shuishen
2022-10-21 9ef1ef592ee9f2ca78481e95334e06b5675cb682
同步
8 files modified
1 files added
134 ■■■■ changed files
public/depend/dc.base.min.js 2 ●●● patch | view | raw | blame | history
public/index.html 5 ●●●● patch | view | raw | blame | history
src/App.vue 7 ●●●● patch | view | raw | blame | history
src/components/leftNav/index.vue 12 ●●●●● patch | view | raw | blame | history
src/components/map/components/dimension.vue 2 ●●●●● patch | view | raw | blame | history
src/main.js 4 ●●●● patch | view | raw | blame | history
src/styles/index.scss 18 ●●●●● patch | view | raw | blame | history
src/utils/devicePixelRatio.js 72 ●●●●● patch | view | raw | blame | history
vue.config.js 12 ●●●● patch | view | raw | blame | history
public/depend/dc.base.min.js
@@ -174,4 +174,4 @@
   *
   * SPDX-License-Identifier: Apache-2.0
   */
var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function i(e){return!0===(e&&e.__isLong__)}function r(e){var t=Math.clz32(e&-e);return e?31-t:t}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(e,t){var n,i,r;return t?(r=0<=(e>>>=0)&&e<256)&&(i=a[e])?i:(n=l(e,0,!0),r&&(a[e]=n),n):(r=-128<=(e|=0)&&e<128)&&(i=o[e])?i:(n=l(e,e<0?-1:0,!1),r&&(o[e]=n),n)}function c(e,t){if(isNaN(e))return t?y:_;if(t){if(e<0)return y;if(e>=p)return A}else{if(e<=-m)return E;if(e+1>=m)return w}return e<0?c(-e,t).neg():l(e%f|0,e/f|0,t)}function l(e,t,i){return new n(e,t,i)}n.fromInt=s,n.fromNumber=c,n.fromBits=l;var u=Math.pow;function h(e,t,n){if(0===e.length)throw Error("empty string");if("number"==typeof t?(n=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?y:_;if((n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return h(e.substring(1),t,n).neg();for(var r=c(u(n,8)),o=_,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),l=parseInt(e.substring(a,a+s),n);if(s<8){var d=c(u(n,s));o=o.mul(d).add(c(l))}else o=(o=o.mul(r)).add(c(l))}return o.unsigned=t,o}function d(e,t){return"number"==typeof e?c(e,t):"string"==typeof e?h(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=h,n.fromValue=d;var f=4294967296,p=f*f,m=p/2,g=s(1<<24),_=s(0);n.ZERO=_;var y=s(0,!0);n.UZERO=y;var b=s(1);n.ONE=b;var v=s(1,!0);n.UONE=v;var O=s(-1);n.NEG_ONE=O;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var A=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=A;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var t=c(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=c(u(e,6),this.unsigned),o=this,a="";;){var s=o.div(r),l=(o.sub(s.mul(r)).toInt()>>>0).toString(e);if((o=s).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?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},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return i(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(i(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&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},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(b)},T.neg=T.negate,T.add=function(e){i(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,c=e.low>>>16,u=0,h=0,f=0,p=0;return f+=(p+=o+(65535&e.low))>>>16,h+=(f+=r+c)>>>16,u+=(h+=n+s)>>>16,u+=t+a,l((f&=65535)<<16|(p&=65535),(u&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return this;if(i(e)||(e=d(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?y:_;if(this.eq(E))return e.isOdd()?E:_;if(e.eq(E))return this.isOdd()?E:_;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(g)&&e.lt(g))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,h=e.low>>>16,f=65535&e.low,p=0,m=0,b=0,v=0;return b+=(v+=a*f)>>>16,m+=(b+=o*f)>>>16,b&=65535,m+=(b+=a*h)>>>16,p+=(m+=r*f)>>>16,m&=65535,p+=(m+=o*h)>>>16,m&=65535,p+=(m+=a*u)>>>16,p+=n*f+r*h+o*u+a*s,l((b&=65535)<<16|(v&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(i(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,r,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return v;o=y}else{if(this.eq(E))return e.eq(b)||e.eq(O)?E:e.eq(E)?b:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?b:O:(r=this.sub(e.mul(n)),o=n.add(r.div(e)));if(e.eq(E))return this.unsigned?y:_;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();o=_}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),s=a<=48?1:u(2,a-48),h=c(n),f=h.mul(e);f.isNegative()||f.gt(r);)f=(h=c(n-=s,this.unsigned)).mul(e);h.isZero()&&(h=b),o=o.add(h),r=r.sub(f)}return o},T.div=T.divide,T.modulo=function(e){return i(e)||(e=d(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},T.clz=T.countLeadingZeros,T.countTrailingZeros=function(){return this.low?r(this.low):r(this.high)+32},T.ctz=T.countTrailingZeros,T.and=function(e){return i(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return i(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return i(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(32===e?this.high:this.high>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.rotateLeft=function(e){var t;return i(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},T.rotl=T.rotateLeft,T.rotateRight=function(e){var t;return i(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},T.rotr=T.rotateRight,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,i){return i?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var C=n;return e.default=C,"default"in e?e.default:e}({});void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)},function(e,t){e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAm
var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function i(e){return!0===(e&&e.__isLong__)}function r(e){var t=Math.clz32(e&-e);return e?31-t:t}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(e,t){var n,i,r;return t?(r=0<=(e>>>=0)&&e<256)&&(i=a[e])?i:(n=l(e,0,!0),r&&(a[e]=n),n):(r=-128<=(e|=0)&&e<128)&&(i=o[e])?i:(n=l(e,e<0?-1:0,!1),r&&(o[e]=n),n)}function c(e,t){if(isNaN(e))return t?y:_;if(t){if(e<0)return y;if(e>=p)return A}else{if(e<=-m)return E;if(e+1>=m)return w}return e<0?c(-e,t).neg():l(e%f|0,e/f|0,t)}function l(e,t,i){return new n(e,t,i)}n.fromInt=s,n.fromNumber=c,n.fromBits=l;var u=Math.pow;function h(e,t,n){if(0===e.length)throw Error("empty string");if("number"==typeof t?(n=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?y:_;if((n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return h(e.substring(1),t,n).neg();for(var r=c(u(n,8)),o=_,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),l=parseInt(e.substring(a,a+s),n);if(s<8){var d=c(u(n,s));o=o.mul(d).add(c(l))}else o=(o=o.mul(r)).add(c(l))}return o.unsigned=t,o}function d(e,t){return"number"==typeof e?c(e,t):"string"==typeof e?h(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=h,n.fromValue=d;var f=4294967296,p=f*f,m=p/2,g=s(1<<24),_=s(0);n.ZERO=_;var y=s(0,!0);n.UZERO=y;var b=s(1);n.ONE=b;var v=s(1,!0);n.UONE=v;var O=s(-1);n.NEG_ONE=O;var w=l(-1,2147483647,!1);n.MAX_VALUE=w;var A=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=A;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var T=n.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var t=c(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=c(u(e,6),this.unsigned),o=this,a="";;){var s=o.div(r),l=(o.sub(s.mul(r)).toInt()>>>0).toString(e);if((o=s).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?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},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return i(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(i(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&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},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(b)},T.neg=T.negate,T.add=function(e){i(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,c=e.low>>>16,u=0,h=0,f=0,p=0;return f+=(p+=o+(65535&e.low))>>>16,h+=(f+=r+c)>>>16,u+=(h+=n+s)>>>16,u+=t+a,l((f&=65535)<<16|(p&=65535),(u&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return this;if(i(e)||(e=d(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return this.unsigned?y:_;if(this.eq(E))return e.isOdd()?E:_;if(e.eq(E))return this.isOdd()?E:_;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(g)&&e.lt(g))return c(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,h=e.low>>>16,f=65535&e.low,p=0,m=0,b=0,v=0;return b+=(v+=a*f)>>>16,m+=(b+=o*f)>>>16,b&=65535,m+=(b+=a*h)>>>16,p+=(m+=r*f)>>>16,m&=65535,p+=(m+=o*h)>>>16,m&=65535,p+=(m+=a*u)>>>16,p+=n*f+r*h+o*u+a*s,l((b&=65535)<<16|(v&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(i(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,r,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return v;o=y}else{if(this.eq(E))return e.eq(b)||e.eq(O)?E:e.eq(E)?b:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?b:O:(r=this.sub(e.mul(n)),o=n.add(r.div(e)));if(e.eq(E))return this.unsigned?y:_;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();o=_}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),s=a<=48?1:u(2,a-48),h=c(n),f=h.mul(e);f.isNegative()||f.gt(r);)f=(h=c(n-=s,this.unsigned)).mul(e);h.isZero()&&(h=b),o=o.add(h),r=r.sub(f)}return o},T.div=T.divide,T.modulo=function(e){return i(e)||(e=d(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return l(~this.low,~this.high,this.unsigned)},T.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},T.clz=T.countLeadingZeros,T.countTrailingZeros=function(){return this.low?r(this.low):r(this.high)+32},T.ctz=T.countTrailingZeros,T.and=function(e){return i(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return i(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return i(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):l(32===e?this.high:this.high>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.rotateLeft=function(e){var t;return i(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),l(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},T.rotl=T.rotateLeft,T.rotateRight=function(e){var t;return i(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?l(this.high,this.low,this.unsigned):e<32?(t=32-e,l(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),l(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},T.rotr=T.rotateRight,T.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,i){return i?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var C=n;return e.default=C,"default"in e?e.default:e}({});void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)},function(e,t){e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}},function(e,t,n){"use strict";var i=n(27),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new i.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function c(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,t.string2buf=function(e){var t,n,r,o,a,s=e.length,c=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new i.Buf8(c),a=0,o=0;a<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},t.buf2binstring=function(e){return c(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},t.buf2string=function(e,t){var n,i,r,o,s=t||e.length,l=new Array(2*s);for(i=0,n=0;n<s;)if((r=e[n++])<128)l[i++]=r;else if((o=a[r])>4)l[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n<s;)r=r<<6|63&e[n++],o--;o>1?l[i++]=65533:r<65536?l[i++]=r:(r-=65536,l[i++]=55296|r>>10&1023,l[i++]=56320|1023&r)}return c(l,i)},t.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},function(e,t,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(e,t,n){"use strict";n.r(t);var i={};n.r(i),n.d(i,"initStream",(function(){return gpe})),n.d(i,"Reader",(function(){return Wfe})),n.d(i,"Writer",(function(){return Yfe})),n.d(i,"TextReader",(function(){return Xfe})),n.d(i,"TextWriter",(function(){return Kfe})),n.d(i,"Data64URIReader",(function(){return Jfe})),n.d(i,"Data64URIWriter",(function(){return Zfe})),n.d(i,"BlobReader",(function(){return $fe})),n.d(i,"BlobWriter",(function(){return Qfe})),n.d(i,"Uint8ArrayReader",(function(){return ppe})),n.d(i,"Uint8ArrayWriter",(function(){return mpe})),n.d(i,"HttpReader",(function(){return dpe})),n.d(i,"HttpRangeReader",(function(){return fpe})),n.d(i,"ERR_HTTP_RANGE",(function(){return Hfe})),n.d(i,"ZipReader",(function(){return Lpe})),n.d(i,"ERR_BAD_FORMAT",(function(){return Epe})),n.d(i,"ERR_EOCDR_NOT_FOUND",(function(){return Tpe})),n.d(i,"ERR_EOCDR_ZIP64_NOT_FOUND",(function(){return Cpe})),n.d(i,"ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND",(function(){return xpe})),n.d(i,"ERR_CENTRAL_DIRECTORY_NOT_FOUND",(function(){return Spe})),n.d(i,"ERR_LOCAL_FILE_HEADER_NOT_FOUND",(function(){return Ipe})),n.d(i,"ERR_EXTRAFIELD_ZIP64_NOT_FOUND",(function(){return Ppe})),n.d(i,"ERR_ENCRYPTED",(function(){return Dpe})),n.d(i,"ERR_UNSUPPORTED_ENCRYPTION",(function(){return Rpe})),n.d(i,"ERR_UNSUPPORTED_COMPRESSION",(function(){return jpe})),n.d(i,"ERR_INVALID_SIGNATURE",(function(){return Ofe})),n.d(i,"ERR_INVALID_PASSWORD",(function(){return zde})),n.d(i,"ZipWriter",(function(){return sme})),n.d(i,"ERR_DUPLICATED_NAME",(function(){return Kpe})),n.d(i,"ERR_INVALID_COMMENT",(function(){return Jpe})),n.d(i,"ERR_INVALID_ENTRY_NAME",(function(){return $pe})),n.d(i,"ERR_INVALID_ENTRY_COMMENT",(function(){return Zpe})),n.d(i,"ERR_INVALID_VERSION",(function(){return Qpe})),n.d(i,"ERR_INVALID_EXTRAFIELD_TYPE",(function(){return tme})),n.d(i,"ERR_INVALID_EXTRAFIELD_DATA",(function(){return nme})),n.d(i,"ERR_INVALID_ENCRYPTION_STRENGTH",(function(){return eme})),n.d(i,"ERR_UNSUPPORTED_FORMAT",(function(){return ime})),n.d(i,"configure",(function(){return Ade})),n.d(i,"getMimeType",(function(){return Tde})),n.d(i,"terminateWorkers",(function(){return Vfe}));var r={};n.r(r),n.d(r,"bbox",(function(){return qme})),n.d(r,"feature",(function(){return Wme})),n.d(r,"mesh",(function(){return Jme})),n.d(r,"meshArcs",(function(){return Zme})),n.d(r,"merge",(function(){return Qme})),n.d(r,"mergeArcs",(function(){return ege})),n.d(r,"neighbors",(function(){return nge})),n.d(r,"quantize",(function(){return rge})),n.d(r,"transform",(function(){return Gme})),n.d(r,"untransform",(function(){return ige}));var o={};n.r(o),n.d(o,"VERSION",(function(){return uqe})),n.d(o,"appendForwardSlash",(function(){return a.a})),n.d(o,"ApproximateTerrainHeights",(function(){return nn})),n.d(o,"ArcGISTiledElevationTerrainProvider",(function(){return bl})),n.d(o,"ArcType",(function(){return vl})),n.d(o,"arrayRemoveDuplicates",(function(){return wl})),n.d(o,"ArticulationStageType",(function(){return Al})),n.d(o,"AssociativeArray",(function(){return Tl})),n.d(o,"AttributeCompression",(function(){return js})),n.d(o,"AxisAlignedBoundingBox",(function(){return pn})),n.d(o,"barycentricCoordinates",(function(){return Il})),n.d(o,"binarySearch",(function(){return Si})),n.d(o,"BingMapsGeocoderService",(function(){return Dl})),n.d(o,"BoundingRectangle",(function(){return Nl})),n.d(o,"BoundingSphere",(function(){return At})),n.d(o,"BoxGeometry",(function(){return uu})),n.d(o,"BoxOutlineGeometry",(function(){return gu})),n.d(o,"buildModuleUrl",(function(){return Lt})),n.d(o,"cancelAnimationFrame",(function(){return yu})),n.d(o,"Cartesian2",(function(){return Vt})),n.d(o,"Cartesian3",(function(){return O})),n.d(o,"Cartesian4",(function(){return _e})),n.d(o,"Cartographic",(function(){return R})),n.d(o,"CartographicGeocoderService",(function(){return vu})),n.d(o,"CatmullRomSpline",(function(){return Uu})),n.d(o,"CesiumTerrainProvider",(function(){return mh})),n.d(o,"Check",(function(){return s.a})),n.d(o,"CircleGeometry",(function(){return Df})),n.d(o,"CircleOutlineGeometry",(function(){return Gf})),n.d(o,"Clock",(function(){return Jf})),n.d(o,"ClockRange",(function(){return qf})),n.d(o,"ClockStep",(function(){return Wf})),n.d(o,"clone",(function(){return Zf.a})),n.d(o,"Color",(function(){return sp})),n.d(o,"ColorGeometryInstanceAttribute",(function(){return lp})),n.d(o,"combine",(function(){return up.a})),n.d(o,"ComponentDatatype",(function(){return gs})),n.d(o,"CompressedTextureBuffer",(function(){return dp})),n.d(o,"ConstantSpline",(function(){return pp})),n.d(o,"CoplanarPolygonGeometry",(function(){return Gm})),n.d(o,"CoplanarPolygonGeometryLibrary",(function(){return wp})),n.d(o,"CoplanarPolygonOutlineGeometry",(function(){return Xm})),n.d(o,"CornerType",(function(){return Km})),n.d(o,"CorridorGeometry",(function(){return ry})),n.d(o,"CorridorGeometryLibrary",(function(){return D_})),n.d(o,"CorridorOutlineGeometry",(function(){return dy})),n.d(o,"createGuid",(function(){return fy})),n.d(o,"createWorldTerrain",(function(){return Oy})),n.d(o,"Credit",(function(){return ln})),n.d(o,"CubicRealPolynomial",(function(){return Fn})),n.d(o,"CullingVolume",(function(){return xy})),n.d(o,"CustomHeightmapTerrainProvider",(function(){return Iy})),n.d(o,"CylinderGeometry",(function(){return Uy})),n.d(o,"CylinderGeometryLibrary",(function(){return Dy})),n.d(o,"CylinderOutlineGeometry",(function(){return qy})),n.d(o,"decodeGoogleEarthEnterpriseData",(function(){return Yy})),n.d(o,"decodeVectorPolylinePositions",(function(){return Jy})),n.d(o,"DefaultProxy",(function(){return $y})),n.d(o,"defaultValue",(function(){return c.a})),n.d(o,"defer",(function(){return oc.a})),n.d(o,"defined",(function(){return l.a})),n.d(o,"deprecationWarning",(function(){return ll})),n.d(o,"destroyObject",(function(){return sc})),n.d(o,"DeveloperError",(function(){return u.a})),n.d(o,"DistanceDisplayCondition",(function(){return eb})),n.d(o,"DistanceDisplayConditionGeometryInstanceAttribute",(function(){return nb})),n.d(o,"DoubleEndedPriorityQueue",(function(){return lb})),n.d(o,"DoublyLinkedList",(function(){return fb})),n.d(o,"EarthOrientationParameters",(function(){return cr})),n.d(o,"EarthOrientationParametersSample",(function(){return Ii})),n.d(o,"EasingFunction",(function(){return _b})),n.d(o,"EllipseGeometry",(function(){return xf})),n.d(o,"EllipseGeometryLibrary",(function(){return Ih})),n.d(o,"EllipseOutlineGeometry",(function(){return kf})),n.d(o,"Ellipsoid",(function(){return H})),n.d(o,"EllipsoidalOccluder",(function(){return Rn})),n.d(o,"EllipsoidGeodesic",(function(){return tg})),n.d(o,"EllipsoidGeometry",(function(){return Rb})),n.d(o,"EllipsoidOutlineGeometry",(function(){return kb})),n.d(o,"EllipsoidRhumbLine",(function(){return Pp})),n.d(o,"EllipsoidTangentPlane",(function(){return ma})),n.d(o,"EllipsoidTerrainProvider",(function(){return Vb})),n.d(o,"EncodedCartesian3",(function(){return Mh})),n.d(o,"Event",(function(){return un.a})),n.d(o,"EventHelper",(function(){return Gb})),n.d(o,"ExperimentalFeatures",(function(){return qb})),n.d(o,"ExtrapolationType",(function(){return Wb})),n.d(o,"FeatureDetection",(function(){return Jr})),n.d(o,"formatError",(function(){return ul})),n.d(o,"FrustumGeometry",(function(){return Rv})),n.d(o,"FrustumOutlineGeometry",(function(){return Fv})),n.d(o,"Fullscreen",(function(){return vr})),n.d(o,"GeocoderService",(function(){return kv})),n.d(o,"GeocodeType",(function(){return Uv})),n.d(o,"GeographicProjection",(function(){return q})),n.d(o,"GeographicTilingScheme",(function(){return Gt})),n.d(o,"Geometry",(function(){return Zl})),n.d(o,"GeometryAttribute",(function(){return $l})),n.d(o,"GeometryAttributes",(function(){return Ql})),n.d(o,"GeometryFactory",(function(){return Hv})),n.d(o,"GeometryInstance",(function(){return Ph})),n.d(o,"GeometryInstanceAttribute",(function(){return Gv})),n.d(o,"GeometryOffsetAttribute",(function(){return eu})),n.d(o,"GeometryPipeline",(function(){return $d})),n.d(o,"GeometryType",(function(){return Bl})),n.d(o,"getAbsoluteUri",(function(){return Et.a})),n.d(o,"getBaseUri",(function(){return qv.a})),n.d(o,"getExtensionFromUri",(function(){return Wv.a})),n.d(o,"getFilenameFromUri",(function(){return Yv})),n.d(o,"getImageFromTypedArray",(function(){return Xv})),n.d(o,"getImagePixels",(function(){return Kv.a})),n.d(o,"getJsonFromTypedArray",(function(){return qu})),n.d(o,"getMagic",(function(){return Jv})),n.d(o,"getStringFromTypedArray",(function(){return Gu})),n.d(o,"getTimestamp",(function(){return Xf})),n.d(o,"GoogleEarthEnterpriseMetadata",(function(){return lO})),n.d(o,"GoogleEarthEnterpriseTerrainData",(function(){return TO})),n.d(o,"GoogleEarthEnterpriseTerrainProvider",(function(){return LO})),n.d(o,"GoogleEarthEnterpriseTileInformation",(function(){return tO})),n.d(o,"GregorianDate",(function(){return Pi})),n.d(o,"GroundPolylineGeometry",(function(){return cA})),n.d(o,"HeadingPitchRange",(function(){return uA})),n.d(o,"HeadingPitchRoll",(function(){return ur})),n.d(o,"Heap",(function(){return hA.a})),n.d(o,"HeightmapEncoding",(function(){return hn})),n.d(o,"HeightmapTerrainData",(function(){return Fc})),n.d(o,"HeightmapTessellator",(function(){return ic})),n.d(o,"HermitePolynomialApproximation",(function(){return gA})),n.d(o,"HermiteSpline",(function(){return Mu})),n.d(o,"HilbertOrder",(function(){return bA})),n.d(o,"Iau2000Orientation",(function(){return SA})),n.d(o,"Iau2006XysData",(function(){return gr})),n.d(o,"Iau2006XysSample",(function(){return hr})),n.d(o,"IauOrientationAxes",(function(){return LA})),n.d(o,"IauOrientationParameters",(function(){return vA})),n.d(o,"IndexDatatype",(function(){return wc})),n.d(o,"InterpolationAlgorithm",(function(){return BA})),n.d(o,"InterpolationType",(function(){return FA})),n.d(o,"Intersect",(function(){return W})),n.d(o,"Intersections2D",(function(){return Yu})),n.d(o,"IntersectionTests",(function(){return vi})),n.d(o,"Interval",(function(){return Y})),n.d(o,"Ion",(function(){return _y})),n.d(o,"IonGeocoderService",(function(){return VA})),n.d(o,"IonResource",(function(){return vy})),n.d(o,"isBitSet",(function(){return $v})),n.d(o,"isBlobUri",(function(){return HA.a})),n.d(o,"isCrossOriginUrl",(function(){return cc.a})),n.d(o,"isDataUri",(function(){return GA.a})),n.d(o,"isLeapYear",(function(){return Di})),n.d(o,"Iso8601",(function(){return JA})),n.d(o,"JulianDate",(function(){return tr})),n.d(o,"KeyboardEventModifier",(function(){return ZA})),n.d(o,"KTX2Transcoder",(function(){return QA})),n.d(o,"LagrangePolynomialApproximation",(function(){return tE})),n.d(o,"LeapSecond",(function(){return Ri})),n.d(o,"LinearApproximation",(function(){return iE})),n.d(o,"LinearSpline",(function(){return Eu})),n.d(o,"loadAndExecuteScript",(function(){return nO.a})),n.d(o,"loadImageFromTypedArray",(function(){return rE})),n.d(o,"loadKTX2",(function(){return sE})),n.d(o,"ManagedArray",(function(){return lE})),n.d(o,"MapProjection",(function(){return hE})),n.d(o,"Math",(function(){return h.a})),n.d(o,"Matrix2",(function(){return Es})),n.d(o,"Matrix3",(function(){return ce})),n.d(o,"Matrix4",(function(){return Me})),n.d(o,"mergeSort",(function(){return mE})),n.d(o,"MorphWeightSpline",(function(){return _E})),n.d(o,"MortonOrder",(function(){return AE})),n.d(o,"NearFarScalar",(function(){return TE})),n.d(o,"objectToQuery",(function(){return CE.a})),n.d(o,"Occluder",(function(){return UE})),n.d(o,"OffsetGeometryInstanceAttribute",(function(){return HE})),n.d(o,"oneTimeWarning",(function(){return cl})),n.d(o,"OpenCageGeocoderService",(function(){return qE})),n.d(o,"OrientedBoundingBox",(function(){return fs})),n.d(o,"OrthographicFrustum",(function(){return nv})),n.d(o,"OrthographicOffCenterFrustum",(function(){return Qb})),n.d(o,"Packable",(function(){return WE})),n.d(o,"PackableForInterpolation",(function(){return YE})),n.d(o,"parseResponseHeaders",(function(){return XE.a})),n.d(o,"PeliasGeocoderService",(function(){return kA})),n.d(o,"PerspectiveFrustum",(function(){return dv})),n.d(o,"PerspectiveOffCenterFrustum",(function(){return lv})),n.d(o,"PinBuilder",(function(){return nT})),n.d(o,"PixelFormat",(function(){return aT})),n.d(o,"Plane",(function(){return xi})),n.d(o,"PlaneGeometry",(function(){return dT})),n.d(o,"PlaneOutlineGeometry",(function(){return gT})),n.d(o,"pointInsideTriangle",(function(){return yT})),n.d(o,"PolygonGeometry",(function(){return $T})),n.d(o,"PolygonGeometryLibrary",(function(){return Em})),n.d(o,"PolygonHierarchy",(function(){return QT})),n.d(o,"PolygonOutlineGeometry",(function(){return sC})),n.d(o,"PolygonPipeline",(function(){return Qp})),n.d(o,"PolylineGeometry",(function(){return yC})),n.d(o,"PolylinePipeline",(function(){return Tg})),n.d(o,"PolylineVolumeGeometry",(function(){return EC})),n.d(o,"PolylineVolumeGeometryLibrary",(function(){return s_})),n.d(o,"PolylineVolumeOutlineGeometry",(function(){return IC})),n.d(o,"PrimitiveType",(function(){return zl})),n.d(o,"Proxy",(function(){return DC})),n.d(o,"QuadraticRealPolynomial",(function(){return Ln})),n.d(o,"QuantizedMeshTerrainData",(function(){return oh})),n.d(o,"QuarticRealPolynomial",(function(){return Vn})),n.d(o,"Quaternion",(function(){return To})),n.d(o,"QuaternionSpline",(function(){return jC})),n.d(o,"queryToObject",(function(){return MC.a})),n.d(o,"Queue",(function(){return tm})),n.d(o,"Ray",(function(){return Gn})),n.d(o,"Rectangle",(function(){return Be})),n.d(o,"RectangleCollisionChecker",(function(){return VC})),n.d(o,"RectangleGeometry",(function(){return Dx})),n.d(o,"RectangleGeometryLibrary",(function(){return QC})),n.d(o,"RectangleOutlineGeometry",(function(){return Vx})),n.d(o,"ReferenceFrame",(function(){return Hx})),n.d(o,"Request",(function(){return zc.a})),n.d(o,"requestAnimationFrame",(function(){return qx})),n.d(o,"RequestErrorEvent",(function(){return Wx.a})),n.d(o,"RequestScheduler",(function(){return Yx.a})),n.d(o,"RequestState",(function(){return kc.a})),n.d(o,"RequestType",(function(){return Uc.a})),n.d(o,"resizeImageToNextPowerOfTwo",(function(){return Xx})),n.d(o,"Resource",(function(){return Tt.a})),n.d(o,"RuntimeError",(function(){return ye.a})),n.d(o,"S2Cell",(function(){return cS})),n.d(o,"sampleTerrain",(function(){return uS})),n.d(o,"sampleTerrainMostDetailed",(function(){return dS})),n.d(o,"scaleToGeodeticSurface",(function(){return E})),n.d(o,"ScreenSpaceEventHandler",(function(){return ZS})),n.d(o,"ScreenSpaceEventType",(function(){return fS})),n.d(o,"ShowGeometryInstanceAttribute",(function(){return QS})),n.d(o,"Simon1994PlanetaryPositions",(function(){return pI})),n.d(o,"SimplePolylineGeometry",(function(){return vI})),n.d(o,"SphereGeometry",(function(){return EI})),n.d(o,"SphereOutlineGeometry",(function(){return SI})),n.d(o,"Spherical",(function(){return PI})),n.d(o,"Spline",(function(){return wu})),n.d(o,"SteppedSpline",(function(){return RI})),n.d(o,"subdivideArray",(function(){return jI})),n.d(o,"TaskProcessor",(function(){return _c})),n.d(o,"TerrainData",(function(){return bc})),n.d(o,"TerrainEncoding",(function(){return Ks})),n.d(o,"TerrainExaggeration",(function(){return Ns})),n.d(o,"TerrainMesh",(function(){return vc})),n.d(o,"TerrainProvider",(function(){return Pc})),n.d(o,"TerrainQuantization",(function(){return Bs})),n.d(o,"TileAvailability",(function(){return ol})),n.d(o,"TileEdge",(function(){return MI})),n.d(o,"TileProviderError",(function(){return dl})),n.d(o,"TilingScheme",(function(){return NI})),n.d(o,"TimeConstants",(function(){return ji})),n.d(o,"TimeInterval",(function(){return YA})),n.d(o,"TimeIntervalCollection",(function(){return YI})),n.d(o,"TimeStandard",(function(){return Mi})),n.d(o,"Tipsify",(function(){return Nh})),n.d(o,"Transforms",(function(){return ca})),n.d(o,"TranslationRotationScale",(function(){return $I})),n.d(o,"TridiagonalSystemSolver",(function(){return Cu})),n.d(o,"TrustedServers",(function(){return QI.a})),n.d(o,"VertexFormat",(function(){return nu})),n.d(o,"VideoSynchronizer",(function(){return tP})),n.d(o,"Visibility",(function(){return xE})),n.d(o,"VRTheWorldTerrainProvider",(function(){return sP})),n.d(o,"VulkanConstants",(function(){return cP})),n.d(o,"WallGeometry",(function(){return SP})),n.d(o,"WallGeometryLibrary",(function(){return gP})),n.d(o,"WallOutlineGeometry",(function(){return MP})),n.d(o,"WebGLConstants",(function(){return ps})),n.d(o,"webGLConstantToGlslType",(function(){return LP})),n.d(o,"WebMercatorProjection",(function(){return Zs})),n.d(o,"WebMercatorTilingScheme",(function(){return pl})),n.d(o,"WindingOrder",(function(){return Mp})),n.d(o,"WireframeIndexGenerator",(function(){return BP})),n.d(o,"wrapFunction",(function(){return FP})),n.d(o,"writeTextToCanvas",(function(){return JE})),n.d(o,"BillboardGraphics",(function(){return GP})),n.d(o,"BillboardVisualizer",(function(){return gD})),n.d(o,"BoundingSphereState",(function(){return XP})),n.d(o,"BoxGeometryUpdater",(function(){return yU})),n.d(o,"BoxGraphics",(function(){return Yz})),n.d(o,"CallbackProperty",(function(){return oU})),n.d(o,"Cesium3DTilesetGraphics",(function(){return Ok})),n.d(o,"Cesium3DTilesetVisualizer",(function(){return Jie})),n.d(o,"CheckerboardMaterialProperty",(function(){return tre})),n.d(o,"ColorMaterialProperty",(function(){return NR})),n.d(o,"CompositeEntityCollection",(function(){return mre})),n.d(o,"CompositeMaterialProperty",(function(){return bre})),n.d(o,"CompositePositionProperty",(function(){return Ore})),n.d(o,"CompositeProperty",(function(){return _re})),n.d(o,"ConstantPositionProperty",(function(){return $z})),n.d(o,"ConstantProperty",(function(){return kP})),n.d(o,"CorridorGeometryUpdater",(function(){return Rre})),n.d(o,"CorridorGraphics",(function(){return ek})),n.d(o,"createMaterialPropertyDescriptor",(function(){return qz})),n.d(o,"createPropertyDescriptor",(function(){return VP})),n.d(o,"createRawPropertyDescriptor",(function(){return nk})),n.d(o,"CustomDataSource",(function(){return Xoe})),n.d(o,"CylinderGeometryUpdater",(function(){return nae})),n.d(o,"CylinderGraphics",(function(){return rk})),n.d(o,"CzmlDataSource",(function(){return tce})),n.d(o,"DataSource",(function(){return Mre})),n.d(o,"DataSourceClock",(function(){return rae})),n.d(o,"DataSourceCollection",(function(){return oce})),n.d(o,"DataSourceDisplay",(function(){return tde})),n.d(o,"DynamicGeometryBatch",(function(){return dce})),n.d(o,"DynamicGeometryUpdater",(function(){return bz})),n.d(o,"EllipseGeometryUpdater",(function(){return vce})),n.d(o,"EllipseGraphics",(function(){return ak})),n.d(o,"EllipsoidGeometryUpdater",(function(){return Dce})),n.d(o,"EllipsoidGraphics",(function(){return ck})),n.d(o,"Entity",(function(){return Yk})),n.d(o,"EntityCluster",(function(){return Woe})),n.d(o,"EntityCollection",(function(){return ore})),n.d(o,"EntityView",(function(){return gde})),n.d(o,"exportKml",(function(){return Vme})),n.d(o,"GeoJsonDataSource",(function(){return Fge})),n.d(o,"GeometryUpdater",(function(){return iU})),n.d(o,"GeometryVisualizer",(function(){return pue})),n.d(o,"GpxDataSource",(function(){return pye})),n.d(o,"GridMaterialProperty",(function(){return uae})),n.d(o,"GroundGeometryUpdater",(function(){return Ere})),n.d(o,"heightReferenceOnEntityPropertyChanged",(function(){return uU})),n.d(o,"ImageMaterialProperty",(function(){return Hz})),n.d(o,"KmlCamera",(function(){return mye})),n.d(o,"KmlDataSource",(function(){return Vbe})),n.d(o,"KmlLookAt",(function(){return _ye})),n.d(o,"KmlTour",(function(){return wye})),n.d(o,"KmlTourFlyTo",(function(){return Eye})),n.d(o,"KmlTourWait",(function(){return Cye})),n.d(o,"LabelGraphics",(function(){return uk})),n.d(o,"LabelVisualizer",(function(){return zue})),n.d(o,"MaterialProperty",(function(){return _z})),n.d(o,"ModelGraphics",(function(){return bk})),n.d(o,"ModelVisualizer",(function(){return Que})),n.d(o,"NodeTransformationProperty",(function(){return fk})),n.d(o,"PathGraphics",(function(){return Ak})),n.d(o,"PathVisualizer",(function(){return hhe})),n.d(o,"PlaneGeometryUpdater",(function(){return qce})),n.d(o,"PlaneGraphics",(function(){return Tk})),n.d(o,"PointGraphics",(function(){return xk})),n.d(o,"PointVisualizer",(function(){return Ahe})),n.d(o,"PolygonGeometryUpdater",(function(){return tle})),n.d(o,"PolygonGraphics",(function(){return Ik})),n.d(o,"PolylineArrowMaterialProperty",(function(){return dae})),n.d(o,"PolylineDashMaterialProperty",(function(){return gae})),n.d(o,"PolylineGeometryUpdater",(function(){return Fhe})),n.d(o,"PolylineGlowMaterialProperty",(function(){return bae})),n.d(o,"PolylineGraphics",(function(){return Dk})),n.d(o,"PolylineOutlineMaterialProperty",(function(){return Aae})),n.d(o,"PolylineVisualizer",(function(){return Zhe})),n.d(o,"PolylineVolumeGeometryUpdater",(function(){return ale})),n.d(o,"PolylineVolumeGraphics",(function(){return jk})),n.d(o,"PositionProperty",(function(){return Jz})),n.d(o,"PositionPropertyArray",(function(){return Tae})),n.d(o,"Property",(function(){return JP})),n.d(o,"PropertyArray",(function(){return xae})),n.d(o,"PropertyBag",(function(){return gk})),n.d(o,"RectangleGeometryUpdater",(function(){return gle})),n.d(o,"RectangleGraphics",(function(){return Lk})),n.d(o,"ReferenceProperty",(function(){return Pae})),n.d(o,"Rotation",(function(){return Dae})),n.d(o,"SampledPositionProperty",(function(){return Vae})),n.d(o,"SampledProperty",(function(){return kae})),n.d(o,"ScaledPositionProperty",(function(){return the})),n.d(o,"StaticGeometryColorBatch",(function(){return Ile})),n.d(o,"StaticGeometryPerMaterialBatch",(function(){return Ble})),n.d(o,"StaticGroundGeometryColorBatch",(function(){return Hle})),n.d(o,"StaticGroundGeometryPerMaterialBatch",(function(){return Xle})),n.d(o,"StaticGroundPolylinePerMaterialBatch",(function(){return Ghe})),n.d(o,"StaticOutlineGeometryBatch",(function(){return nue})),n.d(o,"StripeMaterialProperty",(function(){return Xae})),n.d(o,"StripeOrientation",(function(){return Hae})),n.d(o,"TerrainOffsetProperty",(function(){return lU})),n.d(o,"TimeIntervalCollectionPositionProperty",(function(){return Jae})),n.d(o,"TimeIntervalCollectionProperty",(function(){return $ae})),n.d(o,"VelocityOrientationProperty",(function(){return cse})),n.d(o,"VelocityVectorProperty",(function(){return ise})),n.d(o,"Visualizer",(function(){return Gbe})),n.d(o,"WallGeometryUpdater",(function(){return sue})),n.d(o,"WallGraphics",(function(){return Bk})),n.d(o,"AutomaticUniforms",(function(){return Ej})),n.d(o,"Buffer",(function(){return ZN})),n.d(o,"BufferUsage",(function(){return KN})),n.d(o,"ClearCommand",(function(){return UU})),n.d(o,"ComputeCommand",(function(){return vU})),n.d(o,"ComputeEngine",(function(){return Jbe})),n.d(o,"Context",(function(){return jve})),n.d(o,"ContextLimits",(function(){return MD})),n.d(o,"createUniform",(function(){return kj})),n.d(o,"createUniformArray",(function(){return Qj})),n.d(o,"CubeMap",(function(){return XD})),n.d(o,"CubeMapFace",(function(){return ND})),n.d(o,"DrawCommand",(function(){return XR})),n.d(o,"Framebuffer",(function(){return i$})),n.d(o,"FramebufferManager",(function(){return h$})),n.d(o,"freezeRenderState",(function(){return JR})),n.d(o,"loadCubeMap",(function(){return Mve})),n.d(o,"MipmapHint",(function(){return FD})),n.d(o,"modernizeShader",(function(){return lM})),n.d(o,"MultisampleFramebuffer",(function(){return o$})),n.d(o,"Pass",(function(){return KR})),n.d(o,"PassState",(function(){return Zbe})),n.d(o,"PixelDatatype",(function(){return rT})),n.d(o,"Renderbuffer",(function(){return l$})),n.d(o,"RenderbufferFormat",(function(){return s$})),n.d(o,"RenderState",(function(){return vj})),n.d(o,"Sampler",(function(){return WD})),n.d(o,"ShaderBuilder",(function(){return S9})),n.d(o,"ShaderCache",(function(){return eve})),n.d(o,"ShaderDestination",(function(){return S5})),n.d(o,"ShaderFunction",(function(){return x9})),n.d(o,"ShaderProgram",(function(){return oM})),n.d(o,"ShaderSource",(function(){return UN})),n.d(o,"ShaderStruct",(function(){return C9})),n.d(o,"Texture",(function(){return JD})),n.d(o,"TextureCache",(function(){return nve})),n.d(o,"TextureMagnificationFilter",(function(){return kD})),n.d(o,"TextureMinificationFilter",(function(){return VD})),n.d(o,"TextureWrap",(function(){return GD})),n.d(o,"UniformState",(function(){return Ove})),n.d(o,"VertexArray",(function(){return iB})),n.d(o,"VertexArrayFacade",(function(){return L$})),n.d(o,"AlphaMode",(function(){return LK})),n.d(o,"Appearance",(function(){return RD})),n.d(o,"ArcGisMapServerImageryProvider",(function(){return Gve})),n.d(o,"AttributeType",(function(){return Cs})),n.d(o,"AutoExposure",(function(){return Jve})),n.d(o,"Axis",(function(){return HU})),n.d(o,"B3dmParser",(function(){return YU})),n.d(o,"Batched3DModel3DTileContent",(function(){return xX})),n.d(o,"BatchTable",(function(){return hB})),n.d(o,"BatchTableHierarchy",(function(){return rV})),n.d(o,"BatchTexture",(function(){return XU})),n.d(o,"Billboard",(function(){return SQ})),n.d(o,"BillboardCollection",(function(){return x0})),n.d(o,"BingMapsImageryProvider",(function(){return rOe})),n.d(o,"BingMapsStyle",(function(){return Zve})),n.d(o,"BlendEquation",(function(){return ED})),n.d(o,"BlendFunction",(function(){return CD})),n.d(o,"BlendingState",(function(){return SD})),n.d(o,"BlendOption",(function(){return IQ})),n.d(o,"BoxEmitter",(function(){return cOe})),n.d(o,"BrdfLutGenerator",(function(){return hOe})),n.d(o,"BufferLoader",(function(){return yK})),n.d(o,"Camera",(function(){return LAe})),n.d(o,"CameraEventAggregator",(function(){return GAe})),n.d(o,"CameraEventType",(function(){return NAe})),n.d(o,"CameraFlightPath",(function(){return SOe})),n.d(o,"Cesium3DContentGroup",(function(){return GU})),n.d(o,"Cesium3DTile",(function(){return eie})),n.d(o,"Cesium3DTileBatchTable",(function(){return DV})),n.d(o,"Cesium3DTileColorBlendMode",(function(){return fV})),n.d(o,"Cesium3DTileContent",(function(){return WAe})),n.d(o,"Cesium3DTileContentFactory",(function(){return yee})),n.d(o,"Cesium3DTileContentState",(function(){return bee})),n.d(o,"Cesium3DTileContentType",(function(){return Oee})),n.d(o,"Cesium3DTileFeature",(function(){return jV})),n.d(o,"Cesium3DTileFeatureTable",(function(){return NV})),n.d(o,"Cesium3DTileOptimizationHint",(function(){return wee})),n.d(o,"Cesium3DTileOptimizations",(function(){return lie})),n.d(o,"Cesium3DTilePass",(function(){return ute})),n.d(o,"Cesium3DTilePassState",(function(){return YAe})),n.d(o,"Cesium3DTilePointFeature",(function(){return R0})),n.d(o,"Cesium3DTileRefine",(function(){return wZ})),n.d(o,"Cesium3DTileset",(function(){return qie})),n.d(o,"Cesium3DTilesetCache",(function(){return hie})),n.d(o,"Cesium3DTilesetHeatmap",(function(){return mie})),n.d(o,"Cesium3DTilesetMetadata",(function(){return aie})),n.d(o,"Cesium3DTilesetMostDetailedTraversal",(function(){return jee})),n.d(o,"Cesium3DTilesetStatistics",(function(){return yie})),n.d(o,"Cesium3DTilesetTraversal",(function(){return ste})),n.d(o,"Cesium3DTileStyle",(function(){return tEe})),n.d(o,"Cesium3DTileStyleEngine",(function(){return vie})),n.d(o,"CircleEmitter",(function(){return iEe})),n.d(o,"ClassificationModel",(function(){return Oq})),n.d(o,"ClassificationPrimitive",(function(){return tz})),n.d(o,"ClassificationType",(function(){return qN})),n.d(o,"ClippingPlane",(function(){return Eq})),n.d(o,"ClippingPlaneCollection",(function(){return Fq})),n.d(o,"CloudCollection",(function(){return ZEe})),n.d(o,"CloudType",(function(){return oEe})),n.d(o,"ColorBlendMode",(function(){return kq})),n.d(o,"Composite3DTileContent",(function(){return PX})),n.d(o,"computeFlyToLocationForRectangle",(function(){return QEe})),n.d(o,"ConditionsExpression",(function(){return JAe})),n.d(o,"ConeEmitter",(function(){return nTe})),n.d(o,"ContentMetadata",(function(){return fte})),n.d(o,"createBillboardPointCallback",(function(){return S0})),n.d(o,"createElevationBandMaterial",(function(){return pTe})),n.d(o,"createOsmBuildings",(function(){return mTe})),n.d(o,"createTangentSpaceDebugPrimitive",(function(){return gTe})),n.d(o,"createWorldImagery",(function(){return ECe})),n.d(o,"CreditDisplay",(function(){return MCe})),n.d(o,"CullFace",(function(){return PD})),n.d(o,"CumulusCloud",(function(){return bEe})),n.d(o,"DebugAppearance",(function(){return NCe})),n.d(o,"DebugCameraPrimitive",(function(){return YCe})),n.d(o,"DebugInspector",(function(){return ZCe})),n.d(o,"DebugModelMatrixPrimitive",(function(){return QCe})),n.d(o,"DepthFunction",(function(){return YN})),n.d(o,"DepthPlane",(function(){return lxe})),n.d(o,"DerivedCommand",(function(){return gxe})),n.d(o,"DeviceOrientationCameraController",(function(){return Oxe})),n.d(o,"DirectionalLight",(function(){return wxe})),n.d(o,"DiscardEmptyTileImagePolicy",(function(){return eOe})),n.d(o,"DiscardMissingTileImagePolicy",(function(){return Nve})),n.d(o,"DracoLoader",(function(){return qq})),n.d(o,"EllipsoidPrimitive",(function(){return Sxe})),n.d(o,"EllipsoidSurfaceAppearance",(function(){return Rxe})),n.d(o,"Empty3DTileContent",(function(){return dte})),n.d(o,"Expression",(function(){return WG})),n.d(o,"ExpressionNodeType",(function(){return gG})),n.d(o,"findContentMetadata",(function(){return mte})),n.d(o,"findGroupMetadata",(function(){return gte})),n.d(o,"findTileMetadata",(function(){return bte})),n.d(o,"Fog",(function(){return kxe})),n.d(o,"FrameRateMonitor",(function(){return Vxe})),n.d(o,"FrameState",(function(){return Hxe})),n.d(o,"FrustumCommands",(function(){return Gxe})),n.d(o,"Geometry3DTileContent",(function(){return FX})),n.d(o,"getBinaryAccessor",(function(){return iV})),n.d(o,"getClipAndStyleCode",(function(){return Wq})),n.d(o,"getClippingFunction",(function(){return Xq})),n.d(o,"GetFeatureInfoFormat",(function(){return iCe})),n.d(o,"Globe",(function(){return UPe})),n.d(o,"GlobeDepth",(function(){return WPe})),n.d(o,"GlobeSurfaceShaderSet",(function(){return Zxe})),n.d(o,"GlobeSurfaceTile",(function(){return lSe})),n.d(o,"GlobeSurfaceTileProvider",(function(){return YIe})),n.d(o,"GlobeTranslucency",(function(){return KIe})),n.d(o,"GlobeTranslucencyFramebuffer",(function(){return XPe})),n.d(o,"GlobeTranslucencyState",(function(){return VDe})),n.d(o,"GltfBufferViewLoader",(function(){return vK})),n.d(o,"GltfDracoLoader",(function(){return OK})),n.d(o,"GltfImageLoader",(function(){return wK})),n.d(o,"GltfIndexBufferLoader",(function(){return CK})),n.d(o,"GltfJsonLoader",(function(){return RK})),n.d(o,"GltfLoader",(function(){return v4})),n.d(o,"GltfLoaderUtil",(function(){return GK})),n.d(o,"GltfStructuralMetadataLoader",(function(){return E3})),n.d(o,"GltfTextureLoader",(function(){return qK})),n.d(o,"GltfVertexBufferLoader",(function(){return KK})),n.d(o,"GoogleEarthEnterpriseImageryProvider",(function(){return qDe})),n.d(o,"GoogleEarthEnterpriseMapsProvider",(function(){return VTe})),n.d(o,"GridImageryProvider",(function(){return JDe})),n.d(o,"GroundPolylinePrimitive",(function(){return zz})),n.d(o,"GroundPrimitive",(function(){return mz})),n.d(o,"GroupMetadata",(function(){return nie})),n.d(o,"hasExtension",(function(){return zX})),n.d(o,"HeightReference",(function(){return qP})),n.d(o,"HorizontalOrigin",(function(){return WP})),n.d(o,"I3dmParser",(function(){return KJ})),n.d(o,"ImageBasedLighting",(function(){return zU})),n.d(o,"Imagery",(function(){return fSe})),n.d(o,"ImageryLayer",(function(){return TSe})),n.d(o,"ImageryLayerCollection",(function(){return tPe})),n.d(o,"ImageryLayerFeatureInfo",(function(){return Fve})),n.d(o,"ImageryProvider",(function(){return Uve})),n.d(o,"ImageryState",(function(){return $xe})),n.d(o,"Implicit3DTileContent",(function(){return PJ})),n.d(o,"ImplicitAvailabilityBitstream",(function(){return kX})),n.d(o,"ImplicitMetadataView",(function(){return UX})),n.d(o,"ImplicitSubdivisionScheme",(function(){return HX})),n.d(o,"ImplicitSubtree",(function(){return vJ})),n.d(o,"ImplicitSubtreeMetadata",(function(){return YX})),n.d(o,"ImplicitTileCoordinates",(function(){return wie})),n.d(o,"ImplicitTileset",(function(){return Oie})),n.d(o,"InstanceAttributeSemantic",(function(){return D3})),n.d(o,"Instanced3DModel3DTileContent",(function(){return OZ})),n.d(o,"InvertClassification",(function(){return tRe})),n.d(o,"IonImageryProvider",(function(){return wCe})),n.d(o,"IonWorldImageryStyle",(function(){return ACe})),n.d(o,"JobScheduler",(function(){return rRe})),n.d(o,"JobType",(function(){return Kq})),n.d(o,"JsonMetadataTable",(function(){return t7})),n.d(o,"Label",(function(){return J0})),n.d(o,"LabelCollection",(function(){return m1})),n.d(o,"LabelStyle",(function(){return L0})),n.d(o,"Light",(function(){return aRe})),n.d(o,"MapboxImageryProvider",(function(){return WTe})),n.d(o,"MapboxStyleImageryProvider",(function(){return uRe})),n.d(o,"MapMode2D",(function(){return IOe})),n.d(o,"Material",(function(){return CR})),n.d(o,"MaterialAppearance",(function(){return SR})),n.d(o,"MetadataClass",(function(){return QK})),n.d(o,"MetadataClassProperty",(function(){return oK})),n.d(o,"MetadataComponentType",(function(){return KX})),n.d(o,"MetadataEntity",(function(){return qX})),n.d(o,"MetadataEnum",(function(){return iJ})),n.d(o,"MetadataEnumValue",(function(){return tJ})),n.d(o,"MetadataSchema",(function(){return oJ})),n.d(o,"MetadataSchemaLoader",(function(){return aJ})),n.d(o,"MetadataSemantic",(function(){return TJ})),n.d(o,"MetadataTable",(function(){return mK})),n.d(o,"MetadataTableProperty",(function(){return fK})),n.d(o,"MetadataType",(function(){return ZX})),n.d(o,"Model",(function(){return OX})),n.d(o,"ModelAnimation",(function(){return sW})),n.d(o,"ModelAnimationCache",(function(){return iW})),n.d(o,"ModelAnimationCollection",(function(){return fW})),n.d(o,"ModelAnimationLoop",(function(){return rW})),n.d(o,"ModelAnimationState",(function(){return oW})),n.d(o,"ModelComponents",(function(){return UK})),n.d(o,"ModelInstance",(function(){return ZJ})),n.d(o,"ModelInstanceCollection",(function(){return gZ})),n.d(o,"ModelLoadResources",(function(){return RH})),n.d(o,"ModelMaterial",(function(){return mW})),n.d(o,"ModelMesh",(function(){return _W})),n.d(o,"ModelNode",(function(){return bW})),n.d(o,"ModelOutlineLoader",(function(){return SW})),n.d(o,"ModelUtility",(function(){return nG})),n.d(o,"Moon",(function(){return gRe})),n.d(o,"Multiple3DTileContent",(function(){return Ote})),n.d(o,"NeverTileDiscardPolicy",(function(){return yRe})),n.d(o,"OctahedralProjectedCubeMap",(function(){return FU})),n.d(o,"OIT",(function(){return PRe})),n.d(o,"OpenStreetMapImageryProvider",(function(){return jRe})),n.d(o,"OrderedGroundPrimitiveCollection",(function(){return uce})),n.d(o,"parseBatchTable",(function(){return n7})),n.d(o,"parseBoundingVolumeSemantics",(function(){return CJ})),n.d(o,"parseFeatureMetadataLegacy",(function(){return O3})),n.d(o,"parseStructuralMetadata",(function(){return v3})),n.d(o,"Particle",(function(){return BRe})),n.d(o,"ParticleBurst",(function(){return zRe})),n.d(o,"ParticleEmitter",(function(){return URe})),n.d(o,"ParticleSystem",(function(){return JRe})),n.d(o,"PerformanceDisplay",(function(){return $Re})),n.d(o,"PerInstanceColorAppearance",(function(){return MR})),n.d(o,"PickDepth",(function(){return nje})),n.d(o,"PickDepthFramebuffer",(function(){return rje})),n.d(o,"PickFramebuffer",(function(){return sje})),n.d(o,"Picking",(function(){return nLe})),n.d(o,"PntsParser",(function(){return SZ})),n.d(o,"PointCloud",(function(){return QZ})),n.d(o,"PointCloud3DTileContent",(function(){return x$})),n.d(o,"PointCloudEyeDomeLighting",(function(){return y$})),n.d(o,"PointCloudShading",(function(){return v$})),n.d(o,"PointPrimitive",(function(){return Kre})),n.d(o,"PointPrimitiveCollection",(function(){return woe})),n.d(o,"Polyline",(function(){return C1})),n.d(o,"PolylineCollection",(function(){return m2})),n.d(o,"PolylineColorAppearance",(function(){return Iz})),n.d(o,"PolylineMaterialAppearance",(function(){return Lz})),n.d(o,"PostProcessStage",(function(){return dLe})),n.d(o,"PostProcessStageCollection",(function(){return QLe})),n.d(o,"PostProcessStageComposite",(function(){return jLe})),n.d(o,"PostProcessStageLibrary",(function(){return BLe})),n.d(o,"PostProcessStageSampleMode",(function(){return iLe})),n.d(o,"PostProcessStageTextureCache",(function(){return qLe})),n.d(o,"preprocess3DTileContent",(function(){return vte})),n.d(o,"Primitive",(function(){return hF})),n.d(o,"PrimitiveCollection",(function(){return cce})),n.d(o,"PrimitiveLoadPlan",(function(){return k3})),n.d(o,"PrimitivePipeline",(function(){return vB})),n.d(o,"PrimitiveState",(function(){return OB})),n.d(o,"processModelMaterialsCommon",(function(){return rG})),n.d(o,"processPbrMaterials",(function(){return hG})),n.d(o,"PropertyAttribute",(function(){return _3})),n.d(o,"PropertyAttributeProperty",(function(){return g3})),n.d(o,"PropertyTable",(function(){return c3})),n.d(o,"PropertyTexture",(function(){return m3})),n.d(o,"PropertyTextureProperty",(function(){return f3})),n.d(o,"QuadtreeOccluders",(function(){return iPe})),n.d(o,"QuadtreePrimitive",(function(){return PPe})),n.d(o,"QuadtreeTile",(function(){return aPe})),n.d(o,"QuadtreeTileLoadState",(function(){return Qxe})),n.d(o,"QuadtreeTileProvider",(function(){return tNe})),n.d(o,"ResourceCache",(function(){return bJ})),n.d(o,"ResourceCacheKey",(function(){return mJ})),n.d(o,"ResourceCacheStatistics",(function(){return gJ})),n.d(o,"ResourceLoader",(function(){return gK})),n.d(o,"ResourceLoaderState",(function(){return _K})),n.d(o,"Scene",(function(){return Lke})),n.d(o,"SceneFramebuffer",(function(){return lje})),n.d(o,"SceneMode",(function(){return AB})),n.d(o,"SceneTransforms",(function(){return iQ})),n.d(o,"SceneTransitioner",(function(){return sBe})),n.d(o,"ScreenSpaceCameraController",(function(){return jze})),n.d(o,"SDFSettings",(function(){return PQ})),n.d(o,"ShadowMap",(function(){return Jje})),n.d(o,"ShadowMapShader",(function(){return hje})),n.d(o,"ShadowMode",(function(){return TB})),n.d(o,"ShadowVolumeAppearance",(function(){return zF})),n.d(o,"SingleTileImageryProvider",(function(){return XTe})),n.d(o,"SkyAtmosphere",(function(){return Uke})),n.d(o,"SkyBox",(function(){return qke})),n.d(o,"SphereEmitter",(function(){return Yke})),n.d(o,"SplitDirection",(function(){return IW})),n.d(o,"Splitter",(function(){return PW})),n.d(o,"StencilConstants",(function(){return qF})),n.d(o,"StencilFunction",(function(){return UF})),n.d(o,"StencilOperation",(function(){return HF})),n.d(o,"StructuralMetadata",(function(){return b3})),n.d(o,"StyleExpression",(function(){return Kke})),n.d(o,"Sun",(function(){return rUe})),n.d(o,"SunLight",(function(){return ive})),n.d(o,"SunPostProcess",(function(){return Uze})),n.d(o,"SupportedImageFormats",(function(){return U3})),n.d(o,"TerrainFillMesh",(function(){return hIe})),n.d(o,"TerrainState",(function(){return eSe})),n.d(o,"TextureAtlas",(function(){return NQ})),n.d(o,"TileBoundingRegion",(function(){return Ute})),n.d(o,"TileBoundingS2Cell",(function(){return wne})),n.d(o,"TileBoundingSphere",(function(){return Ene})),n.d(o,"TileBoundingVolume",(function(){return aUe})),n.d(o,"TileCoordinatesImageryProvider",(function(){return cUe})),n.d(o,"TileDiscardPolicy",(function(){return uUe})),n.d(o,"TileImagery",(function(){return mSe})),n.d(o,"TileMapServiceImageryProvider",(function(){return kTe})),n.d(o,"TileMetadata",(function(){return _te})),n.d(o,"TileOrientedBoundingBox",(function(){return jne})),n.d(o,"TileReplacementQueue",(function(){return lPe})),n.d(o,"TileSelectionResult",(function(){return xSe})),n.d(o,"Tileset3DTileContent",(function(){return I$})),n.d(o,"TilesetMetadata",(function(){return rie})),n.d(o,"TileState",(function(){return hUe})),n.d(o,"TimeDynamicImagery",(function(){return cCe})),n.d(o,"TimeDynamicPointCloud",(function(){return xUe})),n.d(o,"Tonemapper",(function(){return YLe})),n.d(o,"TranslucentTileClassification",(function(){return iMe})),n.d(o,"TweenCollection",(function(){return uBe})),n.d(o,"UrlTemplateImageryProvider",(function(){return NTe})),n.d(o,"Vector3DTileBatch",(function(){return dG})),n.d(o,"Vector3DTileClampedPolylines",(function(){return $2})),n.d(o,"Vector3DTileContent",(function(){return r3})),n.d(o,"Vector3DTileGeometry",(function(){return MX})),n.d(o,"Vector3DTilePoints",(function(){return S2})),n.d(o,"Vector3DTilePolygons",(function(){return R2})),n.d(o,"Vector3DTilePolylines",(function(){return U2})),n.d(o,"Vector3DTilePrimitive",(function(){return cq})),n.d(o,"VertexAttributeSemantic",(function(){return TZ})),n.d(o,"VerticalOrigin",(function(){return YP})),n.d(o,"View",(function(){return dMe})),n.d(o,"ViewportQuad",(function(){return PUe})),n.d(o,"WebMapServiceImageryProvider",(function(){return pCe})),n.d(o,"WebMapTileServiceImageryProvider",(function(){return yCe})),n.d(o,"_shadersAdjustTranslucentFS",(function(){return bRe})),n.d(o,"_shadersAtmosphereCommon",(function(){return Yxe})),n.d(o,"_shadersBillboardCollectionFS",(function(){return N$})),n.d(o,"_shadersBillboardCollectionVS",(function(){return B$})),n.d(o,"_shadersBrdfLutGeneratorFS",(function(){return lOe})),n.d(o,"_shadersCloudCollectionFS",(function(){return aEe})),n.d(o,"_shadersCloudCollectionVS",(function(){return sEe})),n.d(o,"_shadersCloudNoiseFS",(function(){return cEe})),n.d(o,"_shadersCloudNoiseVS",(function(){return lEe})),n.d(o,"_shadersCompareAndPackTranslucentDepth",(function(){return Zje})),n.d(o,"_shadersCompositeOITFS",(function(){return vRe})),n.d(o,"_shadersDepthPlaneFS",(function(){return exe})),n.d(o,"_shadersDepthPlaneVS",(function(){return txe})),n.d(o,"_shadersEllipsoidFS",(function(){return Axe})),n.d(o,"_shadersEllipsoidVS",(function(){return Exe})),n.d(o,"_shadersFXAA3_11",(function(){return DLe})),n.d(o,"_shadersGlobeFS",(function(){return qxe})),n.d(o,"_shadersGlobeVS",(function(){return Wxe})),n.d(o,"_shadersGroundAtmosphere",(function(){return Xxe})),n.d(o,"_shadersOctahedralProjectionAtlasFS",(function(){return OU})),n.d(o,"_shadersOctahedralProjectionFS",(function(){return wU})),n.d(o,"_shadersOctahedralProjectionVS",(function(){return AU})),n.d(o,"_shadersPointPrimitiveCollectionFS",(function(){return Jre})),n.d(o,"_shadersPointPrimitiveCollectionVS",(function(){return Zre})),n.d(o,"_shadersPolylineCommon",(function(){return Tz})),n.d(o,"_shadersPolylineFS",(function(){return Dz})),n.d(o,"_shadersPolylineShadowVolumeFS",(function(){return vz})),n.d(o,"_shadersPolylineShadowVolumeMorphFS",(function(){return Oz})),n.d(o,"_shadersPolylineShadowVolumeMorphVS",(function(){return wz})),n.d(o,"_shadersPolylineShadowVolumeVS",(function(){return Az})),n.d(o,"_shadersPolylineVS",(function(){return g1})),n.d(o,"_shadersReprojectWebMercatorFS",(function(){return uSe})),n.d(o,"_shadersReprojectWebMercatorVS",(function(){return hSe})),n.d(o,"_shadersShadowVolumeAppearanceFS",(function(){return dF})),n.d(o,"_shadersShadowVolumeAppearanceVS",(function(){return VN})),n.d(o,"_shadersShadowVolumeFS",(function(){return HN})),n.d(o,"_shadersSkyAtmosphereCommon",(function(){return Nke})),n.d(o,"_shadersSkyAtmosphereFS",(function(){return Bke})),n.d(o,"_shadersSkyAtmosphereVS",(function(){return Fke})),n.d(o,"_shadersSkyBoxFS",(function(){return Vke})),n.d(o,"_shadersSkyBoxVS",(function(){return Hke})),n.d(o,"_shadersSunFS",(function(){return Jke})),n.d(o,"_shadersSunTextureFS",(function(){return Zke})),n.d(o,"_shadersSunVS",(function(){return $ke})),n.d(o,"_shadersVector3DTileClampedPolylinesFS",(function(){return H2})),n.d(o,"_shadersVector3DTileClampedPolylinesVS",(function(){return V2})),n.d(o,"_shadersVector3DTilePolylinesVS",(function(){return j2})),n.d(o,"_shadersVectorTileVS",(function(){return fG})),n.d(o,"_shadersViewportQuadFS",(function(){return SUe})),n.d(o,"_shadersViewportQuadVS",(function(){return qbe})),n.d(o,"Autolinker",(function(){return k_e})),n.d(o,"bitmap_sdf",(function(){return M0.a})),n.d(o,"dompurify",(function(){return on.a})),n.d(o,"earcut",(function(){return Rp.a})),n.d(o,"grapheme_splitter",(function(){return $0.a})),n.d(o,"jsep",(function(){return mG.a})),n.d(o,"kdbush",(function(){return Ioe})),n.d(o,"knockout_3_5_1",(function(){return DUe.a})),n.d(o,"knockout_es5",(function(){return BUe})),n.d(o,"knockout",(function(){return zUe})),n.d(o,"ktx_parse",(function(){return kUe.a}));n.d(o,"lerc",(function(){return VUe.a})),n.d(o,"mersenne_twister",(function(){return AZ.a})),n.d(o,"meshoptimizer",(function(){return bK})),n.d(o,"nosleep",(function(){return GUe.a})),n.d(o,"pako",(function(){return WUe.a})),n.d(o,"protobufjs",(function(){return Zv})),n.d(o,"rbush",(function(){return NC.a})),n.d(o,"topojson",(function(){return r})),n.d(o,"Tween",(function(){return mb.a})),n.d(o,"Uri",(function(){return rc.a})),n.d(o,"zip",(function(){return i})),n.d(o,"ClockViewModel",(function(){return XUe})),n.d(o,"Command",(function(){return KUe})),n.d(o,"createCommand",(function(){return JUe})),n.d(o,"getElement",(function(){return gye})),n.d(o,"InspectorShared",(function(){return $Ue})),n.d(o,"subscribeAndEvaluate",(function(){return QUe})),n.d(o,"SvgPathBindingHandler",(function(){return FUe})),n.d(o,"ToggleButtonViewModel",(function(){return tVe})),n.d(o,"addBuffer",(function(){return pH})),n.d(o,"addDefaults",(function(){return GV})),n.d(o,"addExtensionsRequired",(function(){return aH})),n.d(o,"addExtensionsUsed",(function(){return ZV})),n.d(o,"addPipelineExtras",(function(){return WV})),n.d(o,"addToArray",(function(){return BV})),n.d(o,"findAccessorMinMax",(function(){return QV})),n.d(o,"ForEach",(function(){return kV})),n.d(o,"forEachTextureInMaterial",(function(){return cH})),n.d(o,"getAccessorByteStride",(function(){return VV})),n.d(o,"getComponentReader",(function(){return $V})),n.d(o,"moveTechniqueRenderStates",(function(){return oH})),n.d(o,"moveTechniquesToExtension",(function(){return sH})),n.d(o,"numberOfComponentsForType",(function(){return UV})),n.d(o,"parseGlb",(function(){return JV})),n.d(o,"readAccessorPacked",(function(){return mH})),n.d(o,"removeExtensionsRequired",(function(){return YV})),n.d(o,"removeExtensionsUsed",(function(){return XV})),n.d(o,"removePipelineExtras",(function(){return DK})),n.d(o,"removeUnusedElements",(function(){return fH})),n.d(o,"updateAccessorComponentTypes",(function(){return _H})),n.d(o,"updateVersion",(function(){return PH})),n.d(o,"usesExtension",(function(){return FV})),n.d(o,"AlphaPipelineStage",(function(){return S6})),n.d(o,"B3dmLoader",(function(){return d7})),n.d(o,"BatchTexturePipelineStage",(function(){return P6})),n.d(o,"buildDrawCommand",(function(){return T5})),n.d(o,"CPUStylingPipelineStage",(function(){return a8})),n.d(o,"CustomShader",(function(){return cVe})),n.d(o,"CustomShaderMode",(function(){return R6})),n.d(o,"CustomShaderPipelineStage",(function(){return n8})),n.d(o,"DequantizationPipelineStage",(function(){return h8})),n.d(o,"FeatureIdPipelineStage",(function(){return H6})),n.d(o,"GeoJsonLoader",(function(){return f7})),n.d(o,"GeometryPipelineStage",(function(){return A8})),n.d(o,"I3dmLoader",(function(){return B7})),n.d(o,"ImageBasedLightingPipelineStage",(function(){return P5})),n.d(o,"InstancingPipelineStage",(function(){return y6})),n.d(o,"LightingModel",(function(){return T8})),n.d(o,"LightingPipelineStage",(function(){return x8})),n.d(o,"MaterialPipelineStage",(function(){return L8})),n.d(o,"MetadataPipelineStage",(function(){return K6})),n.d(o,"ModelAlphaOptions",(function(){return T9})),n.d(o,"ModelClippingPlanesPipelineStage",(function(){return G5})),n.d(o,"ModelColorPipelineStage",(function(){return k5})),n.d(o,"ModelExperimental",(function(){return iee})),n.d(o,"ModelExperimental3DTileContent",(function(){return mee})),n.d(o,"ModelExperimentalAnimation",(function(){return r5})),n.d(o,"ModelExperimentalAnimationChannel",(function(){return n5})),n.d(o,"ModelExperimentalAnimationCollection",(function(){return l5})),n.d(o,"ModelExperimentalArticulation",(function(){return L5})),n.d(o,"ModelExperimentalArticulationStage",(function(){return R5})),n.d(o,"ModelExperimentalDrawCommand",(function(){return y5})),n.d(o,"ModelExperimentalNode",(function(){return q5})),n.d(o,"ModelExperimentalRuntimeNode",(function(){return T6})),n.d(o,"ModelExperimentalRuntimePrimitive",(function(){return w9})),n.d(o,"ModelExperimentalSceneGraph",(function(){return k9})),n.d(o,"ModelExperimentalSkin",(function(){return A9})),n.d(o,"ModelExperimentalStatistics",(function(){return J9})),n.d(o,"ModelExperimentalType",(function(){return m8})),n.d(o,"ModelExperimentalUtility",(function(){return O5})),n.d(o,"ModelFeature",(function(){return Z9})),n.d(o,"ModelFeatureTable",(function(){return $9})),n.d(o,"ModelLightingOptions",(function(){return F9})),n.d(o,"ModelMatrixUpdateStage",(function(){return v6})),n.d(o,"ModelRenderResources",(function(){return I9})),n.d(o,"ModelSilhouettePipelineStage",(function(){return j9})),n.d(o,"ModelSplitterPipelineStage",(function(){return N9})),n.d(o,"MorphTargetsPipelineStage",(function(){return k8})),n.d(o,"NodeRenderResources",(function(){return B9})),n.d(o,"NodeStatisticsPipelineStage",(function(){return E6})),n.d(o,"PickingPipelineStage",(function(){return H8})),n.d(o,"PntsLoader",(function(){return Y7})),n.d(o,"PointCloudStylingPipelineStage",(function(){return Z8})),n.d(o,"PrimitiveOutlineGenerator",(function(){return R3})),n.d(o,"PrimitiveOutlinePipelineStage",(function(){return t9})),n.d(o,"PrimitiveRenderResources",(function(){return z9})),n.d(o,"PrimitiveStatisticsPipelineStage",(function(){return l9})),n.d(o,"SceneMode2DPipelineStage",(function(){return g9})),n.d(o,"SelectedFeatureIdPipelineStage",(function(){return v8})),n.d(o,"SkinningPipelineStage",(function(){return b9})),n.d(o,"StyleCommandsNeeded",(function(){return h5})),n.d(o,"TextureManager",(function(){return iVe})),n.d(o,"TextureUniform",(function(){return pVe})),n.d(o,"UniformType",(function(){return nVe})),n.d(o,"VaryingType",(function(){return mVe})),n.d(o,"WireframePipelineStage",(function(){return O9})),n.d(o,"_shadersAllMaterialAppearanceFS",(function(){return _D})),n.d(o,"_shadersAllMaterialAppearanceVS",(function(){return yD})),n.d(o,"_shadersBasicMaterialAppearanceFS",(function(){return bD})),n.d(o,"_shadersBasicMaterialAppearanceVS",(function(){return vD})),n.d(o,"_shadersEllipsoidSurfaceAppearanceFS",(function(){return Ixe})),n.d(o,"_shadersEllipsoidSurfaceAppearanceVS",(function(){return Pxe})),n.d(o,"_shadersPerInstanceColorAppearanceFS",(function(){return IR})),n.d(o,"_shadersPerInstanceColorAppearanceVS",(function(){return PR})),n.d(o,"_shadersPerInstanceFlatColorAppearanceFS",(function(){return DR})),n.d(o,"_shadersPerInstanceFlatColorAppearanceVS",(function(){return RR})),n.d(o,"_shadersPolylineColorAppearanceVS",(function(){return Ez})),n.d(o,"_shadersPolylineMaterialAppearanceVS",(function(){return Pz})),n.d(o,"_shadersTexturedMaterialAppearanceFS",(function(){return OD})),n.d(o,"_shadersTexturedMaterialAppearanceVS",(function(){return wD})),n.d(o,"_shadersCzmBuiltins",(function(){return DN})),n.d(o,"_shadersAspectRampMaterial",(function(){return ZD})),n.d(o,"_shadersBumpMapMaterial",(function(){return $D})),n.d(o,"_shadersCheckerboardMaterial",(function(){return QD})),n.d(o,"_shadersDotMaterial",(function(){return eR})),n.d(o,"_shadersElevationBandMaterial",(function(){return tR})),n.d(o,"_shadersElevationContourMaterial",(function(){return nR})),n.d(o,"_shadersElevationRampMaterial",(function(){return iR})),n.d(o,"_shadersFadeMaterial",(function(){return rR})),n.d(o,"_shadersGridMaterial",(function(){return oR})),n.d(o,"_shadersNormalMapMaterial",(function(){return aR})),n.d(o,"_shadersPolylineArrowMaterial",(function(){return sR})),n.d(o,"_shadersPolylineDashMaterial",(function(){return cR})),n.d(o,"_shadersPolylineGlowMaterial",(function(){return lR})),n.d(o,"_shadersPolylineOutlineMaterial",(function(){return uR})),n.d(o,"_shadersRimLightingMaterial",(function(){return hR})),n.d(o,"_shadersSlopeRampMaterial",(function(){return dR})),n.d(o,"_shadersStripeMaterial",(function(){return fR})),n.d(o,"_shadersWater",(function(){return pR})),n.d(o,"_shadersCPUStylingStageFS",(function(){return r8})),n.d(o,"_shadersCPUStylingStageVS",(function(){return i8})),n.d(o,"_shadersCustomShaderStageFS",(function(){return M6})),n.d(o,"_shadersCustomShaderStageVS",(function(){return j6})),n.d(o,"_shadersFeatureIdStageFS",(function(){return L6})),n.d(o,"_shadersFeatureIdStageVS",(function(){return N6})),n.d(o,"_shadersGeometryStageFS",(function(){return d8})),n.d(o,"_shadersGeometryStageVS",(function(){return f8})),n.d(o,"_shadersImageBasedLightingStageFS",(function(){return C5})),n.d(o,"_shadersInstancingStageCommon",(function(){return W5})),n.d(o,"_shadersInstancingStageVS",(function(){return Y5})),n.d(o,"_shadersLegacyInstancingStageVS",(function(){return X5})),n.d(o,"_shadersLightingStageFS",(function(){return E8})),n.d(o,"_shadersMaterialStageFS",(function(){return S8})),n.d(o,"_shadersMetadataStageFS",(function(){return G6})),n.d(o,"_shadersMetadataStageVS",(function(){return q6})),n.d(o,"_shadersModelClippingPlanesStageFS",(function(){return U5})),n.d(o,"_shadersModelColorStageFS",(function(){return F5})),n.d(o,"_shadersModelExperimentalFS",(function(){return b5})),n.d(o,"_shadersModelExperimentalVS",(function(){return v5})),n.d(o,"_shadersModelSilhouetteStageFS",(function(){return P9})),n.d(o,"_shadersModelSilhouetteStageVS",(function(){return D9})),n.d(o,"_shadersModelSplitterStageFS",(function(){return M9})),n.d(o,"_shadersMorphTargetsStageVS",(function(){return N8})),n.d(o,"_shadersPointCloudStylingStageVS",(function(){return G8})),n.d(o,"_shadersPrimitiveOutlineStageFS",(function(){return Q8})),n.d(o,"_shadersPrimitiveOutlineStageVS",(function(){return $8})),n.d(o,"_shadersSelectedFeatureIdStageCommon",(function(){return g8})),n.d(o,"_shadersSkinningStageVS",(function(){return _9})),n.d(o,"_shadersAcesTonemappingStage",(function(){return fLe})),n.d(o,"_shadersAdditiveBlend",(function(){return Mze})),n.d(o,"_shadersAmbientOcclusionGenerate",(function(){return pLe})),n.d(o,"_shadersAmbientOcclusionModulate",(function(){return mLe})),n.d(o,"_shadersBlackAndWhite",(function(){return gLe})),n.d(o,"_shadersBloomComposite",(function(){return _Le})),n.d(o,"_shadersBrightness",(function(){return yLe})),n.d(o,"_shadersBrightPass",(function(){return Lze})),n.d(o,"_shadersCompositeTranslucentClassification",(function(){return $je})),n.d(o,"_shadersContrastBias",(function(){return bLe})),n.d(o,"_shadersDepthOfField",(function(){return vLe})),n.d(o,"_shadersDepthView",(function(){return OLe})),n.d(o,"_shadersDepthViewPacked",(function(){return gVe})),n.d(o,"_shadersEdgeDetection",(function(){return wLe})),n.d(o,"_shadersFilmicTonemapping",(function(){return ALe})),n.d(o,"_shadersFXAA",(function(){return ELe})),n.d(o,"_shadersGaussianBlur1D",(function(){return TLe})),n.d(o,"_shadersLensFlare",(function(){return CLe})),n.d(o,"_shadersModifiedReinhardTonemapping",(function(){return xLe})),n.d(o,"_shadersNightVision",(function(){return SLe})),n.d(o,"_shadersPassThrough",(function(){return VPe})),n.d(o,"_shadersPassThroughDepth",(function(){return HPe})),n.d(o,"_shadersPointCloudEyeDomeLighting",(function(){return d$})),n.d(o,"_shadersReinhardTonemapping",(function(){return ILe})),n.d(o,"_shadersSilhouette",(function(){return PLe})),n.d(o,"Animation",(function(){return BVe})),n.d(o,"AnimationViewModel",(function(){return VVe})),n.d(o,"BaseLayerPicker",(function(){return WVe})),n.d(o,"BaseLayerPickerViewModel",(function(){return GVe})),n.d(o,"createDefaultImageryProviderViewModels",(function(){return KVe})),n.d(o,"createDefaultTerrainProviderViewModels",(function(){return JVe})),n.d(o,"ProviderViewModel",(function(){return XVe})),n.d(o,"Cesium3DTilesInspector",(function(){return dHe})),n.d(o,"Cesium3DTilesInspectorViewModel",(function(){return cHe})),n.d(o,"CesiumInspector",(function(){return bHe})),n.d(o,"CesiumInspectorViewModel",(function(){return _He})),n.d(o,"CesiumWidget",(function(){return THe})),n.d(o,"FullscreenButton",(function(){return IHe})),n.d(o,"FullscreenButtonViewModel",(function(){return xHe})),n.d(o,"Geocoder",(function(){return FHe})),n.d(o,"GeocoderViewModel",(function(){return NHe})),n.d(o,"HomeButton",(function(){return VHe})),n.d(o,"HomeButtonViewModel",(function(){return kHe})),n.d(o,"InfoBox",(function(){return WHe})),n.d(o,"InfoBoxViewModel",(function(){return GHe})),n.d(o,"NavigationHelpButton",(function(){return JHe})),n.d(o,"NavigationHelpButtonViewModel",(function(){return XHe})),n.d(o,"PerformanceWatchdog",(function(){return eGe})),n.d(o,"PerformanceWatchdogViewModel",(function(){return $He})),n.d(o,"ProjectionPicker",(function(){return rGe})),n.d(o,"ProjectionPickerViewModel",(function(){return nGe})),n.d(o,"SceneModePicker",(function(){return cGe})),n.d(o,"SceneModePickerViewModel",(function(){return aGe})),n.d(o,"SelectionIndicator",(function(){return fGe})),n.d(o,"SelectionIndicatorViewModel",(function(){return hGe})),n.d(o,"Timeline",(function(){return jGe})),n.d(o,"TimelineHighlightRange",(function(){return mGe})),n.d(o,"TimelineTrack",(function(){return _Ge})),n.d(o,"Viewer",(function(){return QGe})),n.d(o,"viewerCesium3DTilesInspectorMixin",(function(){return eqe})),n.d(o,"viewerCesiumInspectorMixin",(function(){return tqe})),n.d(o,"viewerDragDropMixin",(function(){return sqe})),n.d(o,"viewerPerformanceWatchdogMixin",(function(){return cqe})),n.d(o,"VRButton",(function(){return zGe})),n.d(o,"VRButtonViewModel",(function(){return BGe})),n.d(o,"_shadersdegreesPerRadian",(function(){return uM})),n.d(o,"_shadersdepthRange",(function(){return hM})),n.d(o,"_shadersepsilon1",(function(){return dM})),n.d(o,"_shadersepsilon2",(function(){return fM})),n.d(o,"_shadersepsilon3",(function(){return pM})),n.d(o,"_shadersepsilon4",(function(){return mM})),n.d(o,"_shadersepsilon5",(function(){return gM})),n.d(o,"_shadersepsilon6",(function(){return _M})),n.d(o,"_shadersepsilon7",(function(){return yM})),n.d(o,"_shadersinfinity",(function(){return bM})),n.d(o,"_shadersoneOverPi",(function(){return vM})),n.d(o,"_shadersoneOverTwoPi",(function(){return OM})),n.d(o,"_shaderspassCesium3DTile",(function(){return wM})),n.d(o,"_shaderspassCesium3DTileClassification",(function(){return AM})),n.d(o,"_shaderspassCesium3DTileClassificationIgnoreShow",(function(){return EM})),n.d(o,"_shaderspassClassification",(function(){return TM})),n.d(o,"_shaderspassCompute",(function(){return CM})),n.d(o,"_shaderspassEnvironment",(function(){return xM})),n.d(o,"_shaderspassGlobe",(function(){return SM})),n.d(o,"_shaderspassOpaque",(function(){return IM})),n.d(o,"_shaderspassOverlay",(function(){return PM})),n.d(o,"_shaderspassTerrainClassification",(function(){return DM})),n.d(o,"_shaderspassTranslucent",(function(){return RM})),n.d(o,"_shaderspi",(function(){return jM})),n.d(o,"_shaderspiOverFour",(function(){return MM})),n.d(o,"_shaderspiOverSix",(function(){return LM})),n.d(o,"_shaderspiOverThree",(function(){return NM})),n.d(o,"_shaderspiOverTwo",(function(){return BM})),n.d(o,"_shadersradiansPerDegree",(function(){return FM})),n.d(o,"_shaderssceneMode2D",(function(){return zM})),n.d(o,"_shaderssceneMode3D",(function(){return kM})),n.d(o,"_shaderssceneModeColumbusView",(function(){return UM})),n.d(o,"_shaderssceneModeMorphing",(function(){return VM})),n.d(o,"_shaderssolarRadius",(function(){return HM})),n.d(o,"_shadersthreePiOver2",(function(){return GM})),n.d(o,"_shaderstwoPi",(function(){return qM})),n.d(o,"_shaderswebMercatorMaxLatitude",(function(){return WM})),n.d(o,"_shadersacesTonemapping",(function(){return nL})),n.d(o,"_shadersalphaWeight",(function(){return iL})),n.d(o,"_shadersantialias",(function(){return rL})),n.d(o,"_shadersapproximateSphericalCoordinates",(function(){return oL})),n.d(o,"_shadersbackFacing",(function(){return aL})),n.d(o,"_shadersbranchFreeTernary",(function(){return sL})),n.d(o,"_shaderscascadeColor",(function(){return cL})),n.d(o,"_shaderscascadeDistance",(function(){return lL})),n.d(o,"_shaderscascadeMatrix",(function(){return uL})),n.d(o,"_shaderscascadeWeights",(function(){return hL})),n.d(o,"_shaderscolumbusViewMorph",(function(){return dL})),n.d(o,"_shaderscomputePosition",(function(){return fL})),n.d(o,"_shaderscosineAndSine",(function(){return pL})),n.d(o,"_shadersdecompressTextureCoordinates",(function(){return mL})),n.d(o,"_shadersdefaultPbrMaterial",(function(){return gL})),n.d(o,"_shadersdepthClamp",(function(){return _L})),n.d(o,"_shaderseastNorthUpToEyeCoordinates",(function(){return yL})),n.d(o,"_shadersellipsoidContainsPoint",(function(){return bL})),n.d(o,"_shadersellipsoidWgs84TextureCoordinates",(function(){return vL})),n.d(o,"_shadersequalsEpsilon",(function(){return OL})),n.d(o,"_shaderseyeOffset",(function(){return wL})),n.d(o,"_shaderseyeToWindowCoordinates",(function(){return AL})),n.d(o,"_shadersfastApproximateAtan",(function(){return EL})),n.d(o,"_shadersfog",(function(){return TL})),n.d(o,"_shadersgammaCorrect",(function(){return CL})),n.d(o,"_shadersgeodeticSurfaceNormal",(function(){return xL})),n.d(o,"_shadersgetDefaultMaterial",(function(){return SL})),n.d(o,"_shadersgetLambertDiffuse",(function(){return IL})),n.d(o,"_shadersgetSpecular",(function(){return PL})),n.d(o,"_shadersgetWaterNoise",(function(){return DL})),n.d(o,"_shadersHSBToRGB",(function(){return RL})),n.d(o,"_shadersHSLToRGB",(function(){return jL})),n.d(o,"_shadershue",(function(){return ML})),n.d(o,"_shadersinverseGamma",(function(){return LL})),n.d(o,"_shadersisEmpty",(function(){return NL})),n.d(o,"_shadersisFull",(function(){return BL})),n.d(o,"_shaderslatitudeToWebMercatorFraction",(function(){return FL})),n.d(o,"_shaderslinearToSrgb",(function(){return zL})),n.d(o,"_shaderslineDistance",(function(){return kL})),n.d(o,"_shadersluminance",(function(){return UL})),n.d(o,"_shadersmetersPerPixel",(function(){return VL})),n.d(o,"_shadersmodelToWindowCoordinates",(function(){return HL})),n.d(o,"_shadersmultiplyWithColorBalance",(function(){return GL})),n.d(o,"_shadersnearFarScalar",(function(){return qL})),n.d(o,"_shadersoctDecode",(function(){return WL})),n.d(o,"_shaderspackDepth",(function(){return YL})),n.d(o,"_shaderspbrLighting",(function(){return XL})),n.d(o,"_shaderspbrMetallicRoughnessMaterial",(function(){return KL})),n.d(o,"_shaderspbrSpecularGlossinessMaterial",(function(){return JL})),n.d(o,"_shadersphong",(function(){return ZL})),n.d(o,"_shadersplaneDistance",(function(){return $L})),n.d(o,"_shaderspointAlongRay",(function(){return QL})),n.d(o,"_shadersrayEllipsoidIntersectionInterval",(function(){return eN})),n.d(o,"_shadersraySphereIntersectionInterval",(function(){return tN})),n.d(o,"_shadersreadDepth",(function(){return nN})),n.d(o,"_shadersreadNonPerspective",(function(){return iN})),n.d(o,"_shadersreverseLogDepth",(function(){return rN})),n.d(o,"_shadersRGBToHSB",(function(){return oN})),n.d(o,"_shadersRGBToHSL",(function(){return aN})),n.d(o,"_shadersRGBToXYZ",(function(){return sN})),n.d(o,"_shadersround",(function(){return cN})),n.d(o,"_shaderssampleOctahedralProjection",(function(){return lN})),n.d(o,"_shaderssaturation",(function(){return uN})),n.d(o,"_shadersshadowDepthCompare",(function(){return hN})),n.d(o,"_shadersshadowVisibility",(function(){return dN})),n.d(o,"_shaderssignNotZero",(function(){return fN})),n.d(o,"_shaderssphericalHarmonics",(function(){return pN})),n.d(o,"_shaderssrgbToLinear",(function(){return mN})),n.d(o,"_shaderstangentToEyeSpaceMatrix",(function(){return gN})),n.d(o,"_shaderstransformPlane",(function(){return _N})),n.d(o,"_shaderstranslateRelativeToEye",(function(){return yN})),n.d(o,"_shaderstranslucentPhong",(function(){return bN})),n.d(o,"_shaderstranspose",(function(){return vN})),n.d(o,"_shadersunpackDepth",(function(){return ON})),n.d(o,"_shadersunpackFloat",(function(){return wN})),n.d(o,"_shadersunpackUint",(function(){return AN})),n.d(o,"_shadersvalueTransform",(function(){return EN})),n.d(o,"_shadersvertexLogDepth",(function(){return TN})),n.d(o,"_shaderswindowToEyeCoordinates",(function(){return CN})),n.d(o,"_shaderswriteDepthClamp",(function(){return xN})),n.d(o,"_shaderswriteLogDepth",(function(){return SN})),n.d(o,"_shaderswriteNonPerspective",(function(){return IN})),n.d(o,"_shadersXYZToRGB",(function(){return PN})),n.d(o,"_shadersdepthRangeStruct",(function(){return YM})),n.d(o,"_shadersmaterial",(function(){return XM})),n.d(o,"_shadersmaterialInput",(function(){return KM})),n.d(o,"_shadersmodelMaterial",(function(){return JM})),n.d(o,"_shadersmodelVertexOutput",(function(){return ZM})),n.d(o,"_shaderspbrParameters",(function(){return $M})),n.d(o,"_shadersray",(function(){return QM})),n.d(o,"_shadersraySegment",(function(){return eL})),n.d(o,"_shadersshadowParameters",(function(){return tL})),n.d(o,"createTaskProcessorWorker",(function(){return lqe}));var a=n(39),s=n(3),c=n(1),l=n(0),u=n(2),h=n(4);function d(e,t,n){this.x=Object(c.a)(e,0),this.y=Object(c.a)(t,0),this.z=Object(c.a)(n,0)}d.fromSpherical=function(e,t){s.a.typeOf.object("spherical",e),Object(l.a)(t)||(t=new d);const n=e.clock,i=e.cone,r=Object(c.a)(e.magnitude,1),o=r*Math.sin(i);return t.x=o*Math.cos(n),t.y=o*Math.sin(n),t.z=r*Math.cos(i),t},d.fromElements=function(e,t,n,i){return Object(l.a)(i)?(i.x=e,i.y=t,i.z=n,i):new d(e,t,n)},d.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new d(e.x,e.y,e.z)},d.fromCartesian4=d.clone,d.packedLength=3,d.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},d.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new d),n.x=e[t++],n.y=e[t++],n.z=e[t],n},d.packArray=function(e,t){s.a.defined("array",e);const n=e.length,i=3*n;if(Object(l.a)(t)){if(!Array.isArray(t)&&t.length!==i)throw new u.a("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(let i=0;i<n;++i)d.pack(e[i],t,3*i);return t},d.unpackArray=function(e,t){if(s.a.defined("array",e),s.a.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!=0)throw new u.a("array length must be a multiple of 3.");const n=e.length;Object(l.a)(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){const n=i/3;t[n]=d.unpack(e,i,t[n])}return t},d.fromArray=d.unpack,d.maximumComponent=function(e){return s.a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},d.minimumComponent=function(e){return s.a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},d.minimumByComponent=function(e,t,n){return s.a.typeOf.object("first",e),s.a.typeOf.object("second",t),s.a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},d.maximumByComponent=function(e,t,n){return s.a.typeOf.object("first",e),s.a.typeOf.object("second",t),s.a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},d.clamp=function(e,t,n,i){s.a.typeOf.object("value",e),s.a.typeOf.object("min",t),s.a.typeOf.object("max",n),s.a.typeOf.object("result",i);const r=h.a.clamp(e.x,t.x,n.x),o=h.a.clamp(e.y,t.y,n.y),a=h.a.clamp(e.z,t.z,n.z);return i.x=r,i.y=o,i.z=a,i},d.magnitudeSquared=function(e){return s.a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},d.magnitude=function(e){return Math.sqrt(d.magnitudeSquared(e))};const f=new d;d.distance=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),d.subtract(e,t,f),d.magnitude(f)},d.distanceSquared=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),d.subtract(e,t,f),d.magnitudeSquared(f)},d.normalize=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=d.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new u.a("normalized result is not a number");return t},d.dot=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},d.multiplyComponents=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},d.divideComponents=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},d.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},d.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},d.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("cartesian",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},d.divideByScalar=function(e,t,n){return s.a.typeOf.object("cartesian",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},d.negate=function(e,t){return s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},d.abs=function(e,t){return s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const p=new d;d.lerp=function(e,t,n,i){return s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i),d.multiplyByScalar(t,n,p),i=d.multiplyByScalar(e,1-n,i),d.add(p,i,i)};const m=new d,g=new d;d.angleBetween=function(e,t){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),d.normalize(e,m),d.normalize(t,g);const n=d.dot(m,g),i=d.magnitude(d.cross(m,g,m));return Math.atan2(i,n)};const _=new d;d.mostOrthogonalAxis=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=d.normalize(e,_);return d.abs(n,n),t=n.x<=n.y?n.x<=n.z?d.clone(d.UNIT_X,t):d.clone(d.UNIT_Z,t):n.y<=n.z?d.clone(d.UNIT_Y,t):d.clone(d.UNIT_Z,t)},d.projectVector=function(e,t,n){s.a.defined("a",e),s.a.defined("b",t),s.a.defined("result",n);const i=d.dot(e,t)/d.dot(t,t);return d.multiplyByScalar(t,i,n)},d.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},d.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},d.equalsEpsilon=function(e,t,n,i){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&h.a.equalsEpsilon(e.x,t.x,n,i)&&h.a.equalsEpsilon(e.y,t.y,n,i)&&h.a.equalsEpsilon(e.z,t.z,n,i)},d.cross=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n);const i=e.x,r=e.y,o=e.z,a=t.x,c=t.y,l=t.z,u=r*l-o*c,h=o*a-i*l,d=i*c-r*a;return n.x=u,n.y=h,n.z=d,n},d.midpoint=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=.5*(e.x+t.x),n.y=.5*(e.y+t.y),n.z=.5*(e.z+t.z),n},d.fromDegrees=function(e,t,n,i,r){return s.a.typeOf.number("longitude",e),s.a.typeOf.number("latitude",t),e=h.a.toRadians(e),t=h.a.toRadians(t),d.fromRadians(e,t,n,i,r)};let y=new d,b=new d;const v=new d(40680631590769,40680631590769,40408299984661.445);d.fromRadians=function(e,t,n,i,r){s.a.typeOf.number("longitude",e),s.a.typeOf.number("latitude",t),n=Object(c.a)(n,0);const o=Object(l.a)(i)?i.radiiSquared:v,a=Math.cos(t);y.x=a*Math.cos(e),y.y=a*Math.sin(e),y.z=Math.sin(t),y=d.normalize(y,y),d.multiplyComponents(o,y,b);const u=Math.sqrt(d.dot(y,b));return b=d.divideByScalar(b,u,b),y=d.multiplyByScalar(y,n,y),Object(l.a)(r)||(r=new d),d.add(b,y,r)},d.fromDegreesArray=function(e,t,n){if(s.a.defined("coordinates",e),e.length<2||e.length%2!=0)throw new u.a("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;Object(l.a)(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){const i=e[r],o=e[r+1],a=r/2;n[a]=d.fromDegrees(i,o,0,t,n[a])}return n},d.fromRadiansArray=function(e,t,n){if(s.a.defined("coordinates",e),e.length<2||e.length%2!=0)throw new u.a("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;Object(l.a)(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){const i=e[r],o=e[r+1],a=r/2;n[a]=d.fromRadians(i,o,0,t,n[a])}return n},d.fromDegreesArrayHeights=function(e,t,n){if(s.a.defined("coordinates",e),e.length<3||e.length%3!=0)throw new u.a("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;Object(l.a)(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){const i=e[r],o=e[r+1],a=e[r+2],s=r/3;n[s]=d.fromDegrees(i,o,a,t,n[s])}return n},d.fromRadiansArrayHeights=function(e,t,n){if(s.a.defined("coordinates",e),e.length<3||e.length%3!=0)throw new u.a("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;Object(l.a)(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){const i=e[r],o=e[r+1],a=e[r+2],s=r/3;n[s]=d.fromRadians(i,o,a,t,n[s])}return n},d.ZERO=Object.freeze(new d(0,0,0)),d.ONE=Object.freeze(new d(1,1,1)),d.UNIT_X=Object.freeze(new d(1,0,0)),d.UNIT_Y=Object.freeze(new d(0,1,0)),d.UNIT_Z=Object.freeze(new d(0,0,1)),d.prototype.clone=function(e){return d.clone(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.equalsEpsilon=function(e,t,n){return d.equalsEpsilon(this,e,t,n)},d.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var O=d;const w=new O,A=new O;var E=function(e,t,n,i,r){if(!Object(l.a)(e))throw new u.a("cartesian is required.");if(!Object(l.a)(t))throw new u.a("oneOverRadii is required.");if(!Object(l.a)(n))throw new u.a("oneOverRadiiSquared is required.");if(!Object(l.a)(i))throw new u.a("centerToleranceSquared is required.");const o=e.x,a=e.y,s=e.z,c=t.x,d=t.y,f=t.z,p=o*o*c*c,m=a*a*d*d,g=s*s*f*f,_=p+m+g,y=Math.sqrt(1/_),b=O.multiplyByScalar(e,y,w);if(_<i)return isFinite(y)?O.clone(b,r):void 0;const v=n.x,E=n.y,T=n.z,C=A;C.x=b.x*v*2,C.y=b.y*E*2,C.z=b.z*T*2;let x,S,I,P,D,R,j,M,L,N,B,F=(1-y)*O.magnitude(e)/(.5*O.magnitude(C)),z=0;do{F-=z,I=1/(1+F*v),P=1/(1+F*E),D=1/(1+F*T),R=I*I,j=P*P,M=D*D,L=R*I,N=j*P,B=M*D,x=p*R+m*j+g*M-1,S=p*L*v+m*N*E+g*B*T;z=x/(-2*S)}while(Math.abs(x)>h.a.EPSILON12);return Object(l.a)(r)?(r.x=o*I,r.y=a*P,r.z=s*D,r):new O(o*I,a*P,s*D)};function T(e,t,n){this.longitude=Object(c.a)(e,0),this.latitude=Object(c.a)(t,0),this.height=Object(c.a)(n,0)}T.fromRadians=function(e,t,n,i){return s.a.typeOf.number("longitude",e),s.a.typeOf.number("latitude",t),n=Object(c.a)(n,0),Object(l.a)(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new T(e,t,n)},T.fromDegrees=function(e,t,n,i){return s.a.typeOf.number("longitude",e),s.a.typeOf.number("latitude",t),e=h.a.toRadians(e),t=h.a.toRadians(t),T.fromRadians(e,t,n,i)};const C=new O,x=new O,S=new O,I=new O(1/6378137,1/6378137,1/6356752.314245179),P=new O(1/40680631590769,1/40680631590769,1/40408299984661.445),D=h.a.EPSILON1;T.fromCartesian=function(e,t,n){const i=Object(l.a)(t)?t.oneOverRadii:I,r=Object(l.a)(t)?t.oneOverRadiiSquared:P,o=Object(l.a)(t)?t._centerToleranceSquared:D,a=E(e,i,r,o,x);if(!Object(l.a)(a))return;let s=O.multiplyComponents(a,r,C);s=O.normalize(s,s);const c=O.subtract(e,a,S),u=Math.atan2(s.y,s.x),d=Math.asin(s.z),f=h.a.sign(O.dot(c,e))*O.magnitude(c);return Object(l.a)(n)?(n.longitude=u,n.latitude=d,n.height=f,n):new T(u,d,f)},T.toCartesian=function(e,t,n){return s.a.defined("cartographic",e),O.fromRadians(e.longitude,e.latitude,e.height,t,n)},T.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new T(e.longitude,e.latitude,e.height)},T.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},T.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},T.ZERO=Object.freeze(new T(0,0,0)),T.prototype.clone=function(e){return T.clone(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.equalsEpsilon=function(e,t){return T.equalsEpsilon(this,e,t)},T.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var R=T;function j(e,t,n,i){t=Object(c.a)(t,0),n=Object(c.a)(n,0),i=Object(c.a)(i,0),s.a.typeOf.number.greaterThanOrEquals("x",t,0),s.a.typeOf.number.greaterThanOrEquals("y",n,0),s.a.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new O(t,n,i),e._radiiSquared=new O(t*t,n*n,i*i),e._radiiToTheFourth=new O(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new O(0===t?0:1/t,0===n?0:1/n,0===i?0:1/i),e._oneOverRadiiSquared=new O(0===t?0:1/(t*t),0===n?0:1/(n*n),0===i?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=h.a.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function M(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,j(this,e,t,n)}Object.defineProperties(M.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),M.clone=function(e,t){if(!Object(l.a)(e))return;const n=e._radii;return Object(l.a)(t)?(O.clone(n,t._radii),O.clone(e._radiiSquared,t._radiiSquared),O.clone(e._radiiToTheFourth,t._radiiToTheFourth),O.clone(e._oneOverRadii,t._oneOverRadii),O.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new M(n.x,n.y,n.z)},M.fromCartesian3=function(e,t){return Object(l.a)(t)||(t=new M),Object(l.a)(e)?(j(t,e.x,e.y,e.z),t):t},M.WGS84=Object.freeze(new M(6378137,6378137,6356752.314245179)),M.UNIT_SPHERE=Object.freeze(new M(1,1,1)),M.MOON=Object.freeze(new M(h.a.LUNAR_RADIUS,h.a.LUNAR_RADIUS,h.a.LUNAR_RADIUS)),M.prototype.clone=function(e){return M.clone(this,e)},M.packedLength=O.packedLength,M.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),O.pack(e._radii,t,n),t},M.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=O.unpack(e,t);return M.fromCartesian3(i,n)},M.prototype.geocentricSurfaceNormal=O.normalize,M.prototype.geodeticSurfaceNormalCartographic=function(e,t){s.a.typeOf.object("cartographic",e);const n=e.longitude,i=e.latitude,r=Math.cos(i),o=r*Math.cos(n),a=r*Math.sin(n),c=Math.sin(i);return Object(l.a)(t)||(t=new O),t.x=o,t.y=a,t.z=c,O.normalize(t,t)},M.prototype.geodeticSurfaceNormal=function(e,t){if(!O.equalsEpsilon(e,O.ZERO,h.a.EPSILON14))return Object(l.a)(t)||(t=new O),t=O.multiplyComponents(e,this._oneOverRadiiSquared,t),O.normalize(t,t)};const L=new O,N=new O;M.prototype.cartographicToCartesian=function(e,t){const n=L,i=N;this.geodeticSurfaceNormalCartographic(e,n),O.multiplyComponents(this._radiiSquared,n,i);const r=Math.sqrt(O.dot(n,i));return O.divideByScalar(i,r,i),O.multiplyByScalar(n,e.height,n),Object(l.a)(t)||(t=new O),O.add(i,n,t)},M.prototype.cartographicArrayToCartesianArray=function(e,t){s.a.defined("cartographics",e);const n=e.length;Object(l.a)(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};const B=new O,F=new O,z=new O;M.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,F);if(!Object(l.a)(n))return;const i=this.geodeticSurfaceNormal(n,B),r=O.subtract(e,n,z),o=Math.atan2(i.y,i.x),a=Math.asin(i.z),s=h.a.sign(O.dot(r,e))*O.magnitude(r);return Object(l.a)(t)?(t.longitude=o,t.latitude=a,t.height=s,t):new R(o,a,s)},M.prototype.cartesianArrayToCartographicArray=function(e,t){s.a.defined("cartesians",e);const n=e.length;Object(l.a)(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},M.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},M.prototype.scaleToGeocentricSurface=function(e,t){s.a.typeOf.object("cartesian",e),Object(l.a)(t)||(t=new O);const n=e.x,i=e.y,r=e.z,o=this._oneOverRadiiSquared,a=1/Math.sqrt(n*n*o.x+i*i*o.y+r*r*o.z);return O.multiplyByScalar(e,a,t)},M.prototype.transformPositionToScaledSpace=function(e,t){return Object(l.a)(t)||(t=new O),O.multiplyComponents(e,this._oneOverRadii,t)},M.prototype.transformPositionFromScaledSpace=function(e,t){return Object(l.a)(t)||(t=new O),O.multiplyComponents(e,this._radii,t)},M.prototype.equals=function(e){return this===e||Object(l.a)(e)&&O.equals(this._radii,e._radii)},M.prototype.toString=function(){return this._radii.toString()},M.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(s.a.typeOf.object("position",e),!h.a.equalsEpsilon(this._radii.x,this._radii.y,h.a.EPSILON15))throw new u.a("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");s.a.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=Object(c.a)(t,0);const i=this._squaredXOverSquaredZ;if(Object(l.a)(n)||(n=new O),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};const k=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],U=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function V(e,t,n){s.a.typeOf.number("a",e),s.a.typeOf.number("b",t),s.a.typeOf.func("func",n);const i=.5*(t+e),r=.5*(t-e);let o=0;for(let e=0;e<5;e++){const t=r*k[e];o+=U[e]*(n(i+t)+n(i-t))}return o*=r,o}M.prototype.surfaceArea=function(e){s.a.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const i=e.south,r=e.north;for(;n<t;)n+=h.a.TWO_PI;const o=this._radiiSquared,a=o.x,c=o.y,l=o.z,u=a*c;return V(i,r,(function(e){const i=Math.cos(e),r=Math.sin(e);return Math.cos(e)*V(t,n,(function(e){const t=Math.cos(e),n=Math.sin(e);return Math.sqrt(u*r*r+l*(c*t*t+a*n*n)*i*i)}))}))};var H=M;function G(e){this._ellipsoid=Object(c.a)(e,H.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(G.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),G.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,r=e.latitude*n,o=e.height;return Object(l.a)(t)?(t.x=i,t.y=r,t.z=o,t):new O(i,r,o)},G.prototype.unproject=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,r=e.y*n,o=e.z;return Object(l.a)(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new R(i,r,o)};var q=G;var W=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});var Y=function(e,t){this.start=Object(c.a)(e,0),this.stop=Object(c.a)(t,0)};function X(e,t,n,i,r,o,a,s,l){this[0]=Object(c.a)(e,0),this[1]=Object(c.a)(i,0),this[2]=Object(c.a)(a,0),this[3]=Object(c.a)(t,0),this[4]=Object(c.a)(r,0),this[5]=Object(c.a)(s,0),this[6]=Object(c.a)(n,0),this[7]=Object(c.a)(o,0),this[8]=Object(c.a)(l,0)}X.packedLength=9,X.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},X.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new X),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},X.packArray=function(e,t){s.a.defined("array",e);const n=e.length,i=9*n;if(Object(l.a)(t)){if(!Array.isArray(t)&&t.length!==i)throw new u.a("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(let i=0;i<n;++i)X.pack(e[i],t,9*i);return t},X.unpackArray=function(e,t){if(s.a.defined("array",e),s.a.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!=0)throw new u.a("array length must be a multiple of 9.");const n=e.length;Object(l.a)(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){const n=i/9;t[n]=X.unpack(e,i,t[n])}return t},X.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new X(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},X.fromArray=X.unpack,X.fromColumnMajorArray=function(e,t){return s.a.defined("values",e),X.clone(e,t)},X.fromRowMajorArray=function(e,t){return s.a.defined("values",e),Object(l.a)(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new X(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},X.fromQuaternion=function(e,t){s.a.typeOf.object("quaternion",e);const n=e.x*e.x,i=e.x*e.y,r=e.x*e.z,o=e.x*e.w,a=e.y*e.y,c=e.y*e.z,u=e.y*e.w,h=e.z*e.z,d=e.z*e.w,f=e.w*e.w,p=n-a-h+f,m=2*(i-d),g=2*(r+u),_=2*(i+d),y=-n+a-h+f,b=2*(c-o),v=2*(r-u),O=2*(c+o),w=-n-a+h+f;return Object(l.a)(t)?(t[0]=p,t[1]=_,t[2]=v,t[3]=m,t[4]=y,t[5]=O,t[6]=g,t[7]=b,t[8]=w,t):new X(p,m,g,_,y,b,v,O,w)},X.fromHeadingPitchRoll=function(e,t){s.a.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),i=Math.cos(-e.heading),r=Math.cos(e.roll),o=Math.sin(-e.pitch),a=Math.sin(-e.heading),c=Math.sin(e.roll),u=n*i,h=-r*a+c*o*i,d=c*a+r*o*i,f=n*a,p=r*i+c*o*a,m=-c*i+r*o*a,g=-o,_=c*n,y=r*n;return Object(l.a)(t)?(t[0]=u,t[1]=f,t[2]=g,t[3]=h,t[4]=p,t[5]=_,t[6]=d,t[7]=m,t[8]=y,t):new X(u,h,d,f,p,m,g,_,y)},X.fromScale=function(e,t){return s.a.typeOf.object("scale",e),Object(l.a)(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new X(e.x,0,0,0,e.y,0,0,0,e.z)},X.fromUniformScale=function(e,t){return s.a.typeOf.number("scale",e),Object(l.a)(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new X(e,0,0,0,e,0,0,0,e)},X.fromCrossProduct=function(e,t){return s.a.typeOf.object("vector",e),Object(l.a)(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new X(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},X.fromRotationX=function(e,t){s.a.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return Object(l.a)(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new X(1,0,0,0,n,-i,0,i,n)},X.fromRotationY=function(e,t){s.a.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return Object(l.a)(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new X(n,0,i,0,1,0,-i,0,n)},X.fromRotationZ=function(e,t){s.a.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return Object(l.a)(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new X(n,-i,0,i,n,0,0,0,1)},X.toArray=function(e,t){return s.a.typeOf.object("matrix",e),Object(l.a)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},X.getElementIndex=function(e,t){return s.a.typeOf.number.greaterThanOrEquals("row",t,0),s.a.typeOf.number.lessThanOrEquals("row",t,2),s.a.typeOf.number.greaterThanOrEquals("column",e,0),s.a.typeOf.number.lessThanOrEquals("column",e,2),3*e+t},X.getColumn=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,2),s.a.typeOf.object("result",n);const i=3*t,r=e[i],o=e[i+1],a=e[i+2];return n.x=r,n.y=o,n.z=a,n},X.setColumn=function(e,t,n,i){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,2),s.a.typeOf.object("cartesian",n),s.a.typeOf.object("result",i);const r=3*t;return(i=X.clone(e,i))[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i},X.getRow=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,2),s.a.typeOf.object("result",n);const i=e[t],r=e[t+3],o=e[t+6];return n.x=i,n.y=r,n.z=o,n},X.setRow=function(e,t,n,i){return s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,2),s.a.typeOf.object("cartesian",n),s.a.typeOf.object("result",i),(i=X.clone(e,i))[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const K=new O;X.setScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("scale",t),s.a.typeOf.object("result",n);const i=X.getScale(e,K),r=t.x/i.x,o=t.y/i.y,a=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};const J=new O;X.setUniformScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number("scale",t),s.a.typeOf.object("result",n);const i=X.getScale(e,J),r=t/i.x,o=t/i.y,a=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*o,n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};const Z=new O;X.getScale=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t.x=O.magnitude(O.fromElements(e[0],e[1],e[2],Z)),t.y=O.magnitude(O.fromElements(e[3],e[4],e[5],Z)),t.z=O.magnitude(O.fromElements(e[6],e[7],e[8],Z)),t};const $=new O;X.getMaximumScale=function(e){return X.getScale(e,$),O.maximumComponent($)};const Q=new O;X.setRotation=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",n);const i=X.getScale(e,Q);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};const ee=new O;X.getRotation=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=X.getScale(e,ee);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t},X.multiply=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n);const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],r=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],c=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],h=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=a,n[4]=c,n[5]=l,n[6]=u,n[7]=h,n[8]=d,n},X.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},X.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},X.multiplyByVector=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("cartesian",t),s.a.typeOf.object("result",n);const i=t.x,r=t.y,o=t.z,a=e[0]*i+e[3]*r+e[6]*o,c=e[1]*i+e[4]*r+e[7]*o,l=e[2]*i+e[5]*r+e[8]*o;return n.x=a,n.y=c,n.z=l,n},X.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},X.multiplyByScale=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("scale",t),s.a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},X.multiplyByUniformScale=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.number("scale",t),s.a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},X.negate=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},X.transpose=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=e[0],i=e[3],r=e[6],o=e[1],a=e[4],c=e[7],l=e[2],u=e[5],h=e[8];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t[4]=a,t[5]=c,t[6]=l,t[7]=u,t[8]=h,t};const te=[1,0,0],ne=[2,2,1];function ie(e){let t=0;for(let n=0;n<3;++n){const i=e[X.getElementIndex(ne[n],te[n])];t+=2*i*i}return Math.sqrt(t)}function re(e,t){const n=h.a.EPSILON15;let i=0,r=1;for(let t=0;t<3;++t){const n=Math.abs(e[X.getElementIndex(ne[t],te[t])]);n>i&&(r=t,i=n)}let o=1,a=0;const s=te[r],c=ne[r];if(Math.abs(e[X.getElementIndex(c,s)])>n){const t=(e[X.getElementIndex(c,c)]-e[X.getElementIndex(s,s)])/2/e[X.getElementIndex(c,s)];let n;n=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),o=1/Math.sqrt(1+n*n),a=n*o}return(t=X.clone(X.IDENTITY,t))[X.getElementIndex(s,s)]=t[X.getElementIndex(c,c)]=o,t[X.getElementIndex(c,s)]=a,t[X.getElementIndex(s,c)]=-a,t}const oe=new X,ae=new X;X.computeEigenDecomposition=function(e,t){s.a.typeOf.object("matrix",e);const n=h.a.EPSILON20;let i=0,r=0;Object(l.a)(t)||(t={});const o=t.unitary=X.clone(X.IDENTITY,t.unitary),a=t.diagonal=X.clone(e,t.diagonal),c=n*function(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}(a);for(;r<10&&ie(a)>c;)re(a,oe),X.transpose(oe,ae),X.multiply(a,oe,a),X.multiply(ae,a,a),X.multiply(o,oe,o),++i>2&&(++r,i=0);return t},X.abs=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},X.determinant=function(e){s.a.typeOf.object("matrix",e);const t=e[0],n=e[3],i=e[6],r=e[1],o=e[4],a=e[7],c=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+r*(l*i-n*u)+c*(n*a-o*i)},X.inverse=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],c=e[5],l=e[6],d=e[7],f=e[8],p=X.determinant(e);if(Math.abs(p)<=h.a.EPSILON15)throw new u.a("matrix is not invertible");t[0]=a*f-d*c,t[1]=d*r-i*f,t[2]=i*c-a*r,t[3]=l*c-o*f,t[4]=n*f-l*r,t[5]=o*r-n*c,t[6]=o*d-l*a,t[7]=l*i-n*d,t[8]=n*a-o*i;const m=1/p;return X.multiplyByScalar(t,m,t)};const se=new X;X.inverseTranspose=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),X.inverse(X.transpose(e,se),t)},X.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},X.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},X.IDENTITY=Object.freeze(new X(1,0,0,0,1,0,0,0,1)),X.ZERO=Object.freeze(new X(0,0,0,0,0,0,0,0,0)),X.COLUMN0ROW0=0,X.COLUMN0ROW1=1,X.COLUMN0ROW2=2,X.COLUMN1ROW0=3,X.COLUMN1ROW1=4,X.COLUMN1ROW2=5,X.COLUMN2ROW0=6,X.COLUMN2ROW1=7,X.COLUMN2ROW2=8,Object.defineProperties(X.prototype,{length:{get:function(){return X.packedLength}}}),X.prototype.clone=function(e){return X.clone(this,e)},X.prototype.equals=function(e){return X.equals(this,e)},X.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},X.prototype.equalsEpsilon=function(e,t){return X.equalsEpsilon(this,e,t)},X.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`};var ce=X;function le(e,t,n,i){this.x=Object(c.a)(e,0),this.y=Object(c.a)(t,0),this.z=Object(c.a)(n,0),this.w=Object(c.a)(i,0)}le.fromElements=function(e,t,n,i,r){return Object(l.a)(r)?(r.x=e,r.y=t,r.z=n,r.w=i,r):new le(e,t,n,i)},le.fromColor=function(e,t){return s.a.typeOf.object("color",e),Object(l.a)(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new le(e.red,e.green,e.blue,e.alpha)},le.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new le(e.x,e.y,e.z,e.w)},le.packedLength=4,le.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},le.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new le),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},le.packArray=function(e,t){s.a.defined("array",e);const n=e.length,i=4*n;if(Object(l.a)(t)){if(!Array.isArray(t)&&t.length!==i)throw new u.a("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(let i=0;i<n;++i)le.pack(e[i],t,4*i);return t},le.unpackArray=function(e,t){if(s.a.defined("array",e),s.a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new u.a("array length must be a multiple of 4.");const n=e.length;Object(l.a)(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const n=i/4;t[n]=le.unpack(e,i,t[n])}return t},le.fromArray=le.unpack,le.maximumComponent=function(e){return s.a.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},le.minimumComponent=function(e){return s.a.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},le.minimumByComponent=function(e,t,n){return s.a.typeOf.object("first",e),s.a.typeOf.object("second",t),s.a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},le.maximumByComponent=function(e,t,n){return s.a.typeOf.object("first",e),s.a.typeOf.object("second",t),s.a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},le.clamp=function(e,t,n,i){s.a.typeOf.object("value",e),s.a.typeOf.object("min",t),s.a.typeOf.object("max",n),s.a.typeOf.object("result",i);const r=h.a.clamp(e.x,t.x,n.x),o=h.a.clamp(e.y,t.y,n.y),a=h.a.clamp(e.z,t.z,n.z),c=h.a.clamp(e.w,t.w,n.w);return i.x=r,i.y=o,i.z=a,i.w=c,i},le.magnitudeSquared=function(e){return s.a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},le.magnitude=function(e){return Math.sqrt(le.magnitudeSquared(e))};const ue=new le;le.distance=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),le.subtract(e,t,ue),le.magnitude(ue)},le.distanceSquared=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),le.subtract(e,t,ue),le.magnitudeSquared(ue)},le.normalize=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=le.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new u.a("normalized result is not a number");return t},le.dot=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},le.multiplyComponents=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},le.divideComponents=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},le.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},le.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},le.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("cartesian",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},le.divideByScalar=function(e,t,n){return s.a.typeOf.object("cartesian",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},le.negate=function(e,t){return s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},le.abs=function(e,t){return s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};const he=new le;le.lerp=function(e,t,n,i){return s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i),le.multiplyByScalar(t,n,he),i=le.multiplyByScalar(e,1-n,i),le.add(he,i,i)};const de=new le;le.mostOrthogonalAxis=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=le.normalize(e,de);return le.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?le.clone(le.UNIT_X,t):le.clone(le.UNIT_W,t):n.z<=n.w?le.clone(le.UNIT_Z,t):le.clone(le.UNIT_W,t):n.y<=n.z?n.y<=n.w?le.clone(le.UNIT_Y,t):le.clone(le.UNIT_W,t):n.z<=n.w?le.clone(le.UNIT_Z,t):le.clone(le.UNIT_W,t)},le.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},le.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},le.equalsEpsilon=function(e,t,n,i){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&h.a.equalsEpsilon(e.x,t.x,n,i)&&h.a.equalsEpsilon(e.y,t.y,n,i)&&h.a.equalsEpsilon(e.z,t.z,n,i)&&h.a.equalsEpsilon(e.w,t.w,n,i)},le.ZERO=Object.freeze(new le(0,0,0,0)),le.ONE=Object.freeze(new le(1,1,1,1)),le.UNIT_X=Object.freeze(new le(1,0,0,0)),le.UNIT_Y=Object.freeze(new le(0,1,0,0)),le.UNIT_Z=Object.freeze(new le(0,0,1,0)),le.UNIT_W=Object.freeze(new le(0,0,0,1)),le.prototype.clone=function(e){return le.clone(this,e)},le.prototype.equals=function(e){return le.equals(this,e)},le.prototype.equalsEpsilon=function(e,t,n){return le.equalsEpsilon(this,e,t,n)},le.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const fe=new Float32Array(1),pe=new Uint8Array(fe.buffer),me=new Uint32Array([287454020]),ge=68===new Uint8Array(me.buffer)[0];le.packFloat=function(e,t){return s.a.typeOf.number("value",e),Object(l.a)(t)||(t=new le),fe[0]=e,ge?(t.x=pe[0],t.y=pe[1],t.z=pe[2],t.w=pe[3]):(t.x=pe[3],t.y=pe[2],t.z=pe[1],t.w=pe[0]),t},le.unpackFloat=function(e){return s.a.typeOf.object("packedFloat",e),ge?(pe[0]=e.x,pe[1]=e.y,pe[2]=e.z,pe[3]=e.w):(pe[0]=e.w,pe[1]=e.z,pe[2]=e.y,pe[3]=e.x),fe[0]};var _e=le,ye=n(5);function be(e,t,n,i,r,o,a,s,l,u,h,d,f,p,m,g){this[0]=Object(c.a)(e,0),this[1]=Object(c.a)(r,0),this[2]=Object(c.a)(l,0),this[3]=Object(c.a)(f,0),this[4]=Object(c.a)(t,0),this[5]=Object(c.a)(o,0),this[6]=Object(c.a)(u,0),this[7]=Object(c.a)(p,0),this[8]=Object(c.a)(n,0),this[9]=Object(c.a)(a,0),this[10]=Object(c.a)(h,0),this[11]=Object(c.a)(m,0),this[12]=Object(c.a)(i,0),this[13]=Object(c.a)(s,0),this[14]=Object(c.a)(d,0),this[15]=Object(c.a)(g,0)}be.packedLength=16,be.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},be.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new be),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},be.packArray=function(e,t){s.a.defined("array",e);const n=e.length,i=16*n;if(Object(l.a)(t)){if(!Array.isArray(t)&&t.length!==i)throw new u.a("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(let i=0;i<n;++i)be.pack(e[i],t,16*i);return t},be.unpackArray=function(e,t){if(s.a.defined("array",e),s.a.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!=0)throw new u.a("array length must be a multiple of 16.");const n=e.length;Object(l.a)(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){const n=i/16;t[n]=be.unpack(e,i,t[n])}return t},be.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new be(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},be.fromArray=be.unpack,be.fromColumnMajorArray=function(e,t){return s.a.defined("values",e),be.clone(e,t)},be.fromRowMajorArray=function(e,t){return s.a.defined("values",e),Object(l.a)(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new be(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},be.fromRotationTranslation=function(e,t,n){return s.a.typeOf.object("rotation",e),t=Object(c.a)(t,O.ZERO),Object(l.a)(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new be(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},be.fromTranslationQuaternionRotationScale=function(e,t,n,i){s.a.typeOf.object("translation",e),s.a.typeOf.object("rotation",t),s.a.typeOf.object("scale",n),Object(l.a)(i)||(i=new be);const r=n.x,o=n.y,a=n.z,c=t.x*t.x,u=t.x*t.y,h=t.x*t.z,d=t.x*t.w,f=t.y*t.y,p=t.y*t.z,m=t.y*t.w,g=t.z*t.z,_=t.z*t.w,y=t.w*t.w,b=c-f-g+y,v=2*(u-_),O=2*(h+m),w=2*(u+_),A=-c+f-g+y,E=2*(p-d),T=2*(h-m),C=2*(p+d),x=-c-f+g+y;return i[0]=b*r,i[1]=w*r,i[2]=T*r,i[3]=0,i[4]=v*o,i[5]=A*o,i[6]=C*o,i[7]=0,i[8]=O*a,i[9]=E*a,i[10]=x*a,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},be.fromTranslationRotationScale=function(e,t){return s.a.typeOf.object("translationRotationScale",e),be.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},be.fromTranslation=function(e,t){return s.a.typeOf.object("translation",e),be.fromRotationTranslation(ce.IDENTITY,e,t)},be.fromScale=function(e,t){return s.a.typeOf.object("scale",e),Object(l.a)(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new be(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},be.fromUniformScale=function(e,t){return s.a.typeOf.number("scale",e),Object(l.a)(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new be(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},be.fromRotation=function(e,t){return s.a.typeOf.object("rotation",e),Object(l.a)(t)||(t=new be),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};const ve=new O,Oe=new O,we=new O;be.fromCamera=function(e,t){s.a.typeOf.object("camera",e);const n=e.position,i=e.direction,r=e.up;s.a.typeOf.object("camera.position",n),s.a.typeOf.object("camera.direction",i),s.a.typeOf.object("camera.up",r),O.normalize(i,ve),O.normalize(O.cross(ve,r,Oe),Oe),O.normalize(O.cross(Oe,ve,we),we);const o=Oe.x,a=Oe.y,c=Oe.z,u=ve.x,h=ve.y,d=ve.z,f=we.x,p=we.y,m=we.z,g=n.x,_=n.y,y=n.z,b=o*-g+a*-_+c*-y,v=f*-g+p*-_+m*-y,w=u*g+h*_+d*y;return Object(l.a)(t)?(t[0]=o,t[1]=f,t[2]=-u,t[3]=0,t[4]=a,t[5]=p,t[6]=-h,t[7]=0,t[8]=c,t[9]=m,t[10]=-d,t[11]=0,t[12]=b,t[13]=v,t[14]=w,t[15]=1,t):new be(o,a,c,b,f,p,m,v,-u,-h,-d,w,0,0,0,1)},be.computePerspectiveFieldOfView=function(e,t,n,i,r){s.a.typeOf.number.greaterThan("fovY",e,0),s.a.typeOf.number.lessThan("fovY",e,Math.PI),s.a.typeOf.number.greaterThan("near",n,0),s.a.typeOf.number.greaterThan("far",i,0),s.a.typeOf.object("result",r);const o=1/Math.tan(.5*e),a=o/t,c=(i+n)/(n-i),l=2*i*n/(n-i);return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=-1,r[12]=0,r[13]=0,r[14]=l,r[15]=0,r},be.computeOrthographicOffCenter=function(e,t,n,i,r,o,a){s.a.typeOf.number("left",e),s.a.typeOf.number("right",t),s.a.typeOf.number("bottom",n),s.a.typeOf.number("top",i),s.a.typeOf.number("near",r),s.a.typeOf.number("far",o),s.a.typeOf.object("result",a);let c=1/(t-e),l=1/(i-n),u=1/(o-r);const h=-(t+e)*c,d=-(i+n)*l,f=-(o+r)*u;return c*=2,l*=2,u*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=h,a[13]=d,a[14]=f,a[15]=1,a},be.computePerspectiveOffCenter=function(e,t,n,i,r,o,a){s.a.typeOf.number("left",e),s.a.typeOf.number("right",t),s.a.typeOf.number("bottom",n),s.a.typeOf.number("top",i),s.a.typeOf.number("near",r),s.a.typeOf.number("far",o),s.a.typeOf.object("result",a);const c=2*r/(t-e),l=2*r/(i-n),u=(t+e)/(t-e),h=(i+n)/(i-n),d=-(o+r)/(o-r),f=-2*o*r/(o-r);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=h,a[10]=d,a[11]=-1,a[12]=0,a[13]=0,a[14]=f,a[15]=0,a},be.computeInfinitePerspectiveOffCenter=function(e,t,n,i,r,o){s.a.typeOf.number("left",e),s.a.typeOf.number("right",t),s.a.typeOf.number("bottom",n),s.a.typeOf.number("top",i),s.a.typeOf.number("near",r),s.a.typeOf.object("result",o);const a=2*r/(t-e),c=2*r/(i-n),l=(t+e)/(t-e),u=(i+n)/(i-n),h=-2*r;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=c,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},be.computeViewportTransformation=function(e,t,n,i){Object(l.a)(i)||(i=new be),e=Object(c.a)(e,c.a.EMPTY_OBJECT);const r=Object(c.a)(e.x,0),o=Object(c.a)(e.y,0),a=Object(c.a)(e.width,0),s=Object(c.a)(e.height,0);t=Object(c.a)(t,0);const u=.5*a,h=.5*s,d=.5*((n=Object(c.a)(n,1))-t),f=u,p=h,m=d,g=r+u,_=o+h,y=t+d;return i[0]=f,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=m,i[11]=0,i[12]=g,i[13]=_,i[14]=y,i[15]=1,i},be.computeView=function(e,t,n,i,r){return s.a.typeOf.object("position",e),s.a.typeOf.object("direction",t),s.a.typeOf.object("up",n),s.a.typeOf.object("right",i),s.a.typeOf.object("result",r),r[0]=i.x,r[1]=n.x,r[2]=-t.x,r[3]=0,r[4]=i.y,r[5]=n.y,r[6]=-t.y,r[7]=0,r[8]=i.z,r[9]=n.z,r[10]=-t.z,r[11]=0,r[12]=-O.dot(i,e),r[13]=-O.dot(n,e),r[14]=O.dot(t,e),r[15]=1,r},be.toArray=function(e,t){return s.a.typeOf.object("matrix",e),Object(l.a)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},be.getElementIndex=function(e,t){return s.a.typeOf.number.greaterThanOrEquals("row",t,0),s.a.typeOf.number.lessThanOrEquals("row",t,3),s.a.typeOf.number.greaterThanOrEquals("column",e,0),s.a.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},be.getColumn=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,3),s.a.typeOf.object("result",n);const i=4*t,r=e[i],o=e[i+1],a=e[i+2],c=e[i+3];return n.x=r,n.y=o,n.z=a,n.w=c,n},be.setColumn=function(e,t,n,i){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,3),s.a.typeOf.object("cartesian",n),s.a.typeOf.object("result",i);const r=4*t;return(i=be.clone(e,i))[r]=n.x,i[r+1]=n.y,i[r+2]=n.z,i[r+3]=n.w,i},be.getRow=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,3),s.a.typeOf.object("result",n);const i=e[t],r=e[t+4],o=e[t+8],a=e[t+12];return n.x=i,n.y=r,n.z=o,n.w=a,n},be.setRow=function(e,t,n,i){return s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,3),s.a.typeOf.object("cartesian",n),s.a.typeOf.object("result",i),(i=be.clone(e,i))[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i},be.setTranslation=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("translation",t),s.a.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};const Ae=new O;be.setScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("scale",t),s.a.typeOf.object("result",n);const i=be.getScale(e,Ae),r=t.x/i.x,o=t.y/i.y,a=t.z/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Ee=new O;be.setUniformScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number("scale",t),s.a.typeOf.object("result",n);const i=be.getScale(e,Ee),r=t/i.x,o=t/i.y,a=t/i.z;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3],n[4]=e[4]*o,n[5]=e[5]*o,n[6]=e[6]*o,n[7]=e[7],n[8]=e[8]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Te=new O;be.getScale=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t.x=O.magnitude(O.fromElements(e[0],e[1],e[2],Te)),t.y=O.magnitude(O.fromElements(e[4],e[5],e[6],Te)),t.z=O.magnitude(O.fromElements(e[8],e[9],e[10],Te)),t};const Ce=new O;be.getMaximumScale=function(e){return be.getScale(e,Ce),O.maximumComponent(Ce)};const xe=new O;be.setRotation=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",n);const i=be.getScale(e,xe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};const Se=new O;be.getRotation=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=be.getScale(e,Se);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t},be.multiply=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n);const i=e[0],r=e[1],o=e[2],a=e[3],c=e[4],l=e[5],u=e[6],h=e[7],d=e[8],f=e[9],p=e[10],m=e[11],g=e[12],_=e[13],y=e[14],b=e[15],v=t[0],O=t[1],w=t[2],A=t[3],E=t[4],T=t[5],C=t[6],x=t[7],S=t[8],I=t[9],P=t[10],D=t[11],R=t[12],j=t[13],M=t[14],L=t[15],N=i*v+c*O+d*w+g*A,B=r*v+l*O+f*w+_*A,F=o*v+u*O+p*w+y*A,z=a*v+h*O+m*w+b*A,k=i*E+c*T+d*C+g*x,U=r*E+l*T+f*C+_*x,V=o*E+u*T+p*C+y*x,H=a*E+h*T+m*C+b*x,G=i*S+c*I+d*P+g*D,q=r*S+l*I+f*P+_*D,W=o*S+u*I+p*P+y*D,Y=a*S+h*I+m*P+b*D,X=i*R+c*j+d*M+g*L,K=r*R+l*j+f*M+_*L,J=o*R+u*j+p*M+y*L,Z=a*R+h*j+m*M+b*L;return n[0]=N,n[1]=B,n[2]=F,n[3]=z,n[4]=k,n[5]=U,n[6]=V,n[7]=H,n[8]=G,n[9]=q,n[10]=W,n[11]=Y,n[12]=X,n[13]=K,n[14]=J,n[15]=Z,n},be.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},be.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},be.multiplyTransformation=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n);const i=e[0],r=e[1],o=e[2],a=e[4],c=e[5],l=e[6],u=e[8],h=e[9],d=e[10],f=e[12],p=e[13],m=e[14],g=t[0],_=t[1],y=t[2],b=t[4],v=t[5],O=t[6],w=t[8],A=t[9],E=t[10],T=t[12],C=t[13],x=t[14],S=i*g+a*_+u*y,I=r*g+c*_+h*y,P=o*g+l*_+d*y,D=i*b+a*v+u*O,R=r*b+c*v+h*O,j=o*b+l*v+d*O,M=i*w+a*A+u*E,L=r*w+c*A+h*E,N=o*w+l*A+d*E,B=i*T+a*C+u*x+f,F=r*T+c*C+h*x+p,z=o*T+l*C+d*x+m;return n[0]=S,n[1]=I,n[2]=P,n[3]=0,n[4]=D,n[5]=R,n[6]=j,n[7]=0,n[8]=M,n[9]=L,n[10]=N,n[11]=0,n[12]=B,n[13]=F,n[14]=z,n[15]=1,n},be.multiplyByMatrix3=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("rotation",t),s.a.typeOf.object("result",n);const i=e[0],r=e[1],o=e[2],a=e[4],c=e[5],l=e[6],u=e[8],h=e[9],d=e[10],f=t[0],p=t[1],m=t[2],g=t[3],_=t[4],y=t[5],b=t[6],v=t[7],O=t[8],w=i*f+a*p+u*m,A=r*f+c*p+h*m,E=o*f+l*p+d*m,T=i*g+a*_+u*y,C=r*g+c*_+h*y,x=o*g+l*_+d*y,S=i*b+a*v+u*O,I=r*b+c*v+h*O,P=o*b+l*v+d*O;return n[0]=w,n[1]=A,n[2]=E,n[3]=0,n[4]=T,n[5]=C,n[6]=x,n[7]=0,n[8]=S,n[9]=I,n[10]=P,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},be.multiplyByTranslation=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("translation",t),s.a.typeOf.object("result",n);const i=t.x,r=t.y,o=t.z,a=i*e[0]+r*e[4]+o*e[8]+e[12],c=i*e[1]+r*e[5]+o*e[9]+e[13],l=i*e[2]+r*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=a,n[13]=c,n[14]=l,n[15]=e[15],n},be.multiplyByScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("scale",t),s.a.typeOf.object("result",n);const i=t.x,r=t.y,o=t.z;return 1===i&&1===r&&1===o?be.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=r*e[4],n[5]=r*e[5],n[6]=r*e[6],n[7]=e[7],n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)},be.multiplyByUniformScale=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.number("scale",t),s.a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},be.multiplyByVector=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("cartesian",t),s.a.typeOf.object("result",n);const i=t.x,r=t.y,o=t.z,a=t.w,c=e[0]*i+e[4]*r+e[8]*o+e[12]*a,l=e[1]*i+e[5]*r+e[9]*o+e[13]*a,u=e[2]*i+e[6]*r+e[10]*o+e[14]*a,h=e[3]*i+e[7]*r+e[11]*o+e[15]*a;return n.x=c,n.y=l,n.z=u,n.w=h,n},be.multiplyByPointAsVector=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("cartesian",t),s.a.typeOf.object("result",n);const i=t.x,r=t.y,o=t.z,a=e[0]*i+e[4]*r+e[8]*o,c=e[1]*i+e[5]*r+e[9]*o,l=e[2]*i+e[6]*r+e[10]*o;return n.x=a,n.y=c,n.z=l,n},be.multiplyByPoint=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("cartesian",t),s.a.typeOf.object("result",n);const i=t.x,r=t.y,o=t.z,a=e[0]*i+e[4]*r+e[8]*o+e[12],c=e[1]*i+e[5]*r+e[9]*o+e[13],l=e[2]*i+e[6]*r+e[10]*o+e[14];return n.x=a,n.y=c,n.z=l,n},be.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},be.negate=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},be.transpose=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=e[1],i=e[2],r=e[3],o=e[6],a=e[7],c=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=r,t[13]=a,t[14]=c,t[15]=e[15],t},be.abs=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},be.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},be.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},be.getTranslation=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},be.getMatrix3=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};const Ie=new ce,Pe=new ce,De=new _e,Re=new _e(0,0,0,1);be.inverse=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=e[0],i=e[4],r=e[8],o=e[12],a=e[1],c=e[5],l=e[9],u=e[13],d=e[2],f=e[6],p=e[10],m=e[14],g=e[3],_=e[7],y=e[11],b=e[15];let v=p*b,O=m*y,w=f*b,A=m*_,E=f*y,T=p*_,C=d*b,x=m*g,S=d*y,I=p*g,P=d*_,D=f*g;const R=v*c+A*l+E*u-(O*c+w*l+T*u),j=O*a+C*l+I*u-(v*a+x*l+S*u),M=w*a+x*c+P*u-(A*a+C*c+D*u),L=T*a+S*c+D*l-(E*a+I*c+P*l),N=O*i+w*r+T*o-(v*i+A*r+E*o),B=v*n+x*r+S*o-(O*n+C*r+I*o),F=A*n+C*i+D*o-(w*n+x*i+P*o),z=E*n+I*i+P*r-(T*n+S*i+D*r);v=r*u,O=o*l,w=i*u,A=o*c,E=i*l,T=r*c,C=n*u,x=o*a,S=n*l,I=r*a,P=n*c,D=i*a;const k=v*_+A*y+E*b-(O*_+w*y+T*b),U=O*g+C*y+I*b-(v*g+x*y+S*b),V=w*g+x*_+P*b-(A*g+C*_+D*b),H=T*g+S*_+D*y-(E*g+I*_+P*y),G=w*p+T*m+O*f-(E*m+v*f+A*p),q=S*m+v*d+x*p-(C*p+I*m+O*d),W=C*f+D*m+A*d-(P*m+w*d+x*f),Y=P*p+E*d+I*f-(S*f+D*p+T*d);let X=n*R+i*j+r*M+o*L;if(Math.abs(X)<h.a.EPSILON21){if(ce.equalsEpsilon(be.getMatrix3(e,Ie),Pe,h.a.EPSILON7)&&_e.equals(be.getRow(e,3,De),Re))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new ye.a("matrix is not invertible because its determinate is zero.")}return X=1/X,t[0]=R*X,t[1]=j*X,t[2]=M*X,t[3]=L*X,t[4]=N*X,t[5]=B*X,t[6]=F*X,t[7]=z*X,t[8]=k*X,t[9]=U*X,t[10]=V*X,t[11]=H*X,t[12]=G*X,t[13]=q*X,t[14]=W*X,t[15]=Y*X,t},be.inverseTransformation=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=e[0],i=e[1],r=e[2],o=e[4],a=e[5],c=e[6],l=e[8],u=e[9],h=e[10],d=e[12],f=e[13],p=e[14],m=-n*d-i*f-r*p,g=-o*d-a*f-c*p,_=-l*d-u*f-h*p;return t[0]=n,t[1]=o,t[2]=l,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=r,t[9]=c,t[10]=h,t[11]=0,t[12]=m,t[13]=g,t[14]=_,t[15]=1,t};const je=new be;be.inverseTranspose=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),be.inverse(be.transpose(e,je),t)},be.IDENTITY=Object.freeze(new be(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),be.ZERO=Object.freeze(new be(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),be.COLUMN0ROW0=0,be.COLUMN0ROW1=1,be.COLUMN0ROW2=2,be.COLUMN0ROW3=3,be.COLUMN1ROW0=4,be.COLUMN1ROW1=5,be.COLUMN1ROW2=6,be.COLUMN1ROW3=7,be.COLUMN2ROW0=8,be.COLUMN2ROW1=9,be.COLUMN2ROW2=10,be.COLUMN2ROW3=11,be.COLUMN3ROW0=12,be.COLUMN3ROW1=13,be.COLUMN3ROW2=14,be.COLUMN3ROW3=15,Object.defineProperties(be.prototype,{length:{get:function(){return be.packedLength}}}),be.prototype.clone=function(e){return be.clone(this,e)},be.prototype.equals=function(e){return be.equals(this,e)},be.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},be.prototype.equalsEpsilon=function(e,t){return be.equalsEpsilon(this,e,t)},be.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var Me=be;function Le(e,t,n,i){this.west=Object(c.a)(e,0),this.south=Object(c.a)(t,0),this.east=Object(c.a)(n,0),this.north=Object(c.a)(i,0)}Object.defineProperties(Le.prototype,{width:{get:function(){return Le.computeWidth(this)}},height:{get:function(){return Le.computeHeight(this)}}}),Le.packedLength=4,Le.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},Le.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Le),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},Le.computeWidth=function(e){s.a.typeOf.object("rectangle",e);let t=e.east;const n=e.west;return t<n&&(t+=h.a.TWO_PI),t-n},Le.computeHeight=function(e){return s.a.typeOf.object("rectangle",e),e.north-e.south},Le.fromDegrees=function(e,t,n,i,r){return e=h.a.toRadians(Object(c.a)(e,0)),t=h.a.toRadians(Object(c.a)(t,0)),n=h.a.toRadians(Object(c.a)(n,0)),i=h.a.toRadians(Object(c.a)(i,0)),Object(l.a)(r)?(r.west=e,r.south=t,r.east=n,r.north=i,r):new Le(e,t,n,i)},Le.fromRadians=function(e,t,n,i,r){return Object(l.a)(r)?(r.west=Object(c.a)(e,0),r.south=Object(c.a)(t,0),r.east=Object(c.a)(n,0),r.north=Object(c.a)(i,0),r):new Le(e,t,n,i)},Le.fromCartographicArray=function(e,t){s.a.defined("cartographics",e);let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let t=0,s=e.length;t<s;t++){const s=e[t];n=Math.min(n,s.longitude),i=Math.max(i,s.longitude),a=Math.min(a,s.latitude),c=Math.max(c,s.latitude);const l=s.longitude>=0?s.longitude:s.longitude+h.a.TWO_PI;r=Math.min(r,l),o=Math.max(o,l)}return i-n>o-r&&(n=r,i=o,i>h.a.PI&&(i-=h.a.TWO_PI),n>h.a.PI&&(n-=h.a.TWO_PI)),Object(l.a)(t)?(t.west=n,t.south=a,t.east=i,t.north=c,t):new Le(n,a,i,c)},Le.fromCartesianArray=function(e,t,n){s.a.defined("cartesians",e),t=Object(c.a)(t,H.WGS84);let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let n=0,s=e.length;n<s;n++){const s=t.cartesianToCartographic(e[n]);i=Math.min(i,s.longitude),r=Math.max(r,s.longitude),u=Math.min(u,s.latitude),d=Math.max(d,s.latitude);const c=s.longitude>=0?s.longitude:s.longitude+h.a.TWO_PI;o=Math.min(o,c),a=Math.max(a,c)}return r-i>a-o&&(i=o,r=a,r>h.a.PI&&(r-=h.a.TWO_PI),i>h.a.PI&&(i-=h.a.TWO_PI)),Object(l.a)(n)?(n.west=i,n.south=u,n.east=r,n.north=d,n):new Le(i,u,r,d)},Le.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Le(e.west,e.south,e.east,e.north)},Le.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n},Le.prototype.clone=function(e){return Le.clone(this,e)},Le.prototype.equals=function(e){return Le.equals(this,e)},Le.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Le.prototype.equalsEpsilon=function(e,t){return Le.equalsEpsilon(this,e,t)},Le.validate=function(e){s.a.typeOf.object("rectangle",e);const t=e.north;s.a.typeOf.number.greaterThanOrEquals("north",t,-h.a.PI_OVER_TWO),s.a.typeOf.number.lessThanOrEquals("north",t,h.a.PI_OVER_TWO);const n=e.south;s.a.typeOf.number.greaterThanOrEquals("south",n,-h.a.PI_OVER_TWO),s.a.typeOf.number.lessThanOrEquals("south",n,h.a.PI_OVER_TWO);const i=e.west;s.a.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),s.a.typeOf.number.lessThanOrEquals("west",i,Math.PI);const r=e.east;s.a.typeOf.number.greaterThanOrEquals("east",r,-Math.PI),s.a.typeOf.number.lessThanOrEquals("east",r,Math.PI)},Le.southwest=function(e,t){return s.a.typeOf.object("rectangle",e),Object(l.a)(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new R(e.west,e.south)},Le.northwest=function(e,t){return s.a.typeOf.object("rectangle",e),Object(l.a)(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new R(e.west,e.north)},Le.northeast=function(e,t){return s.a.typeOf.object("rectangle",e),Object(l.a)(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new R(e.east,e.north)},Le.southeast=function(e,t){return s.a.typeOf.object("rectangle",e),Object(l.a)(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new R(e.east,e.south)},Le.center=function(e,t){s.a.typeOf.object("rectangle",e);let n=e.east;const i=e.west;n<i&&(n+=h.a.TWO_PI);const r=h.a.negativePiToPi(.5*(i+n)),o=.5*(e.south+e.north);return Object(l.a)(t)?(t.longitude=r,t.latitude=o,t.height=0,t):new R(r,o)},Le.intersection=function(e,t,n){s.a.typeOf.object("rectangle",e),s.a.typeOf.object("otherRectangle",t);let i=e.east,r=e.west,o=t.east,a=t.west;i<r&&o>0?i+=h.a.TWO_PI:o<a&&i>0&&(o+=h.a.TWO_PI),i<r&&a<0?a+=h.a.TWO_PI:o<a&&r<0&&(r+=h.a.TWO_PI);const c=h.a.negativePiToPi(Math.max(r,a)),u=h.a.negativePiToPi(Math.min(i,o));if((e.west<e.east||t.west<t.east)&&u<=c)return;const d=Math.max(e.south,t.south),f=Math.min(e.north,t.north);return d>=f?void 0:Object(l.a)(n)?(n.west=c,n.south=d,n.east=u,n.north=f,n):new Le(c,d,u,f)},Le.simpleIntersection=function(e,t,n){s.a.typeOf.object("rectangle",e),s.a.typeOf.object("otherRectangle",t);const i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),o=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(r>=a||i>=o))return Object(l.a)(n)?(n.west=i,n.south=r,n.east=o,n.north=a,n):new Le(i,r,o,a)},Le.union=function(e,t,n){s.a.typeOf.object("rectangle",e),s.a.typeOf.object("otherRectangle",t),Object(l.a)(n)||(n=new Le);let i=e.east,r=e.west,o=t.east,a=t.west;i<r&&o>0?i+=h.a.TWO_PI:o<a&&i>0&&(o+=h.a.TWO_PI),i<r&&a<0?a+=h.a.TWO_PI:o<a&&r<0&&(r+=h.a.TWO_PI);const c=h.a.negativePiToPi(Math.min(r,a)),u=h.a.negativePiToPi(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=u,n.north=Math.max(e.north,t.north),n},Le.expand=function(e,t,n){return s.a.typeOf.object("rectangle",e),s.a.typeOf.object("cartographic",t),Object(l.a)(n)||(n=new Le),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},Le.contains=function(e,t){s.a.typeOf.object("rectangle",e),s.a.typeOf.object("cartographic",t);let n=t.longitude;const i=t.latitude,r=e.west;let o=e.east;return o<r&&(o+=h.a.TWO_PI,n<0&&(n+=h.a.TWO_PI)),(n>r||h.a.equalsEpsilon(n,r,h.a.EPSILON14))&&(n<o||h.a.equalsEpsilon(n,o,h.a.EPSILON14))&&i>=e.south&&i<=e.north};const Ne=new R;Le.subsample=function(e,t,n,i){s.a.typeOf.object("rectangle",e),t=Object(c.a)(t,H.WGS84),n=Object(c.a)(n,0),Object(l.a)(i)||(i=[]);let r=0;const o=e.north,a=e.south,u=e.east,d=e.west,f=Ne;f.height=n,f.longitude=d,f.latitude=o,i[r]=t.cartographicToCartesian(f,i[r]),r++,f.longitude=u,i[r]=t.cartographicToCartesian(f,i[r]),r++,f.latitude=a,i[r]=t.cartographicToCartesian(f,i[r]),r++,f.longitude=d,i[r]=t.cartographicToCartesian(f,i[r]),r++,f.latitude=o<0?o:a>0?a:0;for(let n=1;n<8;++n)f.longitude=-Math.PI+n*h.a.PI_OVER_TWO,Le.contains(e,f)&&(i[r]=t.cartographicToCartesian(f,i[r]),r++);return 0===f.latitude&&(f.longitude=d,i[r]=t.cartographicToCartesian(f,i[r]),r++,f.longitude=u,i[r]=t.cartographicToCartesian(f,i[r]),r++),i.length=r,i},Le.subsection=function(e,t,n,i,r,o){if(s.a.typeOf.object("rectangle",e),s.a.typeOf.number.greaterThanOrEquals("westLerp",t,0),s.a.typeOf.number.lessThanOrEquals("westLerp",t,1),s.a.typeOf.number.greaterThanOrEquals("southLerp",n,0),s.a.typeOf.number.lessThanOrEquals("southLerp",n,1),s.a.typeOf.number.greaterThanOrEquals("eastLerp",i,0),s.a.typeOf.number.lessThanOrEquals("eastLerp",i,1),s.a.typeOf.number.greaterThanOrEquals("northLerp",r,0),s.a.typeOf.number.lessThanOrEquals("northLerp",r,1),s.a.typeOf.number.lessThanOrEquals("westLerp",t,i),s.a.typeOf.number.lessThanOrEquals("southLerp",n,r),Object(l.a)(o)||(o=new Le),e.west<=e.east){const n=e.east-e.west;o.west=e.west+t*n,o.east=e.west+i*n}else{const n=h.a.TWO_PI+e.east-e.west;o.west=h.a.negativePiToPi(e.west+t*n),o.east=h.a.negativePiToPi(e.west+i*n)}const a=e.north-e.south;return o.south=e.south+n*a,o.north=e.south+r*a,1===t&&(o.west=e.east),1===i&&(o.east=e.east),1===n&&(o.south=e.north),1===r&&(o.north=e.north),o},Le.MAX_VALUE=Object.freeze(new Le(-Math.PI,-h.a.PI_OVER_TWO,Math.PI,h.a.PI_OVER_TWO));var Be=Le;function Fe(e,t){this.center=O.clone(Object(c.a)(e,O.ZERO)),this.radius=Object(c.a)(t,0)}const ze=new O,ke=new O,Ue=new O,Ve=new O,He=new O,Ge=new O,qe=new O,We=new O,Ye=new O,Xe=new O,Ke=new O,Je=new O,Ze=4/3*h.a.PI;Fe.fromPoints=function(e,t){if(Object(l.a)(t)||(t=new Fe),!Object(l.a)(e)||0===e.length)return t.center=O.clone(O.ZERO,t.center),t.radius=0,t;const n=O.clone(e[0],qe),i=O.clone(n,ze),r=O.clone(n,ke),o=O.clone(n,Ue),a=O.clone(n,Ve),s=O.clone(n,He),c=O.clone(n,Ge),u=e.length;let h;for(h=1;h<u;h++){O.clone(e[h],n);const t=n.x,l=n.y,u=n.z;t<i.x&&O.clone(n,i),t>a.x&&O.clone(n,a),l<r.y&&O.clone(n,r),l>s.y&&O.clone(n,s),u<o.z&&O.clone(n,o),u>c.z&&O.clone(n,c)}const d=O.magnitudeSquared(O.subtract(a,i,We)),f=O.magnitudeSquared(O.subtract(s,r,We)),p=O.magnitudeSquared(O.subtract(c,o,We));let m=i,g=a,_=d;f>_&&(_=f,m=r,g=s),p>_&&(_=p,m=o,g=c);const y=Ye;y.x=.5*(m.x+g.x),y.y=.5*(m.y+g.y),y.z=.5*(m.z+g.z);let b=O.magnitudeSquared(O.subtract(g,y,We)),v=Math.sqrt(b);const w=Xe;w.x=i.x,w.y=r.y,w.z=o.z;const A=Ke;A.x=a.x,A.y=s.y,A.z=c.z;const E=O.midpoint(w,A,Je);let T=0;for(h=0;h<u;h++){O.clone(e[h],n);const t=O.magnitude(O.subtract(n,E,We));t>T&&(T=t);const i=O.magnitudeSquared(O.subtract(n,y,We));if(i>b){const e=Math.sqrt(i);v=.5*(v+e),b=v*v;const t=e-v;y.x=(v*y.x+t*n.x)/e,y.y=(v*y.y+t*n.y)/e,y.z=(v*y.z+t*n.z)/e}}return v<T?(O.clone(y,t.center),t.radius=v):(O.clone(E,t.center),t.radius=T),t};const $e=new q,Qe=new O,et=new O,tt=new R,nt=new R;Fe.fromRectangle2D=function(e,t,n){return Fe.fromRectangleWithHeights2D(e,t,0,0,n)},Fe.fromRectangleWithHeights2D=function(e,t,n,i,r){if(Object(l.a)(r)||(r=new Fe),!Object(l.a)(e))return r.center=O.clone(O.ZERO,r.center),r.radius=0,r;t=Object(c.a)(t,$e),Be.southwest(e,tt),tt.height=n,Be.northeast(e,nt),nt.height=i;const o=t.project(tt,Qe),a=t.project(nt,et),s=a.x-o.x,u=a.y-o.y,h=a.z-o.z;r.radius=.5*Math.sqrt(s*s+u*u+h*h);const d=r.center;return d.x=o.x+.5*s,d.y=o.y+.5*u,d.z=o.z+.5*h,r};const it=[];Fe.fromRectangle3D=function(e,t,n,i){if(t=Object(c.a)(t,H.WGS84),n=Object(c.a)(n,0),Object(l.a)(i)||(i=new Fe),!Object(l.a)(e))return i.center=O.clone(O.ZERO,i.center),i.radius=0,i;const r=Be.subsample(e,t,n,it);return Fe.fromPoints(r,i)},Fe.fromVertices=function(e,t,n,i){if(Object(l.a)(i)||(i=new Fe),!Object(l.a)(e)||0===e.length)return i.center=O.clone(O.ZERO,i.center),i.radius=0,i;t=Object(c.a)(t,O.ZERO),n=Object(c.a)(n,3),s.a.typeOf.number.greaterThanOrEquals("stride",n,3);const r=qe;r.x=e[0]+t.x,r.y=e[1]+t.y,r.z=e[2]+t.z;const o=O.clone(r,ze),a=O.clone(r,ke),u=O.clone(r,Ue),h=O.clone(r,Ve),d=O.clone(r,He),f=O.clone(r,Ge),p=e.length;let m;for(m=0;m<p;m+=n){const n=e[m]+t.x,i=e[m+1]+t.y,s=e[m+2]+t.z;r.x=n,r.y=i,r.z=s,n<o.x&&O.clone(r,o),n>h.x&&O.clone(r,h),i<a.y&&O.clone(r,a),i>d.y&&O.clone(r,d),s<u.z&&O.clone(r,u),s>f.z&&O.clone(r,f)}const g=O.magnitudeSquared(O.subtract(h,o,We)),_=O.magnitudeSquared(O.subtract(d,a,We)),y=O.magnitudeSquared(O.subtract(f,u,We));let b=o,v=h,w=g;_>w&&(w=_,b=a,v=d),y>w&&(w=y,b=u,v=f);const A=Ye;A.x=.5*(b.x+v.x),A.y=.5*(b.y+v.y),A.z=.5*(b.z+v.z);let E=O.magnitudeSquared(O.subtract(v,A,We)),T=Math.sqrt(E);const C=Xe;C.x=o.x,C.y=a.y,C.z=u.z;const x=Ke;x.x=h.x,x.y=d.y,x.z=f.z;const S=O.midpoint(C,x,Je);let I=0;for(m=0;m<p;m+=n){r.x=e[m]+t.x,r.y=e[m+1]+t.y,r.z=e[m+2]+t.z;const n=O.magnitude(O.subtract(r,S,We));n>I&&(I=n);const i=O.magnitudeSquared(O.subtract(r,A,We));if(i>E){const e=Math.sqrt(i);T=.5*(T+e),E=T*T;const t=e-T;A.x=(T*A.x+t*r.x)/e,A.y=(T*A.y+t*r.y)/e,A.z=(T*A.z+t*r.z)/e}}return T<I?(O.clone(A,i.center),i.radius=T):(O.clone(S,i.center),i.radius=I),i},Fe.fromEncodedCartesianVertices=function(e,t,n){if(Object(l.a)(n)||(n=new Fe),!Object(l.a)(e)||!Object(l.a)(t)||e.length!==t.length||0===e.length)return n.center=O.clone(O.ZERO,n.center),n.radius=0,n;const i=qe;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const r=O.clone(i,ze),o=O.clone(i,ke),a=O.clone(i,Ue),s=O.clone(i,Ve),c=O.clone(i,He),u=O.clone(i,Ge),h=e.length;let d;for(d=0;d<h;d+=3){const n=e[d]+t[d],l=e[d+1]+t[d+1],h=e[d+2]+t[d+2];i.x=n,i.y=l,i.z=h,n<r.x&&O.clone(i,r),n>s.x&&O.clone(i,s),l<o.y&&O.clone(i,o),l>c.y&&O.clone(i,c),h<a.z&&O.clone(i,a),h>u.z&&O.clone(i,u)}const f=O.magnitudeSquared(O.subtract(s,r,We)),p=O.magnitudeSquared(O.subtract(c,o,We)),m=O.magnitudeSquared(O.subtract(u,a,We));let g=r,_=s,y=f;p>y&&(y=p,g=o,_=c),m>y&&(y=m,g=a,_=u);const b=Ye;b.x=.5*(g.x+_.x),b.y=.5*(g.y+_.y),b.z=.5*(g.z+_.z);let v=O.magnitudeSquared(O.subtract(_,b,We)),w=Math.sqrt(v);const A=Xe;A.x=r.x,A.y=o.y,A.z=a.z;const E=Ke;E.x=s.x,E.y=c.y,E.z=u.z;const T=O.midpoint(A,E,Je);let C=0;for(d=0;d<h;d+=3){i.x=e[d]+t[d],i.y=e[d+1]+t[d+1],i.z=e[d+2]+t[d+2];const n=O.magnitude(O.subtract(i,T,We));n>C&&(C=n);const r=O.magnitudeSquared(O.subtract(i,b,We));if(r>v){const e=Math.sqrt(r);w=.5*(w+e),v=w*w;const t=e-w;b.x=(w*b.x+t*i.x)/e,b.y=(w*b.y+t*i.y)/e,b.z=(w*b.z+t*i.z)/e}}return w<C?(O.clone(b,n.center),n.radius=w):(O.clone(T,n.center),n.radius=C),n},Fe.fromCornerPoints=function(e,t,n){s.a.typeOf.object("corner",e),s.a.typeOf.object("oppositeCorner",t),Object(l.a)(n)||(n=new Fe);const i=O.midpoint(e,t,n.center);return n.radius=O.distance(i,t),n},Fe.fromEllipsoid=function(e,t){return s.a.typeOf.object("ellipsoid",e),Object(l.a)(t)||(t=new Fe),O.clone(O.ZERO,t.center),t.radius=e.maximumRadius,t};const rt=new O;Fe.fromBoundingSpheres=function(e,t){if(Object(l.a)(t)||(t=new Fe),!Object(l.a)(e)||0===e.length)return t.center=O.clone(O.ZERO,t.center),t.radius=0,t;const n=e.length;if(1===n)return Fe.clone(e[0],t);if(2===n)return Fe.union(e[0],e[1],t);const i=[];let r;for(r=0;r<n;r++)i.push(e[r].center);const o=(t=Fe.fromPoints(i,t)).center;let a=t.radius;for(r=0;r<n;r++){const t=e[r];a=Math.max(a,O.distance(o,t.center,rt)+t.radius)}return t.radius=a,t};const ot=new O,at=new O,st=new O;Fe.fromOrientedBoundingBox=function(e,t){s.a.defined("orientedBoundingBox",e),Object(l.a)(t)||(t=new Fe);const n=e.halfAxes,i=ce.getColumn(n,0,ot),r=ce.getColumn(n,1,at),o=ce.getColumn(n,2,st);return O.add(i,r,i),O.add(i,o,i),t.center=O.clone(e.center,t.center),t.radius=O.magnitude(i),t};const ct=new O,lt=new O;Fe.fromTransformation=function(e,t){s.a.typeOf.object("transformation",e),Object(l.a)(t)||(t=new Fe);const n=Me.getTranslation(e,ct),i=Me.getScale(e,lt),r=.5*O.magnitude(i);return t.center=O.clone(n,t.center),t.radius=r,t},Fe.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.center=O.clone(e.center,t.center),t.radius=e.radius,t):new Fe(e.center,e.radius)},Fe.packedLength=4,Fe.pack=function(e,t,n){s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0);const i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},Fe.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Fe);const i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};const ut=new O,ht=new O;Fe.union=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),Object(l.a)(n)||(n=new Fe);const i=e.center,r=e.radius,o=t.center,a=t.radius,c=O.subtract(o,i,ut),u=O.magnitude(c);if(r>=u+a)return e.clone(n),n;if(a>=u+r)return t.clone(n),n;const h=.5*(r+u+a),d=O.multiplyByScalar(c,(-r+h)/u,ht);return O.add(d,i,d),O.clone(d,n.center),n.radius=h,n};const dt=new O;Fe.expand=function(e,t,n){s.a.typeOf.object("sphere",e),s.a.typeOf.object("point",t),n=Fe.clone(e,n);const i=O.magnitude(O.subtract(t,n.center,dt));return i>n.radius&&(n.radius=i),n},Fe.intersectPlane=function(e,t){s.a.typeOf.object("sphere",e),s.a.typeOf.object("plane",t);const n=e.center,i=e.radius,r=t.normal,o=O.dot(r,n)+t.distance;return o<-i?W.OUTSIDE:o<i?W.INTERSECTING:W.INSIDE},Fe.transform=function(e,t,n){return s.a.typeOf.object("sphere",e),s.a.typeOf.object("transform",t),Object(l.a)(n)||(n=new Fe),n.center=Me.multiplyByPoint(t,e.center,n.center),n.radius=Me.getMaximumScale(t)*e.radius,n};const ft=new O;Fe.distanceSquaredTo=function(e,t){s.a.typeOf.object("sphere",e),s.a.typeOf.object("cartesian",t);const n=O.subtract(e.center,t,ft),i=O.magnitude(n)-e.radius;return i<=0?0:i*i},Fe.transformWithoutScale=function(e,t,n){return s.a.typeOf.object("sphere",e),s.a.typeOf.object("transform",t),Object(l.a)(n)||(n=new Fe),n.center=Me.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const pt=new O;Fe.computePlaneDistances=function(e,t,n,i){s.a.typeOf.object("sphere",e),s.a.typeOf.object("position",t),s.a.typeOf.object("direction",n),Object(l.a)(i)||(i=new Y);const r=O.subtract(e.center,t,pt),o=O.dot(n,r);return i.start=o-e.radius,i.stop=o+e.radius,i};const mt=new O,gt=new O,_t=new O,yt=new O,bt=new O,vt=new R,Ot=new Array(8);for(let e=0;e<8;++e)Ot[e]=new O;const wt=new q;Fe.projectTo2D=function(e,t,n){s.a.typeOf.object("sphere",e);const i=(t=Object(c.a)(t,wt)).ellipsoid;let r=e.center;const o=e.radius;let a;a=O.equals(r,O.ZERO)?O.clone(O.UNIT_X,mt):i.geodeticSurfaceNormal(r,mt);const l=O.cross(O.UNIT_Z,a,gt);O.normalize(l,l);const u=O.cross(a,l,_t);O.normalize(u,u),O.multiplyByScalar(a,o,a),O.multiplyByScalar(u,o,u),O.multiplyByScalar(l,o,l);const h=O.negate(u,bt),d=O.negate(l,yt),f=Ot;let p=f[0];O.add(a,u,p),O.add(p,l,p),p=f[1],O.add(a,u,p),O.add(p,d,p),p=f[2],O.add(a,h,p),O.add(p,d,p),p=f[3],O.add(a,h,p),O.add(p,l,p),O.negate(a,a),p=f[4],O.add(a,u,p),O.add(p,l,p),p=f[5],O.add(a,u,p),O.add(p,d,p),p=f[6],O.add(a,h,p),O.add(p,d,p),p=f[7],O.add(a,h,p),O.add(p,l,p);const m=f.length;for(let e=0;e<m;++e){const n=f[e];O.add(r,n,n);const o=i.cartesianToCartographic(n,vt);t.project(o,n)}r=(n=Fe.fromPoints(f,n)).center;const g=r.x,_=r.y,y=r.z;return r.x=y,r.y=g,r.z=_,n},Fe.isOccluded=function(e,t){return s.a.typeOf.object("sphere",e),s.a.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},Fe.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&O.equals(e.center,t.center)&&e.radius===t.radius},Fe.prototype.intersectPlane=function(e){return Fe.intersectPlane(this,e)},Fe.prototype.distanceSquaredTo=function(e){return Fe.distanceSquaredTo(this,e)},Fe.prototype.computePlaneDistances=function(e,t,n){return Fe.computePlaneDistances(this,e,t,n)},Fe.prototype.isOccluded=function(e){return Fe.isOccluded(this,e)},Fe.prototype.equals=function(e){return Fe.equals(this,e)},Fe.prototype.clone=function(e){return Fe.clone(this,e)},Fe.prototype.volume=function(){const e=this.radius;return Ze*e*e*e};var At=Fe,Et=n(20),Tt=n(7);const Ct=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;let xt,St,It;function Pt(e){return"undefined"==typeof document?e:(Object(l.a)(xt)||(xt=document.createElement("a")),xt.href=e,xt.href=xt.href,xt.href)}function Dt(){if(Object(l.a)(St))return St;let e;if(e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&Object(l.a)(n(38))&&!n(38).toUrlUndefined&&Object(l.a)(n(48).toUrl)?Object(Et.a)("..",Mt("Core/buildModuleUrl.js")):function(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const n=e[t].getAttribute("src"),i=Ct.exec(n);if(null!==i)return i[1]}}(),!Object(l.a)(e))throw new u.a("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return St=new Tt.a({url:Pt(e)}),St.appendForwardSlash(),St}function Rt(e){return Pt(n(48).toUrl("../"+e))}function jt(e){return Dt().getDerivedResource({url:e}).url}function Mt(e){Object(l.a)(It)||(It="object"==typeof define&&Object(l.a)(n(38))&&!n(38).toUrlUndefined&&Object(l.a)(n(48).toUrl)?Rt:jt);return It(e)}Mt._cesiumScriptRegex=Ct,Mt._buildModuleUrlFromBaseUrl=jt,Mt._clearBaseResource=function(){St=void 0},Mt.setBaseUrl=function(e){St=Tt.a.DEFAULT.getDerivedResource({url:e})},Mt.getCesiumBaseUrl=Dt;var Lt=Mt;function Nt(e,t){this.x=Object(c.a)(e,0),this.y=Object(c.a)(t,0)}Nt.fromElements=function(e,t,n){return Object(l.a)(n)?(n.x=e,n.y=t,n):new Nt(e,t)},Nt.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.x=e.x,t.y=e.y,t):new Nt(e.x,e.y)},Nt.fromCartesian3=Nt.clone,Nt.fromCartesian4=Nt.clone,Nt.packedLength=2,Nt.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.x,t[n]=e.y,t},Nt.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Nt),n.x=e[t++],n.y=e[t],n},Nt.packArray=function(e,t){s.a.defined("array",e);const n=e.length,i=2*n;if(Object(l.a)(t)){if(!Array.isArray(t)&&t.length!==i)throw new u.a("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(let i=0;i<n;++i)Nt.pack(e[i],t,2*i);return t},Nt.unpackArray=function(e,t){if(s.a.defined("array",e),s.a.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!=0)throw new u.a("array length must be a multiple of 2.");const n=e.length;Object(l.a)(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){const n=i/2;t[n]=Nt.unpack(e,i,t[n])}return t},Nt.fromArray=Nt.unpack,Nt.maximumComponent=function(e){return s.a.typeOf.object("cartesian",e),Math.max(e.x,e.y)},Nt.minimumComponent=function(e){return s.a.typeOf.object("cartesian",e),Math.min(e.x,e.y)},Nt.minimumByComponent=function(e,t,n){return s.a.typeOf.object("first",e),s.a.typeOf.object("second",t),s.a.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},Nt.maximumByComponent=function(e,t,n){return s.a.typeOf.object("first",e),s.a.typeOf.object("second",t),s.a.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},Nt.clamp=function(e,t,n,i){s.a.typeOf.object("value",e),s.a.typeOf.object("min",t),s.a.typeOf.object("max",n),s.a.typeOf.object("result",i);const r=h.a.clamp(e.x,t.x,n.x),o=h.a.clamp(e.y,t.y,n.y);return i.x=r,i.y=o,i},Nt.magnitudeSquared=function(e){return s.a.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},Nt.magnitude=function(e){return Math.sqrt(Nt.magnitudeSquared(e))};const Bt=new Nt;Nt.distance=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),Nt.subtract(e,t,Bt),Nt.magnitude(Bt)},Nt.distanceSquared=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),Nt.subtract(e,t,Bt),Nt.magnitudeSquared(Bt)},Nt.normalize=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=Nt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new u.a("normalized result is not a number");return t},Nt.dot=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),e.x*t.x+e.y*t.y},Nt.cross=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),e.x*t.y-e.y*t.x},Nt.multiplyComponents=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n},Nt.divideComponents=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n},Nt.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n},Nt.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n},Nt.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("cartesian",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n},Nt.divideByScalar=function(e,t,n){return s.a.typeOf.object("cartesian",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n},Nt.negate=function(e,t){return s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},Nt.abs=function(e,t){return s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const Ft=new Nt;Nt.lerp=function(e,t,n,i){return s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i),Nt.multiplyByScalar(t,n,Ft),i=Nt.multiplyByScalar(e,1-n,i),Nt.add(Ft,i,i)};const zt=new Nt,kt=new Nt;Nt.angleBetween=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),Nt.normalize(e,zt),Nt.normalize(t,kt),h.a.acosClamped(Nt.dot(zt,kt))};const Ut=new Nt;Nt.mostOrthogonalAxis=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=Nt.normalize(e,Ut);return Nt.abs(n,n),t=n.x<=n.y?Nt.clone(Nt.UNIT_X,t):Nt.clone(Nt.UNIT_Y,t)},Nt.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.x===t.x&&e.y===t.y},Nt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},Nt.equalsEpsilon=function(e,t,n,i){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&h.a.equalsEpsilon(e.x,t.x,n,i)&&h.a.equalsEpsilon(e.y,t.y,n,i)},Nt.ZERO=Object.freeze(new Nt(0,0)),Nt.ONE=Object.freeze(new Nt(1,1)),Nt.UNIT_X=Object.freeze(new Nt(1,0)),Nt.UNIT_Y=Object.freeze(new Nt(0,1)),Nt.prototype.clone=function(e){return Nt.clone(this,e)},Nt.prototype.equals=function(e){return Nt.equals(this,e)},Nt.prototype.equalsEpsilon=function(e,t,n){return Nt.equalsEpsilon(this,e,t,n)},Nt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var Vt=Nt;function Ht(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._rectangle=Object(c.a)(e.rectangle,Be.MAX_VALUE),this._projection=new q(this._ellipsoid),this._numberOfLevelZeroTilesX=Object(c.a)(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=Object(c.a)(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Ht.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Ht.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},Ht.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},Ht.prototype.rectangleToNativeRectangle=function(e,t){s.a.defined("rectangle",e);const n=h.a.toDegrees(e.west),i=h.a.toDegrees(e.south),r=h.a.toDegrees(e.east),o=h.a.toDegrees(e.north);return Object(l.a)(t)?(t.west=n,t.south=i,t.east=r,t.north=o,t):new Be(n,i,r,o)},Ht.prototype.tileXYToNativeRectangle=function(e,t,n,i){const r=this.tileXYToRectangle(e,t,n,i);return r.west=h.a.toDegrees(r.west),r.south=h.a.toDegrees(r.south),r.east=h.a.toDegrees(r.east),r.north=h.a.toDegrees(r.north),r},Ht.prototype.tileXYToRectangle=function(e,t,n,i){const r=this._rectangle,o=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),s=r.width/o,c=e*s+r.west,u=(e+1)*s+r.west,h=r.height/a,d=r.north-t*h,f=r.north-(t+1)*h;return Object(l.a)(i)||(i=new Be(c,f,u,d)),i.west=c,i.south=f,i.east=u,i.north=d,i},Ht.prototype.positionToTileXY=function(e,t,n){const i=this._rectangle;if(!Be.contains(i,e))return;const r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=i.width/r,s=i.height/o;let c=e.longitude;i.east<i.west&&(c+=h.a.TWO_PI);let u=(c-i.west)/a|0;u>=r&&(u=r-1);let d=(i.north-e.latitude)/s|0;return d>=o&&(d=o-1),Object(l.a)(n)?(n.x=u,n.y=d,n):new Vt(u,d)};var Gt=Ht;const qt=new O,Wt=new O,Yt=new R,Xt=new O,Kt=new O,Jt=new At,Zt=new Gt,$t=[new R,new R,new R,new R],Qt=new Vt,en={};function tn(e){R.fromRadians(e.east,e.north,0,$t[0]),R.fromRadians(e.west,e.north,0,$t[1]),R.fromRadians(e.east,e.south,0,$t[2]),R.fromRadians(e.west,e.south,0,$t[3]);let t=0,n=0,i=0,r=0;const o=en._terrainHeightsMaxLevel;let a;for(a=0;a<=o;++a){let e=!1;for(let t=0;t<4;++t){const n=$t[t];if(Zt.positionToTileXY(n,a,Qt),0===t)i=Qt.x,r=Qt.y;else if(i!==Qt.x||r!==Qt.y){e=!0;break}}if(e)break;t=i,n=r}if(0!==a)return{x:t,y:n,level:a>o?o:a-1}}en.initialize=function(){let e=en._initPromise;return Object(l.a)(e)||(e=Tt.a.fetchJson(Lt("Assets/approximateTerrainHeights.json")).then((function(e){en._terrainHeights=e})),en._initPromise=e),e},en.getMinimumMaximumHeights=function(e,t){if(s.a.defined("rectangle",e),!Object(l.a)(en._terrainHeights))throw new u.a("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=Object(c.a)(t,H.WGS84);const n=tn(e);let i=en._defaultMinTerrainHeight,r=en._defaultMaxTerrainHeight;if(Object(l.a)(n)){const o=`${n.level}-${n.x}-${n.y}`,a=en._terrainHeights[o];Object(l.a)(a)&&(i=a[0],r=a[1]),t.cartographicToCartesian(Be.northeast(e,Yt),qt),t.cartographicToCartesian(Be.southwest(e,Yt),Wt),O.midpoint(Wt,qt,Xt);const s=t.scaleToGeodeticSurface(Xt,Kt);if(Object(l.a)(s)){const e=O.distance(Xt,s);i=Math.min(i,-e)}else i=en._defaultMinTerrainHeight}return i=Math.max(en._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}},en.getBoundingSphere=function(e,t){if(s.a.defined("rectangle",e),!Object(l.a)(en._terrainHeights))throw new u.a("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=Object(c.a)(t,H.WGS84);const n=tn(e);let i=en._defaultMaxTerrainHeight;if(Object(l.a)(n)){const e=`${n.level}-${n.x}-${n.y}`,t=en._terrainHeights[e];Object(l.a)(t)&&(i=t[1])}const r=At.fromRectangle3D(e,t,0);return At.fromRectangle3D(e,t,i,Jt),At.union(r,Jt,r)},en._terrainHeightsMaxLevel=6,en._defaultMaxTerrainHeight=9e3,en._defaultMinTerrainHeight=-1e5,en._terrainHeights=void 0,en._initPromise=void 0,Object.defineProperties(en,{initialized:{get:function(){return Object(l.a)(en._terrainHeights)}}});var nn=en,rn=n(71),on=n.n(rn);let an=0;const sn={};function cn(e,t){let n;s.a.typeOf.string("html",e);const i=e;Object(l.a)(sn[i])?n=sn[i]:(n=an++,sn[i]=n),t=Object(c.a)(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(cn.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!Object(l.a)(this._element)){const e=on.a.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;const n=t.querySelectorAll("a");for(let e=0;e<n.length;e++)n[e].setAttribute("target","_blank");this._element=t}return this._element}}}),cn.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen},cn.prototype.equals=function(e){return cn.equals(this,e)},cn.getIonCredit=function(e){const t=Object(l.a)(e.collapsible)&&!e.collapsible,n=new cn(e.html,t);return n._isIon=-1!==n.html.indexOf("ion-credit.png"),n},cn.clone=function(e){if(Object(l.a)(e))return new cn(e.html,e.showOnScreen)};var ln=cn,un=n(6);var hn=Object.freeze({NONE:0,LERC:1});function dn(e,t,n){this.minimum=O.clone(Object(c.a)(e,O.ZERO)),this.maximum=O.clone(Object(c.a)(t,O.ZERO)),n=Object(l.a)(n)?O.clone(n):O.midpoint(this.minimum,this.maximum,new O),this.center=n}dn.fromCorners=function(e,t,n){return s.a.defined("minimum",e),s.a.defined("maximum",t),Object(l.a)(n)||(n=new dn),n.minimum=O.clone(e,n.minimum),n.maximum=O.clone(t,n.maximum),n.center=O.midpoint(e,t,n.center),n},dn.fromPoints=function(e,t){if(Object(l.a)(t)||(t=new dn),!Object(l.a)(e)||0===e.length)return t.minimum=O.clone(O.ZERO,t.minimum),t.maximum=O.clone(O.ZERO,t.maximum),t.center=O.clone(O.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,a=e[0].y,s=e[0].z;const c=e.length;for(let t=1;t<c;t++){const c=e[t],l=c.x,u=c.y,h=c.z;n=Math.min(l,n),o=Math.max(l,o),i=Math.min(u,i),a=Math.max(u,a),r=Math.min(h,r),s=Math.max(h,s)}const u=t.minimum;u.x=n,u.y=i,u.z=r;const h=t.maximum;return h.x=o,h.y=a,h.z=s,t.center=O.midpoint(u,h,t.center),t},dn.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.minimum=O.clone(e.minimum,t.minimum),t.maximum=O.clone(e.maximum,t.maximum),t.center=O.clone(e.center,t.center),t):new dn(e.minimum,e.maximum,e.center)},dn.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&O.equals(e.center,t.center)&&O.equals(e.minimum,t.minimum)&&O.equals(e.maximum,t.maximum)};let fn=new O;dn.intersectPlane=function(e,t){s.a.defined("box",e),s.a.defined("plane",t),fn=O.subtract(e.maximum,e.minimum,fn);const n=O.multiplyByScalar(fn,.5,fn),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=O.dot(e.center,i)+t.distance;return o-r>0?W.INSIDE:o+r<0?W.OUTSIDE:W.INTERSECTING},dn.prototype.clone=function(e){return dn.clone(this,e)},dn.prototype.intersectPlane=function(e){return dn.intersectPlane(this,e)},dn.prototype.equals=function(e){return dn.equals(this,e)};var pn=dn;function mn(e,t){s.a.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new O,this._cameraPositionInScaledSpace=new O,this._distanceToLimbInScaledSpaceSquared=0,Object(l.a)(t)&&(this.cameraPosition=t)}Object.defineProperties(mn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){const t=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=O.magnitudeSquared(t)-1;O.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=t,this._distanceToLimbInScaledSpaceSquared=n}}});const gn=new O;mn.prototype.isPointVisible=function(e){return Tn(this._ellipsoid.transformPositionToScaledSpace(e,gn),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},mn.prototype.isScaledSpacePointVisible=function(e){return Tn(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const _n=new O;mn.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,r;return Object(l.a)(t)&&t<0&&n.minimumRadius>-t?(r=_n,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),Tn(e,r,i)},mn.prototype.computeHorizonCullingPoint=function(e,t,n){return wn(this._ellipsoid,e,t,n)};const yn=H.clone(H.UNIT_SPHERE);mn.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){return wn(On(this._ellipsoid,n,yn),e,t,i)},mn.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return En(this._ellipsoid,e,t,n,i,r)},mn.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){return En(On(this._ellipsoid,r,yn),e,t,n,i,o)};const bn=[];mn.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){s.a.typeOf.object("rectangle",e);const i=Be.subsample(e,t,0,bn),r=At.fromPoints(i);if(!(O.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};const vn=new O;function On(e,t,n){if(Object(l.a)(t)&&t<0&&e.minimumRadius>-t){const i=O.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,vn);e=H.fromCartesian3(i,n)}return e}function wn(e,t,n,i){s.a.typeOf.object("directionToPoint",t),s.a.defined("positions",n),Object(l.a)(i)||(i=new O);const r=Dn(e,t);let o=0;for(let t=0,i=n.length;t<i;++t){const i=Sn(e,n[t],r);if(i<0)return;o=Math.max(o,i)}return In(r,o,i)}const An=new O;function En(e,t,n,i,r,o){s.a.typeOf.object("directionToPoint",t),s.a.defined("vertices",n),s.a.typeOf.number("stride",i),Object(l.a)(o)||(o=new O),i=Object(c.a)(i,3),r=Object(c.a)(r,O.ZERO);const a=Dn(e,t);let u=0;for(let t=0,o=n.length;t<o;t+=i){An.x=n[t]+r.x,An.y=n[t+1]+r.y,An.z=n[t+2]+r.z;const i=Sn(e,An,a);if(i<0)return;u=Math.max(u,i)}return In(a,u,o)}function Tn(e,t,n){const i=t,r=n,o=O.subtract(e,i,gn),a=-O.dot(o,i);return!(r<0?a>0:a>r&&a*a/O.magnitudeSquared(o)>r)}const Cn=new O,xn=new O;function Sn(e,t,n){const i=e.transformPositionToScaledSpace(t,Cn);let r=O.magnitudeSquared(i),o=Math.sqrt(r);const a=O.divideByScalar(i,o,xn);r=Math.max(1,r),o=Math.max(1,o);const s=1/o;return 1/(O.dot(a,n)*s-O.magnitude(O.cross(a,n,a))*(Math.sqrt(r-1)*s))}function In(e,t,n){if(!(t<=0||t===1/0||t!=t))return O.multiplyByScalar(e,t,n)}const Pn=new O;function Dn(e,t){return O.equals(t,O.ZERO)?t:(e.transformPositionToScaledSpace(t,Pn),O.normalize(Pn,Pn))}var Rn=mn;const jn={};function Mn(e,t,n){const i=e+t;return h.a.sign(e)!==h.a.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}jn.computeDiscriminant=function(e,t,n){if("number"!=typeof e)throw new u.a("a is a required number.");if("number"!=typeof t)throw new u.a("b is a required number.");if("number"!=typeof n)throw new u.a("c is a required number.");return t*t-4*e*n},jn.computeRealRoots=function(e,t,n){if("number"!=typeof e)throw new u.a("a is a required number.");if("number"!=typeof t)throw new u.a("b is a required number.");if("number"!=typeof n)throw new u.a("c is a required number.");let i;if(0===e)return 0===t?[]:[-n/t];if(0===t){if(0===n)return[0,0];const t=Math.abs(n),r=Math.abs(e);if(t<r&&t/r<h.a.EPSILON14)return[0,0];if(t>r&&r/t<h.a.EPSILON14)return[];if(i=-n/e,i<0)return[];const o=Math.sqrt(i);return[-o,o]}if(0===n)return i=-t/e,i<0?[i,0]:[0,i];const r=Mn(t*t,-(4*e*n),h.a.EPSILON14);if(r<0)return[];const o=-.5*Mn(t,h.a.sign(t)*Math.sqrt(r),h.a.EPSILON14);return t>0?[o/e,n/o]:[n/o,o/e]};var Ln=jn;const Nn={};function Bn(e,t,n,i){const r=e,o=t/3,a=n/3,s=i,c=r*a,l=o*s,u=o*o,h=a*a,d=r*a-u,f=r*s-o*a,p=o*s-h,m=4*d*p-f*f;let g,_;if(m<0){let e,t,n;u*l>=c*h?(e=r,t=d,n=-2*o*d+r*f):(e=s,t=p,n=-s*f+2*a*p);const i=-(n<0?-1:1)*Math.abs(e)*Math.sqrt(-m);_=-n+i;const y=_/2,b=y<0?-Math.pow(-y,1/3):Math.pow(y,1/3),v=_===i?-b:-t/b;return g=t<=0?b+v:-n/(b*b+v*v+t),u*l>=c*h?[(g-o)/r]:[-s/(g+a)]}const y=d,b=-2*o*d+r*f,v=p,O=-s*f+2*a*p,w=Math.sqrt(m),A=Math.sqrt(3)/2;let E=Math.abs(Math.atan2(r*w,-b)/3);g=2*Math.sqrt(-y);let T=Math.cos(E);_=g*T;let C=g*(-T/2-A*Math.sin(E));const x=_+C>2*o?_-o:C-o,S=r,I=x/S;E=Math.abs(Math.atan2(s*w,-O)/3),g=2*Math.sqrt(-v),T=Math.cos(E),_=g*T,C=g*(-T/2-A*Math.sin(E));const P=-s,D=_+C<2*a?_+a:C+a,R=P/D,j=-x*D-S*P,M=(a*j-o*(x*P))/(-o*j+a*(S*D));return I<=M?I<=R?M<=R?[I,M,R]:[I,R,M]:[R,I,M]:I<=R?[M,I,R]:M<=R?[M,R,I]:[R,M,I]}Nn.computeDiscriminant=function(e,t,n,i){if("number"!=typeof e)throw new u.a("a is a required number.");if("number"!=typeof t)throw new u.a("b is a required number.");if("number"!=typeof n)throw new u.a("c is a required number.");if("number"!=typeof i)throw new u.a("d is a required number.");const r=t*t,o=n*n;return 18*e*t*n*i+r*o-27*(e*e)*(i*i)-4*(e*o*n+r*t*i)},Nn.computeRealRoots=function(e,t,n,i){if("number"!=typeof e)throw new u.a("a is a required number.");if("number"!=typeof t)throw new u.a("b is a required number.");if("number"!=typeof n)throw new u.a("c is a required number.");if("number"!=typeof i)throw new u.a("d is a required number.");let r,o;if(0===e)return Ln.computeRealRoots(t,n,i);if(0===t){if(0===n){if(0===i)return[0,0,0];o=-i/e;const t=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[t,t,t]}return 0===i?(r=Ln.computeRealRoots(e,0,n),0===r.Length?[0]:[r[0],0,r[1]]):Bn(e,0,n,i)}return 0===n?0===i?(o=-t/e,o<0?[o,0,0]:[0,0,o]):Bn(e,t,0,i):0===i?(r=Ln.computeRealRoots(e,t,n),0===r.length?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]):Bn(e,t,n,i)};var Fn=Nn;const zn={};function kn(e,t,n,i){const r=e*e,o=t-3*r/8,a=n-t*e/2+r*e/8,s=i-n*e/4+t*r/16-3*r*r/256,c=Fn.computeRealRoots(1,2*o,o*o-4*s,-a*a);if(c.length>0){const t=-e/4,n=c[c.length-1];if(Math.abs(n)<h.a.EPSILON14){const e=Ln.computeRealRoots(1,o,s);if(2===e.length){const n=e[0],i=e[1];let r;if(n>=0&&i>=0){const e=Math.sqrt(n),r=Math.sqrt(i);return[t-r,t-e,t+e,t+r]}if(n>=0&&i<0)return r=Math.sqrt(n),[t-r,t+r];if(n<0&&i>=0)return r=Math.sqrt(i),[t-r,t+r]}return[]}if(n>0){const e=Math.sqrt(n),i=(o+n-a/e)/2,r=(o+n+a/e)/2,s=Ln.computeRealRoots(1,e,i),c=Ln.computeRealRoots(1,-e,r);return 0!==s.length?(s[0]+=t,s[1]+=t,0!==c.length?(c[0]+=t,c[1]+=t,s[1]<=c[0]?[s[0],s[1],c[0],c[1]]:c[1]<=s[0]?[c[0],c[1],s[0],s[1]]:s[0]>=c[0]&&s[1]<=c[1]?[c[0],s[0],s[1],c[1]]:c[0]>=s[0]&&c[1]<=s[1]?[s[0],c[0],c[1],s[1]]:s[0]>c[0]&&s[0]<c[1]?[c[0],s[0],c[1],s[1]]:[s[0],c[0],s[1],c[1]]):s):0!==c.length?(c[0]+=t,c[1]+=t,c):[]}}return[]}function Un(e,t,n,i){const r=e*e,o=-2*t,a=n*e+t*t-4*i,s=r*i-n*t*e+n*n,c=Fn.computeRealRoots(1,o,a,s);if(c.length>0){const o=c[0],a=t-o,s=a*a,l=e/2,u=a/2,d=s-4*i,f=s+4*Math.abs(i),p=r-4*o,m=r+4*Math.abs(o);let g,_,y,b,v,O;if(o<0||d*m<p*f){const t=Math.sqrt(p);g=t/2,_=0===t?0:(e*u-n)/t}else{const t=Math.sqrt(d);g=0===t?0:(e*u-n)/t,_=t/2}0===l&&0===g?(y=0,b=0):h.a.sign(l)===h.a.sign(g)?(y=l+g,b=o/y):(b=l-g,y=o/b),0===u&&0===_?(v=0,O=0):h.a.sign(u)===h.a.sign(_)?(v=u+_,O=i/v):(O=u-_,v=i/O);const w=Ln.computeRealRoots(1,y,v),A=Ln.computeRealRoots(1,b,O);if(0!==w.length)return 0!==A.length?w[1]<=A[0]?[w[0],w[1],A[0],A[1]]:A[1]<=w[0]?[A[0],A[1],w[0],w[1]]:w[0]>=A[0]&&w[1]<=A[1]?[A[0],w[0],w[1],A[1]]:A[0]>=w[0]&&A[1]<=w[1]?[w[0],A[0],A[1],w[1]]:w[0]>A[0]&&w[0]<A[1]?[A[0],w[0],A[1],w[1]]:[w[0],A[0],w[1],A[1]]:w;if(0!==A.length)return A}return[]}zn.computeDiscriminant=function(e,t,n,i,r){if("number"!=typeof e)throw new u.a("a is a required number.");if("number"!=typeof t)throw new u.a("b is a required number.");if("number"!=typeof n)throw new u.a("c is a required number.");if("number"!=typeof i)throw new u.a("d is a required number.");if("number"!=typeof r)throw new u.a("e is a required number.");const o=e*e,a=t*t,s=a*t,c=n*n,l=c*n,h=i*i,d=h*i,f=r*r;return a*c*h-4*s*d-4*e*l*h+18*e*t*n*d-27*o*h*h+256*(o*e)*(f*r)+r*(18*s*n*i-4*a*l+16*e*c*c-80*e*t*c*i-6*e*a*h+144*o*n*h)+f*(144*e*a*n-27*a*a-128*o*c-192*o*t*i)},zn.computeRealRoots=function(e,t,n,i,r){if("number"!=typeof e)throw new u.a("a is a required number.");if("number"!=typeof t)throw new u.a("b is a required number.");if("number"!=typeof n)throw new u.a("c is a required number.");if("number"!=typeof i)throw new u.a("d is a required number.");if("number"!=typeof r)throw new u.a("e is a required number.");if(Math.abs(e)<h.a.EPSILON15)return Fn.computeRealRoots(t,n,i,r);const o=t/e,a=n/e,s=i/e,c=r/e;let l=o<0?1:0;switch(l+=a<0?l+1:l,l+=s<0?l+1:l,l+=c<0?l+1:l,l){case 0:return kn(o,a,s,c);case 1:case 2:return Un(o,a,s,c);case 3:case 4:return kn(o,a,s,c);case 5:return Un(o,a,s,c);case 6:case 7:return kn(o,a,s,c);case 8:return Un(o,a,s,c);case 9:case 10:return kn(o,a,s,c);case 11:return Un(o,a,s,c);case 12:case 13:case 14:case 15:return kn(o,a,s,c);default:return}};var Vn=zn;function Hn(e,t){t=O.clone(Object(c.a)(t,O.ZERO)),O.equals(t,O.ZERO)||O.normalize(t,t),this.origin=O.clone(Object(c.a)(e,O.ZERO)),this.direction=t}Hn.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.origin=O.clone(e.origin),t.direction=O.clone(e.direction),t):new Hn(e.origin,e.direction)},Hn.getPoint=function(e,t,n){return s.a.typeOf.object("ray",e),s.a.typeOf.number("t",t),Object(l.a)(n)||(n=new O),n=O.multiplyByScalar(e.direction,t,n),O.add(e.origin,n,n)};var Gn=Hn;const qn={rayPlane:function(e,t,n){if(!Object(l.a)(e))throw new u.a("ray is required.");if(!Object(l.a)(t))throw new u.a("plane is required.");Object(l.a)(n)||(n=new O);const i=e.origin,r=e.direction,o=t.normal,a=O.dot(o,r);if(Math.abs(a)<h.a.EPSILON15)return;const s=(-t.distance-O.dot(o,i))/a;return s<0?void 0:(n=O.multiplyByScalar(r,s,n),O.add(i,n,n))}},Wn=new O,Yn=new O,Xn=new O,Kn=new O,Jn=new O;qn.rayTriangleParametric=function(e,t,n,i,r){if(!Object(l.a)(e))throw new u.a("ray is required.");if(!Object(l.a)(t))throw new u.a("p0 is required.");if(!Object(l.a)(n))throw new u.a("p1 is required.");if(!Object(l.a)(i))throw new u.a("p2 is required.");r=Object(c.a)(r,!1);const o=e.origin,a=e.direction,s=O.subtract(n,t,Wn),d=O.subtract(i,t,Yn),f=O.cross(a,d,Xn),p=O.dot(s,f);let m,g,_,y,b;if(r){if(p<h.a.EPSILON6)return;if(m=O.subtract(o,t,Kn),_=O.dot(m,f),_<0||_>p)return;if(g=O.cross(m,s,Jn),y=O.dot(a,g),y<0||_+y>p)return;b=O.dot(d,g)/p}else{if(Math.abs(p)<h.a.EPSILON6)return;const e=1/p;if(m=O.subtract(o,t,Kn),_=O.dot(m,f)*e,_<0||_>1)return;if(g=O.cross(m,s,Jn),y=O.dot(a,g)*e,y<0||_+y>1)return;b=O.dot(d,g)*e}return b},qn.rayTriangle=function(e,t,n,i,r,o){const a=qn.rayTriangleParametric(e,t,n,i,r);if(Object(l.a)(a)&&!(a<0))return Object(l.a)(o)||(o=new O),O.multiplyByScalar(e.direction,a,o),O.add(e.origin,o,o)};const Zn=new Gn;qn.lineSegmentTriangle=function(e,t,n,i,r,o,a){if(!Object(l.a)(e))throw new u.a("v0 is required.");if(!Object(l.a)(t))throw new u.a("v1 is required.");if(!Object(l.a)(n))throw new u.a("p0 is required.");if(!Object(l.a)(i))throw new u.a("p1 is required.");if(!Object(l.a)(r))throw new u.a("p2 is required.");const s=Zn;O.clone(e,s.origin),O.subtract(t,e,s.direction),O.normalize(s.direction,s.direction);const c=qn.rayTriangleParametric(s,n,i,r,o);if(!(!Object(l.a)(c)||c<0||c>O.distance(e,t)))return Object(l.a)(a)||(a=new O),O.multiplyByScalar(s.direction,c,a),O.add(s.origin,a,a)};const $n={root0:0,root1:0};function Qn(e,t,n){Object(l.a)(n)||(n=new Y);const i=e.origin,r=e.direction,o=t.center,a=t.radius*t.radius,s=O.subtract(i,o,Xn),c=function(e,t,n,i){const r=t*t-4*e*n;if(r<0)return;if(r>0){const n=1/(2*e),o=Math.sqrt(r),a=(-t+o)*n,s=(-t-o)*n;return a<s?(i.root0=a,i.root1=s):(i.root0=s,i.root1=a),i}const o=-t/(2*e);return 0!==o?(i.root0=i.root1=o,i):void 0}(O.dot(r,r),2*O.dot(r,s),O.magnitudeSquared(s)-a,$n);if(Object(l.a)(c))return n.start=c.root0,n.stop=c.root1,n}qn.raySphere=function(e,t,n){if(!Object(l.a)(e))throw new u.a("ray is required.");if(!Object(l.a)(t))throw new u.a("sphere is required.");if(n=Qn(e,t,n),Object(l.a)(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};const ei=new Gn;qn.lineSegmentSphere=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("p0 is required.");if(!Object(l.a)(t))throw new u.a("p1 is required.");if(!Object(l.a)(n))throw new u.a("sphere is required.");const r=ei;O.clone(e,r.origin);const o=O.subtract(t,e,r.direction),a=O.magnitude(o);if(O.normalize(o,o),i=Qn(r,n,i),!(!Object(l.a)(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};const ti=new O,ni=new O;function ii(e,t,n){const i=e+t;return h.a.sign(e)!==h.a.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}qn.rayEllipsoid=function(e,t){if(!Object(l.a)(e))throw new u.a("ray is required.");if(!Object(l.a)(t))throw new u.a("ellipsoid is required.");const n=t.oneOverRadii,i=O.multiplyComponents(n,e.origin,ti),r=O.multiplyComponents(n,e.direction,ni),o=O.magnitudeSquared(i),a=O.dot(i,r);let s,c,h,d,f;if(o>1){if(a>=0)return;const e=a*a;if(s=o-1,c=O.magnitudeSquared(r),h=c*s,e<h)return;if(e>h){d=a*a-h,f=-a+Math.sqrt(d);const e=f/c,t=s/f;return e<t?new Y(e,t):{start:t,stop:e}}const t=Math.sqrt(s/c);return new Y(t,t)}return o<1?(s=o-1,c=O.magnitudeSquared(r),h=c*s,d=a*a-h,f=-a+Math.sqrt(d),new Y(0,f/c)):a<0?(c=O.magnitudeSquared(r),new Y(0,-a/c)):void 0};const ri=new O,oi=new O,ai=new O,si=new O,ci=new O,li=new ce,ui=new ce,hi=new ce,di=new ce,fi=new ce,pi=new ce,mi=new ce,gi=new O,_i=new O,yi=new R;qn.grazingAltitudeLocation=function(e,t){if(!Object(l.a)(e))throw new u.a("ray is required.");if(!Object(l.a)(t))throw new u.a("ellipsoid is required.");const n=e.origin,i=e.direction;if(!O.equals(n,O.ZERO)){const e=t.geodeticSurfaceNormal(n,ri);if(O.dot(i,e)>=0)return n}const r=Object(l.a)(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,ri),a=O.normalize(o,o),s=O.mostOrthogonalAxis(o,si),c=O.normalize(O.cross(s,a,oi),oi),d=O.normalize(O.cross(a,c,ai),ai),f=li;f[0]=a.x,f[1]=a.y,f[2]=a.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=d.x,f[7]=d.y,f[8]=d.z;const p=ce.transpose(f,ui),m=ce.fromScale(t.radii,hi),g=ce.fromScale(t.oneOverRadii,di),_=fi;_[0]=0,_[1]=-i.z,_[2]=i.y,_[3]=i.z,_[4]=0,_[5]=-i.x,_[6]=-i.y,_[7]=i.x,_[8]=0;const y=ce.multiply(ce.multiply(p,g,pi),_,pi),b=ce.multiply(ce.multiply(y,m,mi),f,mi),v=ce.multiplyByVector(y,n,ci),w=function(e,t,n,i,r){const o=i*i,a=r*r,s=(e[ce.COLUMN1ROW1]-e[ce.COLUMN2ROW2])*a,c=r*(i*ii(e[ce.COLUMN1ROW0],e[ce.COLUMN0ROW1],h.a.EPSILON15)+t.y),l=e[ce.COLUMN0ROW0]*o+e[ce.COLUMN2ROW2]*a+i*t.x+n,u=a*ii(e[ce.COLUMN2ROW1],e[ce.COLUMN1ROW2],h.a.EPSILON15),d=r*(i*ii(e[ce.COLUMN2ROW0],e[ce.COLUMN0ROW2])+t.z);let f;const p=[];if(0===d&&0===u){if(f=Ln.computeRealRoots(s,c,l),0===f.length)return p;const e=f[0],t=Math.sqrt(Math.max(1-e*e,0));if(p.push(new O(i,r*e,r*-t)),p.push(new O(i,r*e,r*t)),2===f.length){const e=f[1],t=Math.sqrt(Math.max(1-e*e,0));p.push(new O(i,r*e,r*-t)),p.push(new O(i,r*e,r*t))}return p}const m=d*d,g=u*u,_=d*u,y=s*s+g,b=2*(c*s+_),v=2*l*s+c*c-g+m,w=2*(l*c-_),A=l*l-m;if(0===y&&0===b&&0===v&&0===w)return p;f=Vn.computeRealRoots(y,b,v,w,A);const E=f.length;if(0===E)return p;for(let e=0;e<E;++e){const t=f[e],n=t*t,o=Math.max(1-n,0),a=Math.sqrt(o);let m;m=h.a.sign(s)===h.a.sign(l)?ii(s*n+l,c*t,h.a.EPSILON12):h.a.sign(l)===h.a.sign(c*t)?ii(s*n,c*t+l,h.a.EPSILON12):ii(s*n+c*t,l,h.a.EPSILON12);const g=m*ii(u*t,d,h.a.EPSILON15);g<0?p.push(new O(i,r*t,r*a)):g>0?p.push(new O(i,r*t,r*-a)):0!==a?(p.push(new O(i,r*t,r*-a)),p.push(new O(i,r*t,r*a)),++e):p.push(new O(i,r*t,r*a))}return p}(b,O.negate(v,ri),0,0,1);let A,E;const T=w.length;if(T>0){let e=O.clone(O.ZERO,_i),o=Number.NEGATIVE_INFINITY;for(let t=0;t<T;++t){A=ce.multiplyByVector(m,ce.multiplyByVector(f,w[t],gi),gi);const r=O.normalize(O.subtract(A,n,si),si),a=O.dot(r,i);a>o&&(o=a,e=O.clone(A,e))}const a=t.cartesianToCartographic(e,yi);return o=h.a.clamp(o,0,1),E=O.magnitude(O.subtract(e,n,si))*Math.sqrt(1-o*o),E=r?-E:E,a.height=E,t.cartographicToCartesian(a,new O)}};const bi=new O;qn.lineSegmentPlane=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("endPoint0 is required.");if(!Object(l.a)(t))throw new u.a("endPoint1 is required.");if(!Object(l.a)(n))throw new u.a("plane is required.");Object(l.a)(i)||(i=new O);const r=O.subtract(t,e,bi),o=n.normal,a=O.dot(o,r);if(Math.abs(a)<h.a.EPSILON6)return;const s=O.dot(o,e),c=-(n.distance+s)/a;return c<0||c>1?void 0:(O.multiplyByScalar(r,c,i),O.add(e,i,i),i)},qn.trianglePlaneIntersection=function(e,t,n,i){if(!(Object(l.a)(e)&&Object(l.a)(t)&&Object(l.a)(n)&&Object(l.a)(i)))throw new u.a("p0, p1, p2, and plane are required.");const r=i.normal,o=i.distance,a=O.dot(r,e)+o<0,s=O.dot(r,t)+o<0,c=O.dot(r,n)+o<0;let h,d,f=0;if(f+=a?1:0,f+=s?1:0,f+=c?1:0,1!==f&&2!==f||(h=new O,d=new O),1===f){if(a)return qn.lineSegmentPlane(e,t,i,h),qn.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return qn.lineSegmentPlane(t,n,i,h),qn.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return qn.lineSegmentPlane(n,e,i,h),qn.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===f){if(!a)return qn.lineSegmentPlane(t,e,i,h),qn.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return qn.lineSegmentPlane(n,t,i,h),qn.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return qn.lineSegmentPlane(e,n,i,h),qn.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,h,d],indices:[0,1,4,0,4,3,2,3,4]}}};var vi=qn;function Oi(e,t){if(s.a.typeOf.object("normal",e),!h.a.equalsEpsilon(O.magnitude(e),1,h.a.EPSILON6))throw new u.a("normal must be normalized.");s.a.typeOf.number("distance",t),this.normal=O.clone(e),this.distance=t}Oi.fromPointNormal=function(e,t,n){if(s.a.typeOf.object("point",e),s.a.typeOf.object("normal",t),!h.a.equalsEpsilon(O.magnitude(t),1,h.a.EPSILON6))throw new u.a("normal must be normalized.");const i=-O.dot(t,e);return Object(l.a)(n)?(O.clone(t,n.normal),n.distance=i,n):new Oi(t,i)};const wi=new O;Oi.fromCartesian4=function(e,t){s.a.typeOf.object("coefficients",e);const n=O.fromCartesian4(e,wi),i=e.w;if(!h.a.equalsEpsilon(O.magnitude(n),1,h.a.EPSILON6))throw new u.a("normal must be normalized.");return Object(l.a)(t)?(O.clone(n,t.normal),t.distance=i,t):new Oi(n,i)},Oi.getPointDistance=function(e,t){return s.a.typeOf.object("plane",e),s.a.typeOf.object("point",t),O.dot(e.normal,t)+e.distance};const Ai=new O;Oi.projectPointOntoPlane=function(e,t,n){s.a.typeOf.object("plane",e),s.a.typeOf.object("point",t),Object(l.a)(n)||(n=new O);const i=Oi.getPointDistance(e,t),r=O.multiplyByScalar(e.normal,i,Ai);return O.subtract(t,r,n)};const Ei=new Me,Ti=new _e,Ci=new O;Oi.transform=function(e,t,n){s.a.typeOf.object("plane",e),s.a.typeOf.object("transform",t);const i=e.normal,r=e.distance,o=Me.inverseTranspose(t,Ei);let a=_e.fromElements(i.x,i.y,i.z,r,Ti);a=Me.multiplyByVector(o,a,a);const c=O.fromCartesian4(a,Ci);return a=_e.divideByScalar(a,O.magnitude(c),a),Oi.fromCartesian4(a,n)},Oi.clone=function(e,t){return s.a.typeOf.object("plane",e),Object(l.a)(t)?(O.clone(e.normal,t.normal),t.distance=e.distance,t):new Oi(e.normal,e.distance)},Oi.equals=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),e.distance===t.distance&&O.equals(e.normal,t.normal)},Oi.ORIGIN_XY_PLANE=Object.freeze(new Oi(O.UNIT_Z,0)),Oi.ORIGIN_YZ_PLANE=Object.freeze(new Oi(O.UNIT_X,0)),Oi.ORIGIN_ZX_PLANE=Object.freeze(new Oi(O.UNIT_Y,0));var xi=Oi;var Si=function(e,t,n){s.a.defined("array",e),s.a.defined("itemToFind",t),s.a.defined("comparator",n);let i,r,o=0,a=e.length-1;for(;o<=a;)if(i=~~((o+a)/2),r=n(e[i],t),r<0)o=i+1;else{if(!(r>0))return i;a=i-1}return~(a+1)};var Ii=function(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r};var Pi=function(e,t,n,i,r,o,a,s){this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=a,this.isLeapSecond=s};var Di=function(e){if(null===e||isNaN(e))throw new u.a("year is required and must be a number.");return e%4==0&&e%100!=0||e%400==0};var Ri=function(e,t){this.julianDate=e,this.offset=t};var ji=Object.freeze({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5});var Mi=Object.freeze({UTC:0,TAI:1});const Li=new Pi,Ni=[31,28,31,30,31,30,31,31,30,31,30,31];function Bi(e,t){return Qi.compare(e.julianDate,t.julianDate)}const Fi=new Ri;function zi(e){Fi.julianDate=e;const t=Qi.leapSeconds;let n=Si(t,Fi,Bi);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;if(n>0){Qi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset)}Qi.addSeconds(e,i,e)}function ki(e,t){Fi.julianDate=e;const n=Qi.leapSeconds;let i=Si(n,Fi,Bi);if(i<0&&(i=~i),0===i)return Qi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Qi.addSeconds(e,-n[i-1].offset,t);const r=Qi.secondsDifference(n[i].julianDate,e);return 0===r?Qi.addSeconds(e,-n[i].offset,t):r<=1?void 0:Qi.addSeconds(e,-n[--i].offset,t)}function Ui(e,t,n){const i=t/ji.SECONDS_PER_DAY|0;return e+=i,(t-=ji.SECONDS_PER_DAY*i)<0&&(e--,t+=ji.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Vi(e,t,n,i,r,o,a){const s=(t-14)/12|0,c=e+4800+s;let l=(1461*c/4|0)+(367*(t-2-12*s)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;(i-=12)<0&&(i+=24);const u=o+(i*ji.SECONDS_PER_HOUR+r*ji.SECONDS_PER_MINUTE+a*ji.SECONDS_PER_MILLISECOND);return u>=43200&&(l-=1),[l,u]}const Hi=/^(\d{4})$/,Gi=/^(\d{4})-(\d{2})$/,qi=/^(\d{4})-?(\d{3})$/,Wi=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,Yi=/^(\d{4})-?(\d{2})-?(\d{2})$/,Xi=/([Z+\-])?(\d{2})?:?(\d{2})?$/,Ki=/^(\d{2})(\.\d+)?/.source+Xi.source,Ji=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Xi.source,Zi=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Xi.source,$i="Invalid ISO 8601 date.";function Qi(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=Object(c.a)(e,0),t=Object(c.a)(t,0),n=Object(c.a)(n,Mi.UTC);const i=0|e;Ui(i,t+=(e-i)*ji.SECONDS_PER_DAY,this),n===Mi.UTC&&zi(this)}Qi.fromGregorianDate=function(e,t){if(!(e instanceof Pi))throw new u.a("date must be a valid GregorianDate.");const n=Vi(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return Object(l.a)(t)?(Ui(n[0],n[1],t),zi(t),t):new Qi(n[0],n[1],Mi.UTC)},Qi.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new u.a("date must be a valid JavaScript Date.");const n=Vi(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return Object(l.a)(t)?(Ui(n[0],n[1],t),zi(t),t):new Qi(n[0],n[1],Mi.UTC)},Qi.fromIso8601=function(e,t){if("string"!=typeof e)throw new u.a($i);let n,i=(e=e.replace(",",".")).split("T"),r=1,o=1,a=0,s=0,c=0,h=0;const d=i[0],f=i[1];let p,m,g,_;if(!Object(l.a)(d))throw new u.a($i);if(i=d.match(Yi),null!==i){if(g=d.split("-").length-1,g>0&&2!==g)throw new u.a($i);n=+i[1],r=+i[2],o=+i[3]}else if(i=d.match(Gi),null!==i)n=+i[1],r=+i[2];else if(i=d.match(Hi),null!==i)n=+i[1];else{let e;if(i=d.match(qi),null!==i){if(n=+i[1],e=+i[2],m=Di(n),e<1||m&&e>366||!m&&e>365)throw new u.a($i)}else{if(i=d.match(Wi),null===i)throw new u.a($i);{n=+i[1];const t=+i[2],r=+i[3]||0;if(g=d.split("-").length-1,g>0&&(!Object(l.a)(i[3])&&1!==g||Object(l.a)(i[3])&&2!==g))throw new u.a($i);e=7*t+r-new Date(Date.UTC(n,0,4)).getUTCDay()-3}}p=new Date(Date.UTC(n,0,1)),p.setUTCDate(e),r=p.getUTCMonth()+1,o=p.getUTCDate()}if(m=Di(n),r<1||r>12||o<1||(2!==r||!m)&&o>Ni[r-1]||m&&2===r&&o>29)throw new u.a($i);if(Object(l.a)(f)){if(i=f.match(Zi),null!==i){if(g=f.split(":").length-1,g>0&&2!==g&&3!==g)throw new u.a($i);a=+i[1],s=+i[2],c=+i[3],h=1e3*+(i[4]||0),_=5}else if(i=f.match(Ji),null!==i){if(g=f.split(":").length-1,g>2)throw new u.a($i);a=+i[1],s=+i[2],c=60*+(i[3]||0),_=4}else{if(i=f.match(Ki),null===i)throw new u.a($i);a=+i[1],s=60*+(i[2]||0),_=3}if(s>=60||c>=61||a>24||24===a&&(s>0||c>0||h>0))throw new u.a($i);const e=i[_],t=+i[_+1],l=+(i[_+2]||0);switch(e){case"+":a-=t,s-=l;break;case"-":a+=t,s+=l;break;case"Z":break;default:s+=new Date(Date.UTC(n,r-1,o,a,s)).getTimezoneOffset()}}const y=60===c;for(y&&c--;s>=60;)s-=60,a++;for(;a>=24;)a-=24,o++;for(p=m&&2===r?29:Ni[r-1];o>p;)o-=p,r++,r>12&&(r-=12,n++),p=m&&2===r?29:Ni[r-1];for(;s<0;)s+=60,a--;for(;a<0;)a+=24,o--;for(;o<1;)r--,r<1&&(r+=12,n--),p=m&&2===r?29:Ni[r-1],o+=p;const b=Vi(n,r,o,a,s,c,h);return Object(l.a)(t)?(Ui(b[0],b[1],t),zi(t)):t=new Qi(b[0],b[1],Mi.UTC),y&&Qi.addSeconds(t,1,t),t},Qi.now=function(e){return Qi.fromDate(new Date,e)};const er=new Qi(0,0,Mi.TAI);Qi.toGregorianDate=function(e,t){if(!Object(l.a)(e))throw new u.a("julianDate is required.");let n=!1,i=ki(e,er);Object(l.a)(i)||(Qi.addSeconds(e,-1,er),i=ki(er,er),n=!0);let r=i.dayNumber;const o=i.secondsOfDay;o>=43200&&(r+=1);let a=r+68569|0;const s=4*a/146097|0;a=a-((146097*s+3)/4|0)|0;const c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;const h=80*a/2447|0,d=a-(2447*h/80|0)|0;a=h/11|0;const f=h+2-12*a|0,p=100*(s-49)+c+a|0;let m=o/ji.SECONDS_PER_HOUR|0,g=o-m*ji.SECONDS_PER_HOUR;const _=g/ji.SECONDS_PER_MINUTE|0;g-=_*ji.SECONDS_PER_MINUTE;let y=0|g;const b=(g-y)/ji.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),n&&(y+=1),Object(l.a)(t)?(t.year=p,t.month=f,t.day=d,t.hour=m,t.minute=_,t.second=y,t.millisecond=b,t.isLeapSecond=n,t):new Pi(p,f,d,m,_,y,b,n)},Qi.toDate=function(e){if(!Object(l.a)(e))throw new u.a("julianDate is required.");const t=Qi.toGregorianDate(e,Li);let n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},Qi.toIso8601=function(e,t){if(!Object(l.a)(e))throw new u.a("julianDate is required.");const n=Qi.toGregorianDate(e,Li);let i=n.year,r=n.month,o=n.day,a=n.hour;const s=n.minute,c=n.second,h=n.millisecond;let d;return 1e4===i&&1===r&&1===o&&0===a&&0===s&&0===c&&0===h&&(i=9999,r=12,o=31,a=24),Object(l.a)(t)||0===h?Object(l.a)(t)&&0!==t?(d=(.01*h).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`):`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(d=(.01*h).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${d}Z`)},Qi.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Qi(e.dayNumber,e.secondsOfDay,Mi.TAI)},Qi.compare=function(e,t){if(!Object(l.a)(e))throw new u.a("left is required.");if(!Object(l.a)(t))throw new u.a("right is required.");const n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},Qi.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},Qi.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(Qi.secondsDifference(e,t))<=n},Qi.totalDays=function(e){if(!Object(l.a)(e))throw new u.a("julianDate is required.");return e.dayNumber+e.secondsOfDay/ji.SECONDS_PER_DAY},Qi.secondsDifference=function(e,t){if(!Object(l.a)(e))throw new u.a("left is required.");if(!Object(l.a)(t))throw new u.a("right is required.");return(e.dayNumber-t.dayNumber)*ji.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},Qi.daysDifference=function(e,t){if(!Object(l.a)(e))throw new u.a("left is required.");if(!Object(l.a)(t))throw new u.a("right is required.");return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/ji.SECONDS_PER_DAY},Qi.computeTaiMinusUtc=function(e){Fi.julianDate=e;const t=Qi.leapSeconds;let n=Si(t,Fi,Bi);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},Qi.addSeconds=function(e,t,n){if(!Object(l.a)(e))throw new u.a("julianDate is required.");if(!Object(l.a)(t))throw new u.a("seconds is required.");if(!Object(l.a)(n))throw new u.a("result is required.");return Ui(e.dayNumber,e.secondsOfDay+t,n)},Qi.addMinutes=function(e,t,n){if(!Object(l.a)(e))throw new u.a("julianDate is required.");if(!Object(l.a)(t))throw new u.a("minutes is required.");if(!Object(l.a)(n))throw new u.a("result is required.");const i=e.secondsOfDay+t*ji.SECONDS_PER_MINUTE;return Ui(e.dayNumber,i,n)},Qi.addHours=function(e,t,n){if(!Object(l.a)(e))throw new u.a("julianDate is required.");if(!Object(l.a)(t))throw new u.a("hours is required.");if(!Object(l.a)(n))throw new u.a("result is required.");const i=e.secondsOfDay+t*ji.SECONDS_PER_HOUR;return Ui(e.dayNumber,i,n)},Qi.addDays=function(e,t,n){if(!Object(l.a)(e))throw new u.a("julianDate is required.");if(!Object(l.a)(t))throw new u.a("days is required.");if(!Object(l.a)(n))throw new u.a("result is required.");return Ui(e.dayNumber+t,e.secondsOfDay,n)},Qi.lessThan=function(e,t){return Qi.compare(e,t)<0},Qi.lessThanOrEquals=function(e,t){return Qi.compare(e,t)<=0},Qi.greaterThan=function(e,t){return Qi.compare(e,t)>0},Qi.greaterThanOrEquals=function(e,t){return Qi.compare(e,t)>=0},Qi.prototype.clone=function(e){return Qi.clone(this,e)},Qi.prototype.equals=function(e){return Qi.equals(this,e)},Qi.prototype.equalsEpsilon=function(e,t){return Qi.equalsEpsilon(this,e,t)},Qi.prototype.toString=function(){return Qi.toIso8601(this)},Qi.leapSeconds=[new Ri(new Qi(2441317,43210,Mi.TAI),10),new Ri(new Qi(2441499,43211,Mi.TAI),11),new Ri(new Qi(2441683,43212,Mi.TAI),12),new Ri(new Qi(2442048,43213,Mi.TAI),13),new Ri(new Qi(2442413,43214,Mi.TAI),14),new Ri(new Qi(2442778,43215,Mi.TAI),15),new Ri(new Qi(2443144,43216,Mi.TAI),16),new Ri(new Qi(2443509,43217,Mi.TAI),17),new Ri(new Qi(2443874,43218,Mi.TAI),18),new Ri(new Qi(2444239,43219,Mi.TAI),19),new Ri(new Qi(2444786,43220,Mi.TAI),20),new Ri(new Qi(2445151,43221,Mi.TAI),21),new Ri(new Qi(2445516,43222,Mi.TAI),22),new Ri(new Qi(2446247,43223,Mi.TAI),23),new Ri(new Qi(2447161,43224,Mi.TAI),24),new Ri(new Qi(2447892,43225,Mi.TAI),25),new Ri(new Qi(2448257,43226,Mi.TAI),26),new Ri(new Qi(2448804,43227,Mi.TAI),27),new Ri(new Qi(2449169,43228,Mi.TAI),28),new Ri(new Qi(2449534,43229,Mi.TAI),29),new Ri(new Qi(2450083,43230,Mi.TAI),30),new Ri(new Qi(2450630,43231,Mi.TAI),31),new Ri(new Qi(2451179,43232,Mi.TAI),32),new Ri(new Qi(2453736,43233,Mi.TAI),33),new Ri(new Qi(2454832,43234,Mi.TAI),34),new Ri(new Qi(2456109,43235,Mi.TAI),35),new Ri(new Qi(2457204,43236,Mi.TAI),36),new Ri(new Qi(2457754,43237,Mi.TAI),37)];var tr=Qi;function nr(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=Object(c.a)(e.addNewLeapSeconds,!0),Object(l.a)(e.data))rr(this,e.data);else if(Object(l.a)(e.url)){const t=Tt.a.createIfNeeded(e.url),n=this;this._downloadPromise=t.fetchJson().then((function(e){rr(n,e)})).catch((function(){n._dataError=`An error occurred while retrieving the EOP data from the URL ${t.url}.`}))}else rr(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function ir(e,t){return tr.compare(e.julianDate,t)}function rr(e,t){if(!Object(l.a)(t.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!Object(l.a)(t.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||a<0||s<0||c<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=e._samples=t.samples,h=e._dates=[];let d;e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;const f=e._addNewLeapSeconds;for(let t=0,i=u.length;t<i;t+=e._columnCount){const e=u[t+n],i=u[t+c],r=e+ji.MODIFIED_JULIAN_DATE_DIFFERENCE,o=new tr(r,i,Mi.TAI);if(h.push(o),f){if(i!==d&&Object(l.a)(d)){const e=tr.leapSeconds,t=Si(e,o,ir);if(t<0){const n=new Ri(o,i);e.splice(~t,0,n)}}d=i}}}function or(e,t,n,i,r){const o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function ar(e,t,n){return t+e*(n-t)}function sr(e,t,n,i,r,o,a){const s=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;const c=t[r],l=t[o];if(c.equals(l)||i.equals(c))return or(e,n,r,s,a),a;if(i.equals(l))return or(e,n,o,s,a),a;const u=tr.secondsDifference(i,c)/tr.secondsDifference(l,c),h=r*s,d=o*s;let f=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn];const m=p-f;if(m>.5||m<-.5){const t=n[h+e._taiMinusUtcSecondsColumn],r=n[d+e._taiMinusUtcSecondsColumn];t!==r&&(l.equals(i)?f=p:p-=r-t)}return a.xPoleWander=ar(u,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),a.yPoleWander=ar(u,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),a.xPoleOffset=ar(u,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=ar(u,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=ar(u,f,p),a}nr.NONE=Object.freeze({getPromiseToLoad:function(){return Promise.resolve()},compute:function(e,t){return Object(l.a)(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Ii(0,0,0,0,0),t}}),nr.prototype.getPromiseToLoad=function(){return Promise.resolve(this._downloadPromise)},nr.prototype.compute=function(e,t){if(!Object(l.a)(this._samples)){if(Object(l.a)(this._dataError))throw new ye.a(this._dataError);return}if(Object(l.a)(t)||(t=new Ii(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;const n=this._dates,i=this._lastIndex;let r=0,o=0;if(Object(l.a)(i)){const a=n[i],s=n[i+1],c=tr.lessThanOrEquals(a,e),u=!Object(l.a)(s),h=u||tr.greaterThanOrEquals(s,e);if(c&&h)return r=i,!u&&s.equals(e)&&++r,o=r+1,sr(this,n,this._samples,e,r,o,t),t}let a=Si(n,e,tr.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,r=a,o=a):(o=~a,r=o-1,r<0&&(r=0)),this._lastIndex=r,sr(this,n,this._samples,e,r,o,t),t};var cr=nr;function lr(e,t,n){this.heading=Object(c.a)(e,0),this.pitch=Object(c.a)(t,0),this.roll=Object(c.a)(n,0)}lr.fromQuaternion=function(e,t){if(!Object(l.a)(e))throw new u.a("quaternion is required");Object(l.a)(t)||(t=new lr);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,o),t.roll=Math.atan2(r,i),t.pitch=-h.a.asinClamped(n),t},lr.fromDegrees=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("heading is required");if(!Object(l.a)(t))throw new u.a("pitch is required");if(!Object(l.a)(n))throw new u.a("roll is required");return Object(l.a)(i)||(i=new lr),i.heading=e*h.a.RADIANS_PER_DEGREE,i.pitch=t*h.a.RADIANS_PER_DEGREE,i.roll=n*h.a.RADIANS_PER_DEGREE,i},lr.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new lr(e.heading,e.pitch,e.roll)},lr.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},lr.equalsEpsilon=function(e,t,n,i){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&h.a.equalsEpsilon(e.heading,t.heading,n,i)&&h.a.equalsEpsilon(e.pitch,t.pitch,n,i)&&h.a.equalsEpsilon(e.roll,t.roll,n,i)},lr.prototype.clone=function(e){return lr.clone(this,e)},lr.prototype.equals=function(e){return lr.equals(this,e)},lr.prototype.equalsEpsilon=function(e,t,n){return lr.equalsEpsilon(this,e,t,n)},lr.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var ur=lr;var hr=function(e,t,n){this.x=e,this.y=t,this.s=n};function dr(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._xysFileUrlTemplate=Tt.a.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=Object(c.a)(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=Object(c.a)(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new tr(this._sampleZeroJulianEphemerisDate,0,Mi.TAI),this._stepSizeDays=Object(c.a)(e.stepSizeDays,1),this._samplesPerXysFile=Object(c.a)(e.samplesPerXysFile,1e3),this._totalSamples=Object(c.a)(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let e=0;e<=t;++e){n[e]=r,i[e]=e*this._stepSizeDays;for(let i=0;i<=t;++i)i!==e&&(n[e]*=e-i);n[e]=1/n[e]}this._work=new Array(t+1),this._coef=new Array(t+1)}const fr=new tr(0,0,Mi.TAI);function pr(e,t,n){const i=fr;return i.dayNumber=t,i.secondsOfDay=n,tr.daysDifference(i,e._sampleZeroDateTT)}function mr(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const i=e._xysFileUrlTemplate;n=Object(l.a)(i)?i.getDerivedResource({templateValues:{0:t}}):new Tt.a({url:Lt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const r=n.fetchJson().then((function(n){e._chunkDownloadsInProgress[t]=!1;const i=e._samples,r=n.samples,o=t*e._samplesPerXysFile*3;for(let e=0,t=r.length;e<t;++e)i[o+e]=r[e]}));return e._chunkDownloadsInProgress[t]=r,r}dr.prototype.preload=function(e,t,n,i){const r=pr(this,e,t),o=pr(this,n,i);let a=r/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);const c=a/this._samplesPerXysFile|0,l=s/this._samplesPerXysFile|0,u=[];for(let e=c;e<=l;++e)u.push(mr(this,e));return Promise.all(u)},dr.prototype.computeXysRadians=function(e,t,n){const i=pr(this,e,t);if(i<0)return;const r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;const o=this._interpolationOrder;let a=r-(o/2|0);a<0&&(a=0);let s=a+o;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-o,a<0&&(a=0));let c=!1;const u=this._samples;if(Object(l.a)(u[3*a])||(mr(this,a/this._samplesPerXysFile|0),c=!0),Object(l.a)(u[3*s])||(mr(this,s/this._samplesPerXysFile|0),c=!0),c)return;Object(l.a)(n)?(n.x=0,n.y=0,n.s=0):n=new hr(0,0,0);const h=i-a*this._stepSizeDays,d=this._work,f=this._denominators,p=this._coef,m=this._xTable;let g,_;for(g=0;g<=o;++g)d[g]=h-m[g];for(g=0;g<=o;++g){for(p[g]=1,_=0;_<=o;++_)_!==g&&(p[g]*=d[_]);p[g]*=f[g];let e=3*(a+g);n.x+=p[g]*u[e++],n.y+=p[g]*u[e++],n.s+=p[g]*u[e]}return n};var gr=dr;let _r;const yr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},br={};Object.defineProperties(br,{element:{get:function(){if(br.supportsFullscreen())return document[yr.fullscreenElement]}},changeEventName:{get:function(){if(br.supportsFullscreen())return yr.fullscreenchange}},errorEventName:{get:function(){if(br.supportsFullscreen())return yr.fullscreenerror}},enabled:{get:function(){if(br.supportsFullscreen())return document[yr.fullscreenEnabled]}},fullscreen:{get:function(){if(br.supportsFullscreen())return null!==br.element}}}),br.supportsFullscreen=function(){if(Object(l.a)(_r))return _r;_r=!1;const e=document.body;if("function"==typeof e.requestFullscreen)return yr.requestFullscreen="requestFullscreen",yr.exitFullscreen="exitFullscreen",yr.fullscreenEnabled="fullscreenEnabled",yr.fullscreenElement="fullscreenElement",yr.fullscreenchange="fullscreenchange",yr.fullscreenerror="fullscreenerror",_r=!0,_r;const t=["webkit","moz","o","ms","khtml"];let n;for(let i=0,r=t.length;i<r;++i){const r=t[i];n=r+"RequestFullscreen","function"==typeof e[n]?(yr.requestFullscreen=n,_r=!0):(n=r+"RequestFullScreen","function"==typeof e[n]&&(yr.requestFullscreen=n,_r=!0)),n=r+"ExitFullscreen","function"==typeof document[n]?yr.exitFullscreen=n:(n=r+"CancelFullScreen","function"==typeof document[n]&&(yr.exitFullscreen=n)),n=r+"FullscreenEnabled",void 0!==document[n]?yr.fullscreenEnabled=n:(n=r+"FullScreenEnabled",void 0!==document[n]&&(yr.fullscreenEnabled=n)),n=r+"FullscreenElement",void 0!==document[n]?yr.fullscreenElement=n:(n=r+"FullScreenElement",void 0!==document[n]&&(yr.fullscreenElement=n)),n=r+"fullscreenchange",void 0!==document["on"+n]&&("ms"===r&&(n="MSFullscreenChange"),yr.fullscreenchange=n),n=r+"fullscreenerror",void 0!==document["on"+n]&&("ms"===r&&(n="MSFullscreenError"),yr.fullscreenerror=n)}return _r},br.requestFullscreen=function(e,t){br.supportsFullscreen()&&e[yr.requestFullscreen]({vrDisplay:t})},br.exitFullscreen=function(){br.supportsFullscreen()&&document[yr.exitFullscreen]()},br._names=yr;var vr=br;let Or,wr,Ar,Er,Tr,Cr,xr,Sr,Ir,Pr,Dr,Rr,jr,Mr,Lr,Nr,Br,Fr;function zr(e){const t=e.split(".");for(let e=0,n=t.length;e<n;++e)t[e]=parseInt(t[e],10);return t}function kr(){if(!Object(l.a)(wr)&&(wr=!1,!Gr())){const e=/ Chrome\/([\.0-9]+)/.exec(Or.userAgent);null!==e&&(wr=!0,Ar=zr(e[1]))}return wr}function Ur(){if(!Object(l.a)(Er)&&(Er=!1,!kr()&&!Gr()&&/ Safari\/[\.0-9]+/.test(Or.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Or.userAgent);null!==e&&(Er=!0,Tr=zr(e[1]))}return Er}function Vr(){if(!Object(l.a)(Cr)){Cr=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Or.userAgent);null!==e&&(Cr=!0,xr=zr(e[1]),xr.isNightly=!!e[2])}return Cr}function Hr(){if(!Object(l.a)(Sr)){let e;Sr=!1,"Microsoft Internet Explorer"===Or.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Or.userAgent),null!==e&&(Sr=!0,Ir=zr(e[1]))):"Netscape"===Or.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Or.userAgent),null!==e&&(Sr=!0,Ir=zr(e[1])))}return Sr}function Gr(){if(!Object(l.a)(Pr)){Pr=!1;const e=/ Edg\/([\.0-9]+)/.exec(Or.userAgent);null!==e&&(Pr=!0,Dr=zr(e[1]))}return Pr}function qr(){if(!Object(l.a)(Rr)){Rr=!1;const e=/Firefox\/([\.0-9]+)/.exec(Or.userAgent);null!==e&&(Rr=!0,jr=zr(e[1]))}return Rr}function Wr(){if(!Object(l.a)(Fr)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;Fr=Object(l.a)(t)&&""!==t,Fr&&(Br=t)}return Fr}function Yr(){if(!Yr.initialized)throw new u.a("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return Yr._result}Or="undefined"!=typeof navigator?navigator:{},Yr._promise=void 0,Yr._result=void 0,Yr.initialize=function(){return Object(l.a)(Yr._promise)||(Yr._promise=new Promise(e=>{const t=new Image;t.onload=function(){Yr._result=t.width>0&&t.height>0,e(Yr._result)},t.onerror=function(){Yr._result=!1,e(Yr._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Yr._promise},Object.defineProperties(Yr,{initialized:{get:function(){return Object(l.a)(Yr._result)}}});const Xr=[];"undefined"!=typeof ArrayBuffer&&(Xr.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&Xr.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&Xr.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&Xr.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&Xr.push(BigUint64Array));const Kr={isChrome:kr,chromeVersion:function(){return kr()&&Ar},isSafari:Ur,safariVersion:function(){return Ur()&&Tr},isWebkit:Vr,webkitVersion:function(){return Vr()&&xr},isInternetExplorer:Hr,internetExplorerVersion:function(){return Hr()&&Ir},isEdge:Gr,edgeVersion:function(){return Gr()&&Dr},isFirefox:qr,firefoxVersion:function(){return qr()&&jr},isWindows:function(){return Object(l.a)(Mr)||(Mr=/Windows/i.test(Or.appVersion)),Mr},isIPadOrIOS:function(){return Object(l.a)(Lr)||(Lr="iPhone"===navigator.platform||"iPod"===navigator.platform||"iPad"===navigator.platform),Lr},hardwareConcurrency:Object(c.a)(Or.hardwareConcurrency,3),supportsPointerEvents:function(){return Object(l.a)(Nr)||(Nr=!qr()&&"undefined"!=typeof PointerEvent&&(!Object(l.a)(Or.pointerEnabled)||Or.pointerEnabled)),Nr},supportsImageRenderingPixelated:Wr,supportsWebP:Yr,imageRenderingValue:function(){return Wr()?Br:void 0},typedArrayTypes:Xr,supportsBasis:function(e){return Kr.supportsWebAssembly()&&e.context.supportsBasis},supportsFullscreen:function(){return vr.supportsFullscreen()},supportsTypedArrays:function(){return"undefined"!=typeof ArrayBuffer},supportsBigInt64Array:function(){return"undefined"!=typeof BigInt64Array},supportsBigUint64Array:function(){return"undefined"!=typeof BigUint64Array},supportsBigInt:function(){return"undefined"!=typeof BigInt},supportsWebWorkers:function(){return"undefined"!=typeof Worker},supportsWebAssembly:function(){return"undefined"!=typeof WebAssembly}};var Jr=Kr;function Zr(e,t,n,i){this.x=Object(c.a)(e,0),this.y=Object(c.a)(t,0),this.z=Object(c.a)(n,0),this.w=Object(c.a)(i,0)}let $r=new O;Zr.fromAxisAngle=function(e,t,n){s.a.typeOf.object("axis",e),s.a.typeOf.number("angle",t);const i=t/2,r=Math.sin(i);$r=O.normalize(e,$r);const o=$r.x*r,a=$r.y*r,c=$r.z*r,u=Math.cos(i);return Object(l.a)(n)?(n.x=o,n.y=a,n.z=c,n.w=u,n):new Zr(o,a,c,u)};const Qr=[1,2,0],eo=new Array(3);Zr.fromRotationMatrix=function(e,t){let n,i,r,o,a;s.a.typeOf.object("matrix",e);const c=e[ce.COLUMN0ROW0],u=e[ce.COLUMN1ROW1],h=e[ce.COLUMN2ROW2],d=c+u+h;if(d>0)n=Math.sqrt(d+1),a=.5*n,n=.5/n,i=(e[ce.COLUMN1ROW2]-e[ce.COLUMN2ROW1])*n,r=(e[ce.COLUMN2ROW0]-e[ce.COLUMN0ROW2])*n,o=(e[ce.COLUMN0ROW1]-e[ce.COLUMN1ROW0])*n;else{const t=Qr;let s=0;u>c&&(s=1),h>c&&h>u&&(s=2);const l=t[s],d=t[l];n=Math.sqrt(e[ce.getElementIndex(s,s)]-e[ce.getElementIndex(l,l)]-e[ce.getElementIndex(d,d)]+1);const f=eo;f[s]=.5*n,n=.5/n,a=(e[ce.getElementIndex(d,l)]-e[ce.getElementIndex(l,d)])*n,f[l]=(e[ce.getElementIndex(l,s)]+e[ce.getElementIndex(s,l)])*n,f[d]=(e[ce.getElementIndex(d,s)]+e[ce.getElementIndex(s,d)])*n,i=-f[0],r=-f[1],o=-f[2]}return Object(l.a)(t)?(t.x=i,t.y=r,t.z=o,t.w=a,t):new Zr(i,r,o,a)};const to=new Zr;let no=new Zr,io=new Zr,ro=new Zr;Zr.fromHeadingPitchRoll=function(e,t){return s.a.typeOf.object("headingPitchRoll",e),ro=Zr.fromAxisAngle(O.UNIT_X,e.roll,to),io=Zr.fromAxisAngle(O.UNIT_Y,-e.pitch,t),t=Zr.multiply(io,ro,io),no=Zr.fromAxisAngle(O.UNIT_Z,-e.heading,to),Zr.multiply(no,t,t)};const oo=new O,ao=new O,so=new Zr,co=new Zr,lo=new Zr;Zr.packedLength=4,Zr.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Zr.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Zr),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},Zr.packedInterpolationLength=3,Zr.convertPackedArrayForInterpolation=function(e,t,n,i){Zr.unpack(e,4*n,lo),Zr.conjugate(lo,lo);for(let r=0,o=n-t+1;r<o;r++){const n=3*r;Zr.unpack(e,4*(t+r),so),Zr.multiply(so,lo,so),so.w<0&&Zr.negate(so,so),Zr.computeAxis(so,oo);const o=Zr.computeAngle(so);Object(l.a)(i)||(i=[]),i[n]=oo.x*o,i[n+1]=oo.y*o,i[n+2]=oo.z*o}},Zr.unpackInterpolationResult=function(e,t,n,i,r){Object(l.a)(r)||(r=new Zr),O.fromArray(e,0,ao);const o=O.magnitude(ao);return Zr.unpack(t,4*i,co),0===o?Zr.clone(Zr.IDENTITY,so):Zr.fromAxisAngle(ao,o,so),Zr.multiply(so,co,r)},Zr.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Zr(e.x,e.y,e.z,e.w)},Zr.conjugate=function(e,t){return s.a.typeOf.object("quaternion",e),s.a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},Zr.magnitudeSquared=function(e){return s.a.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Zr.magnitude=function(e){return Math.sqrt(Zr.magnitudeSquared(e))},Zr.normalize=function(e,t){s.a.typeOf.object("result",t);const n=1/Zr.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,a=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=a,t},Zr.inverse=function(e,t){s.a.typeOf.object("result",t);const n=Zr.magnitudeSquared(e);return t=Zr.conjugate(e,t),Zr.multiplyByScalar(t,1/n,t)},Zr.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},Zr.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},Zr.negate=function(e,t){return s.a.typeOf.object("quaternion",e),s.a.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Zr.dot=function(e,t){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Zr.multiply=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n);const i=e.x,r=e.y,o=e.z,a=e.w,c=t.x,l=t.y,u=t.z,h=t.w,d=a*c+i*h+r*u-o*l,f=a*l-i*u+r*h+o*c,p=a*u+i*l-r*c+o*h,m=a*h-i*c-r*l-o*u;return n.x=d,n.y=f,n.z=p,n.w=m,n},Zr.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("quaternion",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},Zr.divideByScalar=function(e,t,n){return s.a.typeOf.object("quaternion",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},Zr.computeAxis=function(e,t){s.a.typeOf.object("quaternion",e),s.a.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<h.a.EPSILON6)return t.x=t.y=t.z=0,t;const i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},Zr.computeAngle=function(e){return s.a.typeOf.object("quaternion",e),Math.abs(e.w-1)<h.a.EPSILON6?0:2*Math.acos(e.w)};let uo=new Zr;Zr.lerp=function(e,t,n,i){return s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i),uo=Zr.multiplyByScalar(t,n,uo),i=Zr.multiplyByScalar(e,1-n,i),Zr.add(uo,i,i)};let ho=new Zr,fo=new Zr,po=new Zr;Zr.slerp=function(e,t,n,i){s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i);let r=Zr.dot(e,t),o=t;if(r<0&&(r=-r,o=ho=Zr.negate(t,ho)),1-r<h.a.EPSILON6)return Zr.lerp(e,o,n,i);const a=Math.acos(r);return fo=Zr.multiplyByScalar(e,Math.sin((1-n)*a),fo),po=Zr.multiplyByScalar(o,Math.sin(n*a),po),i=Zr.add(fo,po,i),Zr.multiplyByScalar(i,1/Math.sin(a),i)},Zr.log=function(e,t){s.a.typeOf.object("quaternion",e),s.a.typeOf.object("result",t);const n=h.a.acosClamped(e.w);let i=0;return 0!==n&&(i=n/Math.sin(n)),O.multiplyByScalar(e,i,t)},Zr.exp=function(e,t){s.a.typeOf.object("cartesian",e),s.a.typeOf.object("result",t);const n=O.magnitude(e);let i=0;return 0!==n&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};const mo=new O,go=new O,_o=new Zr,yo=new Zr;Zr.computeInnerQuadrangle=function(e,t,n,i){s.a.typeOf.object("q0",e),s.a.typeOf.object("q1",t),s.a.typeOf.object("q2",n),s.a.typeOf.object("result",i);const r=Zr.conjugate(t,_o);Zr.multiply(r,n,yo);const o=Zr.log(yo,mo);Zr.multiply(r,e,yo);const a=Zr.log(yo,go);return O.add(o,a,o),O.multiplyByScalar(o,.25,o),O.negate(o,o),Zr.exp(o,_o),Zr.multiply(t,_o,i)},Zr.squad=function(e,t,n,i,r,o){s.a.typeOf.object("q0",e),s.a.typeOf.object("q1",t),s.a.typeOf.object("s0",n),s.a.typeOf.object("s1",i),s.a.typeOf.number("t",r),s.a.typeOf.object("result",o);const a=Zr.slerp(e,t,r,_o),c=Zr.slerp(n,i,r,yo);return Zr.slerp(a,c,2*r*(1-r),o)};const bo=new Zr,vo=1.9011074535173003,Oo=Jr.supportsTypedArrays()?new Float32Array(8):[],wo=Jr.supportsTypedArrays()?new Float32Array(8):[],Ao=Jr.supportsTypedArrays()?new Float32Array(8):[],Eo=Jr.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Oo[e]=1/(t*n),wo[e]=t/n}Oo[7]=vo/136,wo[7]=8*vo/17,Zr.fastSlerp=function(e,t,n,i){s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i);let r,o=Zr.dot(e,t);o>=0?r=1:(r=-1,o=-o);const a=o-1,c=1-n,l=n*n,u=c*c;for(let e=7;e>=0;--e)Ao[e]=(Oo[e]*l-wo[e])*a,Eo[e]=(Oo[e]*u-wo[e])*a;const h=r*n*(1+Ao[0]*(1+Ao[1]*(1+Ao[2]*(1+Ao[3]*(1+Ao[4]*(1+Ao[5]*(1+Ao[6]*(1+Ao[7])))))))),d=c*(1+Eo[0]*(1+Eo[1]*(1+Eo[2]*(1+Eo[3]*(1+Eo[4]*(1+Eo[5]*(1+Eo[6]*(1+Eo[7])))))))),f=Zr.multiplyByScalar(e,d,bo);return Zr.multiplyByScalar(t,h,i),Zr.add(f,i,i)},Zr.fastSquad=function(e,t,n,i,r,o){s.a.typeOf.object("q0",e),s.a.typeOf.object("q1",t),s.a.typeOf.object("s0",n),s.a.typeOf.object("s1",i),s.a.typeOf.number("t",r),s.a.typeOf.object("result",o);const a=Zr.fastSlerp(e,t,r,_o),c=Zr.fastSlerp(n,i,r,yo);return Zr.fastSlerp(a,c,2*r*(1-r),o)},Zr.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Zr.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},Zr.ZERO=Object.freeze(new Zr(0,0,0,0)),Zr.IDENTITY=Object.freeze(new Zr(0,0,0,1)),Zr.prototype.clone=function(e){return Zr.clone(this,e)},Zr.prototype.equals=function(e){return Zr.equals(this,e)},Zr.prototype.equalsEpsilon=function(e,t){return Zr.equalsEpsilon(this,e,t)},Zr.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var To=Zr;const Co={},xo={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"}},So={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Io={},Po={east:new O,north:new O,up:new O,west:new O,south:new O,down:new O};let Do=new O,Ro=new O,jo=new O;Co.localFrameToFixedFrameGenerator=function(e,t){if(!xo.hasOwnProperty(e)||!xo[e].hasOwnProperty(t))throw new u.a("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=xo[e][t];let i;const r=e+t;return Object(l.a)(Io[r])?i=Io[r]:(i=function(i,r,o){if(!Object(l.a)(i))throw new u.a("origin is required.");if(Object(l.a)(o)||(o=new Me),O.equalsEpsilon(i,O.ZERO,h.a.EPSILON14))O.unpack(So[e],0,Do),O.unpack(So[t],0,Ro),O.unpack(So[n],0,jo);else if(h.a.equalsEpsilon(i.x,0,h.a.EPSILON14)&&h.a.equalsEpsilon(i.y,0,h.a.EPSILON14)){const r=h.a.sign(i.z);O.unpack(So[e],0,Do),"east"!==e&&"west"!==e&&O.multiplyByScalar(Do,r,Do),O.unpack(So[t],0,Ro),"east"!==t&&"west"!==t&&O.multiplyByScalar(Ro,r,Ro),O.unpack(So[n],0,jo),"east"!==n&&"west"!==n&&O.multiplyByScalar(jo,r,jo)}else{(r=Object(c.a)(r,H.WGS84)).geodeticSurfaceNormal(i,Po.up);const o=Po.up,a=Po.east;a.x=-i.y,a.y=i.x,a.z=0,O.normalize(a,Po.east),O.cross(o,a,Po.north),O.multiplyByScalar(Po.up,-1,Po.down),O.multiplyByScalar(Po.east,-1,Po.west),O.multiplyByScalar(Po.north,-1,Po.south),Do=Po[e],Ro=Po[t],jo=Po[n]}return o[0]=Do.x,o[1]=Do.y,o[2]=Do.z,o[3]=0,o[4]=Ro.x,o[5]=Ro.y,o[6]=Ro.z,o[7]=0,o[8]=jo.x,o[9]=jo.y,o[10]=jo.z,o[11]=0,o[12]=i.x,o[13]=i.y,o[14]=i.z,o[15]=1,o},Io[r]=i),i},Co.eastNorthUpToFixedFrame=Co.localFrameToFixedFrameGenerator("east","north"),Co.northEastDownToFixedFrame=Co.localFrameToFixedFrameGenerator("north","east"),Co.northUpEastToFixedFrame=Co.localFrameToFixedFrameGenerator("north","up"),Co.northWestUpToFixedFrame=Co.localFrameToFixedFrameGenerator("north","west");const Mo=new To,Lo=new O(1,1,1),No=new Me;Co.headingPitchRollToFixedFrame=function(e,t,n,i,r){s.a.typeOf.object("HeadingPitchRoll",t),i=Object(c.a)(i,Co.eastNorthUpToFixedFrame);const o=To.fromHeadingPitchRoll(t,Mo),a=Me.fromTranslationQuaternionRotationScale(O.ZERO,o,Lo,No);return r=i(e,n,r),Me.multiply(r,a,r)};const Bo=new Me,Fo=new ce;Co.headingPitchRollQuaternion=function(e,t,n,i,r){s.a.typeOf.object("HeadingPitchRoll",t);const o=Co.headingPitchRollToFixedFrame(e,t,n,i,Bo),a=Me.getMatrix3(o,Fo);return To.fromRotationMatrix(a,r)};const zo=new O(1,1,1),ko=new O,Uo=new Me,Vo=new Me,Ho=new ce,Go=new To;Co.fixedFrameToHeadingPitchRoll=function(e,t,n,i){s.a.defined("transform",e),t=Object(c.a)(t,H.WGS84),n=Object(c.a)(n,Co.eastNorthUpToFixedFrame),Object(l.a)(i)||(i=new ur);const r=Me.getTranslation(e,ko);if(O.equals(r,O.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=Me.inverseTransformation(n(r,t,Uo),Uo),a=Me.setScale(e,zo,Vo);a=Me.setTranslation(a,O.ZERO,a),o=Me.multiply(o,a,o);let u=To.fromRotationMatrix(Me.getMatrix3(o,Ho),Go);return u=To.normalize(u,u),ur.fromQuaternion(u,i)};const qo=h.a.TWO_PI/86400;let Wo=new tr;Co.computeTemeToPseudoFixedMatrix=function(e,t){if(!Object(l.a)(e))throw new u.a("date is required.");Wo=tr.addSeconds(e,-tr.computeTaiMinusUtc(e),Wo);const n=Wo.dayNumber,i=Wo.secondsOfDay;let r;const o=n-2451545;r=i>=43200?(o+.5)/ji.DAYS_PER_JULIAN_CENTURY:(o-.5)/ji.DAYS_PER_JULIAN_CENTURY;const a=(24110.54841+r*(8640184.812866+r*(.093104+-62e-7*r)))*qo%h.a.TWO_PI+(72921158553e-15+11772758384668e-32*(n-2451545.5))*((i+.5*ji.SECONDS_PER_DAY)%ji.SECONDS_PER_DAY),s=Math.cos(a),c=Math.sin(a);return Object(l.a)(t)?(t[0]=s,t[1]=-c,t[2]=0,t[3]=c,t[4]=s,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new ce(s,c,0,-c,s,0,0,0,1)},Co.iau2006XysData=new gr,Co.earthOrientationParameters=cr.NONE;Co.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+32.184,i=e.stop.dayNumber,r=e.stop.secondsOfDay+32.184,o=Co.iau2006XysData.preload(t,n,i,r),a=Co.earthOrientationParameters.getPromiseToLoad();return Promise.all([o,a])},Co.computeIcrfToFixedMatrix=function(e,t){if(!Object(l.a)(e))throw new u.a("date is required.");Object(l.a)(t)||(t=new ce);const n=Co.computeFixedToIcrfMatrix(e,t);if(Object(l.a)(n))return ce.transpose(n,t)};const Yo=new hr(0,0,0),Xo=new Ii(0,0,0,0,0,0),Ko=new ce,Jo=new ce;Co.computeFixedToIcrfMatrix=function(e,t){if(!Object(l.a)(e))throw new u.a("date is required.");Object(l.a)(t)||(t=new ce);const n=Co.earthOrientationParameters.compute(e,Xo);if(!Object(l.a)(n))return;const i=e.dayNumber,r=e.secondsOfDay+32.184,o=Co.iau2006XysData.computeXysRadians(i,r,Yo);if(!Object(l.a)(o))return;const a=o.x+n.xPoleOffset,s=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-a*a-s*s)),d=Ko;d[0]=1-c*a*a,d[3]=-c*a*s,d[6]=a,d[1]=-c*a*s,d[4]=1-c*s*s,d[7]=s,d[2]=-a,d[5]=-s,d[8]=1-c*(a*a+s*s);const f=ce.fromRotationZ(-o.s,Jo),p=ce.multiply(d,f,Ko),m=e.dayNumber-2451545,g=(e.secondsOfDay-tr.computeTaiMinusUtc(e)+n.ut1MinusUtc)/ji.SECONDS_PER_DAY;let _=.779057273264+g+.00273781191135448*(m+g);_=_%1*h.a.TWO_PI;const y=ce.fromRotationZ(_,Jo),b=ce.multiply(p,y,Ko),v=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),A=Math.sin(n.yPoleWander);let E=i-2451545+r/ji.SECONDS_PER_DAY;E/=36525;const T=-47e-6*E*h.a.RADIANS_PER_DEGREE/3600,C=Math.cos(T),x=Math.sin(T),S=Jo;return S[0]=v*C,S[1]=v*x,S[2]=w,S[3]=-O*x+A*w*C,S[4]=O*C+A*w*x,S[5]=-A*v,S[6]=-A*x-O*w*C,S[7]=A*C-O*w*x,S[8]=O*v,ce.multiply(b,S,t)};const Zo=new _e;Co.pointToWindowCoordinates=function(e,t,n,i){return(i=Co.pointToGLWindowCoordinates(e,t,n,i)).y=2*t[5]-i.y,i},Co.pointToGLWindowCoordinates=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("modelViewProjectionMatrix is required.");if(!Object(l.a)(t))throw new u.a("viewportTransformation is required.");if(!Object(l.a)(n))throw new u.a("point is required.");Object(l.a)(i)||(i=new Vt);const r=Zo;return Me.multiplyByVector(e,_e.fromElements(n.x,n.y,n.z,1,r),r),_e.multiplyByScalar(r,1/r.w,r),Me.multiplyByVector(t,r,r),Vt.fromCartesian4(r,i)};const $o=new O,Qo=new O,ea=new O;Co.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("position is required.");if(!Object(l.a)(t))throw new u.a("velocity is required.");const r=Object(c.a)(n,H.WGS84).geodeticSurfaceNormal(e,$o);let o=O.cross(t,r,Qo);O.equalsEpsilon(o,O.ZERO,h.a.EPSILON6)&&(o=O.clone(O.UNIT_X,o));const a=O.cross(o,t,ea);return O.normalize(a,a),O.cross(t,a,o),O.negate(o,o),O.normalize(o,o),Object(l.a)(i)||(i=new ce),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i};const ta=new Me(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),na=new R,ia=new O,ra=new O,oa=new ce,aa=new Me,sa=new Me;Co.basisTo2D=function(e,t,n){if(!Object(l.a)(e))throw new u.a("projection is required.");if(!Object(l.a)(t))throw new u.a("matrix is required.");if(!Object(l.a)(n))throw new u.a("result is required.");const i=Me.getTranslation(t,ra),r=e.ellipsoid,o=r.cartesianToCartographic(i,na),a=e.project(o,ia);O.fromElements(a.z,a.x,a.y,a);const s=Co.eastNorthUpToFixedFrame(i,r,aa),c=Me.inverseTransformation(s,sa),h=Me.getMatrix3(t,oa),d=Me.multiplyByMatrix3(c,h,n);return Me.multiply(ta,d,n),Me.setTranslation(n,a,n),n},Co.wgs84To2DModelMatrix=function(e,t,n){if(!Object(l.a)(e))throw new u.a("projection is required.");if(!Object(l.a)(t))throw new u.a("center is required.");if(!Object(l.a)(n))throw new u.a("result is required.");const i=e.ellipsoid,r=Co.eastNorthUpToFixedFrame(t,i,aa),o=Me.inverseTransformation(r,sa),a=i.cartesianToCartographic(t,na),s=e.project(a,ia);O.fromElements(s.z,s.x,s.y,s);const c=Me.fromTranslation(s,aa);return Me.multiply(ta,o,n),Me.multiply(c,n,n),n};var ca=Co;const la=new _e;function ua(e,t){if(s.a.defined("origin",e),e=(t=Object(c.a)(t,H.WGS84)).scaleToGeodeticSurface(e),!Object(l.a)(e))throw new u.a("origin must not be at the center of the ellipsoid.");const n=ca.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=O.fromCartesian4(Me.getColumn(n,0,la)),this._yAxis=O.fromCartesian4(Me.getColumn(n,1,la));const i=O.fromCartesian4(Me.getColumn(n,2,la));this._plane=xi.fromPointNormal(e,i)}Object.defineProperties(ua.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});const ha=new pn;ua.fromPoints=function(e,t){s.a.defined("cartesians",e);return new ua(pn.fromPoints(e,ha).center,t)};const da=new Gn,fa=new O;ua.prototype.projectPointOntoPlane=function(e,t){s.a.defined("cartesian",e);const n=da;n.origin=e,O.normalize(e,n.direction);let i=vi.rayPlane(n,this._plane,fa);if(Object(l.a)(i)||(O.negate(n.direction,n.direction),i=vi.rayPlane(n,this._plane,fa)),Object(l.a)(i)){const e=O.subtract(i,this._origin,i),n=O.dot(this._xAxis,e),r=O.dot(this._yAxis,e);return Object(l.a)(t)?(t.x=n,t.y=r,t):new Vt(n,r)}},ua.prototype.projectPointsOntoPlane=function(e,t){s.a.defined("cartesians",e),Object(l.a)(t)||(t=[]);let n=0;const i=e.length;for(let r=0;r<i;r++){const i=this.projectPointOntoPlane(e[r],t[n]);Object(l.a)(i)&&(t[n]=i,n++)}return t.length=n,t},ua.prototype.projectPointToNearestOnPlane=function(e,t){s.a.defined("cartesian",e),Object(l.a)(t)||(t=new Vt);const n=da;n.origin=e,O.clone(this._plane.normal,n.direction);let i=vi.rayPlane(n,this._plane,fa);Object(l.a)(i)||(O.negate(n.direction,n.direction),i=vi.rayPlane(n,this._plane,fa));const r=O.subtract(i,this._origin,i),o=O.dot(this._xAxis,r),a=O.dot(this._yAxis,r);return t.x=o,t.y=a,t},ua.prototype.projectPointsToNearestOnPlane=function(e,t){s.a.defined("cartesians",e),Object(l.a)(t)||(t=[]);const n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};const pa=new O;ua.prototype.projectPointOntoEllipsoid=function(e,t){s.a.defined("cartesian",e),Object(l.a)(t)||(t=new O);const n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,a=pa;return O.multiplyByScalar(r,e.x,a),t=O.add(i,a,t),O.multiplyByScalar(o,e.y,a),O.add(t,a,t),n.scaleToGeocentricSurface(t,t),t},ua.prototype.projectPointsOntoEllipsoid=function(e,t){s.a.defined("cartesians",e);const n=e.length;Object(l.a)(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var ma=ua;function ga(e,t){this.center=O.clone(Object(c.a)(e,O.ZERO)),this.halfAxes=ce.clone(Object(c.a)(t,ce.ZERO))}ga.packedLength=O.packedLength+ce.packedLength,ga.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),O.pack(e.center,t,n),ce.pack(e.halfAxes,t,n+O.packedLength),t},ga.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new ga),O.unpack(e,t,n.center),ce.unpack(e,t+O.packedLength,n.halfAxes),n};const _a=new O,ya=new O,ba=new O,va=new O,Oa=new O,wa=new O,Aa=new ce,Ea={unitary:new ce,diagonal:new ce};ga.fromPoints=function(e,t){if(Object(l.a)(t)||(t=new ga),!Object(l.a)(e)||0===e.length)return t.halfAxes=ce.ZERO,t.center=O.ZERO,t;let n;const i=e.length,r=O.clone(e[0],_a);for(n=1;n<i;n++)O.add(r,e[n],r);const o=1/i;O.multiplyByScalar(r,o,r);let a,s=0,c=0,u=0,h=0,d=0,f=0;for(n=0;n<i;n++)a=O.subtract(e[n],r,ya),s+=a.x*a.x,c+=a.x*a.y,u+=a.x*a.z,h+=a.y*a.y,d+=a.y*a.z,f+=a.z*a.z;s*=o,c*=o,u*=o,h*=o,d*=o,f*=o;const p=Aa;p[0]=s,p[1]=c,p[2]=u,p[3]=c,p[4]=h,p[5]=d,p[6]=u,p[7]=d,p[8]=f;const m=ce.computeEigenDecomposition(p,Ea),g=ce.clone(m.unitary,t.halfAxes);let _=ce.getColumn(g,0,va),y=ce.getColumn(g,1,Oa),b=ce.getColumn(g,2,wa),v=-Number.MAX_VALUE,w=-Number.MAX_VALUE,A=-Number.MAX_VALUE,E=Number.MAX_VALUE,T=Number.MAX_VALUE,C=Number.MAX_VALUE;for(n=0;n<i;n++)a=e[n],v=Math.max(O.dot(_,a),v),w=Math.max(O.dot(y,a),w),A=Math.max(O.dot(b,a),A),E=Math.min(O.dot(_,a),E),T=Math.min(O.dot(y,a),T),C=Math.min(O.dot(b,a),C);_=O.multiplyByScalar(_,.5*(E+v),_),y=O.multiplyByScalar(y,.5*(T+w),y),b=O.multiplyByScalar(b,.5*(C+A),b);const x=O.add(_,y,t.center);O.add(x,b,x);const S=ba;return S.x=v-E,S.y=w-T,S.z=A-C,O.multiplyByScalar(S,.5,S),ce.multiplyByScale(t.halfAxes,S,t.halfAxes),t};const Ta=new O,Ca=new O;function xa(e,t,n,i,r,o,a,s,c,h,d){if(!(Object(l.a)(r)&&Object(l.a)(o)&&Object(l.a)(a)&&Object(l.a)(s)&&Object(l.a)(c)&&Object(l.a)(h)))throw new u.a("all extents (minimum/maximum X/Y/Z) are required.");Object(l.a)(d)||(d=new ga);const f=d.halfAxes;ce.setColumn(f,0,t,f),ce.setColumn(f,1,n,f),ce.setColumn(f,2,i,f);let p=Ta;p.x=(r+o)/2,p.y=(a+s)/2,p.z=(c+h)/2;const m=Ca;m.x=(o-r)/2,m.y=(s-a)/2,m.z=(h-c)/2;const g=d.center;return p=ce.multiplyByVector(f,p,p),O.add(e,p,g),ce.multiplyByScale(f,m,f),d}const Sa=new R,Ia=new O,Pa=new R,Da=new R,Ra=new R,ja=new R,Ma=new R,La=new O,Na=new O,Ba=new O,Fa=new O,za=new O,ka=new Vt,Ua=new Vt,Va=new Vt,Ha=new Vt,Ga=new Vt,qa=new O,Wa=new O,Ya=new O,Xa=new O,Ka=new Vt,Ja=new O,Za=new O,$a=new O,Qa=new xi(O.UNIT_X,0);ga.fromRectangle=function(e,t,n,i,r){if(!Object(l.a)(e))throw new u.a("rectangle is required");if(e.width<0||e.width>h.a.TWO_PI)throw new u.a("Rectangle width must be between 0 and 2*pi");if(e.height<0||e.height>h.a.PI)throw new u.a("Rectangle height must be between 0 and pi");if(Object(l.a)(i)&&!h.a.equalsEpsilon(i.radii.x,i.radii.y,h.a.EPSILON15))throw new u.a("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");let o,a,s,d,f,p,m;if(t=Object(c.a)(t,0),n=Object(c.a)(n,0),i=Object(c.a)(i,H.WGS84),e.width<=h.a.PI){const c=Be.center(e,Sa),l=i.cartographicToCartesian(c,Ia),u=new ma(l,i);m=u.plane;const h=c.longitude,g=e.south<0&&e.north>0?0:c.latitude,_=R.fromRadians(h,e.north,n,Pa),y=R.fromRadians(e.west,e.north,n,Da),b=R.fromRadians(e.west,g,n,Ra),v=R.fromRadians(e.west,e.south,n,ja),O=R.fromRadians(h,e.south,n,Ma),w=i.cartographicToCartesian(_,La);let A=i.cartographicToCartesian(y,Na);const E=i.cartographicToCartesian(b,Ba);let T=i.cartographicToCartesian(v,Fa);const C=i.cartographicToCartesian(O,za),x=u.projectPointToNearestOnPlane(w,ka),S=u.projectPointToNearestOnPlane(A,Ua),I=u.projectPointToNearestOnPlane(E,Va),P=u.projectPointToNearestOnPlane(T,Ha),D=u.projectPointToNearestOnPlane(C,Ga);return o=Math.min(S.x,I.x,P.x),a=-o,d=Math.max(S.y,x.y),s=Math.min(P.y,D.y),y.height=v.height=t,A=i.cartographicToCartesian(y,Na),T=i.cartographicToCartesian(v,Fa),f=Math.min(xi.getPointDistance(m,A),xi.getPointDistance(m,T)),p=n,xa(u.origin,u.xAxis,u.yAxis,u.zAxis,o,a,s,d,f,p,r)}const g=e.south>0,_=e.north<0,y=g?e.south:_?e.north:0,b=Be.center(e,Sa).longitude,v=O.fromRadians(b,y,n,i,qa);v.z=0;const w=Math.abs(v.x)<h.a.EPSILON10&&Math.abs(v.y)<h.a.EPSILON10?O.UNIT_X:O.normalize(v,Wa),A=O.UNIT_Z,E=O.cross(w,A,Ya);m=xi.fromPointNormal(v,w,Qa);const T=O.fromRadians(b+h.a.PI_OVER_TWO,y,n,i,Xa);a=O.dot(xi.projectPointOntoPlane(m,T,Ka),E),o=-a,d=O.fromRadians(0,e.north,_?t:n,i,Ja).z,s=O.fromRadians(0,e.south,g?t:n,i,Za).z;const C=O.fromRadians(e.east,y,n,i,$a);return f=xi.getPointDistance(m,C),p=0,xa(v,E,A,w,o,a,s,d,f,p,r)},ga.fromTransformation=function(e,t){return s.a.typeOf.object("transformation",e),Object(l.a)(t)||(t=new ga),t.center=Me.getTranslation(e,t.center),t.halfAxes=Me.getMatrix3(e,t.halfAxes),t.halfAxes=ce.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},ga.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(O.clone(e.center,t.center),ce.clone(e.halfAxes,t.halfAxes),t):new ga(e.center,e.halfAxes)},ga.intersectPlane=function(e,t){if(!Object(l.a)(e))throw new u.a("box is required.");if(!Object(l.a)(t))throw new u.a("plane is required.");const n=e.center,i=t.normal,r=e.halfAxes,o=i.x,a=i.y,s=i.z,c=Math.abs(o*r[ce.COLUMN0ROW0]+a*r[ce.COLUMN0ROW1]+s*r[ce.COLUMN0ROW2])+Math.abs(o*r[ce.COLUMN1ROW0]+a*r[ce.COLUMN1ROW1]+s*r[ce.COLUMN1ROW2])+Math.abs(o*r[ce.COLUMN2ROW0]+a*r[ce.COLUMN2ROW1]+s*r[ce.COLUMN2ROW2]),h=O.dot(i,n)+t.distance;return h<=-c?W.OUTSIDE:h>=c?W.INSIDE:W.INTERSECTING};const es=new O,ts=new O,ns=new O,is=new O,rs=new O,os=new O;ga.distanceSquaredTo=function(e,t){if(!Object(l.a)(e))throw new u.a("box is required.");if(!Object(l.a)(t))throw new u.a("cartesian is required.");const n=O.subtract(t,e.center,Ta),i=e.halfAxes;let r=ce.getColumn(i,0,es),o=ce.getColumn(i,1,ts),a=ce.getColumn(i,2,ns);const s=O.magnitude(r),c=O.magnitude(o),d=O.magnitude(a);let f=!0,p=!0,m=!0;s>0?O.divideByScalar(r,s,r):f=!1,c>0?O.divideByScalar(o,c,o):p=!1,d>0?O.divideByScalar(a,d,a):m=!1;const g=!f+!p+!m;let _,y,b;if(1===g){let e=r;_=o,y=a,p?m||(e=a,y=r):(e=o,_=r),b=O.cross(_,y,rs),e===r?r=b:e===o?o=b:e===a&&(a=b)}else if(2===g){_=r,p?_=o:m&&(_=a);let e=O.UNIT_Y;e.equalsEpsilon(_,h.a.EPSILON3)&&(e=O.UNIT_X),y=O.cross(_,e,is),O.normalize(y,y),b=O.cross(_,y,rs),O.normalize(b,b),_===r?(o=y,a=b):_===o?(a=y,r=b):_===a&&(r=y,o=b)}else 3===g&&(r=O.UNIT_X,o=O.UNIT_Y,a=O.UNIT_Z);const v=os;v.x=O.dot(n,r),v.y=O.dot(n,o),v.z=O.dot(n,a);let w,A=0;return v.x<-s?(w=v.x+s,A+=w*w):v.x>s&&(w=v.x-s,A+=w*w),v.y<-c?(w=v.y+c,A+=w*w):v.y>c&&(w=v.y-c,A+=w*w),v.z<-d?(w=v.z+d,A+=w*w):v.z>d&&(w=v.z-d,A+=w*w),A};const as=new O,ss=new O;ga.computePlaneDistances=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("box is required.");if(!Object(l.a)(t))throw new u.a("position is required.");if(!Object(l.a)(n))throw new u.a("direction is required.");Object(l.a)(i)||(i=new Y);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;const a=e.center,s=e.halfAxes,c=ce.getColumn(s,0,es),h=ce.getColumn(s,1,ts),d=ce.getColumn(s,2,ns),f=O.add(c,h,as);O.add(f,d,f),O.add(f,a,f);const p=O.subtract(f,t,ss);let m=O.dot(n,p);return r=Math.min(m,r),o=Math.max(m,o),O.add(a,c,f),O.add(f,h,f),O.subtract(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),O.add(a,c,f),O.subtract(f,h,f),O.add(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),O.add(a,c,f),O.subtract(f,h,f),O.subtract(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),O.subtract(a,c,f),O.add(f,h,f),O.add(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),O.subtract(a,c,f),O.add(f,h,f),O.subtract(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),O.subtract(a,c,f),O.subtract(f,h,f),O.add(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),O.subtract(a,c,f),O.subtract(f,h,f),O.subtract(f,d,f),O.subtract(f,t,p),m=O.dot(n,p),r=Math.min(m,r),o=Math.max(m,o),i.start=r,i.stop=o,i};const cs=new O,ls=new O,us=new O;ga.computeCorners=function(e,t){s.a.typeOf.object("box",e),Object(l.a)(t)||(t=[new O,new O,new O,new O,new O,new O,new O,new O]);const n=e.center,i=e.halfAxes,r=ce.getColumn(i,0,cs),o=ce.getColumn(i,1,ls),a=ce.getColumn(i,2,us);return O.clone(n,t[0]),O.subtract(t[0],r,t[0]),O.subtract(t[0],o,t[0]),O.subtract(t[0],a,t[0]),O.clone(n,t[1]),O.subtract(t[1],r,t[1]),O.subtract(t[1],o,t[1]),O.add(t[1],a,t[1]),O.clone(n,t[2]),O.subtract(t[2],r,t[2]),O.add(t[2],o,t[2]),O.subtract(t[2],a,t[2]),O.clone(n,t[3]),O.subtract(t[3],r,t[3]),O.add(t[3],o,t[3]),O.add(t[3],a,t[3]),O.clone(n,t[4]),O.add(t[4],r,t[4]),O.subtract(t[4],o,t[4]),O.subtract(t[4],a,t[4]),O.clone(n,t[5]),O.add(t[5],r,t[5]),O.subtract(t[5],o,t[5]),O.add(t[5],a,t[5]),O.clone(n,t[6]),O.add(t[6],r,t[6]),O.add(t[6],o,t[6]),O.subtract(t[6],a,t[6]),O.clone(n,t[7]),O.add(t[7],r,t[7]),O.add(t[7],o,t[7]),O.add(t[7],a,t[7]),t};const hs=new ce;ga.computeTransformation=function(e,t){s.a.typeOf.object("box",e),Object(l.a)(t)||(t=new Me);const n=e.center,i=ce.multiplyByUniformScale(e.halfAxes,2,hs);return Me.fromRotationTranslation(i,n,t)};const ds=new At;ga.isOccluded=function(e,t){if(!Object(l.a)(e))throw new u.a("box is required.");if(!Object(l.a)(t))throw new u.a("occluder is required.");const n=At.fromOrientedBoundingBox(e,ds);return!t.isBoundingSphereVisible(n)},ga.prototype.intersectPlane=function(e){return ga.intersectPlane(this,e)},ga.prototype.distanceSquaredTo=function(e){return ga.distanceSquaredTo(this,e)},ga.prototype.computePlaneDistances=function(e,t,n){return ga.computePlaneDistances(this,e,t,n)},ga.prototype.computeCorners=function(e){return ga.computeCorners(this,e)},ga.prototype.computeTransformation=function(e){return ga.computeTransformation(this,e)},ga.prototype.isOccluded=function(e){return ga.isOccluded(this,e)},ga.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&O.equals(e.center,t.center)&&ce.equals(e.halfAxes,t.halfAxes)},ga.prototype.clone=function(e){return ga.clone(this,e)},ga.prototype.equals=function(e){return ga.equals(this,e)};var fs=ga;var ps=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,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_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047});const ms={BYTE:ps.BYTE,UNSIGNED_BYTE:ps.UNSIGNED_BYTE,SHORT:ps.SHORT,UNSIGNED_SHORT:ps.UNSIGNED_SHORT,INT:ps.INT,UNSIGNED_INT:ps.UNSIGNED_INT,FLOAT:ps.FLOAT,DOUBLE:ps.DOUBLE,getSizeInBytes:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");switch(e){case ms.BYTE:return Int8Array.BYTES_PER_ELEMENT;case ms.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ms.SHORT:return Int16Array.BYTES_PER_ELEMENT;case ms.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ms.INT:return Int32Array.BYTES_PER_ELEMENT;case ms.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case ms.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case ms.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new u.a("componentDatatype is not a valid value.")}},fromTypedArray:function(e){if(e instanceof Int8Array)return ms.BYTE;if(e instanceof Uint8Array)return ms.UNSIGNED_BYTE;if(e instanceof Int16Array)return ms.SHORT;if(e instanceof Uint16Array)return ms.UNSIGNED_SHORT;if(e instanceof Int32Array)return ms.INT;if(e instanceof Uint32Array)return ms.UNSIGNED_INT;if(e instanceof Float32Array)return ms.FLOAT;if(e instanceof Float64Array)return ms.DOUBLE;throw new u.a("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},validate:function(e){return Object(l.a)(e)&&(e===ms.BYTE||e===ms.UNSIGNED_BYTE||e===ms.SHORT||e===ms.UNSIGNED_SHORT||e===ms.INT||e===ms.UNSIGNED_INT||e===ms.FLOAT||e===ms.DOUBLE)},createTypedArray:function(e,t){if(!Object(l.a)(e))throw new u.a("componentDatatype is required.");if(!Object(l.a)(t))throw new u.a("valuesOrLength is required.");switch(e){case ms.BYTE:return new Int8Array(t);case ms.UNSIGNED_BYTE:return new Uint8Array(t);case ms.SHORT:return new Int16Array(t);case ms.UNSIGNED_SHORT:return new Uint16Array(t);case ms.INT:return new Int32Array(t);case ms.UNSIGNED_INT:return new Uint32Array(t);case ms.FLOAT:return new Float32Array(t);case ms.DOUBLE:return new Float64Array(t);default:throw new u.a("componentDatatype is not a valid value.")}},createArrayBufferView:function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("componentDatatype is required.");if(!Object(l.a)(t))throw new u.a("buffer is required.");switch(n=Object(c.a)(n,0),i=Object(c.a)(i,(t.byteLength-n)/ms.getSizeInBytes(e)),e){case ms.BYTE:return new Int8Array(t,n,i);case ms.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case ms.SHORT:return new Int16Array(t,n,i);case ms.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case ms.INT:return new Int32Array(t,n,i);case ms.UNSIGNED_INT:return new Uint32Array(t,n,i);case ms.FLOAT:return new Float32Array(t,n,i);case ms.DOUBLE:return new Float64Array(t,n,i);default:throw new u.a("componentDatatype is not a valid value.")}},fromName:function(e){switch(e){case"BYTE":return ms.BYTE;case"UNSIGNED_BYTE":return ms.UNSIGNED_BYTE;case"SHORT":return ms.SHORT;case"UNSIGNED_SHORT":return ms.UNSIGNED_SHORT;case"INT":return ms.INT;case"UNSIGNED_INT":return ms.UNSIGNED_INT;case"FLOAT":return ms.FLOAT;case"DOUBLE":return ms.DOUBLE;default:throw new u.a("name is not a valid value.")}}};var gs=Object.freeze(ms);function _s(e,t,n,i){this[0]=Object(c.a)(e,0),this[1]=Object(c.a)(n,0),this[2]=Object(c.a)(t,0),this[3]=Object(c.a)(i,0)}_s.packedLength=4,_s.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},_s.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new _s),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},_s.packArray=function(e,t){s.a.defined("array",e);const n=e.length,i=4*n;if(Object(l.a)(t)){if(!Array.isArray(t)&&t.length!==i)throw new u.a("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}else t=new Array(i);for(let i=0;i<n;++i)_s.pack(e[i],t,4*i);return t},_s.unpackArray=function(e,t){if(s.a.defined("array",e),s.a.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new u.a("array length must be a multiple of 4.");const n=e.length;Object(l.a)(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const n=i/4;t[n]=_s.unpack(e,i,t[n])}return t},_s.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new _s(e[0],e[2],e[1],e[3])},_s.fromArray=_s.unpack,_s.fromColumnMajorArray=function(e,t){return s.a.defined("values",e),_s.clone(e,t)},_s.fromRowMajorArray=function(e,t){return s.a.defined("values",e),Object(l.a)(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new _s(e[0],e[1],e[2],e[3])},_s.fromScale=function(e,t){return s.a.typeOf.object("scale",e),Object(l.a)(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new _s(e.x,0,0,e.y)},_s.fromUniformScale=function(e,t){return s.a.typeOf.number("scale",e),Object(l.a)(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new _s(e,0,0,e)},_s.fromRotation=function(e,t){s.a.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return Object(l.a)(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new _s(n,-i,i,n)},_s.toArray=function(e,t){return s.a.typeOf.object("matrix",e),Object(l.a)(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},_s.getElementIndex=function(e,t){return s.a.typeOf.number.greaterThanOrEquals("row",t,0),s.a.typeOf.number.lessThanOrEquals("row",t,1),s.a.typeOf.number.greaterThanOrEquals("column",e,0),s.a.typeOf.number.lessThanOrEquals("column",e,1),2*e+t},_s.getColumn=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,1),s.a.typeOf.object("result",n);const i=2*t,r=e[i],o=e[i+1];return n.x=r,n.y=o,n},_s.setColumn=function(e,t,n,i){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,1),s.a.typeOf.object("cartesian",n),s.a.typeOf.object("result",i);const r=2*t;return(i=_s.clone(e,i))[r]=n.x,i[r+1]=n.y,i},_s.getRow=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,1),s.a.typeOf.object("result",n);const i=e[t],r=e[t+2];return n.x=i,n.y=r,n},_s.setRow=function(e,t,n,i){return s.a.typeOf.object("matrix",e),s.a.typeOf.number.greaterThanOrEquals("index",t,0),s.a.typeOf.number.lessThanOrEquals("index",t,1),s.a.typeOf.object("cartesian",n),s.a.typeOf.object("result",i),(i=_s.clone(e,i))[t]=n.x,i[t+2]=n.y,i};const ys=new Vt;_s.setScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("scale",t),s.a.typeOf.object("result",n);const i=_s.getScale(e,ys),r=t.x/i.x,o=t.y/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};const bs=new Vt;_s.setUniformScale=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.number("scale",t),s.a.typeOf.object("result",n);const i=_s.getScale(e,bs),r=t/i.x,o=t/i.y;return n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*o,n[3]=e[3]*o,n};const vs=new Vt;_s.getScale=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t.x=Vt.magnitude(Vt.fromElements(e[0],e[1],vs)),t.y=Vt.magnitude(Vt.fromElements(e[2],e[3],vs)),t};const Os=new Vt;_s.getMaximumScale=function(e){return _s.getScale(e,Os),Vt.maximumComponent(Os)};const ws=new Vt;_s.setRotation=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",n);const i=_s.getScale(e,ws);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};const As=new Vt;_s.getRotation=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=_s.getScale(e,As);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t},_s.multiply=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n);const i=e[0]*t[0]+e[2]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=o,n[2]=r,n[3]=a,n},_s.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},_s.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},_s.multiplyByVector=function(e,t,n){s.a.typeOf.object("matrix",e),s.a.typeOf.object("cartesian",t),s.a.typeOf.object("result",n);const i=e[0]*t.x+e[2]*t.y,r=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=r,n},_s.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},_s.multiplyByScale=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("scale",t),s.a.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},_s.multiplyByUniformScale=function(e,t,n){return s.a.typeOf.object("matrix",e),s.a.typeOf.number("scale",t),s.a.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},_s.negate=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},_s.transpose=function(e,t){s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t);const n=e[0],i=e[2],r=e[1],o=e[3];return t[0]=n,t[1]=i,t[2]=r,t[3]=o,t},_s.abs=function(e,t){return s.a.typeOf.object("matrix",e),s.a.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},_s.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},_s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},_s.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},_s.IDENTITY=Object.freeze(new _s(1,0,0,1)),_s.ZERO=Object.freeze(new _s(0,0,0,0)),_s.COLUMN0ROW0=0,_s.COLUMN0ROW1=1,_s.COLUMN1ROW0=2,_s.COLUMN1ROW1=3,Object.defineProperties(_s.prototype,{length:{get:function(){return _s.packedLength}}}),_s.prototype.clone=function(e){return _s.clone(this,e)},_s.prototype.equals=function(e){return _s.equals(this,e)},_s.prototype.equalsEpsilon=function(e,t){return _s.equalsEpsilon(this,e,t)},_s.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`};var Es=_s;const Ts={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",getMathType:function(e){switch(e){case Ts.SCALAR:return Number;case Ts.VEC2:return Vt;case Ts.VEC3:return O;case Ts.VEC4:return _e;case Ts.MAT2:return Es;case Ts.MAT3:return ce;case Ts.MAT4:return Me;default:throw new u.a("attributeType is not a valid value.")}},getNumberOfComponents:function(e){switch(e){case Ts.SCALAR:return 1;case Ts.VEC2:return 2;case Ts.VEC3:return 3;case Ts.VEC4:case Ts.MAT2:return 4;case Ts.MAT3:return 9;case Ts.MAT4:return 16;default:throw new u.a("attributeType is not a valid value.")}},getAttributeLocationCount:function(e){switch(e){case Ts.SCALAR:case Ts.VEC2:case Ts.VEC3:case Ts.VEC4:return 1;case Ts.MAT2:return 2;case Ts.MAT3:return 3;case Ts.MAT4:return 4;default:throw new u.a("attributeType is not a valid value.")}},getGlslType:function(e){switch(s.a.typeOf.string("attributeType",e),e){case Ts.SCALAR:return"float";case Ts.VEC2:return"vec2";case Ts.VEC3:return"vec3";case Ts.VEC4:return"vec4";case Ts.MAT2:return"mat2";case Ts.MAT3:return"mat3";case Ts.MAT4:return"mat4";default:throw new u.a("attributeType is not a valid value.")}}};var Cs=Object.freeze(Ts);const xs={octEncodeInRange:function(e,t,n){s.a.defined("vector",e),s.a.defined("result",n);const i=O.magnitudeSquared(e);if(Math.abs(i-1)>h.a.EPSILON6)throw new u.a("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){const e=n.x,t=n.y;n.x=(1-Math.abs(t))*h.a.signNotZero(e),n.y=(1-Math.abs(e))*h.a.signNotZero(t)}return n.x=h.a.toSNorm(n.x,t),n.y=h.a.toSNorm(n.y,t),n},octEncode:function(e,t){return xs.octEncodeInRange(e,255,t)}},Ss=new Vt,Is=new Uint8Array(1);function Ps(e){return Is[0]=e,Is[0]}xs.octEncodeToCartesian4=function(e,t){return xs.octEncodeInRange(e,65535,Ss),t.x=Ps(Ss.x*(1/256)),t.y=Ps(Ss.x),t.z=Ps(Ss.y*(1/256)),t.w=Ps(Ss.y),t},xs.octDecodeInRange=function(e,t,n,i){if(s.a.defined("result",i),e<0||e>n||t<0||t>n)throw new u.a("x and y must be unsigned normalized integers between 0 and "+n);if(i.x=h.a.fromSNorm(e,n),i.y=h.a.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const e=i.x;i.x=(1-Math.abs(i.y))*h.a.signNotZero(e),i.y=(1-Math.abs(e))*h.a.signNotZero(i.y)}return O.normalize(i,i)},xs.octDecode=function(e,t,n){return xs.octDecodeInRange(e,t,255,n)},xs.octDecodeFromCartesian4=function(e,t){s.a.typeOf.object("encoded",e),s.a.typeOf.object("result",t);const n=e.x,i=e.y,r=e.z,o=e.w;if(n<0||n>255||i<0||i>255||r<0||r>255||o<0||o>255)throw new u.a("x, y, z, and w must be unsigned normalized integers between 0 and 255");const a=256*n+i,c=256*r+o;return xs.octDecodeInRange(a,c,65535,t)},xs.octPackFloat=function(e){return s.a.defined("encoded",e),256*e.x+e.y};const Ds=new Vt;function Rs(e){return e>>1^-(1&e)}xs.octEncodeFloat=function(e){return xs.octEncode(e,Ds),xs.octPackFloat(Ds)},xs.octDecodeFloat=function(e,t){s.a.defined("value",e);const n=e/256,i=Math.floor(n),r=256*(n-i);return xs.octDecode(i,r,t)},xs.octPack=function(e,t,n,i){s.a.defined("v1",e),s.a.defined("v2",t),s.a.defined("v3",n),s.a.defined("result",i);const r=xs.octEncodeFloat(e),o=xs.octEncodeFloat(t),a=xs.octEncode(n,Ds);return i.x=65536*a.x+r,i.y=65536*a.y+o,i},xs.octUnpack=function(e,t,n,i){s.a.defined("packed",e),s.a.defined("v1",t),s.a.defined("v2",n),s.a.defined("v3",i);let r=e.x/65536;const o=Math.floor(r),a=65536*(r-o);r=e.y/65536;const c=Math.floor(r),l=65536*(r-c);xs.octDecodeFloat(a,t),xs.octDecodeFloat(l,n),xs.octDecode(o,c,i)},xs.compressTextureCoordinates=function(e){s.a.defined("textureCoordinates",e);return 4096*(4095*e.x|0)+(4095*e.y|0)},xs.decompressTextureCoordinates=function(e,t){s.a.defined("compressed",e),s.a.defined("result",t);const n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-4096*i)/4095,t},xs.zigZagDeltaDecode=function(e,t,n){s.a.defined("uBuffer",e),s.a.defined("vBuffer",t),s.a.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),Object(l.a)(n)&&s.a.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);const i=e.length;let r=0,o=0,a=0;for(let s=0;s<i;++s)r+=Rs(e[s]),o+=Rs(t[s]),e[s]=r,t[s]=o,Object(l.a)(n)&&(a+=Rs(n[s]),n[s]=a)},xs.dequantize=function(e,t,n,i){s.a.defined("typedArray",e),s.a.defined("componentDatatype",t),s.a.defined("type",n),s.a.defined("count",i);const r=Cs.getNumberOfComponents(n);let o;switch(t){case gs.BYTE:o=127;break;case gs.UNSIGNED_BYTE:o=255;break;case gs.SHORT:o=32767;break;case gs.UNSIGNED_SHORT:o=65535;break;case gs.INT:o=2147483647;break;case gs.UNSIGNED_INT:o=4294967295;break;default:throw new u.a("Cannot dequantize component datatype: "+t)}const a=new Float32Array(i*r);for(let t=0;t<i;t++)for(let n=0;n<r;n++){const i=t*r+n;a[i]=Math.max(e[i]/o,-1)}return a},xs.decodeRGB565=function(e,t){s.a.defined("typedArray",e);const n=3*e.length;Object(l.a)(t)&&s.a.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);const i=e.length;Object(l.a)(t)||(t=new Float32Array(3*i));for(let n=0;n<i;n++){const i=e[n],r=i>>11,o=i>>5&63,a=31&i,s=3*n;t[s]=r*(1/31),t[s+1]=o*(1/63),t[s+2]=a*(1/31)}return t};var js=xs;const Ms={getHeight:function(e,t,n){return(e-n)*t+n}},Ls=new O;Ms.getPosition=function(e,t,n,i,r){const o=t.cartesianToCartographic(e,Ls),a=Ms.getHeight(o.height,n,i);return O.fromRadians(o.longitude,o.latitude,a,t,r)};var Ns=Ms;var Bs=Object.freeze({NONE:0,BITS12:1});const Fs=new O,zs=new O,ks=new Vt,Us=new Me,Vs=new Me,Hs=Math.pow(2,12);function Gs(e,t,n,i,r,o,a,s,u,h){let d,f,p=Bs.NONE;if(Object(l.a)(t)&&Object(l.a)(n)&&Object(l.a)(i)&&Object(l.a)(r)){const e=t.minimum,o=t.maximum,a=O.subtract(o,e,zs),s=i-n;p=Math.max(O.maximumComponent(a),s)<Hs-1?Bs.BITS12:Bs.NONE,d=Me.inverseTransformation(r,new Me);const c=O.negate(e,Fs);Me.multiply(Me.fromTranslation(c,Us),d,d);const l=Fs;l.x=1/a.x,l.y=1/a.y,l.z=1/a.z,Me.multiply(Me.fromScale(l,Us),d,d),f=Me.clone(r),Me.setTranslation(f,O.ZERO,f),r=Me.clone(r,new Me);const u=Me.fromTranslation(e,Us),h=Me.fromScale(a,Vs),m=Me.multiply(u,h,Us);Me.multiply(r,m,r),Me.multiply(f,m,f)}this.quantization=p,this.minimumHeight=n,this.maximumHeight=i,this.center=O.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=f,this.hasVertexNormals=o,this.hasWebMercatorT=Object(c.a)(a,!1),this.hasGeodeticSurfaceNormals=Object(c.a)(s,!1),this.exaggeration=Object(c.a)(u,1),this.exaggerationRelativeHeight=Object(c.a)(h,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Gs.prototype.encode=function(e,t,n,i,r,o,a,s){const c=i.x,l=i.y;if(this.quantization===Bs.BITS12){(n=Me.multiplyByPoint(this.toScaledENU,n,Fs)).x=h.a.clamp(n.x,0,1),n.y=h.a.clamp(n.y,0,1),n.z=h.a.clamp(n.z,0,1);const i=this.maximumHeight-this.minimumHeight,o=h.a.clamp((r-this.minimumHeight)/i,0,1);Vt.fromElements(n.x,n.y,ks);const s=js.compressTextureCoordinates(ks);Vt.fromElements(n.z,o,ks);const u=js.compressTextureCoordinates(ks);Vt.fromElements(c,l,ks);const d=js.compressTextureCoordinates(ks);if(e[t++]=s,e[t++]=u,e[t++]=d,this.hasWebMercatorT){Vt.fromElements(a,0,ks);const n=js.compressTextureCoordinates(ks);e[t++]=n}}else O.subtract(n,this.center,Fs),e[t++]=Fs.x,e[t++]=Fs.y,e[t++]=Fs.z,e[t++]=r,e[t++]=c,e[t++]=l,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=js.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=s.x,e[t++]=s.y,e[t++]=s.z),t};const qs=new O,Ws=new O;Gs.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;const i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();const o=this.stride;for(let a=0;a<r;a++){for(let n=0;n<i;n++){const r=a*i+n;t[a*o+n]=e[r]}const r=this.decodePosition(t,a,qs),s=n.geodeticSurfaceNormal(r,Ws),c=a*o+this._offsetGeodeticSurfaceNormal;t[c]=s.x,t[c+1]=s.y,t[c+2]=s.z}},Gs.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;const n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();const r=this.stride;for(let o=0;o<i;o++)for(let i=0;i<r;i++){const a=o*n+i;t[o*r+i]=e[a]}},Gs.prototype.decodePosition=function(e,t,n){if(Object(l.a)(n)||(n=new O),t*=this.stride,this.quantization===Bs.BITS12){const i=js.decompressTextureCoordinates(e[t],ks);n.x=i.x,n.y=i.y;const r=js.decompressTextureCoordinates(e[t+1],ks);return n.z=r.x,Me.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],O.add(n,this.center,n)},Gs.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);const i=this.exaggeration,r=this.exaggerationRelativeHeight;if(1!==i&&this.hasGeodeticSurfaceNormals){const o=this.decodeGeodeticSurfaceNormal(e,t,Ws),a=this.decodeHeight(e,t),s=Ns.getHeight(a,i,r)-a;n.x+=o.x*s,n.y+=o.y*s,n.z+=o.z*s}return n},Gs.prototype.decodeTextureCoordinates=function(e,t,n){return Object(l.a)(n)||(n=new Vt),t*=this.stride,this.quantization===Bs.BITS12?js.decompressTextureCoordinates(e[t+2],n):Vt.fromElements(e[t+4],e[t+5],n)},Gs.prototype.decodeHeight=function(e,t){if(t*=this.stride,this.quantization===Bs.BITS12){return js.decompressTextureCoordinates(e[t+1],ks).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return e[t+3]},Gs.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Bs.BITS12?js.decompressTextureCoordinates(e[t+3],ks).x:e[t+6]},Gs.prototype.getOctEncodedNormal=function(e,t,n){const i=e[t=t*this.stride+this._offsetVertexNormal]/256,r=Math.floor(i),o=256*(i-r);return Vt.fromElements(r,o,n)},Gs.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n},Gs.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Bs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};const Ys={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},Xs={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Gs.prototype.getAttributes=function(e){const t=gs.FLOAT,n=gs.getSizeInBytes(t),i=this.stride*n;let r=0;const o=[];function a(a,s){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:s,offsetInBytes:r,strideInBytes:i}),r+=s*n}if(this.quantization===Bs.NONE){a(Ys.position3DAndHeight,4);let e=2;e+=this.hasWebMercatorT?1:0,e+=this.hasVertexNormals?1:0,a(Ys.textureCoordAndEncodedNormals,e),this.hasGeodeticSurfaceNormals&&a(Ys.geodeticSurfaceNormal,3)}else{const e=this.hasWebMercatorT||this.hasVertexNormals,t=this.hasWebMercatorT&&this.hasVertexNormals;a(Xs.compressed0,e?4:3),t&&a(Xs.compressed1,1),this.hasGeodeticSurfaceNormals&&a(Xs.geodeticSurfaceNormal,3)}return o},Gs.prototype.getAttributeLocations=function(){return this.quantization===Bs.NONE?Ys:Xs},Gs.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)||(t=new Gs),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=O.clone(e.center),t.toScaledENU=Me.clone(e.toScaledENU),t.fromScaledENU=Me.clone(e.fromScaledENU),t.matrix=Me.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Ks=Gs;function Js(e){this._ellipsoid=Object(c.a)(e,H.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Js.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Js.mercatorAngleToGeodeticLatitude=function(e){return h.a.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},Js.geodeticLatitudeToMercatorAngle=function(e){e>Js.MaximumLatitude?e=Js.MaximumLatitude:e<-Js.MaximumLatitude&&(e=-Js.MaximumLatitude);const t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},Js.MaximumLatitude=Js.mercatorAngleToGeodeticLatitude(Math.PI),Js.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,r=Js.geodeticLatitudeToMercatorAngle(e.latitude)*n,o=e.height;return Object(l.a)(t)?(t.x=i,t.y=r,t.z=o,t):new O(i,r,o)},Js.prototype.unproject=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,r=Js.mercatorAngleToGeodeticLatitude(e.y*n),o=e.z;return Object(l.a)(t)?(t.longitude=i,t.latitude=r,t.height=o,t):new R(i,r,o)};var Zs=Js;const $s={};$s.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});const Qs=new O,ec=new Me,tc=new O,nc=new O;$s.computeVertices=function(e){if(!Object(l.a)(e)||!Object(l.a)(e.heightmap))throw new u.a("options.heightmap is required.");if(!Object(l.a)(e.width)||!Object(l.a)(e.height))throw new u.a("options.width and options.height are required.");if(!Object(l.a)(e.nativeRectangle))throw new u.a("options.nativeRectangle is required.");if(!Object(l.a)(e.skirtHeight))throw new u.a("options.skirtHeight is required.");const t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,a=h.a.PI_OVER_TWO,s=h.a.toRadians,d=e.heightmap,f=e.width,p=e.height,m=e.skirtHeight,g=m>0,_=Object(c.a)(e.isGeographic,!0),y=Object(c.a)(e.ellipsoid,H.WGS84),b=1/y.maximumRadius,v=Be.clone(e.nativeRectangle),w=Be.clone(e.rectangle);let A,E,T,C;Object(l.a)(w)?(A=w.west,E=w.south,T=w.east,C=w.north):_?(A=s(v.west),E=s(v.south),T=s(v.east),C=s(v.north)):(A=v.west*b,E=a-2*r(o(-v.south*b)),T=v.east*b,C=a-2*r(o(-v.north*b)));let x=e.relativeToCenter;const S=Object(l.a)(x);x=S?x:O.ZERO;const I=Object(c.a)(e.includeWebMercatorT,!1),P=Object(c.a)(e.exaggeration,1),D=Object(c.a)(e.exaggerationRelativeHeight,0),R=1!==P,j=Object(c.a)(e.structure,$s.DEFAULT_STRUCTURE),M=Object(c.a)(j.heightScale,$s.DEFAULT_STRUCTURE.heightScale),L=Object(c.a)(j.heightOffset,$s.DEFAULT_STRUCTURE.heightOffset),N=Object(c.a)(j.elementsPerHeight,$s.DEFAULT_STRUCTURE.elementsPerHeight),B=Object(c.a)(j.stride,$s.DEFAULT_STRUCTURE.stride),F=Object(c.a)(j.elementMultiplier,$s.DEFAULT_STRUCTURE.elementMultiplier),z=Object(c.a)(j.isBigEndian,$s.DEFAULT_STRUCTURE.isBigEndian);let k=Be.computeWidth(v),U=Be.computeHeight(v);const V=k/(f-1),G=U/(p-1);_||(k*=b,U*=b);const q=y.radiiSquared,W=q.x,Y=q.y,X=q.z;let K=65536,J=-65536;const Z=ca.eastNorthUpToFixedFrame(x,y),$=Me.inverseTransformation(Z,ec);let Q,ee;I&&(Q=Zs.geodeticLatitudeToMercatorAngle(E),ee=1/(Zs.geodeticLatitudeToMercatorAngle(C)-Q));const te=tc;te.x=Number.POSITIVE_INFINITY,te.y=Number.POSITIVE_INFINITY,te.z=Number.POSITIVE_INFINITY;const ne=nc;ne.x=Number.NEGATIVE_INFINITY,ne.y=Number.NEGATIVE_INFINITY,ne.z=Number.NEGATIVE_INFINITY;let ie=Number.POSITIVE_INFINITY;const re=f*p,oe=re+(m>0?2*f+2*p:0),ae=new Array(oe),se=new Array(oe),ce=new Array(oe),le=I?new Array(oe):[],ue=R?new Array(oe):[];let he=0,de=p,fe=0,pe=f;g&&(--he,++de,--fe,++pe);for(let e=he;e<de;++e){let c=e;c<0&&(c=0),c>=p&&(c=p-1);let l=v.north-G*c;l=_?s(l):a-2*r(o(-l*b));let u=(l-E)/(C-E);u=h.a.clamp(u,0,1);const g=e===he,w=e===de-1;m>0&&(g?l+=1e-5*U:w&&(l-=1e-5*U));const x=t(l),S=n(l),P=X*S;let D;I&&(D=(Zs.geodeticLatitudeToMercatorAngle(l)-Q)*ee);for(let e=fe;e<pe;++e){let r=e;r<0&&(r=0),r>=f&&(r=f-1);const o=c*(f*B)+r*B;let a;if(1===N)a=d[o];else{let e;if(a=0,z)for(e=0;e<N;++e)a=a*F+d[o+e];else for(e=N-1;e>=0;--e)a=a*F+d[o+e]}a=a*M+L,J=Math.max(J,a),K=Math.min(K,a);let l=v.west+V*r;_?l=s(l):l*=b;let E=(l-A)/(T-A);E=h.a.clamp(E,0,1);let C=c*f+r;if(m>0){const t=e===fe,n=e===pe-1,i=g||w||t||n;if((g||w)&&(t||n))continue;i&&(a-=m,t?(C=re+(p-c-1),l-=1e-5*k):w?C=re+p+(f-r-1):n?(C=re+p+f+c,l+=1e-5*k):g&&(C=re+p+f+p+r))}const j=x*t(l),U=x*n(l),H=W*j,G=Y*U,q=1/i(H*j+G*U+P*S),X=H*q,Z=G*q,Q=P*q,ee=new O;ee.x=X+j*a,ee.y=Z+U*a,ee.z=Q+S*a,Me.multiplyByPoint($,ee,Qs),O.minimumByComponent(Qs,te,te),O.maximumByComponent(Qs,ne,ne),ie=Math.min(ie,a),ae[C]=ee,ce[C]=new Vt(E,u),se[C]=a,I&&(le[C]=D),R&&(ue[C]=y.geodeticSurfaceNormal(ee))}}const me=At.fromPoints(ae);let ge,_e;if(Object(l.a)(w)&&(ge=fs.fromRectangle(w,K,J,y)),S){_e=new Rn(y).computeHorizonCullingPointPossiblyUnderEllipsoid(x,ae,K)}const ye=new pn(te,ne,x),be=new Ks(x,ye,ie,J,Z,!1,I,R,P,D),ve=new Float32Array(oe*be.stride);let Oe=0;for(let e=0;e<oe;++e)Oe=be.encode(ve,Oe,ae[e],ce[e],se[e],void 0,le[e],ue[e]);return{vertices:ve,maximumHeight:J,minimumHeight:K,encoding:be,boundingSphere3D:me,orientedBoundingBox:ge,occludeePointInScaledSpace:_e}};var ic=$s,rc=n(10),oc=n(14);function ac(){return!0}var sc=function(e,t){function n(){throw new u.a(t)}t=Object(c.a)(t,"This object was destroyed, i.e., destroy() was called.");for(const t in e)"function"==typeof e[t]&&(e[t]=n);e.isDestroyed=ac},cc=n(30);function lc(){if(!Object(l.a)(mc._canTransferArrayBuffer)){const e=new Worker(dc("Workers/transferTypedArrayTest.js"));e.postMessage=Object(c.a)(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch(e){return mc._canTransferArrayBuffer=!1,mc._canTransferArrayBuffer}const i=Object(oc.a)();e.onmessage=function(n){const r=n.data.array,o=Object(l.a)(r)&&r[0]===t;i.resolve(o),e.terminate(),mc._canTransferArrayBuffer=o},mc._canTransferArrayBuffer=i.promise}return mc._canTransferArrayBuffer}const uc=new un.a;function hc(e,t){--e._activeTasks;const n=t.id;if(!Object(l.a)(n))return;const i=e._deferreds,r=i[n];if(Object(l.a)(t.error)){let e=t.error;"RuntimeError"===e.name?(e=new ye.a(t.error.message),e.stack=t.error.stack):"DeveloperError"===e.name&&(e=new u.a(t.error.message),e.stack=t.error.stack),uc.raiseEvent(e),r.reject(e)}else uc.raiseEvent(),r.resolve(t.result);delete i[n]}function dc(e){let t=Lt(e);if(Object(cc.a)(t)){const e=`importScripts("${t}");`;let n;try{n=new Blob([e],{type:"application/javascript"})}catch(t){const i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);i.append(e),n=i.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(n)}return t}let fc;function pc(e){const t=new Worker((Object(l.a)(fc)||(fc=dc("Workers/cesiumWorkerBootstrapper.js")),fc));t.postMessage=Object(c.a)(t.webkitPostMessage,t.postMessage);const n={loaderConfig:{paths:{Workers:Lt("Workers")},baseUrl:Lt.getCesiumBaseUrl().url},workerModule:e._workerPath};return t.postMessage(n),t.onmessage=function(t){hc(e,t.data)},t}function mc(e,t){const n=new rc.a(e);this._workerPath=0!==n.scheme().length&&0===n.fragment().length?e:mc._workerModulePrefix+e,this._maximumActiveTasks=Object(c.a)(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}const gc=[];mc.prototype.scheduleTask=function(e,t){if(Object(l.a)(this._worker)||(this._worker=pc(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;const n=this;return Promise.resolve(lc()).then((function(i){Object(l.a)(t)?i||(t.length=0):t=gc;const r=n._nextID++,o=Object(oc.a)();return n._deferreds[r]=o,n._worker.postMessage({id:r,parameters:e,canTransferArrayBuffer:i},t),o.promise}))},mc.prototype.initWebAssemblyModule=function(e){Object(l.a)(this._worker)||(this._worker=pc(this));const t=Object(oc.a)(),n=this,i=this._worker;return function(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Jr.supportsWebAssembly()){if(!Object(l.a)(t.fallbackModulePath))throw new ye.a("This browser does not support Web Assembly, and no backup module was provided for "+e._workerPath);return n.modulePath=Lt(t.fallbackModulePath),Promise.resolve(n)}return n.modulePath=Lt(t.modulePath),n.wasmBinaryFile=Lt(t.wasmBinaryFile),Tt.a.fetchArrayBuffer({url:n.wasmBinaryFile}).then((function(e){return n.wasmBinary=e,n}))}(this,e).then((function(e){return Promise.resolve(lc()).then((function(r){let o;const a=e.wasmBinary;Object(l.a)(a)&&r&&(o=[a]),i.onmessage=function(e){i.onmessage=function(e){hc(n,e.data)},t.resolve(e.data)},i.postMessage({webAssemblyConfig:e},o)}))})),t.promise},mc.prototype.isDestroyed=function(){return!1},mc.prototype.destroy=function(){return Object(l.a)(this._worker)&&this._worker.terminate(),sc(this)},mc.taskCompletedEvent=uc,mc._defaultWorkerModulePrefix="Workers/",mc._workerModulePrefix=mc._defaultWorkerModulePrefix,mc._canTransferArrayBuffer=void 0;var _c=mc;function yc(){u.a.throwInstantiationError()}Object.defineProperties(yc.prototype,{credits:{get:u.a.throwInstantiationError},waterMask:{get:u.a.throwInstantiationError}}),yc.prototype.interpolateHeight=u.a.throwInstantiationError,yc.prototype.isChildAvailable=u.a.throwInstantiationError,yc.prototype.createMesh=u.a.throwInstantiationError,yc.prototype.upsample=u.a.throwInstantiationError,yc.prototype.wasCreatedByUpsampling=u.a.throwInstantiationError,yc.maximumAsynchronousTasks=5;var bc=yc;var vc=function(e,t,n,i,r,o,a,s,l,u,h,d,f,p,m,g){this.center=e,this.vertices=t,this.stride=Object(c.a)(u,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=a,this.boundingSphere3D=s,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=h,this.encoding=d,this.westIndicesSouthToNorth=f,this.southIndicesEastToWest=p,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=g};const Oc={UNSIGNED_BYTE:ps.UNSIGNED_BYTE,UNSIGNED_SHORT:ps.UNSIGNED_SHORT,UNSIGNED_INT:ps.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case Oc.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Oc.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Oc.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new u.a("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case 2:return Oc.UNSIGNED_SHORT;case 4:return Oc.UNSIGNED_INT;case 1:return Oc.UNSIGNED_BYTE;default:throw new u.a("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){return Object(l.a)(e)&&(e===Oc.UNSIGNED_BYTE||e===Oc.UNSIGNED_SHORT||e===Oc.UNSIGNED_INT)},createTypedArray:function(e,t){if(!Object(l.a)(e))throw new u.a("numberOfVertices is required.");return e>=h.a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},createTypedArrayFromArrayBuffer:function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("numberOfVertices is required.");if(!Object(l.a)(t))throw new u.a("sourceArray is required.");if(!Object(l.a)(n))throw new u.a("byteOffset is required.");return e>=h.a.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},fromTypedArray:function(e){if(e instanceof Uint8Array)return Oc.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Oc.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Oc.UNSIGNED_INT;throw new u.a("array must be a Uint8Array, Uint16Array, or Uint32Array.")}};var wc=Object.freeze(Oc);function Ac(){u.a.throwInstantiationError()}Object.defineProperties(Ac.prototype,{errorEvent:{get:u.a.throwInstantiationError},credit:{get:u.a.throwInstantiationError},tilingScheme:{get:u.a.throwInstantiationError},ready:{get:u.a.throwInstantiationError},readyPromise:{get:u.a.throwInstantiationError},hasWaterMask:{get:u.a.throwInstantiationError},hasVertexNormals:{get:u.a.throwInstantiationError},availability:{get:u.a.throwInstantiationError}});const Ec=[];Ac.getRegularGridIndices=function(e,t){if(e*t>=h.a.FOUR_GIGABYTES)throw new u.a("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Ec[e];Object(l.a)(n)||(Ec[e]=n=[]);let i=n[t];return Object(l.a)(i)||(i=e*t<h.a.SIXTY_FOUR_KILOBYTES?n[t]=new Uint16Array((e-1)*(t-1)*6):n[t]=new Uint32Array((e-1)*(t-1)*6),Sc(e,t,i,0)),i};const Tc=[];Ac.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=h.a.FOUR_GIGABYTES)throw new u.a("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Tc[e];Object(l.a)(n)||(Tc[e]=n=[]);let i=n[t];if(!Object(l.a)(i)){const r=Ac.getRegularGridIndices(e,t),o=xc(e,t),a=o.westIndicesSouthToNorth,s=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,l=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:l}}return i};const Cc=[];function xc(e,t){const n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e);let a;for(a=0;a<e;++a)o[a]=a,i[a]=e*t-1-a;for(a=0;a<t;++a)r[a]=(a+1)*e-1,n[a]=(t-a-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function Sc(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let t=0;t<e-1;++t){const t=r,o=t+e,a=o+1,s=t+1;n[i++]=t,n[i++]=o,n[i++]=s,n[i++]=s,n[i++]=o,n[i++]=a,++r}++r}}function Ic(e,t,n,i){let r=e[0];const o=e.length;for(let a=1;a<o;++a){const o=e[a];n[i++]=r,n[i++]=o,n[i++]=t,n[i++]=t,n[i++]=o,n[i++]=t+1,r=o,++t}return i}Ac.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=h.a.FOUR_GIGABYTES)throw new u.a("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Cc[e];Object(l.a)(n)||(Cc[e]=n=[]);let i=n[t];if(!Object(l.a)(i)){const r=e*t,o=(e-1)*(t-1)*6,a=2*e+2*t,s=r+a,c=o+6*Math.max(0,a-4),l=xc(e,t),u=l.westIndicesSouthToNorth,h=l.southIndicesEastToWest,d=l.eastIndicesNorthToSouth,f=l.northIndicesWestToEast,p=wc.createTypedArray(s,c);Sc(e,t,p,0),Ac.addSkirtIndices(u,h,d,f,r,p,o),i=n[t]={indices:p,westIndicesSouthToNorth:u,southIndicesEastToWest:h,eastIndicesNorthToSouth:d,northIndicesWestToEast:f,indexCountWithoutSkirts:o}}return i},Ac.addSkirtIndices=function(e,t,n,i,r,o,a){let s=r;a=Ic(e,s,o,a),s+=e.length,a=Ic(t,s,o,a),s+=t.length,a=Ic(n,s,o,a),s+=n.length,Ic(i,s,o,a)},Ac.heightmapTerrainQuality=.25,Ac.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return 2*e.maximumRadius*Math.PI*Ac.heightmapTerrainQuality/(t*n)},Ac.prototype.requestTileGeometry=u.a.throwInstantiationError,Ac.prototype.getLevelMaximumGeometricError=u.a.throwInstantiationError,Ac.prototype.getTileDataAvailable=u.a.throwInstantiationError,Ac.prototype.loadTileDataAvailability=u.a.throwInstantiationError;var Pc=Ac;function Dc(e){if(!Object(l.a)(e)||!Object(l.a)(e.buffer))throw new u.a("options.buffer is required.");if(!Object(l.a)(e.width))throw new u.a("options.width is required.");if(!Object(l.a)(e.height))throw new u.a("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=Object(c.a)(e.childTileMask,15),this._encoding=Object(c.a)(e.encoding,hn.NONE);const t=ic.DEFAULT_STRUCTURE;let n=e.structure;Object(l.a)(n)?n!==t&&(n.heightScale=Object(c.a)(n.heightScale,t.heightScale),n.heightOffset=Object(c.a)(n.heightOffset,t.heightOffset),n.elementsPerHeight=Object(c.a)(n.elementsPerHeight,t.elementsPerHeight),n.stride=Object(c.a)(n.stride,t.stride),n.elementMultiplier=Object(c.a)(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=Object(c.a)(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=Object(c.a)(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===hn.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Dc.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});const Rc=new _c("createVerticesFromHeightmap"),jc=new _c("createVerticesFromHeightmap",bc.maximumAsynchronousTasks);function Mc(e,t,n,i,r,o,a,s,c){const l=(s-r.west)*(o-1)/(r.east-r.west),u=(c-r.south)*(a-1)/(r.north-r.south);let h=0|l,d=h+1;d>=o&&(d=o-1,h=o-2);let f=0|u,p=f+1;p>=a&&(p=a-1,f=a-2);const m=u-f;f=a-1-f,p=a-1-p;return Lc(l-h,m,(t.decodeHeight(e,f*o+h)-n)/i,(t.decodeHeight(e,f*o+d)-n)/i,(t.decodeHeight(e,p*o+h)-n)/i,(t.decodeHeight(e,p*o+d)-n)/i)}function Lc(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function Nc(e,t,n,i,r,o){o*=i;let a,s=0;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function Bc(e,t,n,i,r,o,a,s){let c;if(a*=r,o)for(c=0;c<t-1;++c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;else for(c=t-1;c>0;--c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;e[a+c]=s}Dc.prototype.createMesh=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.tilingScheme",e.tilingScheme),s.a.typeOf.number("options.x",e.x),s.a.typeOf.number("options.y",e.y),s.a.typeOf.number("options.level",e.level);const t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=Object(c.a)(e.exaggeration,1),a=Object(c.a)(e.exaggerationRelativeHeight,0),u=Object(c.a)(e.throttle,!0),h=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),p=h.cartographicToCartesian(Be.center(f)),m=this._structure,g=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(h,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(4*g,1e3);const _=(u?jc:Rc).scheduleTask({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:f,relativeToCenter:p,ellipsoid:h,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof q,exaggeration:o,exaggerationRelativeHeight:a,encoding:this._encoding});if(!Object(l.a)(_))return;const y=this;return Promise.resolve(_).then((function(e){let t;t=y._skirtHeight>0?Pc.getRegularGridAndSkirtIndicesAndEdgeIndices(e.gridWidth,e.gridHeight):Pc.getRegularGridIndicesAndEdgeIndices(e.gridWidth,e.gridHeight);const n=e.gridWidth*e.gridHeight;return y._mesh=new vc(p,new Float32Array(e.vertices),t.indices,t.indexCountWithoutSkirts,n,e.minimumHeight,e.maximumHeight,At.clone(e.boundingSphere3D),O.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,fs.clone(e.orientedBoundingBox),Ks.clone(e.encoding),t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),y._buffer=void 0,y._mesh}))},Dc.prototype._createMeshSync=function(e){s.a.typeOf.object("options.tilingScheme",e.tilingScheme),s.a.typeOf.number("options.x",e.x),s.a.typeOf.number("options.y",e.y),s.a.typeOf.number("options.level",e.level);const t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=Object(c.a)(e.exaggeration,1),a=Object(c.a)(e.exaggerationRelativeHeight,0),l=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),h=t.tileXYToRectangle(n,i,r),d=l.cartographicToCartesian(Be.center(h)),f=this._structure,p=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(4*p,1e3);const m=ic.computeVertices({heightmap:this._buffer,structure:f,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:h,relativeToCenter:d,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof q,exaggeration:o,exaggerationRelativeHeight:a});let g;this._buffer=void 0,g=this._skirtHeight>0?Pc.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):Pc.getRegularGridIndicesAndEdgeIndices(this._width,this._height);const _=m.gridWidth*m.gridHeight;return this._mesh=new vc(d,m.vertices,g.indices,g.indexCountWithoutSkirts,_,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),this._mesh},Dc.prototype.interpolateHeight=function(e,t,n){const i=this._width,r=this._height,o=this._structure,a=o.stride,s=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,h=o.heightOffset,d=o.heightScale,f=Object(l.a)(this._mesh),p=this._encoding===hn.LERC;if(!f&&p)return;let m;if(f){m=Mc(this._mesh.vertices,this._mesh.encoding,h,d,e,i,r,t,n)}else m=function(e,t,n,i,r,o,a,s,c,l){const u=(c-o.west)*(a-1)/(o.east-o.west),h=(l-o.south)*(s-1)/(o.north-o.south);let d=0|u,f=d+1;f>=a&&(f=a-1,d=a-2);let p=0|h,m=p+1;m>=s&&(m=s-1,p=s-2);const g=u-d,_=h-p;p=s-1-p,m=s-1-m;const y=Nc(e,t,n,i,r,p*a+d),b=Nc(e,t,n,i,r,p*a+f),v=Nc(e,t,n,i,r,m*a+d),O=Nc(e,t,n,i,r,m*a+f);return Lc(g,_,y,b,v,O)}(this._buffer,s,c,a,u,e,i,r,t,n),m=m*d+h;return m},Dc.prototype.upsample=function(e,t,n,i,r,o,a){if(!Object(l.a)(e))throw new u.a("tilingScheme is required.");if(!Object(l.a)(t))throw new u.a("thisX is required.");if(!Object(l.a)(n))throw new u.a("thisY is required.");if(!Object(l.a)(i))throw new u.a("thisLevel is required.");if(!Object(l.a)(r))throw new u.a("descendantX is required.");if(!Object(l.a)(o))throw new u.a("descendantY is required.");if(!Object(l.a)(a))throw new u.a("descendantLevel is required.");if(a-i>1)throw new u.a("Upsampling through more than one level at a time is not currently supported.");const s=this._mesh;if(!Object(l.a)(s))return;const c=this._width,d=this._height,f=this._structure,p=f.stride,m=new this._bufferType(c*d*p),g=s.vertices,_=s.encoding,y=e.tileXYToRectangle(t,n,i),b=e.tileXYToRectangle(r,o,a),v=f.heightOffset,O=f.heightScale,w=f.elementsPerHeight,A=f.elementMultiplier,E=f.isBigEndian,T=Math.pow(A,w-1);for(let e=0;e<d;++e){const t=h.a.lerp(b.north,b.south,e/(d-1));for(let n=0;n<c;++n){let i=Mc(g,_,v,O,y,c,d,h.a.lerp(b.west,b.east,n/(c-1)),t);i=i<f.lowestEncodedHeight?f.lowestEncodedHeight:i,i=i>f.highestEncodedHeight?f.highestEncodedHeight:i,Bc(m,w,A,T,p,E,e*c+n,i)}}return Promise.resolve(new Dc({buffer:m,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))},Dc.prototype.isChildAvailable=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("thisX is required.");if(!Object(l.a)(t))throw new u.a("thisY is required.");if(!Object(l.a)(n))throw new u.a("childX is required.");if(!Object(l.a)(i))throw new u.a("childY is required.");let r=2;return n!==2*e&&++r,i!==2*t&&(r-=2),0!=(this._childTileMask&1<<r)},Dc.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var Fc=Dc,zc=n(12),kc=n(11),Uc=n(13);function Vc(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}const Hc=new Be;function Gc(e,t,n,i){const r=i.length;for(let o=0;o<r;++o){const r=i[o];if(r.x===t&&r.y===n&&r.level===e)return!0}return!1}Vc.prototype.addAvailableTileRange=function(e,t,n,i,r){const o=this._tilingScheme,a=this._rootNodes;if(0===e)for(let s=n;s<=r;++s)for(let n=t;n<=i;++n)Gc(e,n,s,a)||a.push(new Jc(o,void 0,0,n,s));o.tileXYToRectangle(t,n,e,Hc);const s=Hc.west,c=Hc.north;o.tileXYToRectangle(i,r,e,Hc);const l=Hc.east,u=new Zc(e,s,Hc.south,l,c);for(let e=0;e<a.length;++e){const t=a[e];$c(t.extent,u)&&Qc(this._maximumLevel,t,u)}},Vc.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){const i=this._rootNodes[n];if(nl(i.extent,e)){t=i;break}}return Object(l.a)(t)?function e(t,n,i){let r=0,o=!1;for(;!o;){const t=n._nw&&nl(n._nw.extent,i),a=n._ne&&nl(n._ne.extent,i),s=n._sw&&nl(n._sw.extent,i),c=n._se&&nl(n._se.extent,i);if(t+a+s+c>1){t&&(r=Math.max(r,e(n,n._nw,i))),a&&(r=Math.max(r,e(n,n._ne,i))),s&&(r=Math.max(r,e(n,n._sw,i))),c&&(r=Math.max(r,e(n,n._se,i)));break}t?n=n._nw:a?n=n._ne:s?n=n._sw:c?n=n._se:o=!0}for(;n!==t;){const e=n.rectangles;for(let t=e.length-1;t>=0&&e[t].level>r;--t){const n=e[t];nl(n,i)&&(r=n.level)}n=n.parent}return r}(void 0,t,e):-1};const qc=[],Wc=[],Yc=new Be,Xc=new Be;Vc.prototype.computeBestAvailableLevelOverRectangle=function(e){const t=qc;t.length=0,e.east<e.west?(t.push(Be.fromRadians(-Math.PI,e.south,e.east,e.north,Yc)),t.push(Be.fromRadians(e.west,e.south,Math.PI,e.north,Xc))):t.push(e);const n=Wc;let i;for(n.length=0,i=0;i<this._rootNodes.length;++i)il(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(Object(l.a)(n[i])&&0===n[i].length)return i;return 0};const Kc=new R;function Jc(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function Zc(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function $c(e,t){const n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east);return i<Math.min(e.north,t.north)&&n<r}function Qc(e,t,n){for(;t.level<e;)if(tl(t.nw.extent,n))t=t.nw;else if(tl(t.ne.extent,n))t=t.ne;else if(tl(t.sw.extent,n))t=t.sw;else{if(!tl(t.se.extent,n))break;t=t.se}if(0===t.rectangles.length||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let e=Si(t.rectangles,n.level,el);e<0&&(e=~e),t.rectangles.splice(e,0,n)}}function el(e,t){return e.level-t}function tl(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function nl(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function il(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||$c(t.extent,n[i]);if(!r)return;const o=t.rectangles;for(i=0;i<o.length;++i){const t=o[i];e[t.level]||(e[t.level]=n),e[t.level]=rl(e[t.level],t)}il(e,t._nw,n),il(e,t._ne,n),il(e,t._sw,n),il(e,t._se,n)}function rl(e,t){const n=[];for(let i=0;i<e.length;++i){const r=e[i];$c(r,t)?(r.west<t.west&&n.push(new Be(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new Be(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new Be(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new Be(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}Vc.prototype.isTileAvailable=function(e,t,n){const i=this._tilingScheme.tileXYToRectangle(t,n,e,Hc);return Be.center(i,Kc),this.computeMaximumLevelAtPosition(Kc)>=e},Vc.prototype.computeChildMaskForTile=function(e,t,n){const i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r},Object.defineProperties(Jc.prototype,{nw:{get:function(){return this._nw||(this._nw=new Jc(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new Jc(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new Jc(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new Jc(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}});var ol=Vc;const al={};function sl(e,t){if(!Object(l.a)(e))throw new u.a("identifier is required.");Object(l.a)(al[e])||(al[e]=!0,console.warn(Object(c.a)(t,e)))}sl.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",sl.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored",sl.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored",sl.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var cl=sl;var ll=function(e,t){if(!Object(l.a)(e)||!Object(l.a)(t))throw new u.a("identifier and message are required.");cl(e,t)};var ul=function(e){let t;const n=e.name,i=e.message;t=Object(l.a)(n)&&Object(l.a)(i)?`${n}: ${i}`:e.toString();const r=e.stack;return Object(l.a)(r)&&(t+="\n"+r),t};function hl(e,t,n,i,r,o,a){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=Object(c.a)(o,0),this.retry=!1,this.error=a}hl.reportError=function(e,t,n,i,r,o,a,s){let c=e;return Object(l.a)(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=a,c.retry=!1,c.error=s,++c.timesRetried):c=new hl(t,i,r,o,a,0,s),n.numberOfListeners>0?n.raiseEvent(c):console.log(`An error occurred in "${t.constructor.name}": ${ul(i)}`),c},hl.handleError=function(e,t,n,i,r,o,a,s,c){ll("TileProviderError.handleError","TileProviderError.handleError was deprecated in CesiumJS 1.96 and will be removed in 1.97. Use TileProviderError.reportError instead.");const u=hl.reportError(e,t,n,i,r,o,a,c);return u.retry&&Object(l.a)(s)&&s(),u},hl.reportSuccess=function(e){Object(l.a)(e)&&(e.timesRetried=-1)},hl.handleSuccess=function(e){ll("TileProviderError.handleSuccess","TileProviderError.handleSuccess was deprecated in CesiumJS 1.96 and will be removed in 1.97. Use TileProviderError.reportSuccess instead."),hl.reportSuccess(e)};var dl=hl;function fl(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._numberOfLevelZeroTilesX=Object(c.a)(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=Object(c.a)(e.numberOfLevelZeroTilesY,1),this._projection=new Zs(this._ellipsoid),Object(l.a)(e.rectangleSouthwestInMeters)&&Object(l.a)(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{const e=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new Vt(-e,-e),this._rectangleNortheastInMeters=new Vt(e,e)}const t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Be(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(fl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),fl.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},fl.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},fl.prototype.rectangleToNativeRectangle=function(e,t){const n=this._projection,i=n.project(Be.southwest(e)),r=n.project(Be.northeast(e));return Object(l.a)(t)?(t.west=i.x,t.south=i.y,t.east=r.x,t.north=r.y,t):new Be(i.x,i.y,r.x,r.y)},fl.prototype.tileXYToNativeRectangle=function(e,t,n,i){const r=this.getNumberOfXTilesAtLevel(n),o=this.getNumberOfYTilesAtLevel(n),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,s=this._rectangleSouthwestInMeters.x+e*a,c=this._rectangleSouthwestInMeters.x+(e+1)*a,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,h=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return Object(l.a)(i)?(i.west=s,i.south=d,i.east=c,i.north=h,i):new Be(s,d,c,h)},fl.prototype.tileXYToRectangle=function(e,t,n,i){const r=this.tileXYToNativeRectangle(e,t,n,i),o=this._projection,a=o.unproject(new Vt(r.west,r.south)),s=o.unproject(new Vt(r.east,r.north));return r.west=a.longitude,r.south=a.latitude,r.east=s.longitude,r.north=s.latitude,r},fl.prototype.positionToTileXY=function(e,t,n){const i=this._rectangle;if(!Be.contains(i,e))return;const r=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,s=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o,c=this._projection.project(e);let u=(c.x-this._rectangleSouthwestInMeters.x)/a|0;u>=r&&(u=r-1);let h=(this._rectangleNortheastInMeters.y-c.y)/s|0;return h>=o&&(h=o-1),Object(l.a)(n)?(n.x=u,n.y=h,n):new Vt(u,h)};var pl=fl;function ml(e){if(!Object(l.a)(e)||!Object(l.a)(e.url))throw new u.a("options.url is required.");this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._ready=!1,this._width=void 0,this._height=void 0,this._encoding=void 0;const t=e.token;this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailablityLoaded=void 0,this._availableCache={};const n=this,i=Object(c.a)(e.ellipsoid,H.WGS84);this._readyPromise=Promise.resolve(e.url).then((function(e){let i=Tt.a.createIfNeeded(e);i.appendForwardSlash(),Object(l.a)(t)&&(i=i.getDerivedResource({queryParameters:{token:t}})),n._resource=i;return i.getDerivedResource({queryParameters:{f:"pjson"}}).fetchJson()})).then((function(e){const t=e.copyrightText;Object(l.a)(t)&&(n._credit=new ln(t));const r=e.spatialReference,o=Object(c.a)(r.latestWkid,r.wkid),a=e.extent,s={ellipsoid:i};if(4326===o)s.rectangle=Be.fromDegrees(a.xmin,a.ymin,a.xmax,a.ymax),n._tilingScheme=new Gt(s);else{if(3857!==o)return Promise.reject(new ye.a("Invalid spatial reference"));s.rectangleSouthwestInMeters=new Vt(a.xmin,a.ymin),s.rectangleNortheastInMeters=new Vt(a.xmax,a.ymax),n._tilingScheme=new pl(s)}const u=e.tileInfo;if(!Object(l.a)(u))return Promise.reject(new ye.a("tileInfo is required"));n._width=u.rows+1,n._height=u.cols+1,n._encoding="LERC"===u.format?hn.LERC:hn.NONE,n._lodCount=u.lods.length-1;return(n._hasAvailability=-1!==e.capabilities.indexOf("Tilemap"))&&(n._tilesAvailable=new ol(n._tilingScheme,n._lodCount),n._tilesAvailable.addAvailableTileRange(0,0,0,n._tilingScheme.getNumberOfXTilesAtLevel(0),n._tilingScheme.getNumberOfYTilesAtLevel(0)),n._tilesAvailablityLoaded=new ol(n._tilingScheme,n._lodCount)),n._levelZeroMaximumGeometricError=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(n._tilingScheme.ellipsoid,n._width,n._tilingScheme.getNumberOfXTilesAtLevel(0)),e.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),n._terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:e.minValues[0],highestEncodedHeight:e.maxValues[0]},n._ready=!0,!0})).catch((function(e){const t=`An error occurred while accessing ${n._resource.url}.`;return dl.reportError(void 0,n,n._errorEvent,t),Promise.reject(e)})),this._errorEvent=new un.a}function gl(e,t,n,i){if(!e._hasAvailability)return;const r=e._tilesAvailablityLoaded,o=e._tilesAvailable;return!(t>e._lodCount)&&(!!o.isTileAvailable(t,n,i)||!r.isTileAvailable(t,n,i)&&void 0)}function _l(e,t,n,i){const r=t-1,o=n-1,a=i[e.y*t+e.x],s=[],c={startX:e.x,startY:e.y,endX:0,endY:0},l=new Vt(e.x+1,e.y+1);let u=!1,h=!1;for(;!u||!h;){let n=l.x;const d=h?l.y+1:l.y;if(!u){for(let n=e.y;n<d;++n)if(i[n*t+l.x]!==a){u=!0;break}u?(s.push(new Vt(l.x,e.y)),--l.x,--n,c.endX=l.x):l.x===r?(c.endX=l.x,u=!0):++l.x}if(!h){const r=l.y*t;for(let t=e.x;t<=n;++t)if(i[r+t]!==a){h=!0;break}h?(s.push(new Vt(e.x,l.y)),--l.y,c.endY=l.y):l.y===o?(c.endY=l.y,h=!0):++l.y}}return{endingIndices:s,range:c,value:a}}function yl(e,t,n,i){if(!e._hasAvailability)return{};const r=128*Math.floor(n/128),o=128*Math.floor(i/128),a=Math.min(1<<t,128),s=`tilemap/${t}/${o}/${r}/${a}/${a}`,c=e._availableCache;if(Object(l.a)(c[s]))return c[s];const u=new zc.a({throttle:!1,throttleByServer:!0,type:Uc.a.TERRAIN});let h=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return Object(l.a)(h)?(h=h.then((function(s){const c=function(e,t,n,i,r){const o=[];if(r.every((function(e){return e===r[0]})))return 1===r[0]&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new Vt(0,0)];for(;a.length>0;){const s=_l(a.pop(),n,i,r);if(1===s.value){const n=s.range;n.startX+=e,n.endX+=e,n.startY+=t,n.endY+=t,o.push(n)}const c=s.endingIndices;c.length>0&&(a=a.concat(c))}return o}(r,o,a,a,s.data);e._tilesAvailablityLoaded.addAvailableTileRange(t,r,o,r+a,o+a);const l=e._tilesAvailable;for(let e=0;e<c.length;++e){const n=c[e];l.addAvailableTileRange(t,n.startX,n.startY,n.endX,n.endY)}return gl(e,t,n,i)})),c[s]={promise:h,request:u},h=h.finally((function(e){return delete c[s],e})),{promise:h,request:u}):{}}Object.defineProperties(ml.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){if(!this.ready)throw new u.a("credit must not be called before ready returns true.");return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new u.a("tilingScheme must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){if(!this._ready)throw new u.a("availability must not be called before the terrain provider is ready.");return this._tilesAvailable}}}),ml.prototype.requestTileGeometry=function(e,t,n,i){if(!this._ready)throw new u.a("requestTileGeometry must not be called before the terrain provider is ready.");const r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability;let a,s=Promise.resolve(!0);if(o&&!Object(l.a)(gl(this,n+1,2*e,2*t))){const i=yl(this,n+1,2*e,2*t);s=i.promise,a=i.request}const c=r.fetchArrayBuffer();if(!Object(l.a)(c)||!Object(l.a)(s))return;const h=this,d=this._tilesAvailable;return Promise.all([c,s]).then((function(i){return new Fc({buffer:i[0],width:h._width,height:h._height,childTileMask:o?d.computeChildMaskForTile(n,e,t):15,structure:h._terrainDataStructure,encoding:h._encoding})})).catch((function(e){return Object(l.a)(a)&&a.state===kc.a.CANCELLED?(i.cancel(),i.deferred.promise.finally((function(){return i.state=kc.a.CANCELLED,Promise.reject(e)}))):Promise.reject(e)}))},ml.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new u.a("getLevelMaximumGeometricError must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<e)},ml.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;const i=gl(this,n,e,t);if(Object(l.a)(i))return i;yl(this,n,e,t)},ml.prototype.loadTileDataAvailability=function(e,t,n){};var bl=ml;var vl=Object.freeze({NONE:0,GEODESIC:1,RHUMB:2});const Ol=h.a.EPSILON10;var wl=function(e,t,n,i){if(s.a.defined("equalsEpsilon",t),!Object(l.a)(e))return;n=Object(c.a)(n,!1);const r=Object(l.a)(i),o=e.length;if(o<2)return e;let a,u,h,d=e[0],f=0,p=-1;for(a=1;a<o;++a)u=e[a],t(d,u,Ol)?(Object(l.a)(h)||(h=e.slice(0,a),f=a-1,p=0),r&&i.push(a)):(Object(l.a)(h)&&(h.push(u),f=a,r&&(p=i.length)),d=u);return n&&t(e[0],e[o-1],Ol)&&(r&&(Object(l.a)(h)?i.splice(p,0,f):i.push(o-1)),Object(l.a)(h)?h.length-=1:h=e.slice(0,-1)),Object(l.a)(h)?h:e};var Al=Object.freeze({XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"});function El(){this._array=[],this._hash={}}Object.defineProperties(El.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),El.prototype.contains=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new u.a("key is required to be a string or number.");return Object(l.a)(this._hash[e])},El.prototype.set=function(e,t){if("string"!=typeof e&&"number"!=typeof e)throw new u.a("key is required to be a string or number.");t!==this._hash[e]&&(this.remove(e),this._hash[e]=t,this._array.push(t))},El.prototype.get=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new u.a("key is required to be a string or number.");return this._hash[e]},El.prototype.remove=function(e){if(Object(l.a)(e)&&"string"!=typeof e&&"number"!=typeof e)throw new u.a("key is required to be a string or number.");const t=this._hash[e],n=Object(l.a)(t);if(n){const n=this._array;n.splice(n.indexOf(t),1),delete this._hash[e]}return n},El.prototype.removeAll=function(){const e=this._array;e.length>0&&(this._hash={},e.length=0)};var Tl=El;const Cl=new O,xl=new O,Sl=new O;var Il=function(e,t,n,i,r){let o,a,c,u,d,f,p,m;if(s.a.defined("point",e),s.a.defined("p0",t),s.a.defined("p1",n),s.a.defined("p2",i),Object(l.a)(r)||(r=new O),Object(l.a)(t.z)){if(O.equalsEpsilon(e,t,h.a.EPSILON14))return O.clone(O.UNIT_X,r);if(O.equalsEpsilon(e,n,h.a.EPSILON14))return O.clone(O.UNIT_Y,r);if(O.equalsEpsilon(e,i,h.a.EPSILON14))return O.clone(O.UNIT_Z,r);o=O.subtract(n,t,Cl),a=O.subtract(i,t,xl),c=O.subtract(e,t,Sl),u=O.dot(o,o),d=O.dot(o,a),f=O.dot(o,c),p=O.dot(a,a),m=O.dot(a,c)}else{if(Vt.equalsEpsilon(e,t,h.a.EPSILON14))return O.clone(O.UNIT_X,r);if(Vt.equalsEpsilon(e,n,h.a.EPSILON14))return O.clone(O.UNIT_Y,r);if(Vt.equalsEpsilon(e,i,h.a.EPSILON14))return O.clone(O.UNIT_Z,r);o=Vt.subtract(n,t,Cl),a=Vt.subtract(i,t,xl),c=Vt.subtract(e,t,Sl),u=Vt.dot(o,o),d=Vt.dot(o,a),f=Vt.dot(o,c),p=Vt.dot(a,a),m=Vt.dot(a,c)}r.y=p*f-d*m,r.z=u*m-d*f;const g=u*p-d*d;if(0!==g)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r};function Pl(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).key;if(!Object(l.a)(t))throw new u.a("options.key is required.");this._key=t;const n={key:t};Object(l.a)(e.culture)&&(n.culture=e.culture),this._resource=new Tt.a({url:"https://dev.virtualearth.net/REST/v1/Locations",queryParameters:n})}Object.defineProperties(Pl.prototype,{url:{get:function(){return"https://dev.virtualearth.net/REST/v1/Locations"}},key:{get:function(){return this._key}}}),Pl.prototype.geocode=function(e){s.a.typeOf.string("query",e);return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then((function(e){if(0===e.resourceSets.length)return[];return e.resourceSets[0].resources.map((function(e){const t=e.bbox,n=t[0],i=t[1],r=t[2],o=t[3];return{displayName:e.name,destination:Be.fromDegrees(i,n,o,r)}}))}))};var Dl=Pl;function Rl(e,t,n,i){this.x=Object(c.a)(e,0),this.y=Object(c.a)(t,0),this.width=Object(c.a)(n,0),this.height=Object(c.a)(i,0)}Rl.packedLength=4,Rl.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},Rl.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Rl),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},Rl.fromPoints=function(e,t){if(Object(l.a)(t)||(t=new Rl),!Object(l.a)(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;const n=e.length;let i=e[0].x,r=e[0].y,o=e[0].x,a=e[0].y;for(let t=1;t<n;t++){const n=e[t],s=n.x,c=n.y;i=Math.min(s,i),o=Math.max(s,o),r=Math.min(c,r),a=Math.max(c,a)}return t.x=i,t.y=r,t.width=o-i,t.height=a-r,t};const jl=new q,Ml=new R,Ll=new R;Rl.fromRectangle=function(e,t,n){if(Object(l.a)(n)||(n=new Rl),!Object(l.a)(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;const i=(t=Object(c.a)(t,jl)).project(Be.southwest(e,Ml)),r=t.project(Be.northeast(e,Ll));return Vt.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n},Rl.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Rl(e.x,e.y,e.width,e.height)},Rl.union=function(e,t,n){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),Object(l.a)(n)||(n=new Rl);const i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),a=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=a-r,n},Rl.expand=function(e,t,n){s.a.typeOf.object("rectangle",e),s.a.typeOf.object("point",t),n=Rl.clone(e,n);const i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n},Rl.intersect=function(e,t){s.a.typeOf.object("left",e),s.a.typeOf.object("right",t);const n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?W.OUTSIDE:W.INTERSECTING},Rl.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},Rl.prototype.clone=function(e){return Rl.clone(this,e)},Rl.prototype.intersect=function(e){return Rl.intersect(this,e)},Rl.prototype.equals=function(e){return Rl.equals(this,e)};var Nl=Rl;var Bl=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});const Fl={POINTS:ps.POINTS,LINES:ps.LINES,LINE_LOOP:ps.LINE_LOOP,LINE_STRIP:ps.LINE_STRIP,TRIANGLES:ps.TRIANGLES,TRIANGLE_STRIP:ps.TRIANGLE_STRIP,TRIANGLE_FAN:ps.TRIANGLE_FAN,isLines:function(e){return e===Fl.LINES||e===Fl.LINE_LOOP||e===Fl.LINE_STRIP},isTriangles:function(e){return e===Fl.TRIANGLES||e===Fl.TRIANGLE_STRIP||e===Fl.TRIANGLE_FAN},validate:function(e){return e===Fl.POINTS||e===Fl.LINES||e===Fl.LINE_LOOP||e===Fl.LINE_STRIP||e===Fl.TRIANGLES||e===Fl.TRIANGLE_STRIP||e===Fl.TRIANGLE_FAN}};var zl=Object.freeze(Fl);function kl(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=Object(c.a)(e.primitiveType,zl.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=Object(c.a)(e.geometryType,Bl.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}kl.computeNumberOfVertices=function(e){s.a.typeOf.object("geometry",e);let t=-1;for(const n in e.attributes)if(e.attributes.hasOwnProperty(n)&&Object(l.a)(e.attributes[n])&&Object(l.a)(e.attributes[n].values)){const i=e.attributes[n],r=i.values.length/i.componentsPerAttribute;if(t!==r&&-1!==t)throw new u.a("All attribute lists must have the same number of attributes.");t=r}return t};const Ul=new R,Vl=new O,Hl=new Me,Gl=[new R,new R,new R],ql=[new Vt,new Vt,new Vt],Wl=[new Vt,new Vt,new Vt],Yl=new O,Xl=new To,Kl=new Me,Jl=new Es;kl._textureCoordinateRotationPoints=function(e,t,n,i){let r;const o=Be.center(i,Ul),a=R.toCartesian(o,n,Vl),s=ca.eastNorthUpToFixedFrame(a,n,Hl),c=Me.inverse(s,Hl),l=ql,u=Gl;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let h=Yl;for(r=0;r<3;r++)R.toCartesian(u[r],n,h),h=Me.multiplyByPointAsVector(c,h,h),l[r].x=h.x,l[r].y=h.y;const d=To.fromAxisAngle(O.UNIT_Z,-t,Xl),f=ce.fromQuaternion(d,Kl),p=e.length;let m=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(r=0;r<p;r++)h=Me.multiplyByPointAsVector(c,e[r],h),h=ce.multiplyByVector(f,h,h),m=Math.min(m,h.x),g=Math.min(g,h.y),_=Math.max(_,h.x),y=Math.max(y,h.y);const b=Es.fromRotation(t,Jl),v=Wl;v[0].x=m,v[0].y=g,v[1].x=m,v[1].y=y,v[2].x=_,v[2].y=g;const w=l[0],A=l[2].x-w.x,E=l[1].y-w.y;for(r=0;r<3;r++){const e=v[r];Es.multiplyByVector(b,e,e),e.x=(e.x-w.x)/A,e.y=(e.y-w.y)/E}const T=v[0],C=v[1],x=v[2],S=new Array(6);return Vt.pack(T,S),Vt.pack(C,S,2),Vt.pack(x,S,4),S};var Zl=kl;var $l=function(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.componentDatatype))throw new u.a("options.componentDatatype is required.");if(!Object(l.a)(e.componentsPerAttribute))throw new u.a("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new u.a("options.componentsPerAttribute must be between 1 and 4.");if(!Object(l.a)(e.values))throw new u.a("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=Object(c.a)(e.normalize,!1),this.values=e.values};var Ql=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color};var eu=Object.freeze({NONE:0,TOP:1,ALL:2});function tu(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.position=Object(c.a)(e.position,!1),this.normal=Object(c.a)(e.normal,!1),this.st=Object(c.a)(e.st,!1),this.bitangent=Object(c.a)(e.bitangent,!1),this.tangent=Object(c.a)(e.tangent,!1),this.color=Object(c.a)(e.color,!1)}tu.POSITION_ONLY=Object.freeze(new tu({position:!0})),tu.POSITION_AND_NORMAL=Object.freeze(new tu({position:!0,normal:!0})),tu.POSITION_NORMAL_AND_ST=Object.freeze(new tu({position:!0,normal:!0,st:!0})),tu.POSITION_AND_ST=Object.freeze(new tu({position:!0,st:!0})),tu.POSITION_AND_COLOR=Object.freeze(new tu({position:!0,color:!0})),tu.ALL=Object.freeze(new tu({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),tu.DEFAULT=tu.POSITION_NORMAL_AND_ST,tu.packedLength=6,tu.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t},tu.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");return t=Object(c.a)(t,0),Object(l.a)(n)||(n=new tu),n.position=1===e[t++],n.normal=1===e[t++],n.st=1===e[t++],n.tangent=1===e[t++],n.bitangent=1===e[t++],n.color=1===e[t],n},tu.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)||(t=new tu),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var nu=tu;const iu=new O;function ru(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).minimum,n=e.maximum;if(s.a.typeOf.object("min",t),s.a.typeOf.object("max",n),Object(l.a)(e.offsetAttribute)&&e.offsetAttribute===eu.TOP)throw new u.a("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");const i=Object(c.a)(e.vertexFormat,nu.DEFAULT);this._minimum=O.clone(t),this._maximum=O.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}ru.fromDimensions=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).dimensions;s.a.typeOf.object("dimensions",t),s.a.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),s.a.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),s.a.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);const n=O.multiplyByScalar(t,.5,new O);return new ru({minimum:O.negate(n,new O),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},ru.fromAxisAlignedBoundingBox=function(e){return s.a.typeOf.object("boundingBox",e),new ru({minimum:e.minimum,maximum:e.maximum})},ru.packedLength=2*O.packedLength+nu.packedLength+1,ru.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),O.pack(e._minimum,t,n),O.pack(e._maximum,t,n+O.packedLength),nu.pack(e._vertexFormat,t,n+2*O.packedLength),t[n+2*O.packedLength+nu.packedLength]=Object(c.a)(e._offsetAttribute,-1),t};const ou=new O,au=new O,su=new nu,cu={minimum:ou,maximum:au,vertexFormat:su,offsetAttribute:void 0};let lu;ru.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=O.unpack(e,t,ou),r=O.unpack(e,t+O.packedLength,au),o=nu.unpack(e,t+2*O.packedLength,su),a=e[t+2*O.packedLength+nu.packedLength];return Object(l.a)(n)?(n._minimum=O.clone(i,n._minimum),n._maximum=O.clone(r,n._maximum),n._vertexFormat=nu.clone(o,n._vertexFormat),n._offsetAttribute=-1===a?void 0:a,n):(cu.offsetAttribute=-1===a?void 0:a,new ru(cu))},ru.createGeometry=function(e){const t=e._minimum,n=e._maximum,i=e._vertexFormat;if(O.equals(t,n))return;const r=new Ql;let o,a;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(a=new Float64Array(72),a[0]=t.x,a[1]=t.y,a[2]=n.z,a[3]=n.x,a[4]=t.y,a[5]=n.z,a[6]=n.x,a[7]=n.y,a[8]=n.z,a[9]=t.x,a[10]=n.y,a[11]=n.z,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=n.x,a[16]=t.y,a[17]=t.z,a[18]=n.x,a[19]=n.y,a[20]=t.z,a[21]=t.x,a[22]=n.y,a[23]=t.z,a[24]=n.x,a[25]=t.y,a[26]=t.z,a[27]=n.x,a[28]=n.y,a[29]=t.z,a[30]=n.x,a[31]=n.y,a[32]=n.z,a[33]=n.x,a[34]=t.y,a[35]=n.z,a[36]=t.x,a[37]=t.y,a[38]=t.z,a[39]=t.x,a[40]=n.y,a[41]=t.z,a[42]=t.x,a[43]=n.y,a[44]=n.z,a[45]=t.x,a[46]=t.y,a[47]=n.z,a[48]=t.x,a[49]=n.y,a[50]=t.z,a[51]=n.x,a[52]=n.y,a[53]=t.z,a[54]=n.x,a[55]=n.y,a[56]=n.z,a[57]=t.x,a[58]=n.y,a[59]=n.z,a[60]=t.x,a[61]=t.y,a[62]=t.z,a[63]=n.x,a[64]=t.y,a[65]=t.z,a[66]=n.x,a[67]=t.y,a[68]=n.z,a[69]=t.x,a[70]=t.y,a[71]=n.z,r.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a})),i.normal){const e=new Float32Array(72);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,e[12]=0,e[13]=0,e[14]=-1,e[15]=0,e[16]=0,e[17]=-1,e[18]=0,e[19]=0,e[20]=-1,e[21]=0,e[22]=0,e[23]=-1,e[24]=1,e[25]=0,e[26]=0,e[27]=1,e[28]=0,e[29]=0,e[30]=1,e[31]=0,e[32]=0,e[33]=1,e[34]=0,e[35]=0,e[36]=-1,e[37]=0,e[38]=0,e[39]=-1,e[40]=0,e[41]=0,e[42]=-1,e[43]=0,e[44]=0,e[45]=-1,e[46]=0,e[47]=0,e[48]=0,e[49]=1,e[50]=0,e[51]=0,e[52]=1,e[53]=0,e[54]=0,e[55]=1,e[56]=0,e[57]=0,e[58]=1,e[59]=0,e[60]=0,e[61]=-1,e[62]=0,e[63]=0,e[64]=-1,e[65]=0,e[66]=0,e[67]=-1,e[68]=0,e[69]=0,e[70]=-1,e[71]=0,r.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}if(i.st){const e=new Float32Array(48);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,e[8]=1,e[9]=0,e[10]=0,e[11]=0,e[12]=0,e[13]=1,e[14]=1,e[15]=1,e[16]=0,e[17]=0,e[18]=1,e[19]=0,e[20]=1,e[21]=1,e[22]=0,e[23]=1,e[24]=1,e[25]=0,e[26]=0,e[27]=0,e[28]=0,e[29]=1,e[30]=1,e[31]=1,e[32]=1,e[33]=0,e[34]=0,e[35]=0,e[36]=0,e[37]=1,e[38]=1,e[39]=1,e[40]=0,e[41]=0,e[42]=1,e[43]=0,e[44]=1,e[45]=1,e[46]=0,e[47]=1,r.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:e})}if(i.tangent){const e=new Float32Array(72);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,e[12]=-1,e[13]=0,e[14]=0,e[15]=-1,e[16]=0,e[17]=0,e[18]=-1,e[19]=0,e[20]=0,e[21]=-1,e[22]=0,e[23]=0,e[24]=0,e[25]=1,e[26]=0,e[27]=0,e[28]=1,e[29]=0,e[30]=0,e[31]=1,e[32]=0,e[33]=0,e[34]=1,e[35]=0,e[36]=0,e[37]=-1,e[38]=0,e[39]=0,e[40]=-1,e[41]=0,e[42]=0,e[43]=-1,e[44]=0,e[45]=0,e[46]=-1,e[47]=0,e[48]=-1,e[49]=0,e[50]=0,e[51]=-1,e[52]=0,e[53]=0,e[54]=-1,e[55]=0,e[56]=0,e[57]=-1,e[58]=0,e[59]=0,e[60]=1,e[61]=0,e[62]=0,e[63]=1,e[64]=0,e[65]=0,e[66]=1,e[67]=0,e[68]=0,e[69]=1,e[70]=0,e[71]=0,r.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}if(i.bitangent){const e=new Float32Array(72);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=1,e[14]=0,e[15]=0,e[16]=1,e[17]=0,e[18]=0,e[19]=1,e[20]=0,e[21]=0,e[22]=1,e[23]=0,e[24]=0,e[25]=0,e[26]=1,e[27]=0,e[28]=0,e[29]=1,e[30]=0,e[31]=0,e[32]=1,e[33]=0,e[34]=0,e[35]=1,e[36]=0,e[37]=0,e[38]=1,e[39]=0,e[40]=0,e[41]=1,e[42]=0,e[43]=0,e[44]=1,e[45]=0,e[46]=0,e[47]=1,e[48]=0,e[49]=0,e[50]=1,e[51]=0,e[52]=0,e[53]=1,e[54]=0,e[55]=0,e[56]=1,e[57]=0,e[58]=0,e[59]=1,e[60]=0,e[61]=0,e[62]=1,e[63]=0,e[64]=0,e[65]=1,e[66]=0,e[67]=0,e[68]=1,e[69]=0,e[70]=0,e[71]=1,r.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else a=new Float64Array(24),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=n.x,a[4]=t.y,a[5]=t.z,a[6]=n.x,a[7]=n.y,a[8]=t.z,a[9]=t.x,a[10]=n.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=n.z,a[15]=n.x,a[16]=t.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=t.x,a[22]=n.y,a[23]=n.z,r.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;const s=O.subtract(n,t,iu),c=.5*O.magnitude(s);if(Object(l.a)(e._offsetAttribute)){const t=a.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);r.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:r,indices:o,primitiveType:zl.TRIANGLES,boundingSphere:new At(O.ZERO,c),offsetAttribute:e._offsetAttribute})},ru.getUnitBox=function(){return Object(l.a)(lu)||(lu=ru.createGeometry(ru.fromDimensions({dimensions:new O(1,1,1),vertexFormat:nu.POSITION_ONLY}))),lu};var uu=ru;const hu=new O;function du(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).minimum,n=e.maximum;if(s.a.typeOf.object("min",t),s.a.typeOf.object("max",n),Object(l.a)(e.offsetAttribute)&&e.offsetAttribute===eu.TOP)throw new u.a("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=O.clone(t),this._max=O.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}du.fromDimensions=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).dimensions;s.a.typeOf.object("dimensions",t),s.a.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),s.a.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),s.a.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);const n=O.multiplyByScalar(t,.5,new O);return new du({minimum:O.negate(n,new O),maximum:n,offsetAttribute:e.offsetAttribute})},du.fromAxisAlignedBoundingBox=function(e){return s.a.typeOf.object("boundindBox",e),new du({minimum:e.minimum,maximum:e.maximum})},du.packedLength=2*O.packedLength+1,du.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),O.pack(e._min,t,n),O.pack(e._max,t,n+O.packedLength),t[n+2*O.packedLength]=Object(c.a)(e._offsetAttribute,-1),t};const fu=new O,pu=new O,mu={minimum:fu,maximum:pu,offsetAttribute:void 0};du.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=O.unpack(e,t,fu),r=O.unpack(e,t+O.packedLength,pu),o=e[t+2*O.packedLength];return Object(l.a)(n)?(n._min=O.clone(i,n._min),n._max=O.clone(r,n._max),n._offsetAttribute=-1===o?void 0:o,n):(mu.offsetAttribute=-1===o?void 0:o,new du(mu))},du.createGeometry=function(e){const t=e._min,n=e._max;if(O.equals(t,n))return;const i=new Ql,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;const a=O.subtract(n,t,hu),s=.5*O.magnitude(a);if(Object(l.a)(e._offsetAttribute)){const t=o.length,n=e._offsetAttribute===eu.NONE?0:1,r=new Uint8Array(t/3).fill(n);i.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new Zl({attributes:i,indices:r,primitiveType:zl.LINES,boundingSphere:new At(O.ZERO,s),offsetAttribute:e._offsetAttribute})};var gu=du;let _u;"undefined"!=typeof cancelAnimationFrame&&(_u=cancelAnimationFrame),function(){if(!Object(l.a)(_u)&&"undefined"!=typeof window){const e=["webkit","moz","ms","o"];let t=0;const n=e.length;for(;t<n&&!Object(l.a)(_u);)_u=window[e[t]+"CancelAnimationFrame"],Object(l.a)(_u)||(_u=window[e[t]+"CancelRequestAnimationFrame"]),++t}Object(l.a)(_u)||(_u=clearTimeout)}();var yu=function(e){ll("Cesium.cancelAnimationFrame","Cesium.cancelAnimationFrame was deprecated in CesiumJS 1.96 and will be removed in 1.99. Use the native cancelAnimationFrame method instead."),_u(e)};function bu(){}bu.prototype.geocode=function(e){s.a.typeOf.string("query",e);const t=e.match(/[^\s,\n]+/g);if(2===t.length||3===t.length){let n=+t[0],i=+t[1];const r=3===t.length?+t[2]:300;if(isNaN(n)&&isNaN(i)){const e=/^(\d+.?\d*)([nsew])/i;for(let r=0;r<t.length;++r){const o=t[r].match(e);e.test(t[r])&&3===o.length&&(/^[ns]/i.test(o[2])?i=/^[n]/i.test(o[2])?+o[1]:-o[1]:/^[ew]/i.test(o[2])&&(n=/^[e]/i.test(o[2])?+o[1]:-o[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){const t={displayName:e,destination:O.fromDegrees(n,i,r)};return Promise.resolve([t])}}return Promise.resolve([])};var vu=bu;function Ou(){this.times=void 0,this.points=void 0,u.a.throwInstantiationError()}Ou.getPointType=function(e){if("number"==typeof e)return Number;if(e instanceof O)return O;if(e instanceof To)return To;throw new u.a("point must be a Cartesian3, Quaternion, or Number.")},Ou.prototype.evaluate=u.a.throwInstantiationError,Ou.prototype.findTimeInterval=function(e,t){const n=this.times,i=n.length;if(s.a.typeOf.number("time",e),e<n[0]||e>n[i-1])throw new u.a("time is out of range.");if(e>=n[t=Object(c.a)(t,0)]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r},Ou.prototype.wrapTime=function(e){s.a.typeOf.number("time",e);const t=this.times,n=t[t.length-1],i=t[0],r=n-i;let o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e},Ou.prototype.clampTime=function(e){s.a.typeOf.number("time",e);const t=this.times;return h.a.clamp(e,t[0],t[t.length-1])};var wu=Ou;function Au(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).points,n=e.times;if(!Object(l.a)(t)||!Object(l.a)(n))throw new u.a("points and times are required.");if(t.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new u.a("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=wu.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(Au.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),Au.prototype.findTimeInterval=wu.prototype.findTimeInterval,Au.prototype.wrapTime=wu.prototype.wrapTime,Au.prototype.clampTime=wu.prototype.clampTime,Au.prototype.evaluate=function(e,t){const n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(Object(l.a)(t)||(t=new O),O.lerp(n[r],n[r+1],o,t))};var Eu=Au;const Tu={solve:function(e,t,n,i){if(!(Object(l.a)(e)&&e instanceof Array))throw new u.a("The array lower is required.");if(!(Object(l.a)(t)&&t instanceof Array))throw new u.a("The array diagonal is required.");if(!(Object(l.a)(n)&&n instanceof Array))throw new u.a("The array upper is required.");if(!(Object(l.a)(i)&&i instanceof Array))throw new u.a("The array right is required.");if(t.length!==i.length)throw new u.a("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new u.a("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new u.a("lower and upper must be one less than the length of diagonal.");const r=new Array(n.length),o=new Array(i.length),a=new Array(i.length);let s,c;for(s=0;s<o.length;s++)o[s]=new O,a[s]=new O;for(r[0]=n[0]/t[0],o[0]=O.multiplyByScalar(i[0],1/t[0],o[0]),s=1;s<r.length;++s)c=1/(t[s]-r[s-1]*e[s-1]),r[s]=n[s]*c,o[s]=O.subtract(i[s],O.multiplyByScalar(o[s-1],e[s-1],o[s]),o[s]),o[s]=O.multiplyByScalar(o[s],c,o[s]);for(c=1/(t[s]-r[s-1]*e[s-1]),o[s]=O.subtract(i[s],O.multiplyByScalar(o[s-1],e[s-1],o[s]),o[s]),o[s]=O.multiplyByScalar(o[s],c,o[s]),a[a.length-1]=o[o.length-1],s=a.length-2;s>=0;--s)a[s]=O.subtract(o[s],O.multiplyByScalar(a[s+1],r[s],a[s]),a[s]);return a}};var Cu=Tu;const xu=[],Su=[],Iu=[],Pu=[];function Du(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).points,n=e.times,i=e.inTangents,r=e.outTangents;if(!(Object(l.a)(t)&&Object(l.a)(n)&&Object(l.a)(i)&&Object(l.a)(r)))throw new u.a("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new u.a("times.length must be equal to points.length.");if(i.length!==r.length||i.length!==t.length-1)throw new u.a("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=wu.getPointType(t[0]),this._pointType!==wu.getPointType(i[0])||this._pointType!==wu.getPointType(r[0]))throw new u.a("inTangents and outTangents must be of the same type as points.");this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Du.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),Du.createC1=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).times,n=e.points,i=e.tangents;if(!Object(l.a)(n)||!Object(l.a)(t)||!Object(l.a)(i))throw new u.a("points, times and tangents are required.");if(n.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==i.length)throw new u.a("times, points and tangents must have the same length.");const r=i.slice(0,i.length-1);return new Du({times:t,points:n,inTangents:i.slice(1,i.length),outTangents:r})},Du.createNaturalCubic=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).times,n=e.points;if(!Object(l.a)(n)||!Object(l.a)(t))throw new u.a("points and times are required.");if(n.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new u.a("times.length must be equal to points.length.");if(n.length<3)return new Eu({points:n,times:t});const i=function(e){const t=xu,n=Iu,i=Su,r=Pu;let o;t.length=n.length=e.length-1,i.length=r.length=e.length,t[0]=n[0]=1,i[0]=2;let a=r[0];for(Object(l.a)(a)||(a=r[0]=new O),O.subtract(e[1],e[0],a),O.multiplyByScalar(a,3,a),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,a=r[o],Object(l.a)(a)||(a=r[o]=new O),O.subtract(e[o+1],e[o-1],a),O.multiplyByScalar(a,3,a);return i[o]=2,a=r[o],Object(l.a)(a)||(a=r[o]=new O),O.subtract(e[o],e[o-1],a),O.multiplyByScalar(a,3,a),Cu.solve(t,i,n,r)}(n),r=i.slice(0,i.length-1);return new Du({times:t,points:n,inTangents:i.slice(1,i.length),outTangents:r})},Du.createClampedCubic=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).times,n=e.points,i=e.firstTangent,r=e.lastTangent;if(!(Object(l.a)(n)&&Object(l.a)(t)&&Object(l.a)(i)&&Object(l.a)(r)))throw new u.a("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new u.a("times.length must be equal to points.length.");const o=wu.getPointType(n[0]);if(o!==wu.getPointType(i)||o!==wu.getPointType(r))throw new u.a("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new Eu({points:n,times:t});const a=function(e,t,n){const i=xu,r=Iu,o=Su,a=Pu;let s;i.length=r.length=e.length-1,o.length=a.length=e.length,i[0]=o[0]=1,r[0]=0;let c=a[0];for(Object(l.a)(c)||(c=a[0]=new O),O.clone(t,c),s=1;s<i.length-1;++s)i[s]=r[s]=1,o[s]=4,c=a[s],Object(l.a)(c)||(c=a[s]=new O),O.subtract(e[s+1],e[s-1],c),O.multiplyByScalar(c,3,c);return i[s]=0,r[s]=1,o[s]=4,c=a[s],Object(l.a)(c)||(c=a[s]=new O),O.subtract(e[s+1],e[s-1],c),O.multiplyByScalar(c,3,c),o[s+1]=1,c=a[s+1],Object(l.a)(c)||(c=a[s+1]=new O),O.clone(n,c),Cu.solve(i,o,r,a)}(n,i,r),s=a.slice(0,a.length-1);return new Du({times:t,points:n,inTangents:a.slice(1,a.length),outTangents:s})},Du.hermiteCoefficientMatrix=new Me(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),Du.prototype.findTimeInterval=wu.prototype.findTimeInterval;const Ru=new _e,ju=new O;Du.prototype.wrapTime=wu.prototype.wrapTime,Du.prototype.clampTime=wu.prototype.clampTime,Du.prototype.evaluate=function(e,t){const n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);const a=this._lastTimeIndex,s=i[a+1]-i[a],c=(e-i[a])/s,u=Ru;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;const h=Me.multiplyByVector(Du.hermiteCoefficientMatrix,u,u);h.z*=s,h.w*=s;const d=this._pointType;return d===Number?n[a]*h.x+n[a+1]*h.y+o[a]*h.z+r[a]*h.w:(Object(l.a)(t)||(t=new d),t=d.multiplyByScalar(n[a],h.x,t),d.multiplyByScalar(n[a+1],h.y,ju),d.add(t,ju,t),d.multiplyByScalar(o[a],h.z,ju),d.add(t,ju,t),d.multiplyByScalar(r[a],h.w,ju),d.add(t,ju,t))};var Mu=Du;const Lu=new _e,Nu=new O,Bu=new O;const Fu=new O,zu=new O;function ku(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).points,n=e.times;let i=e.firstTangent,r=e.lastTangent;if(s.a.defined("points",t),s.a.defined("times",n),s.a.typeOf.number.greaterThanOrEquals("points.length",t.length,2),s.a.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(Object(l.a)(i)||(i=Fu,O.multiplyByScalar(t[1],2,i),O.subtract(i,t[2],i),O.subtract(i,t[0],i),O.multiplyByScalar(i,.5,i)),!Object(l.a)(r))){const e=t.length-1;r=zu,O.multiplyByScalar(t[e-1],2,r),O.subtract(t[e],r,r),O.add(r,t[e-2],r),O.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=O.clone(i),this._lastTangent=O.clone(r),this._evaluateFunction=function(e){const t=e.points,n=e.times;if(t.length<3){const e=n[0],i=1/(n[1]-e),r=t[0],o=t[1];return function(t,n){Object(l.a)(n)||(n=new O);const a=(t-e)*i;return O.lerp(r,o,a,n)}}return function(i,r){Object(l.a)(r)||(r=new O);const o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[o])/(n[o+1]-n[o]),s=Lu;let c,u,h,d,f;return s.z=a,s.y=a*a,s.x=s.y*a,s.w=1,0===o?(c=t[0],u=t[1],h=e.firstTangent,d=O.subtract(t[2],c,Nu),O.multiplyByScalar(d,.5,d),f=Me.multiplyByVector(Mu.hermiteCoefficientMatrix,s,s)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,h=O.subtract(u,t[o-1],Nu),O.multiplyByScalar(h,.5,h),f=Me.multiplyByVector(Mu.hermiteCoefficientMatrix,s,s)):(c=t[o-1],u=t[o],h=t[o+1],d=t[o+2],f=Me.multiplyByVector(ku.catmullRomCoefficientMatrix,s,s)),r=O.multiplyByScalar(c,f.x,r),O.multiplyByScalar(u,f.y,Bu),O.add(r,Bu,r),O.multiplyByScalar(h,f.z,Bu),O.add(r,Bu,r),O.multiplyByScalar(d,f.w,Bu),O.add(r,Bu,r)}}(this),this._lastTimeIndex=0}Object.defineProperties(ku.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),ku.catmullRomCoefficientMatrix=new Me(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),ku.prototype.findTimeInterval=wu.prototype.findTimeInterval,ku.prototype.wrapTime=wu.prototype.wrapTime,ku.prototype.clampTime=wu.prototype.clampTime,ku.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Uu=ku;function Vu(e,t,n){if(!Object(l.a)(e))throw new u.a("uint8Array is required.");if(t<0)throw new u.a("byteOffset cannot be negative.");if(n<0)throw new u.a("byteLength cannot be negative.");if(t+n>e.byteLength)throw new u.a("sub-region exceeds array bounds.");return t=Object(c.a)(t,0),n=Object(c.a)(n,e.byteLength-t),e=e.subarray(t,t+n),Vu.decode(e)}function Hu(e,t,n){return t<=e&&e<=n}Vu.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},Vu.decodeWithFromCharCode=function(e){let t="";const n=function(e){let t=0,n=0,i=0,r=128,o=191;const a=[],s=e.length;for(let c=0;c<s;++c){const s=e[c];if(0===i){if(Hu(s,0,127)){a.push(s);continue}if(Hu(s,194,223)){i=1,t=31&s;continue}if(Hu(s,224,239)){224===s&&(r=160),237===s&&(o=159),i=2,t=15&s;continue}if(Hu(s,240,244)){240===s&&(r=144),244===s&&(o=143),i=3,t=7&s;continue}throw new ye.a("String decoding failed.")}Hu(s,r,o)?(r=128,o=191,t=t<<6|63&s,++n,n===i&&(a.push(t),t=i=n=0)):(t=i=n=0,r=128,o=191,--c)}return a}(e),i=n.length;for(let e=0;e<i;++e){let i=n[e];i<=65535?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode(55296+(i>>10),56320+(1023&i)))}return t},"undefined"!=typeof TextDecoder?Vu.decode=Vu.decodeWithTextDecoder:Vu.decode=Vu.decodeWithFromCharCode;var Gu=Vu;var qu=function(e,t,n){return JSON.parse(Gu(e,t,n))};const Wu={clipTriangleAtAxisAlignedThreshold:function(e,t,n,i,r,o){if(!Object(l.a)(e))throw new u.a("threshold is required.");if(!Object(l.a)(t))throw new u.a("keepAbove is required.");if(!Object(l.a)(n))throw new u.a("u0 is required.");if(!Object(l.a)(i))throw new u.a("u1 is required.");if(!Object(l.a)(r))throw new u.a("u2 is required.");let a,s,c;Object(l.a)(o)?o.length=0:o=[],t?(a=n<e,s=i<e,c=r<e):(a=n>e,s=i>e,c=r>e);const h=a+s+c;let d,f,p,m,g,_;return 1===h?a?(d=(e-n)/(i-n),f=(e-n)/(r-n),o.push(1),o.push(2),1!==f&&(o.push(-1),o.push(0),o.push(2),o.push(f)),1!==d&&(o.push(-1),o.push(0),o.push(1),o.push(d))):s?(p=(e-i)/(r-i),m=(e-i)/(n-i),o.push(2),o.push(0),1!==m&&(o.push(-1),o.push(1),o.push(0),o.push(m)),1!==p&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(g=(e-r)/(n-r),_=(e-r)/(i-r),o.push(0),o.push(1),1!==_&&(o.push(-1),o.push(2),o.push(1),o.push(_)),1!==g&&(o.push(-1),o.push(2),o.push(0),o.push(g))):2===h?a||n===e?s||i===e?c||r===e||(f=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(f),o.push(-1),o.push(1),o.push(2),o.push(p)):(_=(e-r)/(i-r),d=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(_),o.push(-1),o.push(0),o.push(1),o.push(d)):(m=(e-i)/(n-i),g=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(m),o.push(-1),o.push(2),o.push(0),o.push(g)):3!==h&&(o.push(0),o.push(1),o.push(2)),o},computeBarycentricCoordinates:function(e,t,n,i,r,o,a,s,c){if(!Object(l.a)(e))throw new u.a("x is required.");if(!Object(l.a)(t))throw new u.a("y is required.");if(!Object(l.a)(n))throw new u.a("x1 is required.");if(!Object(l.a)(i))throw new u.a("y1 is required.");if(!Object(l.a)(r))throw new u.a("x2 is required.");if(!Object(l.a)(o))throw new u.a("y2 is required.");if(!Object(l.a)(a))throw new u.a("x3 is required.");if(!Object(l.a)(s))throw new u.a("y3 is required.");const h=n-a,d=a-r,f=o-s,p=i-s,m=1/(f*h+d*p),g=t-s,_=e-a,y=(f*_+d*g)*m,b=(-p*_+h*g)*m,v=1-y-b;return Object(l.a)(c)?(c.x=y,c.y=b,c.z=v,c):new O(y,b,v)},computeLineSegmentLineSegmentIntersection:function(e,t,n,i,r,o,a,c,u){s.a.typeOf.number("x00",e),s.a.typeOf.number("y00",t),s.a.typeOf.number("x01",n),s.a.typeOf.number("y01",i),s.a.typeOf.number("x10",r),s.a.typeOf.number("y10",o),s.a.typeOf.number("x11",a),s.a.typeOf.number("y11",c);const h=(c-o)*(n-e)-(a-r)*(i-t);if(0===h)return;const d=((a-r)*(t-o)-(c-o)*(e-r))/h,f=((n-e)*(t-o)-(i-t)*(e-r))/h;return d>=0&&d<=1&&f>=0&&f<=1?(Object(l.a)(u)||(u=new Vt),u.x=e+d*(n-e),u.y=t+d*(i-t),u):void 0}};var Yu=Wu;function Xu(e){if(!Object(l.a)(e)||!Object(l.a)(e.quantizedVertices))throw new u.a("options.quantizedVertices is required.");if(!Object(l.a)(e.indices))throw new u.a("options.indices is required.");if(!Object(l.a)(e.minimumHeight))throw new u.a("options.minimumHeight is required.");if(!Object(l.a)(e.maximumHeight))throw new u.a("options.maximumHeight is required.");if(!Object(l.a)(e.maximumHeight))throw new u.a("options.maximumHeight is required.");if(!Object(l.a)(e.boundingSphere))throw new u.a("options.boundingSphere is required.");if(!Object(l.a)(e.horizonOcclusionPoint))throw new u.a("options.horizonOcclusionPoint is required.");if(!Object(l.a)(e.westIndices))throw new u.a("options.westIndices is required.");if(!Object(l.a)(e.southIndices))throw new u.a("options.southIndices is required.");if(!Object(l.a)(e.eastIndices))throw new u.a("options.eastIndices is required.");if(!Object(l.a)(e.northIndices))throw new u.a("options.northIndices is required.");if(!Object(l.a)(e.westSkirtHeight))throw new u.a("options.westSkirtHeight is required.");if(!Object(l.a)(e.southSkirtHeight))throw new u.a("options.southSkirtHeight is required.");if(!Object(l.a)(e.eastSkirtHeight))throw new u.a("options.eastSkirtHeight is required.");if(!Object(l.a)(e.northSkirtHeight))throw new u.a("options.northSkirtHeight is required.");this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;const t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);function r(e,t){return i[e]-i[t]}function o(e,t){return n[e]-n[t]}this._heightValues=this._quantizedVertices.subarray(2*t,3*t),this._westIndices=Ju(e.westIndices,r,t),this._southIndices=Ju(e.southIndices,o,t),this._eastIndices=Ju(e.eastIndices,r,t),this._northIndices=Ju(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=Object(c.a)(e.childTileMask,15),this._createdByUpsampling=Object(c.a)(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Xu.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return Object(l.a)(this._mesh)}}});const Ku=[];function Ju(e,t,n){Ku.length=e.length;let i=!1;for(let n=0,r=e.length;n<r;++n)Ku[n]=e[n],i=i||n>0&&t(e[n-1],e[n])>0;return i?(Ku.sort(t),wc.createTypedArray(n,Ku)):e}const Zu=new _c("createVerticesFromQuantizedTerrainMesh"),$u=new _c("createVerticesFromQuantizedTerrainMesh",bc.maximumAsynchronousTasks);Xu.prototype.createMesh=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.tilingScheme",e.tilingScheme),s.a.typeOf.number("options.x",e.x),s.a.typeOf.number("options.y",e.y),s.a.typeOf.number("options.level",e.level);const t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=Object(c.a)(e.exaggeration,1),a=Object(c.a)(e.exaggerationRelativeHeight,0),u=Object(c.a)(e.throttle,!0),h=t.ellipsoid,d=t.tileXYToRectangle(n,i,r),f=(u?$u:Zu).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:h,exaggeration:o,exaggerationRelativeHeight:a});if(!Object(l.a)(f))return;const p=this;return Promise.resolve(f).then((function(e){const t=p._quantizedVertices.length/3,n=t+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,i=wc.createTypedArray(n,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,s=e.maximumHeight,l=p._boundingSphere,u=p._orientedBoundingBox,h=Object(c.a)(O.clone(e.occludeePointInScaledSpace),p._horizonOcclusionPoint),d=e.vertexStride,f=Ks.clone(e.encoding);return p._mesh=new vc(o,r,i,e.indexCountWithoutSkirts,t,a,s,l,h,d,u,f,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh}))};const Qu=new _c("upsampleQuantizedTerrainMesh",bc.maximumAsynchronousTasks);Xu.prototype.upsample=function(e,t,n,i,r,o,a){if(!Object(l.a)(e))throw new u.a("tilingScheme is required.");if(!Object(l.a)(t))throw new u.a("thisX is required.");if(!Object(l.a)(n))throw new u.a("thisY is required.");if(!Object(l.a)(i))throw new u.a("thisLevel is required.");if(!Object(l.a)(r))throw new u.a("descendantX is required.");if(!Object(l.a)(o))throw new u.a("descendantY is required.");if(!Object(l.a)(a))throw new u.a("descendantLevel is required.");if(a-i>1)throw new u.a("Upsampling through more than one level at a time is not currently supported.");const s=this._mesh;if(!Object(l.a)(this._mesh))return;const c=2*t!==r,h=2*n===o,d=e.ellipsoid,f=e.tileXYToRectangle(r,o,a),p=Qu.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:h,childRectangle:f,ellipsoid:d});if(!Object(l.a)(p))return;let m=Math.min(this._westSkirtHeight,this._eastSkirtHeight);m=Math.min(m,this._southSkirtHeight),m=Math.min(m,this._northSkirtHeight);const g=c?.5*m:this._westSkirtHeight,_=h?.5*m:this._southSkirtHeight,y=c?this._eastSkirtHeight:.5*m,b=h?this._northSkirtHeight:.5*m,v=this._credits;return Promise.resolve(p).then((function(e){const t=new Uint16Array(e.vertices),n=wc.createTypedArray(t.length/3,e.indices);let i;return Object(l.a)(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new Xu({quantizedVertices:t,indices:n,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:At.clone(e.boundingSphere),orientedBoundingBox:fs.clone(e.orientedBoundingBox),horizonOcclusionPoint:O.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:g,southSkirtHeight:_,eastSkirtHeight:y,northSkirtHeight:b,childTileMask:0,credits:v,createdByUpsampling:!0})}))};const eh=new O;function th(e,t,n,i,r,o,a,s){const c=Math.min(n,r,a),l=Math.max(n,r,a),u=Math.min(i,o,s),h=Math.max(i,o,s);return e>=c&&e<=l&&t>=u&&t<=h}Xu.prototype.interpolateHeight=function(e,t,n){let i=h.a.clamp((t-e.west)/e.width,0,1);i*=32767;let r=h.a.clamp((n-e.south)/e.height,0,1);return r*=32767,Object(l.a)(this._mesh)?function(e,t,n){const i=e._mesh,r=i.vertices,o=i.encoding,a=i.indices;for(let e=0,i=a.length;e<i;e+=3){const i=a[e],s=a[e+1],c=a[e+2],l=o.decodeTextureCoordinates(r,i,nh),u=o.decodeTextureCoordinates(r,s,ih),h=o.decodeTextureCoordinates(r,c,rh);if(th(t,n,l.x,l.y,u.x,u.y,h.x,h.y)){const e=Yu.computeBarycentricCoordinates(t,n,l.x,l.y,u.x,u.y,h.x,h.y,eh);if(e.x>=-1e-15&&e.y>=-1e-15&&e.z>=-1e-15){const t=o.decodeHeight(r,i),n=o.decodeHeight(r,s),a=o.decodeHeight(r,c);return e.x*t+e.y*n+e.z*a}}}return}(this,i,r):function(e,t,n){const i=e._uValues,r=e._vValues,o=e._heightValues,a=e._indices;for(let s=0,c=a.length;s<c;s+=3){const c=a[s],l=a[s+1],u=a[s+2],d=i[c],f=i[l],p=i[u],m=r[c],g=r[l],_=r[u];if(th(t,n,d,m,f,g,p,_)){const i=Yu.computeBarycentricCoordinates(t,n,d,m,f,g,p,_,eh);if(i.x>=-1e-15&&i.y>=-1e-15&&i.z>=-1e-15){const t=i.x*o[c]+i.y*o[l]+i.z*o[u];return h.a.lerp(e._minimumHeight,e._maximumHeight,t/32767)}}}return}(this,i,r)};const nh=new Vt,ih=new Vt,rh=new Vt;Xu.prototype.isChildAvailable=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("thisX is required.");if(!Object(l.a)(t))throw new u.a("thisY is required.");if(!Object(l.a)(n))throw new u.a("childX is required.");if(!Object(l.a)(i))throw new u.a("childY is required.");let r=2;return n!==2*e&&++r,i!==2*t&&(r-=2),0!=(this._childTileMask&1<<r)},Xu.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var oh=Xu;function ah(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function sh(e){if(!Object(l.a)(e)||!Object(l.a)(e.url))throw new u.a("options.url is required.");this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=Object(c.a)(e.requestVertexNormals,!1),this._requestWaterMask=Object(c.a)(e.requestWaterMask,!1),this._requestMetadata=Object(c.a)(e.requestMetadata,!0),this._errorEvent=new un.a;let t=e.credit;"string"==typeof t&&(t=new ln(t)),this._credit=t,this._availability=void 0,this._ready=!1,this._tileCredits=void 0;const n=this;let i,r,o;const a=this._layers=[];let s="";const h=[];let d=0;function f(e){let t;if(!e.format)return t="The tile format is not specified in the layer.json file.",o=dl.reportError(o,n,n._errorEvent,t),o.retry?_():Promise.reject(new ye.a(t));if(!e.tiles||0===e.tiles.length)return t="The layer.json file does not specify any tile URL templates.",o=dl.reportError(o,n,n._errorEvent,t),o.retry?_():Promise.reject(new ye.a(t));let c=!1,u=!1,m=!1,g=!0,y=!1;if("heightmap-1.0"===e.format)y=!0,Object(l.a)(n._heightmapStructure)||(n._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),u=!0,n._requestWaterMask=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return t=`The tile format "${e.format}" is invalid or not supported.`,o=dl.reportError(o,n,n._errorEvent,t),o.retry?_():Promise.reject(new ye.a(t));const b=e.tiles,v=e.maxzoom;if(d=Math.max(d,v),e.projection&&"EPSG:4326"!==e.projection){if("EPSG:3857"!==e.projection)return t=`The projection "${e.projection}" is invalid or not supported.`,o=dl.reportError(o,n,n._errorEvent,t),o.retry?_():Promise.reject(new ye.a(t));n._tilingScheme=new pl({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:n._ellipsoid})}else n._tilingScheme=new Gt({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:n._ellipsoid});if(n._levelZeroMaximumGeometricError=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(n._tilingScheme.ellipsoid,n._heightmapWidth,n._tilingScheme.getNumberOfXTilesAtLevel(0)),e.scheme&&"tms"!==e.scheme&&"slippyMap"!==e.scheme)return t=`The scheme "${e.scheme}" is invalid or not supported.`,o=dl.reportError(o,n,n._errorEvent,t),o.retry?_():Promise.reject(new ye.a(t));let O;n._scheme=e.scheme,Object(l.a)(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?c=!0:Object(l.a)(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(c=!0,g=!1),Object(l.a)(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(u=!0),Object(l.a)(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(m=!0);const w=e.metadataAvailability,A=e.available;let E;if(Object(l.a)(A)&&!Object(l.a)(w)){E=new ol(n._tilingScheme,A.length);for(let e=0;e<A.length;++e){const t=A[e],i=n._tilingScheme.getNumberOfYTilesAtLevel(e);Object(l.a)(h[e])||(h[e]=[]);for(let n=0;n<t.length;++n){const r=t[n],o=i-r.endY-1,a=i-r.startY-1;h[e].push([r.startX,o,r.endX,a]),E.addAvailableTileRange(e,r.startX,o,r.endX,a)}}}else Object(l.a)(w)&&(O=new ol(n._tilingScheme,v),E=new ol(n._tilingScheme,v),h[0]=[[0,0,1,0]],E.addAvailableTileRange(0,0,0,1,0));n._hasWaterMask=n._hasWaterMask||u,n._hasVertexNormals=n._hasVertexNormals||c,n._hasMetadata=n._hasMetadata||m,Object(l.a)(e.attribution)&&(s.length>0&&(s+=" "),s+=e.attribution),a.push(new ah({resource:i,version:e.version,isHeightmap:y,tileUrlTemplates:b,availability:E,hasVertexNormals:c,hasWaterMask:u,hasMetadata:m,availabilityLevels:w,availabilityTilesLoaded:O,littleEndianExtensionSize:g}));const T=e.parentUrl;if(Object(l.a)(T)){if(!Object(l.a)(E))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),Promise.resolve(!0);i=i.getDerivedResource({url:T}),i.appendForwardSlash(),r=i.getDerivedResource({url:"layer.json"});const e=r.fetchJson();return Promise.resolve(e).then(f).catch(p)}return Promise.resolve(!0)}function p(e){const t=`An error occurred while accessing ${r.url}.`;return o=dl.reportError(o,n,n._errorEvent,t),o.retry?_():Promise.reject(new ye.a(t))}function m(e){return f(e).then((function(){if(Object(l.a)(o))return;const e=h.length;if(e>0){const t=n._availability=new ol(n._tilingScheme,d);for(let n=0;n<e;++n){const e=h[n];for(let i=0;i<e.length;++i){const r=e[i];t.addAvailableTileRange(n,r[0],r[1],r[2],r[3])}}}if(s.length>0){const e=new ln(s);Object(l.a)(n._tileCredits)?n._tileCredits.push(e):n._tileCredits=[e]}return n._ready=!0,Promise.resolve(!0)}))}function g(e){return Object(l.a)(e)&&404===e.statusCode?m({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]}):p()}function _(){return Promise.resolve(r.fetchJson()).then(m).catch(g)}this._readyPromise=Promise.resolve(e.url).then((function(e){const t=Tt.a.createIfNeeded(e);return t.appendForwardSlash(),i=t,r=i.getDerivedResource({url:"layer.json"}),n._tileCredits=t.credits,_()}))}const ch=1,lh=2,uh=4;function hh(e){if(!Object(l.a)(e)||0===e.length)return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"};return{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function dh(e,t,n,i,r,o){if(!Object(l.a)(r))return Promise.reject(new ye.a("Terrain tile doesn't exist"));const a=r.tileUrlTemplates;if(0===a.length)return;let s;if(e._scheme&&"tms"!==e._scheme)s=n;else{s=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1}const c=[];let u,h;e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");const d=a[(t+s+i)%a.length],f=r.resource;Object(l.a)(f._ionEndpoint)&&!Object(l.a)(f._ionEndpoint.externalType)?(0!==c.length&&(h={extensions:c.join("-")}),u=hh(void 0)):u=hh(c);const p=f.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:s},queryParameters:h,headers:u,request:o}).fetchArrayBuffer();return Object(l.a)(p)?p.then((function(o){return Object(l.a)(o)?Object(l.a)(e._heightmapStructure)?function(e,t,n,i,r){const o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Fc({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}(e,o):function(e,t,n,i,r,o){const a=o.littleEndianExtensionSize;let s=0;const c=3*Float64Array.BYTES_PER_ELEMENT,u=4*Float64Array.BYTES_PER_ELEMENT,h=3*Uint16Array.BYTES_PER_ELEMENT;let d=Uint16Array.BYTES_PER_ELEMENT,f=3*d;const p=new DataView(t),m=new O(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0));s+=c;const g=p.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;const _=p.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;const y=new At(new O(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0)),p.getFloat64(s+c,!0));s+=u;const b=new O(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0));s+=c;const v=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;const w=new Uint16Array(t,s,3*v);s+=v*h,v>65536&&(d=Uint32Array.BYTES_PER_ELEMENT,f=3*d);const A=w.subarray(0,v),E=w.subarray(v,2*v),T=w.subarray(2*v,3*v);js.zigZagDeltaDecode(A,E,T),s%d!=0&&(s+=d-s%d);const C=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;const x=wc.createTypedArrayFromArrayBuffer(v,t,s,3*C);s+=C*f;let S=0;const I=x.length;for(let e=0;e<I;++e){const t=x[e];x[e]=S-t,0===t&&++S}const P=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;const D=wc.createTypedArrayFromArrayBuffer(v,t,s,P);s+=P*d;const R=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;const j=wc.createTypedArrayFromArrayBuffer(v,t,s,R);s+=R*d;const M=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;const L=wc.createTypedArrayFromArrayBuffer(v,t,s,M);s+=M*d;const N=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;const B=wc.createTypedArrayFromArrayBuffer(v,t,s,N);let F,z;for(s+=N*d;s<p.byteLength;){const c=p.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;const u=p.getUint32(s,a);if(s+=Uint32Array.BYTES_PER_ELEMENT,c===ch&&e._requestVertexNormals)F=new Uint8Array(t,s,2*v);else if(c===lh&&e._requestWaterMask)z=new Uint8Array(t,s,u);else if(c===uh&&e._requestMetadata){const a=p.getUint32(s,!0);if(a>0){const i=qu(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,a).available;if(Object(l.a)(i))for(let t=0;t<i.length;++t){const r=n+t+1,a=i[t],s=e._tilingScheme.getNumberOfYTilesAtLevel(r);for(let t=0;t<a.length;++t){const n=a[t],i=s-n.endY-1,c=s-n.startY-1;e.availability.addAvailableTileRange(r,n.startX,i,n.endX,c),o.availability.addAvailableTileRange(r,n.startX,i,n.endX,c)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}s+=u}const k=5*e.getLevelMaximumGeometricError(n),U=e._tilingScheme.tileXYToRectangle(i,r,n),V=fs.fromRectangle(U,g,_,e._tilingScheme.ellipsoid);return new oh({center:m,minimumHeight:g,maximumHeight:_,boundingSphere:y,orientedBoundingBox:V,horizonOcclusionPoint:b,quantizedVertices:w,encodedNormals:F,indices:x,westIndices:D,southIndices:j,eastIndices:L,northIndices:B,westSkirtHeight:k,southSkirtHeight:k,eastSkirtHeight:k,northSkirtHeight:k,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:z,credits:e._tileCredits})}(e,o,i,t,n,r):Promise.reject(new ye.a("Mesh buffer doesn't exist."))})):void 0}function fh(e,t,n,i){if(0===i)return;const r=e.availabilityLevels,o=i%r==0?i-r:(i/r|0)*r,a=1<<i-o;return{level:o,x:t/a|0,y:n/a|0}}function ph(e,t,n,i,r,o){if(!Object(l.a)(r.availabilityLevels))return{result:!1};let a;const s=function(){delete r.availabilityPromiseCache[a]},c=r.availabilityTilesLoaded,u=r.availability;let h=fh(r,t,n,i);for(;Object(l.a)(h);){if(u.isTileAvailable(h.level,h.x,h.y)&&!c.isTileAvailable(h.level,h.x,h.y)){let t;if(!o&&(a=`${h.level}-${h.x}-${h.y}`,t=r.availabilityPromiseCache[a],!Object(l.a)(t))){const n=new zc.a({throttle:!1,throttleByServer:!0,type:Uc.a.TERRAIN});t=dh(e,h.x,h.y,h.level,r,n),Object(l.a)(t)&&(r.availabilityPromiseCache[a]=t,t.then(s))}return{result:!0,promise:t}}h=fh(r,h.x,h.y,h.level)}return{result:!1}}sh.prototype.requestTileGeometry=function(e,t,n,i){if(!this._ready)throw new u.a("requestTileGeometry must not be called before the terrain provider is ready.");const r=this._layers;let o;const a=r.length;if(1===a)o=r[0];else for(let i=0;i<a;++i){const a=r[i];if(!Object(l.a)(a.availability)||a.availability.isTileAvailable(n,e,t)){o=a;break}}return dh(this,e,t,n,o,i)},Object.defineProperties(sh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){if(!this._ready)throw new u.a("credit must not be called before the terrain provider is ready.");return this._credit}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the terrain provider is ready.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){if(!this._ready)throw new u.a("hasWaterMask must not be called before the terrain provider is ready.");return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){if(!this._ready)throw new u.a("hasVertexNormals must not be called before the terrain provider is ready.");return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){if(!this._ready)throw new u.a("hasMetadata must not be called before the terrain provider is ready.");return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){if(!this._ready)throw new u.a("availability must not be called before the terrain provider is ready.");return this._availability}}}),sh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},sh.prototype.getTileDataAvailable=function(e,t,n){if(!Object(l.a)(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;const i=this._layers,r=i.length;for(let o=0;o<r;++o){if(ph(this,e,t,n,i[o],0===o).result)return}return!1},sh.prototype.loadTileDataAvailability=function(e,t,n){if(!Object(l.a)(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;const i=this._layers,r=i.length;for(let o=0;o<r;++o){const r=ph(this,e,t,n,i[o],0===o);if(Object(l.a)(r.promise))return r.promise}},sh._getAvailabilityTile=fh;var mh=sh;const gh={},_h=new O,yh=new O,bh=new To,vh=new ce;function Oh(e,t,n,i,r,o,a,s,c,l){const u=e+t;O.multiplyByScalar(i,Math.cos(u),_h),O.multiplyByScalar(n,Math.sin(u),yh),O.add(_h,yh,_h);let h=Math.cos(e);h*=h;let d=Math.sin(e);d*=d;const f=o/Math.sqrt(a*h+r*d)/s;return To.fromAxisAngle(_h,f,bh),ce.fromQuaternion(bh,vh),ce.multiplyByVector(vh,c,l),O.normalize(l,l),O.multiplyByScalar(l,s,l),l}const wh=new O,Ah=new O,Eh=new O,Th=new O;gh.raisePositionsToHeight=function(e,t,n){const i=t.ellipsoid,r=t.height,o=t.extrudedHeight,a=n?e.length/3*2:e.length/3,s=new Float64Array(3*a),c=e.length,l=n?c:0;for(let t=0;t<c;t+=3){const a=t+1,c=t+2,u=O.fromArray(e,t,wh);i.scaleToGeodeticSurface(u,u);const h=O.clone(u,Ah),d=i.geodeticSurfaceNormal(u,Th),f=O.multiplyByScalar(d,r,Eh);O.add(u,f,u),n&&(O.multiplyByScalar(d,o,f),O.add(h,f,h),s[t+l]=h.x,s[a+l]=h.y,s[c+l]=h.z),s[t]=u.x,s[a]=u.y,s[c]=u.z}return s};const Ch=new O,xh=new O,Sh=new O;gh.computeEllipsePositions=function(e,t,n){const i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,a=e.center,s=8*e.granularity,c=i*i,l=r*r,u=r*i,d=O.magnitude(a),f=O.normalize(a,Ch);let p=O.cross(O.UNIT_Z,a,xh);p=O.normalize(p,p);const m=O.cross(f,p,Sh);let g=1+Math.ceil(h.a.PI_OVER_TWO/s);const _=h.a.PI_OVER_TWO/(g-1);let y=h.a.PI_OVER_TWO-g*_;y<0&&(g-=Math.ceil(Math.abs(y)/_));const b=t?new Array(3*(g*(g+2)*2)):void 0;let v=0,w=wh,A=Ah;const E=4*g*3;let T=E-1,C=0;const x=n?new Array(E):void 0;let S,I,P,D,R;for(y=h.a.PI_OVER_TWO,w=Oh(y,o,m,p,c,u,l,d,f,w),t&&(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z),n&&(x[T--]=w.z,x[T--]=w.y,x[T--]=w.x),y=h.a.PI_OVER_TWO-_,S=1;S<g+1;++S){if(w=Oh(y,o,m,p,c,u,l,d,f,w),A=Oh(Math.PI-y,o,m,p,c,u,l,d,f,A),t){for(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z,P=2*S+2,I=1;I<P-1;++I)D=I/(P-1),R=O.lerp(w,A,D,Eh),b[v++]=R.x,b[v++]=R.y,b[v++]=R.z;b[v++]=A.x,b[v++]=A.y,b[v++]=A.z}n&&(x[T--]=w.z,x[T--]=w.y,x[T--]=w.x,x[C++]=A.x,x[C++]=A.y,x[C++]=A.z),y=h.a.PI_OVER_TWO-(S+1)*_}for(S=g;S>1;--S){if(y=h.a.PI_OVER_TWO-(S-1)*_,w=Oh(-y,o,m,p,c,u,l,d,f,w),A=Oh(y+Math.PI,o,m,p,c,u,l,d,f,A),t){for(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z,P=2*(S-1)+2,I=1;I<P-1;++I)D=I/(P-1),R=O.lerp(w,A,D,Eh),b[v++]=R.x,b[v++]=R.y,b[v++]=R.z;b[v++]=A.x,b[v++]=A.y,b[v++]=A.z}n&&(x[T--]=w.z,x[T--]=w.y,x[T--]=w.x,x[C++]=A.x,x[C++]=A.y,x[C++]=A.z)}y=h.a.PI_OVER_TWO,w=Oh(-y,o,m,p,c,u,l,d,f,w);const j={};return t&&(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z,j.positions=b,j.numPts=g),n&&(x[T--]=w.z,x[T--]=w.y,x[T--]=w.x,j.outerPositions=x),j};var Ih=gh;var Ph=function(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.geometry))throw new u.a("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=Object(c.a)(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0};function Dh(){this.high=O.clone(O.ZERO),this.low=O.clone(O.ZERO)}Dh.encode=function(e,t){let n;return s.a.typeOf.number("value",e),Object(l.a)(t)||(t={high:0,low:0}),e>=0?(n=65536*Math.floor(e/65536),t.high=n,t.low=e-n):(n=65536*Math.floor(-e/65536),t.high=-n,t.low=e+n),t};const Rh={high:0,low:0};Dh.fromCartesian=function(e,t){s.a.typeOf.object("cartesian",e),Object(l.a)(t)||(t=new Dh);const n=t.high,i=t.low;return Dh.encode(e.x,Rh),n.x=Rh.high,i.x=Rh.low,Dh.encode(e.y,Rh),n.y=Rh.high,i.y=Rh.low,Dh.encode(e.z,Rh),n.z=Rh.high,i.z=Rh.low,t};const jh=new Dh;Dh.writeElements=function(e,t,n){s.a.defined("cartesianArray",t),s.a.typeOf.number("index",n),s.a.typeOf.number.greaterThanOrEquals("index",n,0),Dh.fromCartesian(e,jh);const i=jh.high,r=jh.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Mh=Dh;const Lh={calculateACMR:function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).indices;let n=e.maximumIndex;const i=Object(c.a)(e.cacheSize,24);if(!Object(l.a)(t))throw new u.a("indices is required.");const r=t.length;if(r<3||r%3!=0)throw new u.a("indices length must be a multiple of three.");if(n<=0)throw new u.a("maximumIndex must be greater than zero.");if(i<3)throw new u.a("cacheSize must be greater than two.");if(!Object(l.a)(n)){n=0;let e=0,i=t[e];for(;e<r;)i>n&&(n=i),++e,i=t[e]}const o=[];for(let e=0;e<n+1;e++)o[e]=0;let a=i+1;for(let e=0;e<r;++e)a-o[t[e]]>i&&(o[t[e]]=a,++a);return(a-i+1)/(r/3)}};Lh.tipsify=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).indices,n=e.maximumIndex,i=Object(c.a)(e.cacheSize,24);let r;function o(e,t,n,i,o,a,s){let c,l=-1,u=-1,h=0;for(;h<n.length;){const e=n[h];i[e].numLiveTriangles&&(c=0,o-i[e].timeStamp+2*i[e].numLiveTriangles<=t&&(c=o-i[e].timeStamp),(c>u||-1===u)&&(u=c,l=e)),++h}return-1===l?function(e,t,n,i){for(;t.length>=1;){const n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;r<i;){if(e[r].numLiveTriangles>0)return++r,r-1;++r}return-1}(i,a,0,s):l}if(!Object(l.a)(t))throw new u.a("indices is required.");const a=t.length;if(a<3||a%3!=0)throw new u.a("indices length must be a multiple of three.");if(n<=0)throw new u.a("maximumIndex must be greater than zero.");if(i<3)throw new u.a("cacheSize must be greater than two.");let s=0,h=0,d=t[h];const f=a;if(Object(l.a)(n))s=n+1;else{for(;h<f;)d>s&&(s=d),++h,d=t[h];if(-1===s)return 0;++s}const p=[];let m;for(m=0;m<s;m++)p[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;let g=0;for(;h<f;)p[t[h]].vertexTriangles.push(g),++p[t[h]].numLiveTriangles,p[t[h+1]].vertexTriangles.push(g),++p[t[h+1]].numLiveTriangles,p[t[h+2]].vertexTriangles.push(g),++p[t[h+2]].numLiveTriangles,++g,h+=3;let _=0,y=i+1;r=1;let b=[];const v=[];let O,w,A=0;const E=[],T=a/3,C=[];for(m=0;m<T;m++)C[m]=!1;let x,S;for(;-1!==_;){b=[],w=p[_],S=w.vertexTriangles.length;for(let e=0;e<S;++e)if(g=w.vertexTriangles[e],!C[g]){C[g]=!0,h=g+g+g;for(let e=0;e<3;++e)x=t[h],b.push(x),v.push(x),E[A]=x,++A,O=p[x],--O.numLiveTriangles,y-O.timeStamp>i&&(O.timeStamp=y,++y),++h}_=o(0,i,b,p,y,v,s)}return E};var Nh=Lh;const Bh={};function Fh(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function zh(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&Object(l.a)(e[n])&&Object(l.a)(e[n].values)){const i=e[n];t[n]=new $l({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function kh(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&Object(l.a)(t[i])&&Object(l.a)(t[i].values)){const r=t[i];for(let t=0;t<r.componentsPerAttribute;++t)e[i].values.push(r.values[n*r.componentsPerAttribute+t])}}Bh.toWireframe=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");const t=e.indices;if(Object(l.a)(t)){switch(e.primitiveType){case zl.TRIANGLES:e.indices=function(e){const t=e.length,n=t/3*6,i=wc.createTypedArray(t,n);let r=0;for(let n=0;n<t;n+=3,r+=6)Fh(i,r,e[n],e[n+1],e[n+2]);return i}(t);break;case zl.TRIANGLE_STRIP:e.indices=function(e){const t=e.length;if(t>=3){const n=6*(t-2),i=wc.createTypedArray(t,n);Fh(i,0,e[0],e[1],e[2]);let r=6;for(let n=3;n<t;++n,r+=6)Fh(i,r,e[n-1],e[n],e[n-2]);return i}return new Uint16Array}(t);break;case zl.TRIANGLE_FAN:e.indices=function(e){if(e.length>0){const t=e.length-1,n=6*(t-1),i=wc.createTypedArray(t,n),r=e[0];let o=0;for(let n=1;n<t;++n,o+=6)Fh(i,o,r,e[n],e[n+1]);return i}return new Uint16Array}(t);break;default:throw new u.a("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=zl.LINES}return e},Bh.createLineSegmentsForVectors=function(e,t,n){if(t=Object(c.a)(t,"normal"),!Object(l.a)(e))throw new u.a("geometry is required.");if(!Object(l.a)(e.attributes.position))throw new u.a("geometry.attributes.position is required.");if(!Object(l.a)(e.attributes[t]))throw new u.a(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=Object(c.a)(n,1e4);const i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,a=new Float64Array(2*o);let s,h=0;for(let e=0;e<o;e+=3)a[h++]=i[e],a[h++]=i[e+1],a[h++]=i[e+2],a[h++]=i[e]+r[e]*n,a[h++]=i[e+1]+r[e+1]*n,a[h++]=i[e+2]+r[e+2]*n;const d=e.boundingSphere;return Object(l.a)(d)&&(s=new At(d.center,d.radius+n)),new Zl({attributes:{position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:zl.LINES,boundingSphere:s})},Bh.createAttributeLocations=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let r,o=0;const a=t.length;for(r=0;r<a;++r){const e=t[r];Object(l.a)(n[e])&&(i[e]=o++)}for(const e in n)n.hasOwnProperty(e)&&!Object(l.a)(i[e])&&(i[e]=o++);return i},Bh.reorderForPreVertexCache=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");const t=Zl.computeNumberOfVertices(e),n=e.indices;if(Object(l.a)(n)){const i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=-1;const r=n,o=r.length,a=wc.createTypedArray(t,o);let s,c=0,u=0,h=0;for(;c<o;)s=i[r[c]],-1!==s?a[u]=s:(s=r[c],i[s]=h,a[u]=h,++h),++c,++u;e.indices=a;const d=e.attributes;for(const e in d)if(d.hasOwnProperty(e)&&Object(l.a)(d[e])&&Object(l.a)(d[e].values)){const n=d[e],r=n.values;let o=0;const a=n.componentsPerAttribute,s=gs.createTypedArray(n.componentDatatype,h*a);for(;o<t;){const e=i[o];if(-1!==e)for(let t=0;t<a;t++)s[a*e+t]=r[a*o+t];++o}n.values=s}}return e},Bh.reorderForPostVertexCache=function(e,t){if(!Object(l.a)(e))throw new u.a("geometry is required.");const n=e.indices;if(e.primitiveType===zl.TRIANGLES&&Object(l.a)(n)){const i=n.length;let r=0;for(let e=0;e<i;e++)n[e]>r&&(r=n[e]);e.indices=Nh.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e},Bh.fitToUnsignedShortIndices=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");if(Object(l.a)(e.indices)&&e.primitiveType!==zl.TRIANGLES&&e.primitiveType!==zl.LINES&&e.primitiveType!==zl.POINTS)throw new u.a("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");const t=[],n=Zl.computeNumberOfVertices(e);if(Object(l.a)(e.indices)&&n>=h.a.SIXTY_FOUR_KILOBYTES){let n=[],i=[],r=0,o=zh(e.attributes);const a=e.indices,s=a.length;let c;e.primitiveType===zl.TRIANGLES?c=3:e.primitiveType===zl.LINES?c=2:e.primitiveType===zl.POINTS&&(c=1);for(let u=0;u<s;u+=c){for(let t=0;t<c;++t){const s=a[u+t];let c=n[s];Object(l.a)(c)||(c=r++,n[s]=c,kh(o,e.attributes,s)),i.push(c)}r+c>=h.a.SIXTY_FOUR_KILOBYTES&&(t.push(new Zl({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],i=[],r=0,o=zh(e.attributes))}0!==i.length&&t.push(new Zl({attributes:o,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const Uh=new O,Vh=new R;Bh.projectTo2D=function(e,t,n,i,r){if(!Object(l.a)(e))throw new u.a("geometry is required.");if(!Object(l.a)(t))throw new u.a("attributeName is required.");if(!Object(l.a)(n))throw new u.a("attributeName3D is required.");if(!Object(l.a)(i))throw new u.a("attributeName2D is required.");if(!Object(l.a)(e.attributes[t]))throw new u.a(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==gs.DOUBLE)throw new u.a("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const o=e.attributes[t],a=(r=Object(l.a)(r)?r:new q).ellipsoid,s=o.values,c=new Float64Array(s.length);let h=0;for(let e=0;e<s.length;e+=3){const t=O.fromArray(s,e,Uh),n=a.cartesianToCartographic(t,Vh);if(!Object(l.a)(n))throw new u.a(`Could not project point (${t.x}, ${t.y}, ${t.z}) to 2D.`);const i=r.project(n,Uh);c[h++]=i.x,c[h++]=i.y,c[h++]=i.z}return e.attributes[n]=o,e.attributes[i]=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};const Hh={high:0,low:0};Bh.encodeAttribute=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("geometry is required.");if(!Object(l.a)(t))throw new u.a("attributeName is required.");if(!Object(l.a)(n))throw new u.a("attributeHighName is required.");if(!Object(l.a)(i))throw new u.a("attributeLowName is required.");if(!Object(l.a)(e.attributes[t]))throw new u.a(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==gs.DOUBLE)throw new u.a("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const r=e.attributes[t],o=r.values,a=o.length,s=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;++e)Mh.encode(o[e],Hh),s[e]=Hh.high,c[e]=Hh.low;const h=r.componentsPerAttribute;return e.attributes[n]=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[i]=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};let Gh=new O;function qh(e,t){if(Object(l.a)(t)){const n=t.values,i=n.length;for(let t=0;t<i;t+=3)O.unpack(n,t,Gh),Me.multiplyByPoint(e,Gh,Gh),O.pack(Gh,n,t)}}function Wh(e,t){if(Object(l.a)(t)){const n=t.values,i=n.length;for(let t=0;t<i;t+=3)O.unpack(n,t,Gh),ce.multiplyByVector(e,Gh,Gh),Gh=O.normalize(Gh,Gh),O.pack(Gh,n,t)}}const Yh=new Me,Xh=new ce;Bh.transformToWorldCoordinates=function(e){if(!Object(l.a)(e))throw new u.a("instance is required.");const t=e.modelMatrix;if(Me.equals(t,Me.IDENTITY))return e;const n=e.geometry.attributes;qh(t,n.position),qh(t,n.prevPosition),qh(t,n.nextPosition),(Object(l.a)(n.normal)||Object(l.a)(n.tangent)||Object(l.a)(n.bitangent))&&(Me.inverse(t,Yh),Me.transpose(Yh,Yh),Me.getMatrix3(Yh,Xh),Wh(Xh,n.normal),Wh(Xh,n.tangent),Wh(Xh,n.bitangent));const i=e.geometry.boundingSphere;return Object(l.a)(i)&&(e.geometry.boundingSphere=At.transform(i,t,i)),e.modelMatrix=Me.clone(Me.IDENTITY),e};const Kh=new O;function Jh(e,t){const n=e.length;let i,r,o,a;const s=e[0].modelMatrix,c=Object(l.a)(e[0][t].indices),h=e[0][t].primitiveType;for(r=1;r<n;++r){if(!Me.equals(e[r].modelMatrix,s))throw new u.a("All instances must have the same modelMatrix.");if(Object(l.a)(e[r][t].indices)!==c)throw new u.a("All instance geometries must have an indices or not have one.");if(e[r][t].primitiveType!==h)throw new u.a("All instance geometries must have the same primitiveType.")}const d=function(e,t){const n=e.length,i={},r=e[0][t].attributes;let o;for(o in r)if(r.hasOwnProperty(o)&&Object(l.a)(r[o])&&Object(l.a)(r[o].values)){const a=r[o];let s=a.values.length,c=!0;for(let i=1;i<n;++i){const n=e[i][t].attributes[o];if(!Object(l.a)(n)||a.componentDatatype!==n.componentDatatype||a.componentsPerAttribute!==n.componentsPerAttribute||a.normalize!==n.normalize){c=!1;break}s+=n.values.length}c&&(i[o]=new $l({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:gs.createTypedArray(a.componentDatatype,s)}))}return i}(e,t);let f,p,m,g;for(i in d)if(d.hasOwnProperty(i))for(f=d[i].values,a=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,m=p.length,o=0;o<m;++o)f[a++]=p[o];if(c){let i=0;for(r=0;r<n;++r)i+=e[r][t].indices.length;const o=Zl.computeNumberOfVertices(new Zl({attributes:d,primitiveType:zl.POINTS})),s=wc.createTypedArray(o,i);let c=0,l=0;for(r=0;r<n;++r){const n=e[r][t].indices,i=n.length;for(a=0;a<i;++a)s[c++]=l+n[a];l+=Zl.computeNumberOfVertices(e[r][t])}g=s}let _,y=new O,b=0;for(r=0;r<n;++r){if(_=e[r][t].boundingSphere,!Object(l.a)(_)){y=void 0;break}O.add(_.center,y,y)}if(Object(l.a)(y))for(O.divideByScalar(y,n,y),r=0;r<n;++r){_=e[r][t].boundingSphere;const n=O.magnitude(O.subtract(_.center,y,Kh))+_.radius;n>b&&(b=n)}return new Zl({attributes:d,indices:g,primitiveType:h,boundingSphere:Object(l.a)(y)?new At(y,b):void 0})}Bh.combineInstances=function(e){if(!Object(l.a)(e)||e.length<1)throw new u.a("instances is required and must have length greater than zero.");const t=[],n=[],i=e.length;for(let r=0;r<i;++r){const i=e[r];Object(l.a)(i.geometry)?t.push(i):Object(l.a)(i.westHemisphereGeometry)&&Object(l.a)(i.eastHemisphereGeometry)&&n.push(i)}const r=[];return t.length>0&&r.push(Jh(t,"geometry")),n.length>0&&(r.push(Jh(n,"westHemisphereGeometry")),r.push(Jh(n,"eastHemisphereGeometry"))),r};const Zh=new O,$h=new O,Qh=new O,ed=new O;Bh.computeNormal=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");if(!Object(l.a)(e.attributes.position)||!Object(l.a)(e.attributes.position.values))throw new u.a("geometry.attributes.position.values is required.");if(!Object(l.a)(e.indices))throw new u.a("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!=0)throw new u.a("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==zl.TRIANGLES)throw new u.a("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,a=new Array(r),s=new Array(o/3),c=new Array(o);let d;for(d=0;d<r;d++)a[d]={indexOffset:0,count:0,currentCount:0};let f=0;for(d=0;d<o;d+=3){const e=t[d],n=t[d+1],r=t[d+2],o=3*e,c=3*n,l=3*r;$h.x=i[o],$h.y=i[o+1],$h.z=i[o+2],Qh.x=i[c],Qh.y=i[c+1],Qh.z=i[c+2],ed.x=i[l],ed.y=i[l+1],ed.z=i[l+2],a[e].count++,a[n].count++,a[r].count++,O.subtract(Qh,$h,Qh),O.subtract(ed,$h,ed),s[f]=O.cross(Qh,ed,new O),f++}let p,m=0;for(d=0;d<r;d++)a[d].indexOffset+=m,m+=a[d].count;for(f=0,d=0;d<o;d+=3){p=a[t[d]];let e=p.indexOffset+p.currentCount;c[e]=f,p.currentCount++,p=a[t[d+1]],e=p.indexOffset+p.currentCount,c[e]=f,p.currentCount++,p=a[t[d+2]],e=p.indexOffset+p.currentCount,c[e]=f,p.currentCount++,f++}const g=new Float32Array(3*r);for(d=0;d<r;d++){const e=3*d;if(p=a[d],O.clone(O.ZERO,Zh),p.count>0){for(f=0;f<p.count;f++)O.add(Zh,s[c[p.indexOffset+f]],Zh);O.equalsEpsilon(O.ZERO,Zh,h.a.EPSILON10)&&O.clone(s[c[p.indexOffset]],Zh)}O.equalsEpsilon(O.ZERO,Zh,h.a.EPSILON10)&&(Zh.z=1),O.normalize(Zh,Zh),g[e]=Zh.x,g[e+1]=Zh.y,g[e+2]=Zh.z}return e.attributes.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:g}),e};const td=new O,nd=new O,id=new O;Bh.computeTangentAndBitangent=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");const t=e.attributes,n=e.indices;if(!Object(l.a)(t.position)||!Object(l.a)(t.position.values))throw new u.a("geometry.attributes.position.values is required.");if(!Object(l.a)(t.normal)||!Object(l.a)(t.normal.values))throw new u.a("geometry.attributes.normal.values is required.");if(!Object(l.a)(t.st)||!Object(l.a)(t.st.values))throw new u.a("geometry.attributes.st.values is required.");if(!Object(l.a)(n))throw new u.a("geometry.indices is required.");if(n.length<2||n.length%3!=0)throw new u.a("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==zl.TRIANGLES)throw new u.a("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,s=n.length,c=new Array(3*a);let h,d,f,p;for(h=0;h<c.length;h++)c[h]=0;for(h=0;h<s;h+=3){const e=n[h],t=n[h+1],r=n[h+2];d=3*e,f=3*t,p=3*r;const a=2*e,s=2*t,l=2*r,u=i[d],m=i[d+1],g=i[d+2],_=o[a],y=o[a+1],b=o[s+1]-y,v=o[l+1]-y,O=1/((o[s]-_)*v-(o[l]-_)*b),w=(v*(i[f]-u)-b*(i[p]-u))*O,A=(v*(i[f+1]-m)-b*(i[p+1]-m))*O,E=(v*(i[f+2]-g)-b*(i[p+2]-g))*O;c[d]+=w,c[d+1]+=A,c[d+2]+=E,c[f]+=w,c[f+1]+=A,c[f+2]+=E,c[p]+=w,c[p+1]+=A,c[p+2]+=E}const m=new Float32Array(3*a),g=new Float32Array(3*a);for(h=0;h<a;h++){d=3*h,f=d+1,p=d+2;const e=O.fromArray(r,d,td),t=O.fromArray(c,d,id),n=O.dot(e,t);O.multiplyByScalar(e,n,nd),O.normalize(O.subtract(t,nd,t),t),m[d]=t.x,m[f]=t.y,m[p]=t.z,O.normalize(O.cross(e,t,t),t),g[d]=t.x,g[f]=t.y,g[p]=t.z}return e.attributes.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:m}),e.attributes.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:g}),e};const rd=new Vt,od=new O,ad=new O,sd=new O;let cd=new Vt;function ld(e){switch(e.primitiveType){case zl.TRIANGLE_FAN:return function(e){const t=Zl.computeNumberOfVertices(e);if(t<3)throw new u.a("The number of vertices must be at least three.");const n=wc.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;let i=3;for(let e=3;e<t;++e)n[i++]=e-1,n[i++]=0,n[i++]=e;return e.indices=n,e.primitiveType=zl.TRIANGLES,e}(e);case zl.TRIANGLE_STRIP:return function(e){const t=Zl.computeNumberOfVertices(e);if(t<3)throw new u.a("The number of vertices must be at least 3.");const n=wc.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let e=3;e<t-1;e+=2)n[i++]=e,n[i++]=e-1,n[i++]=e+1,e+2<t&&(n[i++]=e,n[i++]=e+1,n[i++]=e+2);return e.indices=n,e.primitiveType=zl.TRIANGLES,e}(e);case zl.TRIANGLES:return function(e){if(Object(l.a)(e.indices))return e;const t=Zl.computeNumberOfVertices(e);if(t<3)throw new u.a("The number of vertices must be at least three.");if(t%3!=0)throw new u.a("The number of vertices must be a multiple of three.");const n=wc.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e);case zl.LINE_STRIP:return function(e){const t=Zl.computeNumberOfVertices(e);if(t<2)throw new u.a("The number of vertices must be at least two.");const n=wc.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return e.indices=n,e.primitiveType=zl.LINES,e}(e);case zl.LINE_LOOP:return function(e){const t=Zl.computeNumberOfVertices(e);if(t<2)throw new u.a("The number of vertices must be at least two.");const n=wc.createTypedArray(t,2*t);n[0]=0,n[1]=1;let i=2;for(let e=2;e<t;++e)n[i++]=e-1,n[i++]=e;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=zl.LINES,e}(e);case zl.LINES:return function(e){if(Object(l.a)(e.indices))return e;const t=Zl.computeNumberOfVertices(e);if(t<2)throw new u.a("The number of vertices must be at least two.");if(t%2!=0)throw new u.a("The number of vertices must be a multiple of 2.");const n=wc.createTypedArray(t,t);for(let e=0;e<t;++e)n[e]=e;return e.indices=n,e}(e)}return e}function ud(e,t){Math.abs(e.y)<h.a.EPSILON6&&(e.y=t?-h.a.EPSILON6:h.a.EPSILON6)}Bh.compressVertices=function(e){if(!Object(l.a)(e))throw new u.a("geometry is required.");const t=e.attributes.extrudeDirection;let n,i;if(Object(l.a)(t)){const r=t.values;i=r.length/3;const o=new Float32Array(2*i);let a=0;for(n=0;n<i;++n)O.fromArray(r,3*n,od),O.equals(od,O.ZERO)?a+=2:(cd=js.octEncodeInRange(od,65535,cd),o[a++]=cd.x,o[a++]=cd.y);return e.attributes.compressedAttributes=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:o}),delete e.attributes.extrudeDirection,e}const r=e.attributes.normal,o=e.attributes.st,a=Object(l.a)(r),s=Object(l.a)(o);if(!a&&!s)return e;const c=e.attributes.tangent,h=e.attributes.bitangent,d=Object(l.a)(c),f=Object(l.a)(h);let p,m,g,_;a&&(p=r.values),s&&(m=o.values),d&&(g=c.values),f&&(_=h.values);i=(a?p.length:m.length)/(a?3:2);let y=i,b=s&&a?2:1;b+=d||f?1:0,y*=b;const v=new Float32Array(y);let w=0;for(n=0;n<i;++n){s&&(Vt.fromArray(m,2*n,rd),v[w++]=js.compressTextureCoordinates(rd));const e=3*n;a&&Object(l.a)(g)&&Object(l.a)(_)?(O.fromArray(p,e,od),O.fromArray(g,e,ad),O.fromArray(_,e,sd),js.octPack(od,ad,sd,rd),v[w++]=rd.x,v[w++]=rd.y):(a&&(O.fromArray(p,e,od),v[w++]=js.octEncodeFloat(od)),d&&(O.fromArray(g,e,od),v[w++]=js.octEncodeFloat(od)),f&&(O.fromArray(_,e,od),v[w++]=js.octEncodeFloat(od)))}return e.attributes.compressedAttributes=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:b,values:v}),a&&delete e.attributes.normal,s&&delete e.attributes.st,f&&delete e.attributes.bitangent,d&&delete e.attributes.tangent,e};const hd=new O;function dd(e,t,n,i){O.add(e,O.multiplyByScalar(O.subtract(t,e,hd),e.y/(e.y-t.y),hd),n),O.clone(n,i),ud(n,!0),ud(i,!1)}const fd=new O,pd=new O,md=new O,gd=new O,_d={positions:new Array(7),indices:new Array(9)};function yd(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;!function(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return ud(e,e.y<0),ud(t,t.y<0),void ud(n,n.y<0);const i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y);let a;a=i>r?i>o?h.a.sign(e.y):h.a.sign(n.y):r>o?h.a.sign(t.y):h.a.sign(n.y);const s=a<0;ud(e,s),ud(t,s),ud(n,s)}(e,t,n);const i=e.y<0,r=t.y<0,o=n.y<0;let a=0;a+=i?1:0,a+=r?1:0,a+=o?1:0;const s=_d.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(dd(e,t,fd,md),dd(e,n,pd,gd),s[0]=0,s[3]=1,s[4]=2,s[6]=1):r?(dd(t,n,fd,md),dd(t,e,pd,gd),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(dd(n,e,fd,md),dd(n,t,pd,gd),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?r?o||(dd(n,e,fd,md),dd(n,t,pd,gd),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(dd(t,n,fd,md),dd(t,e,pd,gd),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(dd(e,t,fd,md),dd(e,n,pd,gd),s[0]=1,s[1]=2,s[3]=1,s[6]=0));const c=_d.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,1!==a&&2!==a||(c[3]=fd,c[4]=pd,c[5]=md,c[6]=gd,c.length=7),_d}function bd(e,t){const n=e.attributes;if(0===n.position.values.length)return;for(const e in n)if(n.hasOwnProperty(e)&&Object(l.a)(n[e])&&Object(l.a)(n[e].values)){const t=n[e];t.values=gs.createTypedArray(t.componentDatatype,t.values)}const i=Zl.computeNumberOfVertices(e);return e.indices=wc.createTypedArray(i,e.indices),t&&(e.boundingSphere=At.fromVertices(n.position.values)),e}function vd(e){const t=e.attributes,n={};for(const e in t)if(t.hasOwnProperty(e)&&Object(l.a)(t[e])&&Object(l.a)(t[e].values)){const i=t[e];n[e]=new $l({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new Zl({attributes:n,indices:[],primitiveType:e.primitiveType})}function Od(e,t,n){const i=Object(l.a)(e.geometry.boundingSphere);t=bd(t,i),n=bd(n,i),Object(l.a)(n)&&!Object(l.a)(t)?e.geometry=n:!Object(l.a)(n)&&Object(l.a)(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function wd(e,t){const n=new e,i=new e,r=new e;return function(o,a,s,c,l,u,h,d){const f=e.fromArray(l,o*t,n),p=e.fromArray(l,a*t,i),m=e.fromArray(l,s*t,r);e.multiplyByScalar(f,c.x,f),e.multiplyByScalar(p,c.y,p),e.multiplyByScalar(m,c.z,m);const g=e.add(f,p,f);e.add(g,m,g),d&&e.normalize(g,g),e.pack(g,u,h*t)}}const Ad=wd(_e,4),Ed=wd(O,3),Td=wd(Vt,2),Cd=new O,xd=new O,Sd=new O,Id=new O;function Pd(e,t,n,i,r,o,a,s,c,u,d,f,p,m,g,_){if(!(Object(l.a)(o)||Object(l.a)(a)||Object(l.a)(s)||Object(l.a)(c)||Object(l.a)(u)||0!==m))return;const y=O.fromArray(r,3*e,Cd),b=O.fromArray(r,3*t,xd),v=O.fromArray(r,3*n,Sd),w=Il(i,y,b,v,Id);if(Object(l.a)(w)){if(Object(l.a)(o)&&Ed(e,t,n,w,o,f.normal.values,_,!0),Object(l.a)(u)){const i=O.fromArray(u,3*e,Cd),r=O.fromArray(u,3*t,xd),o=O.fromArray(u,3*n,Sd);let a;O.multiplyByScalar(i,w.x,i),O.multiplyByScalar(r,w.y,r),O.multiplyByScalar(o,w.z,o),O.equals(i,O.ZERO)&&O.equals(r,O.ZERO)&&O.equals(o,O.ZERO)?(a=Cd,a.x=0,a.y=0,a.z=0):(a=O.add(i,r,i),O.add(a,o,a),O.normalize(a,a)),O.pack(a,f.extrudeDirection.values,3*_)}if(Object(l.a)(d)&&function(e,t,n,i,r,o,a){const s=r[e]*i.x,c=r[t]*i.y,l=r[n]*i.z;o[a]=s+c+l>h.a.EPSILON6?1:0}(e,t,n,w,d,f.applyOffset.values,_),Object(l.a)(a)&&Ed(e,t,n,w,a,f.tangent.values,_,!0),Object(l.a)(s)&&Ed(e,t,n,w,s,f.bitangent.values,_,!0),Object(l.a)(c)&&Td(e,t,n,w,c,f.st.values,_),m>0)for(let i=0;i<m;i++){const r=p[i];Dd(e,t,n,w,_,g[r],f[r])}}}function Dd(e,t,n,i,r,o,a){const s=o.componentsPerAttribute,c=o.values,l=a.values;switch(s){case 4:Ad(e,t,n,i,c,l,r,!1);break;case 3:Ed(e,t,n,i,c,l,r,!1);break;case 2:Td(e,t,n,i,c,l,r,!1);break;default:l[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Rd(e,t,n,i,r,o){const a=e.position.values.length/3;if(-1!==r){const s=i[r],c=n[s];return-1===c?(n[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}const jd={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Md(e){const t=e.geometry,n=t.attributes,i=n.position.values,r=Object(l.a)(n.normal)?n.normal.values:void 0,o=Object(l.a)(n.bitangent)?n.bitangent.values:void 0,a=Object(l.a)(n.tangent)?n.tangent.values:void 0,s=Object(l.a)(n.st)?n.st.values:void 0,c=Object(l.a)(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=Object(l.a)(n.applyOffset)?n.applyOffset.values:void 0,h=t.indices,d=[];for(const e in n)n.hasOwnProperty(e)&&!jd[e]&&Object(l.a)(n[e])&&d.push(e);const f=d.length,p=vd(t),m=vd(t);let g,_,y,b,v;const w=[];w.length=i.length/3;const A=[];for(A.length=i.length/3,v=0;v<w.length;++v)w[v]=-1,A[v]=-1;const E=h.length;for(v=0;v<E;v+=3){const e=h[v],t=h[v+1],E=h[v+2];let T=O.fromArray(i,3*e),C=O.fromArray(i,3*t),x=O.fromArray(i,3*E);const S=yd(T,C,x);if(Object(l.a)(S)&&S.positions.length>3){const l=S.positions,O=S.indices,T=O.length;for(let C=0;C<T;++C){const T=O[C],x=l[T];x.y<0?(g=m.attributes,_=m.indices,y=w):(g=p.attributes,_=p.indices,y=A),b=Rd(g,_,y,h,T<3?v+T:-1,x),Pd(e,t,E,x,i,r,a,o,s,c,u,g,d,f,n,b)}}else Object(l.a)(S)&&(T=S.positions[0],C=S.positions[1],x=S.positions[2]),T.y<0?(g=m.attributes,_=m.indices,y=w):(g=p.attributes,_=p.indices,y=A),b=Rd(g,_,y,h,v,T),Pd(e,t,E,T,i,r,a,o,s,c,u,g,d,f,n,b),b=Rd(g,_,y,h,v+1,C),Pd(e,t,E,C,i,r,a,o,s,c,u,g,d,f,n,b),b=Rd(g,_,y,h,v+2,x),Pd(e,t,E,x,i,r,a,o,s,c,u,g,d,f,n,b)}Od(e,m,p)}const Ld=xi.fromPointNormal(O.ZERO,O.UNIT_Y),Nd=new O,Bd=new O;function Fd(e,t,n,i,r,o,a){if(!Object(l.a)(a))return;const s=O.fromArray(i,3*e,Cd);O.equalsEpsilon(s,n,h.a.EPSILON10)?o.applyOffset.values[r]=a[e]:o.applyOffset.values[r]=a[t]}function zd(e){const t=e.geometry,n=t.attributes,i=n.position.values,r=Object(l.a)(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,a=vd(t),s=vd(t);let c;const u=o.length,d=[];d.length=i.length/3;const f=[];for(f.length=i.length/3,c=0;c<d.length;++c)d[c]=-1,f[c]=-1;for(c=0;c<u;c+=2){const e=o[c],t=o[c+1],n=O.fromArray(i,3*e,Cd),u=O.fromArray(i,3*t,xd);let p;Math.abs(n.y)<h.a.EPSILON6&&(n.y<0?n.y=-h.a.EPSILON6:n.y=h.a.EPSILON6),Math.abs(u.y)<h.a.EPSILON6&&(u.y<0?u.y=-h.a.EPSILON6:u.y=h.a.EPSILON6);let m=a.attributes,g=a.indices,_=f,y=s.attributes,b=s.indices,v=d;const w=vi.lineSegmentPlane(n,u,Ld,Sd);if(Object(l.a)(w)){const l=O.multiplyByScalar(O.UNIT_Y,5*h.a.EPSILON9,Nd);n.y<0&&(O.negate(l,l),m=s.attributes,g=s.indices,_=d,y=a.attributes,b=a.indices,v=f);const A=O.add(w,l,Bd);p=Rd(m,g,_,o,c,n),Fd(e,t,n,i,p,m,r),p=Rd(m,g,_,o,-1,A),Fd(e,t,A,i,p,m,r),O.negate(l,l),O.add(w,l,A),p=Rd(y,b,v,o,-1,A),Fd(e,t,A,i,p,y,r),p=Rd(y,b,v,o,c+1,u),Fd(e,t,u,i,p,y,r)}else{let l,h,m;n.y<0?(l=s.attributes,h=s.indices,m=d):(l=a.attributes,h=a.indices,m=f),p=Rd(l,h,m,o,c,n),Fd(e,t,n,i,p,l,r),p=Rd(l,h,m,o,c+1,u),Fd(e,t,u,i,p,l,r)}}Od(e,s,a)}const kd=new Vt,Ud=new Vt,Vd=new O,Hd=new O,Gd=new O,qd=new O,Wd=new O,Yd=new O,Xd=new _e;function Kd(e){const t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let e=0;e<o;e+=3){const t=O.unpack(n,e,Vd);if(t.x>0)continue;const a=O.unpack(i,e,Hd);(t.y<0&&a.y>0||t.y>0&&a.y<0)&&(e-3>0?(i[e]=n[e-3],i[e+1]=n[e-2],i[e+2]=n[e-1]):O.pack(t,i,e));const s=O.unpack(r,e,Gd);(t.y<0&&s.y>0||t.y>0&&s.y<0)&&(e+3<o?(r[e]=n[e+3],r[e+1]=n[e+4],r[e+2]=n[e+5]):O.pack(t,r,e))}}const Jd=5*h.a.EPSILON9,Zd=h.a.EPSILON6;Bh.splitLongitude=function(e){if(!Object(l.a)(e))throw new u.a("instance is required.");const t=e.geometry,n=t.boundingSphere;if(Object(l.a)(n)){if(n.center.x-n.radius>0||At.intersectPlane(n,xi.ORIGIN_ZX_PLANE)!==W.INTERSECTING)return e}if(t.geometryType!==Bl.NONE)switch(t.geometryType){case Bl.POLYLINES:!function(e){const t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,a=n.expandAndWidth.values,s=Object(l.a)(n.st)?n.st.values:void 0,c=Object(l.a)(n.color)?n.color.values:void 0,u=vd(t),d=vd(t);let f,p,m,g=!1;const _=i.length/3;for(f=0;f<_;f+=4){const e=f,t=f+2,n=O.fromArray(i,3*e,Vd),_=O.fromArray(i,3*t,Hd);if(Math.abs(n.y)<Zd)for(n.y=Zd*(_.y<0?-1:1),i[3*f+1]=n.y,i[3*(f+1)+1]=n.y,p=3*e;p<3*e+12;p+=3)r[p]=i[3*f],r[p+1]=i[3*f+1],r[p+2]=i[3*f+2];if(Math.abs(_.y)<Zd)for(_.y=Zd*(n.y<0?-1:1),i[3*(f+2)+1]=_.y,i[3*(f+3)+1]=_.y,p=3*e;p<3*e+12;p+=3)o[p]=i[3*(f+2)],o[p+1]=i[3*(f+2)+1],o[p+2]=i[3*(f+2)+2];let y=u.attributes,b=u.indices,v=d.attributes,w=d.indices;const A=vi.lineSegmentPlane(n,_,Ld,qd);if(Object(l.a)(A)){g=!0;const i=O.multiplyByScalar(O.UNIT_Y,Jd,Wd);n.y<0&&(O.negate(i,i),y=d.attributes,b=d.indices,v=u.attributes,w=u.indices);const E=O.add(A,i,Yd);y.position.values.push(n.x,n.y,n.z,n.x,n.y,n.z),y.position.values.push(E.x,E.y,E.z),y.position.values.push(E.x,E.y,E.z),y.prevPosition.values.push(r[3*e],r[3*e+1],r[3*e+2]),y.prevPosition.values.push(r[3*e+3],r[3*e+4],r[3*e+5]),y.prevPosition.values.push(n.x,n.y,n.z,n.x,n.y,n.z),y.nextPosition.values.push(E.x,E.y,E.z),y.nextPosition.values.push(E.x,E.y,E.z),y.nextPosition.values.push(E.x,E.y,E.z),y.nextPosition.values.push(E.x,E.y,E.z),O.negate(i,i),O.add(A,i,E),v.position.values.push(E.x,E.y,E.z),v.position.values.push(E.x,E.y,E.z),v.position.values.push(_.x,_.y,_.z,_.x,_.y,_.z),v.prevPosition.values.push(E.x,E.y,E.z),v.prevPosition.values.push(E.x,E.y,E.z),v.prevPosition.values.push(E.x,E.y,E.z),v.prevPosition.values.push(E.x,E.y,E.z),v.nextPosition.values.push(_.x,_.y,_.z,_.x,_.y,_.z),v.nextPosition.values.push(o[3*t],o[3*t+1],o[3*t+2]),v.nextPosition.values.push(o[3*t+3],o[3*t+4],o[3*t+5]);const T=Vt.fromArray(a,2*e,kd),C=Math.abs(T.y);y.expandAndWidth.values.push(-1,C,1,C),y.expandAndWidth.values.push(-1,-C,1,-C),v.expandAndWidth.values.push(-1,C,1,C),v.expandAndWidth.values.push(-1,-C,1,-C);let x=O.magnitudeSquared(O.subtract(A,n,Gd));if(x/=O.magnitudeSquared(O.subtract(_,n,Gd)),Object(l.a)(c)){const n=_e.fromArray(c,4*e,Xd),i=_e.fromArray(c,4*t,Xd),r=h.a.lerp(n.x,i.x,x),o=h.a.lerp(n.y,i.y,x),a=h.a.lerp(n.z,i.z,x),s=h.a.lerp(n.w,i.w,x);for(p=4*e;p<4*e+8;++p)y.color.values.push(c[p]);for(y.color.values.push(r,o,a,s),y.color.values.push(r,o,a,s),v.color.values.push(r,o,a,s),v.color.values.push(r,o,a,s),p=4*t;p<4*t+8;++p)v.color.values.push(c[p])}if(Object(l.a)(s)){const n=Vt.fromArray(s,2*e,kd),i=Vt.fromArray(s,2*(f+3),Ud),r=h.a.lerp(n.x,i.x,x);for(p=2*e;p<2*e+4;++p)y.st.values.push(s[p]);for(y.st.values.push(r,n.y),y.st.values.push(r,i.y),v.st.values.push(r,n.y),v.st.values.push(r,i.y),p=2*t;p<2*t+4;++p)v.st.values.push(s[p])}m=y.position.values.length/3-4,b.push(m,m+2,m+1),b.push(m+1,m+2,m+3),m=v.position.values.length/3-4,w.push(m,m+2,m+1),w.push(m+1,m+2,m+3)}else{let e,t;for(n.y<0?(e=d.attributes,t=d.indices):(e=u.attributes,t=u.indices),e.position.values.push(n.x,n.y,n.z),e.position.values.push(n.x,n.y,n.z),e.position.values.push(_.x,_.y,_.z),e.position.values.push(_.x,_.y,_.z),p=3*f;p<3*f+12;++p)e.prevPosition.values.push(r[p]),e.nextPosition.values.push(o[p]);for(p=2*f;p<2*f+8;++p)e.expandAndWidth.values.push(a[p]),Object(l.a)(s)&&e.st.values.push(s[p]);if(Object(l.a)(c))for(p=4*f;p<4*f+16;++p)e.color.values.push(c[p]);m=e.position.values.length/3-4,t.push(m,m+2,m+1),t.push(m+1,m+2,m+3)}}g&&(Kd(d),Kd(u)),Od(e,d,u)}(e);break;case Bl.TRIANGLES:Md(e);break;case Bl.LINES:zd(e)}else ld(t),t.primitiveType===zl.TRIANGLES?Md(e):t.primitiveType===zl.LINES&&zd(e);return e};var $d=Bh;const Qd=new O,ef=new O,tf=new O,nf=new O,rf=new Vt,of=new ce,af=new ce,sf=new To,cf=new O,lf=new O,uf=new O,hf=new R,df=new O,ff=new Vt,pf=new Vt;function mf(e,t,n){const i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,h=t.shadowVolume,d=i.st?new Float32Array(2*u):void 0,f=i.normal?new Float32Array(3*u):void 0,p=i.tangent?new Float32Array(3*u):void 0,m=i.bitangent?new Float32Array(3*u):void 0,g=h?new Float32Array(3*u):void 0;let _=0,y=cf,b=lf,v=uf;const w=new q(s),A=w.project(s.cartesianToCartographic(r,hf),df),E=s.scaleToGeodeticSurface(r,Qd);s.geodeticSurfaceNormal(E,E);let T=of,C=af;if(0!==c){let e=To.fromAxisAngle(E,c,sf);T=ce.fromQuaternion(e,T),e=To.fromAxisAngle(E,-c,sf),C=ce.fromQuaternion(e,C)}else T=ce.clone(ce.IDENTITY,T),C=ce.clone(ce.IDENTITY,C);const x=Vt.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ff),S=Vt.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pf);let I=e.length;const P=n?I:0,D=P/3*2;for(let t=0;t<I;t+=3){const r=t+1,c=t+2,l=O.fromArray(e,t,Qd);if(i.st){const e=ce.multiplyByVector(T,l,ef),t=w.project(s.cartesianToCartographic(e,hf),tf);O.subtract(t,A,t),rf.x=(t.x+o)/(2*o),rf.y=(t.y+a)/(2*a),x.x=Math.min(rf.x,x.x),x.y=Math.min(rf.y,x.y),S.x=Math.max(rf.x,S.x),S.y=Math.max(rf.y,S.y),n&&(d[_+D]=rf.x,d[_+1+D]=rf.y),d[_++]=rf.x,d[_++]=rf.y}(i.normal||i.tangent||i.bitangent||h)&&(y=s.geodeticSurfaceNormal(l,y),h&&(g[t+P]=-y.x,g[r+P]=-y.y,g[c+P]=-y.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(b=O.normalize(O.cross(O.UNIT_Z,y,b),b),ce.multiplyByVector(C,b,b)),i.normal&&(f[t]=y.x,f[r]=y.y,f[c]=y.z,n&&(f[t+P]=-y.x,f[r+P]=-y.y,f[c+P]=-y.z)),i.tangent&&(p[t]=b.x,p[r]=b.y,p[c]=b.z,n&&(p[t+P]=-b.x,p[r+P]=-b.y,p[c+P]=-b.z)),i.bitangent&&(v=O.normalize(O.cross(y,b,v),v),m[t]=v.x,m[r]=v.y,m[c]=v.z,n&&(m[t+P]=v.x,m[r+P]=v.y,m[c+P]=v.z))))}if(i.st){I=d.length;for(let e=0;e<I;e+=2)d[e]=(d[e]-x.x)/(S.x-x.x),d[e+1]=(d[e+1]-x.y)/(S.y-x.y)}const R=new Ql;if(i.position){const i=Ih.raisePositionsToHeight(e,t,n);R.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:i})}if(i.st&&(R.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(R.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:f})),i.tangent&&(R.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:p})),i.bitangent&&(R.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:m})),h&&(R.extrudeDirection=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:g})),n&&Object(l.a)(t.offsetAttribute)){let e=new Uint8Array(u);if(t.offsetAttribute===eu.TOP)e=e.fill(1,0,u/2);else{const n=t.offsetAttribute===eu.NONE?0:1;e=e.fill(n)}R.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return R}function gf(e){const t=new Array(e*(e+1)*12-6);let n,i,r,o,a,s=0;for(n=0,r=1,o=0;o<3;o++)t[s++]=r++,t[s++]=n,t[s++]=r;for(o=2;o<e+1;++o){for(r=o*(o+1)-1,n=(o-1)*o-1,t[s++]=r++,t[s++]=n,t[s++]=r,i=2*o,a=0;a<i-1;++a)t[s++]=r,t[s++]=n++,t[s++]=n,t[s++]=r++,t[s++]=n,t[s++]=r;t[s++]=r++,t[s++]=n,t[s++]=r}for(i=2*e,++r,++n,o=0;o<i-1;++o)t[s++]=r,t[s++]=n++,t[s++]=n,t[s++]=r++,t[s++]=n,t[s++]=r;for(t[s++]=r,t[s++]=n++,t[s++]=n,t[s++]=r++,t[s++]=n++,t[s++]=n,++n,o=e-1;o>1;--o){for(t[s++]=n++,t[s++]=n,t[s++]=r,i=2*o,a=0;a<i-1;++a)t[s++]=r,t[s++]=n++,t[s++]=n,t[s++]=r++,t[s++]=n,t[s++]=r;t[s++]=n++,t[s++]=n++,t[s++]=r++}for(o=0;o<3;o++)t[s++]=n++,t[s++]=n,t[s++]=r;return t}let _f=new O;const yf=new At,bf=new At;function vf(e){const t=e.center,n=e.ellipsoid,i=e.semiMajorAxis;let r=O.multiplyByScalar(n.geodeticSurfaceNormal(t,Qd),e.height,Qd);yf.center=O.add(t,r,yf.center),yf.radius=i,r=O.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),bf.center=O.add(t,r,bf.center),bf.radius=i;const o=Ih.computeEllipsePositions(e,!0,!0),a=o.positions,s=o.numPts,c=o.outerPositions,u=At.union(yf,bf),h=mf(a,e,!0);let d=gf(s);const f=d.length;d.length=2*f;const p=a.length/3;for(let e=0;e<f;e+=3)d[e+f]=d[e+2]+p,d[e+1+f]=d[e+1]+p,d[e+2+f]=d[e]+p;const m=wc.createTypedArray(2*p/3,d),g=new Zl({attributes:h,indices:m,primitiveType:zl.TRIANGLES}),_=function(e,t){const n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,a=t.ellipsoid,s=t.height,c=t.extrudedHeight,u=t.stRotation,h=e.length/3*2,d=new Float64Array(3*h),f=n.st?new Float32Array(2*h):void 0,p=n.normal?new Float32Array(3*h):void 0,m=n.tangent?new Float32Array(3*h):void 0,g=n.bitangent?new Float32Array(3*h):void 0,_=t.shadowVolume,y=_?new Float32Array(3*h):void 0;let b=0,v=cf,w=lf,A=uf;const E=new q(a),T=E.project(a.cartesianToCartographic(i,hf),df),C=a.scaleToGeodeticSurface(i,Qd);a.geodeticSurfaceNormal(C,C);const x=To.fromAxisAngle(C,u,sf),S=ce.fromQuaternion(x,of),I=Vt.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,ff),P=Vt.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,pf);let D=e.length;const R=D/3*2;for(let t=0;t<D;t+=3){const i=t+1,l=t+2;let u,h=O.fromArray(e,t,Qd);if(n.st){const e=ce.multiplyByVector(S,h,ef),t=E.project(a.cartesianToCartographic(e,hf),tf);O.subtract(t,T,t),rf.x=(t.x+r)/(2*r),rf.y=(t.y+o)/(2*o),I.x=Math.min(rf.x,I.x),I.y=Math.min(rf.y,I.y),P.x=Math.max(rf.x,P.x),P.y=Math.max(rf.y,P.y),f[b+R]=rf.x,f[b+1+R]=rf.y,f[b++]=rf.x,f[b++]=rf.y}h=a.scaleToGeodeticSurface(h,h),u=O.clone(h,ef),v=a.geodeticSurfaceNormal(h,v),_&&(y[t+D]=-v.x,y[i+D]=-v.y,y[l+D]=-v.z);let C=O.multiplyByScalar(v,s,nf);if(h=O.add(h,C,h),C=O.multiplyByScalar(v,c,C),u=O.add(u,C,u),n.position&&(d[t+D]=u.x,d[i+D]=u.y,d[l+D]=u.z,d[t]=h.x,d[i]=h.y,d[l]=h.z),n.normal||n.tangent||n.bitangent){A=O.clone(v,A);const r=O.fromArray(e,(t+3)%D,nf);O.subtract(r,h,r);const o=O.subtract(u,h,tf);v=O.normalize(O.cross(o,r,v),v),n.normal&&(p[t]=v.x,p[i]=v.y,p[l]=v.z,p[t+D]=v.x,p[i+D]=v.y,p[l+D]=v.z),n.tangent&&(w=O.normalize(O.cross(A,v,w),w),m[t]=w.x,m[i]=w.y,m[l]=w.z,m[t+D]=w.x,m[t+1+D]=w.y,m[t+2+D]=w.z),n.bitangent&&(g[t]=A.x,g[i]=A.y,g[l]=A.z,g[t+D]=A.x,g[i+D]=A.y,g[l+D]=A.z)}}if(n.st){D=f.length;for(let e=0;e<D;e+=2)f[e]=(f[e]-I.x)/(P.x-I.x),f[e+1]=(f[e+1]-I.y)/(P.y-I.y)}const j=new Ql;if(n.position&&(j.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(j.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:f})),n.normal&&(j.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:p})),n.tangent&&(j.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(j.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:g})),_&&(j.extrudeDirection=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:y})),Object(l.a)(t.offsetAttribute)){let e=new Uint8Array(h);if(t.offsetAttribute===eu.TOP)e=e.fill(1,0,h/2);else{const n=t.offsetAttribute===eu.NONE?0:1;e=e.fill(n)}j.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:e})}return j}(c,e);d=function(e){const t=e.length/3,n=wc.createTypedArray(t,6*t);let i=0;for(let e=0;e<t;e++){const r=e,o=e+t,a=(r+1)%t,s=a+t;n[i++]=r,n[i++]=o,n[i++]=a,n[i++]=a,n[i++]=o,n[i++]=s}return n}(c);const y=wc.createTypedArray(2*c.length/3,d),b=new Zl({attributes:_,indices:y,primitiveType:zl.TRIANGLES}),v=$d.combineInstances([new Ph({geometry:g}),new Ph({geometry:b})]);return{boundingSphere:u,attributes:v[0].attributes,indices:v[0].indices}}function Of(e,t,n,i,r,o,a){const s=Ih.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,c=s.length/3,l=new Array(c);for(let e=0;e<c;++e)l[e]=O.fromArray(s,3*e);const u=Be.fromCartesianArray(l,o,a);return u.width>h.a.PI&&(u.north=u.north>0?h.a.PI_OVER_TWO-h.a.EPSILON7:u.north,u.south=u.south<0?h.a.EPSILON7-h.a.PI_OVER_TWO:u.south,u.east=h.a.PI,u.west=-h.a.PI),u}function wf(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).center,n=Object(c.a)(e.ellipsoid,H.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),a=Object(c.a)(e.vertexFormat,nu.DEFAULT);if(s.a.defined("options.center",t),s.a.typeOf.number("options.semiMajorAxis",i),s.a.typeOf.number("options.semiMinorAxis",r),i<r)throw new u.a("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(o<=0)throw new u.a("granularity must be greater than zero.");const l=Object(c.a)(e.height,0),d=Object(c.a)(e.extrudedHeight,l);this._center=O.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=H.clone(n),this._rotation=Object(c.a)(e.rotation,0),this._stRotation=Object(c.a)(e.stRotation,0),this._height=Math.max(d,l),this._granularity=o,this._vertexFormat=nu.clone(a),this._extrudedHeight=Math.min(d,l),this._shadowVolume=Object(c.a)(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}wf.packedLength=O.packedLength+H.packedLength+nu.packedLength+9,wf.pack=function(e,t,n){return s.a.defined("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),O.pack(e._center,t,n),n+=O.packedLength,H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Af=new O,Ef=new H,Tf=new nu,Cf={center:Af,ellipsoid:Ef,vertexFormat:Tf,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};wf.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=O.unpack(e,t,Af);t+=O.packedLength;const r=H.unpack(e,t,Ef);t+=H.packedLength;const o=nu.unpack(e,t,Tf);t+=nu.packedLength;const a=e[t++],u=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=e[t++],g=1===e[t++],_=e[t];return Object(l.a)(n)?(n._center=O.clone(i,n._center),n._ellipsoid=H.clone(r,n._ellipsoid),n._vertexFormat=nu.clone(o,n._vertexFormat),n._semiMajorAxis=a,n._semiMinorAxis=u,n._rotation=h,n._stRotation=d,n._height=f,n._granularity=p,n._extrudedHeight=m,n._shadowVolume=g,n._offsetAttribute=-1===_?void 0:_,n):(Cf.height=f,Cf.extrudedHeight=m,Cf.granularity=p,Cf.stRotation=d,Cf.rotation=h,Cf.semiMajorAxis=a,Cf.semiMinorAxis=u,Cf.shadowVolume=g,Cf.offsetAttribute=-1===_?void 0:_,new wf(Cf))},wf.computeRectangle=function(e,t){const n=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).center,i=Object(c.a)(e.ellipsoid,H.WGS84),r=e.semiMajorAxis,o=e.semiMinorAxis,a=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),l=Object(c.a)(e.rotation,0);if(s.a.defined("options.center",n),s.a.typeOf.number("options.semiMajorAxis",r),s.a.typeOf.number("options.semiMinorAxis",o),r<o)throw new u.a("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(a<=0)throw new u.a("granularity must be greater than zero.");return Of(n,r,o,l,a,i,t)},wf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;const t=e._height,n=e._extrudedHeight,i=!h.a.equalsEpsilon(t,n,0,h.a.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);const r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};let o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=vf(r);else if(o=function(e){const t=e.center;_f=O.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,_f),e.height,_f),_f=O.add(t,_f,_f);const n=new At(_f,e.semiMajorAxis),i=Ih.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,a=mf(r,e,!1);let s=gf(o);return s=wc.createTypedArray(r.length/3,s),{boundingSphere:n,attributes:a,indices:s}}(r),Object(l.a)(e._offsetAttribute)){const t=o.attributes.position.values.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);o.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:o.attributes,indices:o.indices,primitiveType:zl.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})},wf.createShadowVolume=function(e,t,n){const i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new wf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:nu.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(wf.prototype,{rectangle:{get:function(){return Object(l.a)(this._rectangle)||(this._rectangle=Of(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Object(l.a)(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){const t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];const n=Ih.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,i=n.length/3,r=new Array(i);for(let e=0;e<i;++e)r[e]=O.fromArray(n,3*e);const o=e._ellipsoid,a=e.rectangle;return Zl._textureCoordinateRotationPoints(r,t,o,a)}(this)),this._textureCoordinateRotationPoints}}});var xf=wf;function Sf(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).radius;s.a.typeOf.number("radius",t);const n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new xf(n),this._workerName="createCircleGeometry"}Sf.packedLength=xf.packedLength,Sf.pack=function(e,t,n){return s.a.typeOf.object("value",e),xf.pack(e._ellipseGeometry,t,n)};const If=new xf({center:new O,semiMajorAxis:1,semiMinorAxis:1}),Pf={center:new O,radius:void 0,ellipsoid:H.clone(H.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new nu,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};Sf.unpack=function(e,t,n){const i=xf.unpack(e,t,If);return Pf.center=O.clone(i._center,Pf.center),Pf.ellipsoid=H.clone(i._ellipsoid,Pf.ellipsoid),Pf.height=i._height,Pf.extrudedHeight=i._extrudedHeight,Pf.granularity=i._granularity,Pf.vertexFormat=nu.clone(i._vertexFormat,Pf.vertexFormat),Pf.stRotation=i._stRotation,Pf.shadowVolume=i._shadowVolume,Object(l.a)(n)?(Pf.semiMajorAxis=i._semiMajorAxis,Pf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new xf(Pf),n):(Pf.radius=i._semiMajorAxis,new Sf(Pf))},Sf.createGeometry=function(e){return xf.createGeometry(e._ellipseGeometry)},Sf.createShadowVolume=function(e,t,n){const i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),a=n(i,r);return new Sf({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:nu.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(Sf.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Df=Sf;const Rf=new O;let jf=new O;const Mf=new At,Lf=new At;function Nf(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).center,n=Object(c.a)(e.ellipsoid,H.WGS84),i=e.semiMajorAxis,r=e.semiMinorAxis,o=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE);if(!Object(l.a)(t))throw new u.a("center is required.");if(!Object(l.a)(i))throw new u.a("semiMajorAxis is required.");if(!Object(l.a)(r))throw new u.a("semiMinorAxis is required.");if(i<r)throw new u.a("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(o<=0)throw new u.a("granularity must be greater than zero.");const a=Object(c.a)(e.height,0),s=Object(c.a)(e.extrudedHeight,a);this._center=O.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=H.clone(n),this._rotation=Object(c.a)(e.rotation,0),this._height=Math.max(s,a),this._granularity=o,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max(Object(c.a)(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}Nf.packedLength=O.packedLength+H.packedLength+8,Nf.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),O.pack(e._center,t,n),n+=O.packedLength,H.pack(e._ellipsoid,t,n),n+=H.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Bf=new O,Ff=new H,zf={center:Bf,ellipsoid:Ff,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Nf.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");t=Object(c.a)(t,0);const i=O.unpack(e,t,Bf);t+=O.packedLength;const r=H.unpack(e,t,Ff);t+=H.packedLength;const o=e[t++],a=e[t++],s=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=e[t];return Object(l.a)(n)?(n._center=O.clone(i,n._center),n._ellipsoid=H.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=a,n._rotation=s,n._height=h,n._granularity=d,n._extrudedHeight=f,n._numberOfVerticalLines=p,n._offsetAttribute=-1===m?void 0:m,n):(zf.height=h,zf.extrudedHeight=f,zf.granularity=d,zf.rotation=s,zf.semiMajorAxis=o,zf.semiMinorAxis=a,zf.numberOfVerticalLines=p,zf.offsetAttribute=-1===m?void 0:m,new Nf(zf))},Nf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;const t=e._height,n=e._extrudedHeight,i=!h.a.equalsEpsilon(t,n,0,h.a.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);const r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};let o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=function(e){const t=e.center,n=e.ellipsoid,i=e.semiMajorAxis;let r=O.multiplyByScalar(n.geodeticSurfaceNormal(t,Rf),e.height,Rf);Mf.center=O.add(t,r,Mf.center),Mf.radius=i,r=O.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),Lf.center=O.add(t,r,Lf.center),Lf.radius=i;let o=Ih.computeEllipsePositions(e,!1,!0).outerPositions;const a=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:Ih.raisePositionsToHeight(o,e,!0)})});o=a.position.values;const s=At.union(Mf,Lf);let u=o.length/3;if(Object(l.a)(e.offsetAttribute)){let t=new Uint8Array(u);if(e.offsetAttribute===eu.TOP)t=t.fill(1,0,u/2);else{const n=e.offsetAttribute===eu.NONE?0:1;t=t.fill(n)}a.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let d=Object(c.a)(e.numberOfVerticalLines,16);d=h.a.clamp(d,0,u/2);const f=wc.createTypedArray(u,2*u+2*d);u/=2;let p,m,g=0;for(p=0;p<u;++p)f[g++]=p,f[g++]=(p+1)%u,f[g++]=p+u,f[g++]=(p+1)%u+u;if(d>0){const e=Math.min(d,u);m=Math.round(u/e);const t=Math.min(m*d,u);for(p=0;p<t;p+=m)f[g++]=p,f[g++]=p+u}return{boundingSphere:s,attributes:a,indices:f}}(r);else if(o=function(e){const t=e.center;jf=O.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,jf),e.height,jf),jf=O.add(t,jf,jf);const n=new At(jf,e.semiMajorAxis),i=Ih.computeEllipsePositions(e,!1,!0).outerPositions,r=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:Ih.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,a=wc.createTypedArray(o,2*o);let s=0;for(let e=0;e<o;++e)a[s++]=e,a[s++]=(e+1)%o;return{boundingSphere:n,attributes:r,indices:a}}(r),Object(l.a)(e._offsetAttribute)){const t=o.attributes.position.values.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);o.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:o.attributes,indices:o.indices,primitiveType:zl.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var kf=Nf;function Uf(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).radius;s.a.typeOf.number("radius",t);const n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new kf(n),this._workerName="createCircleOutlineGeometry"}Uf.packedLength=kf.packedLength,Uf.pack=function(e,t,n){return s.a.typeOf.object("value",e),kf.pack(e._ellipseGeometry,t,n)};const Vf=new kf({center:new O,semiMajorAxis:1,semiMinorAxis:1}),Hf={center:new O,radius:void 0,ellipsoid:H.clone(H.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};Uf.unpack=function(e,t,n){const i=kf.unpack(e,t,Vf);return Hf.center=O.clone(i._center,Hf.center),Hf.ellipsoid=H.clone(i._ellipsoid,Hf.ellipsoid),Hf.height=i._height,Hf.extrudedHeight=i._extrudedHeight,Hf.granularity=i._granularity,Hf.numberOfVerticalLines=i._numberOfVerticalLines,Object(l.a)(n)?(Hf.semiMajorAxis=i._semiMajorAxis,Hf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new kf(Hf),n):(Hf.radius=i._semiMajorAxis,new Uf(Hf))},Uf.createGeometry=function(e){return kf.createGeometry(e._ellipseGeometry)};var Gf=Uf;var qf=Object.freeze({UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2});var Wf=Object.freeze({TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2});let Yf;Yf="undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};var Xf=Yf;function Kf(e){let t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).currentTime,n=e.startTime,i=e.stopTime;if(t=Object(l.a)(t)?tr.clone(t):Object(l.a)(n)?tr.clone(n):Object(l.a)(i)?tr.addDays(i,-1,new tr):tr.now(),n=Object(l.a)(n)?tr.clone(n):tr.clone(t),i=Object(l.a)(i)?tr.clone(i):tr.addDays(n,1,new tr),tr.greaterThan(n,i))throw new u.a("startTime must come before stopTime.");this.startTime=n,this.stopTime=i,this.clockRange=Object(c.a)(e.clockRange,qf.UNBOUNDED),this.canAnimate=Object(c.a)(e.canAnimate,!0),this.onTick=new un.a,this.onStop=new un.a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Xf(),this.currentTime=t,this.multiplier=Object(c.a)(e.multiplier,1),this.shouldAnimate=Object(c.a)(e.shouldAnimate,!1),this.clockStep=Object(c.a)(e.clockStep,Wf.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(Kf.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){tr.equals(this._currentTime,e)||(this._clockStep===Wf.SYSTEM_CLOCK&&(this._clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Wf.SYSTEM_CLOCK&&(this._clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Wf.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=tr.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Wf.SYSTEM_CLOCK&&(this._clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),Kf.prototype.tick=function(){const e=Xf();let t=tr.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){const n=this._clockStep;if(n===Wf.SYSTEM_CLOCK)t=tr.now(t);else{const i=this._multiplier;if(n===Wf.TICK_DEPENDENT)t=tr.addSeconds(t,i,t);else{const n=e-this._lastSystemTime;t=tr.addSeconds(t,i*(n/1e3),t)}const r=this.clockRange,o=this.startTime,a=this.stopTime;if(r===qf.CLAMPED)tr.lessThan(t,o)?t=tr.clone(o,t):tr.greaterThan(t,a)&&(t=tr.clone(a,t),this.onStop.raiseEvent(this));else if(r===qf.LOOP_STOP)for(tr.lessThan(t,o)&&(t=tr.clone(o,t));tr.greaterThan(t,a);)t=tr.addSeconds(o,tr.secondsDifference(t,a),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Jf=Kf,Zf=n(8);function $f(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+6*(t-e)*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function Qf(e,t,n,i){this.red=Object(c.a)(e,1),this.green=Object(c.a)(t,1),this.blue=Object(c.a)(n,1),this.alpha=Object(c.a)(i,1)}let ep,tp,np;Qf.fromCartesian4=function(e,t){return s.a.typeOf.object("cartesian",e),Object(l.a)(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new Qf(e.x,e.y,e.z,e.w)},Qf.fromBytes=function(e,t,n,i,r){return e=Qf.byteToFloat(Object(c.a)(e,255)),t=Qf.byteToFloat(Object(c.a)(t,255)),n=Qf.byteToFloat(Object(c.a)(n,255)),i=Qf.byteToFloat(Object(c.a)(i,255)),Object(l.a)(r)?(r.red=e,r.green=t,r.blue=n,r.alpha=i,r):new Qf(e,t,n,i)},Qf.fromAlpha=function(e,t,n){return s.a.typeOf.object("color",e),s.a.typeOf.number("alpha",t),Object(l.a)(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new Qf(e.red,e.green,e.blue,t)},Jr.supportsTypedArrays()&&(ep=new ArrayBuffer(4),tp=new Uint32Array(ep),np=new Uint8Array(ep)),Qf.fromRgba=function(e,t){return tp[0]=e,Qf.fromBytes(np[0],np[1],np[2],np[3],t)},Qf.fromHsl=function(e,t,n,i,r){e=Object(c.a)(e,0)%1,t=Object(c.a)(t,0),n=Object(c.a)(n,0),i=Object(c.a)(i,1);let o=n,a=n,s=n;if(0!==t){let i;i=n<.5?n*(1+t):n+t-n*t;const r=2*n-i;o=$f(r,i,e+1/3),a=$f(r,i,e),s=$f(r,i,e-1/3)}return Object(l.a)(r)?(r.red=o,r.green=a,r.blue=s,r.alpha=i,r):new Qf(o,a,s,i)},Qf.fromRandom=function(e,t){let n=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).red;if(!Object(l.a)(n)){const t=Object(c.a)(e.minimumRed,0),i=Object(c.a)(e.maximumRed,1);s.a.typeOf.number.lessThanOrEquals("minimumRed",t,i),n=t+h.a.nextRandomNumber()*(i-t)}let i=e.green;if(!Object(l.a)(i)){const t=Object(c.a)(e.minimumGreen,0),n=Object(c.a)(e.maximumGreen,1);s.a.typeOf.number.lessThanOrEquals("minimumGreen",t,n),i=t+h.a.nextRandomNumber()*(n-t)}let r=e.blue;if(!Object(l.a)(r)){const t=Object(c.a)(e.minimumBlue,0),n=Object(c.a)(e.maximumBlue,1);s.a.typeOf.number.lessThanOrEquals("minimumBlue",t,n),r=t+h.a.nextRandomNumber()*(n-t)}let o=e.alpha;if(!Object(l.a)(o)){const t=Object(c.a)(e.minimumAlpha,0),n=Object(c.a)(e.maximumAlpha,1);s.a.typeOf.number.lessThanOrEquals("minumumAlpha",t,n),o=t+h.a.nextRandomNumber()*(n-t)}return Object(l.a)(t)?(t.red=n,t.green=i,t.blue=r,t.alpha=o,t):new Qf(n,i,r,o)};const ip=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,rp=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,op=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,ap=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;Qf.fromCssColorString=function(e,t){s.a.typeOf.string("color",e),Object(l.a)(t)||(t=new Qf);const n=Qf[(e=e.replace(/\s/g,"")).toUpperCase()];if(Object(l.a)(n))return Qf.clone(n,t),t;let i=ip.exec(e);return null!==i?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(Object(c.a)(i[4],"f"),16)/15,t):(i=rp.exec(e),null!==i?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(Object(c.a)(i[4],"ff"),16)/255,t):(i=op.exec(e),null!==i?(t.red=parseFloat(i[1])/("%"===i[1].substr(-1)?100:255),t.green=parseFloat(i[2])/("%"===i[2].substr(-1)?100:255),t.blue=parseFloat(i[3])/("%"===i[3].substr(-1)?100:255),t.alpha=parseFloat(Object(c.a)(i[4],"1.0")),t):(i=ap.exec(e),null!==i?Qf.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(Object(c.a)(i[4],"1.0")),t):t=void 0)))},Qf.packedLength=4,Qf.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t},Qf.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Qf),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},Qf.byteToFloat=function(e){return e/255},Qf.floatToByte=function(e){return 1===e?255:256*e|0},Qf.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new Qf(e.red,e.green,e.blue,e.alpha)},Qf.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},Qf.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]},Qf.prototype.clone=function(e){return Qf.clone(this,e)},Qf.prototype.equals=function(e){return Qf.equals(this,e)},Qf.prototype.equalsEpsilon=function(e,t){return this===e||Object(l.a)(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},Qf.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},Qf.prototype.toCssColorString=function(){const e=Qf.floatToByte(this.red),t=Qf.floatToByte(this.green),n=Qf.floatToByte(this.blue);return 1===this.alpha?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},Qf.prototype.toCssHexString=function(){let e=Qf.floatToByte(this.red).toString(16);e.length<2&&(e="0"+e);let t=Qf.floatToByte(this.green).toString(16);t.length<2&&(t="0"+t);let n=Qf.floatToByte(this.blue).toString(16);if(n.length<2&&(n="0"+n),this.alpha<1){let i=Qf.floatToByte(this.alpha).toString(16);return i.length<2&&(i="0"+i),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},Qf.prototype.toBytes=function(e){const t=Qf.floatToByte(this.red),n=Qf.floatToByte(this.green),i=Qf.floatToByte(this.blue),r=Qf.floatToByte(this.alpha);return Object(l.a)(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]},Qf.prototype.toRgba=function(){return np[0]=Qf.floatToByte(this.red),np[1]=Qf.floatToByte(this.green),np[2]=Qf.floatToByte(this.blue),np[3]=Qf.floatToByte(this.alpha),tp[0]},Qf.prototype.brighten=function(e,t){return s.a.typeOf.number("magnitude",e),s.a.typeOf.number.greaterThanOrEquals("magnitude",e,0),s.a.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},Qf.prototype.darken=function(e,t){return s.a.typeOf.number("magnitude",e),s.a.typeOf.number.greaterThanOrEquals("magnitude",e,0),s.a.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},Qf.prototype.withAlpha=function(e,t){return Qf.fromAlpha(this,e,t)},Qf.add=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n},Qf.subtract=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n},Qf.multiply=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n},Qf.divide=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n},Qf.mod=function(e,t,n){return s.a.typeOf.object("left",e),s.a.typeOf.object("right",t),s.a.typeOf.object("result",n),n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n},Qf.lerp=function(e,t,n,i){return s.a.typeOf.object("start",e),s.a.typeOf.object("end",t),s.a.typeOf.number("t",n),s.a.typeOf.object("result",i),i.red=h.a.lerp(e.red,t.red,n),i.green=h.a.lerp(e.green,t.green,n),i.blue=h.a.lerp(e.blue,t.blue,n),i.alpha=h.a.lerp(e.alpha,t.alpha,n),i},Qf.multiplyByScalar=function(e,t,n){return s.a.typeOf.object("color",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n},Qf.divideByScalar=function(e,t,n){return s.a.typeOf.object("color",e),s.a.typeOf.number("scalar",t),s.a.typeOf.object("result",n),n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n},Qf.ALICEBLUE=Object.freeze(Qf.fromCssColorString("#F0F8FF")),Qf.ANTIQUEWHITE=Object.freeze(Qf.fromCssColorString("#FAEBD7")),Qf.AQUA=Object.freeze(Qf.fromCssColorString("#00FFFF")),Qf.AQUAMARINE=Object.freeze(Qf.fromCssColorString("#7FFFD4")),Qf.AZURE=Object.freeze(Qf.fromCssColorString("#F0FFFF")),Qf.BEIGE=Object.freeze(Qf.fromCssColorString("#F5F5DC")),Qf.BISQUE=Object.freeze(Qf.fromCssColorString("#FFE4C4")),Qf.BLACK=Object.freeze(Qf.fromCssColorString("#000000")),Qf.BLANCHEDALMOND=Object.freeze(Qf.fromCssColorString("#FFEBCD")),Qf.BLUE=Object.freeze(Qf.fromCssColorString("#0000FF")),Qf.BLUEVIOLET=Object.freeze(Qf.fromCssColorString("#8A2BE2")),Qf.BROWN=Object.freeze(Qf.fromCssColorString("#A52A2A")),Qf.BURLYWOOD=Object.freeze(Qf.fromCssColorString("#DEB887")),Qf.CADETBLUE=Object.freeze(Qf.fromCssColorString("#5F9EA0")),Qf.CHARTREUSE=Object.freeze(Qf.fromCssColorString("#7FFF00")),Qf.CHOCOLATE=Object.freeze(Qf.fromCssColorString("#D2691E")),Qf.CORAL=Object.freeze(Qf.fromCssColorString("#FF7F50")),Qf.CORNFLOWERBLUE=Object.freeze(Qf.fromCssColorString("#6495ED")),Qf.CORNSILK=Object.freeze(Qf.fromCssColorString("#FFF8DC")),Qf.CRIMSON=Object.freeze(Qf.fromCssColorString("#DC143C")),Qf.CYAN=Object.freeze(Qf.fromCssColorString("#00FFFF")),Qf.DARKBLUE=Object.freeze(Qf.fromCssColorString("#00008B")),Qf.DARKCYAN=Object.freeze(Qf.fromCssColorString("#008B8B")),Qf.DARKGOLDENROD=Object.freeze(Qf.fromCssColorString("#B8860B")),Qf.DARKGRAY=Object.freeze(Qf.fromCssColorString("#A9A9A9")),Qf.DARKGREEN=Object.freeze(Qf.fromCssColorString("#006400")),Qf.DARKGREY=Qf.DARKGRAY,Qf.DARKKHAKI=Object.freeze(Qf.fromCssColorString("#BDB76B")),Qf.DARKMAGENTA=Object.freeze(Qf.fromCssColorString("#8B008B")),Qf.DARKOLIVEGREEN=Object.freeze(Qf.fromCssColorString("#556B2F")),Qf.DARKORANGE=Object.freeze(Qf.fromCssColorString("#FF8C00")),Qf.DARKORCHID=Object.freeze(Qf.fromCssColorString("#9932CC")),Qf.DARKRED=Object.freeze(Qf.fromCssColorString("#8B0000")),Qf.DARKSALMON=Object.freeze(Qf.fromCssColorString("#E9967A")),Qf.DARKSEAGREEN=Object.freeze(Qf.fromCssColorString("#8FBC8F")),Qf.DARKSLATEBLUE=Object.freeze(Qf.fromCssColorString("#483D8B")),Qf.DARKSLATEGRAY=Object.freeze(Qf.fromCssColorString("#2F4F4F")),Qf.DARKSLATEGREY=Qf.DARKSLATEGRAY,Qf.DARKTURQUOISE=Object.freeze(Qf.fromCssColorString("#00CED1")),Qf.DARKVIOLET=Object.freeze(Qf.fromCssColorString("#9400D3")),Qf.DEEPPINK=Object.freeze(Qf.fromCssColorString("#FF1493")),Qf.DEEPSKYBLUE=Object.freeze(Qf.fromCssColorString("#00BFFF")),Qf.DIMGRAY=Object.freeze(Qf.fromCssColorString("#696969")),Qf.DIMGREY=Qf.DIMGRAY,Qf.DODGERBLUE=Object.freeze(Qf.fromCssColorString("#1E90FF")),Qf.FIREBRICK=Object.freeze(Qf.fromCssColorString("#B22222")),Qf.FLORALWHITE=Object.freeze(Qf.fromCssColorString("#FFFAF0")),Qf.FORESTGREEN=Object.freeze(Qf.fromCssColorString("#228B22")),Qf.FUCHSIA=Object.freeze(Qf.fromCssColorString("#FF00FF")),Qf.GAINSBORO=Object.freeze(Qf.fromCssColorString("#DCDCDC")),Qf.GHOSTWHITE=Object.freeze(Qf.fromCssColorString("#F8F8FF")),Qf.GOLD=Object.freeze(Qf.fromCssColorString("#FFD700")),Qf.GOLDENROD=Object.freeze(Qf.fromCssColorString("#DAA520")),Qf.GRAY=Object.freeze(Qf.fromCssColorString("#808080")),Qf.GREEN=Object.freeze(Qf.fromCssColorString("#008000")),Qf.GREENYELLOW=Object.freeze(Qf.fromCssColorString("#ADFF2F")),Qf.GREY=Qf.GRAY,Qf.HONEYDEW=Object.freeze(Qf.fromCssColorString("#F0FFF0")),Qf.HOTPINK=Object.freeze(Qf.fromCssColorString("#FF69B4")),Qf.INDIANRED=Object.freeze(Qf.fromCssColorString("#CD5C5C")),Qf.INDIGO=Object.freeze(Qf.fromCssColorString("#4B0082")),Qf.IVORY=Object.freeze(Qf.fromCssColorString("#FFFFF0")),Qf.KHAKI=Object.freeze(Qf.fromCssColorString("#F0E68C")),Qf.LAVENDER=Object.freeze(Qf.fromCssColorString("#E6E6FA")),Qf.LAVENDAR_BLUSH=Object.freeze(Qf.fromCssColorString("#FFF0F5")),Qf.LAWNGREEN=Object.freeze(Qf.fromCssColorString("#7CFC00")),Qf.LEMONCHIFFON=Object.freeze(Qf.fromCssColorString("#FFFACD")),Qf.LIGHTBLUE=Object.freeze(Qf.fromCssColorString("#ADD8E6")),Qf.LIGHTCORAL=Object.freeze(Qf.fromCssColorString("#F08080")),Qf.LIGHTCYAN=Object.freeze(Qf.fromCssColorString("#E0FFFF")),Qf.LIGHTGOLDENRODYELLOW=Object.freeze(Qf.fromCssColorString("#FAFAD2")),Qf.LIGHTGRAY=Object.freeze(Qf.fromCssColorString("#D3D3D3")),Qf.LIGHTGREEN=Object.freeze(Qf.fromCssColorString("#90EE90")),Qf.LIGHTGREY=Qf.LIGHTGRAY,Qf.LIGHTPINK=Object.freeze(Qf.fromCssColorString("#FFB6C1")),Qf.LIGHTSEAGREEN=Object.freeze(Qf.fromCssColorString("#20B2AA")),Qf.LIGHTSKYBLUE=Object.freeze(Qf.fromCssColorString("#87CEFA")),Qf.LIGHTSLATEGRAY=Object.freeze(Qf.fromCssColorString("#778899")),Qf.LIGHTSLATEGREY=Qf.LIGHTSLATEGRAY,Qf.LIGHTSTEELBLUE=Object.freeze(Qf.fromCssColorString("#B0C4DE")),Qf.LIGHTYELLOW=Object.freeze(Qf.fromCssColorString("#FFFFE0")),Qf.LIME=Object.freeze(Qf.fromCssColorString("#00FF00")),Qf.LIMEGREEN=Object.freeze(Qf.fromCssColorString("#32CD32")),Qf.LINEN=Object.freeze(Qf.fromCssColorString("#FAF0E6")),Qf.MAGENTA=Object.freeze(Qf.fromCssColorString("#FF00FF")),Qf.MAROON=Object.freeze(Qf.fromCssColorString("#800000")),Qf.MEDIUMAQUAMARINE=Object.freeze(Qf.fromCssColorString("#66CDAA")),Qf.MEDIUMBLUE=Object.freeze(Qf.fromCssColorString("#0000CD")),Qf.MEDIUMORCHID=Object.freeze(Qf.fromCssColorString("#BA55D3")),Qf.MEDIUMPURPLE=Object.freeze(Qf.fromCssColorString("#9370DB")),Qf.MEDIUMSEAGREEN=Object.freeze(Qf.fromCssColorString("#3CB371")),Qf.MEDIUMSLATEBLUE=Object.freeze(Qf.fromCssColorString("#7B68EE")),Qf.MEDIUMSPRINGGREEN=Object.freeze(Qf.fromCssColorString("#00FA9A")),Qf.MEDIUMTURQUOISE=Object.freeze(Qf.fromCssColorString("#48D1CC")),Qf.MEDIUMVIOLETRED=Object.freeze(Qf.fromCssColorString("#C71585")),Qf.MIDNIGHTBLUE=Object.freeze(Qf.fromCssColorString("#191970")),Qf.MINTCREAM=Object.freeze(Qf.fromCssColorString("#F5FFFA")),Qf.MISTYROSE=Object.freeze(Qf.fromCssColorString("#FFE4E1")),Qf.MOCCASIN=Object.freeze(Qf.fromCssColorString("#FFE4B5")),Qf.NAVAJOWHITE=Object.freeze(Qf.fromCssColorString("#FFDEAD")),Qf.NAVY=Object.freeze(Qf.fromCssColorString("#000080")),Qf.OLDLACE=Object.freeze(Qf.fromCssColorString("#FDF5E6")),Qf.OLIVE=Object.freeze(Qf.fromCssColorString("#808000")),Qf.OLIVEDRAB=Object.freeze(Qf.fromCssColorString("#6B8E23")),Qf.ORANGE=Object.freeze(Qf.fromCssColorString("#FFA500")),Qf.ORANGERED=Object.freeze(Qf.fromCssColorString("#FF4500")),Qf.ORCHID=Object.freeze(Qf.fromCssColorString("#DA70D6")),Qf.PALEGOLDENROD=Object.freeze(Qf.fromCssColorString("#EEE8AA")),Qf.PALEGREEN=Object.freeze(Qf.fromCssColorString("#98FB98")),Qf.PALETURQUOISE=Object.freeze(Qf.fromCssColorString("#AFEEEE")),Qf.PALEVIOLETRED=Object.freeze(Qf.fromCssColorString("#DB7093")),Qf.PAPAYAWHIP=Object.freeze(Qf.fromCssColorString("#FFEFD5")),Qf.PEACHPUFF=Object.freeze(Qf.fromCssColorString("#FFDAB9")),Qf.PERU=Object.freeze(Qf.fromCssColorString("#CD853F")),Qf.PINK=Object.freeze(Qf.fromCssColorString("#FFC0CB")),Qf.PLUM=Object.freeze(Qf.fromCssColorString("#DDA0DD")),Qf.POWDERBLUE=Object.freeze(Qf.fromCssColorString("#B0E0E6")),Qf.PURPLE=Object.freeze(Qf.fromCssColorString("#800080")),Qf.RED=Object.freeze(Qf.fromCssColorString("#FF0000")),Qf.ROSYBROWN=Object.freeze(Qf.fromCssColorString("#BC8F8F")),Qf.ROYALBLUE=Object.freeze(Qf.fromCssColorString("#4169E1")),Qf.SADDLEBROWN=Object.freeze(Qf.fromCssColorString("#8B4513")),Qf.SALMON=Object.freeze(Qf.fromCssColorString("#FA8072")),Qf.SANDYBROWN=Object.freeze(Qf.fromCssColorString("#F4A460")),Qf.SEAGREEN=Object.freeze(Qf.fromCssColorString("#2E8B57")),Qf.SEASHELL=Object.freeze(Qf.fromCssColorString("#FFF5EE")),Qf.SIENNA=Object.freeze(Qf.fromCssColorString("#A0522D")),Qf.SILVER=Object.freeze(Qf.fromCssColorString("#C0C0C0")),Qf.SKYBLUE=Object.freeze(Qf.fromCssColorString("#87CEEB")),Qf.SLATEBLUE=Object.freeze(Qf.fromCssColorString("#6A5ACD")),Qf.SLATEGRAY=Object.freeze(Qf.fromCssColorString("#708090")),Qf.SLATEGREY=Qf.SLATEGRAY,Qf.SNOW=Object.freeze(Qf.fromCssColorString("#FFFAFA")),Qf.SPRINGGREEN=Object.freeze(Qf.fromCssColorString("#00FF7F")),Qf.STEELBLUE=Object.freeze(Qf.fromCssColorString("#4682B4")),Qf.TAN=Object.freeze(Qf.fromCssColorString("#D2B48C")),Qf.TEAL=Object.freeze(Qf.fromCssColorString("#008080")),Qf.THISTLE=Object.freeze(Qf.fromCssColorString("#D8BFD8")),Qf.TOMATO=Object.freeze(Qf.fromCssColorString("#FF6347")),Qf.TURQUOISE=Object.freeze(Qf.fromCssColorString("#40E0D0")),Qf.VIOLET=Object.freeze(Qf.fromCssColorString("#EE82EE")),Qf.WHEAT=Object.freeze(Qf.fromCssColorString("#F5DEB3")),Qf.WHITE=Object.freeze(Qf.fromCssColorString("#FFFFFF")),Qf.WHITESMOKE=Object.freeze(Qf.fromCssColorString("#F5F5F5")),Qf.YELLOW=Object.freeze(Qf.fromCssColorString("#FFFF00")),Qf.YELLOWGREEN=Object.freeze(Qf.fromCssColorString("#9ACD32")),Qf.TRANSPARENT=Object.freeze(new Qf(0,0,0,0));var sp=Qf;function cp(e,t,n,i){e=Object(c.a)(e,1),t=Object(c.a)(t,1),n=Object(c.a)(n,1),i=Object(c.a)(i,1),this.value=new Uint8Array([sp.floatToByte(e),sp.floatToByte(t),sp.floatToByte(n),sp.floatToByte(i)])}Object.defineProperties(cp.prototype,{componentDatatype:{get:function(){return gs.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),cp.fromColor=function(e){if(!Object(l.a)(e))throw new u.a("color is required.");return new cp(e.red,e.green,e.blue,e.alpha)},cp.toValue=function(e,t){if(!Object(l.a)(e))throw new u.a("color is required.");return Object(l.a)(t)?e.toBytes(t):new Uint8Array(e.toBytes())},cp.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var lp=cp,up=n(9);function hp(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(hp.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),hp.clone=function(e){if(Object(l.a)(e))return new hp(e._format,e._datatype,e._width,e._height,e._buffer)},hp.prototype.clone=function(){return hp.clone(this)};var dp=hp;function fp(e){this._value=e,this._valueType=wu.getPointType(e)}Object.defineProperties(fp.prototype,{value:{get:function(){return this._value}}}),fp.prototype.findTimeInterval=function(e){throw new u.a("findTimeInterval cannot be called on a ConstantSpline.")},fp.prototype.wrapTime=function(e){return s.a.typeOf.number("time",e),0},fp.prototype.clampTime=function(e){return s.a.typeOf.number("time",e),0},fp.prototype.evaluate=function(e,t){s.a.typeOf.number("time",e);const n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var pp=fp;const mp={},gp=new O,_p=new O,yp=new O,bp=new O,vp=new fs;function Op(e,t,n,i,r){const o=O.subtract(e,t,gp),a=O.dot(n,o),s=O.dot(i,o);return Vt.fromElements(a,s,r)}mp.validOutline=function(e){s.a.defined("positions",e);const t=fs.fromPoints(e,vp).halfAxes,n=ce.getColumn(t,0,_p),i=ce.getColumn(t,1,yp),r=ce.getColumn(t,2,bp),o=O.magnitude(n),a=O.magnitude(i),c=O.magnitude(r);return!(0===o&&(0===a||0===c)||0===a&&0===c)},mp.computeProjectTo2DArguments=function(e,t,n,i){s.a.defined("positions",e),s.a.defined("centerResult",t),s.a.defined("planeAxis1Result",n),s.a.defined("planeAxis2Result",i);const r=fs.fromPoints(e,vp),o=r.halfAxes,a=ce.getColumn(o,0,_p),c=ce.getColumn(o,1,yp),l=ce.getColumn(o,2,bp),u=O.magnitude(a),h=O.magnitude(c),d=O.magnitude(l),f=Math.min(u,h,d);if(0===u&&(0===h||0===d)||0===h&&0===d)return!1;let p,m;return f!==h&&f!==d||(p=a),f===u?p=c:f===d&&(m=c),f!==u&&f!==h||(m=l),O.normalize(p,n),O.normalize(m,i),O.clone(r.center,t),!0},mp.createProjectPointsTo2DFunction=function(e,t,n){return function(i){const r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Op(i[o],e,t,n);return r}},mp.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Op(i,e,t,n,r)}};var wp=mp;function Ap(e,t,n){if(0===e)return t*n;const i=e*e,r=i*i,o=r*i,a=o*i,s=a*i,c=s*i,l=n;return t*((1-i/4-3*r/64-5*o/256-175*a/16384-441*s/65536-4851*c/1048576)*l-(3*i/8+3*r/32+45*o/1024+105*a/4096+2205*s/131072+6237*c/524288)*Math.sin(2*l)+(15*r/256+45*o/1024+525*a/16384+1575*s/65536+155925*c/8388608)*Math.sin(4*l)-(35*o/3072+175*a/12288+3675*s/262144+13475*c/1048576)*Math.sin(6*l)+(315*a/131072+2205*s/524288+43659*c/8388608)*Math.sin(8*l)-(693*s/1310720+6237*c/5242880)*Math.sin(10*l)+1001*c/8388608*Math.sin(12*l))}function Ep(e,t){if(0===e)return Math.log(Math.tan(.5*(h.a.PI_OVER_TWO+t)));const n=e*Math.sin(t);return Math.log(Math.tan(.5*(h.a.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}const Tp=new O,Cp=new O;function xp(e,t,n,i){const r=O.normalize(i.cartographicToCartesian(t,Cp),Tp),o=O.normalize(i.cartographicToCartesian(n,Cp),Cp);s.a.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(O.angleBetween(r,o))-Math.PI),.0125);const a=i.maximumRadius,c=i.minimumRadius,l=a*a,u=c*c;e._ellipticitySquared=(l-u)/l,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=R.clone(t,e._start),e._start.height=0,e._end=R.clone(n,e._end),e._end.height=0,e._heading=function(e,t,n,i,r){const o=Ep(e._ellipticity,n),a=Ep(e._ellipticity,r);return Math.atan2(h.a.negativePiToPi(i-t),a-o)}(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=function(e,t,n,i,r,o,a){const s=e._heading,c=o-i;let l=0;if(h.a.equalsEpsilon(Math.abs(s),h.a.PI_OVER_TWO,h.a.EPSILON8))if(t===n)l=t*Math.cos(r)*h.a.negativePiToPi(c);else{const n=Math.sin(r);l=t*Math.cos(r)*h.a.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*n*n)}else{const n=Ap(e._ellipticity,t,r);l=(Ap(e._ellipticity,t,a)-n)/Math.cos(s)}return Math.abs(l)}(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Sp(e,t,n,i,r,o){if(0===n)return R.clone(e,o);const a=r*r;let s,c,u;if(Math.abs(h.a.PI_OVER_TWO-Math.abs(t))>h.a.EPSILON8){c=function(e,t,n){const i=e/n;if(0===t)return i;const r=i*i,o=r*i,a=o*i,s=t*t,c=s*s,l=c*s,u=l*s,h=u*s,d=h*s,f=Math.sin(2*i),p=Math.cos(2*i),m=Math.sin(4*i),g=Math.cos(4*i),_=Math.sin(6*i),y=Math.cos(6*i),b=Math.sin(8*i),v=Math.cos(8*i),O=Math.sin(10*i);return i+i*s/4+7*i*c/64+15*i*l/256+579*i*u/16384+1515*i*h/65536+16837*i*d/1048576+(3*i*c/16+45*i*l/256-i*(32*r-561)*u/4096-i*(232*r-1677)*h/16384+i*(399985-90560*r+512*a)*d/5242880)*p+(21*i*l/256+483*i*u/4096-i*(224*r-1969)*h/16384-i*(33152*r-112599)*d/1048576)*g+(151*i*u/4096+4681*i*h/65536+1479*i*d/16384-453*o*d/32768)*y+(1097*i*h/65536+42783*i*d/1048576)*v+8011*i*d/1048576*Math.cos(10*i)+(3*s/8+3*c/16+213*l/2048-3*r*l/64+255*u/4096-33*r*u/512+20861*h/524288-33*r*h/512+a*h/1024+28273*d/1048576-471*r*d/8192+9*a*d/4096)*f+(21*c/256+21*l/256+533*u/8192-21*r*u/512+197*h/4096-315*r*h/4096+584039*d/16777216-12517*r*d/131072+7*a*d/2048)*m+(151*l/6144+151*u/4096+5019*h/131072-453*r*h/16384+26965*d/786432-8607*r*d/131072)*_+(1097*u/131072+1097*h/65536+225797*d/10485760-1097*r*d/65536)*b+(8011*h/2621440+8011*d/1048576)*O+293393*d/251658240*Math.sin(12*i)}(Ap(r,i,e.latitude)+n*Math.cos(t),r,i);const o=Ep(r,e.latitude),a=Ep(r,c);u=Math.tan(t)*(a-o),s=h.a.negativePiToPi(e.longitude+u)}else{let o;if(c=e.latitude,0===r)o=i*Math.cos(e.latitude);else{const t=Math.sin(e.latitude);o=i*Math.cos(e.latitude)/Math.sqrt(1-a*t*t)}u=n/o,s=t>0?h.a.negativePiToPi(e.longitude+u):h.a.negativePiToPi(e.longitude-u)}return Object(l.a)(o)?(o.longitude=s,o.latitude=c,o.height=0,o):new R(s,c,0)}function Ip(e,t,n){const i=Object(c.a)(n,H.WGS84);this._ellipsoid=i,this._start=new R,this._end=new R,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,Object(l.a)(e)&&Object(l.a)(t)&&xp(this,e,t,i)}Object.defineProperties(Ip.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return s.a.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return s.a.defined("distance",this._distance),this._heading}}}),Ip.fromStartHeadingDistance=function(e,t,n,i,r){s.a.defined("start",e),s.a.defined("heading",t),s.a.defined("distance",n),s.a.typeOf.number.greaterThan("distance",n,0);const o=Object(c.a)(i,H.WGS84),a=o.maximumRadius,u=o.minimumRadius,d=a*a,f=u*u,p=Math.sqrt((d-f)/d),m=Sp(e,t=h.a.negativePiToPi(t),n,o.maximumRadius,p);return!Object(l.a)(r)||Object(l.a)(i)&&!i.equals(r.ellipsoid)?new Ip(e,m,o):(r.setEndPoints(e,m),r)},Ip.prototype.setEndPoints=function(e,t){s.a.defined("start",e),s.a.defined("end",t),xp(this,e,t,this._ellipsoid)},Ip.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},Ip.prototype.interpolateUsingSurfaceDistance=function(e,t){if(s.a.typeOf.number("distance",e),!Object(l.a)(this._distance)||0===this._distance)throw new u.a("EllipsoidRhumbLine must have distinct start and end set.");return Sp(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},Ip.prototype.findIntersectionWithLongitude=function(e,t){if(s.a.typeOf.number("intersectionLongitude",e),!Object(l.a)(this._distance)||0===this._distance)throw new u.a("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=h.a.negativePiToPi(e),h.a.equalsEpsilon(Math.abs(e),Math.PI,h.a.EPSILON14)&&(e=h.a.sign(o.longitude)*Math.PI),Object(l.a)(t)||(t=new R),Math.abs(h.a.PI_OVER_TWO-r)<=h.a.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(h.a.equalsEpsilon(Math.abs(h.a.PI_OVER_TWO-r),h.a.PI_OVER_TWO,h.a.EPSILON8)){if(h.a.equalsEpsilon(e,o.longitude,h.a.EPSILON12))return;return t.longitude=e,t.latitude=h.a.PI_OVER_TWO*h.a.sign(h.a.PI_OVER_TWO-i),t.height=0,t}const a=o.latitude,c=n*Math.sin(a),d=Math.tan(.5*(h.a.PI_OVER_TWO+a))*Math.exp((e-o.longitude)/Math.tan(i)),f=(1+c)/(1-c);let p,m=o.latitude;do{p=m;const e=n*Math.sin(p),t=(1+e)/(1-e);m=2*Math.atan(d*Math.pow(t/f,n/2))-h.a.PI_OVER_TWO}while(!h.a.equalsEpsilon(m,p,h.a.EPSILON12));return t.longitude=e,t.latitude=m,t.height=0,t},Ip.prototype.findIntersectionWithLatitude=function(e,t){if(s.a.typeOf.number("intersectionLatitude",e),!Object(l.a)(this._distance)||0===this._distance)throw new u.a("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,r=this._start;if(h.a.equalsEpsilon(Math.abs(i),h.a.PI_OVER_TWO,h.a.EPSILON8))return;const o=Ep(n,r.latitude),a=Ep(n,e),c=Math.tan(i)*(a-o),d=h.a.negativePiToPi(r.longitude+c);return Object(l.a)(t)?(t.longitude=d,t.latitude=e,t.height=0,t):new R(d,e,0)};var Pp=Ip,Dp=n(72),Rp=n.n(Dp);const jp={CLOCKWISE:ps.CW,COUNTER_CLOCKWISE:ps.CCW,validate:function(e){return e===jp.CLOCKWISE||e===jp.COUNTER_CLOCKWISE}};var Mp=Object.freeze(jp);const Lp=new O,Np=new O,Bp={computeArea2D:function(e){s.a.defined("positions",e),s.a.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);const t=e.length;let n=0;for(let i=t-1,r=0;r<t;i=r++){const t=e[i],o=e[r];n+=t.x*o.y-o.x*t.y}return.5*n},computeWindingOrder2D:function(e){return Bp.computeArea2D(e)>0?Mp.COUNTER_CLOCKWISE:Mp.CLOCKWISE},triangulate:function(e,t){s.a.defined("positions",e);const n=Vt.packArray(e);return Rp()(n,t,2)}},Fp=new O,zp=new O,kp=new O,Up=new O,Vp=new O,Hp=new O,Gp=new O,qp=new Vt,Wp=new Vt,Yp=new Vt,Xp=new Vt;Bp.computeSubdivision=function(e,t,n,i,r){r=Object(c.a)(r,h.a.RADIANS_PER_DEGREE);const o=Object(l.a)(i);s.a.typeOf.object("ellipsoid",e),s.a.defined("positions",t),s.a.defined("indices",n),s.a.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),s.a.typeOf.number.equals("indices.length % 3","0",n.length%3,0),s.a.typeOf.number.greaterThan("granularity",r,0);const a=n.slice(0);let u;const d=t.length,f=new Array(3*d),p=new Array(2*d);let m=0,g=0;for(u=0;u<d;u++){const e=t[u];if(f[m++]=e.x,f[m++]=e.y,f[m++]=e.z,o){const e=i[u];p[g++]=e.x,p[g++]=e.y}}const _=[],y={},b=e.maximumRadius,v=h.a.chordLength(r,b),w=v*v;for(;a.length>0;){const e=a.pop(),t=a.pop(),n=a.pop(),i=O.fromArray(f,3*n,Fp),r=O.fromArray(f,3*t,zp),s=O.fromArray(f,3*e,kp);let c,h,d;o&&(c=Vt.fromArray(p,2*n,qp),h=Vt.fromArray(p,2*t,Wp),d=Vt.fromArray(p,2*e,Yp));const m=O.multiplyByScalar(O.normalize(i,Up),b,Up),g=O.multiplyByScalar(O.normalize(r,Vp),b,Vp),v=O.multiplyByScalar(O.normalize(s,Hp),b,Hp),A=O.magnitudeSquared(O.subtract(m,g,Gp)),E=O.magnitudeSquared(O.subtract(g,v,Gp)),T=O.magnitudeSquared(O.subtract(v,m,Gp)),C=Math.max(A,E,T);let x,S,I;C>w?A===C?(x=`${Math.min(n,t)} ${Math.max(n,t)}`,u=y[x],Object(l.a)(u)||(S=O.add(i,r,Gp),O.multiplyByScalar(S,.5,S),f.push(S.x,S.y,S.z),u=f.length/3-1,y[x]=u,o&&(I=Vt.add(c,h,Xp),Vt.multiplyByScalar(I,.5,I),p.push(I.x,I.y))),a.push(n,u,e),a.push(u,t,e)):E===C?(x=`${Math.min(t,e)} ${Math.max(t,e)}`,u=y[x],Object(l.a)(u)||(S=O.add(r,s,Gp),O.multiplyByScalar(S,.5,S),f.push(S.x,S.y,S.z),u=f.length/3-1,y[x]=u,o&&(I=Vt.add(h,d,Xp),Vt.multiplyByScalar(I,.5,I),p.push(I.x,I.y))),a.push(t,u,n),a.push(u,e,n)):T===C&&(x=`${Math.min(e,n)} ${Math.max(e,n)}`,u=y[x],Object(l.a)(u)||(S=O.add(s,i,Gp),O.multiplyByScalar(S,.5,S),f.push(S.x,S.y,S.z),u=f.length/3-1,y[x]=u,o&&(I=Vt.add(d,c,Xp),Vt.multiplyByScalar(I,.5,I),p.push(I.x,I.y))),a.push(e,u,t),a.push(u,n,t)):(_.push(n),_.push(t),_.push(e))}const A={attributes:{position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:f})},indices:_,primitiveType:zl.TRIANGLES};return o&&(A.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:p})),new Zl(A)};const Kp=new R,Jp=new R,Zp=new R,$p=new R;Bp.computeRhumbLineSubdivision=function(e,t,n,i,r){r=Object(c.a)(r,h.a.RADIANS_PER_DEGREE);const o=Object(l.a)(i);s.a.typeOf.object("ellipsoid",e),s.a.defined("positions",t),s.a.defined("indices",n),s.a.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),s.a.typeOf.number.equals("indices.length % 3","0",n.length%3,0),s.a.typeOf.number.greaterThan("granularity",r,0);const a=n.slice(0);let u;const d=t.length,f=new Array(3*d),p=new Array(2*d);let m=0,g=0;for(u=0;u<d;u++){const e=t[u];if(f[m++]=e.x,f[m++]=e.y,f[m++]=e.z,o){const e=i[u];p[g++]=e.x,p[g++]=e.y}}const _=[],y={},b=e.maximumRadius,v=h.a.chordLength(r,b),w=new Pp(void 0,void 0,e),A=new Pp(void 0,void 0,e),E=new Pp(void 0,void 0,e);for(;a.length>0;){const t=a.pop(),n=a.pop(),i=a.pop(),r=O.fromArray(f,3*i,Fp),s=O.fromArray(f,3*n,zp),c=O.fromArray(f,3*t,kp);let h,d,m;o&&(h=Vt.fromArray(p,2*i,qp),d=Vt.fromArray(p,2*n,Wp),m=Vt.fromArray(p,2*t,Yp));const g=e.cartesianToCartographic(r,Kp),b=e.cartesianToCartographic(s,Jp),T=e.cartesianToCartographic(c,Zp);w.setEndPoints(g,b);const C=w.surfaceDistance;A.setEndPoints(b,T);const x=A.surfaceDistance;E.setEndPoints(T,g);const S=E.surfaceDistance,I=Math.max(C,x,S);let P,D,R,j,M;I>v?C===I?(P=`${Math.min(i,n)} ${Math.max(i,n)}`,u=y[P],Object(l.a)(u)||(D=w.interpolateUsingFraction(.5,$p),R=.5*(g.height+b.height),j=O.fromRadians(D.longitude,D.latitude,R,e,Gp),f.push(j.x,j.y,j.z),u=f.length/3-1,y[P]=u,o&&(M=Vt.add(h,d,Xp),Vt.multiplyByScalar(M,.5,M),p.push(M.x,M.y))),a.push(i,u,t),a.push(u,n,t)):x===I?(P=`${Math.min(n,t)} ${Math.max(n,t)}`,u=y[P],Object(l.a)(u)||(D=A.interpolateUsingFraction(.5,$p),R=.5*(b.height+T.height),j=O.fromRadians(D.longitude,D.latitude,R,e,Gp),f.push(j.x,j.y,j.z),u=f.length/3-1,y[P]=u,o&&(M=Vt.add(d,m,Xp),Vt.multiplyByScalar(M,.5,M),p.push(M.x,M.y))),a.push(n,u,i),a.push(u,t,i)):S===I&&(P=`${Math.min(t,i)} ${Math.max(t,i)}`,u=y[P],Object(l.a)(u)||(D=E.interpolateUsingFraction(.5,$p),R=.5*(T.height+g.height),j=O.fromRadians(D.longitude,D.latitude,R,e,Gp),f.push(j.x,j.y,j.z),u=f.length/3-1,y[P]=u,o&&(M=Vt.add(m,h,Xp),Vt.multiplyByScalar(M,.5,M),p.push(M.x,M.y))),a.push(t,u,n),a.push(u,i,n)):(_.push(i),_.push(n),_.push(t))}const T={attributes:{position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:f})},indices:_,primitiveType:zl.TRIANGLES};return o&&(T.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:p})),new Zl(T)},Bp.scaleToGeodeticHeight=function(e,t,n,i){n=Object(c.a)(n,H.WGS84);let r=Lp,o=Np;if(t=Object(c.a)(t,0),i=Object(c.a)(i,!0),Object(l.a)(e)){const a=e.length;for(let s=0;s<a;s+=3)O.fromArray(e,s,o),i&&(o=n.scaleToGeodeticSurface(o,o)),0!==t&&(r=n.geodeticSurfaceNormal(o,r),O.multiplyByScalar(r,t,r),O.add(o,r,o)),e[s]=o.x,e[s+1]=o.y,e[s+2]=o.z}return e};var Qp=Bp;function em(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(em.prototype,{length:{get:function(){return this._length}}}),em.prototype.enqueue=function(e){this._array.push(e),this._length++},em.prototype.dequeue=function(){if(0===this._length)return;const e=this._array;let t=this._offset;const n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n},em.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},em.prototype.contains=function(e){return-1!==this._array.indexOf(e)},em.prototype.clear=function(){this._array.length=this._offset=this._length=0},em.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var tm=em;const nm={computeHierarchyPackedLength:function(e,t){let n=0;const i=[e];for(;i.length>0;){const e=i.pop();if(!Object(l.a)(e))continue;n+=2;const r=e.positions,o=e.holes;if(Object(l.a)(r)&&r.length>0&&(n+=r.length*t.packedLength),Object(l.a)(o)){const e=o.length;for(let t=0;t<e;++t)i.push(o[t])}}return n},packPolygonHierarchy:function(e,t,n,i){const r=[e];for(;r.length>0;){const e=r.pop();if(!Object(l.a)(e))continue;const o=e.positions,a=e.holes;if(t[n++]=Object(l.a)(o)?o.length:0,t[n++]=Object(l.a)(a)?a.length:0,Object(l.a)(o)){const e=o.length;for(let r=0;r<e;++r,n+=i.packedLength)i.pack(o[r],t,n)}if(Object(l.a)(a)){const e=a.length;for(let t=0;t<e;++t)r.push(a[t])}}return n},unpackPolygonHierarchy:function(e,t,n){const i=e[t++],r=e[t++],o=new Array(i),a=r>0?new Array(r):void 0;for(let r=0;r<i;++r,t+=n.packedLength)o[r]=n.unpack(e,t);for(let i=0;i<r;++i)a[i]=nm.unpackPolygonHierarchy(e,t,n),t=a[i].startingIndex,delete a[i].startingIndex;return{positions:o,holes:a,startingIndex:t}}},im=new Vt;function rm(e,t,n,i){return Vt.subtract(t,e,im),Vt.multiplyByScalar(im,n/i,im),Vt.add(e,im,im),[im.x,im.y]}const om=new O;function am(e,t,n,i){return O.subtract(t,e,om),O.multiplyByScalar(om,n/i,om),O.add(e,om,om),[om.x,om.y,om.z]}nm.subdivideLineCount=function(e,t,n){const i=O.distance(e,t)/n,r=Math.max(0,Math.ceil(h.a.log2(i)));return Math.pow(2,r)};const sm=new R,cm=new R,lm=new R,um=new O,hm=new Pp;nm.subdivideRhumbLineCount=function(e,t,n,i){const r=e.cartesianToCartographic(t,sm),o=e.cartesianToCartographic(n,cm),a=new Pp(r,o,e).surfaceDistance/i,s=Math.max(0,Math.ceil(h.a.log2(a)));return Math.pow(2,s)},nm.subdivideTexcoordLine=function(e,t,n,i,r,o){const a=nm.subdivideLineCount(n,i,r),s=Vt.distance(e,t),c=s/a,l=o;l.length=2*a;let u=0;for(let n=0;n<a;n++){const i=rm(e,t,n*c,s);l[u++]=i[0],l[u++]=i[1]}return l},nm.subdivideLine=function(e,t,n,i){const r=nm.subdivideLineCount(e,t,n),o=O.distance(e,t),a=o/r;Object(l.a)(i)||(i=[]);const s=i;s.length=3*r;let c=0;for(let n=0;n<r;n++){const i=am(e,t,n*a,o);s[c++]=i[0],s[c++]=i[1],s[c++]=i[2]}return s},nm.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,a){const s=n.cartesianToCartographic(i,sm),c=n.cartesianToCartographic(r,cm);hm.setEndPoints(s,c);const l=hm.surfaceDistance/o,u=Math.max(0,Math.ceil(h.a.log2(l))),d=Math.pow(2,u),f=Vt.distance(e,t),p=f/d,m=a;m.length=2*d;let g=0;for(let n=0;n<d;n++){const i=rm(e,t,n*p,f);m[g++]=i[0],m[g++]=i[1]}return m},nm.subdivideRhumbLine=function(e,t,n,i,r){const o=e.cartesianToCartographic(t,sm),a=e.cartesianToCartographic(n,cm),s=new Pp(o,a,e),c=s.surfaceDistance/i,u=Math.max(0,Math.ceil(h.a.log2(c))),d=Math.pow(2,u),f=s.surfaceDistance/d;Object(l.a)(r)||(r=[]);const p=r;p.length=3*d;let m=0;for(let t=0;t<d;t++){const n=s.interpolateUsingSurfaceDistance(t*f,lm),i=e.cartographicToCartesian(n,um);p[m++]=i.x,p[m++]=i.y,p[m++]=i.z}return p};const dm=new O,fm=new O,pm=new O,mm=new O;nm.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=Object(c.a)(i,H.WGS84);const o=dm;let a=fm;const s=pm;let u=mm;if(Object(l.a)(e)&&Object(l.a)(e.attributes)&&Object(l.a)(e.attributes.position)){const c=e.attributes.position.values,l=c.length/2;for(let e=0;e<l;e+=3)O.fromArray(c,e,s),i.geodeticSurfaceNormal(s,o),u=i.scaleToGeodeticSurface(s,u),a=O.multiplyByScalar(o,n,a),a=O.add(u,a,a),c[e+l]=a.x,c[e+1+l]=a.y,c[e+2+l]=a.z,r&&(u=O.clone(s,u)),a=O.multiplyByScalar(o,t,a),a=O.add(u,a,a),c[e]=a.x,c[e+1]=a.y,c[e+2]=a.z}return e},nm.polygonOutlinesFromHierarchy=function(e,t,n){const i=[],r=new tm;let o,a,s;for(r.enqueue(e);0!==r.length;){const e=r.dequeue();let c=e.positions;if(t)for(s=c.length,o=0;o<s;o++)n.scaleToGeodeticSurface(c[o],c[o]);if(c=wl(c,O.equalsEpsilon,!0),c.length<3)continue;const u=e.holes?e.holes.length:0;for(o=0;o<u;o++){const c=e.holes[o];let u=c.positions;if(t)for(s=u.length,a=0;a<s;++a)n.scaleToGeodeticSurface(u[a],u[a]);if(u=wl(u,O.equalsEpsilon,!0),u.length<3)continue;i.push(u);let h=0;for(Object(l.a)(c.holes)&&(h=c.holes.length),a=0;a<h;a++)r.enqueue(c.holes[a])}i.push(c)}return i},nm.polygonsFromHierarchy=function(e,t,n,i,r){const o=[],a=[],s=new tm;for(s.enqueue(e);0!==s.length;){const e=s.dequeue();let c=e.positions;const u=e.holes;let h,d;if(i)for(d=c.length,h=0;h<d;h++)r.scaleToGeodeticSurface(c[h],c[h]);if(t||(c=wl(c,O.equalsEpsilon,!0)),c.length<3)continue;let f=n(c);if(!Object(l.a)(f))continue;const p=[];let m=Qp.computeWindingOrder2D(f);m===Mp.CLOCKWISE&&(f.reverse(),c=c.slice().reverse());let g=c.slice();const _=Object(l.a)(u)?u.length:0,y=[];let b;for(h=0;h<_;h++){const e=u[h];let o=e.positions;if(i)for(d=o.length,b=0;b<d;++b)r.scaleToGeodeticSurface(o[b],o[b]);if(t||(o=wl(o,O.equalsEpsilon,!0)),o.length<3)continue;const a=n(o);if(!Object(l.a)(a))continue;m=Qp.computeWindingOrder2D(a),m===Mp.CLOCKWISE&&(a.reverse(),o=o.slice().reverse()),y.push(o),p.push(g.length),g=g.concat(o),f=f.concat(a);let c=0;for(Object(l.a)(e.holes)&&(c=e.holes.length),b=0;b<c;b++)s.enqueue(e.holes[b])}o.push({outerRing:c,holes:y}),a.push({positions:g,positions2D:f,holes:p})}return{hierarchy:o,polygons:a}};const gm=new Vt,_m=new O,ym=new To,bm=new ce;nm.computeBoundingRectangle=function(e,t,n,i,r){const o=To.fromAxisAngle(e,i,ym),a=ce.fromQuaternion(o,bm);let s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;const d=n.length;for(let e=0;e<d;++e){const i=O.clone(n[e],_m);ce.multiplyByVector(a,i,i);const r=t(i,gm);Object(l.a)(r)&&(s=Math.min(s,r.x),c=Math.max(c,r.x),u=Math.min(u,r.y),h=Math.max(h,r.y))}return r.x=s,r.y=u,r.width=c-s,r.height=h-u,r},nm.createGeometryFromPositions=function(e,t,n,i,r,o,a){let s=Qp.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);const c=t.positions,u=Object(l.a)(n),h=u?n.positions:void 0;if(r){const e=c.length,t=new Array(3*e);let n=0;for(let i=0;i<e;i++){const e=c[i];t[n++]=e.x,t[n++]=e.y,t[n++]=e.z}const i={attributes:{position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:t})},indices:s,primitiveType:zl.TRIANGLES};u&&(i.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:Vt.packArray(h)}));const r=new Zl(i);return o.normal?$d.computeNormal(r):r}return a===vl.GEODESIC?Qp.computeSubdivision(e,c,s,h,i):a===vl.RHUMB?Qp.computeRhumbLineSubdivision(e,c,s,h,i):void 0};const vm=[],Om=[],wm=new O,Am=new O;nm.computeWallGeometry=function(e,t,n,i,r,o){let a,s,c,u,d,f,p,m,g,_=e.length,y=0,b=0;const v=Object(l.a)(t),w=v?t.positions:void 0;if(r)for(s=3*_*2,a=new Array(2*s),v&&(g=2*_*2,m=new Array(2*g)),c=0;c<_;c++)u=e[c],d=e[(c+1)%_],a[y]=a[y+s]=u.x,++y,a[y]=a[y+s]=u.y,++y,a[y]=a[y+s]=u.z,++y,a[y]=a[y+s]=d.x,++y,a[y]=a[y+s]=d.y,++y,a[y]=a[y+s]=d.z,++y,v&&(f=w[c],p=w[(c+1)%_],m[b]=m[b+g]=f.x,++b,m[b]=m[b+g]=f.y,++b,m[b]=m[b+g]=p.x,++b,m[b]=m[b+g]=p.y,++b);else{const t=h.a.chordLength(i,n.maximumRadius);let r=0;if(o===vl.GEODESIC)for(c=0;c<_;c++)r+=nm.subdivideLineCount(e[c],e[(c+1)%_],t);else if(o===vl.RHUMB)for(c=0;c<_;c++)r+=nm.subdivideRhumbLineCount(n,e[c],e[(c+1)%_],t);for(s=3*(r+_),a=new Array(2*s),v&&(g=2*(r+_),m=new Array(2*g)),c=0;c<_;c++){let i,r;u=e[c],d=e[(c+1)%_],v&&(f=w[c],p=w[(c+1)%_]),o===vl.GEODESIC?(i=nm.subdivideLine(u,d,t,Om),v&&(r=nm.subdivideTexcoordLine(f,p,u,d,t,vm))):o===vl.RHUMB&&(i=nm.subdivideRhumbLine(n,u,d,t,Om),v&&(r=nm.subdivideTexcoordRhumbLine(f,p,n,u,d,t,vm)));const l=i.length;for(let e=0;e<l;++e,++y)a[y]=i[e],a[y+s]=i[e];if(a[y]=d.x,a[y+s]=d.x,++y,a[y]=d.y,a[y+s]=d.y,++y,a[y]=d.z,a[y+s]=d.z,++y,v){const e=r.length;for(let t=0;t<e;++t,++b)m[b]=r[t],m[b+g]=r[t];m[b]=p.x,m[b+g]=p.x,++b,m[b]=p.y,m[b+g]=p.y,++b}}}_=a.length;const A=wc.createTypedArray(_/3,_-6*e.length);let E=0;for(_/=6,c=0;c<_;c++){const e=c,t=e+1,n=e+_,i=n+1;u=O.fromArray(a,3*e,wm),d=O.fromArray(a,3*t,Am),O.equalsEpsilon(u,d,h.a.EPSILON10,h.a.EPSILON10)||(A[E++]=e,A[E++]=n,A[E++]=t,A[E++]=t,A[E++]=n,A[E++]=i)}const T={attributes:new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a})}),indices:A,primitiveType:zl.TRIANGLES};v&&(T.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:m}));return new Zl(T)};var Em=nm;const Tm=new O,Cm=new Nl,xm=new Vt,Sm=new Vt,Im=new O,Pm=new O,Dm=new O,Rm=new O,jm=new O,Mm=new O,Lm=new To,Nm=new ce,Bm=new ce,Fm=new O;function zm(e,t,n,i,r,o,a,s,c){const u=e.positions;let d=Qp.triangulate(e.positions2D,e.holes);d.length<3&&(d=[0,1,2]);const f=wc.createTypedArray(u.length,d.length);f.set(d);let p=Nm;if(0!==i){let e=To.fromAxisAngle(a,i,Lm);if(p=ce.fromQuaternion(e,p),t.tangent||t.bitangent){e=To.fromAxisAngle(a,-i,Lm);const n=ce.fromQuaternion(e,Bm);s=O.normalize(ce.multiplyByVector(n,s,s),s),t.bitangent&&(c=O.normalize(O.cross(a,s,c),c))}}else p=ce.clone(ce.IDENTITY,p);const m=Sm;t.st&&(m.x=n.x,m.y=n.y);const g=u.length,_=3*g,y=new Float64Array(_),b=t.normal?new Float32Array(_):void 0,v=t.tangent?new Float32Array(_):void 0,w=t.bitangent?new Float32Array(_):void 0,A=t.st?new Float32Array(2*g):void 0;let E=0,T=0,C=0,x=0,S=0;for(let e=0;e<g;e++){const i=u[e];if(y[E++]=i.x,y[E++]=i.y,y[E++]=i.z,t.st)if(Object(l.a)(r)&&r.positions.length===g)A[S++]=r.positions[e].x,A[S++]=r.positions[e].y;else{const e=o(ce.multiplyByVector(p,i,Tm),xm);Vt.subtract(e,m,e);const t=h.a.clamp(e.x/n.width,0,1),r=h.a.clamp(e.y/n.height,0,1);A[S++]=t,A[S++]=r}t.normal&&(b[T++]=a.x,b[T++]=a.y,b[T++]=a.z),t.tangent&&(v[x++]=s.x,v[x++]=s.y,v[x++]=s.z),t.bitangent&&(w[C++]=c.x,w[C++]=c.y,w[C++]=c.z)}const I=new Ql;return t.position&&(I.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:y})),t.normal&&(I.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(I.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:v})),t.bitangent&&(I.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:w})),t.st&&(I.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:A})),new Zl({attributes:I,indices:f,primitiveType:zl.TRIANGLES})}function km(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).polygonHierarchy,n=e.textureCoordinates;s.a.defined("options.polygonHierarchy",t);const i=Object(c.a)(e.vertexFormat,nu.DEFAULT);this._vertexFormat=nu.clone(i),this._polygonHierarchy=t,this._stRotation=Object(c.a)(e.stRotation,0),this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Em.computeHierarchyPackedLength(t,O)+nu.packedLength+H.packedLength+(Object(l.a)(n)?Em.computeHierarchyPackedLength(n,Vt):1)+2}km.fromPositions=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.positions",e.positions);return new km({polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates})},km.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),n=Em.packPolygonHierarchy(e._polygonHierarchy,t,n,O),H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._stRotation,Object(l.a)(e._textureCoordinates)?n=Em.packPolygonHierarchy(e._textureCoordinates,t,n,Vt):t[n++]=-1,t[n++]=e.packedLength,t};const Um=H.clone(H.UNIT_SPHERE),Vm=new nu,Hm={polygonHierarchy:{}};km.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=Em.unpackPolygonHierarchy(e,t,O);t=i.startingIndex,delete i.startingIndex;const r=H.unpack(e,t,Um);t+=H.packedLength;const o=nu.unpack(e,t,Vm);t+=nu.packedLength;const a=e[t++],u=-1===e[t]?void 0:Em.unpackPolygonHierarchy(e,t,Vt);Object(l.a)(u)?(t=u.startingIndex,delete u.startingIndex):t++;const h=e[t++];return Object(l.a)(n)||(n=new km(Hm)),n._polygonHierarchy=i,n._ellipsoid=H.clone(r,n._ellipsoid),n._vertexFormat=nu.clone(o,n._vertexFormat),n._stRotation=a,n._textureCoordinates=u,n.packedLength=h,n},km.createGeometry=function(e){const t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=Object(l.a)(r);let a=n.positions;if(a=wl(a,O.equalsEpsilon,!0),a.length<3)return;let s=Im,c=Pm,u=Dm,d=jm;const f=Mm;if(!wp.computeProjectTo2DArguments(a,Rm,d,f))return;if(s=O.cross(d,f,s),s=O.normalize(s,s),!O.equalsEpsilon(Rm,O.ZERO,h.a.EPSILON6)){const t=e._ellipsoid.geodeticSurfaceNormal(Rm,Fm);O.dot(s,t)<0&&(s=O.negate(s,s),d=O.negate(d,d))}const p=wp.createProjectPointsTo2DFunction(Rm,d,f),m=wp.createProjectPointTo2DFunction(Rm,d,f);t.tangent&&(c=O.clone(d,c)),t.bitangent&&(u=O.clone(f,u));const g=Em.polygonsFromHierarchy(n,o,p,!1),_=g.hierarchy,y=g.polygons,b=o?Em.polygonsFromHierarchy(r,!0,(function(e){return e}),!1).polygons:void 0;if(0===_.length)return;a=_[0].outerRing;const v=At.fromPoints(a),w=Em.computeBoundingRectangle(s,m,a,i,Cm),A=[];for(let e=0;e<y.length;e++){const n=new Ph({geometry:zm(y[e],t,w,i,o?b[e]:void 0,m,s,c,u)});A.push(n)}const E=$d.combineInstances(A)[0];E.attributes.position.values=new Float64Array(E.attributes.position.values),E.indices=wc.createTypedArray(E.attributes.position.values.length/3,E.indices);const T=E.attributes;return t.position||delete T.position,new Zl({attributes:T,indices:E.indices,primitiveType:E.primitiveType,boundingSphere:v})};var Gm=km;function qm(e){const t=e.length,n=new Float64Array(3*t),i=wc.createTypedArray(t,2*t);let r=0,o=0;for(let a=0;a<t;a++){const s=e[a];n[r++]=s.x,n[r++]=s.y,n[r++]=s.z,i[o++]=a,i[o++]=(a+1)%t}const a=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:n})});return new Zl({attributes:a,indices:i,primitiveType:zl.LINES})}function Wm(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).polygonHierarchy;s.a.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Em.computeHierarchyPackedLength(t,O)+1}Wm.fromPositions=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.positions",e.positions);return new Wm({polygonHierarchy:{positions:e.positions}})},Wm.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n=Em.packPolygonHierarchy(e._polygonHierarchy,t,n,O)]=e.packedLength,t};const Ym={polygonHierarchy:{}};Wm.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=Em.unpackPolygonHierarchy(e,t,O);t=i.startingIndex,delete i.startingIndex;const r=e[t];return Object(l.a)(n)||(n=new Wm(Ym)),n._polygonHierarchy=i,n.packedLength=r,n},Wm.createGeometry=function(e){const t=e._polygonHierarchy;let n=t.positions;if(n=wl(n,O.equalsEpsilon,!0),n.length<3)return;if(!wp.validOutline(n))return;const i=Em.polygonOutlinesFromHierarchy(t,!1);if(0===i.length)return;const r=[];for(let e=0;e<i.length;e++){const t=new Ph({geometry:qm(i[e])});r.push(t)}const o=$d.combineInstances(r)[0],a=At.fromPoints(t.positions);return new Zl({attributes:o.attributes,indices:o.indices,primitiveType:o.primitiveType,boundingSphere:a})};var Xm=Wm;var Km=Object.freeze({ROUNDED:0,MITERED:1,BEVELED:2});function Jm(e,t,n,i,r,o,a){const s=function(e,t){return e*t*(4+e*(4-3*t))/16}(e,n);return(1-s)*e*t*(i+s*r*(a+s*o*(2*a*a-1)))}const Zm=new O,$m=new O;function Qm(e,t,n,i){const r=O.normalize(i.cartographicToCartesian(t,$m),Zm),o=O.normalize(i.cartographicToCartesian(n,$m),$m);s.a.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(O.angleBetween(r,o))-Math.PI),.0125),function(e,t,n,i,r,o,a){const s=(t-n)/t,c=o-i,l=Math.atan((1-s)*Math.tan(r)),u=Math.atan((1-s)*Math.tan(a)),d=Math.cos(l),f=Math.sin(l),p=Math.cos(u),m=Math.sin(u),g=d*p,_=d*m,y=f*m,b=f*p;let v,O,w,A,E,T=c,C=h.a.TWO_PI,x=Math.cos(T),S=Math.sin(T);do{x=Math.cos(T),S=Math.sin(T);const e=_-b*x;let t;w=Math.sqrt(p*p*S*S+e*e),O=y+g*x,v=Math.atan2(w,O),0===w?(t=0,A=1):(t=g*S/w,A=1-t*t),C=T,E=O-2*y/A,isFinite(E)||(E=0),T=c+Jm(s,t,A,v,w,O,E)}while(Math.abs(T-C)>h.a.EPSILON12);const I=A*(t*t-n*n)/(n*n),P=I*(256+I*(I*(74-47*I)-128))/1024,D=E*E,R=n*(1+I*(4096+I*(I*(320-175*I)-768))/16384)*(v-P*w*(E+P*(O*(2*D-1)-P*E*(4*w*w-3)*(4*D-3)/6)/4)),j=Math.atan2(p*S,_-b*x),M=Math.atan2(d*S,_*x-b);e._distance=R,e._startHeading=j,e._endHeading=M,e._uSquared=I}(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=R.clone(t,e._start),e._end=R.clone(n,e._end),e._start.height=0,e._end.height=0,function(e){const t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+s*s),l=c*s,u=Math.atan2(s,o),h=c*a,d=h*h,f=1-d,p=Math.sqrt(f),m=t/4,g=m*m,_=g*m,y=g*g,b=1+m-3*g/4+5*_/4-175*y/64,v=1-m+15*g/8-35*_/8,O=1-3*m+35*g/4,w=1-5*m,A=b*u-v*Math.sin(2*u)*m/2-O*Math.sin(4*u)*g/16-w*Math.sin(6*u)*_/48-5*Math.sin(8*u)*y/512,E=e._constants;E.a=n,E.b=i,E.f=r,E.cosineHeading=o,E.sineHeading=a,E.tanU=s,E.cosineU=c,E.sineU=l,E.sigma=u,E.sineAlpha=h,E.sineSquaredAlpha=d,E.cosineSquaredAlpha=f,E.cosineAlpha=p,E.u2Over4=m,E.u4Over16=g,E.u6Over64=_,E.u8Over256=y,E.a0=b,E.a1=v,E.a2=O,E.a3=w,E.distanceRatio=A}(e)}function eg(e,t,n){const i=Object(c.a)(n,H.WGS84);this._ellipsoid=i,this._start=new R,this._end=new R,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,Object(l.a)(e)&&Object(l.a)(t)&&Qm(this,e,t,i)}Object.defineProperties(eg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return s.a.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return s.a.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return s.a.defined("distance",this._distance),this._endHeading}}}),eg.prototype.setEndPoints=function(e,t){s.a.defined("start",e),s.a.defined("end",t),Qm(this,e,t,this._ellipsoid)},eg.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},eg.prototype.interpolateUsingSurfaceDistance=function(e,t){s.a.defined("distance",this._distance);const n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),a=Math.cos(6*i),c=Math.sin(2*i),u=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),f=i*i,p=i*f,m=n.u8Over256,g=n.u2Over4,_=n.u6Over64,y=n.u4Over16;let b=2*p*m*r/3+i*(1-g+7*y/4-15*_/4+579*m/64-(y-15*_/4+187*m/16)*r-(5*_/4-115*m/16)*o-29*m*a/16)+(g/2-y+71*_/32-85*m/16)*c+(5*y/16-5*_/4+383*m/96)*u-f*((_-11*m/2)*c+5*m*u/2)+(29*_/96-29*m/16)*h+539*m*d/1536;const v=Math.asin(Math.sin(b)*n.cosineAlpha),O=Math.atan(n.a/n.b*Math.tan(v));b-=n.sigma;const w=Math.cos(2*n.sigma+b),A=Math.sin(b),E=Math.cos(b),T=n.cosineU*E,C=n.sineU*A,x=Math.atan2(A*n.sineHeading,T-C*n.cosineHeading)-Jm(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,A,E,w);return Object(l.a)(t)?(t.longitude=this._start.longitude+x,t.latitude=O,t.height=0,t):new R(this._start.longitude+x,O,0)};var tg=eg;const ng={numberOfPoints:function(e,t,n){const i=O.distance(e,t);return Math.ceil(i/n)},numberOfPointsRhumbLine:function(e,t,n){const i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))}},ig=new R;ng.extractHeights=function(e,t){const n=e.length,i=new Array(n);for(let r=0;r<n;r++){const n=e[r];i[r]=t.cartesianToCartographic(n,ig).height}return i};const rg=new Me,og=new O,ag=new O,sg=new xi(O.UNIT_X,0),cg=new O,lg=new xi(O.UNIT_X,0),ug=new O,hg=new O,dg=[];function fg(e,t,n){const i=dg;let r;if(i.length=e,t===n){for(r=0;r<e;r++)i[r]=t;return i}const o=(n-t)/e;for(r=0;r<e;r++){const e=t+r*o;i[r]=e}return i}const pg=new R,mg=new R,gg=new O,_g=new O,yg=new O,bg=new tg;let vg=new Pp;function Og(e,t,n,i,r,o,a,s){const c=i.scaleToGeodeticSurface(e,_g),l=i.scaleToGeodeticSurface(t,yg),u=ng.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,pg),d=i.cartesianToCartographic(l,mg),f=fg(u,r,o);bg.setEndPoints(h,d);const p=bg.surfaceDistance/u;let m=s;h.height=r;let g=i.cartographicToCartesian(h,gg);O.pack(g,a,m),m+=3;for(let e=1;e<u;e++){const t=bg.interpolateUsingSurfaceDistance(e*p,mg);t.height=f[e],g=i.cartographicToCartesian(t,gg),O.pack(g,a,m),m+=3}return m}function wg(e,t,n,i,r,o,a,s){const c=i.cartesianToCartographic(e,pg),l=i.cartesianToCartographic(t,mg),u=ng.numberOfPointsRhumbLine(c,l,n);c.height=0,l.height=0;const h=fg(u,r,o);vg.ellipsoid.equals(i)||(vg=new Pp(void 0,void 0,i)),vg.setEndPoints(c,l);const d=vg.surfaceDistance/u;let f=s;c.height=r;let p=i.cartographicToCartesian(c,gg);O.pack(p,a,f),f+=3;for(let e=1;e<u;e++){const t=vg.interpolateUsingSurfaceDistance(e*d,mg);t.height=h[e],p=i.cartographicToCartesian(t,gg),O.pack(p,a,f),f+=3}return f}ng.wrapLongitude=function(e,t){const n=[],i=[];if(Object(l.a)(e)&&e.length>0){t=Object(c.a)(t,Me.IDENTITY);const r=Me.inverseTransformation(t,rg),o=Me.multiplyByPoint(r,O.ZERO,og),a=O.normalize(Me.multiplyByPointAsVector(r,O.UNIT_Y,ag),ag),s=xi.fromPointNormal(o,a,sg),u=O.normalize(Me.multiplyByPointAsVector(r,O.UNIT_X,cg),cg),h=xi.fromPointNormal(o,u,lg);let d=1;n.push(O.clone(e[0]));let f=n[0];const p=e.length;for(let t=1;t<p;++t){const r=e[t];if(xi.getPointDistance(h,f)<0||xi.getPointDistance(h,r)<0){const e=vi.lineSegmentPlane(f,r,s,ug);if(Object(l.a)(e)){const t=O.multiplyByScalar(a,5e-9,hg);xi.getPointDistance(s,f)<0&&O.negate(t,t),n.push(O.add(e,t,new O)),i.push(d+1),O.negate(t,t),n.push(O.add(e,t,new O)),d=1}}n.push(O.clone(e[t])),d++,f=r}i.push(d)}return{positions:n,lengths:i}},ng.generateArc=function(e){Object(l.a)(e)||(e={});const t=e.positions;if(!Object(l.a)(t))throw new u.a("options.positions is required.");const n=t.length,i=Object(c.a)(e.ellipsoid,H.WGS84);let r=Object(c.a)(e.height,0);const o=Array.isArray(r);if(n<1)return[];if(1===n){const e=i.scaleToGeodeticSurface(t[0],_g);if(r=o?r[0]:r,0!==r){const t=i.geodeticSurfaceNormal(e,gg);O.multiplyByScalar(t,r,t),O.add(e,t,e)}return[e.x,e.y,e.z]}let a=e.minDistance;if(!Object(l.a)(a)){const t=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE);a=h.a.chordLength(t,i.maximumRadius)}let s,d=0;for(s=0;s<n-1;s++)d+=ng.numberOfPoints(t[s],t[s+1],a);const f=3*(d+1),p=new Array(f);let m=0;for(s=0;s<n-1;s++){m=Og(t[s],t[s+1],a,i,o?r[s]:r,o?r[s+1]:r,p,m)}dg.length=0;const g=t[n-1],_=i.cartesianToCartographic(g,pg);_.height=o?r[n-1]:r;const y=i.cartographicToCartesian(_,gg);return O.pack(y,p,f-3),p};const Ag=new R,Eg=new R;ng.generateRhumbArc=function(e){Object(l.a)(e)||(e={});const t=e.positions;if(!Object(l.a)(t))throw new u.a("options.positions is required.");const n=t.length,i=Object(c.a)(e.ellipsoid,H.WGS84);let r=Object(c.a)(e.height,0);const o=Array.isArray(r);if(n<1)return[];if(1===n){const e=i.scaleToGeodeticSurface(t[0],_g);if(r=o?r[0]:r,0!==r){const t=i.geodeticSurfaceNormal(e,gg);O.multiplyByScalar(t,r,t),O.add(e,t,e)}return[e.x,e.y,e.z]}const a=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE);let s,d,f=0,p=i.cartesianToCartographic(t[0],Ag);for(s=0;s<n-1;s++)d=i.cartesianToCartographic(t[s+1],Eg),f+=ng.numberOfPointsRhumbLine(p,d,a),p=R.clone(d,Ag);const m=3*(f+1),g=new Array(m);let _=0;for(s=0;s<n-1;s++){_=wg(t[s],t[s+1],a,i,o?r[s]:r,o?r[s+1]:r,g,_)}dg.length=0;const y=t[n-1],b=i.cartesianToCartographic(y,pg);b.height=o?r[n-1]:r;const v=i.cartographicToCartesian(b,gg);return O.pack(v,g,m-3),g},ng.generateCartesianArc=function(e){const t=ng.generateArc(e),n=t.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=O.unpack(t,3*e);return i},ng.generateCartesianRhumbArc=function(e){const t=ng.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let e=0;e<n;e++)i[e]=O.unpack(t,3*e);return i};var Tg=ng;const Cg=[new O,new O],xg=new O,Sg=new O,Ig=new O,Pg=new O,Dg=new O,Rg=new O,jg=new O,Mg=new O,Lg=new O,Ng=new O,Bg=new O,Fg={};let zg=new R;function kg(e,t,n,i){const r=e[0],o=e[1],a=O.angleBetween(r,o),s=Math.ceil(a/i),c=new Array(s);let l;if(t===n){for(l=0;l<s;l++)c[l]=t;return c.push(n),c}const u=(n-t)/s;for(l=1;l<s;l++){const e=t+l*u;c[l]=e}return c[0]=t,c.push(n),c}const Ug=new O,Vg=new O;const Hg=new O(-1,0,0);let Gg=new Me;const qg=new Me;let Wg=new ce;const Yg=ce.IDENTITY.clone(),Xg=new O,Kg=new _e,Jg=new O;function Zg(e,t,n,i,r,o,a,s){let c=Xg,l=Kg;Gg=ca.eastNorthUpToFixedFrame(e,r,Gg),c=Me.multiplyByPointAsVector(Gg,Hg,c),c=O.normalize(c,c);const u=function(e,t,n,i){const r=new ma(n,i),o=r.projectPointOntoPlane(O.add(n,e,Ug),Ug),a=r.projectPointOntoPlane(O.add(n,t,Vg),Vg),s=Vt.angleBetween(o,a);return a.x*o.y-a.y*o.x>=0?-s:s}(c,t,e,r);Wg=ce.fromRotationZ(u,Wg),Jg.z=o,Gg=Me.multiplyTransformation(Gg,Me.fromRotationTranslation(Wg,Jg,qg),Gg);const h=Yg;h[0]=a;for(let e=0;e<s;e++)for(let e=0;e<n.length;e+=3)l=O.fromArray(n,e,l),l=ce.multiplyByVector(h,l,l),l=Me.multiplyByPoint(Gg,l,l),i.push(l.x,l.y,l.z);return i}const $g=new O;function Qg(e,t,n,i,r,o,a){for(let s=0;s<e.length;s+=3){i=Zg(O.fromArray(e,s,$g),t,n,i,r,o[s/3],a,1)}return i}function e_(e,t){const n=e.length,i=new Array(3*n);let r=0;const o=t.x+t.width/2,a=t.y+t.height/2;for(let t=0;t<n;t++)i[r++]=e[t].x-o,i[r++]=0,i[r++]=e[t].y-a;return i}const t_=new To,n_=new O,i_=new ce;function r_(e,t,n,i,r,o,a,s,c,l){const u=O.angleBetween(O.subtract(t,e,Ng),O.subtract(n,e,Bg)),d=i===Km.BEVELED?0:Math.ceil(u/h.a.toRadians(5));let f,p,m;if(f=r?ce.fromQuaternion(To.fromAxisAngle(O.negate(e,Ng),u/(d+1),t_),i_):ce.fromQuaternion(To.fromAxisAngle(e,u/(d+1),t_),i_),t=O.clone(t,n_),d>0){const n=l?2:1;for(let i=0;i<d;i++)t=ce.multiplyByVector(f,t,t),p=O.subtract(t,e,Ng),p=O.normalize(p,p),r||(p=O.negate(p,p)),m=o.scaleToGeodeticSurface(t,Bg),a=Zg(m,p,s,a,o,c,1,n)}else p=O.subtract(t,e,Ng),p=O.normalize(p,p),r||(p=O.negate(p,p)),m=o.scaleToGeodeticSurface(t,Bg),a=Zg(m,p,s,a,o,c,1,1),n=O.clone(n,n_),p=O.subtract(n,e,Ng),p=O.normalize(p,p),r||(p=O.negate(p,p)),m=o.scaleToGeodeticSurface(n,Bg),a=Zg(m,p,s,a,o,c,1,1);return a}Fg.removeDuplicatesFromShape=function(e){const t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){const t=e[i],o=e[r];Vt.equals(t,o)||n.push(o)}return n},Fg.angleIsGreaterThanPi=function(e,t,n,i){const r=new ma(n,i),o=r.projectPointOntoPlane(O.add(n,e,Ug),Ug),a=r.projectPointOntoPlane(O.add(n,t,Vg),Vg);return a.x*o.y-a.y*o.x>=0};const o_=new O,a_=new O;Fg.computePositions=function(e,t,n,i,r){const o=i._ellipsoid,a=function(e,t){const n=new Array(e.length);for(let i=0;i<e.length;i++){const r=e[i];zg=t.cartesianToCartographic(r,zg),n[i]=zg.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}(e,o),s=i._granularity,c=i._cornerType,l=r?function(e,t){const n=e.length,i=new Array(6*n);let r=0;const o=t.x+t.width/2,a=t.y+t.height/2;let s=e[0];i[r++]=s.x-o,i[r++]=0,i[r++]=s.y-a;for(let t=1;t<n;t++){s=e[t];const n=s.x-o,c=s.y-a;i[r++]=n,i[r++]=0,i[r++]=c,i[r++]=n,i[r++]=0,i[r++]=c}return s=e[0],i[r++]=s.x-o,i[r++]=0,i[r++]=s.y-a,i}(t,n):e_(t,n),u=r?e_(t,n):void 0,d=n.height/2,f=n.width/2;let p=e.length,m=[],g=r?[]:void 0,_=xg,y=Sg,b=Ig,v=Pg,w=Dg,A=Rg,E=jg,T=Mg,C=Lg,x=e[0],S=e[1];v=o.geodeticSurfaceNormal(x,v),_=O.subtract(S,x,_),_=O.normalize(_,_),T=O.cross(v,_,T),T=O.normalize(T,T);let I,P,D=a[0],R=a[1];r&&(g=Zg(x,T,u,g,o,D+d,1,1)),C=O.clone(x,C),x=S,y=O.negate(_,y);for(let t=1;t<p-1;t++){const n=r?2:1;if(S=e[t+1],x.equals(S)){cl("Positions are too close and are considered equivalent with rounding error.");continue}_=O.subtract(S,x,_),_=O.normalize(_,_),b=O.add(_,y,b),b=O.normalize(b,b),v=o.geodeticSurfaceNormal(x,v);const i=O.multiplyByScalar(v,O.dot(_,v),o_);O.subtract(_,i,i),O.normalize(i,i);const u=O.multiplyByScalar(v,O.dot(y,v),a_);O.subtract(y,u,u),O.normalize(u,u);if(!h.a.equalsEpsilon(Math.abs(O.dot(i,u)),1,h.a.EPSILON7)){b=O.cross(b,v,b),b=O.cross(v,b,b),b=O.normalize(b,b);const e=1/Math.max(.25,O.magnitude(O.cross(b,y,Ng))),t=Fg.angleIsGreaterThanPi(_,y,x,o);t?(w=O.add(x,O.multiplyByScalar(b,e*f,b),w),A=O.add(w,O.multiplyByScalar(T,f,A),A),Cg[0]=O.clone(C,Cg[0]),Cg[1]=O.clone(A,Cg[1]),I=kg(Cg,D+d,R+d,s),P=Tg.generateArc({positions:Cg,granularity:s,ellipsoid:o}),m=Qg(P,T,l,m,o,I,1),T=O.cross(v,_,T),T=O.normalize(T,T),E=O.add(w,O.multiplyByScalar(T,f,E),E),c===Km.ROUNDED||c===Km.BEVELED?r_(w,A,E,c,t,o,m,l,R+d,r):(b=O.negate(b,b),m=Zg(x,b,l,m,o,R+d,e,n)),C=O.clone(E,C)):(w=O.add(x,O.multiplyByScalar(b,e*f,b),w),A=O.add(w,O.multiplyByScalar(T,-f,A),A),Cg[0]=O.clone(C,Cg[0]),Cg[1]=O.clone(A,Cg[1]),I=kg(Cg,D+d,R+d,s),P=Tg.generateArc({positions:Cg,granularity:s,ellipsoid:o}),m=Qg(P,T,l,m,o,I,1),T=O.cross(v,_,T),T=O.normalize(T,T),E=O.add(w,O.multiplyByScalar(T,-f,E),E),c===Km.ROUNDED||c===Km.BEVELED?r_(w,A,E,c,t,o,m,l,R+d,r):m=Zg(x,b,l,m,o,R+d,e,n),C=O.clone(E,C)),y=O.negate(_,y)}else m=Zg(C,T,l,m,o,D+d,1,1),C=x;D=R,R=a[t+1],x=S}Cg[0]=O.clone(C,Cg[0]),Cg[1]=O.clone(x,Cg[1]),I=kg(Cg,D+d,R+d,s),P=Tg.generateArc({positions:Cg,granularity:s,ellipsoid:o}),m=Qg(P,T,l,m,o,I,1),r&&(g=Zg(x,T,u,g,o,R+d,1,1)),p=m.length;const j=r?p+g.length:p,M=new Float64Array(j);return M.set(m),r&&M.set(g,p),M};var s_=Fg;const c_={},l_=new O,u_=new O,h_=new O,d_=new O,f_=[new O,new O],p_=new O,m_=new O,g_=new O,__=new O,y_=new O,b_=new O,v_=new O,O_=new O,w_=new O,A_=new O,E_=new To,T_=new ce;function C_(e,t,n,i,r){const o=O.angleBetween(O.subtract(t,e,l_),O.subtract(n,e,u_)),a=i===Km.BEVELED?1:Math.ceil(o/h.a.toRadians(5))+1,s=3*a,c=new Array(s);let l;c[s-3]=n.x,c[s-2]=n.y,c[s-1]=n.z,l=r?ce.fromQuaternion(To.fromAxisAngle(O.negate(e,l_),o/a,E_),T_):ce.fromQuaternion(To.fromAxisAngle(e,o/a,E_),T_);let u=0;t=O.clone(t,l_);for(let e=0;e<a;e++)t=ce.multiplyByVector(l,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function x_(e,t,n,i){let r=l_;return i||(t=O.negate(t,t)),r=O.add(e,t,r),[r.x,r.y,r.z,n.x,n.y,n.z]}function S_(e,t,n,i){const r=new Array(e.length),o=new Array(e.length),a=O.multiplyByScalar(t,n,l_),s=O.negate(a,u_);let c=0,l=e.length-1;for(let t=0;t<e.length;t+=3){const n=O.fromArray(e,t,h_),i=O.add(n,s,d_);r[c++]=i.x,r[c++]=i.y,r[c++]=i.z;const u=O.add(n,a,d_);o[l--]=u.z,o[l--]=u.y,o[l--]=u.x}return i.push(r,o),i}c_.addAttribute=function(e,t,n,i){const r=t.x,o=t.y,a=t.z;Object(l.a)(n)&&(e[n]=r,e[n+1]=o,e[n+2]=a),Object(l.a)(i)&&(e[i]=a,e[i-1]=o,e[i-2]=r)};const I_=new O,P_=new O;c_.computePositions=function(e){const t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,a=e.saveAttributes;let s=p_,c=m_,l=g_,u=__,d=y_,f=b_,p=v_,m=O_,g=w_,_=A_,y=[];const b=a?[]:void 0,v=a?[]:void 0;let w,A=n[0],E=n[1];c=O.normalize(O.subtract(E,A,c),c),s=i.geodeticSurfaceNormal(A,s),u=O.normalize(O.cross(s,c,u),u),a&&(b.push(u.x,u.y,u.z),v.push(s.x,s.y,s.z)),p=O.clone(A,p),A=E,l=O.negate(c,l);const T=[];let C;const x=n.length;for(C=1;C<x-1;C++){s=i.geodeticSurfaceNormal(A,s),E=n[C+1],c=O.normalize(O.subtract(E,A,c),c),d=O.normalize(O.add(c,l,d),d);const e=O.multiplyByScalar(s,O.dot(c,s),I_);O.subtract(c,e,e),O.normalize(e,e);const x=O.multiplyByScalar(s,O.dot(l,s),P_);O.subtract(l,x,x),O.normalize(x,x);if(!h.a.equalsEpsilon(Math.abs(O.dot(e,x)),1,h.a.EPSILON7)){d=O.cross(d,s,d),d=O.cross(s,d,d),d=O.normalize(d,d);const e=r/Math.max(.25,O.magnitude(O.cross(d,l,l_))),n=s_.angleIsGreaterThanPi(c,l,A,i);d=O.multiplyByScalar(d,e,d),n?(m=O.add(A,d,m),_=O.add(m,O.multiplyByScalar(u,r,_),_),g=O.add(m,O.multiplyByScalar(u,2*r,g),g),f_[0]=O.clone(p,f_[0]),f_[1]=O.clone(_,f_[1]),w=Tg.generateArc({positions:f_,granularity:t,ellipsoid:i}),y=S_(w,u,r,y),a&&(b.push(u.x,u.y,u.z),v.push(s.x,s.y,s.z)),f=O.clone(g,f),u=O.normalize(O.cross(s,c,u),u),g=O.add(m,O.multiplyByScalar(u,2*r,g),g),p=O.add(m,O.multiplyByScalar(u,r,p),p),o===Km.ROUNDED||o===Km.BEVELED?T.push({leftPositions:C_(m,f,g,o,n)}):T.push({leftPositions:x_(A,O.negate(d,d),g,n)})):(g=O.add(A,d,g),_=O.add(g,O.negate(O.multiplyByScalar(u,r,_),_),_),m=O.add(g,O.negate(O.multiplyByScalar(u,2*r,m),m),m),f_[0]=O.clone(p,f_[0]),f_[1]=O.clone(_,f_[1]),w=Tg.generateArc({positions:f_,granularity:t,ellipsoid:i}),y=S_(w,u,r,y),a&&(b.push(u.x,u.y,u.z),v.push(s.x,s.y,s.z)),f=O.clone(m,f),u=O.normalize(O.cross(s,c,u),u),m=O.add(g,O.negate(O.multiplyByScalar(u,2*r,m),m),m),p=O.add(g,O.negate(O.multiplyByScalar(u,r,p),p),p),o===Km.ROUNDED||o===Km.BEVELED?T.push({rightPositions:C_(g,f,m,o,n)}):T.push({rightPositions:x_(A,d,m,n)})),l=O.negate(c,l)}A=E}let S;return s=i.geodeticSurfaceNormal(A,s),f_[0]=O.clone(p,f_[0]),f_[1]=O.clone(A,f_[1]),w=Tg.generateArc({positions:f_,granularity:t,ellipsoid:i}),y=S_(w,u,r,y),a&&(b.push(u.x,u.y,u.z),v.push(s.x,s.y,s.z)),o===Km.ROUNDED&&(S=function(e){let t=p_,n=m_,i=g_,r=e[1];n=O.fromArray(e[1],r.length-3,n),i=O.fromArray(e[0],0,i),t=O.midpoint(n,i,t);const o=C_(t,n,i,Km.ROUNDED,!1),a=e.length-1,s=e[a-1];return r=e[a],n=O.fromArray(s,s.length-3,n),i=O.fromArray(r,0,i),t=O.midpoint(n,i,t),[o,C_(t,n,i,Km.ROUNDED,!1)]}(y)),{positions:y,corners:T,lefts:b,normals:v,endPositions:S}};var D_=c_;const R_=new O,j_=new O,M_=new O,L_=new O,N_=new O,B_=new O,F_=new O,z_=new O;function k_(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function U_(e,t,n,i,r,o){const a=e.normals,s=e.tangents,c=e.bitangents,l=O.normalize(O.cross(n,t,F_),F_);o.normal&&D_.addAttribute(a,t,i,r),o.tangent&&D_.addAttribute(s,l,i,r),o.bitangent&&D_.addAttribute(c,n,i,r)}function V_(e,t,n){const i=e.positions,r=e.corners,o=e.endPositions,a=e.lefts,s=e.normals,c=new Ql;let u,d,f,p=0,m=0,g=0;for(d=0;d<i.length;d+=2)f=i[d].length-3,p+=f,g+=2*f,m+=i[d+1].length-3;for(p+=3,m+=3,d=0;d<r.length;d++){u=r[d];const e=r[d].leftPositions;Object(l.a)(e)?(f=e.length,p+=f,g+=f):(f=r[d].rightPositions.length,m+=f,g+=f)}const _=Object(l.a)(o);let y;_&&(y=o[0].length-3,p+=y,m+=y,y/=3,g+=6*y);const b=p+m,v=new Float64Array(b),w={normals:t.normal?new Float32Array(b):void 0,tangents:t.tangent?new Float32Array(b):void 0,bitangents:t.bitangent?new Float32Array(b):void 0};let A,E,T,C,x,S,I=0,P=b-1,D=R_,R=j_;const j=y/2,M=wc.createTypedArray(b/3,g);let L=0;if(_){S=M_,x=L_;const e=o[0];for(D=O.fromArray(s,0,D),R=O.fromArray(a,0,R),d=0;d<j;d++)S=O.fromArray(e,3*(j-1-d),S),x=O.fromArray(e,3*(j+d),x),D_.addAttribute(v,x,I),D_.addAttribute(v,S,void 0,P),U_(w,D,R,I,P,t),E=I/3,C=E+1,A=(P-2)/3,T=A-1,M[L++]=A,M[L++]=E,M[L++]=T,M[L++]=T,M[L++]=E,M[L++]=C,I+=3,P-=3}let N,B,F=0,z=0,k=i[F++],U=i[F++];for(v.set(k,I),v.set(U,P-U.length+1),R=O.fromArray(a,z,R),f=U.length-3,d=0;d<f;d+=3)N=n.geodeticSurfaceNormal(O.fromArray(k,d,F_),F_),B=n.geodeticSurfaceNormal(O.fromArray(U,f-d,z_),z_),D=O.normalize(O.add(N,B,D),D),U_(w,D,R,I,P,t),E=I/3,C=E+1,A=(P-2)/3,T=A-1,M[L++]=A,M[L++]=E,M[L++]=T,M[L++]=T,M[L++]=E,M[L++]=C,I+=3,P-=3;for(N=n.geodeticSurfaceNormal(O.fromArray(k,f,F_),F_),B=n.geodeticSurfaceNormal(O.fromArray(U,f,z_),z_),D=O.normalize(O.add(N,B,D),D),z+=3,d=0;d<r.length;d++){let e;u=r[d];const o=u.leftPositions,c=u.rightPositions;let h,p,m=B_,g=M_,_=L_;if(D=O.fromArray(s,z,D),Object(l.a)(o)){for(U_(w,D,R,void 0,P,t),P-=3,h=C,p=T,e=0;e<o.length/3;e++)m=O.fromArray(o,3*e,m),M[L++]=h,M[L++]=p-e-1,M[L++]=p-e,D_.addAttribute(v,m,void 0,P),g=O.fromArray(v,3*(p-e-1),g),_=O.fromArray(v,3*h,_),R=O.normalize(O.subtract(g,_,R),R),U_(w,D,R,void 0,P,t),P-=3;m=O.fromArray(v,3*h,m),g=O.subtract(O.fromArray(v,3*p,g),m,g),_=O.subtract(O.fromArray(v,3*(p-e),_),m,_),R=O.normalize(O.add(g,_,R),R),U_(w,D,R,I,void 0,t),I+=3}else{for(U_(w,D,R,I,void 0,t),I+=3,h=T,p=C,e=0;e<c.length/3;e++)m=O.fromArray(c,3*e,m),M[L++]=h,M[L++]=p+e,M[L++]=p+e+1,D_.addAttribute(v,m,I),g=O.fromArray(v,3*h,g),_=O.fromArray(v,3*(p+e),_),R=O.normalize(O.subtract(g,_,R),R),U_(w,D,R,I,void 0,t),I+=3;m=O.fromArray(v,3*h,m),g=O.subtract(O.fromArray(v,3*(p+e),g),m,g),_=O.subtract(O.fromArray(v,3*p,_),m,_),R=O.normalize(O.negate(O.add(_,g,R),R),R),U_(w,D,R,void 0,P,t),P-=3}for(k=i[F++],U=i[F++],k.splice(0,3),U.splice(U.length-3,3),v.set(k,I),v.set(U,P-U.length+1),f=U.length-3,z+=3,R=O.fromArray(a,z,R),e=0;e<U.length;e+=3)N=n.geodeticSurfaceNormal(O.fromArray(k,e,F_),F_),B=n.geodeticSurfaceNormal(O.fromArray(U,f-e,z_),z_),D=O.normalize(O.add(N,B,D),D),U_(w,D,R,I,P,t),C=I/3,E=C-1,T=(P-2)/3,A=T+1,M[L++]=A,M[L++]=E,M[L++]=T,M[L++]=T,M[L++]=E,M[L++]=C,I+=3,P-=3;I-=3,P+=3}if(D=O.fromArray(s,s.length-3,D),U_(w,D,R,I,P,t),_){I+=3,P-=3,S=M_,x=L_;const e=o[1];for(d=0;d<j;d++)S=O.fromArray(e,3*(y-d-1),S),x=O.fromArray(e,3*d,x),D_.addAttribute(v,S,void 0,P),D_.addAttribute(v,x,I),U_(w,D,R,I,P,t),C=I/3,E=C-1,T=(P-2)/3,A=T+1,M[L++]=A,M[L++]=E,M[L++]=T,M[L++]=T,M[L++]=E,M[L++]=C,I+=3,P-=3}if(c.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:v}),t.st){const e=new Float32Array(b/3*2);let t,n,i=0;if(_){p/=3,m/=3;const r=Math.PI/(y+1);let o;n=1/(p-y+1),t=1/(m-y+1);const a=y/2;for(d=a+1;d<y+1;d++)o=h.a.PI_OVER_TWO+r*d,e[i++]=t*(1+Math.cos(o)),e[i++]=.5*(1+Math.sin(o));for(d=1;d<m-y+1;d++)e[i++]=d*t,e[i++]=0;for(d=y;d>a;d--)o=h.a.PI_OVER_TWO-d*r,e[i++]=1-t*(1+Math.cos(o)),e[i++]=.5*(1+Math.sin(o));for(d=a;d>0;d--)o=h.a.PI_OVER_TWO-r*d,e[i++]=1-n*(1+Math.cos(o)),e[i++]=.5*(1+Math.sin(o));for(d=p-y;d>0;d--)e[i++]=d*n,e[i++]=1;for(d=1;d<a+1;d++)o=h.a.PI_OVER_TWO+r*d,e[i++]=n*(1+Math.cos(o)),e[i++]=.5*(1+Math.sin(o))}else{for(p/=3,m/=3,n=1/(p-1),t=1/(m-1),d=0;d<m;d++)e[i++]=d*t,e[i++]=0;for(d=p;d>0;d--)e[i++]=(d-1)*n,e[i++]=1}c.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:e})}return t.normal&&(c.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:w.normals})),t.tangent&&(c.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:w.tangents})),t.bitangent&&(c.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:w.bitangents})),{attributes:c,indices:M}}function H_(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){const r=e[i],o=e[i+1],a=e[i+2];n[t++]=r,n[t++]=o,n[t++]=a,n[t++]=r,n[t++]=o,n[t++]=a}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function G_(e,t){const n=new nu({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=V_(D_.computePositions(e),n,i),o=e.height,a=e.extrudedHeight;let s=r.attributes;const c=r.indices;let u=s.position.values,h=u.length;const d=new Float64Array(6*h);let f=new Float64Array(h);f.set(u);let p,m=new Float64Array(4*h);u=Qp.scaleToGeodeticHeight(u,o,i),m=H_(u,0,m),f=Qp.scaleToGeodeticHeight(f,a,i),m=H_(f,2*h,m),d.set(u),d.set(f,h),d.set(m,2*h),s.position.values=d,s=function(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;const n=e.position.values;let i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);const o=e.position.values.length/18,a=3*o,s=2*o,c=2*a;let l;if(t.normal||t.bitangent||t.tangent){const o=t.normal?new Float32Array(6*a):void 0,s=t.tangent?new Float32Array(6*a):void 0,u=t.bitangent?new Float32Array(6*a):void 0;let h=R_,d=j_,f=M_,p=L_,m=N_,g=B_,_=c;for(l=0;l<a;l+=3){const e=_+c;h=O.fromArray(n,l,h),d=O.fromArray(n,l+a,d),f=O.fromArray(n,(l+3)%a,f),d=O.subtract(d,h,d),f=O.subtract(f,h,f),p=O.normalize(O.cross(d,f,p),p),t.normal&&(D_.addAttribute(o,p,e),D_.addAttribute(o,p,e+3),D_.addAttribute(o,p,_),D_.addAttribute(o,p,_+3)),(t.tangent||t.bitangent)&&(g=O.fromArray(i,l,g),t.bitangent&&(D_.addAttribute(u,g,e),D_.addAttribute(u,g,e+3),D_.addAttribute(u,g,_),D_.addAttribute(u,g,_+3)),t.tangent&&(m=O.normalize(O.cross(g,p,m),m),D_.addAttribute(s,m,e),D_.addAttribute(s,m,e+3),D_.addAttribute(s,m,_),D_.addAttribute(s,m,_+3))),_+=6}if(t.normal){for(o.set(i),l=0;l<a;l+=3)o[l+a]=-i[l],o[l+a+1]=-i[l+1],o[l+a+2]=-i[l+2];e.normal.values=o}else e.normal=void 0;if(t.bitangent?(u.set(r),u.set(r,a),e.bitangent.values=u):e.bitangent=void 0,t.tangent){const t=e.tangent.values;s.set(t),s.set(t,a),e.tangent.values=s}}if(t.st){const t=e.st.values,n=new Float32Array(6*s);n.set(t),n.set(t,s);let i=2*s;for(let e=0;e<2;e++){for(n[i++]=t[0],n[i++]=t[1],l=2;l<s;l+=2){const e=t[l],r=t[l+1];n[i++]=e,n[i++]=r,n[i++]=e,n[i++]=r}n[i++]=t[0],n[i++]=t[1]}e.st.values=n}return e}(s,t);const g=h/3;if(e.shadowVolume){const e=s.normal.values;h=e.length;let n=new Float32Array(6*h);for(p=0;p<h;p++)e[p]=-e[p];n.set(e,h),n=H_(e,4*h,n),s.extrudeDirection=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:n}),t.normal||(s.normal=void 0)}if(Object(l.a)(e.offsetAttribute)){let t=new Uint8Array(6*g);if(e.offsetAttribute===eu.TOP)t=t.fill(1,0,g).fill(1,2*g,4*g);else{const n=e.offsetAttribute===eu.NONE?0:1;t=t.fill(n)}s.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}const _=c.length,y=g+g,b=wc.createTypedArray(d.length/3,2*_+3*y);b.set(c);let v,w,A,E,T=_;for(p=0;p<_;p+=3){const e=c[p],t=c[p+1],n=c[p+2];b[T++]=n+g,b[T++]=t+g,b[T++]=e+g}for(p=0;p<y;p+=2)v=p+y,w=v+y,A=v+1,E=w+1,b[T++]=v,b[T++]=w,b[T++]=A,b[T++]=A,b[T++]=w,b[T++]=E;return{attributes:s,indices:b}}const q_=new O,W_=new O,Y_=new R;function X_(e,t,n,i,r,o){const a=O.subtract(t,e,q_);O.normalize(a,a);const s=n.geodeticSurfaceNormal(e,W_),c=O.cross(a,s,q_);O.multiplyByScalar(c,i,c);let l=r.latitude,u=r.longitude,h=o.latitude,d=o.longitude;O.add(e,c,W_),n.cartesianToCartographic(W_,Y_);let f=Y_.latitude,p=Y_.longitude;l=Math.min(l,f),u=Math.min(u,p),h=Math.max(h,f),d=Math.max(d,p),O.subtract(e,c,W_),n.cartesianToCartographic(W_,Y_),f=Y_.latitude,p=Y_.longitude,l=Math.min(l,f),u=Math.min(u,p),h=Math.max(h,f),d=Math.max(d,p),r.latitude=l,r.longitude=u,o.latitude=h,o.longitude=d}const K_=new O,J_=new O,Z_=new R,$_=new R;function Q_(e,t,n,i,r){e=k_(e,t);const o=wl(e,O.equalsEpsilon),a=o.length;if(a<2||n<=0)return new Be;const s=.5*n;let c,u;if(Z_.latitude=Number.POSITIVE_INFINITY,Z_.longitude=Number.POSITIVE_INFINITY,$_.latitude=Number.NEGATIVE_INFINITY,$_.longitude=Number.NEGATIVE_INFINITY,i===Km.ROUNDED){const e=o[0];O.subtract(e,o[1],K_),O.normalize(K_,K_),O.multiplyByScalar(K_,s,K_),O.add(e,K_,J_),t.cartesianToCartographic(J_,Y_),c=Y_.latitude,u=Y_.longitude,Z_.latitude=Math.min(Z_.latitude,c),Z_.longitude=Math.min(Z_.longitude,u),$_.latitude=Math.max($_.latitude,c),$_.longitude=Math.max($_.longitude,u)}for(let e=0;e<a-1;++e)X_(o[e],o[e+1],t,s,Z_,$_);const h=o[a-1];O.subtract(h,o[a-2],K_),O.normalize(K_,K_),O.multiplyByScalar(K_,s,K_),O.add(h,K_,J_),X_(h,J_,t,s,Z_,$_),i===Km.ROUNDED&&(t.cartesianToCartographic(J_,Y_),c=Y_.latitude,u=Y_.longitude,Z_.latitude=Math.min(Z_.latitude,c),Z_.longitude=Math.min(Z_.longitude,u),$_.latitude=Math.max($_.latitude,c),$_.longitude=Math.max($_.longitude,u));const d=Object(l.a)(r)?r:new Be;return d.north=$_.latitude,d.south=Z_.latitude,d.east=$_.longitude,d.west=Z_.longitude,d}function ey(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,n=e.width;s.a.defined("options.positions",t),s.a.defined("options.width",n);const i=Object(c.a)(e.height,0),r=Object(c.a)(e.extrudedHeight,i);this._positions=t,this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._vertexFormat=nu.clone(Object(c.a)(e.vertexFormat,nu.DEFAULT)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=Object(c.a)(e.cornerType,Km.ROUNDED),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._shadowVolume=Object(c.a)(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*O.packedLength+H.packedLength+nu.packedLength+7}ey.pack=function(e,t,n){s.a.defined("value",e),s.a.defined("array",t),n=Object(c.a)(n,0);const i=e._positions,r=i.length;t[n++]=r;for(let e=0;e<r;++e,n+=O.packedLength)O.pack(i[e],t,n);return H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const ty=H.clone(H.UNIT_SPHERE),ny=new nu,iy={positions:void 0,ellipsoid:ty,vertexFormat:ny,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};ey.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=e[t++],r=new Array(i);for(let n=0;n<i;++n,t+=O.packedLength)r[n]=O.unpack(e,t);const o=H.unpack(e,t,ty);t+=H.packedLength;const a=nu.unpack(e,t,ny);t+=nu.packedLength;const u=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=1===e[t++],g=e[t];return Object(l.a)(n)?(n._positions=r,n._ellipsoid=H.clone(o,n._ellipsoid),n._vertexFormat=nu.clone(a,n._vertexFormat),n._width=u,n._height=h,n._extrudedHeight=d,n._cornerType=f,n._granularity=p,n._shadowVolume=m,n._offsetAttribute=-1===g?void 0:g,n):(iy.positions=r,iy.width=u,iy.height=h,iy.extrudedHeight=d,iy.cornerType=f,iy.granularity=p,iy.shadowVolume=m,iy.offsetAttribute=-1===g?void 0:g,new ey(iy))},ey.computeRectangle=function(e,t){const n=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,i=e.width;s.a.defined("options.positions",n),s.a.defined("options.width",i);return Q_(n,Object(c.a)(e.ellipsoid,H.WGS84),i,Object(c.a)(e.cornerType,Km.ROUNDED),t)},ey.createGeometry=function(e){let t=e._positions;const n=e._width,i=e._ellipsoid;t=k_(t,i);const r=wl(t,O.equalsEpsilon);if(r.length<2||n<=0)return;const o=e._height,a=e._extrudedHeight,s=!h.a.equalsEpsilon(o,a,0,h.a.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};let d;if(s)u.height=o,u.extrudedHeight=a,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,d=G_(u,c);else{if(d=V_(D_.computePositions(u),c,i),d.attributes.position.values=Qp.scaleToGeodeticHeight(d.attributes.position.values,o,i),Object(l.a)(e._offsetAttribute)){const t=e._offsetAttribute===eu.NONE?0:1,n=d.attributes.position.values.length,i=new Uint8Array(n/3).fill(t);d.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}}const f=d.attributes,p=At.fromVertices(f.position.values,void 0,3);return c.position||(d.attributes.position.values=void 0),new Zl({attributes:f,indices:d.indices,primitiveType:zl.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})},ey.createShadowVolume=function(e,t,n){const i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new ey({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:a,vertexFormat:nu.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(ey.prototype,{rectangle:{get:function(){return Object(l.a)(this._rectangle)||(this._rectangle=Q_(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var ry=ey;const oy=new O,ay=new O,sy=new O;function cy(e,t){const n=[],i=e.positions,r=e.corners,o=e.endPositions,a=new Ql;let s,c,u,h=0,d=0,f=0;for(c=0;c<i.length;c+=2)u=i[c].length-3,h+=u,f+=u/3*4,d+=i[c+1].length-3;for(h+=3,d+=3,c=0;c<r.length;c++){s=r[c];const e=r[c].leftPositions;Object(l.a)(e)?(u=e.length,h+=u,f+=u/3*2):(u=r[c].rightPositions.length,d+=u,f+=u/3*2)}const p=Object(l.a)(o);let m;p&&(m=o[0].length-3,h+=m,d+=m,m/=3,f+=4*m);const g=h+d,_=new Float64Array(g);let y,b,v,w,A,E,T=0,C=g-1;const x=m/2,S=wc.createTypedArray(g/3,f+4);let I=0;if(S[I++]=T/3,S[I++]=(C-2)/3,p){n.push(T/3),E=oy,A=ay;const e=o[0];for(c=0;c<x;c++)E=O.fromArray(e,3*(x-1-c),E),A=O.fromArray(e,3*(x+c),A),D_.addAttribute(_,A,T),D_.addAttribute(_,E,void 0,C),b=T/3,w=b+1,y=(C-2)/3,v=y-1,S[I++]=y,S[I++]=v,S[I++]=b,S[I++]=w,T+=3,C-=3}let P=0,D=i[P++],R=i[P++];for(_.set(D,T),_.set(R,C-R.length+1),u=R.length-3,n.push(T/3,(C-2)/3),c=0;c<u;c+=3)b=T/3,w=b+1,y=(C-2)/3,v=y-1,S[I++]=y,S[I++]=v,S[I++]=b,S[I++]=w,T+=3,C-=3;for(c=0;c<r.length;c++){let e;s=r[c];const o=s.leftPositions,a=s.rightPositions;let h,d=sy;if(Object(l.a)(o)){for(C-=3,h=v,n.push(w),e=0;e<o.length/3;e++)d=O.fromArray(o,3*e,d),S[I++]=h-e-1,S[I++]=h-e,D_.addAttribute(_,d,void 0,C),C-=3;n.push(h-Math.floor(o.length/6)),t===Km.BEVELED&&n.push((C-2)/3+1),T+=3}else{for(T+=3,h=w,n.push(v),e=0;e<a.length/3;e++)d=O.fromArray(a,3*e,d),S[I++]=h+e,S[I++]=h+e+1,D_.addAttribute(_,d,T),T+=3;n.push(h+Math.floor(a.length/6)),t===Km.BEVELED&&n.push(T/3-1),C-=3}for(D=i[P++],R=i[P++],D.splice(0,3),R.splice(R.length-3,3),_.set(D,T),_.set(R,C-R.length+1),u=R.length-3,e=0;e<R.length;e+=3)w=T/3,b=w-1,v=(C-2)/3,y=v+1,S[I++]=y,S[I++]=v,S[I++]=b,S[I++]=w,T+=3,C-=3;T-=3,C+=3,n.push(T/3,(C-2)/3)}if(p){T+=3,C-=3,E=oy,A=ay;const e=o[1];for(c=0;c<x;c++)E=O.fromArray(e,3*(m-c-1),E),A=O.fromArray(e,3*c,A),D_.addAttribute(_,E,void 0,C),D_.addAttribute(_,A,T),w=T/3,b=w-1,v=(C-2)/3,y=v+1,S[I++]=y,S[I++]=v,S[I++]=b,S[I++]=w,T+=3,C-=3;n.push(T/3)}else n.push(T/3,(C-2)/3);return S[I++]=T/3,S[I++]=(C-2)/3,a.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:a,indices:S,wallIndices:n}}function ly(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,n=e.width;s.a.typeOf.object("options.positions",t),s.a.typeOf.number("options.width",n);const i=Object(c.a)(e.height,0),r=Object(c.a)(e.extrudedHeight,i);this._positions=t,this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=Object(c.a)(e.cornerType,Km.ROUNDED),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*O.packedLength+H.packedLength+6}ly.pack=function(e,t,n){s.a.typeOf.object("value",e),s.a.typeOf.object("array",t),n=Object(c.a)(n,0);const i=e._positions,r=i.length;t[n++]=r;for(let e=0;e<r;++e,n+=O.packedLength)O.pack(i[e],t,n);return H.pack(e._ellipsoid,t,n),n+=H.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const uy=H.clone(H.UNIT_SPHERE),hy={positions:void 0,ellipsoid:uy,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};ly.unpack=function(e,t,n){s.a.typeOf.object("array",e),t=Object(c.a)(t,0);const i=e[t++],r=new Array(i);for(let n=0;n<i;++n,t+=O.packedLength)r[n]=O.unpack(e,t);const o=H.unpack(e,t,uy);t+=H.packedLength;const a=e[t++],u=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t];return Object(l.a)(n)?(n._positions=r,n._ellipsoid=H.clone(o,n._ellipsoid),n._width=a,n._height=u,n._extrudedHeight=h,n._cornerType=d,n._granularity=f,n._offsetAttribute=-1===p?void 0:p,n):(hy.positions=r,hy.width=a,hy.height=u,hy.extrudedHeight=h,hy.cornerType=d,hy.granularity=f,hy.offsetAttribute=-1===p?void 0:p,new ly(hy))},ly.createGeometry=function(e){let t=e._positions;const n=e._width,i=e._ellipsoid;t=function(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}(t,i);const r=wl(t,O.equalsEpsilon);if(r.length<2||n<=0)return;const o=e._height,a=e._extrudedHeight,s=!h.a.equalsEpsilon(o,a,0,h.a.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};let u;if(s)c.height=o,c.extrudedHeight=a,c.offsetAttribute=e._offsetAttribute,u=function(e){const t=e.ellipsoid,n=cy(D_.computePositions(e),e.cornerType),i=n.wallIndices,r=e.height,o=e.extrudedHeight,a=n.attributes,s=n.indices;let c=a.position.values,u=c.length,h=new Float64Array(u);h.set(c);const d=new Float64Array(2*u);if(c=Qp.scaleToGeodeticHeight(c,r,t),h=Qp.scaleToGeodeticHeight(h,o,t),d.set(c),d.set(h,u),a.position.values=d,u/=3,Object(l.a)(e.offsetAttribute)){let t=new Uint8Array(2*u);if(e.offsetAttribute===eu.TOP)t=t.fill(1,0,u);else{const n=e.offsetAttribute===eu.NONE?0:1;t=t.fill(n)}a.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}let f;const p=s.length,m=wc.createTypedArray(d.length/3,2*(p+i.length));m.set(s);let g,_,y=p;for(f=0;f<p;f+=2){const e=s[f],t=s[f+1];m[y++]=e+u,m[y++]=t+u}for(f=0;f<i.length;f++)g=i[f],_=g+u,m[y++]=g,m[y++]=_;return{attributes:a,indices:m}}(c);else{if(u=cy(D_.computePositions(c),c.cornerType),u.attributes.position.values=Qp.scaleToGeodeticHeight(u.attributes.position.values,o,i),Object(l.a)(e._offsetAttribute)){const t=u.attributes.position.values.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);u.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}}const d=u.attributes,f=At.fromVertices(d.position.values,void 0,3);return new Zl({attributes:d,indices:u.indices,primitiveType:zl.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var dy=ly;var fy=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))};let py;const my="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyNDBiMjBhOS1jZWE5LTRmYWYtOGI3Yy05ZDg3ODBiZDZiZjUiLCJpZCI6MjU5LCJpYXQiOjE2NTkzNjE0MTJ9.tXPPvw93XpCGHG71h7s_mMLlWGCuAL55o8LC309hLAg",gy={};gy.defaultAccessToken=my,gy.defaultServer=new Tt.a({url:"https://api.cesium.com/"}),gy.getDefaultTokenCredit=function(e){if(e===my){if(!Object(l.a)(py)){py=new ln('<b>             This application is using Cesium\'s default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i>             with an access token from your ion account before making any Cesium API calls.             You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>',!0)}return py}};var _y=gy;function yy(e,t){let n;s.a.defined("endpoint",e),s.a.defined("endpointResource",t);const i=e.externalType,r=Object(l.a)(i);if(r){if("3DTILES"!==i&&"STK_TERRAIN_SERVER"!==i)throw new ye.a("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");n={url:e.options.url}}else n={url:e.url,retryAttempts:1,retryCallback:by};Tt.a.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new rc.a(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r}function by(e,t){const n=Object(c.a)(e._ionRoot,e),i=n._ionEndpointResource,r="undefined"!=typeof Image;return Object(l.a)(t)&&(401===t.statusCode||r&&t.target instanceof Image)?(Object(l.a)(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then((function(e){return n._ionEndpoint=e,e})).finally((function(e){return n._pendingPromise=void 0,e}))),n._pendingPromise.then((function(t){return e._ionEndpoint=t,!0}))):Promise.resolve(!1)}Object(l.a)(Object.create)&&(yy.prototype=Object.create(Tt.a.prototype),yy.prototype.constructor=yy),yy.fromAssetId=function(e,t){const n=yy._createEndpointResource(e,t);return n.fetchJson().then((function(e){return new yy(e,n)}))},Object.defineProperties(yy.prototype,{credits:{get:function(){return Object(l.a)(this._ionRoot)?this._ionRoot.credits:(Object(l.a)(this._credits)||(this._credits=yy.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),yy.getCreditsFromEndpoint=function(e,t){const n=e.attributions.map(ln.getIonCredit),i=_y.getDefaultTokenCredit(t.queryParameters.access_token);return Object(l.a)(i)&&n.push(ln.clone(i)),n},yy.prototype.clone=function(e){const t=Object(c.a)(this._ionRoot,this);return Object(l.a)(e)||(e=new yy(t._ionEndpoint,t._ionEndpointResource)),(e=Tt.a.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},yy.prototype.fetchImage=function(e){if(!this._isExternal){const t=e;e={preferBlob:!0},Object(l.a)(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Tt.a.prototype.fetchImage.call(this,e)},yy.prototype._makeRequest=function(e){return this._isExternal||new rc.a(this.url).authority()!==this._ionEndpointDomain||(Object(l.a)(e.headers)||(e.headers={}),e.headers.Authorization="Bearer "+this._ionEndpoint.accessToken),Tt.a.prototype._makeRequest.call(this,e)},yy._createEndpointResource=function(e,t){s.a.defined("assetId",e),t=Object(c.a)(t,c.a.EMPTY_OBJECT);let n=Object(c.a)(t.server,_y.defaultServer);const i=Object(c.a)(t.accessToken,_y.defaultAccessToken);n=Tt.a.createIfNeeded(n);const r={url:`v1/assets/${e}/endpoint`};return Object(l.a)(i)&&(r.queryParameters={access_token:i}),n.getDerivedResource(r)};var vy=yy;var Oy=function(e){return e=Object(c.a)(e,c.a.EMPTY_OBJECT),new mh({url:vy.fromAssetId(1),requestVertexNormals:Object(c.a)(e.requestVertexNormals,!1),requestWaterMask:Object(c.a)(e.requestWaterMask,!1)})};function wy(e){this.planes=Object(c.a)(e,[])}const Ay=[new O,new O,new O];O.clone(O.UNIT_X,Ay[0]),O.clone(O.UNIT_Y,Ay[1]),O.clone(O.UNIT_Z,Ay[2]);const Ey=new O,Ty=new O,Cy=new xi(new O(1,0,0),0);wy.fromBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("boundingSphere is required.");Object(l.a)(t)||(t=new wy);const n=Ay.length,i=t.planes;i.length=2*n;const r=e.center,o=e.radius;let a=0;for(let e=0;e<n;++e){const t=Ay[e];let n=i[a],s=i[a+1];Object(l.a)(n)||(n=i[a]=new _e),Object(l.a)(s)||(s=i[a+1]=new _e),O.multiplyByScalar(t,-o,Ey),O.add(r,Ey,Ey),n.x=t.x,n.y=t.y,n.z=t.z,n.w=-O.dot(t,Ey),O.multiplyByScalar(t,o,Ey),O.add(r,Ey,Ey),s.x=-t.x,s.y=-t.y,s.z=-t.z,s.w=-O.dot(O.negate(t,Ty),Ey),a+=2}return t},wy.prototype.computeVisibility=function(e){if(!Object(l.a)(e))throw new u.a("boundingVolume is required.");const t=this.planes;let n=!1;for(let i=0,r=t.length;i<r;++i){const r=e.intersectPlane(xi.fromCartesian4(t[i],Cy));if(r===W.OUTSIDE)return W.OUTSIDE;r===W.INTERSECTING&&(n=!0)}return n?W.INTERSECTING:W.INSIDE},wy.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!Object(l.a)(e))throw new u.a("boundingVolume is required.");if(!Object(l.a)(t))throw new u.a("parentPlaneMask is required.");if(t===wy.MASK_OUTSIDE||t===wy.MASK_INSIDE)return t;let n=wy.MASK_INSIDE;const i=this.planes;for(let r=0,o=i.length;r<o;++r){const o=r<31?1<<r:0;if(r<31&&0==(t&o))continue;const a=e.intersectPlane(xi.fromCartesian4(i[r],Cy));if(a===W.OUTSIDE)return wy.MASK_OUTSIDE;a===W.INTERSECTING&&(n|=o)}return n},wy.MASK_OUTSIDE=4294967295,wy.MASK_INSIDE=0,wy.MASK_INDETERMINATE=2147483647;var xy=wy;function Sy(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.callback",e.callback),s.a.defined("options.width",e.width),s.a.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,Object(l.a)(this._tilingScheme)||(this._tilingScheme=new Gt({ellipsoid:Object(c.a)(e.ellipsoid,H.WGS84)})),this._width=e.width,this._height=e.height;const t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new un.a;let n=e.credit;"string"==typeof n&&(n=new ln(n)),this._credit=n,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(Sy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),Sy.prototype.requestTileGeometry=function(e,t,n,i){const r=this._callback(e,t,n);if(!Object(l.a)(r))return;const o=this._width,a=this._height;return Promise.resolve(r).then((function(e){let t=e;return Array.isArray(t)&&(t=new Float64Array(t)),new Fc({buffer:t,width:o,height:a})}))},Sy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},Sy.prototype.getTileDataAvailable=function(e,t,n){},Sy.prototype.loadTileDataAvailability=function(e,t,n){};var Iy=Sy;const Py={computePositions:function(e,t,n,i,r){const o=.5*e,a=-o,s=i+i,c=new Float64Array(3*(r?2*s:s));let l,u=0,d=0;const f=r?3*s:0,p=r?3*(s+i):3*i;for(l=0;l<i;l++){const e=l/i*h.a.TWO_PI,s=Math.cos(e),m=Math.sin(e),g=s*n,_=m*n,y=s*t,b=m*t;c[d+f]=g,c[d+f+1]=_,c[d+f+2]=a,c[d+p]=y,c[d+p+1]=b,c[d+p+2]=o,d+=3,r&&(c[u++]=g,c[u++]=_,c[u++]=a,c[u++]=y,c[u++]=b,c[u++]=o)}return c}};var Dy=Py;const Ry=new Vt,jy=new O,My=new O,Ly=new O,Ny=new O;function By(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).length,n=e.topRadius,i=e.bottomRadius,r=Object(c.a)(e.vertexFormat,nu.DEFAULT),o=Object(c.a)(e.slices,128);if(!Object(l.a)(t))throw new u.a("options.length must be defined.");if(!Object(l.a)(n))throw new u.a("options.topRadius must be defined.");if(!Object(l.a)(i))throw new u.a("options.bottomRadius must be defined.");if(o<3)throw new u.a("options.slices must be greater than or equal to 3.");if(Object(l.a)(e.offsetAttribute)&&e.offsetAttribute===eu.TOP)throw new u.a("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=nu.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}By.packedLength=nu.packedLength+5,By.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Fy=new nu,zy={vertexFormat:Fy,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};let ky;By.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");t=Object(c.a)(t,0);const i=nu.unpack(e,t,Fy);t+=nu.packedLength;const r=e[t++],o=e[t++],a=e[t++],s=e[t++],h=e[t];return Object(l.a)(n)?(n._vertexFormat=nu.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=a,n._slices=s,n._offsetAttribute=-1===h?void 0:h,n):(zy.length=r,zy.topRadius=o,zy.bottomRadius=a,zy.slices=s,zy.offsetAttribute=-1===h?void 0:h,new By(zy))},By.createGeometry=function(e){let t=e._length;const n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||0===n&&0===i)return;const a=o+o,s=o+a,c=a+a,u=Dy.computePositions(t,n,i,o,!0),d=r.st?new Float32Array(2*c):void 0,f=r.normal?new Float32Array(3*c):void 0,p=r.tangent?new Float32Array(3*c):void 0,m=r.bitangent?new Float32Array(3*c):void 0;let g;const _=r.normal||r.tangent||r.bitangent;if(_){const e=r.tangent||r.bitangent;let a=0,s=0,c=0;const l=Math.atan2(i-n,t),u=jy;u.z=Math.sin(l);const d=Math.cos(l);let y=Ly,b=My;for(g=0;g<o;g++){const t=g/o*h.a.TWO_PI,n=d*Math.cos(t),i=d*Math.sin(t);_&&(u.x=n,u.y=i,e&&(y=O.normalize(O.cross(O.UNIT_Z,u,y),y)),r.normal&&(f[a++]=u.x,f[a++]=u.y,f[a++]=u.z,f[a++]=u.x,f[a++]=u.y,f[a++]=u.z),r.tangent&&(p[s++]=y.x,p[s++]=y.y,p[s++]=y.z,p[s++]=y.x,p[s++]=y.y,p[s++]=y.z),r.bitangent&&(b=O.normalize(O.cross(u,y,b),b),m[c++]=b.x,m[c++]=b.y,m[c++]=b.z,m[c++]=b.x,m[c++]=b.y,m[c++]=b.z))}for(g=0;g<o;g++)r.normal&&(f[a++]=0,f[a++]=0,f[a++]=-1),r.tangent&&(p[s++]=1,p[s++]=0,p[s++]=0),r.bitangent&&(m[c++]=0,m[c++]=-1,m[c++]=0);for(g=0;g<o;g++)r.normal&&(f[a++]=0,f[a++]=0,f[a++]=1),r.tangent&&(p[s++]=1,p[s++]=0,p[s++]=0),r.bitangent&&(m[c++]=0,m[c++]=1,m[c++]=0)}const y=12*o-12,b=wc.createTypedArray(c,y);let v=0,w=0;for(g=0;g<o-1;g++)b[v++]=w,b[v++]=w+2,b[v++]=w+3,b[v++]=w,b[v++]=w+3,b[v++]=w+1,w+=2;for(b[v++]=a-2,b[v++]=0,b[v++]=1,b[v++]=a-2,b[v++]=1,b[v++]=a-1,g=1;g<o-1;g++)b[v++]=a+g+1,b[v++]=a+g,b[v++]=a;for(g=1;g<o-1;g++)b[v++]=s,b[v++]=s+g,b[v++]=s+g+1;let A=0;if(r.st){const e=Math.max(n,i);for(g=0;g<c;g++){const t=O.fromArray(u,3*g,Ny);d[A++]=(t.x+e)/(2*e),d[A++]=(t.y+e)/(2*e)}}const E=new Ql;r.position&&(E.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(E.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:f})),r.tangent&&(E.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(E.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:m})),r.st&&(E.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:d})),Ry.x=.5*t,Ry.y=Math.max(i,n);const T=new At(O.ZERO,Vt.magnitude(Ry));if(Object(l.a)(e._offsetAttribute)){t=u.length;const n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);E.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:E,indices:b,primitiveType:zl.TRIANGLES,boundingSphere:T,offsetAttribute:e._offsetAttribute})},By.getUnitCylinder=function(){return Object(l.a)(ky)||(ky=By.createGeometry(new By({topRadius:1,bottomRadius:1,length:1,vertexFormat:nu.POSITION_ONLY}))),ky};var Uy=By;const Vy=new Vt;function Hy(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).length,n=e.topRadius,i=e.bottomRadius,r=Object(c.a)(e.slices,128),o=Math.max(Object(c.a)(e.numberOfVerticalLines,16),0);if(s.a.typeOf.number("options.positions",t),s.a.typeOf.number("options.topRadius",n),s.a.typeOf.number("options.bottomRadius",i),s.a.typeOf.number.greaterThanOrEquals("options.slices",r,3),Object(l.a)(e.offsetAttribute)&&e.offsetAttribute===eu.TOP)throw new u.a("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}Hy.packedLength=6,Hy.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Gy={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Hy.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=e[t++],r=e[t++],o=e[t++],a=e[t++],u=e[t++],h=e[t];return Object(l.a)(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=a,n._numberOfVerticalLines=u,n._offsetAttribute=-1===h?void 0:h,n):(Gy.length=i,Gy.topRadius=r,Gy.bottomRadius=o,Gy.slices=a,Gy.numberOfVerticalLines=u,Gy.offsetAttribute=-1===h?void 0:h,new Hy(Gy))},Hy.createGeometry=function(e){let t=e._length;const n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||0===n&&0===i)return;const a=2*r,s=Dy.computePositions(t,n,i,r,!1);let c,u=2*r;if(o>0){const e=Math.min(o,r);c=Math.round(r/e),u+=e}const h=wc.createTypedArray(a,2*u);let d,f=0;for(d=0;d<r-1;d++)h[f++]=d,h[f++]=d+1,h[f++]=d+r,h[f++]=d+1+r;if(h[f++]=r-1,h[f++]=0,h[f++]=r+r-1,h[f++]=r,o>0)for(d=0;d<r;d+=c)h[f++]=d,h[f++]=d+r;const p=new Ql;p.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:s}),Vy.x=.5*t,Vy.y=Math.max(i,n);const m=new At(O.ZERO,Vt.magnitude(Vy));if(Object(l.a)(e._offsetAttribute)){t=s.length;const n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);p.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:p,indices:h,primitiveType:zl.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var qy=Hy;function Wy(e,t){if(Wy.passThroughDataForTesting)return t;s.a.typeOf.object("key",e),s.a.typeOf.object("data",t);const n=e.byteLength;if(0===n||n%4!=0)throw new ye.a("The length of key must be greater than 0 and a multiple of 4.");const i=new DataView(t),r=i.getUint32(0,!0);if(1953029805===r||2917034100===r)return t;const o=new DataView(e);let a=0;const c=t.byteLength,l=c-c%8,u=n;let h,d=8;for(;a<l;)for(d=(d+8)%24,h=d;a<l&&h<u;)i.setUint32(a,i.getUint32(a,!0)^o.getUint32(h,!0),!0),i.setUint32(a+4,i.getUint32(a+4,!0)^o.getUint32(h+4,!0),!0),a+=8,h+=24;if(a<c)for(h>=u&&(d=(d+8)%24,h=d);a<c;)i.setUint8(a,i.getUint8(a)^o.getUint8(h)),a++,h++}Wy.passThroughDataForTesting=!1;var Yy=Wy;const Xy=new R,Ky=new O;var Jy=function(e,t,n,i,r){const o=e.length/3,a=e.subarray(0,o),s=e.subarray(o,2*o),c=e.subarray(2*o,3*o);js.zigZagDeltaDecode(a,s,c);const l=new Float64Array(e.length);for(let e=0;e<o;++e){const o=a[e],u=s[e],d=c[e],f=h.a.lerp(t.west,t.east,o/32767),p=h.a.lerp(t.south,t.north,u/32767),m=h.a.lerp(n,i,d/32767),g=R.fromRadians(f,p,m,Xy),_=r.cartographicToCartesian(g,Ky);O.pack(_,l,3*e)}return l};function Zy(e){this.proxy=e}Zy.prototype.getURL=function(e){const t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)};var $y=Zy;function Qy(e,t){e=Object(c.a)(e,0),this._near=e,t=Object(c.a)(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(Qy.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),Qy.packedLength=2,Qy.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),t[n++]=e.near,t[n]=e.far,t},Qy.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");return t=Object(c.a)(t,0),Object(l.a)(n)||(n=new Qy),n.near=e[t++],n.far=e[t],n},Qy.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.near===t.near&&e.far===t.far},Qy.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)||(t=new Qy),t.near=e.near,t.far=e.far,t},Qy.prototype.clone=function(e){return Qy.clone(this,e)},Qy.prototype.equals=function(e){return Qy.equals(this,e)};var eb=Qy;function tb(e,t){if(e=Object(c.a)(e,0),(t=Object(c.a)(t,Number.MAX_VALUE))<=e)throw new u.a("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(tb.prototype,{componentDatatype:{get:function(){return gs.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),tb.fromDistanceDisplayCondition=function(e){if(!Object(l.a)(e))throw new u.a("distanceDisplayCondition is required.");if(e.far<=e.near)throw new u.a("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new tb(e.near,e.far)},tb.toValue=function(e,t){if(!Object(l.a)(e))throw new u.a("distanceDisplayCondition is required.");return Object(l.a)(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var nb=tb;function ib(e){s.a.typeOf.object("options",e),s.a.defined("options.comparator",e.comparator),Object(l.a)(e.maximumLength)&&s.a.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=Object(l.a)(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}function rb(e,t,n){const i=e._array,r=i[t];i[t]=i[n],i[n]=r}function ob(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function ab(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function sb(e,t){if(0===t)return;const n=Math.floor(h.a.log2(t+1))%2==0,i=Math.floor((t-1)/2),r=ob(e,t,i);for(r!==n&&(rb(e,t,i),t=i);t>=3;){const n=Math.floor((t-3)/4);if(ob(e,t,n)!==r)break;rb(e,t,n),t=n}}function cb(e,t){const n=e._length,i=Math.floor(h.a.log2(t+1))%2==0;let r;for(;(r=2*t+1)<n;){let o=r;const a=r+1;if(a<n){ob(e,a,o)===i&&(o=a);const t=2*r+1,s=Math.max(Math.min(n-t,4),0);for(let n=0;n<s;n++){const r=t+n;ob(e,r,o)===i&&(o=r)}}if(ob(e,o,t)===i&&(rb(e,o,t),o!==r&&o!==a)){const t=Math.floor((o-1)/2);ab(e,o,t)===i&&rb(e,o,t)}t=o}}Object.defineProperties(ib.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(Object(l.a)(e)){for(s.a.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}}),ib.prototype.clone=function(){const e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new ib({comparator:t,maximumLength:e});r._length=i;for(let e=0;e<i;e++)r._array[e]=n[e];return r},ib.prototype.reset=function(){this._length=0;const e=this._maximumLength;if(Object(l.a)(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0},ib.prototype.resort=function(){const e=this._length;for(let t=0;t<e;t++)sb(this,t)},ib.prototype.insert=function(e){let t;const n=this._maximumLength;if(Object(l.a)(n)){if(0===n)return;if(this._length===n){const n=this._array[0];if(this._comparator(e,n)<=0)return e;t=this.removeMinimum()}}const i=this._length;return this._array[i]=e,this._length++,sb(this,i),t},ib.prototype.removeMinimum=function(){const e=this._length;if(0===e)return;this._length--;const t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],cb(this,0)),this._array[e-1]=void 0,t},ib.prototype.removeMaximum=function(){const e=this._length;if(0===e)return;let t;if(this._length--,e<=2)t=this._array[e-1];else{const n=ab(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&cb(this,n)}return this._array[e-1]=void 0,t},ib.prototype.getMinimum=function(){if(0!==this._length)return this._array[0]},ib.prototype.getMaximum=function(){const e=this._length;if(0!==e)return e<=2?this._array[e-1]:this._array[ab(this,1,2)?1:2]};var lb=ib;function ub(){this.head=void 0,this.tail=void 0,this._length=0}function hb(e,t,n){this.item=e,this.previous=t,this.next=n}function db(e,t){Object(l.a)(t.previous)&&Object(l.a)(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):Object(l.a)(t.previous)?(t.previous.next=void 0,e.tail=t.previous):Object(l.a)(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}Object.defineProperties(ub.prototype,{length:{get:function(){return this._length}}}),ub.prototype.add=function(e){const t=new hb(e,this.tail,void 0);return Object(l.a)(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t},ub.prototype.remove=function(e){Object(l.a)(e)&&(db(this,e),--this._length)},ub.prototype.splice=function(e,t){if(e===t)return;db(this,t);const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var fb=ub,pb=n(73),mb=n.n(pb);const gb={LINEAR_NONE:mb.a.Easing.Linear.None,QUADRATIC_IN:mb.a.Easing.Quadratic.In,QUADRATIC_OUT:mb.a.Easing.Quadratic.Out,QUADRATIC_IN_OUT:mb.a.Easing.Quadratic.InOut,CUBIC_IN:mb.a.Easing.Cubic.In,CUBIC_OUT:mb.a.Easing.Cubic.Out,CUBIC_IN_OUT:mb.a.Easing.Cubic.InOut,QUARTIC_IN:mb.a.Easing.Quartic.In,QUARTIC_OUT:mb.a.Easing.Quartic.Out,QUARTIC_IN_OUT:mb.a.Easing.Quartic.InOut,QUINTIC_IN:mb.a.Easing.Quintic.In,QUINTIC_OUT:mb.a.Easing.Quintic.Out,QUINTIC_IN_OUT:mb.a.Easing.Quintic.InOut,SINUSOIDAL_IN:mb.a.Easing.Sinusoidal.In,SINUSOIDAL_OUT:mb.a.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:mb.a.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:mb.a.Easing.Exponential.In,EXPONENTIAL_OUT:mb.a.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:mb.a.Easing.Exponential.InOut,CIRCULAR_IN:mb.a.Easing.Circular.In,CIRCULAR_OUT:mb.a.Easing.Circular.Out,CIRCULAR_IN_OUT:mb.a.Easing.Circular.InOut,ELASTIC_IN:mb.a.Easing.Elastic.In,ELASTIC_OUT:mb.a.Easing.Elastic.Out,ELASTIC_IN_OUT:mb.a.Easing.Elastic.InOut,BACK_IN:mb.a.Easing.Back.In,BACK_OUT:mb.a.Easing.Back.Out,BACK_IN_OUT:mb.a.Easing.Back.InOut,BOUNCE_IN:mb.a.Easing.Bounce.In,BOUNCE_OUT:mb.a.Easing.Bounce.Out,BOUNCE_IN_OUT:mb.a.Easing.Bounce.InOut};var _b=Object.freeze(gb);const yb=new O,bb=new O,vb=new O,Ob=new O,wb=new O,Ab=new O(1,1,1),Eb=Math.cos,Tb=Math.sin;function Cb(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.radii,Ab),n=Object(c.a)(e.innerRadii,t),i=Object(c.a)(e.minimumClock,0),r=Object(c.a)(e.maximumClock,h.a.TWO_PI),o=Object(c.a)(e.minimumCone,0),a=Object(c.a)(e.maximumCone,h.a.PI),s=Math.round(Object(c.a)(e.stackPartitions,64)),l=Math.round(Object(c.a)(e.slicePartitions,64)),d=Object(c.a)(e.vertexFormat,nu.DEFAULT);if(l<3)throw new u.a("options.slicePartitions cannot be less than three.");if(s<3)throw new u.a("options.stackPartitions cannot be less than three.");this._radii=O.clone(t),this._innerRadii=O.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=l,this._vertexFormat=nu.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Cb.packedLength=2*O.packedLength+nu.packedLength+7,Cb.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),O.pack(e._radii,t,n),n+=O.packedLength,O.pack(e._innerRadii,t,n),n+=O.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const xb=new O,Sb=new O,Ib=new nu,Pb={radii:xb,innerRadii:Sb,vertexFormat:Ib,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};let Db;Cb.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");t=Object(c.a)(t,0);const i=O.unpack(e,t,xb);t+=O.packedLength;const r=O.unpack(e,t,Sb);t+=O.packedLength;const o=nu.unpack(e,t,Ib);t+=nu.packedLength;const a=e[t++],s=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=e[t];return Object(l.a)(n)?(n._radii=O.clone(i,n._radii),n._innerRadii=O.clone(r,n._innerRadii),n._vertexFormat=nu.clone(o,n._vertexFormat),n._minimumClock=a,n._maximumClock=s,n._minimumCone=h,n._maximumCone=d,n._stackPartitions=f,n._slicePartitions=p,n._offsetAttribute=-1===m?void 0:m,n):(Pb.minimumClock=a,Pb.maximumClock=s,Pb.minimumCone=h,Pb.maximumCone=d,Pb.stackPartitions=f,Pb.slicePartitions=p,Pb.offsetAttribute=-1===m?void 0:m,new Cb(Pb))},Cb.createGeometry=function(e){const t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;const n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;const i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,a=e._maximumCone,s=e._vertexFormat;let c,u,d=e._slicePartitions+1,f=e._stackPartitions+1;d=Math.round(d*Math.abs(r-i)/h.a.TWO_PI),f=Math.round(f*Math.abs(a-o)/h.a.PI),d<2&&(d=2),f<2&&(f=2);let p=0;const m=[o],g=[i];for(c=0;c<f;c++)m.push(o+c*(a-o)/(f-1));for(m.push(a),u=0;u<d;u++)g.push(i+u*(r-i)/(d-1));g.push(r);const _=m.length,y=g.length;let b=0,v=1;const w=n.x!==t.x||n.y!==t.y||n.z!==t.z;let A=!1,E=!1,T=!1;w&&(v=2,o>0&&(A=!0,b+=d-1),a<Math.PI&&(E=!0,b+=d-1),(r-i)%h.a.TWO_PI?(T=!0,b+=2*(f-1)+1):b+=1);const C=y*_*v,x=new Float64Array(3*C),S=new Array(C).fill(!1),I=new Array(C).fill(!1),P=d*f*v,D=6*(P+b+1-(d+f)*v),R=wc.createTypedArray(P,D),j=s.normal?new Float32Array(3*C):void 0,M=s.tangent?new Float32Array(3*C):void 0,L=s.bitangent?new Float32Array(3*C):void 0,N=s.st?new Float32Array(2*C):void 0,B=new Array(_),F=new Array(_);for(c=0;c<_;c++)B[c]=Tb(m[c]),F[c]=Eb(m[c]);const z=new Array(y),k=new Array(y);for(u=0;u<y;u++)k[u]=Eb(g[u]),z[u]=Tb(g[u]);for(c=0;c<_;c++)for(u=0;u<y;u++)x[p++]=t.x*B[c]*k[u],x[p++]=t.y*B[c]*z[u],x[p++]=t.z*F[c];let U,V,G,q,W=C/2;if(w)for(c=0;c<_;c++)for(u=0;u<y;u++)x[p++]=n.x*B[c]*k[u],x[p++]=n.y*B[c]*z[u],x[p++]=n.z*F[c],S[W]=!0,c>0&&c!==_-1&&0!==u&&u!==y-1&&(I[W]=!0),W++;for(p=0,c=1;c<_-2;c++)for(U=c*y,V=(c+1)*y,u=1;u<y-2;u++)R[p++]=V+u,R[p++]=V+u+1,R[p++]=U+u+1,R[p++]=V+u,R[p++]=U+u+1,R[p++]=U+u;if(w){const e=_*y;for(c=1;c<_-2;c++)for(U=e+c*y,V=e+(c+1)*y,u=1;u<y-2;u++)R[p++]=V+u,R[p++]=U+u,R[p++]=U+u+1,R[p++]=V+u,R[p++]=U+u+1,R[p++]=V+u+1}if(w){if(A)for(q=_*y,c=1;c<y-2;c++)R[p++]=c,R[p++]=c+1,R[p++]=q+c+1,R[p++]=c,R[p++]=q+c+1,R[p++]=q+c;if(E)for(G=_*y-y,q=_*y*v-y,c=1;c<y-2;c++)R[p++]=G+c+1,R[p++]=G+c,R[p++]=q+c,R[p++]=G+c+1,R[p++]=q+c,R[p++]=q+c+1}if(T){for(c=1;c<_-2;c++)q=y*_+y*c,G=y*c,R[p++]=q,R[p++]=G+y,R[p++]=G,R[p++]=q,R[p++]=q+y,R[p++]=G+y;for(c=1;c<_-2;c++)q=y*_+y*(c+1)-1,G=y*(c+1)-1,R[p++]=G+y,R[p++]=q,R[p++]=G,R[p++]=G+y,R[p++]=q+y,R[p++]=q}const Y=new Ql;s.position&&(Y.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:x}));let X=0,K=0,J=0,Z=0;const $=C/2;let Q;const ee=H.fromCartesian3(t),te=H.fromCartesian3(n);if(s.st||s.normal||s.tangent||s.bitangent){for(c=0;c<C;c++){Q=S[c]?te:ee;const e=O.fromArray(x,3*c,yb),t=Q.geodeticSurfaceNormal(e,bb);if(I[c]&&O.negate(t,t),s.st){const e=Vt.negate(t,wb);N[X++]=Math.atan2(e.y,e.x)/h.a.TWO_PI+.5,N[X++]=Math.asin(t.z)/Math.PI+.5}if(s.normal&&(j[K++]=t.x,j[K++]=t.y,j[K++]=t.z),s.tangent||s.bitangent){const e=vb;let n,i=0;if(S[c]&&(i=$),n=!A&&c>=i&&c<i+2*y?O.UNIT_X:O.UNIT_Z,O.cross(n,t,e),O.normalize(e,e),s.tangent&&(M[J++]=e.x,M[J++]=e.y,M[J++]=e.z),s.bitangent){const n=O.cross(t,e,Ob);O.normalize(n,n),L[Z++]=n.x,L[Z++]=n.y,L[Z++]=n.z}}}s.st&&(Y.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:N})),s.normal&&(Y.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:j})),s.tangent&&(Y.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:M})),s.bitangent&&(Y.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:L}))}if(Object(l.a)(e._offsetAttribute)){const t=x.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);Y.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:Y,indices:R,primitiveType:zl.TRIANGLES,boundingSphere:At.fromEllipsoid(ee),offsetAttribute:e._offsetAttribute})},Cb.getUnitEllipsoid=function(){return Object(l.a)(Db)||(Db=Cb.createGeometry(new Cb({radii:new O(1,1,1),vertexFormat:nu.POSITION_ONLY}))),Db};var Rb=Cb;const jb=new O(1,1,1),Mb=Math.cos,Lb=Math.sin;function Nb(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.radii,jb),n=Object(c.a)(e.innerRadii,t),i=Object(c.a)(e.minimumClock,0),r=Object(c.a)(e.maximumClock,h.a.TWO_PI),o=Object(c.a)(e.minimumCone,0),a=Object(c.a)(e.maximumCone,h.a.PI),s=Math.round(Object(c.a)(e.stackPartitions,10)),d=Math.round(Object(c.a)(e.slicePartitions,8)),f=Math.round(Object(c.a)(e.subdivisions,128));if(s<1)throw new u.a("options.stackPartitions cannot be less than 1");if(d<0)throw new u.a("options.slicePartitions cannot be less than 0");if(f<0)throw new u.a("options.subdivisions must be greater than or equal to zero.");if(Object(l.a)(e.offsetAttribute)&&e.offsetAttribute===eu.TOP)throw new u.a("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=O.clone(t),this._innerRadii=O.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=d,this._subdivisions=f,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}Nb.packedLength=2*O.packedLength+8,Nb.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),O.pack(e._radii,t,n),n+=O.packedLength,O.pack(e._innerRadii,t,n),n+=O.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Bb=new O,Fb=new O,zb={radii:Bb,innerRadii:Fb,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};Nb.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");t=Object(c.a)(t,0);const i=O.unpack(e,t,Bb);t+=O.packedLength;const r=O.unpack(e,t,Fb);t+=O.packedLength;const o=e[t++],a=e[t++],s=e[t++],h=e[t++],d=e[t++],f=e[t++],p=e[t++],m=e[t];return Object(l.a)(n)?(n._radii=O.clone(i,n._radii),n._innerRadii=O.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=a,n._minimumCone=s,n._maximumCone=h,n._stackPartitions=d,n._slicePartitions=f,n._subdivisions=p,n._offsetAttribute=-1===m?void 0:m,n):(zb.minimumClock=o,zb.maximumClock=a,zb.minimumCone=s,zb.maximumCone=h,zb.stackPartitions=d,zb.slicePartitions=f,zb.subdivisions=p,zb.offsetAttribute=-1===m?void 0:m,new Nb(zb))},Nb.createGeometry=function(e){const t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;const n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;const i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,a=e._maximumCone,s=e._subdivisions,c=H.fromCartesian3(t);let u=e._slicePartitions+1,d=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/h.a.TWO_PI),d=Math.round(d*Math.abs(a-o)/h.a.PI),u<2&&(u=2),d<2&&(d=2);let f=0,p=1;const m=n.x!==t.x||n.y!==t.y||n.z!==t.z;let g=!1,_=!1;m&&(p=2,o>0&&(g=!0,f+=u),a<Math.PI&&(_=!0,f+=u));const y=s*p*(d+u),b=new Float64Array(3*y),v=2*(y+f-(u+d)*p),O=wc.createTypedArray(y,v);let w,A,E,T,C=0;const x=new Array(d),S=new Array(d);for(w=0;w<d;w++)T=o+w*(a-o)/(d-1),x[w]=Lb(T),S[w]=Mb(T);const I=new Array(s),P=new Array(s);for(w=0;w<s;w++)E=i+w*(r-i)/(s-1),I[w]=Lb(E),P[w]=Mb(E);for(w=0;w<d;w++)for(A=0;A<s;A++)b[C++]=t.x*x[w]*P[A],b[C++]=t.y*x[w]*I[A],b[C++]=t.z*S[w];if(m)for(w=0;w<d;w++)for(A=0;A<s;A++)b[C++]=n.x*x[w]*P[A],b[C++]=n.y*x[w]*I[A],b[C++]=n.z*S[w];for(x.length=s,S.length=s,w=0;w<s;w++)T=o+w*(a-o)/(s-1),x[w]=Lb(T),S[w]=Mb(T);for(I.length=u,P.length=u,w=0;w<u;w++)E=i+w*(r-i)/(u-1),I[w]=Lb(E),P[w]=Mb(E);for(w=0;w<s;w++)for(A=0;A<u;A++)b[C++]=t.x*x[w]*P[A],b[C++]=t.y*x[w]*I[A],b[C++]=t.z*S[w];if(m)for(w=0;w<s;w++)for(A=0;A<u;A++)b[C++]=n.x*x[w]*P[A],b[C++]=n.y*x[w]*I[A],b[C++]=n.z*S[w];for(C=0,w=0;w<d*p;w++){const e=w*s;for(A=0;A<s-1;A++)O[C++]=e+A,O[C++]=e+A+1}let D=d*s*p;for(w=0;w<u;w++)for(A=0;A<s-1;A++)O[C++]=D+w+A*u,O[C++]=D+w+(A+1)*u;if(m)for(D=d*s*p+u*s,w=0;w<u;w++)for(A=0;A<s-1;A++)O[C++]=D+w+A*u,O[C++]=D+w+(A+1)*u;if(m){let e=d*s*p,t=e+s*u;if(g)for(w=0;w<u;w++)O[C++]=e+w,O[C++]=t+w;if(_)for(e+=s*u-u,t+=s*u-u,w=0;w<u;w++)O[C++]=e+w,O[C++]=t+w}const R=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:b})});if(Object(l.a)(e._offsetAttribute)){const t=b.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);R.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return new Zl({attributes:R,indices:O,primitiveType:zl.LINES,boundingSphere:At.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var kb=Nb;function Ub(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,Object(l.a)(this._tilingScheme)||(this._tilingScheme=new Gt({ellipsoid:Object(c.a)(e.ellipsoid,H.WGS84)})),this._levelZeroMaximumGeometricError=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new un.a,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(Ub.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}}),Ub.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Fc({buffer:new Uint8Array(256),width:16,height:16}))},Ub.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},Ub.prototype.getTileDataAvailable=function(e,t,n){},Ub.prototype.loadTileDataAvailability=function(e,t,n){};var Vb=Ub;function Hb(){this._removalFunctions=[]}Hb.prototype.add=function(e,t,n){if(!Object(l.a)(e))throw new u.a("event is required");const i=e.addEventListener(t,n);this._removalFunctions.push(i);const r=this;return function(){i();const e=r._removalFunctions;e.splice(e.indexOf(i),1)}},Hb.prototype.removeAll=function(){const e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Gb=Hb;var qb={enableModelExperimental:!1};var Wb=Object.freeze({NONE:0,HOLD:1,EXTRAPOLATE:2});function Yb(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=Object(c.a)(e.near,1),this._near=this.near,this.far=Object(c.a)(e.far,5e8),this._far=this.far,this._cullingVolume=new xy,this._orthographicMatrix=new Me}function Xb(e){if(!(Object(l.a)(e.right)&&Object(l.a)(e.left)&&Object(l.a)(e.top)&&Object(l.a)(e.bottom)&&Object(l.a)(e.near)&&Object(l.a)(e.far)))throw new u.a("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new u.a("right must be greater than left.");if(e.bottom>e.top)throw new u.a("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new u.a("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=Me.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(Yb.prototype,{projectionMatrix:{get:function(){return Xb(this),this._orthographicMatrix}}});const Kb=new O,Jb=new O,Zb=new O,$b=new O;Yb.prototype.computeCullingVolume=function(e,t,n){if(!Object(l.a)(e))throw new u.a("position is required.");if(!Object(l.a)(t))throw new u.a("direction is required.");if(!Object(l.a)(n))throw new u.a("up is required.");const i=this._cullingVolume.planes,r=this.top,o=this.bottom,a=this.right,s=this.left,c=this.near,h=this.far,d=O.cross(t,n,Kb);O.normalize(d,d);const f=Jb;O.multiplyByScalar(t,c,f),O.add(e,f,f);const p=Zb;O.multiplyByScalar(d,s,p),O.add(f,p,p);let m=i[0];return Object(l.a)(m)||(m=i[0]=new _e),m.x=d.x,m.y=d.y,m.z=d.z,m.w=-O.dot(d,p),O.multiplyByScalar(d,a,p),O.add(f,p,p),m=i[1],Object(l.a)(m)||(m=i[1]=new _e),m.x=-d.x,m.y=-d.y,m.z=-d.z,m.w=-O.dot(O.negate(d,$b),p),O.multiplyByScalar(n,o,p),O.add(f,p,p),m=i[2],Object(l.a)(m)||(m=i[2]=new _e),m.x=n.x,m.y=n.y,m.z=n.z,m.w=-O.dot(n,p),O.multiplyByScalar(n,r,p),O.add(f,p,p),m=i[3],Object(l.a)(m)||(m=i[3]=new _e),m.x=-n.x,m.y=-n.y,m.z=-n.z,m.w=-O.dot(O.negate(n,$b),p),m=i[4],Object(l.a)(m)||(m=i[4]=new _e),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-O.dot(t,f),O.multiplyByScalar(t,h,p),O.add(e,p,p),m=i[5],Object(l.a)(m)||(m=i[5]=new _e),m.x=-t.x,m.y=-t.y,m.z=-t.z,m.w=-O.dot(O.negate(t,$b),p),this._cullingVolume},Yb.prototype.getPixelDimensions=function(e,t,n,i,r){if(Xb(this),!Object(l.a)(e)||!Object(l.a)(t))throw new u.a("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new u.a("drawingBufferWidth must be greater than zero.");if(t<=0)throw new u.a("drawingBufferHeight must be greater than zero.");if(!Object(l.a)(n))throw new u.a("distance is required.");if(!Object(l.a)(i))throw new u.a("pixelRatio is required.");if(i<=0)throw new u.a("pixelRatio must be greater than zero.");if(!Object(l.a)(r))throw new u.a("A result object is required.");const o=i*(this.right-this.left)/e,a=i*(this.top-this.bottom)/t;return r.x=o,r.y=a,r},Yb.prototype.clone=function(e){return Object(l.a)(e)||(e=new Yb),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},Yb.prototype.equals=function(e){return Object(l.a)(e)&&e instanceof Yb&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},Yb.prototype.equalsEpsilon=function(e,t,n){return e===this||Object(l.a)(e)&&e instanceof Yb&&h.a.equalsEpsilon(this.right,e.right,t,n)&&h.a.equalsEpsilon(this.left,e.left,t,n)&&h.a.equalsEpsilon(this.top,e.top,t,n)&&h.a.equalsEpsilon(this.bottom,e.bottom,t,n)&&h.a.equalsEpsilon(this.near,e.near,t,n)&&h.a.equalsEpsilon(this.far,e.far,t,n)};var Qb=Yb;function ev(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._offCenterFrustum=new Qb,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=Object(c.a)(e.near,1),this._near=this.near,this.far=Object(c.a)(e.far,5e8),this._far=this.far}function tv(e){if(!(Object(l.a)(e.width)&&Object(l.a)(e.aspectRatio)&&Object(l.a)(e.near)&&Object(l.a)(e.far)))throw new u.a("width, aspectRatio, near, or far parameters are not set.");const t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new u.a("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new u.a("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;const n=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}ev.packedLength=4,ev.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t},ev.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new ev),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n},Object.defineProperties(ev.prototype,{projectionMatrix:{get:function(){return tv(this),this._offCenterFrustum.projectionMatrix}}}),ev.prototype.computeCullingVolume=function(e,t,n){return tv(this),this._offCenterFrustum.computeCullingVolume(e,t,n)},ev.prototype.getPixelDimensions=function(e,t,n,i,r){return tv(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)},ev.prototype.clone=function(e){return Object(l.a)(e)||(e=new ev),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},ev.prototype.equals=function(e){return!!(Object(l.a)(e)&&e instanceof ev)&&(tv(this),tv(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},ev.prototype.equalsEpsilon=function(e,t,n){return!!(Object(l.a)(e)&&e instanceof ev)&&(tv(this),tv(e),h.a.equalsEpsilon(this.width,e.width,t,n)&&h.a.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var nv=ev;function iv(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=Object(c.a)(e.near,1),this._near=this.near,this.far=Object(c.a)(e.far,5e8),this._far=this.far,this._cullingVolume=new xy,this._perspectiveMatrix=new Me,this._infinitePerspective=new Me}function rv(e){if(!(Object(l.a)(e.right)&&Object(l.a)(e.left)&&Object(l.a)(e.top)&&Object(l.a)(e.bottom)&&Object(l.a)(e.near)&&Object(l.a)(e.far)))throw new u.a("right, left, top, bottom, near, or far parameters are not set.");const t=e.top,n=e.bottom,i=e.right,r=e.left,o=e.near,a=e.far;if(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||a!==e._far){if(e.near<=0||e.near>e.far)throw new u.a("near must be greater than zero and less than far.");e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=a,e._perspectiveMatrix=Me.computePerspectiveOffCenter(r,i,n,t,o,a,e._perspectiveMatrix),e._infinitePerspective=Me.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective)}}Object.defineProperties(iv.prototype,{projectionMatrix:{get:function(){return rv(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return rv(this),this._infinitePerspective}}});const ov=new O,av=new O,sv=new O,cv=new O;iv.prototype.computeCullingVolume=function(e,t,n){if(!Object(l.a)(e))throw new u.a("position is required.");if(!Object(l.a)(t))throw new u.a("direction is required.");if(!Object(l.a)(n))throw new u.a("up is required.");const i=this._cullingVolume.planes,r=this.top,o=this.bottom,a=this.right,s=this.left,c=this.near,h=this.far,d=O.cross(t,n,ov),f=av;O.multiplyByScalar(t,c,f),O.add(e,f,f);const p=sv;O.multiplyByScalar(t,h,p),O.add(e,p,p);const m=cv;O.multiplyByScalar(d,s,m),O.add(f,m,m),O.subtract(m,e,m),O.normalize(m,m),O.cross(m,n,m),O.normalize(m,m);let g=i[0];return Object(l.a)(g)||(g=i[0]=new _e),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-O.dot(m,e),O.multiplyByScalar(d,a,m),O.add(f,m,m),O.subtract(m,e,m),O.cross(n,m,m),O.normalize(m,m),g=i[1],Object(l.a)(g)||(g=i[1]=new _e),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-O.dot(m,e),O.multiplyByScalar(n,o,m),O.add(f,m,m),O.subtract(m,e,m),O.cross(d,m,m),O.normalize(m,m),g=i[2],Object(l.a)(g)||(g=i[2]=new _e),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-O.dot(m,e),O.multiplyByScalar(n,r,m),O.add(f,m,m),O.subtract(m,e,m),O.cross(m,d,m),O.normalize(m,m),g=i[3],Object(l.a)(g)||(g=i[3]=new _e),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-O.dot(m,e),g=i[4],Object(l.a)(g)||(g=i[4]=new _e),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-O.dot(t,f),O.negate(t,m),g=i[5],Object(l.a)(g)||(g=i[5]=new _e),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-O.dot(m,p),this._cullingVolume},iv.prototype.getPixelDimensions=function(e,t,n,i,r){if(rv(this),!Object(l.a)(e)||!Object(l.a)(t))throw new u.a("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new u.a("drawingBufferWidth must be greater than zero.");if(t<=0)throw new u.a("drawingBufferHeight must be greater than zero.");if(!Object(l.a)(n))throw new u.a("distance is required.");if(!Object(l.a)(i))throw new u.a("pixelRatio is required");if(i<=0)throw new u.a("pixelRatio must be greater than zero.");if(!Object(l.a)(r))throw new u.a("A result object is required.");const o=1/this.near;let a=this.top*o;const s=2*i*n*a/t;a=this.right*o;const c=2*i*n*a/e;return r.x=c,r.y=s,r},iv.prototype.clone=function(e){return Object(l.a)(e)||(e=new iv),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},iv.prototype.equals=function(e){return Object(l.a)(e)&&e instanceof iv&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},iv.prototype.equalsEpsilon=function(e,t,n){return e===this||Object(l.a)(e)&&e instanceof iv&&h.a.equalsEpsilon(this.right,e.right,t,n)&&h.a.equalsEpsilon(this.left,e.left,t,n)&&h.a.equalsEpsilon(this.top,e.top,t,n)&&h.a.equalsEpsilon(this.bottom,e.bottom,t,n)&&h.a.equalsEpsilon(this.near,e.near,t,n)&&h.a.equalsEpsilon(this.far,e.far,t,n)};var lv=iv;function uv(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._offCenterFrustum=new lv,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=Object(c.a)(e.near,1),this._near=this.near,this.far=Object(c.a)(e.far,5e8),this._far=this.far,this.xOffset=Object(c.a)(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=Object(c.a)(e.yOffset,0),this._yOffset=this.yOffset}function hv(e){if(!(Object(l.a)(e.fov)&&Object(l.a)(e.aspectRatio)&&Object(l.a)(e.near)&&Object(l.a)(e.far)))throw new u.a("fov, aspectRatio, near, or far parameters are not set.");const t=e._offCenterFrustum;if(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset){if(e.fov<0||e.fov>=Math.PI)throw new u.a("fov must be in the range [0, PI).");if(e.aspectRatio<0)throw new u.a("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new u.a("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset}}uv.packedLength=6,uv.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t},uv.unpack=function(e,t,n){return s.a.defined("array",e),t=Object(c.a)(t,0),Object(l.a)(n)||(n=new uv),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n},Object.defineProperties(uv.prototype,{projectionMatrix:{get:function(){return hv(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return hv(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return hv(this),this._fovy}},sseDenominator:{get:function(){return hv(this),this._sseDenominator}}}),uv.prototype.computeCullingVolume=function(e,t,n){return hv(this),this._offCenterFrustum.computeCullingVolume(e,t,n)},uv.prototype.getPixelDimensions=function(e,t,n,i,r){return hv(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)},uv.prototype.clone=function(e){return Object(l.a)(e)||(e=new uv),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},uv.prototype.equals=function(e){return!!(Object(l.a)(e)&&e instanceof uv)&&(hv(this),hv(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},uv.prototype.equalsEpsilon=function(e,t,n){return!!(Object(l.a)(e)&&e instanceof uv)&&(hv(this),hv(e),h.a.equalsEpsilon(this.fov,e.fov,t,n)&&h.a.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var dv=uv;function fv(e){s.a.typeOf.object("options",e),s.a.typeOf.object("options.frustum",e.frustum),s.a.typeOf.object("options.origin",e.origin),s.a.typeOf.object("options.orientation",e.orientation);const t=e.frustum,n=e.orientation,i=e.origin,r=Object(c.a)(e.vertexFormat,nu.DEFAULT),o=Object(c.a)(e._drawNearPlane,!0);let a,l;t instanceof dv?(a=0,l=dv.packedLength):t instanceof nv&&(a=1,l=nv.packedLength),this._frustumType=a,this._frustum=t.clone(),this._origin=O.clone(i),this._orientation=To.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+l+O.packedLength+To.packedLength+nu.packedLength}fv.pack=function(e,t,n){s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0);const i=e._frustumType,r=e._frustum;return t[n++]=i,0===i?(dv.pack(r,t,n),n+=dv.packedLength):(nv.pack(r,t,n),n+=nv.packedLength),O.pack(e._origin,t,n),n+=O.packedLength,To.pack(e._orientation,t,n),n+=To.packedLength,nu.pack(e._vertexFormat,t,n),t[n+=nu.packedLength]=e._drawNearPlane?1:0,t};const pv=new dv,mv=new nv,gv=new To,_v=new O,yv=new nu;function bv(e,t,n,i,r,o,a,s){const c=e/3*2;for(let r=0;r<4;++r)Object(l.a)(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),Object(l.a)(n)&&(n[e]=a.x,n[e+1]=a.y,n[e+2]=a.z),Object(l.a)(i)&&(i[e]=s.x,i[e+1]=s.y,i[e+2]=s.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}fv.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=e[t++];let r;0===i?(r=dv.unpack(e,t,pv),t+=dv.packedLength):(r=nv.unpack(e,t,mv),t+=nv.packedLength);const o=O.unpack(e,t,_v);t+=O.packedLength;const a=To.unpack(e,t,gv);t+=To.packedLength;const u=nu.unpack(e,t,yv),h=1===e[t+=nu.packedLength];if(!Object(l.a)(n))return new fv({frustum:r,origin:o,orientation:a,vertexFormat:u,_drawNearPlane:h});const d=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(d),n._frustumType=i,n._origin=O.clone(o,n._origin),n._orientation=To.clone(a,n._orientation),n._vertexFormat=nu.clone(u,n._vertexFormat),n._drawNearPlane=h,n};const vv=new ce,Ov=new Me,wv=new Me,Av=new O,Ev=new O,Tv=new O,Cv=new O,xv=new O,Sv=new O,Iv=new Array(3),Pv=new Array(4);Pv[0]=new _e(-1,-1,1,1),Pv[1]=new _e(1,-1,1,1),Pv[2]=new _e(1,1,1,1),Pv[3]=new _e(-1,1,1,1);const Dv=new Array(4);for(let e=0;e<4;++e)Dv[e]=new _e;fv._computeNearFarPlanes=function(e,t,n,i,r,o,a,s){const u=ce.fromQuaternion(t,vv);let h=Object(c.a)(o,Av),d=Object(c.a)(a,Ev),f=Object(c.a)(s,Tv);h=ce.getColumn(u,0,h),d=ce.getColumn(u,1,d),f=ce.getColumn(u,2,f),O.normalize(h,h),O.normalize(d,d),O.normalize(f,f),O.negate(h,h);const p=Me.computeView(e,f,d,h,Ov);let m,g;if(0===n){const e=i.projectionMatrix,t=Me.multiply(e,p,wv);g=Me.inverse(t,wv)}else m=Me.inverseTransformation(p,wv);Object(l.a)(g)?(Iv[0]=i.near,Iv[1]=i.far):(Iv[0]=0,Iv[1]=i.near,Iv[2]=i.far);for(let t=0;t<2;++t)for(let n=0;n<4;++n){let o=_e.clone(Pv[n],Dv[n]);if(Object(l.a)(g)){o=Me.multiplyByVector(g,o,o);const n=1/o.w;O.multiplyByScalar(o,n,o),O.subtract(o,e,o),O.normalize(o,o);const i=O.dot(f,o);O.multiplyByScalar(o,Iv[t]/i,o),O.add(o,e,o)}else{Object(l.a)(i._offCenterFrustum)&&(i=i._offCenterFrustum);const e=Iv[t],n=Iv[t+1];o.x=.5*(o.x*(i.right-i.left)+i.left+i.right),o.y=.5*(o.y*(i.top-i.bottom)+i.bottom+i.top),o.z=.5*(o.z*(e-n)-e-n),o.w=1,Me.multiplyByVector(m,o,o)}r[12*t+3*n]=o.x,r[12*t+3*n+1]=o.y,r[12*t+3*n+2]=o.z}},fv.createGeometry=function(e){const t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,a=e._vertexFormat,s=o?6:5;let c=new Float64Array(72);fv._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));const h=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:c})});if(Object(l.a)(a.normal)||Object(l.a)(a.tangent)||Object(l.a)(a.bitangent)||Object(l.a)(a.st)){const e=Object(l.a)(a.normal)?new Float32Array(12*s):void 0,t=Object(l.a)(a.tangent)?new Float32Array(12*s):void 0,n=Object(l.a)(a.bitangent)?new Float32Array(12*s):void 0,i=Object(l.a)(a.st)?new Float32Array(8*s):void 0,r=Av,c=Ev,d=Tv,f=O.negate(r,Cv),p=O.negate(c,xv),m=O.negate(d,Sv);u=0,o&&(bv(u,e,t,n,i,m,r,c),u+=12),bv(u,e,t,n,i,d,f,c),u+=12,bv(u,e,t,n,i,f,m,c),u+=12,bv(u,e,t,n,i,p,m,f),u+=12,bv(u,e,t,n,i,r,d,c),u+=12,bv(u,e,t,n,i,c,d,f),Object(l.a)(e)&&(h.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})),Object(l.a)(t)&&(h.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:t})),Object(l.a)(n)&&(h.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:n})),Object(l.a)(i)&&(h.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:i}))}const d=new Uint16Array(6*s);for(let e=0;e<s;++e){const t=6*e,n=4*e;d[t]=n,d[t+1]=n+1,d[t+2]=n+2,d[t+3]=n,d[t+4]=n+2,d[t+5]=n+3}return new Zl({attributes:h,indices:d,primitiveType:zl.TRIANGLES,boundingSphere:At.fromVertices(c)})};var Rv=fv;function jv(e){s.a.typeOf.object("options",e),s.a.typeOf.object("options.frustum",e.frustum),s.a.typeOf.object("options.origin",e.origin),s.a.typeOf.object("options.orientation",e.orientation);const t=e.frustum,n=e.orientation,i=e.origin,r=Object(c.a)(e._drawNearPlane,!0);let o,a;t instanceof dv?(o=0,a=dv.packedLength):t instanceof nv&&(o=1,a=nv.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=O.clone(i),this._orientation=To.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+a+O.packedLength+To.packedLength}jv.pack=function(e,t,n){s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0);const i=e._frustumType,r=e._frustum;return t[n++]=i,0===i?(dv.pack(r,t,n),n+=dv.packedLength):(nv.pack(r,t,n),n+=nv.packedLength),O.pack(e._origin,t,n),n+=O.packedLength,To.pack(e._orientation,t,n),t[n+=To.packedLength]=e._drawNearPlane?1:0,t};const Mv=new dv,Lv=new nv,Nv=new To,Bv=new O;jv.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=e[t++];let r;0===i?(r=dv.unpack(e,t,Mv),t+=dv.packedLength):(r=nv.unpack(e,t,Lv),t+=nv.packedLength);const o=O.unpack(e,t,Bv);t+=O.packedLength;const a=To.unpack(e,t,Nv),u=1===e[t+=To.packedLength];if(!Object(l.a)(n))return new jv({frustum:r,origin:o,orientation:a,_drawNearPlane:u});const h=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(h),n._frustumType=i,n._origin=O.clone(o,n._origin),n._orientation=To.clone(a,n._orientation),n._drawNearPlane=u,n},jv.createGeometry=function(e){const t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,a=new Float64Array(24);Rv._computeNearFarPlanes(i,r,t,n,a);const s=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a})});let c,l;const u=o?2:1,h=new Uint16Array(8*(u+1));let d=o?0:1;for(;d<2;++d)c=o?8*d:0,l=4*d,h[c]=l,h[c+1]=l+1,h[c+2]=l+1,h[c+3]=l+2,h[c+4]=l+2,h[c+5]=l+3,h[c+6]=l+3,h[c+7]=l;for(d=0;d<2;++d)c=8*(u+d),l=4*d,h[c]=l,h[c+1]=l+4,h[c+2]=l+1,h[c+3]=l+5,h[c+4]=l+2,h[c+5]=l+6,h[c+6]=l+3,h[c+7]=l+7;return new Zl({attributes:s,indices:h,primitiveType:zl.LINES,boundingSphere:At.fromVertices(a)})};var Fv=jv;function zv(){}zv.prototype.geocode=u.a.throwInstantiationError;var kv=zv;var Uv=Object.freeze({SEARCH:0,AUTOCOMPLETE:1});function Vv(){u.a.throwInstantiationError()}Vv.createGeometry=function(e){u.a.throwInstantiationError()};var Hv=Vv;var Gv=function(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.componentDatatype))throw new u.a("options.componentDatatype is required.");if(!Object(l.a)(e.componentsPerAttribute))throw new u.a("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new u.a("options.componentsPerAttribute must be between 1 and 4.");if(!Object(l.a)(e.value))throw new u.a("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=Object(c.a)(e.normalize,!1),this.value=e.value},qv=n(40),Wv=n(28);var Yv=function(e){if(!Object(l.a)(e))throw new u.a("uri is required.");const t=new rc.a(e);t.normalize();let n=t.path();const i=n.lastIndexOf("/");return-1!==i&&(n=n.substr(i+1)),n};var Xv=function(e,t,n){const i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o},Kv=n(21);var Jv=function(e,t){return t=Object(c.a)(t,0),Gu(e,t,Math.min(4,e.length))},Zv=n(74);var $v=function(e,t){return 0!=(e&t)};const Qv=[1,2,4,8];function eO(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}eO.clone=function(e,t){return Object(l.a)(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new eO(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t},eO.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},eO.prototype.hasSubtree=function(){return $v(this._bits,16)},eO.prototype.hasImagery=function(){return $v(this._bits,64)},eO.prototype.hasTerrain=function(){return $v(this._bits,128)},eO.prototype.hasChildren=function(){return $v(this._bits,15)},eO.prototype.hasChild=function(e){return $v(this._bits,Qv[e])},eO.prototype.getChildBitmask=function(){return 15&this._bits};var tO=eO,nO=n(31);const iO=function(e){const t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let n=0;n<t;++n)i[n]=e.charCodeAt(n);return n}('Eô½\vyâjE"’,ÍqøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðœk“¡½NuàA[ß@V\fÙ»r›|3SîOlÔq°{ÀEVZ­wUe\v3’*¬l5Å0sø3>mF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;Áěð<VqH‚\'UfYNe˜u£aF}a?A\0Ÿ×´4M·F°Õ¸Š\'{‹Ü+»Mg0ÈÑö\\Pú[/F›n5/\'C.ë\n\f^¥se4ål.jC\'c#U©?q{gC}:¯ÍâTUœýKÆâŸ/(íË\\Æ-fˆ§;/*"N°k.Ý\r•}}GºC²²+>Mª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êx점ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');function rO(e){s.a.defined("resourceOrUrl",e);let t=e;"string"==typeof t||t instanceof Tt.a||(s.a.typeOf.string("resourceOrUrl.url",e.url),t=e.url);const n=Tt.a.createIfNeeded(t);n.appendForwardSlash(),this._resource=n,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=h.a.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};const i=this;this._readyPromise=function(e){const t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!Object(l.a)(cO)){const e=Lt("ThirdParty/google-earth-dbroot-parser.js"),t=window.cesiumGoogleEarthDbRootParser;cO=Object(nO.a)(e).then((function(){sO=window.cesiumGoogleEarthDbRootParser(Zv),Object(l.a)(t)?window.cesiumGoogleEarthDbRootParser=t:delete window.cesiumGoogleEarthDbRootParser}))}return cO.then((function(){return t.fetchArrayBuffer()})).then((function(t){const n=sO.EncryptedDbRootProto.decode(new Uint8Array(t));let i=n.encryptionData,r=i.byteOffset,o=r+i.byteLength;const a=e.key=i.buffer.slice(r,o);i=n.dbrootData,r=i.byteOffset,o=r+i.byteLength;const s=i.buffer.slice(r,o);return oO.scheduleTask({buffer:s,type:"DbRoot",key:a},[s])})).then((function(t){const n=sO.DbRootProto.decode(new Uint8Array(t.buffer));if(e.imageryPresent=Object(c.a)(n.imageryPresent,e.imageryPresent),e.protoImagery=n.protoImagery,e.terrainPresent=Object(c.a)(n.terrainPresent,e.terrainPresent),Object(l.a)(n.endSnippet)&&Object(l.a)(n.endSnippet.model)){const t=n.endSnippet.model;e.negativeAltitudeExponentBias=Object(c.a)(t.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=Object(c.a)(t.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}Object(l.a)(n.databaseVersion)&&(e._quadPacketVersion=Object(c.a)(n.databaseVersion.quadtreeVersion,e._quadPacketVersion));const i=e.providers,r=Object(c.a)(n.providerInfo,[]),o=r.length;for(let e=0;e<o;++e){const t=r[e],n=t.copyrightString;Object(l.a)(n)&&(i[t.providerId]=new ln(n.value))}})).catch((function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=iO}))}(this).then((function(){return i.getQuadTreePacket("",i._quadPacketVersion)})).then((function(){return!0})).catch((function(e){const t=`An error occurred while accessing ${aO(i,"",1).url}.`;return Promise.reject(new ye.a(t))}))}Object.defineProperties(rO.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),rO.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){const n=1<<r;let o=0;$v(t,n)?$v(e,n)&&(o|=1):(o|=2,$v(e,n)||(o|=1)),i+=o}return i},rO.quadKeyToTileXY=function(e){let t=0,n=0;const i=e.length-1;for(let r=i;r>=0;--r){const o=1<<r,a=+e[i-r];$v(a,2)?$v(a,1)||(t|=o):(n|=o,$v(a,1)&&(t|=o))}return{x:t,y:n,level:i}},rO.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(Object(l.a)(t))return null!==t;let n,i=!0,r=e;for(;r.length>1;){if(n=r.substring(r.length-1),r=r.substring(0,r.length-1),t=this.getTileInformationFromQuadKey(r),Object(l.a)(t)){t.hasSubtree()||t.hasChild(parseInt(n))||(i=!1);break}if(null===t){i=!1;break}}return i};const oO=new _c("decodeGoogleEarthEnterprisePacket");function aO(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}let sO,cO;rO.prototype.getQuadTreePacket=function(e,t,n){t=Object(c.a)(t,1);const i=aO(this,e=Object(c.a)(e,""),t,n).fetchArrayBuffer();if(!Object(l.a)(i))return;const r=this._tileInfo,o=this.key;return i.then((function(t){return oO.scheduleTask({buffer:t,quadKey:e,type:"Metadata",key:o},[t]).then((function(t){let n,i=-1;if(""!==e){i=e.length+1;const o=t[e];n=r[e],n._bits|=o._bits,delete t[e]}const o=Object.keys(t);o.sort((function(e,t){return e.length-t.length}));const a=o.length;for(let e=0;e<a;++e){const a=o[e];if(null!==t[a]){const e=tO.clone(t[a]),o=a.length;if(o===i)e.setParent(n);else if(o>1){const t=r[a.substring(0,a.length-1)];e.setParent(t)}r[a]=e}else r[a]=null}}))}))},rO.prototype.populateSubtree=function(e,t,n,i){return function e(t,n,i){const r=t._tileInfo;let o,a=n,s=r[a];if(Object(l.a)(s)&&(!s.hasSubtree()||s.hasChildren()))return s;for(;void 0===s&&a.length>1;)a=a.substring(0,a.length-1),s=r[a];const c=t._subtreePromises;let u=c[a];if(Object(l.a)(u))return u.then((function(){return o=new zc.a({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),e(t,n,o)}));if(!Object(l.a)(s)||!s.hasSubtree())return Promise.reject(new ye.a("Couldn't load metadata for tile "+n));if(u=t.getQuadTreePacket(a,s.cnodeVersion,i),!Object(l.a)(u))return;return c[a]=u,u.then((function(){return o=new zc.a({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),e(t,n,o)})).finally((function(){delete c[a]}))}(this,rO.tileXYToQuadKey(e,t,n),i)},rO.prototype.getTileInformation=function(e,t,n){const i=rO.tileXYToQuadKey(e,t,n);return this._tileInfo[i]},rO.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};var lO=rO;function uO(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.buffer",e.buffer),s.a.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),s.a.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;const t=Object(c.a)(e.childTileMask,15);let n=3&t;n|=4&t?8:0,n|=8&t?4:0,this._childTileMask=n,this._createdByUpsampling=Object(c.a)(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(uO.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});const hO=new _c("createVerticesFromGoogleEarthEnterpriseBuffer"),dO=new _c("createVerticesFromGoogleEarthEnterpriseBuffer",bc.maximumAsynchronousTasks),fO=new Be,pO=new Be;uO.prototype.createMesh=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.tilingScheme",e.tilingScheme),s.a.typeOf.number("options.x",e.x),s.a.typeOf.number("options.y",e.y),s.a.typeOf.number("options.level",e.level);const t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=Object(c.a)(e.exaggeration,1),a=Object(c.a)(e.exaggerationRelativeHeight,0),u=Object(c.a)(e.throttle,!0),h=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,fO),t.tileXYToRectangle(n,i,r,pO);const d=h.cartographicToCartesian(Be.center(pO)),f=40075.16/(1<<r);this._skirtHeight=Math.min(8*f,1e3);const p=(u?dO:hO).scheduleTask({buffer:this._buffer,nativeRectangle:fO,rectangle:pO,relativeToCenter:d,ellipsoid:h,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!Object(l.a)(p))return;const m=this;return p.then((function(e){return m._mesh=new vc(d,new Float32Array(e.vertices),new Uint16Array(e.indices),e.indexCountWithoutSkirts,e.vertexCountWithoutSkirts,e.minimumHeight,e.maximumHeight,At.clone(e.boundingSphere3D),O.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,fs.clone(e.orientedBoundingBox),Ks.clone(e.encoding),e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),m._minimumHeight=e.minimumHeight,m._maximumHeight=e.maximumHeight,m._buffer=void 0,m._mesh}))},uO.prototype.interpolateHeight=function(e,t,n){const i=h.a.clamp((t-e.west)/e.width,0,1),r=h.a.clamp((n-e.south)/e.height,0,1);return Object(l.a)(this._mesh)?function(e,t,n){const i=e._mesh,r=i.vertices,o=i.encoding,a=i.indices;for(let e=0,i=a.length;e<i;e+=3){const i=a[e],s=a[e+1],c=a[e+2],l=o.decodeTextureCoordinates(r,i,gO),u=o.decodeTextureCoordinates(r,s,_O),h=o.decodeTextureCoordinates(r,c,yO),d=Yu.computeBarycentricCoordinates(t,n,l.x,l.y,u.x,u.y,h.x,h.y,bO);if(d.x>=-1e-15&&d.y>=-1e-15&&d.z>=-1e-15){const e=o.decodeHeight(r,i),t=o.decodeHeight(r,s),n=o.decodeHeight(r,c);return d.x*e+d.y*t+d.z*n}}return}(this,i,r):function(e,t,n,i){const r=e._buffer;let o=0,a=0,s=0;n>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);const c=new DataView(r);let l=0;for(let e=0;e<o;++e)l+=c.getUint32(l,!0),l+=OO;l+=OO,l+=2*EO;const u=h.a.toRadians(180*c.getFloat64(l,!0));l+=EO;const d=h.a.toRadians(180*c.getFloat64(l,!0));l+=EO;const f=i.width/u/2,p=i.height/d/2,m=c.getInt32(l,!0);l+=wO;const g=3*c.getInt32(l,!0);l+=wO,l+=wO;const _=new Array(m),y=new Array(m),b=new Array(m);let v;for(v=0;v<m;++v)_[v]=a+c.getUint8(l++)*f,y[v]=s+c.getUint8(l++)*p,b[v]=6371010*c.getFloat32(l,!0),l+=AO;const O=new Array(g);for(v=0;v<g;++v)O[v]=c.getUint16(l,!0),l+=vO;for(v=0;v<g;v+=3){const e=O[v],i=O[v+1],r=O[v+2],o=_[e],a=_[i],s=_[r],c=y[e],l=y[i],u=y[r],h=Yu.computeBarycentricCoordinates(t,n,o,c,a,l,s,u,bO);if(h.x>=-1e-15&&h.y>=-1e-15&&h.z>=-1e-15)return h.x*b[e]+h.y*b[i]+h.z*b[r]}return}(this,i,r,e)};const mO=new _c("upsampleQuantizedTerrainMesh",bc.maximumAsynchronousTasks);uO.prototype.upsample=function(e,t,n,i,r,o,a){s.a.typeOf.object("tilingScheme",e),s.a.typeOf.number("thisX",t),s.a.typeOf.number("thisY",n),s.a.typeOf.number("thisLevel",i),s.a.typeOf.number("descendantX",r),s.a.typeOf.number("descendantY",o),s.a.typeOf.number("descendantLevel",a);if(a-i>1)throw new u.a("Upsampling through more than one level at a time is not currently supported.");const c=this._mesh;if(!Object(l.a)(this._mesh))return;const h=2*t!==r,d=2*n===o,f=e.ellipsoid,p=e.tileXYToRectangle(r,o,a),m=mO.scheduleTask({vertices:c.vertices,indices:c.indices,indexCountWithoutSkirts:c.indexCountWithoutSkirts,vertexCountWithoutSkirts:c.vertexCountWithoutSkirts,encoding:c.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:h,isNorthChild:d,childRectangle:p,ellipsoid:f});if(!Object(l.a)(m))return;const g=this;return m.then((function(e){const t=new Uint16Array(e.vertices),n=wc.createTypedArray(t.length/3,e.indices),i=g._skirtHeight;return new oh({quantizedVertices:t,indices:n,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:At.clone(e.boundingSphere),orientedBoundingBox:fs.clone(e.orientedBoundingBox),horizonOcclusionPoint:O.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:i,southSkirtHeight:i,eastSkirtHeight:i,northSkirtHeight:i,childTileMask:0,createdByUpsampling:!0,credits:g._credits})}))},uO.prototype.isChildAvailable=function(e,t,n,i){s.a.typeOf.number("thisX",e),s.a.typeOf.number("thisY",t),s.a.typeOf.number("childX",n),s.a.typeOf.number("childY",i);let r=2;return n!==2*e&&++r,i!==2*t&&(r-=2),0!=(this._childTileMask&1<<r)},uO.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};const gO=new Vt,_O=new Vt,yO=new Vt,bO=new O;const vO=Uint16Array.BYTES_PER_ELEMENT,OO=Uint32Array.BYTES_PER_ELEMENT,wO=Int32Array.BYTES_PER_ELEMENT,AO=Float32Array.BYTES_PER_ELEMENT,EO=Float64Array.BYTES_PER_ELEMENT;var TO=uO;const CO=0,xO=1,SO=2,IO=3,PO=new tr;function DO(){this._terrainCache={},this._lastTidy=tr.now()}function RO(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url)&&!Object(l.a)(e.metadata))throw new u.a("options.url or options.metadata is required.");let t;if(Object(l.a)(e.metadata))t=e.metadata;else{const n=Tt.a.createIfNeeded(e.url);t=new lO(n)}this._metadata=t,this._tilingScheme=new Gt({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Be(-h.a.PI,-h.a.PI,h.a.PI,h.a.PI),ellipsoid:e.ellipsoid});let n=e.credit;"string"==typeof n&&(n=new ln(n)),this._credit=n,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new DO,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new un.a,this._ready=!1;const i=this;let r;this._readyPromise=t.readyPromise.then((function(e){if(!t.terrainPresent){const e=new ye.a(`The server ${t.url} doesn't have terrain`);return r=dl.reportError(r,i,i._errorEvent,e.message,void 0,void 0,void 0,e),Promise.reject(e)}return dl.reportSuccess(r),i._ready=e,e})).catch((function(e){return r=dl.reportError(r,i,i._errorEvent,e.message,void 0,void 0,void 0,e),Promise.reject(e)}))}DO.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:tr.now()}},DO.prototype.get=function(e){const t=this._terrainCache[e];if(Object(l.a)(t))return delete this._terrainCache[e],t.buffer},DO.prototype.tidy=function(){if(tr.now(PO),tr.secondsDifference(PO,this._lastTidy)>10){const e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){const n=t[i],r=e[n];tr.secondsDifference(PO,r.timestamp)>10&&delete e[n]}tr.clone(PO,this._lastTidy)}},Object.defineProperties(RO.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});const jO=new _c("decodeGoogleEarthEnterprisePacket");function MO(e,t,n){let i=t.getChildBitmask();if(t.terrainState===IO){i=0;for(let t=0;t<4;++t){const r=n.getTileInformationFromQuadKey(e+t.toString());Object(l.a)(r)&&r.hasTerrain()&&(i|=1<<t)}}return i}RO.prototype.requestTileGeometry=function(e,t,n,i){if(!this._ready)throw new u.a("requestTileGeometry must not be called before the terrain provider is ready.");const r=lO.tileXYToQuadKey(e,t,n),o=this._terrainCache,a=this._metadata,s=a.getTileInformationFromQuadKey(r);if(!Object(l.a)(s))return Promise.reject(new ye.a("Terrain tile doesn't exist"));let c=s.terrainState;Object(l.a)(c)||(c=s.terrainState=CO);const h=o.get(r);if(Object(l.a)(h)){const e=a.providers[s.terrainProvider];return Promise.resolve(new TO({buffer:h,childTileMask:MO(r,s,a),credits:Object(l.a)(e)?[e]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(o.tidy(),!s.ancestorHasTerrain)return Promise.resolve(new Fc({buffer:new Uint8Array(256),width:16,height:16}));if(c===xO)return Promise.reject(new ye.a("Terrain tile doesn't exist"));let d,f=r,p=-1;switch(c){case SO:p=s.terrainVersion;break;case IO:f=f.substring(0,f.length-1),d=a.getTileInformationFromQuadKey(f),p=d.terrainVersion;break;case CO:s.hasTerrain()?p=s.terrainVersion:(f=f.substring(0,f.length-1),d=a.getTileInformationFromQuadKey(f),Object(l.a)(d)&&d.hasTerrain()&&(p=d.terrainVersion))}if(p<0)return Promise.reject(new ye.a("Terrain tile doesn't exist"));const m=this._terrainPromises,g=this._terrainRequests;let _,y;if(Object(l.a)(m[f]))_=m[f],y=g[f];else{y=i;const e=function(e,t,n,i){return n=Object(l.a)(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}(this,f,p,y).fetchArrayBuffer();if(!Object(l.a)(e))return;_=e.then((function(e){return Object(l.a)(e)?jO.scheduleTask({buffer:e,type:"Terrain",key:a.key},[e]).then((function(e){const t=a.getTileInformationFromQuadKey(f);t.terrainState=SO,o.add(f,e[0]);const n=t.terrainProvider,i=e.length-1;for(let t=0;t<i;++t){const i=f+t.toString(),r=a.getTileInformationFromQuadKey(i);Object(l.a)(r)&&(o.add(i,e[t+1]),r.terrainState=IO,0===r.terrainProvider&&(r.terrainProvider=n))}})):Promise.reject(new ye.a("Failed to load terrain."))})),m[f]=_,g[f]=y,_=_.finally((function(){delete m[f],delete g[f]}))}return _.then((function(){const e=o.get(r);if(Object(l.a)(e)){const t=a.providers[s.terrainProvider];return new TO({buffer:e,childTileMask:MO(r,s,a),credits:Object(l.a)(t)?[t]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold})}return Promise.reject(new ye.a("Failed to load terrain."))})).catch((function(e){return y.state===kc.a.CANCELLED?(i.state=y.state,Promise.reject(e)):(s.terrainState=xO,Promise.reject(e))}))},RO.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},RO.prototype.getTileDataAvailable=function(e,t,n){const i=this._metadata;let r=lO.tileXYToQuadKey(e,t,n);const o=i.getTileInformation(e,t,n);if(null===o)return!1;if(Object(l.a)(o)){if(!o.ancestorHasTerrain)return!0;const e=o.terrainState;if(e===xO)return!1;if(!(Object(l.a)(e)&&e!==CO||(o.terrainState=CO,o.hasTerrain()))){r=r.substring(0,r.length-1);const e=i.getTileInformationFromQuadKey(r);if(!Object(l.a)(e)||!e.hasTerrain())return!1}return!0}if(i.isValid(r)){const r=new zc.a({throttle:!1,throttleByServer:!0,type:Uc.a.TERRAIN});i.populateSubtree(e,t,n,r)}return!1},RO.prototype.loadTileDataAvailability=function(e,t,n){};var LO=RO;const NO=[q,Zs],BO=NO.length,FO=Math.cos(h.a.toRadians(30)),zO=Math.cos(h.a.toRadians(150));function kO(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions;if(!Object(l.a)(t)||t.length<2)throw new u.a("At least two positions are required.");if(Object(l.a)(e.arcType)&&e.arcType!==vl.GEODESIC&&e.arcType!==vl.RHUMB)throw new u.a("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=Object(c.a)(e.width,1),this._positions=t,this.granularity=Object(c.a)(e.granularity,9999),this.loop=Object(c.a)(e.loop,!1),this.arcType=Object(c.a)(e.arcType,vl.GEODESIC),this._ellipsoid=H.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(kO.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+H.packedLength+1+1}}}),kO.setProjectionAndEllipsoid=function(e,t){let n=0;for(let e=0;e<BO;e++)if(t instanceof NO[e]){n=e;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const UO=new O,VO=new O,HO=new O;function GO(e,t,n,i,r){const o=ZO(i,e,0,UO),a=ZO(i,e,n,VO),s=ZO(i,t,0,HO),c=$O(a,o,VO),l=$O(s,o,HO);return O.cross(l,c,r),O.normalize(r,r)}const qO=new R,WO=new O,YO=new O,XO=new O;function KO(e,t,n,i,r,o,a,s,c,l,u){if(0===r)return;let h;o===vl.GEODESIC?h=new tg(e,t,a):o===vl.RHUMB&&(h=new Pp(e,t,a));const d=h.surfaceDistance;if(d<r)return;const f=GO(e,t,i,a,XO),p=Math.ceil(d/r),m=d/p;let g=m;const _=p-1;let y=s.length;for(let e=0;e<_;e++){const e=h.interpolateUsingSurfaceDistance(g,qO),t=ZO(a,e,n,WO),r=ZO(a,e,i,YO);O.pack(f,s,y),O.pack(t,c,y),O.pack(r,l,y),u.push(e.latitude),u.push(e.longitude),y+=3,g+=m}}const JO=new R;function ZO(e,t,n,i){return R.clone(t,JO),JO.height=n,R.toCartesian(JO,e,i)}function $O(e,t,n){return O.subtract(e,t,n),O.normalize(n,n),n}function QO(e,t,n,i){return i=$O(e,t,i),i=O.cross(i,n,i),i=O.normalize(i,i),i=O.cross(n,i,i)}kO.pack=function(e,t,n){s.a.typeOf.object("value",e),s.a.defined("array",t);let i=Object(c.a)(n,0);const r=e._positions,o=r.length;t[i++]=o;for(let e=0;e<o;++e){const n=r[e];O.pack(n,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,H.pack(e._ellipsoid,t,i),i+=H.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t},kO.unpack=function(e,t,n){s.a.defined("array",e);let i=Object(c.a)(t,0);const r=e[i++],o=new Array(r);for(let t=0;t<r;t++)o[t]=O.unpack(e,i),i+=3;const a=e[i++],u=1===e[i++],h=e[i++],d=H.unpack(e,i);i+=H.packedLength;const f=e[i++],p=1===e[i++];return Object(l.a)(n)||(n=new kO({positions:o})),n._positions=o,n.granularity=a,n.loop=u,n.arcType=h,n._ellipsoid=d,n._projectionIndex=f,n._scene3DOnly=p,n};const ew=new O,tw=new O,nw=new O,iw=new O;function rw(e,t,n,i,r){const o=$O(n,t,iw),a=QO(e,t,o,ew),s=QO(i,t,o,tw);if(h.a.equalsEpsilon(O.dot(a,s),-1,h.a.EPSILON5))return r=O.cross(o,a,r),r=O.normalize(r,r);r=O.add(s,a,r),r=O.normalize(r,r);const c=O.cross(o,r,nw);return O.dot(s,c)<0&&(r=O.negate(r,r)),r}const ow=xi.fromPointNormal(O.ZERO,O.UNIT_Y),aw=new O,sw=new O,cw=new O,lw=new O,uw=new O,hw=new O,dw=new R,fw=new R,pw=new R;kO.createGeometry=function(e){const t=!e._scene3DOnly;let n=e.loop;const i=e._ellipsoid,r=e.granularity,o=e.arcType,a=new NO[e._projectionIndex](i);let s,c;const u=e._positions,d=u.length;let f,p,m,g;2===d&&(n=!1);const _=new Pp(void 0,void 0,i);let y,b,v;const w=[u[0]];for(c=0;c<d-1;c++)f=u[c],p=u[c+1],y=vi.lineSegmentPlane(f,p,ow,hw),!Object(l.a)(y)||O.equalsEpsilon(y,f,h.a.EPSILON7)||O.equalsEpsilon(y,p,h.a.EPSILON7)||(e.arcType===vl.GEODESIC?w.push(O.clone(y)):e.arcType===vl.RHUMB&&(v=i.cartesianToCartographic(y,dw).longitude,m=i.cartesianToCartographic(f,dw),g=i.cartesianToCartographic(p,fw),_.setEndPoints(m,g),b=_.findIntersectionWithLongitude(v,pw),y=i.cartographicToCartesian(b,hw),!Object(l.a)(y)||O.equalsEpsilon(y,f,h.a.EPSILON7)||O.equalsEpsilon(y,p,h.a.EPSILON7)||w.push(O.clone(y)))),w.push(p);n&&(f=u[d-1],p=u[0],y=vi.lineSegmentPlane(f,p,ow,hw),!Object(l.a)(y)||O.equalsEpsilon(y,f,h.a.EPSILON7)||O.equalsEpsilon(y,p,h.a.EPSILON7)||(e.arcType===vl.GEODESIC?w.push(O.clone(y)):e.arcType===vl.RHUMB&&(v=i.cartesianToCartographic(y,dw).longitude,m=i.cartesianToCartographic(f,dw),g=i.cartesianToCartographic(p,fw),_.setEndPoints(m,g),b=_.findIntersectionWithLongitude(v,pw),y=i.cartographicToCartesian(b,hw),!Object(l.a)(y)||O.equalsEpsilon(y,f,h.a.EPSILON7)||O.equalsEpsilon(y,p,h.a.EPSILON7)||w.push(O.clone(y)))));let A=w.length,E=new Array(A);for(c=0;c<A;c++){const e=R.fromCartesian(w[c],i);e.height=0,E[c]=e}if(E=wl(E,R.equalsEpsilon),A=E.length,A<2)return;const T=[],C=[],x=[],S=[];let I=aw,P=sw,D=cw,j=lw,M=uw;const L=E[0],N=E[1];for(I=ZO(i,E[A-1],0,I),j=ZO(i,N,0,j),P=ZO(i,L,0,P),D=ZO(i,L,1e3,D),M=n?rw(I,P,D,j,M):GO(L,N,1e3,i,M),O.pack(M,C,0),O.pack(P,x,0),O.pack(D,S,0),T.push(L.latitude),T.push(L.longitude),KO(L,N,0,1e3,r,o,i,C,x,S,T),c=1;c<A-1;++c){I=O.clone(P,I),P=O.clone(j,P);const e=E[c];ZO(i,e,1e3,D),ZO(i,E[c+1],0,j),rw(I,P,D,j,M),s=C.length,O.pack(M,C,s),O.pack(P,x,s),O.pack(D,S,s),T.push(e.latitude),T.push(e.longitude),KO(E[c],E[c+1],0,1e3,r,o,i,C,x,S,T)}const B=E[A-1],F=E[A-2];if(P=ZO(i,B,0,P),D=ZO(i,B,1e3,D),n){const e=E[0];I=ZO(i,F,0,I),j=ZO(i,e,0,j),M=rw(I,P,D,j,M)}else M=GO(F,B,1e3,i,M);if(s=C.length,O.pack(M,C,s),O.pack(P,x,s),O.pack(D,S,s),T.push(B.latitude),T.push(B.longitude),n){for(KO(B,L,0,1e3,r,o,i,C,x,S,T),s=C.length,c=0;c<3;++c)C[s+c]=C[c],x[s+c]=x[c],S[s+c]=S[c];T.push(L.latitude),T.push(L.longitude)}return function(e,t,n,i,r,o,a){let s,c;const l=t._ellipsoid,u=n.length/3-1,d=8*u,f=4*d,p=36*u,m=d>65535?new Uint32Array(p):new Uint16Array(p),g=new Float64Array(3*d),_=new Float32Array(f),y=new Float32Array(f),b=new Float32Array(f),v=new Float32Array(f),w=new Float32Array(f);let A,E,T,C;a&&(A=new Float32Array(f),E=new Float32Array(f),T=new Float32Array(f),C=new Float32Array(2*d));const x=o.length/2;let S=0;const I=Iw;I.height=0;const P=Pw;P.height=0;let D=Dw,R=Rw;if(a)for(c=0,s=1;s<x;s++)I.latitude=o[c],I.longitude=o[c+1],P.latitude=o[c+2],P.longitude=o[c+3],D=t.project(I,D),R=t.project(P,R),S+=O.distance(D,R),c+=2;const j=i.length/3;R=O.unpack(i,0,R);let M,L=0;for(c=3,s=1;s<j;s++)D=O.clone(R,D),R=O.unpack(i,c,R),L+=O.distance(D,R),c+=3;c=3;let N=0,B=0,F=0,z=0,k=!1,U=O.unpack(n,0,Mw),V=O.unpack(i,0,Rw),H=O.unpack(r,0,Nw);if(e){const e=O.unpack(n,n.length-6,jw);yw(H,e,U,V)&&(H=O.negate(H,H))}let G=0,q=0,W=0;for(s=0;s<u;s++){const e=O.clone(U,jw),s=O.clone(V,Dw);let u,d,f,p,m=O.clone(H,Lw);if(k&&(m=O.negate(m,m)),U=O.unpack(n,c,Mw),V=O.unpack(i,c,Rw),H=O.unpack(r,c,Nw),k=yw(H,e,U,V),I.latitude=o[N],I.longitude=o[N+1],P.latitude=o[N+2],P.longitude=o[N+3],a){const e=Sw(I,P);u=t.project(I,Hw),d=t.project(P,Gw);const n=$O(d,u,tA);n.y=Math.abs(n.y),f=qw,p=Ww,0===e||O.dot(n,O.UNIT_Y)>FO?(f=ww(t,I,m,u,qw),p=ww(t,P,H,d,Ww)):1===e?(p=ww(t,P,H,d,Ww),f.x=0,f.y=h.a.sign(I.longitude-Math.abs(P.longitude)),f.z=0):(f=ww(t,I,m,u,qw),p.x=0,p.y=h.a.sign(I.longitude-P.longitude),p.z=0)}const x=O.distance(s,V),D=Mh.fromCartesian(e,Qw),R=O.subtract(U,e,Yw),j=O.normalize(R,Jw);let Y=O.subtract(s,e,Xw);Y=O.normalize(Y,Y);let X=O.cross(j,Y,Jw);X=O.normalize(X,X);let K=O.cross(Y,m,Zw);K=O.normalize(K,K);let J=O.subtract(V,U,Kw);J=O.normalize(J,J);let Z=O.cross(H,J,$w);Z=O.normalize(Z,Z);const $=x/L,Q=G/L;let ee,te,ne,ie=0,re=0,oe=0;if(a){ie=O.distance(u,d),ee=Mh.fromCartesian(u,eA),te=O.subtract(d,u,tA),ne=O.normalize(te,nA);const e=ne.x;ne.x=ne.y,ne.y=-e,re=ie/S,oe=q/S}for(M=0;M<8;M++){const e=z+4*M,t=B+2*M,n=e+3,i=M<4?1:-1,r=2===M||3===M||6===M||7===M?1:-1;O.pack(D.high,_,e),_[n]=R.x,O.pack(D.low,y,e),y[n]=R.y,O.pack(K,b,e),b[n]=R.z,O.pack(Z,v,e),v[n]=$*i,O.pack(X,w,e);let o=Q*r;0===o&&r<0&&(o=9),w[n]=o,a&&(A[e]=ee.high.x,A[e+1]=ee.high.y,A[e+2]=ee.low.x,A[e+3]=ee.low.y,T[e]=-f.y,T[e+1]=f.x,T[e+2]=p.y,T[e+3]=-p.x,E[e]=te.x,E[e+1]=te.y,E[e+2]=ne.x,E[e+3]=ne.y,C[t]=re*i,o=oe*r,0===o&&r<0&&(o=9),C[t+1]=o)}const ae=Uw,se=Vw,ce=zw,le=kw,ue=Be.fromCartographicArray(Bw,Fw),he=nn.getMinimumMaximumHeights(ue,l),de=he.minimumTerrainHeight,fe=he.maximumTerrainHeight;W+=de,W+=fe,Tw(e,s,de,fe,ae,ce),Tw(U,V,de,fe,se,le);let pe=O.multiplyByScalar(X,h.a.EPSILON5,iA);O.add(ae,pe,ae),O.add(se,pe,se),O.add(ce,pe,ce),O.add(le,pe,le),xw(ae,se),xw(ce,le),O.pack(ae,g,F),O.pack(se,g,F+3),O.pack(le,g,F+6),O.pack(ce,g,F+9),pe=O.multiplyByScalar(X,-2*h.a.EPSILON5,iA),O.add(ae,pe,ae),O.add(se,pe,se),O.add(ce,pe,ce),O.add(le,pe,le),xw(ae,se),xw(ce,le),O.pack(ae,g,F+12),O.pack(se,g,F+15),O.pack(le,g,F+18),O.pack(ce,g,F+21),N+=2,c+=3,B+=16,F+=24,z+=32,G+=x,q+=ie}c=0;let Y=0;for(s=0;s<u;s++){for(M=0;M<aA;M++)m[c+M]=oA[M]+Y;Y+=8,c+=aA}const X=rA;At.fromVertices(n,O.ZERO,3,X[0]),At.fromVertices(i,O.ZERO,3,X[1]);const K=At.fromBoundingSpheres(X);K.radius+=W/(2*u);const J={position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,normalize:!1,values:g}),startHiAndForwardOffsetX:sA(_),startLoAndForwardOffsetY:sA(y),startNormalAndForwardOffsetZ:sA(b),endNormalAndTextureCoordinateNormalizationX:sA(v),rightNormalAndTextureCoordinateNormalizationY:sA(w)};a&&(J.startHiLo2D=sA(A),J.offsetAndRight2D=sA(E),J.startEndNormals2D=sA(T),J.texcoordNormalization2D=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,normalize:!1,values:C}));return new Zl({attributes:J,indices:m,boundingSphere:K})}(n,a,x,S,C,T,t)};const mw=new O,gw=new ce,_w=new To;function yw(e,t,n,i){const r=$O(n,t,mw),o=O.dot(r,e);if(o>FO||o<zO){const t=$O(i,n,iw),r=o<zO?h.a.PI_OVER_TWO:-h.a.PI_OVER_TWO,a=To.fromAxisAngle(t,r,_w),s=ce.fromQuaternion(a,gw);return ce.multiplyByVector(s,e,e),!0}return!1}const bw=new R,vw=new O,Ow=new O;function ww(e,t,n,i,r){const o=R.toCartesian(t,e._ellipsoid,vw);let a=O.add(o,n,Ow),s=!1;const c=e._ellipsoid;let l=c.cartesianToCartographic(a,bw);Math.abs(t.longitude-l.longitude)>h.a.PI_OVER_TWO&&(s=!0,a=O.subtract(o,n,Ow),l=c.cartesianToCartographic(a,bw)),l.height=0;const u=e.project(l,r);return(r=O.subtract(u,i,r)).z=0,r=O.normalize(r,r),s&&O.negate(r,r),r}const Aw=new O,Ew=new O;function Tw(e,t,n,i,r,o){const a=O.subtract(t,e,Aw);O.normalize(a,a);const s=n-0;let c=O.multiplyByScalar(a,s,Ew);O.add(e,c,r);const l=i-1e3;c=O.multiplyByScalar(a,l,Ew),O.add(t,c,o)}const Cw=new O;function xw(e,t){const n=xi.getPointDistance(ow,e),i=xi.getPointDistance(ow,t);let r=Cw;h.a.equalsEpsilon(n,0,h.a.EPSILON2)?(r=$O(t,e,r),O.multiplyByScalar(r,h.a.EPSILON2,r),O.add(e,r,e)):h.a.equalsEpsilon(i,0,h.a.EPSILON2)&&(r=$O(e,t,r),O.multiplyByScalar(r,h.a.EPSILON2,r),O.add(t,r,t))}function Sw(e,t){const n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(h.a.equalsEpsilon(n,h.a.PI,h.a.EPSILON11)){const i=h.a.sign(t.longitude);return e.longitude=i*(n-h.a.EPSILON11),1}if(h.a.equalsEpsilon(i,h.a.PI,h.a.EPSILON11)){const n=h.a.sign(e.longitude);return t.longitude=n*(i-h.a.EPSILON11),2}return 0}const Iw=new R,Pw=new R,Dw=new O,Rw=new O,jw=new O,Mw=new O,Lw=new O,Nw=new O,Bw=[Iw,Pw],Fw=new Be,zw=new O,kw=new O,Uw=new O,Vw=new O,Hw=new O,Gw=new O,qw=new O,Ww=new O,Yw=new O,Xw=new O,Kw=new O,Jw=new O,Zw=new O,$w=new O,Qw=new Mh,eA=new Mh,tA=new O,nA=new O,iA=new O,rA=[new At,new At],oA=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],aA=oA.length;function sA(e){return new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}kO._projectNormal=ww;var cA=kO;function lA(e,t,n){this.heading=Object(c.a)(e,0),this.pitch=Object(c.a)(t,0),this.range=Object(c.a)(n,0)}lA.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)||(t=new lA),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var uA=lA,hA=n(42);const dA=h.a.factorial;function fA(e,t,n,i,r,o){let a,s,c,l=0;if(i>0){for(s=0;s<r;s++){for(a=!1,c=0;c<o.length&&!a;c++)s===o[c]&&(a=!0);a||(o.push(s),l+=fA(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return l}for(l=1,s=0;s<r;s++){for(a=!1,c=0;c<o.length&&!a;c++)s===o[c]&&(a=!0);a||(l*=e-n[t[s]])}return l}const pA={type:"Hermite",getRequiredDataPoints:function(e,t){if(t=Object(c.a)(t,0),!Object(l.a)(e))throw new u.a("degree is required.");if(e<0)throw new u.a("degree must be 0 or greater.");if(t<0)throw new u.a("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)},interpolateOrderZero:function(e,t,n,i,r){let o,a,s,c,u,h;Object(l.a)(r)||(r=new Array(i));const d=t.length,f=new Array(i);for(o=0;o<i;o++){r[o]=0;const e=new Array(d);for(f[o]=e,a=0;a<d;a++)e[a]=[]}const p=d,m=new Array(p);for(o=0;o<p;o++)m[o]=o;let g=d-1;for(c=0;c<i;c++){for(a=0;a<p;a++)h=m[a]*i+c,f[c][0].push(n[h]);for(o=1;o<p;o++){let e=!1;for(a=0;a<p-o;a++){const r=t[m[a]],s=t[m[a+o]];let l;s-r<=0?(h=m[a]*i+i*o+c,l=n[h],f[c][o].push(l/dA(o))):(l=f[c][o-1][a+1]-f[c][o-1][a],f[c][o].push(l/(s-r))),e=e||0!==l}e||(g=o-1)}}for(s=0,u=0;s<=0;s++)for(o=s;o<=g;o++){const n=fA(e,m,t,s,o,[]);for(c=0;c<i;c++){const e=f[c][o][0];r[c+s*i]+=e*n}}return r}},mA=[];pA.interpolate=function(e,t,n,i,r,o,a){const s=i*(o+1);Object(l.a)(a)||(a=new Array(s));for(let e=0;e<s;e++)a[e]=0;const c=t.length,u=new Array(c*(r+1));let d;for(d=0;d<c;d++)for(let e=0;e<r+1;e++)u[d*(r+1)+e]=d;const f=u.length,p=mA,m=function(e,t,n,i,r,o){let a,s,c=-1;const l=t.length,u=l*(l+1)/2;for(let d=0;d<r;d++){const f=Math.floor(d*u);for(a=0;a<l;a++)s=t[a]*r*(o+1)+d,e[f+a]=i[s];for(let u=1;u<l;u++){let p=0;const m=Math.floor(u*(1-u)/2)+l*u;let g=!1;for(a=0;a<l-u;a++){const c=n[t[a]],_=n[t[a+u]];let y,b;if(_-c<=0)s=t[a]*r*(o+1)+r*u+d,y=i[s],b=y/h.a.factorial(u),e[f+m+p]=b,p++;else{const t=Math.floor((u-1)*(2-u)/2)+l*(u-1);y=e[f+t+a+1]-e[f+t+a],b=y/(_-c),e[f+m+p]=b,p++}g=g||0!==y}g&&(c=Math.max(c,u))}}return c}(p,u,t,n,i,r),g=[],_=f*(f+1)/2,y=Math.min(m,o);for(let n=0;n<=y;n++)for(d=n;d<=m;d++){g.length=0;const r=fA(e,u,t,n,d,g),o=Math.floor(d*(1-d)/2)+f*d;for(let e=0;e<i;e++){const t=p[Math.floor(e*_)+o];a[e+n*i]+=t*r}}return a};var gA=pA;const _A={};function yA(e,t,n,i){if(0!==i)return;1===n&&(t.x=e-1-t.x,t.y=e-1-t.y);const r=t.x;t.x=t.y,t.y=r}_A.encode2D=function(e,t,n){const i=Math.pow(2,e);if(s.a.typeOf.number("level",e),s.a.typeOf.number("x",t),s.a.typeOf.number("y",n),e<1)throw new u.a("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new u.a("Invalid coordinates for given level.");const r={x:t,y:n};let o,a,c,l=BigInt(0);for(c=i/2;c>0;c/=2)o=(r.x&c)>0?1:0,a=(r.y&c)>0?1:0,l+=BigInt((3*o^a)*c*c),yA(i,r,o,a);return l},_A.decode2D=function(e,t){if(s.a.typeOf.number("level",e),s.a.typeOf.bigint("index",t),e<1)throw new u.a("Hilbert level cannot be less than 1.");if(t<BigInt(0)||t>=BigInt(Math.pow(4,e)))throw new u.a("Hilbert index exceeds valid maximum for given level.");const n=Math.pow(2,e),i={x:0,y:0};let r,o,a,c;for(a=1,c=t;a<n;a*=2)r=1&Number(c/BigInt(2)),o=1&Number(c^BigInt(r)),yA(a,i,r,o),i.x+=a*r,i.y+=a*o,c/=BigInt(4);return[i.x,i.y]};var bA=_A;var vA=function(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i};const OA={},wA=.9856003,AA=26.4057084,EA=13.064993,TA=.3287146,CA=1.7484877;let xA=new tr;OA.ComputeMoon=function(e,t){Object(l.a)(e)||(e=tr.now()),xA=tr.addSeconds(e,32.184,xA);const n=tr.totalDays(xA)-2451545,i=n/ji.DAYS_PER_JULIAN_CENTURY,r=(125.045+-.0529921*n)*h.a.RADIANS_PER_DEGREE,o=(250.089+-.1059842*n)*h.a.RADIANS_PER_DEGREE,a=(260.008+13.0120009*n)*h.a.RADIANS_PER_DEGREE,s=(176.625+13.3407154*n)*h.a.RADIANS_PER_DEGREE,c=(357.529+wA*n)*h.a.RADIANS_PER_DEGREE,u=(311.589+AA*n)*h.a.RADIANS_PER_DEGREE,d=(134.963+EA*n)*h.a.RADIANS_PER_DEGREE,f=(276.617+TA*n)*h.a.RADIANS_PER_DEGREE,p=(34.226+CA*n)*h.a.RADIANS_PER_DEGREE,m=(15.134+-.1589763*n)*h.a.RADIANS_PER_DEGREE,g=(119.743+.0036096*n)*h.a.RADIANS_PER_DEGREE,_=(239.961+.1643573*n)*h.a.RADIANS_PER_DEGREE,y=(25.053+12.9590088*n)*h.a.RADIANS_PER_DEGREE,b=Math.sin(r),v=Math.sin(o),O=Math.sin(a),w=Math.sin(s),A=Math.sin(c),E=Math.sin(u),T=Math.sin(d),C=Math.sin(f),x=Math.sin(p),S=Math.sin(m),I=Math.sin(g),P=Math.sin(_),D=Math.sin(y),R=Math.cos(r),j=Math.cos(o),M=Math.cos(a),L=Math.cos(s),N=Math.cos(c),B=Math.cos(u),F=Math.cos(d),z=Math.cos(f),k=Math.cos(p),U=Math.cos(m),V=Math.cos(g),H=Math.cos(_),G=Math.cos(y),q=(269.9949+.0031*i-3.8787*b-.1204*v+.07*O-.0172*w+.0072*E-.0052*S+.0043*D)*h.a.RADIANS_PER_DEGREE,W=(66.5392+.013*i+1.5419*R+.0239*j-.0278*M+.0068*L-.0029*B+9e-4*F+8e-4*U-9e-4*G)*h.a.RADIANS_PER_DEGREE,Y=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*v-.0642*O+.0158*w+.0252*A-.0066*E-.0047*T-.0046*C+.0028*x+.0052*S+.004*I+.0019*P-.0044*D)*h.a.RADIANS_PER_DEGREE,X=(13.17635815-2*n*14e-13+3.561*R*-.0529921+.1208*j*-.1059842-.0642*M*13.0120009+.0158*L*13.3407154+.0252*N*wA-.0066*B*AA-.0047*F*EA-.0046*z*TA+.0028*k*CA+.0052*U*-.1589763+.004*V*.0036096+.0019*H*.1643573-.0044*G*12.9590088)/86400*h.a.RADIANS_PER_DEGREE;return Object(l.a)(t)||(t=new vA),t.rightAscension=q,t.declination=W,t.rotation=Y,t.rotationRate=X,t};var SA=OA;function IA(e){Object(l.a)(e)&&"function"==typeof e||(e=SA.ComputeMoon),this._computeFunction=e}const PA=new O,DA=new O,RA=new O;const jA=new ce,MA=new To;IA.prototype.evaluate=function(e,t){Object(l.a)(e)||(e=tr.now());const n=this._computeFunction(e),i=function(e,t,n){const i=PA;i.x=Math.cos(e+h.a.PI_OVER_TWO),i.y=Math.sin(e+h.a.PI_OVER_TWO),i.z=0;const r=Math.cos(t),o=RA;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);const a=O.cross(o,i,DA);return Object(l.a)(n)||(n=new ce),n[0]=i.x,n[1]=a.x,n[2]=o.x,n[3]=i.y,n[4]=a.y,n[5]=o.y,n[6]=i.z,n[7]=a.z,n[8]=o.z,n}(n.rightAscension,n.declination,t),r=h.a.zeroToTwoPi(n.rotation),o=To.fromAxisAngle(O.UNIT_Z,r,MA),a=ce.fromQuaternion(To.conjugate(o,o),jA);return ce.multiply(a,i,i)};var LA=IA;const NA={type:void 0};NA.getRequiredDataPoints=u.a.throwInstantiationError,NA.interpolateOrderZero=u.a.throwInstantiationError,NA.interpolate=u.a.throwInstantiationError;var BA=NA;var FA=Object.freeze({STEP:0,LINEAR:1,CUBICSPLINE:2});function zA(e){s.a.defined("url",e),this._url=Tt.a.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(zA.prototype,{url:{get:function(){return this._url}}}),zA.prototype.geocode=function(e,t){s.a.typeOf.string("query",e);return this._url.getDerivedResource({url:t===Uv.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then((function(e){return e.features.map((function(e){let t;const n=e.bbox;if(Object(l.a)(n))t=Be.fromDegrees(n[0],n[1],n[2],n[3]);else{const n=e.geometry.coordinates[0],i=e.geometry.coordinates[1];t=O.fromDegrees(n,i)}return{displayName:e.properties.label,destination:t}}))}))};var kA=zA;function UA(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.scene",e.scene);const t=Object(c.a)(e.accessToken,_y.defaultAccessToken),n=Tt.a.createIfNeeded(Object(c.a)(e.server,_y.defaultServer));n.appendForwardSlash();const i=_y.getDefaultTokenCredit(t);Object(l.a)(i)&&e.scene.frameState.creditDisplay.addDefaultCredit(ln.clone(i));const r=n.getDerivedResource({url:"v1/geocode"});Object(l.a)(t)&&r.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new kA(r)}UA.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)};var VA=UA,HA=n(29),GA=n(25);function qA(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.start=Object(l.a)(e.start)?tr.clone(e.start):new tr,this.stop=Object(l.a)(e.stop)?tr.clone(e.stop):new tr,this.data=e.data,this.isStartIncluded=Object(c.a)(e.isStartIncluded,!0),this.isStopIncluded=Object(c.a)(e.isStopIncluded,!0)}Object.defineProperties(qA.prototype,{isEmpty:{get:function(){const e=tr.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});const WA={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};qA.fromIso8601=function(e,t){s.a.typeOf.object("options",e),s.a.typeOf.string("options.iso8601",e.iso8601);const n=e.iso8601.split("/");if(2!==n.length)throw new u.a("options.iso8601 is an invalid ISO 8601 interval.");const i=tr.fromIso8601(n[0]),r=tr.fromIso8601(n[1]),o=Object(c.a)(e.isStartIncluded,!0),a=Object(c.a)(e.isStopIncluded,!0),h=e.data;return Object(l.a)(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=a,t.data=h,t):(WA.start=i,WA.stop=r,WA.isStartIncluded=o,WA.isStopIncluded=a,WA.data=h,new qA(WA))},qA.toIso8601=function(e,t){return s.a.typeOf.object("timeInterval",e),`${tr.toIso8601(e.start,t)}/${tr.toIso8601(e.stop,t)}`},qA.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new qA(e)},qA.equals=function(e,t,n){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&tr.equals(e.start,t.start)&&tr.equals(e.stop,t.stop)&&(e.data===t.data||Object(l.a)(n)&&n(e.data,t.data)))},qA.equalsEpsilon=function(e,t,n,i){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&tr.equalsEpsilon(e.start,t.start,n)&&tr.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||Object(l.a)(i)&&i(e.data,t.data)))},qA.intersect=function(e,t,n,i){if(s.a.typeOf.object("left",e),!Object(l.a)(t))return qA.clone(qA.EMPTY,n);const r=e.start,o=e.stop,a=t.start,c=t.stop,u=tr.greaterThanOrEquals(a,r)&&tr.greaterThanOrEquals(o,a),h=!u&&tr.lessThanOrEquals(a,r)&&tr.lessThanOrEquals(r,c);if(!u&&!h)return qA.clone(qA.EMPTY,n);const d=e.isStartIncluded,f=e.isStopIncluded,p=t.isStartIncluded,m=t.isStopIncluded,g=tr.lessThan(o,c);return Object(l.a)(n)||(n=new qA),n.start=u?a:r,n.isStartIncluded=d&&p||!tr.equals(a,r)&&(u&&p||h&&d),n.stop=g?o:c,n.isStopIncluded=g?f:f&&m||!tr.equals(c,o)&&m,n.data=Object(l.a)(i)?i(e.data,t.data):e.data,n},qA.contains=function(e,t){if(s.a.typeOf.object("timeInterval",e),s.a.typeOf.object("julianDate",t),e.isEmpty)return!1;const n=tr.compare(e.start,t);if(0===n)return e.isStartIncluded;const i=tr.compare(t,e.stop);return 0===i?e.isStopIncluded:n<0&&i<0},qA.prototype.clone=function(e){return qA.clone(this,e)},qA.prototype.equals=function(e,t){return qA.equals(this,e,t)},qA.prototype.equalsEpsilon=function(e,t,n){return qA.equalsEpsilon(this,e,t,n)},qA.prototype.toString=function(){return qA.toIso8601(this)},qA.EMPTY=Object.freeze(new qA({start:new tr,stop:new tr,isStartIncluded:!1,isStopIncluded:!1}));var YA=qA;const XA=Object.freeze(tr.fromIso8601("0000-01-01T00:00:00Z")),KA=Object.freeze(tr.fromIso8601("9999-12-31T24:00:00Z"));var JA={MINIMUM_VALUE:XA,MAXIMUM_VALUE:KA,MAXIMUM_INTERVAL:Object.freeze(new YA({start:XA,stop:KA}))};var ZA=Object.freeze({SHIFT:0,CTRL:1,ALT:2});function $A(){}$A._transcodeTaskProcessor=new _c("transcodeKTX2",Number.POSITIVE_INFINITY),$A._readyPromise=void 0,$A.transcode=function(e,t){return s.a.defined("supportedTargetFormats",t),Object(l.a)($A._readyPromise)||function(){const e=$A._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then((function(){return $A._transcodeTaskProcessor}));$A._readyPromise=e}(),$A._readyPromise.then((function(n){let i;if(e instanceof ArrayBuffer){const r=new Uint8Array(e);return i={supportedTargetFormats:t,ktx2Buffer:r},n.scheduleTask(i,[e])}return i={supportedTargetFormats:t,ktx2Buffer:e},n.scheduleTask(i,[e.buffer])})).then((function(e){const t=e.length,n=Object.keys(e[0]),i=n.length;let r;for(r=0;r<t;r++){const t=e[r];for(let e=0;e<i;e++){const i=t[n[e]];t[n[e]]=new dp(i.internalFormat,i.datatype,i.width,i.height,i.levelBuffer)}}if(1===i){for(r=0;r<t;++r)e[r]=e[r][n[0]];1===t&&(e=e[0])}return e})).catch((function(e){throw e}))};var QA=$A;const eE={type:"Lagrange",getRequiredDataPoints:function(e){return Math.max(e+1,2)},interpolateOrderZero:function(e,t,n,i,r){let o,a;Object(l.a)(r)||(r=new Array(i));const s=t.length;for(o=0;o<i;o++)r[o]=0;for(o=0;o<s;o++){let c=1;for(a=0;a<s;a++)if(a!==o){const n=t[o]-t[a];c*=(e-t[a])/n}for(a=0;a<i;a++)r[a]+=c*n[o*i+a]}return r}};var tE=eE;const nE={type:"Linear",getRequiredDataPoints:function(e){return 2},interpolateOrderZero:function(e,t,n,i,r){if(2!==t.length)throw new u.a("The xTable provided to the linear interpolator must have exactly two elements.");if(i<=0)throw new u.a("There must be at least 1 dependent variable for each independent variable.");let o,a,s;Object(l.a)(r)||(r=new Array(i));const c=t[0],h=t[1];if(c===h)throw new u.a("Divide by zero error: xTable[0] and xTable[1] are equal");for(o=0;o<i;o++)a=n[o],s=n[o+i],r[o]=((s-a)*e+h*a-c*s)/(h-c);return r}};var iE=nE;var rE=function(e){const t=e.uint8Array,n=e.format,i=e.request,r=Object(c.a)(e.flipY,!1),o=Object(c.a)(e.skipColorSpaceConversion,!1);s.a.typeOf.object("uint8Array",t),s.a.typeOf.string("format",n);const a=new Blob([t],{type:n});let u;return Tt.a.supportsImageBitmapOptions().then((function(e){if(e)return Promise.resolve(Tt.a.createImageBitmapFromBlob(a,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o}));u=window.URL.createObjectURL(a);return new Tt.a({url:u,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o})})).then((function(e){return Object(l.a)(u)&&window.URL.revokeObjectURL(u),e})).catch((function(e){return Object(l.a)(u)&&window.URL.revokeObjectURL(u),Promise.reject(e)}))};let oE;function aE(e){let t;if(s.a.defined("resourceOrUrlOrBuffer",e),e instanceof ArrayBuffer||ArrayBuffer.isView(e))t=Promise.resolve(e);else{t=Tt.a.createIfNeeded(e).fetchArrayBuffer()}return t.then((function(e){return QA.transcode(e,oE)}))}aE.setKTX2SupportedFormats=function(e,t,n,i,r,o){oE={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};var sE=aE;function cE(e){e=Object(c.a)(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(cE.prototype,{length:{get:function(){return this._length},set:function(e){s.a.typeOf.number.greaterThanOrEquals("length",e,0);const t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}}),cE.prototype.get=function(e){return s.a.typeOf.number.lessThan("index",e,this._array.length),this._array[e]},cE.prototype.set=function(e,t){s.a.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t},cE.prototype.peek=function(){return this._array[this._length-1]},cE.prototype.push=function(e){const t=this.length++;this._array[t]=e},cE.prototype.pop=function(){if(0===this._length)return;const e=this._array[this._length-1];return--this.length,e},cE.prototype.reserve=function(e){s.a.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)},cE.prototype.resize=function(e){s.a.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e},cE.prototype.trim=function(e){e=Object(c.a)(e,this._length),this._array.length=e};var lE=cE;function uE(){u.a.throwInstantiationError()}Object.defineProperties(uE.prototype,{ellipsoid:{get:u.a.throwInstantiationError}}),uE.prototype.project=u.a.throwInstantiationError,uE.prototype.unproject=u.a.throwInstantiationError;var hE=uE;const dE=[],fE=[];function pE(e,t,n,i,r){if(i>=r)return;const o=Math.floor(.5*(i+r));pE(e,t,n,i,o),pE(e,t,n,o+1,r),function(e,t,n,i,r,o){const a=r-i+1,s=o-r,c=dE,l=fE;let u,h;for(u=0;u<a;++u)c[u]=e[i+u];for(h=0;h<s;++h)l[h]=e[r+h+1];u=0,h=0;for(let r=i;r<=o;++r){const i=c[u],o=l[h];u<a&&(h>=s||t(i,o,n)<=0)?(e[r]=i,++u):h<s&&(e[r]=o,++h)}}(e,t,n,i,o,r)}var mE=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required.");if(!Object(l.a)(t))throw new u.a("comparator is required.");const i=e.length,r=Math.ceil(.5*i);dE.length=r,fE.length=r,pE(e,t,n,0,i-1),dE.length=0,fE.length=0};function gE(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).weights,n=e.times;if(s.a.defined("weights",t),s.a.defined("times",n),s.a.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!=0)throw new u.a("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(gE.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),gE.prototype.findTimeInterval=wu.prototype.findTimeInterval,gE.prototype.wrapTime=wu.prototype.wrapTime,gE.prototype.clampTime=wu.prototype.clampTime,gE.prototype.evaluate=function(e,t){const n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);Object(l.a)(t)||(t=new Array(this._count));for(let e=0;e<this._count;e++){const i=r*this._count+e;t[e]=n[i]*(1-o)+n[i+this._count]*o}return t};var _E=gE;const yE={};function bE(e){return e=1431655765&((e=858993459&((e=252645135&((e=16711935&(e^e<<8))^e<<4))^e<<2))^e<<1)}function vE(e){return e=153391689&((e=51130563&((e=50393103&((e=50331903&(e^e<<16))^e<<8))^e<<4))^e<<2)}function OE(e){return e=65535&((e=16711935&((e=252645135&((e=858993459&((e&=1431655765)^e>>1))^e>>2))^e>>4))^e>>8)}function wE(e){return e=1023&((e=4278190335&((e=50393103&((e=51130563&((e&=153391689)^e>>2))^e>>4))^e>>8))^e>>16)}yE.encode2D=function(e,t){if(s.a.typeOf.number("x",e),s.a.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new u.a("inputs must be 16-bit unsigned integers");return(bE(e)|bE(t)<<1)>>>0},yE.decode2D=function(e,t){if(s.a.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new u.a("input must be a 32-bit unsigned integer");return Object(l.a)(t)||(t=new Array(2)),t[0]=OE(e),t[1]=OE(e>>1),t},yE.encode3D=function(e,t,n){if(s.a.typeOf.number("x",e),s.a.typeOf.number("y",t),s.a.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new u.a("inputs must be 10-bit unsigned integers");return vE(e)|vE(t)<<1|vE(n)<<2},yE.decode3D=function(e,t){if(s.a.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new u.a("input must be a 30-bit unsigned integer");return Object(l.a)(t)||(t=new Array(3)),t[0]=wE(e),t[1]=wE(e>>1),t[2]=wE(e>>2),t};var AE=yE;function EE(e,t,n,i){this.near=Object(c.a)(e,0),this.nearValue=Object(c.a)(t,0),this.far=Object(c.a)(n,1),this.farValue=Object(c.a)(i,0)}EE.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new EE(e.near,e.nearValue,e.far,e.farValue)},EE.packedLength=4,EE.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t},EE.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");return t=Object(c.a)(t,0),Object(l.a)(n)||(n=new EE),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},EE.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},EE.prototype.clone=function(e){return EE.clone(this,e)},EE.prototype.equals=function(e){return EE.equals(this,e)};var TE=EE,CE=n(32);var xE=Object.freeze({NONE:-1,PARTIAL:0,FULL:1});function SE(e,t){if(!Object(l.a)(e))throw new u.a("occluderBoundingSphere is required.");if(!Object(l.a)(t))throw new u.a("camera position is required.");this._occluderPosition=O.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}const IE=new O;Object.defineProperties(SE.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!Object(l.a)(e))throw new u.a("cameraPosition is required.");e=O.clone(e,this._cameraPosition);const t=O.subtract(this._occluderPosition,e,IE);let n=O.magnitudeSquared(t);const i=this._occluderRadius*this._occluderRadius;let r,o,a;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=O.multiplyByScalar(t,n,IE);const s=r*r*n;a=O.add(e,O.multiplyByScalar(o,s,IE),IE)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=a,this._cameraPosition=e}}}),SE.fromBoundingSphere=function(e,t,n){if(!Object(l.a)(e))throw new u.a("occluderBoundingSphere is required.");if(!Object(l.a)(t))throw new u.a("camera position is required.");return Object(l.a)(n)?(O.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new SE(e,t)};const PE=new O;SE.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=O.subtract(e,this._occluderPosition,PE),n=this._occluderRadius;if(n=O.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=O.subtract(e,this._cameraPosition,t),n*n>O.magnitudeSquared(t)}return!1};const DE=new O;SE.prototype.isBoundingSphereVisible=function(e){const t=O.clone(e.center,DE),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let e=O.subtract(t,this._occluderPosition,PE),i=this._occluderRadius-n;if(i=O.magnitudeSquared(e)-i*i,n<this._occluderRadius)return i>0&&(i=Math.sqrt(i)+this._horizonDistance,e=O.subtract(t,this._cameraPosition,e),i*i+n*n>O.magnitudeSquared(e));if(i>0){e=O.subtract(t,this._cameraPosition,e);const r=O.magnitudeSquared(e),o=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+o)*a>r*o||(i=Math.sqrt(i)+this._horizonDistance,i*i+a>r)}return!0}return!1};const RE=new O;SE.prototype.computeVisibility=function(e){if(!Object(l.a)(e))throw new u.a("occludeeBS is required.");const t=O.clone(e.center),n=e.radius;if(n>this._occluderRadius)return xE.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let e=O.subtract(t,this._occluderPosition,RE),i=this._occluderRadius-n;const r=O.magnitudeSquared(e);if(i=r-i*i,i>0){i=Math.sqrt(i)+this._horizonDistance,e=O.subtract(t,this._cameraPosition,e);const o=O.magnitudeSquared(e);return i*i+n*n<o?xE.NONE:(i=this._occluderRadius+n,i=r-i*i,i>0?(i=Math.sqrt(i)+this._horizonDistance,o<i*i+n*n?xE.FULL:xE.PARTIAL):(e=O.subtract(t,this._horizonPlanePosition,e),O.dot(e,this._horizonPlaneNormal)>-n?xE.PARTIAL:xE.FULL))}}return xE.NONE};const jE=new O;SE.computeOccludeePoint=function(e,t,n){if(!Object(l.a)(e))throw new u.a("occluderBoundingSphere is required.");if(!Object(l.a)(n))throw new u.a("positions is required.");if(0===n.length)throw new u.a("positions must contain at least one element");const i=O.clone(t),r=O.clone(e.center),o=e.radius,a=n.length;if(O.equals(r,t))throw new u.a("occludeePosition must be different than occluderBoundingSphere.center");const s=O.normalize(O.subtract(i,r,jE),jE),c=-O.dot(s,r),h=SE._anyRotationVector(r,s,c);let d,f=SE._horizonToPlaneNormalDotProduct(e,s,c,h,n[0]);if(!f)return;for(let t=1;t<a;++t){if(d=SE._horizonToPlaneNormalDotProduct(e,s,c,h,n[t]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;const p=o/f;return O.add(r,O.multiplyByScalar(s,p,jE),jE)};const ME=[];SE.computeOccludeePointFromRectangle=function(e,t){if(!Object(l.a)(e))throw new u.a("rectangle is required.");t=Object(c.a)(t,H.WGS84);const n=Be.subsample(e,t,0,ME),i=At.fromPoints(n),r=O.ZERO;if(!O.equals(r,i.center))return SE.computeOccludeePoint(new At(r,t.minimumRadius),i.center,n)};const LE=new O;SE._anyRotationVector=function(e,t,n){const i=O.abs(t,LE);let r=i.x>i.y?0:1;(0===r&&i.z>i.x||1===r&&i.z>i.y)&&(r=2);const o=new O;let a;0===r?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,a=O.UNIT_X):1===r?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,a=O.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,a=O.UNIT_Z);const s=(O.dot(t,i)+n)/-O.dot(t,a);return O.normalize(O.subtract(O.add(i,O.multiplyByScalar(a,s,o),i),e,i),i)};const NE=new O;SE._rotationVector=function(e,t,n,i,r){let o=O.subtract(i,e,NE);if(o=O.normalize(o,o),O.dot(t,o)<.9999999847691291){const e=O.cross(t,o,o);if(O.magnitude(e)>h.a.EPSILON13)return O.normalize(e,new O)}return r};const BE=new O,FE=new O,zE=new O,kE=new O;SE._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){const o=O.clone(r,BE),a=O.clone(e.center,FE),s=e.radius;let c=O.subtract(a,o,zE);const l=O.magnitudeSquared(c),u=s*s;if(l<u)return!1;const h=l-u,d=Math.sqrt(h),f=d*(1/Math.sqrt(l))*d;c=O.normalize(c,c);const p=O.add(o,O.multiplyByScalar(c,f,kE),kE),m=Math.sqrt(h-f*f);let g=this._rotationVector(a,t,n,o,i),_=O.fromElements(g.x*g.x*c.x+(g.x*g.y-g.z)*c.y+(g.x*g.z+g.y)*c.z,(g.x*g.y+g.z)*c.x+g.y*g.y*c.y+(g.y*g.z-g.x)*c.z,(g.x*g.z-g.y)*c.x+(g.y*g.z+g.x)*c.y+g.z*g.z*c.z,BE);_=O.normalize(_,_);const y=O.multiplyByScalar(_,m,BE);g=O.normalize(O.subtract(O.add(p,y,zE),a,zE),zE);const b=O.dot(t,g);g=O.normalize(O.subtract(O.subtract(p,y,g),a,g),g);const v=O.dot(t,g);return b<v?b:v};var UE=SE;function VE(e,t,n){e=Object(c.a)(e,0),t=Object(c.a)(t,0),n=Object(c.a)(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(VE.prototype,{componentDatatype:{get:function(){return gs.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),VE.fromCartesian3=function(e){return s.a.defined("offset",e),new VE(e.x,e.y,e.z)},VE.toValue=function(e,t){return s.a.defined("offset",e),Object(l.a)(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var HE=VE;function GE(e,t,n){s.a.defined("url",e),s.a.defined("apiKey",t),Object(l.a)(n)&&s.a.typeOf.object("params",n),(e=Tt.a.createIfNeeded(e)).appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=Object(c.a)(n,{})}Object.defineProperties(GE.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}}}),GE.prototype.geocode=function(e){s.a.typeOf.string("query",e);return this._url.getDerivedResource({url:"json",queryParameters:Object(up.a)(this._params,{q:e})}).fetchJson().then((function(e){return e.results.map((function(e){let t;const n=e.bounds;if(Object(l.a)(n))t=Be.fromDegrees(n.southwest.lng,n.southwest.lat,n.northeast.lng,n.northeast.lat);else{const n=e.geometry.lat,i=e.geometry.lng;t=O.fromDegrees(n,i)}return{displayName:e.formatted,destination:t}}))}))};var qE=GE;var WE={packedLength:void 0,pack:u.a.throwInstantiationError,unpack:u.a.throwInstantiationError};var YE={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:u.a.throwInstantiationError,unpackInterpolationResult:u.a.throwInstantiationError},XE=n(41);let KE;var JE=function(e,t){if(!Object(l.a)(e))throw new u.a("text is required.");if(""===e)return;t=Object(c.a)(t,c.a.EMPTY_OBJECT);const n=Object(c.a)(t.font,"10px sans-serif"),i=Object(c.a)(t.stroke,!1),r=Object(c.a)(t.fill,!0),o=Object(c.a)(t.strokeWidth,1),a=Object(c.a)(t.backgroundColor,sp.TRANSPARENT),s=Object(c.a)(t.padding,0),h=2*s,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;const f=d.getContext("2d");Object(l.a)(KE)||(Object(l.a)(f.imageSmoothingEnabled)?KE="imageSmoothingEnabled":Object(l.a)(f.mozImageSmoothingEnabled)?KE="mozImageSmoothingEnabled":Object(l.a)(f.webkitImageSmoothingEnabled)?KE="webkitImageSmoothingEnabled":Object(l.a)(f.msImageSmoothingEnabled)&&(KE="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[KE]=!1,d.style.visibility="hidden",document.body.appendChild(d);const p=function(e,t,n,i,r){const o=e.measureText(t);if(!!/\S/.test(t)){const a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),s=document.createElement("canvas"),c=100,l=o.width+c|0,u=3*a,h=u/2;s.width=l,s.height=u;const d=s.getContext("2d");d.font=n,d.fillStyle="white",d.fillRect(0,0,s.width+1,s.height+1),i&&(d.strokeStyle="black",d.lineWidth=e.lineWidth,d.strokeText(t,c/2,h)),r&&(d.fillStyle="black",d.fillText(t,c/2,h));const f=d.getImageData(0,0,l,u).data,p=f.length,m=4*l;let g,_,y,b;for(g=0;g<p;++g)if(255!==f[g]){y=g/m|0;break}for(g=p-1;g>=0;--g)if(255!==f[g]){b=g/m|0;break}let v=-1;for(g=0;g<l&&-1===v;++g)for(_=0;_<u;++_){const e=4*g+_*m;if(255!==f[e]||255!==f[e+1]||255!==f[e+2]||255!==f[e+3]){v=g;break}}return{width:o.width,height:b-y,ascent:h-y,descent:b-h,minx:v-c/2}}return{width:o.width,height:0,ascent:0,descent:0,minx:0}}(f,e,n,i,r);d.dimensions=p,document.body.removeChild(d),d.style.visibility="";const m=-p.minx,g=Math.ceil(p.width)+m+h,_=p.height+h,y=_-(_-p.ascent+s)+h;if(d.width=g,d.height=_,f.font=n,f.lineJoin="round",f.lineWidth=o,f[KE]=!1,a!==sp.TRANSPARENT&&(f.fillStyle=a.toCssColorString(),f.fillRect(0,0,d.width,d.height)),i){const n=Object(c.a)(t.strokeColor,sp.BLACK);f.strokeStyle=n.toCssColorString(),f.strokeText(e,m+s,y)}if(r){const n=Object(c.a)(t.fillColor,sp.WHITE);f.fillStyle=n.toCssColorString(),f.fillText(e,m+s,y)}return d};function ZE(){this._cache={}}ZE.prototype.fromColor=function(e,t){if(!Object(l.a)(e))throw new u.a("color is required");if(!Object(l.a)(t))throw new u.a("size is required");return tT(void 0,void 0,e,t,this._cache)},ZE.prototype.fromUrl=function(e,t,n){if(!Object(l.a)(e))throw new u.a("url is required");if(!Object(l.a)(t))throw new u.a("color is required");if(!Object(l.a)(n))throw new u.a("size is required");return tT(e,void 0,t,n,this._cache)},ZE.prototype.fromMakiIconId=function(e,t,n){if(!Object(l.a)(e))throw new u.a("id is required");if(!Object(l.a)(t))throw new u.a("color is required");if(!Object(l.a)(n))throw new u.a("size is required");return tT(Lt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)},ZE.prototype.fromText=function(e,t,n){if(!Object(l.a)(e))throw new u.a("text is required");if(!Object(l.a)(t))throw new u.a("color is required");if(!Object(l.a)(n))throw new u.a("size is required");return tT(void 0,e,t,n,this._cache)};const $E=new sp;function QE(e,t,n){const i=n/2.5;let r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));const a=Math.round((n-r)/2),s=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,a-1,s,r,o),e.drawImage(t,a,s-1,r,o),e.drawImage(t,a+1,s,r,o),e.drawImage(t,a,s+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=sp.BLACK.toCssColorString(),e.fillRect(a-1,s-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,a,s,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=sp.WHITE.toCssColorString(),e.fillRect(a-1,s-2,r+2,o+2)}const eT=new Array(4);function tT(e,t,n,i,r){eT[0]=e,eT[1]=t,eT[2]=n,eT[3]=i;const o=JSON.stringify(eT),a=r[o];if(Object(l.a)(a))return a;const s=document.createElement("canvas");s.width=i,s.height=i;const c=s.getContext("2d");if(function(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,$E).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}(c,n,i),Object(l.a)(e)){const t=Tt.a.createIfNeeded(e).fetchImage().then((function(e){return QE(c,e,i),r[o]=s,s}));return r[o]=t,t}if(Object(l.a)(t)){const e=JE(t,{font:`bold ${i}px sans-serif`});QE(c,e,i)}return r[o]=s,s}var nT=ZE;const iT={UNSIGNED_BYTE:ps.UNSIGNED_BYTE,UNSIGNED_SHORT:ps.UNSIGNED_SHORT,UNSIGNED_INT:ps.UNSIGNED_INT,FLOAT:ps.FLOAT,HALF_FLOAT:ps.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ps.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ps.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ps.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ps.UNSIGNED_SHORT_5_6_5,toWebGLConstant:function(e,t){switch(e){case iT.UNSIGNED_BYTE:return ps.UNSIGNED_BYTE;case iT.UNSIGNED_SHORT:return ps.UNSIGNED_SHORT;case iT.UNSIGNED_INT:return ps.UNSIGNED_INT;case iT.FLOAT:return ps.FLOAT;case iT.HALF_FLOAT:return t.webgl2?ps.HALF_FLOAT:ps.HALF_FLOAT_OES;case iT.UNSIGNED_INT_24_8:return ps.UNSIGNED_INT_24_8;case iT.UNSIGNED_SHORT_4_4_4_4:return ps.UNSIGNED_SHORT_4_4_4_4;case iT.UNSIGNED_SHORT_5_5_5_1:return ps.UNSIGNED_SHORT_5_5_5_1;case iT.UNSIGNED_SHORT_5_6_5:return iT.UNSIGNED_SHORT_5_6_5}},isPacked:function(e){return e===iT.UNSIGNED_INT_24_8||e===iT.UNSIGNED_SHORT_4_4_4_4||e===iT.UNSIGNED_SHORT_5_5_5_1||e===iT.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case iT.UNSIGNED_BYTE:return 1;case iT.UNSIGNED_SHORT:case iT.UNSIGNED_SHORT_4_4_4_4:case iT.UNSIGNED_SHORT_5_5_5_1:case iT.UNSIGNED_SHORT_5_6_5:case iT.HALF_FLOAT:return 2;case iT.UNSIGNED_INT:case iT.FLOAT:case iT.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===iT.UNSIGNED_BYTE||e===iT.UNSIGNED_SHORT||e===iT.UNSIGNED_INT||e===iT.FLOAT||e===iT.HALF_FLOAT||e===iT.UNSIGNED_INT_24_8||e===iT.UNSIGNED_SHORT_4_4_4_4||e===iT.UNSIGNED_SHORT_5_5_5_1||e===iT.UNSIGNED_SHORT_5_6_5}};var rT=Object.freeze(iT);const oT={DEPTH_COMPONENT:ps.DEPTH_COMPONENT,DEPTH_STENCIL:ps.DEPTH_STENCIL,ALPHA:ps.ALPHA,RGB:ps.RGB,RGBA:ps.RGBA,LUMINANCE:ps.LUMINANCE,LUMINANCE_ALPHA:ps.LUMINANCE_ALPHA,RGB_DXT1:ps.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ps.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ps.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ps.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ps.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ps.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ps.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ps.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ps.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ps.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ps.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ps.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ps.COMPRESSED_RGBA_BPTC_UNORM,componentsLength:function(e){switch(e){case oT.RGB:return 3;case oT.RGBA:return 4;case oT.LUMINANCE_ALPHA:return 2;case oT.ALPHA:case oT.LUMINANCE:default:return 1}},validate:function(e){return e===oT.DEPTH_COMPONENT||e===oT.DEPTH_STENCIL||e===oT.ALPHA||e===oT.RGB||e===oT.RGBA||e===oT.LUMINANCE||e===oT.LUMINANCE_ALPHA||e===oT.RGB_DXT1||e===oT.RGBA_DXT1||e===oT.RGBA_DXT3||e===oT.RGBA_DXT5||e===oT.RGB_PVRTC_4BPPV1||e===oT.RGB_PVRTC_2BPPV1||e===oT.RGBA_PVRTC_4BPPV1||e===oT.RGBA_PVRTC_2BPPV1||e===oT.RGBA_ASTC||e===oT.RGB_ETC1||e===oT.RGB8_ETC2||e===oT.RGBA8_ETC2_EAC||e===oT.RGBA_BC7},isColorFormat:function(e){return e===oT.ALPHA||e===oT.RGB||e===oT.RGBA||e===oT.LUMINANCE||e===oT.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===oT.DEPTH_COMPONENT||e===oT.DEPTH_STENCIL},isCompressedFormat:function(e){return e===oT.RGB_DXT1||e===oT.RGBA_DXT1||e===oT.RGBA_DXT3||e===oT.RGBA_DXT5||e===oT.RGB_PVRTC_4BPPV1||e===oT.RGB_PVRTC_2BPPV1||e===oT.RGBA_PVRTC_4BPPV1||e===oT.RGBA_PVRTC_2BPPV1||e===oT.RGBA_ASTC||e===oT.RGB_ETC1||e===oT.RGB8_ETC2||e===oT.RGBA8_ETC2_EAC||e===oT.RGBA_BC7},isDXTFormat:function(e){return e===oT.RGB_DXT1||e===oT.RGBA_DXT1||e===oT.RGBA_DXT3||e===oT.RGBA_DXT5},isPVRTCFormat:function(e){return e===oT.RGB_PVRTC_4BPPV1||e===oT.RGB_PVRTC_2BPPV1||e===oT.RGBA_PVRTC_4BPPV1||e===oT.RGBA_PVRTC_2BPPV1},isASTCFormat:function(e){return e===oT.RGBA_ASTC},isETC1Format:function(e){return e===oT.RGB_ETC1},isETC2Format:function(e){return e===oT.RGB8_ETC2||e===oT.RGBA8_ETC2_EAC},isBC7Format:function(e){return e===oT.RGBA_BC7},compressedTextureSizeInBytes:function(e,t,n){switch(e){case oT.RGB_DXT1:case oT.RGBA_DXT1:case oT.RGB_ETC1:case oT.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case oT.RGBA_DXT3:case oT.RGBA_DXT5:case oT.RGBA_ASTC:case oT.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case oT.RGB_PVRTC_4BPPV1:case oT.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case oT.RGB_PVRTC_2BPPV1:case oT.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case oT.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}},textureSizeInBytes:function(e,t,n,i){let r=oT.componentsLength(e);return rT.isPacked(t)&&(r=1),r*rT.sizeInBytes(t)*n*i},alignmentInBytes:function(e,t,n){const i=oT.textureSizeInBytes(e,t,n,1)%4;return 0===i?4:2===i?2:1},createTypedArray:function(e,t,n,i){let r;const o=rT.sizeInBytes(t);r=o===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&t===rT.FLOAT?Float32Array:Uint32Array;return new r(oT.componentsLength(e)*n*i)},flipY:function(e,t,n,i,r){if(1===r)return e;const o=oT.createTypedArray(t,n,i,r),a=oT.componentsLength(t),s=i*a;for(let t=0;t<r;++t){const n=t*i*a,c=(r-t-1)*i*a;for(let t=0;t<s;++t)o[c+t]=e[n+t]}return o},toInternalFormat:function(e,t,n){if(!n.webgl2)return e;if(e===oT.DEPTH_STENCIL)return ps.DEPTH24_STENCIL8;if(e===oT.DEPTH_COMPONENT){if(t===rT.UNSIGNED_SHORT)return ps.DEPTH_COMPONENT16;if(t===rT.UNSIGNED_INT)return ps.DEPTH_COMPONENT24}if(t===rT.FLOAT)switch(e){case oT.RGBA:return ps.RGBA32F;case oT.RGB:return ps.RGB32F;case oT.RG:return ps.RG32F;case oT.R:return ps.R32F}if(t===rT.HALF_FLOAT)switch(e){case oT.RGBA:return ps.RGBA16F;case oT.RGB:return ps.RGB16F;case oT.RG:return ps.RG16F;case oT.R:return ps.R16F}return e}};var aT=Object.freeze(oT);function sT(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.vertexFormat,nu.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}sT.packedLength=nu.packedLength,sT.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),nu.pack(e._vertexFormat,t,n),t};const cT=new nu,lT={vertexFormat:cT};sT.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=nu.unpack(e,t,cT);return Object(l.a)(n)?(n._vertexFormat=nu.clone(i,n._vertexFormat),n):new sT(lT)};const uT=new O(-.5,-.5,0),hT=new O(.5,.5,0);sT.createGeometry=function(e){const t=e._vertexFormat,n=new Ql;let i,r;if(t.position){if(r=new Float64Array(12),r[0]=uT.x,r[1]=uT.y,r[2]=0,r[3]=hT.x,r[4]=uT.y,r[5]=0,r[6]=hT.x,r[7]=hT.y,r[8]=0,r[9]=uT.x,r[10]=hT.y,r[11]=0,n.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){const e=new Float32Array(12);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=1,e[9]=0,e[10]=0,e[11]=1,n.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}if(t.st){const e=new Float32Array(8);e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=1,e[5]=1,e[6]=0,e[7]=1,n.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:e})}if(t.tangent){const e=new Float32Array(12);e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=1,e[7]=0,e[8]=0,e[9]=1,e[10]=0,e[11]=0,n.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}if(t.bitangent){const e=new Float32Array(12);e[0]=0,e[1]=1,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=1,e[8]=0,e[9]=0,e[10]=1,e[11]=0,n.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new Zl({attributes:n,indices:i,primitiveType:zl.TRIANGLES,boundingSphere:new At(O.ZERO,Math.sqrt(2))})};var dT=sT;function fT(){this._workerName="createPlaneOutlineGeometry"}fT.packedLength=0,fT.pack=function(e,t){return s.a.defined("value",e),s.a.defined("array",t),t},fT.unpack=function(e,t,n){return s.a.defined("array",e),Object(l.a)(n)?n:new fT};const pT=new O(-.5,-.5,0),mT=new O(.5,.5,0);fT.createGeometry=function(){const e=new Ql,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=pT.x,n[1]=pT.y,n[2]=pT.z,n[3]=mT.x,n[4]=pT.y,n[5]=pT.z,n[6]=mT.x,n[7]=mT.y,n[8]=pT.z,n[9]=pT.x,n[10]=mT.y,n[11]=pT.z,e.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new Zl({attributes:e,indices:t,primitiveType:zl.LINES,boundingSphere:new At(O.ZERO,Math.sqrt(2))})};var gT=fT;const _T=new O;var yT=function(e,t,n,i){const r=Il(e,t,n,i,_T);return!!Object(l.a)(r)&&(r.x>0&&r.y>0&&r.z>0)};const bT=new R,vT=new R;function OT(e,t,n,i){const r=i.cartesianToCartographic(e,bT).height,o=i.cartesianToCartographic(t,vT);o.height=r,i.cartographicToCartesian(o,t);const a=i.cartesianToCartographic(n,vT);a.height=r-100,i.cartographicToCartesian(a,n)}const wT=new Nl,AT=new O,ET=new O,TT=new O,CT=new O,xT=new O,ST=new O;let IT=new O,PT=new O,DT=new O;const RT=new Vt,jT=new Vt,MT=new O,LT=new To,NT=new ce,BT=new ce;function FT(e){const t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=Object(l.a)(n.attributes.st)?n.attributes.st.values:void 0;let a=r.length;const s=e.wall,c=e.top||s,u=e.bottom||s;if(t.st||t.normal||t.tangent||t.bitangent||i){const d=e.boundingRectangle,f=e.tangentPlane,p=e.ellipsoid,m=e.stRotation,g=e.perPositionHeight,_=RT;_.x=d.x,_.y=d.y;const y=t.st?new Float32Array(a/3*2):void 0;let b;t.normal&&(b=g&&c&&!s?n.attributes.normal.values:new Float32Array(a));const v=t.tangent?new Float32Array(a):void 0,w=t.bitangent?new Float32Array(a):void 0,A=i?new Float32Array(a):void 0;let E=0,T=0,C=ET,x=TT,S=CT,I=!0,P=NT,D=BT;if(0!==m){let e=To.fromAxisAngle(f._plane.normal,m,LT);P=ce.fromQuaternion(e,P),e=To.fromAxisAngle(f._plane.normal,-m,LT),D=ce.fromQuaternion(e,D)}else P=ce.clone(ce.IDENTITY,P),D=ce.clone(ce.IDENTITY,D);let R=0,j=0;c&&u&&(R=a/2,j=a/3,a/=2);for(let n=0;n<a;n+=3){const m=O.fromArray(r,n,MT);if(t.st&&!Object(l.a)(o)){let e=ce.multiplyByVector(P,m,AT);e=p.scaleToGeodeticSurface(e,e);const t=f.projectPointOntoPlane(e,jT);Vt.subtract(t,_,t);const n=h.a.clamp(t.x/d.width,0,1),i=h.a.clamp(t.y/d.height,0,1);u&&(y[E+j]=n,y[E+1+j]=i),c&&(y[E]=n,y[E+1]=i),E+=2}if(t.normal||t.tangent||t.bitangent||i){const o=T+1,l=T+2;if(s){if(n+3<a){const e=O.fromArray(r,n+3,xT);if(I){const t=O.fromArray(r,n+a,ST);g&&OT(m,e,t,p),O.subtract(e,m,e),O.subtract(t,m,t),C=O.normalize(O.cross(t,e,C),C),I=!1}O.equalsEpsilon(e,m,h.a.EPSILON10)&&(I=!0)}(t.tangent||t.bitangent)&&(S=p.geodeticSurfaceNormal(m,S),t.tangent&&(x=O.normalize(O.cross(S,C,x),x)))}else C=p.geodeticSurfaceNormal(m,C),(t.tangent||t.bitangent)&&(g&&(IT=O.fromArray(b,T,IT),PT=O.cross(O.UNIT_Z,IT,PT),PT=O.normalize(ce.multiplyByVector(D,PT,PT),PT),t.bitangent&&(DT=O.normalize(O.cross(IT,PT,DT),DT))),x=O.cross(O.UNIT_Z,C,x),x=O.normalize(ce.multiplyByVector(D,x,x),x),t.bitangent&&(S=O.normalize(O.cross(C,x,S),S)));t.normal&&(e.wall?(b[T+R]=C.x,b[o+R]=C.y,b[l+R]=C.z):u&&(b[T+R]=-C.x,b[o+R]=-C.y,b[l+R]=-C.z),(c&&!g||s)&&(b[T]=C.x,b[o]=C.y,b[l]=C.z)),i&&(s&&(C=p.geodeticSurfaceNormal(m,C)),A[T+R]=-C.x,A[o+R]=-C.y,A[l+R]=-C.z),t.tangent&&(e.wall?(v[T+R]=x.x,v[o+R]=x.y,v[l+R]=x.z):u&&(v[T+R]=-x.x,v[o+R]=-x.y,v[l+R]=-x.z),c&&(g?(v[T]=PT.x,v[o]=PT.y,v[l]=PT.z):(v[T]=x.x,v[o]=x.y,v[l]=x.z))),t.bitangent&&(u&&(w[T+R]=S.x,w[o+R]=S.y,w[l+R]=S.z),c&&(g?(w[T]=DT.x,w[o]=DT.y,w[l]=DT.z):(w[T]=S.x,w[o]=S.y,w[l]=S.z))),T+=3}}t.st&&!Object(l.a)(o)&&(n.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:y})),t.normal&&(n.attributes.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(n.attributes.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:v})),t.bitangent&&(n.attributes.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:w})),i&&(n.attributes.extrudeDirection=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:A}))}if(e.extrude&&Object(l.a)(e.offsetAttribute)){const t=r.length/3;let i=new Uint8Array(t);if(e.offsetAttribute===eu.TOP)c&&u||s?i=i.fill(1,0,t/2):c&&(i=i.fill(1));else{const t=e.offsetAttribute===eu.NONE?0:1;i=i.fill(t)}n.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}return n}const zT=new R,kT=new R,UT={westOverIDL:0,eastOverIDL:0};let VT=new tg;function HT(e,t,n,i,r){if(r=Object(c.a)(r,new Be),!Object(l.a)(e)||e.length<3)return r.west=0,r.north=0,r.south=0,r.east=0,r;if(n===vl.RHUMB)return Be.fromCartesianArray(e,t,r);VT.ellipsoid.equals(t)||(VT=new tg(void 0,void 0,t)),r.west=Number.POSITIVE_INFINITY,r.east=Number.NEGATIVE_INFINITY,r.south=Number.POSITIVE_INFINITY,r.north=Number.NEGATIVE_INFINITY,UT.westOverIDL=Number.POSITIVE_INFINITY,UT.eastOverIDL=Number.NEGATIVE_INFINITY;const o=1/h.a.chordLength(i,t.maximumRadius),a=e.length;let s,u=t.cartesianToCartographic(e[0],kT),d=zT;for(let n=1;n<a;n++)s=d,d=u,u=t.cartesianToCartographic(e[n],s),VT.setEndPoints(d,u),qT(VT,o,r,UT);return s=d,d=u,u=t.cartesianToCartographic(e[0],s),VT.setEndPoints(d,u),qT(VT,o,r,UT),r.east-r.west>UT.eastOverIDL-UT.westOverIDL&&(r.west=UT.westOverIDL,r.east=UT.eastOverIDL,r.east>h.a.PI&&(r.east=r.east-h.a.TWO_PI),r.west>h.a.PI&&(r.west=r.west-h.a.TWO_PI)),r}const GT=new R;function qT(e,t,n,i){const r=e.surfaceDistance,o=Math.ceil(r*t),a=o>0?r/(o-1):Number.POSITIVE_INFINITY;let s=0;for(let t=0;t<o;t++){const t=e.interpolateUsingSurfaceDistance(s,GT);s+=a;const r=t.longitude,o=t.latitude;n.west=Math.min(n.west,r),n.east=Math.max(n.east,r),n.south=Math.min(n.south,o),n.north=Math.max(n.north,o);const c=r>=0?r:r+h.a.TWO_PI;i.westOverIDL=Math.min(i.westOverIDL,c),i.eastOverIDL=Math.max(i.eastOverIDL,c)}}const WT=[];function YT(e,t,n,i,r,o,a,s,c,u){const h={walls:[]};let d;if(a||s){const r=Em.createGeometryFromPositions(e,t,n,i,o,c,u),f=r.attributes.position.values,p=r.indices;let m,g;if(a&&s){const e=f.concat(f);m=e.length/3,g=wc.createTypedArray(m,2*p.length),g.set(p);const t=p.length,i=m/2;for(d=0;d<t;d+=3){const e=g[d]+i,n=g[d+1]+i,r=g[d+2]+i;g[d+t]=r,g[d+1+t]=n,g[d+2+t]=e}if(r.attributes.position.values=e,o&&c.normal){const t=r.attributes.normal.values;r.attributes.normal.values=new Float32Array(e.length),r.attributes.normal.values.set(t)}if(c.st&&Object(l.a)(n)){const e=r.attributes.st.values;r.attributes.st.values=new Float32Array(2*m),r.attributes.st.values=e.concat(e)}r.indices=g}else if(s){for(m=f.length/3,g=wc.createTypedArray(m,p.length),d=0;d<p.length;d+=3)g[d]=p[d+2],g[d+1]=p[d+1],g[d+2]=p[d];r.indices=g}h.topAndBottom=new Ph({geometry:r})}let f=r.outerRing,p=ma.fromPoints(f,e),m=p.projectPointsOntoPlane(f,WT),g=Qp.computeWindingOrder2D(m);g===Mp.CLOCKWISE&&(f=f.slice().reverse());let _=Em.computeWallGeometry(f,n,e,i,o,u);h.walls.push(new Ph({geometry:_}));const y=r.holes;for(d=0;d<y.length;d++){let t=y[d];p=ma.fromPoints(t,e),m=p.projectPointsOntoPlane(t,WT),g=Qp.computeWindingOrder2D(m),g===Mp.COUNTER_CLOCKWISE&&(t=t.slice().reverse()),_=Em.computeWallGeometry(t,n,e,i,o,u),h.walls.push(new Ph({geometry:_}))}return h}function XT(e){if(s.a.typeOf.object("options",e),s.a.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),Object(l.a)(e.perPositionHeight)&&e.perPositionHeight&&Object(l.a)(e.height))throw new u.a("Cannot use both options.perPositionHeight and options.height");if(Object(l.a)(e.arcType)&&e.arcType!==vl.GEODESIC&&e.arcType!==vl.RHUMB)throw new u.a("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");const t=e.polygonHierarchy,n=Object(c.a)(e.vertexFormat,nu.DEFAULT),i=Object(c.a)(e.ellipsoid,H.WGS84),r=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),o=Object(c.a)(e.stRotation,0),a=e.textureCoordinates,d=Object(c.a)(e.perPositionHeight,!1),f=d&&Object(l.a)(e.extrudedHeight);let p=Object(c.a)(e.height,0),m=Object(c.a)(e.extrudedHeight,p);if(!f){const e=Math.max(p,m);m=Math.min(p,m),p=e}this._vertexFormat=nu.clone(n),this._ellipsoid=H.clone(i),this._granularity=r,this._stRotation=o,this._height=p,this._extrudedHeight=m,this._closeTop=Object(c.a)(e.closeTop,!0),this._closeBottom=Object(c.a)(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=d,this._perPositionHeightExtrude=f,this._shadowVolume=Object(c.a)(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=Object(c.a)(e.arcType,vl.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=a,this.packedLength=Em.computeHierarchyPackedLength(t,O)+H.packedLength+nu.packedLength+(a?Em.computeHierarchyPackedLength(a,Vt):1)+12}XT.fromPositions=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.positions",e.positions);return new XT({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates})},XT.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),n=Em.packPolygonHierarchy(e._polygonHierarchy,t,n,O),H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=Object(c.a)(e._offsetAttribute,-1),t[n++]=e._arcType,Object(l.a)(e._textureCoordinates)?n=Em.packPolygonHierarchy(e._textureCoordinates,t,n,Vt):t[n++]=-1,t[n++]=e.packedLength,t};const KT=H.clone(H.UNIT_SPHERE),JT=new nu,ZT={polygonHierarchy:{}};XT.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=Em.unpackPolygonHierarchy(e,t,O);t=i.startingIndex,delete i.startingIndex;const r=H.unpack(e,t,KT);t+=H.packedLength;const o=nu.unpack(e,t,JT);t+=nu.packedLength;const a=e[t++],u=e[t++],h=e[t++],d=e[t++],f=1===e[t++],p=1===e[t++],m=1===e[t++],g=1===e[t++],_=1===e[t++],y=e[t++],b=e[t++],v=-1===e[t]?void 0:Em.unpackPolygonHierarchy(e,t,Vt);Object(l.a)(v)?(t=v.startingIndex,delete v.startingIndex):t++;const w=e[t++];return Object(l.a)(n)||(n=new XT(ZT)),n._polygonHierarchy=i,n._ellipsoid=H.clone(r,n._ellipsoid),n._vertexFormat=nu.clone(o,n._vertexFormat),n._height=a,n._extrudedHeight=u,n._granularity=h,n._stRotation=d,n._perPositionHeightExtrude=f,n._perPositionHeight=p,n._closeTop=m,n._closeBottom=g,n._shadowVolume=_,n._offsetAttribute=-1===y?void 0:y,n._arcType=b,n._textureCoordinates=v,n.packedLength=w,n},XT.computeRectangle=function(e,t){s.a.typeOf.object("options",e),s.a.typeOf.object("options.polygonHierarchy",e.polygonHierarchy);const n=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),i=Object(c.a)(e.arcType,vl.GEODESIC);if(i!==vl.GEODESIC&&i!==vl.RHUMB)throw new u.a("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");const r=e.polygonHierarchy,o=Object(c.a)(e.ellipsoid,H.WGS84);return HT(r.positions,o,i,n,t)},XT.createGeometry=function(e){const t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,a=e._perPositionHeight,s=e._closeTop,c=e._closeBottom,u=e._arcType,d=e._textureCoordinates,f=Object(l.a)(d);let p=o.positions;if(p.length<3)return;const m=ma.fromPoints(p,n),g=Em.polygonsFromHierarchy(o,f,m.projectPointsOntoPlane.bind(m),!a,n),_=g.hierarchy,y=g.polygons,b=f?Em.polygonsFromHierarchy(d,!0,(function(e){return e}),!1).polygons:void 0;if(0===_.length)return;p=_[0].outerRing;const v=Em.computeBoundingRectangle(m.plane.normal,m.projectPointOntoPlane.bind(m),p,r,wT),O=[],w=e._height,A=e._extrudedHeight,E={perPositionHeight:a,vertexFormat:t,geometry:void 0,tangentPlane:m,boundingRectangle:v,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u};let T;if(e._perPositionHeightExtrude||!h.a.equalsEpsilon(w,A,0,h.a.EPSILON2))for(E.extrude=!0,E.top=s,E.bottom=c,E.shadowVolume=e._shadowVolume,E.offsetAttribute=e._offsetAttribute,T=0;T<y.length;T++){const e=YT(n,y[T],f?b[T]:void 0,i,_[T],a,s,c,t,u);let r;s&&c?(r=e.topAndBottom,E.geometry=Em.scaleToGeodeticHeightExtruded(r.geometry,w,A,n,a)):s?(r=e.topAndBottom,r.geometry.attributes.position.values=Qp.scaleToGeodeticHeight(r.geometry.attributes.position.values,w,n,!a),E.geometry=r.geometry):c&&(r=e.topAndBottom,r.geometry.attributes.position.values=Qp.scaleToGeodeticHeight(r.geometry.attributes.position.values,A,n,!0),E.geometry=r.geometry),(s||c)&&(E.wall=!1,r.geometry=FT(E),O.push(r));const o=e.walls;E.wall=!0;for(let e=0;e<o.length;e++){const t=o[e];E.geometry=Em.scaleToGeodeticHeightExtruded(t.geometry,w,A,n,a),t.geometry=FT(E),O.push(t)}}else for(T=0;T<y.length;T++){const r=new Ph({geometry:Em.createGeometryFromPositions(n,y[T],f?b[T]:void 0,i,a,t,u)});if(r.geometry.attributes.position.values=Qp.scaleToGeodeticHeight(r.geometry.attributes.position.values,w,n,!a),E.geometry=r.geometry,r.geometry=FT(E),Object(l.a)(e._offsetAttribute)){const t=r.geometry.attributes.position.values.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);r.geometry.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}O.push(r)}const C=$d.combineInstances(O)[0];C.attributes.position.values=new Float64Array(C.attributes.position.values),C.indices=wc.createTypedArray(C.attributes.position.values.length/3,C.indices);const x=C.attributes,S=At.fromVertices(x.position.values);return t.position||delete x.position,new Zl({attributes:x,indices:C.indices,primitiveType:C.primitiveType,boundingSphere:S,offsetAttribute:e._offsetAttribute})},XT.createShadowVolume=function(e,t,n){const i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new XT({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:nu.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(XT.prototype,{rectangle:{get:function(){if(!Object(l.a)(this._rectangle)){const e=this._polygonHierarchy.positions;this._rectangle=HT(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return Object(l.a)(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){const t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];const n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return Zl._textureCoordinateRotationPoints(i,t,n,r)}(this)),this._textureCoordinateRotationPoints}}});var $T=XT;var QT=function(e,t){this.positions=Object(l.a)(e)?e:[],this.holes=Object(l.a)(t)?t:[]};const eC=[],tC=[];function nC(e,t,n,i,r){const o=ma.fromPoints(t,e).projectPointsOntoPlane(t,eC);let a,s;Qp.computeWindingOrder2D(o)===Mp.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());let c=t.length,l=0;if(i)for(a=new Float64Array(2*c*3),s=0;s<c;s++){const e=t[s],n=t[(s+1)%c];a[l++]=e.x,a[l++]=e.y,a[l++]=e.z,a[l++]=n.x,a[l++]=n.y,a[l++]=n.z}else{let i=0;if(r===vl.GEODESIC)for(s=0;s<c;s++)i+=Em.subdivideLineCount(t[s],t[(s+1)%c],n);else if(r===vl.RHUMB)for(s=0;s<c;s++)i+=Em.subdivideRhumbLineCount(e,t[s],t[(s+1)%c],n);for(a=new Float64Array(3*i),s=0;s<c;s++){let i;r===vl.GEODESIC?i=Em.subdivideLine(t[s],t[(s+1)%c],n,tC):r===vl.RHUMB&&(i=Em.subdivideRhumbLine(e,t[s],t[(s+1)%c],n,tC));const o=i.length;for(let e=0;e<o;++e)a[l++]=i[e]}}c=a.length/3;const u=2*c,h=wc.createTypedArray(c,u);for(l=0,s=0;s<c-1;s++)h[l++]=s,h[l++]=s+1;return h[l++]=c-1,h[l++]=0,new Ph({geometry:new Zl({attributes:new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a})}),indices:h,primitiveType:zl.LINES})})}function iC(e,t,n,i,r){const o=ma.fromPoints(t,e).projectPointsOntoPlane(t,eC);let a,s;Qp.computeWindingOrder2D(o)===Mp.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());let c=t.length;const l=new Array(c);let u=0;if(i)for(a=new Float64Array(2*c*3*2),s=0;s<c;++s){l[s]=u/3;const e=t[s],n=t[(s+1)%c];a[u++]=e.x,a[u++]=e.y,a[u++]=e.z,a[u++]=n.x,a[u++]=n.y,a[u++]=n.z}else{let i=0;if(r===vl.GEODESIC)for(s=0;s<c;s++)i+=Em.subdivideLineCount(t[s],t[(s+1)%c],n);else if(r===vl.RHUMB)for(s=0;s<c;s++)i+=Em.subdivideRhumbLineCount(e,t[s],t[(s+1)%c],n);for(a=new Float64Array(3*i*2),s=0;s<c;++s){let i;l[s]=u/3,r===vl.GEODESIC?i=Em.subdivideLine(t[s],t[(s+1)%c],n,tC):r===vl.RHUMB&&(i=Em.subdivideRhumbLine(e,t[s],t[(s+1)%c],n,tC));const o=i.length;for(let e=0;e<o;++e)a[u++]=i[e]}}c=a.length/6;const h=l.length,d=2*(2*c+h),f=wc.createTypedArray(c+h,d);for(u=0,s=0;s<c;++s)f[u++]=s,f[u++]=(s+1)%c,f[u++]=s+c,f[u++]=(s+1)%c+c;for(s=0;s<h;s++){const e=l[s];f[u++]=e,f[u++]=e+c}return new Ph({geometry:new Zl({attributes:new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:a})}),indices:f,primitiveType:zl.LINES})})}function rC(e){if(s.a.typeOf.object("options",e),s.a.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&Object(l.a)(e.height))throw new u.a("Cannot use both options.perPositionHeight and options.height");if(Object(l.a)(e.arcType)&&e.arcType!==vl.GEODESIC&&e.arcType!==vl.RHUMB)throw new u.a("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");const t=e.polygonHierarchy,n=Object(c.a)(e.ellipsoid,H.WGS84),i=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),r=Object(c.a)(e.perPositionHeight,!1),o=r&&Object(l.a)(e.extrudedHeight),a=Object(c.a)(e.arcType,vl.GEODESIC);let d=Object(c.a)(e.height,0),f=Object(c.a)(e.extrudedHeight,d);if(!o){const e=Math.max(d,f);f=Math.min(d,f),d=e}this._ellipsoid=H.clone(n),this._granularity=i,this._height=d,this._extrudedHeight=f,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Em.computeHierarchyPackedLength(t,O)+H.packedLength+8}rC.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),n=Em.packPolygonHierarchy(e._polygonHierarchy,t,n,O),H.pack(e._ellipsoid,t,n),n+=H.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=Object(c.a)(e._offsetAttribute,-1),t[n]=e.packedLength,t};const oC=H.clone(H.UNIT_SPHERE),aC={polygonHierarchy:{}};rC.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=Em.unpackPolygonHierarchy(e,t,O);t=i.startingIndex,delete i.startingIndex;const r=H.unpack(e,t,oC);t+=H.packedLength;const o=e[t++],a=e[t++],u=e[t++],h=1===e[t++],d=1===e[t++],f=e[t++],p=e[t++],m=e[t];return Object(l.a)(n)||(n=new rC(aC)),n._polygonHierarchy=i,n._ellipsoid=H.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=a,n._granularity=u,n._perPositionHeight=d,n._perPositionHeightExtrude=h,n._arcType=f,n._offsetAttribute=-1===p?void 0:p,n.packedLength=m,n},rC.fromPositions=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.positions",e.positions);return new rC({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},rC.createGeometry=function(e){const t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,a=Em.polygonOutlinesFromHierarchy(i,!r,t);if(0===a.length)return;let s;const c=[],u=h.a.chordLength(n,t.maximumRadius),d=e._height,f=e._extrudedHeight;let p,m;if(e._perPositionHeightExtrude||!h.a.equalsEpsilon(d,f,0,h.a.EPSILON2))for(m=0;m<a.length;m++){if(s=iC(t,a[m],u,r,o),s.geometry=Em.scaleToGeodeticHeightExtruded(s.geometry,d,f,t,r),Object(l.a)(e._offsetAttribute)){const t=s.geometry.attributes.position.values.length/3;let n=new Uint8Array(t);e._offsetAttribute===eu.TOP?n=n.fill(1,0,t/2):(p=e._offsetAttribute===eu.NONE?0:1,n=n.fill(p)),s.geometry.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}c.push(s)}else for(m=0;m<a.length;m++){if(s=nC(t,a[m],u,r,o),s.geometry.attributes.position.values=Qp.scaleToGeodeticHeight(s.geometry.attributes.position.values,d,t,!r),Object(l.a)(e._offsetAttribute)){const t=s.geometry.attributes.position.values.length;p=e._offsetAttribute===eu.NONE?0:1;const n=new Uint8Array(t/3).fill(p);s.geometry.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}c.push(s)}const g=$d.combineInstances(c)[0],_=At.fromVertices(g.attributes.position.values);return new Zl({attributes:g.attributes,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var sC=rC;const cC=[];function lC(e,t,n,i,r){const o=cC;let a;o.length=r;const s=n.red,c=n.green,l=n.blue,u=n.alpha,h=i.red,d=i.green,f=i.blue,p=i.alpha;if(sp.equals(n,i)){for(a=0;a<r;a++)o[a]=sp.clone(n);return o}const m=(h-s)/r,g=(d-c)/r,_=(f-l)/r,y=(p-u)/r;for(a=0;a<r;a++)o[a]=new sp(s+a*m,c+a*g,l+a*_,u+a*y);return o}function uC(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,n=e.colors,i=Object(c.a)(e.width,1),r=Object(c.a)(e.colorsPerVertex,!1);if(!Object(l.a)(t)||t.length<2)throw new u.a("At least two positions are required.");if("number"!=typeof i)throw new u.a("width must be a number");if(Object(l.a)(n)&&(r&&n.length<t.length||!r&&n.length<t.length-1))throw new u.a("colors has an invalid length.");this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=nu.clone(Object(c.a)(e.vertexFormat,nu.DEFAULT)),this._arcType=Object(c.a)(e.arcType,vl.GEODESIC),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._workerName="createPolylineGeometry";let o=1+t.length*O.packedLength;o+=Object(l.a)(n)?1+n.length*sp.packedLength:1,this.packedLength=o+H.packedLength+nu.packedLength+4}uC.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");let i;n=Object(c.a)(n,0);const r=e._positions;let o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=O.packedLength)O.pack(r[i],t,n);const a=e._colors;for(o=Object(l.a)(a)?a.length:0,t[n++]=o,i=0;i<o;++i,n+=sp.packedLength)sp.pack(a[i],t,n);return H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};const hC=H.clone(H.UNIT_SPHERE),dC=new nu,fC={positions:void 0,colors:void 0,ellipsoid:hC,vertexFormat:dC,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};uC.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");let i;t=Object(c.a)(t,0);let r=e[t++];const o=new Array(r);for(i=0;i<r;++i,t+=O.packedLength)o[i]=O.unpack(e,t);r=e[t++];const a=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=sp.packedLength)a[i]=sp.unpack(e,t);const s=H.unpack(e,t,hC);t+=H.packedLength;const h=nu.unpack(e,t,dC);t+=nu.packedLength;const d=e[t++],f=1===e[t++],p=e[t++],m=e[t];return Object(l.a)(n)?(n._positions=o,n._colors=a,n._ellipsoid=H.clone(s,n._ellipsoid),n._vertexFormat=nu.clone(h,n._vertexFormat),n._width=d,n._colorsPerVertex=f,n._arcType=p,n._granularity=m,n):(fC.positions=o,fC.colors=a,fC.width=d,fC.colorsPerVertex=f,fC.arcType=p,fC.granularity=m,new uC(fC))};const pC=new O,mC=new O,gC=new O,_C=new O;uC.createGeometry=function(e){const t=e._width,n=e._vertexFormat;let i=e._colors;const r=e._colorsPerVertex,o=e._arcType,a=e._granularity,s=e._ellipsoid;let c,u,d;const f=[];let p=wl(e._positions,O.equalsEpsilon,!1,f);if(Object(l.a)(i)&&f.length>0){let e=0,t=f[0];i=i.filter((function(n,i){let o=!1;return o=r?i===t||0===i&&1===t:i+1===t,!o||(e++,t=f[e],!1)}))}let m=p.length;if(m<2||t<=0)return;if(o===vl.GEODESIC||o===vl.RHUMB){let e,t;o===vl.GEODESIC?(e=h.a.chordLength(a,s.maximumRadius),t=Tg.numberOfPoints):(e=a,t=Tg.numberOfPointsRhumbLine);const n=Tg.extractHeights(p,s);if(Object(l.a)(i)){let n=1;for(c=0;c<m-1;++c)n+=t(p[c],p[c+1],e);const o=new Array(n);let a=0;for(c=0;c<m-1;++c){const s=p[c],l=p[c+1],h=i[c],d=t(s,l,e);if(r&&c<n){const e=lC(0,0,h,i[c+1],d),t=e.length;for(u=0;u<t;++u)o[a++]=e[u]}else for(u=0;u<d;++u)o[a++]=sp.clone(h)}o[a]=sp.clone(i[i.length-1]),i=o,cC.length=0}p=o===vl.GEODESIC?Tg.generateCartesianArc({positions:p,minDistance:e,ellipsoid:s,height:n}):Tg.generateCartesianRhumbArc({positions:p,granularity:e,ellipsoid:s,height:n})}m=p.length;const g=4*m-4,_=new Float64Array(3*g),y=new Float64Array(3*g),b=new Float64Array(3*g),v=new Float32Array(2*g),w=n.st?new Float32Array(2*g):void 0,A=Object(l.a)(i)?new Uint8Array(4*g):void 0;let E,T=0,C=0,x=0,S=0;for(u=0;u<m;++u){let e,o;0===u?(E=pC,O.subtract(p[0],p[1],E),O.add(p[0],E,E)):E=p[u-1],O.clone(E,gC),O.clone(p[u],mC),u===m-1?(E=pC,O.subtract(p[m-1],p[m-2],E),O.add(p[m-1],E,E)):E=p[u+1],O.clone(E,_C),Object(l.a)(A)&&(e=0===u||r?i[u]:i[u-1],u!==m-1&&(o=i[u]));const a=u===m-1?2:4;for(d=0===u?2:0;d<a;++d){O.pack(mC,_,T),O.pack(gC,y,T),O.pack(_C,b,T),T+=3;const i=d-2<0?-1:1;if(v[C++]=d%2*2-1,v[C++]=i*t,n.st&&(w[x++]=u/(m-1),w[x++]=Math.max(v[C-2],0)),Object(l.a)(A)){const t=d<2?e:o;A[S++]=sp.floatToByte(t.red),A[S++]=sp.floatToByte(t.green),A[S++]=sp.floatToByte(t.blue),A[S++]=sp.floatToByte(t.alpha)}}}const I=new Ql;I.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:_}),I.prevPosition=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:y}),I.nextPosition=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:b}),I.expandAndWidth=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:v}),n.st&&(I.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:w})),Object(l.a)(A)&&(I.color=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0}));const P=wc.createTypedArray(g,6*m-6);let D=0,R=0;const j=m-1;for(u=0;u<j;++u)P[R++]=D,P[R++]=D+2,P[R++]=D+1,P[R++]=D+1,P[R++]=D+2,P[R++]=D+3,D+=4;return new Zl({attributes:I,indices:P,primitiveType:zl.TRIANGLES,boundingSphere:At.fromPoints(p),geometryType:Bl.POLYLINES})};var yC=uC;function bC(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;if(!Object(l.a)(t))throw new u.a("options.polylinePositions is required.");if(!Object(l.a)(n))throw new u.a("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._cornerType=Object(c.a)(e.cornerType,Km.ROUNDED),this._vertexFormat=nu.clone(Object(c.a)(e.vertexFormat,nu.DEFAULT)),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*O.packedLength;i+=1+n.length*Vt.packedLength,this.packedLength=i+H.packedLength+nu.packedLength+2}bC.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");let i;n=Object(c.a)(n,0);const r=e._positions;let o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=O.packedLength)O.pack(r[i],t,n);const a=e._shape;for(o=a.length,t[n++]=o,i=0;i<o;++i,n+=Vt.packedLength)Vt.pack(a[i],t,n);return H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};const vC=H.clone(H.UNIT_SPHERE),OC=new nu,wC={polylinePositions:void 0,shapePositions:void 0,ellipsoid:vC,vertexFormat:OC,cornerType:void 0,granularity:void 0};bC.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");let i;t=Object(c.a)(t,0);let r=e[t++];const o=new Array(r);for(i=0;i<r;++i,t+=O.packedLength)o[i]=O.unpack(e,t);r=e[t++];const a=new Array(r);for(i=0;i<r;++i,t+=Vt.packedLength)a[i]=Vt.unpack(e,t);const s=H.unpack(e,t,vC);t+=H.packedLength;const h=nu.unpack(e,t,OC);t+=nu.packedLength;const d=e[t++],f=e[t];return Object(l.a)(n)?(n._positions=o,n._shape=a,n._ellipsoid=H.clone(s,n._ellipsoid),n._vertexFormat=nu.clone(h,n._vertexFormat),n._cornerType=d,n._granularity=f,n):(wC.polylinePositions=o,wC.shapePositions=a,wC.cornerType=d,wC.granularity=f,new bC(wC))};const AC=new Nl;bC.createGeometry=function(e){const t=e._positions,n=wl(t,O.equalsEpsilon);let i=e._shape;if(i=s_.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;Qp.computeWindingOrder2D(i)===Mp.CLOCKWISE&&i.reverse();const r=Nl.fromPoints(i,AC);return function(e,t,n,i){const r=new Ql;i.position&&(r.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:e}));const o=t.length,a=e.length/3,s=(a-2*o)/(2*o),c=Qp.triangulate(t),l=(s-1)*o*6+2*c.length,u=wc.createTypedArray(a,l);let h,d,f,p,m,g;const _=2*o;let y=0;for(h=0;h<s-1;h++){for(d=0;d<o-1;d++)f=2*d+h*o*2,g=f+_,p=f+1,m=p+_,u[y++]=p,u[y++]=f,u[y++]=m,u[y++]=m,u[y++]=f,u[y++]=g;f=2*o-2+h*o*2,p=f+1,m=p+_,g=f+_,u[y++]=p,u[y++]=f,u[y++]=m,u[y++]=m,u[y++]=f,u[y++]=g}if(i.st||i.tangent||i.bitangent){const e=new Float32Array(2*a),i=1/(s-1),c=1/n.height,l=n.height/2;let u,f,p=0;for(h=0;h<s;h++){for(u=h*i,f=c*(t[0].y+l),e[p++]=u,e[p++]=f,d=1;d<o;d++)f=c*(t[d].y+l),e[p++]=u,e[p++]=f,e[p++]=u,e[p++]=f;f=c*(t[0].y+l),e[p++]=u,e[p++]=f}for(d=0;d<o;d++)u=0,f=c*(t[d].y+l),e[p++]=u,e[p++]=f;for(d=0;d<o;d++)u=(s-1)*i,f=c*(t[d].y+l),e[p++]=u,e[p++]=f;r.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:new Float32Array(e)})}const b=a-2*o;for(h=0;h<c.length;h+=3){const e=c[h]+b,t=c[h+1]+b,n=c[h+2]+b;u[y++]=e,u[y++]=t,u[y++]=n,u[y++]=n+o,u[y++]=t+o,u[y++]=e+o}let v=new Zl({attributes:r,indices:u,boundingSphere:At.fromVertices(e),primitiveType:zl.TRIANGLES});if(i.normal&&(v=$d.computeNormal(v)),i.tangent||i.bitangent){try{v=$d.computeTangentAndBitangent(v)}catch(e){cl("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(v.attributes.tangent=void 0),i.bitangent||(v.attributes.bitangent=void 0),i.st||(v.attributes.st=void 0)}return v}(s_.computePositions(n,i,r,e,!0),i,r,e._vertexFormat)};var EC=bC;function TC(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).polylinePositions,n=e.shapePositions;if(!Object(l.a)(t))throw new u.a("options.polylinePositions is required.");if(!Object(l.a)(n))throw new u.a("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._cornerType=Object(c.a)(e.cornerType,Km.ROUNDED),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*O.packedLength;i+=1+n.length*Vt.packedLength,this.packedLength=i+H.packedLength+2}TC.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");let i;n=Object(c.a)(n,0);const r=e._positions;let o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=O.packedLength)O.pack(r[i],t,n);const a=e._shape;for(o=a.length,t[n++]=o,i=0;i<o;++i,n+=Vt.packedLength)Vt.pack(a[i],t,n);return H.pack(e._ellipsoid,t,n),n+=H.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};const CC=H.clone(H.UNIT_SPHERE),xC={polylinePositions:void 0,shapePositions:void 0,ellipsoid:CC,height:void 0,cornerType:void 0,granularity:void 0};TC.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");let i;t=Object(c.a)(t,0);let r=e[t++];const o=new Array(r);for(i=0;i<r;++i,t+=O.packedLength)o[i]=O.unpack(e,t);r=e[t++];const a=new Array(r);for(i=0;i<r;++i,t+=Vt.packedLength)a[i]=Vt.unpack(e,t);const s=H.unpack(e,t,CC);t+=H.packedLength;const h=e[t++],d=e[t];return Object(l.a)(n)?(n._positions=o,n._shape=a,n._ellipsoid=H.clone(s,n._ellipsoid),n._cornerType=h,n._granularity=d,n):(xC.polylinePositions=o,xC.shapePositions=a,xC.cornerType=h,xC.granularity=d,new TC(xC))};const SC=new Nl;TC.createGeometry=function(e){const t=e._positions,n=wl(t,O.equalsEpsilon);let i=e._shape;if(i=s_.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;Qp.computeWindingOrder2D(i)===Mp.CLOCKWISE&&i.reverse();const r=Nl.fromPoints(i,SC);return function(e,t){const n=new Ql;n.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:e});const i=t.length,r=n.position.values.length/3,o=e.length/3/i,a=wc.createTypedArray(r,2*i*(o+1));let s,c,l=0;s=0;let u=s*i;for(c=0;c<i-1;c++)a[l++]=c+u,a[l++]=c+u+1;for(a[l++]=i-1+u,a[l++]=u,s=o-1,u=s*i,c=0;c<i-1;c++)a[l++]=c+u,a[l++]=c+u+1;for(a[l++]=i-1+u,a[l++]=u,s=0;s<o-1;s++){const e=i*s,t=e+i;for(c=0;c<i;c++)a[l++]=c+e,a[l++]=c+t}return new Zl({attributes:n,indices:wc.createTypedArray(r,a),boundingSphere:At.fromVertices(e),primitiveType:zl.LINES})}(s_.computePositions(n,i,r,e,!1),i)};var IC=TC;function PC(){u.a.throwInstantiationError()}PC.prototype.getURL=u.a.throwInstantiationError;var DC=PC;function RC(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).points,n=e.times;if(!Object(l.a)(t)||!Object(l.a)(n))throw new u.a("points and times are required.");if(t.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new u.a("times.length must be equal to points.length.");this._times=n,this._points=t,this._evaluateFunction=function(e){const t=e.points,n=e.times;return function(i,r){Object(l.a)(r)||(r=new To);const o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[o])/(n[o+1]-n[o]),s=t[o],c=t[o+1];return To.fastSlerp(s,c,a,r)}}(this),this._lastTimeIndex=0}Object.defineProperties(RC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),RC.prototype.findTimeInterval=wu.prototype.findTimeInterval,RC.prototype.wrapTime=wu.prototype.wrapTime,RC.prototype.clampTime=wu.prototype.clampTime,RC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var jC=RC,MC=n(17),LC=n(75),NC=n.n(LC);function BC(){this._tree=new NC.a}function FC(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function zC(e,t){return e.id===t.id}FC.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n},BC.prototype.insert=function(e,t){s.a.typeOf.string("id",e),s.a.typeOf.object("rectangle",t);const n=FC.fromRectangleAndId(e,t,new FC);this._tree.insert(n)};const kC=new FC;BC.prototype.remove=function(e,t){s.a.typeOf.string("id",e),s.a.typeOf.object("rectangle",t);const n=FC.fromRectangleAndId(e,t,kC);this._tree.remove(n,zC)};const UC=new FC;BC.prototype.collides=function(e){s.a.typeOf.object("rectangle",e);const t=FC.fromRectangleAndId("",e,UC);return this._tree.collides(t)};var VC=BC;const HC=Math.cos,GC=Math.sin,qC=Math.sqrt,WC={computePosition:function(e,t,n,i,r,o,a){const s=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle;let h=c.latitude-e.granYCos*i+r*e.granXSin;const d=HC(h),f=GC(h),p=s.z*f;let m=c.longitude+i*e.granYSin+r*e.granXCos;const g=d*HC(m),_=d*GC(m),y=s.x*g,b=s.y*_,v=qC(y*g+b*_+p*f);if(o.x=y/v,o.y=b/v,o.z=p/v,n){const t=e.stNwCorner;Object(l.a)(t)?(h=t.latitude-e.stGranYCos*i+r*e.stGranXSin,m=t.longitude+i*e.stGranYSin+r*e.stGranXCos,a.x=(m-e.stWest)*e.lonScalar,a.y=(h-e.stSouth)*e.latScalar):(a.x=(m-u.west)*e.lonScalar,a.y=(h-u.south)*e.latScalar)}}},YC=new Es;let XC=new O;const KC=new R;let JC=new O;const ZC=new q;function $C(e,t,n,i,r,o,a){const s=Math.cos(t),c=i*s,l=n*s,u=Math.sin(t),h=i*u,d=n*u;XC=ZC.project(e,XC),XC=O.subtract(XC,JC,XC);const f=Es.fromRotation(t,YC);XC=Es.multiplyByVector(f,XC,XC),XC=O.add(XC,JC,XC),o-=1,a-=1;const p=(e=ZC.unproject(XC,e)).latitude,m=p+o*d,g=p-c*a,_=p-c*a+o*d,y=Math.max(p,m,g,_),b=Math.min(p,m,g,_),v=e.longitude,w=v+o*l,A=v+a*h,E=v+a*h+o*l;return{north:y,south:b,east:Math.max(v,w,A,E),west:Math.min(v,w,A,E),granYCos:c,granYSin:h,granXCos:l,granXSin:d,nwCorner:e}}WC.computeOptions=function(e,t,n,i,r,o,a){let s,c=e.east,l=e.west,d=e.north,f=e.south,p=!1,m=!1;d===h.a.PI_OVER_TWO&&(p=!0),f===-h.a.PI_OVER_TWO&&(m=!0);const g=d-f;s=l>c?h.a.TWO_PI-l+c:c-l;const _=Math.ceil(s/t)+1,y=Math.ceil(g/t)+1,b=s/(_-1),v=g/(y-1),O=Be.northwest(e,o),w=Be.center(e,KC);0===n&&0===i||(w.longitude<O.longitude&&(w.longitude+=h.a.TWO_PI),JC=ZC.project(w,JC));const A=v,E=b,T=Be.clone(e,r),C={granYCos:A,granYSin:0,granXCos:E,granXSin:0,nwCorner:O,boundingRectangle:T,width:_,height:y,northCap:p,southCap:m};if(0!==n){const e=$C(O,n,b,v,0,_,y);if(d=e.north,f=e.south,c=e.east,l=e.west,d<-h.a.PI_OVER_TWO||d>h.a.PI_OVER_TWO||f<-h.a.PI_OVER_TWO||f>h.a.PI_OVER_TWO)throw new u.a("Rotated rectangle is invalid.  It crosses over either the north or south pole.");C.granYCos=e.granYCos,C.granYSin=e.granYSin,C.granXCos=e.granXCos,C.granXSin=e.granXSin,T.north=d,T.south=f,T.east=c,T.west=l}if(0!==i){n-=i;const e=Be.northwest(T,a),t=$C(e,n,b,v,0,_,y);C.stGranYCos=t.granYCos,C.stGranXCos=t.granXCos,C.stGranYSin=t.granYSin,C.stGranXSin=t.granXSin,C.stNwCorner=e,C.stWest=t.west,C.stSouth=t.south}return C};var QC=WC;const ex=new O,tx=new O,nx=new O,ix=new O,rx=new Be,ox=new Vt,ax=new At,sx=new At;function cx(e,t){const n=new Zl({attributes:new Ql,primitiveType:zl.TRIANGLES});return n.attributes.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}const lx=new O,ux=new O;function hx(e,t){const n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,a=t.northCap,s=t.southCap;let c=0,l=r,u=r,h=0;a&&(c=1,u-=1,h+=1),s&&(l-=1,u-=1,h+=1),h+=o*u;const d=n.position?new Float64Array(3*h):void 0,f=n.st?new Float32Array(2*h):void 0;let p=0,m=0;const g=ex,_=ox;let y=Number.MAX_VALUE,b=Number.MAX_VALUE,v=-Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let e=c;e<l;++e)for(let r=0;r<o;++r)QC.computePosition(t,i,n.st,e,r,g,_),d[p++]=g.x,d[p++]=g.y,d[p++]=g.z,n.st&&(f[m++]=_.x,f[m++]=_.y,y=Math.min(y,_.x),b=Math.min(b,_.y),v=Math.max(v,_.x),w=Math.max(w,_.y));if(a&&(QC.computePosition(t,i,n.st,0,0,g,_),d[p++]=g.x,d[p++]=g.y,d[p++]=g.z,n.st&&(f[m++]=_.x,f[m++]=_.y,y=_.x,b=_.y,v=_.x,w=_.y)),s&&(QC.computePosition(t,i,n.st,r-1,0,g,_),d[p++]=g.x,d[p++]=g.y,d[p]=g.z,n.st&&(f[m++]=_.x,f[m]=_.y,y=Math.min(y,_.x),b=Math.min(b,_.y),v=Math.max(v,_.x),w=Math.max(w,_.y))),n.st&&(y<0||b<0||v>1||w>1))for(let e=0;e<f.length;e+=2)f[e]=(f[e]-y)/(v-y),f[e+1]=(f[e+1]-b)/(w-b);const A=function(e,t,n,i){const r=e.length,o=t.normal?new Float32Array(r):void 0,a=t.tangent?new Float32Array(r):void 0,s=t.bitangent?new Float32Array(r):void 0;let c=0;const l=ix,u=nx;let h=tx;if(t.normal||t.tangent||t.bitangent)for(let d=0;d<r;d+=3){const r=O.fromArray(e,d,ex),f=c+1,p=c+2;h=n.geodeticSurfaceNormal(r,h),(t.tangent||t.bitangent)&&(O.cross(O.UNIT_Z,h,u),ce.multiplyByVector(i,u,u),O.normalize(u,u),t.bitangent&&O.normalize(O.cross(h,u,l),l)),t.normal&&(o[c]=h.x,o[f]=h.y,o[p]=h.z),t.tangent&&(a[c]=u.x,a[f]=u.y,a[p]=u.z),t.bitangent&&(s[c]=l.x,s[f]=l.y,s[p]=l.z),c+=3}return cx(t,{positions:e,normals:o,tangents:a,bitangents:s})}(d,n,i,t.tangentRotationMatrix);let E=6*(o-1)*(u-1);a&&(E+=3*(o-1)),s&&(E+=3*(o-1));const T=wc.createTypedArray(h,E);let C,x=0,S=0;for(C=0;C<u-1;++C){for(let e=0;e<o-1;++e){const e=x,t=e+o,n=t+1,i=e+1;T[S++]=e,T[S++]=t,T[S++]=i,T[S++]=i,T[S++]=t,T[S++]=n,++x}++x}if(a||s){let e=h-1;const t=h-1;let n,i;if(a&&s&&(e=h-2),x=0,a)for(C=0;C<o-1;C++)n=x,i=n+1,T[S++]=e,T[S++]=n,T[S++]=i,++x;if(s)for(x=(u-1)*o,C=0;C<o-1;C++)n=x,i=n+1,T[S++]=n,T[S++]=t,T[S++]=i,++x}return A.indices=T,n.st&&(A.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:f})),A}function dx(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function fx(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}const px=new nu;function mx(e,t){const n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,a=e._surfaceHeight,s=e._ellipsoid,c=t.height,u=t.width;let d;if(n){const t=nu.clone(r,px);t.normal=!0,e._vertexFormat=t}const f=hx(e,t);n&&(e._vertexFormat=r);let p=Qp.scaleToGeodeticHeight(f.attributes.position.values,a,s,!1);p=new Float64Array(p);let m=p.length;const g=2*m,_=new Float64Array(g);_.set(p);const y=Qp.scaleToGeodeticHeight(f.attributes.position.values,o,s);_.set(y,m),f.attributes.position.values=_;const b=r.normal?new Float32Array(g):void 0,v=r.tangent?new Float32Array(g):void 0,w=r.bitangent?new Float32Array(g):void 0,A=r.st?new Float32Array(g/3*2):void 0;let E,T,C;if(r.normal){for(T=f.attributes.normal.values,b.set(T),d=0;d<m;d++)T[d]=-T[d];b.set(T,m),f.attributes.normal.values=b}if(n){T=f.attributes.normal.values,r.normal||(f.attributes.normal=void 0);const e=new Float32Array(g);for(d=0;d<m;d++)T[d]=-T[d];e.set(T,m),f.attributes.extrudeDirection=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:e})}const x=Object(l.a)(i);if(x){const e=m/3*2;let t=new Uint8Array(e);i===eu.TOP?t=t.fill(1,0,e/2):(C=i===eu.NONE?0:1,t=t.fill(C)),f.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:t})}if(r.tangent){const e=f.attributes.tangent.values;for(v.set(e),d=0;d<m;d++)e[d]=-e[d];v.set(e,m),f.attributes.tangent.values=v}if(r.bitangent){const e=f.attributes.bitangent.values;w.set(e),w.set(e,m),f.attributes.bitangent.values=w}r.st&&(E=f.attributes.st.values,A.set(E),A.set(E,m/3*2),f.attributes.st.values=A);const S=f.indices,I=S.length,P=m/3,D=wc.createTypedArray(g/3,2*I);for(D.set(S),d=0;d<I;d+=3)D[d+I]=S[d+2]+P,D[d+1+I]=S[d+1]+P,D[d+2+I]=S[d]+P;f.indices=D;const R=t.northCap,j=t.southCap;let M=c,L=2,N=0,B=4,F=4;R&&(L-=1,M-=1,N+=1,B-=2,F-=1),j&&(L-=1,M-=1,N+=1,B-=2,F-=1),N+=L*u+2*M-B;const z=2*(N+F);let k=new Float64Array(3*z);const U=n?new Float32Array(3*z):void 0;let V=x?new Uint8Array(z):void 0,H=r.st?new Float32Array(2*z):void 0;const G=i===eu.TOP;x&&!G&&(C=i===eu.ALL?1:0,V=V.fill(C));let q=0,W=0,Y=0,X=0;const K=u*M;let J;for(d=0;d<K;d+=u)J=3*d,k=dx(k,q,J,p,y),q+=6,r.st&&(H=fx(H,W,2*d,E),W+=4),n&&(Y+=3,U[Y++]=T[J],U[Y++]=T[J+1],U[Y++]=T[J+2]),G&&(V[X++]=1,X+=1);if(j){const e=R?K+1:K;for(J=3*e,d=0;d<2;d++)k=dx(k,q,J,p,y),q+=6,r.st&&(H=fx(H,W,2*e,E),W+=4),n&&(Y+=3,U[Y++]=T[J],U[Y++]=T[J+1],U[Y++]=T[J+2]),G&&(V[X++]=1,X+=1)}else for(d=K-u;d<K;d++)J=3*d,k=dx(k,q,J,p,y),q+=6,r.st&&(H=fx(H,W,2*d,E),W+=4),n&&(Y+=3,U[Y++]=T[J],U[Y++]=T[J+1],U[Y++]=T[J+2]),G&&(V[X++]=1,X+=1);for(d=K-1;d>0;d-=u)J=3*d,k=dx(k,q,J,p,y),q+=6,r.st&&(H=fx(H,W,2*d,E),W+=4),n&&(Y+=3,U[Y++]=T[J],U[Y++]=T[J+1],U[Y++]=T[J+2]),G&&(V[X++]=1,X+=1);if(R){const e=K;for(J=3*e,d=0;d<2;d++)k=dx(k,q,J,p,y),q+=6,r.st&&(H=fx(H,W,2*e,E),W+=4),n&&(Y+=3,U[Y++]=T[J],U[Y++]=T[J+1],U[Y++]=T[J+2]),G&&(V[X++]=1,X+=1)}else for(d=u-1;d>=0;d--)J=3*d,k=dx(k,q,J,p,y),q+=6,r.st&&(H=fx(H,W,2*d,E),W+=4),n&&(Y+=3,U[Y++]=T[J],U[Y++]=T[J+1],U[Y++]=T[J+2]),G&&(V[X++]=1,X+=1);let Z=function(e,t,n){const i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,a=t.bitangent?new Float32Array(i):void 0;let s=0,c=0,l=0,u=!0,d=ix,f=nx,p=tx;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){const g=O.fromArray(e,m,ex),_=O.fromArray(e,(m+6)%i,lx);if(u){const t=O.fromArray(e,(m+3)%i,ux);O.subtract(_,g,_),O.subtract(t,g,t),p=O.normalize(O.cross(t,_,p),p),u=!1}O.equalsEpsilon(_,g,h.a.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(g,d),t.tangent&&(f=O.normalize(O.cross(d,p,f),f))),t.normal&&(r[s++]=p.x,r[s++]=p.y,r[s++]=p.z,r[s++]=p.x,r[s++]=p.y,r[s++]=p.z),t.tangent&&(o[c++]=f.x,o[c++]=f.y,o[c++]=f.z,o[c++]=f.x,o[c++]=f.y,o[c++]=f.z),t.bitangent&&(a[l++]=d.x,a[l++]=d.y,a[l++]=d.z,a[l++]=d.x,a[l++]=d.y,a[l++]=d.z)}return cx(t,{positions:e,normals:r,tangents:o,bitangents:a})}(k,r,s);r.st&&(Z.attributes.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:H})),n&&(Z.attributes.extrudeDirection=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:U})),x&&(Z.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:V}));const $=wc.createTypedArray(z,6*N);let Q,ee,te,ne;m=k.length/3;let ie=0;for(d=0;d<m-1;d+=2){Q=d,ne=(Q+2)%m;const e=O.fromArray(k,3*Q,lx),t=O.fromArray(k,3*ne,ux);O.equalsEpsilon(e,t,h.a.EPSILON10)||(ee=(Q+1)%m,te=(ee+2)%m,$[ie++]=Q,$[ie++]=ee,$[ie++]=ne,$[ie++]=ne,$[ie++]=ee,$[ie++]=te)}return Z.indices=$,Z=$d.combineInstances([new Ph({geometry:f}),new Ph({geometry:Z})]),Z[0]}const gx=[new O,new O,new O,new O],_x=new R,yx=new R;function bx(e,t,n,i,r){if(0===n)return Be.clone(e,r);const o=QC.computeOptions(e,t,n,0,rx,_x),a=o.height,s=o.width,c=gx;return QC.computePosition(o,i,!1,0,0,c[0]),QC.computePosition(o,i,!1,0,s-1,c[1]),QC.computePosition(o,i,!1,a-1,0,c[2]),QC.computePosition(o,i,!1,a-1,s-1,c[3]),Be.fromCartesianArray(c,i,r)}function vx(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).rectangle;if(s.a.typeOf.object("rectangle",t),Be.validate(t),t.north<t.south)throw new u.a("options.rectangle.north must be greater than or equal to options.rectangle.south");const n=Object(c.a)(e.height,0),i=Object(c.a)(e.extrudedHeight,n);this._rectangle=Be.clone(t),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._ellipsoid=H.clone(Object(c.a)(e.ellipsoid,H.WGS84)),this._surfaceHeight=Math.max(n,i),this._rotation=Object(c.a)(e.rotation,0),this._stRotation=Object(c.a)(e.stRotation,0),this._vertexFormat=nu.clone(Object(c.a)(e.vertexFormat,nu.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=Object(c.a)(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}vx.packedLength=Be.packedLength+H.packedLength+nu.packedLength+7,vx.pack=function(e,t,n){return s.a.typeOf.object("value",e),s.a.defined("array",t),n=Object(c.a)(n,0),Be.pack(e._rectangle,t,n),n+=Be.packedLength,H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),n+=nu.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Ox=new Be,wx=H.clone(H.UNIT_SPHERE),Ax={rectangle:Ox,ellipsoid:wx,vertexFormat:px,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};vx.unpack=function(e,t,n){s.a.defined("array",e),t=Object(c.a)(t,0);const i=Be.unpack(e,t,Ox);t+=Be.packedLength;const r=H.unpack(e,t,wx);t+=H.packedLength;const o=nu.unpack(e,t,px);t+=nu.packedLength;const a=e[t++],u=e[t++],h=e[t++],d=e[t++],f=e[t++],p=1===e[t++],m=e[t];return Object(l.a)(n)?(n._rectangle=Be.clone(i,n._rectangle),n._ellipsoid=H.clone(r,n._ellipsoid),n._vertexFormat=nu.clone(o,n._vertexFormat),n._granularity=a,n._surfaceHeight=u,n._rotation=h,n._stRotation=d,n._extrudedHeight=f,n._shadowVolume=p,n._offsetAttribute=-1===m?void 0:m,n):(Ax.granularity=a,Ax.height=u,Ax.rotation=h,Ax.stRotation=d,Ax.extrudedHeight=f,Ax.shadowVolume=p,Ax.offsetAttribute=-1===m?void 0:m,new vx(Ax))},vx.computeRectangle=function(e,t){const n=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).rectangle;if(s.a.typeOf.object("rectangle",n),Be.validate(n),n.north<n.south)throw new u.a("options.rectangle.north must be greater than or equal to options.rectangle.south");const i=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),r=Object(c.a)(e.ellipsoid,H.WGS84);return bx(n,i,Object(c.a)(e.rotation,0),r,t)};const Ex=new ce,Tx=new To,Cx=new R;vx.createGeometry=function(e){if(h.a.equalsEpsilon(e._rectangle.north,e._rectangle.south,h.a.EPSILON10)||h.a.equalsEpsilon(e._rectangle.east,e._rectangle.west,h.a.EPSILON10))return;let t=e._rectangle;const n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,a=QC.computeOptions(t,e._granularity,i,r,rx,_x,yx),s=Ex;if(0!==r||0!==i){const e=Be.center(t,Cx),i=n.geodeticSurfaceNormalCartographic(e,lx);To.fromAxisAngle(i,-r,Tx),ce.fromQuaternion(Tx,s)}else ce.clone(ce.IDENTITY,s);const c=e._surfaceHeight,u=e._extrudedHeight,d=!h.a.equalsEpsilon(c,u,0,h.a.EPSILON2);let f,p;if(a.lonScalar=1/e._rectangle.width,a.latScalar=1/e._rectangle.height,a.tangentRotationMatrix=s,t=e._rectangle,d){f=mx(e,a);const i=At.fromRectangle3D(t,n,c,sx),r=At.fromRectangle3D(t,n,u,ax);p=At.union(i,r)}else{if(f=hx(e,a),f.attributes.position.values=Qp.scaleToGeodeticHeight(f.attributes.position.values,c,n,!1),Object(l.a)(e._offsetAttribute)){const t=f.attributes.position.values.length,n=e._offsetAttribute===eu.NONE?0:1,i=new Uint8Array(t/3).fill(n);f.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:i})}p=At.fromRectangle3D(t,n,c)}return o.position||delete f.attributes.position,new Zl({attributes:f.attributes,indices:f.indices,primitiveType:f.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})},vx.createShadowVolume=function(e,t,n){const i=e._granularity,r=e._ellipsoid,o=t(i,r),a=n(i,r);return new vx({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:o,vertexFormat:nu.POSITION_ONLY,shadowVolume:!0})};const xx=new Be,Sx=[new Vt,new Vt,new Vt],Ix=new Es,Px=new R;Object.defineProperties(vx.prototype,{rectangle:{get:function(){return Object(l.a)(this._rotatedRectangle)||(this._rotatedRectangle=bx(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return Object(l.a)(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(e){if(0===e._stRotation)return[0,0,0,1,1,0];const t=Be.clone(e._rectangle,xx),n=e._granularity,i=e._ellipsoid,r=bx(t,n,e._rotation-e._stRotation,i,xx),o=Sx;o[0].x=r.west,o[0].y=r.south,o[1].x=r.west,o[1].y=r.north,o[2].x=r.east,o[2].y=r.south;const a=e.rectangle,s=Es.fromRotation(e._stRotation,Ix),c=Be.center(a,Px);for(let e=0;e<3;++e){const t=o[e];t.x-=c.longitude,t.y-=c.latitude,Es.multiplyByVector(s,t,t),t.x+=c.longitude,t.y+=c.latitude,t.x=(t.x-a.west)/a.width,t.y=(t.y-a.south)/a.height}const l=o[0],u=o[1],h=o[2],d=new Array(6);return Vt.pack(l,d),Vt.pack(u,d,2),Vt.pack(h,d,4),d}(this)),this._textureCoordinateRotationPoints}}});var Dx=vx;const Rx=new At,jx=new At,Mx=new O,Lx=new Be;function Nx(e,t){const n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,a=t.southCap;let s=i,c=2,l=0,u=4;o&&(c-=1,s-=1,l+=1,u-=2),a&&(c-=1,s-=1,l+=1,u-=2),l+=c*r+2*s-u;const h=new Float64Array(3*l);let d,f=0,p=0;const m=Mx;if(o)QC.computePosition(t,n,!1,p,0,m),h[f++]=m.x,h[f++]=m.y,h[f++]=m.z;else for(d=0;d<r;d++)QC.computePosition(t,n,!1,p,d,m),h[f++]=m.x,h[f++]=m.y,h[f++]=m.z;for(d=r-1,p=1;p<i;p++)QC.computePosition(t,n,!1,p,d,m),h[f++]=m.x,h[f++]=m.y,h[f++]=m.z;if(p=i-1,!a)for(d=r-2;d>=0;d--)QC.computePosition(t,n,!1,p,d,m),h[f++]=m.x,h[f++]=m.y,h[f++]=m.z;for(d=0,p=i-2;p>0;p--)QC.computePosition(t,n,!1,p,d,m),h[f++]=m.x,h[f++]=m.y,h[f++]=m.z;const g=h.length/3*2,_=wc.createTypedArray(h.length/3,g);let y=0;for(let e=0;e<h.length/3-1;e++)_[y++]=e,_[y++]=e+1;_[y++]=h.length/3-1,_[y++]=0;const b=new Zl({attributes:new Ql,primitiveType:zl.LINES});return b.attributes.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:h}),b.indices=_,b}function Bx(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).rectangle,n=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),i=Object(c.a)(e.ellipsoid,H.WGS84),r=Object(c.a)(e.rotation,0);if(!Object(l.a)(t))throw new u.a("rectangle is required.");if(Be.validate(t),t.north<t.south)throw new u.a("options.rectangle.north must be greater than options.rectangle.south");const o=Object(c.a)(e.height,0),a=Object(c.a)(e.extrudedHeight,o);this._rectangle=Be.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,a),this._rotation=r,this._extrudedHeight=Math.min(o,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}Bx.packedLength=Be.packedLength+H.packedLength+5,Bx.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return n=Object(c.a)(n,0),Be.pack(e._rectangle,t,n),n+=Be.packedLength,H.pack(e._ellipsoid,t,n),n+=H.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=Object(c.a)(e._offsetAttribute,-1),t};const Fx=new Be,zx=H.clone(H.UNIT_SPHERE),kx={rectangle:Fx,ellipsoid:zx,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};Bx.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");t=Object(c.a)(t,0);const i=Be.unpack(e,t,Fx);t+=Be.packedLength;const r=H.unpack(e,t,zx);t+=H.packedLength;const o=e[t++],a=e[t++],s=e[t++],h=e[t++],d=e[t];return Object(l.a)(n)?(n._rectangle=Be.clone(i,n._rectangle),n._ellipsoid=H.clone(r,n._ellipsoid),n._surfaceHeight=a,n._rotation=s,n._extrudedHeight=h,n._offsetAttribute=-1===d?void 0:d,n):(kx.granularity=o,kx.height=a,kx.rotation=s,kx.extrudedHeight=h,kx.offsetAttribute=-1===d?void 0:d,new Bx(kx))};const Ux=new R;Bx.createGeometry=function(e){const t=e._rectangle,n=e._ellipsoid,i=QC.computeOptions(t,e._granularity,e._rotation,0,Lx,Ux);let r,o;if(h.a.equalsEpsilon(t.north,t.south,h.a.EPSILON10)||h.a.equalsEpsilon(t.east,t.west,h.a.EPSILON10))return;const a=e._surfaceHeight,s=e._extrudedHeight;let c;if(!h.a.equalsEpsilon(a,s,0,h.a.EPSILON2)){if(r=function(e,t){const n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=i,a=n,s=Nx(e,t),c=t.height,l=t.width,u=Qp.scaleToGeodeticHeight(s.attributes.position.values,a,r,!1);let h=u.length;const d=new Float64Array(2*h);d.set(u);const f=Qp.scaleToGeodeticHeight(s.attributes.position.values,o,r);d.set(f,h),s.attributes.position.values=d;const p=t.northCap,m=t.southCap;let g=4;p&&(g-=1),m&&(g-=1);const _=2*(d.length/3+g),y=wc.createTypedArray(d.length/3,_);h=d.length/6;let b,v=0;for(let e=0;e<h-1;e++)y[v++]=e,y[v++]=e+1,y[v++]=e+h,y[v++]=e+h+1;if(y[v++]=h-1,y[v++]=0,y[v++]=h+h-1,y[v++]=h,y[v++]=0,y[v++]=h,p)b=c-1;else{const e=l-1;y[v++]=e,y[v++]=e+h,b=l+c-2}if(y[v++]=b,y[v++]=b+h,!m){const e=l+b-1;y[v++]=e,y[v]=e+h}return s.indices=y,s}(e,i),Object(l.a)(e._offsetAttribute)){const t=r.attributes.position.values.length/3;let n=new Uint8Array(t);e._offsetAttribute===eu.TOP?n=n.fill(1,0,t/2):(c=e._offsetAttribute===eu.NONE?0:1,n=n.fill(c)),r.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}const u=At.fromRectangle3D(t,n,a,jx),h=At.fromRectangle3D(t,n,s,Rx);o=At.union(u,h)}else{if(r=Nx(e,i),r.attributes.position.values=Qp.scaleToGeodeticHeight(r.attributes.position.values,a,n,!1),Object(l.a)(e._offsetAttribute)){const t=r.attributes.position.values.length;c=e._offsetAttribute===eu.NONE?0:1;const n=new Uint8Array(t/3).fill(c);r.attributes.applyOffset=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,values:n})}o=At.fromRectangle3D(t,n,a)}return new Zl({attributes:r.attributes,indices:r.indices,primitiveType:zl.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var Vx=Bx;var Hx=Object.freeze({FIXED:0,INERTIAL:1});let Gx;"undefined"!=typeof requestAnimationFrame&&(Gx=requestAnimationFrame),function(){if(!Object(l.a)(Gx)&&"undefined"!=typeof window){const e=["webkit","moz","ms","o"];let t=0;const n=e.length;for(;t<n&&!Object(l.a)(Gx);)Gx=window[e[t]+"RequestAnimationFrame"],++t}if(!Object(l.a)(Gx)){const e=1e3/60;let t=0;Gx=function(n){const i=Xf(),r=Math.max(e-(i-t),0);return t=i+r,setTimeout((function(){n(t)}),r)}}}();var qx=function(e){return ll("Cesium.requestAnimationFrame","Cesium.requestAnimationFrame was deprecated in CesiumJS 1.96 and will be removed in 1.99. Use the native requestAnimationFrame method instead."),Gx(e)},Wx=n(23),Yx=n(16);var Xx=function(e){const t=document.createElement("canvas");return t.width=h.a.nextPowerOfTwo(e.width),t.height=h.a.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t};const Kx=[],Jx=[],Zx=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],$x=[1,0,0,3];function Qx(e){if(!Jr.supportsBigInt())throw new ye.a("S2 required BigInt support");if(!Object(l.a)(e))throw new u.a("cell ID is required.");if(!Qx.isValidId(e))throw new u.a("cell ID is invalid.");this._cellId=e,this._level=Qx.getLevel(e)}function eS(e){0===Kx.length&&(oS(0,0,0,0,0,0),oS(0,0,0,1,0,1),oS(0,0,0,2,0,2),oS(0,0,0,3,0,3));const t=Number(e>>BigInt(61));let n=1&t;let i=0,r=0;for(let t=7;t>=0;t--){const o=(1<<2*(7===t?2:4))-1;n+=Number(e>>BigInt(2*t*4+1)&BigInt(o))<<2,n=Jx[n];const a=4*t;i+=n>>6<<a,r+=(n>>2&15)<<a,n&=3}return[t,i,r]}function tS(e,t,n){switch(e){case 0:return new O(1,t,n);case 1:return new O(-t,1,n);case 2:return new O(-t,-n,1);case 3:return new O(-1,-n,-t);case 4:return new O(n,-1,-t);default:return new O(n,t,-1)}}function nS(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function iS(e){return 1/(1<<31>>>0)*e}function rS(e){return 1/(1<<30)*e}function oS(e,t,n,i,r,o){if(4===e){const e=(t<<4)+n;Kx[(e<<2)+i]=(r<<2)+o,Jx[(r<<2)+i]=(e<<2)+o}else{e++,n<<=1,r<<=2;const a=Zx[o];oS(e,(t<<=1)+(a[0]>>1),n+(1&a[0]),i,r,o^$x[0]),oS(e,t+(a[1]>>1),n+(1&a[1]),i,r+1,o^$x[1]),oS(e,t+(a[2]>>1),n+(1&a[2]),i,r+2,o^$x[2]),oS(e,t+(a[3]>>1),n+(1&a[3]),i,r+3,o^$x[3])}}function aS(e){return e&~e+BigInt(1)}Qx.fromToken=function(e){if(s.a.typeOf.string("token",e),!Qx.isValidToken(e))throw new u.a("token is invalid.");return new Qx(Qx.getIdFromToken(e))},Qx.isValidId=function(e){if(s.a.typeOf.bigint("cellId",e),e<=0)return!1;if(e>>BigInt(61)>5)return!1;return!!(e&~e+BigInt(1)&BigInt("0x1555555555555555"))},Qx.isValidToken=function(e){return s.a.typeOf.string("token",e),!!/^[0-9a-fA-F]{1,16}$/.test(e)&&Qx.isValidId(Qx.getIdFromToken(e))},Qx.getIdFromToken=function(e){return s.a.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))},Qx.getTokenFromId=function(e){s.a.typeOf.bigint("cellId",e);const t=Math.floor(sS[(-(n=e)&n)%BigInt(67)]/4);var n;const i=e.toString(16).replace(/0*$/,"");return Array(17-t-i.length).join("0")+i},Qx.getLevel=function(e){if(s.a.typeOf.bigint("cellId",e),!Qx.isValidId(e))throw new u.a;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e>>=BigInt(1);return 30-(t>>1)},Qx.prototype.getChild=function(e){if(s.a.typeOf.number("index",e),e<0||e>3)throw new u.a("child index must be in the range [0-3].");if(30===this._level)throw new u.a("cannot get child of leaf cell.");const t=aS(this._cellId)>>BigInt(2);return new Qx(this._cellId+BigInt(2*e+1-4)*t)},Qx.prototype.getParent=function(){if(0===this._level)throw new u.a("cannot get parent of root cell.");const e=aS(this._cellId)<<BigInt(2);return new Qx(this._cellId&~e+BigInt(1)|e)},Qx.prototype.getParentAtLevel=function(e){if(0===this._level||e<0||this._level<e)throw new u.a("cannot get parent at invalid level.");const t=function(e){return BigInt(1)<<BigInt(2*(30-e))}(e);return new Qx(this._cellId&-t|t)},Qx.prototype.getCenter=function(e){e=Object(c.a)(e,H.WGS84);let t=function(e,t){const n=function(e,t){const n=eS(e),i=n[0],r=n[1],o=n[2],a=30===t,s=!a&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=a?1:s?2:0;return[i,(r<<1)+c,(o<<1)+c]}(e,t);return function(e,t,n){const i=iS(t),r=iS(n),o=nS(i),a=nS(r);return tS(e,o,a)}(n[0],n[1],n[2])}(this._cellId,this._level);t=O.normalize(t,t);const n=new R.fromCartesian(t,H.UNIT_SPHERE);return R.toCartesian(n,e,new O)},Qx.prototype.getVertex=function(e,t){if(s.a.typeOf.number("index",e),e<0||e>3)throw new u.a("vertex index must be in the range [0-3].");t=Object(c.a)(t,H.WGS84);let n=function(e,t,n){const i=eS(e),r=function(e,t){const n=[[],[]],i=function(e){return 1<<30-e>>>0}(t);for(let t=0;t<2;++t){const r=e[t]&-i,o=r+i;n[t][0]=nS(rS(r)),n[t][1]=nS(rS(o))}return n}([i[1],i[2]],t),o=n>>1&1;return tS(i[0],r[0][o^1&n],r[1][o])}(this._cellId,this._level,e);n=O.normalize(n,n);const i=new R.fromCartesian(n,H.UNIT_SPHERE);return R.toCartesian(i,t,new O)},Qx.fromFacePositionLevel=function(e,t,n){if(s.a.typeOf.bigint("position",t),e<0||e>5)throw new u.a("Invalid S2 Face (must be within 0-5)");if(n<0||n>30)throw new u.a("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new u.a("Invalid Hilbert position for level");const i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),a=Array(61-2*n).join("0");return new Qx(BigInt(`0b${i}${o}${r}1${a}`))};const sS=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];var cS=Qx;function lS(e,t,n){const i=t.interpolateHeight(n,e.longitude,e.latitude);return void 0!==i&&(e.height=i,!0)}var uS=function(e,t,n){return s.a.typeOf.object("terrainProvider",e),s.a.typeOf.number("level",t),s.a.defined("positions",n),e.readyPromise.then((function(){return function(e,t,n){const i=e.tilingScheme;let r;const o=[],a={};for(r=0;r<n.length;++r){const s=i.positionToTileXY(n[r],t),c=s.toString();if(!a.hasOwnProperty(c)){const n={x:s.x,y:s.y,level:t,tilingScheme:i,terrainProvider:e,positions:[]};a[c]=n,o.push(n)}a[c].positions.push(n[r])}const s=[];return function e(t,n){if(!t.length)return Promise.resolve();if(function(e,t){const n=e[0],i=n.terrainProvider.requestTileGeometry(n.x,n.y,n.level);if(!i)return!1;const r=i.then(function(e){const t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let e=0;e<t.length;++e){if(!lS(t[e],i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then((function(){for(let e=0;e<t.length;++e){lS(t[e],i,n)}})):Promise.resolve()}}(n)).catch(function(e){const t=e.positions;return function(){for(let e=0;e<t.length;++e){t[e].height=void 0}}}(n));return e.shift(),t.push(r),!0}(t,n))return e(t,n);return(i=100,new Promise((function(e){setTimeout(e,i)}))).then(()=>e(t,n));var i}(o,s).then((function(){return Promise.all(s).then((function(){return n}))}))}(e,t,n)}))};const hS=new Vt;var dS=function e(t,n){if(!Object(l.a)(t))throw new u.a("terrainProvider is required.");if(!Object(l.a)(n))throw new u.a("positions is required.");return t.readyPromise.then((function(){const i=[],r=[],o=t.availability;if(!Object(l.a)(o))throw new u.a("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");const a=[];for(let e=0;e<n.length;++e){const s=n[e],c=o.computeMaximumLevelAtPosition(s);if(r[e]=c,0===c){t.tilingScheme.positionToTileXY(s,1,hS);const e=t.loadTileDataAvailability(hS.x,hS.y,1);Object(l.a)(e)&&a.push(e)}let u=i[c];Object(l.a)(u)||(i[c]=u=[]),u.push(s)}return Promise.all(a).then((function(){return Promise.all(i.map((function(e,n){if(Object(l.a)(e))return uS(t,n,e)})))})).then((function(){const i=[];for(let e=0;e<n.length;++e){const t=n[e];o.computeMaximumLevelAtPosition(t)!==r[e]&&i.push(t)}if(i.length>0)return e(t,i)})).then((function(){return n}))}))};var fS=Object.freeze({LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19});function pS(e,t,n){const i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;const r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function mS(e,t){let n=e;return Object(l.a)(t)&&(n+="+"+t),n}function gS(e){return e.shiftKey?ZA.SHIFT:e.ctrlKey?ZA.CTRL:e.altKey?ZA.ALT:void 0}const _S=0,yS=1,bS=2;function vS(e,t,n,i){function r(t){i(e,t)}Jr.isInternetExplorer()?n.addEventListener(t,r,!1):n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push((function(){n.removeEventListener(t,r,!1)}))}const OS={position:new Vt};function wS(e){e._lastSeenTouchEvent=Xf()}function AS(e){return Xf()-e._lastSeenTouchEvent>JS.mouseEmulationIgnoreMilliseconds}function ES(e,t,n){const i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function TS(e,t){if(!AS(e))return;const n=t.button;let i;if(e._buttonDown[n]=!0,n===_S)i=fS.LEFT_DOWN;else if(n===yS)i=fS.MIDDLE_DOWN;else{if(n!==bS)return;i=fS.RIGHT_DOWN}const r=pS(e,t,e._primaryPosition);Vt.clone(r,e._primaryStartPosition),Vt.clone(r,e._primaryPreviousPosition);const o=gS(t),a=e.getInputAction(i,o);Object(l.a)(a)&&(Vt.clone(r,OS.position),a(OS),t.preventDefault())}const CS={position:new Vt},xS={position:new Vt};function SS(e,t,n,i){const r=gS(i),o=e.getInputAction(t,r),a=e.getInputAction(n,r);if(Object(l.a)(o)||Object(l.a)(a)){const t=pS(e,i,e._primaryPosition);if(Object(l.a)(o)&&(Vt.clone(t,CS.position),o(CS)),Object(l.a)(a)){ES(e._primaryStartPosition,t,e._clickPixelTolerance)&&(Vt.clone(t,xS.position),a(xS))}}}function IS(e,t){if(!AS(e))return;const n=t.button;n!==_S&&n!==yS&&n!==bS||(e._buttonDown[_S]&&(SS(e,fS.LEFT_UP,fS.LEFT_CLICK,t),e._buttonDown[_S]=!1),e._buttonDown[yS]&&(SS(e,fS.MIDDLE_UP,fS.MIDDLE_CLICK,t),e._buttonDown[yS]=!1),e._buttonDown[bS]&&(SS(e,fS.RIGHT_UP,fS.RIGHT_CLICK,t),e._buttonDown[bS]=!1))}const PS={startPosition:new Vt,endPosition:new Vt};function DS(e,t){if(!AS(e))return;const n=gS(t),i=pS(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(fS.MOUSE_MOVE,n);Object(l.a)(o)&&(Vt.clone(r,PS.startPosition),Vt.clone(i,PS.endPosition),o(PS)),Vt.clone(i,r),(e._buttonDown[_S]||e._buttonDown[yS]||e._buttonDown[bS])&&t.preventDefault()}const RS={position:new Vt};function jS(e,t){let n;if(t.button!==_S)return;n=fS.LEFT_DOUBLE_CLICK;const i=gS(t),r=e.getInputAction(n,i);Object(l.a)(r)&&(pS(e,t,RS.position),r(RS))}function MS(e,t){let n;if(Object(l.a)(t.deltaY)){const e=t.deltaMode;n=e===t.DOM_DELTA_PIXEL?-t.deltaY:e===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else n=t.detail>0?-120*t.detail:t.wheelDelta;if(!Object(l.a)(n))return;const i=gS(t),r=e.getInputAction(fS.WHEEL,i);Object(l.a)(r)&&(r(n),t.preventDefault())}function LS(e,t){wS(e);const n=t.changedTouches;let i;const r=n.length;let o,a;const s=e._positions;for(i=0;i<r;++i)o=n[i],a=o.identifier,s.set(a,pS(e,o,new Vt));VS(e,t);const c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,c.set(a,Vt.clone(s.get(a)))}function NS(e,t){wS(e);const n=t.changedTouches;let i;const r=n.length;let o,a;const s=e._positions;for(i=0;i<r;++i)o=n[i],a=o.identifier,s.remove(a);VS(e,t);const c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,c.remove(a)}const BS={position:new Vt},FS={position1:new Vt,position2:new Vt},zS={position:new Vt},kS={position:new Vt},US={position:new Vt};function VS(e,t){const n=gS(t),i=e._positions,r=i.length;let o,a;const s=e._isPinching;if(1!==r&&e._buttonDown[_S]){if(e._buttonDown[_S]=!1,Object(l.a)(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(fS.LEFT_UP,n),Object(l.a)(o)&&(Vt.clone(e._primaryPosition,zS.position),o(zS)),0===r&&!e._isTouchHolding&&(a=e.getInputAction(fS.LEFT_CLICK,n),Object(l.a)(a))){ES(e._primaryStartPosition,e._previousPositions.values[0],e._clickPixelTolerance)&&(Vt.clone(e._primaryPosition,kS.position),a(kS))}e._isTouchHolding=!1}if(0===r&&s&&(e._isPinching=!1,o=e.getInputAction(fS.PINCH_END,n),Object(l.a)(o)&&o()),1===r&&!s){const r=i.values[0];Vt.clone(r,e._primaryPosition),Vt.clone(r,e._primaryStartPosition),Vt.clone(r,e._primaryPreviousPosition),e._buttonDown[_S]=!0,o=e.getInputAction(fS.LEFT_DOWN,n),Object(l.a)(o)&&(Vt.clone(r,BS.position),o(BS)),e._touchHoldTimer=setTimeout((function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,a=e.getInputAction(fS.RIGHT_CLICK,n),Object(l.a)(a))){ES(e._primaryStartPosition,e._previousPositions.values[0],e._holdPixelTolerance)&&(Vt.clone(e._primaryPosition,US.position),a(US))}}),JS.touchHoldDelayMilliseconds),t.preventDefault()}2!==r||s||(e._isPinching=!0,o=e.getInputAction(fS.PINCH_START,n),Object(l.a)(o)&&(Vt.clone(i.values[0],FS.position1),Vt.clone(i.values[1],FS.position2),o(FS),t.preventDefault()))}function HS(e,t){wS(e);const n=t.changedTouches;let i;const r=n.length;let o,a;const s=e._positions;for(i=0;i<r;++i){o=n[i],a=o.identifier;const t=s.get(a);Object(l.a)(t)&&pS(e,o,t)}WS(e,t);const c=e._previousPositions;for(i=0;i<r;++i)o=n[i],a=o.identifier,Vt.clone(s.get(a),c.get(a))}const GS={startPosition:new Vt,endPosition:new Vt},qS={distance:{startPosition:new Vt,endPosition:new Vt},angleAndHeight:{startPosition:new Vt,endPosition:new Vt}};function WS(e,t){const n=gS(t),i=e._positions,r=e._previousPositions,o=i.length;let a;if(1===o&&e._buttonDown[_S]){const r=i.values[0];Vt.clone(r,e._primaryPosition);const o=e._primaryPreviousPosition;a=e.getInputAction(fS.MOUSE_MOVE,n),Object(l.a)(a)&&(Vt.clone(o,GS.startPosition),Vt.clone(r,GS.endPosition),a(GS)),Vt.clone(r,o),t.preventDefault()}else if(2===o&&e._isPinching&&(a=e.getInputAction(fS.PINCH_MOVE,n),Object(l.a)(a))){const e=i.values[0],t=i.values[1],n=r.values[0],o=r.values[1],s=t.x-e.x,c=t.y-e.y,l=.25*Math.sqrt(s*s+c*c),u=o.x-n.x,h=o.y-n.y,d=.25*Math.sqrt(u*u+h*h),f=.125*(t.y+e.y),p=.125*(o.y+n.y),m=Math.atan2(c,s),g=Math.atan2(h,u);Vt.fromElements(0,d,qS.distance.startPosition),Vt.fromElements(0,l,qS.distance.endPosition),Vt.fromElements(g,p,qS.angleAndHeight.startPosition),Vt.fromElements(m,f,qS.angleAndHeight.endPosition),a(qS)}}function YS(e,t){if(t.target.setPointerCapture(t.pointerId),"touch"===t.pointerType){const n=e._positions,i=t.pointerId;n.set(i,pS(e,t,new Vt)),VS(e,t);e._previousPositions.set(i,Vt.clone(n.get(i)))}else TS(e,t)}function XS(e,t){if("touch"===t.pointerType){const n=e._positions,i=t.pointerId;n.remove(i),VS(e,t);e._previousPositions.remove(i)}else IS(e,t)}function KS(e,t){if("touch"===t.pointerType){const n=e._positions,i=t.pointerId,r=n.get(i);if(!Object(l.a)(r))return;pS(e,t,r),WS(e,t);const o=e._previousPositions;Vt.clone(n.get(i),o.get(i))}else DS(e,t)}function JS(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-JS.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new Vt,this._primaryPosition=new Vt,this._primaryPreviousPosition=new Vt,this._positions=new Tl,this._previousPositions=new Tl,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=Object(c.a)(e,document),function(e){const t=e._element,n=Object(l.a)(t.disableRootEvents)?t:document;let i;Jr.supportsPointerEvents()?(vS(e,"pointerdown",t,YS),vS(e,"pointerup",t,XS),vS(e,"pointermove",t,KS),vS(e,"pointercancel",t,XS)):(vS(e,"mousedown",t,TS),vS(e,"mouseup",n,IS),vS(e,"mousemove",n,DS),vS(e,"touchstart",t,LS),vS(e,"touchend",n,NS),vS(e,"touchmove",n,HS),vS(e,"touchcancel",n,NS)),vS(e,"dblclick",t,jS),i="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",vS(e,i,t,MS)}(this)}JS.prototype.setInputAction=function(e,t,n){if(!Object(l.a)(e))throw new u.a("action is required.");if(!Object(l.a)(t))throw new u.a("type is required.");const i=mS(t,n);this._inputEvents[i]=e},JS.prototype.getInputAction=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=mS(e,t);return this._inputEvents[n]},JS.prototype.removeInputAction=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=mS(e,t);delete this._inputEvents[n]},JS.prototype.isDestroyed=function(){return!1},JS.prototype.destroy=function(){return function(e){const t=e._removalFunctions;for(let e=0;e<t.length;++e)t[e]()}(this),sc(this)},JS.mouseEmulationIgnoreMilliseconds=800,JS.touchHoldDelayMilliseconds=1500;var ZS=JS;function $S(e){e=Object(c.a)(e,!0),this.value=$S.toValue(e)}Object.defineProperties($S.prototype,{componentDatatype:{get:function(){return gs.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),$S.toValue=function(e,t){if(!Object(l.a)(e))throw new u.a("show is required.");return Object(l.a)(t)?(t[0]=e,t):new Uint8Array([e])};var QS=$S;const eI={};function tI(e,t){t=tr.addSeconds(e,32.184,t);const n=tr.totalDays(t)-2451545;return t=tr.addSeconds(t,function(e){const t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}(n),t)}const nI=new tr(2451545,0,Mi.TAI),iI=h.a.RADIANS_PER_DEGREE,rI=h.a.RADIANS_PER_ARCSECOND,oI=new ce;function aI(e,t,n,i,r,o,a){if(n<0&&(n=-n,r+=h.a.PI),n<0||n>h.a.PI)throw new u.a("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");const s=e*(1-t),c=i-r,d=r,f=function(e,t){if(t<0||t>=1)throw new u.a("eccentricity out of range.");return function(e,t){if(t<0||t>=1)throw new u.a("eccentricity out of range.");const n=Math.floor(e/h.a.TWO_PI);e-=n*h.a.TWO_PI;const i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t);let o=Math.atan2(r,i);o=h.a.zeroToTwoPi(o),e<0&&(o-=h.a.TWO_PI);return o+=n*h.a.TWO_PI,o}(function(e,t){if(t<0||t>=1)throw new u.a("eccentricity out of range.");const n=Math.floor(e/h.a.TWO_PI);let i,r=(e-=n*h.a.TWO_PI)+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE;for(i=0;i<50&&Math.abs(o-r)>sI;++i){o=r;const n=o-t*Math.sin(o)-e,i=1-t*Math.cos(o);r=o-n/i}if(i>=50)throw new u.a("Kepler equation did not converge");return o=r+n*h.a.TWO_PI,o}(e,t),t)}(o-i,t);if("Hyperbolic"===function(e,t){if(e<0)throw new u.a("eccentricity cannot be negative.");if(e<=t)return"Circular";if(e<1-t)return"Elliptical";if(e<=1+t)return"Parabolic";return"Hyperbolic"}(t,0)&&Math.abs(h.a.negativePiToPi(f))>=Math.acos(-1/t))throw new u.a("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");!function(e,t,n,i){if(t<0||t>h.a.PI)throw new u.a("inclination out of range");const r=Math.cos(e),o=Math.sin(e),a=Math.cos(t),s=Math.sin(t),c=Math.cos(n),d=Math.sin(n);Object(l.a)(i)?(i[0]=c*r-d*o*a,i[1]=d*r+c*o*a,i[2]=o*s,i[3]=-c*o-d*r*a,i[4]=-d*o+c*r*a,i[5]=r*s,i[6]=d*s,i[7]=-c*s,i[8]=a):i=new ce(c*r-d*o*a,-c*o-d*r*a,d*s,d*r+c*o*a,-d*o+c*r*a,-c*s,o*s,r*s,a)}(c,n,d,oI);const p=s*(1+t),m=Math.cos(f),g=Math.sin(f),_=1+t*m;if(_<=h.a.Epsilon10)throw new u.a("elements cannot be converted to cartesian");const y=p/_;return Object(l.a)(a)?(a.x=y*m,a.y=y*g,a.z=0):a=new O(y*m,y*g,0),ce.multiplyByVector(oI,a,a)}const sI=h.a.EPSILON8;const cI=100.46645683*iI,lI=1295977422.83429*rI,uI=new tr(0,0,Mi.TAI);function hI(e,t){tI(e,uI);const n=(uI.dayNumber-nI.dayNumber+(uI.secondsOfDay-nI.secondsOfDay)/ji.SECONDS_PER_DAY)/ji.DAYS_PER_JULIAN_CENTURY,i=n*n,r=i*n,o=r*n;let a=383397.7725+.004*n,s=.055545526-16e-9*n;const c=5.15668983*iI;let l=-8e-5*n+.02966*i-42e-6*r-13e-8*o;const u=83.35324312*iI;let h=14643420.2669*n-38.2702*i-.045047*r+21301e-8*o;const d=125.04455501*iI;let f=-6967919.3631*n+6.3602*i+.007625*r-3586e-8*o;const p=218.31664563*iI;let m=1732559343.4847*n-6.391*i+.006588*r-3169e-8*o;const g=297.85019547*iI+rI*(1602961601.209*n-6.3706*i+.006593*r-3169e-8*o),_=134.96340251*iI+rI*(1717915923.2178*n+31.8792*i+.051635*r-2447e-7*o),y=357.52910918*iI+rI*(129596581.0481*n-.5532*i+136e-6*r-1149e-8*o),b=310.17137918*iI-rI*(6967051.436*n+6.2068*i+.007618*r-3219e-8*o),v=2*g,O=4*g,w=6*g,A=2*_,E=3*_,T=4*_,C=2*(93.27209062*iI+rI*(1739527262.8478*n-12.7512*i-.001037*r+417e-8*o));a+=3400.4*Math.cos(v)-635.6*Math.cos(v-_)-235.6*Math.cos(_)+218.1*Math.cos(v-y)+181*Math.cos(v+_),s+=.014216*Math.cos(v-_)+.008551*Math.cos(v-A)-.001383*Math.cos(_)+.001356*Math.cos(v+_)-.001147*Math.cos(O-E)-914e-6*Math.cos(O-A)+869e-6*Math.cos(v-y-_)-627e-6*Math.cos(v)-394e-6*Math.cos(O-T)+282e-6*Math.cos(v-y-A)-279e-6*Math.cos(g-_)-236e-6*Math.cos(A)+231e-6*Math.cos(O)+229e-6*Math.cos(w-T)-201e-6*Math.cos(A-C),l+=486.26*Math.cos(v-C)-40.13*Math.cos(v)+37.51*Math.cos(C)+25.73*Math.cos(A-C)+19.97*Math.cos(v-y-C),h+=-55609*Math.sin(v-_)-34711*Math.sin(v-A)-9792*Math.sin(_)+9385*Math.sin(O-E)+7505*Math.sin(O-A)+5318*Math.sin(v+_)+3484*Math.sin(O-T)-3417*Math.sin(v-y-_)-2530*Math.sin(w-T)-2376*Math.sin(v)-2075*Math.sin(v-E)-1883*Math.sin(A)-1736*Math.sin(w-5*_)+1626*Math.sin(y)-1370*Math.sin(w-E),f+=-5392*Math.sin(v-C)-540*Math.sin(y)-441*Math.sin(v)+423*Math.sin(C)-288*Math.sin(A-C),m+=-3332.9*Math.sin(v)+1197.4*Math.sin(v-_)-662.5*Math.sin(y)+396.3*Math.sin(_)-218*Math.sin(v-y);const x=2*b,S=3*b;l+=46.997*Math.cos(b)*n-.614*Math.cos(v-C+b)*n+.614*Math.cos(v-C-b)*n-.0297*Math.cos(x)*i-.0335*Math.cos(b)*i+.0012*Math.cos(v-C+x)*i-16e-5*Math.cos(b)*r+4e-5*Math.cos(S)*r+4e-5*Math.cos(x)*r;const I=2.116*Math.sin(b)*n-.111*Math.sin(v-C-b)*n-.0015*Math.sin(b)*i;h+=I,m+=I,f+=-520.77*Math.sin(b)*n+13.66*Math.sin(v-C+b)*n+1.12*Math.sin(v-b)*n-1.06*Math.sin(C-b)*n+.66*Math.sin(x)*i+.371*Math.sin(b)*i-.035*Math.sin(v-C+x)*i-.015*Math.sin(v-C+b)*i+.0014*Math.sin(b)*r-.0011*Math.sin(S)*r-9e-4*Math.sin(x)*r,a*=1e3;return aI(a,s,c+l*rI,u+h*rI,d+f*rI,p+m*rI,t)}const dI=new ce(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819);let fI=new O;eI.computeSunPositionInEarthInertialFrame=function(e,t){return Object(l.a)(e)||(e=tr.now()),Object(l.a)(t)||(t=new O),fI=function(e,t){tI(e,uI);const n=(uI.dayNumber-nI.dayNumber+(uI.secondsOfDay-nI.secondsOfDay)/ji.SECONDS_PER_DAY)/(10*ji.DAYS_PER_JULIAN_CENTURY),i=.3595362*n,r=149598022260.7121+957426.3679999999*Math.cos(16002*i)+-2243968.05*Math.sin(16002*i)+-2273887.624*Math.cos(21863*i)+-688150.202*Math.sin(21863*i)+927506.794*Math.cos(32004*i)+1017265.516*Math.sin(32004*i)+14959787e4*-8e-7*Math.cos(10931*i)+807828.498*Math.sin(10931*i)+478713.18399999995*Math.cos(14529*i)+209437.01799999998*Math.sin(14529*i)+-613351.267*Math.cos(16368*i)+359034.888*Math.sin(16368*i)+284235.953*Math.cos(15318*i)+-418874.03599999996*Math.sin(15318*i)+-164557.657*Math.cos(32794*i)+329115.314*Math.sin(32794*i),o=cI+lI*n+1e-7*-325*Math.cos(10*i)+1e-7*-105*Math.sin(10*i)+1e-7*-322*Math.cos(16002*i)+1e-7*-137*Math.sin(16002*i)+1e-7*-79*Math.cos(21863*i)+258*1e-7*Math.sin(21863*i)+232*1e-7*Math.cos(10931*i)+35*1e-7*Math.sin(10931*i)+1e-7*-52*Math.cos(1473*i)+1e-7*-116*Math.sin(1473*i)+97*1e-7*Math.cos(32004*i)+1e-7*-88*Math.sin(32004*i)+55*1e-7*Math.cos(4387*i)+1e-7*-112*Math.sin(4387*i)+1e-7*-41*Math.cos(73*i)+1e-7*-80*Math.sin(73*i);return aI(r,.0167086342-.0004203654*n,469.97289*rI*n,102.93734808*iI+11612.3529*rI*n,174.87317577*iI-8679.27034*rI*n,o,t)}(e,fI),t=O.negate(fI,t),function(e,t){t=hI(e,t),O.multiplyByScalar(t,-.01215058143522694,t)}(e,fI),O.subtract(t,fI,t),ce.multiplyByVector(dI,t,t),t},eI.computeMoonPositionInEarthInertialFrame=function(e,t){return Object(l.a)(e)||(e=tr.now()),t=hI(e,t),ce.multiplyByVector(dI,t,t),t};var pI=eI;function mI(e,t,n,i,r,o,a){const s=Tg.numberOfPoints(e,t,r);let c;const l=n.red,u=n.green,h=n.blue,d=n.alpha,f=i.red,p=i.green,m=i.blue,g=i.alpha;if(sp.equals(n,i)){for(c=0;c<s;c++)o[a++]=sp.floatToByte(l),o[a++]=sp.floatToByte(u),o[a++]=sp.floatToByte(h),o[a++]=sp.floatToByte(d);return a}const _=(f-l)/s,y=(p-u)/s,b=(m-h)/s,v=(g-d)/s;let O=a;for(c=0;c<s;c++)o[O++]=sp.floatToByte(l+c*_),o[O++]=sp.floatToByte(u+c*y),o[O++]=sp.floatToByte(h+c*b),o[O++]=sp.floatToByte(d+c*v);return O}function gI(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,n=e.colors,i=Object(c.a)(e.colorsPerVertex,!1);if(!Object(l.a)(t)||t.length<2)throw new u.a("At least two positions are required.");if(Object(l.a)(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new u.a("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=Object(c.a)(e.arcType,vl.GEODESIC),this._granularity=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._workerName="createSimplePolylineGeometry";let r=1+t.length*O.packedLength;r+=Object(l.a)(n)?1+n.length*sp.packedLength:1,this.packedLength=r+H.packedLength+3}gI.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");let i;n=Object(c.a)(n,0);const r=e._positions;let o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=O.packedLength)O.pack(r[i],t,n);const a=e._colors;for(o=Object(l.a)(a)?a.length:0,t[n++]=o,i=0;i<o;++i,n+=sp.packedLength)sp.pack(a[i],t,n);return H.pack(e._ellipsoid,t,n),n+=H.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t},gI.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");let i;t=Object(c.a)(t,0);let r=e[t++];const o=new Array(r);for(i=0;i<r;++i,t+=O.packedLength)o[i]=O.unpack(e,t);r=e[t++];const a=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=sp.packedLength)a[i]=sp.unpack(e,t);const s=H.unpack(e,t);t+=H.packedLength;const h=1===e[t++],d=e[t++],f=e[t];return Object(l.a)(n)?(n._positions=o,n._colors=a,n._ellipsoid=s,n._colorsPerVertex=h,n._arcType=d,n._granularity=f,n):new gI({positions:o,colors:a,ellipsoid:s,colorsPerVertex:h,arcType:d,granularity:f})};const _I=new Array(2),yI=new Array(2),bI={positions:_I,height:yI,ellipsoid:void 0,minDistance:void 0,granularity:void 0};gI.createGeometry=function(e){const t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,a=e._ellipsoid,s=h.a.chordLength(o,a.maximumRadius),c=Object(l.a)(n)&&!i;let u;const d=t.length;let f,p,m,g,_=0;if(r===vl.GEODESIC||r===vl.RHUMB){let e,i,p;r===vl.GEODESIC?(e=h.a.chordLength(o,a.maximumRadius),i=Tg.numberOfPoints,p=Tg.generateArc):(e=o,i=Tg.numberOfPointsRhumbLine,p=Tg.generateRhumbArc);const y=Tg.extractHeights(t,a),b=bI;if(r===vl.GEODESIC?b.minDistance=s:b.granularity=o,b.ellipsoid=a,c){let r=0;for(u=0;u<d-1;u++)r+=i(t[u],t[u+1],e)+1;f=new Float64Array(3*r),m=new Uint8Array(4*r),b.positions=_I,b.height=yI;let o=0;for(u=0;u<d-1;++u){_I[0]=t[u],_I[1]=t[u+1],yI[0]=y[u],yI[1]=y[u+1];const e=p(b);if(Object(l.a)(n)){const t=e.length/3;g=n[u];for(let e=0;e<t;++e)m[o++]=sp.floatToByte(g.red),m[o++]=sp.floatToByte(g.green),m[o++]=sp.floatToByte(g.blue),m[o++]=sp.floatToByte(g.alpha)}f.set(e,_),_+=e.length}}else if(b.positions=t,b.height=y,f=new Float64Array(p(b)),Object(l.a)(n)){for(m=new Uint8Array(f.length/3*4),u=0;u<d-1;++u){_=mI(t[u],t[u+1],n[u],n[u+1],s,m,_)}const e=n[d-1];m[_++]=sp.floatToByte(e.red),m[_++]=sp.floatToByte(e.green),m[_++]=sp.floatToByte(e.blue),m[_++]=sp.floatToByte(e.alpha)}}else{p=c?2*d-2:d,f=new Float64Array(3*p),m=Object(l.a)(n)?new Uint8Array(4*p):void 0;let e=0,i=0;for(u=0;u<d;++u){const r=t[u];if(c&&u>0&&(O.pack(r,f,e),e+=3,g=n[u-1],m[i++]=sp.floatToByte(g.red),m[i++]=sp.floatToByte(g.green),m[i++]=sp.floatToByte(g.blue),m[i++]=sp.floatToByte(g.alpha)),c&&u===d-1)break;O.pack(r,f,e),e+=3,Object(l.a)(n)&&(g=n[u],m[i++]=sp.floatToByte(g.red),m[i++]=sp.floatToByte(g.green),m[i++]=sp.floatToByte(g.blue),m[i++]=sp.floatToByte(g.alpha))}}const y=new Ql;y.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:f}),Object(l.a)(n)&&(y.color=new $l({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:4,values:m,normalize:!0})),p=f.length/3;const b=2*(p-1),v=wc.createTypedArray(p,b);let w=0;for(u=0;u<p-1;++u)v[w++]=u,v[w++]=u+1;return new Zl({attributes:y,indices:v,primitiveType:zl.LINES,boundingSphere:At.fromPoints(t)})};var vI=gI;function OI(e){const t=Object(c.a)(e.radius,1),n={radii:new O(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Rb(n),this._workerName="createSphereGeometry"}OI.packedLength=Rb.packedLength,OI.pack=function(e,t,n){return s.a.typeOf.object("value",e),Rb.pack(e._ellipsoidGeometry,t,n)};const wI=new Rb,AI={radius:void 0,radii:new O,vertexFormat:new nu,stackPartitions:void 0,slicePartitions:void 0};OI.unpack=function(e,t,n){const i=Rb.unpack(e,t,wI);return AI.vertexFormat=nu.clone(i._vertexFormat,AI.vertexFormat),AI.stackPartitions=i._stackPartitions,AI.slicePartitions=i._slicePartitions,Object(l.a)(n)?(O.clone(i._radii,AI.radii),n._ellipsoidGeometry=new Rb(AI),n):(AI.radius=i._radii.x,new OI(AI))},OI.createGeometry=function(e){return Rb.createGeometry(e._ellipsoidGeometry)};var EI=OI;function TI(e){const t=Object(c.a)(e.radius,1),n={radii:new O(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new kb(n),this._workerName="createSphereOutlineGeometry"}TI.packedLength=kb.packedLength,TI.pack=function(e,t,n){return s.a.typeOf.object("value",e),kb.pack(e._ellipsoidGeometry,t,n)};const CI=new kb,xI={radius:void 0,radii:new O,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};TI.unpack=function(e,t,n){const i=kb.unpack(e,t,CI);return xI.stackPartitions=i._stackPartitions,xI.slicePartitions=i._slicePartitions,xI.subdivisions=i._subdivisions,Object(l.a)(n)?(O.clone(i._radii,xI.radii),n._ellipsoidGeometry=new kb(xI),n):(xI.radius=i._radii.x,new TI(xI))},TI.createGeometry=function(e){return kb.createGeometry(e._ellipsoidGeometry)};var SI=TI;function II(e,t,n){this.clock=Object(c.a)(e,0),this.cone=Object(c.a)(t,0),this.magnitude=Object(c.a)(n,1)}II.fromCartesian3=function(e,t){s.a.typeOf.object("cartesian3",e);const n=e.x,i=e.y,r=e.z,o=n*n+i*i;return Object(l.a)(t)||(t=new II),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t},II.clone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new II(e.clock,e.cone,e.magnitude)},II.normalize=function(e,t){return s.a.typeOf.object("spherical",e),Object(l.a)(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new II(e.clock,e.cone,1)},II.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},II.equalsEpsilon=function(e,t,n){return n=Object(c.a)(n,0),e===t||Object(l.a)(e)&&Object(l.a)(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n},II.prototype.equals=function(e){return II.equals(this,e)},II.prototype.clone=function(e){return II.clone(this,e)},II.prototype.equalsEpsilon=function(e,t){return II.equalsEpsilon(this,e,t)},II.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var PI=II;function DI(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).points,n=e.times;if(!Object(l.a)(t)||!Object(l.a)(n))throw new u.a("points and times are required.");if(t.length<2)throw new u.a("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new u.a("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=wu.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(DI.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),DI.prototype.findTimeInterval=wu.prototype.findTimeInterval,DI.prototype.wrapTime=wu.prototype.wrapTime,DI.prototype.clampTime=wu.prototype.clampTime,DI.prototype.evaluate=function(e,t){const n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);const i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(Object(l.a)(t)||(t=new r),r.clone(n[i],t))};var RI=DI;var jI=function(e,t){if(!Object(l.a)(e))throw new u.a("array is required.");if(!Object(l.a)(t)||t<1)throw new u.a("numberOfArrays must be greater than 0.");const n=[],i=e.length;let r=0;for(;r<i;){const o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n};var MI={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7};function LI(e){throw new u.a("This type should not be instantiated directly.  Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(LI.prototype,{ellipsoid:{get:u.a.throwInstantiationError},rectangle:{get:u.a.throwInstantiationError},projection:{get:u.a.throwInstantiationError}}),LI.prototype.getNumberOfXTilesAtLevel=u.a.throwInstantiationError,LI.prototype.getNumberOfYTilesAtLevel=u.a.throwInstantiationError,LI.prototype.rectangleToNativeRectangle=u.a.throwInstantiationError,LI.prototype.tileXYToNativeRectangle=u.a.throwInstantiationError,LI.prototype.tileXYToRectangle=u.a.throwInstantiationError,LI.prototype.positionToTileXY=u.a.throwInstantiationError;var NI=LI;function BI(e,t){return tr.compare(e.start,t.start)}function FI(e){if(this._intervals=[],this._changedEvent=new un.a,Object(l.a)(e)){const t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(FI.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){const e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){const e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){const e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){const e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),FI.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof FI))return!1;const n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let e=0;e<r;e++)if(!YA.equals(n[e],i[e],t))return!1;return!0},FI.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return this._intervals[e]},FI.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},FI.prototype.findIntervalContainingDate=function(e){const t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},FI.prototype.findDataForIntervalContainingDate=function(e){const t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},FI.prototype.contains=function(e){return this.indexOf(e)>=0};const zI=new YA;FI.prototype.indexOf=function(e){if(!Object(l.a)(e))throw new u.a("date is required");const t=this._intervals;zI.start=e,zI.stop=e;let n=Si(t,zI,BI);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&YA.contains(t[n-1],e)?n-1:~n)},FI.prototype.findInterval=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let e=0,a=o.length;e<a;e++){const a=o[e];if((!Object(l.a)(t)||a.start.equals(t))&&(!Object(l.a)(n)||a.stop.equals(n))&&(!Object(l.a)(i)||a.isStartIncluded===i)&&(!Object(l.a)(r)||a.isStopIncluded===r))return o[e]}},FI.prototype.addInterval=function(e,t){if(!Object(l.a)(e))throw new u.a("interval is required");if(e.isEmpty)return;const n=this._intervals;if(0===n.length||tr.greaterThan(e.start,n[n.length-1].stop))return n.push(e),void this._changedEvent.raiseEvent(this);let i,r=Si(n,e,BI);for(r<0?r=~r:r>0&&e.isStartIncluded&&n[r-1].isStartIncluded&&n[r-1].start.equals(e.start)?--r:r<n.length&&!e.isStartIncluded&&n[r].isStartIncluded&&n[r].start.equals(e.start)&&++r,r>0&&(i=tr.compare(n[r-1].stop,e.start),(i>0||0===i&&(n[r-1].isStopIncluded||e.isStartIncluded))&&((Object(l.a)(t)?t(n[r-1].data,e.data):n[r-1].data===e.data)?(e=tr.greaterThan(e.stop,n[r-1].stop)?new YA({start:n[r-1].start,stop:e.stop,isStartIncluded:n[r-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):new YA({start:n[r-1].start,stop:n[r-1].stop,isStartIncluded:n[r-1].isStartIncluded,isStopIncluded:n[r-1].isStopIncluded||e.stop.equals(n[r-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(r-1,1),--r):(i=tr.compare(n[r-1].stop,e.stop),(i>0||0===i&&n[r-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(r,0,new YA({start:e.stop,stop:n[r-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[r-1].isStopIncluded,data:n[r-1].data})),n[r-1]=new YA({start:n[r-1].start,stop:e.start,isStartIncluded:n[r-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[r-1].data}))));r<n.length&&(i=tr.compare(e.stop,n[r].start),i>0||0===i&&(e.isStopIncluded||n[r].isStartIncluded));)if(Object(l.a)(t)?t(n[r].data,e.data):n[r].data===e.data)e=new YA({start:e.start,stop:tr.greaterThan(n[r].stop,e.stop)?n[r].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:tr.greaterThan(n[r].stop,e.stop)?n[r].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(r,1);else{if(n[r]=new YA({start:e.stop,stop:n[r].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[r].isStopIncluded,data:n[r].data}),!n[r].isEmpty)break;n.splice(r,1)}n.splice(r,0,e),this._changedEvent.raiseEvent(this)},FI.prototype.removeInterval=function(e){if(!Object(l.a)(e))throw new u.a("interval is required");if(e.isEmpty)return!1;const t=this._intervals;let n=Si(t,e,BI);n<0&&(n=~n);let i=!1;for(n>0&&(tr.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(tr.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new YA({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new YA({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new YA({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&tr.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new YA({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new YA({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(tr.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new YA({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i},FI.prototype.intersect=function(e,t,n){if(!Object(l.a)(e))throw new u.a("other is required.");const i=new FI;let r=0,o=0;const a=this._intervals,s=e._intervals;for(;r<a.length&&o<s.length;){const e=a[r],c=s[o];if(tr.lessThan(e.stop,c.start))++r;else if(tr.lessThan(c.stop,e.start))++o;else{if(Object(l.a)(n)||Object(l.a)(t)&&t(e.data,c.data)||!Object(l.a)(t)&&c.data===e.data){const r=YA.intersect(e,c,new YA,n);r.isEmpty||i.addInterval(r,t)}tr.lessThan(e.stop,c.stop)||e.stop.equals(c.stop)&&!e.isStopIncluded&&c.isStopIncluded?++r:++o}}return i},FI.fromJulianDateArray=function(e,t){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.julianDates))throw new u.a("options.iso8601Array is required.");Object(l.a)(t)||(t=new FI);const n=e.julianDates,i=n.length,r=e.dataCallback,o=Object(c.a)(e.isStartIncluded,!0),a=Object(c.a)(e.isStopIncluded,!0),s=Object(c.a)(e.leadingInterval,!1),h=Object(c.a)(e.trailingInterval,!1);let d,f=0;s&&(++f,d=new YA({start:JA.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),d.data=Object(l.a)(r)?r(d,t.length):t.length,t.addInterval(d));for(let e=0;e<i-1;++e){let s=n[e];const c=n[e+1];d=new YA({start:s,stop:c,isStartIncluded:t.length!==f||o,isStopIncluded:e===i-2&&a}),d.data=Object(l.a)(r)?r(d,t.length):t.length,t.addInterval(d),s=c}return h&&(d=new YA({start:n[i-1],stop:JA.MAXIMUM_VALUE,isStartIncluded:!a,isStopIncluded:!0}),d.data=Object(l.a)(r)?r(d,t.length):t.length,t.addInterval(d)),t};const kI=new Pi,UI=[0,31,28,31,30,31,30,31,31,30,31,30,31];function VI(e,t,n){Object(l.a)(n)||(n=new tr),tr.toGregorianDate(e,kI);let i=kI.millisecond+t.millisecond,r=kI.second+t.second,o=kI.minute+t.minute,a=kI.hour+t.hour,s=kI.day+t.day,c=kI.month+t.month,u=kI.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i%=1e3),r>=60&&(o+=Math.floor(r/60),r%=60),o>=60&&(a+=Math.floor(o/60),o%=60),a>=24&&(s+=Math.floor(a/24),a%=24),UI[2]=Di(u)?29:28;s>UI[c]||c>=13;)s>UI[c]&&(s-=UI[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c%=12,++c),UI[2]=Di(u)?29:28;return kI.millisecond=i,kI.second=r,kI.minute=o,kI.hour=a,kI.day=s,kI.month=c,kI.year=u,tr.fromGregorianDate(kI,n)}const HI=new tr,GI=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function qI(e,t){if(!Object(l.a)(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,"P"===e[0]){const n=e.match(GI);if(!Object(l.a)(n))return!1;if(Object(l.a)(n[1])&&(t.year=Number(n[1].replace(",","."))),Object(l.a)(n[2])&&(t.month=Number(n[2].replace(",","."))),Object(l.a)(n[3])&&(t.day=7*Number(n[3].replace(",","."))),Object(l.a)(n[4])&&(t.day+=Number(n[4].replace(",","."))),Object(l.a)(n[5])&&(t.hour=Number(n[5].replace(",","."))),Object(l.a)(n[6])&&(t.minute=Number(n[6].replace(",","."))),Object(l.a)(n[7])){const e=Number(n[7].replace(",","."));t.second=Math.floor(e),t.millisecond=e%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),tr.toGregorianDate(tr.fromIso8601(e,HI),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}const WI=new Pi;FI.fromIso8601=function(e,t){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.iso8601))throw new u.a("options.iso8601 is required.");const n=e.iso8601.split("/"),i=tr.fromIso8601(n[0]),r=tr.fromIso8601(n[1]),o=[];if(qI(n[2],WI)){let e=tr.clone(i);for(o.push(e);tr.compare(e,r)<0;){e=VI(e,WI);tr.compare(r,e)<=0&&tr.clone(r,e),o.push(e)}}else o.push(i,r);return FI.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},FI.fromIso8601DateArray=function(e,t){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.iso8601Dates))throw new u.a("options.iso8601Dates is required.");return FI.fromJulianDateArray({julianDates:e.iso8601Dates.map((function(e){return tr.fromIso8601(e)})),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},FI.fromIso8601DurationArray=function(e,t){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.epoch))throw new u.a("options.epoch is required.");if(!Object(l.a)(e.iso8601Durations))throw new u.a("options.iso8601Durations is required.");const n=e.epoch,i=e.iso8601Durations,r=Object(c.a)(e.relativeToPrevious,!1),o=[];let a,s;const h=i.length;for(let e=0;e<h;++e)(qI(i[e],WI)||0===e)&&(a=r&&Object(l.a)(s)?VI(s,WI):VI(n,WI),o.push(a),s=a);return FI.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var YI=FI;const XI=new O(1,1,1),KI=O.ZERO,JI=To.IDENTITY;function ZI(e,t,n){this.translation=O.clone(Object(c.a)(e,KI)),this.rotation=To.clone(Object(c.a)(t,JI)),this.scale=O.clone(Object(c.a)(n,XI))}ZI.prototype.equals=function(e){return this===e||Object(l.a)(e)&&O.equals(this.translation,e.translation)&&To.equals(this.rotation,e.rotation)&&O.equals(this.scale,e.scale)};var $I=ZI,QI=n(36);function eP(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=Object(c.a)(e.epoch,JA.MINIMUM_VALUE),this.tolerance=Object(c.a)(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(eP.prototype,{clock:{get:function(){return this._clock},set:function(e){const t=this._clock;t!==e&&(Object(l.a)(t)&&(this._clockSubscription(),this._clockSubscription=void 0),Object(l.a)(e)&&(this._clockSubscription=e.onTick.addEventListener(eP.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){const t=this._element;var n;t!==e&&(Object(l.a)(t)&&t.removeEventListener("seeked",this._seekFunction,!1),Object(l.a)(e)&&(this._seeking=!1,this._seekFunction=(n=this,function(){n._seeking=!1,n._firstTickAfterSeek=!0}),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),eP.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,sc(this)},eP.prototype.isDestroyed=function(){return!1},eP.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;const t=this._element;try{t.playbackRate=e.multiplier}catch(e){t.playbackRate=0}this._lastPlaybackRate=e.multiplier},eP.prototype._onTick=function(e){const t=this._element;if(!Object(l.a)(t)||t.readyState<2)return;const n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);this._trySetPlaybackRate(e);const r=e.currentTime,o=Object(c.a)(this.epoch,JA.MINIMUM_VALUE);let a=tr.secondsDifference(r,o);const s=t.duration;let u;const h=t.currentTime;t.loop?(a%=s,a<0&&(a=s-a),u=a):u=a>s?s:a<0?0:a;const d=i?Object(c.a)(this.tolerance,1):.001;Math.abs(u-h)>d&&(this._seeking=!0,t.currentTime=u)};var tP=eP;function nP(e,t){this.rectangle=e,this.maxLevel=t}function iP(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url))throw new u.a("options.url is required.");const t=Tt.a.createIfNeeded(e.url);this._resource=t,this._errorEvent=new un.a,this._ready=!1,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};let n=e.credit;"string"==typeof n&&(n=new ln(n)),this._credit=n,this._tilingScheme=void 0,this._rectangles=[];const i=this;let r;const o=Object(c.a)(e.ellipsoid,H.WGS84);function a(e){const t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return Promise.reject(new ye.a(`SRS ${t} is not supported.`));i._tilingScheme=new Gt({ellipsoid:o});const n=e.getElementsByTagName("TileFormat")[0];i._heightmapWidth=parseInt(n.getAttribute("width"),10),i._heightmapHeight=parseInt(n.getAttribute("height"),10),i._levelZeroMaximumGeometricError=Pc.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,Math.min(i._heightmapWidth,i._heightmapHeight),i._tilingScheme.getNumberOfXTilesAtLevel(0));const r=e.getElementsByTagName("DataExtent");for(let e=0;e<r.length;++e){const t=r[e],n=h.a.toRadians(parseFloat(t.getAttribute("minx"))),o=h.a.toRadians(parseFloat(t.getAttribute("miny"))),a=h.a.toRadians(parseFloat(t.getAttribute("maxx"))),s=h.a.toRadians(parseFloat(t.getAttribute("maxy"))),c=parseInt(t.getAttribute("maxlevel"),10);i._rectangles.push(new nP(new Be(n,o,a,s),c))}return i._ready=!0,Promise.resolve(!0)}function s(e){const t=Object(c.a)(Object(l.a)(e)?e.message:void 0,`An error occurred while accessing ${i._resource.url}.`);return r=dl.reportError(r,i,i._errorEvent,t),r.retry?d():Promise.reject(new ye.a(t))}function d(){return i._resource.fetchXML().then(a).catch(s)}this._readyPromise=d()}Object.defineProperties(iP.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new u.a("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}}),iP.prototype.requestTileGeometry=function(e,t,n,i){if(!this.ready)throw new u.a("requestTileGeometry must not be called before ready returns true.");const r=this._tilingScheme.getNumberOfYTilesAtLevel(n),o=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!Object(l.a)(o))return;const a=this;return Promise.resolve(o).then((function(i){return new Fc({buffer:Object(Kv.a)(i),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:oP(a,e,t,n),structure:a._terrainDataStructure})}))},iP.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new u.a("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<e)};const rP=new Be;function oP(e,t,n,i){const r=e._tilingScheme,o=e._rectangles,a=r.tileXYToRectangle(t,n,i);let s=0;for(let e=0;e<o.length&&15!==s;++e){const c=o[e];if(c.maxLevel<=i)continue;const u=c.rectangle,h=Be.intersection(u,a,rP);Object(l.a)(h)&&(aP(r,u,2*t,2*n,i+1)&&(s|=4),aP(r,u,2*t+1,2*n,i+1)&&(s|=8),aP(r,u,2*t,2*n+1,i+1)&&(s|=1),aP(r,u,2*t+1,2*n+1,i+1)&&(s|=2))}return s}function aP(e,t,n,i,r){const o=e.tileXYToRectangle(n,i,r);return Object(l.a)(Be.intersection(o,t,rP))}iP.prototype.getTileDataAvailable=function(e,t,n){},iP.prototype.loadTileDataAvailability=function(e,t,n){};var sP=iP;var cP=Object.freeze({VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033});const lP={};function uP(e,t){return h.a.equalsEpsilon(e.latitude,t.latitude,h.a.EPSILON10)&&h.a.equalsEpsilon(e.longitude,t.longitude,h.a.EPSILON10)}const hP=new R,dP=new R;const fP=new Array(2),pP=new Array(2),mP={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};lP.computePositions=function(e,t,n,i,r,o){const a=function(e,t,n,i){const r=(t=wl(t,O.equalsEpsilon)).length;if(r<2)return;const o=Object(l.a)(i),a=Object(l.a)(n),s=new Array(r),c=new Array(r),u=new Array(r),h=t[0];s[0]=h;const d=e.cartesianToCartographic(h,hP);a&&(d.height=n[0]),c[0]=d.height,u[0]=o?i[0]:0;let f=c[0]===u[0],p=1;for(let l=1;l<r;++l){const r=t[l],h=e.cartesianToCartographic(r,dP);a&&(h.height=n[l]),f=f&&0===h.height,uP(d,h)?d.height<h.height&&(c[p-1]=h.height):(s[p]=r,c[p]=h.height,u[p]=o?i[l]:0,f=f&&c[p]===u[p],R.clone(h,d),++p)}return f||p<2?void 0:(s.length=p,c.length=p,u.length=p,{positions:s,topHeights:c,bottomHeights:u})}(e,t,n,i);if(!Object(l.a)(a))return;t=a.positions,n=a.topHeights,i=a.bottomHeights;const s=t.length,c=s-2;let u,d;const f=h.a.chordLength(r,e.maximumRadius),p=mP;if(p.minDistance=f,p.ellipsoid=e,o){let e,r=0;for(e=0;e<s-1;e++)r+=Tg.numberOfPoints(t[e],t[e+1],f)+1;u=new Float64Array(3*r),d=new Float64Array(3*r);const o=fP,a=pP;p.positions=o,p.height=a;let c=0;for(e=0;e<s-1;e++){o[0]=t[e],o[1]=t[e+1],a[0]=n[e],a[1]=n[e+1];const r=Tg.generateArc(p);u.set(r,c),a[0]=i[e],a[1]=i[e+1],d.set(Tg.generateArc(p),c),c+=r.length}}else p.positions=t,p.height=n,u=new Float64Array(Tg.generateArc(p)),p.height=i,d=new Float64Array(Tg.generateArc(p));return{bottomPositions:d,topPositions:u,numCorners:c}};var gP=lP;const _P=new O,yP=new O,bP=new O,vP=new O,OP=new O,wP=new O,AP=new O;function EP(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,n=e.maximumHeights,i=e.minimumHeights;if(!Object(l.a)(t))throw new u.a("options.positions is required.");if(Object(l.a)(n)&&n.length!==t.length)throw new u.a("options.positions and options.maximumHeights must have the same length.");if(Object(l.a)(i)&&i.length!==t.length)throw new u.a("options.positions and options.minimumHeights must have the same length.");const r=Object(c.a)(e.vertexFormat,nu.DEFAULT),o=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),a=Object(c.a)(e.ellipsoid,H.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=nu.clone(r),this._granularity=o,this._ellipsoid=H.clone(a),this._workerName="createWallGeometry";let s=1+t.length*O.packedLength+2;Object(l.a)(i)&&(s+=i.length),Object(l.a)(n)&&(s+=n.length),this.packedLength=s+H.packedLength+nu.packedLength+1}EP.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");let i;n=Object(c.a)(n,0);const r=e._positions;let o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=O.packedLength)O.pack(r[i],t,n);const a=e._minimumHeights;if(o=Object(l.a)(a)?a.length:0,t[n++]=o,Object(l.a)(a))for(i=0;i<o;++i)t[n++]=a[i];const s=e._maximumHeights;if(o=Object(l.a)(s)?s.length:0,t[n++]=o,Object(l.a)(s))for(i=0;i<o;++i)t[n++]=s[i];return H.pack(e._ellipsoid,t,n),n+=H.packedLength,nu.pack(e._vertexFormat,t,n),t[n+=nu.packedLength]=e._granularity,t};const TP=H.clone(H.UNIT_SPHERE),CP=new nu,xP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:TP,vertexFormat:CP,granularity:void 0};EP.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");let i;t=Object(c.a)(t,0);let r=e[t++];const o=new Array(r);for(i=0;i<r;++i,t+=O.packedLength)o[i]=O.unpack(e,t);let a,s;if(r=e[t++],r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];if(r=e[t++],r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];const h=H.unpack(e,t,TP);t+=H.packedLength;const d=nu.unpack(e,t,CP),f=e[t+=nu.packedLength];return Object(l.a)(n)?(n._positions=o,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=H.clone(h,n._ellipsoid),n._vertexFormat=nu.clone(d,n._vertexFormat),n._granularity=f,n):(xP.positions=o,xP.minimumHeights=a,xP.maximumHeights=s,xP.granularity=f,new EP(xP))},EP.fromConstantHeights=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions;if(!Object(l.a)(t))throw new u.a("options.positions is required.");let n,i;const r=e.minimumHeight,o=e.maximumHeight,a=Object(l.a)(r),s=Object(l.a)(o);if(a||s){const e=t.length;n=a?new Array(e):void 0,i=s?new Array(e):void 0;for(let t=0;t<e;++t)a&&(n[t]=r),s&&(i[t]=o)}return new EP({positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},EP.createGeometry=function(e){const t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,a=e._ellipsoid,s=gP.computePositions(a,t,i,n,o,!0);if(!Object(l.a)(s))return;const c=s.bottomPositions,u=s.topPositions,d=s.numCorners;let f=u.length,p=2*f;const m=r.position?new Float64Array(p):void 0,g=r.normal?new Float32Array(p):void 0,_=r.tangent?new Float32Array(p):void 0,y=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0;let v,w=0,A=0,E=0,T=0,C=0,x=AP,S=wP,I=OP,P=!0;f/=3;let D=0;const R=1/(f-d-1);for(v=0;v<f;++v){const e=3*v,t=O.fromArray(u,e,_P),n=O.fromArray(c,e,yP);if(r.position&&(m[w++]=n.x,m[w++]=n.y,m[w++]=n.z,m[w++]=t.x,m[w++]=t.y,m[w++]=t.z),r.st&&(b[C++]=D,b[C++]=0,b[C++]=D,b[C++]=1),r.normal||r.tangent||r.bitangent){let n=O.clone(O.ZERO,vP);const i=O.subtract(t,a.geodeticSurfaceNormal(t,yP),yP);if(v+1<f&&(n=O.fromArray(u,e+3,vP)),P){const e=O.subtract(n,t,bP),r=O.subtract(i,t,_P);x=O.normalize(O.cross(r,e,x),x),P=!1}O.equalsEpsilon(t,n,h.a.EPSILON10)?P=!0:(D+=R,r.tangent&&(S=O.normalize(O.subtract(n,t,S),S)),r.bitangent&&(I=O.normalize(O.cross(x,S,I),I))),r.normal&&(g[A++]=x.x,g[A++]=x.y,g[A++]=x.z,g[A++]=x.x,g[A++]=x.y,g[A++]=x.z),r.tangent&&(_[T++]=S.x,_[T++]=S.y,_[T++]=S.z,_[T++]=S.x,_[T++]=S.y,_[T++]=S.z),r.bitangent&&(y[E++]=I.x,y[E++]=I.y,y[E++]=I.z,y[E++]=I.x,y[E++]=I.y,y[E++]=I.z)}}const j=new Ql;r.position&&(j.position=new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:m})),r.normal&&(j.normal=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:g})),r.tangent&&(j.tangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:_})),r.bitangent&&(j.bitangent=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:y})),r.st&&(j.st=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:b}));const M=p/3;p-=6*(d+1);const L=wc.createTypedArray(M,p);let N=0;for(v=0;v<M-2;v+=2){const e=v,t=v+2,n=O.fromArray(m,3*e,_P),i=O.fromArray(m,3*t,yP);if(O.equalsEpsilon(n,i,h.a.EPSILON10))continue;const r=v+1,o=v+3;L[N++]=r,L[N++]=e,L[N++]=o,L[N++]=o,L[N++]=e,L[N++]=t}return new Zl({attributes:j,indices:L,primitiveType:zl.TRIANGLES,boundingSphere:new At.fromVertices(m)})};var SP=EP;const IP=new O,PP=new O;function DP(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions,n=e.maximumHeights,i=e.minimumHeights;if(!Object(l.a)(t))throw new u.a("options.positions is required.");if(Object(l.a)(n)&&n.length!==t.length)throw new u.a("options.positions and options.maximumHeights must have the same length.");if(Object(l.a)(i)&&i.length!==t.length)throw new u.a("options.positions and options.minimumHeights must have the same length.");const r=Object(c.a)(e.granularity,h.a.RADIANS_PER_DEGREE),o=Object(c.a)(e.ellipsoid,H.WGS84);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=H.clone(o),this._workerName="createWallOutlineGeometry";let a=1+t.length*O.packedLength+2;Object(l.a)(i)&&(a+=i.length),Object(l.a)(n)&&(a+=n.length),this.packedLength=a+H.packedLength+1}DP.pack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");let i;n=Object(c.a)(n,0);const r=e._positions;let o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=O.packedLength)O.pack(r[i],t,n);const a=e._minimumHeights;if(o=Object(l.a)(a)?a.length:0,t[n++]=o,Object(l.a)(a))for(i=0;i<o;++i)t[n++]=a[i];const s=e._maximumHeights;if(o=Object(l.a)(s)?s.length:0,t[n++]=o,Object(l.a)(s))for(i=0;i<o;++i)t[n++]=s[i];return H.pack(e._ellipsoid,t,n),t[n+=H.packedLength]=e._granularity,t};const RP=H.clone(H.UNIT_SPHERE),jP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:RP,granularity:void 0};DP.unpack=function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");let i;t=Object(c.a)(t,0);let r=e[t++];const o=new Array(r);for(i=0;i<r;++i,t+=O.packedLength)o[i]=O.unpack(e,t);let a,s;if(r=e[t++],r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];if(r=e[t++],r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];const h=H.unpack(e,t,RP),d=e[t+=H.packedLength];return Object(l.a)(n)?(n._positions=o,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=H.clone(h,n._ellipsoid),n._granularity=d,n):(jP.positions=o,jP.minimumHeights=a,jP.maximumHeights=s,jP.granularity=d,new DP(jP))},DP.fromConstantHeights=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).positions;if(!Object(l.a)(t))throw new u.a("options.positions is required.");let n,i;const r=e.minimumHeight,o=e.maximumHeight,a=Object(l.a)(r),s=Object(l.a)(o);if(a||s){const e=t.length;n=a?new Array(e):void 0,i=s?new Array(e):void 0;for(let t=0;t<e;++t)a&&(n[t]=r),s&&(i[t]=o)}return new DP({positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid})},DP.createGeometry=function(e){const t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,a=gP.computePositions(o,t,i,n,r,!1);if(!Object(l.a)(a))return;const s=a.bottomPositions,c=a.topPositions;let u=c.length,d=2*u;const f=new Float64Array(d);let p,m=0;for(u/=3,p=0;p<u;++p){const e=3*p,t=O.fromArray(c,e,IP),n=O.fromArray(s,e,PP);f[m++]=n.x,f[m++]=n.y,f[m++]=n.z,f[m++]=t.x,f[m++]=t.y,f[m++]=t.z}const g=new Ql({position:new $l({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:f})}),_=d/3;d=2*_-4+_;const y=wc.createTypedArray(_,d);let b=0;for(p=0;p<_-2;p+=2){const e=p,t=p+2,n=O.fromArray(f,3*e,IP),i=O.fromArray(f,3*t,PP);if(O.equalsEpsilon(n,i,h.a.EPSILON10))continue;const r=p+1,o=p+3;y[b++]=r,y[b++]=e,y[b++]=r,y[b++]=o,y[b++]=e,y[b++]=t}return y[b++]=_-2,y[b++]=_-1,new Zl({attributes:g,indices:y,primitiveType:zl.LINES,boundingSphere:new At.fromVertices(f)})};var MP=DP;var LP=function(e){switch(e){case ps.FLOAT:return"float";case ps.FLOAT_VEC2:return"vec2";case ps.FLOAT_VEC3:return"vec3";case ps.FLOAT_VEC4:return"vec4";case ps.FLOAT_MAT2:return"mat2";case ps.FLOAT_MAT3:return"mat3";case ps.FLOAT_MAT4:return"mat4";case ps.SAMPLER_2D:return"sampler2D";case ps.BOOL:return"bool"}};const NP={};NP.createWireframeIndices=function(e,t,n){const i=Object(l.a)(n);return e===zl.TRIANGLES?i?function(e,t){const n=t.length,i=wc.createTypedArray(e,2*n);let r=0;for(let e=0;e<n;e+=3){const n=t[e],o=t[e+1],a=t[e+2];i[r++]=n,i[r++]=o,i[r++]=o,i[r++]=a,i[r++]=a,i[r++]=n}return i}(t,n):function(e){const t=wc.createTypedArray(e,2*e),n=e;let i=0;for(let e=0;e<n;e+=3)t[i++]=e,t[i++]=e+1,t[i++]=e+1,t[i++]=e+2,t[i++]=e+2,t[i++]=e;return t}(t):e===zl.TRIANGLE_STRIP?i?function(e,t){const n=t.length-2,i=2+4*n,r=wc.createTypedArray(e,i);let o=0;r[o++]=t[0],r[o++]=t[1];for(let e=0;e<n;e++){const n=t[e],i=t[e+1],a=t[e+2];r[o++]=i,r[o++]=a,r[o++]=a,r[o++]=n}return r}(t,n):function(e){const t=e-2,n=2+4*t,i=wc.createTypedArray(e,n);let r=0;i[r++]=0,i[r++]=1;for(let e=0;e<t;e++)i[r++]=e+1,i[r++]=e+2,i[r++]=e+2,i[r++]=e;return i}(t):e===zl.TRIANGLE_FAN?i?function(e,t){const n=t.length-2,i=2+4*n,r=wc.createTypedArray(e,i);let o=0;const a=t[0];r[o++]=a,r[o++]=t[1];for(let e=0;e<n;e++){const n=t[e+1],i=t[e+2];r[o++]=n,r[o++]=i,r[o++]=i,r[o++]=a}return r}(t,n):function(e){const t=e-2,n=2+4*t,i=wc.createTypedArray(e,n);let r=0;i[r++]=0,i[r++]=1;for(let e=0;e<t;e++)i[r++]=e+1,i[r++]=e+2,i[r++]=e+2,i[r++]=0;return i}(t):void 0},NP.getWireframeIndicesCount=function(e,t){if(e===zl.TRIANGLES)return 2*t;if(e===zl.TRIANGLE_STRIP||e===zl.TRIANGLE_FAN){return 2+4*(t-2)}return t};var BP=NP;var FP=function(e,t,n){if("function"!=typeof t)throw new u.a("oldFunction is required to be a function.");if("function"!=typeof n)throw new u.a("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}};function zP(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new un.a,this.setValue(e)}Object.defineProperties(zP.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),zP.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},zP.prototype.setValue=function(e){const t=this._value;if(t!==e){const n=Object(l.a)(e),i=n&&"function"==typeof e.clone,r=n&&"function"==typeof e.equals;(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},zP.prototype.equals=function(e){return this===e||e instanceof zP&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},zP.prototype.valueOf=function(){return this._value},zP.prototype.toString=function(){return String(this._value)};var kP=zP;function UP(e){return new kP(e)}var VP=function(e,t,n){return function(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(i){const o=this[t],a=this[n];Object(l.a)(a)&&(a(),this[n]=void 0);!(void 0!==i)||Object(l.a)(i)&&Object(l.a)(i.getValue)||!Object(l.a)(r)||(i=r(i)),o!==i&&(this[t]=i,this._definitionChanged.raiseEvent(this,e,i,o)),Object(l.a)(i)&&Object(l.a)(i.definitionChanged)&&(this[n]=i.definitionChanged.addEventListener((function(){this._definitionChanged.raiseEvent(this,e,i,i)}),this))}}}(e,"_"+e.toString(),`_${e.toString()}Subscription`,Object(c.a)(t,!1),Object(c.a)(n,UP))};function HP(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(HP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),image:VP("image"),scale:VP("scale"),pixelOffset:VP("pixelOffset"),eyeOffset:VP("eyeOffset"),horizontalOrigin:VP("horizontalOrigin"),verticalOrigin:VP("verticalOrigin"),heightReference:VP("heightReference"),color:VP("color"),rotation:VP("rotation"),alignedAxis:VP("alignedAxis"),sizeInMeters:VP("sizeInMeters"),width:VP("width"),height:VP("height"),scaleByDistance:VP("scaleByDistance"),translucencyByDistance:VP("translucencyByDistance"),pixelOffsetScaleByDistance:VP("pixelOffsetScaleByDistance"),imageSubRegion:VP("imageSubRegion"),distanceDisplayCondition:VP("distanceDisplayCondition"),disableDepthTestDistance:VP("disableDepthTestDistance")}),HP.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new HP(this)},HP.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this._show,e.show),this.image=Object(c.a)(this._image,e.image),this.scale=Object(c.a)(this._scale,e.scale),this.pixelOffset=Object(c.a)(this._pixelOffset,e.pixelOffset),this.eyeOffset=Object(c.a)(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=Object(c.a)(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=Object(c.a)(this._verticalOrigin,e.verticalOrigin),this.heightReference=Object(c.a)(this._heightReference,e.heightReference),this.color=Object(c.a)(this._color,e.color),this.rotation=Object(c.a)(this._rotation,e.rotation),this.alignedAxis=Object(c.a)(this._alignedAxis,e.alignedAxis),this.sizeInMeters=Object(c.a)(this._sizeInMeters,e.sizeInMeters),this.width=Object(c.a)(this._width,e.width),this.height=Object(c.a)(this._height,e.height),this.scaleByDistance=Object(c.a)(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=Object(c.a)(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=Object(c.a)(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=Object(c.a)(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=Object(c.a)(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=Object(c.a)(this._disableDepthTestDistance,e.disableDepthTestDistance)};var GP=HP;var qP=Object.freeze({NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2});var WP=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1});var YP=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});var XP=Object.freeze({DONE:0,PENDING:1,FAILED:2});function KP(){u.a.throwInstantiationError()}Object.defineProperties(KP.prototype,{isConstant:{get:u.a.throwInstantiationError},definitionChanged:{get:u.a.throwInstantiationError}}),KP.prototype.getValue=u.a.throwInstantiationError,KP.prototype.equals=u.a.throwInstantiationError,KP.equals=function(e,t){return e===t||Object(l.a)(e)&&e.equals(t)},KP.arrayEquals=function(e,t){if(e===t)return!0;if(!Object(l.a)(e)||!Object(l.a)(t)||e.length!==t.length)return!1;const n=e.length;for(let i=0;i<n;i++)if(!KP.equals(e[i],t[i]))return!1;return!0},KP.isConstant=function(e){return!Object(l.a)(e)||e.isConstant},KP.getValueOrUndefined=function(e,t,n){return Object(l.a)(e)?e.getValue(t,n):void 0},KP.getValueOrDefault=function(e,t,n,i){return Object(l.a)(e)?Object(c.a)(e.getValue(t,i),n):n},KP.getValueOrClonedDefault=function(e,t,n,i){let r;return Object(l.a)(e)&&(r=e.getValue(t,i)),Object(l.a)(r)||(r=n.clone(r)),r};var JP=KP;const ZP=sp.WHITE,$P=O.ZERO,QP=qP.NONE,eD=Vt.ZERO,tD=O.ZERO,nD=WP.CENTER,iD=YP.CENTER,rD=new O,oD=new sp,aD=new O,sD=new Vt,cD=new TE,lD=new TE,uD=new TE,hD=new Nl,dD=new eb;function fD(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function pD(e,t){if(!Object(l.a)(e))throw new u.a("entityCluster is required.");if(!Object(l.a)(t))throw new u.a("entityCollection is required.");t.collectionChanged.addEventListener(pD.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tl,this._onCollectionChanged(t,t.values,[],[])}function mD(e,t,n){Object(l.a)(e)&&(e.billboard=void 0,n.removeBillboard(t))}pD.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){const r=t[i],o=r.entity,a=o._billboard;let s,c,u=r.billboard,h=o.isShowing&&o.isAvailable(e)&&JP.getValueOrDefault(a._show,e,!0);if(h&&(c=JP.getValueOrUndefined(o._position,e,rD),s=JP.getValueOrUndefined(a._image,e),h=Object(l.a)(c)&&Object(l.a)(s)),!h){mD(r,o,n);continue}JP.isConstant(o._position)||(n._clusterDirty=!0),Object(l.a)(u)||(u=n.getBillboard(o),u.id=o,u.image=void 0,r.billboard=u),u.show=h,Object(l.a)(u.image)&&r.textureValue===s||(u.image=s,r.textureValue=s),u.position=c,u.color=JP.getValueOrDefault(a._color,e,ZP,oD),u.eyeOffset=JP.getValueOrDefault(a._eyeOffset,e,$P,aD),u.heightReference=JP.getValueOrDefault(a._heightReference,e,QP),u.pixelOffset=JP.getValueOrDefault(a._pixelOffset,e,eD,sD),u.scale=JP.getValueOrDefault(a._scale,e,1),u.rotation=JP.getValueOrDefault(a._rotation,e,0),u.alignedAxis=JP.getValueOrDefault(a._alignedAxis,e,tD),u.horizontalOrigin=JP.getValueOrDefault(a._horizontalOrigin,e,nD),u.verticalOrigin=JP.getValueOrDefault(a._verticalOrigin,e,iD),u.width=JP.getValueOrUndefined(a._width,e),u.height=JP.getValueOrUndefined(a._height,e),u.scaleByDistance=JP.getValueOrUndefined(a._scaleByDistance,e,cD),u.translucencyByDistance=JP.getValueOrUndefined(a._translucencyByDistance,e,lD),u.pixelOffsetScaleByDistance=JP.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,uD),u.sizeInMeters=JP.getValueOrDefault(a._sizeInMeters,e,!1),u.distanceDisplayCondition=JP.getValueOrUndefined(a._distanceDisplayCondition,e,dD),u.disableDepthTestDistance=JP.getValueOrUndefined(a._disableDepthTestDistance,e);const d=JP.getValueOrUndefined(a._imageSubRegion,e,hD);Object(l.a)(d)&&u.setImageSubRegion(u._imageId,d)}return!0},pD.prototype.getBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("entity is required.");if(!Object(l.a)(t))throw new u.a("result is required.");const n=this._items.get(e.id);if(!Object(l.a)(n)||!Object(l.a)(n.billboard))return XP.FAILED;const i=n.billboard;if(i.heightReference===qP.NONE)t.center=O.clone(i.position,t.center);else{if(!Object(l.a)(i._clampedPosition))return XP.PENDING;t.center=O.clone(i._clampedPosition,t.center)}return t.radius=0,XP.DONE},pD.prototype.isDestroyed=function(){return!1},pD.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(pD.prototype._onCollectionChanged,this);const e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return sc(this)},pD.prototype._onCollectionChanged=function(e,t,n,i){let r,o;const a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],Object(l.a)(o._billboard)&&Object(l.a)(o._position)&&a.set(o.id,new fD(o));for(r=i.length-1;r>-1;r--)o=i[r],Object(l.a)(o._billboard)&&Object(l.a)(o._position)?a.contains(o.id)||a.set(o.id,new fD(o)):(mD(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],mD(a.get(o.id),o,s),a.remove(o.id)};var gD=pD,_D="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n    vec3 positionToEyeEC = -v_positionEC;\n    mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\n\n    vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n    czm_materialInput materialInput;\n    materialInput.normalEC = normalEC;\n    materialInput.tangentToEyeMatrix = tangentToEyeMatrix;\n    materialInput.positionToEyeEC = positionToEyeEC;\n    materialInput.st = v_st;\n    czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n    gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",yD="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n    vec4 p = czm_computePosition();\n\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\n    v_tangentEC = czm_normal * tangent;                       // tangent in eye coordinates\n    v_bitangentEC = czm_normal * bitangent;                   // bitangent in eye coordinates\n    v_st = st;\n\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",bD="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\n\nvoid main()\n{\n    vec3 positionToEyeEC = -v_positionEC;\n\n    vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n    czm_materialInput materialInput;\n    materialInput.normalEC = normalEC;\n    materialInput.positionToEyeEC = positionToEyeEC;\n    czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n    gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",vD="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\n\nvoid main()\n{\n    vec4 p = czm_computePosition();\n\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\n\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",OD="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n    vec3 positionToEyeEC = -v_positionEC;\n\n    vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n    czm_materialInput materialInput;\n    materialInput.normalEC = normalEC;\n    materialInput.positionToEyeEC = positionToEyeEC;\n    materialInput.st = v_st;\n    czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n    gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",wD="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n    vec4 p = czm_computePosition();\n\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\n    v_st = st;\n\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";const AD={ADD:ps.FUNC_ADD,SUBTRACT:ps.FUNC_SUBTRACT,REVERSE_SUBTRACT:ps.FUNC_REVERSE_SUBTRACT,MIN:ps.MIN,MAX:ps.MAX};var ED=Object.freeze(AD);const TD={ZERO:ps.ZERO,ONE:ps.ONE,SOURCE_COLOR:ps.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ps.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ps.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ps.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ps.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ps.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ps.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ps.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ps.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ps.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ps.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ps.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ps.SRC_ALPHA_SATURATE};var CD=Object.freeze(TD);const xD={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ED.ADD,equationAlpha:ED.ADD,functionSourceRgb:CD.SOURCE_ALPHA,functionSourceAlpha:CD.ONE,functionDestinationRgb:CD.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:CD.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:ED.ADD,equationAlpha:ED.ADD,functionSourceRgb:CD.ONE,functionSourceAlpha:CD.ONE,functionDestinationRgb:CD.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:CD.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:ED.ADD,equationAlpha:ED.ADD,functionSourceRgb:CD.SOURCE_ALPHA,functionSourceAlpha:CD.ONE,functionDestinationRgb:CD.ONE,functionDestinationAlpha:CD.ONE})};var SD=Object.freeze(xD);const ID={FRONT:ps.FRONT,BACK:ps.BACK,FRONT_AND_BACK:ps.FRONT_AND_BACK};var PD=Object.freeze(ID);function DD(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.material=e.material,this.translucent=Object(c.a)(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=Object(c.a)(e.closed,!1)}Object.defineProperties(DD.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),DD.prototype.getFragmentShaderSource=function(){const e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),Object(l.a)(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},DD.prototype.isTranslucent=function(){return Object(l.a)(this.material)&&this.material.isTranslucent()||!Object(l.a)(this.material)&&this.translucent},DD.prototype.getRenderState=function(){const e=this.isTranslucent(),t=Object(Zf.a)(this.renderState,!1);return e?(t.depthMask=!1,t.blending=SD.ALPHA_BLEND):t.depthMask=!0,t},DD.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=SD.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:PD.BACK}),Object(l.a)(n)&&(i=Object(up.a)(n,i,!0)),i};var RD=DD;const jD={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(jD,{maximumCombinedTextureImageUnits:{get:function(){return jD._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return jD._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return jD._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return jD._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return jD._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return jD._maximumTextureSize}},maximumVaryingVectors:{get:function(){return jD._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return jD._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return jD._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return jD._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return jD._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return jD._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return jD._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return jD._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return jD._maximumViewportWidth}},maximumViewportHeight:{get:function(){return jD._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return jD._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return jD._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return jD._maximumColorAttachments}},maximumSamples:{get:function(){return jD._maximumSamples}},highpFloatSupported:{get:function(){return jD._highpFloatSupported}},highpIntSupported:{get:function(){return jD._highpIntSupported}}});var MD=jD;function LD(e,t,n,i,r,o,a,s,c,l,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=r,this._pixelFormat=o,this._size=s,this._preMultiplyAlpha=c,this._flipY=l,this._initialized=u}Object.defineProperties(LD.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),LD.prototype.copyFrom=function(e){s.a.defined("options",e);const t=Object(c.a)(e.xOffset,0),n=Object(c.a)(e.yOffset,0);if(s.a.defined("options.source",e.source),s.a.typeOf.number.greaterThanOrEquals("xOffset",t,0),s.a.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+e.source.width>this._size)throw new u.a("xOffset + options.source.width must be less than or equal to width.");if(n+e.source.height>this._size)throw new u.a("yOffset + options.source.height must be less than or equal to height.");const i=e.source,r=this._context._gl,o=this._textureTarget,a=this._targetFace;r.activeTexture(r.TEXTURE0),r.bindTexture(o,this._texture);const h=i.width,d=i.height;let f=i.arrayBufferView;const p=this._size,m=this._pixelFormat,g=this._internalFormat,_=this._pixelDatatype,y=this._preMultiplyAlpha,b=this._flipY,v=Object(c.a)(e.skipColorSpaceConversion,!1);let O=4;Object(l.a)(f)&&(O=aT.alignmentInBytes(m,_,h)),r.pixelStorei(r.UNPACK_ALIGNMENT,O),v?r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE):r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.BROWSER_DEFAULT_WEBGL);let w=!1;if(!this._initialized){if(0===t&&0===n&&h===p&&d===p)Object(l.a)(f)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=aT.flipY(f,m,_,p,p)),r.texImage2D(a,0,g,p,p,0,m,rT.toWebGLConstant(_,this._context),f)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b),r.texImage2D(a,0,g,m,rT.toWebGLConstant(_,this._context),i)),w=!0;else{r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const e=aT.createTypedArray(m,_,p,p);r.texImage2D(a,0,g,p,p,0,m,rT.toWebGLConstant(_,this._context),e)}this._initialized=!0}w||(Object(l.a)(f)?(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=aT.flipY(f,m,_,h,d)),r.texSubImage2D(a,0,t,n,h,d,m,rT.toWebGLConstant(_,this._context),f)):(r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,b),r.texSubImage2D(a,0,t,n,m,rT.toWebGLConstant(_,this._context),i))),r.bindTexture(o,null)},LD.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){if(e=Object(c.a)(e,0),t=Object(c.a)(t,0),n=Object(c.a)(n,0),i=Object(c.a)(i,0),r=Object(c.a)(r,this._size),o=Object(c.a)(o,this._size),s.a.typeOf.number.greaterThanOrEquals("xOffset",e,0),s.a.typeOf.number.greaterThanOrEquals("yOffset",t,0),s.a.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),s.a.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+r>this._size)throw new u.a("xOffset + source.width must be less than or equal to width.");if(t+o>this._size)throw new u.a("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===rT.FLOAT)throw new u.a("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===rT.HALF_FLOAT)throw new u.a("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");const a=this._context._gl,l=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),a.bindTexture(l,null),this._initialized=!0};var ND=LD;const BD={DONT_CARE:ps.DONT_CARE,FASTEST:ps.FASTEST,NICEST:ps.NICEST,validate:function(e){return e===BD.DONT_CARE||e===BD.FASTEST||e===BD.NICEST}};var FD=Object.freeze(BD);const zD={NEAREST:ps.NEAREST,LINEAR:ps.LINEAR,validate:function(e){return e===zD.NEAREST||e===zD.LINEAR}};var kD=Object.freeze(zD);const UD={NEAREST:ps.NEAREST,LINEAR:ps.LINEAR,NEAREST_MIPMAP_NEAREST:ps.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ps.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ps.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ps.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===UD.NEAREST||e===UD.LINEAR||e===UD.NEAREST_MIPMAP_NEAREST||e===UD.LINEAR_MIPMAP_NEAREST||e===UD.NEAREST_MIPMAP_LINEAR||e===UD.LINEAR_MIPMAP_LINEAR}};var VD=Object.freeze(UD);const HD={CLAMP_TO_EDGE:ps.CLAMP_TO_EDGE,REPEAT:ps.REPEAT,MIRRORED_REPEAT:ps.MIRRORED_REPEAT,validate:function(e){return e===HD.CLAMP_TO_EDGE||e===HD.REPEAT||e===HD.MIRRORED_REPEAT}};var GD=Object.freeze(HD);function qD(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.wrapS,GD.CLAMP_TO_EDGE),n=Object(c.a)(e.wrapT,GD.CLAMP_TO_EDGE),i=Object(c.a)(e.minificationFilter,VD.LINEAR),r=Object(c.a)(e.magnificationFilter,kD.LINEAR),o=Object(l.a)(e.maximumAnisotropy)?e.maximumAnisotropy:1;if(!GD.validate(t))throw new u.a("Invalid sampler.wrapS.");if(!GD.validate(n))throw new u.a("Invalid sampler.wrapT.");if(!VD.validate(i))throw new u.a("Invalid sampler.minificationFilter.");if(!kD.validate(r))throw new u.a("Invalid sampler.magnificationFilter.");s.a.typeOf.number.greaterThanOrEquals("maximumAnisotropy",o,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=r,this._maximumAnisotropy=o}Object.defineProperties(qD.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),qD.equals=function(e,t){return e===t||Object(l.a)(e)&&Object(l.a)(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},qD.NEAREST=Object.freeze(new qD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.NEAREST,magnificationFilter:kD.NEAREST}));var WD=qD;function YD(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context);const t=e.context,n=e.source;let i,r;if(Object(l.a)(n)){const e=[n.positiveX,n.negativeX,n.positiveY,n.negativeY,n.positiveZ,n.negativeZ];if(!(e[0]&&e[1]&&e[2]&&e[3]&&e[4]&&e[5]))throw new u.a("options.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.");i=e[0].width,r=e[0].height;for(let t=1;t<6;++t)if(Number(e[t].width)!==i||Number(e[t].height)!==r)throw new u.a("Each face in options.source must have the same width and height.")}else i=e.width,r=e.height;const o=i,a=Object(c.a)(e.pixelDatatype,rT.UNSIGNED_BYTE),h=Object(c.a)(e.pixelFormat,aT.RGBA),d=aT.toInternalFormat(h,a,t);if(!Object(l.a)(i)||!Object(l.a)(r))throw new u.a("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(i!==r)throw new u.a("Width must equal height.");if(o<=0)throw new u.a("Width and height must be greater than zero.");if(o>MD.maximumCubeMapSize)throw new u.a(`Width and height must be less than or equal to the maximum cube map size (${MD.maximumCubeMapSize}).  Check maximumCubeMapSize.`);if(!aT.validate(h))throw new u.a("Invalid options.pixelFormat.");if(aT.isDepthFormat(h))throw new u.a("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!rT.validate(a))throw new u.a("Invalid options.pixelDatatype.");if(a===rT.FLOAT&&!t.floatingPointTexture)throw new u.a("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(a===rT.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new u.a("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");const f=6*aT.textureSizeInBytes(h,a,o,o),p=e.preMultiplyAlpha||h===aT.RGB||h===aT.LUMINANCE,m=Object(c.a)(e.flipY,!0),g=Object(c.a)(e.skipColorSpaceConversion,!1),_=t._gl,y=_.TEXTURE_CUBE_MAP,b=_.createTexture();function v(e,n,r,s,c){let u=n.arrayBufferView;Object(l.a)(u)||(u=n.bufferView);let f=4;Object(l.a)(u)&&(f=aT.alignmentInBytes(h,a,i)),_.pixelStorei(_.UNPACK_ALIGNMENT,f),c?_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.NONE):_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.BROWSER_DEFAULT_WEBGL),Object(l.a)(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,!1),s&&(u=aT.flipY(u,h,a,o,o)),_.texImage2D(e,0,d,o,o,0,h,rT.toWebGLConstant(a,t),u)):(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,s),_.texImage2D(e,0,d,h,rT.toWebGLConstant(a,t),n))}_.activeTexture(_.TEXTURE0),_.bindTexture(y,b),Object(l.a)(n)?(v(_.TEXTURE_CUBE_MAP_POSITIVE_X,n.positiveX,p,m,g),v(_.TEXTURE_CUBE_MAP_NEGATIVE_X,n.negativeX,p,m,g),v(_.TEXTURE_CUBE_MAP_POSITIVE_Y,n.positiveY,p,m,g),v(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,n.negativeY,p,m,g),v(_.TEXTURE_CUBE_MAP_POSITIVE_Z,n.positiveZ,p,m,g),v(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,n.negativeZ,p,m,g)):(_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X,0,d,o,o,0,h,rT.toWebGLConstant(a,t),null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_X,0,d,o,o,0,h,rT.toWebGLConstant(a,t),null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Y,0,d,o,o,0,h,rT.toWebGLConstant(a,t),null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,d,o,o,0,h,rT.toWebGLConstant(a,t),null),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Z,0,d,o,o,0,h,rT.toWebGLConstant(a,t),null),_.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,d,o,o,0,h,rT.toWebGLConstant(a,t),null)),_.bindTexture(y,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=h,this._pixelDatatype=a,this._size=o,this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=p,this._flipY=m,this._sampler=void 0;const O=Object(l.a)(n);this._positiveX=new ND(t,b,y,_.TEXTURE_CUBE_MAP_POSITIVE_X,d,h,a,o,p,m,O),this._negativeX=new ND(t,b,y,_.TEXTURE_CUBE_MAP_NEGATIVE_X,d,h,a,o,p,m,O),this._positiveY=new ND(t,b,y,_.TEXTURE_CUBE_MAP_POSITIVE_Y,d,h,a,o,p,m,O),this._negativeY=new ND(t,b,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Y,d,h,a,o,p,m,O),this._positiveZ=new ND(t,b,y,_.TEXTURE_CUBE_MAP_POSITIVE_Z,d,h,a,o,p,m,O),this._negativeZ=new ND(t,b,y,_.TEXTURE_CUBE_MAP_NEGATIVE_Z,d,h,a,o,p,m,O),this.sampler=Object(l.a)(e.sampler)?e.sampler:new WD}Object.defineProperties(YD.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter;const i=t===VD.NEAREST_MIPMAP_NEAREST||t===VD.NEAREST_MIPMAP_LINEAR||t===VD.LINEAR_MIPMAP_NEAREST||t===VD.LINEAR_MIPMAP_LINEAR,r=this._context,o=this._pixelDatatype;(o===rT.FLOAT&&!r.textureFloatLinear||o===rT.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=i?VD.NEAREST_MIPMAP_NEAREST:VD.NEAREST,n=kD.NEAREST);const a=r._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,t),a.texParameteri(s,a.TEXTURE_MAG_FILTER,n),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),Object(l.a)(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),YD.prototype.generateMipmap=function(e){if(e=Object(c.a)(e,FD.DONT_CARE),this._size>1&&!h.a.isPowerOfTwo(this._size))throw new u.a("width and height must be a power of two to call generateMipmap().");if(!FD.validate(e))throw new u.a("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)},YD.prototype.isDestroyed=function(){return!1},YD.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=sc(this._positiveX),this._negativeX=sc(this._negativeX),this._positiveY=sc(this._positiveY),this._negativeY=sc(this._negativeY),this._positiveZ=sc(this._positiveZ),this._negativeZ=sc(this._negativeZ),sc(this)};var XD=YD;function KD(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context);const t=e.context;let n=e.width,i=e.height;const r=e.source;Object(l.a)(r)&&(Object(l.a)(n)||(n=Object(c.a)(r.videoWidth,r.width)),Object(l.a)(i)||(i=Object(c.a)(r.videoHeight,r.height)));const o=Object(c.a)(e.pixelFormat,aT.RGBA),a=Object(c.a)(e.pixelDatatype,rT.UNSIGNED_BYTE),h=aT.toInternalFormat(o,a,t),d=aT.isCompressedFormat(h);if(!Object(l.a)(n)||!Object(l.a)(i))throw new u.a("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(s.a.typeOf.number.greaterThan("width",n,0),n>MD.maximumTextureSize)throw new u.a(`Width must be less than or equal to the maximum texture size (${MD.maximumTextureSize}).  Check maximumTextureSize.`);if(s.a.typeOf.number.greaterThan("height",i,0),i>MD.maximumTextureSize)throw new u.a(`Height must be less than or equal to the maximum texture size (${MD.maximumTextureSize}).  Check maximumTextureSize.`);if(!aT.validate(o))throw new u.a("Invalid options.pixelFormat.");if(!d&&!rT.validate(a))throw new u.a("Invalid options.pixelDatatype.");if(o===aT.DEPTH_COMPONENT&&a!==rT.UNSIGNED_SHORT&&a!==rT.UNSIGNED_INT)throw new u.a("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(o===aT.DEPTH_STENCIL&&a!==rT.UNSIGNED_INT_24_8)throw new u.a("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(a===rT.FLOAT&&!t.floatingPointTexture)throw new u.a("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.  Check context.floatingPointTexture.");if(a===rT.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new u.a("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(aT.isDepthFormat(o)){if(Object(l.a)(r))throw new u.a("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new u.a("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture.  Check context.depthTexture.")}if(d){if(!Object(l.a)(r)||!Object(l.a)(r.arrayBufferView))throw new u.a("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(aT.isDXTFormat(h)&&!t.s3tc)throw new u.a("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(aT.isPVRTCFormat(h)&&!t.pvrtc)throw new u.a("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(aT.isASTCFormat(h)&&!t.astc)throw new u.a("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(aT.isETC2Format(h)&&!t.etc)throw new u.a("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(aT.isETC1Format(h)&&!t.etc1)throw new u.a("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(aT.isBC7Format(h)&&!t.bc7)throw new u.a("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(aT.compressedTextureSizeInBytes(h,n,i)!==r.arrayBufferView.byteLength)throw new u.a("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const f=e.preMultiplyAlpha||o===aT.RGB||o===aT.LUMINANCE,p=Object(c.a)(e.flipY,!0),m=Object(c.a)(e.skipColorSpaceConversion,!1);let g=!0;const _=t._gl,y=_.TEXTURE_2D,b=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,b);let v,O=4;if(Object(l.a)(r)&&Object(l.a)(r.arrayBufferView)&&!d&&(O=aT.alignmentInBytes(o,a,n)),_.pixelStorei(_.UNPACK_ALIGNMENT,O),m?_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.NONE):_.pixelStorei(_.UNPACK_COLORSPACE_CONVERSION_WEBGL,_.BROWSER_DEFAULT_WEBGL),Object(l.a)(r))if(Object(l.a)(r.arrayBufferView)){_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,!1);let e,s,c,u=r.arrayBufferView;if(d){if(_.compressedTexImage2D(y,0,h,n,i,0,u),Object(l.a)(r.mipLevels))for(s=n,c=i,e=0;e<r.mipLevels.length;++e)s=0|Math.floor(s/2),s<1&&(s=1),c=0|Math.floor(c/2),c<1&&(c=1),_.compressedTexImage2D(y,e+1,h,s,c,0,r.mipLevels[e])}else if(p&&(u=aT.flipY(u,o,a,n,i)),_.texImage2D(y,0,h,n,i,0,o,rT.toWebGLConstant(a,t),u),Object(l.a)(r.mipLevels))for(s=n,c=i,e=0;e<r.mipLevels.length;++e)s=0|Math.floor(s/2),s<1&&(s=1),c=0|Math.floor(c/2),c<1&&(c=1),_.texImage2D(y,e+1,h,s,c,0,o,rT.toWebGLConstant(a,t),r.mipLevels[e])}else Object(l.a)(r.framebuffer)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,!1),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._bind(),_.copyTexImage2D(y,0,h,r.xOffset,r.yOffset,n,i,0),r.framebuffer!==t.defaultFramebuffer&&r.framebuffer._unBind()):(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,p),_.texImage2D(y,0,h,o,rT.toWebGLConstant(a,t),r));else _.texImage2D(y,0,h,n,i,0,o,rT.toWebGLConstant(a,t),null),g=!1;_.bindTexture(y,null),v=d?aT.compressedTextureSizeInBytes(o,n,i):aT.textureSizeInBytes(o,a,n,i),this._id=fy(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._internalFormat=h,this._pixelFormat=o,this._pixelDatatype=a,this._width=n,this._height=i,this._dimensions=new Vt(n,i),this._hasMipmap=!1,this._sizeInBytes=v,this._preMultiplyAlpha=f,this._flipY=p,this._initialized=g,this._sampler=void 0,this.sampler=Object(l.a)(e.sampler)?e.sampler:new WD}KD.create=function(e){return new KD(e)},KD.fromFramebuffer=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context);const t=e.context,n=t._gl,i=Object(c.a)(e.pixelFormat,aT.RGB),r=Object(c.a)(e.framebufferXOffset,0),o=Object(c.a)(e.framebufferYOffset,0),a=Object(c.a)(e.width,n.drawingBufferWidth),h=Object(c.a)(e.height,n.drawingBufferHeight),d=e.framebuffer;if(!aT.validate(i))throw new u.a("Invalid pixelFormat.");if(aT.isDepthFormat(i)||aT.isCompressedFormat(i))throw new u.a("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(s.a.defined("options.context",e.context),s.a.typeOf.number.greaterThanOrEquals("framebufferXOffset",r,0),s.a.typeOf.number.greaterThanOrEquals("framebufferYOffset",o,0),r+a>n.drawingBufferWidth)throw new u.a("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(o+h>n.drawingBufferHeight)throw new u.a("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new KD({context:t,width:a,height:h,pixelFormat:i,source:{framebuffer:Object(l.a)(d)?d:t.defaultFramebuffer,xOffset:r,yOffset:o,width:a,height:h}})},Object.defineProperties(KD.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,n=e.magnificationFilter;const i=this._context,r=this._pixelFormat,o=this._pixelDatatype,a=t===VD.NEAREST_MIPMAP_NEAREST||t===VD.NEAREST_MIPMAP_LINEAR||t===VD.LINEAR_MIPMAP_NEAREST||t===VD.LINEAR_MIPMAP_LINEAR;(o===rT.FLOAT&&!i.textureFloatLinear||o===rT.HALF_FLOAT&&!i.textureHalfFloatLinear)&&(t=a?VD.NEAREST_MIPMAP_NEAREST:VD.NEAREST,n=kD.NEAREST),i.webgl2&&aT.isDepthFormat(r)&&(t=VD.NEAREST,n=kD.NEAREST);const s=i._gl,c=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(c,this._texture),s.texParameteri(c,s.TEXTURE_MIN_FILTER,t),s.texParameteri(c,s.TEXTURE_MAG_FILTER,n),s.texParameteri(c,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(c,s.TEXTURE_WRAP_T,e.wrapT),Object(l.a)(this._textureFilterAnisotropic)&&s.texParameteri(c,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(c,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),KD.prototype.copyFrom=function(e){s.a.defined("options",e);const t=Object(c.a)(e.xOffset,0),n=Object(c.a)(e.yOffset,0);if(s.a.defined("options.source",e.source),aT.isDepthFormat(this._pixelFormat))throw new u.a("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(aT.isCompressedFormat(this._pixelFormat))throw new u.a("Cannot call copyFrom with a compressed texture pixel format.");s.a.typeOf.number.greaterThanOrEquals("xOffset",t,0),s.a.typeOf.number.greaterThanOrEquals("yOffset",n,0),s.a.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+e.source.width,this._width),s.a.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+e.source.height,this._height);const i=e.source,r=this._context,o=r._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture);const h=i.width,d=i.height;let f=i.arrayBufferView;const p=this._width,m=this._height,g=this._internalFormat,_=this._pixelFormat,y=this._pixelDatatype,b=this._preMultiplyAlpha,v=this._flipY,O=Object(c.a)(e.skipColorSpaceConversion,!1);let w=4;Object(l.a)(f)&&(w=aT.alignmentInBytes(_,y,h)),o.pixelStorei(o.UNPACK_ALIGNMENT,w),O?o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.NONE):o.pixelStorei(o.UNPACK_COLORSPACE_CONVERSION_WEBGL,o.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){if(0===t&&0===n&&h===p&&d===m)Object(l.a)(f)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),v&&(f=aT.flipY(f,_,y,p,m)),o.texImage2D(a,0,g,p,m,0,_,rT.toWebGLConstant(y,r),f)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,v),o.texImage2D(a,0,g,_,rT.toWebGLConstant(y,r),i)),A=!0;else{o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1);const e=aT.createTypedArray(_,y,p,m);o.texImage2D(a,0,g,p,m,0,_,rT.toWebGLConstant(y,r),e)}this._initialized=!0}A||(Object(l.a)(f)?(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!1),v&&(f=aT.flipY(f,_,y,h,d)),o.texSubImage2D(a,0,t,n,h,d,_,rT.toWebGLConstant(y,r),f)):(o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,v),o.texSubImage2D(a,0,t,n,_,rT.toWebGLConstant(y,r),i))),o.bindTexture(a,null)},KD.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){if(e=Object(c.a)(e,0),t=Object(c.a)(t,0),n=Object(c.a)(n,0),i=Object(c.a)(i,0),r=Object(c.a)(r,this._width),o=Object(c.a)(o,this._height),aT.isDepthFormat(this._pixelFormat))throw new u.a("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===rT.FLOAT)throw new u.a("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===rT.HALF_FLOAT)throw new u.a("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(aT.isCompressedFormat(this._pixelFormat))throw new u.a("Cannot call copyFrom with a compressed texture pixel format.");s.a.typeOf.number.greaterThanOrEquals("xOffset",e,0),s.a.typeOf.number.greaterThanOrEquals("yOffset",t,0),s.a.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),s.a.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),s.a.typeOf.number.lessThanOrEquals("xOffset + width",e+r,this._width),s.a.typeOf.number.lessThanOrEquals("yOffset + height",t+o,this._height);const a=this._context._gl,l=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture),a.copyTexSubImage2D(l,0,e,t,n,i,r,o),a.bindTexture(l,null),this._initialized=!0},KD.prototype.generateMipmap=function(e){if(e=Object(c.a)(e,FD.DONT_CARE),aT.isDepthFormat(this._pixelFormat))throw new u.a("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(aT.isCompressedFormat(this._pixelFormat))throw new u.a("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!h.a.isPowerOfTwo(this._width))throw new u.a("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!h.a.isPowerOfTwo(this._height))throw new u.a("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!FD.validate(e))throw new u.a("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)},KD.prototype.isDestroyed=function(){return!1},KD.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),sc(this)};var JD=KD,ZD="uniform sampler2D image;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    vec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\n    rampColor = czm_gammaCorrect(rampColor);\n    material.diffuse = rampColor.rgb;\n    material.alpha = rampColor.a;\n    return material;\n}\n",$D="uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n\n    vec2 centerPixel = fract(repeat * st);\n    float centerBump = texture2D(image, centerPixel).channel;\n\n    float imageWidth = float(imageDimensions.x);\n    vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\n    float rightBump = texture2D(image, rightPixel).channel;\n\n    float imageHeight = float(imageDimensions.y);\n    vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\n    float topBump = texture2D(image, leftPixel).channel;\n\n    vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\n    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n\n    material.normal = normalEC;\n    material.diffuse = vec3(0.01);\n\n    return material;\n}\n",QD="uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n\n    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n    float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);  // 0.0 or 1.0\n\n    // Find the distance from the closest separator (region between two colors)\n    float scaledWidth = fract(repeat.s * st.s);\n    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n    float scaledHeight = fract(repeat.t * st.t);\n    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n    float value = min(scaledWidth, scaledHeight);\n\n    vec4 currentColor = mix(lightColor, darkColor, b);\n    vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\n\n    color = czm_gammaCorrect(color);\n    material.diffuse = color.rgb;\n    material.alpha = color.a;\n\n    return material;\n}\n",eR="uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n    float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));  // 0.0 or 1.0\n\n    vec4 color = mix(lightColor, darkColor, b);\n    color = czm_gammaCorrect(color);\n    material.diffuse = color.rgb;\n    material.alpha = color.a;\n\n    return material;\n}\n",tR="uniform sampler2D heights;\nuniform sampler2D colors;\n\n// This material expects heights to be sorted from lowest to highest.\n\nfloat getHeight(int idx, float invTexSize)\n{\n    vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\n#ifdef OES_texture_float\n    return texture2D(heights, uv).x;\n#else\n    return czm_unpackFloat(texture2D(heights, uv));\n#endif\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    float height = materialInput.height;\n    float invTexSize = 1.0 / float(heightsDimensions.x);\n\n    float minHeight = getHeight(0, invTexSize);\n    float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);\n\n    // early-out when outside the height range\n    if (height < minHeight || height > maxHeight) {\n        material.diffuse = vec3(0.0);\n        material.alpha = 0.0;\n        return material;\n    }\n\n    // Binary search to find heights above and below.\n    int idxBelow = 0;\n    int idxAbove = heightsDimensions.x;\n    float heightBelow = minHeight;\n    float heightAbove = maxHeight;\n\n    // while loop not allowed, so use for loop with max iterations.\n    // maxIterations of 16 supports a texture size up to 65536 (2^16).\n    const int maxIterations = 16;\n    for (int i = 0; i < maxIterations; i++) {\n        if (idxBelow >= idxAbove - 1) {\n            break;\n        }\n\n        int idxMid = (idxBelow + idxAbove) / 2;\n        float heightTex = getHeight(idxMid, invTexSize);\n\n        if (height > heightTex) {\n            idxBelow = idxMid;\n            heightBelow = heightTex;\n        } else {\n            idxAbove = idxMid;\n            heightAbove = heightTex;\n        }\n    }\n\n    float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\n    vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\n    vec4 color = texture2D(colors, colorUv);\n\n    // undo preumultiplied alpha\n    if (color.a > 0.0) \n    {\n        color.rgb /= color.a;\n    }\n    \n    color.rgb = czm_gammaCorrect(color.rgb);\n\n    material.diffuse = color.rgb;\n    material.alpha = color.a;\n    return material;\n}\n",nR="#ifdef GL_OES_standard_derivatives\n    #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 color;\nuniform float spacing;\nuniform float width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    float distanceToContour = mod(materialInput.height, spacing);\n\n#ifdef GL_OES_standard_derivatives\n    float dxc = abs(dFdx(materialInput.height));\n    float dyc = abs(dFdy(materialInput.height));\n    float dF = max(dxc, dyc) * czm_pixelRatio * width;\n    float alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\n    float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\n#endif\n\n    vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));\n    material.diffuse = outColor.rgb;\n    material.alpha = outColor.a;\n\n    return material;\n}\n",iR="uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\n    vec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\n    rampColor = czm_gammaCorrect(rampColor);\n    material.diffuse = rampColor.rgb;\n    material.alpha = rampColor.a;\n    return material;\n}\n",rR="uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\n\nfloat getTime(float t, float coord)\n{\n    float scalar = 1.0 / maximumDistance;\n    float q  = distance(t, coord) * scalar;\n    if (repeat)\n    {\n        float r = distance(t, coord + 1.0) * scalar;\n        float s = distance(t, coord - 1.0) * scalar;\n        q = min(min(r, s), q);\n    }\n    return clamp(q, 0.0, 1.0);\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n    float s = getTime(time.x, st.s) * fadeDirection.s;\n    float t = getTime(time.y, st.t) * fadeDirection.t;\n\n    float u = length(vec2(s, t));\n    vec4 color = mix(fadeInColor, fadeOutColor, u);\n\n    color = czm_gammaCorrect(color);\n    material.emission = color.rgb;\n    material.alpha = color.a;\n\n    return material;\n}\n",oR='#ifdef GL_OES_standard_derivatives\n    #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n\n    float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\n    scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n    float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\n    scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n\n    float value;\n#ifdef GL_OES_standard_derivatives\n    // Fuzz Factor - Controls blurriness of lines\n    const float fuzz = 1.2;\n    vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\n\n    // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.\n    vec2 dx = abs(dFdx(st));\n    vec2 dy = abs(dFdy(st));\n    vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\n    value = min(\n        smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\n        smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\n    // Fuzz Factor - Controls blurriness of lines\n    const float fuzz = 0.05;\n\n    vec2 range = 0.5 - (lineThickness * 0.05);\n    value = min(\n        1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n        1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\n\n    // Edges taken from RimLightingMaterial.glsl\n    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\n    float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\n    float sRim = smoothstep(0.8, 1.0, dRim);\n    value *= (1.0 - sRim);\n\n    vec4 halfColor;\n    halfColor.rgb = color.rgb * 0.5;\n    halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\n    halfColor = czm_gammaCorrect(halfColor);\n    material.diffuse = halfColor.rgb;\n    material.emission = halfColor.rgb;\n    material.alpha = halfColor.a;\n\n    return material;\n}\n',aR="uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    \n    vec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\n    vec3 normalTangentSpace = textureValue.channels;\n    normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\n    normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\n    normalTangentSpace = normalize(normalTangentSpace);\n    vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n    \n    material.normal = normalEC;\n    \n    return material;\n}\n",sR="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 color;\n\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\n    float slope = (p0.y - p1.y) / (p0.x - p1.x);\n    return slope * (x - p0.x) + p0.y;\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n\n#ifdef GL_OES_standard_derivatives\n    float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\n#else\n    float base = 0.975; // 2.5% of the line will be the arrow head\n#endif\n\n    vec2 center = vec2(1.0, 0.5);\n    float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\n    float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\n\n    float halfWidth = 0.15;\n    float s = step(0.5 - halfWidth, st.t);\n    s *= 1.0 - step(0.5 + halfWidth, st.t);\n    s *= 1.0 - step(base, st.s);\n\n    float t = step(base, materialInput.st.s);\n    t *= 1.0 - step(ptOnUpperLine, st.t);\n    t *= step(ptOnLowerLine, st.t);\n\n    // Find the distance from the closest separator (region between two colors)\n    float dist;\n    if (st.s < base)\n    {\n        float d1 = abs(st.t - (0.5 - halfWidth));\n        float d2 = abs(st.t - (0.5 + halfWidth));\n        dist = min(d1, d2);\n    }\n    else\n    {\n        float d1 = czm_infinity;\n        if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n        {\n            d1 = abs(st.s - base);\n        }\n        float d2 = abs(st.t - ptOnUpperLine);\n        float d3 = abs(st.t - ptOnLowerLine);\n        dist = min(min(d1, d2), d3);\n    }\n\n    vec4 outsideColor = vec4(0.0);\n    vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\n    vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\n\n    outColor = czm_gammaCorrect(outColor);\n    material.diffuse = outColor.rgb;\n    material.alpha = outColor.a;\n    return material;\n}\n",cR="uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\n\nconst float maskLength = 16.0;\n\nmat2 rotate(float rad) {\n    float c = cos(rad);\n    float s = sin(rad);\n    return mat2(\n        c, s,\n        -s, c\n    );\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\n\n    // Get the relative position within the dash from 0 to 1\n    float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\n    // Figure out the mask index.\n    float maskIndex = floor(dashPosition * maskLength);\n    // Test the bit mask.\n    float maskTest = floor(dashPattern / pow(2.0, maskIndex));\n    vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\n    if (fragColor.a < 0.005) {   // matches 0/255 and 1/255\n        discard;\n    }\n\n    fragColor = czm_gammaCorrect(fragColor);\n    material.emission = fragColor.rgb;\n    material.alpha = fragColor.a;\n    return material;\n}\n",lR="uniform vec4 color;\nuniform float glowPower;\nuniform float taperPower;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n    float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\n\n    if (taperPower <= 0.99999) {\n        glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n    }\n\n    vec4 fragColor;\n    fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n    fragColor.a = clamp(0.0, 1.0, glow) * color.a;\n    fragColor = czm_gammaCorrect(fragColor);\n\n    material.emission = fragColor.rgb;\n    material.alpha = fragColor.a;\n\n    return material;\n}\n",uR="uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\n\nvarying float v_width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    vec2 st = materialInput.st;\n    float halfInteriorWidth =  0.5 * (v_width - outlineWidth) / v_width;\n    float b = step(0.5 - halfInteriorWidth, st.t);\n    b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\n\n    // Find the distance from the closest separator (region between two colors)\n    float d1 = abs(st.t - (0.5 - halfInteriorWidth));\n    float d2 = abs(st.t - (0.5 + halfInteriorWidth));\n    float dist = min(d1, d2);\n\n    vec4 currentColor = mix(outlineColor, color, b);\n    vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\n    outColor = czm_gammaCorrect(outColor);\n\n    material.diffuse = outColor.rgb;\n    material.alpha = outColor.a;\n\n    return material;\n}\n",hR="uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\n    float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\n    float s = smoothstep(1.0 - width, 1.0, d);\n\n    vec4 outColor = czm_gammaCorrect(color);\n    vec4 outRimColor = czm_gammaCorrect(rimColor);\n\n    material.diffuse = outColor.rgb;\n    material.emission = outRimColor.rgb * s;\n    material.alpha = mix(outColor.a, outRimColor.a, s);\n\n    return material;\n}\n",dR="uniform sampler2D image;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    vec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\n    rampColor = czm_gammaCorrect(rampColor);\n    material.diffuse = rampColor.rgb;\n    material.alpha = rampColor.a;\n    return material;\n}\n",fR="uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)\n    float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\n    float value = fract((coord - offset) * (repeat * 0.5));\n    float dist = min(value, min(abs(value - 0.5), 1.0 - value));\n\n    vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\n    vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\n    color = czm_gammaCorrect(color);\n\n    material.diffuse = color.rgb;\n    material.alpha = color.a;\n\n    return material;\n}\n",pR="// Thanks for the contribution Jonas\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\n\nuniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n    czm_material material = czm_getDefaultMaterial(materialInput);\n\n    float time = czm_frameNumber * animationSpeed;\n\n    // fade is a function of the distance from the fragment and the frequency of the waves\n    float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\n\n    float specularMapValue = texture2D(specularMap, materialInput.st).r;\n\n    // note: not using directional motion at this time, just set the angle to 0.0;\n    vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\n    vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\n\n    // fade out the normal perturbation as we move further from the water surface\n    normalTangentSpace.xy /= fade;\n\n    // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)\n    normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\n\n    normalTangentSpace = normalize(normalTangentSpace);\n\n    // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane\n    float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\n\n    // fade out water effect as specular map value decreases\n    material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\n\n    // base color is a blend of the water and non-water color based on the value from the specular map\n    // may need a uniform blend factor to better control this\n    material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\n\n    // diffuse highlights are based on how perturbed the normal is\n    material.diffuse += (0.1 * tsPerturbationRatio);\n\n    material.diffuse = material.diffuse;\n\n    material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\n\n    material.specular = specularIntensity;\n    material.shininess = 10.0;\n\n    return material;\n}\n";function mR(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=Object(c.a)(e.minificationFilter,VD.LINEAR),this._magnificationFilter=Object(c.a)(e.magnificationFilter,kD.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,function(e,t){let n;e=Object(c.a)(e,c.a.EMPTY_OBJECT),t._strict=Object(c.a)(e.strict,!1),t._count=Object(c.a)(e.count,0),t._template=Object(Zf.a)(Object(c.a)(e.fabric,c.a.EMPTY_OBJECT)),t._template.uniforms=Object(Zf.a)(Object(c.a)(t._template.uniforms,c.a.EMPTY_OBJECT)),t._template.materials=Object(Zf.a)(Object(c.a)(t._template.materials,c.a.EMPTY_OBJECT)),t.type=Object(l.a)(t._template.type)?t._template.type:fy(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];const i=mR._materialCache.getMaterial(t.type);if(Object(l.a)(i)){const e=Object(Zf.a)(i.fabric,!0);t._template=Object(up.a)(t._template,e,!0),n=i.translucent}(function(e){const t=e._template,n=t.uniforms,i=t.materials,r=t.components;if(Object(l.a)(r)&&Object(l.a)(t.source))throw new u.a("fabric: cannot have source and components in the same template.");gR(t,bR,_R,!0),gR(r,vR,_R,!0);const o=[];for(const e in i)i.hasOwnProperty(e)&&o.push(e);gR(n,o,yR,!1)})(t),Object(l.a)(i)||mR._materialCache.addMaterial(t.type,t);(function(e){const t=e._template.components,n=e._template.source;if(Object(l.a)(n))e.shaderSource+=n+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",Object(l.a)(t)){const n=Object.keys(e._template.materials).length>0;for(const i in t)if(t.hasOwnProperty(i))if("diffuse"===i||"emission"===i){const r=n&&OR(t[i],e)?t[i]:`czm_gammaCorrect(${t[i]})`;e.shaderSource+=`material.${i} = ${r}; \n`}else e.shaderSource+="alpha"===i?`material.alpha = ${t.alpha}; \n`:`material.${i} = ${t[i]};\n`}e.shaderSource+="return material;\n}\n"}})(t),function(e){const t=e._template.uniforms;for(const n in t)t.hasOwnProperty(n)&&ER(e,n)}(t),function(e){const t=e._strict,n=e._template.materials;for(const i in n)if(n.hasOwnProperty(i)){const r=new mR({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Object(up.a)(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);const o="czm_getMaterial",a=`${o}_${e._count++}`;TR(r,o,a),e.shaderSource=r.shaderSource+e.shaderSource;if(0===TR(e,i,a+"(materialInput)")&&t)throw new u.a(`strict: shader source does not use material '${i}'.`)}}(t);const r=0===t._translucentFunctions.length||void 0;if(n=Object(c.a)(n,r),n=Object(c.a)(e.translucent,n),Object(l.a)(n))if("function"==typeof n){const e=function(){return n(t)};t._translucentFunctions.push(e)}else t._translucentFunctions.push(n)}(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),Object(l.a)(mR._uniformList[this.type])||(mR._uniformList[this.type]=Object.keys(this._uniforms))}function gR(e,t,n,i){if(Object(l.a)(e))for(const r in e)if(e.hasOwnProperty(r)){const e=-1!==t.indexOf(r);(i&&!e||!i&&e)&&n(r,t)}}function _R(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let e=0;e<t.length;e++){const i=`'${t[e]}'`;n+=e===t.length-1?`or ${i}.`:i+", "}throw new u.a(n)}function yR(e,t){const n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new u.a(n)}mR._uniformList={},mR.fromType=function(e,t){if(!Object(l.a)(mR._materialCache.getMaterial(e)))throw new u.a(`material with type '${e}' does not exist.`);const n=new mR({fabric:{type:e}});if(Object(l.a)(t))for(const e in t)t.hasOwnProperty(e)&&(n.uniforms[e]=t[e]);return n},mR.prototype.isTranslucent=function(){if(Object(l.a)(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;let e=!0;const t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){const n=t[i];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},mR.prototype.update=function(e){let t,n;this._defaultTexture=e.defaultTexture;const i=this._loadedImages;let r=i.length;for(t=0;t<r;++t){const r=i[t];n=r.id;let o,a=r.image;Array.isArray(a)&&(o=a.slice(1,a.length).map((function(e){return e.bufferView})),a=a[0]);const s=new WD({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter});let c;c=Object(l.a)(a.internalFormat)?new JD({context:e,pixelFormat:a.internalFormat,width:a.width,height:a.height,source:{arrayBufferView:a.bufferView,mipLevels:o},sampler:s}):new JD({context:e,source:a,sampler:s});const u=this._textures[n];Object(l.a)(u)&&u!==this._defaultTexture&&u.destroy(),this._textures[n]=c;const h=n+"Dimensions";if(this.uniforms.hasOwnProperty(h)){const e=this.uniforms[h];e.x=c._width,e.y=c._height}}i.length=0;const o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){const i=o[t];n=i.id;const r=i.images,a=new XD({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]},sampler:new WD({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=a}o.length=0;const a=this._updateFunctions;for(r=a.length,t=0;t<r;++t)a[t](this,e);const s=this.materials;for(const t in s)s.hasOwnProperty(t)&&s[t].update(e)},mR.prototype.isDestroyed=function(){return!1},mR.prototype.destroy=function(){const e=this._textures;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];n!==this._defaultTexture&&n.destroy()}const t=this.materials;for(const e in t)t.hasOwnProperty(e)&&t[e].destroy();return sc(this)};const bR=["type","materials","uniforms","components","source"],vR=["diffuse","specular","shininess","normal","emission","alpha"];function OR(e,t){const n=t._template.materials;for(const t in n)if(n.hasOwnProperty(t)&&e.indexOf(t)>-1)return!0;return!1}const wR={mat2:Es,mat3:ce,mat4:Me},AR=/\.ktx2$/i;function ER(e,t){const n=e._strict,i=e._template.uniforms,r=i[t],o=function(e){let t=e.type;if(!Object(l.a)(t)){const n=typeof e;if("number"===n)t="float";else if("boolean"===n)t="bool";else if("string"===n||e instanceof Tt.a||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===mR.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===n)if(Array.isArray(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{let n=0;for(const t in e)e.hasOwnProperty(t)&&(n+=1);n>=2&&n<=4?t="vec"+n:6===n&&(t="samplerCube")}}return t}(r);if(!Object(l.a)(o))throw new u.a(`fabric: uniform '${t}' has invalid type.`);let a;if("channels"===o){if(a=TR(e,t,r,!1),0===a&&n)throw new u.a(`strict: shader source does not use channels '${t}'.`)}else{if("sampler2D"===o){const n=t+"Dimensions";(function(e,t,n){return TR(e,t,t,n)})(e,n)>0&&(i[n]={type:"ivec3",x:1,y:1},ER(e,n))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){const n=`uniform ${o} ${t};`;e.shaderSource=n+e.shaderSource}const s=`${t}_${e._count++}`;if(a=TR(e,t,s),1===a&&n)throw new u.a(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=r,"sampler2D"===o)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(function(e){let t;return function(n,i){const r=n.uniforms,o=r[e],a=t!==o,s=!Object(l.a)(o)||o===mR.DefaultImageId;t=o;let c,u,h=n._textures[e];if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(a&&Object(l.a)(h)&&(h!==i.defaultTexture&&h.destroy(),h=void 0),!Object(l.a)(h)||h===i.defaultTexture){const t=new WD({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});return h=new JD({context:i,source:o,sampler:t}),void(n._textures[e]=h)}h.copyFrom({source:o})}else Object(l.a)(h)||(n._textures[e]=i.defaultTexture);return}if(o instanceof JD&&o!==h){n._texturePaths[e]=void 0;const t=n._textures[e];return Object(l.a)(t)&&t!==n._defaultTexture&&t.destroy(),n._textures[e]=o,c=e+"Dimensions",void(r.hasOwnProperty(c)&&(u=r[c],u.x=o._width,u.y=o._height))}if(a&&Object(l.a)(h)&&s&&(h!==n._defaultTexture&&h.destroy(),h=void 0),Object(l.a)(h)||(n._texturePaths[e]=void 0,h=n._textures[e]=n._defaultTexture,c=e+"Dimensions",r.hasOwnProperty(c)&&(u=r[c],u.x=h._width,u.y=h._height)),s)return;const d=o instanceof Tt.a;if(!Object(l.a)(n._texturePaths[e])||d&&o.url!==n._texturePaths[e].url||!d&&o!==n._texturePaths[e]){if("string"==typeof o||d){const t=d?o:Tt.a.createIfNeeded(o);let i;i=AR.test(t.url)?sE(t.url):t.fetchImage(),Promise.resolve(i).then((function(t){n._loadedImages.push({id:e,image:t})})).catch((function(){Object(l.a)(h)&&h!==n._defaultTexture&&h.destroy(),n._textures[e]=n._defaultTexture}))}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:o});n._texturePaths[e]=o}}}(t));else if("samplerCube"===o)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(function(e){return function(t,n){const i=t.uniforms[e];if(i instanceof XD){const n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=i)}if(Object(l.a)(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===mR.DefaultCubeMapId)return;const r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r!==t._texturePaths[e]){const n=[Tt.a.createIfNeeded(i.positiveX).fetchImage(),Tt.a.createIfNeeded(i.negativeX).fetchImage(),Tt.a.createIfNeeded(i.positiveY).fetchImage(),Tt.a.createIfNeeded(i.negativeY).fetchImage(),Tt.a.createIfNeeded(i.positiveZ).fetchImage(),Tt.a.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(n).then((function(n){t._loadedCubeMaps.push({id:e,images:n})})),t._texturePaths[e]=r}}}(t));else if(-1!==o.indexOf("mat")){const n=new wR[o];e._uniforms[s]=function(){return wR[o].fromColumnMajorArray(e.uniforms[t],n)}}else e._uniforms[s]=function(){return e.uniforms[t]}}}function TR(e,t,n,i){i=Object(c.a)(i,!0);let r=0;const o=new RegExp(`([\\w${i?".":""}])?`+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(o,(function(e,t,i){return t||i?e:(r+=1,n)})),r}mR._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},mR.DefaultImageId="czm_defaultImage",mR.DefaultCubeMapId="czm_defaultCubeMap",mR.ColorType="Color",mR._materialCache.addMaterial(mR.ColorType,{fabric:{type:mR.ColorType,uniforms:{color:new sp(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),mR.ImageType="Image",mR._materialCache.addMaterial(mR.ImageType,{fabric:{type:mR.ImageType,uniforms:{image:mR.DefaultImageId,repeat:new Vt(1,1),color:new sp(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),mR.DiffuseMapType="DiffuseMap",mR._materialCache.addMaterial(mR.DiffuseMapType,{fabric:{type:mR.DiffuseMapType,uniforms:{image:mR.DefaultImageId,channels:"rgb",repeat:new Vt(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),mR.AlphaMapType="AlphaMap",mR._materialCache.addMaterial(mR.AlphaMapType,{fabric:{type:mR.AlphaMapType,uniforms:{image:mR.DefaultImageId,channel:"a",repeat:new Vt(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),mR.SpecularMapType="SpecularMap",mR._materialCache.addMaterial(mR.SpecularMapType,{fabric:{type:mR.SpecularMapType,uniforms:{image:mR.DefaultImageId,channel:"r",repeat:new Vt(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),mR.EmissionMapType="EmissionMap",mR._materialCache.addMaterial(mR.EmissionMapType,{fabric:{type:mR.EmissionMapType,uniforms:{image:mR.DefaultImageId,channels:"rgb",repeat:new Vt(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),mR.BumpMapType="BumpMap",mR._materialCache.addMaterial(mR.BumpMapType,{fabric:{type:mR.BumpMapType,uniforms:{image:mR.DefaultImageId,channel:"r",strength:.8,repeat:new Vt(1,1)},source:$D},translucent:!1}),mR.NormalMapType="NormalMap",mR._materialCache.addMaterial(mR.NormalMapType,{fabric:{type:mR.NormalMapType,uniforms:{image:mR.DefaultImageId,channels:"rgb",strength:.8,repeat:new Vt(1,1)},source:aR},translucent:!1}),mR.GridType="Grid",mR._materialCache.addMaterial(mR.GridType,{fabric:{type:mR.GridType,uniforms:{color:new sp(0,1,0,1),cellAlpha:.1,lineCount:new Vt(8,8),lineThickness:new Vt(1,1),lineOffset:new Vt(0,0)},source:oR},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),mR.StripeType="Stripe",mR._materialCache.addMaterial(mR.StripeType,{fabric:{type:mR.StripeType,uniforms:{horizontal:!0,evenColor:new sp(1,1,1,.5),oddColor:new sp(0,0,1,.5),offset:0,repeat:5},source:fR},translucent:function(e){const t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),mR.CheckerboardType="Checkerboard",mR._materialCache.addMaterial(mR.CheckerboardType,{fabric:{type:mR.CheckerboardType,uniforms:{lightColor:new sp(1,1,1,.5),darkColor:new sp(0,0,0,.5),repeat:new Vt(5,5)},source:QD},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),mR.DotType="Dot",mR._materialCache.addMaterial(mR.DotType,{fabric:{type:mR.DotType,uniforms:{lightColor:new sp(1,1,0,.75),darkColor:new sp(0,1,1,.75),repeat:new Vt(5,5)},source:eR},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),mR.WaterType="Water",mR._materialCache.addMaterial(mR.WaterType,{fabric:{type:mR.WaterType,uniforms:{baseWaterColor:new sp(.2,.3,.6,1),blendColor:new sp(0,1,.699,1),specularMap:mR.DefaultImageId,normalMap:mR.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:pR},translucent:function(e){const t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),mR.RimLightingType="RimLighting",mR._materialCache.addMaterial(mR.RimLightingType,{fabric:{type:mR.RimLightingType,uniforms:{color:new sp(1,0,0,.7),rimColor:new sp(1,1,1,.4),width:.3},source:hR},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),mR.FadeType="Fade",mR._materialCache.addMaterial(mR.FadeType,{fabric:{type:mR.FadeType,uniforms:{fadeInColor:new sp(1,0,0,1),fadeOutColor:new sp(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new Vt(.5,.5)},source:rR},translucent:function(e){const t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),mR.PolylineArrowType="PolylineArrow",mR._materialCache.addMaterial(mR.PolylineArrowType,{fabric:{type:mR.PolylineArrowType,uniforms:{color:new sp(1,1,1,1)},source:sR},translucent:!0}),mR.PolylineDashType="PolylineDash",mR._materialCache.addMaterial(mR.PolylineDashType,{fabric:{type:mR.PolylineDashType,uniforms:{color:new sp(1,0,1,1),gapColor:new sp(0,0,0,0),dashLength:16,dashPattern:255},source:cR},translucent:!0}),mR.PolylineGlowType="PolylineGlow",mR._materialCache.addMaterial(mR.PolylineGlowType,{fabric:{type:mR.PolylineGlowType,uniforms:{color:new sp(0,.5,1,1),glowPower:.25,taperPower:1},source:lR},translucent:!0}),mR.PolylineOutlineType="PolylineOutline",mR._materialCache.addMaterial(mR.PolylineOutlineType,{fabric:{type:mR.PolylineOutlineType,uniforms:{color:new sp(1,1,1,1),outlineColor:new sp(1,0,0,1),outlineWidth:1},source:uR},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),mR.ElevationContourType="ElevationContour",mR._materialCache.addMaterial(mR.ElevationContourType,{fabric:{type:mR.ElevationContourType,uniforms:{spacing:100,color:new sp(1,0,0,1),width:1},source:nR},translucent:!1}),mR.ElevationRampType="ElevationRamp",mR._materialCache.addMaterial(mR.ElevationRampType,{fabric:{type:mR.ElevationRampType,uniforms:{image:mR.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:iR},translucent:!1}),mR.SlopeRampMaterialType="SlopeRamp",mR._materialCache.addMaterial(mR.SlopeRampMaterialType,{fabric:{type:mR.SlopeRampMaterialType,uniforms:{image:mR.DefaultImageId},source:dR},translucent:!1}),mR.AspectRampMaterialType="AspectRamp",mR._materialCache.addMaterial(mR.AspectRampMaterialType,{fabric:{type:mR.AspectRampMaterialType,uniforms:{image:mR.DefaultImageId},source:ZD},translucent:!1}),mR.ElevationBandType="ElevationBand",mR._materialCache.addMaterial(mR.ElevationBandType,{fabric:{type:mR.ElevationBandType,uniforms:{heights:mR.DefaultImageId,colors:mR.DefaultImageId},source:tR},translucent:!0});var CR=mR;function xR(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.translucent,!0),n=Object(c.a)(e.closed,!1),i=Object(c.a)(e.materialSupport,xR.MaterialSupport.TEXTURED);this.material=Object(l.a)(e.material)?e.material:CR.fromType(CR.ColorType),this.translucent=t,this._vertexShaderSource=Object(c.a)(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=Object(c.a)(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=RD.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=Object(c.a)(e.flat,!1),this._faceForward=Object(c.a)(e.faceForward,!n)}Object.defineProperties(xR.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),xR.prototype.getFragmentShaderSource=RD.prototype.getFragmentShaderSource,xR.prototype.isTranslucent=RD.prototype.isTranslucent,xR.prototype.getRenderState=RD.prototype.getRenderState,xR.MaterialSupport={BASIC:Object.freeze({vertexFormat:nu.POSITION_AND_NORMAL,vertexShaderSource:vD,fragmentShaderSource:bD}),TEXTURED:Object.freeze({vertexFormat:nu.POSITION_NORMAL_AND_ST,vertexShaderSource:wD,fragmentShaderSource:OD}),ALL:Object.freeze({vertexFormat:nu.ALL,vertexShaderSource:yD,fragmentShaderSource:_D})};var SR=xR,IR="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\n\nvoid main()\n{\n    vec3 positionToEyeEC = -v_positionEC;\n\n    vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n    vec4 color = czm_gammaCorrect(v_color);\n\n    czm_materialInput materialInput;\n    materialInput.normalEC = normalEC;\n    materialInput.positionToEyeEC = positionToEyeEC;\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    material.diffuse = color.rgb;\n    material.alpha = color.a;\n\n    gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\n",PR="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\n\nvoid main()\n{\n    vec4 p = czm_computePosition();\n\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;      // position in eye coordinates\n    v_normalEC = czm_normal * normal;                         // normal in eye coordinates\n    v_color = color;\n\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",DR="varying vec4 v_color;\n\nvoid main()\n{\n    gl_FragColor = czm_gammaCorrect(v_color);\n}\n",RR="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\n\nvarying vec4 v_color;\n\nvoid main()\n{\n    vec4 p = czm_computePosition();\n\n    v_color = color;\n\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function jR(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.translucent,!0),n=Object(c.a)(e.closed,!1),i=Object(c.a)(e.flat,!1),r=i?RR:PR,o=i?DR:IR,a=i?jR.FLAT_VERTEX_FORMAT:jR.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=Object(c.a)(e.vertexShaderSource,r),this._fragmentShaderSource=Object(c.a)(e.fragmentShaderSource,o),this._renderState=RD.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=Object(c.a)(e.faceForward,!n)}Object.defineProperties(jR.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),jR.VERTEX_FORMAT=nu.POSITION_AND_NORMAL,jR.FLAT_VERTEX_FORMAT=nu.POSITION_ONLY,jR.prototype.getFragmentShaderSource=RD.prototype.getFragmentShaderSource,jR.prototype.isTranslucent=RD.prototype.isTranslucent,jR.prototype.getRenderState=RD.prototype.getRenderState;var MR=jR;function LR(e){this._definitionChanged=new un.a,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(LR.prototype,{isConstant:{get:function(){return JP.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:VP("color")}),LR.prototype.getType=function(e){return"Color"},LR.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.color=JP.getValueOrClonedDefault(this._color,e,sp.WHITE,t.color),t},LR.prototype.equals=function(e){return this===e||e instanceof LR&&JP.equals(this._color,e._color)};var NR=LR;const BR=1,FR=2,zR=4,kR=8,UR=16,VR=32,HR=64,GR=128;function qR(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=Object(c.a)(e.primitiveType,zl.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=Object(c.a)(e.offset,0),this._instanceCount=Object(c.a)(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._flags=0,this.cull=Object(c.a)(e.cull,!0),this.occlude=Object(c.a)(e.occlude,!0),this.executeInClosestFrustum=Object(c.a)(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.castShadows=Object(c.a)(e.castShadows,!1),this.receiveShadows=Object(c.a)(e.receiveShadows,!1),this.pickOnly=Object(c.a)(e.pickOnly,!1),this.depthForTranslucentClassification=Object(c.a)(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function WR(e,t){return(e._flags&t)===t}function YR(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(qR.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return WR(this,BR)},set:function(e){WR(this,BR)!==e&&(YR(this,BR,e),this.dirty=!0)}},occlude:{get:function(){return WR(this,FR)},set:function(e){WR(this,FR)!==e&&(YR(this,FR,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return WR(this,UR)},set:function(e){WR(this,UR)!==e&&(YR(this,UR,e),this.dirty=!0)}},receiveShadows:{get:function(){return WR(this,VR)},set:function(e){WR(this,VR)!==e&&(YR(this,VR,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return WR(this,zR)},set:function(e){WR(this,zR)!==e&&(YR(this,zR,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return WR(this,kR)},set:function(e){WR(this,kR)!==e&&(YR(this,kR,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return WR(this,HR)},set:function(e){WR(this,HR)!==e&&(YR(this,HR,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return WR(this,GR)},set:function(e){WR(this,GR)!==e&&(YR(this,GR,e),this.dirty=!0)}}}),qR.shallowClone=function(e,t){if(Object(l.a)(e))return Object(l.a)(t)||(t=new qR),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t},qR.prototype.execute=function(e,t){e.draw(this,t)};var XR=qR;var KR=Object.freeze({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,OVERLAY:9,NUMBER_OF_PASSES:10});var JR=function e(t){if("object"!=typeof t||null===t)return t;let n;const i=Object.keys(t);for(let r=0;r<i.length;r++)n=i[r],t.hasOwnProperty(n)&&"_applyFunctions"!==n&&(t[n]=e(t[n]));return Object.freeze(t)};function ZR(e){return e===ps.FUNC_ADD||e===ps.FUNC_SUBTRACT||e===ps.FUNC_REVERSE_SUBTRACT||e===ps.MIN||e===ps.MAX}function $R(e){return e===ps.ZERO||e===ps.ONE||e===ps.SRC_COLOR||e===ps.ONE_MINUS_SRC_COLOR||e===ps.DST_COLOR||e===ps.ONE_MINUS_DST_COLOR||e===ps.SRC_ALPHA||e===ps.ONE_MINUS_SRC_ALPHA||e===ps.DST_ALPHA||e===ps.ONE_MINUS_DST_ALPHA||e===ps.CONSTANT_COLOR||e===ps.ONE_MINUS_CONSTANT_COLOR||e===ps.CONSTANT_ALPHA||e===ps.ONE_MINUS_CONSTANT_ALPHA||e===ps.SRC_ALPHA_SATURATE}function QR(e){return e===ps.NEVER||e===ps.LESS||e===ps.EQUAL||e===ps.LEQUAL||e===ps.GREATER||e===ps.NOTEQUAL||e===ps.GEQUAL||e===ps.ALWAYS}function ej(e){return e===ps.ZERO||e===ps.KEEP||e===ps.REPLACE||e===ps.INCR||e===ps.DECR||e===ps.INVERT||e===ps.INCR_WRAP||e===ps.DECR_WRAP}function tj(e){const t=Object(c.a)(e,c.a.EMPTY_OBJECT),n=Object(c.a)(t.cull,c.a.EMPTY_OBJECT),i=Object(c.a)(t.polygonOffset,c.a.EMPTY_OBJECT),r=Object(c.a)(t.scissorTest,c.a.EMPTY_OBJECT),o=Object(c.a)(r.rectangle,c.a.EMPTY_OBJECT),a=Object(c.a)(t.depthRange,c.a.EMPTY_OBJECT),s=Object(c.a)(t.depthTest,c.a.EMPTY_OBJECT),h=Object(c.a)(t.colorMask,c.a.EMPTY_OBJECT),d=Object(c.a)(t.blending,c.a.EMPTY_OBJECT),f=Object(c.a)(d.color,c.a.EMPTY_OBJECT),p=Object(c.a)(t.stencilTest,c.a.EMPTY_OBJECT),m=Object(c.a)(p.frontOperation,c.a.EMPTY_OBJECT),g=Object(c.a)(p.backOperation,c.a.EMPTY_OBJECT),_=Object(c.a)(t.sampleCoverage,c.a.EMPTY_OBJECT),y=t.viewport;if(this.frontFace=Object(c.a)(t.frontFace,Mp.COUNTER_CLOCKWISE),this.cull={enabled:Object(c.a)(n.enabled,!1),face:Object(c.a)(n.face,ps.BACK)},this.lineWidth=Object(c.a)(t.lineWidth,1),this.polygonOffset={enabled:Object(c.a)(i.enabled,!1),factor:Object(c.a)(i.factor,0),units:Object(c.a)(i.units,0)},this.scissorTest={enabled:Object(c.a)(r.enabled,!1),rectangle:Nl.clone(o)},this.depthRange={near:Object(c.a)(a.near,0),far:Object(c.a)(a.far,1)},this.depthTest={enabled:Object(c.a)(s.enabled,!1),func:Object(c.a)(s.func,ps.LESS)},this.colorMask={red:Object(c.a)(h.red,!0),green:Object(c.a)(h.green,!0),blue:Object(c.a)(h.blue,!0),alpha:Object(c.a)(h.alpha,!0)},this.depthMask=Object(c.a)(t.depthMask,!0),this.stencilMask=Object(c.a)(t.stencilMask,-1),this.blending={enabled:Object(c.a)(d.enabled,!1),color:new sp(Object(c.a)(f.red,0),Object(c.a)(f.green,0),Object(c.a)(f.blue,0),Object(c.a)(f.alpha,0)),equationRgb:Object(c.a)(d.equationRgb,ps.FUNC_ADD),equationAlpha:Object(c.a)(d.equationAlpha,ps.FUNC_ADD),functionSourceRgb:Object(c.a)(d.functionSourceRgb,ps.ONE),functionSourceAlpha:Object(c.a)(d.functionSourceAlpha,ps.ONE),functionDestinationRgb:Object(c.a)(d.functionDestinationRgb,ps.ZERO),functionDestinationAlpha:Object(c.a)(d.functionDestinationAlpha,ps.ZERO)},this.stencilTest={enabled:Object(c.a)(p.enabled,!1),frontFunction:Object(c.a)(p.frontFunction,ps.ALWAYS),backFunction:Object(c.a)(p.backFunction,ps.ALWAYS),reference:Object(c.a)(p.reference,0),mask:Object(c.a)(p.mask,-1),frontOperation:{fail:Object(c.a)(m.fail,ps.KEEP),zFail:Object(c.a)(m.zFail,ps.KEEP),zPass:Object(c.a)(m.zPass,ps.KEEP)},backOperation:{fail:Object(c.a)(g.fail,ps.KEEP),zFail:Object(c.a)(g.zFail,ps.KEEP),zPass:Object(c.a)(g.zPass,ps.KEEP)}},this.sampleCoverage={enabled:Object(c.a)(_.enabled,!1),value:Object(c.a)(_.value,1),invert:Object(c.a)(_.invert,!1)},this.viewport=Object(l.a)(y)?new Nl(y.x,y.y,y.width,y.height):void 0,this.lineWidth<MD.minimumAliasedLineWidth||this.lineWidth>MD.maximumAliasedLineWidth)throw new u.a("renderState.lineWidth is out of range.  Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!Mp.validate(this.frontFace))throw new u.a("Invalid renderState.frontFace.");if((b=this.cull.face)!==ps.FRONT&&b!==ps.BACK&&b!==ps.FRONT_AND_BACK)throw new u.a("Invalid renderState.cull.face.");var b,v;if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new u.a("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new u.a("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new u.a("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new u.a("renderState.depthRange.far must be less than or equal to one.");if((v=this.depthTest.func)!==ps.NEVER&&v!==ps.LESS&&v!==ps.EQUAL&&v!==ps.LEQUAL&&v!==ps.GREATER&&v!==ps.NOTEQUAL&&v!==ps.GEQUAL&&v!==ps.ALWAYS)throw new u.a("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new u.a("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!ZR(this.blending.equationRgb))throw new u.a("Invalid renderState.blending.equationRgb.");if(!ZR(this.blending.equationAlpha))throw new u.a("Invalid renderState.blending.equationAlpha.");if(!$R(this.blending.functionSourceRgb))throw new u.a("Invalid renderState.blending.functionSourceRgb.");if(!$R(this.blending.functionSourceAlpha))throw new u.a("Invalid renderState.blending.functionSourceAlpha.");if(!$R(this.blending.functionDestinationRgb))throw new u.a("Invalid renderState.blending.functionDestinationRgb.");if(!$R(this.blending.functionDestinationAlpha))throw new u.a("Invalid renderState.blending.functionDestinationAlpha.");if(!QR(this.stencilTest.frontFunction))throw new u.a("Invalid renderState.stencilTest.frontFunction.");if(!QR(this.stencilTest.backFunction))throw new u.a("Invalid renderState.stencilTest.backFunction.");if(!ej(this.stencilTest.frontOperation.fail))throw new u.a("Invalid renderState.stencilTest.frontOperation.fail.");if(!ej(this.stencilTest.frontOperation.zFail))throw new u.a("Invalid renderState.stencilTest.frontOperation.zFail.");if(!ej(this.stencilTest.frontOperation.zPass))throw new u.a("Invalid renderState.stencilTest.frontOperation.zPass.");if(!ej(this.stencilTest.backOperation.fail))throw new u.a("Invalid renderState.stencilTest.backOperation.fail.");if(!ej(this.stencilTest.backOperation.zFail))throw new u.a("Invalid renderState.stencilTest.backOperation.zFail.");if(!ej(this.stencilTest.backOperation.zPass))throw new u.a("Invalid renderState.stencilTest.backOperation.zPass.");if(Object(l.a)(this.viewport)){if(this.viewport.width<0)throw new u.a("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new u.a("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>MD.maximumViewportWidth)throw new u.a(`renderState.viewport.width must be less than or equal to the maximum viewport width (${MD.maximumViewportWidth.toString()}).  Check maximumViewportWidth.`);if(this.viewport.height>MD.maximumViewportHeight)throw new u.a(`renderState.viewport.height must be less than or equal to the maximum viewport height (${MD.maximumViewportHeight.toString()}).  Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let nj=0,ij={};function rj(e,t,n){n?e.enable(t):e.disable(t)}function oj(e,t){e.frontFace(t.frontFace)}function aj(e,t){const n=t.cull,i=n.enabled;rj(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function sj(e,t){e.lineWidth(t.lineWidth)}function cj(e,t){const n=t.polygonOffset,i=n.enabled;rj(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function lj(e,t,n){const i=t.scissorTest,r=Object(l.a)(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(rj(e,e.SCISSOR_TEST,r),r){const t=Object(l.a)(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(t.x,t.y,t.width,t.height)}}function uj(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function hj(e,t){const n=t.depthTest,i=n.enabled;rj(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function dj(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function fj(e,t){e.depthMask(t.depthMask)}function pj(e,t){e.stencilMask(t.stencilMask)}function mj(e,t,n){const i=t.blending,r=Object(l.a)(n.blendingEnabled)?n.blendingEnabled:i.enabled;rj(e,e.BLEND,r),r&&(!function(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function gj(e,t){const n=t.stencilTest,i=n.enabled;if(rj(e,e.STENCIL_TEST,i),i){const t=n.frontFunction,i=n.backFunction,r=n.reference,o=n.mask;e.stencilFunc(t,r,o),e.stencilFuncSeparate(e.BACK,i,r,o),e.stencilFuncSeparate(e.FRONT,t,r,o);const a=n.frontOperation,s=a.fail,c=a.zFail,l=a.zPass;e.stencilOpSeparate(e.FRONT,s,c,l);const u=n.backOperation,h=u.fail,d=u.zFail,f=u.zPass;e.stencilOpSeparate(e.BACK,h,d,f)}}function _j(e,t){const n=t.sampleCoverage,i=n.enabled;rj(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}tj.fromCache=function(e){const t=JSON.stringify(e);let n=ij[t];if(Object(l.a)(n))return++n.referenceCount,n.state;let i=new tj(e);const r=JSON.stringify(i);return n=ij[r],Object(l.a)(n)||(i.id=nj++,i=JR(i),n={referenceCount:0,state:i},ij[r]=n),++n.referenceCount,ij[t]={referenceCount:1,state:n.state},n.state},tj.removeFromCache=function(e){const t=new tj(e),n=JSON.stringify(t),i=ij[n],r=JSON.stringify(e),o=ij[r];Object(l.a)(o)&&(--o.referenceCount,0===o.referenceCount&&(delete ij[r],Object(l.a)(i)&&--i.referenceCount)),Object(l.a)(i)&&0===i.referenceCount&&delete ij[n]},tj.getCache=function(){return ij},tj.clearCache=function(){ij={}};const yj=new Nl;function bj(e,t,n){let i=Object(c.a)(t.viewport,n.viewport);Object(l.a)(i)||(i=yj,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}tj.apply=function(e,t,n){oj(e,t),aj(e,t),sj(e,t),cj(e,t),uj(e,t),hj(e,t),dj(e,t),fj(e,t),pj(e,t),gj(e,t),_j(e,t),lj(e,t,n),mj(e,t,n),bj(e,t,n)},tj.partialApply=function(e,t,n,i,r,o){if(t!==n){let i=n._applyFunctions[t.id];Object(l.a)(i)||(i=function(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(oj),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||n.push(aj),e.lineWidth!==t.lineWidth&&n.push(sj),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||n.push(cj),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||n.push(uj),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||n.push(hj),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||n.push(dj),e.depthMask!==t.depthMask&&n.push(fj),e.stencilMask!==t.stencilMask&&n.push(pj),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||n.push(gj),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||n.push(_j),n}(t,n),n._applyFunctions[t.id]=i);const r=i.length;for(let t=0;t<r;++t)i[t](e,n)}((Object(l.a)(i.scissorTest)?i.scissorTest:t.scissorTest)!==(Object(l.a)(r.scissorTest)?r.scissorTest:n.scissorTest)||o)&&lj(e,n,r);const a=Object(l.a)(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,s=Object(l.a)(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(a!==s||s&&t.blending!==n.blending)&&mj(e,n,r),t===n&&i===r&&i.context===r.context||bj(e,n,r)},tj.getState=function(e){if(!Object(l.a)(e))throw new u.a("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Nl.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:sp.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:Object(l.a)(e.viewport)?Nl.clone(e.viewport):void 0}};var vj=tj;const Oj=new O;function wj(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const Aj={};Aj[ps.FLOAT]="float",Aj[ps.FLOAT_VEC2]="vec2",Aj[ps.FLOAT_VEC3]="vec3",Aj[ps.FLOAT_VEC4]="vec4",Aj[ps.INT]="int",Aj[ps.INT_VEC2]="ivec2",Aj[ps.INT_VEC3]="ivec3",Aj[ps.INT_VEC4]="ivec4",Aj[ps.BOOL]="bool",Aj[ps.BOOL_VEC2]="bvec2",Aj[ps.BOOL_VEC3]="bvec3",Aj[ps.BOOL_VEC4]="bvec4",Aj[ps.FLOAT_MAT2]="mat2",Aj[ps.FLOAT_MAT3]="mat3",Aj[ps.FLOAT_MAT4]="mat4",Aj[ps.SAMPLER_2D]="sampler2D",Aj[ps.SAMPLER_CUBE]="samplerCube",wj.prototype.getDeclaration=function(e){let t=`uniform ${Aj[this._datatype]} ${e}`;const n=this._size;return t+=1===n?";":`[${n.toString()}];`,t};var Ej={czm_viewport:new wj({size:1,datatype:ps.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new wj({size:1,datatype:ps.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new wj({size:1,datatype:ps.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new wj({size:1,datatype:ps.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new wj({size:1,datatype:ps.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new wj({size:1,datatype:ps.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new wj({size:1,datatype:ps.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return Me.getTranslation(e.inverseView,Oj)}}),czm_frameNumber:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new wj({size:1,datatype:ps.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new wj({size:1,datatype:ps.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new wj({size:1,datatype:ps.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new wj({size:1,datatype:ps.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new wj({size:1,datatype:ps.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new wj({size:9,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new wj({size:1,datatype:ps.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.fogDensity}}),czm_splitPosition:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new wj({size:1,datatype:ps.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new wj({size:1,datatype:ps.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new wj({size:1,datatype:ps.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};function Tj(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}function Cj(e,t,n,i){this.name=n,this.value=void 0,this._value=new Vt,this._gl=e,this._location=i}function xj(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function Sj(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function Ij(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}function Pj(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}function Dj(e,t,n,i){this.name=n,this.value=void 0,this._value=new Vt,this._gl=e,this._location=i}function Rj(e,t,n,i){this.name=n,this.value=void 0,this._value=new O,this._gl=e,this._location=i}function jj(e,t,n,i){this.name=n,this.value=void 0,this._value=new _e,this._gl=e,this._location=i}Tj.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},Cj.prototype.set=function(){const e=this.value;Vt.equals(e,this._value)||(Vt.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))},xj.prototype.set=function(){const e=this.value;if(Object(l.a)(e.red))sp.equals(e,this._value)||(this._value=sp.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else{if(!Object(l.a)(e.x))throw new u.a(`Invalid vec3 value for uniform "${this.name}".`);O.equals(e,this._value)||(this._value=O.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))}},Sj.prototype.set=function(){const e=this.value;if(Object(l.a)(e.red))sp.equals(e,this._value)||(this._value=sp.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else{if(!Object(l.a)(e.x))throw new u.a(`Invalid vec4 value for uniform "${this.name}".`);_e.equals(e,this._value)||(this._value=_e.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w))}},Ij.prototype.set=function(){const e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);const t=this.value;e.bindTexture(t._target,t._texture)},Ij.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},Pj.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},Dj.prototype.set=function(){const e=this.value;Vt.equals(e,this._value)||(Vt.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))},Rj.prototype.set=function(){const e=this.value;O.equals(e,this._value)||(O.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},jj.prototype.set=function(){const e=this.value;_e.equals(e,this._value)||(_e.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};const Mj=new Float32Array(4);function Lj(e,t,n,i){this.name=n,this.value=void 0,this._value=new Es,this._gl=e,this._location=i}Lj.prototype.set=function(){if(!Es.equalsArray(this.value,this._value,0)){Es.clone(this.value,this._value);const e=Es.toArray(this.value,Mj);this._gl.uniformMatrix2fv(this._location,!1,e)}};const Nj=new Float32Array(9);function Bj(e,t,n,i){this.name=n,this.value=void 0,this._value=new ce,this._gl=e,this._location=i}Bj.prototype.set=function(){if(!ce.equalsArray(this.value,this._value,0)){ce.clone(this.value,this._value);const e=ce.toArray(this.value,Nj);this._gl.uniformMatrix3fv(this._location,!1,e)}};const Fj=new Float32Array(16);function zj(e,t,n,i){this.name=n,this.value=void 0,this._value=new Me,this._gl=e,this._location=i}zj.prototype.set=function(){if(!Me.equalsArray(this.value,this._value,0)){Me.clone(this.value,this._value);const e=Me.toArray(this.value,Fj);this._gl.uniformMatrix4fv(this._location,!1,e)}};var kj=function(e,t,n,i){switch(t.type){case e.FLOAT:return new Tj(e,t,n,i);case e.FLOAT_VEC2:return new Cj(e,t,n,i);case e.FLOAT_VEC3:return new xj(e,t,n,i);case e.FLOAT_VEC4:return new Sj(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new Ij(e,t,n,i);case e.INT:case e.BOOL:return new Pj(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Dj(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Rj(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new jj(e,t,n,i);case e.FLOAT_MAT2:return new Lj(e,t,n,i);case e.FLOAT_MAT3:return new Bj(e,t,n,i);case e.FLOAT_MAT4:return new zj(e,t,n,i);default:throw new ye.a(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}};function Uj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._location=i[0]}function Vj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(2*r),this._gl=e,this._location=i[0]}function Hj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(3*r),this._gl=e,this._location=i[0]}function Gj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(4*r),this._gl=e,this._location=i[0]}function qj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(r),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}function Wj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(r),this._gl=e,this._location=i[0]}function Yj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(2*r),this._gl=e,this._location=i[0]}function Xj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(3*r),this._gl=e,this._location=i[0]}function Kj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Int32Array(4*r),this._gl=e,this._location=i[0]}function Jj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(4*r),this._gl=e,this._location=i[0]}function Zj(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(9*r),this._gl=e,this._location=i[0]}function $j(e,t,n,i){const r=i.length;this.name=n,this.value=new Array(r),this._value=new Float32Array(16*r),this._gl=e,this._location=i[0]}Uj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let r=0;r<t;++r){const t=e[r];t!==n[r]&&(n[r]=t,i=!0)}i&&this._gl.uniform1fv(this._location,n)},Vj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];Vt.equalsArray(t,n,r)||(Vt.pack(t,n,r),i=!0),r+=2}i&&this._gl.uniform2fv(this._location,n)},Hj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];if(Object(l.a)(t.red))t.red===n[r]&&t.green===n[r+1]&&t.blue===n[r+2]||(n[r]=t.red,n[r+1]=t.green,n[r+2]=t.blue,i=!0);else{if(!Object(l.a)(t.x))throw new u.a("Invalid vec3 value.");O.equalsArray(t,n,r)||(O.pack(t,n,r),i=!0)}r+=3}i&&this._gl.uniform3fv(this._location,n)},Gj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];if(Object(l.a)(t.red))sp.equalsArray(t,n,r)||(sp.pack(t,n,r),i=!0);else{if(!Object(l.a)(t.x))throw new u.a("Invalid vec4 value.");_e.equalsArray(t,n,r)||(_e.pack(t,n,r),i=!0)}r+=4}i&&this._gl.uniform4fv(this._location,n)},qj.prototype.set=function(){const e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let r=0;r<i;++r){const i=n[r];e.activeTexture(t+r),e.bindTexture(i._target,i._texture)}},qj.prototype._setSampler=function(e){this.textureUnitIndex=e;const t=this._locations,n=t.length;for(let i=0;i<n;++i){const n=e+i;this._gl.uniform1i(t[i],n)}return e+n},Wj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let r=0;r<t;++r){const t=e[r];t!==n[r]&&(n[r]=t,i=!0)}i&&this._gl.uniform1iv(this._location,n)},Yj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];Vt.equalsArray(t,n,r)||(Vt.pack(t,n,r),i=!0),r+=2}i&&this._gl.uniform2iv(this._location,n)},Xj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];O.equalsArray(t,n,r)||(O.pack(t,n,r),i=!0),r+=3}i&&this._gl.uniform3iv(this._location,n)},Kj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];_e.equalsArray(t,n,r)||(_e.pack(t,n,r),i=!0),r+=4}i&&this._gl.uniform4iv(this._location,n)},Jj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];Es.equalsArray(t,n,r)||(Es.pack(t,n,r),i=!0),r+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)},Zj.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];ce.equalsArray(t,n,r)||(ce.pack(t,n,r),i=!0),r+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)},$j.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,r=0;for(let o=0;o<t;++o){const t=e[o];Me.equalsArray(t,n,r)||(Me.pack(t,n,r),i=!0),r+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var Qj=function(e,t,n,i){switch(t.type){case e.FLOAT:return new Uj(e,t,n,i);case e.FLOAT_VEC2:return new Vj(e,t,n,i);case e.FLOAT_VEC3:return new Hj(e,t,n,i);case e.FLOAT_VEC4:return new Gj(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new qj(e,t,n,i);case e.INT:case e.BOOL:return new Wj(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Yj(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Xj(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Kj(e,t,n,i);case e.FLOAT_MAT2:return new Jj(e,t,n,i);case e.FLOAT_MAT3:return new Zj(e,t,n,i);case e.FLOAT_MAT4:return new $j(e,t,n,i);default:throw new ye.a(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}};let eM=0;function tM(e){let t=e.vertexShaderText,n=e.fragmentShaderText;"undefined"!=typeof spector&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));const i=function(e,t){const n={};if(!MD.highpFloatSupported||!MD.highpIntSupported){let i,r,o,a;const s=nM(e),c=nM(t),l=s.length,u=c.length;for(i=0;i<l;i++)for(r=0;r<u;r++)if(s[i]===c[r]){o=s[i],a="czm_mediump_"+o;const e=new RegExp(o+"\\b","g");t=t.replace(e,a),n[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=eM++}function nM(e){const t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(Object(l.a)(n)){const e=n.length;for(let i=0;i<e;i++){const e=n[i].trim(),r=e.slice(e.lastIndexOf(" ")+1);t.push(r)}}return t}tM.fromCache=function(e){return e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},tM.replaceCache=function(e){return e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(tM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return rM(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return rM(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return rM(this),this._uniformsByName}}});const iM="[Cesium WebGL] ";function rM(e){Object(l.a)(e._program)||function e(t){const n=t._program,i=t._gl,r=function(e,t){const n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);const o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);const a=e.createProgram();e.attachShader(a,r),e.attachShader(a,o),e.deleteShader(r),e.deleteShader(o);const s=t._attributeLocations;if(Object(l.a)(s))for(const t in s)s.hasOwnProperty(t)&&e.bindAttribLocation(a,s[t],t);let c;if(e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS)){const n=t._debugShaders;if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(c=e.getShaderInfoLog(o),console.error(`${iM}Fragment shader compile log: ${c}`),Object(l.a)(n)){const e=n.getTranslatedShaderSource(o);""!==e?console.error(`${iM}Translated fragment shader source:\n${e}`):console.error(iM+"Fragment shader translation failed.")}throw e.deleteProgram(a),new ye.a("Fragment shader failed to compile.  Compile log: "+c)}if(!e.getShaderParameter(r,e.COMPILE_STATUS)){if(c=e.getShaderInfoLog(r),console.error(`${iM}Vertex shader compile log: ${c}`),Object(l.a)(n)){const e=n.getTranslatedShaderSource(r);""!==e?console.error(`${iM}Translated vertex shader source:\n${e}`):console.error(iM+"Vertex shader translation failed.")}throw e.deleteProgram(a),new ye.a("Vertex shader failed to compile.  Compile log: "+c)}throw c=e.getProgramInfoLog(a),console.error(`${iM}Shader program link log: ${c}`),Object(l.a)(n)&&(console.error(`${iM}Translated vertex shader source:\n${n.getTranslatedShaderSource(r)}`),console.error(`${iM}Translated fragment shader source:\n${n.getTranslatedShaderSource(o)}`)),e.deleteProgram(a),new ye.a("Program failed to link.  Link log: "+c)}const u=t._logShaderCompilation;return u&&(c=e.getShaderInfoLog(r),Object(l.a)(c)&&c.length>0&&console.log(`${iM}Vertex shader compile log: ${c}`)),u&&(c=e.getShaderInfoLog(o),Object(l.a)(c)&&c.length>0&&console.log(`${iM}Fragment shader compile log: ${c}`)),u&&(c=e.getProgramInfoLog(a),Object(l.a)(c)&&c.length>0&&console.log(`${iM}Shader program link log: ${c}`)),a}(i,t,t._debugShaders),o=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),a=function(e,t){const n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<o;++a){const o=e.getActiveUniform(t,a),s="[0]",c=-1!==o.name.indexOf(s,o.name.length-s.length)?o.name.slice(0,o.name.length-3):o.name;if(0!==c.indexOf("gl_"))if(o.name.indexOf("[")<0){const a=e.getUniformLocation(t,c);if(null!==a){const t=kj(e,o,c,a);n[c]=t,i.push(t),t._setSampler&&r.push(t)}}else{let a,s,u,h;const d=c.indexOf("[");if(d>=0){if(a=n[c.slice(0,d)],!Object(l.a)(a))continue;s=a._locations,s.length<=1&&(u=a.value,h=e.getUniformLocation(t,c),null!==h&&(s.push(h),u.push(e.getUniform(t,h))))}else{s=[];for(let n=0;n<o.size;++n)h=e.getUniformLocation(t,`${c}[${n}]`),null!==h&&s.push(h);a=Qj(e,o,c,s),n[c]=a,i.push(a),a._setSampler&&r.push(a)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}(i,r),s=function(e,t){const n=[],i=[];for(const r in t)if(t.hasOwnProperty(r)){const o=t[r];let a=r;const s=e._duplicateUniformNames[a];Object(l.a)(s)&&(o.name=s,a=s);const c=Ej[a];Object(l.a)(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}(t,a.uniformsByName);t._program=r,t._numberOfVertexAttributes=o,t._vertexAttributes=function(e,t,n){const i={};for(let r=0;r<n;++r){const n=e.getActiveAttrib(t,r),o=e.getAttribLocation(t,n.name);i[n.name]={name:n.name,type:n.type,index:o}}return i}(i,r,o),t._uniformsByName=a.uniformsByName,t._uniforms=a.uniforms,t._automaticUniforms=s.automaticUniforms,t._manualUniforms=s.manualUniforms,t.maximumTextureUnitIndex=function(e,t,n){e.useProgram(t);let i=0;const r=n.length;for(let e=0;e<r;++e)i=n[e]._setSampler(i);return e.useProgram(null),i}(i,r,a.samplerUniforms),n&&t._gl.deleteProgram(n);"undefined"!=typeof spector&&(t._program.__SPECTOR_rebuildProgram=function(n,i,r,o){const a=t._vertexShaderText,s=t._fragmentShaderText,c=/ ! = /g;t._vertexShaderText=n.replace(c," != "),t._fragmentShaderText=i.replace(c," != ");try{e(t),r(t._program)}catch(e){t._vertexShaderText=a,t._fragmentShaderText=s;const n=/(?:Compile|Link) error: ([^]*)/.exec(e.message);o(n?n[1]:e.message)}})}(e)}tM.prototype._bind=function(){rM(this),this._gl.useProgram(this._program)},tM.prototype._setUniforms=function(e,t,n){let i,r;if(Object(l.a)(e)){const t=this._manualUniforms;for(i=t.length,r=0;r<i;++r){const n=t[r];n.value=e[n.name]()}}const o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){const e=o[r];e.uniform.value=e.automaticUniform.getValue(t)}const a=this._uniforms;for(i=a.length,r=0;r<i;++r)a[r].set();if(n){const e=this._gl,t=this._program;if(e.validateProgram(t),!e.getProgramParameter(t,e.VALIDATE_STATUS))throw new u.a("Program validation failed.  Program info log: "+e.getProgramInfoLog(t))}},tM.prototype.isDestroyed=function(){return!1},tM.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},tM.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),sc(this)};var oM=tM;function aM(e,t,n){const i=new RegExp(`(^|[^\\w])(${e})($|[^\\w])`,"g"),r=n.length;for(let e=0;e<r;++e){const r=n[e];n[e]=r.replace(i,`$1${t}$3`)}}function sM(e,t){-1===t.indexOf(e)&&t.push(e)}function cM(e,t,n){!function(e,t,n){const i=n.length;for(let r=0;r<i;++r){const i=n[r];n[r]=i.replace(e,t)}}(new RegExp(`#extension\\s+GL_${e}\\s+:\\s+[a-zA-Z0-9]+\\s*$`,"g"),"",n),aM("GL_"+e,t,n)}var lM=function(e,t){const n=/#define OUTPUT_DECLARATION/,i=e.split("\n");if(/#version 300 es/g.test(e))return e;let r,o,a=-1;for(r=0;r<i.length;++r)if(o=i[r],n.test(o)){a=r;break}if(-1===a)throw new u.a("Could not find a #define OUTPUT_DECLARATION!");const s=[];for(r=0;r<10;r++){const t=`gl_FragData\\[${r}\\]`,n="czm_out"+r;new RegExp(t,"g").test(e)&&(sM(n,s),aM(t,n,i),i.splice(a,0,`layout(location = ${r}) out vec4 ${n};`),a+=1)}(function(e,t){const n=new RegExp(`(^|[^\\w])(${e})($|[^\\w])`,"g"),i=t.length;for(let e=0;e<i;++e){const i=t[e];if(n.test(i))return!0}return!1})("gl_FragColor",i)&&(sM("czm_fragColor",s),aM("gl_FragColor","czm_fragColor",i),i.splice(a,0,"layout(location = 0) out vec4 czm_fragColor;"),a+=1);const c=function(e,t){const n={},i=e.length,r=[];for(let o=0;o<t.length;++o){const a=t[o],s=/(#ifdef|#if)/g.test(a),c=/#else/g.test(a),u=/#endif/g.test(a);if(s)r.push(a);else if(c){let e=r[r.length-1].replace("ifdef","ifndef");/if/g.test(e)&&(e=e.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),r.pop(),r.push(e)}else if(u)r.pop();else if(!/layout/g.test(a))for(let t=0;t<i;++t){const i=e[t];-1!==a.indexOf(i)&&(Object(l.a)(n[i])?n[i]=n[i].filter((function(e){return r.indexOf(e)>=0})):n[i]=r.slice())}}return n}(s,i),h={};for(r=0;r<i.length;r++){o=i[r];for(const e in c)if(c.hasOwnProperty(e)){new RegExp(`(layout)[^]+(out)[^]+(${e})[^]+`,"g").test(o)&&(h[o]=e)}}for(const e in h)if(h.hasOwnProperty(e)){const t=h[e];let n=i.indexOf(e);const r=c[t],o=r.length;for(let e=0;e<o;e++)i.splice(n,0,r[e]);n+=o+1;for(let e=o-1;e>=0;e--)i.splice(n,0,"#endif //"+r[e])}let d=!1;for(r=0;r<i.length;r++)if(/#version/.test(i[r])){i[r]="#version 300 es",d=!0;break}return d||i.splice(0,0,"#version 300 es"),i.splice(1,0,"#define WEBGL_2"),cM("EXT_draw_buffers","WEBGL_2",i),cM("EXT_frag_depth","WEBGL_2",i),cM("OES_standard_derivatives","WEBGL_2",i),aM("texture2D","texture",i),aM("texture3D","texture",i),aM("textureCube","texture",i),aM("gl_FragDepthEXT","gl_FragDepth",i),t?aM("varying","in",i):(aM("attribute","in",i),aM("varying","out",i)),function(e){let t="";const n=e.length;for(let i=0;i<n;++i)t+=e[i]+"\n";return t}(i)},uM="/**\n * A built-in GLSL floating-point constant for converting radians to degrees.\n *\n * @alias czm_degreesPerRadian\n * @glslConstant\n *\n * @see CesiumMath.DEGREES_PER_RADIAN\n *\n * @example\n * // GLSL declaration\n * const float czm_degreesPerRadian = ...;\n *\n * // Example\n * float deg = czm_degreesPerRadian * rad;\n */\nconst float czm_degreesPerRadian = 57.29577951308232;\n",hM="/**\n * A built-in GLSL vec2 constant for defining the depth range.\n * This is a workaround to a bug where IE11 does not implement gl_DepthRange.\n *\n * @alias czm_depthRange\n * @glslConstant\n *\n * @example\n * // GLSL declaration\n * float depthRangeNear = czm_depthRange.near;\n * float depthRangeFar = czm_depthRange.far;\n *\n */\nconst czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n",dM="/**\n * 0.1\n *\n * @name czm_epsilon1\n * @glslConstant\n */\nconst float czm_epsilon1 = 0.1;\n",fM="/**\n * 0.01\n *\n * @name czm_epsilon2\n * @glslConstant\n */\nconst float czm_epsilon2 = 0.01;\n",pM="/**\n * 0.001\n *\n * @name czm_epsilon3\n * @glslConstant\n */\nconst float czm_epsilon3 = 0.001;\n",mM="/**\n * 0.0001\n *\n * @name czm_epsilon4\n * @glslConstant\n */\nconst float czm_epsilon4 = 0.0001;\n",gM="/**\n * 0.00001\n *\n * @name czm_epsilon5\n * @glslConstant\n */\nconst float czm_epsilon5 = 0.00001;\n",_M="/**\n * 0.000001\n *\n * @name czm_epsilon6\n * @glslConstant\n */\nconst float czm_epsilon6 = 0.000001;\n",yM="/**\n * 0.0000001\n *\n * @name czm_epsilon7\n * @glslConstant\n */\nconst float czm_epsilon7 = 0.0000001;\n",bM="/**\n * DOC_TBA\n *\n * @name czm_infinity\n * @glslConstant\n */\nconst float czm_infinity = 5906376272000.0;  // Distance from the Sun to Pluto in meters.  TODO: What is best given lowp, mediump, and highp?\n",vM="/**\n * A built-in GLSL floating-point constant for <code>1/pi</code>.\n *\n * @alias czm_oneOverPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverPi = ...;\n *\n * // Example\n * float pi = 1.0 / czm_oneOverPi;\n */\nconst float czm_oneOverPi = 0.3183098861837907;\n",OM="/**\n * A built-in GLSL floating-point constant for <code>1/2pi</code>.\n *\n * @alias czm_oneOverTwoPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverTwoPi = ...;\n *\n * // Example\n * float pi = 2.0 * czm_oneOverTwoPi;\n */\nconst float czm_oneOverTwoPi = 0.15915494309189535;\n",wM="/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}\n *\n * @name czm_passCesium3DTile\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTile = 4.0;\n",AM="/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}\n *\n * @name czm_passCesium3DTileClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassification = 5.0;\n",EM="/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}\n *\n * @name czm_passCesium3DTileClassificationIgnoreShow\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n",TM="/**\n * The automatic GLSL constant for {@link Pass#CLASSIFICATION}\n *\n * @name czm_passClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passClassification = 7.0;\n",CM="/**\n * The automatic GLSL constant for {@link Pass#COMPUTE}\n *\n * @name czm_passCompute\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCompute = 1.0;\n",xM="/**\n * The automatic GLSL constant for {@link Pass#ENVIRONMENT}\n *\n * @name czm_passEnvironment\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passEnvironment = 0.0;\n",SM="/**\n * The automatic GLSL constant for {@link Pass#GLOBE}\n *\n * @name czm_passGlobe\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passGlobe = 2.0;\n",IM="/**\n * The automatic GLSL constant for {@link Pass#OPAQUE}\n *\n * @name czm_passOpaque\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOpaque = 7.0;\n",PM="/**\n * The automatic GLSL constant for {@link Pass#OVERLAY}\n *\n * @name czm_passOverlay\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOverlay = 9.0;\n",DM="/**\n * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}\n *\n * @name czm_passTerrainClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTerrainClassification = 3.0;\n",RM="/**\n * The automatic GLSL constant for {@link Pass#TRANSLUCENT}\n *\n * @name czm_passTranslucent\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTranslucent = 8.0;\n",jM="/**\n * A built-in GLSL floating-point constant for <code>Math.PI</code>.\n *\n * @alias czm_pi\n * @glslConstant\n *\n * @see CesiumMath.PI\n *\n * @example\n * // GLSL declaration\n * const float czm_pi = ...;\n *\n * // Example\n * float twoPi = 2.0 * czm_pi;\n */\nconst float czm_pi = 3.141592653589793;\n",MM="/**\n * A built-in GLSL floating-point constant for <code>pi/4</code>.\n *\n * @alias czm_piOverFour\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_FOUR\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverFour = ...;\n *\n * // Example\n * float pi = 4.0 * czm_piOverFour;\n */\nconst float czm_piOverFour = 0.7853981633974483;\n",LM="/**\n * A built-in GLSL floating-point constant for <code>pi/6</code>.\n *\n * @alias czm_piOverSix\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_SIX\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverSix = ...;\n *\n * // Example\n * float pi = 6.0 * czm_piOverSix;\n */\nconst float czm_piOverSix = 0.5235987755982988;\n",NM="/**\n * A built-in GLSL floating-point constant for <code>pi/3</code>.\n *\n * @alias czm_piOverThree\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_THREE\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverThree = ...;\n *\n * // Example\n * float pi = 3.0 * czm_piOverThree;\n */\nconst float czm_piOverThree = 1.0471975511965976;\n",BM="/**\n * A built-in GLSL floating-point constant for <code>pi/2</code>.\n *\n * @alias czm_piOverTwo\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverTwo = ...;\n *\n * // Example\n * float pi = 2.0 * czm_piOverTwo;\n */\nconst float czm_piOverTwo = 1.5707963267948966;\n",FM="/**\n * A built-in GLSL floating-point constant for converting degrees to radians.\n *\n * @alias czm_radiansPerDegree\n * @glslConstant\n *\n * @see CesiumMath.RADIANS_PER_DEGREE\n *\n * @example\n * // GLSL declaration\n * const float czm_radiansPerDegree = ...;\n *\n * // Example\n * float rad = czm_radiansPerDegree * deg;\n */\nconst float czm_radiansPerDegree = 0.017453292519943295;\n",zM="/**\n * The constant identifier for the 2D {@link SceneMode}\n *\n * @name czm_sceneMode2D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode2D = 2.0;\n",kM="/**\n * The constant identifier for the 3D {@link SceneMode}\n *\n * @name czm_sceneMode3D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode3D = 3.0;\n",UM="/**\n * The constant identifier for the Columbus View {@link SceneMode}\n *\n * @name czm_sceneModeColumbusView\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneModeColumbusView = 1.0;\n",VM="/**\n * The constant identifier for the Morphing {@link SceneMode}\n *\n * @name czm_sceneModeMorphing\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n */\nconst float czm_sceneModeMorphing = 0.0;\n",HM="/**\n * A built-in GLSL floating-point constant for one solar radius.\n *\n * @alias czm_solarRadius\n * @glslConstant\n *\n * @see CesiumMath.SOLAR_RADIUS\n *\n * @example\n * // GLSL declaration\n * const float czm_solarRadius = ...;\n */\nconst float czm_solarRadius = 695500000.0;\n",GM="/**\n * A built-in GLSL floating-point constant for <code>3pi/2</code>.\n *\n * @alias czm_threePiOver2\n * @glslConstant\n *\n * @see CesiumMath.THREE_PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_threePiOver2 = ...;\n *\n * // Example\n * float pi = (2.0 / 3.0) * czm_threePiOver2;\n */\nconst float czm_threePiOver2 = 4.71238898038469;\n",qM="/**\n * A built-in GLSL floating-point constant for <code>2pi</code>.\n *\n * @alias czm_twoPi\n * @glslConstant\n *\n * @see CesiumMath.TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_twoPi = ...;\n *\n * // Example\n * float pi = czm_twoPi / 2.0;\n */\nconst float czm_twoPi = 6.283185307179586;\n",WM="/**\n * The maximum latitude, in radians, both North and South, supported by a Web Mercator\n * (EPSG:3857) projection.  Technically, the Mercator projection is defined\n * for any latitude up to (but not including) 90 degrees, but it makes sense\n * to cut it off sooner because it grows exponentially with increasing latitude.\n * The logic behind this particular cutoff value, which is the one used by\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\n * square.  That is, the rectangle is equal in the X and Y directions.\n *\n * The constant value is computed as follows:\n *   czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))\n *\n * @name czm_webMercatorMaxLatitude\n * @glslConstant\n */\nconst float czm_webMercatorMaxLatitude = 1.4844222297453324;\n",YM="/**\n * @name czm_depthRangeStruct\n * @glslStruct\n */\nstruct czm_depthRangeStruct\n{\n    float near;\n    float far;\n};\n",XM="/**\n * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.\n *\n * @name czm_material\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} specular Intensity of incoming light reflecting in a single direction.\n * @property {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.\n * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n */\nstruct czm_material\n{\n    vec3 diffuse;\n    float specular;\n    float shininess;\n    vec3 normal;\n    vec3 emission;\n    float alpha;\n};\n",KM="/**\n * Used as input to every material's czm_getMaterial function.\n *\n * @name czm_materialInput\n * @glslStruct\n *\n * @property {float} s 1D texture coordinates.\n * @property {vec2} st 2D texture coordinates.\n * @property {vec3} str 3D texture coordinates.\n * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.\n * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.\n * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates.  The magnitude is the distance in meters from the fragment to the eye.\n * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid.  Only available for globe materials.\n * @property {float} slope The slope of the terrain in radians.  0 is flat; pi/2 is vertical.  Only available for globe materials.\n * @property {float} aspect The aspect of the terrain in radians.  0 is East, pi/2 is North, pi is West, 3pi/2 is South.  Only available for globe materials.\n */\nstruct czm_materialInput\n{\n    float s;\n    vec2 st;\n    vec3 str;\n    vec3 normalEC;\n    mat3 tangentToEyeMatrix;\n    vec3 positionToEyeEC;\n    float height;\n    float slope;\n    float aspect;\n};\n",JM="/**\n * Struct for representing a material for a {@link ModelExperimental}. The model\n * rendering pipeline will pass this struct between material, custom shaders,\n * and lighting stages. This is not to be confused with {@link czm_material}\n * which is used by the older Fabric materials system, although they are similar.\n * <p>\n * All color values (diffuse, specular, emissive) are in linear color space.\n * </p>\n *\n * @name czm_modelMaterial\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.\n * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.\n * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.\n * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n */\nstruct czm_modelMaterial {\n    vec3 diffuse;\n    float alpha;\n    vec3 specular;\n    float roughness;\n    vec3 normalEC;\n    float occlusion;\n    vec3 emissive;\n};\n",ZM="/**\n * Struct for representing the output of a custom vertex shader.\n * \n * @name czm_modelVertexOutput\n * @glslStruct\n *\n * @see {@link CustomShader}\n * @see {@link ModelExperimental}\n *\n * @property {vec3} positionMC The position of the vertex in model coordinates\n * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. \n */\nstruct czm_modelVertexOutput {\n  vec3 positionMC;\n  float pointSize;\n};\n",$M="/**\n * Parameters for {@link czm_pbrLighting}\n *\n * @name czm_material\n * @glslStruct\n *\n * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation\n * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is.\n * @property {vec3} f0 The reflectance of the material at normal incidence\n */\nstruct czm_pbrParameters\n{\n    vec3 diffuseColor;\n    float roughness;\n    vec3 f0;\n};\n",QM="/**\n * DOC_TBA\n *\n * @name czm_ray\n * @glslStruct\n */\nstruct czm_ray\n{\n    vec3 origin;\n    vec3 direction;\n};\n",eL="/**\n * DOC_TBA\n *\n * @name czm_raySegment\n * @glslStruct\n */\nstruct czm_raySegment\n{\n    float start;\n    float stop;\n};\n\n/**\n * DOC_TBA\n *\n * @name czm_emptyRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\n\n/**\n * DOC_TBA\n *\n * @name czm_fullRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n",tL="struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\n    vec3 texCoords;\n#else\n    vec2 texCoords;\n#endif\n\n    float depthBias;\n    float depth;\n    float nDotL;\n    vec2 texelStepSize;\n    float normalShadingSmooth;\n    float darkness;\n};\n",nL="// See:\n//    https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\n\nvec3 czm_acesTonemapping(vec3 color) {\n    float g = 0.985;\n    float a = 0.065;\n    float b = 0.0001;\n    float c = 0.433;\n    float d = 0.238;\n\n    color = (color * (color + a) - b) / (color * (g * color + c) + d);\n\n    color = clamp(color, 0.0, 1.0);\n\n    return color;\n}\n",iL="/**\n * @private\n */\nfloat czm_alphaWeight(float a)\n{\n    float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n\n    // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:\n    // http://jcgt.org/published/0002/02/09/\n    return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\n}\n",rL="/**\n * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.\n *\n * @name czm_antialias\n * @glslFunction\n *\n * @param {vec4} color1 The color on one side of the edge.\n * @param {vec4} color2 The color on the other side of the edge.\n * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.\n * @param {float} dist The distance to the edge in texture coordinates.\n * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.\n * @returns {vec4} The anti-aliased color.\n *\n * @example\n * // GLSL declarations\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);\n *\n * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space\n * float dist = abs(textureCoordinates.t - 0.5);\n * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));\n * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);\n */\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\n    float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\n    float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\n    val1 = val1 * (1.0 - val2);\n    val1 = val1 * val1 * (3.0 - (2.0 * val1));\n    val1 = pow(val1, 0.5); //makes the transition nicer\n    \n    vec4 midColor = (color1 + color2) * 0.5;\n    return mix(midColor, currentColor, val1);\n}\n\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\n    return czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n",oL="/**\n * Approximately computes spherical coordinates given a normal.\n * Uses approximate inverse trigonometry for speed and consistency,\n * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.\n *\n * @name czm_approximateSphericalCoordinates\n * @glslFunction\n *\n * @param {vec3} normal arbitrary-length normal.\n *\n * @returns {vec2} Approximate latitude and longitude spherical coordinates.\n */\nvec2 czm_approximateSphericalCoordinates(vec3 normal) {\n    // Project into plane with vertical for latitude\n    float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\n    float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\n    return vec2(latitudeApproximation, longitudeApproximation);\n}\n",aL="/**\n * Determines if the fragment is back facing\n *\n * @name czm_backFacing\n * @glslFunction \n * \n * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.\n */\nbool czm_backFacing()\n{\n    // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.\n    return gl_FrontFacing == false;\n}\n",sL="/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a float expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {float} a Value to return if the comparison is true.\n * @param {float} b Value to return if the comparison is false.\n *\n * @returns {float} equivalent of comparison ? a : b\n */\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\n    float useA = float(comparison);\n    return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec2 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec2} a Value to return if the comparison is true.\n * @param {vec2} b Value to return if the comparison is false.\n *\n * @returns {vec2} equivalent of comparison ? a : b\n */\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\n    float useA = float(comparison);\n    return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec3 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\n    float useA = float(comparison);\n    return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec4 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\n    float useA = float(comparison);\n    return a * useA + b * (1.0 - useA);\n}\n",cL="\nvec4 czm_cascadeColor(vec4 weights)\n{\n    return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\n           vec4(0.0, 1.0, 0.0, 1.0) * weights.y +\n           vec4(0.0, 0.0, 1.0, 1.0) * weights.z +\n           vec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n",lL="\nuniform vec4 shadowMap_cascadeDistances;\n\nfloat czm_cascadeDistance(vec4 weights)\n{\n    return dot(shadowMap_cascadeDistances, weights);\n}\n",uL="\nuniform mat4 shadowMap_cascadeMatrices[4];\n\nmat4 czm_cascadeMatrix(vec4 weights)\n{\n    return shadowMap_cascadeMatrices[0] * weights.x +\n           shadowMap_cascadeMatrices[1] * weights.y +\n           shadowMap_cascadeMatrices[2] * weights.z +\n           shadowMap_cascadeMatrices[3] * weights.w;\n}\n",hL="\nuniform vec4 shadowMap_cascadeSplits[2];\n\nvec4 czm_cascadeWeights(float depthEye)\n{\n    // One component is set to 1.0 and all others set to 0.0.\n    vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\n    vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\n    return near * far;\n}\n",dL="/**\n * DOC_TBA\n *\n * @name czm_columbusViewMorph\n * @glslFunction\n */\nvec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\n    // Just linear for now.\n    vec3 p = mix(position2D.xyz, position3D.xyz, time);\n    return vec4(p, 1.0);\n}\n",fL="/**\n * Returns a position in model coordinates relative to eye taking into\n * account the current scene mode: 3D, 2D, or Columbus view.\n * <p>\n * This uses standard position attributes, <code>position3DHigh</code>, \n * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>, \n * and should be used when writing a vertex shader for an {@link Appearance}.\n * </p>\n *\n * @name czm_computePosition\n * @glslFunction\n *\n * @returns {vec4} The position relative to eye.\n *\n * @example\n * vec4 p = czm_computePosition();\n * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n *\n * @see czm_translateRelativeToEye\n */\nvec4 czm_computePosition();\n",pL="/**\n * @private\n */\nvec2 cordic(float angle)\n{\n// Scale the vector by the appropriate factor for the 24 iterations to follow.\n    vec2 vector = vec2(6.0725293500888267e-1, 0.0);\n// Iteration 1\n    float sense = (angle < 0.0) ? -1.0 : 1.0;\n //   float factor = sense * 1.0;  // 2^-0\n    mat2 rotation = mat2(1.0, sense, -sense, 1.0);\n    vector = rotation * vector;\n    angle -= sense * 7.8539816339744828e-1;  // atan(2^-0)\n// Iteration 2\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    float factor = sense * 5.0e-1;  // 2^-1\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 4.6364760900080609e-1;  // atan(2^-1)\n// Iteration 3\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 2.5e-1;  // 2^-2\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 2.4497866312686414e-1;  // atan(2^-2)\n// Iteration 4\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.25e-1;  // 2^-3\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 1.2435499454676144e-1;  // atan(2^-3)\n// Iteration 5\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 6.25e-2;  // 2^-4\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 6.2418809995957350e-2;  // atan(2^-4)\n// Iteration 6\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 3.125e-2;  // 2^-5\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 3.1239833430268277e-2;  // atan(2^-5)\n// Iteration 7\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.5625e-2;  // 2^-6\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 1.5623728620476831e-2;  // atan(2^-6)\n// Iteration 8\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 7.8125e-3;  // 2^-7\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 7.8123410601011111e-3;  // atan(2^-7)\n// Iteration 9\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 3.90625e-3;  // 2^-8\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 3.9062301319669718e-3;  // atan(2^-8)\n// Iteration 10\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.953125e-3;  // 2^-9\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 1.9531225164788188e-3;  // atan(2^-9)\n// Iteration 11\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 9.765625e-4;  // 2^-10\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 9.7656218955931946e-4;  // atan(2^-10)\n// Iteration 12\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 4.8828125e-4;  // 2^-11\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 4.8828121119489829e-4;  // atan(2^-11)\n// Iteration 13\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 2.44140625e-4;  // 2^-12\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 2.4414062014936177e-4;  // atan(2^-12)\n// Iteration 14\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.220703125e-4;  // 2^-13\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 1.2207031189367021e-4;  // atan(2^-13)\n// Iteration 15\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 6.103515625e-5;  // 2^-14\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 6.1035156174208773e-5;  // atan(2^-14)\n// Iteration 16\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 3.0517578125e-5;  // 2^-15\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 3.0517578115526096e-5;  // atan(2^-15)\n// Iteration 17\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.52587890625e-5;  // 2^-16\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 1.5258789061315762e-5;  // atan(2^-16)\n// Iteration 18\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 7.62939453125e-6;  // 2^-17\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 7.6293945311019700e-6;  // atan(2^-17)\n// Iteration 19\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 3.814697265625e-6;  // 2^-18\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 3.8146972656064961e-6;  // atan(2^-18)\n// Iteration 20\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.9073486328125e-6;  // 2^-19\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 1.9073486328101870e-6;  // atan(2^-19)\n// Iteration 21\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 9.5367431640625e-7;  // 2^-20\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 9.5367431640596084e-7;  // atan(2^-20)\n// Iteration 22\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 4.76837158203125e-7;  // 2^-21\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 4.7683715820308884e-7;  // atan(2^-21)\n// Iteration 23\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 2.384185791015625e-7;  // 2^-22\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n    angle -= sense * 2.3841857910155797e-7;  // atan(2^-22)\n// Iteration 24\n    sense = (angle < 0.0) ? -1.0 : 1.0;\n    factor = sense * 1.1920928955078125e-7;  // 2^-23\n    rotation[0][1] = factor;\n    rotation[1][0] = -factor;\n    vector = rotation * vector;\n//    angle -= sense * 1.1920928955078068e-7;  // atan(2^-23)\n\n    return vector;\n}\n\n/**\n * Computes the cosine and sine of the provided angle using the CORDIC algorithm.\n *\n * @name czm_cosineAndSine\n * @glslFunction\n *\n * @param {float} angle The angle in radians.\n *\n * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).\n *\n * @example\n * vec2 v = czm_cosineAndSine(czm_piOverSix);\n * float cosine = v.x;\n * float sine = v.y;\n */\nvec2 czm_cosineAndSine(float angle)\n{\n    if (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n    {\n        if (angle < 0.0)\n        {\n            return -cordic(angle + czm_pi);\n        }\n        else\n        {\n            return -cordic(angle - czm_pi);\n        }\n    }\n    else\n    {\n        return cordic(angle);\n    }\n}\n",mL="/**\n * Decompresses texture coordinates that were packed into a single float.\n *\n * @name czm_decompressTextureCoordinates\n * @glslFunction\n *\n * @param {float} encoded The compressed texture coordinates.\n * @returns {vec2} The decompressed texture coordinates.\n */\n vec2 czm_decompressTextureCoordinates(float encoded)\n {\n    float temp = encoded / 4096.0;\n    float xZeroTo4095 = floor(temp);\n    float stx = xZeroTo4095 / 4095.0;\n    float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\n    return vec2(stx, sty);\n }\n",gL="/**\n * Get default parameters for physically based rendering. These defaults\n * describe a rough dielectric (non-metal) surface (e.g. rough plastic).\n *\n * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting}\n */\nczm_pbrParameters czm_defaultPbrMaterial()\n{\n    czm_pbrParameters results;\n    results.diffuseColor = vec3(1.0);\n    results.roughness = 1.0;\n\n    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\n    results.f0 = REFLECTANCE_DIELECTRIC;\n    return results;\n}\n",_L="// emulated noperspective\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\n\n/**\n * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.\n * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, \n * capping the shadow volume. More information here: \n * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.\n *\n * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring \n * no geometry gets clipped by setting the clip space z value to 0.0 and then\n * sending the unaltered screen space z value (using emulated noperspective\n * interpolation) to the frag shader where it is clamped to [0,1] and then\n * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:\n * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.\n *\n * When GL_EXT_frag_depth is not available, which is the case on some mobile \n * devices, we must attempt to fix this only in the vertex shader. \n * The approach is to clamp the z value to the far plane, which closes the \n * shadow volume but also distorts the geometry, so there can still be artifacts\n * on frustum seams.\n *\n * @name czm_depthClamp\n * @glslFunction\n *\n * @param {vec4} coords The vertex in clip coordinates.\n * @returns {vec4} The modified vertex.\n *\n * @example\n * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));\n *\n * @see czm_writeDepthClamp\n */\nvec4 czm_depthClamp(vec4 coords)\n{\n#ifndef LOG_DEPTH\n#ifdef GL_EXT_frag_depth\n    v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\n    coords.z = 0.0;\n#else\n    coords.z = min(coords.z, coords.w);\n#endif\n#endif\n    return coords;\n}\n",yL="/**\n * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system \n * to eye coordinates.  In east-north-up coordinates, x points east, y points north, and z points along the \n * surface normal.  East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.\n * <br /><br />\n * The ellipsoid is assumed to be centered at the model coordinate's origin.\n *\n * @name czm_eastNorthUpToEyeCoordinates\n * @glslFunction\n *\n * @param {vec3} positionMC The position on the ellipsoid in model coordinates.\n * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.\n *\n * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.\n *\n * @example\n * // Transform a vector defined in the east-north-up coordinate \n * // system, (0, 0, 1) which is the surface normal, to eye \n * // coordinates.\n * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\n * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);\n */\nmat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\n    vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));  // normalized surface tangent in model coordinates\n    vec3 tangentEC = normalize(czm_normal3D * tangentMC);                // normalized surface tangent in eye coordiantes\n    vec3 bitangentEC = normalize(cross(normalEC, tangentEC));            // normalized surface bitangent in eye coordinates\n\n    return mat3(\n        tangentEC.x,   tangentEC.y,   tangentEC.z,\n        bitangentEC.x, bitangentEC.y, bitangentEC.z,\n        normalEC.x,    normalEC.y,    normalEC.z);\n}\n",bL="/**\n * DOC_TBA\n *\n * @name czm_ellipsoidContainsPoint\n * @glslFunction\n *\n */\nbool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\n{\n    vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\n    return (dot(scaled, scaled) <= 1.0);\n}\n",vL="/**\n * DOC_TBA\n *\n * @name czm_ellipsoidWgs84TextureCoordinates\n * @glslFunction\n */\nvec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\n    return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n",OL="/**\n * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>\n * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs\n * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,\n * <code>vec3</code>s, or <code>vec4</code>s.\n *\n * @name czm_equalsEpsilon\n * @glslFunction\n *\n * @param {} left The first vector.\n * @param {} right The second vector.\n * @param {float} epsilon The epsilon to use for equality testing.\n * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.\n *\n * @example\n * // GLSL declarations\n * bool czm_equalsEpsilon(float left, float right, float epsilon);\n * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);\n * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);\n * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);\n */\nbool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\n    return all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\n    return all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\n    return all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\n\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\n    return (abs(left - right) <= epsilon);\n}\n",wL="/**\n * DOC_TBA\n *\n * @name czm_eyeOffset\n * @glslFunction\n *\n * @param {vec4} positionEC DOC_TBA.\n * @param {vec3} eyeOffset DOC_TBA.\n *\n * @returns {vec4} DOC_TBA.\n */\nvec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\n    // This equation is approximate in x and y.\n    vec4 p = positionEC;\n    vec4 zEyeOffset = normalize(p) * eyeOffset.z;\n    p.xy += eyeOffset.xy + zEyeOffset.xy;\n    p.z += zEyeOffset.z;\n    return p;\n}\n",AL="/**\n * Transforms a position from eye to window coordinates.  The transformation\n * from eye to clip coordinates is done using {@link czm_projection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of <code>near = 0</code> and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n *\n * @name czm_eyeToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in eye coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_projection\n * @see czm_viewportTransformation\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n */\nvec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\n    vec4 q = czm_projection * positionEC;                        // clip coordinates\n    q.xyz /= q.w;                                                // normalized device coordinates\n    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n    return q;\n}\n",EL="/**\n * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.\n *\n * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on\n * \"Efficient approximations for the arctangent function,\" Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\n * Adapted from ShaderFastLibs under MIT License.\n *\n * Chosen for the following characteristics over range [0, 1]:\n * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)\n * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)\n *\n * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);\n * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.\n *\n * @name czm_fastApproximateAtan\n * @glslFunction\n *\n * @param {float} x Value between 0 and 1 inclusive.\n *\n * @returns {float} Approximation of atan(x)\n */\nfloat czm_fastApproximateAtan(float x) {\n    return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n}\n\n/**\n * Approximation of atan2.\n *\n * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html\n * However, we replaced their atan curve with Michael Drobot's (see above).\n *\n * @name czm_fastApproximateAtan\n * @glslFunction\n *\n * @param {float} x Value between -1 and 1 inclusive.\n * @param {float} y Value between -1 and 1 inclusive.\n *\n * @returns {float} Approximation of atan2(x, y)\n */\nfloat czm_fastApproximateAtan(float x, float y) {\n    // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.\n    // So range-reduce using abs and by flipping whether x or y is on top.\n    float t = abs(x); // t used as swap and atan result.\n    float opposite = abs(y);\n    float adjacent = max(t, opposite);\n    opposite = min(t, opposite);\n\n    t = czm_fastApproximateAtan(opposite / adjacent);\n\n    // Undo range reduction\n    t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\n    t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\n    t = czm_branchFreeTernary(y < 0.0, -t, t);\n    return t;\n}\n",TL="/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\n    float scalar = distanceToCamera * czm_fogDensity;\n    float fog = 1.0 - exp(-(scalar * scalar));\n    return mix(color, fogColor, fog);\n}\n\n/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n * @param {float} fogModifierConstant A constant to modify the appearance of fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\n    float scalar = distanceToCamera * czm_fogDensity;\n    float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\n    return mix(color, fogColor, fog);\n}\n",CL="/**\n * Converts a color from RGB space to linear space.\n *\n * @name czm_gammaCorrect\n * @glslFunction\n *\n * @param {vec3} color The color in RGB space.\n * @returns {vec3} The color in linear space.\n */\nvec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\n    color = pow(color, vec3(czm_gamma));\n#endif\n    return color;\n}\n\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\n    color.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\n    return color;\n}\n",xL="/**\n * DOC_TBA\n *\n * @name czm_geodeticSurfaceNormal\n * @glslFunction\n *\n * @param {vec3} positionOnEllipsoid DOC_TBA\n * @param {vec3} ellipsoidCenter DOC_TBA\n * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA\n * \n * @returns {vec3} DOC_TBA.\n */\nvec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\n    return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n",SL="/**\n * An czm_material with default values. Every material's czm_getMaterial\n * should use this default material as a base for the material it returns.\n * The default normal value is given by materialInput.normalEC.\n *\n * @name czm_getDefaultMaterial\n * @glslFunction\n *\n * @param {czm_materialInput} input The input used to construct the default material.\n *\n * @returns {czm_material} The default material.\n *\n * @see czm_materialInput\n * @see czm_material\n * @see czm_getMaterial\n */\nczm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\n    czm_material material;\n    material.diffuse = vec3(0.0);\n    material.specular = 0.0;\n    material.shininess = 1.0;\n    material.normal = materialInput.normalEC;\n    material.emission = vec3(0.0);\n    material.alpha = 1.0;\n    return material;\n}\n",IL="/**\n * Calculates the intensity of diffusely reflected light.\n *\n * @name czm_getLambertDiffuse\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n *\n * @returns {float} The intensity of the diffuse reflection.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\n    return max(dot(lightDirectionEC, normalEC), 0.0);\n}\n",PL="/**\n * Calculates the specular intensity of reflected light.\n *\n * @name czm_getSpecular\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n * @param {float} shininess The sharpness of the specular reflection.  Higher values create a smaller, more focused specular highlight.\n *\n * @returns {float} The intensity of the specular highlight.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\n    vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\n    float specular = max(dot(toReflectedLight, toEyeEC), 0.0);\n\n    // pow has undefined behavior if both parameters <= 0.\n    // Prevent this by making sure shininess is at least czm_epsilon2.\n    return pow(specular, max(shininess, czm_epsilon2));\n}\n",DL="/**\n * @private\n */\nvec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\n    float cosAngle = cos(angleInRadians);\n    float sinAngle = sin(angleInRadians);\n\n    // time dependent sampling directions\n    vec2 s0 = vec2(1.0/17.0, 0.0);\n    vec2 s1 = vec2(-1.0/29.0, 0.0);\n    vec2 s2 = vec2(1.0/101.0, 1.0/59.0);\n    vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\n\n    // rotate sampling direction by specified angle\n    s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\n    s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\n    s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\n    s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\n\n    vec2 uv0 = (uv/103.0) + (time * s0);\n    vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\n    vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\n    vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\n\n    uv0 = fract(uv0);\n    uv1 = fract(uv1);\n    uv2 = fract(uv2);\n    uv3 = fract(uv3);\n    vec4 noise = (texture2D(normalMap, uv0)) +\n                 (texture2D(normalMap, uv1)) +\n                 (texture2D(normalMap, uv2)) +\n                 (texture2D(normalMap, uv3));\n\n    // average and scale to between -1 and 1\n    return ((noise / 4.0) - 0.5) * 2.0;\n}\n",RL="/**\n * Converts an HSB color (hue, saturation, brightness) to RGB\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\n *\n * @name czm_HSBToRGB\n * @glslFunction\n * \n * @param {vec3} hsb The color in HSB.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\nvec3 czm_HSBToRGB(vec3 hsb)\n{\n    vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\n    return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n",jL="/**\n * Converts an HSL color (hue, saturation, lightness) to RGB\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\n *\n * @name czm_HSLToRGB\n * @glslFunction\n * \n * @param {vec3} rgb The color in HSL.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n\nvec3 hueToRGB(float hue)\n{\n    float r = abs(hue * 6.0 - 3.0) - 1.0;\n    float g = 2.0 - abs(hue * 6.0 - 2.0);\n    float b = 2.0 - abs(hue * 6.0 - 4.0);\n    return clamp(vec3(r, g, b), 0.0, 1.0);\n}\n\nvec3 czm_HSLToRGB(vec3 hsl)\n{\n    vec3 rgb = hueToRGB(hsl.x);\n    float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\n    return (rgb - 0.5) * c + hsl.z;\n}\n",ML="/**\n * Adjusts the hue of a color.\n * \n * @name czm_hue\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the hue of the color in radians.\n *\n * @returns {float} The color with the hue adjusted.\n *\n * @example\n * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)\n */\nvec3 czm_hue(vec3 rgb, float adjustment)\n{\n    const mat3 toYIQ = mat3(0.299,     0.587,     0.114,\n                            0.595716, -0.274453, -0.321263,\n                            0.211456, -0.522591,  0.311135);\n    const mat3 toRGB = mat3(1.0,  0.9563,  0.6210,\n                            1.0, -0.2721, -0.6474,\n                            1.0, -1.107,   1.7046);\n    \n    vec3 yiq = toYIQ * rgb;\n    float hue = atan(yiq.z, yiq.y) + adjustment;\n    float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\n    \n    vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\n    return toRGB * color;\n}\n",LL="/**\n * Converts a color in linear space to RGB space.\n *\n * @name czm_inverseGamma\n * @glslFunction\n *\n * @param {vec3} color The color in linear space.\n * @returns {vec3} The color in RGB space.\n */\nvec3 czm_inverseGamma(vec3 color) {\n    return pow(color, vec3(1.0 / czm_gamma));\n}\n",NL="/**\n * Determines if a time interval is empty.\n *\n * @name czm_isEmpty\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isEmpty(czm_raySegment interval)\n{\n    return (interval.stop < 0.0);\n}\n",BL="/**\n * Determines if a time interval is empty.\n *\n * @name czm_isFull\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment);      // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isFull(czm_raySegment interval)\n{\n    return (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n",FL="/**\n * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.\n *\n * @name czm_latitudeToWebMercatorFraction\n * @glslFunction\n *\n * @param {float} latitude The geodetic latitude, in radians.\n * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.\n * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.\n *\n * @returns {float} The fraction of the rectangle at which the latitude occurs.  If the latitude is the southern\n *          boundary of the rectangle, the return value will be zero.  If it is the northern boundary, the return\n *          value will be 1.0.  Latitudes in between are mapped according to the Web Mercator projection.\n */ \nfloat czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\n    float sinLatitude = sin(latitude);\n    float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n    \n    return (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n",zL="/**\n * Converts a linear RGB color to an sRGB color.\n *\n * @param {vec3|vec4} linearIn The color in linear color space.\n * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.\n */\nvec3 czm_linearToSrgb(vec3 linearIn) \n{\n    return pow(linearIn, vec3(1.0/2.2));\n}\n\nvec4 czm_linearToSrgb(vec4 linearIn) \n{\n    vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));\n    return vec4(srgbOut, linearIn.a);\n}\n",kL="/**\n * Computes distance from an point in 2D to a line in 2D.\n *\n * @name czm_lineDistance\n * @glslFunction\n *\n * param {vec2} point1 A point along the line.\n * param {vec2} point2 A point along the line.\n * param {vec2} point A point that may or may not be on the line.\n * returns {float} The distance from the point to the line.\n */\nfloat czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\n    return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\n}\n",UL="/**\n * Computes the luminance of a color. \n *\n * @name czm_luminance\n * @glslFunction\n *\n * @param {vec3} rgb The color.\n * \n * @returns {float} The luminance.\n *\n * @example\n * float light = czm_luminance(vec3(0.0)); // 0.0\n * float dark = czm_luminance(vec3(1.0));  // ~1.0 \n */\nfloat czm_luminance(vec3 rgb)\n{\n    // Algorithm from Chapter 10 of Graphics Shaders.\n    const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n    return dot(rgb, W);\n}\n",VL="/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * <p>\n * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.\n * </p>\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n * @param {float} pixelRatio The scaling factor from pixel space to coordinate space\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio)\n{\n    float width = czm_viewport.z;\n    float height = czm_viewport.w;\n    float pixelWidth;\n    float pixelHeight;\n\n    float top = czm_frustumPlanes.x;\n    float bottom = czm_frustumPlanes.y;\n    float left = czm_frustumPlanes.z;\n    float right = czm_frustumPlanes.w;\n\n    if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\n    {\n        float frustumWidth = right - left;\n        float frustumHeight = top - bottom;\n        pixelWidth = frustumWidth / width;\n        pixelHeight = frustumHeight / height;\n    }\n    else\n    {\n        float distanceToPixel = -positionEC.z;\n        float inverseNear = 1.0 / czm_currentFrustum.x;\n        float tanTheta = top * inverseNear;\n        pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\n        tanTheta = right * inverseNear;\n        pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n    }\n\n    return max(pixelWidth, pixelHeight) * pixelRatio;\n}\n\n/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * <p>\n * Use this version when scaling by pixel ratio.\n * </p>\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC)\n{\n    return czm_metersPerPixel(positionEC, czm_pixelRatio);\n}\n",HL="/**\n * Transforms a position from model to window coordinates.  The transformation\n * from model to clip coordinates is done using {@link czm_modelViewProjection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of <code>near = 0</code> and <code>far = 1</code>.\n * <br /><br />\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n * <br /><br />\n * This function should not be confused with {@link czm_viewportOrthographic},\n * which is an orthographic projection matrix that transforms from window \n * coordinates to clip coordinates.\n *\n * @name czm_modelToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in model coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_eyeToWindowCoordinates\n * @see czm_modelViewProjection\n * @see czm_viewportTransformation\n * @see czm_viewportOrthographic\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);\n */\nvec4 czm_modelToWindowCoordinates(vec4 position)\n{\n    vec4 q = czm_modelViewProjection * position;                // clip coordinates\n    q.xyz /= q.w;                                                // normalized device coordinates\n    q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n    return q;\n}\n",GL="/**\n * DOC_TBA\n *\n * @name czm_multiplyWithColorBalance\n * @glslFunction\n */\nvec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\n    // Algorithm from Chapter 10 of Graphics Shaders.\n    const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n    \n    vec3 target = left * right;\n    float leftLuminance = dot(left, W);\n    float rightLuminance = dot(right, W);\n    float targetLuminance = dot(target, W);\n    \n    return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n",qL="/**\n * Computes a value that scales with distance.  The scaling is clamped at the near and\n * far distances, and does not extrapolate.  This function works with the\n * {@link NearFarScalar} JavaScript class.\n *\n * @name czm_nearFarScalar\n * @glslFunction\n *\n * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).\n * @param {float} cameraDistSq The square of the current distance from the camera.\n *\n * @returns {float} The value at this distance.\n */\nfloat czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\n    float valueAtMin = nearFarScalar.y;\n    float valueAtMax = nearFarScalar.w;\n    float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\n    float farDistanceSq = nearFarScalar.z * nearFarScalar.z;\n\n    float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\n\n    t = pow(clamp(t, 0.0, 1.0), 0.2);\n\n    return mix(valueAtMin, valueAtMax, t);\n}\n",WL=" /**\n  * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\n  * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n  * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n  *\n  * @name czm_octDecode\n  * @param {vec2} encoded The oct-encoded, unit-length vector\n  * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.\n  * @returns {vec3} The decoded and normalized vector\n  */\n  vec3 czm_octDecode(vec2 encoded, float range)\n  {\n      if (encoded.x == 0.0 && encoded.y == 0.0) {\n          return vec3(0.0, 0.0, 0.0);\n      }\n\n     encoded = encoded / range * 2.0 - 1.0;\n     vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\n     if (v.z < 0.0)\n     {\n         v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n     }\n\n     return normalize(v);\n  }\n\n/**\n * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {vec2} encoded The oct-encoded, unit-length vector\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(vec2 encoded)\n {\n    return czm_octDecode(encoded, 255.0);\n }\n\n /**\n * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {float} encoded The oct-encoded, unit-length vector\n * @returns {vec3} The decoded and normalized vector\n */\n vec3 czm_octDecode(float encoded)\n {\n    float temp = encoded / 256.0;\n    float x = floor(temp);\n    float y = (temp - x) * 256.0;\n    return czm_octDecode(vec2(x, y));\n }\n\n/**\n * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.\n * The 'oct' encoding is described in \"A Survey of Efficient Representations of Independent Unit Vectors\",\n * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/\n *\n * @name czm_octDecode\n * @param {vec2} encoded The packed oct-encoded, unit-length vectors.\n * @param {vec3} vector1 One decoded and normalized vector.\n * @param {vec3} vector2 One decoded and normalized vector.\n * @param {vec3} vector3 One decoded and normalized vector.\n */\n  void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n {\n    float temp = encoded.x / 65536.0;\n    float x = floor(temp);\n    float encodedFloat1 = (temp - x) * 65536.0;\n\n    temp = encoded.y / 65536.0;\n    float y = floor(temp);\n    float encodedFloat2 = (temp - y) * 65536.0;\n\n    vector1 = czm_octDecode(encodedFloat1);\n    vector2 = czm_octDecode(encodedFloat2);\n    vector3 = czm_octDecode(vec2(x, y));\n }\n\n",YL="/**\n * Packs a depth value into a vec3 that can be represented by unsigned bytes.\n *\n * @name czm_packDepth\n * @glslFunction\n *\n * @param {float} depth The floating-point depth.\n * @returns {vec3} The packed depth.\n */\nvec4 czm_packDepth(float depth)\n{\n    // See Aras Pranckevičius' post Encoding Floats to RGBA\n    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n    vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n    enc = fract(enc);\n    enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n    return enc;\n}\n",XL="vec3 lambertianDiffuse(vec3 diffuseColor)\n{\n    return diffuseColor / czm_pi;\n}\n\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\n{\n    return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\nfloat smithVisibilityG1(float NdotV, float roughness)\n{\n    // this is the k value for direct lighting.\n    // for image based lighting it will be roughness^2 / 2\n    float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n    return NdotV / (NdotV * (1.0 - k) + k);\n}\n\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\n{\n    return (\n        smithVisibilityG1(NdotL, roughness) *\n        smithVisibilityG1(NdotV, roughness)\n    );\n}\n\nfloat GGX(float roughness, float NdotH)\n{\n    float roughnessSquared = roughness * roughness;\n    float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n    return roughnessSquared / (czm_pi * f * f);\n}\n\n/**\n * Compute the diffuse and specular contributions using physically based\n * rendering. This function only handles direct lighting.\n * <p>\n * This function only handles the lighting calculations. Metallic/roughness\n * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial}\n * </p>\n *\n * @name czm_pbrlighting\n * @glslFunction\n *\n * @param {vec3} positionEC The position of the fragment in eye coordinates\n * @param {vec3} normalEC The surface normal in eye coordinates\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value.\n * @param {czm_pbrParameters} The computed PBR parameters.\n * @return {vec3} The computed HDR color\n *\n * @example\n * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial(\n *  baseColor,\n *  metallic,\n *  roughness\n * );\n * vec3 color = czm_pbrlighting(\n *  positionEC,\n *  normalEC,\n *  lightDirectionEC,\n *  lightColorHdr,\n *  pbrParameters);\n */\nvec3 czm_pbrLighting(\n    vec3 positionEC,\n    vec3 normalEC,\n    vec3 lightDirectionEC,\n    vec3 lightColorHdr,\n    czm_pbrParameters pbrParameters\n)\n{\n    vec3 v = -normalize(positionEC);\n    vec3 l = normalize(lightDirectionEC);\n    vec3 h = normalize(v + l);\n    vec3 n = normalEC;\n    float NdotL = clamp(dot(n, l), 0.001, 1.0);\n    float NdotV = abs(dot(n, v)) + 0.001;\n    float NdotH = clamp(dot(n, h), 0.0, 1.0);\n    float LdotH = clamp(dot(l, h), 0.0, 1.0);\n    float VdotH = clamp(dot(v, h), 0.0, 1.0);\n\n    vec3 f0 = pbrParameters.f0;\n    float reflectance = max(max(f0.r, f0.g), f0.b);\n    vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n    vec3 F = fresnelSchlick2(f0, f90, VdotH);\n\n    float alpha = pbrParameters.roughness;\n    float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n    float D = GGX(alpha, NdotH);\n    vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n\n    vec3 diffuseColor = pbrParameters.diffuseColor;\n    // F here represents the specular contribution\n    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n\n    // Lo = (diffuse + specular) * Li * NdotL\n    return (diffuseContribution + specularContribution) * NdotL * lightColorHdr;\n}\n",KL="/**\n * Compute parameters for physically based rendering using the\n * metallic/roughness workflow. All inputs are linear; sRGB texture values must\n * be decoded beforehand\n *\n * @name czm_pbrMetallicRoughnessMaterial\n * @glslFunction\n *\n * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence)\n * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt);\n * @param {float} roughness A value between 0.0 and 1.0\n * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}\n */\nczm_pbrParameters czm_pbrMetallicRoughnessMaterial(\n    vec3 baseColor,\n    float metallic,\n    float roughness\n) \n{\n    czm_pbrParameters results;\n\n    // roughness is authored as perceptual roughness\n    // square it to get material roughness\n    roughness = clamp(roughness, 0.0, 1.0);\n    results.roughness = roughness * roughness;\n\n    // dielectrics use f0 = 0.04, metals use albedo as f0\n    metallic = clamp(metallic, 0.0, 1.0);\n    const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\n    vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);\n    results.f0 = f0;\n\n    // diffuse only applies to dielectrics.\n    results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);\n\n    return results;\n}\n",JL="/**\n * Compute parameters for physically based rendering using the\n * specular/glossy workflow. All inputs are linear; sRGB texture values must\n * be decoded beforehand\n *\n * @name czm_pbrSpecularGlossinessMaterial\n * @glslFunction\n *\n * @param {vec3} diffuse The diffuse color for dielectrics (non-metals)\n * @param {vec3} specular The reflectance at normal incidence (f0)\n * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is.\n * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}\n */\nczm_pbrParameters czm_pbrSpecularGlossinessMaterial(\n    vec3 diffuse,\n    vec3 specular,\n    float glossiness\n) \n{\n    czm_pbrParameters results;\n\n    // glossiness is the opposite of roughness, but easier for artists to use.\n    float roughness = 1.0 - glossiness;\n    results.roughness = roughness * roughness;\n\n    results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));\n    results.f0 = specular;\n\n    return results;\n}\n",ZL="float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\n    return czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\n\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\n    return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\n\n/**\n * Computes a color using the Phong lighting model.\n *\n * @name czm_phong\n * @glslFunction\n *\n * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.\n * @param {czm_material} material The fragment's material.\n *\n * @returns {vec4} The computed color.\n *\n * @example\n * vec3 positionToEyeEC = // ...\n * czm_material material = // ...\n * vec3 lightDirectionEC = // ...\n * gl_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);\n *\n * @see czm_getMaterial\n */\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n    // Diffuse from directional light sources at eye (for top-down)\n    float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\n    if (czm_sceneMode == czm_sceneMode3D) {\n        // (and horizon views in 3D)\n        diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n    }\n\n    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n    // Temporary workaround for adding ambient.\n    vec3 materialDiffuse = material.diffuse * 0.5;\n\n    vec3 ambient = materialDiffuse;\n    vec3 color = ambient + material.emission;\n    color += materialDiffuse * diffuse * czm_lightColor;\n    color += material.specular * specular * czm_lightColor;\n\n    return vec4(color, material.alpha);\n}\n\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n    float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\n    float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n    vec3 ambient = vec3(0.0);\n    vec3 color = ambient + material.emission;\n    color += material.diffuse * diffuse * czm_lightColor;\n    color += material.specular * specular * czm_lightColor;\n\n    return vec4(color, material.alpha);\n}\n",$L="/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec4 plane, vec3 point) {\n    return (dot(plane.xyz, point) + plane.w);\n}\n\n/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js\n * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\n    return (dot(planeNormal, point) + planeDistance);\n}\n",QL="/**\n * Computes the point along a ray at the given time.  <code>time</code> can be positive, negative, or zero.\n *\n * @name czm_pointAlongRay\n * @glslFunction\n *\n * @param {czm_ray} ray The ray to compute the point along.\n * @param {float} time The time along the ray.\n * \n * @returns {vec3} The point along the ray at the given time.\n * \n * @example\n * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction\n * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)\n */\nvec3 czm_pointAlongRay(czm_ray ray, float time)\n{\n    return ray.origin + (time * ray.direction);\n}\n",eN="/**\n * DOC_TBA\n *\n * @name czm_rayEllipsoidIntersectionInterval\n * @glslFunction\n */\nczm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\n{\n   // ray and ellipsoid center in eye coordinates.  radii in model coordinates.\n    vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\n    vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\n\n    q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\n\n    float q2 = dot(q, q);\n    float qw = dot(q, w);\n\n    if (q2 > 1.0) // Outside ellipsoid.\n    {\n        if (qw >= 0.0) // Looking outward or tangent (0 intersections).\n        {\n            return czm_emptyRaySegment;\n        }\n        else // qw < 0.0.\n        {\n            float qw2 = qw * qw;\n            float difference = q2 - 1.0; // Positively valued.\n            float w2 = dot(w, w);\n            float product = w2 * difference;\n\n            if (qw2 < product) // Imaginary roots (0 intersections).\n            {\n                return czm_emptyRaySegment;\n            }\n            else if (qw2 > product) // Distinct roots (2 intersections).\n            {\n                float discriminant = qw * qw - product;\n                float temp = -qw + sqrt(discriminant); // Avoid cancellation.\n                float root0 = temp / w2;\n                float root1 = difference / temp;\n                if (root0 < root1)\n                {\n                    czm_raySegment i = czm_raySegment(root0, root1);\n                    return i;\n                }\n                else\n                {\n                    czm_raySegment i = czm_raySegment(root1, root0);\n                    return i;\n                }\n            }\n            else // qw2 == product.  Repeated roots (2 intersections).\n            {\n                float root = sqrt(difference / w2);\n                czm_raySegment i = czm_raySegment(root, root);\n                return i;\n            }\n        }\n    }\n    else if (q2 < 1.0) // Inside ellipsoid (2 intersections).\n    {\n        float difference = q2 - 1.0; // Negatively valued.\n        float w2 = dot(w, w);\n        float product = w2 * difference; // Negatively valued.\n        float discriminant = qw * qw - product;\n        float temp = -qw + sqrt(discriminant); // Positively valued.\n        czm_raySegment i = czm_raySegment(0.0, temp / w2);\n        return i;\n    }\n    else // q2 == 1.0. On ellipsoid.\n    {\n        if (qw < 0.0) // Looking inward.\n        {\n            float w2 = dot(w, w);\n            czm_raySegment i = czm_raySegment(0.0, -qw / w2);\n            return i;\n        }\n        else // qw >= 0.0.  Looking outward or tangent.\n        {\n            return czm_emptyRaySegment;\n        }\n    }\n}\n",tN="/**\n * Compute the intersection interval of a ray with a sphere.\n *\n * @name czm_raySphereIntersectionInterval\n * @glslFunction\n *\n * @param {czm_ray} ray The ray.\n * @param {vec3} center The center of the sphere.\n * @param {float} radius The radius of the sphere.\n * @return {czm_raySegment} The intersection interval of the ray with the sphere.\n */\nczm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)\n{\n    vec3 o = ray.origin;\n    vec3 d = ray.direction;\n\n    vec3 oc = o - center;\n\n    float a = dot(d, d);\n    float b = 2.0 * dot(d, oc);\n    float c = dot(oc, oc) - (radius * radius);\n\n    float det = (b * b) - (4.0 * a * c);\n\n    if (det < 0.0) {\n        return czm_emptyRaySegment;\n    }\n\n    float sqrtDet = sqrt(det);\n\n    float t0 = (-b - sqrtDet) / (2.0 * a);\n    float t1 = (-b + sqrtDet) / (2.0 * a);\n\n    czm_raySegment result = czm_raySegment(t0, t1);\n    return result;\n}\n",nN="float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\n    return czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\n}\n",iN="/**\n * Reads a value previously transformed with {@link czm_writeNonPerspective}\n * by dividing it by `w`, the value used in the perspective divide.\n * This function is intended to be called in a fragment shader to access a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The value should have been\n * previously written in the vertex shader with a call to\n * {@link czm_writeNonPerspective}.\n *\n * @name czm_readNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.\n * @param {float} oneOverW One over the perspective divide value, `w`. Usually this is simply `gl_FragCoord.w`.\n * @returns {float|vec2|vec3|vec4} The usable value.\n */\nfloat czm_readNonPerspective(float value, float oneOverW) {\n    return value * oneOverW;\n}\n\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\n    return value * oneOverW;\n}\n\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\n    return value * oneOverW;\n}\n\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\n    return value * oneOverW;\n}\n",rN="float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\n    float near = czm_currentFrustum.x;\n    float far = czm_currentFrustum.y;\n    float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\n    float depthFromNear = pow(2.0, log2Depth) - 1.0;\n    return far * (1.0 - near / (depthFromNear + near)) / (far - near);\n#endif\n    return logZ;\n}\n",oN="/**\n * Converts an RGB color to HSB (hue, saturation, brightness)\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\n *\n * @name czm_RGBToHSB\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\nvec3 czm_RGBToHSB(vec3 rgb)\n{\n    vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\n    vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\n\n    float d = q.x - min(q.w, q.y);\n    return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n",aN="/**\n * Converts an RGB color to HSL (hue, saturation, lightness)\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\n *\n * @name czm_RGBToHSL\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSL.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n \nvec3 RGBtoHCV(vec3 rgb)\n{\n    // Based on work by Sam Hocevar and Emil Persson\n    vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\n    vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\n    float c = q.x - min(q.w, q.y);\n    float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\n    return vec3(h, c, q.x);\n}\n\nvec3 czm_RGBToHSL(vec3 rgb)\n{\n    vec3 hcv = RGBtoHCV(rgb);\n    float l = hcv.z - hcv.y * 0.5;\n    float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\n    return vec3(hcv.x, s, l);\n}\n",sN="/**\n * Converts an RGB color to CIE Yxy.\n * <p>The conversion is described in\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\n * </p>\n * \n * @name czm_RGBToXYZ\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in CIE Yxy.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_RGBToXYZ(vec3 rgb)\n{\n    const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n                              0.3576, 0.7152, 0.1192,\n                              0.1805, 0.0722, 0.9505);\n    vec3 xyz = RGB2XYZ * rgb;\n    vec3 Yxy;\n    Yxy.r = xyz.g;\n    float temp = dot(vec3(1.0), xyz);\n    Yxy.gb = xyz.rg / temp;\n    return Yxy;\n}\n",cN="/**\n * Round a floating point value. This function exists because round() doesn't\n * exist in GLSL 1.00. \n *\n * @param {float|vec2|vec3|vec4} value The value to round\n * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.\n */\nfloat czm_round(float value) {\n  return floor(value + 0.5);\n}\n\nvec2 czm_round(vec2 value) {\n  return floor(value + 0.5);\n}\n\nvec3 czm_round(vec3 value) {\n  return floor(value + 0.5);\n}\n\nvec4 czm_round(vec4 value) {\n  return floor(value + 0.5);\n}\n",lN="/**\n * Samples the 4 neighboring pixels and return the weighted average.\n *\n * @private\n */\nvec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\n    direction /= dot(vec3(1.0), abs(direction));\n    vec2 rev = abs(direction.zx) - vec2(1.0);\n    vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\n                    direction.z < 0.0 ? rev.y : -rev.y);\n    vec2 uv = direction.y < 0.0 ? neg : direction.xz;\n    vec2 coord = 0.5 * uv + vec2(0.5);\n    vec2 pixel = 1.0 / textureSize;\n\n    if (lod > 0.0)\n    {\n        // Each subseqeuent mip level is half the size\n        float scale = 1.0 / pow(2.0, lod);\n        float offset = ((textureSize.y + 1.0) / textureSize.x);\n\n        coord.x *= offset;\n        coord *= scale;\n\n        coord.x += offset + pixel.x;\n        coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n    }\n    else\n    {\n        coord.x *= (textureSize.y / textureSize.x);\n    }\n\n    // Do bilinear filtering\n    #ifndef OES_texture_float_linear\n        vec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\n        vec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\n        vec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\n        vec3 color4 = texture2D(projectedMap, coord).rgb;\n\n        vec2 texturePosition = coord * textureSize;\n\n        float fu = fract(texturePosition.x);\n        float fv = fract(texturePosition.y);\n\n        vec3 average1 = mix(color4, color2, fu);\n        vec3 average2 = mix(color1, color3, fu);\n\n        vec3 color = mix(average1, average2, fv);\n    #else\n        vec3 color = texture2D(projectedMap, coord).rgb;\n    #endif\n\n    return color;\n}\n\n\n/**\n * Samples from a cube map that has been projected using an octahedral projection from the given direction.\n *\n * @name czm_sampleOctahedralProjection\n * @glslFunction\n *\n * @param {sampler2D} projectedMap The texture with the octahedral projected cube map.\n * @param {vec2} textureSize The width and height dimensions in pixels of the projected map.\n * @param {vec3} direction The normalized direction used to sample the cube map.\n * @param {float} lod The level of detail to sample.\n * @param {float} maxLod The maximum level of detail.\n * @returns {vec3} The color of the cube map at the direction.\n */\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\n    float currentLod = floor(lod + 0.5);\n    float nextLod = min(currentLod + 1.0, maxLod);\n\n    vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\n    vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\n\n    return mix(colorNextLod, colorCurrentLod, nextLod - lod);\n}\n",uN="/**\n * Adjusts the saturation of a color.\n * \n * @name czm_saturation\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the saturation of the color.\n *\n * @returns {float} The color with the saturation adjusted.\n *\n * @example\n * vec3 greyScale = czm_saturation(color, 0.0);\n * vec3 doubleSaturation = czm_saturation(color, 2.0);\n */\nvec3 czm_saturation(vec3 rgb, float adjustment)\n{\n    // Algorithm from Chapter 16 of OpenGL Shading Language\n    const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n    vec3 intensity = vec3(dot(rgb, W));\n    return mix(intensity, rgb, adjustment);\n}\n",hN="\nfloat czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)\n{\n    return czm_unpackDepth(textureCube(shadowMap, d));\n}\n\nfloat czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\n    return texture2D(shadowMap, uv).r;\n#else\n    return czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\n\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\n    return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\n    return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n",dN="\nfloat czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\n    float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\n    float strength = step(0.0, nDotL);\n#endif\n    visibility *= strength;\n#endif\n\n    visibility = max(visibility, darkness);\n    return visibility;\n}\n\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\n    float depthBias = shadowParameters.depthBias;\n    float depth = shadowParameters.depth;\n    float nDotL = shadowParameters.nDotL;\n    float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n    float darkness = shadowParameters.darkness;\n    vec3 uvw = shadowParameters.texCoords;\n\n    depth -= depthBias;\n    float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\n    float depthBias = shadowParameters.depthBias;\n    float depth = shadowParameters.depth;\n    float nDotL = shadowParameters.nDotL;\n    float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n    float darkness = shadowParameters.darkness;\n    vec2 uv = shadowParameters.texCoords;\n\n    depth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\n    vec2 texelStepSize = shadowParameters.texelStepSize;\n    float radius = 1.0;\n    float dx0 = -texelStepSize.x * radius;\n    float dy0 = -texelStepSize.y * radius;\n    float dx1 = texelStepSize.x * radius;\n    float dy1 = texelStepSize.y * radius;\n    float visibility = (\n        czm_shadowDepthCompare(shadowMap, uv, depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\n        czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n    ) * (1.0 / 9.0);\n#else\n    float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\n\n    return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n",fN="/**\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.  This is similar to the GLSL\n * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.\n * \n * @name czm_signNotZero\n * @glslFunction\n *\n * @param {} value The value for which to determine the sign.\n * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.\n */\nfloat czm_signNotZero(float value)\n{\n    return value >= 0.0 ? 1.0 : -1.0;\n}\n\nvec2 czm_signNotZero(vec2 value)\n{\n    return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\n\nvec3 czm_signNotZero(vec3 value)\n{\n    return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\n\nvec4 czm_signNotZero(vec4 value)\n{\n    return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n",pN="/**\n * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.\n * <p>\n * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].\n * </p>\n *\n * @name czm_sphericalHarmonics\n * @glslFunction\n *\n * @param {vec3} normal The normalized direction.\n * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.\n * @returns {vec3} The color at the direction.\n *\n * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf\n */\nvec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\n    vec3 L00 = coefficients[0];\n    vec3 L1_1 = coefficients[1];\n    vec3 L10 = coefficients[2];\n    vec3 L11 = coefficients[3];\n    vec3 L2_2 = coefficients[4];\n    vec3 L2_1 = coefficients[5];\n    vec3 L20 = coefficients[6];\n    vec3 L21 = coefficients[7];\n    vec3 L22 = coefficients[8];\n\n    float x = normal.x;\n    float y = normal.y;\n    float z = normal.z;\n\n    return\n          L00\n        + L1_1 * y\n        + L10 * z\n        + L11 * x\n        + L2_2 * (y * x)\n        + L2_1 * (y * z)\n        + L20 * (3.0 * z * z - 1.0)\n        + L21 * (z * x)\n        + L22 * (x * x - y * y);\n}\n",mN="/**\n * Converts an sRGB color to a linear RGB color.\n *\n * @param {vec3|vec4} srgbIn The color in sRGB space\n * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.\n */\nvec3 czm_srgbToLinear(vec3 srgbIn)\n{\n    return pow(srgbIn, vec3(2.2));\n}\n\nvec4 czm_srgbToLinear(vec4 srgbIn) \n{\n    vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n    return vec4(linearOut, srgbIn.a);\n}\n",gN="/**\n * Creates a matrix that transforms vectors from tangent space to eye space.\n *\n * @name czm_tangentToEyeSpaceMatrix\n * @glslFunction\n *\n * @param {vec3} normalEC The normal vector in eye coordinates.\n * @param {vec3} tangentEC The tangent vector in eye coordinates.\n * @param {vec3} bitangentEC The bitangent vector in eye coordinates.\n *\n * @returns {mat3} The matrix that transforms from tangent space to eye space.\n *\n * @example\n * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);\n * vec3 normal = tangentToEye * texture2D(normalMap, st).xyz;\n */\nmat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\n    vec3 normal = normalize(normalEC);\n    vec3 tangent = normalize(tangentEC);\n    vec3 bitangent = normalize(bitangentEC);\n    return mat3(tangent.x  , tangent.y  , tangent.z,\n                bitangent.x, bitangent.y, bitangent.z,\n                normal.x   , normal.y   , normal.z);\n}\n",_N="/**\n * Transforms a plane.\n * \n * @name czm_transformPlane\n * @glslFunction\n *\n * @param {vec4} plane The plane in Hessian Normal Form.\n * @param {mat4} transform The inverse-transpose of a transformation matrix.\n */\nvec4 czm_transformPlane(vec4 plane, mat4 transform) {\n    vec4 transformedPlane = transform * plane;\n    // Convert the transformed plane to Hessian Normal Form\n    float normalMagnitude = length(transformedPlane.xyz);\n    return transformedPlane / normalMagnitude;\n}\n",yN="/**\n * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},\n * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to\n * be relative to the eye.  As shown in the example, the position can then be transformed in eye\n * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},\n * respectively.\n * <p>\n * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as\n * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n * </p>\n *\n * @name czm_translateRelativeToEye\n * @glslFunction\n *\n * @param {vec3} high The position's high bits.\n * @param {vec3} low The position's low bits.\n * @returns {vec3} The position translated to be relative to the camera's position.\n *\n * @example\n * attribute vec3 positionHigh;\n * attribute vec3 positionLow;\n *\n * void main()\n * {\n *   vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n *   gl_Position = czm_modelViewProjectionRelativeToEye * p;\n * }\n *\n * @see czm_modelViewRelativeToEye\n * @see czm_modelViewProjectionRelativeToEye\n * @see czm_computePosition\n * @see EncodedCartesian3\n */\nvec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\n    vec3 highDifference = high - czm_encodedCameraPositionMCHigh;\n    vec3 lowDifference = low - czm_encodedCameraPositionMCLow;\n\n    return vec4(highDifference + lowDifference, 1.0);\n}\n",bN="/**\n * @private\n */\nvec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n    // Diffuse from directional light sources at eye (for top-down and horizon views)\n    float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\n\n    if (czm_sceneMode == czm_sceneMode3D) {\n        // (and horizon views in 3D)\n        diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n    }\n\n    diffuse = clamp(diffuse, 0.0, 1.0);\n\n    float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\n\n    // Temporary workaround for adding ambient.\n    vec3 materialDiffuse = material.diffuse * 0.5;\n\n    vec3 ambient = materialDiffuse;\n    vec3 color = ambient + material.emission;\n    color += materialDiffuse * diffuse * czm_lightColor;\n    color += material.specular * specular * czm_lightColor;\n\n    return vec4(color, material.alpha);\n}\n",vN="/**\n * Returns the transpose of the matrix.  The input <code>matrix</code> can be\n * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.\n *\n * @name czm_transpose\n * @glslFunction\n *\n * @param {} matrix The matrix to transpose.\n *\n * @returns {} The transposed matrix.\n *\n * @example\n * // GLSL declarations\n * mat2 czm_transpose(mat2 matrix);\n * mat3 czm_transpose(mat3 matrix);\n * mat4 czm_transpose(mat4 matrix);\n *\n * // Transpose a 3x3 rotation matrix to find its inverse.\n * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(\n *     positionMC, normalEC);\n * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);\n */\nmat2 czm_transpose(mat2 matrix)\n{\n    return mat2(\n        matrix[0][0], matrix[1][0],\n        matrix[0][1], matrix[1][1]);\n}\n\nmat3 czm_transpose(mat3 matrix)\n{\n    return mat3(\n        matrix[0][0], matrix[1][0], matrix[2][0],\n        matrix[0][1], matrix[1][1], matrix[2][1],\n        matrix[0][2], matrix[1][2], matrix[2][2]);\n}\n\nmat4 czm_transpose(mat4 matrix)\n{\n    return mat4(\n        matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\n        matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\n        matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\n        matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n",ON="/**\n * Unpacks a vec4 depth value to a float in [0, 1) range.\n *\n * @name czm_unpackDepth\n * @glslFunction\n *\n * @param {vec4} packedDepth The packed depth.\n *\n * @returns {float} The floating-point depth in [0, 1) range.\n */\n float czm_unpackDepth(vec4 packedDepth)\n {\n    // See Aras Pranckevičius' post Encoding Floats to RGBA\n    // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n    return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n }\n",wN="/**\n * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.\n *\n * @name czm_unpackFloat\n * @glslFunction\n *\n * @param {vec4} packedFloat The packed float.\n *\n * @returns {float} The floating-point depth in arbitrary range.\n */\nfloat czm_unpackFloat(vec4 packedFloat)\n{\n    // Convert to [0.0, 255.0] and round to integer\n    packedFloat = floor(packedFloat * 255.0 + 0.5);\n    float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;\n    float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;    \n    if (exponent == -127.0)\n    {\n        return 0.0;\n    }\n    float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);\n    float result = sign * exp2(exponent - 23.0) * mantissa;\n    return result;\n}\n",AN="/**\n * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,\n * so the return value is an int.\n * <p>\n * There are also precision limitations in WebGL 1. highp int is still limited\n * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.\n * </p>\n *\n * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.\n *\n * @return {int} The unpacked value.\n */\n int czm_unpackUint(float packedValue) {\n   float rounded = czm_round(packedValue * 255.0);\n   return int(rounded);\n }\n\n int czm_unpackUint(vec2 packedValue) {\n   vec2 rounded = czm_round(packedValue * 255.0);\n   return int(dot(rounded, vec2(1.0, 256.0)));\n }\n\n int czm_unpackUint(vec3 packedValue) {\n   vec3 rounded = czm_round(packedValue * 255.0);\n   return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));\n }\n\n int czm_unpackUint(vec4 packedValue) {\n   vec4 rounded = czm_round(packedValue * 255.0);\n   return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));\n }\n",EN="/**\n * Transform metadata values following the EXT_structural_metadata spec\n * by multiplying by scale and adding the offset. Operations are always\n * performed component-wise, even for matrices.\n * \n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.\n *\n * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.\n */\nfloat czm_valueTransform(float offset, float scale, float value) {\n  return scale * value + offset;\n}\n\nvec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {\n  return scale * value + offset;\n}\n\nvec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {\n  return scale * value + offset;\n}\n\nvec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {\n  return scale * value + offset;\n}\n\nmat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {\n  return matrixCompMult(scale, value) + offset;\n}\n\nmat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {\n  return matrixCompMult(scale, value) + offset;\n}\n\nmat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {\n  return matrixCompMult(scale, value) + offset;\n}\n",TN="#ifdef LOG_DEPTH\n// 1.0 at the near plane, increasing linearly from there.\nvarying float v_depthFromNearPlusOne;\n#ifdef SHADOW_MAP\nvarying vec3 v_logPositionEC;\n#endif\n#endif\n\nvec4 czm_updatePositionDepth(vec4 coords) {\n#if defined(LOG_DEPTH)\n\n#ifdef SHADOW_MAP\n    vec3 logPositionEC = (czm_inverseProjection * coords).xyz;\n    v_logPositionEC = logPositionEC;\n#endif\n\n    // With the very high far/near ratios used with the logarithmic depth\n    // buffer, floating point rounding errors can cause linear depth values\n    // to end up on the wrong side of the far plane, even for vertices that\n    // are really nowhere near it. Since we always write a correct logarithmic\n    // depth value in the fragment shader anyway, we just need to make sure\n    // such errors don't cause the primitive to be clipped entirely before\n    // we even get to the fragment shader.\n    coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\n#endif\n\n    return coords;\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the already computed gl_Position.\n *\n * @name czm_vertexLogDepth\n * @glslFunction\n */\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\n    v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;\n    gl_Position = czm_updatePositionDepth(gl_Position);\n#endif\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the provided clip coordinates.\n * <p>\n * An example use case for this function would be moving the vertex in window coordinates\n * before converting back to clip coordinates. Use the original vertex clip coordinates.\n * </p>\n * @name czm_vertexLogDepth\n * @glslFunction\n *\n * @param {vec4} clipCoords The vertex in clip coordinates.\n *\n * @example\n * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));\n */\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\n    v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;\n    czm_updatePositionDepth(clipCoords);\n#endif\n}\n",CN="/**\n * Transforms a position from window to eye coordinates.\n * The transform from window to normalized device coordinates is done using components\n * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating\n * the inverse of <code>czm_viewportTransformation</code>. The transformation from\n * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,\n * which is expected to be the scalar used in the perspective divide. The transformation\n * from clip to eye coordinates is done using {@link czm_inverseProjection}.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec4} fragmentCoordinate The position in window coordinates to transform.\n *\n * @returns {vec4} The transformed position in eye coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @example\n * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);\n */\nvec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\n    // Reconstruct NDC coordinates\n    float x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\n    float y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\n    float z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n    vec4 q = vec4(x, y, z, 1.0);\n\n    // Reverse the perspective division to obtain clip coordinates.\n    q /= fragmentCoordinate.w;\n\n    // Reverse the projection transformation to obtain eye coordinates.\n    if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s\n    {\n        q = czm_inverseProjection * q;\n    }\n    else\n    {\n        float top = czm_frustumPlanes.x;\n        float bottom = czm_frustumPlanes.y;\n        float left = czm_frustumPlanes.z;\n        float right = czm_frustumPlanes.w;\n\n        float near = czm_currentFrustum.x;\n        float far = czm_currentFrustum.y;\n\n        q.x = (q.x * (right - left) + left + right) * 0.5;\n        q.y = (q.y * (top - bottom) + bottom + top) * 0.5;\n        q.z = (q.z * (near - far) - near - far) * 0.5;\n        q.w = 1.0;\n    }\n\n    return q;\n}\n\n/**\n * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.\n * This function produces more accurate results for window positions with log depth than\n * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version\n * of czm_windowToEyeCoordinates.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.\n * @param {float} depthOrLogDepth A depth or log depth for the fragment.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @returns {vec4} The transformed position in eye coordinates.\n */\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n    // See reverseLogDepth.glsl. This is separate to re-use the pow.\n#ifdef LOG_DEPTH\n    float near = czm_currentFrustum.x;\n    float far = czm_currentFrustum.y;\n    float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\n    float depthFromNear = pow(2.0, log2Depth) - 1.0;\n    float depthFromCamera = depthFromNear + near;\n    vec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n    eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision\n    return eyeCoordinate;\n#else\n    vec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\n    return eyeCoordinate;\n}\n",xN="// emulated noperspective\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\n\n/**\n * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane\n * by writing the fragment's depth. See czm_depthClamp for more details.\n * <p>\n * The shader must enable the GL_EXT_frag_depth extension.\n * </p>\n *\n * @name czm_writeDepthClamp\n * @glslFunction\n *\n * @example\n * gl_FragColor = color;\n * czm_writeDepthClamp();\n *\n * @see czm_depthClamp\n */\nvoid czm_writeDepthClamp()\n{\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\n    gl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n#endif\n}\n",SN="#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#endif\n\n#endif\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * <p>\n * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when\n * ray-casting geometry using a full screen quad.\n * </p>\n * @name czm_writeLogDepth\n * @glslFunction\n *\n * @param {float} depth The depth coordinate, where 1.0 is on the near plane and\n *                      depth increases in eye-space units from there\n *\n * @example\n * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);\n */\nvoid czm_writeLogDepth(float depth)\n{\n#if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH)\n    // Discard the vertex if it's not between the near and far planes.\n    // We allow a bit of epsilon on the near plane comparison because a 1.0\n    // from the vertex shader (indicating the vertex should be _on_ the near\n    // plane) will not necessarily come here as exactly 1.0.\n    if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\n        discard;\n    }\n\n#ifdef POLYGON_OFFSET\n    // Polygon offset: m * factor + r * units\n    float factor = u_polygonOffset[0];\n    float units = u_polygonOffset[1];\n\n    // If we can't compute derivatives, just leave out the factor I guess?\n#ifdef GL_OES_standard_derivatives\n    // m = sqrt(dZdX^2 + dZdY^2);\n    float x = dFdx(depth);\n    float y = dFdy(depth);\n    float m = sqrt(x * x + y * y);\n\n    // Apply the factor before computing the log depth.\n    depth += m * factor;\n#endif\n\n#endif\n\n    gl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\n    // Apply the units after the log depth.\n    gl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n\n#endif\n}\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * <p>\n * Use this when the vertex shader calls {@link czm_vertexlogDepth}.\n * </p>\n *\n * @name czm_writeLogDepth\n * @glslFunction\n */\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\n    czm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n",IN="/**\n * Transforms a value for non-perspective interpolation by multiplying\n * it by w, the value used in the perspective divide. This function is\n * intended to be called in a vertex shader to compute the value of a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The fragment shader\n * must call {@link czm_readNonPerspective} to retrieve the final\n * non-perspective value.\n *\n * @name czm_writeNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.\n * @param {float} w The perspective divide value. Usually this is the computed `gl_Position.w`.\n * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a `varying` and read in the\n *          fragment shader with {@link czm_readNonPerspective}.\n */\nfloat czm_writeNonPerspective(float value, float w) {\n    return value * w;\n}\n\nvec2 czm_writeNonPerspective(vec2 value, float w) {\n    return value * w;\n}\n\nvec3 czm_writeNonPerspective(vec3 value, float w) {\n    return value * w;\n}\n\nvec4 czm_writeNonPerspective(vec4 value, float w) {\n    return value * w;\n}\n",PN="/**\n * Converts a CIE Yxy color to RGB.\n * <p>The conversion is described in\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\n * </p>\n * \n * @name czm_XYZToRGB\n * @glslFunction\n * \n * @param {vec3} Yxy The color in CIE Yxy.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_XYZToRGB(vec3 Yxy)\n{\n    const mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,\n                              -1.5371,  1.8760, -0.2040,\n                              -0.4985,  0.0416,  1.0572);\n    vec3 xyz;\n    xyz.r = Yxy.r * Yxy.g / Yxy.b;\n    xyz.g = Yxy.r;\n    xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\n    \n    return XYZ2RGB * xyz;\n}\n",DN={czm_degreesPerRadian:uM,czm_depthRange:hM,czm_epsilon1:dM,czm_epsilon2:fM,czm_epsilon3:pM,czm_epsilon4:mM,czm_epsilon5:gM,czm_epsilon6:_M,czm_epsilon7:yM,czm_infinity:bM,czm_oneOverPi:vM,czm_oneOverTwoPi:OM,czm_passCesium3DTile:wM,czm_passCesium3DTileClassification:AM,czm_passCesium3DTileClassificationIgnoreShow:EM,czm_passClassification:TM,czm_passCompute:CM,czm_passEnvironment:xM,czm_passGlobe:SM,czm_passOpaque:IM,czm_passOverlay:PM,czm_passTerrainClassification:DM,czm_passTranslucent:RM,czm_pi:jM,czm_piOverFour:MM,czm_piOverSix:LM,czm_piOverThree:NM,czm_piOverTwo:BM,czm_radiansPerDegree:FM,czm_sceneMode2D:zM,czm_sceneMode3D:kM,czm_sceneModeColumbusView:UM,czm_sceneModeMorphing:VM,czm_solarRadius:HM,czm_threePiOver2:GM,czm_twoPi:qM,czm_webMercatorMaxLatitude:WM,czm_depthRangeStruct:YM,czm_material:XM,czm_materialInput:KM,czm_modelMaterial:JM,czm_modelVertexOutput:ZM,czm_pbrParameters:$M,czm_ray:QM,czm_raySegment:eL,czm_shadowParameters:tL,czm_acesTonemapping:nL,czm_alphaWeight:iL,czm_antialias:rL,czm_approximateSphericalCoordinates:oL,czm_backFacing:aL,czm_branchFreeTernary:sL,czm_cascadeColor:cL,czm_cascadeDistance:lL,czm_cascadeMatrix:uL,czm_cascadeWeights:hL,czm_columbusViewMorph:dL,czm_computePosition:fL,czm_cosineAndSine:pL,czm_decompressTextureCoordinates:mL,czm_defaultPbrMaterial:gL,czm_depthClamp:_L,czm_eastNorthUpToEyeCoordinates:yL,czm_ellipsoidContainsPoint:bL,czm_ellipsoidWgs84TextureCoordinates:vL,czm_equalsEpsilon:OL,czm_eyeOffset:wL,czm_eyeToWindowCoordinates:AL,czm_fastApproximateAtan:EL,czm_fog:TL,czm_gammaCorrect:CL,czm_geodeticSurfaceNormal:xL,czm_getDefaultMaterial:SL,czm_getLambertDiffuse:IL,czm_getSpecular:PL,czm_getWaterNoise:DL,czm_HSBToRGB:RL,czm_HSLToRGB:jL,czm_hue:ML,czm_inverseGamma:LL,czm_isEmpty:NL,czm_isFull:BL,czm_latitudeToWebMercatorFraction:FL,czm_linearToSrgb:zL,czm_lineDistance:kL,czm_luminance:UL,czm_metersPerPixel:VL,czm_modelToWindowCoordinates:HL,czm_multiplyWithColorBalance:GL,czm_nearFarScalar:qL,czm_octDecode:WL,czm_packDepth:YL,czm_pbrLighting:XL,czm_pbrMetallicRoughnessMaterial:KL,czm_pbrSpecularGlossinessMaterial:JL,czm_phong:ZL,czm_planeDistance:$L,czm_pointAlongRay:QL,czm_rayEllipsoidIntersectionInterval:eN,czm_raySphereIntersectionInterval:tN,czm_readDepth:nN,czm_readNonPerspective:iN,czm_reverseLogDepth:rN,czm_RGBToHSB:oN,czm_RGBToHSL:aN,czm_RGBToXYZ:sN,czm_round:cN,czm_sampleOctahedralProjection:lN,czm_saturation:uN,czm_shadowDepthCompare:hN,czm_shadowVisibility:dN,czm_signNotZero:fN,czm_sphericalHarmonics:pN,czm_srgbToLinear:mN,czm_tangentToEyeSpaceMatrix:gN,czm_transformPlane:_N,czm_translateRelativeToEye:yN,czm_translucentPhong:bN,czm_transpose:vN,czm_unpackDepth:ON,czm_unpackFloat:wN,czm_unpackUint:AN,czm_valueTransform:EN,czm_vertexLogDepth:TN,czm_windowToEyeCoordinates:CN,czm_writeDepthClamp:xN,czm_writeLogDepth:SN,czm_writeNonPerspective:IN,czm_XYZToRGB:PN};function RN(e){return(e=e.replace(/\/\/.*/g,"")).replace(/\/\*\*[\s\S]*?\*\//gm,(function(e){const t=e.match(/\n/gm).length;let n="";for(let e=0;e<t;++e)n+="\n";return n}))}function jN(e,t,n){let i;for(let t=0;t<n.length;++t)n[t].name===e&&(i=n[t]);return Object(l.a)(i)||(i={name:e,glslSource:t=RN(t),dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function MN(e){const t=[],n=jN("main",e,t);!function e(t,n){if(t.evaluated)return;t.evaluated=!0;let i=t.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);Object(l.a)(i)&&null!==i&&(i=i.filter((function(e,t){return i.indexOf(e)===t})),i.forEach((function(i){if(i!==t.name&&NN._czmBuiltinsAndUniforms.hasOwnProperty(i)){const r=jN(i,NN._czmBuiltinsAndUniforms[i],n);t.dependsOn.push(r),r.requiredBy.push(t),e(r,n)}})))}(n,t),function(e){const t=[],n=[];for(;e.length>0;){const i=e.pop();n.push(i),0===i.requiredBy.length&&t.push(i)}for(;t.length>0;){const n=t.shift();e.push(n);for(let e=0;e<n.dependsOn.length;++e){const i=n.dependsOn[e],r=i.requiredBy.indexOf(n);i.requiredBy.splice(r,1),0===i.requiredBy.length&&t.push(i)}}const i=[];for(let e=0;e<n.length;++e)0!==n[e].requiredBy.length&&i.push(n[e]);if(0!==i.length){let e="A circular dependency was found in the following built-in functions/structs/constants: \n";for(let t=0;t<i.length;++t)e=e+i[t].name+"\n";throw new u.a(e)}}(t);let i="";for(let e=t.length-1;e>=0;--e)i=i+t[e].glslSource+"\n";return i.replace(n.glslSource,"")}function LN(e,t,n){let i,r,o="";const a=e.sources;if(Object(l.a)(a))for(i=0,r=a.length;i<r;++i)o+="\n#line 0\n"+a[i];let s;o=RN(o),o=o.replace(/#version\s+(.*?)\n/gm,(function(e,t){if(Object(l.a)(s)&&s!==t)throw new u.a(`inconsistent versions found: ${s} and ${t}`);return s=t,"\n"}));const c=[];o=o.replace(/#extension.*\n/gm,(function(e){return c.push(e),"\n"})),o=o.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");const h=e.pickColorQualifier;Object(l.a)(h)&&(o=NN.createPickFragmentShaderSource(o,h));let d="";Object(l.a)(s)&&(d=`#version ${s}\n`);const f=c.length;for(i=0;i<f;i++)d+=c[i];t&&(d+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp float;\n    precision highp int;\n#else\n    precision mediump float;\n    precision mediump int;\n    #define highp mediump\n#endif\n\n");const p=e.defines;if(Object(l.a)(p))for(i=0,r=p.length;i<r;++i){const e=p[i];0!==e.length&&(d+=`#define ${e}\n`)}return n.webgl2&&(d+="#define OUTPUT_DECLARATION\n\n"),n.textureFloatLinear&&(d+="#define OES_texture_float_linear\n\n"),n.floatingPointTexture&&(d+="#define OES_texture_float\n\n"),e.includeBuiltIns&&(d+=MN(o)),d+="\n#line 0\n",d+=o,n.webgl2&&(d=lM(d,t,!0)),d}function NN(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).pickColorQualifier;if(Object(l.a)(t)&&"uniform"!==t&&"varying"!==t)throw new u.a("options.pickColorQualifier must be 'uniform' or 'varying'.");this.defines=Object(l.a)(e.defines)?e.defines.slice(0):[],this.sources=Object(l.a)(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=Object(c.a)(e.includeBuiltIns,!0)}NN.prototype.clone=function(){return new NN({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},NN.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},NN.prototype.createCombinedVertexShader=function(e){return LN(this,!1,e)},NN.prototype.createCombinedFragmentShader=function(e){return LN(this,!0,e)},NN._czmBuiltinsAndUniforms={};for(const e in DN)DN.hasOwnProperty(e)&&(NN._czmBuiltinsAndUniforms[e]=DN[e]);for(const e in Ej)if(Ej.hasOwnProperty(e)){const t=Ej[e];"function"==typeof t.getDeclaration&&(NN._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}function BN(e,t){const n=e.sources,i=n.length;for(let e=0;e<i;++e)if(-1!==n[e].indexOf(t))return!0;return!1}function FN(e,t){const n=t.length;for(let i=0;i<n;++i){const n=t[i];if(BN(e,n))return n}}NN.createPickVertexShaderSource=function(e){return NN.replaceMain(e,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    czm_pickColor = pickColor; \n}"},NN.createPickFragmentShaderSource=function(e,t){return`${NN.replaceMain(e,"czm_old_main")}\n${t+" vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    if (gl_FragColor.a == 0.0) { \n       discard; \n    } \n    gl_FragColor = czm_pickColor; \n}"}`};const zN=["v_normalEC","v_normal"];NN.findNormalVarying=function(e){return BN(e,"#ifdef HAS_NORMALS")?function(e,t){const n=e.defines,i=n.length;for(let e=0;e<i;++e)if(n[e]===t)return!0;return!1}(e,"HAS_NORMALS")?"v_normalEC":void 0:FN(e,zN)};const kN=["v_positionEC"];NN.findPositionVarying=function(e){return FN(e,kN)};var UN=NN,VN='attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\n\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n\nvoid main()\n{\n    vec4 position = czm_computePosition();\n\n#ifdef EXTRUDED_GEOMETRY\n    float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\n    delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\n\n    //extrudeDirection is zero for the top layer\n    position = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\n    v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\n    v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\n    vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\n    vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\n\n    // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):\n    // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)\n    // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)\n    // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)\n    vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\n    bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\n    planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\n    planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\n\n    // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)\n    // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)\n    // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)\n    idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\n    idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\n    planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\n    planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\n\n    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\n    vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\n    vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\n    // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction\n    vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\n    vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\n    vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // COLUMBUS_VIEW_2D\n\n    vec3 eastWard = southEastCorner - southWestCorner;\n    float eastExtent = length(eastWard);\n    eastWard /= eastExtent;\n\n    vec3 northWard = northWestCorner - southWestCorner;\n    float northExtent = length(northWard);\n    northWard /= northExtent;\n\n    v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\n    v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\n    v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\n    vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\n    vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\n\n    v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\n    v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\n    v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n\n#ifdef PER_INSTANCE_COLOR\n    v_color = czm_batchTable_color(batchId);\n#endif\n\n    gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);\n}\n',HN="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nvoid main(void)\n{\n#ifdef VECTOR_TILE\n    gl_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\n    gl_FragColor = vec4(1.0);\n#endif\n    czm_writeDepthClamp();\n}\n";const GN={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2,NUMBER_OF_CLASSIFICATION_TYPES:3};var qN=Object.freeze(GN);const WN={NEVER:ps.NEVER,LESS:ps.LESS,EQUAL:ps.EQUAL,LESS_OR_EQUAL:ps.LEQUAL,GREATER:ps.GREATER,NOT_EQUAL:ps.NOTEQUAL,GREATER_OR_EQUAL:ps.GEQUAL,ALWAYS:ps.ALWAYS};var YN=Object.freeze(WN);const XN={STREAM_DRAW:ps.STREAM_DRAW,STATIC_DRAW:ps.STATIC_DRAW,DYNAMIC_DRAW:ps.DYNAMIC_DRAW,validate:function(e){return e===XN.STREAM_DRAW||e===XN.STATIC_DRAW||e===XN.DYNAMIC_DRAW}};var KN=Object.freeze(XN);function JN(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context),!Object(l.a)(e.typedArray)&&!Object(l.a)(e.sizeInBytes))throw new u.a("Either options.sizeInBytes or options.typedArray is required.");if(Object(l.a)(e.typedArray)&&Object(l.a)(e.sizeInBytes))throw new u.a("Cannot pass in both options.sizeInBytes and options.typedArray.");if(Object(l.a)(e.typedArray)&&(s.a.typeOf.object("options.typedArray",e.typedArray),s.a.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!KN.validate(e.usage))throw new u.a("usage is invalid.");const t=e.context._gl,n=e.bufferTarget,i=e.typedArray;let r=e.sizeInBytes;const o=e.usage,a=Object(l.a)(i);a&&(r=i.byteLength),s.a.typeOf.number.greaterThan("sizeInBytes",r,0);const h=t.createBuffer();t.bindBuffer(n,h),t.bufferData(n,a?i:r,o),t.bindBuffer(n,null),this._id=fy(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=h,this.vertexArrayDestroyable=!0}JN.createVertexBuffer=function(e){return s.a.defined("options.context",e.context),new JN({context:e.context,bufferTarget:ps.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},JN.createIndexBuffer=function(e){if(s.a.defined("options.context",e.context),!wc.validate(e.indexDatatype))throw new u.a("Invalid indexDatatype.");if(e.indexDatatype===wc.UNSIGNED_INT&&!e.context.elementIndexUint)throw new u.a("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system.  Check context.elementIndexUint.");const t=e.context,n=e.indexDatatype,i=wc.getSizeInBytes(n),r=new JN({context:t,bufferTarget:ps.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r},Object.defineProperties(JN.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),JN.prototype._getBuffer=function(){return this._buffer},JN.prototype.copyFromArrayView=function(e,t){t=Object(c.a)(t,0),s.a.defined("arrayView",e),s.a.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);const n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)},JN.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new u.a("A WebGL 2 context is required.");if(!Object(l.a)(e))throw new u.a("readBuffer must be defined.");if(!Object(l.a)(i)||i<=0)throw new u.a("sizeInBytes must be defined and be greater than zero.");if(!Object(l.a)(t)||t<0||t+i>e._sizeInBytes)throw new u.a("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!Object(l.a)(n)||n<0||n+i>this._sizeInBytes)throw new u.a("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new u.a("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===ps.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==ps.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==ps.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===ps.ELEMENT_ARRAY_BUFFER)throw new u.a("Can not copy an index buffer into another buffer type.");const r=ps.COPY_READ_BUFFER,o=ps.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(r,e._buffer),a.copyBufferSubData(r,o,t,n,i),a.bindBuffer(o,null),a.bindBuffer(r,null)},JN.prototype.getBufferData=function(e,t,n,i){if(t=Object(c.a)(t,0),n=Object(c.a)(n,0),!this._webgl2)throw new u.a("A WebGL 2 context is required.");if(!Object(l.a)(e))throw new u.a("arrayView is required.");let r,o,a=e.byteLength;if(Object(l.a)(i)?(r=i,Object(l.a)(a)?o=1:(a=e.length,o=e.BYTES_PER_ELEMENT)):Object(l.a)(a)?(r=a-n,o=1):(a=e.length,r=a-n,o=e.BYTES_PER_ELEMENT),n<0||n>a)throw new u.a("destinationOffset must be greater than zero and less than the arrayView length.");if(n+r>a)throw new u.a("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new u.a("sourceOffset must be greater than zero and less than the buffers size.");if(t+r*o>this._sizeInBytes)throw new u.a("sourceOffset + length must be less than the buffers size.");const s=this._gl,h=ps.COPY_READ_BUFFER;s.bindBuffer(h,this._buffer),s.getBufferSubData(h,t,e,n,i),s.bindBuffer(h,null)},JN.prototype.isDestroyed=function(){return!1},JN.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),sc(this)};var ZN=JN;function $N(e,t,n,i){const r=Object(l.a)(t.vertexBuffer),o=Object(l.a)(t.value),a=t.value?t.value.length:t.componentsPerAttribute;if(!r&&!o)throw new u.a("attribute must have a vertexBuffer or a value.");if(r&&o)throw new u.a("attribute cannot have both a vertexBuffer and a value.  It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(1!==a&&2!==a&&3!==a&&4!==a){if(o)throw new u.a("attribute.value.length must be in the range [1, 4].");throw new u.a("attribute.componentsPerAttribute must be in the range [1, 4].")}if(Object(l.a)(t.componentDatatype)&&!gs.validate(t.componentDatatype))throw new u.a("attribute must have a valid componentDatatype or not specify it.");if(Object(l.a)(t.strideInBytes)&&t.strideInBytes>255)throw new u.a("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(Object(l.a)(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new u.a("instanced arrays is not supported");if(Object(l.a)(t.instanceDivisor)&&t.instanceDivisor<0)throw new u.a("attribute must have an instanceDivisor greater than or equal to zero");if(Object(l.a)(t.instanceDivisor)&&o)throw new u.a("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(Object(l.a)(t.instanceDivisor)&&t.instanceDivisor>0&&0===t.index)throw new u.a("attribute zero cannot have an instanceDivisor greater than 0");const s={index:Object(c.a)(t.index,n),enabled:Object(c.a)(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:Object(c.a)(t.componentDatatype,gs.FLOAT),normalize:Object(c.a)(t.normalize,!1),offsetInBytes:Object(c.a)(t.offsetInBytes,0),strideInBytes:Object(c.a)(t.strideInBytes,0),instanceDivisor:Object(c.a)(t.instanceDivisor,0)};if(r)s.vertexAttrib=function(e){const t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(i.glVertexAttribDivisor(t,this.instanceDivisor),i._vertexAttribDivisors[t]=this.instanceDivisor,i._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}s.disableVertexAttribArray=function(e){}}e.push(s)}function QN(e,t,n){for(let n=0;n<t.length;++n){const i=t[n];i.enabled&&i.vertexAttrib(e)}Object(l.a)(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function eB(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context),s.a.defined("options.attributes",e.attributes);const t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer;let o;const a=[];let h=1,d=!1,f=!1,p=i.length;for(o=0;o<p;++o)$N(a,i[o],o,t);for(p=a.length,o=0;o<p;++o){const e=a[o];if(Object(l.a)(e.vertexBuffer)&&0===e.instanceDivisor){const t=e.strideInBytes||e.componentsPerAttribute*gs.getSizeInBytes(e.componentDatatype);h=e.vertexBuffer.sizeInBytes/t;break}}for(o=0;o<p;++o)a[o].instanceDivisor>0&&(d=!0),Object(l.a)(a[o].value)&&(f=!0);const m={};for(o=0;o<p;++o){const e=a[o].index;if(m[e])throw new u.a(`Index ${e} is used by more than one attribute.`);m[e]=!0}let g;t.vertexArrayObject&&(g=t.glCreateVertexArray(),t.glBindVertexArray(g),QN(n,a,r),t.glBindVertexArray(null)),this._numberOfVertices=h,this._hasInstancedAttributes=d,this._hasConstantAttributes=f,this._context=t,this._gl=n,this._vao=g,this._attributes=a,this._indexBuffer=r}function tB(e){return e.values.length/e.componentsPerAttribute}function nB(e){return gs.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}eB.fromGeometry=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context);const t=e.context,n=Object(c.a)(e.geometry,c.a.EMPTY_OBJECT),i=Object(c.a)(e.bufferUsage,KN.DYNAMIC_DRAW),r=Object(c.a)(e.attributeLocations,c.a.EMPTY_OBJECT),o=Object(c.a)(e.interleave,!1),a=e.vertexArrayAttributes;let u,d,f;const p=Object(l.a)(a)?a:[],m=n.attributes;if(o){const e=function(e){let t,n,i;const r=[];for(n in e)e.hasOwnProperty(n)&&Object(l.a)(e[n])&&Object(l.a)(e[n].values)&&(r.push(n),e[n].componentDatatype===gs.DOUBLE&&(e[n].componentDatatype=gs.FLOAT,e[n].values=gs.createTypedArray(gs.FLOAT,e[n].values)));let o;const a=r.length;if(a>0)for(o=tB(e[r[0]]),t=1;t<a;++t){const n=tB(e[r[t]]);if(n!==o)throw new ye.a(`Each attribute list must have the same number of vertices.  Attribute ${r[t]} has a different number of vertices (${n.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort((function(t,n){return gs.getSizeInBytes(e[n].componentDatatype)-gs.getSizeInBytes(e[t].componentDatatype)}));let s=0;const c={};for(t=0;t<a;++t)n=r[t],i=e[n],c[n]=s,s+=nB(i);if(s>0){const l=gs.getSizeInBytes(e[r[0]].componentDatatype),u=s%l;0!==u&&(s+=l-u);const h=new ArrayBuffer(o*s),d={};for(t=0;t<a;++t){n=r[t];const i=gs.getSizeInBytes(e[n].componentDatatype);d[n]={pointer:gs.createTypedArray(e[n].componentDatatype,h),index:c[n]/i,strideInComponentType:s/i}}for(t=0;t<o;++t)for(let o=0;o<a;++o){n=r[o],i=e[n];const a=i.values,s=d[n],c=s.pointer,l=i.componentsPerAttribute;for(let e=0;e<l;++e)c[s.index+e]=a[t*l+e];s.index+=s.strideInComponentType}return{buffer:h,offsetsInBytes:c,vertexSizeInBytes:s}}}(m);if(Object(l.a)(e)){f=ZN.createVertexBuffer({context:t,typedArray:e.buffer,usage:i});const n=e.offsetsInBytes,o=e.vertexSizeInBytes;for(u in m)m.hasOwnProperty(u)&&Object(l.a)(m[u])&&(d=m[u],Object(l.a)(d.values)?p.push({index:r[u],vertexBuffer:f,componentDatatype:d.componentDatatype,componentsPerAttribute:d.componentsPerAttribute,normalize:d.normalize,offsetInBytes:n[u],strideInBytes:o}):p.push({index:r[u],value:d.value,componentDatatype:d.componentDatatype,normalize:d.normalize}))}}else for(u in m)if(m.hasOwnProperty(u)&&Object(l.a)(m[u])){d=m[u];let e=d.componentDatatype;e===gs.DOUBLE&&(e=gs.FLOAT),f=void 0,Object(l.a)(d.values)&&(f=ZN.createVertexBuffer({context:t,typedArray:gs.createTypedArray(e,d.values),usage:i})),p.push({index:r[u],vertexBuffer:f,value:d.value,componentDatatype:e,componentsPerAttribute:d.componentsPerAttribute,normalize:d.normalize})}let g;const _=n.indices;return Object(l.a)(_)&&(g=Zl.computeNumberOfVertices(n)>=h.a.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?ZN.createIndexBuffer({context:t,typedArray:new Uint32Array(_),usage:i,indexDatatype:wc.UNSIGNED_INT}):ZN.createIndexBuffer({context:t,typedArray:new Uint16Array(_),usage:i,indexDatatype:wc.UNSIGNED_SHORT})),new eB({context:t,attributes:p,indexBuffer:g})},Object.defineProperties(eB.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),eB.prototype.getAttribute=function(e){return s.a.defined("index",e),this._attributes[e]},eB.prototype._bind=function(){Object(l.a)(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&function(e){const t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;const i=t._vertexAttribDivisors,r=e._attributes,o=MD.maximumVertexAttributes;let a;if(n){const e=r.length;for(a=0;a<e;++a){const e=r[a];if(e.enabled){const n=e.instanceDivisor,r=e.index;n!==i[r]&&(t.glVertexAttribDivisor(r,n),i[r]=n)}}}else for(a=0;a<o;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}(this),this._hasConstantAttributes&&function(e,t){const n=e._attributes,i=n.length;for(let e=0;e<i;++e){const i=n[e];i.enabled&&Object(l.a)(i.value)&&i.vertexAttrib(t)}}(this,this._gl)):QN(this._gl,this._attributes,this._indexBuffer)},eB.prototype._unBind=function(){if(Object(l.a)(this._vao))this._context.glBindVertexArray(null);else{const e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){const i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},eB.prototype.isDestroyed=function(){return!1},eB.prototype.destroy=function(){const e=this._attributes;for(let t=0;t<e.length;++t){const n=e[t].vertexBuffer;Object(l.a)(n)&&!n.isDestroyed()&&n.vertexArrayDestroyable&&n.destroy()}const t=this._indexBuffer;return Object(l.a)(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),Object(l.a)(this._vao)&&this._context.glDeleteVertexArray(this._vao),sc(this)};var iB=eB;function rB(e,t,n){if(!Object(l.a)(e))throw new u.a("context is required");if(!Object(l.a)(t))throw new u.a("attributes is required");if(!Object(l.a)(n))throw new u.a("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,0===t.length)return;const i=function(e){let t=!1;const n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==gs.UNSIGNED_BYTE){t=!0;break}return t?rT.FLOAT:rT.UNSIGNED_BYTE}(t),r=e.floatingPointTexture,o=i===rT.FLOAT&&!r,a=function(e,t){const n=new Array(e.length);let i=0;const r=e.length;for(let o=0;o<r;++o){const r=e[o].componentDatatype;n[o]=i,r!==gs.UNSIGNED_BYTE&&t?i+=4:++i}return n}(t,o),s=function(e,t,n){const i=e.length,r=e[i-1],o=t[i-1];if(o.componentDatatype!==gs.UNSIGNED_BYTE&&n)return r+4;return r+1}(a,t,o),c=Math.floor(MD.maximumTextureSize/s),h=Math.min(n,c),d=s*h,f=Math.ceil(n/h),p=1/d,m=.5*p,g=1/f,_=.5*g;this._textureDimensions=new Vt(d,f),this._textureStep=new _e(p,m,g,_),this._pixelDatatype=o?rT.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=a,this._stride=s,this._texture=void 0;const y=4*d*f;this._batchValues=i!==rT.FLOAT||o?new Uint8Array(y):new Float32Array(y),this._batchValuesDirty=!1}function oB(e,t){const n=e[t].componentsPerAttribute;return 2===n?Vt:3===n?O:4===n?_e:Number}Object.defineProperties(rB.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});const aB=new _e;const sB=new _e;rB.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new u.a("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new u.a("attributeIndex is out of range");const i=this._attributes,r=this._offsets[t],o=4*this._stride*e+4*r;let a;a=this._packFloats&&i[t].componentDatatype!==rT.UNSIGNED_BYTE?function(e,t,n){let i=_e.unpack(e,t,aB);const r=_e.unpackFloat(i);i=_e.unpack(e,t+4,aB);const o=_e.unpackFloat(i);i=_e.unpack(e,t+8,aB);const a=_e.unpackFloat(i);i=_e.unpack(e,t+12,aB);const s=_e.unpackFloat(i);return _e.fromElements(r,o,a,s,n)}(this._batchValues,o,sB):_e.unpack(this._batchValues,o,sB);const s=oB(i,t);return Object(l.a)(s.fromCartesian4)?s.fromCartesian4(a,n):Object(l.a)(s.clone)?s.clone(a,n):a.x};const cB=[void 0,void 0,new Vt,new O,new _e],lB=new _e;function uB(e,t){const n=e._attributes[t],i=n.componentsPerAttribute,r=n.functionName,o=function(e){return 1===e?"float":"vec"+e}(i),a=function(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}(i);let s=`${o} ${r}(float batchId) \n{ \n    vec2 st = computeSt(batchId); \n    st.x += batchTextureStep.x * float(${e._offsets[t]}); \n`;return e._packFloats&&n.componentDatatype!==rT.UNSIGNED_BYTE?s+="vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":s+="    vec4 textureValue = texture2D(batchTexture, st); \n",s+=`    ${o} value = textureValue${a}; \n`,e._pixelDatatype!==rT.UNSIGNED_BYTE||n.componentDatatype!==gs.UNSIGNED_BYTE||n.normalize?e._pixelDatatype===rT.FLOAT&&n.componentDatatype===gs.UNSIGNED_BYTE&&n.normalize&&(s+="value /= 255.0; \n"):s+="value *= 255.0; \n",s+="    return value; \n} \n",s}rB.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new u.a("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new u.a("attributeIndex is out of range");if(!Object(l.a)(n))throw new u.a("value is required.");const i=this._attributes,r=cB[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),a=oB(this._attributes,t);if(Object(l.a)(a.equals)?a.equals(o,n):o===n)return;const s=lB;s.x=Object(l.a)(n.x)?n.x:n,s.y=Object(l.a)(n.y)?n.y:0,s.z=Object(l.a)(n.z)?n.z:0,s.w=Object(l.a)(n.w)?n.w:0;const c=this._offsets[t],h=4*this._stride*e+4*c;this._packFloats&&i[t].componentDatatype!==rT.UNSIGNED_BYTE?function(e,t,n){let i=_e.packFloat(e.x,aB);_e.pack(i,t,n),i=_e.packFloat(e.y,i),_e.pack(i,t,n+4),i=_e.packFloat(e.z,i),_e.pack(i,t,n+8),i=_e.packFloat(e.w,i),_e.pack(i,t,n+12)}(s,this._batchValues,h):_e.pack(s,this._batchValues,h),this._batchValuesDirty=!0},rB.prototype.update=function(e){Object(l.a)(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,Object(l.a)(this._texture)||function(e,t){const n=e._textureDimensions;e._texture=new JD({context:t,pixelFormat:aT.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:WD.NEAREST,flipY:!1})}(this,e.context),function(e){const t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}(this))},rB.prototype.getUniformMapCallback=function(){const e=this;return function(t){if(0===e._attributes.length)return t;const n={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return Object(up.a)(t,n)}},rB.prototype.getVertexShaderCallback=function(){const e=this._attributes;if(0===e.length)return function(e){return e};let t="uniform highp sampler2D batchTexture; \n";t+=function(e){const t=e._stride;return 1===e._textureDimensions.y?`uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n    float stepX = batchTextureStep.x; \n    float centerX = batchTextureStep.y; \n    float numberOfAttributes = float(${t}); \n    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n`:`uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n    float stepX = batchTextureStep.x; \n    float centerX = batchTextureStep.y; \n    float stepY = batchTextureStep.z; \n    float centerY = batchTextureStep.w; \n    float numberOfAttributes = float(${t}); \n    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n`}(this)+"\n";const n=e.length;for(let e=0;e<n;++e)t+=uB(this,e);return function(e){const n=e.indexOf("void main"),i=e.substring(0,n),r=e.substring(n);return`${i}\n${t}\n${r}`}},rB.prototype.isDestroyed=function(){return!1},rB.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),sc(this)};var hB=rB;function dB(e,t){const n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});const o=n.batchId.values;for(let e=0;e<r;++e)o[e]=t}function fB(e){const t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,a=e.compressVertices,s=e.modelMatrix;let c,h,d,f=t.length;for(c=0;c<f;++c)if(Object(l.a)(t[c].geometry)){d=t[c].geometry.primitiveType;break}for(c=1;c<f;++c)if(Object(l.a)(t[c].geometry)&&t[c].geometry.primitiveType!==d)throw new u.a("All instance geometries must have the same primitiveType.");if(function(e,t,n){let i=!n;const r=e.length;let o;if(!i&&r>1){const t=e[0].modelMatrix;for(o=1;o<r;++o)if(!Me.equals(t,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)Object(l.a)(e[o].geometry)&&$d.transformToWorldCoordinates(e[o]);else Me.multiplyTransformation(t,e[0].modelMatrix,t)}(t,s,r),!r)for(c=0;c<f;++c)Object(l.a)(t[c].geometry)&&$d.splitLongitude(t[c]);if(function(e){const t=e.length;for(let n=0;n<t;++n){const t=e[n];Object(l.a)(t.geometry)?dB(t.geometry,n):Object(l.a)(t.westHemisphereGeometry)&&Object(l.a)(t.eastHemisphereGeometry)&&(dB(t.westHemisphereGeometry,n),dB(t.eastHemisphereGeometry,n))}}(t),o)for(c=0;c<f;++c){const e=t[c];Object(l.a)(e.geometry)?($d.reorderForPostVertexCache(e.geometry),$d.reorderForPreVertexCache(e.geometry)):Object(l.a)(e.westHemisphereGeometry)&&Object(l.a)(e.eastHemisphereGeometry)&&($d.reorderForPostVertexCache(e.westHemisphereGeometry),$d.reorderForPreVertexCache(e.westHemisphereGeometry),$d.reorderForPostVertexCache(e.eastHemisphereGeometry),$d.reorderForPreVertexCache(e.eastHemisphereGeometry))}let p=$d.combineInstances(t);for(f=p.length,c=0;c<f;++c){h=p[c];const e=h.attributes;if(r)for(const t in e)e.hasOwnProperty(t)&&e[t].componentDatatype===gs.DOUBLE&&$d.encodeAttribute(h,t,t+"3DHigh",t+"3DLow");else for(const t in e)if(e.hasOwnProperty(t)&&e[t].componentDatatype===gs.DOUBLE){const e=t+"3D",i=t+"2D";$d.projectTo2D(h,t,e,i,n),Object(l.a)(h.boundingSphere)&&"position"===t&&(h.boundingSphereCV=At.fromVertices(h.attributes.position2D.values)),$d.encodeAttribute(h,e,e+"High",e+"Low"),$d.encodeAttribute(h,i,i+"High",i+"Low")}a&&$d.compressVertices(h)}if(!i){let e=[];for(f=p.length,c=0;c<f;++c)h=p[c],e=e.concat($d.fitToUnsignedShortIndices(h));p=e}return p}function pB(e,t,n,i){let r,o,a;const s=i.length-1;if(s>=0){const e=i[s];r=e.offset+e.count,a=e.index,o=n[a].indices.length}else r=0,a=0,o=n[a].indices.length;const c=e.length;for(let s=0;s<c;++s){const c=e[s][t];if(!Object(l.a)(c))continue;const u=c.indices.length;r+u>o&&(r=0,o=n[++a].indices.length),i.push({index:a,offset:r,count:u}),r+=u}}const mB={};function gB(e,t){const n=e.attributes;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e];Object(l.a)(i)&&Object(l.a)(i.values)&&t.push(i.values.buffer)}Object(l.a)(e.indices)&&t.push(e.indices.buffer)}function _B(e,t){const n=e.length,i=new Float64Array(1+19*n);let r=0;i[r++]=n;for(let t=0;t<n;t++){const n=e[t];if(Me.pack(n.modelMatrix,i,r),r+=Me.packedLength,Object(l.a)(n.attributes)&&Object(l.a)(n.attributes.offset)){const e=n.attributes.offset.value;i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2]}r+=3}return t.push(i.buffer),i}function yB(e){const t=e.length,n=1+(At.packedLength+1)*t,i=new Float32Array(n);let r=0;i[r++]=t;for(let n=0;n<t;++n){const t=e[n];Object(l.a)(t)?(i[r++]=1,At.pack(e[n],i,r)):i[r++]=0,r+=At.packedLength}return i}function bB(e){const t=new Array(e[0]);let n=0,i=1;for(;i<e.length;)1===e[i++]&&(t[n]=At.unpack(e,i)),++n,i+=At.packedLength;return t}mB.combineGeometry=function(e){let t,n;const i=e.instances,r=i.length;let o,a,s=!1;r>0&&(t=fB(e),t.length>0&&(n=$d.createAttributeLocations(t[0]),e.createPickOffsets&&(o=function(e,t){const n=[];return pB(e,"geometry",t,n),pB(e,"westHemisphereGeometry",t,n),pB(e,"eastHemisphereGeometry",t,n),n}(i,t))),Object(l.a)(i[0].attributes)&&Object(l.a)(i[0].attributes.offset)&&(a=new Array(r),s=!0));const c=new Array(r),u=new Array(r);for(let e=0;e<r;++e){const t=i[e],n=t.geometry;Object(l.a)(n)&&(c[e]=n.boundingSphere,u[e]=n.boundingSphereCV,s&&(a[e]=t.geometry.offsetAttribute));const r=t.eastHemisphereGeometry,o=t.westHemisphereGeometry;Object(l.a)(r)&&Object(l.a)(o)&&(Object(l.a)(r.boundingSphere)&&Object(l.a)(o.boundingSphere)&&(c[e]=At.union(r.boundingSphere,o.boundingSphere)),Object(l.a)(r.boundingSphereCV)&&Object(l.a)(o.boundingSphereCV)&&(u[e]=At.union(r.boundingSphereCV,o.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:a,boundingSpheres:c,boundingSpheresCV:u}},mB.packCreateGeometryResults=function(e,t){const n=new Float64Array(function(e){let t=1;const n=e.length;for(let i=0;i<n;i++){const n=e[i];if(++t,!Object(l.a)(n))continue;const r=n.attributes;t+=7+2*At.packedLength+(Object(l.a)(n.indices)?n.indices.length:0);for(const e in r)if(r.hasOwnProperty(e)&&Object(l.a)(r[e])){t+=5+r[e].values.length}}return t}(e)),i=[],r={},o=e.length;let a=0;n[a++]=o;for(let t=0;t<o;t++){const o=e[t],s=Object(l.a)(o);if(n[a++]=s?1:0,!s)continue;n[a++]=o.primitiveType,n[a++]=o.geometryType,n[a++]=Object(c.a)(o.offsetAttribute,-1);const u=Object(l.a)(o.boundingSphere)?1:0;n[a++]=u,u&&At.pack(o.boundingSphere,n,a),a+=At.packedLength;const h=Object(l.a)(o.boundingSphereCV)?1:0;n[a++]=h,h&&At.pack(o.boundingSphereCV,n,a),a+=At.packedLength;const d=o.attributes,f=[];for(const e in d)d.hasOwnProperty(e)&&Object(l.a)(d[e])&&(f.push(e),Object(l.a)(r[e])||(r[e]=i.length,i.push(e)));n[a++]=f.length;for(let e=0;e<f.length;e++){const t=f[e],i=d[t];n[a++]=r[t],n[a++]=i.componentDatatype,n[a++]=i.componentsPerAttribute,n[a++]=i.normalize?1:0,n[a++]=i.values.length,n.set(i.values,a),a+=i.values.length}const p=Object(l.a)(o.indices)?o.indices.length:0;n[a++]=p,p>0&&(n.set(o.indices,a),a+=p)}return t.push(n.buffer),{stringTable:i,packedData:n}},mB.unpackCreateGeometryResults=function(e){const t=e.stringTable,n=e.packedData;let i;const r=new Array(n[0]);let o=0,a=1;for(;a<n.length;){if(!(1===n[a++])){r[o++]=void 0;continue}const e=n[a++],s=n[a++];let c,l,u=n[a++];-1===u&&(u=void 0);1===n[a++]&&(c=At.unpack(n,a)),a+=At.packedLength;let h,d,f;1===n[a++]&&(l=At.unpack(n,a)),a+=At.packedLength;const p=new Ql,m=n[a++];for(i=0;i<m;i++){const e=t[n[a++]],i=n[a++];f=n[a++];const r=0!==n[a++];h=n[a++],d=gs.createTypedArray(i,h);for(let e=0;e<h;e++)d[e]=n[a++];p[e]=new $l({componentDatatype:i,componentsPerAttribute:f,normalize:r,values:d})}let g;if(h=n[a++],h>0){const e=d.length/f;for(g=wc.createTypedArray(e,h),i=0;i<h;i++)g[i]=n[a++]}r[o++]=new Zl({primitiveType:e,geometryType:s,boundingSphere:c,boundingSphereCV:l,indices:g,attributes:p,offsetAttribute:u})}return r},mB.packCombineGeometryParameters=function(e,t){const n=e.createGeometryResults,i=n.length;for(let e=0;e<i;e++)t.push(n[e].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:_B(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof q,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},mB.unpackCombineGeometryParameters=function(e){const t=function(e){const t=e,n=new Array(t[0]);let i=0,r=1;for(;r<t.length;){const e=Me.unpack(t,r);let o;r+=Me.packedLength,Object(l.a)(t[r])&&(o={offset:new HE(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:e,attributes:o}}return n}(e.packedInstances),n=e.createGeometryResults,i=n.length;let r=0;for(let e=0;e<i;e++){const i=mB.unpackCreateGeometryResults(n[e]),o=i.length;for(let e=0;e<o;e++){const n=i[e];t[r].geometry=n,++r}}const o=H.clone(e.ellipsoid);return{instances:t,ellipsoid:o,projection:e.isGeographic?new q(o):new Zs(o),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:Me.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},mB.packCombineGeometryResults=function(e,t){Object(l.a)(e.geometries)&&function(e,t){const n=e.length;for(let i=0;i<n;++i)gB(e[i],t)}(e.geometries,t);const n=yB(e.boundingSpheres),i=yB(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}},mB.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:bB(e.boundingSpheres),boundingSpheresCV:bB(e.boundingSpheresCV)}};var vB=mB;var OB=Object.freeze({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6});const wB={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3,getMorphTime:function(e){return e===wB.SCENE3D?1:e!==wB.MORPHING?0:void 0}};var AB=Object.freeze(wB);const EB={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4,castShadows:function(e){return e===EB.ENABLED||e===EB.CAST_ONLY},receiveShadows:function(e){return e===EB.ENABLED||e===EB.RECEIVE_ONLY},fromCastReceive:function(e,t){return e&&t?EB.ENABLED:e?EB.CAST_ONLY:t?EB.RECEIVE_ONLY:EB.DISABLED}};var TB=Object.freeze(EB);function CB(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=new Me,this.show=Object(c.a)(e.show,!0),this._vertexCacheOptimize=Object(c.a)(e.vertexCacheOptimize,!1),this._interleave=Object(c.a)(e.interleave,!1),this._releaseGeometryInstances=Object(c.a)(e.releaseGeometryInstances,!0),this._allowPicking=Object(c.a)(e.allowPicking,!0),this._asynchronous=Object(c.a)(e.asynchronous,!0),this._compressVertices=Object(c.a)(e.compressVertices,!0),this.cull=Object(c.a)(e.cull,!0),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,Object(l.a)(this.rtcCenter)&&(!Object(l.a)(this.geometryInstances)||Array.isArray(this.geometryInstances)&&1!==this.geometryInstances.length))throw new u.a("Relative-to-center rendering only supports one geometry instance.");this.shadows=Object(c.a)(e.shadows,TB.DISABLED),this._translucent=void 0,this._state=OB.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1;const t=this;this._readyPromise=new Promise((e,n)=>{t._completeLoad=(i,r,o)=>{this._error=o,this._state=r,i.afterRender.push((function(){t._ready=t._state===OB.COMPLETE||t._state===OB.FAILED,Object(l.a)(o)?n(o):e(t)}))}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(CB.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}});const xB=new Vt,SB=new O,IB=new _e;function PB(e){const t=e.length;return 1===t?e[0]:2===t?Vt.unpack(e,0,xB):3===t?O.unpack(e,0,SB):4===t?_e.unpack(e,0,IB):void 0}function DB(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(0===r)return;const o=function(e){const t=e.length,n=[],i=e[0].attributes;let r;for(r in i)if(i.hasOwnProperty(r)&&Object(l.a)(i[r])){const o=i[r];let a=!0;for(let n=1;n<t;++n){const t=e[n].attributes[r];if(!Object(l.a)(t)||o.componentDatatype!==t.componentDatatype||o.componentsPerAttribute!==t.componentsPerAttribute||o.normalize!==t.normalize){a=!1;break}}a&&n.push(r)}return n}(i),a=o.length,s=[],u={},h={};let d;let f,p,m,g=i[0].attributes;for(f=0;f<a;++f)p=o[f],m=g[p],u[p]=f,s.push({functionName:"czm_batchTable_"+p,componentDatatype:m.componentDatatype,componentsPerAttribute:m.componentsPerAttribute,normalize:m.normalize});-1!==o.indexOf("distanceDisplayCondition")&&(s.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:gs.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:gs.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:gs.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:gs.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:gs.FLOAT,componentsPerAttribute:1}),h.center3DHigh=s.length-5,h.center3DLow=s.length-4,h.center2DHigh=s.length-3,h.center2DLow=s.length-2,h.radius=s.length-1),-1!==o.indexOf("offset")&&(s.push({functionName:"czm_batchTable_offset2D",componentDatatype:gs.FLOAT,componentsPerAttribute:3}),d=s.length-1),s.push({functionName:"czm_batchTable_pickColor",componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});const _=s.length,y=new hB(t,s,r);for(f=0;f<r;++f){const n=i[f];g=n.attributes;for(let e=0;e<a;++e){p=o[e],m=g[p];const t=PB(m.value),n=u[p];y.setBatchedAttribute(f,n,t)}const r={primitive:Object(c.a)(n.pickPrimitive,e)};Object(l.a)(n.id)&&(r.id=n.id);const s=t.createPickId(r);e._pickIds.push(s);const h=s.color,d=IB;d.x=sp.floatToByte(h.red),d.y=sp.floatToByte(h.green),d.z=sp.floatToByte(h.blue),d.w=sp.floatToByte(h.alpha),y.setBatchedAttribute(f,_-1,d)}e._batchTable=y,e._batchTableAttributeIndices=u,e._batchTableBoundingSphereAttributeIndices=h,e._batchTableOffsetAttribute2DIndex=d}function RB(e){let t;return t=Array.isArray(e.values)?e.values.slice(0):new e.values.constructor(e.values),new $l({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function jB(e){const t=e.attributes,n=new Ql;for(const e in t)t.hasOwnProperty(e)&&Object(l.a)(t[e])&&(n[e]=RB(t[e]));let i;if(Object(l.a)(e.indices)){const t=e.indices;i=Array.isArray(t)?t.slice(0):new t.constructor(t)}return new Zl({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:At.clone(e.boundingSphere)})}function MB(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:Me.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const LB=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;function NB(e){return UN.replaceMain(e,"czm_non_pick_main")+"\nvarying vec4 v_pickColor; \nvoid main() \n{ \n    czm_non_pick_main(); \n    v_pickColor = czm_batchTable_pickColor(batchId); \n}"}function BB(e){return"varying vec4 v_pickColor;\n"+e}function FB(e,t){if(!e.compressVertices)return t;const n=-1!==t.search(/attribute\s+vec3\s+normal;/g),i=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!n&&!i)return t;const r=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+bitangent;/g);let a=i&&n?2:1;a+=r||o?1:0;const s="compressedAttributes",c=`attribute ${a>1?"vec"+a:"float"} ${s};`;let l="",u="";if(i){l+="vec2 st;\n";u+=`    st = czm_decompressTextureCoordinates(${a>1?s+".x":s});\n`}n&&r&&o?(l+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",u+=`    czm_octDecode(${s}.${i?"yz":"xy"}, normal, tangent, bitangent);\n`):(n&&(l+="vec3 normal;\n",u+=`    normal = czm_octDecode(${s}${a>1?"."+(i?"y":"x"):""});\n`),r&&(l+="vec3 tangent;\n",u+=`    tangent = czm_octDecode(${s}.${i&&n?"z":"y"});\n`),o&&(l+="vec3 bitangent;\n",u+=`    bitangent = czm_octDecode(${s}.${i&&n?"z":"y"});\n`));let h=t;h=h.replace(/attribute\s+vec3\s+normal;/g,""),h=h.replace(/attribute\s+vec2\s+st;/g,""),h=h.replace(/attribute\s+vec3\s+tangent;/g,""),h=h.replace(/attribute\s+vec3\s+bitangent;/g,""),h=UN.replaceMain(h,"czm_non_compressed_main");return[c,l,h,`void main() \n{ \n${u}    czm_non_compressed_main(); \n}`].join("\n")}function zB(e,t){const n=e.vertexAttributes;for(const e in n)if(n.hasOwnProperty(e)&&!Object(l.a)(t[e]))throw new u.a(`Appearance/Geometry mismatch.  The appearance requires vertex shader attribute input '${e}', which was not computed as part of the Geometry.  Use the appearance's vertexFormat property when constructing the geometry.`)}function kB(e,t){return function(){return e[t]}}CB._modifyShaderPosition=function(e,t,n){let i,r="",o="",a="";for(;null!==(i=LB.exec(t));){const s=i[1],c=`vec4 czm_compute${s[0].toUpperCase()}${s.substr(1)}()`;"vec4 czm_computePosition()"!==c&&(r+=c+";\n"),Object(l.a)(e.rtcCenter)?(r+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=c+"\n{\n    return u_modifiedModelView * position;\n}\n\n",t=(t=(t=(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,"")).replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,"")).replace(/czm_modelViewRelativeToEye\s+\*\s+/g,"")).replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?a+=c+"\n{\n"+`    return czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);\n}\n\n`:(o+=`attribute vec3 ${s}2DHigh;\nattribute vec3 ${s}2DLow;\n`,a+=c+"\n{\n    vec4 p;\n    if (czm_morphTime == 1.0)\n    {\n"+`        p = czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n`+`        p = czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy);\n    }\n    else\n    {\n        p = czm_columbusViewMorph(\n`+`                czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy),\n`+`                czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow),\n                czm_morphTime);\n    }\n    return p;\n}\n\n`)}return[r,o,t,a].join("\n")},CB._appendShowToShader=function(e,t){if(!Object(l.a)(e._batchTableAttributeIndices.show))return t;return UN.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n    czm_non_show_main(); \n    gl_Position *= czm_batchTable_show(batchId); \n}"},CB._updateColorAttribute=function(e,t,n){if(!Object(l.a)(e._batchTableAttributeIndices.color)&&!Object(l.a)(e._batchTableAttributeIndices.depthFailColor))return t;if(-1===t.search(/attribute\s+vec4\s+color;/g))return t;if(n&&!Object(l.a)(e._batchTableAttributeIndices.depthFailColor))throw new u.a("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");let i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=n?i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i},CB._updatePickColorAttribute=function(e){let t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t},CB._appendOffsetToShader=function(e,t){if(!Object(l.a)(e._batchTableAttributeIndices.offset))return t;let n="attribute float batchId;\n";n+="attribute float applyOffset;";let i=t.replace(/attribute\s+float\s+batchId;/g,"attribute float batchId;\nattribute float applyOffset;"),r="vec4 $1 = czm_computePosition();\n";return r+="    if (czm_sceneMode == czm_sceneMode3D)\n",r+="    {\n",r+="        $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",r+="    }\n",r+="    else\n",r+="    {\n",r+="        $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",r+="    }\n",i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,"vec4 $1 = czm_computePosition();\n    if (czm_sceneMode == czm_sceneMode3D)\n    {\n        $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);    }\n    else\n    {\n        $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);    }\n"),i},CB._appendDistanceDisplayConditionToShader=function(e,t,n){if(!Object(l.a)(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i="void main() \n{ \n    czm_non_distanceDisplayCondition_main(); \n    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return i+=n?"    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":"    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n    vec4 centerRTE;\n    if (czm_morphTime == 1.0)\n    {\n        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n    }\n    else\n    {\n        centerRTE = czm_columbusViewMorph(\n                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n                czm_morphTime);\n    }\n",i+="    float radiusSq = boundingSphereRadius * boundingSphereRadius; \n    float distanceSq; \n    if (czm_sceneMode == czm_sceneMode2D) \n    { \n        distanceSq = czm_eyeHeight2D.y - radiusSq; \n    } \n    else \n    { \n        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n    } \n    distanceSq = max(distanceSq, 0.0); \n    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n    gl_Position *= show; \n}",`${UN.replaceMain(t,"czm_non_distanceDisplayCondition_main")}\n${i}`};const UB=Math.max(Jr.hardwareConcurrency-1,1);let VB;const HB=new _c("combineGeometry");const GB=new Mh,qB=new R,WB=new O,YB=new At;const XB=new O,KB=new O;function JB(e,t){if(!Object(l.a)(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;const n=e._batchTableOffsetAttribute2DIndex,i=t.mapProjection,r=i.ellipsoid,o=e._batchTable,a=e._instanceBoundingSpheres,s=a.length;for(let t=0;t<s;++t){let s=a[t];if(!Object(l.a)(s))continue;const c=o.getBatchedAttribute(t,e._batchTableAttributeIndices.offset);if(O.equals(c,O.ZERO)){o.setBatchedAttribute(t,n,O.ZERO);continue}const u=e.modelMatrix;Object(l.a)(u)&&(s=At.transform(s,u,YB));let h=s.center;h=r.scaleToGeodeticSurface(h,KB);let d=r.cartesianToCartographic(h,qB);const f=i.project(d,WB),p=O.add(c,h,XB);d=r.cartesianToCartographic(p,d);const m=i.project(d,XB),g=O.subtract(m,f,XB),_=g.x;g.x=g.z,g.z=g.y,g.y=_,o.setBatchedAttribute(t,n,g)}e._batchTableOffsetsUpdated=!0}function ZB(e,t,n,i){let r,o=n.getRenderState();i?(r=Object(Zf.a)(o,!1),r.cull={enabled:!0,face:PD.BACK},e._frontFaceRS=vj.fromCache(r),r.cull.face=PD.FRONT,e._backFaceRS=vj.fromCache(r)):(e._frontFaceRS=vj.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Object(Zf.a)(o,!1),Object(l.a)(e._depthFailAppearance)&&(r.depthTest.enabled=!1),Object(l.a)(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Object(Zf.a)(o,!1),r.depthTest.func=YN.GREATER,i?(r.cull={enabled:!0,face:PD.BACK},e._frontFaceDepthFailRS=vj.fromCache(r),r.cull.face=PD.FRONT,e._backFaceDepthFailRS=vj.fromCache(r)):(e._frontFaceDepthFailRS=vj.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function $B(e,t,n){const i=t.context,r=e._attributeLocations;let o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=CB._appendOffsetToShader(e,o),o=CB._appendShowToShader(e,o),o=CB._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=NB(o),o=CB._updateColorAttribute(e,o,!1),o=FB(e,o),o=CB._modifyShaderPosition(e,o,t.scene3DOnly);let a=n.getFragmentShaderSource();a=BB(a),e._sp=oM.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),zB(e._sp,r),Object(l.a)(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=CB._appendShowToShader(e,o),o=CB._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=NB(o),o=CB._updateColorAttribute(e,o,!0),o=FB(e,o),o=CB._modifyShaderPosition(e,o,t.scene3DOnly),o=function(e){let t=UN.replaceMain(e,"czm_non_depth_clamp_main");return t+="void main() {\n    czm_non_depth_clamp_main();\n    gl_Position = czm_depthClamp(gl_Position);}\n",t}(o),a=e._depthFailAppearance.getFragmentShaderSource(),a=BB(a),a=function(e){let t=UN.replaceMain(e,"czm_non_depth_clamp_main");return t+="void main() {\n    czm_non_depth_clamp_main();\n#if defined(GL_EXT_frag_depth)\n    #if defined(LOG_DEPTH)\n        czm_writeLogDepth();\n    #else\n        czm_writeDepthClamp();\n    #endif\n#endif\n}\n",t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+t,t}(a),e._spDepthFail=oM.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),zB(e._spDepthFail,r))}const QB=new Me,eF=new O;function tF(e,t,n,i){const r=Object(l.a)(n)?n._uniforms:void 0,o={},a=t.uniforms;if(Object(l.a)(a))for(const e in a)if(a.hasOwnProperty(e)){if(Object(l.a)(r)&&Object(l.a)(r[e]))throw new u.a("Appearance and material have a uniform with the same name: "+e);o[e]=kB(a,e)}let s=Object(up.a)(o,r);return s=e._batchTable.getUniformMapCallback()(s),Object(l.a)(e.rtcCenter)&&(s.u_modifiedModelView=function(){const t=i.context.uniformState.view;return Me.multiply(t,e._modelMatrix,QB),Me.multiplyByPoint(QB,e.rtcCenter,eF),Me.setTranslation(QB,eF,QB),QB}),s}function nF(e,t,n,i,r,o,a,s){const c=tF(e,t,n,s);let u;Object(l.a)(e._depthFailAppearance)&&(u=tF(e,e._depthFailAppearance,e._depthFailAppearance.material,s));const h=i?KR.TRANSLUCENT:KR.OPAQUE;let d=r?2:1;d*=Object(l.a)(e._depthFailAppearance)?2:1,o.length=e._va.length*d;const f=o.length;let p=0;for(let t=0;t<f;++t){let n;r&&(n=o[t],Object(l.a)(n)||(n=o[t]=new XR({owner:e,primitiveType:e._primitiveType})),n.vertexArray=e._va[p],n.renderState=e._backFaceRS,n.shaderProgram=e._sp,n.uniformMap=c,n.pass=h,++t),n=o[t],Object(l.a)(n)||(n=o[t]=new XR({owner:e,primitiveType:e._primitiveType})),n.vertexArray=e._va[p],n.renderState=e._frontFaceRS,n.shaderProgram=e._sp,n.uniformMap=c,n.pass=h,Object(l.a)(e._depthFailAppearance)&&(r&&(++t,n=o[t],Object(l.a)(n)||(n=o[t]=new XR({owner:e,primitiveType:e._primitiveType})),n.vertexArray=e._va[p],n.renderState=e._backFaceDepthFailRS,n.shaderProgram=e._spDepthFail,n.uniformMap=u,n.pass=h),++t,n=o[t],Object(l.a)(n)||(n=o[t]=new XR({owner:e,primitiveType:e._primitiveType})),n.vertexArray=e._va[p],n.renderState=e._frontFaceDepthFailRS,n.shaderProgram=e._spDepthFail,n.uniformMap=u,n.pass=h),++p}}function iF(e,t,n,i,r,o,a,s){if(t.mode!==AB.SCENE3D&&!Me.equals(r,Me.IDENTITY))throw new u.a("Primitive.modelMatrix is only supported in 3D mode.");let c;CB._updateBoundingVolumes(e,t,r),t.mode===AB.SCENE3D?c=e._boundingSphereWC:t.mode===AB.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===AB.SCENE2D&&Object(l.a)(e._boundingSphere2D)?c=e._boundingSphere2D:Object(l.a)(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);const h=t.commandList,d=t.passes;if(d.render||d.pick){const t=e.allowPicking,i=TB.castShadows(e.shadows),u=TB.receiveShadows(e.shadows),d=n.length;let f=s?2:1;f*=Object(l.a)(e._depthFailAppearance)?2:1;for(let e=0;e<d;++e){const s=Math.floor(e/f),l=n[e];l.modelMatrix=r,l.boundingVolume=c[s],l.cull=o,l.debugShowBoundingVolume=a,l.castShadows=i,l.receiveShadows=u,l.pickId=t?"v_pickColor":void 0,h.push(l)}}}CB._updateBoundingVolumes=function(e,t,n,i){let r,o,a;if(i||!Me.equals(n,e._modelMatrix))for(Me.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)a=e._boundingSpheres[r],Object(l.a)(a)&&(e._boundingSphereWC[r]=At.transform(a,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=At.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphere2D[r].center.x=0,e._boundingSphereMorph[r]=At.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));const s=e.appearance.pixelSize;if(Object(l.a)(s))for(o=e._boundingSpheres.length,r=0;r<o;++r){a=e._boundingSpheres[r];const n=e._boundingSphereWC[r],i=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;n.radius=a.radius+i}},CB.prototype.update=function(e){if(!Object(l.a)(this.geometryInstances)&&0===this._va.length||Object(l.a)(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&0===this.geometryInstances.length||!Object(l.a)(this.appearance)||e.mode!==AB.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(Object(l.a)(this._error))throw this._error;if(Object(l.a)(this.rtcCenter)&&!e.scene3DOnly)throw new u.a("RTC rendering is only available for 3D only scenes.");if(this._state===OB.FAILED)return;const t=e.context;if(Object(l.a)(this._batchTable)||DB(this,t),this._batchTable.attributes.length>0){if(0===MD.maximumVertexTextureImageUnits)throw new ye.a("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==OB.COMPLETE&&this._state!==OB.COMBINED&&(this.asynchronous?function(e,t){let n,i,r,o;const a=e._instanceIds;if(e._state===OB.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const s=e._numberOfInstances=n.length,h=[];let d,f=[];for(r=0;r<s;++r){if(i=n[r].geometry,a.push(n[r].id),!Object(l.a)(i._workerName))throw new u.a("_workerName must be defined for asynchronous geometry.");f.push({moduleName:i._workerName,geometry:i})}if(!Object(l.a)(VB))for(VB=new Array(UB),r=0;r<UB;r++)VB[r]=new _c("createGeometry");for(f=jI(f,UB),r=0;r<f.length;r++){let e=0;const t=f[r],n=t.length;for(o=0;o<n;++o)d=t[o],i=d.geometry,Object(l.a)(i.constructor.pack)&&(d.offset=e,e+=Object(c.a)(i.constructor.packedLength,i.packedLength));let a;if(e>0){const r=new Float64Array(e);for(a=[r.buffer],o=0;o<n;++o)d=t[o],i=d.geometry,Object(l.a)(i.constructor.pack)&&(i.constructor.pack(i,r,d.offset),d.geometry=r)}h.push(VB[r].scheduleTask({subTasks:f[r]},a))}e._state=OB.CREATING,Promise.all(h).then((function(t){e._createGeometryResults=t,e._state=OB.CREATED})).catch((function(n){uF(e,t,OB.FAILED,n)}))}else if(e._state===OB.CREATED){const i=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const r=t.scene3DOnly,o=t.mapProjection,a=HB.scheduleTask(vB.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:o.ellipsoid,projection:o,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:r,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},i),i);e._createGeometryResults=void 0,e._state=OB.COMBINING,Promise.resolve(a).then((function(n){const i=vB.unpackCombineGeometryResults(n);e._geometries=i.geometries,e._attributeLocations=i.attributeLocations,e.modelMatrix=Me.clone(i.modelMatrix,e.modelMatrix),e._pickOffsets=i.pickOffsets,e._offsetInstanceExtend=i.offsetInstanceExtend,e._instanceBoundingSpheres=i.boundingSpheres,e._instanceBoundingSpheresCV=i.boundingSpheresCV,Object(l.a)(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=OB.COMBINED):uF(e,t,OB.FAILED,void 0)})).catch((function(n){uF(e,t,OB.FAILED,n)}))}}(this,e):function(e,t){const n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds;let a,s,c=0;for(s=0;s<i;s++){a=n[s];const e=a.geometry;let t;t=Object(l.a)(e.attributes)&&Object(l.a)(e.primitiveType)?jB(e):e.constructor.createGeometry(e),r[c++]=MB(a,t),o.push(a.id)}r.length=c;const u=t.scene3DOnly,h=t.mapProjection,d=vB.combineGeometry({instances:r,ellipsoid:h.ellipsoid,projection:h,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=Me.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,Object(l.a)(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=OB.COMBINED):uF(e,t,OB.FAILED,void 0)}(this,e)),this._state===OB.COMBINED&&(function(e,t){if(!Object(l.a)(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;const n=e._batchTableBoundingSphereAttributeIndices,i=n.center3DHigh,r=n.center3DLow,o=n.center2DHigh,a=n.center2DLow,s=n.radius,c=t.mapProjection,u=c.ellipsoid,h=e._batchTable,d=e._instanceBoundingSpheres,f=d.length;for(let n=0;n<f;++n){let f=d[n];if(!Object(l.a)(f))continue;const p=e.modelMatrix;Object(l.a)(p)&&(f=At.transform(f,p,YB));const m=f.center,g=f.radius;let _=Mh.fromCartesian(m,GB);if(h.setBatchedAttribute(n,i,_.high),h.setBatchedAttribute(n,r,_.low),!t.scene3DOnly){const e=u.cartesianToCartographic(m,qB),t=c.project(e,WB);_=Mh.fromCartesian(t,GB),h.setBatchedAttribute(n,o,_.high),h.setBatchedAttribute(n,a,_.low)}h.setBatchedAttribute(n,s,g)}e._batchTableBoundingSpheresUpdated=!0}(this,e),JB(this,e),function(e,t){const n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,a=[],s=i.length;for(let c=0;c<s;++c){const s=i[c];if(a.push(iB.fromGeometry({context:o,geometry:s,attributeLocations:n,bufferUsage:KN.STATIC_DRAW,interleave:e._interleave})),Object(l.a)(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,s);else if(e._boundingSpheres.push(At.clone(s.boundingSphere)),e._boundingSphereWC.push(new At),!r){const t=s.boundingSphereCV.center,n=t.x,i=t.y,r=t.z;t.x=r,t.y=n,t.z=i,e._boundingSphereCV.push(At.clone(s.boundingSphereCV)),e._boundingSphere2D.push(new At),e._boundingSphereMorph.push(new At)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,uF(e,t,OB.COMPLETE,void 0)}(this,e)),!this.show||this._state!==OB.COMPLETE)return;this._batchTableOffsetsUpdated||JB(this,e),this._recomputeBoundingSpheres&&function(e,t){const n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!Object(l.a)(n))return void(e._recomputeBoundingSpheres=!1);let i;const r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,a=o.length;let s=e._tempBoundingSpheres;if(!Object(l.a)(s)){for(s=new Array(a),i=0;i<a;i++)s[i]=new At;e._tempBoundingSpheres=s}for(i=0;i<a;++i){let t=s[i];const a=e._batchTable.getBatchedAttribute(i,n,new O);t=o[i].clone(t),aF(t,a,r[i])}const c=[],u=[],h=[];for(i=0;i<a;++i){const e=s[i];e.center.x-e.radius>0||At.intersectPlane(e,xi.ORIGIN_ZX_PLANE)!==W.INTERSECTING?c.push(e):(u.push(e),h.push(e))}let d=c[0],f=h[0],p=u[0];for(i=1;i<c.length;i++)d=At.union(d,c[i]);for(i=1;i<h.length;i++)f=At.union(f,h[i]);for(i=1;i<u.length;i++)p=At.union(p,u[i]);const m=[];for(Object(l.a)(d)&&m.push(d),Object(l.a)(f)&&m.push(f),Object(l.a)(p)&&m.push(p),i=0;i<m.length;i++){const n=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=n,e._boundingSphereCV[i]=At.projectTo2D(n,t.mapProjection,e._boundingSphereCV[i])}CB._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}(this,e);const n=this.appearance,i=n.material;let r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);const a=this.depthFailAppearance,s=Object(l.a)(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,r=!0,o=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,o=!0);const h=this._appearance.isTranslucent();this._translucent!==h&&(this._translucent=h,r=!0),Object(l.a)(this._material)&&this._material.update(t);const d=n.closed&&h;if(r){Object(c.a)(this._createRenderStatesFunction,ZB)(this,t,n,d)}if(o){Object(c.a)(this._createShaderProgramFunction,$B)(this,e,n)}if(r||o){Object(c.a)(this._createCommandsFunction,nF)(this,n,i,h,d,this._colorCommands,this._pickCommands,e)}Object(c.a)(this._updateAndQueueCommandsFunction,iF)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};const rF=new At,oF=new At;function aF(e,t,n){if(n===eu.TOP){const n=At.clone(e,rF),i=At.clone(e,oF);i.center=O.add(i.center,t,i.center),e=At.union(n,i,e)}else n===eu.ALL&&(e.center=O.add(e.center,t,e.center));return e}function sF(e,t,n){return function(){const i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,a=gs.createTypedArray(r.componentDatatype,o);return Object(l.a)(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function cF(e,t,n,i,r){return function(o){if(!Object(l.a)(o)||!Object(l.a)(o.length)||o.length<1||o.length>4)throw new u.a("value must be and array with length between 1 and 4.");const a=PB(o);e.setBatchedAttribute(t,n,a),"offset"===r&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}const lF=new O;function uF(e,t,n,i){e._completeLoad(t,n,i)}CB.prototype.getGeometryInstanceAttributes=function(e){if(!Object(l.a)(e))throw new u.a("id is required");if(!Object(l.a)(this._batchTable))throw new u.a("must call update before calling getGeometryInstanceAttributes");let t=-1;const n=this._lastPerInstanceAttributeIndex,i=this._instanceIds,r=i.length;for(let o=0;o<r;++o){const a=(n+o)%r;if(e===i[a]){t=a;break}}if(-1===t)return;let o=this._perInstanceAttributeCache[t];if(Object(l.a)(o))return o;const a=this._batchTable,s=this._batchTableAttributeIndices;o={};const c={};for(const e in s)if(s.hasOwnProperty(e)){const n=s[e];c[e]={get:sF(a,t,n),set:cF(a,t,n,this,e)}}return function(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(Object(l.a)(i)){i=i.clone();const r=e.modelMatrix,o=t.offset;Object(l.a)(o)&&aF(i,O.fromArray(o.get(),0,lF),e._offsetInstanceExtend[n]),Object(l.a)(r)&&(i=At.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}(this,c,t),function(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}(this,c,t),Object.defineProperties(o,c),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=o,o},CB.prototype.isDestroyed=function(){return!1},CB.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();const n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;const i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,sc(this)};var hF=CB,dF="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\n    return eyeCoordinate.xyz / eyeCoordinate.w;\n}\n\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\n    vec2 glFragCoordXY = gl_FragCoord.xy;\n    // Sample depths at both offset and negative offset\n    float upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\n    float downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\n    // Explicitly evaluate both paths\n    // Necessary for multifrustum and for edges of the screen\n    bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\n    float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\n    float useDownOrLeft = float(useUpOrRight == 0.0);\n    vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\n    vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\n    return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\n\nvoid main(void)\n{\n#ifdef REQUIRES_EC\n    float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n\n#ifdef REQUIRES_WC\n    vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n    vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n\n#ifdef TEXTURE_COORDINATES\n    vec2 uv;\n#ifdef SPHERICAL\n    // Treat world coords as a sphere normal for spherical coordinates\n    vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\n    sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\n    sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n    uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\n    uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\n    // Unpack planes and transform to eye space\n    uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\n    uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\n    // When classifying translucent geometry, logDepthOrDepth == 0.0\n    // indicates a region that should not be classified, possibly due to there\n    // being opaque pixels there in another buffer.\n    // Check for logDepthOrDepth != 0.0 to make sure this should be classified.\n    if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {\n        gl_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource\n        czm_writeDepthClamp();\n    }\n#else // CULL_FRAGMENTS\n        gl_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n\n#ifdef CULL_FRAGMENTS\n    // When classifying translucent geometry, logDepthOrDepth == 0.0\n    // indicates a region that should not be classified, possibly due to there\n    // being opaque pixels there in another buffer.\n    if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {\n        discard;\n    }\n#endif\n\n#ifdef NORMAL_EC\n    // Compute normal by sampling adjacent pixels in 2x2 block in screen space\n    vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\n    vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\n    vec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n\n\n#ifdef PER_INSTANCE_COLOR\n\n    vec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\n    gl_FragColor = color;\n#else // FLAT\n    czm_materialInput materialInput;\n    materialInput.normalEC = normalEC;\n    materialInput.positionToEyeEC = -eyeCoordinate.xyz;\n    czm_material material = czm_getDefaultMaterial(materialInput);\n    material.diffuse = color.rgb;\n    material.alpha = color.a;\n\n    gl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n\n    // Premultiply alpha. Required for classification primitives on translucent globe.\n    gl_FragColor.rgb *= gl_FragColor.a;\n\n#else // PER_INSTANCE_COLOR\n\n    // Material support.\n    // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or\n    // dependencies for culling but might not actually be used by the material.\n\n    czm_materialInput materialInput;\n\n#ifdef USES_NORMAL_EC\n    materialInput.normalEC = normalEC;\n#endif\n\n#ifdef USES_POSITION_TO_EYE_EC\n    materialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n\n#ifdef USES_TANGENT_TO_EYE\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n\n#ifdef USES_ST\n    // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired\n    // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.\n    // Shader is provided a set of reference points for remapping.\n    materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\n    materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\n\n    czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\n    gl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n\n    // Premultiply alpha. Required for classification primitives on translucent globe.\n    gl_FragColor.rgb *= gl_FragColor.a;\n\n#endif // PER_INSTANCE_COLOR\n    czm_writeDepthClamp();\n#endif // PICK\n}\n";function fF(e,t,n){s.a.typeOf.bool("extentsCulling",e),s.a.typeOf.bool("planarExtents",t),s.a.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};const i=new yF;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;const r=new yF;if(r.requiresTextureCoordinates=e,n instanceof MR)i.requiresNormalEC=!n.flat;else{const e=`${n.material.shaderSource}\n${n.fragmentShaderSource}`;i.normalEC=-1!==e.indexOf("materialInput.normalEC")||-1!==e.indexOf("czm_getDefaultMaterial"),i.positionToEyeEC=-1!==e.indexOf("materialInput.positionToEyeEC"),i.tangentToEyeMatrix=-1!==e.indexOf("materialInput.tangentToEyeMatrix"),i.st=-1!==e.indexOf("materialInput.st")}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}fF.prototype.createFragmentShader=function(e){s.a.typeOf.bool("columbusView2D",e);const t=this._appearance,n=this._colorShaderDependencies,i=[];e||this._planarExtents||i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof MR&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof MR||(r=t.material.shaderSource),new UN({defines:i,sources:[r,dF]})},fF.prototype.createPickFragmentShader=function(e){s.a.typeOf.bool("columbusView2D",e);const t=this._pickShaderDependencies,n=["PICK"];return e||this._planarExtents||n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new UN({defines:n,sources:[dF],pickColorQualifier:"varying"})},fF.prototype.createVertexShader=function(e,t,n,i){return s.a.defined("defines",e),s.a.typeOf.string("vertexShaderSource",t),s.a.typeOf.bool("columbusView2D",n),s.a.defined("mapProjection",i),_F(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},fF.prototype.createPickVertexShader=function(e,t,n,i){return s.a.defined("defines",e),s.a.typeOf.string("vertexShaderSource",t),s.a.typeOf.bool("columbusView2D",n),s.a.defined("mapProjection",i),_F(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const pF=new O,mF=new R,gF={high:0,low:0};function _F(e,t,n,i,r,o,a,s){const c=i.slice();if(""===s.eastMostYhighDefine){const e=mF;e.longitude=h.a.PI,e.latitude=0,e.height=0;const t=a.project(e,pF);let n=Mh.encode(t.x,gF);s.eastMostYhighDefine="EAST_MOST_X_HIGH "+n.high.toFixed((""+n.high).length+1),s.eastMostYlowDefine="EAST_MOST_X_LOW "+n.low.toFixed((""+n.low).length+1);const i=mF;i.longitude=-h.a.PI,i.latitude=0,i.height=0;const r=a.project(i,pF);n=Mh.encode(r.x,gF),s.westMostYhighDefine="WEST_MOST_X_HIGH "+n.high.toFixed((""+n.high).length+1),s.westMostYlowDefine="WEST_MOST_X_LOW "+n.low.toFixed((""+n.low).length+1)}return n&&(c.push(s.eastMostYhighDefine),c.push(s.eastMostYlowDefine),c.push(s.westMostYhighDefine),c.push(s.westMostYlowDefine)),Object(l.a)(o)&&o instanceof MR&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new UN({defines:c,sources:[r]})}function yF(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function bF(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/Vt.distance(t,e)}Object.defineProperties(yF.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});const vF=[new Vt,new Vt,new Vt,new Vt];function OF(e,t){const n=vF,i=Vt.unpack(t,0,n[0]),r=Vt.unpack(t,2,n[1]),o=Vt.unpack(t,4,n[2]);e.uMaxVmax=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});const a=1/bF(i,r,o),s=1/bF(i,o,r);e.uvMinAndExtents=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,s]})}const wF=new R,AF=new O,EF=new O,TF=new O,CF={high:0,low:0};function xF(e,t,n){const i=wF;i.height=0,i.longitude=e.west,i.latitude=e.south;const r=t.project(i,AF);i.latitude=e.north;const o=t.project(i,EF);i.longitude=e.east,i.latitude=e.south;const a=t.project(i,TF),s=[0,0,0,0],c=[0,0,0,0];let l=Mh.encode(r.x,CF);s[0]=l.high,c[0]=l.low,l=Mh.encode(r.y,CF),s[1]=l.high,c[1]=l.low,l=Mh.encode(o.y,CF),s[2]=l.high,c[2]=l.low,l=Mh.encode(a.x,CF),s[3]=l.high,c[3]=l.low,n.planes2D_HIGH=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:4,normalize:!1,value:s}),n.planes2D_LOW=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}const SF=new Me,IF=new Me,PF=new O,DF=new R,RF=[new R,new R,new R,new R,new R,new R,new R,new R];const jF=new O,MF=new O,LF=new Mh;fF.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){s.a.typeOf.object("boundingRectangle",e),s.a.defined("textureCoordinateRotationPoints",t),s.a.typeOf.object("ellipsoid",n),s.a.typeOf.object("projection",i);const o=AF,a=jF,l=MF;!function(e,t,n,i,r,o){const a=Be.center(e,DF);a.height=n;const s=R.toCartesian(a,t,PF),c=ca.eastNorthUpToFixedFrame(s,t,SF),l=Me.inverse(c,IF),u=e.west,h=e.east,d=e.north,f=e.south,p=RF;p[0].latitude=f,p[0].longitude=u,p[1].latitude=d,p[1].longitude=u,p[2].latitude=d,p[2].longitude=h,p[3].latitude=f,p[3].longitude=h;const m=.5*(u+h),g=.5*(d+f);p[4].latitude=f,p[4].longitude=m,p[5].latitude=d,p[5].longitude=m,p[6].latitude=g,p[6].longitude=u,p[7].latitude=g,p[7].longitude=h;let _=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,b=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY;for(let e=0;e<8;e++){p[e].height=n;const i=R.toCartesian(p[e],t,PF);Me.multiplyByPoint(l,i,i),i.z=0,_=Math.min(_,i.x),y=Math.max(y,i.x),b=Math.min(b,i.y),v=Math.max(v,i.y)}const w=i;w.x=_,w.y=b,w.z=0,Me.multiplyByPoint(c,w,w);const A=r;A.x=y,A.y=b,A.z=0,Me.multiplyByPoint(c,A,A),O.subtract(A,w,r);const E=o;E.x=_,E.y=v,E.z=0,Me.multiplyByPoint(c,E,E),O.subtract(E,w,o)}(e,n,Object(c.a)(r,0),o,a,l);const u={};OF(u,t);const h=Mh.fromCartesian(o,LF);return u.southWest_HIGH=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:3,normalize:!1,value:O.pack(h.high,[0,0,0])}),u.southWest_LOW=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:3,normalize:!1,value:O.pack(h.low,[0,0,0])}),u.eastward=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:3,normalize:!1,value:O.pack(a,[0,0,0])}),u.northward=new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:3,normalize:!1,value:O.pack(l,[0,0,0])}),xF(e,i,u),u};const NF=new O;function BF(e,t,n,i){const r=wF;r.latitude=e,r.longitude=t,r.height=0;const o=R.toCartesian(r,n,NF),a=Math.sqrt(o.x*o.x+o.y*o.y),s=h.a.fastApproximateAtan2(a,o.z),c=h.a.fastApproximateAtan2(o.x,o.y);return i.x=s,i.y=c,i}const FF=new Vt;fF.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){s.a.typeOf.object("boundingRectangle",e),s.a.defined("textureCoordinateRotationPoints",t),s.a.typeOf.object("ellipsoid",n),s.a.typeOf.object("projection",i);const r=BF(e.south,e.west,n,FF);let o=r.x,a=r.y;const c=BF(e.north,e.east,n,FF);let l=c.x,u=c.y,d=0;a>u&&(d=h.a.PI-a,a=-h.a.PI,u+=d),o-=h.a.EPSILON5,a-=h.a.EPSILON5,l+=h.a.EPSILON5,u+=h.a.EPSILON5;const f=1/(u-a),p=1/(l-o),m={sphericalExtents:new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,a,p,f]}),longitudeRotation:new Gv({componentDatatype:gs.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return OF(m,t),xF(e,i,m),m},fF.hasAttributesForTextureCoordinatePlanes=function(e){return Object(l.a)(e.southWest_HIGH)&&Object(l.a)(e.southWest_LOW)&&Object(l.a)(e.northward)&&Object(l.a)(e.eastward)&&Object(l.a)(e.planes2D_HIGH)&&Object(l.a)(e.planes2D_LOW)&&Object(l.a)(e.uMaxVmax)&&Object(l.a)(e.uvMinAndExtents)},fF.hasAttributesForSphericalExtents=function(e){return Object(l.a)(e.sphericalExtents)&&Object(l.a)(e.longitudeRotation)&&Object(l.a)(e.planes2D_HIGH)&&Object(l.a)(e.planes2D_LOW)&&Object(l.a)(e.uMaxVmax)&&Object(l.a)(e.uvMinAndExtents)},fF.shouldUseSphericalCoordinates=function(e){return s.a.typeOf.object("rectangle",e),function(e){return Math.max(e.width,e.height)>fF.MAX_WIDTH_FOR_PLANAR_EXTENTS}(e)},fF.MAX_WIDTH_FOR_PLANAR_EXTENTS=h.a.toRadians(1);var zF=fF;const kF={NEVER:ps.NEVER,LESS:ps.LESS,EQUAL:ps.EQUAL,LESS_OR_EQUAL:ps.LEQUAL,GREATER:ps.GREATER,NOT_EQUAL:ps.NOTEQUAL,GREATER_OR_EQUAL:ps.GEQUAL,ALWAYS:ps.ALWAYS};var UF=Object.freeze(kF);const VF={ZERO:ps.ZERO,KEEP:ps.KEEP,REPLACE:ps.REPLACE,INCREMENT:ps.INCR,DECREMENT:ps.DECR,INVERT:ps.INVERT,INCREMENT_WRAP:ps.INCR_WRAP,DECREMENT_WRAP:ps.DECR_WRAP};var HF=Object.freeze(VF);const GF={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15,setCesium3DTileBit:function(){return{enabled:!0,frontFunction:UF.ALWAYS,frontOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.REPLACE},backFunction:UF.ALWAYS,backOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.REPLACE},reference:GF.CESIUM_3D_TILE_MASK,mask:GF.CESIUM_3D_TILE_MASK}}};var qF=Object.freeze(GF);function WF(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).geometryInstances;this.geometryInstances=t,this.show=Object(c.a)(e.show,!0),this.classificationType=Object(c.a)(e.classificationType,qN.BOTH),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=Object(c.a)(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=Object(c.a)(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;const n=this;this._readyPromise=new Promise((e,t)=>{n._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const n=this._error;Object(l.a)(n)?t(n):e(this)}}),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:Object(c.a)(e.vertexCacheOptimize,!1),interleave:Object(c.a)(e.interleave,!1),releaseGeometryInstances:Object(c.a)(e.releaseGeometryInstances,!0),allowPicking:Object(c.a)(e.allowPicking,!0),asynchronous:Object(c.a)(e.asynchronous,!0),compressVertices:Object(c.a)(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}function YF(e,t){const n=t?UF.EQUAL:UF.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:HF.KEEP,zFail:HF.DECREMENT_WRAP,zPass:HF.KEEP},backFunction:n,backOperation:{fail:HF.KEEP,zFail:HF.INCREMENT_WRAP,zPass:HF.KEEP},reference:qF.CESIUM_3D_TILE_MASK,mask:qF.CESIUM_3D_TILE_MASK},stencilMask:qF.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:YN.LESS_OR_EQUAL},depthMask:!1}}function XF(e){return{stencilTest:{enabled:e,frontFunction:UF.NOT_EQUAL,frontOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},backFunction:UF.NOT_EQUAL,backOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},reference:0,mask:qF.CLASSIFICATION_MASK},stencilMask:qF.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:SD.PRE_MULTIPLIED_ALPHA_BLEND}}Object.defineProperties(WF.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),WF.isSupported=function(e){return e.context.stencilBuffer};const KF={stencilTest:{enabled:!0,frontFunction:UF.NOT_EQUAL,frontOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},backFunction:UF.NOT_EQUAL,backOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},reference:0,mask:qF.CLASSIFICATION_MASK},stencilMask:qF.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function JF(e,t){const n=t.context,i=e._primitive;let r=VN;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=hF._appendDistanceDisplayConditionToShader(i,r),r=hF._modifyShaderPosition(e,r,t.scene3DOnly),r=hF._updateColorAttribute(i,r);const o=e._hasPlanarExtentsAttributes,a=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=function(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/attribute\s+vec3\s+extrudeDirection;/g)){const e="compressedAttributes",n=`attribute vec2 ${e};`,i="vec3 extrudeDirection;\n",r=`    extrudeDirection = czm_octDecode(${e}, 65535.0);\n`;let o=t;o=o.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),o=UN.replaceMain(o,"czm_non_compressed_main");return[n,i,o,`void main() \n{ \n${r}    czm_non_compressed_main(); \n}`].join("\n")}}(i,r));const s=e._extruded?"EXTRUDED_GEOMETRY":"";let c=new UN({defines:[s],sources:[r]});const u=new UN({sources:[HN]}),h=e._primitive._attributeLocations,d=new zF(a,o,e.appearance);if(e._spStencil=oM.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h}),e._primitive.allowPicking){let o=UN.createPickVertexShaderSource(r);o=hF._appendShowToShader(i,o),o=hF._updatePickColorAttribute(o);const c=d.createPickFragmentShader(!1),u=d.createPickVertexShader([s],o,!1,t.mapProjection);if(e._spPick=oM.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:h}),a){let i=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!Object(l.a)(i)){const r=d.createPickFragmentShader(!0),a=d.createPickVertexShader([s],o,!0,t.mapProjection);i=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:h})}e._spPick2D=i}}else e._spPick=oM.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h});r=hF._appendShowToShader(i,r),c=new UN({defines:[s],sources:[r]}),e._sp=oM.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h});const f=d.createFragmentShader(!1),p=d.createVertexShader([s],r,!1,t.mapProjection);if(e._spColor=oM.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:p,fragmentShaderSource:f,attributeLocations:h}),a){let i=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!Object(l.a)(i)){const o=d.createFragmentShader(!0),a=d.createVertexShader([s],r,!0,t.mapProjection);i=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:h})}e._spColor2D=i}}function ZF(e,t,n,i,r,o,a){!function(e,t){const n=e._primitive;let i,r,o,a=2*n._va.length;t.length=a;let s=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap);const u=e._needs2DShader;for(i=0;i<a;i+=2){const a=n._va[s++];r=t[i],Object(l.a)(r)||(r=t[i]=new XR({owner:e,primitiveType:n._primitiveType})),r.vertexArray=a,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=KR.TERRAIN_CLASSIFICATION,o=XR.shallowClone(r,r.derivedCommands.tileset),o.renderState=e._rsStencilDepthPass3DTiles,o.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=o,r=t[i+1],Object(l.a)(r)||(r=t[i+1]=new XR({owner:e,primitiveType:n._primitiveType})),r.vertexArray=a,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=KR.TERRAIN_CLASSIFICATION;const h=e.appearance.material;if(Object(l.a)(h)&&(c=Object(up.a)(c,h._uniforms)),r.uniformMap=c,o=XR.shallowClone(r,r.derivedCommands.tileset),o.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=o,u){let t=XR.shallowClone(r,r.derivedCommands.appearance2D);t.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=t,t=XR.shallowClone(o,o.derivedCommands.appearance2D),t.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=t}}const h=e._commandsIgnoreShow,d=e._spStencil;let f=0;a=h.length=a/2;for(let e=0;e<a;++e){const n=h[e]=XR.shallowClone(t[f],h[e]);n.shaderProgram=d,n.pass=KR.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,f+=2}}(e,o),function(e,t){const n=e._usePickOffsets,i=e._primitive;let r,o,a,s,c,u=2*i._va.length,h=0;n&&(r=i._pickOffsets,u=2*r.length),t.length=u;let d=0;const f=i._batchTable.getUniformMapCallback()(e._uniformMap),p=e._needs2DShader;for(a=0;a<u;a+=2){let u=i._va[d++];if(n&&(o=r[h++],u=i._va[o.index]),s=t[a],Object(l.a)(s)||(s=t[a]=new XR({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),s.vertexArray=u,s.renderState=e._rsStencilDepthPass,s.shaderProgram=e._sp,s.uniformMap=f,s.pass=KR.TERRAIN_CLASSIFICATION,n&&(s.offset=o.offset,s.count=o.count),c=XR.shallowClone(s,s.derivedCommands.tileset),c.renderState=e._rsStencilDepthPass3DTiles,c.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=c,s=t[a+1],Object(l.a)(s)||(s=t[a+1]=new XR({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),s.vertexArray=u,s.renderState=e._rsPickPass,s.shaderProgram=e._spPick,s.uniformMap=f,s.pass=KR.TERRAIN_CLASSIFICATION,n&&(s.offset=o.offset,s.count=o.count),c=XR.shallowClone(s,s.derivedCommands.tileset),c.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=c,p){let t=XR.shallowClone(s,s.derivedCommands.pick2D);t.shaderProgram=e._spPick2D,s.derivedCommands.pick2D=t,t=XR.shallowClone(c,c.derivedCommands.pick2D),t.shaderProgram=e._spPick2D,c.derivedCommands.pick2D=t}}}(e,a)}function $F(e,t){return Math.floor(e%t/2)}function QF(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function ez(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}WF.prototype.update=function(e){if(!Object(l.a)(this._primitive)&&!Object(l.a)(this.geometryInstances))return;let t=this.appearance;Object(l.a)(t)&&Object(l.a)(t.material)&&t.material.update(e.context);const n=this,i=this._primitiveOptions;if(!Object(l.a)(this._primitive)){const e=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=e.length;let o,a,s,h,d=!1,f=!0,p=!1,m=!1;for(r>0&&(s=e[0].attributes,p=zF.hasAttributesForSphericalExtents(s),m=zF.hasAttributesForTextureCoordinatePlanes(s),h=s.color),o=0;o<r;o++){a=e[o];const t=a.attributes.color;if(Object(l.a)(t))d=!0;else if(d)throw new u.a("All GeometryInstances must have color attributes to use per-instance color.");f=f&&Object(l.a)(t)&&lp.equals(h,t)}if(!f&&!p&&!m)throw new u.a("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(d&&!Object(l.a)(t)&&(t=new MR({flat:!0}),this.appearance=t),!d&&t instanceof MR)throw new u.a("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(Object(l.a)(t.material)&&!p&&!m)throw new u.a("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!p&&!m,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=m,this._hasPerColorAttribute=d;const g=new Array(r);for(o=0;o<r;++o)a=e[o],g[o]=new Ph({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:Object(c.a)(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=g,Object(l.a)(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(e,t){n._createBoundingVolumeFunction(e,t)}),i._createRenderStatesFunction=function(e,t,i,r){!function(e,t,n,i){if(Object(l.a)(e._rsStencilDepthPass))return;const r=!e.debugShowShadowVolume;e._rsStencilDepthPass=vj.fromCache(YF(r,!1)),e._rsStencilDepthPass3DTiles=vj.fromCache(YF(r,!0)),e._rsColorPass=vj.fromCache(XF(r)),e._rsPickPass=vj.fromCache(KF)}(n)},i._createShaderProgramFunction=function(e,t,i){JF(n,t)},i._createCommandsFunction=function(e,t,i,r,o,a,s){ZF(n,0,0,0,0,a,s)},Object(l.a)(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(e,t,i,r,o,a,s,c){n._updateAndQueueCommandsFunction(e,t,i,r,o,a,s,c)}:i._updateAndQueueCommandsFunction=function(e,t,i,r,o,a,s,c){!function(e,t,n,i,r,o,a,s){const c=e._primitive;let u;hF._updateBoundingVolumes(c,t,r),t.mode===AB.SCENE3D?u=c._boundingSphereWC:t.mode===AB.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===AB.SCENE2D&&Object(l.a)(c._boundingSphere2D)?u=c._boundingSphere2D:Object(l.a)(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);const h=e.classificationType,d=h!==qN.CESIUM_3D_TILE,f=h!==qN.TERRAIN,p=t.passes;let m,g,_;if(p.render){const i=n.length;for(m=0;m<i;++m)g=u[$F(m,i)],d&&(_=n[m],QF(_,t,r,o,g,a)),f&&(_=n[m].derivedCommands.tileset,QF(_,t,r,o,g,a));if(t.invertClassification){const n=e._commandsIgnoreShow,i=n.length;for(m=0;m<i;++m)g=u[m],_=n[m],QF(_,t,r,o,g,a)}}if(p.pick){const e=i.length,n=c._pickOffsets;for(m=0;m<e;++m){g=u[n[$F(m,e)].index],d&&(_=i[m],ez(_,t,r,o,g)),f&&(_=i[m].derivedCommands.tileset,ez(_,t,r,o,g))}}}(n,t,i,r,o,a,s)},this._primitive=new hF(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=vj.fromCache(YF(!1,!1)),this._rsStencilDepthPass3DTiles=vj.fromCache(YF(!1,!0)),this._rsColorPass=vj.fromCache(XF(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=vj.fromCache(YF(!0,!1)),this._rsStencilDepthPass3DTiles=vj.fromCache(YF(!0,!0)),this._rsColorPass=vj.fromCache(XF(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&Object(l.a)(t.material))throw new u.a("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof MR)throw new u.a("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{Object(l.a)(this._primitive)&&this._primitive.ready&&this._completeLoad()})},WF.prototype.getGeometryInstanceAttributes=function(e){if(!Object(l.a)(this._primitive))throw new u.a("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},WF.prototype.isDestroyed=function(){return!1},WF.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,sc(this)};var tz=WF;const nz={u_globeMinimumAltitude:function(){return 55e3}};function iz(e){let t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).appearance;const n=e.geometryInstances;if(!Object(l.a)(t)&&Object(l.a)(n)){const e=Array.isArray(n)?n:[n],i=e.length;for(let n=0;n<i;n++){const i=e[n].attributes;if(Object(l.a)(i)&&Object(l.a)(i.color)){t=new MR({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=Object(c.a)(e.show,!0),this.classificationType=Object(c.a)(e.classificationType,qN.BOTH),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=Object(c.a)(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1;const i=this;this._readyPromise=new Promise((e,t)=>{i._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const n=this._error;Object(l.a)(n)?t(n):e(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=nn._defaultMaxTerrainHeight,this._minTerrainHeight=nn._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:Object(c.a)(e.vertexCacheOptimize,!1),interleave:Object(c.a)(e.interleave,!1),releaseGeometryInstances:Object(c.a)(e.releaseGeometryInstances,!0),allowPicking:Object(c.a)(e.allowPicking,!0),asynchronous:Object(c.a)(e.asynchronous,!0),compressVertices:Object(c.a)(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:this,_extruded:!0,_uniformMap:nz}}function rz(e){return function(t,n){const i=n.maximumRadius,r=i/Math.cos(.5*t)-i;return e._maxHeight+r}}function oz(e){return function(t,n){return e._minHeight}}Object.defineProperties(iz.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}}),iz.isSupported=tz.isSupported;const az=new O,sz=new O,cz=new O,lz=new R,uz=new Be;function hz(e,t){const n=e.mapProjection.ellipsoid;if(!Object(l.a)(t.attributes)||!Object(l.a)(t.attributes.position3DHigh))return Object(l.a)(t.rectangle)?t.rectangle:void 0;const i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length;let a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let e=0;e<o;e+=3){const t=O.unpack(i,e,az),o=O.unpack(r,e,sz),l=O.add(t,o,cz),h=n.cartesianToCartographic(l,lz),d=h.latitude,f=h.longitude;a=Math.min(a,d),s=Math.min(s,f),c=Math.max(c,d),u=Math.max(u,f)}const h=uz;return h.north=c,h.south=a,h.east=u,h.west=s,h}function dz(e,t){return Math.floor(e%t/2)}function fz(e,t,n,i,r,o,a){const s=e._primitive;n.mode!==AB.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=a,n.commandList.push(t)}function pz(e,t,n,i,r,o){const a=e._primitive;n.mode!==AB.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}iz.initializeTerrainHeights=function(){return nn.initialize()},iz.prototype.update=function(e){if(!Object(l.a)(this._primitive)&&!Object(l.a)(this.geometryInstances))return;if(!nn.initialized){if(!this.asynchronous)throw new u.a("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");return void iz.initializeTerrainHeights()}const t=this,n=this._classificationPrimitiveOptions;if(!Object(l.a)(this._primitive)){const i=e.mapProjection.ellipsoid;let r,o,a;const s=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=s.length,h=new Array(c);let d,f;for(d=0;d<c;++d){r=s[d],o=r.geometry;const t=hz(e,o);Object(l.a)(f)?Object(l.a)(t)&&Be.union(f,t,f):f=Be.clone(t);const n=r.id;if(Object(l.a)(n)&&Object(l.a)(t)){const e=nn.getBoundingSphere(t,i);this._boundingSpheresKeys.push(n),this._boundingSpheres.push(e)}if(a=o.constructor,!Object(l.a)(a)||!Object(l.a)(a.createShadowVolume))throw new u.a("Not all of the geometry instances have GroundPrimitive support.")}!function(e,t,n){const i=nn.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}(this,f,i);const p=e.terrainExaggeration,m=e.terrainExaggerationRelativeHeight;this._minHeight=Ns.getHeight(this._minTerrainHeight,p,m),this._maxHeight=Ns.getHeight(this._maxTerrainHeight,p,m);const g=iz._supportsMaterials(e.context);if(this._useFragmentCulling=g,g){let t,n=!0;for(d=0;d<c;++d)if(r=s[d],o=r.geometry,f=hz(e,o),zF.shouldUseSphericalCoordinates(f)){n=!1;break}for(d=0;d<c;++d){r=s[d],o=r.geometry,a=o.constructor;const c=hz(e,o),l=o.textureCoordinateRotationPoints;t=n?zF.getPlanarTextureCoordinateAttributes(c,l,i,e.mapProjection,this._maxHeight):zF.getSphericalExtentGeometryInstanceAttributes(c,l,i,e.mapProjection);const u=r.attributes;for(const e in u)u.hasOwnProperty(e)&&(t[e]=u[e]);h[d]=new Ph({geometry:a.createShadowVolume(o,oz(this),rz(this)),attributes:t,id:r.id})}}else for(d=0;d<c;++d)r=s[d],o=r.geometry,a=o.constructor,h[d]=new Ph({geometry:a.createShadowVolume(o,oz(this),rz(this)),attributes:r.attributes,id:r.id});n.geometryInstances=h,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(e,n){!function(e,t,n){const i=t.mapProjection.ellipsoid,r=hz(t,n),o=fs.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){const n=t.mapProjection,i=At.fromRectangleWithHeights2D(r,n,e._maxHeight,e._minHeight);O.fromElements(i.center.z,i.center.x,i.center.y,i.center),e._boundingVolumes2D.push(i)}}(t,e,n)},n._updateAndQueueCommandsFunction=function(e,n,i,r,o,a,s,c){!function(e,t,n,i,r,o,a,s){let c;c=t.mode===AB.SCENE3D?e._boundingVolumes:e._boundingVolumes2D;const l=e.classificationType,u=l!==qN.CESIUM_3D_TILE,h=l!==qN.TERRAIN,d=t.passes,f=e._primitive;let p,m,g;if(d.render){const i=n.length;for(p=0;p<i;++p)m=c[dz(p,i)],u&&(g=n[p],fz(e,g,t,r,o,m,a)),h&&(g=n[p].derivedCommands.tileset,fz(e,g,t,r,o,m,a));if(t.invertClassification){const n=f._commandsIgnoreShow,i=n.length;for(p=0;p<i;++p)m=c[p],g=n[p],fz(e,g,t,r,o,m,a)}}if(d.pick){const n=i.length;let a;for(e._useFragmentCulling||(a=f._primitive._pickOffsets),p=0;p<n;++p){if(m=c[dz(p,n)],!e._useFragmentCulling){m=c[a[dz(p,n)].index]}u&&(g=i[p],pz(e,g,t,r,o,m)),h&&(g=i[p].derivedCommands.tileset,pz(e,g,t,r,o,m))}}}(t,n,i,r,o,a,s)},this._primitive=new tz(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{Object(l.a)(this._primitive)&&this._primitive.ready&&this._completeLoad()})},iz.prototype.getBoundingSphere=function(e){const t=this._boundingSpheresKeys.indexOf(e);if(-1!==t)return this._boundingSpheres[t]},iz.prototype.getGeometryInstanceAttributes=function(e){if(!Object(l.a)(this._primitive))throw new u.a("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},iz.prototype.isDestroyed=function(){return!1},iz.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),sc(this)},iz._supportsMaterials=function(e){return e.depthTexture},iz.supportsMaterials=function(e){return s.a.typeOf.object("scene",e),iz._supportsMaterials(e.frameState.context)};var mz=iz;function gz(){u.a.throwInstantiationError()}Object.defineProperties(gz.prototype,{isConstant:{get:u.a.throwInstantiationError},definitionChanged:{get:u.a.throwInstantiationError}}),gz.prototype.getType=u.a.throwInstantiationError,gz.prototype.getValue=u.a.throwInstantiationError,gz.prototype.equals=u.a.throwInstantiationError,gz.getValue=function(e,t,n){let i;return Object(l.a)(t)&&(i=t.getType(e),Object(l.a)(i))?(Object(l.a)(n)&&n.type===i||(n=CR.fromType(i)),t.getValue(e,n.uniforms),n):(Object(l.a)(n)&&n.type===CR.ColorType||(n=CR.fromType(CR.ColorType)),sp.clone(sp.WHITE,n.uniforms.color),n)};var _z=gz;function yz(e,t,n){s.a.defined("geometryUpdater",e),s.a.defined("primitives",t),s.a.defined("orderedGroundPrimitives",n),this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}yz.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!JP.getValueOrDefault(t.show,n,!0)},yz.prototype._setOptions=u.a.throwInstantiationError,yz.prototype.update=function(e){s.a.defined("time",e);const t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;const o=this._entity,a=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,a,e),this._isHidden(o,a,e))return;const c=this._geometryUpdater.shadowsProperty.getValue(e),u=this._options;if(!Object(l.a)(a.fill)||a.fill.getValue(e)){const o=t.fillMaterialProperty,a=o instanceof NR;let s;const l=t._getIsClosed(u);if(a)s=new MR({closed:l,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{const t=_z.getValue(e,o,this._material);this._material=t,s=new SR({material:t,translucent:t.isTranslucent(),closed:l})}if(n)u.vertexFormat=MR.VERTEX_FORMAT,this._primitive=r.add(new mz({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:s,asynchronous:!1,shadows:c,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),JP.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{u.vertexFormat=s.vertexFormat;const t=this._geometryUpdater.createFillGeometryInstance(e);a&&(s.translucent=255!==t.attributes.color.value[3]),this._primitive=i.add(new hF({geometryInstances:t,appearance:s,asynchronous:!1,shadows:c}))}}if(!n&&Object(l.a)(a.outline)&&a.outline.getValue(e)){const n=this._geometryUpdater.createOutlineGeometryInstance(e),r=JP.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=i.add(new hF({geometryInstances:n,appearance:new MR({flat:!0,translucent:255!==n.attributes.color.value[3],renderState:{lineWidth:t._scene.clampLineWidth(r)}}),asynchronous:!1,shadows:c}))}},yz.prototype.getBoundingSphere=function(e){if(!Object(l.a)(e))throw new u.a("result is required.");const t=this._entity,n=this._primitive,i=this._outlinePrimitive;let r;return Object(l.a)(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),Object(l.a)(r)&&Object(l.a)(r.boundingSphere))||Object(l.a)(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),Object(l.a)(r)&&Object(l.a)(r.boundingSphere))?(At.clone(r.boundingSphere,e),XP.DONE):Object(l.a)(n)&&!n.ready||Object(l.a)(i)&&!i.ready?XP.PENDING:XP.FAILED},yz.prototype.isDestroyed=function(){return!1},yz.prototype.destroy=function(){const e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),sc(this)};var bz=yz,vz='#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC; // Technically can compute distance for this here\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n\nvoid main(void)\n{\n    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\n    vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\n\n    // Discard for sky\n    if (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n        gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\n        return;\n#else // DEBUG_SHOW_VOLUME\n        discard;\n#endif // DEBUG_SHOW_VOLUME\n    }\n\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n    eyeCoordinate /= eyeCoordinate.w;\n\n    float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\n    // Check distance of the eye coordinate against the right-facing plane\n    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n\n    // Check eye coordinate against the mitering planes\n    float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\n    float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\n\n    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n        gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\n        return;\n#else // DEBUG_SHOW_VOLUME\n        discard;\n#endif // DEBUG_SHOW_VOLUME\n    }\n\n    // Check distance of the eye coordinate against start and end planes with normals in the right plane.\n    // For computing unskewed lengthwise texture coordinate.\n    // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.\n\n    // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"\n    vec3 alignedPlaneNormal;\n\n    // start aligned plane\n    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\n    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n    distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\n\n    // end aligned plane\n    alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\n    alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n    distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n\n#ifdef PER_INSTANCE_COLOR\n    gl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\n    // Clamp - distance to aligned planes may be negative due to mitering,\n    // so fragment texture coordinate might be out-of-bounds.\n    float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\n    s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\n    float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\n\n    czm_materialInput materialInput;\n\n    materialInput.s = s;\n    materialInput.st = vec2(s, t);\n    materialInput.str = vec3(s, t, 0.0);\n\n    czm_material material = czm_getMaterial(materialInput);\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n\n    // Premultiply alpha. Required for classification primitives on translucent globe.\n    gl_FragColor.rgb *= gl_FragColor.a;\n\n    czm_writeDepthClamp();\n}\n',Oz="varying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\n\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\n    // We don't expect the ray to ever be parallel to the plane\n    return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\n}\n\nvoid main(void)\n{\n    vec4 eyeCoordinate = gl_FragCoord;\n    eyeCoordinate /= eyeCoordinate.w;\n\n#ifdef PER_INSTANCE_COLOR\n    gl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\n    // Use distances for planes aligned with segment to prevent skew in dashing\n    float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\n    float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\n\n    // Clamp - distance to aligned planes may be negative due to mitering\n    distanceFromStart = max(0.0, distanceFromStart);\n    distanceFromEnd = max(0.0, distanceFromEnd);\n\n    float s = distanceFromStart / (distanceFromStart + distanceFromEnd);\n    s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\n\n    czm_materialInput materialInput;\n\n    materialInput.s = s;\n    materialInput.st = vec2(s, v_texcoordT);\n    materialInput.str = vec3(s, v_texcoordT, 0.0);\n\n    czm_material material = czm_getMaterial(materialInput);\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n}\n",wz='attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\n\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\n\nattribute float batchId;\n\nvarying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n\n// For materials\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\n\n// Morphing planes using SLERP or NLERP doesn\'t seem to work, so instead draw the material directly on the shadow volume.\n// Morph views are from very far away and aren\'t meant to be used precisely, so this should be sufficient.\nvoid main()\n{\n    v_batchId = batchId;\n\n    // Start position\n    vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\n    vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\n    vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\n    vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\n    vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\n    vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\n\n    // Start plane\n    vec4 startPlane2D;\n    vec4 startPlane3D;\n    startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\n    startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\n    startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\n    startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\n\n    // Right plane\n    vec4 rightPlane2D;\n    vec4 rightPlane3D;\n    rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\n    rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\n    rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\n    rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\n\n    // End position\n    posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\n    posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\n    posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\n    posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\n    posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\n    vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\n    vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\n    vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\n\n    // End plane\n    vec4 endPlane2D;\n    vec4 endPlane3D;\n    endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\n    endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\n    endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\n    endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\n\n    // Forward direction\n    v_forwardDirectionEC = normalize(endEC - startEC);\n\n    vec2 cleanTexcoordNormalization2D;\n    cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\n    cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\n    vec2 cleanTexcoordNormalization3D;\n    cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\n    cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\n    cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\n\n    v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\n\n#ifdef PER_INSTANCE_COLOR\n    v_color = czm_batchTable_color(batchId);\n#else // PER_INSTANCE_COLOR\n    // For computing texture coordinates\n\n    v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\n    v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\n#endif // PER_INSTANCE_COLOR\n\n#ifdef WIDTH_VARYING\n    float width = czm_batchTable_width(batchId);\n    float halfWidth = width * 0.5;\n    v_width = width;\n    v_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#else\n    float halfWidth = 0.5 * czm_batchTable_width(batchId);\n    v_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#endif\n\n    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.\n    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.\n    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\n    // Since this is morphing, compute both 3D and 2D positions and then blend.\n\n    // ****** 3D ******\n    // Check distance to the end plane and start plane, pick the plane that is closer\n    vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition\n    float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\n    float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\n    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\n    vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n    vec3 normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.\n\n    // Nudge the top vertex upwards to prevent flickering\n    vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\n    geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\n    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\n    positionEc3D.xyz += geodeticSurfaceNormal;\n\n    // Determine if this vertex is on the "left" or "right"\n    normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n\n    // A "perfect" implementation would push along normals according to the angle against forward.\n    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.\n    positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)\n\n    // ****** 2D ******\n    // Check distance to the end plane and start plane, pick the plane that is closer\n    vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition\n    absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\n    absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\n    planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\n    upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n    normalEC = normalize(cross(planeDirection, upOrDown));         // In practice, the opposite seems to work too.\n\n    // Nudge the top vertex upwards to prevent flickering\n    geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\n    geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\n    geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\n    positionEc2D.xyz += geodeticSurfaceNormal;\n\n    // Determine if this vertex is on the "left" or "right"\n    normalEC *= sign(texcoordNormalization2D.x);\n#ifndef PER_INSTANCE_COLOR\n    // Use vertex\'s sidedness to compute its texture coordinate.\n    v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\n#endif\n\n    // A "perfect" implementation would push along normals according to the angle against forward.\n    // In practice, just pushing the normal out by halfWidth is sufficient for morph views.\n    positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)\n\n    // Blend for actual position\n    gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\n\n#ifdef ANGLE_VARYING\n    // Approximate relative screen space direction of the line.\n    vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\n    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\n    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n',Az='attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\n\n// In 2D and in 3D, texture coordinate normalization component signs encodes:\n// * X sign - sidedness relative to right plane\n// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume\n#ifndef COLUMBUS_VIEW_2D\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\n#else\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\n#endif\n\nattribute float batchId;\n\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n\n// For materials\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n\nvoid main()\n{\n#ifdef COLUMBUS_VIEW_2D\n    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\n\n    vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\n    vec3 ecEnd = forwardDirectionEC + ecStart;\n    forwardDirectionEC = normalize(forwardDirectionEC);\n\n    // Right plane\n    v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\n    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n\n    // start plane\n    vec4 startPlaneEC;\n    startPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.xy);\n    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n\n    // end plane\n    vec4 endPlaneEC;\n    endPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.zw);\n    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n\n    v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\n    v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\n\n#else // COLUMBUS_VIEW_2D\n    vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\n    vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\n    vec3 ecEnd = ecStart + offset;\n\n    vec3 forwardDirectionEC = normalize(offset);\n\n    // start plane\n    vec4 startPlaneEC;\n    startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\n    startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n\n    // end plane\n    vec4 endPlaneEC;\n    endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\n    endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n\n    // Right plane\n    v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\n    v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n\n    v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\n    v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n\n#endif // COLUMBUS_VIEW_2D\n\n    v_endEcAndStartEcX.xyz = ecEnd;\n    v_endEcAndStartEcX.w = ecStart.x;\n    v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n\n#ifdef PER_INSTANCE_COLOR\n    v_color = czm_batchTable_color(batchId);\n#endif // PER_INSTANCE_COLOR\n\n    // Compute a normal along which to "push" the position out, extending the miter depending on view distance.\n    // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.\n    // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\n    vec4 positionRelativeToEye = czm_computePosition();\n\n    // Check distance to the end plane and start plane, pick the plane that is closer\n    vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition\n    float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\n    float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\n    vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\n    vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n    vec3 normalEC = normalize(cross(planeDirection, upOrDown));           // In practice, the opposite seems to work too.\n\n    // Extrude bottom vertices downward for far view distances, like for GroundPrimitives\n    upOrDown = cross(forwardDirectionEC, normalEC);\n    upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\n    upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\n    upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\n    positionEC.xyz += upOrDown;\n\n    v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\n\n    // Determine distance along normalEC to push for a volume of appropriate width.\n    // Make volumes about double pixel width for a conservative fit - in practice the\n    // extra cost here is minimal compared to the loose volume heights.\n    //\n    // N = normalEC (guaranteed "right-facing")\n    // R = rightEC\n    // p = angle between N and R\n    // w = distance to push along R if R == N\n    // d = distance to push along N\n    //\n    //   N   R\n    //  {  p| }      * cos(p) = dot(N, R) = w / d\n    //  d  |  |w    * d = w / dot(N, R)\n    //    { | }\n    //       o---------- polyline segment ----\x3e\n    //\n    float width = czm_batchTable_width(batchId);\n#ifdef WIDTH_VARYING\n    v_width = width;\n#endif\n\n    v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\n    v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\n\n    v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\n    v_endPlaneNormalEcAndBatchId.w = batchId;\n\n    width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R\n    width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N\n\n    // Determine if this vertex is on the "left" or "right"\n#ifdef COLUMBUS_VIEW_2D\n        normalEC *= sign(texcoordNormalization2D.x);\n#else\n        normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n#endif\n\n    positionEC.xyz += width * normalEC;\n    gl_Position = czm_depthClamp(czm_projection * positionEC);\n\n#ifdef ANGLE_VARYING\n    // Approximate relative screen space direction of the line.\n    vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\n    approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\n    v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n',Ez="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\n\nvarying vec4 v_color;\n\nvoid main()\n{\n    float expandDir = expandAndWidth.x;\n    float width = abs(expandAndWidth.y) + 0.5;\n    bool usePrev = expandAndWidth.y < 0.0;\n\n    vec4 p = czm_computePosition();\n    vec4 prev = czm_computePrevPosition();\n    vec4 next = czm_computeNextPosition();\n\n    float angle;\n    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n    gl_Position = czm_viewportOrthographic * positionWC;\n\n    v_color = color;\n}\n",Tz="void clipLineSegmentToNearPlane(\n    vec3 p0,\n    vec3 p1,\n    out vec4 positionWC,\n    out bool clipped,\n    out bool culledByNearPlane,\n    out vec4 clippedPositionEC)\n{\n    culledByNearPlane = false;\n    clipped = false;\n\n    vec3 p0ToP1 = p1 - p0;\n    float magnitude = length(p0ToP1);\n    vec3 direction = normalize(p0ToP1);\n\n    // Distance that p0 is behind the near plane. Negative means p0 is\n    // in front of the near plane.\n    float endPoint0Distance =  czm_currentFrustum.x + p0.z;\n\n    // Camera looks down -Z.\n    // When moving a point along +Z: LESS VISIBLE\n    //   * Points in front of the camera move closer to the camera.\n    //   * Points behind the camrea move farther away from the camera.\n    // When moving a point along -Z: MORE VISIBLE\n    //   * Points in front of the camera move farther away from the camera.\n    //   * Points behind the camera move closer to the camera.\n\n    // Positive denominator: -Z, becoming more visible\n    // Negative denominator: +Z, becoming less visible\n    // Nearly zero: parallel to near plane\n    float denominator = -direction.z;\n\n    if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n    {\n        // p0 is behind the near plane and the line to p1 is nearly parallel to\n        // the near plane, so cull the segment completely.\n        culledByNearPlane = true;\n    }\n    else if (endPoint0Distance > 0.0)\n    {\n        // p0 is behind the near plane, and the line to p1 is moving distinctly\n        // toward or away from it.\n\n        // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)\n        float t = endPoint0Distance / denominator;\n        if (t < 0.0 || t > magnitude)\n        {\n            // Near plane intersection is not between the two points.\n            // We already confirmed p0 is behind the naer plane, so now\n            // we know the entire segment is behind it.\n            culledByNearPlane = true;\n        }\n        else\n        {\n            // Segment crosses the near plane, update p0 to lie exactly on it.\n            p0 = p0 + t * direction;\n\n            // Numerical noise might put us a bit on the wrong side of the near plane.\n            // Don't let that happen.\n            p0.z = min(p0.z, -czm_currentFrustum.x);\n\n            clipped = true;\n        }\n    }\n\n    clippedPositionEC = vec4(p0, 1.0);\n    positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\n}\n\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\n    // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.\n\n#ifdef POLYLINE_DASH\n    // Compute the window coordinates of the points.\n    vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\n    vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\n    vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n\n    // Determine the relative screen space direction of the line.\n    vec2 lineDir;\n    if (usePrevious) {\n        lineDir = normalize(positionWindow.xy - previousWindow.xy);\n    }\n    else {\n        lineDir = normalize(nextWindow.xy - positionWindow.xy);\n    }\n    angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)\n\n    // Quantize the angle so it doesn't change rapidly between segments.\n    angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\n\n    vec4 clippedPrevWC, clippedPrevEC;\n    bool prevSegmentClipped, prevSegmentCulled;\n    clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\n\n    vec4 clippedNextWC, clippedNextEC;\n    bool nextSegmentClipped, nextSegmentCulled;\n    clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\n\n    bool segmentClipped, segmentCulled;\n    vec4 clippedPositionWC, clippedPositionEC;\n    clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\n\n    if (segmentCulled)\n    {\n        return vec4(0.0, 0.0, 0.0, 1.0);\n    }\n\n    vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\n    vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\n\n    // If a segment was culled, we can't use the corresponding direction\n    // computed above. We should never see both of these be true without\n    // `segmentCulled` above also being true.\n    if (prevSegmentCulled)\n    {\n        directionToPrevWC = -directionToNextWC;\n    }\n    else if (nextSegmentCulled)\n    {\n        directionToNextWC = -directionToPrevWC;\n    }\n\n    vec2 thisSegmentForwardWC, otherSegmentForwardWC;\n    if (usePrevious)\n    {\n        thisSegmentForwardWC = -directionToPrevWC;\n        otherSegmentForwardWC = directionToNextWC;\n    }\n    else\n    {\n        thisSegmentForwardWC = directionToNextWC;\n        otherSegmentForwardWC =  -directionToPrevWC;\n    }\n\n    vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\n\n    vec2 leftWC = thisSegmentLeftWC;\n    float expandWidth = width * 0.5;\n\n    // When lines are split at the anti-meridian, the position may be at the\n    // same location as the next or previous position, and we need to handle\n    // that to avoid producing NaNs.\n    if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\n    {\n        vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\n\n        vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\n        float leftSumLength = length(leftSumWC);\n        leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\n\n        // The sine of the angle between the two vectors is given by the formula\n        //         |a x b| = |a||b|sin(theta)\n        // which is\n        //     float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));\n        // Because the z components of both vectors are zero, the x and y coordinate will be zero.\n        // Therefore, the sine of the angle is just the z component of the cross product.\n        vec2 u = -thisSegmentForwardWC;\n        vec2 v = leftWC;\n        float sinAngle = abs(u.x * v.y - u.y * v.x);\n        expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n    }\n\n    vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\n    return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\n}\n\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\n    vec4 positionEC = czm_modelViewRelativeToEye * position;\n    vec4 prevEC = czm_modelViewRelativeToEye * previous;\n    vec4 nextEC = czm_modelViewRelativeToEye * next;\n    return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n";let Cz=`${Tz}\n${Ez}`;const xz=DR;function Sz(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.translucent,!0),n=Sz.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=Object(c.a)(e.vertexShaderSource,Cz),this._fragmentShaderSource=Object(c.a)(e.fragmentShaderSource,xz),this._renderState=RD.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=n}Jr.isInternetExplorer()||(Cz="#define CLIP_POLYLINE \n"+Cz),Object.defineProperties(Sz.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),Sz.VERTEX_FORMAT=nu.POSITION_ONLY,Sz.prototype.getFragmentShaderSource=RD.prototype.getFragmentShaderSource,Sz.prototype.isTranslucent=RD.prototype.isTranslucent,Sz.prototype.getRenderState=RD.prototype.getRenderState;var Iz=Sz,Pz="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\n\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\n\nvoid main()\n{\n    float expandDir = expandAndWidth.x;\n    float width = abs(expandAndWidth.y) + 0.5;\n    bool usePrev = expandAndWidth.y < 0.0;\n\n    vec4 p = czm_computePosition();\n    vec4 prev = czm_computePrevPosition();\n    vec4 next = czm_computeNextPosition();\n\n    float angle;\n    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n    gl_Position = czm_viewportOrthographic * positionWC;\n\n    v_width = width;\n    v_st.s = st.s;\n    v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\n    v_polylineAngle = angle;\n}\n",Dz="#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nvarying vec2 v_st;\n\nvoid main()\n{\n    czm_materialInput materialInput;\n\n    vec2 st = v_st;\n    st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\n\n    materialInput.s = st.s;\n    materialInput.st = st;\n    materialInput.str = vec3(st, 0.0);\n\n    czm_material material = czm_getMaterial(materialInput);\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#ifdef VECTOR_TILE\n    gl_FragColor *= u_highlightColor;\n#endif\n\n    czm_writeLogDepth();\n}\n";let Rz=`${Tz}\n${Pz}`;const jz=Dz;function Mz(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.translucent,!0),n=Mz.VERTEX_FORMAT;this.material=Object(l.a)(e.material)?e.material:CR.fromType(CR.ColorType),this.translucent=t,this._vertexShaderSource=Object(c.a)(e.vertexShaderSource,Rz),this._fragmentShaderSource=Object(c.a)(e.fragmentShaderSource,jz),this._renderState=RD.getDefaultRenderState(t,!1,e.renderState),this._closed=!1,this._vertexFormat=n}Jr.isInternetExplorer()||(Rz="#define CLIP_POLYLINE \n"+Rz),Object.defineProperties(Mz.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&(e="#define POLYLINE_DASH\n"+e),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),Mz.VERTEX_FORMAT=nu.POSITION_AND_ST,Mz.prototype.getFragmentShaderSource=RD.prototype.getFragmentShaderSource,Mz.prototype.isTranslucent=RD.prototype.isTranslucent,Mz.prototype.getRenderState=RD.prototype.getRenderState;var Lz=Mz;function Nz(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;Object(l.a)(t)||(t=new Lz),this.appearance=t,this.show=Object(c.a)(e.show,!0),this.classificationType=Object(c.a)(e.classificationType,qN.BOTH),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=Object(c.a)(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:Object(c.a)(e.interleave,!1),releaseGeometryInstances:Object(c.a)(e.releaseGeometryInstances,!0),allowPicking:Object(c.a)(e.allowPicking,!0),asynchronous:Object(c.a)(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const n=this;this._readyPromise=new Promise((e,t)=>{n._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const n=this._error;Object(l.a)(n)?t(n):e(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Bz(!1),this._renderState3DTiles=Bz(!0),this._renderStateMorph=vj.fromCache({cull:{enabled:!0,face:PD.FRONT},depthTest:{enabled:!0},blending:SD.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}function Bz(e){return vj.fromCache({cull:{enabled:!0},blending:SD.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:UF.EQUAL,frontOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},backFunction:UF.EQUAL,backOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},reference:qF.CESIUM_3D_TILE_MASK,mask:qF.CESIUM_3D_TILE_MASK}})}function Fz(e,t,n,i,r,o,a){n.mode===AB.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==AB.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=a,n.commandList.push(t)}Object.defineProperties(Nz.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Nz.initializeTerrainHeights=function(){return nn.initialize()},Nz.prototype.update=function(e){if(!Object(l.a)(this._primitive)&&!Object(l.a)(this.geometryInstances))return;if(!nn.initialized){if(!this.asynchronous)throw new u.a("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");return void Nz.initializeTerrainHeights()}let t;const n=this,i=this._primitiveOptions;if(!Object(l.a)(this._primitive)){const r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,a=new Array(o);let s;for(t=0;t<o;++t)if(s=r[t].attributes,!Object(l.a)(s)||!Object(l.a)(s.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){const i=r[t];s={};const o=i.attributes;for(const e in o)o.hasOwnProperty(e)&&(s[e]=o[e]);Object(l.a)(s.width)||(s.width=new Gv({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:1,value:[i.geometry.width]})),i.geometry._scene3DOnly=e.scene3DOnly,cA.setProjectionAndEllipsoid(i.geometry,e.mapProjection),a[t]=new Ph({geometry:i.geometry,attributes:s,id:i.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(e,t,i){!function(e,t,n){const i=t.context,r=e._primitive,o=r._attributeLocations;let a=r._batchTable.getVertexShaderCallback()(Az);a=hF._appendShowToShader(r,a),a=hF._appendDistanceDisplayConditionToShader(r,a),a=hF._modifyShaderPosition(e,a,t.scene3DOnly);let s=r._batchTable.getVertexShaderCallback()(wz);s=hF._appendShowToShader(r,s),s=hF._appendDistanceDisplayConditionToShader(r,s),s=hF._modifyShaderPosition(e,s,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(vz);const u=["GLOBE_MINIMUM_ALTITUDE "+t.mapProjection.ellipsoid.minimumRadius.toFixed(1)];let h="",d="";Object(l.a)(n.material)?(d=Object(l.a)(n.material)?n.material.shaderSource:"",-1!==d.search(/varying\s+float\s+v_polylineAngle;/g)&&u.push("ANGLE_VARYING"),-1!==d.search(/varying\s+float\s+v_width;/g)&&u.push("WIDTH_VARYING")):h="PER_INSTANCE_COLOR",u.push(h);const f=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",h]:[h],p=new UN({defines:u,sources:[a]}),m=new UN({defines:f,sources:[d,c]});e._sp=oM.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:p,fragmentShaderSource:m,attributeLocations:o});let g=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!Object(l.a)(g)){const t=new UN({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});g=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:t,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=g;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!Object(l.a)(_)){const t=new UN({defines:u.concat(["MAX_TERRAIN_HEIGHT "+nn._defaultMaxTerrainHeight.toFixed(1)]),sources:[s]});c=r._batchTable.getVertexShaderCallback()(Oz);const n=new UN({defines:f,sources:[d,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:t,fragmentShaderSource:n,attributeLocations:o})}e._spMorph=_}(n,t,i)},i._createCommandsFunction=function(e,t,i,r,o,a,s){!function(e,t,n,i,r,o){const a=e._primitive,s=a._va.length;r.length=s,o.length=s;const c=t instanceof Iz?{}:n._uniforms,u=a._batchTable.getUniformMapCallback()(c);for(let t=0;t<s;t++){const n=a._va[t];let i=r[t];Object(l.a)(i)||(i=r[t]=new XR({owner:e,primitiveType:a._primitiveType})),i.vertexArray=n,i.renderState=e._renderState,i.shaderProgram=e._sp,i.uniformMap=u,i.pass=KR.TERRAIN_CLASSIFICATION,i.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const o=XR.shallowClone(i,i.derivedCommands.tileset);o.renderState=e._renderState3DTiles,o.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,i.derivedCommands.tileset=o;const s=XR.shallowClone(i,i.derivedCommands.color2D);s.shaderProgram=e._sp2D,i.derivedCommands.color2D=s;const c=XR.shallowClone(o,o.derivedCommands.color2D);c.shaderProgram=e._sp2D,o.derivedCommands.color2D=c;const h=XR.shallowClone(i,i.derivedCommands.colorMorph);h.renderState=e._renderStateMorph,h.shaderProgram=e._spMorph,h.pickId="czm_batchTable_pickColor(v_batchId)",i.derivedCommands.colorMorph=h}}(n,t,i,0,a,s)},i._updateAndQueueCommandsFunction=function(e,t,i,r,o,a,s,c){!function(e,t,n,i,r,o,a){const s=e._primitive;let c;hF._updateBoundingVolumes(s,t,r),t.mode===AB.SCENE3D?c=s._boundingSphereWC:t.mode===AB.COLUMBUS_VIEW?c=s._boundingSphereCV:t.mode===AB.SCENE2D&&Object(l.a)(s._boundingSphere2D)?c=s._boundingSphere2D:Object(l.a)(s._boundingSphereMorph)&&(c=s._boundingSphereMorph);const u=t.mode===AB.MORPHING,h=e.classificationType,d=h!==qN.CESIUM_3D_TILE,f=h!==qN.TERRAIN&&!u;let p;const m=t.passes;if(m.render||m.pick&&s.allowPicking){const e=n.length;for(let i=0;i<e;++i){const e=c[i];d&&(p=n[i],Fz(0,p,t,r,o,e,a)),f&&(p=n[i].derivedCommands.tileset,Fz(0,p,t,r,o,e,a))}}}(n,t,i,0,o,a,s)},this._primitive=new hF(i),this._primitive.readyPromise.then(this._completeLoad)}if(this.appearance instanceof Iz&&!this._hasPerInstanceColors)throw new u.a("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)},Nz.prototype.getGeometryInstanceAttributes=function(e){if(!Object(l.a)(this._primitive))throw new u.a("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},Nz.isSupported=function(e){return e.frameState.context.depthTexture},Nz.prototype.isDestroyed=function(){return!1},Nz.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,sc(this)};var zz=Nz;const kz=new Vt(1,1),Uz=sp.WHITE;function Vz(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(Vz.prototype,{isConstant:{get:function(){return JP.isConstant(this._image)&&JP.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:VP("image"),repeat:VP("repeat"),color:VP("color"),transparent:VP("transparent")}),Vz.prototype.getType=function(e){return"Image"},Vz.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.image=JP.getValueOrUndefined(this._image,e),t.repeat=JP.getValueOrClonedDefault(this._repeat,e,kz,t.repeat),t.color=JP.getValueOrClonedDefault(this._color,e,Uz,t.color),JP.getValueOrDefault(this._transparent,e,!1)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},Vz.prototype.equals=function(e){return this===e||e instanceof Vz&&JP.equals(this._image,e._image)&&JP.equals(this._repeat,e._repeat)&&JP.equals(this._color,e._color)&&JP.equals(this._transparent,e._transparent)};var Hz=Vz;function Gz(e){if(e instanceof sp)return new NR(e);if("string"==typeof e||e instanceof Tt.a||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new Hz;return t.image=e,t}throw new u.a("Unable to infer material type: "+e)}var qz=function(e,t){return VP(e,t,Gz)};function Wz(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Wz.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),dimensions:VP("dimensions"),heightReference:VP("heightReference"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition")}),Wz.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Wz(this)},Wz.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.dimensions=Object(c.a)(this.dimensions,e.dimensions),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Yz=Wz;function Xz(){u.a.throwInstantiationError()}Object.defineProperties(Xz.prototype,{isConstant:{get:u.a.throwInstantiationError},definitionChanged:{get:u.a.throwInstantiationError},referenceFrame:{get:u.a.throwInstantiationError}}),Xz.prototype.getValue=u.a.throwInstantiationError,Xz.prototype.getValueInReferenceFrame=u.a.throwInstantiationError,Xz.prototype.equals=u.a.throwInstantiationError;const Kz=new ce;Xz.convertToReferenceFrame=function(e,t,n,i,r){if(!Object(l.a)(t))return t;if(Object(l.a)(r)||(r=new O),n===i)return O.clone(t,r);let o=ca.computeIcrfToFixedMatrix(e,Kz);return Object(l.a)(o)||(o=ca.computeTemeToPseudoFixedMatrix(e,Kz)),n===Hx.INERTIAL?ce.multiplyByVector(o,t,r):n===Hx.FIXED?ce.multiplyByVector(ce.transpose(o,Kz),t,r):void 0};var Jz=Xz;function Zz(e,t){this._definitionChanged=new un.a,this._value=O.clone(e),this._referenceFrame=Object(c.a)(t,Hx.FIXED)}Object.defineProperties(Zz.prototype,{isConstant:{get:function(){return!Object(l.a)(this._value)||this._referenceFrame===Hx.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),Zz.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Hx.FIXED,t)},Zz.prototype.setValue=function(e,t){let n=!1;O.equals(this._value,e)||(n=!0,this._value=O.clone(e)),Object(l.a)(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)},Zz.prototype.getValueInReferenceFrame=function(e,t,n){if(!Object(l.a)(e))throw new u.a("time is required.");if(!Object(l.a)(t))throw new u.a("referenceFrame is required.");return Jz.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},Zz.prototype.equals=function(e){return this===e||e instanceof Zz&&O.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var $z=Zz;function Qz(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Qz.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),positions:VP("positions"),width:VP("width"),height:VP("height"),heightReference:VP("heightReference"),extrudedHeight:VP("extrudedHeight"),extrudedHeightReference:VP("extrudedHeightReference"),cornerType:VP("cornerType"),granularity:VP("granularity"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition"),classificationType:VP("classificationType"),zIndex:VP("zIndex")}),Qz.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Qz(this)},Qz.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.positions=Object(c.a)(this.positions,e.positions),this.width=Object(c.a)(this.width,e.width),this.height=Object(c.a)(this.height,e.height),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.extrudedHeight=Object(c.a)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=Object(c.a)(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=Object(c.a)(this.cornerType,e.cornerType),this.granularity=Object(c.a)(this.granularity,e.granularity),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=Object(c.a)(this.classificationType,e.classificationType),this.zIndex=Object(c.a)(this.zIndex,e.zIndex)};var ek=Qz;function tk(e){return e}var nk=function(e,t){return VP(e,t,tk)};function ik(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(ik.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),length:VP("length"),topRadius:VP("topRadius"),bottomRadius:VP("bottomRadius"),heightReference:VP("heightReference"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),numberOfVerticalLines:VP("numberOfVerticalLines"),slices:VP("slices"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition")}),ik.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new ik(this)},ik.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.length=Object(c.a)(this.length,e.length),this.topRadius=Object(c.a)(this.topRadius,e.topRadius),this.bottomRadius=Object(c.a)(this.bottomRadius,e.bottomRadius),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=Object(c.a)(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=Object(c.a)(this.slices,e.slices),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var rk=ik;function ok(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(ok.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),semiMajorAxis:VP("semiMajorAxis"),semiMinorAxis:VP("semiMinorAxis"),height:VP("height"),heightReference:VP("heightReference"),extrudedHeight:VP("extrudedHeight"),extrudedHeightReference:VP("extrudedHeightReference"),rotation:VP("rotation"),stRotation:VP("stRotation"),granularity:VP("granularity"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),numberOfVerticalLines:VP("numberOfVerticalLines"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition"),classificationType:VP("classificationType"),zIndex:VP("zIndex")}),ok.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new ok(this)},ok.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.semiMajorAxis=Object(c.a)(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=Object(c.a)(this.semiMinorAxis,e.semiMinorAxis),this.height=Object(c.a)(this.height,e.height),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.extrudedHeight=Object(c.a)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=Object(c.a)(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=Object(c.a)(this.rotation,e.rotation),this.stRotation=Object(c.a)(this.stRotation,e.stRotation),this.granularity=Object(c.a)(this.granularity,e.granularity),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=Object(c.a)(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=Object(c.a)(this.classificationType,e.classificationType),this.zIndex=Object(c.a)(this.zIndex,e.zIndex)};var ak=ok;function sk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(sk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),radii:VP("radii"),innerRadii:VP("innerRadii"),minimumClock:VP("minimumClock"),maximumClock:VP("maximumClock"),minimumCone:VP("minimumCone"),maximumCone:VP("maximumCone"),heightReference:VP("heightReference"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),stackPartitions:VP("stackPartitions"),slicePartitions:VP("slicePartitions"),subdivisions:VP("subdivisions"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition")}),sk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new sk(this)},sk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.radii=Object(c.a)(this.radii,e.radii),this.innerRadii=Object(c.a)(this.innerRadii,e.innerRadii),this.minimumClock=Object(c.a)(this.minimumClock,e.minimumClock),this.maximumClock=Object(c.a)(this.maximumClock,e.maximumClock),this.minimumCone=Object(c.a)(this.minimumCone,e.minimumCone),this.maximumCone=Object(c.a)(this.maximumCone,e.maximumCone),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.stackPartitions=Object(c.a)(this.stackPartitions,e.stackPartitions),this.slicePartitions=Object(c.a)(this.slicePartitions,e.slicePartitions),this.subdivisions=Object(c.a)(this.subdivisions,e.subdivisions),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var ck=sk;function lk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(lk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),text:VP("text"),font:VP("font"),style:VP("style"),scale:VP("scale"),showBackground:VP("showBackground"),backgroundColor:VP("backgroundColor"),backgroundPadding:VP("backgroundPadding"),pixelOffset:VP("pixelOffset"),eyeOffset:VP("eyeOffset"),horizontalOrigin:VP("horizontalOrigin"),verticalOrigin:VP("verticalOrigin"),heightReference:VP("heightReference"),fillColor:VP("fillColor"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),translucencyByDistance:VP("translucencyByDistance"),pixelOffsetScaleByDistance:VP("pixelOffsetScaleByDistance"),scaleByDistance:VP("scaleByDistance"),distanceDisplayCondition:VP("distanceDisplayCondition"),disableDepthTestDistance:VP("disableDepthTestDistance")}),lk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new lk(this)},lk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.text=Object(c.a)(this.text,e.text),this.font=Object(c.a)(this.font,e.font),this.style=Object(c.a)(this.style,e.style),this.scale=Object(c.a)(this.scale,e.scale),this.showBackground=Object(c.a)(this.showBackground,e.showBackground),this.backgroundColor=Object(c.a)(this.backgroundColor,e.backgroundColor),this.backgroundPadding=Object(c.a)(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=Object(c.a)(this.pixelOffset,e.pixelOffset),this.eyeOffset=Object(c.a)(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=Object(c.a)(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=Object(c.a)(this.verticalOrigin,e.verticalOrigin),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.fillColor=Object(c.a)(this.fillColor,e.fillColor),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=Object(c.a)(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=Object(c.a)(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=Object(c.a)(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=Object(c.a)(this.disableDepthTestDistance,e.disableDepthTestDistance)};var uk=lk;const hk=new $I;function dk(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(dk.prototype,{isConstant:{get:function(){return JP.isConstant(this._translation)&&JP.isConstant(this._rotation)&&JP.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:VP("translation"),rotation:VP("rotation"),scale:VP("scale")}),dk.prototype.getValue=function(e,t){return Object(l.a)(t)||(t=new $I),t.translation=JP.getValueOrClonedDefault(this._translation,e,hk.translation,t.translation),t.rotation=JP.getValueOrClonedDefault(this._rotation,e,hk.rotation,t.rotation),t.scale=JP.getValueOrClonedDefault(this._scale,e,hk.scale,t.scale),t},dk.prototype.equals=function(e){return this===e||e instanceof dk&&JP.equals(this._translation,e._translation)&&JP.equals(this._rotation,e._rotation)&&JP.equals(this._scale,e._scale)};var fk=dk;function pk(e,t){this._propertyNames=[],this._definitionChanged=new un.a,Object(l.a)(e)&&this.merge(e,t)}function mk(e){return new kP(e)}Object.defineProperties(pk.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!JP.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),pk.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},pk.prototype.addProperty=function(e,t,n){const i=this._propertyNames;if(!Object(l.a)(e))throw new u.a("propertyName is required.");if(-1!==i.indexOf(e))throw new u.a(e+" is already a registered property.");i.push(e),Object.defineProperty(this,e,VP(e,!0,Object(c.a)(n,mk))),Object(l.a)(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},pk.prototype.removeProperty=function(e){const t=this._propertyNames.indexOf(e);if(!Object(l.a)(e))throw new u.a("propertyName is required.");if(-1===t)throw new u.a(e+" is not a registered property.");this._propertyNames.splice(t,1),delete this[e],this._definitionChanged.raiseEvent(this)},pk.prototype.getValue=function(e,t){if(!Object(l.a)(e))throw new u.a("time is required.");Object(l.a)(t)||(t={});const n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){const r=n[i];t[r]=JP.getValueOrUndefined(this[r],e,t[r])}return t},pk.prototype.merge=function(e,t){if(!Object(l.a)(e))throw new u.a("source is required.");const n=this._propertyNames,i=Object(l.a)(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){const o=i[r],a=this[o],s=e[o];void 0===a&&-1===n.indexOf(o)&&this.addProperty(o,void 0,t),void 0!==s&&(void 0!==a?Object(l.a)(a)&&Object(l.a)(a.merge)&&a.merge(s):Object(l.a)(s)&&Object(l.a)(s.merge)&&Object(l.a)(s.clone)?this[o]=s.clone():this[o]=s)}},pk.prototype.equals=function(e){return this===e||e instanceof pk&&function(e,t){const n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){const r=n[o];if(-1===i.indexOf(r))return!1;if(!JP.equals(e[r],t[r]))return!1}return!0}(this,e)};var gk=pk;function _k(e){return new fk(e)}function yk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(yk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),uri:VP("uri"),scale:VP("scale"),minimumPixelSize:VP("minimumPixelSize"),maximumScale:VP("maximumScale"),incrementallyLoadTextures:VP("incrementallyLoadTextures"),runAnimations:VP("runAnimations"),clampAnimations:VP("clampAnimations"),shadows:VP("shadows"),heightReference:VP("heightReference"),silhouetteColor:VP("silhouetteColor"),silhouetteSize:VP("silhouetteSize"),color:VP("color"),colorBlendMode:VP("colorBlendMode"),colorBlendAmount:VP("colorBlendAmount"),imageBasedLightingFactor:VP("imageBasedLightingFactor"),lightColor:VP("lightColor"),distanceDisplayCondition:VP("distanceDisplayCondition"),nodeTransformations:VP("nodeTransformations",void 0,(function(e){return new gk(e,_k)})),articulations:VP("articulations",void 0,(function(e){return new gk(e)})),clippingPlanes:VP("clippingPlanes")}),yk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e):new yk(this)},yk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.uri=Object(c.a)(this.uri,e.uri),this.scale=Object(c.a)(this.scale,e.scale),this.minimumPixelSize=Object(c.a)(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=Object(c.a)(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=Object(c.a)(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=Object(c.a)(this.runAnimations,e.runAnimations),this.clampAnimations=Object(c.a)(this.clampAnimations,e.clampAnimations),this.shadows=Object(c.a)(this.shadows,e.shadows),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.silhouetteColor=Object(c.a)(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=Object(c.a)(this.silhouetteSize,e.silhouetteSize),this.color=Object(c.a)(this.color,e.color),this.colorBlendMode=Object(c.a)(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=Object(c.a)(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=Object(c.a)(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=Object(c.a)(this.lightColor,e.lightColor),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=Object(c.a)(this.clippingPlanes,e.clippingPlanes);const t=e.nodeTransformations;if(Object(l.a)(t)){const e=this.nodeTransformations;Object(l.a)(e)?e.merge(t):this.nodeTransformations=new gk(t,_k)}const n=e.articulations;if(Object(l.a)(n)){const e=this.articulations;Object(l.a)(e)?e.merge(n):this.articulations=new gk(n)}};var bk=yk;function vk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(vk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),uri:VP("uri"),maximumScreenSpaceError:VP("maximumScreenSpaceError")}),vk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new vk(this)},vk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.uri=Object(c.a)(this.uri,e.uri),this.maximumScreenSpaceError=Object(c.a)(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var Ok=vk;function wk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(wk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),leadTime:VP("leadTime"),trailTime:VP("trailTime"),width:VP("width"),resolution:VP("resolution"),material:qz("material"),distanceDisplayCondition:VP("distanceDisplayCondition")}),wk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new wk(this)},wk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.leadTime=Object(c.a)(this.leadTime,e.leadTime),this.trailTime=Object(c.a)(this.trailTime,e.trailTime),this.width=Object(c.a)(this.width,e.width),this.resolution=Object(c.a)(this.resolution,e.resolution),this.material=Object(c.a)(this.material,e.material),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Ak=wk;function Ek(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Ek.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),plane:VP("plane"),dimensions:VP("dimensions"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition")}),Ek.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Ek(this)},Ek.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.plane=Object(c.a)(this.plane,e.plane),this.dimensions=Object(c.a)(this.dimensions,e.dimensions),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Tk=Ek;function Ck(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Ck.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),pixelSize:VP("pixelSize"),heightReference:VP("heightReference"),color:VP("color"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),scaleByDistance:VP("scaleByDistance"),translucencyByDistance:VP("translucencyByDistance"),distanceDisplayCondition:VP("distanceDisplayCondition"),disableDepthTestDistance:VP("disableDepthTestDistance")}),Ck.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Ck(this)},Ck.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.pixelSize=Object(c.a)(this.pixelSize,e.pixelSize),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.color=Object(c.a)(this.color,e.color),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.scaleByDistance=Object(c.a)(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=Object(c.a)(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=Object(c.a)(this.disableDepthTestDistance,e.disableDepthTestDistance)};var xk=Ck;function Sk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Sk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),hierarchy:VP("hierarchy",void 0,(function(e){return Array.isArray(e)&&(e=new QT(e)),new kP(e)})),height:VP("height"),heightReference:VP("heightReference"),extrudedHeight:VP("extrudedHeight"),extrudedHeightReference:VP("extrudedHeightReference"),stRotation:VP("stRotation"),granularity:VP("granularity"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),perPositionHeight:VP("perPositionHeight"),closeTop:VP("closeTop"),closeBottom:VP("closeBottom"),arcType:VP("arcType"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition"),classificationType:VP("classificationType"),zIndex:VP("zIndex"),textureCoordinates:VP("textureCoordinates")}),Sk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new Sk(this)},Sk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.hierarchy=Object(c.a)(this.hierarchy,e.hierarchy),this.height=Object(c.a)(this.height,e.height),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.extrudedHeight=Object(c.a)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=Object(c.a)(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=Object(c.a)(this.stRotation,e.stRotation),this.granularity=Object(c.a)(this.granularity,e.granularity),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.perPositionHeight=Object(c.a)(this.perPositionHeight,e.perPositionHeight),this.closeTop=Object(c.a)(this.closeTop,e.closeTop),this.closeBottom=Object(c.a)(this.closeBottom,e.closeBottom),this.arcType=Object(c.a)(this.arcType,e.arcType),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=Object(c.a)(this.classificationType,e.classificationType),this.zIndex=Object(c.a)(this.zIndex,e.zIndex),this.textureCoordinates=Object(c.a)(this.textureCoordinates,e.textureCoordinates)};var Ik=Sk;function Pk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Pk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),positions:VP("positions"),width:VP("width"),granularity:VP("granularity"),material:qz("material"),depthFailMaterial:qz("depthFailMaterial"),arcType:VP("arcType"),clampToGround:VP("clampToGround"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition"),classificationType:VP("classificationType"),zIndex:VP("zIndex")}),Pk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Pk(this)},Pk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.positions=Object(c.a)(this.positions,e.positions),this.width=Object(c.a)(this.width,e.width),this.granularity=Object(c.a)(this.granularity,e.granularity),this.material=Object(c.a)(this.material,e.material),this.depthFailMaterial=Object(c.a)(this.depthFailMaterial,e.depthFailMaterial),this.arcType=Object(c.a)(this.arcType,e.arcType),this.clampToGround=Object(c.a)(this.clampToGround,e.clampToGround),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=Object(c.a)(this.classificationType,e.classificationType),this.zIndex=Object(c.a)(this.zIndex,e.zIndex)};var Dk=Pk;function Rk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Rk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),positions:VP("positions"),shape:VP("shape"),cornerType:VP("cornerType"),granularity:VP("granularity"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition")}),Rk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Rk(this)},Rk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.positions=Object(c.a)(this.positions,e.positions),this.shape=Object(c.a)(this.shape,e.shape),this.cornerType=Object(c.a)(this.cornerType,e.cornerType),this.granularity=Object(c.a)(this.granularity,e.granularity),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var jk=Rk;function Mk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Mk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),coordinates:VP("coordinates"),height:VP("height"),heightReference:VP("heightReference"),extrudedHeight:VP("extrudedHeight"),extrudedHeightReference:VP("extrudedHeightReference"),rotation:VP("rotation"),stRotation:VP("stRotation"),granularity:VP("granularity"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition"),classificationType:VP("classificationType"),zIndex:VP("zIndex")}),Mk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Mk(this)},Mk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.coordinates=Object(c.a)(this.coordinates,e.coordinates),this.height=Object(c.a)(this.height,e.height),this.heightReference=Object(c.a)(this.heightReference,e.heightReference),this.extrudedHeight=Object(c.a)(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=Object(c.a)(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=Object(c.a)(this.rotation,e.rotation),this.stRotation=Object(c.a)(this.stRotation,e.stRotation),this.granularity=Object(c.a)(this.granularity,e.granularity),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=Object(c.a)(this.classificationType,e.classificationType),this.zIndex=Object(c.a)(this.zIndex,e.zIndex)};var Lk=Mk;function Nk(e){this._definitionChanged=new un.a,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Object(c.a)(e,c.a.EMPTY_OBJECT))}Object.defineProperties(Nk.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:VP("show"),positions:VP("positions"),minimumHeights:VP("minimumHeights"),maximumHeights:VP("maximumHeights"),granularity:VP("granularity"),fill:VP("fill"),material:qz("material"),outline:VP("outline"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth"),shadows:VP("shadows"),distanceDisplayCondition:VP("distanceDisplayCondition")}),Nk.prototype.clone=function(e){return Object(l.a)(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Nk(this)},Nk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.show=Object(c.a)(this.show,e.show),this.positions=Object(c.a)(this.positions,e.positions),this.minimumHeights=Object(c.a)(this.minimumHeights,e.minimumHeights),this.maximumHeights=Object(c.a)(this.maximumHeights,e.maximumHeights),this.granularity=Object(c.a)(this.granularity,e.granularity),this.fill=Object(c.a)(this.fill,e.fill),this.material=Object(c.a)(this.material,e.material),this.outline=Object(c.a)(this.outline,e.outline),this.outlineColor=Object(c.a)(this.outlineColor,e.outlineColor),this.outlineWidth=Object(c.a)(this.outlineWidth,e.outlineWidth),this.shadows=Object(c.a)(this.shadows,e.shadows),this.distanceDisplayCondition=Object(c.a)(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Bk=Nk;const Fk=new R;function zk(e){return new $z(e)}function kk(e,t){return VP(e,void 0,(function(e){return e instanceof t?e:new t(e)}))}function Uk(e){let t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).id;Object(l.a)(t)||(t=fy()),this._availability=void 0,this._id=t,this._definitionChanged=new un.a,this._name=e.name,this._show=Object(c.a)(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function Vk(e,t,n){const i=t.length;for(let e=0;e<i;e++){const i=t[e],r=i._show;(!n&&r)!==(n&&r)&&Vk(i,i._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}var Hk;Object.defineProperties(Uk.prototype,{availability:nk("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:nk("name"),show:{get:function(){return this._show},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(e===this._show)return;const t=this.isShowing;this._show=e;const n=this.isShowing;t!==n&&Vk(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!Object(l.a)(this.entityCollection)||this.entityCollection.show)&&(!Object(l.a)(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){const t=this._parent;if(t===e)return;const n=this.isShowing;if(Object(l.a)(t)){const e=t._children.indexOf(this);t._children.splice(e,1)}this._parent=e,Object(l.a)(e)&&e._children.push(this);const i=this.isShowing;n!==i&&Vk(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:kk("billboard",GP),box:kk("box",Yz),corridor:kk("corridor",ek),cylinder:kk("cylinder",rk),description:VP("description"),ellipse:kk("ellipse",ak),ellipsoid:kk("ellipsoid",ck),label:kk("label",uk),model:kk("model",bk),tileset:kk("tileset",Ok),orientation:VP("orientation"),path:kk("path",Ak),plane:kk("plane",Tk),point:kk("point",xk),polygon:kk("polygon",Ik),polyline:kk("polyline",Dk),polylineVolume:kk("polylineVolume",jk),properties:kk("properties",gk),position:(Hk="position",VP(Hk,void 0,zk)),rectangle:kk("rectangle",Lk),viewFrom:VP("viewFrom"),wall:kk("wall",Bk)}),Uk.prototype.isAvailable=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._availability;return!Object(l.a)(t)||t.contains(e)},Uk.prototype.addProperty=function(e){const t=this._propertyNames;if(!Object(l.a)(e))throw new u.a("propertyName is required.");if(-1!==t.indexOf(e))throw new u.a(e+" is already a registered property.");if(e in this)throw new u.a(e+" is a reserved property name.");t.push(e),Object.defineProperty(this,e,nk(e,!0))},Uk.prototype.removeProperty=function(e){const t=this._propertyNames.indexOf(e);if(!Object(l.a)(e))throw new u.a("propertyName is required.");if(-1===t)throw new u.a(e+" is not a registered property.");this._propertyNames.splice(t,1),delete this[e]},Uk.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.name=Object(c.a)(this.name,e.name),this.availability=Object(c.a)(this.availability,e.availability);const t=this._propertyNames,n=Object(l.a)(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){const i=n[r];if("parent"===i||"name"===i||"availability"===i)continue;const o=this[i],a=e[i];Object(l.a)(o)||-1!==t.indexOf(i)||this.addProperty(i),Object(l.a)(a)&&(Object(l.a)(o)?Object(l.a)(o.merge)&&o.merge(a):Object(l.a)(a.merge)&&Object(l.a)(a.clone)?this[i]=a.clone():this[i]=a)}};const Gk=new ce,qk=new O,Wk=new To;Uk.prototype.computeModelMatrix=function(e,t){s.a.typeOf.object("time",e);const n=JP.getValueOrUndefined(this._position,e,qk);if(!Object(l.a)(n))return;const i=JP.getValueOrUndefined(this._orientation,e,Wk);return t=Object(l.a)(i)?Me.fromRotationTranslation(ce.fromQuaternion(i,Gk),n,t):ca.eastNorthUpToFixedFrame(n,void 0,t)},Uk.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){s.a.typeOf.object("time",e);const o=JP.getValueOrDefault(t,e,qP.NONE);let a=JP.getValueOrUndefined(this._position,e,qk);if(o===qP.NONE||!Object(l.a)(a)||O.equalsEpsilon(a,O.ZERO,h.a.EPSILON8))return this.computeModelMatrix(e,r);const c=i.cartesianToCartographic(a,Fk);o===qP.CLAMP_TO_GROUND?c.height=n:c.height+=n,a=i.cartographicToCartesian(c,a);const u=JP.getValueOrUndefined(this._orientation,e,Wk);return r=Object(l.a)(u)?Me.fromRotationTranslation(ce.fromQuaternion(u,Gk),a,r):ca.eastNorthUpToFixedFrame(a,void 0,r)},Uk.supportsMaterialsforEntitiesOnTerrain=function(e){return mz.supportsMaterials(e)},Uk.supportsPolylinesOnTerrain=function(e){return zz.isSupported(e)};var Yk=Uk;const Xk=new NR(sp.WHITE),Kk=new kP(!0),Jk=new kP(!0),Zk=new kP(!1),$k=new kP(sp.BLACK),Qk=new kP(TB.DISABLED),eU=new kP(new eb),tU=new kP(qN.BOTH);function nU(e){s.a.defined("options.entity",e.entity),s.a.defined("options.scene",e.scene),s.a.defined("options.geometryOptions",e.geometryOptions),s.a.defined("options.geometryPropertyName",e.geometryPropertyName),s.a.defined("options.observedPropertyNames",e.observedPropertyNames);const t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new un.a,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Yk.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(nU.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!Object(l.a)(this._entity.availability)&&JP.isConstant(this._showProperty)&&JP.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!Object(l.a)(this._entity.availability)&&JP.isConstant(this._showProperty)&&JP.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),nU.prototype.isOutlineVisible=function(e){const t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return Object(c.a)(n,!1)},nU.prototype.isFilled=function(e){const t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return Object(c.a)(n,!1)},nU.prototype.createFillGeometryInstance=u.a.throwInstantiationError,nU.prototype.createOutlineGeometryInstance=u.a.throwInstantiationError,nU.prototype.isDestroyed=function(){return!1},nU.prototype.destroy=function(){sc(this)},nU.prototype._isHidden=function(e,t){const n=t.show;return Object(l.a)(n)&&n.isConstant&&!n.getValue(JA.MINIMUM_VALUE)},nU.prototype._isOnTerrain=function(e,t){return!1},nU.prototype._getIsClosed=function(e){return!0},nU.prototype._isDynamic=u.a.throwInstantiationError,nU.prototype._setStaticOptions=u.a.throwInstantiationError,nU.prototype._onEntityPropertyChanged=function(e,t,n,i){if(-1===this._observedPropertyNames.indexOf(t))return;const r=this._entity[this._geometryPropertyName];if(!Object(l.a)(r))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));const o=r.fill,a=!Object(l.a)(o)||!o.isConstant||o.getValue(JA.MINIMUM_VALUE),s=r.outline;let u=Object(l.a)(s);if(u&&s.isConstant&&(u=s.getValue(JA.MINIMUM_VALUE)),!a&&!u)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));const h=r.show;if(this._isHidden(e,r))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));this._materialProperty=Object(c.a)(r.material,Xk),this._fillProperty=Object(c.a)(o,Jk),this._showProperty=Object(c.a)(h,Kk),this._showOutlineProperty=Object(c.a)(r.outline,Zk),this._outlineColorProperty=u?Object(c.a)(r.outlineColor,$k):void 0,this._shadowsProperty=Object(c.a)(r.shadows,Qk),this._distanceDisplayConditionProperty=Object(c.a)(r.distanceDisplayCondition,eU),this._classificationTypeProperty=Object(c.a)(r.classificationType,tU),this._fillEnabled=a;const d=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof NR);if(u&&d&&(cl(cl.geometryOutlines),u=!1),this._onTerrain=d,this._outlineEnabled=u,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);const t=r.outlineWidth;this._outlineWidth=Object(l.a)(t)?t.getValue(JA.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}},nU.prototype.createDynamicUpdater=function(e,t){if(s.a.defined("primitives",e),s.a.defined("groundPrimitives",t),!this._dynamic)throw new u.a("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)};var iU=nU;function rU(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new un.a,this.setCallback(e,t)}Object.defineProperties(rU.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),rU.prototype.getValue=function(e,t){return this._callback(e,t)},rU.prototype.setCallback=function(e,t){if(!Object(l.a)(e))throw new u.a("callback is required.");if(!Object(l.a)(t))throw new u.a("isConstant is required.");const n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)},rU.prototype.equals=function(e){return this===e||e instanceof rU&&this._callback===e._callback&&this._isConstant===e._isConstant};var oU=rU;const aU=new O,sU=new R;function cU(e,t,n,i){s.a.defined("scene",e),s.a.defined("positionProperty",t),this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new O,this._cartographicPosition=new R,this._normal=new O,this._definitionChanged=new un.a,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;const r=this;if(Object(l.a)(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener((function(){r._updateClamping()})),this._removeModeListener=e.morphComplete.addEventListener((function(){r._updateClamping()}))),t.isConstant){const n=t.getValue(JA.MINIMUM_VALUE,aU);if(!Object(l.a)(n)||O.equals(n,O.ZERO)||!Object(l.a)(e.globe))return;this._position=O.clone(n,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(n,this._normal)}}Object.defineProperties(cU.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),cU.prototype._updateClamping=function(){Object(l.a)(this._removeCallbackFunc)&&this._removeCallbackFunc();const e=this._scene,t=e.globe,n=this._position;if(!Object(l.a)(t)||O.equals(n,O.ZERO))return void(this._terrainHeight=0);const i=t.ellipsoid,r=t._surface,o=this,a=i.cartesianToCartographic(n,this._cartographicPosition),s=t.getHeight(a);Object(l.a)(s)?this._terrainHeight=s:this._terrainHeight=0,this._removeCallbackFunc=r.updateHeight(a,(function(t){if(e.mode===AB.SCENE3D){const e=i.cartesianToCartographic(t,sU);o._terrainHeight=e.height}else o._terrainHeight=t.x;o.definitionChanged.raiseEvent()}))},cU.prototype.getValue=function(e,t){const n=JP.getValueOrDefault(this._heightReference,e,qP.NONE),i=JP.getValueOrDefault(this._extrudedHeightReference,e,qP.NONE);if(n===qP.NONE&&i!==qP.RELATIVE_TO_GROUND)return this._position=O.clone(O.ZERO,this._position),O.clone(O.ZERO,t);if(this._positionProperty.isConstant)return O.multiplyByScalar(this._normal,this._terrainHeight,t);const r=this._scene,o=this._positionProperty.getValue(e,aU);if(!Object(l.a)(o)||O.equals(o,O.ZERO)||!Object(l.a)(r.globe))return O.clone(O.ZERO,t);if(O.equalsEpsilon(this._position,o,h.a.EPSILON10))return O.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=O.clone(o,this._position),this._updateClamping();const a=r.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return O.multiplyByScalar(a,this._terrainHeight,t)},cU.prototype.isDestroyed=function(){return!1},cU.prototype.destroy=function(){return Object(l.a)(this._removeEventListener)&&this._removeEventListener(),Object(l.a)(this._removeModeListener)&&this._removeModeListener(),Object(l.a)(this._removeCallbackFunc)&&this._removeCallbackFunc(),sc(this)};var lU=cU;var uU=function(e,t,n,i){if(iU.prototype._onEntityPropertyChanged.call(this,e,t,n,i),-1===this._observedPropertyNames.indexOf(t))return;const r=this._entity[this._geometryPropertyName];if(!Object(l.a)(r))return;Object(l.a)(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);const o=r.heightReference;if(Object(l.a)(o)){const e=new oU(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new lU(this._scene,e,o)}};const hU=O.ZERO,dU=new O,fU=new O,pU=new sp;function mU(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function gU(e,t){iU.call(this,{entity:e,scene:t,geometryOptions:new mU(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function _U(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(gU.prototype=Object.create(iU.prototype),gU.prototype.constructor=gU),Object.defineProperties(gU.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),gU.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i=new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o={show:i,distanceDisplayCondition:nb.fromDistanceDisplayCondition(r),color:void 0,offset:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,pU)),Object(l.a)(t)||(t=sp.WHITE),o.color=lp.fromColor(t)}return Object(l.a)(this._options.offsetAttribute)&&(o.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,hU,dU))),new Ph({id:t,geometry:uu.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:o})},gU.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,pU),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r),offset:void 0};return Object(l.a)(this._options.offsetAttribute)&&(o.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,hU,dU))),new Ph({id:t,geometry:gu.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:o})},gU.prototype._computeCenter=function(e,t){return JP.getValueOrUndefined(this._entity.position,e,t)},gU.prototype._isHidden=function(e,t){return!Object(l.a)(t.dimensions)||!Object(l.a)(e.position)||iU.prototype._isHidden.call(this,e,t)},gU.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&JP.isConstant(e.orientation)&&t.dimensions.isConstant&&JP.isConstant(t.outlineWidth))},gU.prototype._setStaticOptions=function(e,t){const n=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof NR?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(JA.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==qP.NONE?eu.ALL:void 0},gU.prototype._onEntityPropertyChanged=uU,gU.DynamicGeometryUpdater=_U,Object(l.a)(Object.create)&&(_U.prototype=Object.create(bz.prototype),_U.prototype.constructor=_U),_U.prototype._isHidden=function(e,t,n){const i=JP.getValueOrUndefined(e.position,n,fU),r=this._options.dimensions;return!Object(l.a)(i)||!Object(l.a)(r)||bz.prototype._isHidden.call(this,e,t,n)},_U.prototype._setOptions=function(e,t,n){const i=JP.getValueOrDefault(t.heightReference,n,qP.NONE),r=this._options;r.dimensions=JP.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==qP.NONE?eu.ALL:void 0};var yU=gU;function bU(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=Object(c.a)(e.persists,!1),this.pass=KR.COMPUTE,this.owner=e.owner}bU.prototype.execute=function(e){e.execute(this)};var vU=bU,OU="varying vec2 v_textureCoordinates;\n\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\n\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\n\nvoid main()\n{\n    vec2 uv = v_textureCoordinates;\n    vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\n    vec2 pixel = 1.0 / textureSize;\n\n    float mipLevel = 0.0;\n\n    if (uv.x - pixel.x > (textureSize.y / textureSize.x))\n    {\n        mipLevel = 1.0;\n        if (uv.y - pixel.y > yMipLevel1)\n        {\n            mipLevel = 2.0;\n            if (uv.y - pixel.y * 3.0 > yMipLevel2)\n            {\n                mipLevel = 3.0;\n                if (uv.y - pixel.y * 5.0 > yMipLevel3)\n                {\n                    mipLevel = 4.0;\n                    if (uv.y - pixel.y * 7.0 > yMipLevel4)\n                    {\n                        mipLevel = 5.0;\n                    }\n                }\n            }\n        }\n    }\n\n    if (mipLevel > 0.0)\n    {\n        float scale = pow(2.0, mipLevel);\n\n        uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\n        uv.x *= ((textureSize.x - 2.0) / textureSize.y);\n\n        uv.x -= 1.0 + pixel.x;\n        uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\n        uv *= scale;\n    }\n    else\n    {\n        uv.x *= (textureSize.x / textureSize.y);\n    }\n\n    if(mipLevel == 0.0)\n    {\n        gl_FragColor = texture2D(texture0, uv);\n    }\n    else if(mipLevel == 1.0)\n    {\n        gl_FragColor = texture2D(texture1, uv);\n    }\n    else if(mipLevel == 2.0)\n    {\n        gl_FragColor = texture2D(texture2, uv);\n    }\n    else if(mipLevel == 3.0)\n    {\n        gl_FragColor = texture2D(texture3, uv);\n    }\n    else if(mipLevel == 4.0)\n    {\n        gl_FragColor = texture2D(texture4, uv);\n    }\n    else if(mipLevel == 5.0)\n    {\n        gl_FragColor = texture2D(texture5, uv);\n    }\n    else\n    {\n        gl_FragColor = vec4(0.0);\n    }\n}\n",wU="varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\n\nvoid main()\n{\n    vec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);\n    #ifdef RGBA_NORMALIZED\n        gl_FragColor = vec4(rgba.rgb, 1.0);\n    #else\n        float m = rgba.a * 16.0;\n        vec3 r = rgba.rgb * m;\n        gl_FragColor = vec4(r * r, 1.0);\n    #endif\n}\n",AU="attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\n\nvarying vec3 v_cubeMapCoordinates;\n\nvoid main()\n{\n    gl_Position = position;\n    v_cubeMapCoordinates = cubeMapCoordinates;\n}\n";function EU(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1;const t=this;this._readyPromise=new Promise((e,n)=>{t._completeLoadFromCache=t=>{BU(this),this._texture=t,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,e()},t._failLoad=e=>{n(e)},t._completeLoad=()=>{this._ready=!0,e()}})}Object.defineProperties(EU.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}}),EU.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};const TU=new O(1,0,0),CU=new O(0,0,1),xU=new O(-1,0,0),SU=new O(0,0,-1),IU=new O(0,1,0),PU=[IU,xU,CU,new O(0,-1,0),TU,IU,SU,IU,IU],DU=PU.length,RU=new Float32Array(3*DU);let jU=0;for(let e=0;e<DU;++e,jU+=3)O.pack(PU[e],RU,jU);const MU=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),LU=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function NU(e){return function(){return e}}function BU(e){let t,n;e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();const i=e._cubeMaps;if(Object(l.a)(i))for(n=i.length,t=0;t<n;++t)i[t].destroy();const r=e._mipTextures;if(Object(l.a)(r))for(n=r.length,t=0;t<n;++t)r[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}EU.prototype.update=function(e){const t=e.context;if(!EU.isSupported(t))return;if(Object(l.a)(this._texture)&&Object(l.a)(this._va)&&BU(this),Object(l.a)(this._texture))return;if(!Object(l.a)(this._texture)&&!this._loading){const t=e.context.textureCache.getTexture(this._url);Object(l.a)(t)&&this._completeLoadFromCache(t)}const n=this._cubeMapBuffers;if(!Object(l.a)(n)&&!this._loading){const e=this;sE(this._url).then((function(t){e._cubeMapBuffers=t,e._loading=!1})).catch((function(t){e._failLoad(t)})),this._loading=!0}if(!Object(l.a)(this._cubeMapBuffers))return;const i=[];let r=n[0].positiveX.pixelDatatype;Object(l.a)(r)?i.push("RGBA_NORMALIZED"):r=t.halfFloatingPointTexture?rT.HALF_FLOAT:rT.FLOAT;const o=aT.RGBA,a=new UN({defines:i,sources:[wU]});this._va=function(e){const t=ZN.createVertexBuffer({context:e,typedArray:MU,usage:KN.STATIC_DRAW}),n=ZN.createVertexBuffer({context:e,typedArray:RU,usage:KN.STATIC_DRAW}),i=ZN.createIndexBuffer({context:e,typedArray:LU,usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT}),r=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:gs.FLOAT},{index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:gs.FLOAT}];return new iB({context:e,attributes:r,indexBuffer:i})}(t),this._sp=oM.fromCache({context:t,vertexShaderSource:AU,fragmentShaderSource:a,attributeLocations:{position:0,cubeMapCoordinates:1}});const s=Math.min(n.length,6);this._maximumMipmapLevel=s-1;const c=this._cubeMaps=new Array(s),u=this._mipTextures=new Array(s),h=2*n[0].positiveX.width,d={originalSize:function(){return h}};for(let i=0;i<s;++i){const a=n[i].positiveY;n[i].positiveY=n[i].negativeY,n[i].negativeY=a;const s=c[i]=new XD({context:t,source:n[i],pixelDatatype:r}),l=2*c[i].width,h=u[i]=new JD({context:t,width:l,height:l,pixelDatatype:r,pixelFormat:o}),f=new vU({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:NU(s)},outputTexture:h,persists:!0,owner:this});e.commandList.push(f),d["texture"+i]=NU(h)}this._texture=new JD({context:t,width:1.5*h+2,height:h,pixelDatatype:r,pixelFormat:o}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);const f=new vU({fragmentShaderSource:OU,uniformMap:d,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(f),this._completeLoad()},EU.prototype.isDestroyed=function(){return!1},EU.prototype.destroy=function(){return BU(this),this._texture=this._texture&&this._texture.destroy(),sc(this)};var FU=EU;function zU(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(l.a)(e.imageBasedLightingFactor)?Vt.clone(e.imageBasedLightingFactor):new Vt(1,1);s.a.typeOf.object("options.imageBasedLightingFactor",t),s.a.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.x",t.x,0),s.a.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.x",t.x,1),s.a.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.y",t.y,0),s.a.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.y",t.y,1),this._imageBasedLightingFactor=t;const n=Object(c.a)(e.luminanceAtZenith,.2);s.a.typeOf.number("options.luminanceAtZenith",n),this._luminanceAtZenith=n;const i=e.sphericalHarmonicCoefficients;if(Object(l.a)(i)&&(!Array.isArray(i)||9!==i.length))throw new u.a("options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");this._sphericalHarmonicCoefficients=i,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapAtlas=void 0,this._specularEnvironmentMapAtlasDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=Vt.clone(t),this._previousLuminanceAtZenith=n,this._previousSphericalHarmonicCoefficients=i}function kU(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}Object.defineProperties(zU.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){s.a.typeOf.object("imageBasedLightingFactor",e),s.a.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),s.a.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),s.a.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),s.a.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),this._previousImageBasedLightingFactor=Vt.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=Vt.clone(e,this._imageBasedLightingFactor)}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){this._previousLuminanceAtZenith=this._luminanceAtZenith,this._luminanceAtZenith=e}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if(Object(l.a)(e)&&(!Array.isArray(e)||9!==e.length))throw new u.a("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentMapAtlasDirty=this._specularEnvironmentMapAtlasDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return Object(l.a)(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return Object(l.a)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}}),zU.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;const t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;const n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;Vt.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&0===i.x||0===n.x&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&0===i.y||0===n.y&&i.y>0,this._previousImageBasedLightingFactor=Vt.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||Object(l.a)(this._luminanceAtZenith)!==Object(l.a)(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||Object(l.a)(this._previousSphericalHarmonicCoefficients)!==Object(l.a)(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(!function(e,t){if(FU.isSupported(t)){if(e._specularEnvironmentMapAtlas=e._specularEnvironmentMapAtlas&&e._specularEnvironmentMapAtlas.destroy(),Object(l.a)(e._specularEnvironmentMaps)){const t=new FU(e._specularEnvironmentMaps);e._specularEnvironmentMapAtlas=t,t.readyPromise.then((function(){e._specularEnvironmentMapLoaded=!0})).catch((function(e){console.error("Error loading specularEnvironmentMaps: "+e)}))}e._shouldRegenerateShaders=!0}}(this,t),this._specularEnvironmentMapAtlasDirty=!1),Object(l.a)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);const r=!Object(l.a)(this._specularEnvironmentMapAtlas)&&Object(l.a)(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!Object(l.a)(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,a=!Object(l.a)(this._sphericalHarmonicCoefficients)&&Object(l.a)(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,s=!Object(l.a)(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||a||s,this._useDefaultSpecularMaps=!Object(l.a)(this._specularEnvironmentMapAtlas)&&Object(l.a)(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!Object(l.a)(this._sphericalHarmonicCoefficients)&&Object(l.a)(e.sphericalHarmonicCoefficients)},zU.prototype.isDestroyed=function(){return!1},zU.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),sc(this)},kU.ALL=Object.freeze(new kU({color:new sp(0,0,0,0),depth:1,stencil:0})),kU.prototype.execute=function(e,t){e.clear(this,t)};var UU=kU;const VU={X:0,Y:1,Z:2};VU.Y_UP_TO_Z_UP=Me.fromRotationTranslation(ce.fromRotationX(h.a.PI_OVER_TWO)),VU.Z_UP_TO_Y_UP=Me.fromRotationTranslation(ce.fromRotationX(-h.a.PI_OVER_TWO)),VU.X_UP_TO_Z_UP=Me.fromRotationTranslation(ce.fromRotationY(-h.a.PI_OVER_TWO)),VU.Z_UP_TO_X_UP=Me.fromRotationTranslation(ce.fromRotationY(h.a.PI_OVER_TWO)),VU.X_UP_TO_Y_UP=Me.fromRotationTranslation(ce.fromRotationZ(h.a.PI_OVER_TWO)),VU.Y_UP_TO_X_UP=Me.fromRotationTranslation(ce.fromRotationZ(-h.a.PI_OVER_TWO)),VU.fromName=function(e){return s.a.typeOf.string("name",e),VU[e]};var HU=Object.freeze(VU);function GU(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties(GU.prototype,{metadata:{get:function(){return this._metadata}}});const qU={};qU._deprecationWarning=ll;const WU=Uint32Array.BYTES_PER_ELEMENT;qU.parse=function(e,t){const n=Object(c.a)(t,0);s.a.defined("arrayBuffer",e),t=n;const i=new Uint8Array(e),r=new DataView(e);t+=WU;const o=r.getUint32(t,!0);if(1!==o)throw new ye.a(`Only Batched 3D Model version 1 is supported.  Version ${o} is not.`);t+=WU;const a=r.getUint32(t,!0);t+=WU;let l=r.getUint32(t,!0);t+=WU;let u=r.getUint32(t,!0);t+=WU;let h=r.getUint32(t,!0);t+=WU;let d,f,p=r.getUint32(t,!0);t+=WU,h>=570425344?(t-=2*WU,d=l,h=u,p=0,l=0,u=0,qU._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):p>=570425344&&(t-=WU,d=h,h=l,p=u,l=0,u=0,qU._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")),0===l?f={BATCH_LENGTH:Object(c.a)(d,0)}:(f=qu(i,t,l),t+=l);const m=new Uint8Array(e,t,u);let g,_;t+=u,h>0&&(g=qu(i,t,h),t+=h,p>0&&(_=new Uint8Array(e,t,p),_=new Uint8Array(_),t+=p));const y=n+a-t;if(0===y)throw new ye.a("glTF byte length must be greater than 0.");let b;return t%4==0?b=new Uint8Array(e,t,y):(qU._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+y))),{batchLength:d,featureTableJson:f,featureTableBinary:m,batchTableJson:g,batchTableBinary:_,gltf:b}};var YU=qU;function XU(e){s.a.typeOf.number("options.featuresLength",e.featuresLength),s.a.typeOf.object("options.owner",e.owner),this._id=fy();const t=e.featuresLength;let n,i;if(this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],t>0){const e=Math.min(t,MD.maximumTextureSize),r=Math.ceil(t/MD.maximumTextureSize),o=1/e,a=.5*o,s=1/r,c=.5*s;n=new Vt(e,r),i=new _e(o,a,s,c)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}function KU(e){const t=e._textureDimensions;return t.x*t.y*4}function JU(e){if(!Object(l.a)(e._batchValues)){const t=KU(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function ZU(e){if(!Object(l.a)(e._showAlphaProperties)){const t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function $U(e,t){if(!Object(l.a)(e)||e<0||e>=t)throw new u.a("batchId is required and between zero and featuresLength - 1 ("+t-NaN)}Object.defineProperties(XU.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return Object(l.a)(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),Object(l.a)(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}}),XU.DEFAULT_COLOR_VALUE=sp.WHITE,XU.DEFAULT_SHOW_VALUE=!0,XU.prototype.setShow=function(e,t){if($U(e,this._featuresLength),s.a.typeOf.bool("show",t),t&&!Object(l.a)(this._showAlphaProperties))return;const n=ZU(this),i=2*e,r=t?255:0;if(n[i]!==r){n[i]=r;JU(this)[4*e+3]=t?n[i+1]:0,this._batchValuesDirty=!0}},XU.prototype.setAllShow=function(e){s.a.typeOf.bool("show",e);const t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)},XU.prototype.getShow=function(e){if($U(e,this._featuresLength),!Object(l.a)(this._showAlphaProperties))return!0;const t=2*e;return 255===this._showAlphaProperties[t]};const QU=new Array(4);function eV(e,t,n){const i=e._textureDimensions;return new JD({context:t,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:WD.NEAREST})}XU.prototype.setColor=function(e,t){if($U(e,this._featuresLength),s.a.typeOf.object("color",t),sp.equals(t,XU.DEFAULT_COLOR_VALUE)&&!Object(l.a)(this._batchValues))return;const n=t.toBytes(QU),i=n[3],r=JU(this),o=4*e,a=ZU(this),c=2*e;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||a[c+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];const s=255!==a[c+1],u=0!==a[c];r[o+3]=u?i:0,a[c+1]=i;const h=255!==i;h&&!s?++this._translucentFeaturesLength:!h&&s&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,Object(l.a)(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}},XU.prototype.setAllColor=function(e){s.a.typeOf.object("color",e);const t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)},XU.prototype.getColor=function(e,t){if($U(e,this._featuresLength),s.a.typeOf.object("result",t),!Object(l.a)(this._batchValues))return sp.clone(XU.DEFAULT_COLOR_VALUE,t);const n=this._batchValues,i=4*e,r=this._showAlphaProperties,o=2*e;return sp.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)},XU.prototype.getPickColor=function(e){return $U(e,this._featuresLength),this._pickIds[e]},XU.prototype.update=function(e,t){const n=t.context;this._defaultTexture=n.defaultTexture;const i=t.passes;(i.pick||i.postProcess)&&function(e,t){const n=e._featuresLength;if(!Object(l.a)(e._pickTexture)&&n>0){const i=e._pickIds,r=KU(e),o=new Uint8Array(r),a=e._owner,s=e._statistics;for(let e=0;e<n;++e){const n=t.createPickId(a.getFeature(e));i.push(n);const r=n.color,s=4*e;o[s]=sp.floatToByte(r.red),o[s+1]=sp.floatToByte(r.green),o[s+2]=sp.floatToByte(r.blue),o[s+3]=sp.floatToByte(r.alpha)}e._pickTexture=eV(e,t,o),Object(l.a)(s)&&(s.batchTableByteLength+=e._pickTexture.sizeInBytes)}}(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,Object(l.a)(this._batchTexture)||(this._batchTexture=eV(this,n,this._batchValues),Object(l.a)(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),function(e){const t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}(this))},XU.prototype.isDestroyed=function(){return!1},XU.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();const e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return sc(this)};const tV={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nV={SCALAR:void 0,VEC2:Vt,VEC3:O,VEC4:_e,MAT2:Es,MAT3:ce,MAT4:Me};var iV=function(e){const t=e.componentType;let n;n="string"==typeof t?gs.fromName(t):t;const i=tV[e.type],r=nV[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(e,t,r){return gs.createArrayBufferView(n,e,t,i*r)}}};function rV(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,s.a.typeOf.object("options.extension",e.extension),function(e,t,n){let i,r,o;const a=t.instancesLength,s=t.classes;let u,h=t.classIds,d=t.parentCounts,f=t.parentIds,p=a,m=0;Object(l.a)(h.byteOffset)&&(h.componentType=Object(c.a)(h.componentType,gs.UNSIGNED_SHORT),h.type=Cs.SCALAR,o=iV(h),h=o.createArrayBufferView(n.buffer,n.byteOffset+h.byteOffset,a),m+=h.byteLength);if(Object(l.a)(d)){for(Object(l.a)(d.byteOffset)&&(d.componentType=Object(c.a)(d.componentType,gs.UNSIGNED_SHORT),d.type=Cs.SCALAR,o=iV(d),d=o.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,a),m+=d.byteLength),u=new Uint16Array(a),p=0,i=0;i<a;++i)u[i]=p,p+=d[i];m+=u.byteLength}Object(l.a)(f)&&Object(l.a)(f.byteOffset)&&(f.componentType=Object(c.a)(f.componentType,gs.UNSIGNED_SHORT),f.type=Cs.SCALAR,o=iV(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,p),m+=f.byteLength);const g=s.length;for(i=0;i<g;++i){const e=s[i].length,t=s[i].instances,r=oV(e,t,n);m+=aV(r),s[i].instances=Object(up.a)(r,t)}const _=new Array(g).fill(0),y=new Uint16Array(a);for(i=0;i<a;++i)r=h[i],y[i]=_[r],++_[r];m+=y.byteLength,e._classes=s,e._classIds=h,e._classIndexes=y,e._parentCounts=d,e._parentIndexes=u,e._parentIds=f,e._byteLength=m}(this,e.extension,e.binaryBody),function(e){const t=sV;t.length=0;const n=e._classIds.length;for(let i=0;i<n;++i)cV(e,i,t)}(this)}function oV(e,t,n){let i;for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],a=o.byteOffset;if(Object(l.a)(a)){const t=o.componentType,s=o.type;if(!Object(l.a)(t))throw new ye.a("componentType is required.");if(!Object(l.a)(s))throw new ye.a("type is required.");if(!Object(l.a)(n))throw new ye.a(`Property ${r} requires a batch table binary.`);const c=iV(o),u=c.componentsPerAttribute,h=c.classType,d=c.createArrayBufferView(n.buffer,n.byteOffset+a,e);Object(l.a)(i)||(i={}),i[r]={typedArray:d,componentCount:u,type:h}}}return i}function aV(e){let t=0;for(const n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Object.defineProperties(rV.prototype,{byteLength:{get:function(){return this._byteLength}}});const sV=[];function cV(e,t,n){const i=e._parentCounts,r=e._parentIds,o=e._parentIndexes,a=e._classIds.length;if(!Object(l.a)(r))return;if(t>=a)throw new u.a(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new u.a("Circular dependency detected in the batch table hierarchy.");n.push(t);const s=Object(l.a)(i)?i[t]:1,c=Object(l.a)(i)?o[t]:t;for(let i=0;i<s;++i){const o=r[c+i];o!==t&&cV(e,o,n)}n.pop(t)}const lV=[],uV=[];let hV=0;function dV(e,t,n){const i=e._parentCounts,r=e._parentIds;return Object(l.a)(r)?Object(l.a)(i)?function(e,t,n){const i=e._classIds,r=e._parentCounts,o=e._parentIds,a=e._parentIndexes,s=i.length,c=lV;c.length=Math.max(c.length,s);const u=++hV,h=uV;for(h.length=0,h.push(t);h.length>0;){if(c[t=h.pop()]===u)continue;c[t]=u;const i=n(e,t);if(Object(l.a)(i))return i;const s=r[t],d=a[t];for(let e=0;e<s;++e){const n=o[d+e];n!==t&&h.push(n)}}}(e,t,n):function(e,t,n){let i=!0;for(;i;){const r=n(e,t);if(Object(l.a)(r))return r;const o=e._parentIds[t];i=o!==t,t=o}}(e,t,n):n(e,t)}rV.prototype.hasProperty=function(e,t){const n=dV(this,e,(function(e,n){const i=e._classIds[n],r=e._classes[i].instances;if(Object(l.a)(r[t]))return!0}));return Object(l.a)(n)},rV.prototype.propertyExists=function(e){const t=this._classes,n=t.length;for(let i=0;i<n;++i){const n=t[i].instances;if(Object(l.a)(n[e]))return!0}return!1},rV.prototype.getPropertyIds=function(e,t){return(t=Object(l.a)(t)?t:[]).length=0,dV(this,e,(function(e,n){const i=e._classIds[n],r=e._classes[i].instances;for(const e in r)r.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)})),t},rV.prototype.getProperty=function(e,t){return dV(this,e,(function(e,n){const i=e._classIds[n],r=e._classes[i],o=e._classIndexes[n],a=r.instances[t];if(Object(l.a)(a))return Object(l.a)(a.typedArray)?function(e,t){const n=e.typedArray,i=e.componentCount;if(1===i)return n[t];return e.type.unpack(n,t*i)}(a,o):Object(Zf.a)(a[o],!0)}))},rV.prototype.setProperty=function(e,t,n){const i=dV(this,e,(function(i,r){const o=i._classIds[r],a=i._classes[o],s=i._classIndexes[r],c=a.instances[t];if(Object(l.a)(c)){if(r!==e)throw new u.a(`Inherited property "${t}" is read-only.`);return Object(l.a)(c.typedArray)?function(e,t,n){const i=e.typedArray,r=e.componentCount;1===r?i[t]=n:e.type.pack(n,i,t*r)}(c,s,n):c[s]=Object(Zf.a)(n,!0),!0}}));return Object(l.a)(i)},rV.prototype.isClass=function(e,t){const n=dV(this,e,(function(e,n){const i=e._classIds[n];if(e._classes[i].name===t)return!0}));return Object(l.a)(n)},rV.prototype.getClassName=function(e){const t=this._classIds[e];return this._classes[t].name};var fV=Object.freeze({HIGHLIGHT:0,REPLACE:1,MIX:2});const pV=XU.DEFAULT_COLOR_VALUE,mV=XU.DEFAULT_SHOW_VALUE;function gV(e,t,n,i,r){let o;this.featuresLength=t,Object(l.a)(n)&&(o=n.extensions),this._extensions=Object(c.a)(o,{});const a=function(e){const t={};if(!Object(l.a)(e))return t;for(const n in e)e.hasOwnProperty(n)&&"HIERARCHY"!==n&&"extensions"!==n&&"extras"!==n&&(t[n]=Object(Zf.a)(e[n],!0));return t}(n);this._properties=a,this._batchTableHierarchy=function(e,t,n){if(!Object(l.a)(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"];const r=t.HIERARCHY;Object(l.a)(r)&&(gV._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r);if(!Object(l.a)(i))return;return new rV({extension:i,binaryBody:n})}(this,n,i);const s=_V(t,a,i);this._binaryPropertiesByteLength=function(e){if(!Object(l.a)(e))return 0;let t=0;for(const n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new XU({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}function _V(e,t,n){let i;for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],a=o.byteOffset;if(Object(l.a)(a)){const t=o.componentType,s=o.type;if(!Object(l.a)(t))throw new ye.a("componentType is required.");if(!Object(l.a)(s))throw new ye.a("type is required.");if(!Object(l.a)(n))throw new ye.a(`Property ${r} requires a batch table binary.`);const c=iV(o),u=c.componentsPerAttribute,h=c.classType,d=c.createArrayBufferView(n.buffer,n.byteOffset+a,e);Object(l.a)(i)||(i={}),i[r]={typedArray:d,componentCount:u,type:h}}}return i}gV._deprecationWarning=ll,Object.defineProperties(gV.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return Object(l.a)(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}}),gV.getBinaryProperties=function(e,t,n){return _V(e,t,n)},gV.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)},gV.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)},gV.prototype.getShow=function(e){return this._batchTexture.getShow(e)},gV.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)},gV.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)},gV.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)},gV.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};const yV=new sp;function bV(e,t){if(!Object(l.a)(e)||e<0||e>=t)throw new u.a("batchId is required and must be between zero and featuresLength - 1 ("+t-NaN)}function vV(e,t){return e=UN.replaceMain(e,"tile_main"),t?e+"uniform float tile_colorBlend; \nvoid tile_color(vec4 tile_featureColor) \n{ \n    tile_main(); \n    tile_featureColor = czm_gammaCorrect(tile_featureColor); \n    gl_FragColor.a *= tile_featureColor.a; \n    float highlight = ceil(tile_colorBlend); \n    gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n":e+"void tile_color(vec4 tile_featureColor) \n{ \n    tile_main(); \n} \n"}function OV(e,t,n){if(!Object(l.a)(t))return vV(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`);const r=e.match(i);if(!Object(l.a)(r))return vV(e,n);const o=r[0],a=r[2];e=(e=UN.replaceMain(e,"tile_main")).replace(o,"");let s;if("vec3"===a||"vec4"===a){const n="vec3"===a?`vec4(${t}, 1.0)`:t,r="vec3"===a?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,r),s=`    vec4 source = ${n}; \n    tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n    tile_main(); \n`}else"sampler2D"===a&&(e=function(e,t){const n="texture2D("+t;let i,r=0,o=e.indexOf(n,r);for(;o>-1;){let t=0;for(let n=o;n<e.length;++n){const r=e.charAt(n);if("("===r)++t;else if(")"===r&&(--t,0===t)){i=n+1;break}}const a=`tile_diffuse_final(${e.slice(o,i)}, tile_diffuse)`;e=e.slice(0,o)+a+e.slice(i),r=o+a.length,o=e.indexOf(n,r)}return e}(e,t),s="    tile_diffuse = tile_featureColor; \n    tile_main(); \n");return e=`uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nbool isWhite(vec3 color) \n{ \n    return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n    vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n    vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n    return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n${o}\n${e}\nvoid tile_color(vec4 tile_featureColor) \n{ \n`+s,n&&(e+="    tile_featureColor = czm_gammaCorrect(tile_featureColor); \n    gl_FragColor.a *= tile_featureColor.a; \n    float highlight = ceil(tile_colorBlend); \n    gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}gV.prototype.applyStyle=function(e){if(!Object(l.a)(e))return this.setAllColor(pV),void this.setAllShow(mV);const t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){const n=t.getFeature(i),r=Object(l.a)(e.color)?Object(c.a)(e.color.evaluateColor(n,yV),pV):pV,o=Object(l.a)(e.show)?Object(c.a)(e.show.evaluate(n),mV):mV;this.setColor(i,r),this.setShow(i,o)}},gV.prototype.isClass=function(e,t){bV(e,this.featuresLength),s.a.typeOf.string("className",t);const n=this._batchTableHierarchy;return!!Object(l.a)(n)&&n.isClass(e,t)},gV.prototype.isExactClass=function(e,t){return s.a.typeOf.string("className",t),this.getExactClassName(e)===t},gV.prototype.getExactClassName=function(e){bV(e,this.featuresLength);const t=this._batchTableHierarchy;if(Object(l.a)(t))return t.getClassName(e)},gV.prototype.hasProperty=function(e,t){return bV(e,this.featuresLength),s.a.typeOf.string("name",t),Object(l.a)(this._properties[t])||Object(l.a)(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)},gV.prototype.hasPropertyBySemantic=function(){return!1},gV.prototype.getPropertyIds=function(e,t){bV(e,this.featuresLength),(t=Object(l.a)(t)?t:[]).length=0;const n=Object.keys(this._properties);return t.push.apply(t,n),Object(l.a)(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t},gV.prototype.getPropertyBySemantic=function(e,t){},gV.prototype.getProperty=function(e,t){if(bV(e,this.featuresLength),s.a.typeOf.string("name",t),Object(l.a)(this._batchTableBinaryProperties)){const n=this._batchTableBinaryProperties[t];if(Object(l.a)(n))return function(e,t){const n=e.typedArray,i=e.componentCount;return 1===i?n[t]:e.type.unpack(n,t*i)}(n,e)}const n=this._properties[t];if(Object(l.a)(n))return Object(Zf.a)(n[e],!0);if(Object(l.a)(this._batchTableHierarchy)){const n=this._batchTableHierarchy.getProperty(e,t);if(Object(l.a)(n))return n}},gV.prototype.setProperty=function(e,t,n){const i=this.featuresLength;if(bV(e,i),s.a.typeOf.string("name",t),Object(l.a)(this._batchTableBinaryProperties)){const i=this._batchTableBinaryProperties[t];if(Object(l.a)(i))return void function(e,t,n){const i=e.typedArray,r=e.componentCount;1===r?i[t]=n:e.type.pack(n,i,t*r)}(i,e,n)}if(Object(l.a)(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];Object(l.a)(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Object(Zf.a)(n,!0)},gV.prototype.getVertexShaderCallback=function(e,t,n){if(0===this.featuresLength)return;const i=this;return function(r){const o=OV(r,n,!1);let a;return MD.maximumVertexTextureImageUnits>0?(a="",e&&(a+="uniform bool tile_translucentCommand; \n"),a+=`uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    vec2 st = computeSt(${t}); \n    vec4 featureProperties = texture2D(tile_batchTexture, st); \n    tile_color(featureProperties); \n    float show = ceil(featureProperties.a); \n    gl_Position *= show; \n`,e&&(a+="    bool isStyleTranslucent = (featureProperties.a != 1.0); \n    if (czm_pass == czm_passTranslucent) \n    { \n        if (!isStyleTranslucent && !tile_translucentCommand) \n        { \n            gl_Position *= 0.0; \n        } \n    } \n    else \n    { \n        if (isStyleTranslucent) \n        { \n            gl_Position *= 0.0; \n        } \n    } \n"),a+="    tile_featureColor = featureProperties; \n    tile_featureSt = st; \n}"):a=`varying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_color(vec4(1.0)); \n    tile_featureSt = computeSt(${t}); \n}`,`${o}\n${s=i,1===s._batchTexture.textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n    float stepX = tile_textureStep.x; \n    float centerX = tile_textureStep.y; \n    return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n    float stepX = tile_textureStep.x; \n    float centerX = tile_textureStep.y; \n    float stepY = tile_textureStep.z; \n    float centerY = tile_textureStep.w; \n    float xId = mod(batchId, tile_textureDimensions.x); \n    float yId = floor(batchId / tile_textureDimensions.x); \n    return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}${a}`;var s}},gV.prototype.getFragmentShaderCallback=function(e,t,n){if(0!==this.featuresLength)return function(i){return i=OV(i,t,!0),MD.maximumVertexTextureImageUnits>0?(i+="uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n    tile_color(tile_featureColor); \n",n&&(i+="    gl_FragColor.rgb *= gl_FragColor.a; \n"),i+="}"):(e&&(i+="uniform bool tile_translucentCommand; \n"),i+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n    if (featureProperties.a == 0.0) { \n        discard; \n    } \n",e&&(i+="    bool isStyleTranslucent = (featureProperties.a != 1.0); \n    if (czm_pass == czm_passTranslucent) \n    { \n        if (!isStyleTranslucent && !tile_translucentCommand) \n        { \n            discard; \n        } \n    } \n    else \n    { \n        if (isStyleTranslucent) \n        { \n            discard; \n        } \n    } \n"),i+="    tile_color(featureProperties); \n",n&&(i+="    gl_FragColor.rgb *= gl_FragColor.a; \n"),i+="} \n"),i}},gV.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=UN.replaceMain(e,"tile_main"),MD.maximumVertexTextureImageUnits>0?e+="uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n    tile_main(); \n    gl_FragColor = tile_featureColor; \n    gl_FragColor.rgb *= gl_FragColor.a; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n    if (featureProperties.a == 0.0) { \n        discard; \n    } \n    gl_FragColor = featureProperties; \n    gl_FragColor.rgb *= gl_FragColor.a; \n} \n",e}},gV.prototype.getUniformMapCallback=function(){if(0===this.featuresLength)return;const e=this;return function(t){const n={tile_batchTexture:function(){return Object(c.a)(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return function(e){const t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===fV.HIGHLIGHT)return 0;if(n===fV.REPLACE)return 1;if(n===fV.MIX)return h.a.clamp(i,h.a.EPSILON4,1);throw new u.a(`Invalid color blend mode "${n}".`)}(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}};return Object(up.a)(t,n)}},gV.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};const wV=0,AV=1,EV=2;function TV(e){const t=XR.shallowClone(e),n=t.pass===KR.TRANSLUCENT;return t.uniformMap=Object(l.a)(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function CV(e){const t=XR.shallowClone(e);return t.pass=KR.TRANSLUCENT,t.renderState=function(e){const t=Object(Zf.a)(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=SD.ALPHA_BLEND,t.stencilTest=qF.setCesium3DTileBit(),t.stencilMask=qF.CESIUM_3D_TILE_MASK,vj.fromCache(t)}(e.renderState),t}function xV(e){const t=XR.shallowClone(e);return t.renderState=function(e){const t=Object(Zf.a)(e,!0);return t.stencilTest=qF.setCesium3DTileBit(),t.stencilMask=qF.CESIUM_3D_TILE_MASK,vj.fromCache(t)}(e.renderState),t}function SV(e,t){const n=XR.shallowClone(t),i=Object(Zf.a)(n.renderState,!0);i.cull.enabled=!0,i.cull.face=PD.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=qF.setCesium3DTileBit(),i.stencilMask=qF.CESIUM_3D_TILE_MASK,n.renderState=vj.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Object(Zf.a)(t.uniformMap);const r=new Vt(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=function(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!Object(l.a)(n)){const i=t.fragmentShaderSource.clone();i.defines=Object(l.a)(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),i.sources.unshift("#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}(e,t.shaderProgram),n}function IV(e,t){const n=XR.shallowClone(e),i=Object(Zf.a)(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=qF.SKIP_LOD_MASK,i.stencilTest.reference=qF.CESIUM_3D_TILE_MASK|t<<qF.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=UF.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=HF.REPLACE,i.stencilTest.backFunction=UF.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=HF.REPLACE,i.stencilMask=qF.CESIUM_3D_TILE_MASK|qF.SKIP_LOD_MASK,n.renderState=vj.fromCache(i),n}function PV(e){return(e.renderState.stencilTest.reference&qF.SKIP_LOD_MASK)>>>qF.SKIP_LOD_BIT_SHIFT}gV.prototype.addDerivedCommands=function(e,t){const n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,a=r.tileset,s=a._skipLevelOfDetail&&a._hasMixedContent&&e.context.stencilBuffer,c=function(e){const t=e._batchTexture.translucentFeaturesLength;if(0===t)return wV;if(t===e.featuresLength)return AV;return EV}(this);for(let u=t;u<i;++u){const t=n[u];if(t.pass===KR.COMPUTE)continue;let i=t.derivedCommands.tileset;Object(l.a)(i)&&!t.dirty||(i={},t.derivedCommands.tileset=i,i.originalCommand=TV(t),t.dirty=!1);const h=i.originalCommand;c!==wV&&t.pass!==KR.TRANSLUCENT&&(Object(l.a)(i.translucent)||(i.translucent=CV(h))),c!==AV&&t.pass!==KR.TRANSLUCENT&&(Object(l.a)(i.opaque)||(i.opaque=xV(h)),s&&(o||(Object(l.a)(i.zback)||(i.zback=SV(e.context,h)),a._backfaceCommands.push(i.zback)),Object(l.a)(i.stencil)&&r._selectionDepth===PV(i.stencil)||(t.renderState.depthMask?i.stencil=IV(h,r._selectionDepth):i.stencil=i.opaque)));const d=s?i.stencil:i.opaque,f=i.translucent;t.pass!==KR.TRANSLUCENT?(c===wV&&(n[u]=d),c===AV&&(n[u]=f),c===EV&&(n[u]=d,n.push(f))):n[u]=h}},gV.prototype.update=function(e,t){this._batchTexture.update(e,t)},gV.prototype.isDestroyed=function(){return!1},gV.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),sc(this)};var DV=gV;function RV(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(RV.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return Object(l.a)(this._color)||(this._color=new sp),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(Object(l.a)(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}}),RV.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},RV.prototype.getPropertyNames=function(e){return ll("Cesium3DTileFeature.getPropertyNames","Cesium3DTileFeature.getPropertyNames was deprecated in CesiumJS 1.95 and will be removed in 1.98. Use Cesium3DTileFeature.getPropertyIds instead"),this._content.batchTable.getPropertyIds(this._batchId,e)},RV.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)},RV.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},RV.getPropertyInherited=function(e,t,n){const i=e.batchTable;if(Object(l.a)(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}const r=e.metadata;if(Object(l.a)(r)){if(r.hasPropertyBySemantic(n))return r.getPropertyBySemantic(n);if(r.hasProperty(n))return r.getProperty(n)}const o=e.tile,a=o.metadata;if(Object(l.a)(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let s;if(Object(l.a)(o.implicitSubtree)&&(s=o.implicitSubtree.metadata),Object(l.a)(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}const c=Object(l.a)(e.group)?e.group.metadata:void 0;if(Object(l.a)(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}const u=e.tileset.metadata;if(Object(l.a)(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}},RV.prototype.getPropertyInherited=function(e){return RV.getPropertyInherited(this._content,this._batchId,e)},RV.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},RV.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},RV.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},RV.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var jV=RV;function MV(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function LV(e,t,n,i,r,o){const a=e._cachedTypedArrays;let s=a[t];return Object(l.a)(s)||(s=gs.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),a[t]=s),s}MV.prototype.getGlobalProperty=function(e,t,n){const i=this.json[e];if(Object(l.a)(i))return Object(l.a)(i.byteOffset)?LV(this,e,t=Object(c.a)(t,gs.UNSIGNED_INT),n=Object(c.a)(n,1),1,i.byteOffset):i},MV.prototype.hasProperty=function(e){return Object(l.a)(this.json[e])},MV.prototype.getPropertyArray=function(e,t,n){const i=this.json[e];if(Object(l.a)(i))return Object(l.a)(i.byteOffset)?(Object(l.a)(i.componentType)&&(t=gs.fromName(i.componentType)),LV(this,e,t,n,this.featuresLength,i.byteOffset)):function(e,t,n,i){const r=e._cachedTypedArrays;let o=r[t];return Object(l.a)(o)||(o=gs.createTypedArray(n,i),r[t]=o),o}(this,e,t,i)},MV.prototype.getProperty=function(e,t,n,i,r){const o=this.json[e];if(!Object(l.a)(o))return;const a=this.getPropertyArray(e,t,n);if(1===n)return a[i];for(let e=0;e<n;++e)r[e]=a[n*i+e];return r};var NV=MV;var BV=function(e,t,n){if(n=Object(c.a)(n,!1)){const n=e.indexOf(t);if(n>-1)return n}return e.push(t),e.length-1};var FV=function(e,t){return Object(l.a)(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0};function zV(){}zV.objectLegacy=function(e,t){if(Object(l.a)(e))for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const i=t(e[n],n);if(Object(l.a)(i))return i}},zV.object=function(e,t){if(Object(l.a)(e)){const n=e.length;for(let i=0;i<n;i++){const n=t(e[i],i);if(Object(l.a)(n))return n}}},zV.topLevel=function(e,t,n){const i=e[t];return Object(l.a)(i)&&!Array.isArray(i)?zV.objectLegacy(i,n):zV.object(i,n)},zV.accessor=function(e,t){return zV.topLevel(e,"accessors",t)},zV.accessorWithSemantic=function(e,t,n){const i={};return zV.mesh(e,(function(e){return zV.meshPrimitive(e,(function(e){const r=zV.meshPrimitiveAttribute(e,(function(e,r){if(0===r.indexOf(t)&&!Object(l.a)(i[e])){i[e]=!0;const t=n(e);if(Object(l.a)(t))return t}}));return Object(l.a)(r)?r:zV.meshPrimitiveTarget(e,(function(e){return zV.meshPrimitiveTargetAttribute(e,(function(e,r){if(0===r.indexOf(t)&&!Object(l.a)(i[e])){i[e]=!0;const t=n(e);if(Object(l.a)(t))return t}}))}))}))}))},zV.accessorContainingVertexAttributeData=function(e,t){const n={};return zV.mesh(e,(function(e){return zV.meshPrimitive(e,(function(e){const i=zV.meshPrimitiveAttribute(e,(function(e){if(!Object(l.a)(n[e])){n[e]=!0;const i=t(e);if(Object(l.a)(i))return i}}));return Object(l.a)(i)?i:zV.meshPrimitiveTarget(e,(function(e){return zV.meshPrimitiveTargetAttribute(e,(function(e){if(!Object(l.a)(n[e])){n[e]=!0;const i=t(e);if(Object(l.a)(i))return i}}))}))}))}))},zV.accessorContainingIndexData=function(e,t){const n={};return zV.mesh(e,(function(e){return zV.meshPrimitive(e,(function(e){const i=e.indices;if(Object(l.a)(i)&&!Object(l.a)(n[i])){n[i]=!0;const e=t(i);if(Object(l.a)(e))return e}}))}))},zV.animation=function(e,t){return zV.topLevel(e,"animations",t)},zV.animationChannel=function(e,t){const n=e.channels;return zV.object(n,t)},zV.animationSampler=function(e,t){const n=e.samplers;return zV.object(n,t)},zV.buffer=function(e,t){return zV.topLevel(e,"buffers",t)},zV.bufferView=function(e,t){return zV.topLevel(e,"bufferViews",t)},zV.camera=function(e,t){return zV.topLevel(e,"cameras",t)},zV.image=function(e,t){return zV.topLevel(e,"images",t)},zV.material=function(e,t){return zV.topLevel(e,"materials",t)},zV.materialValue=function(e,t){let n=e.values;Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const i=t(n[e],e);if(Object(l.a)(i))return i}},zV.mesh=function(e,t){return zV.topLevel(e,"meshes",t)},zV.meshPrimitive=function(e,t){const n=e.primitives;if(Object(l.a)(n)){const e=n.length;for(let i=0;i<e;i++){const e=t(n[i],i);if(Object(l.a)(e))return e}}},zV.meshPrimitiveAttribute=function(e,t){const n=e.attributes;for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const i=t(n[e],e);if(Object(l.a)(i))return i}},zV.meshPrimitiveTarget=function(e,t){const n=e.targets;if(Object(l.a)(n)){const e=n.length;for(let i=0;i<e;++i){const e=t(n[i],i);if(Object(l.a)(e))return e}}},zV.meshPrimitiveTargetAttribute=function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const i=t(e[n],n);if(Object(l.a)(i))return i}},zV.node=function(e,t){return zV.topLevel(e,"nodes",t)},zV.nodeInTree=function(e,t,n){const i=e.nodes;if(Object(l.a)(i)){const r=t.length;for(let o=0;o<r;o++){const r=t[o],a=i[r];if(Object(l.a)(a)){let t=n(a,r);if(Object(l.a)(t))return t;const i=a.children;if(Object(l.a)(i)&&(t=zV.nodeInTree(e,i,n),Object(l.a)(t)))return t}}}},zV.nodeInScene=function(e,t,n){const i=t.nodes;if(Object(l.a)(i))return zV.nodeInTree(e,i,n)},zV.program=function(e,t){return FV(e,"KHR_techniques_webgl")?zV.object(e.extensions.KHR_techniques_webgl.programs,t):zV.topLevel(e,"programs",t)},zV.sampler=function(e,t){return zV.topLevel(e,"samplers",t)},zV.scene=function(e,t){return zV.topLevel(e,"scenes",t)},zV.shader=function(e,t){return FV(e,"KHR_techniques_webgl")?zV.object(e.extensions.KHR_techniques_webgl.shaders,t):zV.topLevel(e,"shaders",t)},zV.skin=function(e,t){return zV.topLevel(e,"skins",t)},zV.skinJoint=function(e,t){const n=e.joints;if(Object(l.a)(n)){const e=n.length;for(let i=0;i<e;i++){const e=t(n[i]);if(Object(l.a)(e))return e}}},zV.techniqueAttribute=function(e,t){const n=e.attributes;for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const i=t(n[e],e);if(Object(l.a)(i))return i}},zV.techniqueUniform=function(e,t){const n=e.uniforms;for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const i=t(n[e],e);if(Object(l.a)(i))return i}},zV.techniqueParameter=function(e,t){const n=e.parameters;for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const i=t(n[e],e);if(Object(l.a)(i))return i}},zV.technique=function(e,t){return FV(e,"KHR_techniques_webgl")?zV.object(e.extensions.KHR_techniques_webgl.techniques,t):zV.topLevel(e,"techniques",t)},zV.texture=function(e,t){return zV.topLevel(e,"textures",t)};var kV=zV;var UV=function(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}};var VV=function(e,t){const n=t.bufferView;if(Object(l.a)(n)){const t=e.bufferViews[n];if(Object(l.a)(t.byteStride)&&t.byteStride>0)return t.byteStride}return gs.getSizeInBytes(t.componentType)*UV(t.type)};function HV(e){Object(l.a)(e)&&(e.texCoord=Object(c.a)(e.texCoord,0))}var GV=function(e){kV.accessor(e,(function(e){Object(l.a)(e.bufferView)&&(e.byteOffset=Object(c.a)(e.byteOffset,0))})),kV.bufferView(e,(function(e){Object(l.a)(e.buffer)&&(e.byteOffset=Object(c.a)(e.byteOffset,0))})),kV.mesh(e,(function(t){kV.meshPrimitive(t,(function(t){if(t.mode=Object(c.a)(t.mode,ps.TRIANGLES),!Object(l.a)(t.material)){Object(l.a)(e.materials)||(e.materials=[]);const n={name:"default"};t.material=BV(e.materials,n)}}))})),kV.accessorContainingVertexAttributeData(e,(function(t){const n=e.accessors[t],i=n.bufferView;if(n.normalized=Object(c.a)(n.normalized,!1),Object(l.a)(i)){const t=e.bufferViews[i];t.byteStride=VV(e,n),t.target=ps.ARRAY_BUFFER}})),kV.accessorContainingIndexData(e,(function(t){const n=e.accessors[t].bufferView;if(Object(l.a)(n)){e.bufferViews[n].target=ps.ELEMENT_ARRAY_BUFFER}})),kV.material(e,(function(e){const t=Object(c.a)(e.extensions,c.a.EMPTY_OBJECT),n=t.KHR_materials_common;if(Object(l.a)(n)){const e=n.technique,t=Object(l.a)(n.values)?n.values:{};return n.values=t,t.ambient=Object(l.a)(t.ambient)?t.ambient:[0,0,0,1],t.emission=Object(l.a)(t.emission)?t.emission:[0,0,0,1],t.transparency=Object(c.a)(t.transparency,1),t.transparent=Object(c.a)(t.transparent,!1),t.doubleSided=Object(c.a)(t.doubleSided,!1),void("CONSTANT"!==e&&(t.diffuse=Object(l.a)(t.diffuse)?t.diffuse:[0,0,0,1],"LAMBERT"!==e&&(t.specular=Object(l.a)(t.specular)?t.specular:[0,0,0,1],t.shininess=Object(c.a)(t.shininess,0))))}e.emissiveFactor=Object(c.a)(e.emissiveFactor,[0,0,0]),e.alphaMode=Object(c.a)(e.alphaMode,"OPAQUE"),e.doubleSided=Object(c.a)(e.doubleSided,!1),"MASK"===e.alphaMode&&(e.alphaCutoff=Object(c.a)(e.alphaCutoff,.5));const i=t.KHR_techniques_webgl;Object(l.a)(i)&&kV.materialValue(e,(function(e){Object(l.a)(e.index)&&HV(e)})),HV(e.emissiveTexture),HV(e.normalTexture),HV(e.occlusionTexture);const r=e.pbrMetallicRoughness;Object(l.a)(r)&&(r.baseColorFactor=Object(c.a)(r.baseColorFactor,[1,1,1,1]),r.metallicFactor=Object(c.a)(r.metallicFactor,1),r.roughnessFactor=Object(c.a)(r.roughnessFactor,1),HV(r.baseColorTexture),HV(r.metallicRoughnessTexture));const o=t.KHR_materials_pbrSpecularGlossiness;Object(l.a)(o)&&(o.diffuseFactor=Object(c.a)(o.diffuseFactor,[1,1,1,1]),o.specularFactor=Object(c.a)(o.specularFactor,[1,1,1]),o.glossinessFactor=Object(c.a)(o.glossinessFactor,1),HV(o.specularGlossinessTexture))})),kV.animation(e,(function(e){kV.animationSampler(e,(function(e){e.interpolation=Object(c.a)(e.interpolation,"LINEAR")}))}));const t=function(e){const t={};return kV.animation(e,(function(e){kV.animationChannel(e,(function(e){const n=e.target,i=n.node,r=n.path;"translation"!==r&&"rotation"!==r&&"scale"!==r||(t[i]=!0)}))})),t}(e);return kV.node(e,(function(e,n){Object(l.a)(t[n])||Object(l.a)(e.translation)||Object(l.a)(e.rotation)||Object(l.a)(e.scale)?(e.translation=Object(c.a)(e.translation,[0,0,0]),e.rotation=Object(c.a)(e.rotation,[0,0,0,1]),e.scale=Object(c.a)(e.scale,[1,1,1])):e.matrix=Object(c.a)(e.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])})),kV.sampler(e,(function(e){e.wrapS=Object(c.a)(e.wrapS,ps.REPEAT),e.wrapT=Object(c.a)(e.wrapT,ps.REPEAT)})),Object(l.a)(e.scenes)&&!Object(l.a)(e.scene)&&(e.scene=0),e};function qV(e){e.extras=Object(l.a)(e.extras)?e.extras:{},e.extras._pipeline=Object(l.a)(e.extras._pipeline)?e.extras._pipeline:{}}var WV=function(e){return kV.shader(e,(function(e){qV(e)})),kV.buffer(e,(function(e){qV(e)})),kV.image(e,(function(e){qV(e)})),qV(e),e};var YV=function(e,t){const n=e.extensionsRequired;if(Object(l.a)(n)){const i=n.indexOf(t);i>=0&&n.splice(i,1),0===n.length&&delete e.extensionsRequired}};var XV=function(e,t){const n=e.extensionsUsed;if(Object(l.a)(n)){const i=n.indexOf(t);i>=0&&n.splice(i,1),YV(e,t),0===n.length&&delete e.extensionsUsed}};function KV(e,t,n){const i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+4*o,!0);return r}var JV=function(e){if("glTF"!==Jv(e))throw new ye.a("File is not valid binary glTF");const t=KV(e,0,5),n=t[1];if(1!==n&&2!==n)throw new ye.a("Binary glTF version is not 1 or 2");return 1===n?function(e,t){const n=t[2],i=t[3];if(0!==t[4])throw new ye.a("Binary glTF scene format is not JSON");const r=20+i,o=Gu(e,20,i),a=JSON.parse(o);WV(a);const s=e.subarray(r,n),u=a.buffers;if(Object(l.a)(u)&&Object.keys(u).length>0){const e=Object(c.a)(u.binary_glTF,u.KHR_binary_glTF);Object(l.a)(e)&&(e.extras._pipeline.source=s,delete e.uri)}return XV(a,"KHR_binary_glTF"),a}(e,t):function(e,t){const n=t[2];let i,r,o=12;for(;o<n;){const t=KV(e,o,2),n=t[0],a=t[1];o+=8;const s=e.subarray(o,o+n);if(o+=n,1313821514===a){const e=Gu(s);i=JSON.parse(e),WV(i)}else 5130562===a&&(r=s)}if(Object(l.a)(i)&&Object(l.a)(r)){const e=i.buffers;if(Object(l.a)(e)&&e.length>0){e[0].extras._pipeline.source=r}}return i}(e,t)};var ZV=function(e,t){let n=e.extensionsUsed;Object(l.a)(n)||(n=[],e.extensionsUsed=n),BV(n,t,!0)};var $V=function(e){switch(e){case gs.BYTE:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getInt8(t+o*i)};case gs.UNSIGNED_BYTE:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getUint8(t+o*i)};case gs.SHORT:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getInt16(t+o*i,!0)};case gs.UNSIGNED_SHORT:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getUint16(t+o*i,!0)};case gs.INT:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getInt32(t+o*i,!0)};case gs.UNSIGNED_INT:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getUint32(t+o*i,!0)};case gs.FLOAT:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getFloat32(t+o*i,!0)};case gs.DOUBLE:return function(e,t,n,i,r){for(let o=0;o<n;++o)r[o]=e.getFloat64(t+o*i,!0)}}};var QV=function(e,t){const n=e.bufferViews,i=e.buffers,r=t.bufferView,o=UV(t.type);if(!Object(l.a)(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};const a=new Array(o).fill(Number.POSITIVE_INFINITY),s=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=i[c.buffer].extras._pipeline.source,h=t.count,d=VV(e,t);let f=t.byteOffset+c.byteOffset+u.byteOffset;const p=t.componentType,m=gs.getSizeInBytes(p),g=new DataView(u.buffer),_=new Array(o),y=$V(p);for(let e=0;e<h;e++){y(g,f,o,m,_);for(let e=0;e<o;e++){const t=_[e];a[e]=Math.min(a[e],t),s[e]=Math.max(s[e],t)}f+=d}return{min:a,max:s}};const eH=[ps.FUNC_ADD,ps.FUNC_ADD],tH=[ps.ONE,ps.ZERO,ps.ONE,ps.ZERO];function nH(e,t){const n=e.enable;return!!Object(l.a)(n)&&n.indexOf(t)>-1}const iH=[ps.ZERO,ps.ONE,ps.SRC_COLOR,ps.ONE_MINUS_SRC_COLOR,ps.SRC_ALPHA,ps.ONE_MINUS_SRC_ALPHA,ps.DST_ALPHA,ps.ONE_MINUS_DST_ALPHA,ps.DST_COLOR,ps.ONE_MINUS_DST_COLOR];function rH(e,t){if(!Object(l.a)(e))return t;for(let n=0;n<4;n++)if(-1===iH.indexOf(e[n]))return t;return e}var oH=function(e){const t={},n={},i=e.techniques;return Object(l.a)(i)?(kV.technique(e,(function(e,i){const r=e.states;if(Object(l.a)(r)){const o=n[i]={};if(nH(r,ps.BLEND)){o.alphaMode="BLEND";const e=r.functions;Object(l.a)(e)&&(Object(l.a)(e.blendEquationSeparate)||Object(l.a)(e.blendFuncSeparate))&&(t[i]={blendEquation:Object(c.a)(e.blendEquationSeparate,eH),blendFactors:rH(e.blendFuncSeparate,tH)})}nH(r,ps.CULL_FACE)||(o.doubleSided=!0),delete e.states}})),Object.keys(t).length>0&&(Object(l.a)(e.extensions)||(e.extensions={}),ZV(e,"KHR_blend")),kV.material(e,(function(e){if(Object(l.a)(e.technique)){const i=n[e.technique];kV.objectLegacy(i,(function(t,n){e[n]=t}));const r=t[e.technique];Object(l.a)(r)&&(Object(l.a)(e.extensions)||(e.extensions={}),e.extensions.KHR_blend=r)}})),e):e};var aH=function(e,t){let n=e.extensionsRequired;Object(l.a)(n)||(n=[],e.extensionsRequired=n),BV(n,t,!0),ZV(e,t)};var sH=function(e){const t=e.techniques,n={},i={},r={};if(Object(l.a)(t)){const t={programs:[],shaders:[],techniques:[]},o=e.glExtensionsUsed;delete e.glExtensionsUsed,kV.technique(e,(function(a,s){const c={name:a.name,program:void 0,attributes:{},uniforms:{}};let u;if(kV.techniqueAttribute(a,(function(e,t){u=a.parameters[e],c.attributes[t]={semantic:u.semantic}})),kV.techniqueUniform(a,(function(e,t){u=a.parameters[e],c.uniforms[t]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},Object(l.a)(n[s])||(n[s]={}),n[s][e]=t})),Object(l.a)(r[a.program]))c.program=r[a.program];else{const n=e.programs[a.program],i={name:n.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:o},s=e.shaders[n.fragmentShader];i.fragmentShader=BV(t.shaders,s,!0);const l=e.shaders[n.vertexShader];i.vertexShader=BV(t.shaders,l,!0),c.program=BV(t.programs,i),r[a.program]=c.program}i[s]=BV(t.techniques,c)})),t.techniques.length>0&&(Object(l.a)(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=t,ZV(e,"KHR_techniques_webgl"),aH(e,"KHR_techniques_webgl"))}return kV.material(e,(function(e){if(Object(l.a)(e.technique)){const t={technique:i[e.technique]};kV.objectLegacy(e.values,(function(i,r){Object(l.a)(t.values)||(t.values={});const o=n[e.technique][r];t.values[o]=i})),Object(l.a)(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=t}delete e.technique,delete e.values})),delete e.techniques,delete e.programs,delete e.shaders,e};var cH=function(e,t){s.a.typeOf.object("material",e),s.a.defined("handler",t);const n=e.pbrMetallicRoughness;if(Object(l.a)(n)){if(Object(l.a)(n.baseColorTexture)){const e=n.baseColorTexture,i=t(e.index,e);if(Object(l.a)(i))return i}if(Object(l.a)(n.metallicRoughnessTexture)){const e=n.metallicRoughnessTexture,i=t(e.index,e);if(Object(l.a)(i))return i}}if(Object(l.a)(e.extensions)){const n=e.extensions.KHR_materials_pbrSpecularGlossiness;if(Object(l.a)(n)){if(Object(l.a)(n.diffuseTexture)){const e=n.diffuseTexture,i=t(e.index,e);if(Object(l.a)(i))return i}if(Object(l.a)(n.specularGlossinessTexture)){const e=n.specularGlossinessTexture,i=t(e.index,e);if(Object(l.a)(i))return i}}const i=e.extensions.KHR_materials_common;if(Object(l.a)(i)){const e=i.values.diffuse,n=i.values.ambient,r=i.values.emission,o=i.values.specular;if(Object(l.a)(e)&&Object(l.a)(e.index)){const n=t(e.index,e);if(Object(l.a)(n))return n}if(Object(l.a)(n)&&Object(l.a)(n.index)){const e=t(n.index,n);if(Object(l.a)(e))return e}if(Object(l.a)(r)&&Object(l.a)(r.index)){const e=t(r.index,r);if(Object(l.a)(e))return e}if(Object(l.a)(o)&&Object(l.a)(o.index)){const e=t(o.index,o);if(Object(l.a)(e))return e}}}const i=kV.materialValue(e,(function(e){if(Object(l.a)(e.index)){const n=t(e.index,e);if(Object(l.a)(n))return n}}));if(Object(l.a)(i))return i;if(Object(l.a)(e.emissiveTexture)){const n=e.emissiveTexture,i=t(n.index,n);if(Object(l.a)(i))return i}if(Object(l.a)(e.normalTexture)){const n=e.normalTexture,i=t(n.index,n);if(Object(l.a)(i))return i}if(Object(l.a)(e.occlusionTexture)){const n=e.occlusionTexture,i=t(n.index,n);if(Object(l.a)(i))return i}};const lH=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];const uH={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function hH(){}function dH(){}hH.accessor=function(e,t){e.accessors.splice(t,1),kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){kV.meshPrimitiveAttribute(e,(function(n,i){n>t&&e.attributes[i]--})),kV.meshPrimitiveTarget(e,(function(e){kV.meshPrimitiveTargetAttribute(e,(function(n,i){n>t&&e[i]--}))}));const n=e.indices;Object(l.a)(n)&&n>t&&e.indices--}))})),kV.skin(e,(function(e){Object(l.a)(e.inverseBindMatrices)&&e.inverseBindMatrices>t&&e.inverseBindMatrices--})),kV.animation(e,(function(e){kV.animationSampler(e,(function(e){Object(l.a)(e.input)&&e.input>t&&e.input--,Object(l.a)(e.output)&&e.output>t&&e.output--}))}))},hH.buffer=function(e,t){e.buffers.splice(t,1),kV.bufferView(e,(function(e){Object(l.a)(e.buffer)&&e.buffer>t&&e.buffer--,Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.EXT_meshopt_compression)&&e.extensions.EXT_meshopt_compression.buffer--}))},hH.bufferView=function(e,t){if(e.bufferViews.splice(t,1),kV.accessor(e,(function(e){Object(l.a)(e.bufferView)&&e.bufferView>t&&e.bufferView--})),kV.shader(e,(function(e){Object(l.a)(e.bufferView)&&e.bufferView>t&&e.bufferView--})),kV.image(e,(function(e){Object(l.a)(e.bufferView)&&e.bufferView>t&&e.bufferView--})),FV(e,"KHR_draco_mesh_compression")&&kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_draco_mesh_compression)&&e.extensions.KHR_draco_mesh_compression.bufferView>t&&e.extensions.KHR_draco_mesh_compression.bufferView--}))})),FV(e,"EXT_feature_metadata")){const n=e.extensions.EXT_feature_metadata.featureTables;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e].properties;if(Object(l.a)(i))for(const e in i)if(i.hasOwnProperty(e)){const n=i[e];Object(l.a)(n.bufferView)&&n.bufferView>t&&n.bufferView--,Object(l.a)(n.arrayOffsetBufferView)&&n.arrayOffsetBufferView>t&&n.arrayOffsetBufferView--,Object(l.a)(n.stringOffsetBufferView)&&n.stringOffsetBufferView>t&&n.stringOffsetBufferView--}}}},hH.image=function(e,t){e.images.splice(t,1),kV.texture(e,(function(e){Object(l.a)(e.source)&&e.source>t&&--e.source;const n=e.extensions;Object(l.a)(n)&&Object(l.a)(n.EXT_texture_webp)&&n.EXT_texture_webp.source>t?--e.extensions.EXT_texture_webp.source:Object(l.a)(n)&&Object(l.a)(n.KHR_texture_basisu)&&n.KHR_texture_basisu.source>t&&--e.extensions.KHR_texture_basisu.source}))},hH.mesh=function(e,t){e.meshes.splice(t,1),kV.node(e,(function(e){Object(l.a)(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)}))},hH.node=function(e,t){e.nodes.splice(t,1),kV.skin(e,(function(e){Object(l.a)(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map((function(e){return e>t?e-1:e}))})),kV.animation(e,(function(e){kV.animationChannel(e,(function(e){Object(l.a)(e.target)&&Object(l.a)(e.target.node)&&e.target.node>t&&e.target.node--}))})),kV.technique(e,(function(e){kV.techniqueUniform(e,(function(e){Object(l.a)(e.node)&&e.node>t&&e.node--}))})),kV.node(e,(function(e){Object(l.a)(e.children)&&(e.children=e.children.filter((function(e){return e!==t})).map((function(e){return e>t?e-1:e})))})),kV.scene(e,(function(e){e.nodes=e.nodes.filter((function(e){return e!==t})).map((function(e){return e>t?e-1:e}))}))},hH.material=function(e,t){e.materials.splice(t,1),kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){Object(l.a)(e.material)&&e.material>t&&e.material--}))}))},hH.sampler=function(e,t){e.samplers.splice(t,1),kV.texture(e,(function(e){Object(l.a)(e.sampler)&&e.sampler>t&&--e.sampler}))},hH.texture=function(e,t){if(e.textures.splice(t,1),kV.material(e,(function(e){cH(e,(function(e,n){n.index>t&&--n.index}))})),FV(e,"EXT_feature_metadata")){kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){const n=e.extensions;if(Object(l.a)(n)&&Object(l.a)(n.EXT_feature_metadata)){const e=n.EXT_feature_metadata.featureIdTextures;if(Object(l.a)(e)){const n=e.length;for(let i=0;i<n;++i){const n=e[i].featureIds.texture;n.index>t&&--n.index}}}}))}));const n=e.extensions.EXT_feature_metadata.featureTextures;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e].properties;if(Object(l.a)(i))for(const e in i)if(i.hasOwnProperty(e)){const n=i[e].texture;n.index>t&&--n.index}}}},dH.accessor=function(e){const t={};return kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){kV.meshPrimitiveAttribute(e,(function(e){t[e]=!0})),kV.meshPrimitiveTarget(e,(function(e){kV.meshPrimitiveTargetAttribute(e,(function(e){t[e]=!0}))}));const n=e.indices;Object(l.a)(n)&&(t[n]=!0)}))})),kV.skin(e,(function(e){Object(l.a)(e.inverseBindMatrices)&&(t[e.inverseBindMatrices]=!0)})),kV.animation(e,(function(e){kV.animationSampler(e,(function(e){Object(l.a)(e.input)&&(t[e.input]=!0),Object(l.a)(e.output)&&(t[e.output]=!0)}))})),FV(e,"EXT_mesh_gpu_instancing")&&kV.node(e,(function(e){Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.EXT_mesh_gpu_instancing)&&Object.keys(e.extensions.EXT_mesh_gpu_instancing.attributes).forEach((function(n){const i=e.extensions.EXT_mesh_gpu_instancing.attributes[n];t[i]=!0}))})),t},dH.buffer=function(e){const t={};return kV.bufferView(e,(function(e){Object(l.a)(e.buffer)&&(t[e.buffer]=!0),Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.EXT_meshopt_compression)&&(t[e.extensions.EXT_meshopt_compression.buffer]=!0)})),t},dH.bufferView=function(e){const t={};if(kV.accessor(e,(function(e){Object(l.a)(e.bufferView)&&(t[e.bufferView]=!0)})),kV.shader(e,(function(e){Object(l.a)(e.bufferView)&&(t[e.bufferView]=!0)})),kV.image(e,(function(e){Object(l.a)(e.bufferView)&&(t[e.bufferView]=!0)})),FV(e,"KHR_draco_mesh_compression")&&kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)}))})),FV(e,"EXT_feature_metadata")){const n=e.extensions.EXT_feature_metadata.featureTables;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e].properties;if(Object(l.a)(i))for(const e in i)if(i.hasOwnProperty(e)){const n=i[e];Object(l.a)(n.bufferView)&&(t[n.bufferView]=!0),Object(l.a)(n.arrayOffsetBufferView)&&(t[n.arrayOffsetBufferView]=!0),Object(l.a)(n.stringOffsetBufferView)&&(t[n.stringOffsetBufferView]=!0)}}}return t},dH.image=function(e){const t={};return kV.texture(e,(function(e){Object(l.a)(e.source)&&(t[e.source]=!0),Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.EXT_texture_webp)?t[e.extensions.EXT_texture_webp.source]=!0:Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_texture_basisu)&&(t[e.extensions.KHR_texture_basisu.source]=!0)})),t},dH.mesh=function(e){const t={};return kV.node(e,(function(n){if(Object(l.a)(n.mesh&&Object(l.a)(e.meshes))){const i=e.meshes[n.mesh];Object(l.a)(i)&&Object(l.a)(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}})),t},dH.node=function(e){const t={};return kV.skin(e,(function(e){Object(l.a)(e.skeleton)&&(t[e.skeleton]=!0),kV.skinJoint(e,(function(e){t[e]=!0}))})),kV.animation(e,(function(e){kV.animationChannel(e,(function(e){Object(l.a)(e.target)&&Object(l.a)(e.target.node)&&(t[e.target.node]=!0)}))})),kV.technique(e,(function(e){kV.techniqueUniform(e,(function(e){Object(l.a)(e.node)&&(t[e.node]=!0)}))})),kV.node(e,(function(n,i){(function e(t,n,i){const r=t.nodes[n];return!(Object(l.a)(r.mesh)||Object(l.a)(r.camera)||Object(l.a)(r.skin)||Object(l.a)(r.weights)||Object(l.a)(r.extras)||Object(l.a)(r.extensions)&&0!==Object.keys(r.extensions).length||Object(l.a)(i[n]))&&(!Object(l.a)(r.children)||0===r.children.filter((function(n){return!e(t,n,i)})).length)})(e,i,t)||(t[i]=!0)})),t},dH.material=function(e){const t={};return kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){Object(l.a)(e.material)&&(t[e.material]=!0)}))})),t},dH.texture=function(e){const t={};if(kV.material(e,(function(e){cH(e,(function(e){t[e]=!0}))})),FV(e,"EXT_feature_metadata")){kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){const n=e.extensions;if(Object(l.a)(n)&&Object(l.a)(n.EXT_feature_metadata)){const e=n.EXT_feature_metadata.featureIdTextures;if(Object(l.a)(e)){const n=e.length;for(let i=0;i<n;++i){const n=e[i].featureIds.texture;t[n.index]=!0}}}}))}));const n=e.extensions.EXT_feature_metadata.featureTextures;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e].properties;if(Object(l.a)(i))for(const e in i)if(i.hasOwnProperty(e)){const n=i[e].texture;t[n.index]=!0}}}return t},dH.sampler=function(e){const t={};return kV.texture(e,(function(e){Object(l.a)(e.sampler)&&(t[e.sampler]=!0)})),t};var fH=function(e,t){return t=Object(c.a)(t,lH),lH.forEach((function(n){t.indexOf(n)>-1&&function(e,t){const n=e[uH[t]];if(Object(l.a)(n)){let i=0;const r=dH[t](e),o=n.length;for(let n=0;n<o;++n)r[n]||(hH[t](e,n-i),i++)}}(e,n)})),e};var pH=function(e,t){const n={byteLength:t.length,extras:{_pipeline:{source:t}}},i={buffer:BV(e.buffers,n),byteOffset:0,byteLength:t.length};return BV(e.bufferViews,i)};var mH=function(e,t){const n=VV(e,t),i=gs.getSizeInBytes(t.componentType),r=UV(t.type),o=t.count,a=new Array(r*o);if(!Object(l.a)(t.bufferView))return a.fill(0);const s=e.bufferViews[t.bufferView],c=e.buffers[s.buffer].extras._pipeline.source;let u=t.byteOffset+s.byteOffset+c.byteOffset;const h=new DataView(c.buffer),d=new Array(r),f=$V(t.componentType);for(let e=0;e<o;++e){f(h,u,r,i,d);for(let t=0;t<r;++t)a[e*r+t]=d[t];u+=n}return a};function gH(e,t,n){const i=gs.createTypedArray(n,mH(e,t)),r=new Uint8Array(i.buffer);t.bufferView=pH(e,r),t.componentType=n,t.byteOffset=0}var _H=function(e){let t;return kV.accessorWithSemantic(e,"JOINTS_0",(function(n){const i=e.accessors[n];t=i.componentType,t===ps.BYTE?gH(e,i,gs.UNSIGNED_BYTE):t!==ps.UNSIGNED_BYTE&&t!==ps.UNSIGNED_SHORT&&gH(e,i,gs.UNSIGNED_SHORT)})),kV.accessorWithSemantic(e,"WEIGHTS_0",(function(n){const i=e.accessors[n];t=i.componentType,t===ps.BYTE?gH(e,i,gs.UNSIGNED_BYTE):t===ps.SHORT&&gH(e,i,gs.UNSIGNED_SHORT)})),e};const yH={.8:function(e){Object(l.a)(e.asset)||(e.asset={});const t=e.asset;if(t.version="1.0","string"==typeof t.profile){const e=t.profile.split(" ");t.profile={api:e[0],version:e[1]}}else t.profile={};Object(l.a)(e.version)&&delete e.version;bH(e),vH(e),OH(e),wH(e),AH(e),Object(l.a)(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions);if(Object(l.a)(e.lights)){const t=Object(c.a)(e.extensions,{});e.extensions=t;const n=Object(c.a)(t.KHR_materials_common,{});t.KHR_materials_common=n,n.lights=e.lights,delete e.lights,ZV(e,"KHR_materials_common")}},"1.0":function(e){e.asset=Object(c.a)(e.asset,{}),e.asset.version="2.0",bH(e),function(e){const t=e.animations;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e],i=n.parameters;if(Object(l.a)(i)){const e=n.samplers;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];n.input=i[n.input],n.output=i[n.output]}delete n.parameters}}}(e),function(e){kV.node(e,(function(t,n){IH(t)&&function e(t,n){kV.scene(t,(function(e){const t=e.nodes;if(Object(l.a)(t)){for(let e=t.length;e>=0;--e)if(t[e]===n)return void t.splice(e,1)}})),kV.node(t,(function(i,r){if(Object(l.a)(i.children)){const o=i.children.indexOf(n);o>-1&&(i.children.splice(o,1),IH(i)&&e(t,r))}})),delete t.nodes[n]}(e,n)}))}(e),function(e){let t;const n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}};let i;const r={},o=e.nodes;for(const e in o)Object.prototype.hasOwnProperty.call(o,e)&&(i=o[e].jointName,Object(l.a)(i)&&(r[i]=e));for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Object(l.a)(n[t])){const i={},r=e[t];e[t]=EH(r,i),n[t]=i}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);Object(l.a)(e.scene)&&(e.scene=n.scenes[e.scene]);kV.bufferView(e,(function(e){Object(l.a)(e.buffer)&&(e.buffer=n.buffers[e.buffer])})),kV.accessor(e,(function(e){Object(l.a)(e.bufferView)&&(e.bufferView=n.bufferViews[e.bufferView])})),kV.shader(e,(function(e){const t=e.extensions;if(Object(l.a)(t)){const i=t.KHR_binary_glTF;Object(l.a)(i)&&(e.bufferView=n.bufferViews[i.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}})),kV.program(e,(function(e){Object(l.a)(e.vertexShader)&&(e.vertexShader=n.shaders[e.vertexShader]),Object(l.a)(e.fragmentShader)&&(e.fragmentShader=n.shaders[e.fragmentShader])})),kV.technique(e,(function(e){Object(l.a)(e.program)&&(e.program=n.programs[e.program]),kV.techniqueParameter(e,(function(e){Object(l.a)(e.node)&&(e.node=n.nodes[e.node]);const t=e.value;"string"==typeof t&&(e.value={index:n.textures[t]})}))})),kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){Object(l.a)(e.indices)&&(e.indices=n.accessors[e.indices]),kV.meshPrimitiveAttribute(e,(function(t,i){e.attributes[i]=n.accessors[t]})),Object(l.a)(e.material)&&(e.material=n.materials[e.material])}))})),kV.node(e,(function(i){let r=i.children;if(Object(l.a)(r)){const e=r.length;for(t=0;t<e;++t)r[t]=n.nodes[r[t]]}if(Object(l.a)(i.meshes)){const o=i.meshes,a=o.length;if(a>0)for(i.mesh=n.meshes[o[0]],t=1;t<a;++t){const a={mesh:n.meshes[o[t]]},s=BV(e.nodes,a);Object(l.a)(r)||(r=[],i.children=r),r.push(s)}delete i.meshes}if(Object(l.a)(i.camera)&&(i.camera=n.cameras[i.camera]),Object(l.a)(i.skin)&&(i.skin=n.skins[i.skin]),Object(l.a)(i.skeletons)){const t=i.skeletons;if(t.length>0&&Object(l.a)(i.skin)){e.skins[i.skin].skeleton=n.nodes[t[0]]}delete i.skeletons}Object(l.a)(i.jointName)&&delete i.jointName})),kV.skin(e,(function(e){Object(l.a)(e.inverseBindMatrices)&&(e.inverseBindMatrices=n.accessors[e.inverseBindMatrices]);const i=e.jointNames;if(Object(l.a)(i)){const n=[],o=i.length;for(t=0;t<o;++t)n[t]=r[i[t]];e.joints=n,delete e.jointNames}})),kV.scene(e,(function(e){const i=e.nodes;if(Object(l.a)(i)){const e=i.length;for(t=0;t<e;++t)i[t]=n.nodes[i[t]]}})),kV.animation(e,(function(e){const t={};e.samplers=EH(e.samplers,t),kV.animationSampler(e,(function(e){e.input=n.accessors[e.input],e.output=n.accessors[e.output]})),kV.animationChannel(e,(function(e){e.sampler=t[e.sampler];const i=e.target;Object(l.a)(i)&&(i.node=n.nodes[i.id],delete i.id)}))})),kV.material(e,(function(e){Object(l.a)(e.technique)&&(e.technique=n.techniques[e.technique]),kV.materialValue(e,(function(t,i){"string"==typeof t&&(e.values[i]={index:n.textures[t]})}));const t=e.extensions;if(Object(l.a)(t)){const e=t.KHR_materials_common;Object(l.a)(e)&&kV.materialValue(e,(function(t,i){"string"==typeof t&&(e.values[i]={index:n.textures[t]})}))}})),kV.image(e,(function(e){const t=e.extensions;if(Object(l.a)(t)){const i=t.KHR_binary_glTF;Object(l.a)(i)&&(e.bufferView=n.bufferViews[i.bufferView],e.mimeType=i.mimeType,delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}})),kV.texture(e,(function(e){Object(l.a)(e.sampler)&&(e.sampler=n.samplers[e.sampler]),Object(l.a)(e.source)&&(e.source=n.images[e.source])}))}(e),function(e){kV.animation(e,(function(e){kV.animationSampler(e,(function(e){delete e.name}))}))}(e),function(e){const t=e.asset;delete t.profile,delete t.premultipliedAlpha}(e),function(e){const t=e.extensionsUsed;if(e.extensionsRequired=Object(c.a)(e.extensionsRequired,[]),Object(l.a)(t)){const n=t.length;for(let i=0;i<n;++i){const n=t[i];Object(l.a)(TH[n])&&e.extensionsRequired.push(n)}}}(e),function(e){kV.buffer(e,(function(e){Object(l.a)(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)})),kV.accessor(e,(function(t){const n=t.bufferView;if(Object(l.a)(n)){const i=e.bufferViews[n],r=SH(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(Object(c.a)(i.byteLength,0),o)}}))}(e),function(e){let t,n,i;const r=e.bufferViews,o={};kV.accessorContainingVertexAttributeData(e,(function(t){const n=e.accessors[t];Object(l.a)(n.bufferView)&&(o[n.bufferView]=!0)}));const a={};kV.accessor(e,(function(e){Object(l.a)(e.bufferView)&&(a[e.bufferView]=Object(c.a)(a[e.bufferView],[]),a[e.bufferView].push(e))}));for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){i=r[s];const c=a[s];c.sort((function(e,t){return e.byteOffset-t.byteOffset}));let l=0,u=0;const h=c.length;for(t=0;t<h;++t){let a=c[t];const d=SH(e,a),f=a.byteOffset,p=a.count*d;delete a.byteStride;const m=t<h-1,g=m?SH(e,c[t+1]):void 0;if(d!==g){const e=Object(Zf.a)(i,!0);o[s]&&(e.byteStride=d),e.byteOffset+=l,e.byteLength=f+p-l;const h=BV(r,e);for(n=u;n<=t;++n)a=c[n],a.bufferView=h,a.byteOffset=a.byteOffset-l;l=m?c[t+1].byteOffset:void 0,u=t+1}}}fH(e,["accessor","bufferView","buffer"])}(e),function(e){kV.accessorWithSemantic(e,"POSITION",(function(t){const n=e.accessors[t];if(!Object(l.a)(n.min)||!Object(l.a)(n.max)){const t=QV(e,n);n.min=t.min,n.max=t.max}}))}(e),function(e){kV.animation(e,(function(t){kV.animationSampler(t,(function(t){const n=e.accessors[t.input];if(!Object(l.a)(n.min)||!Object(l.a)(n.max)){const t=QV(e,n);n.min=t.min,n.max=t.max}}))}))}(e),function(e){kV.buffer(e,(function(e){delete e.type}))}(e),function(e){kV.texture(e,(function(e){delete e.format,delete e.internalFormat,delete e.target,delete e.type}))}(e),function(e){kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){kV.meshPrimitiveAttribute(e,(function(t,n){"TEXCOORD"===n?e.attributes.TEXCOORD_0=t:"COLOR"===n&&(e.attributes.COLOR_0=t)})),delete e.attributes.TEXCOORD,delete e.attributes.COLOR}))})),kV.technique(e,(function(e){kV.techniqueParameter(e,(function(e){const t=e.semantic;Object(l.a)(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))}))}))}(e),function(e){const t={};kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){kV.meshPrimitiveAttribute(e,(function(e,n){if("_"!==n.charAt(0)){const e=n.search(/_[0-9]+/g);let i,r=n,o="_0";e>=0&&(r=n.substring(0,e),o=n.substring(e));const a=xH[r];Object(l.a)(a)?(i=a+o,t[n]=i):Object(l.a)(CH[r])||(i="_"+n,t[n]=i)}}));for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const i=t[n],r=e.attributes[n];Object(l.a)(r)&&(delete e.attributes[n],e.attributes[i]=r)}}))})),kV.technique(e,(function(e){kV.techniqueParameter(e,(function(e){const n=t[e.semantic];Object(l.a)(n)&&(e.semantic=n)}))}))}(e),_H(e),function(e){kV.camera(e,(function(e){const t=e.perspective;if(Object(l.a)(t)){const e=t.aspectRatio;Object(l.a)(e)&&0===e&&delete t.aspectRatio;const n=t.yfov;Object(l.a)(n)&&0===n&&(t.yfov=1)}}))}(e),oH(e),sH(e),function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];Array.isArray(n)&&0===n.length&&delete e[t]}kV.node(e,(function(e){Object(l.a)(e.children)&&0===e.children.length&&delete e.children}))}(e)},"2.0":void 0};function bH(e){const t=e.materials;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e],i=n.instanceTechnique;Object(l.a)(i)&&(n.technique=i.technique,n.values=i.values,delete n.instanceTechnique)}}function vH(e){const t=e.meshes;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e].primitives;if(Object(l.a)(n)){const e=n.length;for(let t=0;t<e;++t){const e=n[t],i=Object(c.a)(e.primitive,ps.TRIANGLES);e.mode=Object(c.a)(e.mode,i),delete e.primitive}}}}function OH(e){const t=e.nodes,n=new O,i=new To;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const r=t[e];if(Object(l.a)(r.rotation)){const e=r.rotation;O.fromArray(e,0,n),To.fromAxisAngle(n,e[3],i),r.rotation=[i.x,i.y,i.z,i.w]}const o=r.instanceSkin;Object(l.a)(o)&&(r.skeletons=o.skeletons,r.skin=o.skin,r.meshes=o.meshes,delete r.instanceSkin)}}function wH(e){const t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},a=new O,s=new To;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const c=t[e],u=c.channels,h=c.parameters,d=c.samplers;if(Object(l.a)(u)){const e=u.length;for(let t=0;t<e;++t){const e=u[t];if("rotation"===e.target.path){const t=h[d[e.sampler].output];if(Object(l.a)(o[t]))continue;o[t]=!0;const c=n[t],u=i[c.bufferView],f=r[u.buffer].extras._pipeline.source,p=f.byteOffset+u.byteOffset+c.byteOffset,m=c.componentType,g=c.count,_=UV(c.type),y=c.count*_,b=gs.createArrayBufferView(m,f.buffer,p,y);for(let e=0;e<g;e++){const t=e*_;O.unpack(b,t,a);const n=b[t+3];To.fromAxisAngle(a,n,s),To.pack(s,b,t)}}}}}}function AH(e){const t=e.techniques;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e],i=n.passes;if(Object(l.a)(i)){const e=Object(c.a)(n.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(i,e)){const t=i[e],r=t.instanceProgram;n.attributes=Object(c.a)(n.attributes,r.attributes),n.program=Object(c.a)(n.program,r.program),n.uniforms=Object(c.a)(n.uniforms,r.uniforms),n.states=Object(c.a)(n.states,t.states)}delete n.passes,delete n.pass}}}function EH(e,t){const n=[];for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const r=e[i];t[i]=n.length,n.push(r),Object(l.a)(r.name)||(r.name=i)}return n}const TH={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};const CH={POSITION:!0,NORMAL:!0,TANGENT:!0},xH={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function SH(e,t){return Object(l.a)(t.byteStride)&&0!==t.byteStride?t.byteStride:VV(e,t)}function IH(e){return(!Object(l.a)(e.children)||0===e.children.length)&&(!Object(l.a)(e.meshes)||0===e.meshes.length)&&!Object(l.a)(e.camera)&&!Object(l.a)(e.skin)&&!Object(l.a)(e.skeletons)&&!Object(l.a)(e.jointName)&&(!Object(l.a)(e.translation)||O.fromArray(e.translation).equals(O.ZERO))&&(!Object(l.a)(e.scale)||O.fromArray(e.scale).equals(new O(1,1,1)))&&(!Object(l.a)(e.rotation)||_e.fromArray(e.rotation).equals(new _e(0,0,0,1)))&&(!Object(l.a)(e.matrix)||Me.fromColumnMajorArray(e.matrix).equals(Me.IDENTITY))&&!Object(l.a)(e.extensions)&&!Object(l.a)(e.extras)}var PH=function(e,t){const n=(t=Object(c.a)(t,c.a.EMPTY_OBJECT)).targetVersion;let i=e.version;e.asset=Object(c.a)(e.asset,{version:"1.0"}),e.asset.version=Object(c.a)(e.asset.version,"1.0"),i=Object(c.a)(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(yH,i)||(Object(l.a)(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(yH,i)||(i="1.0"));let r=yH[i];for(;Object(l.a)(r)&&i!==n;)r(e,t),i=e.asset.version,r=yH[i];return e};function DH(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new tm,this.indexBuffersToCreate=new tm,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new tm,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new tm,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new tm,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new tm,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}DH.prototype.getBuffer=function(e){return t=this.buffers[e.buffer],n=e.byteOffset,i=e.byteLength,t.subarray(n,n+i);var t,n,i},DH.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},DH.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},DH.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},DH.prototype.finishedTextureCreation=function(){const e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},DH.prototype.finishedEverythingButTextureCreation=function(){const e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return this.finishedDecoding()&&e&&t},DH.prototype.finishedDecoding=function(){return 0===this.primitivesToDecode.length&&0===this.activeDecodingTasks&&!this.pendingDecodingCache},DH.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var RH=DH;const jH={updateForwardAxis:function(e){const t=e.gltfInternal.extras.sourceVersion;(Object(l.a)(t)&&"2.0"!==t||"2.0"!==jH.getAssetVersion(e.gltfInternal))&&(e._gltfForwardAxis=HU.X)},getAssetVersion:function(e){return Object(l.a)(e.asset)&&Object(l.a)(e.asset.version)?e.asset.version:"1.0"},splitIncompatibleMaterials:function(e){const t=e.accessors,n=e.materials,i={};return kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){let r=e.material;const o=n[r],a=e.attributes.JOINTS_0;let s,c;if(Object(l.a)(a)){const e=t[a];s=e.componentType,c=e.type}const u=Object(l.a)(a)&&"VEC4"===c,h=Object(l.a)(e.attributes.COLOR_0),d=Object(l.a)(e.targets),f=Object(l.a)(e.attributes.NORMAL),p=Object(l.a)(e.attributes.TANGENT),m=Object(l.a)(e.attributes.TEXCOORD_0),g=m&&Object(l.a)(e.attributes.TEXCOORD_1),_=Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.CESIUM_primitive_outline),y=i[r];if(Object(l.a)(y)){if(y.skinning.skinned!==u||y.hasVertexColors!==h||y.hasMorphTargets!==d||y.hasNormals!==f||y.hasTangents!==p||y.hasTexCoords!==m||y.hasTexCoord1!==g||y.hasOutline!==_){const t=Object(Zf.a)(o,!0);r=BV(n,t),e.material=r,i[r]={skinning:{skinned:u,componentType:s},hasVertexColors:h,hasMorphTargets:d,hasNormals:f,hasTangents:p,hasTexCoords:m,hasTexCoord1:g,hasOutline:_}}}else i[r]={skinning:{skinned:u,componentType:s},hasVertexColors:h,hasMorphTargets:d,hasNormals:f,hasTangents:p,hasTexCoords:m,hasTexCoord1:g,hasOutline:_}}))})),i},getShaderVariable:function(e){return"SCALAR"===e?"float":e.toLowerCase()},ModelState:{NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},getFailedLoadFunction:function(e,t,n){return function(i){e._state=jH.ModelState.FAILED;let r=`Failed to load ${t}: ${n}`;Object(l.a)(i)&&(r+="\n"+i.message),e._readyPromise.reject(new ye.a(r))}},parseBuffers:function(e,t){const n=e._loadResources;kV.buffer(e.gltfInternal,(function(i,r){if(Object(l.a)(i.extras._pipeline.source))n.buffers[r]=i.extras._pipeline.source;else if(Object(l.a)(t)){const o=e._resource.getDerivedResource({url:i.uri});++n.pendingBufferLoads,o.fetchArrayBuffer().then(t(e,r)).catch(jH.getFailedLoadFunction(e,"buffer",o.url))}}))}},MH=new O,LH=new O;function NH(e,t){return kV.techniqueAttribute(e,(function(e,n){if(e.semantic===t)return n}))}function BH(e,t,n,i){return FV(e,"KHR_techniques_webgl")?function(e,t){if(!(e.semantic!==n||i&&Object(l.a)(e.node)))return t}:function(e,r){const o=t.parameters[e];if(!(o.semantic!==n||i&&Object(l.a)(o.node)))return r}}jH.computeBoundingSphere=function(e){const t=e.gltfInternal,n=t.nodes,i=t.meshes,r=t.scenes[t.scene].nodes,o=r.length,a=[],s=new O(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new O(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let e=0;e<o;++e){let o=n[r[e]];for(o._transformToRoot=jH.getTransform(o),a.push(o);a.length>0;){o=a.pop();const e=o._transformToRoot,r=o.mesh;if(Object(l.a)(r)){const n=i[r].primitives,o=n.length;for(let i=0;i<o;++i){const r=n[i].attributes.POSITION;if(Object(l.a)(r)){const n=jH.getAccessorMinMax(t,r);if(Object(l.a)(n.min)&&Object(l.a)(n.max)){const t=O.fromArray(n.min,0,MH),i=O.fromArray(n.max,0,LH);Me.multiplyByPoint(e,t,t),Me.multiplyByPoint(e,i,i),O.minimumByComponent(s,t,s),O.maximumByComponent(c,i,c)}}}}const u=o.children;if(Object(l.a)(u)){const t=u.length;for(let i=0;i<t;++i){const t=n[u[i]];t._transformToRoot=jH.getTransform(t),Me.multiplyTransformation(e,t._transformToRoot,t._transformToRoot),a.push(t)}}delete o._transformToRoot}}const u=At.fromCornerPoints(s,c);return e.forwardAxis===HU.Z&&At.transformWithoutScale(u,HU.Z_UP_TO_X_UP,u),e._upAxis===HU.Y?At.transformWithoutScale(u,HU.Y_UP_TO_Z_UP,u):e._upAxis===HU.X&&At.transformWithoutScale(u,HU.X_UP_TO_Z_UP,u),u},jH.ensureSemanticExistence=function(e){return kV.mesh(e,(function(t){kV.meshPrimitive(t,(function(t){!function(e,t){const n=e.accessors,i=e.materials,r=e.extensions.KHR_techniques_webgl,o=r.techniques,a=r.programs,s=r.shaders,c=t.targets,u=t.attributes;for(const e in c)if(c.hasOwnProperty(e)){const t=c[e];for(const n in t)"extras"!==n&&(u[`${n}_${e}`]=t[n])}const h=o[i[t.material].extensions.KHR_techniques_webgl.technique],d=s[a[h.program].vertexShader];for(const e in u)if(u.hasOwnProperty(e)&&!Object(l.a)(NH(h,e))){const t=n[u[e]];let i=e.toLowerCase();"_"===i.charAt(0)&&(i=i.slice(1));const r="a_"+i;h.attributes[r]={semantic:e,type:t.componentType};const o=d.extras._pipeline;let a=o.source;a=`attribute ${jH.getShaderVariable(t.type)} ${r};\n${a}`,o.source=a}}(e,t)}))})),e},jH.createAttributeLocations=function(e,t){const n={};let i=!1,r=1;if(kV.techniqueAttribute(e,(function(e,t){/pos/i.test(t)&&!i?(n[t]=0,i=!0):n[t]=r++})),Object(l.a)(t))for(const e in t)t.hasOwnProperty(e)&&(n[e]=r++);return n},jH.getAccessorMinMax=function(e,t){const n=e.accessors[t],i=n.extensions;let r=n.min,o=n.max;if(Object(l.a)(i)){const e=i.WEB3D_quantized_attributes;Object(l.a)(e)&&(r=e.decodedMin,o=e.decodedMax)}return{min:r,max:o}},jH.getAttributeOrUniformBySemantic=function(e,t,n,i){return kV.technique(e,(function(r){if(Object(l.a)(n)&&r.program!==n)return;const o=kV.techniqueAttribute(r,BH(e,r,t,i));return Object(l.a)(o)?o:kV.techniqueUniform(r,BH(e,r,t,i))}))},jH.getDiffuseAttributeOrUniform=function(e,t){let n=jH.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return Object(l.a)(n)||(n=jH.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),n};const FH=new O,zH=new To,kH=new O;function UH(e,t,n){t+="(?!\\w)",t=new RegExp(t,"g");const i=e.search(t);return e.replace(t,(function(e,t){return i===t?e:n}))}function VH(e,t){const n=e.accessors[t].extensions;if(Object(l.a)(n))return n.WEB3D_quantized_attributes}function HH(e,t,n){const i=t.material,r=e.materials[i];if(!FV(e,"KHR_techniques_webgl")||!Object(l.a)(r.extensions)||!Object(l.a)(r.extensions.KHR_techniques_webgl))return;const o=r.extensions.KHR_techniques_webgl.technique,a=e.extensions.KHR_techniques_webgl.techniques[o];return kV.techniqueAttribute(a,(function(e,t){if(e.semantic===n)return t}))}function GH(e){const t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function qH(e){const t={value:Vt.fromArray(e),clone:Vt.clone,func:function(){return t.value}};return t}function WH(e){const t={value:O.fromArray(e),clone:O.clone,func:function(){return t.value}};return t}function YH(e){const t={value:_e.fromArray(e),clone:_e.clone,func:function(){return t.value}};return t}function XH(e){const t={value:Es.fromColumnMajorArray(e),clone:Es.clone,func:function(){return t.value}};return t}function KH(e){const t={value:ce.fromColumnMajorArray(e),clone:ce.clone,func:function(){return t.value}};return t}function JH(e){const t={value:Me.fromColumnMajorArray(e),clone:Me.clone,func:function(){return t.value}};return t}function ZH(e,t,n){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=n}jH.getTransform=function(e,t){return Object(l.a)(e.matrix)?Me.fromColumnMajorArray(e.matrix,t):Me.fromTranslationQuaternionRotationScale(O.fromArray(e.translation,0,FH),To.unpack(e.rotation,0,zH),O.fromArray(e.scale,0,kH),t)},jH.getUsedExtensions=function(e){const t=e.extensionsUsed,n={};if(Object(l.a)(t)){const e=t.length;for(let i=0;i<e;i++){n[t[i]]=!0}}return n},jH.getRequiredExtensions=function(e){const t=e.extensionsRequired,n={};if(Object(l.a)(t)){const e=t.length;for(let i=0;i<e;i++){n[t[i]]=!0}}return n},jH.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_texture_basisu:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0},jH.checkSupportedExtensions=function(e,t){for(const n in e)if(e.hasOwnProperty(n)){if(!jH.supportedExtensions[n])throw new ye.a("Unsupported glTF Extension: "+n);if("EXT_texture_webp"===n&&!1===t)throw new ye.a("Loaded model requires WebP but browser does not support it.")}},jH.checkSupportedGlExtensions=function(e,t){if(Object(l.a)(e)){const n=e.length;for(let i=0;i<n;i++){const n=e[i];if("OES_element_index_uint"!==n)throw new ye.a("Unsupported WebGL Extension: "+n);if(!t.elementIndexUint)throw new ye.a("OES_element_index_uint WebGL extension is not enabled.")}}},jH.modifyShaderForDracoQuantizedAttributes=function(e,t,n,i){const r={};for(let o in i)if(i.hasOwnProperty(o)){const a=i[o],s=a.quantization;if(!Object(l.a)(s))continue;const c=HH(e,t,o);"_"===o.charAt(0)&&(o=o.substring(1));const u="gltf_u_dec_"+o.toLowerCase();if(!Object(l.a)(r[u])){const e="gltf_decoded_"+o,t=c.replace("a_","gltf_a_dec_"),i=a.componentsPerAttribute;let r;n=UH(n,c,t),r=s.octEncoded?"vec3":i>1?"vec"+i:"float",n=`${r} ${t};\n${n}`;const l=3===i&&"COLOR_0"===o;l&&(n=UH(n,t,`vec4(${t}, 1.0)`));let h="";if(s.octEncoded){const i=u+"_rangeConstant";n=`uniform float ${i};\n${n}`,h=`\nvoid main() {\n    ${t} = czm_octDecode(${c}.xy, ${i}).zxy;\n    ${e}();\n}\n`}else{const i=u+"_normConstant",o=u+"_min";n=`uniform float ${i};\nuniform ${r} ${o};\n${n}`;h=`\nvoid main() {\n    ${t} = ${o} + ${c}${l?".xyz":""} * ${i};\n    ${e}();\n}\n`}n=UN.replaceMain(n,e),n+=h}}return{shader:n}},jH.modifyShaderForQuantizedAttributes=function(e,t,n){const i={},r=t.attributes;for(let o in r)if(r.hasOwnProperty(o)){const r=HH(e,t,o),a=t.attributes[o];"_"===o.charAt(0)&&(o=o.substring(1));const s="gltf_u_dec_"+o.toLowerCase(),c=s+"_scale",u=s+"_translate";if(!Object(l.a)(i[s])&&!Object(l.a)(i[c])){const t=VH(e,a);if(Object(l.a)(t)){const e=t.decodeMatrix,a="gltf_decoded_"+o,l=r.replace("a_","gltf_a_dec_"),h=Math.floor(Math.sqrt(e.length));let d;n=UH(n,r,l),d=h>2?"vec"+(h-1):"float",n=`${d} ${l};\n${n}`;let f="";5===h?(n=`uniform vec4 ${u};\n${n=`uniform mat4 ${c};\n${n}`}`,f=`\nvoid main() {\n    ${l} = ${c} * ${r} + ${u};\n    ${a}();\n}\n`,i[c]={mat:4},i[u]={vec:4}):(n=`uniform mat${h} ${s};\n${n}`,f=`\nvoid main() {\n    ${l} = ${d}(${s} * vec${h}(${r},1.0));\n    ${a}();\n}\n`,i[s]={mat:h}),n=UN.replaceMain(n,a),n+=f}}}return{shader:n,uniforms:i}},Object.defineProperties(ZH.prototype,{value:{get:function(){if(!Object(l.a)(this._value)){const e=this._textures[this._textureId];if(!Object(l.a)(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),ZH.prototype.clone=function(e){return e},ZH.prototype.func=void 0;const $H={};function QH(e){return[e[20],e[21],e[22],e[23]]}$H[ps.FLOAT]=GH,$H[ps.FLOAT_VEC2]=qH,$H[ps.FLOAT_VEC3]=WH,$H[ps.FLOAT_VEC4]=YH,$H[ps.INT]=GH,$H[ps.INT_VEC2]=qH,$H[ps.INT_VEC3]=WH,$H[ps.INT_VEC4]=YH,$H[ps.BOOL]=GH,$H[ps.BOOL_VEC2]=qH,$H[ps.BOOL_VEC3]=WH,$H[ps.BOOL_VEC4]=YH,$H[ps.FLOAT_MAT2]=XH,$H[ps.FLOAT_MAT3]=KH,$H[ps.FLOAT_MAT4]=JH,$H[ps.SAMPLER_2D]=function(e,t,n){const i=new ZH(e,t,n);return i.func=function(){return i.value},i},jH.createUniformFunction=function(e,t,n,i){return $H[e](t,n,i)},jH.createUniformsForDracoQuantizedAttributes=function(e){const t={};for(let n in e)if(e.hasOwnProperty(n)){const i=e[n],r=i.quantization;if(!Object(l.a)(r))continue;"_"===n.charAt(0)&&(n=n.substring(1));const o="gltf_u_dec_"+n.toLowerCase();if(r.octEncoded){const e=o+"_rangeConstant",n=(1<<r.quantizationBits)-1;t[e]=GH(n).func;continue}const a=o+"_normConstant",s=r.range/(1<<r.quantizationBits);t[a]=GH(s).func;const c=o+"_min";switch(i.componentsPerAttribute){case 1:t[c]=GH(r.minValues).func;break;case 2:t[c]=qH(r.minValues).func;break;case 3:t[c]=WH(r.minValues).func;break;case 4:t[c]=YH(r.minValues).func}}return t},jH.createUniformsForQuantizedAttributes=function(e,t,n){const i=e.accessors,r={},o={},a=t.attributes;for(let e in a)if(a.hasOwnProperty(e)){const t=i[a[e]],n=t.extensions;if("_"===e.charAt(0)&&(e=e.substring(1)),Object(l.a)(n)){const i=n.WEB3D_quantized_attributes;if(Object(l.a)(i)){const n=i.decodeMatrix,a="gltf_u_dec_"+e.toLowerCase();let c,l;switch(t.type){case Cs.SCALAR:o[a]=XH(n).func,r[a]=!0;break;case Cs.VEC2:o[a]=KH(n).func,r[a]=!0;break;case Cs.VEC3:o[a]=JH(n).func,r[a]=!0;break;case Cs.VEC4:c=a+"_scale",l=a+"_translate",o[c]=JH((s=n,[s[0],s[1],s[2],s[3],s[5],s[6],s[7],s[8],s[10],s[11],s[12],s[13],s[15],s[16],s[17],s[18]])).func,o[l]=YH(QH(n)).func,r[c]=!0,r[l]=!0}}}}var s;for(const e in n)if(n.hasOwnProperty(e)&&!r[e]){const t=n[e];Object(l.a)(t.mat)&&(2===t.mat?o[e]=XH(Es.IDENTITY).func:3===t.mat?o[e]=KH(ce.IDENTITY).func:4===t.mat&&(o[e]=JH(Me.IDENTITY).func)),Object(l.a)(t.vec)&&4===t.vec&&(o[e]=YH([0,0,0,0]).func)}return o};const eG=new O,tG={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){const n=new Me;return function(){return Object(l.a)(t._rtcCenter)?(Me.getTranslation(e.model,eG),O.add(eG,t._rtcCenter,eG),Me.multiplyByPoint(e.view,eG,eG),Me.setTranslation(e.modelView,eG,n)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};jH.getGltfSemanticUniforms=function(){return tG};var nG=jH;function iG(e,t){let n;switch(n=Object(l.a)(t.value)?t.value:Object(l.a)(t.index)?[t.index]:t,e){case"ambient":case"diffuse":case"emission":case"specular":return 1===n.length?ps.SAMPLER_2D:ps.FLOAT_VEC4;case"shininess":case"transparency":return ps.FLOAT;case"transparent":case"doubleSided":return ps.BOOL}}var rG=function(e,t){if(t=Object(c.a)(t,c.a.EMPTY_OBJECT),!Object(l.a)(e))return;if(!FV(e,"KHR_materials_common"))return;FV(e,"KHR_techniques_webgl")||(Object(l.a)(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl"));const n=e.extensions.KHR_techniques_webgl;!function(e){const t=e.extensions.KHR_materials_common;if(!Object(l.a)(t)||!Object(l.a)(t.lights))return;const n=t.lights,i=n.length;for(let e=0;e<i;e++){const t=n[e];if("ambient"===t.type){Object(l.a)(t.ambient)||(t.ambient={});const e=t.ambient;Object(l.a)(e.color)||(e.color=[1,1,1])}else if("directional"===t.type){Object(l.a)(t.directional)||(t.directional={});const e=t.directional;Object(l.a)(e.color)||(e.color=[1,1,1])}else if("point"===t.type){Object(l.a)(t.point)||(t.point={});const e=t.point;Object(l.a)(e.color)||(e.color=[1,1,1]),e.constantAttenuation=Object(c.a)(e.constantAttenuation,1),e.linearAttenuation=Object(c.a)(e.linearAttenuation,0),e.quadraticAttenuation=Object(c.a)(e.quadraticAttenuation,0)}else if("spot"===t.type){Object(l.a)(t.spot)||(t.spot={});const e=t.spot;Object(l.a)(e.color)||(e.color=[1,1,1]),e.constantAttenuation=Object(c.a)(e.constantAttenuation,1),e.fallOffAngle=Object(c.a)(e.fallOffAngle,3.14159265),e.fallOffExponent=Object(c.a)(e.fallOffExponent,0),e.linearAttenuation=Object(c.a)(e.linearAttenuation,0),e.quadraticAttenuation=Object(c.a)(e.quadraticAttenuation,0)}}}(e);const i=function(e){const t={};let n;Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_materials_common)&&(n=e.extensions.KHR_materials_common.lights);if(Object(l.a)(n)){const i=e.nodes;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];if(Object(l.a)(t.extensions)&&Object(l.a)(t.extensions.KHR_materials_common)){const i=t.extensions.KHR_materials_common.light;Object(l.a)(i)&&Object(l.a)(n[i])&&(n[i].node=e),delete t.extensions.KHR_materials_common}}let r=0;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e],o=i.type;if("ambient"!==o&&!Object(l.a)(i.node)){delete n[e];continue}const a="light"+r.toString();let s,c,u,h;switch(i.baseName=a,o){case"ambient":s=i.ambient,t[a+"Color"]={type:ps.FLOAT_VEC3,value:s.color};break;case"directional":c=i.directional,t[a+"Color"]={type:ps.FLOAT_VEC3,value:c.color},Object(l.a)(i.node)&&(t[a+"Transform"]={node:i.node,semantic:"MODELVIEW",type:ps.FLOAT_MAT4});break;case"point":u=i.point,t[a+"Color"]={type:ps.FLOAT_VEC3,value:u.color},Object(l.a)(i.node)&&(t[a+"Transform"]={node:i.node,semantic:"MODELVIEW",type:ps.FLOAT_MAT4}),t[a+"Attenuation"]={type:ps.FLOAT_VEC3,value:[u.constantAttenuation,u.linearAttenuation,u.quadraticAttenuation]};break;case"spot":h=i.spot,t[a+"Color"]={type:ps.FLOAT_VEC3,value:h.color},Object(l.a)(i.node)&&(t[a+"Transform"]={node:i.node,semantic:"MODELVIEW",type:ps.FLOAT_MAT4},t[a+"InverseTransform"]={node:i.node,semantic:"MODELVIEWINVERSE",type:ps.FLOAT_MAT4,useInFragment:!0}),t[a+"Attenuation"]={type:ps.FLOAT_VEC3,value:[h.constantAttenuation,h.linearAttenuation,h.quadraticAttenuation]},t[a+"FallOff"]={type:ps.FLOAT_VEC2,value:[h.fallOffAngle,h.fallOffExponent]}}++r}}return t}(e),r=nG.splitIncompatibleMaterials(e),o={};let a=!1;return kV.material(e,(function(s,u){if(Object(l.a)(s.extensions)&&Object(l.a)(s.extensions.KHR_materials_common)){const h=s.extensions.KHR_materials_common,d=r[u],f=function(e,t){let n="";n+=`technique:${e.technique};`;const i=e.values,r=Object.keys(i).sort(),o=r.length;for(let e=0;e<o;++e){const t=r[e];i.hasOwnProperty(t)&&(n+=`${t}:${iG(t,i[t])}`,n+=";")}const a=Object(c.a)(e.jointCount,0);if(n+=a.toString()+";",Object(l.a)(t)){const e=t.skinning;a>0&&(n+=e.type+";"),n+=t.hasVertexColors}return n}(h,d);let p=o[f];Object(l.a)(p)||(p=function(e,t,n,i,r,o){Object(l.a)(i)||(i={});o=Object(c.a)(o,!1);const a=t.techniques,s=t.shaders,u=t.programs,h=i.technique.toUpperCase();let d;Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_materials_common)&&(d=e.extensions.KHR_materials_common.lights);const f=i.values,p=Object(c.a)(i.jointCount,0);let m,g=!1,_=!1;Object(l.a)(n)&&(m=n.skinning,g=m.skinned,_=n.hasVertexColors);let y="precision highp float;\n",b="precision highp float;\n";const v="CONSTANT"!==h,O={u_modelViewMatrix:{semantic:FV(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:ps.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:ps.FLOAT_MAT4}};v&&(O.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:ps.FLOAT_MAT3});g&&(O.u_jointMatrix={count:p,semantic:"JOINTMATRIX",type:ps.FLOAT_MAT4});let w,A=!1;for(const e in f)if(f.hasOwnProperty(e)&&"transparent"!==e&&"doubleSided"!==e){const t=iG(e,f[e]);w="u_"+e.toLowerCase(),A||t!==ps.SAMPLER_2D||(A=!0),O[w]={type:t}}Object(l.a)(O.u_diffuse)&&(O.u_diffuse.semantic="_3DTILESDIFFUSE");if(Object(l.a)(r))for(const e in r)r.hasOwnProperty(e)&&(w="u_"+e,O[w]=r[e]);for(w in O)if(O.hasOwnProperty(w)){const e=O[w],t=Object(l.a)(e.count)?`[${e.count}]`:"";e.type!==ps.FLOAT_MAT3&&e.type!==ps.FLOAT_MAT4||e.useInFragment?(b+=`uniform ${LP(e.type)} ${w}${t};\n`,delete e.useInFragment):y+=`uniform ${LP(e.type)} ${w}${t};\n`}let E="";g&&(E+="    mat4 skinMatrix =\n        a_weight.x * u_jointMatrix[int(a_joint.x)] +\n        a_weight.y * u_jointMatrix[int(a_joint.y)] +\n        a_weight.z * u_jointMatrix[int(a_joint.z)] +\n        a_weight.w * u_jointMatrix[int(a_joint.w)];\n");const T={a_position:{semantic:"POSITION"}};y+="attribute vec3 a_position;\n",y+="varying vec3 v_positionEC;\n",E+=g?"  vec4 pos = u_modelViewMatrix * skinMatrix * vec4(a_position,1.0);\n":"  vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n";E+="  v_positionEC = pos.xyz;\n",E+="  gl_Position = u_projectionMatrix * pos;\n",b+="varying vec3 v_positionEC;\n",v&&(T.a_normal={semantic:"NORMAL"},y+="attribute vec3 a_normal;\n",y+="varying vec3 v_normal;\n",E+=g?"  v_normal = u_normalMatrix * mat3(skinMatrix) * a_normal;\n":"  v_normal = u_normalMatrix * a_normal;\n",b+="varying vec3 v_normal;\n");let C;A&&(T.a_texcoord_0={semantic:"TEXCOORD_0"},C="v_texcoord_0",y+="attribute vec2 a_texcoord_0;\n",y+=`varying vec2 ${C};\n`,E+=`  ${C} = a_texcoord_0;\n`,b+=`varying vec2 ${C};\n`);g&&(T.a_joint={semantic:"JOINTS_0"},T.a_weight={semantic:"WEIGHTS_0"},y+="attribute vec4 a_joint;\n",y+="attribute vec4 a_weight;\n");_&&(T.a_vertexColor={semantic:"COLOR_0"},y+="attribute vec4 a_vertexColor;\n",y+="varying vec4 v_vertexColor;\n",E+="  v_vertexColor = a_vertexColor;\n",b+="varying vec4 v_vertexColor;\n");o&&(T.a_batchId={semantic:"_BATCHID"},y+="attribute float a_batchId;\n");const x=v&&("BLINN"===h||"PHONG"===h)&&Object(l.a)(O.u_specular)&&Object(l.a)(O.u_shininess)&&O.u_shininess>0;let S=!1,I=!1,P="";for(const e in d)if(d.hasOwnProperty(e)){const t=d[e],n=t.type.toLowerCase(),i=t.baseName;P+="  {\n";const r=`u_${i}Color`;if("ambient"===n)I=!0,P+=`    ambientLight += ${r};\n`;else if(v){S=!0;const e=`v_${i}Direction`,t=`v_${i}Position`;"point"!==n&&(y+=`varying vec3 ${e};\n`,b+=`varying vec3 ${e};\n`,E+=`  ${e} = mat3(u_${i}Transform) * vec3(0.,0.,1.);\n`,"directional"===n&&(P+=`    vec3 l = normalize(${e});\n`)),"directional"!==n?(y+=`varying vec3 ${t};\n`,b+=`varying vec3 ${t};\n`,E+=`  ${t} = u_${i}Transform[3].xyz;\n`,P+=`    vec3 VP = ${t} - v_positionEC;\n`,P+="    vec3 l = normalize(VP);\n",P+="    float range = length(VP);\n",P+=`    float attenuation = 1.0 / (u_${i}Attenuation.x + `,P+=`(u_${i}Attenuation.y * range) + `,P+=`(u_${i}Attenuation.z * range * range));\n`):P+="    float attenuation = 1.0;\n","spot"===n&&(P+=`    float spotDot = dot(l, normalize(${e}));\n`,P+=`    if (spotDot < cos(u_${i}FallOff.x * 0.5))\n`,P+="    {\n",P+="      attenuation = 0.0;\n",P+="    }\n",P+="    else\n",P+="    {\n",P+=`        attenuation *= max(0.0, pow(spotDot, u_${i}FallOff.y));\n`,P+="    }\n"),P+=`    diffuseLight += ${r}* max(dot(normal,l), 0.) * attenuation;\n`,x&&("BLINN"===h?(P+="    vec3 h = normalize(l + viewDir);\n",P+="    float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(P+="    vec3 reflectDir = reflect(-l, normal);\n",P+="    float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),P+=`    specularLight += ${r} * specularIntensity;\n`)}P+="  }\n"}I||(P+="  ambientLight += vec3(0.2, 0.2, 0.2);\n");if(!S&&"CONSTANT"!==h){b+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",b+="uniform vec3 gltf_lightColor; \n",b+="#endif \n",P+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",P+="    vec3 lightColor = czm_lightColor;\n",P+="#else \n",P+="    vec3 lightColor = gltf_lightColor;\n",P+="#endif \n",P+="  vec3 l = normalize(czm_lightDirectionEC);\n";P+=`  diffuseLight += lightColor * max(dot(normal,l), ${"0.2"});\n`,x&&("BLINN"===h?(P+="  vec3 h = normalize(l + viewDir);\n",P+="  float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(P+="  vec3 reflectDir = reflect(-l, normal);\n",P+="  float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),P+="  specularLight += lightColor * specularIntensity;\n")}y+="void main(void) {\n",y+=E,y+="}\n",b+="void main(void) {\n";let D,R="  vec3 color = vec3(0.0, 0.0, 0.0);\n";v&&(b+="  vec3 normal = normalize(v_normal);\n",i.doubleSided&&(b+="  if (czm_backFacing())\n",b+="  {\n",b+="    normal = -normal;\n",b+="  }\n"));"CONSTANT"!==h?(Object(l.a)(O.u_diffuse)&&(O.u_diffuse.type===ps.SAMPLER_2D?b+=`  vec4 diffuse = texture2D(u_diffuse, ${C});\n`:b+="  vec4 diffuse = u_diffuse;\n",b+="  vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",R+="  color += diffuse.rgb * diffuseLight;\n"),x&&(O.u_specular.type===ps.SAMPLER_2D?b+=`  vec3 specular = texture2D(u_specular, ${C}).rgb;\n`:b+="  vec3 specular = u_specular.rgb;\n",b+="  vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",R+="  color += specular * specularLight;\n"),D=Object(l.a)(O.u_transparency)?"  gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":"  gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):D=Object(l.a)(O.u_transparency)?"  gl_FragColor = vec4(color * u_transparency, u_transparency);\n":"  gl_FragColor = vec4(color, 1.0);\n";_&&(R+="  color *= v_vertexColor.rgb;\n");Object(l.a)(O.u_emission)&&(O.u_emission.type===ps.SAMPLER_2D?b+=`  vec3 emission = texture2D(u_emission, ${C}).rgb;\n`:b+="  vec3 emission = u_emission.rgb;\n",R+="  color += emission;\n");(Object(l.a)(O.u_ambient)||"CONSTANT"!==h)&&(Object(l.a)(O.u_ambient)?O.u_ambient.type===ps.SAMPLER_2D?b+=`  vec3 ambient = texture2D(u_ambient, ${C}).rgb;\n`:b+="  vec3 ambient = u_ambient.rgb;\n":b+="  vec3 ambient = diffuse.rgb;\n",R+="  color += ambient * ambientLight;\n");b+="  vec3 viewDir = -normalize(v_positionEC);\n",b+="  vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",b+=P,b+=R,b+=D,b+="}\n";const j=BV(s,{type:ps.VERTEX_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}}),M=BV(s,{type:ps.FRAGMENT_SHADER,extras:{_pipeline:{source:b,extension:".glsl"}}}),L=BV(u,{fragmentShader:M,vertexShader:j});return BV(a,{attributes:T,program:L,uniforms:O})}(e,n,d,h,i,t.addBatchIdToGeneratedShaders),o[f]=p,a=!0);const m={},g=h.values;let _;for(const e in g)g.hasOwnProperty(e)&&"transparent"!==e&&"doubleSided"!==e&&(_="u_"+e.toLowerCase(),m[_]=g[e]);s.extensions.KHR_techniques_webgl={technique:p,values:m},s.alphaMode="OPAQUE",h.transparent&&(s.alphaMode="BLEND"),h.doubleSided&&(s.doubleSided=!0)}})),a?(nG.ensureSemanticExistence(e),e):e};function oG(e,t,n,i,r){let o;const a=n[t];return Object(l.a)(a)&&Object(l.a)(a.texCoord)&&1===a.texCoord&&(i=i.replace("0","1")),Object(l.a)(n[t+"Offset"])?(o=t+"Coord",r.fragmentShaderMain+=`    vec2 ${o} = computeTexCoord(${i}, ${t}Offset, ${t}Rotation, ${t}Scale);\n`):o=i,o}const aG=[0,0],sG=[0],cG=[1,1];function lG(e,t,n){if(-1===e.indexOf("Texture")||!Object(l.a)(t.extensions)||!Object(l.a)(t.extensions.KHR_texture_transform))return;const i="u_"+e,r=t.extensions.KHR_texture_transform;n[i+"Offset"]=Object(c.a)(r.offset,aG),n[i+"Rotation"]=Object(c.a)(r.rotation,sG),n[i+"Scale"]=Object(c.a)(r.scale,cG),Object(l.a)(t.texCoord)&&Object(l.a)(r.texCoord)&&(n[i].texCoord=r.texCoord)}function uG(e){if(-1!==e.indexOf("Offset"))return ps.FLOAT_VEC2;if(-1!==e.indexOf("Rotation"))return ps.FLOAT;if(-1!==e.indexOf("Scale"))return ps.FLOAT_VEC2;if(-1!==e.indexOf("Texture"))return ps.SAMPLER_2D;switch(e){case"u_baseColorFactor":return ps.FLOAT_VEC4;case"u_metallicFactor":case"u_roughnessFactor":return ps.FLOAT;case"u_emissiveFactor":return ps.FLOAT_VEC3;case"u_diffuseFactor":return ps.FLOAT_VEC4;case"u_specularFactor":return ps.FLOAT_VEC3;case"u_glossinessFactor":return ps.FLOAT}}var hG=function(e,t){if(t=Object(c.a)(t,c.a.EMPTY_OBJECT),FV(e,"KHR_techniques_webgl"))return e;if(!Object(l.a)(e.materials)||0===e.materials.length)return e;Object(l.a)(e.extensions)||(e.extensions={}),Object(l.a)(e.extensionsUsed)||(e.extensionsUsed=[]),Object(l.a)(e.extensionsRequired)||(e.extensionsRequired=[]),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl");const n=nG.splitIncompatibleMaterials(e);return kV.material(e,(function(i,r){const o={},a=function(e,t,n,i,r,o){const a=Object(c.a)(o.addBatchIdToGeneratedShaders,!1),s=e.extensions.KHR_techniques_webgl,u=s.techniques,h=s.shaders,d=s.programs,f=function(e){return Object(l.a)(e.extensions)&&Object(l.a)(e.extensions.KHR_materials_pbrSpecularGlossiness)}(t);let p,m,g;if(!f){const e=t.pbrMetallicRoughness;if(Object(l.a)(e))for(m in e)e.hasOwnProperty(m)&&(g=e[m],p="u_"+m,i[p]=g,lG(m,g,i));else i.u_baseColorFactor=[1,1,1,1]}if(f){const e=t.extensions.KHR_materials_pbrSpecularGlossiness;for(m in e)e.hasOwnProperty(m)&&(g=e[m],p="u_"+m,i[p]=g,lG(m,g,i))}for(const e in t)t.hasOwnProperty(e)&&(e.indexOf("Texture")>=0||e.indexOf("Factor")>=0)&&(g=t[e],p="u_"+e,i[p]=g,lG(e,g,i));let _,y="precision highp float;\n",b="precision highp float;\n";Object(l.a)(e.skins)&&(_=e.skins[0]);const v=Object(l.a)(_)?_.joints:[],O=v.length,w=r[n];let A,E,T=!1,C=!1,x=!1,S=!1,I=!1,P=!1,D=!1,R=!1,j=!1;Object(l.a)(w)&&(A=w.skinning,T=A.skinned&&v.length>0,C=w.hasVertexColors,x=w.hasMorphTargets,S=w.hasNormals,I=w.hasTangents,P=w.hasTexCoords,D=w.hasTexCoord1,R=w.hasOutline);x&&kV.mesh(e,(function(e){kV.meshPrimitive(e,(function(e){if(e.material===n){const t=e.targets;Object(l.a)(t)&&(E=t)}}))}));const M={u_modelViewMatrix:{semantic:FV(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:ps.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:ps.FLOAT_MAT4}};Object(l.a)(t.extensions)&&Object(l.a)(t.extensions.KHR_materials_unlit)&&(j=!0);S&&(M.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:ps.FLOAT_MAT3});T&&(M.u_jointMatrix={count:O,semantic:"JOINTMATRIX",type:ps.FLOAT_MAT4});x&&(M.u_morphWeights={count:E.length,semantic:"MORPHWEIGHTS",type:ps.FLOAT});const L=t.alphaMode;Object(l.a)(L)&&"MASK"===L&&(M.u_alphaCutoff={semantic:"ALPHACUTOFF",type:ps.FLOAT});for(p in i)i.hasOwnProperty(p)&&(M[p]={type:uG(p)});const N=Object(c.a)(M.u_baseColorTexture,M.u_baseColorFactor);Object(l.a)(N)&&(N.semantic="_3DTILESDIFFUSE");for(p in M)if(M.hasOwnProperty(p)){const e=M[p],t=Object(l.a)(e.count)?`[${e.count}]`:"";e.type!==ps.FLOAT_MAT3&&e.type!==ps.FLOAT_MAT4&&"u_morphWeights"!==p||e.useInFragment?(b+=`uniform ${LP(e.type)} ${p}${t};\n`,delete e.useInFragment):y+=`uniform ${LP(e.type)} ${p}${t};\n`}R&&(b+="uniform sampler2D u_outlineTexture;\n");let B="";T&&(B+="    mat4 skinMatrix =\n        a_weight.x * u_jointMatrix[int(a_joint.x)] +\n        a_weight.y * u_jointMatrix[int(a_joint.y)] +\n        a_weight.z * u_jointMatrix[int(a_joint.z)] +\n        a_weight.w * u_jointMatrix[int(a_joint.w)];\n");const F={a_position:{semantic:"POSITION"}};R&&(F.a_outlineCoordinates={semantic:"_OUTLINE_COORDINATES"});y+="attribute vec3 a_position;\n",S&&(y+="varying vec3 v_positionEC;\n");R&&(y+="attribute vec3 a_outlineCoordinates;\n",y+="varying vec3 v_outlineCoordinates;\n");B+="    vec3 weightedPosition = a_position;\n",S&&(B+="    vec3 weightedNormal = a_normal;\n");I&&(B+="    vec4 weightedTangent = a_tangent;\n");if(x)for(let e=0;e<E.length;e++){const t=E[e];for(const n in t)if(t.hasOwnProperty(n)&&"extras"!==n){const t=`a_${n}_${e}`;F[t]={semantic:`${n}_${e}`},y+=`attribute vec3 ${t};\n`,"POSITION"===n?B+=`    weightedPosition += u_morphWeights[${e}] * ${t};\n`:"NORMAL"===n?B+=`    weightedNormal += u_morphWeights[${e}] * ${t};\n`:I&&"TANGENT"===n&&(B+=`    weightedTangent.xyz += u_morphWeights[${e}] * ${t};\n`)}}B+=T?"    vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":"    vec4 position = vec4(weightedPosition, 1.0);\n";B+="    position = u_modelViewMatrix * position;\n",S&&(B+="    v_positionEC = position.xyz;\n");B+="    gl_Position = u_projectionMatrix * position;\n",R&&(B+="    v_outlineCoordinates = a_outlineCoordinates;\n");S&&(F.a_normal={semantic:"NORMAL"},y+="attribute vec3 a_normal;\n",j||(y+="varying vec3 v_normal;\n",B+=T?"    v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":"    v_normal = u_normalMatrix * weightedNormal;\n",b+="varying vec3 v_normal;\n"),b+="varying vec3 v_positionEC;\n");I&&(F.a_tangent={semantic:"TANGENT"},y+="attribute vec4 a_tangent;\n",y+="varying vec4 v_tangent;\n",B+="    v_tangent.xyz = u_normalMatrix * weightedTangent.xyz;\n",B+="    v_tangent.w = weightedTangent.w;\n",b+="varying vec4 v_tangent;\n");R&&(b+="varying vec3 v_outlineCoordinates;\n");let z,k,U,V,H,G,q,W,Y="";if(P){if(F.a_texcoord_0={semantic:"TEXCOORD_0"},z="v_texcoord_0",y+="attribute vec2 a_texcoord_0;\n",y+=`varying vec2 ${z};\n`,B+=`    ${z} = a_texcoord_0;\n`,b+=`varying vec2 ${z};\n`,D){F.a_texcoord_1={semantic:"TEXCOORD_1"};const e=z.replace("0","1");y+="attribute vec2 a_texcoord_1;\n",y+=`varying vec2 ${e};\n`,B+=`    ${e} = a_texcoord_1;\n`,b+=`varying vec2 ${e};\n`}const t={fragmentShaderMain:Y};k=oG(e,"u_normalTexture",i,z,t),U=oG(e,"u_baseColorTexture",i,z,t),V=oG(e,"u_specularGlossinessTexture",i,z,t),H=oG(e,"u_diffuseTexture",i,z,t),G=oG(e,"u_metallicRoughnessTexture",i,z,t),q=oG(e,"u_occlusionTexture",i,z,t),W=oG(e,"u_emissiveTexture",i,z,t),Y=t.fragmentShaderMain}T&&(F.a_joint={semantic:"JOINTS_0"},F.a_weight={semantic:"WEIGHTS_0"},y+="attribute vec4 a_joint;\n",y+="attribute vec4 a_weight;\n");C&&(F.a_vertexColor={semantic:"COLOR_0"},y+="attribute vec4 a_vertexColor;\n",y+="varying vec4 v_vertexColor;\n",B+="  v_vertexColor = a_vertexColor;\n",b+="varying vec4 v_vertexColor;\n");a&&(F.a_batchId={semantic:"_BATCHID"},y+="attribute float a_batchId;\n");y+="void main(void) \n{\n",y+=B,y+="}\n",S&&!j&&(b+="const float M_PI = 3.141592653589793;\n",b+="vec3 lambertianDiffuse(vec3 diffuseColor) \n{\n    return diffuseColor / M_PI;\n}\n\n",b+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n    return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",b+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n    return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",b+="float smithVisibilityG1(float NdotV, float roughness) \n{\n    float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n    return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",b+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n    return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",b+="float GGX(float roughness, float NdotH) \n{\n    float roughnessSquared = roughness * roughness;\n    float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n    return roughnessSquared / (M_PI * f * f);\n}\n\n");b+="vec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n    return pow(srgbIn, vec3(2.2));\n}\n\n",b+="vec4 SRGBtoLINEAR4(vec4 srgbIn) \n{\n    vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n    return vec4(linearOut, srgbIn.a);\n}\n\n",b+="vec3 applyTonemapping(vec3 linearIn) \n{\n#ifndef HDR \n    return czm_acesTonemapping(linearIn);\n#else \n    return linearIn;\n#endif \n}\n\n",b+="vec3 LINEARtoSRGB(vec3 linearIn) \n{\n#ifndef HDR \n    return pow(linearIn, vec3(1.0/2.2));\n#else \n    return linearIn;\n#endif \n}\n\n",b+="vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale) \n{\n    rotation = -rotation; \n    mat3 transform = mat3(\n        cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, \n       -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, \n        offset.x, offset.y, 1.0); \n    vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; \n    return transformedTexCoords; \n}\n\n",b+="#ifdef USE_IBL_LIGHTING \n",b+="uniform vec2 gltf_iblFactor; \n",b+="#endif \n",b+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",b+="uniform vec3 gltf_lightColor; \n",b+="#endif \n",b+="void main(void) \n{\n",b+=Y,S&&!j&&(b+="    vec3 ng = normalize(v_normal);\n",b+="    vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\n",Object(l.a)(i.u_normalTexture)?I?(b+="    vec3 t = normalize(v_tangent.xyz);\n",b+="    vec3 b = normalize(cross(ng, t) * v_tangent.w);\n",b+="    mat3 tbn = mat3(t, b, ng);\n",b+=`    vec3 n = texture2D(u_normalTexture, ${k}).rgb;\n`,b+="    n = normalize(tbn * (2.0 * n - 1.0));\n"):(b="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+b,b+="#ifdef GL_OES_standard_derivatives\n",b+="    vec3 pos_dx = dFdx(v_positionEC);\n",b+="    vec3 pos_dy = dFdy(v_positionEC);\n",b+=`    vec3 tex_dx = dFdx(vec3(${k},0.0));\n`,b+=`    vec3 tex_dy = dFdy(vec3(${k},0.0));\n`,b+="    vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",b+="    t = normalize(t - ng * dot(ng, t));\n",b+="    vec3 b = normalize(cross(ng, t));\n",b+="    mat3 tbn = mat3(t, b, ng);\n",b+=`    vec3 n = texture2D(u_normalTexture, ${k}).rgb;\n`,b+="    n = normalize(tbn * (2.0 * n - 1.0));\n",b+="#else\n",b+="    vec3 n = ng;\n",b+="#endif\n"):b+="    vec3 n = ng;\n",t.doubleSided&&(b+="    if (czm_backFacing())\n",b+="    {\n",b+="        n = -n;\n",b+="    }\n"));Object(l.a)(i.u_baseColorTexture)?(b+=`    vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, ${U}));\n`,Object(l.a)(i.u_baseColorFactor)&&(b+="    baseColorWithAlpha *= u_baseColorFactor;\n")):Object(l.a)(i.u_baseColorFactor)?b+="    vec4 baseColorWithAlpha = u_baseColorFactor;\n":b+="    vec4 baseColorWithAlpha = vec4(1.0);\n";C&&(b+="    baseColorWithAlpha *= v_vertexColor;\n");b+="    vec3 baseColor = baseColorWithAlpha.rgb;\n",S&&!j?(f?(Object(l.a)(i.u_specularGlossinessTexture)?(b+=`    vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, ${V}));\n`,b+="    vec3 specular = specularGlossiness.rgb;\n",b+="    float glossiness = specularGlossiness.a;\n",Object(l.a)(i.u_specularFactor)&&(b+="    specular *= u_specularFactor;\n"),Object(l.a)(i.u_glossinessFactor)&&(b+="    glossiness *= u_glossinessFactor;\n")):(Object(l.a)(i.u_specularFactor)?b+="    vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n":b+="    vec3 specular = vec3(1.0);\n",Object(l.a)(i.u_glossinessFactor)?b+="    float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n":b+="    float glossiness = 1.0;\n"),Object(l.a)(i.u_diffuseTexture)?(b+=`    vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, ${H}));\n`,Object(l.a)(i.u_diffuseFactor)&&(b+="    diffuse *= u_diffuseFactor;\n")):Object(l.a)(i.u_diffuseFactor)?b+="    vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n":b+="    vec4 diffuse = vec4(1.0);\n",b+="    baseColorWithAlpha.a = diffuse.a;\n"):Object(l.a)(i.u_metallicRoughnessTexture)?(b+=`    vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, ${G}).rgb;\n`,b+="    float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",b+="    float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",Object(l.a)(i.u_metallicFactor)&&(b+="    metalness *= u_metallicFactor;\n"),Object(l.a)(i.u_roughnessFactor)&&(b+="    roughness *= u_roughnessFactor;\n")):(Object(l.a)(i.u_metallicFactor)?b+="    float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":b+="    float metalness = 1.0;\n",Object(l.a)(i.u_roughnessFactor)?b+="    float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":b+="    float roughness = 1.0;\n"),b+="    vec3 v = -normalize(v_positionEC);\n",b+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",b+="    vec3 lightColorHdr = czm_lightColorHdr;\n",b+="#else \n",b+="    vec3 lightColorHdr = gltf_lightColor;\n",b+="#endif \n",b+="    vec3 l = normalize(czm_lightDirectionEC);\n",b+="    vec3 h = normalize(v + l);\n",b+="    float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",b+="    float NdotV = abs(dot(n, v)) + 0.001;\n",b+="    float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",b+="    float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",b+="    float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",b+="    vec3 f0 = vec3(0.04);\n",f?(b+="    float roughness = 1.0 - glossiness;\n",b+="    vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b));\n",b+="    vec3 specularColor = specular;\n"):(b+="    vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n",b+="    vec3 specularColor = mix(f0, baseColor, metalness);\n"),b+="    float alpha = roughness * roughness;\n",b+="    float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",b+="    vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",b+="    vec3 r0 = specularColor.rgb;\n",b+="    vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",b+="    float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",b+="    float D = GGX(alpha, NdotH);\n",b+="    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n",b+="    vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",b+="    vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n",b+="#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) \n",b+="    vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",b+="    float vertexRadius = length(positionWC);\n",b+="    float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n",b+="    float reflectionDotNadir = dot(r, normalize(positionWC));\n",b+="    r.x = -r.x;\n",b+="    r = -normalize(czm_temeToPseudoFixed * r);\n",b+="    r.x = -r.x;\n",b+="    float inverseRoughness = 1.04 - roughness;\n",b+="    inverseRoughness *= inverseRoughness;\n",b+="    vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",b+="    float atmosphereHeight = 0.05;\n",b+="    float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",b+="    float blendRegionOffset = roughness * -1.0;\n",b+="    float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n",b+="    float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",b+="    float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",b+="    float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",b+="    vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n",b+="    vec3 nadirColor = belowHorizonColor * 0.5;\n",b+="    vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n",b+="    vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n",b+="    vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",b+="    vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n",b+="    float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n",b+="    float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n",b+="    vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n",b+="    float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n",b+="    vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n",b+="    specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",b+="    specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",b+="#ifdef USE_SUN_LUMINANCE \n",b+="    float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\n",b+="    float S = acos(LdotZenith);\n",b+="    float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n",b+="    float gamma = acos(NdotL);\n",b+="    float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n",b+="    float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n",b+="    float luminance = gltf_luminanceAtZenith * (numerator / denominator);\n",b+="#endif \n",b+="    vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",b+="    vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y);\n",b+="    float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n",b+="    vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n",b+="    IBLColor *= lightColor;\n",b+="#ifdef USE_SUN_LUMINANCE \n",b+="    color += IBLColor * luminance;\n",b+="#else \n",b+="    color += IBLColor; \n",b+="#endif \n",b+="#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) \n",b+="    const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); \n",b+="    vec3 cubeDir = normalize(yUpToZUp * gltf_iblReferenceFrameMatrix * normalize(reflect(-v, n))); \n",b+="#ifdef DIFFUSE_IBL \n",b+="#ifdef CUSTOM_SPHERICAL_HARMONICS \n",b+="    vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); \n",b+="#else \n",b+="    vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n",b+="#endif \n",b+="#else \n",b+="    vec3 diffuseIrradiance = vec3(0.0); \n",b+="#endif \n",b+="#ifdef SPECULAR_IBL \n",b+="    vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",b+="#ifdef CUSTOM_SPECULAR_IBL \n",b+="    vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir,  roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD);\n",b+="#else \n",b+="    vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir,  roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n",b+="#endif \n",b+="    specularIBL *= F * brdfLut.x + brdfLut.y;\n",b+="#else \n",b+="    vec3 specularIBL = vec3(0.0); \n",b+="#endif \n",b+="    color += diffuseIrradiance * diffuseColor + specularColor * specularIBL;\n",b+="#endif \n"):b+="    vec3 color = baseColor;\n";j||(Object(l.a)(i.u_occlusionTexture)&&(b+=`    color *= texture2D(u_occlusionTexture, ${q}).r;\n`),Object(l.a)(i.u_emissiveTexture)?(b+=`    vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, ${W}).rgb);\n`,Object(l.a)(i.u_emissiveFactor)&&(b+="    emissive *= u_emissiveFactor;\n"),b+="    color += emissive;\n"):Object(l.a)(i.u_emissiveFactor)&&(b+="    color += u_emissiveFactor;\n"));j||(b+="    color = applyTonemapping(color);\n");b+="    color = LINEARtoSRGB(color);\n",R&&(b+="    float outlineness = max(\n",b+="        texture2D(u_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r,\n",b+="        max(\n",b+="          texture2D(u_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r,\n",b+="          texture2D(u_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r));\n",b+="    color = mix(color, vec3(0.0, 0.0, 0.0), outlineness);\n");Object(l.a)(L)?"MASK"===L?(b+="    if (baseColorWithAlpha.a < u_alphaCutoff) {\n",b+="        discard;\n",b+="    }\n",b+="    gl_FragColor = vec4(color, 1.0);\n"):b+="BLEND"===L?"    gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":"    gl_FragColor = vec4(color, 1.0);\n":b+="    gl_FragColor = vec4(color, 1.0);\n";b+="}\n";const X=BV(h,{type:ps.VERTEX_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}}),K=BV(h,{type:ps.FRAGMENT_SHADER,extras:{_pipeline:{source:b,extension:".glsl"}}}),J=BV(d,{fragmentShader:K,vertexShader:X});return BV(u,{attributes:F,program:J,uniforms:M})}(e,i,r,o,n,t);Object(l.a)(i.extensions)||(i.extensions={}),i.extensions.KHR_techniques_webgl={values:o,technique:a}})),nG.ensureSemanticExistence(e),e};var dG=function(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds},fG="attribute vec3 position;\nattribute float a_batchId;\n\nuniform mat4 u_modifiedModelViewProjection;\n\nvoid main()\n{\n    gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n",pG=n(76),mG=n.n(pG);var gG=Object.freeze({VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18});function _G(e,t){let n;s.a.typeOf.string("expression",e),this._expression=e,e=function(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){const e=t.indexOf("'"),r=t.indexOf('"');let o;if(e>=0&&e<i)o=t.indexOf("'",e+1),n+=t.substr(0,o+1),t=t.substr(o+1),i=t.indexOf("${");else if(r>=0&&r<i)o=t.indexOf('"',r+1),n+=t.substr(0,o+1),t=t.substr(o+1),i=t.indexOf("${");else{n+=t.substr(0,i);const e=t.indexOf("}");if(e<0)throw new ye.a("Unmatched {.");n+="czm_"+t.substr(i+2,e-(i+2)),t=t.substr(e+1),i=t.indexOf("${")}}return n+=t,n}(function(e){return e.replace(wG,"@#%")}(e=function(e,t){if(!Object(l.a)(t))return e;for(const n in t)if(t.hasOwnProperty(n)){const i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;Object(l.a)(r)&&(e=e.replace(i,r))}return e}(e,t))),mG.a.addBinaryOp("=~",0),mG.a.addBinaryOp("!~",0);try{n=mG()(e)}catch(e){throw new ye.a(e)}this._runtimeAst=NG(this,n)}Object.defineProperties(_G.prototype,{expression:{get:function(){return this._expression}}});const yG={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Vt],cartesian3Array:[new O],cartesian4Array:[new _e],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);const e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new Vt),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new O),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new _e),this.cartesian4Array[this.cartesian4Index++]}};_G.prototype.evaluate=function(e,t){yG.reset();const n=this._runtimeAst.evaluate(e);return t instanceof sp&&n instanceof _e?sp.fromCartesian4(n,t):n instanceof Vt||n instanceof O||n instanceof _e?n.clone(t):n},_G.prototype.evaluateColor=function(e,t){yG.reset();const n=this._runtimeAst.evaluate(e);return sp.fromCartesian4(n,t)},_G.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e}\n{\n    return ${r};\n}\n`,r},_G.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)},_G.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter((function(e,t,n){return n.indexOf(e)===t})),e};const bG=["!","-","+"],vG=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],OG=/\${(.*?)}/g,wG=/\\/g,AG=/@#%/g,EG=new sp,TG={abs:SG(Math.abs),sqrt:SG(Math.sqrt),cos:SG(Math.cos),sin:SG(Math.sin),tan:SG(Math.tan),acos:SG(Math.acos),asin:SG(Math.asin),atan:SG(Math.atan),radians:SG(h.a.toRadians),degrees:SG(h.a.toDegrees),sign:SG(h.a.sign),floor:SG(Math.floor),ceil:SG(Math.ceil),round:SG(Math.round),exp:SG(Math.exp),exp2:SG((function(e){return Math.pow(2,e)})),log:SG(Math.log),log2:SG((function(e){return h.a.log2(e)})),fract:SG((function(e){return e-Math.floor(e)})),length:function(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof Vt)return Vt.magnitude(t);if(t instanceof O)return O.magnitude(t);if(t instanceof _e)return _e.magnitude(t);throw new ye.a(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)},normalize:function(e,t){if("number"==typeof t)return 1;if(t instanceof Vt)return Vt.normalize(t,yG.getCartesian2());if(t instanceof O)return O.normalize(t,yG.getCartesian3());if(t instanceof _e)return _e.normalize(t,yG.getCartesian4());throw new ye.a(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}},CG={atan2:IG(Math.atan2,!1),pow:IG(Math.pow,!1),min:IG(Math.min,!0),max:IG(Math.max,!0),distance:function(e,t,n){if("number"==typeof t&&"number"==typeof n)return Math.abs(t-n);if(t instanceof Vt&&n instanceof Vt)return Vt.distance(t,n);if(t instanceof O&&n instanceof O)return O.distance(t,n);if(t instanceof _e&&n instanceof _e)return _e.distance(t,n);throw new ye.a(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)},dot:function(e,t,n){if("number"==typeof t&&"number"==typeof n)return t*n;if(t instanceof Vt&&n instanceof Vt)return Vt.dot(t,n);if(t instanceof O&&n instanceof O)return O.dot(t,n);if(t instanceof _e&&n instanceof _e)return _e.dot(t,n);throw new ye.a(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)},cross:function(e,t,n){if(t instanceof O&&n instanceof O)return O.cross(t,n,yG.getCartesian3());throw new ye.a(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}},xG={clamp:PG(h.a.clamp,!0),mix:PG(h.a.lerp,!0)};function SG(e){return function(t,n){if("number"==typeof n)return e(n);if(n instanceof Vt)return Vt.fromElements(e(n.x),e(n.y),yG.getCartesian2());if(n instanceof O)return O.fromElements(e(n.x),e(n.y),e(n.z),yG.getCartesian3());if(n instanceof _e)return _e.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),yG.getCartesian4());throw new ye.a(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function IG(e,t){return function(n,i,r){if(t&&"number"==typeof r){if("number"==typeof i)return e(i,r);if(i instanceof Vt)return Vt.fromElements(e(i.x,r),e(i.y,r),yG.getCartesian2());if(i instanceof O)return O.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),yG.getCartesian3());if(i instanceof _e)return _e.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),yG.getCartesian4())}if("number"==typeof i&&"number"==typeof r)return e(i,r);if(i instanceof Vt&&r instanceof Vt)return Vt.fromElements(e(i.x,r.x),e(i.y,r.y),yG.getCartesian2());if(i instanceof O&&r instanceof O)return O.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),yG.getCartesian3());if(i instanceof _e&&r instanceof _e)return _e.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),yG.getCartesian4());throw new ye.a(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function PG(e,t){return function(n,i,r,o){if(t&&"number"==typeof o){if("number"==typeof i&&"number"==typeof r)return e(i,r,o);if(i instanceof Vt&&r instanceof Vt)return Vt.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),yG.getCartesian2());if(i instanceof O&&r instanceof O)return O.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),yG.getCartesian3());if(i instanceof _e&&r instanceof _e)return _e.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),yG.getCartesian4())}if("number"==typeof i&&"number"==typeof r&&"number"==typeof o)return e(i,r,o);if(i instanceof Vt&&r instanceof Vt&&o instanceof Vt)return Vt.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),yG.getCartesian2());if(i instanceof O&&r instanceof O&&o instanceof O)return O.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),yG.getCartesian3());if(i instanceof _e&&r instanceof _e&&o instanceof _e)return _e.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),yG.getCartesian4());throw new ye.a(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function DG(e,t,n,i,r){var o;this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,(o=this)._type===gG.CONDITIONAL?o.evaluate=o._evaluateConditional:o._type===gG.FUNCTION_CALL?"test"===o._value?o.evaluate=o._evaluateRegExpTest:"exec"===o._value?o.evaluate=o._evaluateRegExpExec:"toString"===o._value&&(o.evaluate=o._evaluateToString):o._type===gG.UNARY?"!"===o._value?o.evaluate=o._evaluateNot:"-"===o._value?o.evaluate=o._evaluateNegative:"+"===o._value?o.evaluate=o._evaluatePositive:"isNaN"===o._value?o.evaluate=o._evaluateNaN:"isFinite"===o._value?o.evaluate=o._evaluateIsFinite:"isExactClass"===o._value?o.evaluate=o._evaluateIsExactClass:"isClass"===o._value?o.evaluate=o._evaluateIsClass:"getExactClassName"===o._value?o.evaluate=o._evaluateGetExactClassName:"Boolean"===o._value?o.evaluate=o._evaluateBooleanConversion:"Number"===o._value?o.evaluate=o._evaluateNumberConversion:"String"===o._value?o.evaluate=o._evaluateStringConversion:Object(l.a)(TG[o._value])&&(o.evaluate=function(e){const t=TG[e];return function(n){const i=this._left.evaluate(n);return t(e,i)}}(o._value)):o._type===gG.BINARY?"+"===o._value?o.evaluate=o._evaluatePlus:"-"===o._value?o.evaluate=o._evaluateMinus:"*"===o._value?o.evaluate=o._evaluateTimes:"/"===o._value?o.evaluate=o._evaluateDivide:"%"===o._value?o.evaluate=o._evaluateMod:"==="===o._value?o.evaluate=o._evaluateEqualsStrict:"!=="===o._value?o.evaluate=o._evaluateNotEqualsStrict:"<"===o._value?o.evaluate=o._evaluateLessThan:"<="===o._value?o.evaluate=o._evaluateLessThanOrEquals:">"===o._value?o.evaluate=o._evaluateGreaterThan:">="===o._value?o.evaluate=o._evaluateGreaterThanOrEquals:"&&"===o._value?o.evaluate=o._evaluateAnd:"||"===o._value?o.evaluate=o._evaluateOr:"=~"===o._value?o.evaluate=o._evaluateRegExpMatch:"!~"===o._value?o.evaluate=o._evaluateRegExpNotMatch:Object(l.a)(CG[o._value])&&(o.evaluate=function(e){const t=CG[e];return function(n){const i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}(o._value)):o._type===gG.TERNARY?o.evaluate=function(e){const t=xG[e];return function(n){const i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}(o._value):o._type===gG.MEMBER?"brackets"===o._value?o.evaluate=o._evaluateMemberBrackets:o.evaluate=o._evaluateMemberDot:o._type===gG.ARRAY?o.evaluate=o._evaluateArray:o._type===gG.VARIABLE?o.evaluate=o._evaluateVariable:o._type===gG.VARIABLE_IN_STRING?o.evaluate=o._evaluateVariableString:o._type===gG.LITERAL_COLOR?o.evaluate=o._evaluateLiteralColor:o._type===gG.LITERAL_VECTOR?o.evaluate=o._evaluateLiteralVector:o._type===gG.LITERAL_STRING?o.evaluate=o._evaluateLiteralString:o._type===gG.REGEX?o.evaluate=o._evaluateRegExp:o._type===gG.BUILTIN_VARIABLE?"tiles3d_tileset_time"===o._value&&(o.evaluate=BG):o.evaluate=o._evaluateLiteral}function RG(e){return e.replace(AG,"\\")}function jG(e,t){const n=t.arguments,i=n.length;let r,o,a,s;if("MemberExpression"===t.callee.type){r=t.callee.property.name;const c=t.callee.object;if("test"===r||"exec"===r){if("regExp"!==c.callee.name)throw new ye.a(r+" is not a function.");return 0===i?"test"===r?new DG(gG.LITERAL_BOOLEAN,!1):new DG(gG.LITERAL_NULL,null):(a=NG(e,c),s=NG(e,n[0]),new DG(gG.FUNCTION_CALL,r,a,s))}if("toString"===r)return o=NG(e,c),new DG(gG.FUNCTION_CALL,r,o);throw new ye.a(`Unexpected function call "${r}".`)}if(r=t.callee.name,"color"===r){if(0===i)return new DG(gG.LITERAL_COLOR,r);if(o=NG(e,n[0]),Object(l.a)(n[1])){const t=NG(e,n[1]);return new DG(gG.LITERAL_COLOR,r,[o,t])}return new DG(gG.LITERAL_COLOR,r,[o])}if("rgb"===r||"hsl"===r){if(i<3)throw new ye.a(r+" requires three arguments.");return o=[NG(e,n[0]),NG(e,n[1]),NG(e,n[2])],new DG(gG.LITERAL_COLOR,r,o)}if("rgba"===r||"hsla"===r){if(i<4)throw new ye.a(r+" requires four arguments.");return o=[NG(e,n[0]),NG(e,n[1]),NG(e,n[2]),NG(e,n[3])],new DG(gG.LITERAL_COLOR,r,o)}if("vec2"===r||"vec3"===r||"vec4"===r){o=new Array(i);for(let t=0;t<i;++t)o[t]=NG(e,n[t]);return new DG(gG.LITERAL_VECTOR,r,o)}if("isNaN"===r||"isFinite"===r)return 0===i?new DG(gG.LITERAL_BOOLEAN,"isNaN"===r):(o=NG(e,n[0]),new DG(gG.UNARY,r,o));if("isExactClass"===r||"isClass"===r){if(i<1||i>1)throw new ye.a(r+" requires exactly one argument.");return o=NG(e,n[0]),new DG(gG.UNARY,r,o)}if("getExactClassName"===r){if(i>0)throw new ye.a(r+" does not take any argument.");return new DG(gG.UNARY,r)}if(Object(l.a)(TG[r])){if(1!==i)throw new ye.a(r+" requires exactly one argument.");return o=NG(e,n[0]),new DG(gG.UNARY,r,o)}if(Object(l.a)(CG[r])){if(2!==i)throw new ye.a(r+" requires exactly two arguments.");return a=NG(e,n[0]),s=NG(e,n[1]),new DG(gG.BINARY,r,a,s)}if(Object(l.a)(xG[r])){if(3!==i)throw new ye.a(r+" requires exactly three arguments.");a=NG(e,n[0]),s=NG(e,n[1]);const t=NG(e,n[2]);return new DG(gG.TERNARY,r,a,s,t)}if("Boolean"===r)return 0===i?new DG(gG.LITERAL_BOOLEAN,!1):(o=NG(e,n[0]),new DG(gG.UNARY,r,o));if("Number"===r)return 0===i?new DG(gG.LITERAL_NUMBER,0):(o=NG(e,n[0]),new DG(gG.UNARY,r,o));if("String"===r)return 0===i?new DG(gG.LITERAL_STRING,""):(o=NG(e,n[0]),new DG(gG.UNARY,r,o));if("regExp"===r)return function(e,t){const n=t.arguments;if(0===n.length)return new DG(gG.LITERAL_REGEX,new RegExp);const i=NG(e,n[0]);let r;if(n.length>1){const t=NG(e,n[1]);if(LG(i)&&LG(t)){try{r=new RegExp(RG(String(i._value)),t._value)}catch(e){throw new ye.a(e)}return new DG(gG.LITERAL_REGEX,r)}return new DG(gG.REGEX,i,t)}if(LG(i)){try{r=new RegExp(RG(String(i._value)))}catch(e){throw new ye.a(e)}return new DG(gG.LITERAL_REGEX,r)}return new DG(gG.REGEX,i)}(e,t);throw new ye.a(`Unexpected function call "${r}".`)}function MG(e,t){if("Math"===t.object.name)return function(e){const t=e.property.name;return"PI"===t?new DG(gG.LITERAL_NUMBER,Math.PI):"E"===t?new DG(gG.LITERAL_NUMBER,Math.E):void 0}(t);if("Number"===t.object.name)return function(e){if("POSITIVE_INFINITY"===e.property.name)return new DG(gG.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}(t);let n;const i=NG(e,t.object);return t.computed?(n=NG(e,t.property),new DG(gG.MEMBER,"brackets",i,n)):(n=new DG(gG.LITERAL_STRING,t.property.name),new DG(gG.MEMBER,"dot",i,n))}function LG(e){return e._type>=gG.LITERAL_NULL}function NG(e,t){let n,i,r,o;if("Literal"===t.type)n=function(e){const t=typeof e.value;return null===e.value?new DG(gG.LITERAL_NULL,null):"boolean"===t?new DG(gG.LITERAL_BOOLEAN,e.value):"number"===t?new DG(gG.LITERAL_NUMBER,e.value):"string"===t?e.value.indexOf("${")>=0?new DG(gG.VARIABLE_IN_STRING,e.value):new DG(gG.LITERAL_STRING,RG(e.value)):void 0}(t);else if("CallExpression"===t.type)n=jG(e,t);else if("Identifier"===t.type)n=function(e){if(function(e){return"czm_"===e.substr(0,4)}(e.name)){const t=e.name.substr(4);return"tiles3d_"===t.substr(0,8)?new DG(gG.BUILTIN_VARIABLE,t):new DG(gG.VARIABLE,t)}if("NaN"===e.name)return new DG(gG.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new DG(gG.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new DG(gG.LITERAL_UNDEFINED,void 0);throw new ye.a(e.name+" is not defined.")}(t);else if("UnaryExpression"===t.type){i=t.operator;const r=NG(e,t.argument);if(!(bG.indexOf(i)>-1))throw new ye.a(`Unexpected operator "${i}".`);n=new DG(gG.UNARY,i,r)}else if("BinaryExpression"===t.type){if(i=t.operator,r=NG(e,t.left),o=NG(e,t.right),!(vG.indexOf(i)>-1))throw new ye.a(`Unexpected operator "${i}".`);n=new DG(gG.BINARY,i,r,o)}else if("LogicalExpression"===t.type)i=t.operator,r=NG(e,t.left),o=NG(e,t.right),vG.indexOf(i)>-1&&(n=new DG(gG.BINARY,i,r,o));else if("ConditionalExpression"===t.type){const i=NG(e,t.test);r=NG(e,t.consequent),o=NG(e,t.alternate),n=new DG(gG.CONDITIONAL,"?",r,o,i)}else if("MemberExpression"===t.type)n=MG(e,t);else{if("ArrayExpression"!==t.type)throw"Compound"===t.type?new ye.a("Provide exactly one expression."):new ye.a("Cannot parse expression.");{const i=[];for(let n=0;n<t.elements.length;n++)i[n]=NG(e,t.elements[n]);n=new DG(gG.ARRAY,i)}}return n}function BG(e){return Object(l.a)(e)?e.content.tileset.timeSinceLoad:0}function FG(e,t){if(Object(l.a)(e))return e.getPropertyInherited(t)}function zG(e){return"feature"===e._value}function kG(e){const t=e._left,n=t.length;for(let e=0;e<n;++e)if(t[e]._type!==gG.LITERAL_NUMBER)return;const i=t[0]._value,r=t[1]._value,o=t[2]._value,a=4===n?t[3]._value:1;return sp.fromHsl(i,r,o,a,EG)}function UG(e){const t=e._left,n=t.length;for(let e=0;e<n;++e)if(t[e]._type!==gG.LITERAL_NUMBER)return;const i=EG;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=4===n?t[3]._value:1,i}function VG(e){return e%1==0?e.toFixed(1):e.toString()}function HG(e){return`vec4(${VG(e.red)}, ${VG(e.green)}, ${VG(e.blue)}, ${VG(e.alpha)})`}function GG(e,t,n,i){const r=e.length,o=new Array(r);for(let a=0;a<r;++a)o[a]=e[a].getShaderExpression(t,n,i);return o}function qG(e,t){return Object(l.a)(t[e])?t[e]:_G.NULL_SENTINEL}DG.prototype._evaluateLiteral=function(){return this._value},DG.prototype._evaluateLiteralColor=function(e){const t=EG,n=this._left;if("color"===this._value)Object(l.a)(n)?n.length>1?(sp.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):sp.fromCssColorString(n[0].evaluate(e),t):sp.fromBytes(255,255,255,255,t);else if("rgb"===this._value)sp.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if("rgba"===this._value){const i=255*n[3].evaluate(e);sp.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else"hsl"===this._value?sp.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):"hsla"===this._value&&sp.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return _e.fromColor(t,yG.getCartesian4())},DG.prototype._evaluateLiteralVector=function(e){const t=yG.getArray(),n=this._value,i=this._left,r=i.length;for(let o=0;o<r;++o){const r=i[o].evaluate(e);if("number"==typeof r)t.push(r);else if(r instanceof Vt)t.push(r.x,r.y);else if(r instanceof O)t.push(r.x,r.y,r.z);else{if(!(r instanceof _e))throw new ye.a(`${n} argument must be a vector or number. Argument is ${r}.`);t.push(r.x,r.y,r.z,r.w)}}const o=t.length,a=parseInt(n.charAt(3));if(0===o)throw new ye.a(`Invalid ${n} constructor. No valid arguments.`);if(o<a&&o>1)throw new ye.a(`Invalid ${n} constructor. Not enough arguments.`);if(o>a&&r>1)throw new ye.a(`Invalid ${n} constructor. Too many arguments.`);if(1===o){const e=t[0];t.push(e,e,e)}return"vec2"===n?Vt.fromArray(t,0,yG.getCartesian2()):"vec3"===n?O.fromArray(t,0,yG.getCartesian3()):"vec4"===n?_e.fromArray(t,0,yG.getCartesian4()):void 0},DG.prototype._evaluateLiteralString=function(){return this._value},DG.prototype._evaluateVariableString=function(e){let t=this._value,n=OG.exec(t);for(;null!==n;){const i=n[0];let r=FG(e,n[1]);Object(l.a)(r)||(r=""),t=t.replace(i,r),n=OG.exec(t)}return t},DG.prototype._evaluateVariable=function(e){return FG(e,this._value)},DG.prototype._evaluateMemberDot=function(e){if(zG(this._left))return FG(e,this._right.evaluate(e));const t=this._left.evaluate(e);if(!Object(l.a)(t))return;const n=this._right.evaluate(e);if(t instanceof Vt||t instanceof O||t instanceof _e){if("r"===n)return t.x;if("g"===n)return t.y;if("b"===n)return t.z;if("a"===n)return t.w}return t[n]},DG.prototype._evaluateMemberBrackets=function(e){if(zG(this._left))return FG(e,this._right.evaluate(e));const t=this._left.evaluate(e);if(!Object(l.a)(t))return;const n=this._right.evaluate(e);if(t instanceof Vt||t instanceof O||t instanceof _e){if(0===n||"r"===n)return t.x;if(1===n||"g"===n)return t.y;if(2===n||"b"===n)return t.z;if(3===n||"a"===n)return t.w}return t[n]},DG.prototype._evaluateArray=function(e){const t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t},DG.prototype._evaluateNot=function(e){const t=this._left.evaluate(e);if("boolean"!=typeof t)throw new ye.a(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t},DG.prototype._evaluateNegative=function(e){const t=this._left.evaluate(e);if(t instanceof Vt)return Vt.negate(t,yG.getCartesian2());if(t instanceof O)return O.negate(t,yG.getCartesian3());if(t instanceof _e)return _e.negate(t,yG.getCartesian4());if("number"==typeof t)return-t;throw new ye.a(`Operator "-" requires a vector or number argument. Argument is ${t}.`)},DG.prototype._evaluatePositive=function(e){const t=this._left.evaluate(e);if(!(t instanceof Vt||t instanceof O||t instanceof _e||"number"==typeof t))throw new ye.a(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t},DG.prototype._evaluateLessThan=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof n)throw new ye.a(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n},DG.prototype._evaluateLessThanOrEquals=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof n)throw new ye.a(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n},DG.prototype._evaluateGreaterThan=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof n)throw new ye.a(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n},DG.prototype._evaluateGreaterThanOrEquals=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof n)throw new ye.a(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n},DG.prototype._evaluateOr=function(e){const t=this._left.evaluate(e);if("boolean"!=typeof t)throw new ye.a(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;const n=this._right.evaluate(e);if("boolean"!=typeof n)throw new ye.a(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n},DG.prototype._evaluateAnd=function(e){const t=this._left.evaluate(e);if("boolean"!=typeof t)throw new ye.a(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;const n=this._right.evaluate(e);if("boolean"!=typeof n)throw new ye.a(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n},DG.prototype._evaluatePlus=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Vt&&t instanceof Vt)return Vt.add(t,n,yG.getCartesian2());if(n instanceof O&&t instanceof O)return O.add(t,n,yG.getCartesian3());if(n instanceof _e&&t instanceof _e)return _e.add(t,n,yG.getCartesian4());if("string"==typeof t||"string"==typeof n)return t+n;if("number"==typeof t&&"number"==typeof n)return t+n;throw new ye.a(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateMinus=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Vt&&t instanceof Vt)return Vt.subtract(t,n,yG.getCartesian2());if(n instanceof O&&t instanceof O)return O.subtract(t,n,yG.getCartesian3());if(n instanceof _e&&t instanceof _e)return _e.subtract(t,n,yG.getCartesian4());if("number"==typeof t&&"number"==typeof n)return t-n;throw new ye.a(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateTimes=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Vt&&t instanceof Vt)return Vt.multiplyComponents(t,n,yG.getCartesian2());if(n instanceof Vt&&"number"==typeof t)return Vt.multiplyByScalar(n,t,yG.getCartesian2());if(t instanceof Vt&&"number"==typeof n)return Vt.multiplyByScalar(t,n,yG.getCartesian2());if(n instanceof O&&t instanceof O)return O.multiplyComponents(t,n,yG.getCartesian3());if(n instanceof O&&"number"==typeof t)return O.multiplyByScalar(n,t,yG.getCartesian3());if(t instanceof O&&"number"==typeof n)return O.multiplyByScalar(t,n,yG.getCartesian3());if(n instanceof _e&&t instanceof _e)return _e.multiplyComponents(t,n,yG.getCartesian4());if(n instanceof _e&&"number"==typeof t)return _e.multiplyByScalar(n,t,yG.getCartesian4());if(t instanceof _e&&"number"==typeof n)return _e.multiplyByScalar(t,n,yG.getCartesian4());if("number"==typeof t&&"number"==typeof n)return t*n;throw new ye.a(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateDivide=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Vt&&t instanceof Vt)return Vt.divideComponents(t,n,yG.getCartesian2());if(t instanceof Vt&&"number"==typeof n)return Vt.divideByScalar(t,n,yG.getCartesian2());if(n instanceof O&&t instanceof O)return O.divideComponents(t,n,yG.getCartesian3());if(t instanceof O&&"number"==typeof n)return O.divideByScalar(t,n,yG.getCartesian3());if(n instanceof _e&&t instanceof _e)return _e.divideComponents(t,n,yG.getCartesian4());if(t instanceof _e&&"number"==typeof n)return _e.divideByScalar(t,n,yG.getCartesian4());if("number"==typeof t&&"number"==typeof n)return t/n;throw new ye.a(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateMod=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Vt&&t instanceof Vt)return Vt.fromElements(t.x%n.x,t.y%n.y,yG.getCartesian2());if(n instanceof O&&t instanceof O)return O.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,yG.getCartesian3());if(n instanceof _e&&t instanceof _e)return _e.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,yG.getCartesian4());if("number"==typeof t&&"number"==typeof n)return t%n;throw new ye.a(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateEqualsStrict=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof Vt&&t instanceof Vt||n instanceof O&&t instanceof O||n instanceof _e&&t instanceof _e?t.equals(n):t===n},DG.prototype._evaluateNotEqualsStrict=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof Vt&&t instanceof Vt||n instanceof O&&t instanceof O||n instanceof _e&&t instanceof _e?!t.equals(n):t!==n},DG.prototype._evaluateConditional=function(e){const t=this._test.evaluate(e);if("boolean"!=typeof t)throw new ye.a(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)},DG.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},DG.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},DG.prototype._evaluateIsExactClass=function(e){return!!Object(l.a)(e)&&e.isExactClass(this._left.evaluate(e))},DG.prototype._evaluateIsClass=function(e){return!!Object(l.a)(e)&&e.isClass(this._left.evaluate(e))},DG.prototype._evaluateGetExactClassName=function(e){if(Object(l.a)(e))return e.getExactClassName()},DG.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},DG.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},DG.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},DG.prototype._evaluateRegExp=function(e){const t=this._value.evaluate(e);let n,i="";Object(l.a)(this._left)&&(i=this._left.evaluate(e));try{n=new RegExp(t,i)}catch(e){throw new ye.a(e)}return n},DG.prototype._evaluateRegExpTest=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof n))throw new ye.a(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)},DG.prototype._evaluateRegExpMatch=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof n)return t.test(n);if(n instanceof RegExp&&"string"==typeof t)return n.test(t);throw new ye.a(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateRegExpNotMatch=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof n)return!t.test(n);if(n instanceof RegExp&&"string"==typeof t)return!n.test(t);throw new ye.a(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)},DG.prototype._evaluateRegExpExec=function(e){const t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof n))throw new ye.a(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);const i=t.exec(n);return Object(l.a)(i)?i[1]:null},DG.prototype._evaluateToString=function(e){const t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof Vt||t instanceof O||t instanceof _e)return String(t);throw new ye.a(`Unexpected function call "${this._value}".`)},_G.NULL_SENTINEL="czm_infinity",DG.prototype.getShaderExpression=function(e,t,n){let i,r,o,a;const s=this._type;let c,h,d,f=this._value;switch(Object(l.a)(this._left)&&(r=Array.isArray(this._left)?GG(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),Object(l.a)(this._right)&&(o=this._right.getShaderExpression(e,t,this)),Object(l.a)(this._test)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(f=GG(this._value,e,t,this)),s){case gG.VARIABLE:if(zG(this))return;return qG(f,e);case gG.UNARY:if("Boolean"===f)return`bool(${r})`;if("Number"===f)return`float(${r})`;if("round"===f)return`floor(${r} + 0.5)`;if(Object(l.a)(TG[f]))return`${f}(${r})`;if("isNaN"===f)return`(${r} != ${r})`;if("isFinite"===f)return`(abs(${r}) < czm_infinity)`;if("String"===f||"isExactClass"===f||"isClass"===f||"getExactClassName"===f)throw new ye.a(`Error generating style shader: "${f}" is not supported.`);return f+r;case gG.BINARY:return"%"===f?`mod(${r}, ${o})`:"==="===f?`(${r} == ${o})`:"!=="===f?`(${r} != ${o})`:"atan2"===f?`atan(${r}, ${o})`:Object(l.a)(CG[f])?`${f}(${r}, ${o})`:`(${r} ${f} ${o})`;case gG.TERNARY:if(Object(l.a)(xG[f]))return`${f}(${r}, ${o}, ${a})`;break;case gG.CONDITIONAL:return`(${a} ? ${r} : ${o})`;case gG.MEMBER:return zG(this._left)?qG(o,e):"r"===o||"x"===o||"0.0"===o?r+"[0]":"g"===o||"y"===o||"1.0"===o?r+"[1]":"b"===o||"z"===o||"2.0"===o?r+"[2]":"a"===o||"w"===o||"3.0"===o?r+"[3]":`${r}[int(${o})]`;case gG.FUNCTION_CALL:throw new ye.a(`Error generating style shader: "${f}" is not supported.`);case gG.ARRAY:if(4===f.length)return`vec4(${f[0]}, ${f[1]}, ${f[2]}, ${f[3]})`;if(3===f.length)return`vec3(${f[0]}, ${f[1]}, ${f[2]})`;if(2===f.length)return`vec2(${f[0]}, ${f[1]})`;throw new ye.a("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gG.REGEX:throw new ye.a("Error generating style shader: Regular expressions are not supported.");case gG.VARIABLE_IN_STRING:throw new ye.a("Error generating style shader: Converting a variable to a string is not supported.");case gG.LITERAL_NULL:return _G.NULL_SENTINEL;case gG.LITERAL_BOOLEAN:return f?"true":"false";case gG.LITERAL_NUMBER:return VG(f);case gG.LITERAL_STRING:if(Object(l.a)(n)&&n._type===gG.MEMBER&&("r"===f||"g"===f||"b"===f||"a"===f||"x"===f||"y"===f||"z"===f||"w"===f||zG(n._left)))return f;if(i=sp.fromCssColorString(f,EG),Object(l.a)(i))return function(e){return`vec3(${VG(e.red)}, ${VG(e.green)}, ${VG(e.blue)})`}(i);throw new ye.a("Error generating style shader: String literals are not supported.");case gG.LITERAL_COLOR:if(c=r,"color"===f){if(!Object(l.a)(c))return"vec4(1.0)";if(c.length>1){const e=c[0],n=c[1];return"1.0"!==n&&(t.translucent=!0),`vec4(${e}, ${n})`}return`vec4(${c[0]}, 1.0)`}if("rgb"===f)return i=UG(this),Object(l.a)(i)?HG(i):`vec4(${c[0]} / 255.0, ${c[1]} / 255.0, ${c[2]} / 255.0, 1.0)`;if("rgba"===f)return"1.0"!==c[3]&&(t.translucent=!0),i=UG(this),Object(l.a)(i)?HG(i):`vec4(${c[0]} / 255.0, ${c[1]} / 255.0, ${c[2]} / 255.0, ${c[3]})`;if("hsl"===f)return i=kG(this),Object(l.a)(i)?HG(i):`vec4(czm_HSLToRGB(vec3(${c[0]}, ${c[1]}, ${c[2]})), 1.0)`;if("hsla"===f)return i=kG(this),Object(l.a)(i)?(1!==i.alpha&&(t.translucent=!0),HG(i)):("1.0"!==c[3]&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${c[0]}, ${c[1]}, ${c[2]})), ${c[3]})`);break;case gG.LITERAL_VECTOR:if(!Object(l.a)(r))throw new u.a("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");h=r.length,d=f+"(";for(let e=0;e<h;++e)d+=r[e],e<h-1&&(d+=", ");return d+=")",d;case gG.LITERAL_REGEX:throw new ye.a("Error generating style shader: Regular expressions are not supported.");case gG.LITERAL_UNDEFINED:return _G.NULL_SENTINEL;case gG.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===f)return f}},DG.prototype.getVariables=function(e,t){let n,i,r;const o=this._type,a=this._value;if(Object(l.a)(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(Object(l.a)(this._right)&&this._right.getVariables(e,this),Object(l.a)(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let s;switch(o){case gG.VARIABLE:zG(this)||e.push(a);break;case gG.VARIABLE_IN_STRING:for(s=OG.exec(a);null!==s;)e.push(s[1]),s=OG.exec(a);break;case gG.LITERAL_STRING:Object(l.a)(t)&&t._type===gG.MEMBER&&zG(t._left)&&e.push(a)}};var WG=_G;function YG(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=Object(c.a)(e.center,O.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=sp.clone(sp.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=Object(c.a)(e.classificationType,qN.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};const t=this._batchIds.length;for(let e=0;e<t;++e){const t=this._batchIds[e];this._batchIdLookUp[t]=e}}Object.defineProperties(YG.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});const XG={position:0,a_batchId:1};function KG(e){const t=e?UF.EQUAL:UF.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:HF.KEEP,zFail:HF.DECREMENT_WRAP,zPass:HF.KEEP},backFunction:t,backOperation:{fail:HF.KEEP,zFail:HF.INCREMENT_WRAP,zPass:HF.KEEP},reference:qF.CESIUM_3D_TILE_MASK,mask:qF.CESIUM_3D_TILE_MASK},stencilMask:qF.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:YN.LESS_OR_EQUAL},depthMask:!1}}const JG={stencilTest:{enabled:!0,frontFunction:UF.NOT_EQUAL,frontOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},backFunction:UF.NOT_EQUAL,backOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},reference:0,mask:qF.CLASSIFICATION_MASK},stencilMask:qF.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:SD.PRE_MULTIPLIED_ALPHA_BLEND},ZG={stencilTest:{enabled:!0,frontFunction:UF.NOT_EQUAL,frontOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},backFunction:UF.NOT_EQUAL,backOperation:{fail:HF.ZERO,zFail:HF.ZERO,zPass:HF.ZERO},reference:0,mask:qF.CLASSIFICATION_MASK},stencilMask:qF.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};const $G=new Me,QG=new O;function eq(e,t,n,i,r,o,a){const s=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let l=0;l<c;++l){const c=a[o[l]],u=i[c],h=r[c],d=new e.constructor(e.buffer,s*u,h);t.set(d,n),i[c]=n,n+=h}return n}function tq(e,t,n,i,r,o,a){const s=e.bytesPerIndex,c=o.length;for(let l=0;l<c;++l){const c=a[o[l]],u=i[c],h=r[c];t.copyFromBuffer(e,u*s,n*s,h*s),i[c]=n,n+=h}return n}function nq(e,t){return t.color.toRgba()-e.color.toRgba()}function iq(e,t){if(!e._batchDirty)return!1;const n=e._batchedIndices,i=n.length;let r=!1;const o={};for(let e=0;e<i;++e){const t=n[e].color.toRgba();if(Object(l.a)(o[t])){r=!0;break}o[t]=!0}return r?r&&!e.forceRebatch&&e._framesSinceLastRebatch<120?void++e._framesSinceLastRebatch:(n.sort(nq),t.webgl2?function(e,t){const n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp;let o=t.pop();const a=[o],s=e._va.indexBuffer,c=e._vaSwap.indexBuffer;let l=tq(s,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=l;t.length>0;){const e=t.pop();if(sp.equals(e.color,o.color))l=tq(s,c,l,n,i,e.batchIds,r),o.batchIds=o.batchIds.concat(e.batchIds),o.count=l-o.offset;else{const t=l;l=tq(s,c,l,n,i,e.batchIds,r),e.offset=t,e.count=l-t,a.push(e),o=e}}const u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=a}(e,n):function(e,t){const n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,a=new n.constructor(n.length);let s=t.pop();const c=[s];let l=eq(n,a,0,i,r,s.batchIds,o);for(s.offset=0,s.count=l;t.length>0;){const e=t.pop();if(sp.equals(e.color,s.color))l=eq(n,a,l,i,r,e.batchIds,o),s.batchIds=s.batchIds.concat(e.batchIds),s.count=l-s.offset;else{const t=l;l=eq(n,a,l,i,r,e.batchIds,o),e.offset=t,e.count=l-t,c.push(e),s=e}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=c}(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0):(e._batchDirty=!1,!1)}YG.prototype.createFeatures=function(e,t){const n=this._batchIds,i=n.length;for(let r=0;r<i;++r){const i=n[r];t[i]=new jV(e,i)}},YG.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};const rq=new sp,oq=sp.WHITE,aq=/\$/;function sq(e,t,n,i){const r=e.classificationType,o=r!==qN.CESIUM_3D_TILE,a=r!==qN.TERRAIN,s=t.commandList;let c,u,h=n.length;for(u=0;u<h;++u)o&&(c=n[u],c.pass=KR.TERRAIN_CLASSIFICATION,s.push(c)),a&&(c=n[u].derivedCommands.tileset,c.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,s.push(c));if(t.invertClassification&&Object(l.a)(i))for(h=i.length,u=0;u<h;++u)s.push(i[u])}YG.prototype.applyStyle=function(e,t){if(!Object(l.a)(e))return void function(e,t){e._updatingAllCommands=!0;const n=e._batchIds;let i,r=n.length;for(i=0;i<r;++i){const e=t[n[i]];e.show=!0,e.color=sp.WHITE}const o=e._batchedIndices;for(r=o.length,i=0;i<r;++i)o[i].color=sp.clone(sp.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}(this,t);const n=e.color,i=n instanceof WG&&!aq.test(n.expression);this._updatingAllCommands=i;const r=this._batchIds;let o,a=r.length;for(o=0;o<a;++o){const n=t[r[o]];n.color=Object(l.a)(e.color)?e.color.evaluateColor(n,rq):oq,n.show=!Object(l.a)(e.show)||e.show.evaluate(n)}if(i){const e=this._batchedIndices;for(a=e.length,o=0;o<a;++o)e[o].color=sp.clone(sp.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}},YG.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;const n=this._batchIdLookUp,i=n[e];if(!Object(l.a)(i))return;const r=this._indexOffsets,o=this._indexCounts,a=r[i],s=o[i],c=this._batchedIndices,u=c.length;let h;for(h=0;h<u;++h){const e=c[h].offset,t=c[h].count;if(a>=e&&a<e+t)break}c.push(new dG({color:sp.clone(t),offset:a,count:s,batchIds:[e]}));const d=[],f=[],p=c[h].batchIds,m=p.length;for(let t=0;t<m;++t){const i=p[t];if(i===e)continue;r[n[i]]<a?d.push(i):f.push(i)}0!==f.length&&c.push(new dG({color:sp.clone(c[h].color),offset:a+s,count:c[h].offset+c[h].count-(a+s),batchIds:f})),0!==d.length?(c[h].count=a-c[h].offset,c[h].batchIds=d):c.splice(h,1),this._batchDirty=!0},YG.prototype.update=function(e){const t=e.context;var n;!function(e,t){if(Object(l.a)(e._va))return;const n=ZN.createVertexBuffer({context:t,typedArray:e._positions,usage:KN.STATIC_DRAW}),i=ZN.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:KN.STATIC_DRAW}),r=ZN.createIndexBuffer({context:t,typedArray:e._indices,usage:KN.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?wc.UNSIGNED_SHORT:wc.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:gs.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:gs.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new iB({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new iB({context:t,attributes:o,indexBuffer:ZN.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:KN.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0}(this,t),function(e,t){if(Object(l.a)(e._sp))return;const n=e._batchTable,i=Object(c.a)(e._attributeLocations,XG);let r=e._pickId;const o=e._vertexShaderSource;let a=e._fragmentShaderSource;if(Object(l.a)(o))return e._sp=oM.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:i}),e._spStencil=e._sp,a=UN.replaceMain(a,"czm_non_pick_main"),a=a+"void main() \n{ \n    czm_non_pick_main(); \n"+`    gl_FragColor = ${r}; \n} \n`,void(e._spPick=oM.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:i}));const s=n.getVertexShaderCallback(!1,"a_batchId",void 0)(fG);let u=n.getFragmentShaderCallback(!1,void 0,!0)(HN);r=n.getPickId();let h=new UN({sources:[s]}),d=new UN({defines:["VECTOR_TILE"],sources:[u]});e._sp=oM.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:i}),h=new UN({sources:[fG]}),d=new UN({defines:["VECTOR_TILE"],sources:[HN]}),e._spStencil=oM.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:i}),u=UN.replaceMain(u,"czm_non_pick_main"),u=u+"\nvoid main() \n{ \n    czm_non_pick_main(); \n"+`    gl_FragColor = ${r}; \n} \n`;const f=new UN({sources:[s]}),p=new UN({defines:["VECTOR_TILE"],sources:[u]});e._spPick=oM.fromCache({context:t,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:i})}(this,t),n=this,Object(l.a)(n._rsStencilDepthPass)||(n._rsStencilDepthPass=vj.fromCache(KG(!1)),n._rsStencilDepthPass3DTiles=vj.fromCache(KG(!0)),n._rsColorPass=vj.fromCache(JG),n._rsPickPass=vj.fromCache(ZG)),function(e,t){if(Object(l.a)(e._uniformMap))return;const n={u_modifiedModelViewProjection:function(){const n=t.uniformState.view,i=t.uniformState.projection;return Me.clone(n,$G),Me.multiplyByPoint($G,e._center,QG),Me.setTranslation($G,QG,$G),Me.multiply(i,$G,$G),$G},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}(this,t);const i=e.passes;i.render&&(function(e,t){const n=iq(e,t),i=e._commands,r=e._batchedIndices,o=r.length,a=2*o;if(Object(l.a)(i)&&!n&&i.length===a)return;i.length=a;const s=e._va,u=e._sp,h=Object(c.a)(e._modelMatrix,Me.IDENTITY),d=e._uniformMap,f=e._boundingVolume;for(let t=0;t<o;++t){const n=r[t].offset,o=r[t].count;let a=i[2*t];Object(l.a)(a)||(a=i[2*t]=new XR({owner:e})),a.vertexArray=s,a.modelMatrix=h,a.offset=n,a.count=o,a.renderState=e._rsStencilDepthPass,a.shaderProgram=u,a.uniformMap=d,a.boundingVolume=f,a.cull=!1,a.pass=KR.TERRAIN_CLASSIFICATION;const c=XR.shallowClone(a,a.derivedCommands.tileset);c.renderState=e._rsStencilDepthPass3DTiles,c.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=c;let p=i[2*t+1];Object(l.a)(p)||(p=i[2*t+1]=new XR({owner:e})),p.vertexArray=s,p.modelMatrix=h,p.offset=n,p.count=o,p.renderState=e._rsColorPass,p.shaderProgram=u,p.uniformMap=d,p.boundingVolume=f,p.cull=!1,p.pass=KR.TERRAIN_CLASSIFICATION;const m=XR.shallowClone(p,p.derivedCommands.tileset);m.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=m}e._commandsDirty=!0}(this,t),function(e,t){if(e.classificationType===qN.TERRAIN||!t.invertClassification||Object(l.a)(e._commandsIgnoreShow)&&!e._commandsDirty)return;const n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,a=i.length=o/2;let s=0;for(let e=0;e<a;++e){const t=i[e]=XR.shallowClone(n[s],i[e]);t.shaderProgram=r,t.pass=KR.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=2}e._commandsDirty=!1}(this,e),function(e){let t,n,i=e.debugWireframe===e._debugWireframe;if(i=i&&!(e.debugWireframe&&e._wireframeDirty),i)return;Object(l.a)(e._rsWireframe)||(e._rsWireframe=vj.fromCache({})),e.debugWireframe?(t=e._rsWireframe,n=zl.LINES):(t=e._rsColorPass,n=zl.TRIANGLES);const r=e._commands,o=r.length;for(let e=0;e<o;e+=2){const i=r[e+1];i.renderState=t,i.primitiveType=n}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}(this),this._debugWireframe?function(e,t){const n=e.commandList,i=t.length;for(let e=0;e<i;e+=2){const i=t[e+1];i.pass=KR.OPAQUE,n.push(i)}}(e,this._commands):sq(this,e,this._commands,this._commandsIgnoreShow)),i.pick&&(!function(e){if(!e._pickCommandsDirty)return;const t=e._indexOffsets.length,n=e._pickCommands;n.length=2*t;const i=e._va,r=e._spStencil,o=e._spPick,a=Object(c.a)(e._modelMatrix,Me.IDENTITY),s=e._uniformMap;for(let c=0;c<t;++c){const t=e._indexOffsets[c],u=e._indexCounts[c],h=Object(l.a)(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume;let d=n[2*c];Object(l.a)(d)||(d=n[2*c]=new XR({owner:e,pickOnly:!0})),d.vertexArray=i,d.modelMatrix=a,d.offset=t,d.count=u,d.renderState=e._rsStencilDepthPass,d.shaderProgram=r,d.uniformMap=s,d.boundingVolume=h,d.pass=KR.TERRAIN_CLASSIFICATION;const f=XR.shallowClone(d,d.derivedCommands.tileset);f.renderState=e._rsStencilDepthPass3DTiles,f.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=f;let p=n[2*c+1];Object(l.a)(p)||(p=n[2*c+1]=new XR({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=a,p.offset=t,p.count=u,p.renderState=e._rsPickPass,p.shaderProgram=o,p.uniformMap=s,p.boundingVolume=h,p.pass=KR.TERRAIN_CLASSIFICATION;const m=XR.shallowClone(p,p.derivedCommands.tileset);m.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=m}e._pickCommandsDirty=!1}(this),sq(this,e,this._pickCommands))},YG.prototype.isDestroyed=function(){return!1},YG.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),sc(this)};var cq=YG;const lq=new O,uq=nG.ModelState;function hq(e){let t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),!(t instanceof Uint8Array))throw new ye.a("Only binary glTF is supported as a classifier.");t=JV(t),PH(t),GV(t),rG(t),hG(t),kV.buffer(t,(function(e){if(!Object(l.a)(e.extras._pipeline.source))throw new ye.a("Buffer data must be embedded in the binary gltf.")}));const n=t.nodes,i=t.meshes,r=n[0].mesh;if(1!==n.length||!Object(l.a)(r))throw new ye.a("Only one node is supported for classification and it must have a mesh.");if(1!==i.length)throw new ye.a("Only one mesh is supported when using b3dm for classification.");const o=i[0].primitives;if(1!==o.length)throw new ye.a("Only one primitive per mesh is supported when using b3dm for classification.");const a=o[0].attributes.POSITION;if(!Object(l.a)(a))throw new ye.a("The mesh must have a position attribute.");const s=o[0].attributes._BATCHID;if(!Object(l.a)(s))throw new ye.a("The mesh must have a batch id attribute.");this._gltf=t,this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=Me.clone(this.modelMatrix),this._ready=!1;const u=this;this._readyPromise=new Promise(e=>{u._completeLoad=t=>{t.afterRender.push((function(){u._ready=!0,e(u)}))}}),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Object(c.a)(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=Object(c.a)(e.ignoreCommands,!1),this._upAxis=Object(c.a)(e.upAxis,HU.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new Me,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new At,this._state=uq.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new Me,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function dq(e,t){const n=t._loadResources,i=t.gltf.bufferViews[e],r=n.getBuffer(i);t._buffers[e]=r,t._geometryByteLength+=r.byteLength}function fq(e,t,n){const i=n._loadResources,r=n.gltf.bufferViews[e],o={typedArray:i.getBuffer(r),indexDatatype:t};n._buffers[e]=o,n._geometryByteLength+=o.typedArray.byteLength}function pq(e,t){return Object(l.a)(t)&&(e=t(e)),e}function mq(e){const t=e.gltf,n=nG.getAttributeOrUniformBySemantic(t,"POSITION"),i=nG.getAttributeOrUniformBySemantic(t,"_BATCHID"),r={};r[n]=0,r[i]=1;const o=nG.getAttributeOrUniformBySemantic(t,"MODELVIEWPROJECTION");let a,s;if(Object(l.a)(o))a=`uniform mat4 ${o};\n`,s=`${o} * vec4(${n}, 1.0)`;else{const e=nG.getAttributeOrUniformBySemantic(t,"PROJECTION");let i=nG.getAttributeOrUniformBySemantic(t,"MODELVIEW");Object(l.a)(i)||(i=nG.getAttributeOrUniformBySemantic(t,"CESIUM_RTC_MODELVIEW")),a=`uniform mat4 ${i};\nuniform mat4 ${e};\n`,s=`${e} * ${i} * vec4(${n}, 1.0)`}let c=`attribute vec3 ${n};\nattribute float ${i};\n${a}void main() {\n${`    vec4 positionInClipCoords = ${s};\n`}    gl_Position = czm_depthClamp(positionInClipCoords);\n}\n`;e.extensionsUsed.WEB3D_quantized_attributes&&(c=function(e,t){const n=t.gltf.meshes[0].primitives[0],i=nG.modifyShaderForQuantizedAttributes(t.gltf,n,e);return t._quantizedUniforms=i.uniforms,i.shader}(c,e));const u=pq(c,e._vertexShaderLoaded),h=pq("#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n    gl_FragColor = vec4(1.0); \n    czm_writeDepthClamp();\n}\n",e._classificationShaderLoaded);e._shaderProgram={vertexShaderSource:u,fragmentShaderSource:h,attributeLocations:r}}Object.defineProperties(hq.prototype,{gltf:{get:function(){return this._gltf}},gltfInternal:{get:function(){return this._gltf}},boundingSphere:{get:function(){if(this._state!==uq.LOADED)throw new u.a("The model is not loaded.  Use ClassificationModel.readyPromise or wait for ClassificationModel.ready to be true.");const e=this.modelMatrix,t=Me.getScale(e,lq),n=this._scaledBoundingSphere;return n.center=O.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=O.maximumComponent(t)*this._initialRadius,Object(l.a)(this._rtcCenter)&&O.add(this._rtcCenter,n.center,n.center),n}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return Object(l.a)(this._extensionsUsed)||(this._extensionsUsed=nG.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return Object(l.a)(this._extensionsRequired)||(this._extensionsRequired=nG.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});const gq={PROJECTION:function(e,t){return nG.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return nG.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return nG.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return nG.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}};function _q(e){const t=e._batchTable;let n=e._uniformMap;const i=e._vertexArray,r=e.gltf,o=r.accessors,a=r.meshes[0].primitives[0],s=o[a.indices],c=a.attributes.POSITION,u=nG.getAccessorMinMax(r,c),h=At.fromCornerPoints(O.fromArray(u.min),O.fromArray(u.max));let d,f;if(Object(l.a)(s))f=s.count,d=s.byteOffset/wc.getSizeInBytes(s.componentType);else{f=o[a.attributes.POSITION].count,d=0}if(e._trianglesLength+=function(e,t){switch(e.mode){case zl.TRIANGLES:return t/3;case zl.TRIANGLE_STRIP:case zl.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}(a,f),Object(l.a)(e._uniformMapLoaded)&&(n=e._uniformMapLoaded(n)),e.extensionsUsed.WEB3D_quantized_attributes){const t=function(e,t){return nG.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}(e,a);n=Object(up.a)(n,t)}let p=i.attributes.POSITION,m=p.componentDatatype,g=p.vertexBuffer,_=g.byteOffset,y=g.byteLength/gs.getSizeInBytes(m),b=gs.createArrayBufferView(m,g.buffer,_,y);p=i.attributes._BATCHID,m=p.componentDatatype,g=p.vertexBuffer,_=g.byteOffset,y=g.byteLength/gs.getSizeInBytes(m);let v=gs.createArrayBufferView(m,g.buffer,_,y);const w=i.indexBuffer.typedArray;let A;A=i.indexBuffer.indexDatatype===wc.UNSIGNED_SHORT?new Uint16Array(w.buffer,w.byteOffset,w.byteLength/Uint16Array.BYTES_PER_ELEMENT):new Uint32Array(w.buffer,w.byteOffset,w.byteLength/Uint32Array.BYTES_PER_ELEMENT),b=b.slice(),v=v.slice(),A=A.slice(d,d+f);const E=[],T=[],C=[],x=[];let S,I,P,D=v[A[0]];E.push(D),C.push(0);const R=A.length;for(let e=1;e<R;++e)S=v[A[e]],S!==D&&(I=C[C.length-1],P=e-I,E.push(S),T.push(P),C.push(e),x.push(new dG({offset:I,count:P,batchIds:[D],color:sp.WHITE})),D=S);I=C[C.length-1],P=R-I,T.push(P),x.push(new dG({offset:I,count:P,batchIds:[D],color:sp.WHITE}));const j=e._shaderProgram,M=j.vertexShaderSource,L=j.fragmentShaderSource,N=j.attributeLocations,B=Object(l.a)(e._pickIdLoaded)?e._pickIdLoaded():void 0;e._primitive=new cq({classificationType:e._classificationType,positions:b,indices:A,indexOffsets:C,indexCounts:T,batchIds:E,vertexBatchIds:v,batchedIndices:x,batchTable:t,boundingVolume:new At,_vertexShaderSource:M,_fragmentShaderSource:L,_attributeLocations:N,_uniformMap:n,_pickId:B,_modelMatrix:new Me,_boundingSphere:h}),e._buffers=void 0,e._vertexArray=void 0,e._shaderProgram=void 0,e._uniformMap=void 0}function yq(e,t){const n=t.context;nG.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,n),function(e){const t=e._loadResources;if(0!==t.pendingBufferLoads)return;const n=t.vertexBuffersToCreate,i=t.indexBuffersToCreate;for(;n.length>0;)dq(n.dequeue(),e);for(;i.length>0;){const t=i.dequeue();fq(t.id,t.componentType,e)}}(e),mq(e),function(e){if(!e._loadResources.finishedBuffersCreation()||Object(l.a)(e._vertexArray))return;const t=e._buffers,n=e.gltf,i=n.accessors,r=n.meshes[0].primitives[0],o={POSITION:0,_BATCHID:1},a={};let s;if(kV.meshPrimitiveAttribute(r,(function(e,r){const s=o[r];if(Object(l.a)(s)){const o=i[e];a[r]={index:s,vertexBuffer:t[o.bufferView],componentsPerAttribute:UV(o.type),componentDatatype:o.componentType,offsetInBytes:o.byteOffset,strideInBytes:VV(n,o)}}})),Object(l.a)(r.indices)){const e=i[r.indices];s=t[e.bufferView]}e._vertexArray={attributes:a,indexBuffer:s}}(e),function(e,t){if(Object(l.a)(e._uniformMap))return;const n={};kV.technique(e.gltf,(function(i){kV.techniqueUniform(i,(function(i,r){Object(l.a)(i.semantic)&&Object(l.a)(gq[i.semantic])&&(n[r]=gq[i.semantic](t.uniformState,e))}))})),e._uniformMap=n}(e,n),function(e){if(!e._loadResources.finished())return;if(Object(l.a)(e._primitive))return;const t=e.gltf.nodes[0];e._nodeMatrix=nG.getTransform(t,e._nodeMatrix),_q(e)}(e)}const bq=new _e,vq=new Me;hq.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},hq.prototype.update=function(e){if(e.mode===AB.MORPHING)return;if(!Jr.supportsWebP.initialized)return void Jr.supportsWebP.initialize();const t=Jr.supportsWebP();if(this._state===uq.NEEDS_LOAD&&Object(l.a)(this.gltf)&&(this._state=uq.LOADING,this._state!==uq.FAILED)){const t=this.gltf.extensions;if(Object(l.a)(t)&&Object(l.a)(t.CESIUM_RTC)){const n=O.fromArray(t.CESIUM_RTC.center);if(!O.equals(n,O.ZERO)){this._rtcCenter3D=n;const t=e.mapProjection,i=t.ellipsoid.cartesianToCartographic(this._rtcCenter3D),r=t.project(i);O.fromElements(r.z,r.x,r.y,r),this._rtcCenter2D=r,this._rtcCenterEye=new O,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new RH,nG.parseBuffers(this)}const n=this._loadResources;let i=!1;this._state===uq.LOADING&&(0===n.pendingBufferLoads&&(nG.checkSupportedExtensions(this.extensionsRequired,t),function(e){const t=e.gltf,n=e._loadResources;kV.buffer(t,(function(e,t){n.buffers[t]=e.extras._pipeline.source}))}(this),function(e){const t=e.gltf.bufferViews,n=e._loadResources.vertexBuffersToCreate;kV.bufferView(e.gltf,(function(e,t){e.target===ps.ARRAY_BUFFER&&n.enqueue(t)}));const i=e._loadResources.indexBuffersToCreate,r={};kV.accessor(e.gltf,(function(e){const n=e.bufferView;t[n].target!==ps.ELEMENT_ARRAY_BUFFER||Object(l.a)(r[n])||(r[n]=!0,i.enqueue({id:n,componentType:e.componentType}))}))}(this),this._boundingSphere=nG.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,yq(this,e)),n.finished()&&(this._state=uq.LOADED,i=!0)),Object(l.a)(n)&&this._state===uq.LOADED&&(i||yq(this,e),n.finished()&&(this._loadResources=void 0));const r=this.show;if(r&&this._state===uq.LOADED||i){this._dirty=!1;const t=this.modelMatrix,n=e.mode!==this._mode;this._mode=e.mode;const r=!Me.equals(this._modelMatrix,t)||n;if(r||i){Me.clone(t,this._modelMatrix);const e=this._computedModelMatrix;Me.clone(t,e),this._upAxis===HU.Y?Me.multiplyTransformation(e,HU.Y_UP_TO_Z_UP,e):this._upAxis===HU.X&&Me.multiplyTransformation(e,HU.X_UP_TO_Z_UP,e)}(r||i)&&(!function(e,t,n,i){let r=e._computedModelMatrix;if(e._mode!==AB.SCENE3D&&!e._ignoreCommands){const t=Me.getColumn(r,3,bq);if(_e.equals(t,_e.UNIT_W)){const t=e.boundingSphereInternal.center,n=ca.wgs84To2DModelMatrix(i,t,vq);r=Me.multiply(n,r,vq),Object(l.a)(e._rtcCenter)&&(Me.setTranslation(r,_e.UNIT_W,r),e._rtcCenter=e._rtcCenter2D)}else r=ca.basisTo2D(i,r,vq),e._rtcCenter=e._rtcCenter3D}const o=e._primitive;(t||n)&&(Me.multiplyTransformation(r,e._nodeMatrix,o._modelMatrix),At.transform(o._boundingSphere,o._modelMatrix,o._boundingVolume),Object(l.a)(e._rtcCenter)&&O.add(e._rtcCenter,o._boundingVolume.center,o._boundingVolume.center))}(this,r,i,e.mapProjection),this._dirty=!0)}i?this._completeLoad(e):r&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))},hq.prototype.isDestroyed=function(){return!1},hq.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),sc(this)};var Oq=hq;function wq(e,t){s.a.typeOf.object("normal",e),s.a.typeOf.number("distance",t),this._distance=t,this._normal=new Aq(e,this),this.onChangeCallback=void 0,this.index=-1}function Aq(e,t){this._clippingPlane=t,this._cartesian3=O.clone(e)}Object.defineProperties(wq.prototype,{distance:{get:function(){return this._distance},set:function(e){s.a.typeOf.number("value",e),Object(l.a)(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){s.a.typeOf.object("value",e),Object(l.a)(this.onChangeCallback)&&!O.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),O.clone(e,this._normal._cartesian3)}}}),wq.fromPlane=function(e,t){return s.a.typeOf.object("plane",e),Object(l.a)(t)?(t.normal=e.normal,t.distance=e.distance):t=new wq(e.normal,e.distance),t},wq.clone=function(e,t){return Object(l.a)(t)?(t.normal=e.normal,t.distance=e.distance,t):new wq(e.normal,e.distance)},Object.defineProperties(Aq.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){s.a.typeOf.number("value",e),Object(l.a)(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){s.a.typeOf.number("value",e),Object(l.a)(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){s.a.typeOf.number("value",e),Object(l.a)(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var Eq=wq;function Tq(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=Object(c.a)(e.enabled,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this.edgeColor=sp.clone(Object(c.a)(e.edgeColor,sp.WHITE)),this.edgeWidth=Object(c.a)(e.edgeWidth,0),this.planeAdded=new un.a,this.planeRemoved=new un.a,this._owner=void 0;const t=Object(c.a)(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?Cq:xq,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;const n=e.planes;if(Object(l.a)(n)){const e=n.length;for(let t=0;t<e;++t)this.add(n[t])}}function Cq(e){return e===W.OUTSIDE}function xq(e){return e===W.INSIDE}function Sq(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||-1!==e._dirtyIndex&&e._dirtyIndex!==t,e._dirtyIndex=t}function Iq(e,t){const n=e.length;for(let i=0;i<n;++i)if(xi.equals(e[i],t))return i;return-1}Object.defineProperties(Tq.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Cq:xq)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}}),Tq.prototype.add=function(e){const t=this._planes.length,n=this;e.onChangeCallback=function(e){Sq(n,e)},e.index=t,Sq(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)},Tq.prototype.get=function(e){return s.a.typeOf.number("index",e),this._planes[e]},Tq.prototype.contains=function(e){return-1!==Iq(this._planes,e)},Tq.prototype.remove=function(e){const t=this._planes,n=Iq(t,e);if(-1===n)return!1;e instanceof Eq&&(e.onChangeCallback=void 0,e.index=-1);const i=t.length-1;for(let e=n;e<i;++e){const n=t[e+1];t[e]=n,n instanceof Eq&&(n.index=e)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0},Tq.prototype.removeAll=function(){const e=this._planes,t=e.length;for(let n=0;n<t;++n){const t=e[n];t instanceof Eq&&(t.onChangeCallback=void 0,t.index=-1),this.planeRemoved.raiseEvent(t,n)}this._multipleDirtyPlanes=!0,this._planes=[]};const Pq=new _e,Dq=new _e;function Rq(e,t,n){const i=e._uint8View,r=e._planes;let o=0;for(let e=t;e<n;++e){const t=r[e],n=js.octEncodeToCartesian4(t.normal,Dq);i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w;const a=_e.packFloat(t.distance,Pq);i[o+4]=a.x,i[o+5]=a.y,i[o+6]=a.z,i[o+7]=a.w,o+=8}}function jq(e,t,n){const i=e._float32View,r=e._planes;let o=0;for(let e=t;e<n;++e){const t=r[e],n=t.normal;i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=t.distance,o+=4}}function Mq(e,t){const n=MD.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}const Lq=new Vt;Tq.prototype.update=function(e){let t=this._clippingPlanesTexture;const n=e.context,i=Tq.useFloatTexture(n),r=i?this.length:2*this.length;if(Object(l.a)(t)){const e=t.width*t.height;(e<r||r<.25*e)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(0===this.length)return;if(!Object(l.a)(t)){const e=Mq(r,Lq);e.y*=2,i?(t=new JD({context:n,width:e.x,height:e.y,pixelFormat:aT.RGBA,pixelDatatype:rT.FLOAT,sampler:WD.NEAREST,flipY:!1}),this._float32View=new Float32Array(e.x*e.y*4)):(t=new JD({context:n,width:e.x,height:e.y,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,sampler:WD.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(e.x*e.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}const o=this._dirtyIndex;if(this._multipleDirtyPlanes||-1!==o){if(this._multipleDirtyPlanes)i?(jq(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Rq(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let e=0,n=0;i?(n=Math.floor(o/t.width),e=Math.floor(o-n*t.width),jq(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:e,yOffset:n})):(n=Math.floor(2*o/t.width),e=Math.floor(2*o-n*t.width),Rq(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:e,yOffset:n}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};const Nq=new Me,Bq=new xi(O.UNIT_X,0);Tq.prototype.computeIntersectionWithBoundingVolume=function(e,t){const n=this._planes,i=n.length;let r=this.modelMatrix;Object(l.a)(t)&&(r=Me.multiply(t,r,Nq));let o=W.INSIDE;!this.unionClippingRegions&&i>0&&(o=W.OUTSIDE);for(let t=0;t<i;++t){const i=n[t];xi.transform(i,r,Bq);const a=e.intersectPlane(Bq);if(a===W.INTERSECTING)o=a;else if(this._testIntersection(a))return a}return o},Tq.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),Object(l.a)(e))){if(Object(l.a)(e._owner))throw new u.a("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[n]=e}},Tq.useFloatTexture=function(e){return e.floatingPointTexture},Tq.getTextureResolution=function(e,t,n){const i=e.texture;if(Object(l.a)(i))return n.x=i.width,n.y=i.height,n;const r=Mq(Tq.useFloatTexture(t)?e.length:2*e.length,n);return r.y*=2,r},Tq.prototype.isDestroyed=function(){return!1},Tq.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),sc(this)};var Fq=Tq;const zq={HIGHLIGHT:0,REPLACE:1,MIX:2,getColorBlend:function(e,t){return e===zq.HIGHLIGHT?0:e===zq.REPLACE?1:e===zq.MIX?h.a.clamp(t,h.a.EPSILON4,1):void 0}};var kq=Object.freeze(zq);function Uq(){}function Vq(e,t){const n="runtime."+Object.keys(e.createdBufferViews).length,i=e.buffers,r=Object.keys(i).length;return i[r]=t,e.createdBufferViews[n]={buffer:r,byteOffset:0,byteLength:t.byteLength},n}function Hq(e,t,n){const i=t._loadResources,r=Vq(i,e);return i.vertexBuffersToCreate.enqueue(r),r}function Gq(e,t,n,i){if(!Uq._taskProcessorReady)return;const r=n.primitivesToDecode.peek();if(!Object(l.a)(r))return;const o=e.scheduleTask(r,[r.array.buffer]);return Object(l.a)(o)?(n.activeDecodingTasks++,n.primitivesToDecode.dequeue(),o.then((function(e){n.activeDecodingTasks--;const i=function(e,t,n){const i=e.typedArray,r=t._loadResources,o=Vq(r,i);return r.indexBuffersToCreate.enqueue({id:o,componentType:gs.fromTypedArray(i)}),{bufferViewId:o,numberOfIndices:e.numberOfIndices}}(e.indexArray,t),o={},a=e.attributeData;for(const e in a)if(a.hasOwnProperty(e)){const n=a[e],i=Hq(n.array,t),r=n.data;r.bufferView=i,o[e]=r}t._decodedData[`${r.mesh}.primitive.${r.primitive}`]={bufferView:i.bufferViewId,numberOfIndices:i.numberOfIndices,attributes:o}}))):void 0}Uq._maxDecodingConcurrency=Math.max(Jr.hardwareConcurrency-1,1),Uq._decoderTaskProcessor=void 0,Uq._taskProcessorReady=!1,Uq._getDecoderTaskProcessor=function(){if(!Object(l.a)(Uq._decoderTaskProcessor)){const e=new _c("decodeDraco",Uq._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then((function(){Uq._taskProcessorReady=!0})),Uq._decoderTaskProcessor=e}return Uq._decoderTaskProcessor},Uq.hasExtension=function(e){return Object(l.a)(e.extensionsRequired.KHR_draco_mesh_compression)||Object(l.a)(e.extensionsUsed.KHR_draco_mesh_compression)},Uq._decodedModelResourceCache=void 0,Uq.parse=function(e,t){if(!Uq.hasExtension(e))return;const n=e._loadResources,i=e.cacheKey;if(Object(l.a)(i)){Object(l.a)(Uq._decodedModelResourceCache)||(Object(l.a)(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),Uq._decodedModelResourceCache=t.cache.modelDecodingCache);const e=Uq._decodedModelResourceCache[i];if(Object(l.a)(e))return e.count++,void(n.pendingDecodingCache=!0)}const r=e._dequantizeInShader,o=e.gltfInternal;kV.mesh(o,(function(e,t){kV.meshPrimitive(e,(function(e,i){if(!Object(l.a)(e.extensions))return;const a=e.extensions.KHR_draco_mesh_compression;if(!Object(l.a)(a))return;const s=o.bufferViews[a.bufferView],c=o.buffers[s.buffer].extras._pipeline.source.slice(s.byteOffset,s.byteOffset+s.byteLength);n.primitivesToDecode.enqueue({mesh:t,primitive:i,array:c,bufferView:s,compressedAttributes:a.attributes,dequantizeInShader:r})}))}))},Uq.decodeModel=function(e,t){if(!Uq.hasExtension(e))return Promise.resolve();const n=e._loadResources,i=e.cacheKey;if(Object(l.a)(i)&&Object(l.a)(Uq._decodedModelResourceCache)){const t=Uq._decodedModelResourceCache[i];if(Object(l.a)(t)&&n.pendingDecodingCache)return Promise.resolve(t.ready).then((function(){e._decodedData=t.data,n.pendingDecodingCache=!1}));Uq._decodedModelResourceCache[i]={ready:!1,count:1,data:void 0}}if(0===n.primitivesToDecode.length)return Promise.resolve();const r=Uq._getDecoderTaskProcessor(),o=[];let a=Gq(r,e,n);for(;Object(l.a)(a);)o.push(a),a=Gq(r,e,n);return Promise.all(o)},Uq.decodePointCloud=function(e){const t=Uq._getDecoderTaskProcessor();if(Uq._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},Uq.decodeBufferView=function(e){const t=Uq._getDecoderTaskProcessor();if(Uq._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])},Uq.cacheDataForModel=function(e){const t=e.cacheKey;if(Object(l.a)(t)&&Object(l.a)(Uq._decodedModelResourceCache)){const n=Uq._decodedModelResourceCache[t];Object(l.a)(n)&&(n.ready=!0,n.data=e._decodedData)}},Uq.destroyCachedDataForModel=function(e){const t=e.cacheKey;if(Object(l.a)(t)&&Object(l.a)(Uq._decodedModelResourceCache)){const e=Uq._decodedModelResourceCache[t];Object(l.a)(e)&&0==--e.count&&delete Uq._decodedModelResourceCache[t]}};var qq=Uq;var Wq=function(e,t,n){return s.a.typeOf.string("samplerUniformName",e),s.a.typeOf.string("matrixUniformName",t),s.a.typeOf.string("styleUniformName",n),`    float clipDistance = clip(gl_FragCoord, ${e}, ${t}); \n    vec4 clippingPlanesEdgeColor = vec4(1.0); \n    clippingPlanesEdgeColor.rgb = ${n}.rgb; \n    float clippingPlanesEdgeWidth = ${n}.a; \n    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n    { \n        gl_FragColor = clippingPlanesEdgeColor;\n    } \n`};const Yq=new Vt;var Xq=function(e,t){s.a.typeOf.object("clippingPlaneCollection",e),s.a.typeOf.object("context",t);const n=e.unionClippingRegions,i=e.length,r=Fq.useFloatTexture(t),o=Fq.getTextureResolution(e,t,Yq),a=o.x,c=o.y;let l=r?function(e,t){const n=1/t;let i=""+1/e;-1===i.indexOf(".")&&(i+=".0");let r=""+n;-1===r.indexOf(".")&&(r+=".0");return`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n    int pixY = clippingPlaneNumber / ${e};\n    int pixX = clippingPlaneNumber - (pixY * ${e});\n    float u = (float(pixX) + 0.5) * ${i};\n    float v = (float(pixY) + 0.5) * ${r};\n    vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n    return czm_transformPlane(plane, transform);\n}\n`}(a,c):function(e,t){const n=1/t;let i=""+1/e;-1===i.indexOf(".")&&(i+=".0");let r=""+n;-1===r.indexOf(".")&&(r+=".0");return`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n    int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n    int pixY = clippingPlaneStartIndex / ${e};\n    int pixX = clippingPlaneStartIndex - (pixY * ${e});\n    float u = (float(pixX) + 0.5) * ${i};\n    float v = (float(pixY) + 0.5) * ${r};\n    vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n    vec4 plane;\n    plane.xyz = czm_octDecode(oct, 65535.0);\n    plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + ${i}, v)));\n    return czm_transformPlane(plane, transform);\n}\n`}(a,c);return l+="\n",l+=n?function(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n    vec4 position = czm_windowToEyeCoordinates(fragCoord);\n    vec3 clipNormal = vec3(0.0);\n    vec3 clipPosition = vec3(0.0);\n    float clipAmount;\n    float pixelWidth = czm_metersPerPixel(position);\n    bool breakAndDiscard = false;\n    for (int i = 0; i < ${e}; ++i)\n    {\n        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n        clipNormal = clippingPlane.xyz;\n        clipPosition = -clippingPlane.w * clipNormal;\n        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n        if (amount <= 0.0)\n        {\n           breakAndDiscard = true;\n           break;\n        }\n    }\n    if (breakAndDiscard) {\n        discard;\n    }\n    return clipAmount;\n}\n`}(i):function(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n    bool clipped = true;\n    vec4 position = czm_windowToEyeCoordinates(fragCoord);\n    vec3 clipNormal = vec3(0.0);\n    vec3 clipPosition = vec3(0.0);\n    float clipAmount = 0.0;\n    float pixelWidth = czm_metersPerPixel(position);\n    for (int i = 0; i < ${e}; ++i)\n    {\n        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n        clipNormal = clippingPlane.xyz;\n        clipPosition = -clippingPlane.w * clipNormal;\n        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n        clipAmount = max(amount, clipAmount);\n        clipped = clipped && (amount <= 0.0);\n    }\n    if (clipped)\n    {\n        discard;\n    }\n    return clipAmount;\n}\n`}(i),l};var Kq=Object.freeze({TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3});function Jq(){}const Zq=/^data\:/i;function $q(e,t){const n=e.gltfInternal,i=n.buffers,r=n.bufferViews[t.bufferView],o=i[r.buffer],a=r.byteOffset+t.byteOffset,s=t.count*UV(t.type),c=Zq.test(o.uri)?"":o.uri;return`${e.cacheKey}//${c}/${a}/${s}`}const Qq={};Jq.getAnimationParameterValues=function(e,t){const n=$q(e,t);let i=Qq[n];if(!Object(l.a)(i)){const r=e.gltfInternal,o=r.buffers,a=r.bufferViews[t.bufferView],s=o[a.buffer].extras._pipeline.source,u=t.componentType,h=t.type,d=UV(h),f=t.count,p=VV(r,t);i=new Array(f);const m=Object(c.a)(t.byteOffset,0);let g=a.byteOffset+m;for(let e=0;e<f;e++){const t=gs.createArrayBufferView(u,s.buffer,s.byteOffset+g,d);"SCALAR"===h?i[e]=t[0]:"VEC3"===h?i[e]=O.fromArray(t):"VEC4"===h&&(i[e]=To.unpack(t)),g+=p}Object(l.a)(e.cacheKey)&&(Qq[n]=i)}return i};const eW={};function tW(e){this._spline=e,this._lastTimeIndex=0}tW.prototype.findTimeInterval=wu.prototype.findTimeInterval,tW.prototype.evaluate=function(e,t){const n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),i=this._spline.times,r=e>=i[n+1]?i[n+1]:i[n];return this._spline.evaluate(r,t)},Object.defineProperties(tW.prototype,{times:{get:function(){return this._spline.times}}}),tW.prototype.wrapTime=function(e){return this._spline.wrapTime(e)},tW.prototype.clampTime=function(e){return this._spline.clampTime(e)},Jq.getAnimationSpline=function(e,t,n,i,r,o,a,s){const c=function(e,t,n){return`${e.cacheKey}//${t}/${n}`}(e,t,i);let u=eW[c];if(!Object(l.a)(u)){const t=o,n=s;1===t.length&&1===n.length?u=new pp(n[0]):"LINEAR"!==r.interpolation&&"STEP"!==r.interpolation||("translation"===a||"scale"===a?u=new Eu({times:t,points:n}):"rotation"===a?u=new jC({times:t,points:n}):"weights"===a&&(u=new _E({times:t,weights:n})),Object(l.a)(u)&&"STEP"===r.interpolation&&(u=new tW(u))),Object(l.a)(e.cacheKey)&&(eW[c]=u)}return u};const nW={};Jq.getSkinInverseBindMatrices=function(e,t){const n=$q(e,t);let i=nW[n];if(!Object(l.a)(i)){const r=e.gltfInternal,o=r.buffers,a=r.bufferViews[t.bufferView],s=o[a.buffer].extras._pipeline.source,c=t.componentType,l=t.type,u=t.count,h=VV(r,t);let d=a.byteOffset+t.byteOffset;const f=UV(l);if(i=new Array(u),c===ps.FLOAT&&l===Cs.MAT4)for(let e=0;e<u;++e){const t=gs.createArrayBufferView(c,s.buffer,s.byteOffset+d,f);i[e]=Me.fromArray(t),d+=h}nW[n]=i}return i};var iW=Jq;var rW=Object.freeze({NONE:0,REPEAT:1,MIRRORED_REPEAT:2}),oW=Object.freeze({STOPPED:0,ANIMATING:1});function aW(e,t,n){this._name=n.name,this._startTime=tr.clone(e.startTime),this._delay=Object(c.a)(e.delay,0),this._stopTime=e.stopTime,this.removeOnStop=Object(c.a)(e.removeOnStop,!1),this._multiplier=Object(c.a)(e.multiplier,1),this._reverse=Object(c.a)(e.reverse,!1),this._loop=Object(c.a)(e.loop,rW.NONE),this._animationTime=e.animationTime,this._prevAnimationDelta=void 0,this.start=new un.a,this.update=new un.a,this.stop=new un.a,this._state=oW.STOPPED,this._runtimeAnimation=n,this._computedStartTime=void 0,this._duration=void 0;const i=this;this._raiseStartEvent=function(){i.start.raiseEvent(t,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(t,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(t,i)}}Object.defineProperties(aW.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});var sW=aW;function cW(e){this.animationAdded=new un.a,this.animationRemoved=new un.a,this.animateWhilePaused=!1,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function lW(e,t,n){const i=e._model,r=i._runtime.animations[t],o=new sW(n,i,r);return e._scheduledAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}function uW(e,t){const n=e.channelEvaluators,i=n.length;for(let e=0;e<i;++e)n[e](t)}Object.defineProperties(cW.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),cW.prototype.add=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=this._model._runtime.animations;if(!Object(l.a)(t))throw new u.a("Animations are not loaded.  Wait for Model.readyPromise to resolve.");if(!Object(l.a)(e.name)&&!Object(l.a)(e.index))throw new u.a("Either options.name or options.index must be defined.");if(Object(l.a)(e.multiplier)&&e.multiplier<=0)throw new u.a("options.multiplier must be greater than zero.");if(Object(l.a)(e.index)&&(e.index>=t.length||e.index<0))throw new u.a("options.index must be a valid animation index.");if(Object(l.a)(e.index))return lW(this,e.index,e);let n;const i=t.length;for(let r=0;r<i;++r)if(t[r].name===e.name){n=r;break}if(!Object(l.a)(n))throw new u.a("options.name must be a valid animation name.");return lW(this,n,e)},cW.prototype.addAll=function(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(this._model._runtime.animations))throw new u.a("Animations are not loaded.  Wait for Model.readyPromise to resolve.");if(Object(l.a)(e.multiplier)&&e.multiplier<=0)throw new u.a("options.multiplier must be greater than zero.");const t=[],n=this._model._runtime.animations.length;for(let i=0;i<n;++i)t.push(lW(this,i,e));return t},cW.prototype.remove=function(e){if(Object(l.a)(e)){const t=this._scheduledAnimations,n=t.indexOf(e);if(-1!==n)return t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},cW.prototype.removeAll=function(){const e=this._model,t=this._scheduledAnimations,n=t.length;this._scheduledAnimations=[];for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])},cW.prototype.contains=function(e){return!!Object(l.a)(e)&&-1!==this._scheduledAnimations.indexOf(e)},cW.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return this._scheduledAnimations[e]};const hW=[];function dW(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}cW.prototype.update=function(e){const t=this._scheduledAnimations;let n=t.length;if(0===n)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&tr.equals(e.time,this._previousTime))return!1;this._previousTime=tr.clone(e.time,this._previousTime);let i=!1;const r=e.time,o=this._model;for(let o=0;o<n;++o){const n=t[o],a=n._runtimeAnimation;Object(l.a)(n._computedStartTime)||(n._computedStartTime=tr.addSeconds(Object(c.a)(n.startTime,r),n.delay,new tr)),Object(l.a)(n._duration)||(n._duration=a.stopTime*(1/n.multiplier));const s=n._computedStartTime,u=n._duration,d=n.stopTime,f=tr.lessThanOrEquals(s,r),p=Object(l.a)(d)&&tr.greaterThan(r,d);let m=0;if(0!==u){const e=tr.secondsDifference(p?d:r,s);m=Object(l.a)(n._animationTime)?n._animationTime(u,e):e/u}const g=n.loop===rW.REPEAT||n.loop===rW.MIRRORED_REPEAT,_=(f||g&&!Object(l.a)(n.startTime))&&(m<=1||g)&&!p;if(m===n._prevAnimationDelta){if(_!==(n._state===oW.STOPPED))continue}if(n._prevAnimationDelta=m,_||n._state===oW.ANIMATING){if(_&&n._state===oW.STOPPED&&(n._state=oW.ANIMATING,n.start.numberOfListeners>0&&e.afterRender.push(n._raiseStartEvent)),n.loop===rW.REPEAT)m-=Math.floor(m);else if(n.loop===rW.MIRRORED_REPEAT){const e=Math.floor(m),t=m-e;m=e%2==1?1-t:t}n.reverse&&(m=1-m);let t=m*u*n.multiplier;t=h.a.clamp(t,a.startTime,a.stopTime),uW(a,t),n.update.numberOfListeners>0&&(n._updateEventTime=t,e.afterRender.push(n._raiseUpdateEvent)),i=!0,_||(n._state=oW.STOPPED,n.stop.numberOfListeners>0&&e.afterRender.push(n._raiseStopEvent),n.removeOnStop&&hW.push(n))}}n=hW.length;for(let i=0;i<n;++i){const n=hW[i];t.splice(t.indexOf(n),1),e.afterRender.push(dW(this,o,n))}return hW.length=0,i};var fW=cW;function pW(e,t,n){this._name=t.name,this._id=n,this._uniformMap=e._uniformMaps[n],this._technique=void 0,this._program=void 0,this._values=void 0}Object.defineProperties(pW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),pW.prototype.setValue=function(e,t){if(!Object(l.a)(e))throw new u.a("name is required.");const n="u_"+e,i=this._uniformMap.values[n];if(!Object(l.a)(i))throw new u.a("name must match a parameter name in the material's technique that is targetable and not optimized out.");i.value=i.clone(t,i.value)},pW.prototype.getValue=function(e){if(!Object(l.a)(e))throw new u.a("name is required.");const t="u_"+e,n=this._uniformMap.values[t];if(Object(l.a)(n))return n.value};var mW=pW;function gW(e,t,n){const i=[],r=e.primitives,o=r.length;for(let e=0;e<o;++e){const n=r[e];i[e]=t[n.material]}this._name=e.name,this._materials=i,this._id=n}Object.defineProperties(gW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}});var _W=gW;function yW(e,t,n,i,r){this._model=e,this._runtimeNode=n,this._name=t.name,this._id=i,this.useMatrix=!1,this._show=!0,this._matrix=Me.clone(r),this._originalMatrix=Me.clone(r)}Object.defineProperties(yW.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=Me.clone(e,this._matrix),this.useMatrix=!0;const t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}}),yW.prototype.setMatrix=function(e){Me.clone(e,this._matrix)};var bW=yW;function vW(){}function OW(e,t,n,i,r){const o=3*t,a=e[o],s=e[o+1],c=e[o+2];return void 0===a?63:((a===n&&s===i&&c===r)<<0)+((a===n&&s===r&&c===i)<<1)+((a===i&&s===n&&c===r)<<2)+((a===i&&s===r&&c===n)<<3)+((a===r&&s===n&&c===i)<<4)+((a===r&&s===i&&c===n)<<5)}function wW(e){return(1&e)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function AW(e,t,n,i,r,o,a){const s=a?1:0,c=r?1:0,l=OW(e,t,s,c,0);if(0===l)return t;const u=r?1:0,h=o?1:0,d=OW(e,n,0,u,h);if(0===d)return n;const f=a?1:0,p=o?1:0,m=OW(e,i,f,0,p);if(0===m)return i;const g=l&d&m;let _,y,b;if(1&g)_=0,y=1,b=2;else if(2&g)_=0,b=1,y=2;else if(4&g)y=0,_=1,b=2;else if(8&g)y=0,b=1,_=2;else if(16&g)b=0,_=1,y=2;else{if(!(32&g)){const e=wW(l),r=wW(d),o=wW(m);return e<r&&e<o?t:r<o?n:i}b=0,y=1,_=2}const v=3*t;e[v+_]=s,e[v+y]=c,e[v+b]=0;const O=3*n;e[O+_]=0,e[O+y]=u,e[O+b]=h;const w=3*i;return e[w+_]=f,e[w+y]=0,e[w+b]=p,-1}function EW(e,t,n){const i=e[0];return 1===e[Math.min(t,n)*i+Math.max(t,n)]}function TW(e){const t=new Uint8Array(e);return t[e-1]=192,8===e?t[e-1]=96:4===e?t[e-1]=48:2===e?t[e-1]=24:1===e&&(t[e-1]=12),t}function CW(e,t){const n=e.gltfInternal,i=e._loadResources;let r,o;for(r=0;r<t.length;++r){const a=t[r],s=a.extras._pipeline.vertexNumberingScope;a.extras._pipeline.vertexNumberingScope=void 0;const c=s.extraVertices,l=i.getBuffer(a),u=a.byteStride||4,h=c.length,d=new Uint8Array(l.byteLength+h*u);for(d.set(l),o=0;o<h;++o){const e=c[o]*u,t=l.length+o*u;for(let n=0;n<u;++n)d[t+n]=d[e+n]}a.byteOffset=0,a.byteLength=d.byteLength;const f=n.buffers.push({byteLength:d.byteLength,extras:{_pipeline:{source:d.buffer}}})-1;a.buffer=f,i.buffers[f]=d;const p=s.accessors;for(o=0;o<p.length;++o){const e=p[o];n.accessors[e].count+=h}if(!s.createdOutlines){const t=s.outlineCoordinates,n=new Float32Array(t),r=e.gltfInternal.buffers.push({byteLength:n.byteLength,extras:{_pipeline:{source:n.buffer}}})-1;i.buffers[r]=new Uint8Array(n.buffer,0,n.byteLength);const a=e.gltfInternal.bufferViews.push({buffer:r,byteLength:n.byteLength,byteOffset:0,byteStride:3*Float32Array.BYTES_PER_ELEMENT,target:34962})-1,c=e.gltfInternal.accessors.push({bufferView:a,byteOffset:0,componentType:5126,count:n.length/3,type:"VEC3",min:[0,0,0],max:[1,1,1]})-1,l=s.primitives;for(o=0;o<l.length;++o)l[o].attributes._OUTLINE_COORDINATES=c;i.vertexBuffersToCreate.enqueue(a),s.createdOutlines=!0}}}function xW(e,t){return t.buffer===e}vW.hasExtension=function(e){return Object(l.a)(e.extensionsRequired.CESIUM_primitive_outline)||Object(l.a)(e.extensionsUsed.CESIUM_primitive_outline)},vW.outlinePrimitives=function(e){if(!vW.hasExtension(e))return;const t=e.gltfInternal,n=[];kV.mesh(t,(function(t,i){kV.meshPrimitive(t,(function(t,r){if(!Object(l.a)(t.extensions))return;const o=t.extensions.CESIUM_primitive_outline;if(!Object(l.a)(o))return;const a=function(e,t){const n=t.attributes;if(void 0===n)return;const i=e.gltfInternal;let r;for(const e in n){if(!n.hasOwnProperty(e))continue;const t=n[e],o=i.accessors[t].bufferView,a=i.bufferViews[o];if(Object(l.a)(a.extras)||(a.extras={}),Object(l.a)(a.extras._pipeline)||(a.extras._pipeline={}),Object(l.a)(a.extras._pipeline.vertexNumberingScope)){if(void 0!==r&&a.extras._pipeline.vertexNumberingScope!==r)return}else a.extras._pipeline.vertexNumberingScope=r||{vertexCopies:[],extraVertices:[],outlineCoordinates:[],accessors:[],bufferViews:[],primitives:[],createdOutlines:!1};r=a.extras._pipeline.vertexNumberingScope,r.bufferViews.indexOf(a)<0&&r.bufferViews.push(a),r.accessors.indexOf(t)<0&&r.accessors.push(t)}return r.primitives.push(t),r}(e,t);void 0!==a&&(n.indexOf(a)<0&&n.push(a),function(e,t,n,i,r){const o=r.vertexCopies,a=r.extraVertices,s=r.outlineCoordinates,c=e.gltfInternal,u=c.meshes[t].primitives[n],h=c.accessors,d=c.bufferViews;let f;for(const e in u.attributes)if(u.attributes.hasOwnProperty(e)){const t=u.attributes[e],n=h[t];if(Object(l.a)(n)){f=n.count;break}}if(!Object(l.a)(f))return;const p=h[u.indices],m=d[p.bufferView],g=h[i],_=d[g.bufferView],y=e._loadResources,b=y.getBuffer(m),v=y.getBuffer(_);let O=5123===p.componentType?new Uint16Array(b.buffer,b.byteOffset+p.byteOffset,p.count):new Uint32Array(b.buffer,b.byteOffset+p.byteOffset,p.count);const w=5123===g.componentType?new Uint16Array(v.buffer,v.byteOffset+g.byteOffset,g.count):new Uint32Array(v.buffer,v.byteOffset+g.byteOffset,g.count),A=f,E=[A];let T;for(T=0;T<w.length;T+=2){const e=w[T],t=w[T+1],n=Math.min(e,t),i=Math.max(e,t);E[n*A+i]=1}for(T=0;T<O.length;T+=3){let t=O[T],n=O[T+1],i=O[T+2];const r=!1,u=r||EW(E,t,n),h=r||EW(E,n,i),d=r||EW(E,i,t);let g=AW(s,t,n,i,u,h,d);for(;g>=0;){let r;if(r=g===t?o[t]:g===n?o[n]:o[i],void 0===r){r=f+a.length;let e=g;for(;e>=f;)e=a[e-f];a.push(e),o[g]=r}r>65534&&O instanceof Uint16Array&&(O=new Uint32Array(O),p.componentType=5125,m.buffer=c.buffers.push({byteLength:O.byteLength,extras:{_pipeline:{source:O.buffer}}})-1,m.byteLength=O.byteLength,m.byteOffset=0,e._loadResources.buffers[m.buffer]=new Uint8Array(O.buffer,0,O.byteLength),y.indexBuffersToCreate._array.forEach((function(e){Object(l.a)(e)&&e.id===p.bufferView&&(e.componentType=p.componentType)}))),g===t?(t=r,O[T]=r):g===n?(n=r,O[T+1]=r):(i=r,O[T+2]=r),Object(l.a)(p.max)&&(p.max[0]=Math.max(p.max[0],r)),g=AW(s,t,n,i,u,h,d)}}}(e,i,r,o.indices,a))}))}));for(let t=0;t<n.length;++t)CW(e,n[t].bufferViews);!function(e){const t=e.gltfInternal,n=e._loadResources;let i;for(i=0;i<t.buffers.length;++i){const e=t.buffers[i],r=t.bufferViews.filter(xW.bind(void 0,i)),o=r.reduce((function(e,t){return e+t.byteLength}),0);if(o===e.byteLength)continue;const a=new Uint8Array(o);let s=0;for(let e=0;e<r.length;++e){const t=r[e],i=n.getBuffer(t);a.set(i,s),t.byteOffset=s,s+=i.byteLength}n.buffers[i]=a,e.extras._pipeline.source=a.buffer,e.byteLength=o}}(e)},vW.createTexture=function(e,t){let n=t.cache.modelOutliningCache;if(Object(l.a)(n)||(n=t.cache.modelOutliningCache={}),Object(l.a)(n.outlineTexture))return n.outlineTexture;const i=Math.min(4096,MD.maximumTextureSize);let r=i;const o=TW(r),a=[];for(;r>1;)r>>=1,a.push(TW(r));const s=new JD({context:t,source:{arrayBufferView:o,mipLevels:a},width:i,height:1,pixelFormat:aT.LUMINANCE,sampler:new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.LINEAR_MIPMAP_LINEAR,magnificationFilter:kD.LINEAR})});return n.outlineTexture=s,s};var SW=vW;var IW=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});var PW={modifyFragmentShader:function(e){return e=UN.replaceMain(e,"czm_splitter_main"),e+="uniform float czm_splitDirection; \nvoid main() \n{ \n#ifndef SHADOW_MAP\n    if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; \n    if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; \n#endif\n    czm_splitter_main(); \n} \n"},addUniforms:function(e,t){t.czm_splitDirection=function(){return e.splitDirection}}};const DW=new O,RW=nG.ModelState,jW=h.a.EPSILON16;function MW(e,t){e._cachedGltf=t}function LW(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(LW.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),LW.prototype.makeReady=function(e){this.gltf=e;const t=this.modelsToLoad,n=t.length;for(let e=0;e<n;++e){const n=t[e];n.isDestroyed()||MW(n,this)}this.modelsToLoad=void 0,this.ready=!0};const NW={},BW={};function FW(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).cacheKey;let n;if(this._cacheKey=t,this._cachedGltf=void 0,this._releaseGltfJson=Object(c.a)(e.releaseGltfJson,!1),Object(l.a)(t)&&Object(l.a)(NW[t])&&NW[t].ready)n=NW[t],++n.count;else{let i=e.gltf;if(Object(l.a)(i)){if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),i instanceof Uint8Array){n=new LW({gltf:JV(i),ready:!0})}else n=new LW({gltf:e.gltf,ready:!0});n.count=1,Object(l.a)(t)&&(NW[t]=n)}}MW(this,n);const i=Object(c.a)(e.basePath,"");this._resource=Tt.a.createIfNeeded(i);let r=e.credit;"string"==typeof r&&(r=new ln(r)),this._credit=r,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=Object(c.a)(e.showCreditsOnScreen,!1),this.show=Object(c.a)(e.show,!0),this.silhouetteColor=Object(c.a)(e.silhouetteColor,sp.RED),this._silhouetteColor=new sp,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=Object(c.a)(e.silhouetteSize,0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=Me.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=Object(c.a)(e.scale,1),this._scale=this.scale,this.minimumPixelSize=Object(c.a)(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=Object(c.a)(e.heightReference,qP.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;const o=e.scene;this._scene=o,Object(l.a)(o)&&Object(l.a)(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener((function(){this._heightChanged=!0}),this)),this._pickObject=e.pickObject,this._allowPicking=Object(c.a)(e.allowPicking,!0),this._ready=!1,this._readyPromise=Object(oc.a)(),this.activeAnimations=new fW(this),this.clampAnimations=Object(c.a)(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=Object(c.a)(e.incrementallyLoadTextures,!0),this._asynchronous=Object(c.a)(e.asynchronous,!0),this.shadows=Object(c.a)(e.shadows,TB.ENABLED),this._shadows=this.shadows,this.color=sp.clone(Object(c.a)(e.color,sp.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=Object(c.a)(e.colorBlendMode,kq.HIGHLIGHT),this.colorBlendAmount=Object(c.a)(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.referenceMatrix=void 0,this.backFaceCulling=Object(c.a)(e.backFaceCulling,!0),this.showOutline=Object(c.a)(e.showOutline,!0),this.splitDirection=Object(c.a)(e.splitDirection,IW.NONE),this._splittingEnabled=!1,this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Object(c.a)(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=Object(c.a)(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=Object(c.a)(e.upAxis,HU.Y),this._gltfForwardAxis=HU.Z,this._forwardAxis=e.forwardAxis,this.cull=Object(c.a)(e.cull,!0),this.opaquePass=Object(c.a)(e.opaquePass,KR.OPAQUE),this._computedModelMatrix=new Me,this._clippingPlanesMatrix=Me.clone(Me.IDENTITY),this._iblReferenceFrameMatrix=ce.clone(ce.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new At,this._state=RW.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,e.dequantizeInShader&&ll("Model.dequantizeInShader","The Model dequantizeInShader constructor parameter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this._dequantizeInShader=Object(c.a)(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._pointsLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._lightColor=O.clone(e.lightColor),Object(l.a)(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new zU,this._shouldDestroyImageBasedLighting=!0),this._shouldRegenerateShaders=!1}function zW(e){return e.stencilBuffer}function kW(e){return!sp.equals(e.color,sp.WHITE)||e.colorBlendMode!==kq.HIGHLIGHT}function UW(e){const t=e._clippingPlanes;return Object(l.a)(t)&&t.enabled&&0!==t.length}function VW(e,t,n){if(e._state!==RW.LOADED)throw new u.a("The model is not loaded.  Use Model.readyPromise or wait for Model.ready to be true.");if(!Object(l.a)(n))throw new u.a("name is required.");return e._runtime[t][n]}Object.defineProperties(FW.prototype,{gltf:{get:function(){return ll("Model.gltf","Model.gltf getter was deprecated in CesiumJS 1.94 and will be removed in 1.97"),this.gltfInternal}},gltfInternal:{get:function(){return Object(l.a)(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return ll("model.basePath","Model.basePath getter is deprecated in CesiumJS 1.94. It will be removed in CesiumJS 1.97"),this.basePathInternal}},basePathInternal:{get:function(){return this._resource.url}},boundingSphere:{get:function(){let e=this.modelMatrix;this.heightReference!==qP.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);const t=Object(l.a)(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale,n=At.clone(this._boundingSphere,this._scaledBoundingSphere);return n.radius*=t,At.transform(n,e,n),Object(l.a)(this._rtcCenter)&&O.add(this._rtcCenter,n.center,n.center),n}},boundingSphereInternal:{get:function(){if(this._state!==RW.LOADED)throw new u.a("The model is not loaded.  Use Model.readyPromise or wait for Model.ready to be true.");let e=this.modelMatrix;this.heightReference!==qP.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);const t=Me.getScale(e,DW),n=Object(l.a)(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;O.multiplyByScalar(t,n,t);const i=this._scaledBoundingSphere;return i.center=O.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=O.maximumComponent(t)*this._initialRadius,Object(l.a)(this._rtcCenter)&&O.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return ll("Model.pendingTextureLoads","The Model.pendingTextureLoads getter was deprecated in CesiumJS 1.94 and will be removed in CesiumJS 1.97"),this.pendingTextureLoadsInternal}},pendingTextureLoadsInternal:{get:function(){return Object(l.a)(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far must be greater than near");this._distanceDisplayCondition=eb.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return Object(l.a)(this._extensionsUsed)||(this._extensionsUsed=nG.getUsedExtensions(this.gltfInternal)),this._extensionsUsed}},extensionsRequired:{get:function(){return Object(l.a)(this._extensionsRequired)||(this._extensionsRequired=nG.getRequiredExtensions(this.gltfInternal)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return Object(l.a)(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&Fq.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},lightColor:{get:function(){return this._lightColor},set:function(e){const t=this._lightColor;e===t||O.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||Object(l.a)(t)&&!Object(l.a)(e)||Object(l.a)(e)&&!Object(l.a)(t),this._lightColor=O.clone(e,t))}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){s.a.typeOf.object("imageBasedLighting",this._imageBasedLighting),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this._shouldRegenerateShaders=!0)}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){if(this._showCreditsOnScreen!==e){Object(l.a)(this._credit)&&(this._credit.showOnScreen=e);const t=this._resourceCredits.length;for(let n=0;n<t;n++)this._resourceCredits[n].showOnScreen=e;const n=this._gltfCredits.length;for(let t=0;t<n;t++)this._gltfCredits[t].showOnScreen=e}this._showCreditsOnScreen=e}}}),FW.silhouetteSupported=function(e){return zW(e.context)},FW.fromGltf=function(e){if(!Object(l.a)(e)||!Object(l.a)(e.url))throw new u.a("options.url is required");const t=e.url;e=Object(Zf.a)(e);const n=Tt.a.createIfNeeded(t),i=Object(c.a)(e.basePath,n.clone()),r=Tt.a.createIfNeeded(i);let o=Object(c.a)(e.cacheKey,BW[Object(Et.a)(n.url)]);Object(l.a)(o)||(o=fy(),BW[Object(Et.a)(n.url)]=o),Object(l.a)(e.basePath)&&!Object(l.a)(e.cacheKey)&&(o+=r.url),e.cacheKey=o,e.basePath=r;const a=new FW(e);let s=NW[o];return Object(l.a)(s)?s.ready||(++s.count,s.modelsToLoad.push(a)):(s=new LW({ready:!1}),s.count=1,s.modelsToLoad.push(a),MW(a,s),NW[o]=s,Object(l.a)(n.headers.Accept)||(n.headers.Accept="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01"),n.fetchArrayBuffer().then((function(e){const t=new Uint8Array(e);if("glTF"===Jv(t)){const e=JV(t);s.makeReady(e)}else{const e=qu(t);s.makeReady(e)}const i=a._resourceCredits,r=n.credits;if(Object(l.a)(r)){const e=r.length;for(let t=0;t<e;t++)i.push(r[t])}})).catch(nG.getFailedLoadFunction(a,"model",n.url))),a},FW._gltfCache=NW,FW.prototype.getNode=function(e){const t=VW(this,"nodesByName",e);return Object(l.a)(t)?t.publicNode:void 0},FW.prototype.getMesh=function(e){return VW(this,"meshesByName",e)},FW.prototype.getMaterial=function(e){return VW(this,"materialsByName",e)},FW.prototype.setArticulationStage=function(e,t){s.a.typeOf.number("value",t);const n=VW(this,"stagesByKey",e),i=VW(this,"articulationsByStageKey",e);Object(l.a)(n)&&Object(l.a)(i)&&(t=h.a.clamp(t,n.minimumValue,n.maximumValue),h.a.equalsEpsilon(n.currentValue,t,jW)||(n.currentValue=t,i.isDirty=!0))};const HW=new O,GW=new ce;function qW(e,t){s.a.typeOf.object("stage",e),s.a.typeOf.object("result",t);const n=e.currentValue,i=HW;let r;switch(e.type){case"xRotate":r=ce.fromRotationX(h.a.toRadians(n),GW),Me.multiplyByMatrix3(t,r,t);break;case"yRotate":r=ce.fromRotationY(h.a.toRadians(n),GW),Me.multiplyByMatrix3(t,r,t);break;case"zRotate":r=ce.fromRotationZ(h.a.toRadians(n),GW),Me.multiplyByMatrix3(t,r,t);break;case"xTranslate":i.x=n,i.y=0,i.z=0,Me.multiplyByTranslation(t,i,t);break;case"yTranslate":i.x=0,i.y=n,i.z=0,Me.multiplyByTranslation(t,i,t);break;case"zTranslate":i.x=0,i.y=0,i.z=n,Me.multiplyByTranslation(t,i,t);break;case"xScale":i.x=n,i.y=1,i.z=1,Me.multiplyByScale(t,i,t);break;case"yScale":i.x=1,i.y=n,i.z=1,Me.multiplyByScale(t,i,t);break;case"zScale":i.x=1,i.y=1,i.z=n,Me.multiplyByScale(t,i,t);break;case"uniformScale":Me.multiplyByUniformScale(t,n,t)}return t}const WW=new Me;function YW(e,t){return function(n){const i=e._loadResources,r=new Uint8Array(n);--i.pendingBufferLoads,e.gltfInternal.buffers[t].extras._pipeline.source=r}}function XW(e,t){return function(n){const i=e._loadResources;let r;--i.pendingTextureLoads,Array.isArray(n)&&(r=n.slice(1,n.length).map((function(e){return e.bufferView})),n=n[0]),i.texturesToCreate.enqueue({id:t,image:n,bufferView:n.bufferView,width:n.width,height:n.height,internalFormat:n.internalFormat,mipLevels:r})}}FW.prototype.applyArticulations=function(){const e=this._runtime.articulationsByName;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];if(n.isDirty){n.isDirty=!1;const e=n.nodes.length;for(let t=0;t<e;++t){const e=n.nodes[t];let i=Me.clone(e.originalMatrix,WW);const r=n.stages.length;for(let e=0;e<r;++e){i=qW(n.stages[e],i)}e.matrix=i}}}};const KW=/(^data:image\/ktx2)|(\.ktx2$)/i;const JW=new Me;const ZW=function(){this.id=void 0,this.model=void 0,this.context=void 0};function $W(e,t,n){const i=t._loadResources;let r=t.gltfInternal.bufferViews[e];Object(l.a)(r)||(r=i.createdBufferViews[e]);const o=ZN.createVertexBuffer({context:n,typedArray:i.getBuffer(r),usage:KN.STATIC_DRAW});o.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=o,t._geometryByteLength+=o.sizeInBytes}ZW.prototype.set=function(e,t,n){this.id=e,this.model=t,this.context=n},ZW.prototype.execute=function(){$W(this.id,this.model,this.context)};const QW=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};function eY(e,t,n,i){const r=n._loadResources;let o=n.gltfInternal.bufferViews[e];Object(l.a)(o)||(o=r.createdBufferViews[e]);const a=ZN.createIndexBuffer({context:i,typedArray:r.getBuffer(o),usage:KN.STATIC_DRAW,indexDatatype:t});a.vertexArrayDestroyable=!1,n._rendererResources.buffers[e]=a,n._geometryByteLength+=a.sizeInBytes}QW.prototype.set=function(e,t,n,i){this.id=e,this.componentType=t,this.model=n,this.context=i},QW.prototype.execute=function(){eY(this.id,this.componentType,this.model,this.context)};const tY=new ZW,nY=new QW;function iY(e,t){const n=e._runtime.materialsById[t.material];if(Object(l.a)(n))return n._program}function rY(e,t,n){let i;const r=n._programPrimitives[t];if(!Object(l.a)(r))return e;let o,a;for(o in r)if(r.hasOwnProperty(o)&&(i=r[o],iY(n,i)===t))break;if(n._programPrimitives[t]=void 0,n.extensionsUsed.WEB3D_quantized_attributes)a=nG.modifyShaderForQuantizedAttributes(n.gltfInternal,i,e),n._quantizedUniforms[t]=a.uniforms;else{const t=n._decodedData[o];if(!Object(l.a)(t))return e;a=nG.modifyShaderForDracoQuantizedAttributes(n.gltfInternal,i,e,t.attributes)}return a.shader}function oY(e,t,n){return Object(l.a)(n)&&(e=n(e,t)),e}const aY=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};function sY(e,t,n){const i=e.programId,r=e.techniqueId,o=t._sourcePrograms[i],a=t._rendererResources.sourceShaders;let s=a[o.vertexShader];const c=a[o.fragmentShader],u=t._quantizedVertexShaders;if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){let e=u[i];Object(l.a)(e)||(e=rY(s,i,t),u[i]=e),s=e}const h=oY(s,i,t._vertexShaderLoaded);let d=oY(c,i,t._fragmentShaderLoaded);Object(l.a)(t._uniformMapLoaded)||(d="uniform vec4 czm_pickColor;\n"+d);const f=t._imageBasedLighting,p=f.enabled;if(p&&(d="#define USE_IBL_LIGHTING \n\n"+d),Object(l.a)(t._lightColor)&&(d="#define USE_CUSTOM_LIGHT_COLOR \n\n"+d),("2.0"!==t._sourceVersion||t._sourceKHRTechniquesWebGL)&&(d=UN.replaceMain(d,"non_gamma_corrected_main"),d+="\nvoid main() { \n    non_gamma_corrected_main(); \n    gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),FU.isSupported(n)){const e=f.useSphericalHarmonicCoefficients,t=f.useSpecularEnvironmentMaps;(e||t||p)&&(d="uniform mat3 gltf_iblReferenceFrameMatrix; \n"+d),Object(l.a)(f.sphericalHarmonicCoefficients)?d="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+d:f.useDefaultSphericalHarmonics&&(d="#define DIFFUSE_IBL \n"+d),Object(l.a)(f.specularEnvironmentMapAtlas)&&f.specularEnvironmentMapAtlas.ready?d="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+d:f.useDefaultSpecularMaps&&(d="#define SPECULAR_IBL \n"+d)}Object(l.a)(f.luminanceAtZenith)&&(d="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+d),lY(i,r,d,h,t,n)}function cY(e,t,n){const i=e.programId,r=e.techniqueId,o=t._sourcePrograms[i],a=t._rendererResources.sourceShaders,s=t._quantizedVertexShaders,c=t.clippingPlanes,u=UW(t);let h=a[o.vertexShader];const d=a[o.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(h=s[i]);let f=d;kW(t)&&(f=FW._modifyShaderForColor(f)),u&&(f=function(e,t,n){return e=UN.replaceMain(e,"gltf_clip_main"),e+=FW._getClippingFunction(t,n)+"\n",e+=`uniform highp sampler2D gltf_clippingPlanes; \nuniform mat4 gltf_clippingPlanesMatrix; \nuniform vec4 gltf_clippingPlanesEdgeStyle; \nvoid main() \n{ \n    gltf_clip_main(); \n${Wq("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")}} \n`}(f,c,n)),t.splitDirection!==IW.NONE&&(f=PW.modifyFragmentShader(f));const p=oY(h,i,t._vertexShaderLoaded);let m=oY(f,i,t._fragmentShaderLoaded);Object(l.a)(t._uniformMapLoaded)||(m="uniform vec4 czm_pickColor;\n"+m);const g=t._imageBasedLighting,_=g.enabled;if(_&&(m="#define USE_IBL_LIGHTING \n\n"+m),Object(l.a)(t._lightColor)&&(m="#define USE_CUSTOM_LIGHT_COLOR \n\n"+m),("2.0"!==t._sourceVersion||t._sourceKHRTechniquesWebGL)&&(m=UN.replaceMain(m,"non_gamma_corrected_main"),m+="\nvoid main() { \n    non_gamma_corrected_main(); \n    gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),FU.isSupported(n)){const e=g.useSphericalHarmonicCoefficients,t=g.useSpecularEnvironmentMaps;(e||t||_)&&(m="uniform mat3 gltf_iblReferenceFrameMatrix; \n"+m),Object(l.a)(g.sphericalHarmonicCoefficients)?m="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+m:g.useDefaultSphericalHarmonics&&(m="#define DIFFUSE_IBL \n"+m),Object(l.a)(g.specularEnvironmentMapAtlas)&&g.specularEnvironmentMapAtlas.ready?m="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+m:g.useDefaultSpecularMaps&&(m="#define SPECULAR_IBL \n"+m)}Object(l.a)(g.luminanceAtZenith)&&(m="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+m),lY(i,r,m,p,t,n)}function lY(e,t,n,i,r,o){const a=r._sourceTechniques[t],s=nG.createAttributeLocations(a,r._precreatedAttributes);r._rendererResources.programs[e]=oM.fromCache({context:o,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:s})}aY.prototype.set=function(e,t,n){this.programToCreate=e,this.model=t,this.context=n},aY.prototype.execute=function(){sY(this.programToCreate,this.model,this.context)};const uY=new aY;function hY(e,t){return function(n){e.texturesToCreate.enqueue({id:t.id,image:n,bufferView:void 0}),--e.pendingBufferViewToImage}}const dY=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};function fY(e,t,n){const i=t.gltfInternal.textures[e.id];let r=t._rendererResources.samplers[i.sampler];Object(l.a)(r)||(r=new WD({wrapS:GD.REPEAT,wrapT:GD.REPEAT}));let o=!1;const a=t.gltfInternal.materials,s=a.length;for(let t=0;t<s;++t){const n=a[t];if(Object(l.a)(n.extensions)&&Object(l.a)(n.extensions.KHR_techniques_webgl)){const t=n.extensions.KHR_techniques_webgl.values;for(const n in t)if(t.hasOwnProperty(n)&&-1!==n.indexOf("Texture")){const i=t[n];if(i.index===e.id&&Object(l.a)(i.extensions)&&Object(l.a)(i.extensions.KHR_texture_transform)){o=!0;break}}}if(o)break}const c=r.wrapS,u=r.wrapT;let d=r.minificationFilter;o&&d!==VD.LINEAR&&d!==VD.NEAREST&&(d=d===VD.NEAREST_MIPMAP_NEAREST||d===VD.NEAREST_MIPMAP_LINEAR?VD.NEAREST:VD.LINEAR,r=new WD({wrapS:r.wrapS,wrapT:r.wrapT,minificationFilter:d,magnificationFilter:r.magnificationFilter}));const f=e.internalFormat,p=!(Object(l.a)(f)&&aT.isCompressedFormat(f)||d!==VD.NEAREST_MIPMAP_NEAREST&&d!==VD.NEAREST_MIPMAP_LINEAR&&d!==VD.LINEAR_MIPMAP_NEAREST&&d!==VD.LINEAR_MIPMAP_LINEAR),m=p||c===GD.REPEAT||c===GD.MIRRORED_REPEAT||u===GD.REPEAT||u===GD.MIRRORED_REPEAT;let g,_,y=e.image;if(Object(l.a)(f)){g=!h.a.isPowerOfTwo(e.width)||!h.a.isPowerOfTwo(e.height),!n.webgl2&&aT.isCompressedFormat(f)&&g&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly. See the Model.js constructor documentation for more information.");let t=r.minificationFilter;Object(l.a)(e.mipLevels)||d!==VD.NEAREST_MIPMAP_NEAREST&&d!==VD.NEAREST_MIPMAP_LINEAR?Object(l.a)(e.mipLevels)||d!==VD.LINEAR_MIPMAP_NEAREST&&d!==VD.LINEAR_MIPMAP_LINEAR||(t=VD.LINEAR):t=VD.NEAREST,r=new WD({wrapS:r.wrapS,wrapT:r.wrapT,minificationFilter:t,magnificationFilter:r.magnificationFilter}),_=new JD({context:n,source:{arrayBufferView:e.bufferView,mipLevels:e.mipLevels},width:e.width,height:e.height,pixelFormat:f,sampler:r})}else if(Object(l.a)(y)){if(g=!h.a.isPowerOfTwo(y.width)||!h.a.isPowerOfTwo(y.height),m&&g){const e=document.createElement("canvas");e.width=h.a.nextPowerOfTwo(y.width),e.height=h.a.nextPowerOfTwo(y.height);e.getContext("2d").drawImage(y,0,0,y.width,y.height,0,0,e.width,e.height),y=e}_=new JD({context:n,source:y,pixelFormat:i.internalFormat,pixelDatatype:i.type,sampler:r,flipY:!1,skipColorSpaceConversion:!0}),p&&_.generateMipmap()}Object(l.a)(_)&&(t._rendererResources.textures[e.id]=_,t._texturesByteLength+=_.sizeInBytes)}dY.prototype.set=function(e,t,n){this.gltfTexture=e,this.model=t,this.context=n},dY.prototype.execute=function(){fY(this.gltfTexture,this.model,this.context)};const pY=new dY;function mY(e,t,n,i){return function(r){Object(l.a)(i)&&(r=e.clampAnimations?i.clampTime(r):i.wrapTime(r),t[n]=i.evaluate(r,t[n]),t.dirtyNumber=e._maxDirtyNumber)}}function gY(e,t){const n=e._loadResources;if(!n.finishedBuffersCreation()||!n.finishedProgramCreation()||!n.createVertexArrays)return;n.createVertexArrays=!1;const i=e._rendererResources.buffers,r=e._rendererResources.vertexArrays,o=e.gltfInternal,a=o.accessors;kV.mesh(o,(function(n,s){kV.meshPrimitive(n,(function(n,c){const u=[];let h;const d=function(e,t){const n=e._sourceTechniques,i={};let r,o;const a=e._runtime.materialsById[t.material];if(!Object(l.a)(a))return i;const s=n[a._technique];if(!Object(l.a)(s))return i;const c=s.attributes,u=e._rendererResources.programs[s.program]._attributeLocations;for(r in u)if(u.hasOwnProperty(r)){const e=c[r];Object(l.a)(e)&&(o=u[r],i[e.semantic]=o)}const h=e._precreatedAttributes;if(Object(l.a)(h))for(r in h)h.hasOwnProperty(r)&&(o=u[r],i[r]=o);return i}(e,n),f=e._decodedData[`${s}.primitive.${c}`];let p,m;kV.meshPrimitiveAttribute(n,(function(e,t){if(h=d[t],Object(l.a)(h)){if(Object(l.a)(f)){const e=f.attributes;if(e.hasOwnProperty(t)){const n=e[t];return void u.push({index:h,vertexBuffer:i[n.bufferView],componentsPerAttribute:n.componentsPerAttribute,componentDatatype:n.componentDatatype,normalize:n.normalized,offsetInBytes:n.byteOffset,strideInBytes:n.byteStride})}}const n=a[e],r=Object(l.a)(n.normalized)&&n.normalized;u.push({index:h,vertexBuffer:i[n.bufferView],componentsPerAttribute:UV(n.type),componentDatatype:n.componentType,normalize:r,offsetInBytes:n.byteOffset,strideInBytes:VV(o,n)})}}));const g=e._precreatedAttributes;if(Object(l.a)(g))for(m in g)g.hasOwnProperty(m)&&(h=d[m],Object(l.a)(h)&&(p=g[m],p.index=h,u.push(p)));let _;if(Object(l.a)(n.indices)){let e=a[n.indices].bufferView;Object(l.a)(f)&&(e=f.bufferView),_=i[e]}r[`${s}.primitive.${c}`]=new iB({context:t,attributes:u,indexBuffer:_})}))}))}function _Y(e){const t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,kV.material(e.gltfInternal,(function(t,n){!function(e,t,n){const i=e._rendererResources.renderStates;let r=[ps.FUNC_ADD,ps.FUNC_ADD],o=[ps.ONE,ps.ONE_MINUS_SRC_ALPHA,ps.ONE,ps.ONE_MINUS_SRC_ALPHA];Object(l.a)(t.extensions)&&Object(l.a)(t.extensions.KHR_blend)&&(r=t.extensions.KHR_blend.blendEquation,o=t.extensions.KHR_blend.blendFactors);const a=!t.doubleSided,s="BLEND"===t.alphaMode;i[n]=vj.fromCache({cull:{enabled:a},depthTest:{enabled:!0,func:YN.LESS_OR_EQUAL},depthMask:!s,blending:{enabled:s,equationRgb:r[0],equationAlpha:r[1],functionSourceRgb:o[0],functionDestinationRgb:o[1],functionSourceAlpha:o[2],functionDestinationAlpha:o[3]}})}(e,t,n)})))}const yY={MODEL:function(e,t,n){return function(){return n.computedMatrix}},VIEW:function(e,t,n){return function(){return e.view}},PROJECTION:function(e,t,n){return function(){return e.projection}},MODELVIEW:function(e,t,n){const i=new Me;return function(){return Me.multiplyTransformation(e.view,n.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,n){const i=new Me;return function(){return Me.multiplyTransformation(e.view,n.computedMatrix,i),Me.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,n){const i=new Me;return function(){return Me.multiplyTransformation(e.view,n.computedMatrix,i),Me.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,n){const i=new Me;return function(){return Me.inverse(n.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,n){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,n){const i=new Me,r=new Me;return function(){return Me.multiplyTransformation(e.view,n.computedMatrix,i),Me.inverse(i,r)}},MODELVIEWPROJECTIONINVERSE:function(e,t,n){const i=new Me,r=new Me;return function(){return Me.multiplyTransformation(e.view,n.computedMatrix,i),Me.multiply(e._projection,i,i),Me.inverse(i,r)}},MODELINVERSETRANSPOSE:function(e,t,n){const i=new Me,r=new ce;return function(){return Me.inverse(n.computedMatrix,i),Me.getMatrix3(i,r),ce.transpose(r,r)}},MODELVIEWINVERSETRANSPOSE:function(e,t,n){const i=new Me,r=new Me,o=new ce;return function(){return Me.multiplyTransformation(e.view,n.computedMatrix,i),Me.inverse(i,r),Me.getMatrix3(r,o),ce.transpose(o,o)}},VIEWPORT:function(e,t,n){return function(){return e.viewportCartesian4}}};function bY(e,t,n,i,r,o,a){const s={},u={};let h,d;return kV.techniqueUniform(n,(function(n,f){let p;if(Object(l.a)(i)&&Object(l.a)(i[f]))p=nG.createUniformFunction(n.type,i[f],o,a),s[f]=p.func,u[f]=p;else if(Object(l.a)(n.node))s[f]=function(e,t,n,i){const r=t._runtime.nodes[e];return yY[n](i,t,r)}(n.node,e,n.semantic,r.uniformState);else if(Object(l.a)(n.semantic))if("JOINTMATRIX"===n.semantic)h=f;else if("MORPHWEIGHTS"===n.semantic)d=f;else if("ALPHACUTOFF"===n.semantic){const e=t.alphaMode;if(Object(l.a)(e)&&"MASK"===e){const e=Object(c.a)(t.alphaCutoff,.5);p=nG.createUniformFunction(n.type,e,o,a),s[f]=p.func,u[f]=p}}else s[f]=nG.getGltfSemanticUniforms()[n.semantic](r.uniformState,e);else if(Object(l.a)(n.value)){const e=nG.createUniformFunction(n.type,n.value,o,a);s[f]=e.func,u[f]=e}})),{map:s,values:u,jointMatrixUniformName:h,morphWeightsUniformName:d}}function vY(e){return nG.createUniformsForDracoQuantizedAttributes(e.attributes)}function OY(e,t){const n=iY(e,t),i=e._quantizedUniforms[n];return nG.createUniformsForQuantizedAttributes(e.gltfInternal,t,i)}function wY(e){return function(){return e}}function AY(e){return function(){return e.computedJointMatrices}}function EY(e){return function(){return e.weights}}function TY(e){return function(){return e.silhouetteColor}}function CY(e){return function(){return e.silhouetteSize}}function xY(e){return function(){return e.color}}function SY(e){return function(){return e._clippingPlanesMatrix}}function IY(e){return function(){return e._iblReferenceFrameMatrix}}function PY(e){return function(){const t=e.clippingPlanes;return Object(l.a)(t)&&t.enabled?t.texture:e._defaultTexture}}function DY(e){return function(){const t=e.clippingPlanes;if(!Object(l.a)(t))return sp.WHITE.withAlpha(0);const n=sp.clone(t.edgeColor);return n.alpha=t.edgeWidth,n}}function RY(e){return function(){return kq.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function jY(e){return function(){return e._imageBasedLighting.imageBasedLightingFactor}}function MY(e){return function(){return e._lightColor}}function LY(e){return function(){return e._imageBasedLighting.luminanceAtZenith}}function NY(e){return function(){return e._imageBasedLighting.sphericalHarmonicCoefficients}}function BY(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture}}function FY(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions}}function zY(e){return function(){return e._imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel}}function kY(e,t){switch(e.mode){case zl.TRIANGLES:return t/3;case zl.TRIANGLE_STRIP:case zl.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function UY(e,t,n,i,r){const o=e._nodeCommands,a=e._pickIds,s=e.allowPicking,c=e._runtime.meshesByName,u=e._rendererResources,h=u.vertexArrays,d=u.programs,f=u.renderStates,p=e._uniformMaps,m=e.gltfInternal,g=m.accessors,_=m.meshes,y=t.mesh,b=_[y],v=b.primitives,w=v.length;for(let t=0;t<w;++t){const u=v[t],_=g[u.indices],w=e._runtime.materialsById[u.material]._program,A=e._decodedData[`${y}.primitive.${t}`];let E;const T=u.attributes.POSITION;if(Object(l.a)(T)){const e=nG.getAccessorMinMax(m,T);E=At.fromCornerPoints(O.fromArray(e.min),O.fromArray(e.max))}const C=h[`${y}.primitive.${t}`];let x,S;if(Object(l.a)(A))S=A.numberOfIndices,x=0;else if(Object(l.a)(_))S=_.count,x=_.byteOffset/wc.getSizeInBytes(_.componentType);else{S=g[u.attributes.POSITION].count,x=0}e._trianglesLength+=kY(u,S),u.mode===zl.POINTS&&(e._pointsLength+=S);const I=p[u.material];let P=I.uniformMap;if(Object(l.a)(I.jointMatrixUniformName)){const e={};e[I.jointMatrixUniformName]=AY(n),P=Object(up.a)(P,e)}if(Object(l.a)(I.morphWeightsUniformName)){const e={};e[I.morphWeightsUniformName]=EY(n),P=Object(up.a)(P,e)}P=Object(up.a)(P,{gltf_color:xY(e),gltf_colorBlend:RY(e),gltf_clippingPlanes:PY(e),gltf_clippingPlanesEdgeStyle:DY(e),gltf_clippingPlanesMatrix:SY(e),gltf_iblReferenceFrameMatrix:IY(e),gltf_iblFactor:jY(e),gltf_lightColor:MY(e),gltf_sphericalHarmonicCoefficients:NY(e),gltf_specularMap:BY(e),gltf_specularMapSize:FY(e),gltf_maxSpecularLOD:zY(e),gltf_luminanceAtZenith:LY(e)}),PW.addUniforms(e,P),Object(l.a)(e._uniformMapLoaded)&&(P=e._uniformMapLoaded(P,w,n));let D={};e.extensionsUsed.WEB3D_quantized_attributes?D=OY(e,u):e._dequantizeInShader&&Object(l.a)(A)&&(D=vY(A)),P=Object(up.a)(P,D);const R=f[u.material],j=R.blending.enabled;let M=e._pickObject;Object(l.a)(M)||(M={primitive:e,id:e.id,node:n.publicNode,mesh:c[b.name]});const L=TB.castShadows(e._shadows),N=TB.receiveShadows(e._shadows);let B;if(s&&!Object(l.a)(e._uniformMapLoaded)){B=i.createPickId(M),a.push(B);const e={czm_pickColor:wY(B.color)};P=Object(up.a)(P,e)}s&&(B=Object(l.a)(e._pickIdLoaded)&&Object(l.a)(e._uniformMapLoaded)?e._pickIdLoaded():"czm_pickColor");const F=new XR({boundingVolume:new At,cull:e.cull,modelMatrix:new Me,primitiveType:u.mode,vertexArray:C,count:S,offset:x,shaderProgram:d[w],castShadows:L,receiveShadows:N,uniformMap:P,renderState:R,owner:M,pass:j?KR.TRANSLUCENT:e.opaquePass,pickId:B});let z;r||(z=XR.shallowClone(F),z.boundingVolume=new At,z.modelMatrix=new Me);const k={show:!0,boundingSphere:E,command:F,command2D:z,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:w};n.commands.push(k),o.push(k)}}function VY(e,t){const n=t.context,i=t.scene3DOnly,r=e._quantizedVertexShaders,o=e._sourceTechniques,a=e._sourcePrograms,s=e._rendererResources;let c=s.sourceShaders;e._loadRendererResourcesFromCache&&(c=s.sourceShaders=e._cachedRendererResources.sourceShaders);for(const t in o)if(o.hasOwnProperty(t)){const i=o[t].program,s=a[i];let u=c[s.vertexShader];if(nG.checkSupportedGlExtensions(s.glExtensions,n),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){let t=r[i];Object(l.a)(t)||(t=rY(u,i,e),r[i]=t),u=t}u=oY(u,i,e._vertexShaderLoaded)}if(e._loadRendererResourcesFromCache){const t=e._cachedRendererResources;s.buffers=t.buffers,s.vertexArrays=t.vertexArrays,s.programs=t.programs,s.silhouettePrograms=t.silhouettePrograms,s.textures=t.textures,s.samplers=t.samplers,s.renderStates=t.renderStates,Object(l.a)(e._precreatedAttributes)&&gY(e,n),e._cachedGeometryByteLength+=function(e){let t=0;for(const n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}(t.buffers),e._cachedTexturesByteLength+=function(e){let t=0;for(const n in e)e.hasOwnProperty(n)&&(t+=e[n].sizeInBytes);return t}(t.textures)}else!function(e,t){const n=e._loadResources;if(0!==n.pendingBufferLoads)return;const i=t.context,r=n.vertexBuffersToCreate,o=n.indexBuffersToCreate;let a;if(e.asynchronous){for(;r.length>0&&(tY.set(r.peek(),e,i),t.jobScheduler.execute(tY,Kq.BUFFER));)r.dequeue();for(;o.length>0&&(a=o.peek(),nY.set(a.id,a.componentType,e,i),t.jobScheduler.execute(nY,Kq.BUFFER));)o.dequeue()}else{for(;r.length>0;)$W(r.dequeue(),e,i);for(;o.length>0;)a=o.dequeue(),eY(a.id,a.componentType,e,i)}}(e,t),function(e,t){const n=e._loadResources,i=n.programsToCreate;if(0!==n.pendingShaderLoads)return;if(0!==n.pendingBufferLoads)return;const r=t.context;if(e.asynchronous)for(;i.length>0&&(uY.set(i.peek(),e,r),t.jobScheduler.execute(uY,Kq.PROGRAM));)i.dequeue();else for(;i.length>0;)sY(i.dequeue(),e,r)}(e,t),function(e){const t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;const n=e._rendererResources.samplers;kV.sampler(e.gltfInternal,(function(e,t){n[t]=new WD({wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minFilter,magnificationFilter:e.magFilter})}))}}(e),function(e){const t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){const n=t.texturesToCreateFromBufferView.dequeue(),i=e.gltfInternal,r=i.bufferViews[n.bufferView],o=(i.textures[n.id].source,nG.getFailedLoadFunction(e,"image",`id: ${n.id}, bufferView: ${n.bufferView}`));if("image/ktx2"===n.mimeType){const i=new Uint8Array(t.getBuffer(r));sE(i).then(XW(e,n.id)).catch(o),++e._loadResources.pendingTextureLoads}else{const e=hY(t,n);rE({uint8Array:t.getBuffer(r),format:n.mimeType,flipY:!1,skipColorSpaceConversion:!0}).then(e).catch(o),++t.pendingBufferViewToImage}}}(e),function(e,t){const n=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(pY.set(i.peek(),e,n),t.jobScheduler.execute(pY,Kq.TEXTURE));)i.dequeue();else for(;i.length>0;)fY(i.dequeue(),e,n)}(e,t);!function(e){const t=e._loadResources;if(0!==t.pendingBufferLoads)return;if(!t.createSkins)return;t.createSkins=!1;const n=e.gltfInternal,i=n.accessors,r={};kV.skin(n,(function(t,n){const o=i[t.inverseBindMatrices];let a;Me.equals(t.bindShapeMatrix,Me.IDENTITY)||(a=Me.clone(t.bindShapeMatrix)),r[n]={inverseBindMatrices:iW.getSkinInverseBindMatrices(e,o),bindShapeMatrix:a}})),function(e,t){const n=e.gltfInternal,i=n.skins,r=n.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length;for(let e=0;e<s;++e){const n=a[e],s=o[n],c=r[n],l=t[c.skin];s.inverseBindMatrices=l.inverseBindMatrices,s.bindShapeMatrix=l.bindShapeMatrix;const u=i[c.skin].joints,h=u.length;for(let e=0;e<h;++e){const t=o[u[e]];s.joints.push(t)}}}(e,r)}(e),function(e){const t=e._loadResources;if(!t.finishedPendingBufferLoads())return;if(!t.createRuntimeAnimations)return;t.createRuntimeAnimations=!1,e._runtime.animations=[];const n=e._runtime.nodes,i=e.gltfInternal.accessors;kV.animation(e.gltfInternal,(function(t,r){const o=t.channels,a=t.samplers;let s=Number.MAX_VALUE,c=-Number.MAX_VALUE;const l=o.length,u=new Array(l);for(let h=0;h<l;++h){const l=o[h],d=l.target,f=d.path,p=a[l.sampler],m=iW.getAnimationParameterValues(e,i[p.input]),g=iW.getAnimationParameterValues(e,i[p.output]);s=Math.min(s,m[0]),c=Math.max(c,m[m.length-1]);const _=iW.getAnimationSpline(e,r,t,l.sampler,p,m,f,g);u[h]=mY(e,n[d.node],d.path,_)}e._runtime.animations[r]={name:t.name,startTime:s,stopTime:c,channelEvaluators:u}}))}(e),e._loadRendererResourcesFromCache||(gY(e,n),_Y(e)),function(e,t){const n=e._loadResources;if(!n.finishedProgramCreation())return;if(!n.createUniformMaps)return;n.createUniformMaps=!1;const i=e.gltfInternal,r=e._sourceTechniques,o=e._uniformMaps,a=e._rendererResources.textures,s=e._defaultTexture;kV.material(i,(function(n,i){const c=e._runtime.materialsById[i],u=r[c._technique],h=c._values,d=bY(e,n,u,h,t,a,s),f=o[i];if(f.uniformMap=d.map,f.values=d.values,f.jointMatrixUniformName=d.jointMatrixUniformName,f.morphWeightsUniformName=d.morphWeightsUniformName,Object(l.a)(u.attributes.a_outlineCoordinates)){const n=SW.createTexture(e,t);f.uniformMap.u_outlineTexture=function(){return n}}}))}(e,n),function(e,t,n){const i=e._loadResources;if(!i.finishedEverythingButTextureCreation())return;if(!i.createRuntimeNodes)return;i.createRuntimeNodes=!1;const r=[],o=e._runtime.nodes,a=e.gltfInternal,s=a.nodes,c=a.scenes[a.scene].nodes,u=c.length,h=[],d={};for(let i=0;i<u;++i)for(h.push({parentRuntimeNode:void 0,gltfNode:s[c[i]],id:c[i]});h.length>0;){const i=h.pop();d[i.id]=!0;const a=i.parentRuntimeNode,c=i.gltfNode,u=o[i.id];if(0===u.parents.length)if(Object(l.a)(c.matrix))u.matrix=Me.fromColumnMajorArray(c.matrix);else{const e=c.rotation;u.translation=O.fromArray(c.translation),u.rotation=To.unpack(e),u.scale=O.fromArray(c.scale)}Object(l.a)(a)?(a.children.push(u),u.parents.push(a)):r.push(u),Object(l.a)(c.mesh)&&UY(e,c,u,t,n);const f=c.children;if(Object(l.a)(f)){const e=f.length;for(let t=0;t<e;t++){const e=f[t];d[e]||h.push({parentRuntimeNode:u,gltfNode:s[e],id:f[t]})}}}e._runtime.rootNodes=r,e._runtime.nodes=o}(e,n,i)}function HY(e,t){const n=e.publicNode,i=n.matrix;n.useMatrix&&Object(l.a)(i)?Me.clone(i,t):Object(l.a)(e.matrix)?Me.clone(e.matrix,t):(Me.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),n.setMatrix(t))}const GY=[],qY=new _e,WY=new Me;let YY=new Me;function XY(e,t){const n=XR.shallowClone(t);return n.pass=KR.TRANSLUCENT,n.renderState=function(e,t){const n=Object(Zf.a)(t,!0);return n.cull.enabled=!1,n.depthTest.enabled=!0,n.depthMask=!1,n.blending=SD.ALPHA_BLEND,e.opaquePass===KR.CESIUM_3D_TILE&&(n.stencilTest=qF.setCesium3DTileBit(),n.stencilMask=qF.CESIUM_3D_TILE_MASK),vj.fromCache(n)}(e,t.renderState),n}function KY(e,t,n){const i=t.scene3DOnly,r=e.color.alpha;if(r>0&&r<1){const t=e._nodeCommands,r=t.length;if(r>0&&(!Object(l.a)(t[0].translucentCommand)||n))for(let n=0;n<r;++n){const r=t[n],o=r.command;if(r.translucentCommand=XY(e,o),!i){const t=r.command2D;r.translucentCommand2D=XY(e,t)}}}}function JY(e){const t=XR.shallowClone(e);return t.renderState=function(e){const t=Object(Zf.a)(e,!0);return t.cull.enabled=!1,vj.fromCache(t)}(e.renderState),t}function ZY(e,t,n){const i=t.scene3DOnly;if(!e.backFaceCulling){const t=e._nodeCommands,r=t.length;if(r>0&&(!Object(l.a)(t[0].disableCullingCommand)||n))for(let e=0;e<r;++e){const n=t[e],r=n.command;if(n.disableCullingCommand=JY(r),!i){const e=n.command2D;n.disableCullingCommand2D=JY(e)}}}}function $Y(e,t){const n=e._rendererResources.programs;for(const e in n)if(n.hasOwnProperty(e)&&n[e]===t)return e}function QY(e,t,n){let i=t.vertexShaderSource.sources[0];const r=t._attributeLocations,o=e._normalAttributeName;i=UN.replaceMain(i,"gltf_silhouette_main"),i+=`uniform float gltf_silhouetteSize; \nvoid main() \n{ \n    gltf_silhouette_main(); \n    vec3 n = normalize(czm_normal3D * ${o}); \n    n.x *= czm_projection[0][0]; \n    n.y *= czm_projection[1][1]; \n    vec4 clip = gl_Position; \n    clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z; \n    gl_Position = clip; \n}`;return oM.fromCache({context:n.context,vertexShaderSource:i,fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n    gl_FragColor = czm_gammaCorrect(gltf_silhouetteColor); \n}",attributeLocations:r})}function eX(e,t){return zW(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&Object(l.a)(e._normalAttributeName)}function tX(e){return e.color.alpha>0&&e.color.alpha<1}function nX(e){return 0===e.color.alpha}function iX(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}let rX=0;function oX(e,t){const n=++rX%255,i=function(e){const t=e._nodeCommands,n=t.length;for(let e=0;e<n;++e){if(t[e].command.pass===KR.TRANSLUCENT)return!0}return!1}(e)||tX(e)||e.silhouetteColor.alpha<1,r=e._rendererResources.silhouettePrograms,o=t.scene3DOnly,a=e._nodeCommands,s=a.length;for(let c=0;c<s;++c){const s=a[c],u=s.command,h=tX(e)?s.translucentCommand:u,d=XR.shallowClone(h);let f=Object(Zf.a)(h.renderState);f.stencilTest={enabled:!0,frontFunction:ps.ALWAYS,backFunction:ps.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.REPLACE},backOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.REPLACE}},nX(e)&&(f.colorMask={red:!1,green:!1,blue:!1,alpha:!1},f.depthMask=!1),f=vj.fromCache(f),d.renderState=f,s.silhouetteModelCommand=d;const p=XR.shallowClone(u);f=Object(Zf.a)(u.renderState,!0),f.depthTest.enabled=!0,f.cull.enabled=!1,i&&(p.pass=KR.TRANSLUCENT,f.depthMask=!1,f.blending=SD.ALPHA_BLEND),f.stencilTest={enabled:!0,frontFunction:ps.NOTEQUAL,backFunction:ps.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.KEEP},backOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.KEEP}},f=vj.fromCache(f);const m=u.shaderProgram,g=$Y(e,m);let _=r[g];Object(l.a)(_)||(_=QY(e,m,t),r[g]=_);const y=Object(up.a)(u.uniformMap,{gltf_silhouetteColor:TY(e),gltf_silhouetteSize:CY(e)});if(p.renderState=f,p.shaderProgram=_,p.uniformMap=y,p.castShadows=!1,p.receiveShadows=!1,s.silhouetteColorCommand=p,!o){const e=s.command2D,t=XR.shallowClone(d);t.boundingVolume=e.boundingVolume,t.modelMatrix=e.modelMatrix,s.silhouetteModelCommand2D=t;const n=XR.shallowClone(p);t.boundingVolume=e.boundingVolume,t.modelMatrix=e.modelMatrix,s.silhouetteColorCommand2D=n}}}function aX(e,t,n){if(!eX(e,t))return;const i=e._nodeCommands,r=i.length>0&&(iX(e.color.alpha,e._colorPreviousAlpha)||iX(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!Object(l.a)(i[0].silhouetteModelCommand));e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(r||n)&&oX(e,t)}const sX=new At;const cX=new O,lX=new R;function uX(e,t){let n=e.scale;if(0!==e.minimumPixelSize){const i=t.context,r=Math.max(i.drawingBufferWidth,i.drawingBufferHeight),o=Object(l.a)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(cX.x=o[12],cX.y=o[13],cX.z=o[14],Object(l.a)(e._rtcCenter)&&O.add(e._rtcCenter,cX,cX),e._mode!==AB.SCENE3D){const e=t.mapProjection,n=e.ellipsoid.cartesianToCartographic(cX,lX);e.project(n,cX),O.fromElements(cX.z,cX.x,cX.y,cX)}const a=e.boundingSphereInternal.radius,s=function(e,t,n){return sX.center=e,sX.radius=t,n.camera.getPixelSize(sX,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}(cX,a,t),c=1/s;Math.min(c*(2*a),r)<e.minimumPixelSize&&(n=e.minimumPixelSize*s/(2*e._initialRadius))}return Object(l.a)(e.maximumScale)?Math.min(e.maximumScale,n):n}function hX(e){Object(l.a)(e._cacheKey)&&Object(l.a)(e._cachedGltf)&&0==--e._cachedGltf.count&&delete NW[e._cacheKey],e._cachedGltf=void 0}function dX(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function fX(e){for(const t in e)e.hasOwnProperty(t)&&e[t].destroy()}function pX(e,t,n){return function(i){if(e.heightReference===qP.RELATIVE_TO_GROUND){const e=t.cartesianToCartographic(i,lX);e.height+=n.height,t.cartographicToCartesian(e,i)}const r=e._clampedModelMatrix;Me.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightChanged=!0}}dX.prototype.release=function(){if(0==--this.count)return Object(l.a)(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],fX((e=this).buffers),fX(e.vertexArrays),fX(e.programs),fX(e.silhouettePrograms),fX(e.textures),sc(this);var e};const mX=new O,gX=new R;const _X=new Me,yX=new ce,bX=new Me;function vX(e,t){e.programs!==t.programs&&fX(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&fX(e.silhouettePrograms)}FW.prototype.update=function(e){if(e.mode===AB.MORPHING)return;if(!Jr.supportsWebP.initialized)return void Jr.supportsWebP.initialize();const t=e.context;this._defaultTexture=t.defaultTexture;const n=Jr.supportsWebP();if(this._state===RW.NEEDS_LOAD&&Object(l.a)(this.gltfInternal)){let n;const i=this.cacheKey;if(Object(l.a)(i)){t.cache.modelRendererResourceCache=Object(c.a)(t.cache.modelRendererResourceCache,{});const e=t.cache.modelRendererResourceCache;if(n=e[this.cacheKey],Object(l.a)(n)){if(!n.ready)return;++n.count,this._loadRendererResourcesFromCache=!0}else n=new dX(t,i),n.count=1,e[this.cacheKey]=n;this._cachedRendererResources=n}else n=new dX(t),n.count=1,this._cachedRendererResources=n;if(this._state=RW.LOADING,this._state!==RW.FAILED){const t=this.gltfInternal.extensions;if(Object(l.a)(t)&&Object(l.a)(t.CESIUM_RTC)){const n=O.fromArray(t.CESIUM_RTC.center);if(!O.equals(n,O.ZERO)){this._rtcCenter3D=n;const t=e.mapProjection,i=t.ellipsoid.cartesianToCartographic(this._rtcCenter3D),r=t.project(i);O.fromElements(r.z,r.x,r.y,r),this._rtcCenter2D=r,this._rtcCenterEye=new O,this._rtcCenter=this._rtcCenter3D}}WV(this.gltfInternal),this._loadResources=new RH,this._loadRendererResourcesFromCache||nG.parseBuffers(this,YW)}}const i=this._loadResources,r=this._incrementallyLoadTextures;let o=!1;if(this._state===RW.LOADING){if(0===i.pendingBufferLoads){if(!i.initialized){if(e.brdfLutGenerator.update(e),nG.checkSupportedExtensions(this.extensionsRequired,n),nG.updateForwardAxis(this),!Object(l.a)(this.gltfInternal.extras.sourceVersion)){const e=this.gltfInternal,t=nG.getAssetVersion(e),n=Object(l.a)(nG.getUsedExtensions(e).KHR_techniques_webgl);"2.0"!==t&&ll("gltf-1.0","glTF 1.0 assets were deprecated in CesiumJS 1.94. They will be removed in 1.97. Please convert any glTF 1.0 assets to glTF 2.0."),n&&ll("KHR_techniques_webgl","Support for glTF 1.0 techniques and the KHR_techniques_webgl glTF extension were deprecated in CesiumJS 1.94. It will be removed in 1.97. If custom GLSL shaders are needed, use CustomShader instead."),e.extras.sourceVersion=t,e.extras.sourceKHRTechniquesWebGL=n,this._sourceVersion=t,this._sourceKHRTechniquesWebGL=n,PH(e),GV(e);const i={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};rG(e,i),hG(e,i)}this._sourceVersion=this.gltfInternal.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltfInternal.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&qq.hasExtension(this),function(e){const t=e.gltfInternal,n=e._loadResources;kV.buffer(t,(function(e,t){n.buffers[t]=e.extras._pipeline.source}))}(this),function(e){const t={},n={},i={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=n,e._runtime.stagesByKey=i;const r=e.gltfInternal;if(!FV(r,"AGI_articulations")||!Object(l.a)(r.extensions)||!Object(l.a)(r.extensions.AGI_articulations))return;const o=r.extensions.AGI_articulations.articulations;if(!Object(l.a)(o))return;const a=o.length;for(let e=0;e<a;++e){const r=Object(Zf.a)(o[e]);r.nodes=[],r.isDirty=!0,t[r.name]=r;const a=r.stages.length;for(let e=0;e<a;++e){const t=r.stages[e];t.currentValue=t.initialValue;const o=`${r.name} ${t.name}`;n[o]=r,i[o]=t}}}(this),function(e){const t=e.gltfInternal;if(!FV(t,"KHR_techniques_webgl"))return;const n=e._sourcePrograms,i=e._sourceTechniques,r=t.extensions.KHR_techniques_webgl.programs;kV.technique(t,(function(e,t){i[t]=Object(Zf.a)(e);const o=e.program;Object(l.a)(n[o])||(n[o]=Object(Zf.a)(r[o]))}))}(this),this._loadRendererResourcesFromCache||(function(e){const t=e.gltfInternal.bufferViews,n=e._loadResources.vertexBuffersToCreate;kV.bufferView(e.gltfInternal,(function(e,t){e.target===ps.ARRAY_BUFFER&&n.enqueue(t)}));const i=e._loadResources.indexBuffersToCreate,r={};kV.accessor(e.gltfInternal,(function(e){const n=e.bufferView;if(!Object(l.a)(n))return;t[n].target!==ps.ELEMENT_ARRAY_BUFFER||Object(l.a)(r[n])||(r[n]=!0,i.enqueue({id:n,componentType:e.componentType}))}))}(this),function(e){const t=e.gltfInternal,n=t.buffers,i=t.bufferViews,r=e._rendererResources.sourceShaders;kV.shader(t,(function(t,o){if(Object(l.a)(t.bufferView)){const e=t.bufferView,a=i[e],s=a.buffer,c=n[s],l=Gu(c.extras._pipeline.source,a.byteOffset,a.byteLength);r[o]=l}else if(Object(l.a)(t.extras._pipeline.source))r[o]=t.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;const n=e._resource.getDerivedResource({url:t.uri});n.fetchText().then(function(e,t,n){return function(i){const r=e._loadResources;r.shaders[n]={source:i,type:t,bufferView:void 0},--r.pendingShaderLoads,e._rendererResources.sourceShaders[n]=i}}(e,t.type,o)).catch(nG.getFailedLoadFunction(e,"shader",n.url))}}))}(this),function(e){const t=e._sourceTechniques;for(const n in t)if(t.hasOwnProperty(n)){const i=t[n];e._loadResources.programsToCreate.enqueue({programId:i.program,techniqueId:n})}}(this),function(e,t,n){const i=e.gltfInternal,r=i.images;let o;kV.texture(i,(function(i,a){let s=i.source;Object(l.a)(i.extensions)&&Object(l.a)(i.extensions.EXT_texture_webp)&&n?s=i.extensions.EXT_texture_webp.source:Object(l.a)(i.extensions)&&Object(l.a)(i.extensions.KHR_texture_basisu)&&t.supportsBasis&&(s=i.extensions.KHR_texture_basisu.source);const c=r[s],u=c.bufferView,h=c.mimeType;if(o=c.uri,Object(l.a)(u))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:u,mimeType:h});else{++e._loadResources.pendingTextureLoads;const t=e._resource.getDerivedResource({url:o});let n;n=KW.test(o)?sE(t):t.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0}),n.then(XW(e,a)).catch(nG.getFailedLoadFunction(e,"image",t.url))}}))}(this,t,n)),function(e){const t=e.gltfInternal,n=e._sourceTechniques,i={},r={},o=e._uniformMaps;kV.material(t,(function(t,a){o[a]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};const s=new mW(e,t,a);if(Object(l.a)(t.extensions)&&Object(l.a)(t.extensions.KHR_techniques_webgl)){const e=t.extensions.KHR_techniques_webgl.technique;s._technique=e,s._program=n[e].program,kV.materialValue(t,(function(e,t){Object(l.a)(s._values)||(s._values={}),s._values[t]=Object(Zf.a)(e)}))}i[t.name]=s,r[a]=s})),e._runtime.materialsByName=i,e._runtime.materialsById=r}(this),function(e){const t={},n=e._runtime.materialsById;kV.mesh(e.gltfInternal,(function(i,r){t[i.name]=new _W(i,n,r),(Object(l.a)(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&kV.meshPrimitive(i,(function(t,n){const i=iY(e,t);let o=e._programPrimitives[i];Object(l.a)(o)||(o={},e._programPrimitives[i]=o),o[`${r}.primitive.${n}`]=t}))})),e._runtime.meshesByName=t}(this),function(e){const t={},n={},i=[],r=e._loadResources.skinnedNodesIds,o=e._runtime.articulationsByName;kV.node(e.gltfInternal,(function(a,s){const c={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new Me,computedMatrix:new Me,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:a.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(c.publicNode=new bW(e,a,c,s,nG.getTransform(a)),t[s]=c,n[a.name]=c,Object(l.a)(a.skin)&&(r.push(s),i.push(c)),Object(l.a)(a.extensions)&&Object(l.a)(a.extensions.AGI_articulations)){const e=a.extensions.AGI_articulations.articulationName;if(Object(l.a)(e)){let t=Me.clone(c.publicNode.originalMatrix,JW);const n=o[e];n.nodes.push(c.publicNode);const i=n.stages.length;for(let e=0;e<i;++e){t=qW(n.stages[e],t)}c.publicNode.matrix=t}}})),e._runtime.nodes=t,e._runtime.nodesByName=n,e._runtime.skinnedNodes=i}(this),function(e){const t=e.gltfInternal.asset.copyright;if(!Object(l.a)(t))return;const n=e._showCreditsOnScreen,i=t.split(";").map((function(e){return new ln(e.trim(),n)}));e._gltfCredits=i}(this),qq.parse(this,t),i.initialized=!0}i.finishedDecoding()||qq.decodeModel(this,t).catch(nG.getFailedLoadFunction(this,"model",this.basePathInternal)),i.finishedDecoding()&&!i.resourcesParsed&&(this._boundingSphere=nG.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,qq.cacheDataForModel(this),i.resourcesParsed=!0),i.resourcesParsed&&0===i.pendingShaderLoads&&(this.showOutline&&SW.outlinePrimitives(this),VY(this,e))}(i.finished()||r&&i.finishedEverythingButTextureCreation())&&(this._state=RW.LOADED,o=!0)}if(Object(l.a)(i)&&this._state===RW.LOADED&&(r&&!o&&VY(this,e),i.finished())){this._loadResources=void 0;const e=this._rendererResources,t=this._cachedRendererResources;t.buffers=e.buffers,t.vertexArrays=e.vertexArrays,t.programs=e.programs,t.sourceShaders=e.sourceShaders,t.silhouettePrograms=e.silhouettePrograms,t.textures=e.textures,t.samplers=e.samplers,t.renderStates=e.renderStates,t.ready=!0,this._normalAttributeName=nG.getAttributeOrUniformBySemantic(this.gltfInternal,"NORMAL"),Object(l.a)(this._precreatedAttributes)&&(t.vertexArrays={}),this.releaseGltfJson&&hX(this)}const a=eX(this,e),s=tX(this),d=nX(this),f=this.backFaceCulling,p=!Object(l.a)(this.distanceDisplayCondition)||function(e,t){let n;const i=e.distanceDisplayCondition,r=i.near*i.near,o=i.far*i.far;if(t.mode===AB.SCENE2D){n=.5*(t.camera.frustum.right-t.camera.frustum.left),n*=n}else{let i=Me.getTranslation(e.modelMatrix,mX);if(t.mode===AB.COLUMBUS_VIEW){const e=t.mapProjection,n=e.ellipsoid.cartesianToCartographic(i,gX);i=e.project(n,i),O.fromElements(i.z,i.x,i.y,i)}n=O.distanceSquared(i,t.camera.positionWC)}return n>=r&&n<=o}(this,e),m=this.show&&p&&0!==this.scale&&(!d||a);if(this._imageBasedLighting.update(e),m&&this._state===RW.LOADED||o){const n=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;let i=this.modelMatrix;const r=e.mode!==this._mode;this._mode=e.mode;const a=!Me.equals(this._modelMatrix,i)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||r;if(a||o){Me.clone(i,this._modelMatrix),function(e){Object(l.a)(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);const t=e._scene;if(!Object(l.a)(t)||!Object(l.a)(t.globe)||e.heightReference===qP.NONE){if(e.heightReference!==qP.NONE)throw new u.a("Height reference is not supported without a scene and globe.");return void(e._clampedModelMatrix=void 0)}const n=t.globe,i=n.ellipsoid,r=e.modelMatrix;cX.x=r[12],cX.y=r[13],cX.z=r[14];const o=i.cartesianToCartographic(cX);Object(l.a)(e._clampedModelMatrix)||(e._clampedModelMatrix=Me.clone(r,new Me));const a=n._surface;e._removeUpdateHeightCallback=a.updateHeight(o,pX(e,i,o));const s=n.getHeight(o);if(Object(l.a)(s)){const t=pX(e,i,o);R.clone(o,lX),lX.height=s,i.cartographicToCartesian(lX,cX),t(cX)}}(this),Object(l.a)(this._clampedModelMatrix)&&(i=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;const t=uX(this,e),n=this._computedModelMatrix;Me.multiplyByUniformScale(i,t,n),this._upAxis===HU.Y?Me.multiplyTransformation(n,HU.Y_UP_TO_Z_UP,n):this._upAxis===HU.X&&Me.multiplyTransformation(n,HU.X_UP_TO_Z_UP,n),this.forwardAxis===HU.Z&&Me.multiplyTransformation(n,HU.Z_UP_TO_X_UP,n)}(n||a||o)&&(function(e,t,n,i){const r=e._maxDirtyNumber,o=e._runtime.rootNodes,a=o.length,s=GY;let c=e._computedModelMatrix;if(e._mode!==AB.SCENE3D&&!e._ignoreCommands){const t=Me.getColumn(c,3,qY);if(_e.equals(t,_e.UNIT_W)){const t=e.boundingSphereInternal.center,n=ca.wgs84To2DModelMatrix(i,t,WY);c=Me.multiply(n,c,WY),Object(l.a)(e._rtcCenter)&&(Me.setTranslation(c,_e.UNIT_W,c),e._rtcCenter=e._rtcCenter2D)}else c=ca.basisTo2D(i,c,WY),e._rtcCenter=e._rtcCenter3D}for(let u=0;u<a;++u){let a=o[u];for(HY(a,a.transformToRoot),s.push(a);s.length>0;){a=s.pop();const o=a.transformToRoot,u=a.commands;if(a.dirtyNumber===r||t||n){const t=Me.multiplyTransformation(c,o,a.computedMatrix),n=u.length;if(n>0)for(let r=0;r<n;++r){const n=u[r];let o=n.command;Me.clone(t,o.modelMatrix),At.transform(n.boundingSphere,o.modelMatrix,o.boundingVolume),Object(l.a)(e._rtcCenter)&&O.add(e._rtcCenter,o.boundingVolume.center,o.boundingVolume.center),o=n.command2D,Object(l.a)(o)&&e._mode===AB.SCENE2D&&(Me.clone(t,o.modelMatrix),o.modelMatrix[13]-=2*h.a.sign(o.modelMatrix[13])*h.a.PI*i.ellipsoid.maximumRadius,At.transform(n.boundingSphere,o.modelMatrix,o.boundingVolume))}}const d=a.children;if(Object(l.a)(d)){const e=d.length;for(let t=0;t<e;++t){const e=d[t];e.dirtyNumber=Math.max(e.dirtyNumber,a.dirtyNumber),(e.dirtyNumber===r||n)&&(HY(e,e.transformToRoot),Me.multiplyTransformation(o,e.transformToRoot,e.transformToRoot)),s.push(e)}}}}++e._maxDirtyNumber}(this,a,o,e.mapProjection),this._dirty=!0,(n||o)&&function(e){const t=e._runtime.skinnedNodes,n=t.length;for(let e=0;e<n;++e){const n=t[e];YY=Me.inverseTransformation(n.transformToRoot,YY);const i=n.computedJointMatrices,r=n.joints,o=n.bindShapeMatrix,a=n.inverseBindMatrices,s=a.length;for(let e=0;e<s;++e)Object(l.a)(i[e])||(i[e]=new Me),i[e]=Me.multiplyTransformation(YY,r[e].transformToRoot,i[e]),i[e]=Me.multiplyTransformation(i[e],a[e],i[e]),Object(l.a)(o)&&(i[e]=Me.multiplyTransformation(i[e],o,i[e]))}}(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,function(e){const t=e._runtime.rootNodes,n=t.length,i=GY;for(let e=0;e<n;++e){let n=t[e];for(n.computedShow=n.publicNode.show,i.push(n);i.length>0;){n=i.pop();const e=n.computedShow,t=n.commands,r=t.length;for(let n=0;n<r;++n)t[n].show=e;const o=n.children;if(Object(l.a)(o)){const t=o.length;for(let n=0;n<t;++n){const t=o[n];t.computedShow=e&&t.publicNode.show,i.push(t)}}}}}(this)),function(e,t){const n=e.id;if(e._id!==n){e._id=n;const t=e._pickIds,i=t.length;for(let e=0;e<i;++e)t[e].object.id=n}}(this),function(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;const t=e.debugWireframe?zl.LINES:zl.TRIANGLES,n=e._nodeCommands,i=n.length;for(let e=0;e<i;++e)n[e].command.primitiveType=t}}(this),function(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;const t=e.debugShowBoundingVolume,n=e._nodeCommands,i=n.length;for(let e=0;e<i;++e)n[e].command.debugShowBoundingVolume=t}}(this),function(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;const t=TB.castShadows(e.shadows),n=TB.receiveShadows(e.shadows),i=e._nodeCommands,r=i.length;for(let e=0;e<r;e++){const r=i[e];r.command.castShadows=t,r.command.receiveShadows=n}}}(this),function(e,t){const n=e._clippingPlanes;Object(l.a)(n)&&n.owner===e&&n.enabled&&n.update(t)}(this,e);const s=this._clippingPlanes;let d=0;const f=Object(c.a)(this.referenceMatrix,i);if(this._imageBasedLighting.useSphericalHarmonicCoefficients||this._imageBasedLighting.useSpecularEnvironmentMaps){let e=yX,n=_X;n=Me.multiply(t.uniformState.view3D,f,n),e=Me.getMatrix3(n,e),e=ce.getRotation(e,e),this._iblReferenceFrameMatrix=ce.transpose(e,this._iblReferenceFrameMatrix)}if(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLighting.shouldRegenerateShaders,UW(this)){let e=bX;e=Me.multiply(t.uniformState.view3D,f,e),e=Me.multiply(e,s.modelMatrix,e),this._clippingPlanesMatrix=Me.inverseTranspose(e,this._clippingPlanesMatrix),d=s.clippingPlanesState}this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._clippingPlanesState!==d,this._clippingPlanesState=d;const p=kW(this);p!==this._colorShadingEnabled&&(this._colorShadingEnabled=p,this._shouldRegenerateShaders=!0);const m=this.splitDirection!==IW.NONE;this._splittingEnabled!==m&&(this._splittingEnabled=m,this._shouldRegenerateShaders=!0),this._shouldRegenerateShaders?function(e,t){const n=e._rendererResources,i=e._cachedRendererResources;let r;if(vX(n,i),UW(e)||kW(e)||e.splitDirection!==IW.NONE||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,n.programs={},n.silhouettePrograms={};const i={},o=e._sourceTechniques;let a;for(const n in o)o.hasOwnProperty(n)&&(a=o[n],r=a.program,i[r]||(i[r]=!0,cY({programId:r,techniqueId:n},e,t.context)))}else n.programs=i.programs,n.silhouettePrograms=i.silhouettePrograms;const o=n.programs,a=e._nodeCommands,s=a.length;for(let e=0;e<s;++e){const t=a[e];r=t.programId;const n=o[r];t.command.shaderProgram=n,Object(l.a)(t.command2D)&&(t.command2D.shaderProgram=n)}KY(e,t,!0),ZY(e,t,!0),aX(e,t,!0)}(this,e):(KY(this,e,!1),ZY(this,e,!1),aX(this,e,!1))}if(o){const t=this;return void e.afterRender.push((function(){t._ready=!0,t._readyPromise.resolve(t)}))}if(m&&!this._ignoreCommands){const t=e.commandList,n=e.passes,i=this._nodeCommands,r=i.length;let o,c;const l=e.mapProjection.ellipsoid.maximumRadius*h.a.PI;let u;if(n.render||n.pick&&this.allowPicking){for(o=0;o<r;++o)if(c=i[o],c.show){let n=c.command;a?n=c.silhouetteModelCommand:s?n=c.translucentCommand:f||(n=c.disableCullingCommand),t.push(n),u=c.command.boundingVolume;const i=u.center.y-u.radius,r=u.center.y+u.radius,o=i<l&&r>l||i<-l&&r>-l;if(e.mode===AB.SCENE2D&&o){let e=c.command2D;a?e=c.silhouetteModelCommand2D:s?e=c.translucentCommand2D:f||(e=c.disableCullingCommand2D),t.push(e)}}if(a&&!n.pick)for(o=0;o<r;++o)if(c=i[o],c.show){t.push(c.silhouetteColorCommand),u=c.command.boundingVolume;const n=u.center.y-u.radius,i=u.center.y+u.radius,r=n<l&&i>l||n<-l&&i>-l;e.mode===AB.SCENE2D&&r&&t.push(c.silhouetteColorCommand2D)}}}const g=this._credit;Object(l.a)(g)&&e.creditDisplay.addCredit(g);const _=this._resourceCredits,y=_.length;for(let t=0;t<y;t++)e.creditDisplay.addCredit(_[t]);const b=this._gltfCredits,v=b.length;for(let t=0;t<v;t++)e.creditDisplay.addCredit(b[t])},FW.prototype.isDestroyed=function(){return!1},FW.prototype.destroy=function(){Object(l.a)(this._precreatedAttributes)&&fX(this._rendererResources.vertexArrays),Object(l.a)(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),Object(l.a)(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),Object(l.a)(this._cachedRendererResources)&&vX(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),qq.destroyCachedDataForModel(this);const e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();hX(this),this._quantizedVertexShaders=void 0;const n=this._clippingPlanes;return Object(l.a)(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,sc(this)},FW._getClippingFunction=Xq,FW._modifyShaderForColor=function(e){return e=UN.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n    gltf_blend_main(); \n    gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n    float highlight = ceil(gltf_colorBlend); \n    gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n    gl_FragColor.a *= gltf_color.a; \n} \n"};var OX=FW;function wX(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._batchTable=void 0,this._features=void 0,this._classificationType=e.vectorClassificationOnly?void 0:e.classificationType,this._metadata=void 0,this._batchIdAttributeName=void 0,this._diffuseAttributeOrUniformName={},this._rtcCenterTransform=void 0,this._contentModelMatrix=void 0,this.featurePropertiesDirty=!1,this._group=void 0,function(e,t,n){const i=e._tileset,r=e._tile,o=e._resource,a=YU.parse(t,n);let s=a.batchLength;const c=a.featureTableJson,u=a.featureTableBinary,h=new NV(c,u);s=h.getGlobalProperty("BATCH_LENGTH"),h.featuresLength=s;const d=a.batchTableJson,f=a.batchTableBinary;let p;Object(l.a)(e._classificationType)&&(p=function(e){return function(t,n){e._model.updateCommands(t,n)}}(e));const m=new DV(e,s,d,f,p);e._batchTable=m;const g=a.gltf,_={content:e,primitive:i};e._rtcCenterTransform=Me.IDENTITY;const y=h.getGlobalProperty("RTC_CENTER",gs.FLOAT,3);Object(l.a)(y)&&(e._rtcCenterTransform=Me.fromTranslation(O.fromArray(y)));e._contentModelMatrix=Me.multiply(r.computedTransform,e._rtcCenterTransform,new Me),Object(l.a)(e._classificationType)?e._model=new Oq({gltf:g,cull:!1,basePath:o,requestType:Uc.a.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:i._modelUpAxis,forwardAxis:i._modelForwardAxis,debugWireframe:i.debugWireframe,vertexShaderLoaded:AX(e),classificationShaderLoaded:CX(e),uniformMapLoaded:m.getUniformMapCallback(),pickIdLoaded:TX(e),classificationType:e._classificationType,batchTable:m}):(e._model=new OX({gltf:g,cull:!1,releaseGltfJson:!0,opaquePass:KR.CESIUM_3D_TILE,basePath:o,requestType:Uc.a.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:i._modelUpAxis,forwardAxis:i._modelForwardAxis,shadows:i.shadows,debugWireframe:i.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:AX(e),fragmentShaderLoaded:EX(e),uniformMapLoaded:m.getUniformMapCallback(),pickIdLoaded:TX(e),addBatchIdToGeneratedShaders:s>0,pickObject:_,lightColor:i.lightColor,imageBasedLighting:i.imageBasedLighting,backFaceCulling:i.backFaceCulling,showOutline:i.showOutline,showCreditsOnScreen:i.showCreditsOnScreen}),e._model.readyPromise.then((function(e){e.activeAnimations.addAll({loop:rW.REPEAT})})))}(this,i,r)}function AX(e){return function(t,n){const i=e._batchTable,r=!Object(l.a)(e._classificationType),o=e._model.gltfInternal;Object(l.a)(o)&&(e._batchIdAttributeName=function(e){let t=nG.getAttributeOrUniformBySemantic(e,"_BATCHID");return Object(l.a)(t)||(t=nG.getAttributeOrUniformBySemantic(e,"BATCHID"),Object(l.a)(t)&&wX._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`.")),t}(o),e._diffuseAttributeOrUniformName[n]=nG.getDiffuseAttributeOrUniform(o,n));const a=i.getVertexShaderCallback(r,e._batchIdAttributeName,e._diffuseAttributeOrUniformName[n]);return Object(l.a)(a)?a(t):t}}function EX(e){return function(t,n){const i=e._batchTable,r=!Object(l.a)(e._classificationType),o=e._model.gltfInternal;Object(l.a)(o)&&(e._diffuseAttributeOrUniformName[n]=nG.getDiffuseAttributeOrUniform(o,n));const a=i.getFragmentShaderCallback(r,e._diffuseAttributeOrUniformName[n],!1);return Object(l.a)(a)?a(t):t}}function TX(e){return function(){return e._batchTable.getPickId()}}function CX(e){return function(t){const n=e._batchTable.getClassificationFragmentShaderCallback();return Object(l.a)(n)?n(t):t}}wX._deprecationWarning=ll,Object.defineProperties(wX.prototype,{featuresLength:{get:function(){return this.batchTable.featuresLength}},pointsLength:{get:function(){return this._model.pointsLength}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this.batchTable.batchTableByteLength}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),wX.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},wX.prototype.getFeature=function(e){const t=this.featuresLength;if(!Object(l.a)(e)||e<0||e>=t)throw new u.a(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return function(e){const t=e.featuresLength;if(!Object(l.a)(e._features)&&t>0){const n=new Array(t);for(let i=0;i<t;++i)n[i]=new jV(e,i);e._features=n}}(this),this._features[e]},wX.prototype.applyDebugSettings=function(e,t){t=e?t:sp.WHITE,0===this.featuresLength?this._model.color=t:this._batchTable.setAllColor(t)},wX.prototype.applyStyle=function(e){if(0===this.featuresLength){const t=Object(l.a)(e)&&Object(l.a)(e.color),n=Object(l.a)(e)&&Object(l.a)(e.show);this._model.color=t?e.color.evaluateColor(void 0,this._model.color):sp.clone(sp.WHITE,this._model.color),this._model.show=!n||e.show.evaluate(void 0)}else this._batchTable.applyStyle(e)},wX.prototype.update=function(e,t){const n=t.commandList.length,i=this._model,r=this._tile,o=this._batchTable;o.update(e,t),this._contentModelMatrix=Me.multiply(r.computedTransform,this._rtcCenterTransform,this._contentModelMatrix),i.modelMatrix=this._contentModelMatrix,i.shadows=e.shadows,i.lightColor=e.lightColor,i.imageBasedLighting=e.imageBasedLighting,i.backFaceCulling=e.backFaceCulling,i.debugWireframe=e.debugWireframe,i.showCreditsOnScreen=e.showCreditsOnScreen,i.splitDirection=e.splitDirection;const a=e.clippingPlanes;i.referenceMatrix=e.clippingPlanesOriginMatrix,Object(l.a)(a)&&r.clippingPlanesDirty&&(i._clippingPlanes=a.enabled&&r._isClipped?a:void 0),Object(l.a)(a)&&Object(l.a)(i._clippingPlanes)&&i._clippingPlanes!==a&&(i._clippingPlanes=a),i.update(t);n<t.commandList.length&&(t.passes.render||t.passes.pick)&&!Object(l.a)(this._classificationType)&&o.addDerivedCommands(t,n)},wX.prototype.isDestroyed=function(){return!1},wX.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),sc(this)};var xX=wX;function SX(e,t,n,i,r,o){this._tileset=e,this._tile=t,this._resource=n,this._contents=[],this._metadata=void 0,this._group=void 0,this._readyPromise=function(e,t,n,i){n=Object(c.a)(n,0);const r=new Uint8Array(t),o=new DataView(t);n+=IX;const a=o.getUint32(n,!0);if(1!==a)throw new ye.a(`Only Composite Tile version 1 is supported. Version ${a} is not.`);n+=IX,n+=IX;const s=o.getUint32(n,!0);n+=IX;const u=[],h=e._resource;let d=h.queryParameters.compositeIndex;Object(l.a)(d)?d+="_":d="";for(let a=0;a<s;++a){const s=Jv(r,n),c=o.getUint32(n+2*IX,!0),f=i[s],p=`${d}${a}`,m=h.getDerivedResource({queryParameters:{compositeIndex:p}});if(!Object(l.a)(f))throw new ye.a(`Unknown tile content type, ${s}, inside Composite tile`);{const i=f(e._tileset,e._tile,m,t,n);e._contents.push(i),u.push(i.readyPromise)}n+=c}return Promise.all(u).then((function(){return e}))}(this,i,r,o)}Object.defineProperties(SX.prototype,{featurePropertiesDirty:{get:function(){const e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){const t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;const t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;const t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});const IX=Uint32Array.BYTES_PER_ELEMENT;SX.prototype.hasProperty=function(e,t){return!1},SX.prototype.getFeature=function(e){},SX.prototype.applyDebugSettings=function(e,t){const n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)},SX.prototype.applyStyle=function(e){const t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)},SX.prototype.update=function(e,t){const n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].update(e,t)},SX.prototype.isDestroyed=function(){return!1},SX.prototype.destroy=function(){const e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return sc(this)};var PX=SX;function DX(e){var t;this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,Object(l.a)(this._center)||(Object(l.a)(this._boundingVolume)?this._center=O.clone(this._boundingVolume.center):this._center=O.clone(O.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._update=function(e,t){},this._readyPromise=(t=this,new Promise((function(e,n){t._update=function(t,i){const r=function(e){if(!Object(l.a)(e._primitive)&&!Object(l.a)(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,h=e._packedBuffer;if(!Object(l.a)(u)){let d=0;Object(l.a)(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),d+=n.length),Object(l.a)(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),d+=r.length),Object(l.a)(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),a=e._ellipsoidBatchIds=a.slice(),d+=a.length),Object(l.a)(e._spheres)&&(s=e._sphere=s.slice(),c=e._sphereBatchIds=c.slice(),d+=c.length),u=e._batchTableColors=new Uint32Array(d);const f=e._batchTable;for(let e=0;e<d;++e){const t=f.getColor(e,jX);u[e]=t.toRgba()}h=e._packedBuffer=function(e){const t=new Float64Array(Me.packedLength+O.packedLength);let n=0;return O.pack(e._center,t,n),n+=O.packedLength,Me.pack(e._modelMatrix,t,n),t}(e)}const d=[];Object(l.a)(t)&&d.push(t.buffer,n.buffer),Object(l.a)(i)&&d.push(i.buffer,r.buffer),Object(l.a)(o)&&d.push(o.buffer,a.buffer),Object(l.a)(s)&&d.push(s.buffer,c.buffer),d.push(u.buffer,h.buffer);const f={boxes:Object(l.a)(t)?t.buffer:void 0,boxBatchIds:Object(l.a)(t)?n.buffer:void 0,cylinders:Object(l.a)(i)?i.buffer:void 0,cylinderBatchIds:Object(l.a)(i)?r.buffer:void 0,ellipsoids:Object(l.a)(o)?o.buffer:void 0,ellipsoidBatchIds:Object(l.a)(o)?a.buffer:void 0,spheres:Object(l.a)(s)?s.buffer:void 0,sphereBatchIds:Object(l.a)(s)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:h.buffer},p=e._verticesPromise=RX.scheduleTask(f,d);if(!Object(l.a)(p))return;return p.then((function(t){const n=new Float64Array(t.packedBuffer),i=function(e,t){let n=0;const i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let e=0;e<r;++e)o[e]=At.unpack(t,n),n+=At.packedLength;const a=t[n++],s=e._batchedIndices=new Array(a);for(let e=0;e<a;++e){const i=sp.unpack(t,n);n+=sp.packedLength;const r=t[n++],o=t[n++],a=t[n++],c=new Array(a);for(let e=0;e<a;++e)c[e]=t[n++];s[e]=new dG({color:i,offset:r,count:o,batchIds:c})}return i}(e,n);e._indices=2===i?new Uint16Array(t.indices):new Uint32Array(t.indices),e._indexOffsets=new Uint32Array(t.indexOffsets),e._indexCounts=new Uint32Array(t.indexCounts),e._positions=new Float32Array(t.positions),e._vertexBatchIds=new Uint16Array(t.vertexBatchIds),e._batchIds=new Uint16Array(t.batchIds),e._ready=!0}))}}(t);t._ready&&(t._primitive.debugWireframe=t.debugWireframe,t._primitive.forceRebatch=t.forceRebatch,t._primitive.classificationType=t.classificationType,t._primitive.update(i)),Object(l.a)(r)&&r.then((function(){!function(e){e._ready&&!Object(l.a)(e._primitive)&&(e._primitive=new cq({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:Object(c.a)(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}(t),e(t)})).catch((function(e){n(e)}))}}))),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=qN.BOTH}Object.defineProperties(DX.prototype,{trianglesLength:{get:function(){return Object(l.a)(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return Object(l.a)(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise}}}),DX.packedBoxLength=Me.packedLength+O.packedLength,DX.packedCylinderLength=Me.packedLength+2,DX.packedEllipsoidLength=Me.packedLength+O.packedLength,DX.packedSphereLength=O.packedLength+1;const RX=new _c("createVectorTileGeometries",5),jX=new sp;DX.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},DX.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},DX.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},DX.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},DX.prototype.update=function(e){this._update(this,e)},DX.prototype.isDestroyed=function(){return!1},DX.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),sc(this)};var MX=DX;function LX(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._readyPromise=function(e,t,n){n=Object(c.a)(n,0);const i=new Uint8Array(t),r=new DataView(t);n+=NX;const o=r.getUint32(n,!0);if(1!==o)throw new ye.a(`Only Geometry tile version 1 is supported.  Version ${o} is not.`);n+=NX;const a=r.getUint32(n,!0);if(n+=NX,0===a)return void e._readyPromise.resolve(e);const s=r.getUint32(n,!0);if(n+=NX,0===s)throw new ye.a("Feature table must have a byte length greater than zero");const u=r.getUint32(n,!0);n+=NX;const h=r.getUint32(n,!0);n+=NX;const d=r.getUint32(n,!0),f=qu(i,n+=NX,s);n+=s;const p=new Uint8Array(t,n,u);let m,g;n+=u,h>0&&(m=qu(i,n,h),n+=h,d>0&&(g=new Uint8Array(t,n,d),g=new Uint8Array(g)));const _=Object(c.a)(f.BOXES_LENGTH,0),y=Object(c.a)(f.CYLINDERS_LENGTH,0),b=Object(c.a)(f.ELLIPSOIDS_LENGTH,0),v=Object(c.a)(f.SPHERES_LENGTH,0),w=_+y+b+v,A=new DV(e,w,m,g,function(e){return function(t,n){Object(l.a)(e._geometries)&&e._geometries.updateCommands(t,n)}}(e));if(e._batchTable=A,0===w)return;const E=e.tile.computedTransform;let T;Object(l.a)(f.RTC_CENTER)&&(T=O.unpack(f.RTC_CENTER),Me.multiplyByPoint(E,T,T));const C=function(e,t){let n,i,r,o,a;const s=Object(c.a)(e.BOXES_LENGTH,0),u=Object(c.a)(e.CYLINDERS_LENGTH,0),h=Object(c.a)(e.ELLIPSOIDS_LENGTH,0),d=Object(c.a)(e.SPHERES_LENGTH,0);if(s>0&&Object(l.a)(e.BOX_BATCH_IDS)){const i=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,i,s)}if(u>0&&Object(l.a)(e.CYLINDER_BATCH_IDS)){const n=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,n,u)}if(h>0&&Object(l.a)(e.ELLIPSOID_BATCH_IDS)){const n=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,n,h)}if(d>0&&Object(l.a)(e.SPHERE_BATCH_IDS)){const n=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,n,d)}const f=Object(l.a)(n)||Object(l.a)(i)||Object(l.a)(r)||Object(l.a)(o),p=s>0&&!Object(l.a)(n)||u>0&&!Object(l.a)(i)||h>0&&!Object(l.a)(r)||d>0&&!Object(l.a)(o);if(f&&p)throw new ye.a("If one group of batch ids is defined, then all batch ids must be defined.");if(!(Object(l.a)(n)||Object(l.a)(i)||Object(l.a)(r)||Object(l.a)(o))){let e=0;if(!Object(l.a)(n)&&s>0)for(n=new Uint16Array(s),a=0;a<s;++a)n[a]=e++;if(!Object(l.a)(i)&&u>0)for(i=new Uint16Array(u),a=0;a<u;++a)i[a]=e++;if(!Object(l.a)(r)&&h>0)for(r=new Uint16Array(h),a=0;a<h;++a)r[a]=e++;if(!Object(l.a)(o)&&d>0)for(o=new Uint16Array(d),a=0;a<d;++a)o[a]=e++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}(f,p);if(_>0||y>0||b>0||v>0){let t,n,i,r;if(_>0){const e=p.byteOffset+f.BOXES.byteOffset;t=new Float32Array(p.buffer,e,MX.packedBoxLength*_)}if(y>0){const e=p.byteOffset+f.CYLINDERS.byteOffset;n=new Float32Array(p.buffer,e,MX.packedCylinderLength*y)}if(b>0){const e=p.byteOffset+f.ELLIPSOIDS.byteOffset;i=new Float32Array(p.buffer,e,MX.packedEllipsoidLength*b)}if(v>0){const e=p.byteOffset+f.SPHERES.byteOffset;r=new Float32Array(p.buffer,e,MX.packedSphereLength*v)}return e._geometries=new MX({boxes:t,boxBatchIds:C.boxes,cylinders:n,cylinderBatchIds:C.cylinders,ellipsoids:i,ellipsoidBatchIds:C.ellipsoids,spheres:r,sphereBatchIds:C.spheres,center:T,modelMatrix:E,batchTable:A,boundingVolume:e.tile.boundingVolume.boundingVolume}),e._geometries.readyPromise.then((function(){return e}))}return Promise.resolve(e)}(this,i,r)}Object.defineProperties(LX.prototype,{featuresLength:{get:function(){return Object(l.a)(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return Object(l.a)(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return Object(l.a)(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return Object(l.a)(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});const NX=Uint32Array.BYTES_PER_ELEMENT;function BX(e){const t=e.featuresLength;if(!Object(l.a)(e._features)&&t>0){const n=new Array(t);Object(l.a)(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}LX.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},LX.prototype.getFeature=function(e){const t=this.featuresLength;if(!Object(l.a)(e)||e<0||e>=t)throw new u.a(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return BX(this),this._features[e]},LX.prototype.applyDebugSettings=function(e,t){Object(l.a)(this._geometries)&&this._geometries.applyDebugSettings(e,t)},LX.prototype.applyStyle=function(e){BX(this),Object(l.a)(this._geometries)&&this._geometries.applyStyle(e,this._features)},LX.prototype.update=function(e,t){Object(l.a)(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),Object(l.a)(this._batchTable)&&this._geometries._ready&&this._batchTable.update(e,t)},LX.prototype.isDestroyed=function(){return!1},LX.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),sc(this)};var FX=LX;function zX(e,t){return Object(l.a)(e)&&Object(l.a)(e.extensions)&&Object(l.a)(e.extensions[t])}function kX(e){const t=e.lengthBits;let n=e.availableCount;s.a.typeOf.number("options.lengthBits",t);const i=e.constant,r=e.bitstream;if(Object(l.a)(i))n=t;else{const i=Math.ceil(t/8);if(r.length!==i)throw new ye.a(`Availability bitstream must be exactly ${i} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);const o=Object(c.a)(e.computeAvailableCountEnabled,!1);!Object(l.a)(n)&&o&&(n=function(e,t){let n=0;for(let i=0;i<t;i++){const t=i%8;n+=e[i>>3]>>t&1}return n}(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function UX(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;s.a.typeOf.object("options.metadataTable",t),s.a.typeOf.object("options.class",n),s.a.typeOf.number("options.entityId",i),s.a.typeOf.object("options.propertyTableJson",r),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(kX.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}}),kX.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new u.a("Bit index out of bounds.");if(Object(l.a)(this._constant))return this._constant;const t=e>>3,n=e%8;return 1==(this._bitstream[t]>>n&1)},Object.defineProperties(UX.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),UX.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)},UX.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)},UX.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)},UX.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)},UX.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)},UX.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)},UX.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};const VX={QUADTREE:"QUADTREE",OCTREE:"OCTREE",getBranchingFactor:function(e){switch(e){case VX.OCTREE:return 8;case VX.QUADTREE:return 4;default:throw new u.a("subdivisionScheme is not a valid value.")}}};var HX=Object.freeze(VX);function GX(){}Object.defineProperties(GX.prototype,{class:{get:function(){u.a.throwInstantiationError()}}}),GX.prototype.hasProperty=function(e){u.a.throwInstantiationError()},GX.prototype.hasPropertyBySemantic=function(e){u.a.throwInstantiationError()},GX.prototype.getPropertyIds=function(e){u.a.throwInstantiationError()},GX.prototype.getProperty=function(e){u.a.throwInstantiationError()},GX.prototype.setProperty=function(e,t){u.a.throwInstantiationError()},GX.prototype.getPropertyBySemantic=function(e){u.a.throwInstantiationError()},GX.prototype.setPropertyBySemantic=function(e,t){u.a.throwInstantiationError()},GX.hasProperty=function(e,t,n){if(s.a.typeOf.string("propertyId",e),s.a.typeOf.object("properties",t),s.a.typeOf.object("classDefinition",n),Object(l.a)(t[e]))return!0;const i=n.properties;if(!Object(l.a)(i))return!1;const r=i[e];return!(!Object(l.a)(r)||!Object(l.a)(r.default))},GX.hasPropertyBySemantic=function(e,t,n){s.a.typeOf.string("semantic",e),s.a.typeOf.object("properties",t),s.a.typeOf.object("classDefinition",n);const i=n.propertiesBySemantic;if(!Object(l.a)(i))return!1;const r=i[e];return Object(l.a)(r)},GX.getPropertyIds=function(e,t,n){s.a.typeOf.object("properties",e),s.a.typeOf.object("classDefinition",t),(n=Object(l.a)(n)?n:[]).length=0;for(const t in e)e.hasOwnProperty(t)&&Object(l.a)(e[t])&&n.push(t);const i=t.properties;if(Object(l.a)(i))for(const t in i)i.hasOwnProperty(t)&&!Object(l.a)(e[t])&&Object(l.a)(i[t].default)&&n.push(t);return n},GX.getProperty=function(e,t,n){if(s.a.typeOf.string("propertyId",e),s.a.typeOf.object("properties",t),s.a.typeOf.object("classDefinition",n),!Object(l.a)(n.properties[e]))throw new u.a("Class definition missing property "+e);const i=n.properties[e];let r=t[e];Array.isArray(r)&&(r=r.slice());return r=i.handleNoData(r),!Object(l.a)(r)&&Object(l.a)(i.default)?(r=Object(Zf.a)(i.default,!0),i.unpackVectorAndMatrixTypes(r,!0)):Object(l.a)(r)?(r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,!0)):void 0},GX.setProperty=function(e,t,n,i){if(s.a.typeOf.string("propertyId",e),s.a.defined("value",t),s.a.typeOf.object("properties",n),s.a.typeOf.object("classDefinition",i),!Object(l.a)(n[e]))return!1;let r;Array.isArray(t)&&(t=t.slice());const o=i.properties;Object(l.a)(o)&&(r=o[e]);return Object(l.a)(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0},GX.getPropertyBySemantic=function(e,t,n){s.a.typeOf.string("semantic",e),s.a.typeOf.object("properties",t),s.a.typeOf.object("classDefinition",n);const i=n.propertiesBySemantic;if(!Object(l.a)(i))return;const r=i[e];return Object(l.a)(r)?GX.getProperty(r.id,t,n):void 0},GX.setPropertyBySemantic=function(e,t,n,i){s.a.typeOf.string("semantic",e),s.a.defined("value",t),s.a.typeOf.object("properties",n),s.a.typeOf.object("classDefinition",i);const r=i.propertiesBySemantic;if(!Object(l.a)(r))return!1;const o=i.propertiesBySemantic[e];return!!Object(l.a)(o)&&GX.setProperty(o.id,t,n,i)};var qX=GX;function WX(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).subtreeMetadata,n=e.class;s.a.typeOf.object("options.subtreeMetadata",t),s.a.typeOf.object("options.class",n);const i=Object(l.a)(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(WX.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),WX.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,this._class)},WX.prototype.hasPropertyBySemantic=function(e){return qX.hasPropertyBySemantic(e,this._properties,this._class)},WX.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,this._class,e)},WX.prototype.getProperty=function(e){return qX.getProperty(e,this._properties,this._class)},WX.prototype.setProperty=function(e,t){return qX.setProperty(e,t,this._properties,this._class)},WX.prototype.getPropertyBySemantic=function(e){return qX.getPropertyBySemantic(e,this._properties,this._class)},WX.prototype.setPropertyBySemantic=function(e,t){return qX.setPropertyBySemantic(e,t,this._properties,this._class)};var YX=WX;const XX={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64",getMinimum:function(e){if(!XX.isNumericType(e))throw new u.a("type must be a numeric type");switch(e){case XX.INT8:return-128;case XX.UINT8:return 0;case XX.INT16:return-32768;case XX.UINT16:return 0;case XX.INT32:return-2147483648;case XX.UINT32:return 0;case XX.INT64:return Jr.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case XX.UINT64:return Jr.supportsBigInt()?BigInt(0):0;case XX.FLOAT32:return-34028234663852886e22;case XX.FLOAT64:return-Number.MAX_VALUE}},getMaximum:function(e){if(!XX.isNumericType(e))throw new u.a("type must be a numeric type");switch(e){case XX.INT8:return 127;case XX.UINT8:return 255;case XX.INT16:return 32767;case XX.UINT16:return 65535;case XX.INT32:return 2147483647;case XX.UINT32:return 4294967295;case XX.INT64:return Jr.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case XX.UINT64:return Jr.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case XX.FLOAT32:return 34028234663852886e22;case XX.FLOAT64:return Number.MAX_VALUE}},isNumericType:function(e){switch(s.a.typeOf.string("type",e),e){case XX.INT8:case XX.UINT8:case XX.INT16:case XX.UINT16:case XX.INT32:case XX.UINT32:case XX.INT64:case XX.UINT64:case XX.FLOAT32:case XX.FLOAT64:return!0;default:return!1}},isIntegerType:function(e){switch(s.a.typeOf.string("type",e),e){case XX.INT8:case XX.UINT8:case XX.INT16:case XX.UINT16:case XX.INT32:case XX.UINT32:case XX.INT64:case XX.UINT64:return!0;default:return!1}},isUnsignedIntegerType:function(e){switch(s.a.typeOf.string("type",e),e){case XX.UINT8:case XX.UINT16:case XX.UINT32:case XX.UINT64:return!0;default:return!1}},isVectorCompatible:function(e){switch(s.a.typeOf.string("type",e),e){case XX.INT8:case XX.UINT8:case XX.INT16:case XX.UINT16:case XX.INT32:case XX.UINT32:case XX.FLOAT32:case XX.FLOAT64:return!0;default:return!1}},normalize:function(e,t){if("number"!=typeof e&&"bigint"!=typeof e)throw new u.a("value must be a number or a BigInt");if(!XX.isIntegerType(t))throw new u.a("type must be an integer type");return Math.max(Number(e)/Number(XX.getMaximum(t)),-1)},unnormalize:function(e,t){if(s.a.typeOf.number("value",e),!XX.isIntegerType(t))throw new u.a("type must be an integer type");const n=XX.getMaximum(t),i=XX.isUnsignedIntegerType(t)?0:-n;return e=h.a.sign(e)*Math.round(Math.abs(e)*Number(n)),t!==XX.INT64&&t!==XX.UINT64||!Jr.supportsBigInt()||(e=BigInt(e)),e>n?n:e<i?i:e},applyValueTransform:function(e,t,n){return n*e+t},unapplyValueTransform:function(e,t,n){return 0===n?0:(e-t)/n},getSizeInBytes:function(e){if(!XX.isNumericType(e))throw new u.a("type must be a numeric type");switch(e){case XX.INT8:case XX.UINT8:return 1;case XX.INT16:case XX.UINT16:return 2;case XX.INT32:case XX.UINT32:return 4;case XX.INT64:case XX.UINT64:return 8;case XX.FLOAT32:return 4;case XX.FLOAT64:return 8}}};var KX=Object.freeze(XX);const JX={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM",isVectorType:function(e){switch(s.a.typeOf.string("type",e),e){case JX.VEC2:case JX.VEC3:case JX.VEC4:return!0;default:return!1}},isMatrixType:function(e){switch(s.a.typeOf.string("type",e),e){case JX.MAT2:case JX.MAT3:case JX.MAT4:return!0;default:return!1}},getComponentCount:function(e){switch(s.a.typeOf.string("type",e),e){case JX.SCALAR:case JX.STRING:case JX.ENUM:case JX.BOOLEAN:return 1;case JX.VEC2:return 2;case JX.VEC3:return 3;case JX.VEC4:case JX.MAT2:return 4;case JX.MAT3:return 9;case JX.MAT4:return 16;default:throw new u.a("Invalid metadata type "+e)}},getMathType:function(e){switch(e){case JX.VEC2:return Vt;case JX.VEC3:return O;case JX.VEC4:return _e;case JX.MAT2:return Es;case JX.MAT3:return ce;case JX.MAT4:return Me;default:return}}};var ZX=Object.freeze(JX);function $X(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).id,n=e.property;s.a.typeOf.string("options.id",t),s.a.typeOf.object("options.property",n),s.a.typeOf.string("options.property.type",n.type);const i=function(e){if("ARRAY"===e.type)return!0;const t=e.type;if(t===ZX.SCALAR||ZX.isMatrixType(t)||ZX.isVectorType(t))return!1;if(KX.isNumericType(t))return!0;if(Object(l.a)(e.noData)||Object(l.a)(e.scale)||Object(l.a)(e.offset)||Object(l.a)(e.required)||Object(l.a)(e.count)||Object(l.a)(e.array))return!1;if(Object(l.a)(e.optional))return!1;return}(n),r=function(e,t){const n=e.type,i=e.componentType,r="ARRAY"===n;let o,a,s,c;r?(o=!0,a=e.componentCount,s=!Object(l.a)(a)):e.array?(o=!0,a=e.count,s=!Object(l.a)(e.count)):(o=!1,a=void 0,s=!1);Object(l.a)(e.enumType)&&(c=t[e.enumType]);if(n===ZX.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:s,arrayLength:a};if(r&&i===ZX.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:s,arrayLength:a};if(n===ZX.SCALAR||ZX.isMatrixType(n)||ZX.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:s,arrayLength:a};if(n===ZX.BOOLEAN||n===ZX.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:s,arrayLength:a};if(r&&(i===ZX.BOOLEAN||i===ZX.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:s,arrayLength:a};if(Object(l.a)(i)&&KX.isNumericType(i))return{type:ZX.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:s,arrayLength:a};if(KX.isNumericType(n))return{type:ZX.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:s,arrayLength:a};throw new u.a(`unknown metadata type {type: ${n}, componentType: ${i})`)}(n,e.enums),o=r.componentType,a=Object(l.a)(o)&&KX.isIntegerType(o)&&Object(c.a)(n.normalized,!1);this._id=t,this._name=n.name,this._description=n.description,this._semantic=n.semantic,this._isLegacyExtension=i,this._type=r.type,this._componentType=o,this._enumType=r.enumType,this._valueType=r.valueType,this._isArray=r.isArray,this._isVariableLengthArray=r.isVariableLengthArray,this._arrayLength=r.arrayLength,this._min=n.min,this._max=n.max,this._normalized=a;let h=n.offset,d=n.scale;const f=Object(l.a)(h)||Object(l.a)(d);let p;Object(l.a)(h)||(h=this.expandConstant(0,!0)),Object(l.a)(d)||(d=this.expandConstant(1,!0)),this._offset=h,this._scale=d,this._hasValueTransform=f,this._noData=n.noData,this._default=n.default,p=!!Object(l.a)(i)&&(i?!Object(l.a)(n.optional)||!n.optional:Object(c.a)(n.required,!1)),this._required=p,this._extras=n.extras,this._extensions=n.extensions}function QX(e,t){const n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return ZX.isVectorType(n)?function(e,t,n){if(!KX.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===ZX.VEC2&&!(e instanceof Vt))return`vector value ${e} must be a Cartesian2`;if(t===ZX.VEC3&&!(e instanceof O))return`vector value ${e} must be a Cartesian3`;if(t===ZX.VEC4&&!(e instanceof _e))return`vector value ${e} must be a Cartesian4`}(t,n,i):ZX.isMatrixType(n)?function(e,t,n){if(!KX.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===ZX.MAT2&&!(e instanceof Es))return`matrix value ${e} must be a Matrix2`;if(t===ZX.MAT3&&!(e instanceof ce))return`matrix value ${e} must be a Matrix3`;if(t===ZX.MAT4&&!(e instanceof Me))return`matrix value ${e} must be a Matrix4`}(t,n,i):n===ZX.STRING?function(e){if("string"!=typeof e)return eK(e,ZX.STRING)}(t):n===ZX.BOOLEAN?function(e){if("boolean"!=typeof e)return eK(e,ZX.BOOLEAN)}(t):n===ZX.ENUM?function(e,t){const n=typeof e;if(Object(l.a)(t))return"string"===n&&Object(l.a)(t.valuesByName[e])?void 0:`value ${e} is not a valid enum name for ${t.id}`}(t,r):function(e,t,n){const i=typeof e;switch(t){case KX.INT8:case KX.UINT8:case KX.INT16:case KX.UINT16:case KX.INT32:case KX.UINT32:case KX.FLOAT32:case KX.FLOAT64:return"number"!==i?eK(e,t):isFinite(e)?nK(e,t,n):iK(e,t);case KX.INT64:case KX.UINT64:return"number"!==i&&"bigint"!==i?eK(e,t):"number"!==i||isFinite(e)?nK(e,t,n):iK(e,t)}}(t,i,o)}function eK(e,t){return`value ${e} does not match type ${t}`}function tK(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function nK(e,t,n){if(n){const i=1;return e<(KX.isUnsignedIntegerType(t)?0:-1)||e>i?tK(e,t,n):void 0}if(e<KX.getMinimum(t)||e>KX.getMaximum(t))return tK(e,t,n)}function iK(e,t){return`value ${e} of type ${t} must be finite`}function rK(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=rK(e[i],t,n);return e}Object.defineProperties($X.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),$X.prototype.normalize=function(e){return this._normalized?rK(e,this._valueType,KX.normalize):e},$X.prototype.unnormalize=function(e){return this._normalized?rK(e,this._valueType,KX.unnormalize):e},$X.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:$X.valueTransformInPlace(e,this._offset,this._scale,KX.applyValueTransform)},$X.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:$X.valueTransformInPlace(e,this._offset,this._scale,KX.unapplyValueTransform)},$X.prototype.expandConstant=function(e,t){t=Object(c.a)(t,!1);const n=this._isArray,i=this._arrayLength,r=ZX.getComponentCount(this._type),o=n&&r>1;if(!n&&1===r)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);const a=new Array(r).fill(e);return new Array(this._arrayLength).fill(a)},$X.prototype.handleNoData=function(e){const t=this._noData;return Object(l.a)(t)&&function e(t,n){if(!Array.isArray(t))return t===n;if(!Array.isArray(n))return!1;if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++)if(!e(t[i],n[i]))return!1;return!0}(e,t)?void 0:e},$X.prototype.unpackVectorAndMatrixTypes=function(e,t){t=Object(c.a)(t,!1);const n=ZX.getMathType(this._type),i=this._isArray,r=ZX.getComponentCount(this._type),o=i&&r>1;return Object(l.a)(n)?t&&o?e.map((function(e){return n.unpack(e)})):i?n.unpackArray(e):n.unpack(e):e},$X.prototype.packVectorAndMatrixTypes=function(e,t){t=Object(c.a)(t,!1);const n=ZX.getMathType(this._type),i=this._isArray,r=ZX.getComponentCount(this._type),o=i&&r>1;return Object(l.a)(n)?t&&o?e.map((function(e){return n.pack(e,[])})):i?n.packArray(e,[]):n.pack(e,[]):e},$X.prototype.validate=function(e){if(Object(l.a)(e)||!Object(l.a)(this._default))return this._required&&!Object(l.a)(e)?"required property must have a value":this._isArray?function(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;const n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){const n=QX(e,t[i]);if(Object(l.a)(n))return n}}(this,e):QX(this,e)},$X.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=$X.valueTransformInPlace(e[r],t[r],n[r],i);return e};var oK=$X;function aK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).count,n=e.property,i=e.classProperty,r=e.bufferViews;s.a.typeOf.number.greaterThan("options.count",t,0),s.a.typeOf.object("options.property",n),s.a.typeOf.object("options.classProperty",i),s.a.typeOf.object("options.bufferViews",r);const o=i.type,a=i.isArray,u=i.isVariableLengthArray;let h=i.valueType;const d=i.enumType,f=o===ZX.STRING,p=o===ZX.BOOLEAN;let m,g=0;if(u){let e=Object(c.a)(n.arrayOffsetType,n.offsetType);e=Object(c.a)(KX[e],KX.UINT32);m=new dK(r[Object(c.a)(n.arrayOffsets,n.arrayOffsetBufferView)],e,t+1),g+=m.typedArray.byteLength}const _=ZX.getComponentCount(o);let y;y=u?m.get(t)-m.get(0):a?t*i.arrayLength:t;const b=_*y;let v,O;if(f){let e=Object(c.a)(n.stringOffsetType,n.offsetType);e=Object(c.a)(KX[e],KX.UINT32);v=new dK(r[Object(c.a)(n.stringOffsets,n.stringOffsetBufferView)],e,b+1),g+=v.typedArray.byteLength}(f||p)&&(h=KX.UINT8),O=f?v.get(b)-v.get(0):p?Math.ceil(b/8):b;const w=new dK(r[Object(c.a)(n.values,n.bufferView)],h,O);g+=w.typedArray.byteLength;let A=n.offset,E=n.scale;const T=i.hasValueTransform||Object(l.a)(A)||Object(l.a)(E);let C,x;A=Object(c.a)(A,i.offset),E=Object(c.a)(E,i.scale),A=sK(A),E=sK(E);const S=this;f?C=function(e){return function(e,t,n){const i=n.get(e),r=n.get(e+1)-i;return Gu(t.typedArray,i,r)}(e,S._values,S._stringOffsets)}:p?(C=function(e){return function(e,t){const n=e>>3,i=e%8;return 1==(t.typedArray[n]>>i&1)}(e,S._values)},x=function(e,t){!function(e,t,n){const i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}(e,S._values,t)}):Object(l.a)(d)?(C=function(e){const t=S._values.get(e);return d.namesByValue[t]},x=function(e,t){const n=d.valuesByName[t];S._values.set(e,n)}):(C=function(e){return S._values.get(e)},x=function(e,t){S._values.set(e,t)}),this._arrayOffsets=m,this._stringOffsets=v,this._values=w,this._classProperty=i,this._count=t,this._vectorComponentCount=_,this._min=n.min,this._max=n.max,this._offset=A,this._scale=E,this._hasValueTransform=T,this._getValue=C,this._setValue=x,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=g}function sK(e){if(!Array.isArray(e))return e;const t=[];for(let n=0;n<e.length;n++){const i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function cK(e,t){const n=e._count;if(!Object(l.a)(t)||t<0||t>=n){const e=n-1;throw new u.a("index is required and between zero and count - 1. Actual value: "+e)}}function lK(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;const o=ZX.getComponentCount(t.type);i*=o,r*=o}else{const o=Object(c.a)(t.arrayLength,1)*e._vectorComponentCount;i=n*o,r=o}const o=new Array(r);for(let t=0;t<r;t++)o[t]=e._getValue(i+t);return o}function uK(e){if(Object(l.a)(e._unpackedValues))return!1;const t=e._classProperty,n=t.type,i=t.valueType;return n===ZX.STRING||(i===KX.INT64&&!Jr.supportsBigInt64Array()||i===KX.UINT64&&!Jr.supportsBigUint64Array())}function hK(e){e._unpackedValues=function(e){const t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,a=ZX.getComponentCount(o);if(!r&&1===a){for(let i=0;i<t;++i)n[i]=e._getValue(i);return n}for(let r=0;r<t;r++)n[r]=lK(e,i,r);return n}(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function dK(e,t,n){const i=this;let r,o,a;if(t===KX.INT64)Jr.supportsBigInt()?Jr.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),a=function(e,t){i.typedArray[e]=BigInt(t)}):(r=new Uint8Array(e.buffer,e.byteOffset,8*n),o=function(e){return function(e,t){const n=t.dataView,i=8*e;let r=BigInt(0);const o=(128&n.getUint8(i+7))>0;let a=!0;for(let e=0;e<8;++e){let t=n.getUint8(i+e);o&&(a?0!==t&&(t=255&~(t-1),a=!1):t=255&~t),r+=BigInt(t)*(BigInt(1)<<BigInt(8*e))}return o&&(r=-r),r}(e,i)}):(cl("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,8*n),o=function(e){return function(e,t){const n=t.dataView,i=8*e;let r=0;const o=(128&n.getUint8(i+7))>0;let a=!0;for(let e=0;e<8;++e){let t=n.getUint8(i+e);o&&(a?0!==t&&(t=255&~(t-1),a=!1):t=255&~t),r+=t*Math.pow(256,e)}return o&&(r=-r),r}(e,i)});else if(t===KX.UINT64)Jr.supportsBigInt()?Jr.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),a=function(e,t){i.typedArray[e]=BigInt(t)}):(r=new Uint8Array(e.buffer,e.byteOffset,8*n),o=function(e){return function(e,t){const n=t.dataView,i=8*e,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}(e,i)}):(cl("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,8*n),o=function(e){return function(e,t){const n=t.dataView,i=8*e;return n.getUint32(i,!0)+4294967296*n.getUint32(i+4,!0)}(e,i)});else{const o=function(e){switch(e){case KX.INT8:return gs.BYTE;case KX.UINT8:return gs.UNSIGNED_BYTE;case KX.INT16:return gs.SHORT;case KX.UINT16:return gs.UNSIGNED_SHORT;case KX.INT32:return gs.INT;case KX.UINT32:return gs.UNSIGNED_INT;case KX.FLOAT32:return gs.FLOAT;case KX.FLOAT64:return gs.DOUBLE}}(t);r=gs.createArrayBufferView(o,e.buffer,e.byteOffset,n),a=function(e,t){i.typedArray[e]=t}}Object(l.a)(o)||(o=function(e){return i.typedArray[e]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=a,this._componentType=t}Object.defineProperties(aK.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}}),aK.prototype.get=function(e){cK(this,e);let t=function(e,t){uK(e)&&hK(e);const n=e._classProperty,i=n.isArray,r=n.type,o=ZX.getComponentCount(r);if(Object(l.a)(e._unpackedValues)){const n=e._unpackedValues[t];return i?Object(Zf.a)(n,!0):n}if(!i&&1===o)return e._getValue(t);return lK(e,n,t)}(this,e);return t=this._classProperty.handleNoData(t),Object(l.a)(t)?(t=this._classProperty.normalize(t),t=function(e,t){const n=e._classProperty.isVariableLengthArray;if(!e._hasValueTransform||n)return t;return oK.valueTransformInPlace(t,e._offset,e._scale,KX.applyValueTransform)}(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))},aK.prototype.set=function(e,t){const n=this._classProperty;s.a.defined("value",t),cK(this,e);const i=n.validate(t);if(Object(l.a)(i))throw new u.a(i);t=function(e,t){const n=e._classProperty.isVariableLengthArray;if(!e._hasValueTransform||n)return t;return oK.valueTransformInPlace(t,e._offset,e._scale,KX.unapplyValueTransform)}(this,t=n.packVectorAndMatrixTypes(t)),function(e,t,n){(function(e,t,n){if(uK(e))return!0;const i=e._arrayOffsets;if(Object(l.a)(i)){const e=i.get(t+1)-i.get(t),r=n.length;if(e!==r)return!0}return!1})(e,t,n)&&hK(e);const i=e._classProperty,r=i.isArray,o=i.type,a=ZX.getComponentCount(o);if(Object(l.a)(e._unpackedValues))return i.isArray&&(n=Object(Zf.a)(n,!0)),void(e._unpackedValues[t]=n);if(!r&&1===a)return void e._setValue(t,n);let s,u;if(i.isVariableLengthArray)s=e._arrayOffsets.get(t),u=e._arrayOffsets.get(t+1)-s;else{const n=Object(c.a)(i.arrayLength,1)*e._vectorComponentCount;s=t*n,u=n}for(let t=0;t<u;++t)e._setValue(s+t,n[t])}(this,e,t=n.unnormalize(t))},aK.prototype.getTypedArray=function(){if(Object(l.a)(this._values))return this._values.typedArray};var fK=aK;function pK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).count,n=e.class;s.a.typeOf.number.greaterThan("options.count",t,0),s.a.typeOf.object("options.class",n);let i=0;const r={};if(Object(l.a)(e.properties))for(const o in e.properties)if(e.properties.hasOwnProperty(o)){const a=new fK({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=a,i+=a.byteLength}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(pK.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}}),pK.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,this._class)},pK.prototype.hasPropertyBySemantic=function(e){return qX.hasPropertyBySemantic(e,this._properties,this._class)},pK.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,this._class,e)},pK.prototype.getProperty=function(e,t){s.a.typeOf.string("propertyId",t);const n=this._properties[t];let i;return i=Object(l.a)(n)?n.get(e):function(e,t){const n=e.properties;if(!Object(l.a)(n))return;const i=n[t];if(Object(l.a)(i)&&Object(l.a)(i.default)){let e=i.default;return i.isArray&&(e=Object(Zf.a)(e,!0)),e=i.normalize(e),i.unpackVectorAndMatrixTypes(e)}}(this._class,t),i},pK.prototype.setProperty=function(e,t,n){s.a.typeOf.string("propertyId",t);const i=this._properties[t];return!!Object(l.a)(i)&&(i.set(e,n),!0)},pK.prototype.getPropertyBySemantic=function(e,t){let n;s.a.typeOf.string("semantic",t);const i=this._class.propertiesBySemantic;if(Object(l.a)(i)&&(n=i[t]),Object(l.a)(n))return this.getProperty(e,n.id)},pK.prototype.setPropertyBySemantic=function(e,t,n){let i;s.a.typeOf.string("semantic",t);const r=this._class.propertiesBySemantic;return Object(l.a)(r)&&(i=r[t]),!!Object(l.a)(i)&&this.setProperty(e,i.id,n)},pK.prototype.getPropertyTypedArray=function(e){s.a.typeOf.string("propertyId",e);const t=this._properties[e];if(Object(l.a)(t))return t.getTypedArray()},pK.prototype.getPropertyTypedArrayBySemantic=function(e){let t;s.a.typeOf.string("semantic",e);const n=this._class.propertiesBySemantic;if(Object(l.a)(n)&&(t=n[e]),Object(l.a)(t))return this.getPropertyTypedArray(t.id)};var mK=pK;function gK(){}Object.defineProperties(gK.prototype,{promise:{get:function(){u.a.throwInstantiationError()}},cacheKey:{get:function(){u.a.throwInstantiationError()}}}),gK.prototype.load=function(){u.a.throwInstantiationError()},gK.prototype.unload=function(){},gK.prototype.process=function(e){},gK.prototype.getError=function(e,t){s.a.typeOf.string("errorMessage",e),Object(l.a)(t)&&(e+="\n"+t.message);const n=new ye.a(e);return Object(l.a)(t)&&(n.stack=`Original stack:\n${t.stack}\nHandler stack:\n${n.stack}`),n},gK.prototype.isDestroyed=function(){return!1},gK.prototype.destroy=function(){return this.unload(),sc(this)};var _K=Object.freeze({UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4});function yK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).typedArray,n=e.resource,i=e.cacheKey;if(Object(l.a)(t)===Object(l.a)(n))throw new u.a("One of options.typedArray and options.resource must be defined.");this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=_K.UNLOADED,this._promise=void 0}Object(l.a)(Object.create)&&(yK.prototype=Object.create(gK.prototype),yK.prototype.constructor=yK),Object.defineProperties(yK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}}),yK.prototype.load=function(){return Object(l.a)(this._typedArray)?this._promise=Promise.resolve(this):this._promise=function(e){const t=e._resource;return e._state=_K.LOADING,yK._fetchArrayBuffer(t).then((function(t){if(!e.isDestroyed())return e._typedArray=new Uint8Array(t),e._state=_K.READY,e})).catch((function(n){if(e.isDestroyed())return;e._state=_K.FAILED;const i="Failed to load external buffer: "+t.url;return Promise.reject(e.getError(i,n))}))}(this),this._promise},yK._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()},yK.prototype.unload=function(){this._typedArray=void 0};!function(){var e,t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};function n(e){if(!e)throw new Error("Assertion failed")}function i(t,n,i,r,o){var a=e.exports.sbrk,s=a(n),c=a(r*o),l=new Uint8Array(e.exports.memory.buffer);l.set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength),c);var u=t(s,n,c,r,o),h=new Uint8Array(u);return h.set(l.subarray(s,s+u)),a(s-a(0)),h}function r(e){for(var t=0,n=0;n<e.length;++n){var i=e[n];t=t<i?i:t}return t}function o(e,t){if(n(2==t||4==t),4==t)return new Uint32Array(e.buffer,e.byteOffset,e.byteLength/4);var i=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);return new Uint32Array(i)}function a(t,n,i,r,o,a){var s=e.exports.sbrk,c=s(i*r),l=s(i*a),u=new Uint8Array(e.exports.memory.buffer);u.set(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),l),t(c,i,r,o,l);var h=new Uint8Array(i*r);return h.set(u.subarray(c,c+i*r)),s(c-s(0)),h}WebAssembly.instantiate(function(e){for(var n=new Uint8Array(e.length),i=0;i<e.length;++i){var r=e.charCodeAt(i);n[i]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}var o=0;for(i=0;i<e.length;++i)n[o++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,o)}("B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gIUUUEU9gVUUUUUB9gLUUUUB9gD99UE99Ie8aDILEVOLEVLRRRRRWWVBOOBEdddLVE9wEIIVIEBEOWEUEC+Q/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBO8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBRe9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jwBWA9tw79o9v9wT9fw9u9j9v9kw69u9kw949Twg91w9u9jw9C9v919u9kBdl9tw79o9v9wT9fw9u9j9v9kws9p2Twv9P9jTBQk9tw79o9v9wT9fw9u9j9v9kws9p2Twv9R919hTBKl9tw79o9v9wT9fw9u9j9v9kws9p2Twvt949wBXe9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9owBSA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94j9h9j9ow9TTv9p9wBZA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9wBhL79iv9rBodWEBCEKDqxQ+f9Q8aDBK/EpE8jU8jJJJJBCJO9rGV8kJJJJBCBHODNALCEFAE0MBABCBrBJ+KJJBC+gEv86BBAVCJDFCBCJDZnJJJB8aDNAItMBAVCJDFADALZ+TJJJB8aKABAEFHRABCEFHEAVALFCBCBCJDAL9rALCfE0eZnJJJB8aAVAVCJDFALZ+TJJJBHWCJ/ABAL9uHODNAItMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAWCJLFCBCJDZnJJJB8aAdAIAQ9rAQAdFAI6eHKADAQAL2FHXDNALtMBAKCSFGOC9wgHMAOCL4CIFCD4HpCBHSAXHZAEHhINDNAKtMBAWASFrBBHoCBHEAZHOINAWCJLFAEFAOrBBGaAo9rGoCETAoCkTCk91CR4786BBAOALFHOAaHoAECEFGEAK9HMBKKDNARAh9rAp6MBAhCBApZnJJJBGcApFHEDNAMtMBCBHxAWCJLFHqINARAE9rCk6MDAWCJLFAxFGlrBDHoCUHODNAlrBEGaAlrBBGkvCfEgMBCBHaAoCfEgMBCBHoDNAlrBIMBAlrBLMBAlrBVMBAlrBOMBAlrBRMBAlrBWMBAlrBdMBAlrBQMBAlrBKMBAlrBXMBAlrBMMBCBHaAlrBpMECBHoCUCBAlrBSeHOKCBHaKDNDNDNDNCLCDCECWAOCZ6GheAkCfEgGkCD0CLvAaCfEgGaCD0FAoCfEgGoCD0FAlrBIGyCD0FAlrBLG8aCD0FAlrBVGeCD0FAlrBOG3CD0FAlrBRG5CD0FAlrBWG8eCD0FAlrBdG8fCD0FAlrBQGACD0FAlrBKGHCD0FAlrBXGGCD0FAlrBMG8jCD0FAlrBpG8kCD0FAlrBSG8lCD0FG8mAOCZAheG8n6GOeAkCp0CWvAaCp0FAoCp0FAyCp0FA8aCp0FAeCp0FA3Cp0FA5Cp0FA8eCp0FA8fCp0FAACp0FAHCp0FAGCp0FA8jCp0FA8kCp0FA8lCp0FA8mA8nAOe6GoeGyCUFpDIEBKAcAxCO4FGaAarBBCDCIAoeAxCI4COgTv86BBAyCW9HMEAEAl8pBB83BBAECWFAlCWF8pBB83BBAECZFHEXDKAcAxCO4FGaAarBBCEAxCI4COgTv86BBKCDCLCWCEAheAOeAoeH8aCUAyTCU7HaCBH5AqHeINAEH3A8aHoAeHECBHOINAErBBGhAaAhAaCfEgGk6eAOCfEgAyTvHOAECEFHEAoCUFGoMBKA3AO86BBAeA8aFHeA3CEFHEA5A8aFG5CZ6MBKDNAlrBBGOAk6MBA3AO86BEA3CDFHEKDNAlrBEGOAk6MBAEAO86BBAECEFHEKDNAlrBDGOAk6MBAEAO86BBAECEFHEKDNAlrBIGOAk6MBAEAO86BBAECEFHEKDNAlrBLGOAk6MBAEAO86BBAECEFHEKDNAlrBVGOAk6MBAEAO86BBAECEFHEKDNAlrBOGOAk6MBAEAO86BBAECEFHEKDNAlrBRGOAk6MBAEAO86BBAECEFHEKDNAlrBWGOAk6MBAEAO86BBAECEFHEKDNAlrBdGOAk6MBAEAO86BBAECEFHEKDNAlrBQGOAk6MBAEAO86BBAECEFHEKDNAlrBKGOAk6MBAEAO86BBAECEFHEKDNAlrBXGOAk6MBAEAO86BBAECEFHEKDNAlrBMGOAk6MBAEAO86BBAECEFHEKDNAlrBpGOAk6MBAEAO86BBAECEFHEKAlrBSGOAk6MBAEAO86BBAECEFHEKAqCZFHqAxCZFGxAM6MBKKAEtMBAZCEFHZAEHhASCEFGSALsMDXEKKCBHOXIKAWAXAKCUFAL2FALZ+TJJJB8aAKAQFGQAI6MBKKCBHOARAE9rCAALALCA6e6MBDNALC8f0MBAECBCAAL9rGOZnJJJBAOFHEKAEAWCJDFALZ+TJJJBALFAB9rHOKAVCJOF8kJJJJBAOK9HEEUAECAAECA0eABCJ/ABAE9uC/wfBgGDCJDADCJD6eGDFCUFAD9uAE2ADCL4CIFCD4ADv2FCEFKMBCBABbDJ+KJJBK/pSEeU8jJJJJBC/AE9rGL8kJJJJBCBHVDNAICI9uGOChFAE0MBABCBYD+E+KJJBGRC/gEv86BBALC/ABFCfECJEZnJJJB8aALCuFGW9CU83IBALC8wFGd9CU83IBALCYFGQ9CU83IBALCAFGK9CU83IBALCkFGX9CU83IBALCZFGM9CU83IBAL9CU83IWAL9CU83IBABAEFC9wFGpABCEFGSAOFGE6HODNAItMBCMCSARCB9KeHZCBHhCBHoCBHaCBHcCBHxINDNAOCEgtMBCBHVXIKCDHqADAaCDTFGOYDBHlAOCWFYDBHkAOCLFYDBHyCBH8aCBHODNDNDNDNDNDNDNDNDNINALC/ABFAOCU7AxFCSgCITFGVYDLHeDNAVYDBGVAl9HMBAeAy9HMBAqC9+FHqXDKDNAVAy9HMBAeAk9HMBAqCUFHqXDKDNAVAk9HMBAeAlsMDKAqCLFHqA8aCZFH8aAOCEFGOCZ9HMBXDKKAqC870MBADAqCIgCX2GVC+E1JJBFYDBAaFCDTFYDBHqADAVCJ1JJBFYDBAaFCDTFYDBHyALADAVC11JJBFYDBAaFCDTFYDBGVAcZ+FJJJBGeCBCSAVAhsGkeAeCB9KAeAZ9IgGleHeAkAlCE7gHkDNARCE9IMBAeCS9HMBAVAVAoAVCEFAosGeeGoCEFsMDCMCSAeeHeKASAeA8av86BBAeCS9HMDAVAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAVHoXIKADCEAkAhsCETAyAhseCX2GOC11JJBFYDBAaFCDTFYDBHqADAOC+E1JJBFYDBAaFCDTFYDBHeADAOCJ1JJBFYDBAaFCDTFYDBHVCBHlDNARCE9IMBAhtMBAVMBAeCE9HMBAqCD9HMBAW9CU83IBAd9CU83IBAQ9CU83IBAK9CU83IBAX9CU83IBAM9CU83IBAL9CU83IWAL9CU83IBCBHhCEHlKAhAVAhsGOFH8aALAeAcZ+FJJJBHyALAqAcZ+FJJJBHkAyCM0MLAyCEFHyXVKCpHeASAOCLTCpv86BBAVHoKAetMBAeAZ9IMEKALAcCDTFAVbDBAcCEFCSgHcKAhAkFHhALC/ABFAxCITFGOAqbDLAOAVbDBALC/ABFAxCEFCSgGOCITFGeAVbDLAeAybDBAOCEFHVXDKCBCSAeA8asG3eHyA8aA3FH8aKDNDNAkCM0MBAkCEFHkXEKCBCSAqA8asG3eHkA8aA3FH8aKDNDNDNDNDNDNDNDNDNDNDNDNDNDNDNDNDNAkAyCLTvG3CfEgG5C+qUFp9UISSSSSSSSSSSSSSWSLQMSSSSSSSSSSSSESVSSSSSSSSSSSSSRDSdSSSSSSSSSSSSSSKSSSSSSSSSSSSSSSSOBKC/wEH8eA5pDMKpKC/xEH8eXXKC/yEH8eXKKC/zEH8eXQKC/0EH8eXdKC/1EH8eXWKC/2EH8eXRKC/3EH8eXOKC/4EH8eXVKC/5EH8eXLKC/6EH8eXIKC/7EH8eXDKC/8EH8eXEKCPEH8eKAlAVAh9HvMBASA8e86BBXEKASC9+CUAOe86BBAEA386BBAECEFHEKDNAOMBAVAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAVHoKDNAyCS9HMBAeAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAeHoKDNAkCS9HMBAqAo9rGOCETAOC8f917HOINAEAOCfB0CRTAOCfBgv86BBAECEFHEAOCR4GOMBKAqHoKALAcCDTFAVbDBAcCEFCSgHODNDNAypZBEEEEEEEEEEEEEEBEKALAOCDTFAebDBAcCDFCSgHOKDNDNAkpZBEEEEEEEEEEEEEEBEKALAOCDTFAqbDBAOCEFCSgHOKALC/ABFAxCITFGyAVbDLAyAebDBALC/ABFAxCEFCSgCITFGyAebDLAyAqbDBALC/ABFAxCDFCSgCITFGeAqbDLAeAVbDBAxCIFHVAOHcA8aHhKApAE6HOASCEFHSAVCSgHxAaCIFGaAI6MBKKCBHVAOMBAE9C/lm+i/D+Z+g8a83BWAE9CJ/s+d+0/1+M/e/U+GU83BBAEAB9rCZFHVKALC/AEF8kJJJJBAVK+mIEEUCBHIDNABADCUFCSgCDTFYDBAEsMBCEHIABADCpFCSgCDTFYDBAEsMBCDHIABADCMFCSgCDTFYDBAEsMBCIHIABADCXFCSgCDTFYDBAEsMBCLHIABADCKFCSgCDTFYDBAEsMBCVHIABADCQFCSgCDTFYDBAEsMBCOHIABADCdFCSgCDTFYDBAEsMBCRHIABADCWFCSgCDTFYDBAEsMBCWHIABADCRFCSgCDTFYDBAEsMBCdHIABADCOFCSgCDTFYDBAEsMBCQHIABADCVFCSgCDTFYDBAEsMBCKHIABADCLFCSgCDTFYDBAEsMBCXHIABADCIFCSgCDTFYDBAEsMBCMHIABADCDFCSgCDTFYDBAEsMBCpHIABADCEFCSgCDTFYDBAEsMBCSCUABADCSgCDTFYDBAEseSKAIKjEIUCRHDDNINADCEFHIADC96FGLC8f0MEAIHDCEALTAE6MBKKAICR9uCI2CDFABCI9u2ChFKMBCBABbD+E+KJJBK+YDERU8jJJJJBCZ9rHLCBHVDNAICVFAE0MBCBHVABCBrB+E+KJJBC/QEv86BBAL9CB83IWABCEFHOABAEFC98FHRDNAItMBCBHWINDNARAO0MBCBSKAVADAWCDTFYDBGdALCWFAVCDTFYDB9rGEAEC8f91GEFAE7C59K7GVAdALCWFAVCDTFGQYDB9rGEC8f91CETAECDT7vHEINAOAECfB0CRTAECfBgv86BBAOCEFHOAECR4GEMBKAQAdbDBAWCEFGWAI9HMBKKCBHVARAO6MBAOCBbBBAOAB9rCLFHVKAVK86EIUCWHDDNINADCEFHIADC95FGLC8f0MEAIHDCEALTAE6MBKKAICR9uAB2CVFK+yWDEUO99DNAEtMBADCLsHVCUADCETCUFTCU7HDDNDNCUAICUFTCU7+yGOjBBBzmGR+LjBBB9P9dtMBAR+oHIXEKCJJJJ94HIKAD+yHWDNAVMBABCOFHDINALCLFiDBGRjBBBBjBBJzALiDBGd+LAR+LmALCWFiDBGQ+LmGR+VARjBBBB9beGRnHKAdARnHRALCXFiDBHdDNDNAQjBBBB9gtMBAKHQXEKjBBJzAR+L+TGQAQ+MAKjBBBB9geHQjBBJzAK+L+TGKAK+MARjBBBB9geHRKADC9+FAI87EBDNDNjBBBzjBBB+/AdjBBBB9geAdjBBJ+/AdjBBJ+/9geGdjBBJzAdjBBJz9feAWnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADAB87EBDNDNjBBBzjBBB+/AQjBBBB9geAQjBBJ+/AQjBBJ+/9geGdjBBJzAdjBBJz9feAOnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADC98FAB87EBDNDNjBBBzjBBB+/ARjBBBB9geARjBBJ+/ARjBBJ+/9geGRjBBJzARjBBJz9feAOnmGR+LjBBB9P9dtMBAR+oHBXEKCJJJJ94HBKADC96FAB87EBALCZFHLADCWFHDAECUFGEMBXDKKABCIFHDINALCLFiDBGRjBBBBjBBJzALiDBGd+LAR+LmALCWFiDBGQ+LmGR+VARjBBBB9beGRnHKAdARnHRALCXFiDBHdDNDNAQjBBBB9gtMBAKHQXEKjBBJzAR+L+TGQAQ+MAKjBBBB9geHQjBBJzAK+L+TGKAK+MARjBBBB9geHRKADCUFAI86BBDNDNjBBBzjBBB+/AdjBBBB9geAdjBBJ+/AdjBBJ+/9geGdjBBJzAdjBBJz9feAWnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADAB86BBDNDNjBBBzjBBB+/AQjBBBB9geAQjBBJ+/AQjBBJ+/9geGdjBBJzAdjBBJz9feAOnmGd+LjBBB9P9dtMBAd+oHBXEKCJJJJ94HBKADC9+FAB86BBDNDNjBBBzjBBB+/ARjBBBB9geARjBBJ+/ARjBBJ+/9geGRjBBJzARjBBJz9feAOnmGR+LjBBB9P9dtMBAR+oHBXEKCJJJJ94HBKADC99FAB86BBALCZFHLADCLFHDAECUFGEMBKKK/KLLD99EUE99EUDNAEtMBDNDNCUAICUFTCU7+yGVjBBBzmGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKAIC/8fIgHRINABCOFCICDALCLFiDB+LALiDB+L9eGIALCWFiDB+LALAICDTFiDB+L9eeGIALCXFiDB+LALAICDTFiDB+L9eeGIARv87EBDNDNjBBBzjBBB+/ALAICEFCIgCDTFiDBj/zL+1znjBBJ+/jBBJzALAICDTFiDBjBBBB9deGOnGWjBBBB9geAWjBBJ+/AWjBBJ+/9geGWjBBJzAWjBBJz9feAVnmGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKABAd87EBDNDNjBBBzjBBB+/AOALAICDFCIgCDTFiDBj/zL+1znnGWjBBBB9geAWjBBJ+/AWjBBJ+/9geGWjBBJzAWjBBJz9feAVnmGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKABCDFAd87EBDNDNjBBBzjBBB+/AOALAICUFCIgCDTFiDBj/zL+1znnGOjBBBB9geAOjBBJ+/AOjBBJ+/9geGOjBBJzAOjBBJz9feAVnmGO+LjBBB9P9dtMBAO+oHIXEKCJJJJ94HIKABCLFAI87EBABCWFHBALCZFHLAECUFGEMBKKK+tDDWUE998jJJJJBCZ9rGV8kJJJJBDNAEtMBADCD4GOtMBCEAI9rHRAOCDTHWCBHdINC+cUHDALHIAOHQINAIiDBAVCXFZ+YJJJB8aAVYDXGKADADAK9IeHDAICLFHIAQCUFGQMBKARADFGICkTHKCBHDCBAI9rHXAOHIINDNDNALADFiDBGMAXZ+XJJJBjBBBzjBBB+/AMjBBBB9gemGM+LjBBB9P9dtMBAM+oHQXEKCJJJJ94HQKABADFAQCfffRgAKvbDBADCLFHDAICUFGIMBKABAWFHBALAWFHLAdCEFGdAE9HMBKKAVCZF8kJJJJBK+iMDlUI998jJJJJBC+QD9rGV8kJJJJBAVC+oEFCBC/kBZnJJJB8aCBHODNADtMBCBHOAItMBDNABAE9HMBAVCUADCDTGRADCffffI0eCBYD/4+JJJBhJJJJBBGEbD+oEAVCEbD1DAEABARZ+TJJJB8aKAVC+YEFCWFCBbDBAV9CB83I+YEAVC+YEFAEADAIAVC+oEFZ+OJJJBCUAICDTGWAICffffI0eGdCBYD/4+JJJBhJJJJBBHRAVC+oEFAVYD1DGOCDTFARbDBAVAOCEFGQbD1DARAVYD+YEGKAWZ+TJJJBHXAVC+oEFAQCDTFADCI9uGMCBYD/4+JJJBhJJJJBBGRbDBAVAOCDFGWbD1DARCBAMZnJJJBHpAVC+oEFAWCDTFAdCBYD/4+JJJBhJJJJBBGSbDBAVAOCIFGQbD1DAXHRASHWINAWALiDBALARYDBGdCWAdCW6eCDTFC/EBFiDBmuDBARCLFHRAWCLFHWAICUFGIMBKCBHIAVC+oEFAQCDTFCUAMCDTADCffff970eCBYD/4+JJJBhJJJJBBGQbDBAVAOCLFGObD1DDNADCI6MBAEHRAQHWINAWASARYDBCDTFiDBASARCLFYDBCDTFiDBmASARCWFYDBCDTFiDBmuDBARCXFHRAWCLFHWAICEFGIAM6MBKKAVC/MBFHZAVYD+cEHhAVYD+gEHoAVHRCBHdCBHWCBHaCEHcINARHxAEAWCX2FGqCWFGlYDBHDAqYDBHkABAaCX2FGRCLFAqCLFGyYDBG8abDBARAkbDBARCWFADbDBApAWFCE86BBAZADbDWAZA8abDLAZAkbDBAQAWCDTFCBbDBCIHeDNAdtMBAxHRINDNARYDBGIADsMBAIAksMBAIA8asMBAZAeCDTFAIbDBAeCEFHeKARCLFHRAdCUFGdMBKKAXAkCDTFGRARYDBCUFbDBAXA8aCDTFGRARYDBCUFbDBAXADCDTFGRARYDBCUFbDBAoAhAqYDBCDTGIFYDBCDTFGkHRAKAIFGDYDBGdHIDNAdtMBDNINARYDBAWsMEARCLFHRAICUFGItMDXBKKARAdCDTAkFC98FYDBbDBADADYDBCUFbDBKAoAhAyYDBCDTGIFYDBCDTFGkHRAKAIFGDYDBGdHIDNAdtMBDNINARYDBAWsMEARCLFHRAICUFGIMBXDKKARAdCDTAkFC98FYDBbDBADADYDBCUFbDBKDNAKAlYDBCDTGRFGDYDBGdtMBAoAhARFYDBCDTFGkHRAdHIDNINARYDBAWsMEARCLFHRAICUFGIMBXDKKARAdCDTAkFC98FYDBbDBADADYDBCUFbDBKDNDNAetMBCUHWjBBBBH3CBHRINASAZARCDTFYDBCDTGIFGdiDBH5AdALCBARCEFGkARCS0eCDTFiDBALAXAIFYDBGRCWARCW6eCDTFC/EBFiDBmG8euDBDNAKAIFYDBGdtMBA8eA5+TH8eAoAhAIFYDBCDTFHRAdCDTHIINAQARYDBGdCDTFGDA8eADiDBmG5uDBA5A3A3A59dGDeH3AdAWADeHWARCLFHRAIC98FGIMBKKAkHRAkAe9HMBKAWCU9HMEKAcAM9PMDINDNApAcFrBBMBAcHWXDKAMAcCEFGc9HMBXIKKAaCEFHaAeCZAeCZ6eHdAZHRAxHZAWCU9HMBKKAOCDTAVC+oEFFC98FHRDNINAOtMEARYDBCBYD/0+JJJBh+BJJJBBARC98FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/iLEVUCUAICDTGVAICffffI0eGOCBYD/4+JJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD/4+JJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD/4+JJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZnJJJB8aADCI9uHdDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEALCEFGLAd6MBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+k1JJBZ+NJJJBKqBABAEADAIC+M+JJJBZ+NJJJBK9dEEUABCfEAICDTZnJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/8+JJJBGEABCIFC98gFGBbD/8+JJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/8+JJJBGEABCIFC98gFGBbD/8+JJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/8+JJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/8+JJJBFGDbD/8+JJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+ZJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+YJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9OMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD9IeC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9MMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2999KeC/MEFHEKABAEClTCJJJ/8IF++nKK+ODDBCJWK/0EBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC/0dKXEBBBDBBBZwBB"),{}).then((function(t){(e=t.instance).exports.__wasm_call_ctors(),e.exports.meshopt_encodeVertexVersion(0),e.exports.meshopt_encodeIndexVersion(1)}))}();var bK=function(){var e=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]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var n,i="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB";WebAssembly.validate(e)&&(i="B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB");var r=WebAssembly.instantiate(function(e){for(var n=new Uint8Array(e.length),i=0;i<e.length;++i){var r=e.charCodeAt(i);n[i]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}var o=0;for(i=0;i<e.length;++i)n[o++]=n[i]<60?t[n[i]]:64*(n[i]-60)+n[++i];return n.buffer.slice(0,o)}(i),{}).then((function(e){(n=e.instance).exports.__wasm_call_ctors()}));function o(e,t,i,r,o,a){var s=n.exports.sbrk,c=i+3&-4,l=s(c*r),u=s(o.length),h=new Uint8Array(n.exports.memory.buffer);h.set(o,u);var d=e(l,i,r,u,o.length);if(0==d&&a&&a(l,c,r),t.set(h.subarray(l,l+i*r)),s(l-s(0)),0!=d)throw new Error("Malformed buffer data: "+d)}var a={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},s={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:r,supported:!0,decodeVertexBuffer:function(e,t,i,r,s){o(n.exports.meshopt_decodeVertexBuffer,e,t,i,r,n.exports[a[s]])},decodeIndexBuffer:function(e,t,i,r){o(n.exports.meshopt_decodeIndexBuffer,e,t,i,r)},decodeIndexSequence:function(e,t,i,r){o(n.exports.meshopt_decodeIndexSequence,e,t,i,r)},decodeGltfBuffer:function(e,t,i,r,c,l){o(n.exports[s[c]],e,t,i,r,n.exports[a[l]])}}}();function vK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltf,i=e.bufferViewId,r=e.gltfResource,o=e.baseResource,a=e.cacheKey;s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltf",n),s.a.typeOf.number("options.bufferViewId",i),s.a.typeOf.object("options.gltfResource",r),s.a.typeOf.object("options.baseResource",o);const l=n.bufferViews[i];let u,h,d,f,p=l.buffer,m=l.byteOffset,g=l.byteLength,_=!1;if(zX(l,"EXT_meshopt_compression")){const e=l.extensions.EXT_meshopt_compression;p=e.buffer,m=Object(c.a)(e.byteOffset,0),g=e.byteLength,_=!0,u=e.byteStride,h=e.count,d=e.mode,f=Object(c.a)(e.filter,"NONE")}const y=n.buffers[p];this._hasMeshopt=_,this._meshoptByteStride=u,this._meshoptCount=h,this._meshoptMode=d,this._meshoptFilter=f,this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._buffer=y,this._bufferId=p,this._byteOffset=m,this._byteLength=g,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=_K.UNLOADED,this._promise=void 0,this._process=function(e,t){}}function OK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltf,i=e.draco,r=e.gltfResource,o=e.baseResource,a=e.cacheKey;s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltf",n),s.a.typeOf.object("options.draco",i),s.a.typeOf.object("options.gltfResource",r),s.a.typeOf.object("options.baseResource",o),this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._draco=i,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=_K.UNLOADED,this._promise=void 0,this._process=function(e,t){}}function wK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltf,i=e.imageId,r=e.gltfResource,o=e.baseResource,a=e.cacheKey;s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltf",n),s.a.typeOf.number("options.imageId",i),s.a.typeOf.object("options.gltfResource",r),s.a.typeOf.object("options.baseResource",o);const l=n.images[i],u=l.bufferView,h=l.uri;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._bufferViewId=u,this._uri=h,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=_K.UNLOADED,this._promise=void 0}function AK(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map((function(e){return e.bufferView})),e=e[0]),{image:e,mipLevels:t}}function EK(e,t,n){return e.unload(),e._state=_K.FAILED,Promise.reject(e.getError(n,t))}Object(l.a)(Object.create)&&(vK.prototype=Object.create(gK.prototype),vK.prototype.constructor=vK),Object.defineProperties(vK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}}),vK.prototype.load=function(){const e=function(e){const t=e._resourceCache,n=e._buffer;if(Object(l.a)(n.uri)){const i=e._baseResource.getDerivedResource({url:n.uri});return t.loadExternalBuffer({resource:i})}return t.loadEmbeddedBuffer({parentResource:e._gltfResource,bufferId:e._bufferId})}(this);this._bufferLoader=e,this._state=_K.LOADING;const t=this,n=new Promise((function(e){t._process=function(t,n){if(!t._hasMeshopt)return;if(!Object(l.a)(t._typedArray))return;if(t._state!==_K.PROCESSING)return;const i=t._meshoptCount,r=t._meshoptByteStride,o=new Uint8Array(i*r);bK.decodeGltfBuffer(o,i,r,t._typedArray,t._meshoptMode,t._meshoptFilter),t._typedArray=o,t._state=_K.READY,e(t)}}));return this._promise=e.promise.then((function(){if(t.isDestroyed())return;const i=e.typedArray,r=new Uint8Array(i.buffer,i.byteOffset+t._byteOffset,t._byteLength);return t.unload(),t._typedArray=r,t._hasMeshopt?(t._state=_K.PROCESSING,n):(t._state=_K.READY,t)})).catch((function(e){if(t.isDestroyed())return;t.unload(),t._state=_K.FAILED;return Promise.reject(t.getError("Failed to load buffer view",e))})),this._promise},vK.prototype.process=function(e){return s.a.typeOf.object("frameState",e),this._process(this,e)},vK.prototype.unload=function(){Object(l.a)(this._bufferLoader)&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0},Object(l.a)(Object.create)&&(OK.prototype=Object.create(gK.prototype),OK.prototype.constructor=OK),Object.defineProperties(OK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}}),OK.prototype.load=function(){const e=this._resourceCache.loadBufferView({gltf:this._gltf,bufferViewId:this._draco.bufferView,gltfResource:this._gltfResource,baseResource:this._baseResource});this._bufferViewLoader=e,this._state=_K.LOADING;const t=this,n=new Promise((function(e,n){t._process=function(t,i){if(!Object(l.a)(t._bufferViewTypedArray))return;if(Object(l.a)(t._decodePromise))return;const r=t._draco,o=t._gltf.bufferViews[r.bufferView],a=r.attributes,s={array:new Uint8Array(t._bufferViewTypedArray),bufferView:o,compressedAttributes:a,dequantizeInShader:!0},c=qq.decodeBufferView(s);Object(l.a)(c)&&(t._decodePromise=c.then((function(n){t.isDestroyed()?e():(t.unload(),t._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},t._state=_K.READY,e(t))})).catch((function(i){t.isDestroyed()?e():n(i)})))}}));return this._promise=e.promise.then((function(){if(!t.isDestroyed())return t._bufferViewTypedArray=e.typedArray,t._state=_K.PROCESSING,n})).catch((function(e){if(!t.isDestroyed())return function(e,t){e.unload(),e._state=_K.FAILED;return Promise.reject(e.getError("Failed to load Draco",t))}(t,e)})),this._promise},OK.prototype.process=function(e){return s.a.typeOf.object("frameState",e),this._process(this,e)},OK.prototype.unload=function(){Object(l.a)(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0},Object(l.a)(Object.create)&&(wK.prototype=Object.create(gK.prototype),wK.prototype.constructor=wK),Object.defineProperties(wK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}}),wK.prototype.load=function(){return Object(l.a)(this._bufferViewId)?(this._promise=function(e){const t=e._resourceCache.loadBufferView({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=t,e._state=_K.LOADING,t.promise.then((function(){if(e.isDestroyed())return;return function(e){const t=function(e){const t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(255===t[0]&&216===t[1])return"image/jpeg";if(137===t[0]&&80===t[1])return"image/png";if(171===t[0]&&75===t[1])return"image/ktx2";if(82===n[0]&&73===n[1]&&70===n[2]&&70===n[3]&&87===i[0]&&69===i[1]&&66===i[2]&&80===i[3])return"image/webp";throw new ye.a("Image format is not recognized")}(e);if("image/ktx2"===t){const t=new Uint8Array(e);return sE(t)}return wK._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}(t.typedArray).then((function(t){if(e.isDestroyed())return;const n=AK(t);return e.unload(),e._image=n.image,e._mipLevels=n.mipLevels,e._state=_K.READY,e}))})).catch((function(t){if(!e.isDestroyed())return EK(e,t,"Failed to load embedded image")}))}(this),this._promise):(this._promise=function(e){const t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});return e._state=_K.LOADING,function(e){const t=e.url;if(TK.test(t))return sE(e);return e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}(i).then((function(t){if(e.isDestroyed())return;const n=AK(t);return e.unload(),e._image=n.image,e._mipLevels=n.mipLevels,e._state=_K.READY,e})).catch((function(t){if(!e.isDestroyed())return EK(e,t,"Failed to load image: "+n)}))}(this),this._promise)};const TK=/(^data:image\/ktx2)|(\.ktx2$)/i;function CK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltf,i=e.accessorId,r=e.gltfResource,o=e.baseResource,a=e.draco,l=e.cacheKey,h=Object(c.a)(e.asynchronous,!0),d=Object(c.a)(e.loadBuffer,!1),f=Object(c.a)(e.loadTypedArray,!1);if(s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltf",n),s.a.typeOf.number("options.accessorId",i),s.a.typeOf.object("options.gltfResource",r),s.a.typeOf.object("options.baseResource",o),!d&&!f)throw new u.a("At least one of loadBuffer and loadTypedArray must be true.");const p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=r,this._baseResource=o,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._draco=a,this._cacheKey=l,this._asynchronous=h,this._loadBuffer=d,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=_K.UNLOADED,this._promise=void 0,this._process=function(e,t){}}wK.prototype.unload=function(){Object(l.a)(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0},wK._loadImageFromTypedArray=rE,Object(l.a)(Object.create)&&(CK.prototype=Object.create(gK.prototype),CK.prototype.constructor=CK),Object.defineProperties(CK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});const xK=new SK;function SK(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}function IK(e,t,n){const i=ZN.createIndexBuffer({typedArray:e,context:n,usage:KN.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}function PK(e){Object(l.a)(e.extras)&&(Object(l.a)(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}CK.prototype.load=function(){let e;e=Object(l.a)(this._draco)?function(e){const t=e._resourceCache.loadDraco({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=t,e._state=_K.LOADING,t.promise.then((function(){if(e.isDestroyed())return;const n=t.decodedData.indices.typedArray;return e._typedArray=n,e._indexDatatype=gs.fromTypedArray(n),e._state=_K.PROCESSING,e}))}(this):function(e){const t=e._gltf,n=e._accessorId,i=t.accessors[n].bufferView,r=e._resourceCache.loadBufferView({gltf:t,bufferViewId:i,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._state=_K.LOADING,e._bufferViewLoader=r,r.promise.then((function(){if(e.isDestroyed())return;const t=r.typedArray;return e._typedArray=function(e,t){const n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,a=r.componentType,s=t.buffer,c=t.byteOffset+r.byteOffset;let l;a===wc.UNSIGNED_BYTE?l=new Uint8Array(s,c,o):a===wc.UNSIGNED_SHORT?l=new Uint16Array(s,c,o):a===wc.UNSIGNED_INT&&(l=new Uint32Array(s,c,o));return l}(e,t),e._state=_K.PROCESSING,e}))}(this);const t=this,n=new Promise((function(e){t._process=function(t,n){if(t._state===_K.READY)return;const i=t._typedArray,r=t._indexDatatype;if(Object(l.a)(t._dracoLoader)&&t._dracoLoader.process(n),Object(l.a)(t._bufferViewLoader)&&t._bufferViewLoader.process(n),!Object(l.a)(i))return;let o;if(t._loadBuffer&&t._asynchronous){const e=xK;e.set(i,r,n.context);if(!n.jobScheduler.execute(e,Kq.BUFFER))return;o=e.buffer}else t._loadBuffer&&(o=IK(i,r,n.context));t.unload(),t._buffer=o,t._typedArray=t._loadTypedArray?i:void 0,t._state=_K.READY,e(t)}}));return this._promise=e.then((function(){if(!t.isDestroyed())return n})).catch((function(e){if(!t.isDestroyed())return function(e,t){e.unload(),e._state=_K.FAILED;return t=e.getError("Failed to load index buffer",t),Promise.reject(t)}(t,e)})),this._promise},SK.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n},SK.prototype.execute=function(){this.buffer=IK(this.typedArray,this.indexDatatype,this.context)},CK.prototype.process=function(e){return s.a.typeOf.object("frameState",e),this._process(this,e)},CK.prototype.unload=function(){Object(l.a)(this._buffer)&&this._buffer.destroy();const e=this._resourceCache;Object(l.a)(this._bufferViewLoader)&&e.unload(this._bufferViewLoader),Object(l.a)(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var DK=function(e){return kV.shader(e,(function(e){PK(e)})),kV.buffer(e,(function(e){PK(e)})),kV.image(e,(function(e){PK(e)})),PK(e),e};function RK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltfResource,i=e.baseResource,r=e.typedArray,o=e.gltfJson,a=e.cacheKey;s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltfResource",n),s.a.typeOf.object("options.baseResource",i),this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=r,this._gltfJson=o,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=_K.UNLOADED,this._promise=void 0}function jK(e,t){return WV(t),function(e){const t=[];return kV.buffer(e,(function(e){const n=e.uri;!Object(l.a)(e.extras._pipeline.source)&&Object(l.a)(n)&&Object(GA.a)(n)&&(delete e.uri,t.push(Tt.a.fetchArrayBuffer(n).then((function(t){e.extras._pipeline.source=new Uint8Array(t)}))))})),Promise.all(t)}(t).then((function(){return function(e,t){if("2.0"===t.asset.version)return Promise.resolve();const n=[];return kV.buffer(t,(function(t){if(!Object(l.a)(t.extras._pipeline.source)&&Object(l.a)(t.uri)){const i=e._baseResource.getDerivedResource({url:t.uri}),r=e._resourceCache.loadExternalBuffer({resource:i});e._bufferLoaders.push(r),n.push(r.promise.then((function(e){t.extras._pipeline.source=e.typedArray})))}})),Promise.all(n).then((function(){PH(t)}))}(e,t)})).then((function(){return GV(t),function(e,t){const n=[];return kV.buffer(t,(function(t,i){const r=t.extras._pipeline.source;if(Object(l.a)(r)&&!Object(l.a)(t.uri)){const t=e._resourceCache.loadEmbeddedBuffer({parentResource:e._gltfResource,bufferId:i,typedArray:r});e._bufferLoaders.push(t),n.push(t.promise)}})),Promise.all(n)}(e,t)})).then((function(){return DK(t),t}))}function MK(e,t){let n;return n="glTF"===Jv(t)?JV(t):qu(t),jK(e,n)}Object(l.a)(Object.create)&&(RK.prototype=Object.create(gK.prototype),RK.prototype.constructor=RK),Object.defineProperties(RK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}}),RK.prototype.load=function(){let e;var t;this._state=_K.LOADING,e=Object(l.a)(this._gltfJson)?jK(this,this._gltfJson):Object(l.a)(this._typedArray)?MK(this,this._typedArray):(t=this)._fetchGltf().then((function(e){if(t.isDestroyed())return;const n=new Uint8Array(e);return MK(t,n)}));const n=this;return this._promise=e.then((function(e){if(!n.isDestroyed())return n._gltf=e,n._state=_K.READY,n})).catch((function(e){if(!n.isDestroyed())return function(e,t){e.unload(),e._state=_K.FAILED;const n="Failed to load glTF: "+e._gltfResource.url;return Promise.reject(e.getError(n,t))}(n,e)})),this._promise},RK.prototype.unload=function(){const e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0},RK.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var LK=Object.freeze({OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"});const NK={};function BK(){this.credits=[]}function FK(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=_e.clone(FK.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=FK.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=FK.DEFAULT_ROUGHNESS_FACTOR}function zK(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=_e.clone(zK.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=O.clone(zK.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=zK.DEFAULT_GLOSSINESS_FACTOR}function kK(){this.metallicRoughness=new FK,this.specularGlossiness=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=O.clone(kK.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=LK.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}FK.DEFAULT_BASE_COLOR_FACTOR=_e.ONE,FK.DEFAULT_METALLIC_FACTOR=1,FK.DEFAULT_ROUGHNESS_FACTOR=1,zK.DEFAULT_DIFFUSE_FACTOR=_e.ONE,zK.DEFAULT_SPECULAR_FACTOR=O.ONE,zK.DEFAULT_GLOSSINESS_FACTOR=1,kK.DEFAULT_EMISSIVE_FACTOR=O.ZERO,NK.Quantization=function(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0},NK.Attribute=function(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0},NK.Indices=function(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0},NK.FeatureIdAttribute=function(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0},NK.FeatureIdTexture=function(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0},NK.FeatureIdImplicitRange=function(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0},NK.MorphTarget=function(){this.attributes=[]},NK.Primitive=function(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0},NK.Instances=function(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1},NK.Skin=function(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]},NK.Node=function(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0},NK.Scene=function(){this.nodes=[]},NK.AnimatedPropertyType=Object.freeze({TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"}),NK.AnimationSampler=function(){this.input=[],this.interpolation=void 0,this.output=[]},NK.AnimationTarget=function(){this.node=void 0,this.path=void 0},NK.AnimationChannel=function(){this.sampler=void 0,this.target=void 0},NK.Animation=function(){this.name=void 0,this.samplers=[],this.channels=[]},NK.ArticulationStage=function(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0},NK.Articulation=function(){this.name=void 0,this.stages=[]},NK.Asset=BK,NK.Components=function(){this.asset=new BK,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=Me.clone(Me.IDENTITY)},NK.TextureReader=function(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=ce.clone(ce.IDENTITY),this.channels=void 0},NK.MetallicRoughness=FK,NK.SpecularGlossiness=zK,NK.Material=kK;var UK=NK;const VK={getImageIdFromTexture:function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.textureId,i=e.supportedImageFormats;s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.textureId",n),s.a.typeOf.object("options.supportedImageFormats",i);const r=t.textures[n],o=r.extensions;if(Object(l.a)(o)){if(i.webp&&Object(l.a)(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&Object(l.a)(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source},createSampler:function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.textureInfo,i=Object(c.a)(e.compressedTextureNoMipmap,!1);s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.textureInfo",n);let r=GD.REPEAT,o=GD.REPEAT,a=VD.LINEAR,u=kD.LINEAR;const h=n.index,d=t.textures[h].sampler;if(Object(l.a)(d)){const e=t.samplers[d];r=Object(c.a)(e.wrapS,r),o=Object(c.a)(e.wrapT,o),a=Object(c.a)(e.minFilter,a),u=Object(c.a)(e.magFilter,u)}let f=!1;const p=n.extensions;return Object(l.a)(p)&&Object(l.a)(p.KHR_texture_transform)&&(f=!0),(i||f)&&a!==VD.LINEAR&&a!==VD.NEAREST&&(a=a===VD.NEAREST_MIPMAP_NEAREST||a===VD.NEAREST_MIPMAP_LINEAR?VD.NEAREST:VD.LINEAR),new WD({wrapS:r,wrapT:o,minificationFilter:a,magnificationFilter:u})}},HK=new Vt(1,1);VK.createModelTextureReader=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).textureInfo,n=e.channels,i=e.texture;s.a.typeOf.object("options.textureInfo",t);let r,o=Object(c.a)(t.texCoord,0);const a=Object(c.a)(t.extensions,c.a.EMPTY_OBJECT).KHR_texture_transform;if(Object(l.a)(a)){o=Object(c.a)(a.texCoord,o);const e=Object(l.a)(a.offset)?Vt.unpack(a.offset):Vt.ZERO;let t=Object(c.a)(a.rotation,0);const n=Object(l.a)(a.scale)?Vt.unpack(a.scale):HK;t=-t,r=new ce(Math.cos(t)*n.x,-Math.sin(t)*n.y,e.x,Math.sin(t)*n.x,Math.cos(t)*n.y,e.y,0,0,1)}const u=new UK.TextureReader;return u.index=t.index,u.texture=i,u.texCoord=o,u.transform=r,u.channels=n,u};var GK=VK;function qK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltf,i=e.textureInfo,r=e.gltfResource,o=e.baseResource,a=e.supportedImageFormats,l=e.cacheKey,u=Object(c.a)(e.asynchronous,!0);s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltf",n),s.a.typeOf.object("options.textureInfo",i),s.a.typeOf.object("options.gltfResource",r),s.a.typeOf.object("options.baseResource",o),s.a.typeOf.object("options.supportedImageFormats",a);const h=i.index,d=GK.getImageIdFromTexture({gltf:n,textureId:h,supportedImageFormats:a});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=d,this._gltfResource=r,this._baseResource=o,this._cacheKey=l,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=_K.UNLOADED,this._promise=void 0,this._process=function(e,t){}}Object(l.a)(Object.create)&&(qK.prototype=Object.create(gK.prototype),qK.prototype.constructor=qK),Object.defineProperties(qK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});const WK=new YK;function YK(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}function XK(e,t,n,i,r){const o=n.internalFormat;let a=!1;aT.isCompressedFormat(o)&&!Object(l.a)(i)&&(a=!0);const s=GK.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),c=s.minificationFilter,u=s.wrapS,d=s.wrapT,f=c===VD.NEAREST_MIPMAP_NEAREST||c===VD.NEAREST_MIPMAP_LINEAR||c===VD.LINEAR_MIPMAP_NEAREST||c===VD.LINEAR_MIPMAP_LINEAR,p=!Object(l.a)(o)&&f,m=p||u===GD.REPEAT||u===GD.MIRRORED_REPEAT||d===GD.REPEAT||d===GD.MIRRORED_REPEAT,g=!h.a.isPowerOfTwo(n.width)||!h.a.isPowerOfTwo(n.height),_=m&&g;let y;return Object(l.a)(o)?(!r.webgl2&&aT.isCompressedFormat(o)&&g&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),y=JD.create({context:r,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:s})):(_&&(n=Xx(n)),y=JD.create({context:r,source:n,sampler:s,flipY:!1,skipColorSpaceConversion:!0})),p&&y.generateMipmap(),y}function KK(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceCache,n=e.gltf,i=e.gltfResource,r=e.baseResource,o=e.bufferViewId,a=e.draco,h=e.attributeSemantic,d=e.accessorId,f=e.cacheKey,p=Object(c.a)(e.asynchronous,!0),m=Object(c.a)(e.dequantize,!1),g=Object(c.a)(e.loadBuffer,!1),_=Object(c.a)(e.loadTypedArray,!1);if(s.a.typeOf.func("options.resourceCache",t),s.a.typeOf.object("options.gltf",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r),!g&&!_)throw new u.a("At least one of loadBuffer and loadTypedArray must be true.");const y=Object(l.a)(o),b=Object(l.a)(a),v=Object(l.a)(h),O=Object(l.a)(d);if(y===b)throw new u.a("One of options.bufferViewId and options.draco must be defined.");if(b&&!v)throw new u.a("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!O)throw new u.a("When options.draco is defined options.accessorId must also be defined.");b&&(s.a.typeOf.object("options.draco",a),s.a.typeOf.string("options.attributeSemantic",h),s.a.typeOf.number("options.accessorId",d)),this._resourceCache=t,this._gltfResource=i,this._baseResource=r,this._gltf=n,this._bufferViewId=o,this._draco=a,this._attributeSemantic=h,this._accessorId=d,this._cacheKey=f,this._asynchronous=p,this._dequantize=m,this._loadBuffer=g,this._loadTypedArray=_,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=_K.UNLOADED,this._promise=void 0,this._process=function(e,t){}}function JK(){this.typedArray=void 0,this.dequantize=void 0,this.componentType=void 0,this.type=void 0,this.count=void 0,this.context=void 0,this.buffer=void 0}function ZK(e,t,n,i,r,o){t&&n!==gs.FLOAT&&(e=js.dequantize(e,n,i,r));const a=ZN.createVertexBuffer({typedArray:e,context:o,usage:KN.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}function $K(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).id,n=e.class;s.a.typeOf.string("options.id",t),s.a.typeOf.object("options.class",n);const i={},r={};for(const t in n.properties)if(n.properties.hasOwnProperty(t)){const o=new oK({id:t,property:n.properties[t],enums:e.enums});i[t]=o,Object(l.a)(o.semantic)&&(r[o.semantic]=o)}this._properties=i,this._propertiesBySemantic=r,this._id=t,this._name=n.name,this._description=n.description,this._extras=n.extras,this._extensions=n.extensions}qK.prototype.load=function(){const e=this._resourceCache.loadImage({gltf:this._gltf,imageId:this._imageId,gltfResource:this._gltfResource,baseResource:this._baseResource});this._imageLoader=e,this._state=_K.LOADING;const t=this,n=new Promise((function(e){t._process=function(t,n){if(Object(l.a)(t._texture))return;if(!Object(l.a)(t._image))return;let i;if(t._asynchronous){const e=WK;e.set(t._gltf,t._textureInfo,t._image,t._mipLevels,n.context);if(!n.jobScheduler.execute(e,Kq.TEXTURE))return;i=e.texture}else i=XK(t._gltf,t._textureInfo,t._image,t._mipLevels,n.context);t.unload(),t._texture=i,t._state=_K.READY,e(t)}}));return this._promise=e.promise.then((function(){if(!t.isDestroyed())return t._image=e.image,t._mipLevels=e.mipLevels,t._state=_K.PROCESSING,n})).catch((function(e){if(t.isDestroyed())return;t.unload(),t._state=_K.FAILED;return Promise.reject(t.getError("Failed to load texture",e))})),this._promise},YK.prototype.set=function(e,t,n,i,r){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=r},YK.prototype.execute=function(){this.texture=XK(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)},qK.prototype.process=function(e){return s.a.typeOf.object("frameState",e),this._process(this,e)},qK.prototype.unload=function(){Object(l.a)(this._texture)&&this._texture.destroy(),Object(l.a)(this._imageLoader)&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0},Object(l.a)(Object.create)&&(KK.prototype=Object.create(gK.prototype),KK.prototype.constructor=KK),Object.defineProperties(KK.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}}),KK.prototype.load=function(){let e;e=Object(l.a)(this._draco)?function(e){const t=e._resourceCache.loadDraco({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=t,e._state=_K.LOADING,t.promise.then((function(){if(e.isDestroyed())return;const n=t.decodedData.vertexAttributes[e._attributeSemantic],i=e._accessorId,r=e._gltf.accessors[i].type,o=n.array,a=n.data.quantization;return Object(l.a)(a)&&(e._quantization=function(e,t,n,i){const r=(1<<e.quantizationBits)-1,o=1/r,a=new UK.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Cs.VEC2,a.normalizationRange=r;else{const t=Cs.getMathType(i);if(t===Number){const t=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=t,a.normalizationRange=r,a.quantizedVolumeStepSize=t*o}else{a.quantizedVolumeOffset=t.unpack(e.minValues),a.normalizationRange=t.unpack(new Array(n).fill(r));const i=new Array(n).fill(e.range);a.quantizedVolumeDimensions=t.unpack(i);const s=i.map((function(e){return e*o}));a.quantizedVolumeStepSize=t.unpack(s)}}return a}(a,n.data.componentDatatype,n.data.componentsPerAttribute,r)),e._typedArray=new Uint8Array(o.buffer,o.byteOffset,o.byteLength),e._state=_K.PROCESSING,e}))}(this):function(e){const t=e._resourceCache.loadBufferView({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._state=_K.LOADING,e._bufferViewLoader=t,t.promise.then((function(){if(!e.isDestroyed())return e._typedArray=t.typedArray,e._state=_K.PROCESSING,e}))}(this);const t=this,n=new JK,i=new Promise((function(e){t._process=function(t,i){if(t._state===_K.READY)return;const r=t._typedArray,o=t._dequantize;if(Object(l.a)(t._dracoLoader)&&t._dracoLoader.process(i),Object(l.a)(t._bufferViewLoader)&&t._bufferViewLoader.process(i),!Object(l.a)(r))return;const a=t._gltf.accessors[t._accessorId];let s;if(t._loadBuffer&&t._asynchronous){const e=n;e.set(r,o,a.componentType,a.type,a.count,i.context);if(!i.jobScheduler.execute(e,Kq.BUFFER))return;s=e.buffer}else t._loadBuffer&&(s=ZK(r,o,a.componentType,a.type,a.count,i.context));t.unload(),t._buffer=s,t._typedArray=t._loadTypedArray?r:void 0,t._state=_K.READY,e(t)}}));return this._promise=e.then((function(){if(!t.isDestroyed())return i})).catch((function(e){if(!t.isDestroyed())return function(e,t){e.unload(),e._state=_K.FAILED;return t=e.getError("Failed to load vertex buffer",t),Promise.reject(t)}(t,e)})),this._promise},JK.prototype.set=function(e,t,n,i,r,o){this.typedArray=e,this.dequantize=t,this.componentType=n,this.type=i,this.count=r,this.context=o},JK.prototype.execute=function(){this.buffer=ZK(this.typedArray,this.dequantize,this.componentType,this.type,this.count,this.context)},KK.prototype.process=function(e){return s.a.typeOf.object("frameState",e),this._process(this,e)},KK.prototype.unload=function(){Object(l.a)(this._buffer)&&this._buffer.destroy();const e=this._resourceCache;Object(l.a)(this._bufferViewLoader)&&e.unload(this._bufferViewLoader),Object(l.a)(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0},Object.defineProperties($K.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),$K.BATCH_TABLE_CLASS_NAME="_batchTable";var QK=$K;function eJ(e){s.a.typeOf.object("value",e),this._value=e.value,this._name=e.name,this._description=e.description,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(eJ.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var tJ=eJ;function nJ(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).id,n=e.enum;s.a.typeOf.string("options.id",t),s.a.typeOf.object("options.enum",n);const i={},r={},o=n.values.map((function(e){return i[e.value]=e.name,r[e.name]=e.value,new tJ(e)})),a=Object(c.a)(KX[n.valueType],KX.UINT16);this._values=o,this._namesByValue=i,this._valuesByName=r,this._valueType=a,this._id=t,this._name=n.name,this._description=n.description,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(nJ.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var iJ=nJ;function rJ(e){s.a.typeOf.object("schema",e);const t={};if(Object(l.a)(e.enums))for(const n in e.enums)e.enums.hasOwnProperty(n)&&(t[n]=new iJ({id:n,enum:e.enums[n]}));const n={};if(Object(l.a)(e.classes))for(const i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=new QK({id:i,class:e.classes[i],enums:t}));this._classes=n,this._enums=t,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(rJ.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var oJ=rJ;function aJ(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).schema,n=e.resource,i=e.cacheKey;if(Object(l.a)(t)===Object(l.a)(n))throw new u.a("One of options.schema and options.resource must be defined.");this._schema=Object(l.a)(t)?new oJ(t):void 0,this._resource=n,this._cacheKey=i,this._state=_K.UNLOADED,this._promise=void 0}Object(l.a)(Object.create)&&(aJ.prototype=Object.create(gK.prototype),aJ.prototype.constructor=aJ),Object.defineProperties(aJ.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}}),aJ.prototype.load=function(){return Object(l.a)(this._schema)?this._promise=Promise.resolve(this):this._promise=function(e){const t=e._resource;return e._state=_K.LOADING,t.fetchJson().then((function(t){if(!e.isDestroyed())return e._schema=new oJ(t),e._state=_K.READY,e})).catch((function(n){if(e.isDestroyed())return;e._state=_K.FAILED;const i="Failed to load schema: "+t.url;return Promise.reject(e.getError(i,n))}))}(this),this._promise},aJ.prototype.unload=function(){this._schema=void 0};const sJ={};function cJ(e){return Object(Et.a)(e.url)}function lJ(e){let t=e.byteOffset,n=e.byteLength;if(zX(e,"EXT_meshopt_compression")){const i=e.extensions.EXT_meshopt_compression;t=Object(c.a)(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function uJ(e){return cJ(e)}function hJ(e,t){return`${cJ(e)}-buffer-id-${t}`}function dJ(e,t,n,i){if(Object(l.a)(e.uri)){return uJ(i.getDerivedResource({url:e.uri}))}return hJ(n,t)}function fJ(e,t,n,i){const r=t.bufferView,o=e.bufferViews[r],a=o.buffer;return`${dJ(e.buffers[a],a,n,i)}-range-${lJ(o)}`}function pJ(e,t,n,i){const r=e.images[t],o=r.bufferView,a=r.uri;if(Object(l.a)(a)){return cJ(i.getDerivedResource({url:a}))}const s=e.bufferViews[o],c=s.buffer;return`${dJ(e.buffers[c],c,n,i)}-range-${lJ(s)}`}sJ.getSchemaCacheKey=function(e){const t=e.schema,n=e.resource;if(Object(l.a)(t)===Object(l.a)(n))throw new u.a("One of options.schema and options.resource must be defined.");return Object(l.a)(t)?"embedded-schema:"+JSON.stringify(t):"external-schema:"+cJ(n)},sJ.getExternalBufferCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resource;return s.a.typeOf.object("options.resource",t),"external-buffer:"+uJ(t)},sJ.getEmbeddedBufferCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).parentResource,n=e.bufferId;return s.a.typeOf.object("options.parentResource",t),s.a.typeOf.number("options.bufferId",n),"embedded-buffer:"+hJ(t,n)},sJ.getGltfCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltfResource;return s.a.typeOf.object("options.gltfResource",t),"gltf:"+cJ(t)},sJ.getBufferViewCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource;s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.bufferViewId",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r);const o=t.bufferViews[n];let a=o.buffer;const l=t.buffers[a];if(zX(o,"EXT_meshopt_compression")){a=o.extensions.EXT_meshopt_compression.buffer}return`buffer-view:${dJ(l,a,i,r)}-range-${lJ(o)}`},sJ.getDracoCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.draco,i=e.gltfResource,r=e.baseResource;return s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.draco",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r),"draco:"+fJ(t,n,i,r)},sJ.getVertexBufferCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.gltfResource,i=e.baseResource,r=e.bufferViewId,o=e.draco,a=e.attributeSemantic,h=Object(c.a)(e.dequantize,!1),d=Object(c.a)(e.loadBuffer,!1),f=Object(c.a)(e.loadTypedArray,!1);s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.gltfResource",n),s.a.typeOf.object("options.baseResource",i);const p=Object(l.a)(r),m=Object(l.a)(o),g=Object(l.a)(a);if(p===m)throw new u.a("One of options.bufferViewId and options.draco must be defined.");if(m&&!g)throw new u.a("When options.draco is defined options.attributeSemantic must also be defined.");if(m&&(s.a.typeOf.object("options.draco",o),s.a.typeOf.string("options.attributeSemantic",a)),!d&&!f)throw new u.a("At least one of loadBuffer and loadTypedArray must be true.");let _="";if(h&&(_+="-dequantize"),d&&(_+="-buffer"),f&&(_+="-typed-array"),Object(l.a)(o)){return`vertex-buffer:${fJ(t,o,n,i)}-draco-${a}${_}`}const y=t.bufferViews[r],b=y.buffer;return`vertex-buffer:${dJ(t.buffers[b],b,n,i)}-range-${lJ(y)}${_}`},sJ.getIndexBufferCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.draco,a=Object(c.a)(e.loadBuffer,!1),h=Object(c.a)(e.loadTypedArray,!1);if(s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.accessorId",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r),!a&&!h)throw new u.a("At least one of loadBuffer and loadTypedArray must be true.");let d="";if(a&&(d+="-buffer"),h&&(d+="-typed-array"),Object(l.a)(o)){return`index-buffer:${fJ(t,o,i,r)}-draco${d}`}const f=t.accessors[n],p=f.bufferView,m=t.bufferViews[p],g=m.buffer;return`index-buffer:${dJ(t.buffers[g],g,i,r)}-accessor-${function(e,t){return`${t.byteOffset+e.byteOffset}-${e.componentType}-${e.type}-${e.count}`}(f,m)}${d}`},sJ.getImageCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource;s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.imageId",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r);return"image:"+pJ(t,n,i,r)},sJ.getTextureCacheKey=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats;s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.textureInfo",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r),s.a.typeOf.object("options.supportedImageFormats",o);const a=n.index;return`texture:${pJ(t,GK.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),i,r)}-sampler-${function(e,t){const n=GK.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}(t,n)}`};var mJ=sJ;function gJ(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}function _J(){}function yJ(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}gJ.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}},gJ.prototype.addGeometryLoader=function(e){s.a.typeOf.object("loader",e);const t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;const n=this;return e.promise.then((function(e){if(!n._geometrySizes.hasOwnProperty(t))return;const i=e.buffer,r=e.typedArray;let o=0;Object(l.a)(i)&&(o+=i.sizeInBytes),Object(l.a)(r)&&(o+=r.byteLength),n.geometryByteLength+=o,n._geometrySizes[t]=o})).catch((function(){delete n._geometrySizes[t]}))},gJ.prototype.addTextureLoader=function(e){s.a.typeOf.object("loader",e);const t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;const n=this;return e.promise.then((function(e){if(!n._textureSizes.hasOwnProperty(t))return;const i=e.texture.sizeInBytes;n.texturesByteLength+=e.texture.sizeInBytes,n._textureSizes[t]=i})).catch((function(){delete n._textureSizes[t]}))},gJ.prototype.removeLoader=function(e){s.a.typeOf.object("loader",e);const t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],Object(l.a)(n)&&(this.geometryByteLength-=n);const i=this._textureSizes[t];delete this._textureSizes[t],Object(l.a)(i)&&(this.texturesByteLength-=i)},_J.cacheEntries={},_J.statistics=new gJ,_J.get=function(e){s.a.typeOf.string("cacheKey",e);const t=_J.cacheEntries[e];if(Object(l.a)(t))return++t.referenceCount,t.resourceLoader},_J.load=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resourceLoader;s.a.typeOf.object("options.resourceLoader",t);const n=t.cacheKey;if(s.a.typeOf.string("options.resourceLoader.cacheKey",n),Object(l.a)(_J.cacheEntries[n]))throw new u.a("Resource with this cacheKey is already in the cache: "+n);_J.cacheEntries[n]=new yJ(t),t.load()},_J.unload=function(e){s.a.typeOf.object("resourceLoader",e);const t=e.cacheKey,n=_J.cacheEntries[t];if(!Object(l.a)(n))throw new u.a("Resource is not in the cache: "+t);--n.referenceCount,0===n.referenceCount&&(_J.statistics.removeLoader(e),e.destroy(),delete _J.cacheEntries[t])},_J.loadSchema=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).schema,n=e.resource;if(Object(l.a)(t)===Object(l.a)(n))throw new u.a("One of options.schema and options.resource must be defined.");const i=mJ.getSchemaCacheKey({schema:t,resource:n});let r=_J.get(i);return Object(l.a)(r)||(r=new aJ({schema:t,resource:n,cacheKey:i}),_J.load({resourceLoader:r})),r},_J.loadEmbeddedBuffer=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).parentResource,n=e.bufferId,i=e.typedArray;s.a.typeOf.object("options.parentResource",t),s.a.typeOf.number("options.bufferId",n);const r=mJ.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n});let o=_J.get(r);return Object(l.a)(o)||(s.a.typeOf.object("options.typedArray",i),o=new yK({typedArray:i,cacheKey:r}),_J.load({resourceLoader:o})),o},_J.loadExternalBuffer=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).resource;s.a.typeOf.object("options.resource",t);const n=mJ.getExternalBufferCacheKey({resource:t});let i=_J.get(n);return Object(l.a)(i)||(i=new yK({resource:t,cacheKey:n}),_J.load({resourceLoader:i})),i},_J.loadGltfJson=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltfResource,n=e.baseResource,i=e.typedArray,r=e.gltfJson;s.a.typeOf.object("options.gltfResource",t),s.a.typeOf.object("options.baseResource",n);const o=mJ.getGltfCacheKey({gltfResource:t});let a=_J.get(o);return Object(l.a)(a)||(a=new RK({resourceCache:_J,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),_J.load({resourceLoader:a})),a},_J.loadBufferView=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.bufferViewId,i=e.gltfResource,r=e.baseResource;s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.bufferViewId",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r);const o=mJ.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r});let a=_J.get(o);return Object(l.a)(a)||(a=new vK({resourceCache:_J,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),_J.load({resourceLoader:a})),a},_J.loadDraco=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.draco,i=e.gltfResource,r=e.baseResource;s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.draco",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r);const o=mJ.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:r});let a=_J.get(o);return Object(l.a)(a)||(a=new OK({resourceCache:_J,gltf:t,draco:n,gltfResource:i,baseResource:r,cacheKey:o}),_J.load({resourceLoader:a})),a},_J.loadVertexBuffer=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.gltfResource,i=e.baseResource,r=e.bufferViewId,o=e.draco,a=e.attributeSemantic,h=e.accessorId,d=Object(c.a)(e.asynchronous,!0),f=Object(c.a)(e.dequantize,!1),p=Object(c.a)(e.loadBuffer,!1),m=Object(c.a)(e.loadTypedArray,!1);if(s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.gltfResource",n),s.a.typeOf.object("options.baseResource",i),!p&&!m)throw new u.a("At least one of loadBuffer and loadTypedArray must be true.");const g=Object(l.a)(r),_=Object(l.a)(o),y=Object(l.a)(a),b=Object(l.a)(h);if(g===_)throw new u.a("One of options.bufferViewId and options.draco must be defined.");if(_&&!y)throw new u.a("When options.draco is defined options.attributeSemantic must also be defined.");if(_&&!b)throw new u.a("When options.draco is defined options.haAccessorId must also be defined.");_&&(s.a.typeOf.object("options.draco",o),s.a.typeOf.string("options.attributeSemantic",a),s.a.typeOf.number("options.accessorId",h));const v=mJ.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:o,attributeSemantic:a,dequantize:f,loadBuffer:p,loadTypedArray:m});let O=_J.get(v);if(Object(l.a)(O))return O;O=new KK({resourceCache:_J,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:o,attributeSemantic:a,accessorId:h,cacheKey:v,asynchronous:d,dequantize:f,loadBuffer:p,loadTypedArray:m}),_J.load({resourceLoader:O});const w=_J.statistics.addGeometryLoader(O);return _J.cacheEntries[v]._statisticsPromise=w,O},_J.loadIndexBuffer=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.accessorId,i=e.gltfResource,r=e.baseResource,o=e.draco,a=Object(c.a)(e.asynchronous,!0),h=Object(c.a)(e.loadBuffer,!1),d=Object(c.a)(e.loadTypedArray,!1);if(s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.accessorId",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r),!h&&!d)throw new u.a("At least one of loadBuffer and loadTypedArray must be true.");const f=mJ.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:o,loadBuffer:h,loadTypedArray:d});let p=_J.get(f);if(Object(l.a)(p))return p;p=new CK({resourceCache:_J,gltf:t,accessorId:n,gltfResource:i,baseResource:r,draco:o,cacheKey:f,asynchronous:a,loadBuffer:h,loadTypedArray:d}),_J.load({resourceLoader:p});const m=_J.statistics.addGeometryLoader(p);return _J.cacheEntries[f]._statisticsPromise=m,p},_J.loadImage=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.imageId,i=e.gltfResource,r=e.baseResource;s.a.typeOf.object("options.gltf",t),s.a.typeOf.number("options.imageId",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r);const o=mJ.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r});let a=_J.get(o);return Object(l.a)(a)||(a=new wK({resourceCache:_J,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),_J.load({resourceLoader:a})),a},_J.loadTexture=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.textureInfo,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,a=Object(c.a)(e.asynchronous,!0);s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.textureInfo",n),s.a.typeOf.object("options.gltfResource",i),s.a.typeOf.object("options.baseResource",r);const u=mJ.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o});let h=_J.get(u);if(Object(l.a)(h))return h;h=new qK({resourceCache:_J,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:u,asynchronous:a}),_J.load({resourceLoader:h});const d=_J.statistics.addTextureLoader(h);return _J.cacheEntries[u]._statisticsPromise=d,h},_J.clearForSpecs=function(){const e=[KK,CK,OK,qK,wK,vK,yK,aJ,RK];let t;const n=_J.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort((function(t,n){return e.indexOf(t.resourceLoader.constructor)-e.indexOf(n.resourceLoader.constructor)}));const r=i.length;for(let e=0;e<r;++e){const r=i[e];t=r.resourceLoader.cacheKey,Object(l.a)(n[t])&&(r.resourceLoader.destroy(),delete n[t])}_J.statistics.clear()};var bJ=_J;function vJ(e,t,n,i,r){if(s.a.typeOf.object("resource",e),Object(l.a)(t)===Object(l.a)(n))throw new u.a("One of json and subtreeView must be defined.");s.a.typeOf.object("implicitTileset",i),s.a.typeOf.object("implicitCoordinates",r),this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=r,this._subtreeLevels=i.subtreeLevels,this._subdivisionScheme=i.subdivisionScheme,this._branchingFactor=i.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._readyPromise=function(e,t,n,i){let r;r=Object(l.a)(t)?{json:t,binary:void 0}:function(e){const t=new DataView(e.buffer,e.byteOffset);let n=8;const i=t.getUint32(n,!0);n+=8;const r=t.getUint32(n,!0);n+=8;const o=qu(e,n,i);n+=i;const a=e.subarray(n,n+r);return{json:o,binary:a}}(n);const o=r.json;let a;if(e._subtreeJson=o,zX(o,"3DTILES_metadata"))a=o.extensions["3DTILES_metadata"];else if(Object(l.a)(o.tileMetadata)){const e=o.tileMetadata;a=o.propertyTables[e]}const s=[];if(Object(l.a)(o.contentMetadata)){const e=o.contentMetadata.length;for(let t=0;t<e;t++){const e=o.contentMetadata[t];s.push(o.propertyTables[e])}}let u;const h=i.metadataSchema,d=o.subtreeMetadata;if(Object(l.a)(d)){const e=d.class,t=h.classes[e];u=new YX({subtreeMetadata:d,class:t})}e._metadata=u,e._tilePropertyTableJson=a,e._contentPropertyTableJsons=s;const f={constant:0};o.contentAvailabilityHeaders=[],zX(o,"3DTILES_multiple_contents")?o.contentAvailabilityHeaders=o.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(o.contentAvailability)?o.contentAvailabilityHeaders=o.contentAvailability:o.contentAvailabilityHeaders.push(Object(c.a)(o.contentAvailability,f));const p=function(e){e=Object(l.a)(e)?e:[];for(let t=0;t<e.length;t++){const n=e[t];n.isExternal=Object(l.a)(n.uri),n.isActive=!1}return e}(o.buffers),m=function(e,t){e=Object(l.a)(e)?e:[];for(let n=0;n<e.length;n++){const i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}(o.bufferViews,p);(function(e,t){let n;const i=e.tileAvailability;Object(l.a)(i.bitstream)?n=t[i.bitstream]:Object(l.a)(i.bufferView)&&(n=t[i.bufferView]);Object(l.a)(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);const r=e.contentAvailabilityHeaders;for(let e=0;e<r.length;e++)n=void 0,Object(l.a)(r[e].bitstream)?n=t[r[e].bitstream]:Object(l.a)(r[e].bufferView)&&(n=t[r[e].bufferView]),Object(l.a)(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;const o=e.childSubtreeAvailability;Object(l.a)(o.bitstream)?n=t[o.bitstream]:Object(l.a)(o.bufferView)&&(n=t[o.bufferView]);Object(l.a)(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)})(o,m),Object(l.a)(a)&&OJ(a,m);for(let e=0;e<s.length;e++){OJ(s[e],m)}return function(e,t,n){const i=[];for(let r=0;r<t.length;r++){const o=t[r];if(o.isActive)if(o.isExternal){const t=wJ(e,o);i.push(t)}else i.push(Promise.resolve(n));else i.push(Promise.resolve(void 0))}return Promise.all(i).then((function(e){const t={};for(let n=0;n<e.length;n++){const i=e[n];Object(l.a)(i)&&(t[n]=i)}return t}))}(e,p,r.binary).then((function(t){const n=function(e,t){const n={};for(let i=0;i<e.length;i++){const r=e[i];if(!r.isActive)continue;const o=r.byteOffset,a=o+r.byteLength,s=t[r.buffer].subarray(o,a);n[i]=s}return n}(m,t);return function(e,t,n,i){const r=n.branchingFactor,o=n.subtreeLevels,a=(Math.pow(r,o)-1)/(r-1),s=Math.pow(r,o),c=zX(t,"3DTILES_metadata"),u=Object(l.a)(e._tilePropertyTableJson);let h=c||u;e._tileAvailability=AJ(t.tileAvailability,i,a,h);const d=e._contentPropertyTableJsons.length>0;h=h||d;for(let n=0;n<t.contentAvailabilityHeaders.length;n++){const r=AJ(t.contentAvailabilityHeaders[n],i,a,h);e._contentAvailabilityBitstreams.push(r)}e._childSubtreeAvailability=AJ(t.childSubtreeAvailability,i,s)}(e,o,i,n),Object(l.a)(a)&&(function(e,t,n){const i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,a=i.class,s=o.classes[a];e._tileMetadataTable=new mK({class:s,count:r,properties:i.properties,bufferViews:n})}(e,i,n),function(e){const t=EJ(e._tileAvailability);e._tileJumpBuffer=t}(e)),function(e,t,n){const i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,a=e._contentMetadataTables;for(let e=0;e<i.length;e++){const t=i[e],s=r[e].availableCount,c=t.class,l=o.classes[c],u=new mK({class:l,count:s,properties:t.properties,bufferViews:n});a.push(u)}}(e,i,n),function(e){const t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let e=0;e<n.length;e++){const i=EJ(n[e]);t.push(i)}}(e),e}))}(this,t,n,i)}function OJ(e,t){const n=e.properties;let i;for(const e in n)if(n.hasOwnProperty(e)){const r=n[e];i=t[Object(c.a)(r.values,r.bufferView)],i.isActive=!0,i.bufferHeader.isActive=!0;const o=Object(c.a)(r.stringOffsets,r.stringOffsetBufferView);Object(l.a)(o)&&(i=t[o],i.isActive=!0,i.bufferHeader.isActive=!0);const a=Object(c.a)(r.arrayOffsets,r.arrayOffsetBufferView);Object(l.a)(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0)}}function wJ(e,t){const n=e._resource.getDerivedResource({url:t.uri}),i=bJ.loadExternalBuffer({resource:n});return e._bufferLoader=i,i.promise.then((function(e){return e.typedArray}))}function AJ(e,t,n,i){if(Object(l.a)(e.constant))return new kX({constant:Boolean(e.constant),lengthBits:n,availableCount:e.availableCount});let r;return Object(l.a)(e.bitstream)?r=t[e.bitstream]:Object(l.a)(e.bufferView)&&(r=t[e.bufferView]),new kX({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function EJ(e){let t=0;const n=e.lengthBits,i=e.availableCount;let r;r=i<256?new Uint8Array(n):i<65536?new Uint16Array(n):new Uint32Array(n);for(let n=0;n<e.lengthBits;n++)e.getBit(n)&&(r[n]=t,t++);return r}Object.defineProperties(vJ.prototype,{readyPromise:{get:function(){return this._readyPromise}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}}),vJ.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)},vJ.prototype.tileIsAvailableAtCoordinates=function(e){const t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)},vJ.prototype.contentIsAvailableAtIndex=function(e,t){if((t=Object(c.a)(t,0))<0||t>=this._contentAvailabilityBitstreams.length)throw new u.a("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)},vJ.prototype.contentIsAvailableAtCoordinates=function(e,t){const n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)},vJ.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)},vJ.prototype.childSubtreeIsAvailableAtCoordinates=function(e){const t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)},vJ.prototype.getLevelOffset=function(e){const t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)},vJ.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===HX.OCTREE&&(t=3),e>>t},vJ.prototype.getTileIndex=function(e){const t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ye.a("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex},vJ.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ye.a("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex},vJ.prototype.getTileMetadataView=function(e){const t=function(e,t){if(!Object(l.a)(e._tileMetadataTable))return;const n=e.getTileIndex(t);return e._tileAvailability.getBit(n)?e._tileJumpBuffer[n]:void 0}(this,e);if(!Object(l.a)(t))return;const n=this._tileMetadataTable;return new UX({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})},vJ.prototype.getContentMetadataView=function(e,t){const n=function(e,t,n){const i=e._contentMetadataTables;if(!Object(l.a)(i))return;const r=i[n];if(!Object(l.a)(r))return;const o=e._contentAvailabilityBitstreams[n],a=e.getTileIndex(t);if(o.getBit(a)){return e._contentJumpBuffers[n][a]}}(this,e,t);if(!Object(l.a)(n))return;const i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new UX({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})},vJ.prototype.isDestroyed=function(){return!1},vJ.prototype.destroy=function(){return Object(l.a)(this._bufferLoader)&&bJ.unload(this._bufferLoader),sc(this)};var TJ=Object.freeze({ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"});function CJ(e){return s.a.typeOf.object("tileMetadata",e),{tile:{boundingVolume:xJ("TILE",e),minimumHeight:SJ("TILE",e),maximumHeight:IJ("TILE",e)},content:{boundingVolume:xJ("CONTENT",e),minimumHeight:SJ("CONTENT",e),maximumHeight:IJ("CONTENT",e)}}}function xJ(e,t){const n=e+"_BOUNDING_BOX",i=t.getPropertyBySemantic(n);if(Object(l.a)(i))return{box:i};const r=e+"_BOUNDING_REGION",o=t.getPropertyBySemantic(r);if(Object(l.a)(o))return{region:o};const a=e+"_BOUNDING_SPHERE",s=t.getPropertyBySemantic(a);return Object(l.a)(s)?{sphere:s}:void 0}function SJ(e,t){const n=e+"_MINIMUM_HEIGHT";return t.getPropertyBySemantic(n)}function IJ(e,t){const n=e+"_MAXIMUM_HEIGHT";return t.getPropertyBySemantic(n)}function PJ(e,t,n,i,r,o){if(s.a.defined("tile.implicitTileset",t.implicitTileset),s.a.defined("tile.implicitCoordinates",t.implicitCoordinates),Object(l.a)(i)===Object(l.a)(r))throw new u.a("One of json and arrayBuffer must be defined.");const a=t.implicitTileset,h=t.implicitCoordinates;this._implicitTileset=a,this._implicitCoordinates=h,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;const d=h.getTemplateValues(),f=a.subtreeUriTemplate.getDerivedResource({templateValues:d});this._url=f.getUrlComponent(!0),this._readyPromise=function(e,t,n,i){let r;i=Object(c.a)(i,0),Object(l.a)(n)&&(r=new Uint8Array(n,i));const o=new vJ(e._resource,t,r,e._implicitTileset,e._implicitCoordinates);return e._implicitSubtree=o,o.readyPromise.then((function(){return function(e,t){const n=e._tile,i=e._implicitCoordinates.childIndex,r=function(e,t,n,i){const r=RJ(e,t,n,i,0,!0),o=e._tileset.statistics;let a=[r],s=[];const c=e._implicitTileset;for(let n=1;n<c.subtreeLevels;n++){const i=t.getLevelOffset(n),r=c.branchingFactor*a.length;for(let n=0;n<r;n++){const r=i+n;if(!t.tileIsAvailableAtIndex(r)){s.push(void 0);continue}const l=t.getParentMortonIndex(n),u=a[l],h=n%c.branchingFactor,d=RJ(e,t,u,h,r);u.children.push(d),o.numberOfTilesTotal++,s.push(d)}a=s,s=[]}return{rootTile:r,bottomRow:a}}(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;const a=function(e,t,n){const i=[],r=e._implicitTileset.branchingFactor;for(let e=0;e<n.length;e++){const o=n[e];if(Object(l.a)(o))for(let n=0;n<r;n++){const a=e*r+n;t.childSubtreeIsAvailableAtIndex(a)&&i.push({tile:o,childIndex:n})}}return i}(e,t,r.bottomRow);for(let t=0;t<a.length;t++){const n=a[t],i=n.tile,r=qJ(e,i,n.childIndex);i.children.push(r),o.numberOfTilesTotal++}}(e,o),e}))}(this,i,r,o)}function DJ(e,t,n){const i=TJ.TILE_GEOMETRIC_ERROR;return Object(l.a)(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function RJ(e,t,n,i,r,o){const a=e._implicitTileset;let s,u,h,d;if(s=Object(c.a)(o,!1)?n.implicitCoordinates:n.implicitCoordinates.getChildCoordinates(i),Object(l.a)(t.tilePropertyTableJson)){u=t.getTileMetadataView(s);const e=CJ(u);h=e.tile,d=e.content}const f=t.contentPropertyTableJsons.length;let p=!1;for(let e=0;e<f;e++)if(t.contentIsAvailableAtCoordinates(s,e)){p=!0;break}const m=function(e,t,n,i,r,o){let a;a=!Object(l.a)(o)||!Object(l.a)(o.boundingVolume)||!jJ(o.boundingVolume,o)&&jJ(e.boundingVolume,o)?NJ(e,t,n,Object(c.a)(i,!1),r):o.boundingVolume;return MJ(a,o),a}(a,s,i,o,n,h),g=[];for(let e=0;e<a.contentCount;e++){if(!t.contentIsAvailableAtIndex(r,e))continue;const n={uri:a.contentUriTemplates[e].getDerivedResource({templateValues:s.getTemplateValues()}).url},i=LJ(m,d);Object(l.a)(i)&&(n.boundingVolume=i),g.push(Object(up.a)(n,a.contentHeaders[e]))}const _={boundingVolume:m,geometricError:DJ(u,a,s),refine:a.refine,contents:g},y=Object(Zf.a)(a.tileHeader,!0);delete y.boundingVolume,delete y.transform;const b=Object(up.a)(_,y,!0),v=WJ(e,a.baseResource,b,n);return v.implicitCoordinates=s,v.implicitSubtree=t,v.metadata=u,v.hasImplicitContentMetadata=p,v}function jJ(e,t){return Object(l.a)(e)&&Object(l.a)(t)&&(Object(l.a)(t.minimumHeight)||Object(l.a)(t.maximumHeight))&&(zX(e,"3DTILES_bounding_volume_S2")||Object(l.a)(e.region))}function MJ(e,t){Object(l.a)(t)&&(zX(e,"3DTILES_bounding_volume_S2")?function(e,t,n){Object(l.a)(t)&&(e.minimumHeight=t);Object(l.a)(n)&&(e.maximumHeight=n)}(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):Object(l.a)(e.region)&&function(e,t,n){Object(l.a)(t)&&(e[4]=t);Object(l.a)(n)&&(e[5]=n)}(e.region,t.minimumHeight,t.maximumHeight))}function LJ(e,t){let n;return Object(l.a)(t)&&(n=t.boundingVolume),jJ(n,t)?MJ(n,t):jJ(e,t)&&(n=Object(Zf.a)(e,!0),MJ(n,t)),n}function NJ(e,t,n,i,r){const o=e.boundingVolume;if(zX(o,"3DTILES_bounding_volume_S2"))return BJ(i,r,n,t.level,t.x,t.y,t.z);if(Object(l.a)(o.region)){return{region:GJ(o.region,t.level,t.x,t.y,t.z)}}return{box:VJ(o.box,t.level,t.x,t.y,t.z)}}function BJ(e,t,n,i,r,o,a){s.a.typeOf.bool("parentIsPlaceholderTile",e),s.a.typeOf.object("parentTile",t),s.a.typeOf.number("childIndex",n),s.a.typeOf.number("level",i),s.a.typeOf.number("x",r),s.a.typeOf.number("y",o),Object(l.a)(a)&&s.a.typeOf.number("z",a);const c=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:cS.getTokenFromId(c.s2Cell._cellId),minimumHeight:c.minimumHeight,maximumHeight:c.maximumHeight}}};const u=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),h=u%2==0?bA.encode2D(i,r,o):bA.encode2D(i,o,r),d=cS.fromFacePositionLevel(u,BigInt(h),i);let f,p;if(Object(l.a)(a)){const e=(c.maximumHeight+c.minimumHeight)/2;f=n<4?c.minimumHeight:e,p=n<4?e:c.maximumHeight}else f=c.minimumHeight,p=c.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:cS.getTokenFromId(d._cellId),minimumHeight:f,maximumHeight:p}}}}Object.defineProperties(PJ.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){throw new u.a("Implicit3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});const FJ=new O,zJ=new O,kJ=new O,UJ=new ce;function VJ(e,t,n,i,r){if(s.a.typeOf.object("rootBox",e),s.a.typeOf.number("level",t),s.a.typeOf.number("x",n),s.a.typeOf.number("y",i),Object(l.a)(r)&&s.a.typeOf.number("z",r),0===t)return e;const o=O.unpack(e,0,zJ),a=ce.unpack(e,3,UJ),c=Math.pow(2,-t),u=(2*n+1)*c-1,h=(2*i+1)*c-1;let d=0;const f=O.fromElements(c,c,1,FJ);Object(l.a)(r)&&(d=(2*r+1)*c-1,f.z=c);let p=O.fromElements(u,h,d,kJ);p=ce.multiplyByVector(a,p,kJ),p=O.add(p,o,kJ);let m=ce.clone(a);m=ce.multiplyByScale(m,f,m);const g=new Array(12);return O.pack(p,g),ce.pack(m,g,3),g}const HJ=new Be;function GJ(e,t,n,i,r){if(s.a.typeOf.object("rootRegion",e),s.a.typeOf.number("level",t),s.a.typeOf.number("x",n),s.a.typeOf.number("y",i),Object(l.a)(r)&&s.a.typeOf.number("z",r),0===t)return e.slice();const o=Be.unpack(e,0,HJ),a=e[4],c=e[5],u=Math.pow(2,-t),d=u*o.width,f=h.a.negativePiToPi(o.west+n*d),p=h.a.negativePiToPi(f+d),m=u*o.height,g=h.a.negativePiToPi(o.south+i*m),_=h.a.negativePiToPi(g+m);let y=a,b=c;if(Object(l.a)(r)){const e=u*(c-a);y+=r*e,b=y+e}return[f,g,p,_,y,b]}function qJ(e,t,n){const i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=NJ(i,r,n,!1,t),a=DJ(void 0,i,r),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:a,refine:i.refine,contents:[{uri:s}]},l=WJ(e,i.baseResource,c,t);return l.implicitTileset=i,l.implicitCoordinates=r,l}function WJ(e,t,n,i){return new(0,e._tile.constructor)(e._tileset,t,n,i)}PJ.prototype.hasProperty=function(e,t){return!1},PJ.prototype.getFeature=function(e){},PJ.prototype.applyDebugSettings=function(e,t){},PJ.prototype.applyStyle=function(e){},PJ.prototype.update=function(e,t){},PJ.prototype.isDestroyed=function(){return!1},PJ.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),sc(this)},PJ._deriveBoundingBox=VJ,PJ._deriveBoundingRegion=GJ,PJ._deriveBoundingVolumeS2=BJ;const YJ={};YJ._deprecationWarning=ll;const XJ=Uint32Array.BYTES_PER_ELEMENT;YJ.parse=function(e,t){s.a.defined("arrayBuffer",e);const n=Object(c.a)(t,0);t=n;const i=new Uint8Array(e),r=new DataView(e);t+=XJ;const o=r.getUint32(t,!0);if(1!==o)throw new ye.a(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=XJ;const a=r.getUint32(t,!0);t+=XJ;const l=r.getUint32(t,!0);if(0===l)throw new ye.a("featureTableJsonByteLength is zero, the feature table must be defined.");t+=XJ;const u=r.getUint32(t,!0);t+=XJ;const h=r.getUint32(t,!0);t+=XJ;const d=r.getUint32(t,!0);t+=XJ;const f=r.getUint32(t,!0);if(1!==f&&0!==f)throw new ye.a(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${f} is not.`);const p=qu(i,t+=XJ,l);t+=l;const m=new Uint8Array(e,t,u);let g,_;t+=u,h>0&&(g=qu(i,t,h),t+=h,d>0&&(_=new Uint8Array(e,t,d),_=new Uint8Array(_),t+=d));const y=n+a-t;if(0===y)throw new ye.a("glTF byte length must be greater than 0.");let b;return t%4==0?b=new Uint8Array(e,t,y):(YJ._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+y))),{gltfFormat:f,featureTableJson:p,featureTableBinary:m,batchTableJson:g,batchTableBinary:_,gltf:b}};var KJ=YJ;function JJ(e,t,n){this.primitive=e,this._modelMatrix=Me.clone(t),this._instanceId=n}Object.defineProperties(JJ.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return Me.clone(this._modelMatrix)},set:function(e){Me.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var ZJ=JJ;const $J=0,QJ=1,eZ=2,tZ=3;function nZ(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.gltf)&&!Object(l.a)(e.url))throw new u.a("Either options.gltf or options.url is required.");if(Object(l.a)(e.gltf)&&Object(l.a)(e.url))throw new u.a("Cannot pass in both options.gltf and options.url.");this.show=Object(c.a)(e.show,!0),this._instancingSupported=!1,this._dynamic=Object(c.a)(e.dynamic,!1),this._allowPicking=Object(c.a)(e.allowPicking,!0),this._ready=!1,this._readyPromise=Object(oc.a)(),this._state=$J,this._dirty=!1,this._cull=Object(c.a)(e.cull,!0),this._opaquePass=Object(c.a)(e.opaquePass,KR.OPAQUE),this._instances=function(e,t){const n=(t=Object(c.a)(t,[])).length,i=new Array(n);for(let r=0;r<n;++r){const n=t[r],o=n.modelMatrix,a=Object(c.a)(n.batchId,r);i[r]=new ZJ(e,o,a)}return i}(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=function(e){const t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=Me.getTranslation(e._instances[i]._modelMatrix,new O);return At.fromPoints(n)}(this),this._center=O.clone(this._boundingSphere.center),this._rtcTransform=new Me,this._rtcModelView=new Me,this._mode=void 0,this.modelMatrix=Me.clone(Me.IDENTITY),this._modelMatrix=Me.clone(this.modelMatrix),this._url=Tt.a.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=Tt.a.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=Object(c.a)(e.shadows,TB.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.splitDirection=Object(c.a)(e.splitDirection,IW.NONE),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=Object(c.a)(e.debugWireframe,!1),this._debugWireframe=!1,Object(l.a)(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new zU,this._shouldDestroyImageBasedLighting=!0),this.backFaceCulling=Object(c.a)(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling,this.showCreditsOnScreen=Object(c.a)(e.showCreditsOnScreen,!1)}Object.defineProperties(nZ.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}}});const iZ=new O,rZ=new Me;function oZ(e,t,n,i){return function(r,o){const a=r.semantic;if(Object(l.a)(a)&&e.indexOf(a)>-1){if(!(t.indexOf(a)>-1))throw new ye.a(`Shader program cannot be optimized for instancing. Uniform "${o}" in program "${n}" uses unsupported semantic "${a}"`);i[o]=a}}}function aZ(e,t){if(Object(l.a)(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];const n={};e._instancedUniformsByProgram=n;const i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],r=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],o=e._model._sourceTechniques;for(const e in o)if(o.hasOwnProperty(e)){const a=o[e],s=a.program;if(!Object(l.a)(n[s])){const e={};n[s]=e,kV.techniqueUniform(a,oZ(i,r,t,e))}}return n[t]}function sZ(e,t){return function(n,i,r){(n=Object(Zf.a)(n)).czm_instanced_modifiedModelView=function(e,t){return function(){return Me.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}(e,t),n.czm_instanced_nodeTransform=function(e){return function(){return e.computedMatrix}}(r);const o=aZ(e,i);for(const e in o)o.hasOwnProperty(e)&&delete n[e];return Object(l.a)(e._batchTable)&&(n=e._batchTable.getUniformMapCallback()(n)),n}}function cZ(e){const t=e._instances,n=e.length,i=e._center;let r=e._vertexBufferTypedArray;Object(l.a)(r)||(r=new Float32Array(12*n)),e._dynamic&&(e._vertexBufferTypedArray=r);for(let e=0;e<n;++e){const n=t[e]._modelMatrix,o=Me.clone(n,rZ);o[12]-=i.x,o[13]-=i.y,o[14]-=i.z;const a=12*e;r[a+0]=o[0],r[a+1]=o[4],r[a+2]=o[8],r[a+3]=o[12],r[a+4]=o[1],r[a+5]=o[5],r[a+6]=o[9],r[a+7]=o[13],r[a+8]=o[2],r[a+9]=o[6],r[a+10]=o[10],r[a+11]=o[14]}return r}function lZ(e,t){const n=e._instancingSupported;n||ll("cpuModelInstancing","Support for rendering instanced models on the CPU has been deprecated and will be removed in CesiumJS 1.97.");const i=Object(l.a)(e._batchTable),r=e._allowPicking,o={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:r,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLighting:e._imageBasedLighting,showOutline:e.showOutline,showCreditsOnScreen:e.showCreditsOnScreen};if(i||(e._pickIds=function(e,t){const n=e._instances,i=n.length,r=new Array(i);for(let e=0;e<i;++e)r[e]=t.createPickId(n[e]);return r}(e,t)),n){!function(e,t){let n;const i=e._instances,r=e.length,o=e._dynamic,a=Object(l.a)(e._batchTable);if(a){const o=new Uint16Array(r);for(n=0;n<r;++n)o[n]=i[n]._instanceId;e._batchIdBuffer=ZN.createVertexBuffer({context:t,typedArray:o,usage:KN.STATIC_DRAW})}if(!a){const i=new Uint8Array(4*r);for(n=0;n<r;++n){const t=e._pickIds[n].color,r=4*n;i[r]=sp.floatToByte(t.red),i[r+1]=sp.floatToByte(t.green),i[r+2]=sp.floatToByte(t.blue),i[r+3]=sp.floatToByte(t.alpha)}e._pickIdBuffer=ZN.createVertexBuffer({context:t,typedArray:i,usage:KN.STATIC_DRAW})}const s=cZ(e);e._vertexBuffer=ZN.createVertexBuffer({context:t,typedArray:s,usage:o?KN.STREAM_DRAW:KN.STATIC_DRAW})}(e,t);const n=12,r=gs.getSizeInBytes(gs.FLOAT),a={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:r*n,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:4*r,strideInBytes:r*n,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:8*r,strideInBytes:r*n,instanceDivisor:1}};i&&(a.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:gs.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),i||(a.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:gs.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),o.precreatedAttributes=a,o.vertexShaderLoaded=function(e){return function(t,n){const i=aZ(e,n),r=Object(l.a)(e._batchTable);let o=UN.replaceMain(t,"czm_instancing_main"),a="",s="";for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];let n;"MODELVIEW"===t||"CESIUM_RTC_MODELVIEW"===t?n="czm_instanced_modelView":"MODELVIEWPROJECTION"===t?(n="czm_instanced_modelViewProjection",a+="mat4 czm_instanced_modelViewProjection;\n",s+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===t&&(n="czm_instanced_modelViewInverseTranspose",a+="mat3 czm_instanced_modelViewInverseTranspose;\n",s+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n");let r=new RegExp(`uniform.*${e}.*`);o=o.replace(r,""),r=new RegExp(e+"\\b","g"),o=o.replace(r,n)}let c,u,h;r?(c="attribute float a_batchId;\n",u="",h=""):(c="",u="attribute vec4 pickColor;\nvarying vec4 v_pickColor;\n",h="    v_pickColor = pickColor;\n");let d="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+a+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\n"+`attribute vec4 czm_modelMatrixRow2;\n${c}${u}${o}void main()\n{\n    mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n`+`    czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n${s}    czm_instancing_main();\n${h}}\n`;if(r){const t=e._model.gltfInternal,i=nG.getDiffuseAttributeOrUniform(t,n);d=e._batchTable.getVertexShaderCallback(!0,"a_batchId",i)(d)}return d}}(e),o.fragmentShaderLoaded=function(e){return function(t,n){const i=e._batchTable;if(Object(l.a)(i)){const r=e._model.gltfInternal,o=nG.getDiffuseAttributeOrUniform(r,n);t=i.getFragmentShaderCallback(!0,o,!1)(t)}else t="varying vec4 v_pickColor;\n"+t;return t}}(e),o.uniformMapLoaded=sZ(e,t),Object(l.a)(e._url)&&(o.cacheKey=e._url.getUrlComponent()+"#instanced")}else o.vertexShaderLoaded=function(e){return function(t,n){if(Object(l.a)(e._batchTable)){const i=e._model.gltfInternal,r=nG.getDiffuseAttributeOrUniform(i,n);t="uniform float a_batchId\n;"+(t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",r)(t))}return t}}(e),o.fragmentShaderLoaded=function(e){return function(t,n){const i=e._batchTable;if(Object(l.a)(i)){const r=e._model.gltfInternal,o=nG.getDiffuseAttributeOrUniform(r,n);t=i.getFragmentShaderCallback(!0,o,!1)(t)}else t="uniform vec4 czm_pickColor;\n"+t;return t}}(e),o.uniformMapLoaded=function(e){return function(t){return Object(l.a)(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}(e);Object(l.a)(e._url)?e._model=OX.fromGltf(o):e._model=new OX(o)}function uZ(e){const t=Object(Zf.a)(e,!0);return t.cull.enabled=!1,vj.fromCache(t)}function hZ(e){return function(){return e}}function dZ(e){return function(){return e}}function fZ(e){const t=e._modelCommands,n=t.length,i=e.length,r=e._rtcTransform,o=e._center;for(let a=0;a<n;++a){const n=t[a];for(let t=0;t<i;++t){const s=a*i+t,c=e._drawCommands[s];let l=Me.clone(e._instances[t]._modelMatrix,rZ);l[12]-=o.x,l[13]-=o.y,l[14]-=o.z,l=Me.multiply(r,l,rZ);const u=n.modelMatrix,h=c.modelMatrix;Me.multiply(l,u,h);const d=n.boundingVolume,f=c.boundingVolume;At.transform(d,l,f)}}}function pZ(e){const t=e._nodeCommands,n=t.length,i=[];for(let e=0;e<n;++e){const n=t[e];n.show&&i.push(n.command)}return i}function mZ(e,t){e._drawCommands=[];const n=pZ(e._model);t?function(e,t){const n=t.length,i=e.length,r=e._boundingSphere,o=e._cull;for(let a=0;a<n;++a){const n=XR.shallowClone(t[a]);n.instanceCount=i,n.boundingVolume=r,n.cull=o,Object(l.a)(e._batchTable)?n.pickId=e._batchTable.getPickId():n.pickId="v_pickColor",e._drawCommands.push(n)}}(e,n):(!function(e,t){const n=e._instances,i=t.length,r=e.length,o=e._batchTable,a=Object(l.a)(o),s=e._cull;for(let o=0;o<i;++o)for(let i=0;i<r;++i){const r=XR.shallowClone(t[o]);if(r.modelMatrix=new Me,r.boundingVolume=new At,r.cull=s,r.uniformMap=Object(Zf.a)(r.uniformMap),a)r.uniformMap.a_batchId=hZ(n[i]._instanceId);else{const t=e._pickIds[i];r.uniformMap.czm_pickColor=dZ(t.color)}e._drawCommands.push(r)}}(e,n),fZ(e))}nZ.prototype.expandBoundingSphere=function(e){const t=Me.getTranslation(e,iZ);At.expand(this._boundingSphere,t,this._boundingSphere)},nZ.prototype.update=function(e){if(e.mode===AB.MORPHING)return;if(!this.show)return;if(0===this.length)return;const t=e.context;if(this._state===$J){this._state=QJ,this._instancingSupported=t.instancedArrays,lZ(this,t);const e=this;this._model.readyPromise.catch((function(t){e._state=tZ,e._readyPromise.reject(t)}))}const n=this._instancingSupported,i=this._model;if(i.imageBasedLighting=this._imageBasedLighting,i.showCreditsOnScreen=this.showCreditsOnScreen,i.splitDirection=this.splitDirection,i.update(e),i.ready&&this._state===QJ){this._state=eZ,this._ready=!0;const e=i.boundingSphereInternal.radius+O.magnitude(i.boundingSphereInternal.center);return this._boundingSphere.radius+=e,this._modelCommands=pZ(i),mZ(this,n),void this._readyPromise.resolve(this)}if(this._state!==eZ)return;const r=e.mode!==this._mode,o=this.modelMatrix,a=!Me.equals(this._modelMatrix,o);if(r||a){this._mode=e.mode,Me.clone(o,this._modelMatrix);let t=Me.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==AB.SCENE3D&&(t=ca.basisTo2D(e.mapProjection,t,t)),Me.getTranslation(t,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,function(e){const t=cZ(e);e._vertexBuffer.copyFromArrayView(t)}(this));const s=function(e){const t=e._nodeCommands,n=t.length;let i=!1;for(let e=0;e<n;e++){const n=t[e];n.command.dirty&&(n.command.dirty=!1,i=!0)}return i}(i);s&&mZ(this,n),!n&&(i.dirty||this._dirty||r||a)&&fZ(this),function(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;const t=TB.castShadows(e.shadows),n=TB.receiveShadows(e.shadows),i=e._drawCommands,r=i.length;for(let e=0;e<r;++e){const r=i[e];r.castShadows=t,r.receiveShadows=n}}}(this,s),function(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;const t=e.debugWireframe?zl.LINES:zl.TRIANGLES,n=e._drawCommands,i=n.length;for(let e=0;e<i;++e)n[e].primitiveType=t}}(this,s),function(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;const t=e._drawCommands,n=t.length;let i;if(!Object(l.a)(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(n),e._renderStates=new Array(n),i=0;i<n;++i){const n=t[i].renderState,r=uZ(n);e._disableCullingRenderStates[i]=r,e._renderStates[i]=n}for(i=0;i<n;++i)t[i].renderState=e._backFaceCulling?e._renderStates[i]:e._disableCullingRenderStates[i]}}(this,s),function(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;const t=e._drawCommands,n=t.length;for(let i=0;i<n;++i)t[i].debugShowBoundingVolume=e.debugShowBoundingVolume}}(this,s);const c=e.passes;if(!c.render&&!c.pick)return;const u=e.commandList,h=this._drawCommands,d=h.length;for(let e=0;e<d;++e)u.push(h[e])},nZ.prototype.isDestroyed=function(){return!1},nZ.prototype.destroy=function(){this._model=this._model&&this._model.destroy();const e=this._pickIds;if(Object(l.a)(e)){const t=e.length;for(let n=0;n<t;++n)e[n].destroy()}return this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,sc(this)};var gZ=nZ;function _Z(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._modelInstanceCollection=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,function(e,t,n){const i=KJ.parse(t,n),r=i.gltfFormat,o=i.gltf,a=i.featureTableJson,s=i.featureTableBinary,c=i.batchTableJson,u=i.batchTableBinary,h=new NV(a,s),d=h.getGlobalProperty("INSTANCES_LENGTH");if(h.featuresLength=d,!Object(l.a)(d))throw new ye.a("Feature table global property: INSTANCES_LENGTH must be defined");e._batchTable=new DV(e,d,c,u);const f=e._tileset,p={instances:new Array(d),batchTable:e._batchTable,cull:!1,url:void 0,requestType:Uc.a.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:f._modelUpAxis,forwardAxis:f._modelForwardAxis,opaquePass:KR.CESIUM_3D_TILE,pickIdLoaded:yZ(e),imageBasedLighting:f.imageBasedLighting,backFaceCulling:f.backFaceCulling,showOutline:f.showOutline,showCreditsOnScreen:f.showCreditsOnScreen};if(0===r){let t=Gu(o);t=t.replace(/[\s\0]+$/,""),p.url=e._resource.getDerivedResource({url:t})}else p.gltf=o,p.basePath=e._resource.clone();const m=h.getGlobalProperty("EAST_NORTH_UP");let g;const _=h.getGlobalProperty("RTC_CENTER",gs.FLOAT,3);Object(l.a)(_)&&(g=O.unpack(_));const y=p.instances,b=new O,v=new Array(3),w=new O,A=new O,E=new O,T=new ce,C=new To;let x=new O;const S=new $I,I=new Me;for(let e=0;e<d;e++){let t=h.getProperty("POSITION",gs.FLOAT,3,e,bZ);if(!Object(l.a)(t)){t=v;const n=h.getProperty("POSITION_QUANTIZED",gs.UNSIGNED_SHORT,3,e,bZ);if(!Object(l.a)(n))throw new ye.a("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");const i=h.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",gs.FLOAT,3);if(!Object(l.a)(i))throw new ye.a("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const r=h.getGlobalProperty("QUANTIZED_VOLUME_SCALE",gs.FLOAT,3);if(!Object(l.a)(r))throw new ye.a("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(let e=0;e<3;e++)t[e]=n[e]/65535*r[e]+i[e]}O.unpack(t,0,b),Object(l.a)(g)&&O.add(b,g,b),S.translation=b;const n=h.getProperty("NORMAL_UP",gs.FLOAT,3,e,bZ),i=h.getProperty("NORMAL_RIGHT",gs.FLOAT,3,e,vZ);let r=!1;if(Object(l.a)(n)){if(!Object(l.a)(i))throw new ye.a("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");O.unpack(n,0,A),O.unpack(i,0,w),r=!0}else{const t=h.getProperty("NORMAL_UP_OCT32P",gs.UNSIGNED_SHORT,2,e,bZ),n=h.getProperty("NORMAL_RIGHT_OCT32P",gs.UNSIGNED_SHORT,2,e,vZ);if(Object(l.a)(t)){if(!Object(l.a)(n))throw new ye.a("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");js.octDecodeInRange(t[0],t[1],65535,A),js.octDecodeInRange(n[0],n[1],65535,w),r=!0}else m?(ca.eastNorthUpToFixedFrame(b,H.WGS84,I),Me.getMatrix3(I,T)):ce.clone(ce.IDENTITY,T)}r&&(O.cross(w,A,E),O.normalize(E,E),ce.setColumn(T,0,w,T),ce.setColumn(T,1,A,T),ce.setColumn(T,2,E,T)),To.fromRotationMatrix(T,C),S.rotation=C,x=O.fromElements(1,1,1,x);const o=h.getProperty("SCALE",gs.FLOAT,1,e);Object(l.a)(o)&&O.multiplyByScalar(x,o,x);const a=h.getProperty("SCALE_NON_UNIFORM",gs.FLOAT,3,e,bZ);Object(l.a)(a)&&(x.x*=a[0],x.y*=a[1],x.z*=a[2]),S.scale=x;let s=h.getProperty("BATCH_ID",gs.UNSIGNED_SHORT,1,e);Object(l.a)(s)||(s=e),Me.fromTranslationRotationScale(S,I);const c=I.clone();y[e]={modelMatrix:c,batchId:s}}e._modelInstanceCollection=new gZ(p),e._modelInstanceCollection.readyPromise.catch((function(){})).then((function(t){e._modelInstanceCollection.ready&&t.activeAnimations.addAll({loop:rW.REPEAT})}))}(this,i,r)}function yZ(e){return function(){return e._batchTable.getPickId()}}_Z._deprecationWarning=ll,Object.defineProperties(_Z.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){const e=this._modelInstanceCollection._model;return Object(l.a)(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){const e=this._modelInstanceCollection._model;return Object(l.a)(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){const e=this._modelInstanceCollection._model;return Object(l.a)(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.batchTableByteLength}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});const bZ=new Array(4),vZ=new Array(4);_Z.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},_Z.prototype.getFeature=function(e){const t=this.featuresLength;if(!Object(l.a)(e)||e<0||e>=t)throw new u.a(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return function(e){const t=e.featuresLength;if(!Object(l.a)(e._features)&&t>0){const n=new Array(t);for(let i=0;i<t;++i)n[i]=new jV(e,i);e._features=n}}(this),this._features[e]},_Z.prototype.applyDebugSettings=function(e,t){t=e?t:sp.WHITE,this._batchTable.setAllColor(t)},_Z.prototype.applyStyle=function(e){this._batchTable.applyStyle(e)},_Z.prototype.update=function(e,t){const n=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.lightColor=this._tileset.lightColor,this._modelInstanceCollection.imageBasedLighting=this._tileset.imageBasedLighting,this._modelInstanceCollection.backFaceCulling=this._tileset.backFaceCulling,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe,this._modelInstanceCollection.showCreditsOnScreen=this._tileset.showCreditsOnScreen,this._modelInstanceCollection.splitDirection=this._tileset.splitDirection;const i=this._modelInstanceCollection._model;if(Object(l.a)(i)){const e=this._tileset.clippingPlanes;i.referenceMatrix=this._tileset.clippingPlanesOriginMatrix,Object(l.a)(e)&&this._tile.clippingPlanesDirty&&(i._clippingPlanes=e.enabled&&this._tile._isClipped?e:void 0),Object(l.a)(e)&&Object(l.a)(i._clippingPlanes)&&i._clippingPlanes!==e&&(i._clippingPlanes=e)}this._modelInstanceCollection.update(t);n<t.commandList.length&&(t.passes.render||t.passes.pick)&&this._batchTable.addDerivedCommands(t,n,!1)},_Z.prototype.isDestroyed=function(){return!1},_Z.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),sc(this)};var OZ=_Z;var wZ=Object.freeze({ADD:0,REPLACE:1}),AZ=n(22);const EZ={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};EZ.hasSetIndex=function(e){switch(s.a.typeOf.string("semantic",e),e){case EZ.POSITION:case EZ.NORMAL:case EZ.TANGENT:return!1;case EZ.TEXCOORD:case EZ.COLOR:case EZ.JOINTS:case EZ.WEIGHTS:case EZ.FEATURE_ID:return!0;default:throw new u.a("semantic is not a valid value.")}},EZ.fromGltfSemantic=function(e){s.a.typeOf.string("gltfSemantic",e);let t=e;const n=/^(\w+)_\d+$/.exec(e);switch(null!==n&&(t=n[1]),t){case"POSITION":return EZ.POSITION;case"NORMAL":return EZ.NORMAL;case"TANGENT":return EZ.TANGENT;case"TEXCOORD":return EZ.TEXCOORD;case"COLOR":return EZ.COLOR;case"JOINTS":return EZ.JOINTS;case"WEIGHTS":return EZ.WEIGHTS;case"_FEATURE_ID":return EZ.FEATURE_ID}},EZ.fromPntsSemantic=function(e){switch(s.a.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return EZ.POSITION;case"RGBA":case"RGB":case"RGB565":return EZ.COLOR;case"NORMAL":case"NORMAL_OCT16P":return EZ.NORMAL;case"BATCH_ID":return EZ.FEATURE_ID;default:throw new u.a("pntsSemantic is not a valid value.")}},EZ.getGlslType=function(e){switch(s.a.typeOf.string("semantic",e),e){case EZ.POSITION:case EZ.NORMAL:case EZ.TANGENT:return"vec3";case EZ.TEXCOORD:return"vec2";case EZ.COLOR:return"vec4";case EZ.JOINTS:return"ivec4";case EZ.WEIGHTS:return"vec4";case EZ.FEATURE_ID:return"int";default:throw new u.a("semantic is not a valid value.")}},EZ.getVariableName=function(e,t){s.a.typeOf.string("semantic",e);let n=function(e){switch(e){case EZ.POSITION:return"positionMC";case EZ.NORMAL:return"normalMC";case EZ.TANGENT:return"tangentMC";case EZ.TEXCOORD:return"texCoord";case EZ.COLOR:return"color";case EZ.JOINTS:return"joints";case EZ.WEIGHTS:return"weights";case EZ.FEATURE_ID:return"featureId";default:throw new u.a("semantic is not a valid value.")}}(e);return Object(l.a)(t)&&(n+="_"+t),n};var TZ=Object.freeze(EZ);const CZ={},xZ=Uint32Array.BYTES_PER_ELEMENT;CZ.parse=function(e,t){t=Object(c.a)(t,0),s.a.defined("arrayBuffer",e);const n=new Uint8Array(e),i=new DataView(e);t+=xZ;const r=i.getUint32(t,!0);if(1!==r)throw new ye.a(`Only Point Cloud tile version 1 is supported.  Version ${r} is not.`);t+=xZ,t+=xZ;const o=i.getUint32(t,!0);if(0===o)throw new ye.a("Feature table must have a byte length greater than zero");t+=xZ;const a=i.getUint32(t,!0);t+=xZ;const u=i.getUint32(t,!0);t+=xZ;const h=i.getUint32(t,!0),d=qu(n,t+=xZ,o);t+=o;const f=new Uint8Array(e,t,a);let p,m;t+=a,u>0&&(p=qu(n,t,u),t+=u,h>0&&(m=new Uint8Array(e,t,h),t+=h));const g=new NV(d,f),_=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=_,!Object(l.a)(_))throw new ye.a("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",gs.FLOAT,3);Object(l.a)(y)&&(y=O.unpack(y));const b=function(e,t){const n=e.json;let i,r,o;const a=Object(l.a)(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,s=Object(l.a)(t)&&Object(l.a)(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;Object(l.a)(s)&&(o=s.properties);let c,u,h,d,f,p;if(Object(l.a)(a)){r=a.properties;const t=a.byteOffset,n=a.byteLength;if(!Object(l.a)(r)||!Object(l.a)(t)||!Object(l.a)(n))throw new ye.a("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(t,t+n),c=Object(l.a)(r.POSITION),u=Object(l.a)(r.RGB)||Object(l.a)(r.RGBA),h=Object(l.a)(r.NORMAL),d=Object(l.a)(r.BATCH_ID),f=Object(l.a)(r.RGBA)}Object(l.a)(i)&&(p={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Object(up.a)(r,o),dequantizeInShader:!0});return{draco:p,hasPositions:c,hasColors:u,isTranslucent:f,hasNormals:h,hasBatchIds:d}}(g,p);if(b.rtcCenter=y,b.pointsLength=_,!b.hasPositions){const e=function(e){const t=e.json;let n;if(Object(l.a)(t.POSITION))return n=e.getPropertyArray("POSITION",gs.FLOAT,3),{name:TZ.POSITION,semantic:TZ.POSITION,typedArray:n,isQuantized:!1,componentDatatype:gs.FLOAT,type:Cs.VEC3};if(Object(l.a)(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",gs.UNSIGNED_SHORT,3);const t=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",gs.FLOAT,3);if(!Object(l.a)(t))throw new ye.a("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const i=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",gs.FLOAT,3);if(!Object(l.a)(r))throw new ye.a("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:TZ.POSITION,semantic:TZ.POSITION,typedArray:n,isQuantized:!0,componentDatatype:gs.FLOAT,type:Cs.VEC3,quantizedRange:i,quantizedVolumeOffset:O.unpack(r),quantizedVolumeScale:O.unpack(t),quantizedComponentDatatype:gs.UNSIGNED_SHORT,quantizedType:Cs.VEC3}}}(g);b.positions=e,b.hasPositions=b.hasPositions||Object(l.a)(e)}if(!b.hasPositions)throw new ye.a("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){const e=function(e){const t=e.json;let n;if(Object(l.a)(t.NORMAL))return n=e.getPropertyArray("NORMAL",gs.FLOAT,3),{name:TZ.NORMAL,semantic:TZ.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:gs.FLOAT,type:Cs.VEC3};if(Object(l.a)(t.NORMAL_OCT16P)){n=e.getPropertyArray("NORMAL_OCT16P",gs.UNSIGNED_BYTE,2);const t=8;return{name:TZ.NORMAL,semantic:TZ.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<t)-1,quantizedType:Cs.VEC2,quantizedComponentDatatype:gs.UNSIGNED_BYTE,componentDatatype:gs.FLOAT,type:Cs.VEC3}}return}(g);b.normals=e,b.hasNormals=b.hasNormals||Object(l.a)(e)}if(!b.hasColors){const e=function(e){const t=e.json;let n;if(Object(l.a)(t.RGBA))return n=e.getPropertyArray("RGBA",gs.UNSIGNED_BYTE,4),{name:TZ.COLOR,semantic:TZ.COLOR,setIndex:0,typedArray:n,componentDatatype:gs.UNSIGNED_BYTE,type:Cs.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(Object(l.a)(t.RGB))return n=e.getPropertyArray("RGB",gs.UNSIGNED_BYTE,3),{name:"COLOR",semantic:TZ.COLOR,setIndex:0,typedArray:n,componentDatatype:gs.UNSIGNED_BYTE,type:Cs.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(Object(l.a)(t.RGB565))return n=e.getPropertyArray("RGB565",gs.UNSIGNED_SHORT,1),{name:"COLOR",semantic:TZ.COLOR,setIndex:0,typedArray:n,componentDatatype:gs.FLOAT,type:Cs.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(Object(l.a)(t.CONSTANT_RGBA)){const t=e.getGlobalProperty("CONSTANT_RGBA",gs.UNSIGNED_BYTE,4),n=t[3],i=sp.fromBytes(t[0],t[1],t[2],n),r=n<255;return{name:TZ.COLOR,semantic:TZ.COLOR,setIndex:0,constantColor:i,componentDatatype:gs.FLOAT,type:Cs.VEC4,isQuantized:!1,isTranslucent:r}}return}(g);b.colors=e,b.hasColors=b.hasColors||Object(l.a)(e),b.hasConstantColor=Object(l.a)(b.constantColor),b.isTranslucent=Object(l.a)(e)&&e.isTranslucent}if(!b.hasBatchIds){const e=function(e){const t=e.json;if(Object(l.a)(t.BATCH_ID)){const t=e.getPropertyArray("BATCH_ID",gs.UNSIGNED_SHORT,1);return{name:TZ.FEATURE_ID,semantic:TZ.FEATURE_ID,setIndex:0,typedArray:t,componentDatatype:gs.fromTypedArray(t),type:Cs.SCALAR}}return}(g);b.batchIds=e,b.hasBatchIds=b.hasBatchIds||Object(l.a)(e)}if(b.hasBatchIds){const e=g.getGlobalProperty("BATCH_LENGTH");if(!Object(l.a)(e))throw new ye.a("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=e}return Object(l.a)(m)&&(m=new Uint8Array(m),b.batchTableJson=p,b.batchTableBinary=m),b};var SZ=CZ;const IZ=0,PZ=1,DZ=2,RZ=3;function jZ(e){s.a.typeOf.object("options",e),s.a.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=sp.clone(sp.DARKGRAY),this._highlightColor=sp.clone(sp.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=DZ,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=Object(c.a)(e.opaquePass,KR.OPAQUE),this._cull=Object(c.a)(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=Me.clone(Me.IDENTITY),this._modelMatrix=Me.clone(Me.IDENTITY),this.time=0,this.shadows=TB.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=Object(c.a)(e.splitDirection,IW.NONE),this._splittingEnabled=!1,this._resolveReadyPromise=void 0,this._rejectReadyPromise=void 0,this._readyPromise=function(e,t){const n=SZ.parse(t.arrayBuffer,t.byteOffset);e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&Object(l.a)(n.batchTableBinary)&&(n.styleableProperties=DV.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary));if(Object(l.a)(n.draco)){const t=n.draco;e._decodingState=IZ,t.dequantizeInShader=e._dequantizeInShader}const i=n.positions;Object(l.a)(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);const r=n.normals;Object(l.a)(r)&&(e._isOctEncoded16P=r.octEncoded);const o=n.colors;Object(l.a)(o)&&(Object(l.a)(o.constantColor)&&(e._constantColor=sp.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);const a=n.batchIds;Object(l.a)(n.batchIds)&&(a.name="BATCH_ID",a.semantic="BATCH_ID",a.setIndex=void 0);n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary);return e._pointsLength=n.pointsLength,new Promise((function(t,n){e._resolveReadyPromise=function(){e._ready=!0,t(e)},e._rejectReadyPromise=n}))}(this,e)}Object.defineProperties(jZ.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},color:{get:function(){return sp.clone(this._highlightColor)},set:function(e){this._highlightColor=sp.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(Object(l.a)(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=At.clone(e,this._boundingSphere)}}});const MZ=new O,LZ=new O,NZ=new O;let BZ,FZ;function zZ(e){const t=e.length/3,n=Math.min(t,20),i=function(e){if(!Object(l.a)(FZ)){BZ=new AZ.a(0),FZ=new Array(e);for(let t=0;t<e;++t)FZ[t]=BZ.random()}return FZ}(20),r=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=O.fromElements(r,r,r,MZ),s=O.fromElements(o,o,o,LZ);for(let r=0;r<n;++r){const n=Math.floor(i[r]*t),o=O.unpack(e,3*n,NZ);O.minimumByComponent(a,o,a),O.maximumByComponent(s,o,s)}const c=At.fromCornerPoints(a,s);return c.radius+=h.a.EPSILON2,c}function kZ(e,t){const n=gs.fromTypedArray(e);return n===gs.INT||n===gs.UNSIGNED_INT||n===gs.DOUBLE?(cl("Cast pnts property to floats",`Point cloud property "${t}" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}const UZ=new _e,VZ=new _e,HZ=new sp,GZ=new Me,qZ=new Me;function WZ(e,t){const n=/czm_3dtiles_property_(\d+)/g;let i=n.exec(e);for(;null!==i;){const r=parseInt(i[1]);-1===t.indexOf(r)&&t.push(r),i=n.exec(e)}}function YZ(e,t){e=e.slice(e.indexOf("\n"));const n=/czm_3dtiles_builtin_property_(\w+)/g;let i=n.exec(e);for(;null!==i;){const r=i[1];-1===t.indexOf(r)&&t.push(r),i=n.exec(e)}}function XZ(e,t){const n=e.numberOfAttributes;for(let i=0;i<n;++i){const n=e.getAttribute(i);if(n.index===t)return n}}const KZ={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function JZ(e,t,n){let i,r,o;const a=t.context,s=Object(l.a)(n),u=e._isQuantized,h=e._isQuantizedDraco,d=e._isOctEncoded16P,f=e._isOctEncodedDraco,p=e._isRGB565,m=e._isTranslucent,g=e._hasColors,_=e._hasNormals,y=e._hasBatchIds,b=e._backFaceCulling,v=e._normalShading,w=e._drawCommand.vertexArray,A=e.clippingPlanes,E=e._attenuation;let T,C,x,S=m;const I=Object(Zf.a)(KZ),P={},D=e._styleableShaderAttributes;for(r in D)D.hasOwnProperty(r)&&(o=D[r],I[r]="czm_3dtiles_property_"+o.location,P[o.location]=o);if(s){const e={translucent:!1},t="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";T=n.getColorShaderFunction("getColorFromStyle"+t,I,e),C=n.getShowShaderFunction("getShowFromStyle"+t,I,e),x=n.getPointSizeShaderFunction("getPointSizeFromStyle"+t,I,e),Object(l.a)(T)&&e.translucent&&(S=!0)}e._styleTranslucent=S;const R=Object(l.a)(T),j=Object(l.a)(C),M=Object(l.a)(x),L=e.isClipped,N=[],B=[];R&&(WZ(T,N),YZ(T,B)),j&&(WZ(C,N),YZ(C,B)),M&&(WZ(x,N),YZ(x,B));const F=B.indexOf("COLOR")>=0,z=B.indexOf("NORMAL")>=0;if(z&&!_)throw new ye.a("Style references the NORMAL semantic but the point cloud does not have normals");for(r in D)if(D.hasOwnProperty(r)){o=D[r];const e=N.indexOf(o.location)>=0;XZ(w,o.location).enabled=e}const k=g&&(!R||F);if(g){XZ(w,1).enabled=k}const U=_&&(v||b||z);if(_){XZ(w,2).enabled=U}const V={a_position:0};k&&(V.a_color=1),U&&(V.a_normal=2),y&&(V.a_batchId=3);let H="";const G=N.length;for(i=0;i<G;++i){const e=N[i];o=P[e];const t=o.componentCount,n="czm_3dtiles_property_"+e;let r;r=1===t?"float":"vec"+t,H+=`attribute ${r} ${n}; \n`,V[n]=o.location}!function(e,t){const n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco;let a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){const i=UZ;if(i.x=e._attenuation?e.maximumAttenuation:e._pointSize,i.x*=t.pixelRatio,i.y=e.time,e._attenuation){const r=t.camera.frustum;let o;o=t.mode===AB.SCENE2D||r instanceof nv?Number.POSITIVE_INFINITY:n.drawingBufferHeight/t.camera.frustum.sseDenominator,i.z=e.geometricError*e.geometricErrorScale,i.w=o}return i},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){const t=e.clippingPlanes;return e.isClipped?t.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){const t=e.clippingPlanes;if(!Object(l.a)(t))return sp.TRANSPARENT;const n=sp.clone(t.edgeColor,HZ);return n.alpha=t.edgeWidth,n},u_clippingPlanesMatrix:function(){const t=e.clippingPlanes;if(!Object(l.a)(t))return Me.IDENTITY;const i=Object(c.a)(e.clippingPlanesOriginMatrix,e._modelMatrix);Me.multiply(n.uniformState.view3D,i,GZ);const r=Me.multiply(GZ,t.modelMatrix,GZ);return Me.inverseTranspose(r,qZ)}};PW.addUniforms(e,a),(i||r||o)&&(a=Object(up.a)(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){const t=VZ;if(Object(l.a)(e._quantizedVolumeScale)){const n=O.clone(e._quantizedVolumeScale,t);O.divideByScalar(n,e._quantizedRange,t)}return t.w=e._octEncodedRange,t}})),Object(l.a)(e._uniformMapLoaded)&&(a=e._uniformMapLoaded(a)),e._drawCommand.uniformMap=a}(e,t);let q="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";q+="float u_pointSize; \nfloat tiles3d_tileset_time; \n",E&&(q+="float u_geometricError; \nfloat u_depthMultiplier; \n"),q+=H,k&&(q+=m?"attribute vec4 a_color; \n":p?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),U&&(q+=d||f?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),y&&(q+="attribute float a_batchId; \n"),(u||h||f)&&(q+="uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \n"),R&&(q+=T),j&&(q+=C),M&&(q+=x),q+="void main() \n{ \n    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \n    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \n",E&&(q+="    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \n    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \n"),q+=k?m?"    vec4 color = a_color; \n":p?"    float compressed = a_color; \n    float r = floor(compressed * SHIFT_RIGHT_11); \n    compressed -= r * SHIFT_LEFT_11; \n    float g = floor(compressed * SHIFT_RIGHT_5); \n    compressed -= g * SHIFT_LEFT_5; \n    float b = compressed; \n    vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n    vec4 color = vec4(rgb, 1.0); \n":"    vec4 color = vec4(a_color, 1.0); \n":"    vec4 color = u_constantColor; \n",q+=u||h?"    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \n":"    vec3 position = a_position; \n",q+="    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",U?(q+=d?"    vec3 normal = czm_octDecode(a_normal); \n":f?"    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \n":"    vec3 normal = a_normal; \n",q+="    vec3 normalEC = czm_normal * normal; \n"):q+="    vec3 normal = vec3(1.0); \n",R&&(q+="    color = getColorFromStyle(position, position_absolute, color, normal); \n"),j&&(q+="    float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),q+=M?"    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \n":E?"    vec4 positionEC = czm_modelView * vec4(position, 1.0); \n    float depth = -positionEC.z; \n    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":"    gl_PointSize = u_pointSize; \n",q+="    color = color * u_highlightColor; \n",U&&v&&(q+="    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \n    diffuseStrength = max(diffuseStrength, 0.4); \n    color.xyz *= diffuseStrength * czm_lightColor; \n"),q+="    v_color = color; \n    gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",U&&b&&(q+="    float visible = step(-normalEC.z, 0.0); \n    gl_Position *= visible; \n    gl_PointSize *= visible; \n"),j&&(q+="    gl_Position.w *= float(show); \n    gl_PointSize *= float(show); \n"),q+="} \n";let W="varying vec4 v_color; \n";L&&(W+="uniform highp sampler2D u_clippingPlanes; \nuniform mat4 u_clippingPlanesMatrix; \nuniform vec4 u_clippingPlanesEdgeStyle; \n",W+="\n",W+=Xq(A,a),W+="\n"),W+="void main() \n{ \n    gl_FragColor = czm_gammaCorrect(v_color); \n",L&&(W+=Wq("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),W+="} \n",e.splitDirection!==IW.NONE&&(W=PW.modifyFragmentShader(W)),Object(l.a)(e._vertexShaderLoaded)&&(q=e._vertexShaderLoaded(q)),Object(l.a)(e._fragmentShaderLoaded)&&(W=e._fragmentShaderLoaded(W));const Y=e._drawCommand;Object(l.a)(Y.shaderProgram)&&Y.shaderProgram.destroy(),Y.shaderProgram=oM.fromCache({context:a,vertexShaderSource:q,fragmentShaderSource:W,attributeLocations:V});try{Y.shaderProgram._bind()}catch(e){throw new ye.a("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}const ZZ=new _e,$Z=new O;jZ.prototype.update=function(e){if(function(e,t){if(e._decodingState===DZ)return!1;if(e._decodingState===IZ){const n=e._parsedContent,i=n.draco,r=qq.decodePointCloud(i,t);Object(l.a)(r)&&(e._decodingState=PZ,r.then((function(t){e._decodingState=DZ;const r=Object(l.a)(t.POSITION)?t.POSITION.array:void 0,o=Object(l.a)(t.RGB)?t.RGB.array:void 0,a=Object(l.a)(t.RGBA)?t.RGBA.array:void 0,s=Object(l.a)(t.NORMAL)?t.NORMAL.array:void 0,u=Object(l.a)(t.BATCH_ID)?t.BATCH_ID.array:void 0,h=Object(l.a)(r)&&Object(l.a)(t.POSITION.data.quantization),d=Object(l.a)(s)&&Object(l.a)(t.NORMAL.data.quantization);if(h){const n=t.POSITION.data.quantization,i=n.range;e._quantizedVolumeScale=O.fromElements(i,i,i),e._quantizedVolumeOffset=O.unpack(n.minValues),e._quantizedRange=(1<<n.quantizationBits)-1,e._isQuantizedDraco=!0}d&&(e._octEncodedRange=(1<<t.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let f=n.styleableProperties;const p=i.batchTableProperties;for(const e in p)if(p.hasOwnProperty(e)){const n=t[e];Object(l.a)(f)||(f={}),f[e]={typedArray:n.array,componentCount:n.data.componentsPerAttribute}}Object(l.a)(r)&&(n.positions={typedArray:r});const m=Object(c.a)(a,o);Object(l.a)(m)&&(n.colors={typedArray:m}),Object(l.a)(s)&&(n.normals={typedArray:s}),Object(l.a)(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=f})).catch((function(t){e._decodingState=RZ,e._rejectReadyPromise(t)})))}return!0}(this,e.context))return;let t=!1,n=!Me.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,n=!0),Object(l.a)(this._drawCommand)||(!function(e,t){const n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,a=i.colors,s=i.normals,c=i.batchIds,u=i.styleableProperties,h=Object(l.a)(u),d=e._isQuantized,f=e._isQuantizedDraco,p=e._isOctEncoded16P,m=e._isOctEncodedDraco,g=e._quantizedRange,_=e._octEncodedRange,y=e._isRGB565,b=e._isTranslucent,v=e._hasColors,w=e._hasNormals,A=e._hasBatchIds;let E,T;const C=[],x={};if(e._styleableShaderAttributes=x,h){let t=4;for(const i in u)if(u.hasOwnProperty(i)){const r=u[i],o=kZ(r.typedArray,i);E=r.componentCount,T=gs.fromTypedArray(o);const a=ZN.createVertexBuffer({context:n,typedArray:o,usage:KN.STATIC_DRAW});e._geometryByteLength+=a.sizeInBytes;const s={index:t,vertexBuffer:a,componentsPerAttribute:E,componentDatatype:T,normalize:!1,offsetInBytes:0,strideInBytes:0};C.push(s),x[i]={location:t,componentCount:E},++t}}const S=ZN.createVertexBuffer({context:n,typedArray:o.typedArray,usage:KN.STATIC_DRAW});let I,P,D;e._geometryByteLength+=S.sizeInBytes,v&&(I=ZN.createVertexBuffer({context:n,typedArray:a.typedArray,usage:KN.STATIC_DRAW}),e._geometryByteLength+=I.sizeInBytes),w&&(P=ZN.createVertexBuffer({context:n,typedArray:s.typedArray,usage:KN.STATIC_DRAW}),e._geometryByteLength+=P.sizeInBytes),A&&(c.typedArray=kZ(c.typedArray,"batchIds"),D=ZN.createVertexBuffer({context:n,typedArray:c.typedArray,usage:KN.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes);let R=[];if(T=d?gs.UNSIGNED_SHORT:f?g<=255?gs.UNSIGNED_BYTE:gs.UNSIGNED_SHORT:gs.FLOAT,R.push({index:0,vertexBuffer:S,componentsPerAttribute:3,componentDatatype:T,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(e._boundingSphere=d||f?At.fromCornerPoints(O.ZERO,e._quantizedVolumeScale):zZ(o.typedArray)),v)if(y)R.push({index:1,vertexBuffer:I,componentsPerAttribute:1,componentDatatype:gs.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{const e=b?4:3;R.push({index:1,vertexBuffer:I,componentsPerAttribute:e,componentDatatype:gs.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}w&&(p?(E=2,T=gs.UNSIGNED_BYTE):m?(E=2,T=_<=255?gs.UNSIGNED_BYTE:gs.UNSIGNED_SHORT):(E=3,T=gs.FLOAT),R.push({index:2,vertexBuffer:P,componentsPerAttribute:E,componentDatatype:T,normalize:!1,offsetInBytes:0,strideInBytes:0})),A&&R.push({index:3,vertexBuffer:D,componentsPerAttribute:1,componentDatatype:gs.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),h&&(R=R.concat(C));const j=new iB({context:n,attributes:R}),M={depthTest:{enabled:!0}},L={depthTest:{enabled:!0},depthMask:!1,blending:SD.ALPHA_BLEND};e._opaquePass===KR.CESIUM_3D_TILE&&(M.stencilTest=qF.setCesium3DTileBit(),M.stencilMask=qF.CESIUM_3D_TILE_MASK,L.stencilTest=qF.setCesium3DTileBit(),L.stencilMask=qF.CESIUM_3D_TILE_MASK),e._opaqueRenderState=vj.fromCache(M),e._translucentRenderState=vj.fromCache(L),e._drawCommand=new XR({boundingVolume:new At,cull:e._cull,modelMatrix:new Me,primitiveType:zl.POINTS,vertexArray:j,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:b?e._translucentRenderState:e._opaqueRenderState,pass:b?KR.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}(this,e),n=!0,t=!0,this._resolveReadyPromise(),this._parsedContent=void 0),n){Me.clone(this.modelMatrix,this._modelMatrix);const t=this._drawCommand.modelMatrix;if(Me.clone(this._modelMatrix,t),Object(l.a)(this._rtcCenter)&&Me.multiplyByTranslation(t,this._rtcCenter,t),Object(l.a)(this._quantizedVolumeOffset)&&Me.multiplyByTranslation(t,this._quantizedVolumeOffset,t),e.mode!==AB.SCENE3D){const n=e.mapProjection,i=Me.getColumn(t,3,ZZ);_e.equals(i,_e.UNIT_W)||ca.basisTo2D(n,t,t)}const n=this._drawCommand.boundingVolume;if(At.clone(this._boundingSphere,n),this._cull){const e=n.center;Me.multiplyByPoint(t,e,e);const i=Me.getScale(t,$Z);n.radius*=O.maximumComponent(i)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,t=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,t=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,t=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,t=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,t=!0);const i=this.splitDirection!==IW.NONE;this._splittingEnabled!==i&&(this._splittingEnabled=i,t=!0),t&&JZ(this,e,this._style),this._drawCommand.castShadows=TB.castShadows(this.shadows),this._drawCommand.receiveShadows=TB.receiveShadows(this.shadows);const r=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=r?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=r?KR.TRANSLUCENT:this._opaquePass;const o=e.commandList,a=e.passes;(a.render||a.pick)&&o.push(this._drawCommand)},jZ.prototype.isDestroyed=function(){return!1},jZ.prototype.destroy=function(){const e=this._drawCommand;return Object(l.a)(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),sc(this)};var QZ=jZ;function e$(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function t$(e,t,n){const i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function n$(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).context;s.a.defined("options.context",t);const n=t._gl,i=MD.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=Object(c.a)(e.destroyAttachments,!0),Object(l.a)(e.colorTextures)&&Object(l.a)(e.colorRenderbuffers))throw new u.a("Cannot have both color texture and color renderbuffer attachments.");if(Object(l.a)(e.depthTexture)&&Object(l.a)(e.depthRenderbuffer))throw new u.a("Cannot have both a depth texture and depth renderbuffer attachment.");if(Object(l.a)(e.depthStencilTexture)&&Object(l.a)(e.depthStencilRenderbuffer))throw new u.a("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");const r=Object(l.a)(e.depthTexture)||Object(l.a)(e.depthRenderbuffer),o=Object(l.a)(e.depthStencilTexture)||Object(l.a)(e.depthStencilRenderbuffer);if(r&&o)throw new u.a("Cannot have both a depth and depth-stencil attachment.");if(Object(l.a)(e.stencilRenderbuffer)&&o)throw new u.a("Cannot have both a stencil and depth-stencil attachment.");if(r&&Object(l.a)(e.stencilRenderbuffer))throw new u.a("Cannot have both a depth and stencil attachment.");let a,h,d,f,p;if(this._bind(),Object(l.a)(e.colorTextures)){const n=e.colorTextures;if(f=this._colorTextures.length=this._activeColorAttachments.length=n.length,f>i)throw new u.a("The number of color attachments exceeds the number supported.");for(d=0;d<f;++d){if(a=n[d],!aT.isColorFormat(a.pixelFormat))throw new u.a("The color-texture pixel-format must be a color format.");if(a.pixelDatatype===rT.FLOAT&&!t.colorBufferFloat)throw new u.a("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(a.pixelDatatype===rT.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new u.a("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");p=this._gl.COLOR_ATTACHMENT0+d,e$(this,p,a),this._activeColorAttachments[d]=p,this._colorTextures[d]=a}}if(Object(l.a)(e.colorRenderbuffers)){const t=e.colorRenderbuffers;if(f=this._colorRenderbuffers.length=this._activeColorAttachments.length=t.length,f>i)throw new u.a("The number of color attachments exceeds the number supported.");for(d=0;d<f;++d)h=t[d],p=this._gl.COLOR_ATTACHMENT0+d,t$(this,p,h),this._activeColorAttachments[d]=p,this._colorRenderbuffers[d]=h}if(Object(l.a)(e.depthTexture)){if(a=e.depthTexture,a.pixelFormat!==aT.DEPTH_COMPONENT)throw new u.a("The depth-texture pixel-format must be DEPTH_COMPONENT.");e$(this,this._gl.DEPTH_ATTACHMENT,a),this._depthTexture=a}if(Object(l.a)(e.depthRenderbuffer)&&(h=e.depthRenderbuffer,t$(this,this._gl.DEPTH_ATTACHMENT,h),this._depthRenderbuffer=h),Object(l.a)(e.stencilRenderbuffer)&&(h=e.stencilRenderbuffer,t$(this,this._gl.STENCIL_ATTACHMENT,h),this._stencilRenderbuffer=h),Object(l.a)(e.depthStencilTexture)){if(a=e.depthStencilTexture,a.pixelFormat!==aT.DEPTH_STENCIL)throw new u.a("The depth-stencil pixel-format must be DEPTH_STENCIL.");e$(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilTexture=a}Object(l.a)(e.depthStencilRenderbuffer)&&(h=e.depthStencilRenderbuffer,t$(this,this._gl.DEPTH_STENCIL_ATTACHMENT,h),this._depthStencilRenderbuffer=h),this._unBind()}Object.defineProperties(n$.prototype,{status:{get:function(){this._bind();const e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),n$.prototype._bind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},n$.prototype._unBind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},n$.prototype.bindDraw=function(){const e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)},n$.prototype.bindRead=function(){const e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)},n$.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},n$.prototype.getColorTexture=function(e){if(!Object(l.a)(e)||e<0||e>=this._colorTextures.length)throw new u.a("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]},n$.prototype.getColorRenderbuffer=function(e){if(!Object(l.a)(e)||e<0||e>=this._colorRenderbuffers.length)throw new u.a("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]},n$.prototype.isDestroyed=function(){return!1},n$.prototype.destroy=function(){if(this.destroyAttachments){let e=0;const t=this._colorTextures;let n=t.length;for(;e<n;++e){const n=t[e];Object(l.a)(n)&&n.destroy()}const i=this._colorRenderbuffers;for(n=i.length,e=0;e<n;++e){const t=i[e];Object(l.a)(t)&&t.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),sc(this)};var i$=n$;function r$(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).context,n=e.width,i=e.height;s.a.defined("options.context",t),s.a.defined("options.width",n),s.a.defined("options.height",i),this._width=n,this._height=i;const r=e.colorRenderbuffers,o=e.colorTextures;if(Object(l.a)(r)!==Object(l.a)(o))throw new u.a("Both color renderbuffer and texture attachments must be provided.");const a=e.depthStencilRenderbuffer,h=e.depthStencilTexture;if(Object(l.a)(a)!==Object(l.a)(h))throw new u.a("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new i$({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:a,destroyAttachments:e.destroyAttachments}),this._colorFramebuffer=new i$({context:t,colorTextures:o,depthStencilTexture:h,destroyAttachments:e.destroyAttachments})}r$.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer},r$.prototype.getColorFramebuffer=function(){return this._colorFramebuffer},r$.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();const n=e._gl;let i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),Object(l.a)(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)},r$.prototype.isDestroyed=function(){return!1},r$.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),sc(this)};var o$=r$;const a$={RGBA4:ps.RGBA4,RGBA8:ps.RGBA8,RGBA16F:ps.RGBA16F,RGBA32F:ps.RGBA32F,RGB5_A1:ps.RGB5_A1,RGB565:ps.RGB565,DEPTH_COMPONENT16:ps.DEPTH_COMPONENT16,STENCIL_INDEX8:ps.STENCIL_INDEX8,DEPTH_STENCIL:ps.DEPTH_STENCIL,DEPTH24_STENCIL8:ps.DEPTH24_STENCIL8,validate:function(e){return e===a$.RGBA4||e===a$.RGBA8||e===a$.RGBA16F||e===a$.RGBA32F||e===a$.RGB5_A1||e===a$.RGB565||e===a$.DEPTH_COMPONENT16||e===a$.STENCIL_INDEX8||e===a$.DEPTH_STENCIL||e===a$.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ps.FLOAT?a$.RGBA32F:e===ps.HALF_FLOAT_OES?a$.RGBA16F:a$.RGBA8}};var s$=Object.freeze(a$);function c$(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.context",e.context);const t=e.context._gl,n=MD.maximumRenderbufferSize,i=Object(c.a)(e.format,s$.RGBA4),r=Object(l.a)(e.width)?e.width:t.drawingBufferWidth,o=Object(l.a)(e.height)?e.height:t.drawingBufferHeight,a=Object(c.a)(e.numSamples,1);if(!s$.validate(i))throw new u.a("Invalid format.");if(s.a.typeOf.number.greaterThan("width",r,0),r>n)throw new u.a(`Width must be less than or equal to the maximum renderbuffer size (${n}).  Check maximumRenderbufferSize.`);if(s.a.typeOf.number.greaterThan("height",o,0),o>n)throw new u.a(`Height must be less than or equal to the maximum renderbuffer size (${n}).  Check maximumRenderbufferSize.`);this._gl=t,this._format=i,this._width=r,this._height=o,this._renderbuffer=this._gl.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this._renderbuffer),a>1?t.renderbufferStorageMultisample(t.RENDERBUFFER,a,i,r,o):t.renderbufferStorage(t.RENDERBUFFER,i,r,o),t.bindRenderbuffer(t.RENDERBUFFER,null)}Object.defineProperties(c$.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),c$.prototype._getRenderbuffer=function(){return this._renderbuffer},c$.prototype.isDestroyed=function(){return!1},c$.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),sc(this)};var l$=c$;function u$(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._numSamples=Object(c.a)(e.numSamples,1),this._colorAttachmentsLength=Object(c.a)(e.colorAttachmentsLength,1),this._color=Object(c.a)(e.color,!0),this._depth=Object(c.a)(e.depth,!1),this._depthStencil=Object(c.a)(e.depthStencil,!1),this._supportsDepthTexture=Object(c.a)(e.supportsDepthTexture,!1),!this._color&&!this._depth&&!this._depthStencil)throw new u.a("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new u.a("Cannot have both a depth and depth-stencil attachment.");this._createColorAttachments=Object(c.a)(e.createColorAttachments,!0),this._createDepthAttachments=Object(c.a)(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(u$.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}}),u$.prototype.isDirty=function(e,t,n,i,r){n=Object(c.a)(n,1);const o=this._width!==e||this._height!==t,a=this._numSamples!==n,s=Object(l.a)(i)&&this._pixelDatatype!==i||Object(l.a)(r)&&this._pixelFormat!==r,u=1===n?Object(l.a)(this._framebuffer):Object(l.a)(this._multisampleFramebuffer);return this._attachmentsDirty||o||a||s||!u||this._color&&!Object(l.a)(this._colorTextures[0])},u$.prototype.update=function(e,t,n,i,r,o){if(!Object(l.a)(t)||!Object(l.a)(n))throw new u.a("width and height must be defined.");if(i=e.msaa?Object(c.a)(i,1):1,r=Object(c.a)(r,this._color?Object(c.a)(this._pixelDatatype,rT.UNSIGNED_BYTE):void 0),o=Object(c.a)(o,this._color?Object(c.a)(this._pixelFormat,aT.RGBA):void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments)for(let i=0;i<this._colorAttachmentsLength;++i)if(this._colorTextures[i]=new JD({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:WD.NEAREST}),this._numSamples>1){const o=s$.getColorFormat(r);this._colorRenderbuffers[i]=new l$({context:e,width:t,height:n,format:o,numSamples:this._numSamples})}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new JD({context:e,width:t,height:n,pixelFormat:aT.DEPTH_STENCIL,pixelDatatype:rT.UNSIGNED_INT_24_8,sampler:WD.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new l$({context:e,width:t,height:n,format:s$.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new l$({context:e,width:t,height:n,format:s$.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new JD({context:e,width:t,height:n,pixelFormat:aT.DEPTH_COMPONENT,pixelDatatype:rT.UNSIGNED_INT,sampler:WD.NEAREST}):this._depthRenderbuffer=new l$({context:e,width:t,height:n,format:s$.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new o$({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new i$({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}},u$.prototype.getColorTexture=function(e){if((e=Object(c.a)(e,0))>=this._colorAttachmentsLength)throw new u.a("index must be smaller than total number of color attachments.");return this._colorTextures[e]},u$.prototype.setColorTexture=function(e,t){if(t=Object(c.a)(t,0),this._createColorAttachments)throw new u.a("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new u.a("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e},u$.prototype.getColorRenderbuffer=function(e){if((e=Object(c.a)(e,0))>=this._colorAttachmentsLength)throw new u.a("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]},u$.prototype.setColorRenderbuffer=function(e,t){if(t=Object(c.a)(t,0),this._createColorAttachments)throw new u.a("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new u.a("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e},u$.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer},u$.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new u.a("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e},u$.prototype.getDepthTexture=function(){return this._depthTexture},u$.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new u.a("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e},u$.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer},u$.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new u.a("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e},u$.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture},u$.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new u.a("createDepthAttachments must be false if setDepthStencilTexture is called.");this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e},u$.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)},u$.prototype.clear=function(e,t,n){const i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i},u$.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()},u$.prototype.destroy=function(){if(this._color){let e;const t=this._colorTextures.length;for(e=0;e<t;++e){const t=this._colorTextures[e];this._createColorAttachments&&Object(l.a)(t)&&!t.isDestroyed()&&(this._colorTextures[e].destroy(),this._colorTextures[e]=void 0),Object(l.a)(t)&&t.isDestroyed()&&(this._colorTextures[e]=void 0);const n=this._colorRenderbuffers[e];this._createColorAttachments&&Object(l.a)(n)&&!n.isDestroyed()&&(this._colorRenderbuffers[e].destroy(),this._colorRenderbuffers[e]=void 0),Object(l.a)(n)&&n.isDestroyed()&&(this._colorRenderbuffers[e]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),Object(l.a)(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),Object(l.a)(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),Object(l.a)(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),Object(l.a)(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var h$=u$,d$="#extension GL_EXT_frag_depth : enable\n\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec2 u_distanceAndEdlStrength;\nvarying vec2 v_textureCoordinates;\n\nvec2 neighborContribution(float log2Depth, vec2 offset)\n{\n    float dist = u_distanceAndEdlStrength.x;\n    vec2 texCoordOrig = v_textureCoordinates + offset * dist;\n    vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\n    vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\n\n    float depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));\n    float depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));\n\n    // ignore depth values that are the clear depth\n    if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\n        return vec2(0.0);\n    }\n\n    // interpolate the two adjacent depth values\n    float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\n    return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\n\nvoid main()\n{\n    float depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\n\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\n    eyeCoordinate /= eyeCoordinate.w;\n\n    float log2Depth = log2(-eyeCoordinate.z);\n\n    if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer\n    {\n        discard;\n    }\n\n    vec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\n\n    // sample from neighbors left, right, down, up\n    vec2 texelSize = 1.0 / czm_viewport.zw;\n\n    vec2 responseAndCount = vec2(0.0);\n\n    responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\n    responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\n    responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\n    responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\n\n    float response = responseAndCount.x / responseAndCount.y;\n    float strength = u_distanceAndEdlStrength.y;\n    float shade = exp(-response * 300.0 * strength);\n    color.rgb *= shade;\n    gl_FragColor = vec4(color);\n\n    // Input and output depth are the same.\n    gl_FragDepthEXT = depthOrLogDepth;\n}\n";function f$(){this._framebuffer=new h$({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(f$.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});const p$=new Vt;function m$(e,t){const n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),function(e,t){const n=new UN({defines:["LOG_DEPTH_WRITE"],sources:[d$]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return p$.x=e._radius,p$.y=e._strength,p$}},r=vj.fromCache({blending:SD.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:qF.setCesium3DTileBit(),stencilMask:qF.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:KR.CESIUM_3D_TILE,owner:e}),e._clearCommand=new UU({framebuffer:e.framebuffer,color:new sp(0,0,0,0),depth:1,renderState:vj.fromCache(),pass:KR.CESIUM_3D_TILE,owner:e})}(e,t)}function g$(e){return e.drawBuffers&&e.fragmentDepth}function _$(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!Object(l.a)(n)){const i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources=r.sources.map((function(e){return e=(e=UN.replaceMain(e,"czm_point_cloud_post_process_main")).replace(/gl_FragColor/g,"gl_FragData[0]")})),r.sources.unshift("#extension GL_EXT_draw_buffers : enable \n"),r.sources.push("void main() \n{ \n    czm_point_cloud_post_process_main(); \n#ifdef LOG_DEPTH\n    czm_writeLogDepth();\n    gl_FragData[1] = czm_packDepth(gl_FragDepthEXT); \n#else\n    gl_FragData[1] = czm_packDepth(gl_FragCoord.z);\n#endif\n}"),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}f$.isSupported=g$,f$.prototype.update=function(e,t,n,i){if(!g$(e.context))return;let r;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,m$(this,e.context);const o=e.commandList,a=o.length;for(r=t;r<a;++r){const t=o[r];if(t.primitiveType!==zl.POINTS||t.pass===KR.TRANSLUCENT)continue;let n,i,a=t.derivedCommands.pointCloudProcessor;Object(l.a)(a)&&(n=a.command,i=a.originalShaderProgram),Object(l.a)(n)&&!t.dirty&&i===t.shaderProgram&&n.framebuffer===this.framebuffer||(n=XR.shallowClone(t,n),n.framebuffer=this.framebuffer,n.shaderProgram=_$(e.context,t.shaderProgram),n.castShadows=!1,n.receiveShadows=!1,Object(l.a)(a)||(a={command:n,originalShaderProgram:t.shaderProgram},t.derivedCommands.pointCloudProcessor=a),a.originalShaderProgram=t.shaderProgram),o[r]=n}const s=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(s)},f$.prototype.isDestroyed=function(){return!1},f$.prototype.destroy=function(){var e;return(e=this)._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0,sc(this)};var y$=f$;function b$(e){const t=Object(c.a)(e,{});this.attenuation=Object(c.a)(t.attenuation,!1),this.geometricErrorScale=Object(c.a)(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=Object(c.a)(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=Object(c.a)(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=Object(c.a)(t.eyeDomeLightingRadius,1),this.backFaceCulling=Object(c.a)(t.backFaceCulling,!1),this.normalShading=Object(c.a)(t.normalShading,!0)}b$.isSupported=function(e){return y$.isSupported(e.context)};var v$=b$;function O$(e,t,n,i,r){var o;this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this._pickId=void 0,this._batchTable=void 0,this._styleDirty=!1,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._pointCloud=new QZ({arrayBuffer:i,byteOffset:r,cull:!1,opaquePass:KR.CESIUM_3D_TILE,vertexShaderLoaded:(o=this,function(e){return Object(l.a)(o._batchTable)?o._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(e):e}),fragmentShaderLoaded:w$(this),uniformMapLoaded:A$(this),batchTableLoaded:E$(this),pickIdLoaded:T$(this)})}function w$(e){return function(t){return Object(l.a)(e._batchTable)?e._batchTable.getFragmentShaderCallback(!1,void 0,!1)(t):"uniform vec4 czm_pickColor;\n"+t}}function A$(e){return function(t){return Object(l.a)(e._batchTable)?e._batchTable.getUniformMapCallback()(t):Object(up.a)(t,{czm_pickColor:function(){return e._pickId.color}})}}function E$(e){return function(t,n,i){e._batchTable=new DV(e,t,n,i)}}function T$(e){return function(){return Object(l.a)(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}Object.defineProperties(O$.prototype,{featuresLength:{get:function(){return Object(l.a)(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return Object(l.a)(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),O$.prototype.hasProperty=function(e,t){return!!Object(l.a)(this._batchTable)&&this._batchTable.hasProperty(e,t)},O$.prototype.getFeature=function(e){if(!Object(l.a)(this._batchTable))return;const t=this.featuresLength;if(!Object(l.a)(e)||e<0||e>=t)throw new u.a(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return function(e){const t=e.featuresLength;if(!Object(l.a)(e._features)&&t>0){const n=new Array(t);for(let i=0;i<t;++i)n[i]=new jV(e,i);e._features=n}}(this),this._features[e]},O$.prototype.applyDebugSettings=function(e,t){this._pointCloud.color=e?t:sp.WHITE},O$.prototype.applyStyle=function(e){Object(l.a)(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};const C$=new v$;O$.prototype.update=function(e,t){const n=this._pointCloud,i=Object(c.a)(e.pointCloudShading,C$),r=this._tile,o=this._batchTable,a=t.mode,s=e.clippingPlanes;let u;Object(l.a)(this._pickId)||Object(l.a)(o)||(this._pickId=t.context.createPickId({primitive:e,content:this})),Object(l.a)(o)&&o.update(e,t),u=Object(l.a)(r._contentBoundingVolume)?a===AB.SCENE3D?r._contentBoundingVolume.boundingSphere:r._contentBoundingVolume2D.boundingSphere:a===AB.SCENE3D?r._boundingVolume.boundingSphere:r._boundingVolume2D.boundingSphere;const d=this._styleDirty;this._styleDirty=!1,n.clippingPlanesOriginMatrix=e.clippingPlanesOriginMatrix,n.style=Object(l.a)(o)?void 0:e.style,n.styleDirty=d,n.modelMatrix=r.computedTransform,n.time=e.timeSinceLoad,n.shadows=e.shadows,n.boundingSphere=u,n.clippingPlanes=s,n.isClipped=Object(l.a)(s)&&s.enabled&&r._isClipped,n.clippingPlanesDirty=r.clippingPlanesDirty,n.attenuation=i.attenuation,n.backFaceCulling=i.backFaceCulling,n.normalShading=i.normalShading,n.geometricError=function(e){const t=e._tileset.pointCloudShading,n=e._tile.contentBoundingVolume.boundingSphere.volume(),i=h.a.cbrt(n/e.pointsLength);let r=e._tile.geometricError;return 0===r&&(r=Object(l.a)(t)&&Object(l.a)(t.baseResolution)?t.baseResolution:i),r}(this),n.geometricErrorScale=i.geometricErrorScale,n.splitDirection=e.splitDirection,Object(l.a)(i)&&Object(l.a)(i.maximumAttenuation)?n.maximumAttenuation=i.maximumAttenuation:r.refine===wZ.ADD?n.maximumAttenuation=5:n.maximumAttenuation=e.maximumScreenSpaceError,n.update(t)},O$.prototype.isDestroyed=function(){return!1},O$.prototype.destroy=function(){return this._pickId=this._pickId&&this._pickId.destroy(),this._pointCloud=this._pointCloud&&this._pointCloud.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),sc(this)};var x$=O$;function S$(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._readyPromise=function(e,t){return e._tileset.loadTileset(e._resource,t,e._tile),Promise.resolve(e)}(this,i)}Object.defineProperties(S$.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),S$.prototype.hasProperty=function(e,t){return!1},S$.prototype.getFeature=function(e){},S$.prototype.applyDebugSettings=function(e,t){},S$.prototype.applyStyle=function(e){},S$.prototype.update=function(e,t){},S$.prototype.isDestroyed=function(){return!1},S$.prototype.destroy=function(){return sc(this)};var I$=S$;function P$(e,t,n,i){if(s.a.defined("context",e),!t||0===t.length)throw new u.a("At least one attribute is required.");const r=P$._verifyAttributes(t);n=Object(c.a)(n,0);const o=[],a={};let h,d;const f=r.length;for(let e=0;e<f;++e){const t=r[e];t.vertexBuffer?o.push(t):(d=t.usage,h=a[d],Object(l.a)(h)||(h=a[d]=[]),h.push(t))}function p(e,t){return gs.getSizeInBytes(t.componentDatatype)-gs.getSizeInBytes(e.componentDatatype)}for(d in this._allBuffers=[],a)if(a.hasOwnProperty(d)){h=a[d],h.sort(p);const e=P$._vertexSizeInBytes(h),t={vertexSizeInBytes:e,vertexBuffer:void 0,usage:h[0].usage,needsCommit:!1,arrayBuffer:void 0,arrayViews:P$._createArrayViews(h,e)};this._allBuffers.push(t)}this._size=0,this._instanced=Object(c.a)(i,!1),this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}P$._verifyAttributes=function(e){const t=[];for(let n=0;n<e.length;++n){const i=e[n],r={index:Object(c.a)(i.index,n),enabled:Object(c.a)(i.enabled,!0),componentsPerAttribute:i.componentsPerAttribute,componentDatatype:Object(c.a)(i.componentDatatype,gs.FLOAT),normalize:Object(c.a)(i.normalize,!1),vertexBuffer:i.vertexBuffer,usage:Object(c.a)(i.usage,KN.STATIC_DRAW)};if(t.push(r),1!==r.componentsPerAttribute&&2!==r.componentsPerAttribute&&3!==r.componentsPerAttribute&&4!==r.componentsPerAttribute)throw new u.a("attribute.componentsPerAttribute must be in the range [1, 4].");const o=r.componentDatatype;if(!gs.validate(o))throw new u.a("Attribute must have a valid componentDatatype or not specify it.");if(!KN.validate(r.usage))throw new u.a("Attribute must have a valid usage or not specify it.")}const n=new Array(t.length);for(let e=0;e<t.length;++e){const i=t[e].index;if(n[i])throw new u.a(`Index ${i} is used by more than one attribute.`);n[i]=!0}return t},P$._vertexSizeInBytes=function(e){let t=0;const n=e.length;for(let i=0;i<n;++i){const n=e[i];t+=n.componentsPerAttribute*gs.getSizeInBytes(n.componentDatatype)}const i=n>0?gs.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0;return t+=0===r?0:i-r,t},P$._createArrayViews=function(e,t){const n=[];let i=0;const r=e.length;for(let o=0;o<r;++o){const r=e[o],a=r.componentDatatype;n.push({index:r.index,enabled:r.enabled,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:a,normalize:r.normalize,offsetInBytes:i,vertexSizeInComponentType:t/gs.getSizeInBytes(a),view:void 0}),i+=r.componentsPerAttribute*gs.getSizeInBytes(a)}return n},P$.prototype.resize=function(e){this._size=e;const t=this._allBuffers;this.writers=[];for(let e=0,n=t.length;e<n;++e){const n=t[e];P$._resize(n,this._size),P$._appendWriters(this.writers,n)}M$(this)},P$._resize=function(e,t){if(e.vertexSizeInBytes>0){const n=new ArrayBuffer(t*e.vertexSizeInBytes);if(Object(l.a)(e.arrayBuffer)){const t=new Uint8Array(n),i=new Uint8Array(e.arrayBuffer),r=i.length;for(let e=0;e<r;++e)t[e]=i[e]}const i=e.arrayViews,r=i.length;for(let e=0;e<r;++e){const t=i[e];t.view=gs.createArrayBufferView(t.componentDatatype,n,t.offsetInBytes)}e.arrayBuffer=n}};const D$=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){const a=i*n;t[a]=r,t[a+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,a){const s=i*n;t[s]=r,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,a,s){const c=i*n;t[c]=r,t[c+1]=o,t[c+2]=a,t[c+3]=s,e.needsCommit=!0}}];function R$(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;const n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=Object(l.a)(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=ZN.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function j$(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){const i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}function M$(e){const t=e.va;if(!Object(l.a)(t))return;const n=t.length;for(let e=0;e<n;++e)t[e].va.destroy();e.va=void 0}P$._appendWriters=function(e,t){const n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){const i=n[r];e[i.index]=D$[i.componentsPerAttribute-1](t,i.view,i.vertexSizeInComponentType)}},P$.prototype.commit=function(e){let t=!1;const n=this._allBuffers;let i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=R$(this,i)||t;if(t||!Object(l.a)(this.va)){M$(this);const t=this.va=[],a=h.a.SIXTY_FOUR_KILOBYTES-4,s=Object(l.a)(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let c=0;c<s;++c){let l=[];for(r=0,o=n.length;r<o;++r){i=n[r];const e=c*(i.vertexSizeInBytes*a);P$._appendAttributes(l,i,e,this._instanced)}l=l.concat(this._precreated),t.push({va:new iB({context:this._context,attributes:l,indexBuffer:e}),indicesCount:1.5*(c!==s-1?a:this._size%a)})}}},P$._appendAttributes=function(e,t,n,i){const r=t.arrayViews,o=r.length;for(let a=0;a<o;++a){const o=r[a];e.push({index:o.index,enabled:o.enabled,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype,normalize:o.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+o.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},P$.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new u.a("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new u.a("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");const n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)j$(n[i],e,t)},P$.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1},P$.prototype.isDestroyed=function(){return!1},P$.prototype.destroy=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){const n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return M$(this),sc(this)};var L$=P$,N$='#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform sampler2D u_atlas;\n\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nvarying vec2 v_textureCoordinates;\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\n\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;                  // the min and max x and y values for the texture coordinates\nvarying vec4 v_originTextureCoordinateAndTranslate;      // texture coordinate at the origin, billboard translate (used for label glyphs)\nvarying vec4 v_compressed;                               // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize\nvarying mat2 v_rotationMatrix;\n\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT1 = 2.0;\n\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\n\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\n{\n    vec2 lookupVector = imageSize * (depthLookupST - adjustedST);\n    lookupVector = v_rotationMatrix * lookupVector;\n    vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle.  Will be zero for billboards because dimensions and imageSize will be equal\n\n    vec2 translation = v_originTextureCoordinateAndTranslate.zw;\n\n    if (applyTranslate)\n    {\n        // this is only needed for labels where the horizontal origin is not LEFT\n        // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT\n        translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\n    }\n\n    vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\n    float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));\n\n    if (logDepthOrDepth == 0.0)\n    {\n        return 0.0; // not on the globe\n    }\n\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n    return eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\n\n\n#ifdef SDF\n\n// Get the distance from the edge of a glyph at a given position sampling an SDF texture.\nfloat getDistance(vec2 position)\n{\n    return texture2D(u_atlas, position).r;\n}\n\n// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\n{\n    float distance = getDistance(position);\n\n    if (outlineWidth > 0.0)\n    {\n        // Don\'t get the outline edge exceed the SDF_EDGE\n        float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\n        float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\n        vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\n        float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\n        return vec4(sdfColor.rgb, sdfColor.a * alpha);\n    }\n    else\n    {\n        float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\n        return vec4(v_color.rgb, v_color.a * alpha);\n    }\n}\n#endif\n\nvoid main()\n{\n    vec4 color = texture2D(u_atlas, v_textureCoordinates);\n\n#ifdef SDF\n    float outlineWidth = v_outlineWidth;\n    vec4 outlineColor = v_outlineColor;\n\n    // Get the current distance\n    float distance = getDistance(v_textureCoordinates);\n\n#ifdef GL_OES_standard_derivatives\n    float smoothing = fwidth(distance);\n    // Get an offset that is approximately half the distance to the neighbor pixels\n    // 0.354 is approximately half of 1/sqrt(2)\n    vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\n\n    // Sample the center point\n    vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n\n    // Sample the 4 neighbors\n    vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\n    vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\n    vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\n    vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\n\n    // Equally weight the center sample and the 4 neighboring samples\n    color = (center + color1 + color2 + color3 + color4)/5.0;\n#else\n    // Just do a single sample\n    float smoothing = 1.0/32.0;\n    color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n#endif\n\n    color = czm_gammaCorrect(color);\n#else\n    color = czm_gammaCorrect(color);\n    color *= czm_gammaCorrect(v_color);\n#endif\n\n// Fully transparent parts of the billboard are not pickable.\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\n    if (color.a < 0.005)   // matches 0/255 and 1/255\n    {\n        discard;\n    }\n#else\n// The billboard is rendered twice. The opaque pass discards translucent fragments\n// and the translucent pass discards opaque fragments.\n#ifdef OPAQUE\n    if (color.a < 0.995)   // matches < 254/255\n    {\n        discard;\n    }\n#else\n    if (color.a >= 0.995)  // matches 254/255 and 255/255\n    {\n        discard;\n    }\n#endif\n#endif\n\n#ifdef VECTOR_TILE\n    color *= u_highlightColor;\n#endif\n    gl_FragColor = color;\n\n#ifdef LOG_DEPTH\n    czm_writeLogDepth();\n#endif\n\n#ifdef FRAGMENT_DEPTH_CHECK\n    float temp = v_compressed.y;\n\n    temp = temp * SHIFT_RIGHT1;\n\n    float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\n    bool enableDepthTest = temp2 != 0.0;\n    bool applyTranslate = floor(temp) != 0.0;\n\n    if (enableDepthTest) {\n        temp = v_compressed.z;\n        temp = temp * SHIFT_RIGHT12;\n\n        vec2 dimensions;\n        dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\n        dimensions.x = floor(temp);\n\n        temp = v_compressed.w;\n        temp = temp * SHIFT_RIGHT12;\n\n        vec2 imageSize;\n        imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\n        imageSize.x = floor(temp);\n\n        vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\n        adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\n\n        float epsilonEyeDepth = v_compressed.x + czm_epsilon1;\n        float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\n\n        // negative values go into the screen\n        if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\n        {\n            float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner\n            if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\n            {\n                float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner\n                if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\n                {\n                    discard;\n                }\n            }\n        }\n    }\n#endif\n\n}\n',B$="#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;                       // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)\nattribute vec4 compressedAttribute1;                       // aligned axis, translucency by distance, image width\nattribute vec4 compressedAttribute2;                       // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free\nattribute vec4 eyeOffset;                                  // eye offset in meters, 4 bytes free (texture range)\nattribute vec4 scaleByDistance;                            // near, nearScale, far, farScale\nattribute vec4 pixelOffsetScaleByDistance;                 // near, nearScale, far, farScale\nattribute vec4 compressedAttribute3;                       // distance display condition near, far, disableDepthTestDistance, dimensions\nattribute vec2 sdf;                                        // sdf outline color (rgb) and width (w)\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\nattribute vec4 textureCoordinateBoundsOrLabelTranslate;    // the min and max x and y values for the texture coordinates\n#endif\n#ifdef VECTOR_TILE\nattribute float a_batchId;\n#endif\n\nvarying vec2 v_textureCoordinates;\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;                                 // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize\nvarying mat2 v_rotationMatrix;\n#endif\n\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\n\nconst float UPPER_BOUND = 32768.0;\n\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\n\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\n\nvec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)\n{\n    // Note the halfSize cannot be computed in JavaScript because it is sent via\n    // compressed vertex attributes that coerce it to an integer.\n    vec2 halfSize = imageSize * scale * 0.5;\n    halfSize *= ((direction * 2.0) - 1.0);\n\n    vec2 originTranslate = origin * abs(halfSize);\n\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\n    if (validAlignedAxis || rotation != 0.0)\n    {\n        float angle = rotation;\n        if (validAlignedAxis)\n        {\n            vec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\n            angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n                    (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\n        }\n\n        float cosTheta = cos(angle);\n        float sinTheta = sin(angle);\n        rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\n        halfSize = rotationMatrix * halfSize;\n    }\n    else\n    {\n        rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n    }\n#endif\n\n    mpp = czm_metersPerPixel(positionEC);\n    positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\n    positionEC.xy += (translate + pixelOffset) * mpp;\n\n    return positionEC;\n}\n\n#ifdef VERTEX_DEPTH_CHECK\nfloat getGlobeDepth(vec4 positionEC)\n{\n    vec4 posWC = czm_eyeToWindowCoordinates(positionEC);\n\n    float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\n\n    if (globeDepth == 0.0)\n    {\n        return 0.0; // not on the globe\n    }\n\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\n    return eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\nvoid main()\n{\n    // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition\n\n    // unpack attributes\n    vec3 positionHigh = positionHighAndScale.xyz;\n    vec3 positionLow = positionLowAndRotation.xyz;\n    float scale = positionHighAndScale.w;\n\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\n    float rotation = positionLowAndRotation.w;\n#else\n    float rotation = 0.0;\n#endif\n\n    float compressed = compressedAttribute0.x;\n\n    vec2 pixelOffset;\n    pixelOffset.x = floor(compressed * SHIFT_RIGHT7);\n    compressed -= pixelOffset.x * SHIFT_LEFT7;\n    pixelOffset.x -= UPPER_BOUND;\n\n    vec2 origin;\n    origin.x = floor(compressed * SHIFT_RIGHT5);\n    compressed -= origin.x * SHIFT_LEFT5;\n\n    origin.y = floor(compressed * SHIFT_RIGHT3);\n    compressed -= origin.y * SHIFT_LEFT3;\n\n#ifdef FRAGMENT_DEPTH_CHECK\n    vec2 depthOrigin = origin.xy;\n#endif\n    origin -= vec2(1.0);\n\n    float show = floor(compressed * SHIFT_RIGHT2);\n    compressed -= show * SHIFT_LEFT2;\n\n#ifdef INSTANCED\n    vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\n    vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\n    vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\n    vec2 direction;\n    direction.x = floor(compressed * SHIFT_RIGHT1);\n    direction.y = compressed - direction.x * SHIFT_LEFT1;\n\n    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\n\n    float temp = compressedAttribute0.y  * SHIFT_RIGHT8;\n    pixelOffset.y = -(floor(temp) - UPPER_BOUND);\n\n    vec2 translate;\n    translate.y = (temp - floor(temp)) * SHIFT_LEFT16;\n\n    temp = compressedAttribute0.z * SHIFT_RIGHT8;\n    translate.x = floor(temp) - UPPER_BOUND;\n\n    translate.y += (temp - floor(temp)) * SHIFT_LEFT8;\n    translate.y -= UPPER_BOUND;\n\n    temp = compressedAttribute1.x * SHIFT_RIGHT8;\n    float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\n\n    vec2 imageSize = vec2(floor(temp), temp2);\n\n#ifdef FRAGMENT_DEPTH_CHECK\n    float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\n    float applyTranslate = 0.0;\n    if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false\n    {\n        applyTranslate = 1.0;\n        labelHorizontalOrigin -= 2.0;\n        depthOrigin.x = labelHorizontalOrigin + 1.0;\n    }\n\n    depthOrigin = vec2(1.0) - (depthOrigin * 0.5);\n#endif\n\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n    vec4 translucencyByDistance;\n    translucencyByDistance.x = compressedAttribute1.z;\n    translucencyByDistance.z = compressedAttribute1.w;\n\n    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n\n    temp = compressedAttribute1.y * SHIFT_RIGHT8;\n    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\n    temp = compressedAttribute3.w;\n    temp = temp * SHIFT_RIGHT12;\n\n    vec2 dimensions;\n    dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\n    dimensions.x = floor(temp);\n#endif\n\n#ifdef ALIGNED_AXIS\n    vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\n    temp = compressedAttribute2.z * SHIFT_RIGHT5;\n    bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\n    vec3 alignedAxis = vec3(0.0);\n    bool validAlignedAxis = false;\n#endif\n\n    vec4 pickColor;\n    vec4 color;\n\n    temp = compressedAttribute2.y;\n    temp = temp * SHIFT_RIGHT8;\n    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n    pickColor.r = floor(temp);\n\n    temp = compressedAttribute2.x;\n    temp = temp * SHIFT_RIGHT8;\n    color.b = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    color.g = (temp - floor(temp)) * SHIFT_LEFT8;\n    color.r = floor(temp);\n\n    temp = compressedAttribute2.z * SHIFT_RIGHT8;\n    bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\n    temp = floor(temp) * SHIFT_RIGHT8;\n\n    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\n    pickColor /= 255.0;\n\n    color.a = floor(temp);\n    color /= 255.0;\n\n    ///////////////////////////////////////////////////////////////////////////\n\n    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n    vec4 positionEC = czm_modelViewRelativeToEye * p;\n\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\n    float eyeDepth = positionEC.z;\n#endif\n\n    positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\n    positionEC.xyz *= show;\n\n    ///////////////////////////////////////////////////////////////////////////\n\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\n    float lengthSq;\n    if (czm_sceneMode == czm_sceneMode2D)\n    {\n        // 2D camera distance is a special case\n        // treat all billboards as flattened to the z=0.0 plane\n        lengthSq = czm_eyeHeight2D.y;\n    }\n    else\n    {\n        lengthSq = dot(positionEC.xyz, positionEC.xyz);\n    }\n#endif\n\n#ifdef EYE_DISTANCE_SCALING\n    float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\n    scale *= distanceScale;\n    translate *= distanceScale;\n    // push vertex behind near plane for clipping\n    if (scale == 0.0)\n    {\n        positionEC.xyz = vec3(0.0);\n    }\n#endif\n\n    float translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\n    // push vertex behind near plane for clipping\n    if (translucency == 0.0)\n    {\n        positionEC.xyz = vec3(0.0);\n    }\n#endif\n\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\n    float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\n    pixelOffset *= pixelOffsetScale;\n#endif\n\n#ifdef DISTANCE_DISPLAY_CONDITION\n    float nearSq = compressedAttribute3.x;\n    float farSq = compressedAttribute3.y;\n    if (lengthSq < nearSq || lengthSq > farSq)\n    {\n        positionEC.xyz = vec3(0.0);\n    }\n#endif\n\n    mat2 rotationMatrix;\n    float mpp;\n\n#ifdef DISABLE_DEPTH_DISTANCE\n    float disableDepthTestDistance = compressedAttribute3.z;\n#endif\n\n#ifdef VERTEX_DEPTH_CHECK\nif (lengthSq < disableDepthTestDistance) {\n    float depthsilon = 10.0;\n\n    vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\n    vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n    float globeDepth1 = getGlobeDepth(pEC1);\n\n    if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\n    {\n        vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n        float globeDepth2 = getGlobeDepth(pEC2);\n\n        if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\n        {\n            vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n            float globeDepth3 = getGlobeDepth(pEC3);\n            if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\n            {\n                positionEC.xyz = vec3(0.0);\n            }\n        }\n    }\n}\n#endif\n\n    positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\n    gl_Position = czm_projection * positionEC;\n    v_textureCoordinates = textureCoordinates;\n\n#ifdef LOG_DEPTH\n    czm_vertexLogDepth();\n#endif\n\n#ifdef DISABLE_DEPTH_DISTANCE\n    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n    {\n        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n    }\n\n    if (disableDepthTestDistance != 0.0)\n    {\n        // Don't try to \"multiply both sides\" by w.  Greater/less-than comparisons won't work for negative values of w.\n        float zclip = gl_Position.z / gl_Position.w;\n        bool clipped = (zclip < -1.0 || zclip > 1.0);\n        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n        {\n            // Position z on the near plane.\n            gl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\n            v_depthFromNearPlusOne = 1.0;\n#endif\n        }\n    }\n#endif\n\n#ifdef FRAGMENT_DEPTH_CHECK\n    if (sizeInMeters) {\n        translate /= mpp;\n        dimensions /= mpp;\n        imageSize /= mpp;\n    }\n\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\n    v_rotationMatrix = rotationMatrix;\n#else\n    v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n#endif\n\n    float enableDepthCheck = 0.0;\n    if (lengthSq < disableDepthTestDistance)\n    {\n        enableDepthCheck = 1.0;\n    }\n\n    float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\n    float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\n\n    float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\n    float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\n\n    v_compressed.x = eyeDepth;\n    v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\n    v_compressed.z = dw * SHIFT_LEFT12 + dh;\n    v_compressed.w = iw * SHIFT_LEFT12 + ih;\n    v_originTextureCoordinateAndTranslate.xy = depthOrigin;\n    v_originTextureCoordinateAndTranslate.zw = translate;\n    v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\n\n#endif\n\n#ifdef SDF\n    vec4 outlineColor;\n    float outlineWidth;\n\n    temp = sdf.x;\n    temp = temp * SHIFT_RIGHT8;\n    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n    outlineColor.r = floor(temp);\n\n    temp = sdf.y;\n    temp = temp * SHIFT_RIGHT8;\n    float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\n    outlineColor.a = floor(temp);\n    outlineColor /= 255.0;\n\n    v_outlineWidth = outlineWidth / 255.0;\n    v_outlineColor = outlineColor;\n    v_outlineColor.a *= translucency;\n#endif\n\n    v_pickColor = pickColor;\n\n    v_color = color;\n    v_color.a *= translucency;\n\n}\n";const F$={},z$=new _e(0,0,0,1);let k$=new _e;const U$=new Nl,V$=new Vt,H$=new Vt;F$.wgs84ToWindowCoordinates=function(e,t,n){return F$.wgs84WithEyeOffsetToWindowCoordinates(e,t,O.ZERO,n)};const G$=new _e,q$=new O;function W$(e,t,n,i){const r=n.viewMatrix,o=Me.multiplyByVector(r,_e.fromElements(e.x,e.y,e.z,1,G$),G$),a=O.multiplyComponents(t,O.normalize(o,q$),q$);return o.x+=t.x+a.x,o.y+=t.y+a.y,o.z+=a.z,Me.multiplyByVector(n.frustum.projectionMatrix,o,i)}const Y$=new R(Math.PI,h.a.PI_OVER_TWO),X$=new O,K$=new O;F$.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("scene is required.");if(!Object(l.a)(t))throw new u.a("position is required.");const r=e.frameState,o=F$.computeActualWgs84Position(r,t,z$);if(!Object(l.a)(o))return;const a=e.canvas,s=U$;s.x=0,s.y=0,s.width=a.clientWidth,s.height=a.clientHeight;const c=e.camera;let d=!1;if(r.mode===AB.SCENE2D){const t=e.mapProjection,r=Y$,l=t.project(r,X$),u=O.clone(c.position,K$),f=c.frustum.clone(),p=Me.computeViewportTransformation(s,0,1,new Me),m=c.frustum.projectionMatrix,g=c.positionWC.y,_=O.fromElements(h.a.sign(g)*l.x-g,0,-c.positionWC.x),y=ca.pointToGLWindowCoordinates(m,p,_);if(0===g||y.x<=0||y.x>=a.clientWidth)d=!0;else{if(y.x>.5*a.clientWidth){s.width=y.x,c.frustum.right=l.x-g,k$=W$(o,n,c,k$),F$.clipToGLWindowCoordinates(s,k$,V$),s.x+=y.x,c.position.x=-c.position.x;const e=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-e,k$=W$(o,n,c,k$),F$.clipToGLWindowCoordinates(s,k$,H$)}else{s.x+=y.x,s.width-=y.x,c.frustum.left=-l.x-g,k$=W$(o,n,c,k$),F$.clipToGLWindowCoordinates(s,k$,V$),s.x=s.x-s.width,c.position.x=-c.position.x;const e=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-e,k$=W$(o,n,c,k$),F$.clipToGLWindowCoordinates(s,k$,H$)}O.clone(u,c.position),c.frustum=f.clone(),((i=Vt.clone(V$,i)).x<0||i.x>a.clientWidth)&&(i.x=H$.x)}}if(r.mode!==AB.SCENE2D||d){if(k$=W$(o,n,c,k$),k$.z<0&&!(c.frustum instanceof nv)&&!(c.frustum instanceof Qb))return;i=F$.clipToGLWindowCoordinates(s,k$,i)}return i.y=a.clientHeight-i.y,i},F$.wgs84ToDrawingBufferCoordinates=function(e,t,n){if(n=F$.wgs84ToWindowCoordinates(e,t,n),Object(l.a)(n))return F$.transformWindowToDrawingBuffer(e,n,n)};const J$=new O,Z$=new R;F$.computeActualWgs84Position=function(e,t,n){const i=e.mode;if(i===AB.SCENE3D)return O.clone(t,n);const r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,Z$);if(!Object(l.a)(o))return;if(r.project(o,J$),i===AB.COLUMBUS_VIEW)return O.fromElements(J$.z,J$.x,J$.y,n);if(i===AB.SCENE2D)return O.fromElements(0,J$.x,J$.y,n);const a=e.morphTime;return O.fromElements(h.a.lerp(J$.z,t.x,a),h.a.lerp(J$.x,t.y,a),h.a.lerp(J$.y,t.z,a),n)};const $$=new O,Q$=new O,eQ=new Me;F$.clipToGLWindowCoordinates=function(e,t,n){return O.divideByScalar(t,t.w,$$),Me.computeViewportTransformation(e,0,1,eQ),Me.multiplyByPoint(eQ,$$,Q$),Vt.fromCartesian3(Q$,n)},F$.transformWindowToDrawingBuffer=function(e,t,n){const i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return Vt.fromElements(t.x*r,t.y*o,n)};const tQ=new _e,nQ=new _e;F$.drawingBufferToWgs84Coordinates=function(e,t,n,i){const r=e.context.uniformState,o=r.currentFrustum,a=o.x,s=o.y;if(e.frameState.useLogDepth){const e=n*r.log2FarDepthFromNearPlusOne;n=s*(1-a/(Math.pow(2,e)-1+a))/(s-a)}const c=e.view.passState.viewport,u=_e.clone(_e.UNIT_W,tQ);let h;u.x=(t.x-c.x)/c.width*2-1,u.y=(t.y-c.y)/c.height*2-1,u.z=2*n-1,u.w=1;let d=e.camera.frustum;if(Object(l.a)(d.fovy)){h=Me.multiplyByVector(r.inverseViewProjection,u,nQ);const e=1/h.w;O.multiplyByScalar(h,e,h)}else Object(l.a)(d._offCenterFrustum)&&(d=d._offCenterFrustum),h=nQ,h.x=.5*(u.x*(d.right-d.left)+d.left+d.right),h.y=.5*(u.y*(d.top-d.bottom)+d.bottom+d.top),h.z=.5*(u.z*(a-s)-a-s),h.w=1,h=Me.multiplyByVector(r.inverseView,h,h);return O.fromCartesian4(h,i)};var iQ=F$;function rQ(e,t){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),Object(l.a)(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new u.a("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;if(Object(l.a)(n)){if(n.far<=n.near)throw new u.a("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=TE.clone(n)}if(Object(l.a)(i)){if(i.far<=i.near)throw new u.a("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=TE.clone(i)}if(Object(l.a)(r)){if(r.far<=r.near)throw new u.a("scaleByDistance.far must be greater than scaleByDistance.near.");r=TE.clone(r)}if(Object(l.a)(o)){if(o.far<=o.near)throw new u.a("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=eb.clone(o)}this._show=Object(c.a)(e.show,!0),this._position=O.clone(Object(c.a)(e.position,O.ZERO)),this._actualPosition=O.clone(this._position),this._pixelOffset=Vt.clone(Object(c.a)(e.pixelOffset,Vt.ZERO)),this._translate=new Vt(0,0),this._eyeOffset=O.clone(Object(c.a)(e.eyeOffset,O.ZERO)),this._heightReference=Object(c.a)(e.heightReference,qP.NONE),this._verticalOrigin=Object(c.a)(e.verticalOrigin,YP.CENTER),this._horizontalOrigin=Object(c.a)(e.horizontalOrigin,WP.CENTER),this._scale=Object(c.a)(e.scale,1),this._color=sp.clone(Object(c.a)(e.color,sp.WHITE)),this._rotation=Object(c.a)(e.rotation,0),this._alignedAxis=O.clone(Object(c.a)(e.alignedAxis,O.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=Object(c.a)(e.sizeInMeters,!1),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=Object(c.a)(e.collection,t),this._pickId=void 0,this._pickPrimitive=Object(c.a)(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;const a=e.image;let s=e.imageId;Object(l.a)(a)&&(Object(l.a)(s)||(s="string"==typeof a?a:Object(l.a)(a.src)?a.src:fy()),this._imageId=s,this._image=a),Object(l.a)(e.imageSubRegion)&&(this._imageId=s,this._imageSubRegion=e.imageSubRegion),Object(l.a)(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=AB.SCENE3D,this._clusterShow=!0,this._outlineColor=sp.clone(Object(c.a)(e.outlineColor,sp.BLACK)),this._outlineWidth=Object(c.a)(e.outlineWidth,0),this._updateClamping()}const oQ=rQ.SHOW_INDEX=0,aQ=rQ.POSITION_INDEX=1,sQ=rQ.PIXEL_OFFSET_INDEX=2,cQ=rQ.EYE_OFFSET_INDEX=3,lQ=rQ.HORIZONTAL_ORIGIN_INDEX=4,uQ=rQ.VERTICAL_ORIGIN_INDEX=5,hQ=rQ.SCALE_INDEX=6,dQ=rQ.IMAGE_INDEX_INDEX=7,fQ=rQ.COLOR_INDEX=8,pQ=rQ.ROTATION_INDEX=9,mQ=rQ.ALIGNED_AXIS_INDEX=10,gQ=rQ.SCALE_BY_DISTANCE_INDEX=11,_Q=rQ.TRANSLUCENCY_BY_DISTANCE_INDEX=12,yQ=rQ.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,bQ=rQ.DISTANCE_DISPLAY_CONDITION=14,vQ=rQ.DISABLE_DEPTH_DISTANCE=15;rQ.TEXTURE_COORDINATE_BOUNDS=16;const OQ=rQ.SDF_INDEX=17;function wQ(e,t){const n=e._billboardCollection;Object(l.a)(n)&&(n._updateBillboard(e,t),e._dirty=!0)}rQ.NUMBER_OF_PROPERTIES=18,Object.defineProperties(rQ.prototype,{show:{get:function(){return this._show},set:function(e){s.a.typeOf.bool("value",e),this._show!==e&&(this._show=e,wQ(this,oQ))}},position:{get:function(){return this._position},set:function(e){s.a.typeOf.object("value",e);const t=this._position;O.equals(t,e)||(O.clone(e,t),O.clone(e,this._actualPosition),this._updateClamping(),wQ(this,aQ))}},heightReference:{get:function(){return this._heightReference},set:function(e){s.a.typeOf.number("value",e);e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),wQ(this,aQ))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){s.a.typeOf.object("value",e);const t=this._pixelOffset;Vt.equals(t,e)||(Vt.clone(e,t),wQ(this,sQ))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(Object(l.a)(e)&&(s.a.typeOf.object("value",e),e.far<=e.near))throw new u.a("far distance must be greater than near distance.");const t=this._scaleByDistance;TE.equals(t,e)||(this._scaleByDistance=TE.clone(e,t),wQ(this,gQ))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(Object(l.a)(e)&&(s.a.typeOf.object("value",e),e.far<=e.near))throw new u.a("far distance must be greater than near distance.");const t=this._translucencyByDistance;TE.equals(t,e)||(this._translucencyByDistance=TE.clone(e,t),wQ(this,_Q))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(Object(l.a)(e)&&(s.a.typeOf.object("value",e),e.far<=e.near))throw new u.a("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;TE.equals(t,e)||(this._pixelOffsetScaleByDistance=TE.clone(e,t),wQ(this,yQ))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){s.a.typeOf.object("value",e);const t=this._eyeOffset;O.equals(t,e)||(O.clone(e,t),wQ(this,cQ))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){s.a.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wQ(this,lQ))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){s.a.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,wQ(this,uQ))}},scale:{get:function(){return this._scale},set:function(e){s.a.typeOf.number("value",e),this._scale!==e&&(this._scale=e,wQ(this,hQ))}},color:{get:function(){return this._color},set:function(e){s.a.typeOf.object("value",e);const t=this._color;sp.equals(t,e)||(sp.clone(e,t),wQ(this,fQ))}},rotation:{get:function(){return this._rotation},set:function(e){s.a.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,wQ(this,pQ))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){s.a.typeOf.object("value",e);const t=this._alignedAxis;O.equals(t,e)||(O.clone(e,t),wQ(this,mQ))}},width:{get:function(){return Object(c.a)(this._width,this._imageWidth)},set:function(e){Object(l.a)(e)&&s.a.typeOf.number("value",e),this._width!==e&&(this._width=e,wQ(this,dQ))}},height:{get:function(){return Object(c.a)(this._height,this._imageHeight)},set:function(e){Object(l.a)(e)&&s.a.typeOf.number("value",e),this._height!==e&&(this._height=e,wQ(this,dQ))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){s.a.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,wQ(this,fQ))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!eb.equals(e,this._distanceDisplayCondition)){if(Object(l.a)(e)&&(s.a.typeOf.object("value",e),e.far<=e.near))throw new u.a("far distance must be greater than near distance.");this._distanceDisplayCondition=eb.clone(e,this._distanceDisplayCondition),wQ(this,bQ)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(Object(l.a)(e)&&(s.a.typeOf.number("value",e),e<0))throw new u.a("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,wQ(this,vQ))}},id:{get:function(){return this._id},set:function(e){this._id=e,Object(l.a)(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,Object(l.a)(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){Object(l.a)(e)?"string"==typeof e?this.setImage(e,e):e instanceof Tt.a?this.setImage(e.url,e):Object(l.a)(e.src)?this.setImage(e.src,e):this.setImage(fy(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,wQ(this,dQ))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=O.clone(e,this._actualClampedPosition),wQ(this,aQ)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wQ(this,oQ))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._outlineColor;sp.equals(t,e)||(sp.clone(e,t),wQ(this,OQ))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wQ(this,OQ))}}}),rQ.prototype.getPickId=function(e){return Object(l.a)(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},rQ.prototype._updateClamping=function(){rQ._updateClamping(this._billboardCollection,this)};const AQ=new R,EQ=new O;rQ._updateClamping=function(e,t){const n=e._scene;if(!Object(l.a)(n)||!Object(l.a)(n.globe)){if(t._heightReference!==qP.NONE)throw new u.a("Height reference is not supported without a scene and globe.");return}const i=n.globe,r=i.ellipsoid,o=i._surface,a=n.frameState.mode,s=a!==t._mode;if(t._mode=a,(t._heightReference===qP.NONE||s)&&Object(l.a)(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qP.NONE||!Object(l.a)(t._position))return;const c=r.cartesianToCartographic(t._position);if(!Object(l.a)(c))return void(t._actualClampedPosition=void 0);function h(e){if(t._heightReference===qP.RELATIVE_TO_GROUND)if(t._mode===AB.SCENE3D){const t=r.cartesianToCartographic(e,AQ);t.height+=c.height,r.cartographicToCartesian(t,e)}else e.x+=c.height;t._clampedPosition=O.clone(e,t._clampedPosition)}Object(l.a)(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=o.updateHeight(c,h),R.clone(c,AQ);const d=i.getHeight(c);Object(l.a)(d)&&(AQ.height=d),r.cartographicToCartesian(AQ,EQ),h(EQ)},rQ.prototype._loadImage=function(){const e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion;let r;const o=this;function a(r){if(o._imageId!==t||o._image!==n||!Nl.equals(o._imageSubRegion,i))return;const a=e.textureCoordinates[r];o._imageWidth=e.texture.width*a.width,o._imageHeight=e.texture.height*a.height,o._imageIndex=r,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,wQ(o,dQ)}if(Object(l.a)(n)){const i=e.getImageIndex(t);if(Object(l.a)(i))return void a(i);r=e.addImage(t,n)}Object(l.a)(i)&&(r=e.addSubRegion(t,i)),this._imageIndexPromise=r,Object(l.a)(r)&&r.then(a).catch((function(e){console.error("Error loading image for billboard: "+e),o._imageIndexPromise=void 0}))},rQ.prototype.setImage=function(e,t){if(!Object(l.a)(e))throw new u.a("id is required.");if(!Object(l.a)(t))throw new u.a("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,Object(l.a)(this._billboardCollection._textureAtlas)&&this._loadImage())},rQ.prototype.setImageSubRegion=function(e,t){if(!Object(l.a)(e))throw new u.a("id is required.");if(!Object(l.a)(t))throw new u.a("subRegion is required.");this._imageId===e&&Nl.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Nl.clone(t),Object(l.a)(this._billboardCollection._textureAtlas)&&this._loadImage())},rQ.prototype._setTranslate=function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._translate;Vt.equals(t,e)||(Vt.clone(e,t),wQ(this,sQ))},rQ.prototype._getActualPosition=function(){return Object(l.a)(this._clampedPosition)?this._clampedPosition:this._actualPosition},rQ.prototype._setActualPosition=function(e){Object(l.a)(this._clampedPosition)||O.clone(e,this._actualPosition),wQ(this,aQ)};const TQ=new _e;rQ._computeActualPosition=function(e,t,n,i){return Object(l.a)(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===AB.SCENE3D?t:(Me.multiplyByPoint(i,t,TQ),iQ.computeActualWgs84Position(n,TQ))};const CQ=new O;rQ._computeScreenSpacePosition=function(e,t,n,i,r,o){const a=Me.multiplyByPoint(e,t,CQ),s=iQ.wgs84WithEyeOffsetToWindowCoordinates(r,a,n,o);if(Object(l.a)(s))return Vt.add(s,i,s),s};const xQ=new Vt(0,0);rQ.prototype.computeScreenSpacePosition=function(e,t){const n=this._billboardCollection;if(Object(l.a)(t)||(t=new Vt),!Object(l.a)(n))throw new u.a("Billboard must be in a collection.  Was it removed?");if(!Object(l.a)(e))throw new u.a("scene is required.");Vt.clone(this._pixelOffset,xQ),Vt.add(xQ,this._translate,xQ);let i=n.modelMatrix,r=this._position;if(Object(l.a)(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==AB.SCENE3D)){const t=e.mapProjection,n=t.ellipsoid,o=t.unproject(r,AQ);r=n.cartographicToCartesian(o,CQ),i=Me.IDENTITY}return rQ._computeScreenSpacePosition(i,r,this._eyeOffset,xQ,e,t)},rQ.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height;const o=e.scale;i*=o,r*=o;let a=t.x;e.horizontalOrigin===WP.RIGHT?a-=i:e.horizontalOrigin===WP.CENTER&&(a-=.5*i);let s=t.y;return e.verticalOrigin===YP.BOTTOM||e.verticalOrigin===YP.BASELINE?s-=r:e.verticalOrigin===YP.CENTER&&(s-=.5*r),Object(l.a)(n)||(n=new Nl),n.x=a,n.y=s,n.width=i,n.height=r,n},rQ.prototype.equals=function(e){return this===e||Object(l.a)(e)&&this._id===e._id&&O.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Nl.equals(this._imageSubRegion,e._imageSubRegion)&&sp.equals(this._color,e._color)&&Vt.equals(this._pixelOffset,e._pixelOffset)&&Vt.equals(this._translate,e._translate)&&O.equals(this._eyeOffset,e._eyeOffset)&&TE.equals(this._scaleByDistance,e._scaleByDistance)&&TE.equals(this._translucencyByDistance,e._translucencyByDistance)&&TE.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&eb.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},rQ.prototype._destroy=function(){Object(l.a)(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),Object(l.a)(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var SQ=rQ;var IQ=Object.freeze({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2});var PQ=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25});function DQ(e,t,n,i,r){this.bottomLeft=Object(c.a)(e,Vt.ZERO),this.topRight=Object(c.a)(t,Vt.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=r}const RQ=new Vt(16,16);function jQ(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.borderWidthInPixels,1),n=Object(c.a)(e.initialSize,RQ);if(!Object(l.a)(e.context))throw new u.a("context is required.");if(t<0)throw new u.a("borderWidthInPixels must be greater than or equal to zero.");if(n.x<1||n.y<1)throw new u.a("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=Object(c.a)(e.pixelFormat,aT.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=fy(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}function MQ(e,t,n){const i=function e(t,n,i){if(Object(l.a)(n)){if(!Object(l.a)(n.childNode1)&&!Object(l.a)(n.childNode2)){if(Object(l.a)(n.imageIndex))return;const r=n.topRight.x-n.bottomLeft.x,o=n.topRight.y-n.bottomLeft.y,a=r-i.width,s=o-i.height;if(a<0||s<0)return;if(0===a&&0===s)return n;if(a>s){n.childNode1=new DQ(new Vt(n.bottomLeft.x,n.bottomLeft.y),new Vt(n.bottomLeft.x+i.width,n.topRight.y));const e=n.bottomLeft.x+i.width+t._borderWidthInPixels;e<n.topRight.x&&(n.childNode2=new DQ(new Vt(e,n.bottomLeft.y),new Vt(n.topRight.x,n.topRight.y)))}else{n.childNode1=new DQ(new Vt(n.bottomLeft.x,n.bottomLeft.y),new Vt(n.topRight.x,n.bottomLeft.y+i.height));const e=n.bottomLeft.y+i.height+t._borderWidthInPixels;e<n.topRight.y&&(n.childNode2=new DQ(new Vt(n.bottomLeft.x,e),new Vt(n.topRight.x,n.topRight.y)))}return e(t,n.childNode1,i)}return e(t,n.childNode1,i)||e(t,n.childNode2,i)}}(e,e._root,t);if(Object(l.a)(i)){i.imageIndex=n;const r=e._texture.width,o=e._texture.height,a=i.topRight.x-i.bottomLeft.x,s=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/r,l=i.bottomLeft.y/o,u=a/r,h=s/o;e._textureCoordinates[n]=new Nl(c,l,u,h),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else!function(e,t){const n=e._context,i=e.numberOfImages,r=e._borderWidthInPixels;if(i>0){const i=e._texture.width,o=e._texture.height,a=2*(i+t.width+r),s=2*(o+t.height+r),c=i/a,u=o/s,h=new DQ(new Vt(i+r,r),new Vt(a,o)),d=new DQ(new Vt,new Vt(a,o),e._root,h),f=new DQ(new Vt(r,o+r),new Vt(a,s)),p=new DQ(new Vt,new Vt(a,s),d,f);for(let t=0;t<e._textureCoordinates.length;t++){const n=e._textureCoordinates[t];Object(l.a)(n)&&(n.x*=c,n.y*=u,n.width*=c,n.height*=u)}const m=new JD({context:e._context,width:a,height:s,pixelFormat:e._pixelFormat}),g=new i$({context:n,colorTextures:[e._texture],destroyAttachments:!1});g._bind(),m.copyFromFramebuffer(0,0,0,0,a,s),g._unBind(),g.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=m,e._root=p}else{let n=2*(t.width+2*r),i=2*(t.height+2*r);n<e._initialSize.x&&(n=e._initialSize.x),i<e._initialSize.y&&(i=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new JD({context:e._context,width:n,height:i,pixelFormat:e._pixelFormat}),e._root=new DQ(new Vt(r,r),new Vt(n,i))}}(e,t),MQ(e,t,n);e._guid=fy()}function LQ(e,t){if(!Object(l.a)(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return MQ(e,t,n),n}Object.defineProperties(jQ.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return Object(l.a)(this._texture)||(this._texture=new JD({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),jQ.prototype.getImageIndex=function(e){if(!Object(l.a)(e))throw new u.a("id is required.");return this._indexHash[e]},jQ.prototype.addImageSync=function(e,t){if(!Object(l.a)(e))throw new u.a("id is required.");if(!Object(l.a)(t))throw new u.a("image is required.");let n=this._indexHash[e];return Object(l.a)(n)||(n=LQ(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n},jQ.prototype.addImage=function(e,t){if(!Object(l.a)(e))throw new u.a("id is required.");if(!Object(l.a)(t))throw new u.a("image is required.");let n=this._idHash[e];if(Object(l.a)(n))return n;if("function"==typeof t){if(t=t(e),!Object(l.a)(t))throw new u.a("image is required.")}else if("string"==typeof t||t instanceof Tt.a){t=Tt.a.createIfNeeded(t).fetchImage()}const i=this;return n=Promise.resolve(t).then((function(t){const n=LQ(i,t);return i._indexHash[e]=n,n})),this._idHash[e]=n,n},jQ.prototype.addSubRegion=function(e,t){if(!Object(l.a)(e))throw new u.a("id is required.");if(!Object(l.a)(t))throw new u.a("subRegion is required.");const n=this._idHash[e];if(!Object(l.a)(n))throw new ye.a(`image with id "${e}" not found in the atlas.`);const i=this;return Promise.resolve(n).then((function(e){if(-1===e)return-1;const n=i._texture.width,r=i._texture.height,o=i.numberOfImages,a=i._textureCoordinates[e],s=a.x+t.x/n,c=a.y+t.y/r,l=t.width/n,u=t.height/r;return i._textureCoordinates.push(new Nl(s,c,l,u)),i._guid=fy(),o}))},jQ.prototype.isDestroyed=function(){return!1},jQ.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),sc(this)};var NQ=jQ;const BQ=SQ.SHOW_INDEX,FQ=SQ.POSITION_INDEX,zQ=SQ.PIXEL_OFFSET_INDEX,kQ=SQ.EYE_OFFSET_INDEX,UQ=SQ.HORIZONTAL_ORIGIN_INDEX,VQ=SQ.VERTICAL_ORIGIN_INDEX,HQ=SQ.SCALE_INDEX,GQ=SQ.IMAGE_INDEX_INDEX,qQ=SQ.COLOR_INDEX,WQ=SQ.ROTATION_INDEX,YQ=SQ.ALIGNED_AXIS_INDEX,XQ=SQ.SCALE_BY_DISTANCE_INDEX,KQ=SQ.TRANSLUCENCY_BY_DISTANCE_INDEX,JQ=SQ.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,ZQ=SQ.DISTANCE_DISPLAY_CONDITION,$Q=SQ.DISABLE_DEPTH_DISTANCE,QQ=SQ.TEXTURE_COORDINATE_BOUNDS,e0=SQ.SDF_INDEX,t0=SQ.NUMBER_OF_PROPERTIES;let n0;const i0={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11},r0={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12};function o0(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(t0),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new At,this._baseVolumeWC=new At,this._baseVolume2D=new At,this._boundingVolume=new At,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=Me.clone(Me.IDENTITY),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=Object(c.a)(e.debugShowTextureAtlas,!1),this.blendOption=Object(c.a)(e.blendOption,IQ.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=AB.SCENE3D,this._buffersUsage=[KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW],this._highlightColor=sp.clone(sp.WHITE);const t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};const n=this._scene;Object(l.a)(n)&&Object(l.a)(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener((function(){const e=this._billboards,t=e.length;for(let n=0;n<t;++n)Object(l.a)(e[n])&&e[n]._updateClamping()}),this))}function a0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}function s0(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;const t=[],n=e._billboards,i=n.length;for(let e=0,r=0;e<i;++e){const i=n[e];Object(l.a)(i)&&(i._index=r++,t.push(i))}e._billboards=t}}let c0;function l0(e){let t=e.cache.billboardCollection_indexBufferBatched;if(Object(l.a)(t))return t;const n=new Uint16Array(98298);for(let e=0,t=0;e<98298;e+=6,t+=4)n[e]=t,n[e+1]=t+1,n[e+2]=t+2,n[e+3]=t+0,n[e+4]=t+2,n[e+5]=t+3;return t=ZN.createIndexBuffer({context:e,typedArray:n,usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function u0(e){let t=e.cache.billboardCollection_indexBufferInstanced;return Object(l.a)(t)||(t=ZN.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function h0(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return Object(l.a)(t)||(t=ZN.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:KN.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Object.defineProperties(o0.prototype,{length:{get:function(){return s0(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),o0.prototype.add=function(e){const t=new SQ(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},o0.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},o0.prototype.removeAll=function(){a0(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},o0.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},o0.prototype.contains=function(e){return Object(l.a)(e)&&e._billboardCollection===this},o0.prototype.get=function(e){return s.a.typeOf.number("index",e),s0(this),this._billboards[e]},o0.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<t0;++i){const r=0===n[i]?KN.STATIC_DRAW:KN.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};const d0=new Mh;function f0(e,t,n,i,r){let o;const a=i[n0.positionHighAndScale],s=i[n0.positionLowAndRotation],c=r._getActualPosition();e._mode===AB.SCENE3D&&(At.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),Mh.fromCartesian(c,d0);const l=r.scale,u=r.rotation;0!==u&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);const h=d0.high,d=d0.low;e._instanced?(o=r._index,a(o,h.x,h.y,h.z,l),s(o,d.x,d.y,d.z,u)):(o=4*r._index,a(o+0,h.x,h.y,h.z,l),a(o+1,h.x,h.y,h.z,l),a(o+2,h.x,h.y,h.z,l),a(o+3,h.x,h.y,h.z,l),s(o+0,d.x,d.y,d.z,u),s(o+1,d.x,d.y,d.z,u),s(o+2,d.x,d.y,d.z,u),s(o+3,d.x,d.y,d.z,u))}const p0=new Vt;function m0(e,t,n,i,r){let o;const a=i[n0.compressedAttribute0],s=r.pixelOffset,c=s.x,d=s.y,f=r._translate,p=f.x,m=f.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+p),Math.abs(-d+m));const g=r.horizontalOrigin;let _=r._verticalOrigin,y=r.show&&r.clusterShow;0===r.color.alpha&&(y=!1),_===YP.BASELINE&&(_=YP.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===WP.CENTER,e._allVerticalCenter=e._allVerticalCenter&&_===YP.CENTER;let b=0,v=0,O=0,w=0;const A=r._imageIndex;if(-1!==A){const e=n[A];if(!Object(l.a)(e))throw new u.a("Invalid billboard image index: "+A);b=e.x,v=e.y,O=e.width,w=e.height}const E=b+O,T=v+w;let C=128*Math.floor(h.a.clamp(c,-32768,32768)+32768);C+=32*(g+1),C+=8*(_+1),C+=4*(y?1:0);let x=256*Math.floor(h.a.clamp(d,-32768,32768)+32768),S=256*Math.floor(h.a.clamp(p,-32768,32768)+32768);const I=(h.a.clamp(m,-32768,32768)+32768)*(1/256),P=Math.floor(I);x+=P,S+=Math.floor(256*(I-P)),p0.x=b,p0.y=v;const D=js.compressTextureCoordinates(p0);p0.x=E;const R=js.compressTextureCoordinates(p0);p0.y=T;const j=js.compressTextureCoordinates(p0);p0.x=b;const M=js.compressTextureCoordinates(p0);e._instanced?(o=r._index,a(o,C,x,S,D)):(o=4*r._index,a(o+0,C+0,x,S,D),a(o+1,C+2,x,S,R),a(o+2,C+3,x,S,j),a(o+3,C+1,x,S,M))}function g0(e,t,n,i,r){let o;const a=i[n0.compressedAttribute1],s=r.alignedAxis;O.equals(s,O.ZERO)||(e._shaderAlignedAxis=!0);let d=0,f=1,p=1,m=1;const g=r.translucencyByDistance;Object(l.a)(g)&&(d=g.near,f=g.nearValue,p=g.far,m=g.farValue,1===f&&1===m||(e._shaderTranslucencyByDistance=!0));let _=0;const y=r._imageIndex;if(-1!==y){const e=n[y];if(!Object(l.a)(e))throw new u.a("Invalid billboard image index: "+y);_=e.width}const b=e._textureAtlas.texture.width,v=Math.round(Object(c.a)(r.width,b*_));e._maxSize=Math.max(e._maxSize,v);let w=h.a.clamp(v,0,65536),A=0;Math.abs(O.magnitudeSquared(s)-1)<h.a.EPSILON6&&(A=js.octEncodeFloat(s)),f=h.a.clamp(f,0,1),f=1===f?255:255*f|0,w=256*w+f,m=h.a.clamp(m,0,1),m=1===m?255:255*m|0,A=256*A+m,e._instanced?(o=r._index,a(o,w,A,d,p)):(o=4*r._index,a(o+0,w,A,d,p),a(o+1,w,A,d,p),a(o+2,w,A,d,p),a(o+3,w,A,d,p))}function _0(e,t,n,i,r){let o;const a=i[n0.compressedAttribute2],s=r.color,d=Object(l.a)(e._batchTable)?sp.WHITE:r.getPickId(t.context).color,f=r.sizeInMeters?1:0,p=Math.abs(O.magnitudeSquared(r.alignedAxis)-1)<h.a.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===f;let m=0;const g=r._imageIndex;if(-1!==g){const e=n[g];if(!Object(l.a)(e))throw new u.a("Invalid billboard image index: "+g);m=e.height}const _=e._textureAtlas.texture.dimensions,y=Math.round(Object(c.a)(r.height,_.y*m));e._maxSize=Math.max(e._maxSize,y);let b=Object(c.a)(r._labelHorizontalOrigin,-2);b+=2;const v=4*y+b;let w=sp.floatToByte(s.red),A=sp.floatToByte(s.green),E=sp.floatToByte(s.blue);const T=65536*w+256*A+E;w=sp.floatToByte(d.red),A=sp.floatToByte(d.green),E=sp.floatToByte(d.blue);const C=65536*w+256*A+E;let x=65536*sp.floatToByte(s.alpha)+256*sp.floatToByte(d.alpha);x+=2*f+p,e._instanced?(o=r._index,a(o,T,C,x,v)):(o=4*r._index,a(o+0,T,C,x,v),a(o+1,T,C,x,v),a(o+2,T,C,x,v),a(o+3,T,C,x,v))}function y0(e,t,n,i,r){let o;const a=i[n0.eyeOffset],s=r.eyeOffset;let c=s.z;if(r._heightReference!==qP.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(c)),e._instanced){let e=0,t=0;const i=r._imageIndex;if(-1!==i){const r=n[i];if(!Object(l.a)(r))throw new u.a("Invalid billboard image index: "+i);e=r.width,t=r.height}p0.x=e,p0.y=t;const h=js.compressTextureCoordinates(p0);o=r._index,a(o,s.x,s.y,c,h)}else o=4*r._index,a(o+0,s.x,s.y,c,0),a(o+1,s.x,s.y,c,0),a(o+2,s.x,s.y,c,0),a(o+3,s.x,s.y,c,0)}function b0(e,t,n,i,r){let o;const a=i[n0.scaleByDistance];let s=0,c=1,u=1,h=1;const d=r.scaleByDistance;Object(l.a)(d)&&(s=d.near,c=d.nearValue,u=d.far,h=d.farValue,1===c&&1===h||(e._shaderScaleByDistance=!0)),e._instanced?(o=r._index,a(o,s,c,u,h)):(o=4*r._index,a(o+0,s,c,u,h),a(o+1,s,c,u,h),a(o+2,s,c,u,h),a(o+3,s,c,u,h))}function v0(e,t,n,i,r){let o;const a=i[n0.pixelOffsetScaleByDistance];let s=0,c=1,u=1,h=1;const d=r.pixelOffsetScaleByDistance;Object(l.a)(d)&&(s=d.near,c=d.nearValue,u=d.far,h=d.farValue,1===c&&1===h||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=r._index,a(o,s,c,u,h)):(o=4*r._index,a(o+0,s,c,u,h),a(o+1,s,c,u,h),a(o+2,s,c,u,h),a(o+3,s,c,u,h))}function O0(e,t,n,i,r){let o;const a=i[n0.compressedAttribute3];let s=0,d=Number.MAX_VALUE;const f=r.distanceDisplayCondition;Object(l.a)(f)&&(s=f.near,d=f.far,s*=s,d*=d,e._shaderDistanceDisplayCondition=!0);let p=r.disableDepthTestDistance;const m=r.heightReference===qP.CLAMP_TO_GROUND&&t.context.depthTexture;let g,_;if(Object(l.a)(p)||(p=m?5e3:0),p*=p,(m||p>0)&&(e._shaderDisableDepthDistance=!0,p===Number.POSITIVE_INFINITY&&(p=-1)),Object(l.a)(r._labelDimensions))_=r._labelDimensions.x,g=r._labelDimensions.y;else{let t=0,i=0;const o=r._imageIndex;if(-1!==o){const e=n[o];if(!Object(l.a)(e))throw new u.a("Invalid billboard image index: "+o);t=e.height,i=e.width}g=Math.round(Object(c.a)(r.height,e._textureAtlas.texture.dimensions.y*t));const a=e._textureAtlas.texture.width;_=Math.round(Object(c.a)(r.width,a*i))}const y=4096*Math.floor(h.a.clamp(_,0,4096))+Math.floor(h.a.clamp(g,0,4096));e._instanced?(o=r._index,a(o,s,d,p,y)):(o=4*r._index,a(o+0,s,d,p,y),a(o+1,s,d,p,y),a(o+2,s,d,p,y),a(o+3,s,d,p,y))}function w0(e,t,n,i,r){if(r.heightReference===qP.CLAMP_TO_GROUND){const n=e._scene,i=t.context,r=t.globeTranslucencyState.translucent,o=Object(l.a)(n.globe)&&n.globe.depthTestAgainstTerrain;e._shaderClampToGround=i.depthTexture&&!r&&o}let o;const a=i[n0.textureCoordinateBoundsOrLabelTranslate];if(MD.maximumVertexTextureImageUnits>0){let t=0,n=0;return Object(l.a)(r._labelTranslate)&&(t=r._labelTranslate.x,n=r._labelTranslate.y),void(e._instanced?(o=r._index,a(o,t,n,0,0)):(o=4*r._index,a(o+0,t,n,0,0),a(o+1,t,n,0,0),a(o+2,t,n,0,0),a(o+3,t,n,0,0)))}let s=0,c=0,h=0,d=0;const f=r._imageIndex;if(-1!==f){const e=n[f];if(!Object(l.a)(e))throw new u.a("Invalid billboard image index: "+f);s=e.x,c=e.y,h=e.width,d=e.height}const p=s+h,m=c+d;e._instanced?(o=r._index,a(o,s,c,p,m)):(o=4*r._index,a(o+0,s,c,p,m),a(o+1,s,c,p,m),a(o+2,s,c,p,m),a(o+3,s,c,p,m))}function A0(e,t,n,i,r){if(!e._sdf)return;let o;const a=i[n0.sdf],s=r.outlineColor,c=r.outlineWidth,l=65536*sp.floatToByte(s.red)+256*sp.floatToByte(s.green)+sp.floatToByte(s.blue),u=c/PQ.RADIUS,h=65536*sp.floatToByte(s.alpha)+256*sp.floatToByte(u);e._instanced?(o=r._index,a(o,l,h)):(o=4*r._index,a(o+0,l+0,h),a(o+1,l+2,h),a(o+2,l+3,h),a(o+3,l+1,h))}function E0(e,t,n,i,r){f0(e,0,0,i,r),m0(e,0,n,i,r),g0(e,0,n,i,r),_0(e,t,n,i,r),y0(e,0,n,i,r),b0(e,0,0,i,r),v0(e,0,0,i,r),O0(e,t,n,i,r),w0(e,t,n,i,r),function(e,t,n,i,r){if(!Object(l.a)(e._batchTable))return;const o=i[n0.a_batchId],a=r._batchIndex;let s;e._instanced?(s=r._index,o(s,a)):(s=4*r._index,o(s+0,a),o(s+1,a),o(s+2,a),o(s+3,a))}(e,0,0,i,r),A0(e,0,0,i,r)}function T0(e,t,n,i,r,o){let a;i.mode===AB.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const s=[];for(let e=0;e<n;++e){const n=t[e],c=n.position,u=SQ._computeActualPosition(n,c,i,r);Object(l.a)(u)&&(n._setActualPosition(u),o?s.push(u):At.expand(a,u,a))}o&&At.fromPoints(s,a)}const C0=[];o0.prototype.update=function(e){if(s0(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,n0=this._instanced?r0:i0,c0=this._instanced?u0:l0;let r=this._textureAtlas;if(!Object(l.a)(r)){r=this._textureAtlas=new NQ({context:i});for(let e=0;e<n;++e)t[e]._loadImage()}const o=r.textureCoordinates;if(0===o.length)return;!function(e,t){const n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==AB.SCENE3D&&!Me.equals(o,e.modelMatrix)?(e._mode=n,Me.clone(e.modelMatrix,o),e._createVertexArray=!0,n!==AB.SCENE3D&&n!==AB.SCENE2D&&n!==AB.COLUMBUS_VIEW||T0(e,i,i.length,t,o,!0)):n===AB.MORPHING?T0(e,i,i.length,t,o,!0):n!==AB.SCENE2D&&n!==AB.COLUMBUS_VIEW||T0(e,r,e._billboardsToUpdateIndex,t,o,!1)}(this,e),t=this._billboards,n=t.length;const a=this._billboardsToUpdate,s=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,h=this._createVertexArray||this._textureAtlasGUID!==u;let d;this._textureAtlasGUID=u;const f=e.passes,p=f.pick;if(h||!p&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let e=0;e<t0;++e)c[e]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=function(e,t,n,i,r,o){const a=[{index:n0.positionHighAndScale,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[FQ]},{index:n0.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[FQ]},{index:n0.compressedAttribute0,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[zQ]},{index:n0.compressedAttribute1,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[KQ]},{index:n0.compressedAttribute2,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[qQ]},{index:n0.eyeOffset,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[kQ]},{index:n0.scaleByDistance,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[XQ]},{index:n0.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[JQ]},{index:n0.compressedAttribute3,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[ZQ]},{index:n0.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[QQ]}];return i&&a.push({index:n0.direction,componentsPerAttribute:2,componentDatatype:gs.FLOAT,vertexBuffer:h0(e)}),Object(l.a)(r)&&a.push({index:n0.a_batchId,componentsPerAttribute:1,componentDatatype:gs.FLOAT,bufferUsage:KN.STATIC_DRAW}),o&&a.push({index:n0.sdf,componentsPerAttribute:2,componentDatatype:gs.FLOAT,usage:n[e0]}),new L$(e,a,i?t:4*t,i)}(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),d=this._vaf.writers;for(let t=0;t<n;++t){const n=this._billboards[t];n._dirty=!1,E0(this,e,o,d,n)}this._vaf.commit(c0(i))}this._billboardsToUpdateIndex=0}else if(s>0){const t=C0;t.length=0,(c[FQ]||c[WQ]||c[HQ])&&t.push(f0),(c[GQ]||c[zQ]||c[UQ]||c[VQ]||c[BQ])&&(t.push(m0),this._instanced&&t.push(y0)),(c[GQ]||c[YQ]||c[KQ])&&(t.push(g0),t.push(_0)),(c[GQ]||c[qQ])&&t.push(_0),c[kQ]&&t.push(y0),c[XQ]&&t.push(b0),c[JQ]&&t.push(v0),(c[ZQ]||c[$Q]||c[GQ]||c[FQ])&&t.push(O0),(c[GQ]||c[FQ])&&t.push(w0),c[e0]&&t.push(A0);const r=t.length;if(d=this._vaf.writers,s/n>.1){for(let n=0;n<s;++n){const i=a[n];i._dirty=!1;for(let n=0;n<r;++n)t[n](this,e,o,d,i)}this._vaf.commit(c0(i))}else{for(let n=0;n<s;++n){const i=a[n];i._dirty=!1;for(let n=0;n<r;++n)t[n](this,e,o,d,i);this._instanced?this._vaf.subCommit(i._index,1):this._vaf.subCommit(4*i._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(s>1.5*n&&(a.length=n),!Object(l.a)(this._vaf)||!Object(l.a)(this._vaf.va))return;let m;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,At.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let g=Me.IDENTITY;e.mode===AB.SCENE3D?(g=this.modelMatrix,m=At.clone(this._baseVolumeWC,this._boundingVolume)):m=At.clone(this._baseVolume2D,this._boundingVolume),function(e,t,n){let i=1;e._allSizedInMeters&&0===e._maxPixelOffset||(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);const o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}(this,e,m);const _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===IQ.OPAQUE||this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=vj.fromCache({depthTest:{enabled:!0,func:ps.LESS},depthMask:!0}):this._rsOpaque=void 0;const e=this._blendOption===IQ.TRANSLUCENT;this._blendOption===IQ.TRANSLUCENT||this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=vj.fromCache({depthTest:{enabled:!0,func:e?ps.LEQUAL:ps.LESS},depthMask:e,blending:SD.ALPHA_BLEND}):this._rsTranslucent=void 0}let y,b,v,O,w;this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;const A=MD.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){y=B$,b=N$,w=[],Object(l.a)(this._batchTable)&&(w.push("VECTOR_TILE"),y=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(y),b=this._batchTable.getFragmentShaderCallback(!1,void 0)(b)),v=new UN({defines:w,sources:[y]}),this._instanced&&v.defines.push("INSTANCED"),this._shaderRotation&&v.defines.push("ROTATION"),this._shaderAlignedAxis&&v.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&v.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&v.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&v.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&v.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&v.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(A?v.defines.push("VERTEX_DEPTH_CHECK"):v.defines.push("FRAGMENT_DEPTH_CHECK"));const e=1-PQ.CUTOFF;this._sdf&&v.defines.push("SDF");const t=Object(l.a)(this._batchTable)?"VECTOR_TILE":"";this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT&&(O=new UN({defines:["OPAQUE",t],sources:[b]}),this._shaderClampToGround&&(A?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push("SDF_EDGE "+e)),this._sp=oM.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:O,attributeLocations:n0}),O=new UN({defines:["TRANSLUCENT",t],sources:[b]}),this._shaderClampToGround&&(A?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push("SDF_EDGE "+e)),this._spTranslucent=oM.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:v,fragmentShaderSource:O,attributeLocations:n0})),this._blendOption===IQ.OPAQUE&&(O=new UN({defines:[t],sources:[b]}),this._shaderClampToGround&&(A?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push("SDF_EDGE "+e)),this._sp=oM.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:O,attributeLocations:n0})),this._blendOption===IQ.TRANSLUCENT&&(O=new UN({defines:[t],sources:[b]}),this._shaderClampToGround&&(A?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(O.defines.push("SDF"),O.defines.push("SDF_EDGE "+e)),this._spTranslucent=oM.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:v,fragmentShaderSource:O,attributeLocations:n0})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}const E=e.commandList;if(f.render||f.pick){const t=this._colorCommands,i=this._blendOption===IQ.OPAQUE,r=this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT,o=this._vaf.va,a=o.length;let s,c=this._uniforms;Object(l.a)(this._batchTable)?(c=this._batchTable.getUniformMapCallback()(c),s=this._batchTable.getPickId()):s="v_pickColor",t.length=a;const u=r?2*a:a;for(let e=0;e<u;++e){let a=t[e];Object(l.a)(a)||(a=t[e]=new XR);const u=i||r&&e%2==0;a.pass=u||!r?KR.OPAQUE:KR.TRANSLUCENT,a.owner=this;const h=r?Math.floor(e/2):e;a.boundingVolume=m,a.modelMatrix=g,a.count=o[h].indicesCount,a.shaderProgram=u?this._sp:this._spTranslucent,a.uniformMap=c,a.vertexArray=o[h].va,a.renderState=u?this._rsOpaque:this._rsTranslucent,a.debugShowBoundingVolume=this.debugShowBoundingVolume,a.pickId=s,this._instanced&&(a.count=6,a.instanceCount=n),E.push(a)}this.debugShowTextureAtlas&&(Object(l.a)(this.debugCommand)||(this.debugCommand=function(e,t){const n=t.createViewportQuadCommand("uniform sampler2D billboard_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n    gl_FragColor = texture2D(billboard_texture, v_textureCoordinates); \n} \n",{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return n.pass=KR.OVERLAY,n}(this,e.context)),E.push(this.debugCommand))}},o0.prototype.isDestroyed=function(){return!1},o0.prototype.destroy=function(){return Object(l.a)(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),a0(this._billboards),sc(this)};var x0=o0;var S0=function(e,t,n,i,r){return function(){const o=document.createElement("canvas"),a=r+2*i;o.height=o.width=a;const s=o.getContext("2d");return s.clearRect(0,0,a,a),0!==i&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=n,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,r/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,r/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}};function I0(e,t,n,i,r){this._content=e,this._billboard=n,this._label=i,this._polyline=r,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),D0(this)}const P0=new R;function D0(e){const t=e._billboard;if(Object(l.a)(e._billboardImage)&&e._billboardImage!==t.image)return void(t.image=e._billboardImage);if(Object(l.a)(e._billboardImage))return;const n=Object(c.a)(e._color,I0.defaultColor),i=Object(c.a)(e._pointOutlineColor,I0.defaultPointOutlineColor),r=Object(c.a)(e._pointOutlineWidth,I0.defaultPointOutlineWidth),o=Object(c.a)(e._pointSize,I0.defaultPointSize),a=e._billboardColor,s=e._billboardOutlineColor,u=e._billboardOutlineWidth,h=e._billboardSize;if(sp.equals(n,a)&&sp.equals(i,s)&&r===u&&o===h)return;e._billboardColor=sp.clone(n,e._billboardColor),e._billboardOutlineColor=sp.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;const d=n.alpha,f=n.toCssColorString(),p=i.toCssColorString(),m=JSON.stringify([f,o,p,r]);t.setImage(m,S0(d,f,p,r,o))}Object.defineProperties(I0.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=sp.clone(e,this._color),D0(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,D0(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=sp.clone(e,this._pointOutlineColor),D0(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,D0(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){Object(l.a)(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){const t=Object(c.a)(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,P0);i.height=i.height-t+e;const r=n.cartographicToCartesian(i);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=sp.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){const t=this._billboardImage!==e;this._billboardImage=e,t&&D0(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){const e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}}),I0.defaultColor=sp.WHITE,I0.defaultPointOutlineColor=sp.BLACK,I0.defaultPointOutlineWidth=0,I0.defaultPointSize=8,I0.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},I0.prototype.getPropertyNames=function(e){return ll("Cesium3DTilePointFeature.getPropertyNames","Cesium3DTilePointFeature.getPropertyNames is deprecated in CesiumJS 1.95, and will be removed in 1.98. Use Cesium3DTilePointFeature.getPropertyIds instead"),this._content.batchTable.getPropertyIds(this._batchId,e)},I0.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)},I0.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},I0.prototype.getPropertyInherited=function(e){return jV.getPropertyInherited(this._content,this._batchId,e)},I0.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},I0.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},I0.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},I0.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var R0=I0,j0=n(77),M0=n.n(j0);var L0=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2});const N0={};let B0=0;const F0=new sp(.165,.165,.165,.8),z0=new Vt(7,5),k0=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function U0(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function V0(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function H0(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function G0(e){let t=N0[e._font];if(!Object(l.a)(t)){const n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(H0(n,"line-height"));isNaN(i)&&(i=void 0),t={family:H0(n,"font-family"),size:H0(n,"font-size").replace("px",""),style:H0(n,"font-style"),weight:H0(n,"font-weight"),lineHeight:i},document.body.removeChild(n),B0<256&&(N0[e._font]=t,B0++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function q0(e,t){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),Object(l.a)(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new u.a("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;if(Object(l.a)(n)){if(n.far<=n.near)throw new u.a("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=TE.clone(n)}if(Object(l.a)(i)){if(i.far<=i.near)throw new u.a("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=TE.clone(i)}if(Object(l.a)(r)){if(r.far<=r.near)throw new u.a("scaleByDistance.far must be greater than scaleByDistance.near.");r=TE.clone(r)}if(Object(l.a)(o)){if(o.far<=o.near)throw new u.a("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=eb.clone(o)}this._renderedText=void 0,this._text=void 0,this._show=Object(c.a)(e.show,!0),this._font=Object(c.a)(e.font,"30px sans-serif"),this._fillColor=sp.clone(Object(c.a)(e.fillColor,sp.WHITE)),this._outlineColor=sp.clone(Object(c.a)(e.outlineColor,sp.BLACK)),this._outlineWidth=Object(c.a)(e.outlineWidth,1),this._showBackground=Object(c.a)(e.showBackground,!1),this._backgroundColor=sp.clone(Object(c.a)(e.backgroundColor,F0)),this._backgroundPadding=Vt.clone(Object(c.a)(e.backgroundPadding,z0)),this._style=Object(c.a)(e.style,L0.FILL),this._verticalOrigin=Object(c.a)(e.verticalOrigin,YP.BASELINE),this._horizontalOrigin=Object(c.a)(e.horizontalOrigin,WP.LEFT),this._pixelOffset=Vt.clone(Object(c.a)(e.pixelOffset,Vt.ZERO)),this._eyeOffset=O.clone(Object(c.a)(e.eyeOffset,O.ZERO)),this._position=O.clone(Object(c.a)(e.position,O.ZERO)),this._scale=Object(c.a)(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=Object(c.a)(e.heightReference,qP.NONE),this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=Object(c.a)(e.text,""),this._relativeSize=1,G0(this),this._updateClamping()}function W0(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[];let o="",a=k0.LTR,s="";const c=e.length;for(let l=0;l<c;++l){const c=e.charAt(l);s=t.test(c)?k0.RTL:n.test(c)?k0.LTR:i.test(c)?k0.BRACKETS:k0.WEAK,0===l&&(a=s),a===s&&s!==k0.BRACKETS?o+=c:(""!==o&&r.push({Type:a,Word:o}),a=s,o=c)}return r.push({Type:s,Word:o}),r}function Y0(e,t,n){return e.slice(0,t)+n+e.slice(t)}function X0(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}Object.defineProperties(q0.prototype,{show:{get:function(){return this._show},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(this._show!==e){this._show=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n].billboard;Object(l.a)(i)&&(i.show=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._position;if(!O.equals(t,e)){O.clone(e,t);const n=this._glyphs;for(let t=0,i=n.length;t<i;t++){const i=n[t].billboard;Object(l.a)(i)&&(i.position=e)}const i=this._backgroundBillboard;Object(l.a)(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(e!==this._heightReference){this._heightReference=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n].billboard;Object(l.a)(i)&&(i.heightReference=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.heightReference=e),V0(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(this._text!==e){this._text=e;const t=e.replace(/\u00ad/g,"");this._renderedText=q0.enableRightToLeftDetection?function(e){const t=e.split("\n");let n="";for(let e=0;e<t.length;e++){const i=t[e],r=K0.test(i.charAt(0)),o=W0(i,K0);let a=0,s="";for(let e=0;e<o.length;++e){const t=o[e],n=t.Type===k0.BRACKETS?X0(t.Word):t.Word.split("").reverse().join("");r?t.Type===k0.RTL?(s=n+s,a=0):t.Type===k0.LTR?(s=Y0(s,a,t.Word),a+=t.Word.length):t.Type!==k0.WEAK&&t.Type!==k0.BRACKETS||(t.Type===k0.WEAK&&o[e-1].Type===k0.BRACKETS?s=n+s:o[e-1].Type===k0.RTL?(s=n+s,a=0):o.length>e+1?o[e+1].Type===k0.RTL?(s=n+s,a=0):(s=Y0(s,a,t.Word),a+=t.Word.length):s=Y0(s,0,n)):t.Type===k0.RTL?s=Y0(s,a,n):t.Type===k0.LTR?(s+=t.Word,a=s.length):t.Type!==k0.WEAK&&t.Type!==k0.BRACKETS||(e>0&&o[e-1].Type===k0.RTL?o.length>e+1?o[e+1].Type===k0.RTL?s=Y0(s,a,n):(s+=t.Word,a=s.length):s+=t.Word:(s+=t.Word,a=s.length))}n+=s,e<t.length-1&&(n+="\n")}return n}(t):t,U0(this)}}},font:{get:function(){return this._font},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._font!==e&&(this._font=e,U0(this),G0(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._fillColor;sp.equals(t,e)||(sp.clone(e,t),U0(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._outlineColor;sp.equals(t,e)||(sp.clone(e,t),U0(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,U0(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._showBackground!==e&&(this._showBackground=e,U0(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._backgroundColor;if(!sp.equals(t,e)){sp.clone(e,t);const n=this._backgroundBillboard;Object(l.a)(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._backgroundPadding;Vt.equals(t,e)||(Vt.clone(e,t),V0(this))}},style:{get:function(){return this._style},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._style!==e&&(this._style=e,U0(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._pixelOffset;if(!Vt.equals(t,e)){Vt.clone(e,t);const n=this._glyphs;for(let t=0,i=n.length;t<i;t++){const i=n[t];Object(l.a)(i.billboard)&&(i.billboard.pixelOffset=e)}const i=this._backgroundBillboard;Object(l.a)(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far distance must be greater than near distance.");const t=this._translucencyByDistance;if(!TE.equals(t,e)){this._translucencyByDistance=TE.clone(e,t);const n=this._glyphs;for(let t=0,i=n.length;t<i;t++){const i=n[t];Object(l.a)(i.billboard)&&(i.billboard.translucencyByDistance=e)}const i=this._backgroundBillboard;Object(l.a)(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;if(!TE.equals(t,e)){this._pixelOffsetScaleByDistance=TE.clone(e,t);const n=this._glyphs;for(let t=0,i=n.length;t<i;t++){const i=n[t];Object(l.a)(i.billboard)&&(i.billboard.pixelOffsetScaleByDistance=e)}const i=this._backgroundBillboard;Object(l.a)(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far distance must be greater than near distance.");const t=this._scaleByDistance;if(!TE.equals(t,e)){this._scaleByDistance=TE.clone(e,t);const n=this._glyphs;for(let t=0,i=n.length;t<i;t++){const i=n[t];Object(l.a)(i.billboard)&&(i.billboard.scaleByDistance=e)}const i=this._backgroundBillboard;Object(l.a)(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._eyeOffset;if(!O.equals(t,e)){O.clone(e,t);const n=this._glyphs;for(let t=0,i=n.length;t<i;t++){const i=n[t];Object(l.a)(i.billboard)&&(i.billboard.eyeOffset=e)}const i=this._backgroundBillboard;Object(l.a)(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,V0(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard.verticalOrigin=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.verticalOrigin=e),V0(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(this._scale!==e){this._scale=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard.scale=e*this._relativeSize)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.scale=e*this._relativeSize),V0(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far must be greater than near");if(!eb.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=eb.clone(e,this._distanceDisplayCondition);const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard.distanceDisplayCondition=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(Object(l.a)(e)&&e<0)throw new u.a("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard.disableDepthTestDistance=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard.id=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.id=e)}}},pickId:{get:function(){if(0!==this._glyphs.length&&Object(l.a)(this._glyphs[0].billboard))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=O.clone(e,this._actualClampedPosition);const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard._clampedPosition=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;const t=this._glyphs;for(let n=0,i=t.length;n<i;n++){const i=t[n];Object(l.a)(i.billboard)&&(i.billboard.clusterShow=e)}const n=this._backgroundBillboard;Object(l.a)(n)&&(n.clusterShow=e)}}}}),q0.prototype._updateClamping=function(){SQ._updateClamping(this._labelCollection,this)},q0.prototype.computeScreenSpacePosition=function(e,t){if(!Object(l.a)(e))throw new u.a("scene is required.");Object(l.a)(t)||(t=new Vt);const n=this._labelCollection.modelMatrix,i=Object(l.a)(this._actualClampedPosition)?this._actualClampedPosition:this._position;return SQ._computeScreenSpacePosition(n,i,this._eyeOffset,this._pixelOffset,e,t)},q0.getScreenSpaceBoundingBox=function(e,t,n){let i=0,r=0,o=0,a=0;const s=e.totalScale,c=e._backgroundBillboard;if(Object(l.a)(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*s,a=c.height*s,e.verticalOrigin===YP.BOTTOM||e.verticalOrigin===YP.BASELINE?r-=a:e.verticalOrigin===YP.CENTER&&(r-=.5*a);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let n=0,c=0;const u=e._glyphs,h=u.length;for(let o=0;o<h;++o){const a=u[o],h=a.billboard;if(!Object(l.a)(h))continue;const d=t.x+h._translate.x;let f=t.y-h._translate.y;const p=a.dimensions.width*s,m=a.dimensions.height*s;e.verticalOrigin===YP.BOTTOM||e.verticalOrigin===YP.BASELINE?f-=m:e.verticalOrigin===YP.CENTER&&(f-=.5*m),e._verticalOrigin===YP.TOP?f+=PQ.PADDING*s:e._verticalOrigin!==YP.BOTTOM&&e._verticalOrigin!==YP.BASELINE||(f-=PQ.PADDING*s),i=Math.min(i,d),r=Math.min(r,f),n=Math.max(n,d+p),c=Math.max(c,f+m)}o=n-i,a=c-r}return Object(l.a)(n)||(n=new Nl),n.x=i,n.y=r,n.width=o,n.height=a,n},q0.prototype.equals=function(e){return this===e||Object(l.a)(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&O.equals(this._position,e._position)&&sp.equals(this._fillColor,e._fillColor)&&sp.equals(this._outlineColor,e._outlineColor)&&sp.equals(this._backgroundColor,e._backgroundColor)&&Vt.equals(this._backgroundPadding,e._backgroundPadding)&&Vt.equals(this._pixelOffset,e._pixelOffset)&&O.equals(this._eyeOffset,e._eyeOffset)&&TE.equals(this._translucencyByDistance,e._translucencyByDistance)&&TE.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&TE.equals(this._scaleByDistance,e._scaleByDistance)&&eb.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},q0.prototype.isDestroyed=function(){return!1},q0.enableRightToLeftDetection=!1;const K0=new RegExp("[א-ת؀-ۿݐ-ݿࢠ-ࣿ]");var J0=q0,Z0=n(78),$0=n.n(Z0);function Q0(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function e1(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const t1=new Vt(4,4),n1=new Nl(1,1,1,1);const i1={};function r1(e,t,n,i,r,o,a){return i1.font=t,i1.fillColor=n,i1.strokeColor=i,i1.strokeWidth=r,i1.padding=PQ.PADDING,a===YP.CENTER?i1.textBaseline="middle":a===YP.TOP?i1.textBaseline="top":i1.textBaseline="bottom",i1.fill=o===L0.FILL||o===L0.FILL_AND_OUTLINE,i1.stroke=o===L0.OUTLINE||o===L0.FILL_AND_OUTLINE,i1.backgroundColor=sp.BLACK,JE(e,i1)}function o1(e,t){t.textureInfo=void 0,t.dimensions=void 0;const n=t.billboard;Object(l.a)(n)&&(n.show=!1,n.image=void 0,Object(l.a)(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function a1(e,t,n,i){i.index=e.addImageSync(t,n)}const s1=new $0.a;function c1(e,t){const n=t._renderedText,i=s1.splitGraphemes(n),r=i.length,o=t._glyphs,a=o.length;let s,c,u;if(t._relativeSize=t._fontSize/PQ.FONT_SIZE,r<a)for(c=r;c<a;++c)o1(e,o[c]);o.length=r;const h=t._showBackground&&n.split("\n").join("").length>0;let d=t._backgroundBillboard;const f=e._backgroundBillboardCollection;h?(Object(l.a)(d)||(d=f.add({collection:e,image:"ID_WHITE_PIXEL",imageSubRegion:n1}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=WP.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t.totalScale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):Object(l.a)(d)&&(f.remove(d),t._backgroundBillboard=d=void 0);const p=e._glyphTextureCache;for(u=0;u<r;++u){const n=i[u],r=t._verticalOrigin,a=JSON.stringify([n,t._fontFamily,t._fontStyle,t._fontWeight,+r]);let c=p[a];if(!Object(l.a)(c)){const i=r1(n,`${t._fontStyle} ${t._fontWeight} ${PQ.FONT_SIZE}px ${t._fontFamily}`,sp.WHITE,sp.WHITE,0,L0.FILL,r);if(c=new e1(e,-1,i.dimensions),p[a]=c,i.width>0&&i.height>0){const t=M0()(i,{cutoff:PQ.CUTOFF,radius:PQ.RADIUS}),r=i.getContext("2d"),o=i.width,s=i.height,l=r.getImageData(0,0,o,s);for(let e=0;e<o;e++)for(let n=0;n<s;n++){const i=n*o+e,r=255*t[i],a=4*i;l.data[a+0]=r,l.data[a+1]=r,l.data[a+2]=r,l.data[a+3]=r}r.putImageData(l,0,0)," "!==n&&a1(e._textureAtlas,a,i,c)}}if(s=o[u],Object(l.a)(s)?-1===c.index?o1(e,s):Object(l.a)(s.textureInfo)&&(s.textureInfo=void 0):(s=new Q0,o[u]=s),s.textureInfo=c,s.dimensions=c.dimensions,-1!==c.index){let n=s.billboard;const i=e._spareBillboards;Object(l.a)(n)||(i.length>0?n=i.pop():(n=e._billboardCollection.add({collection:e}),n._labelDimensions=new Vt,n._labelTranslate=new Vt),s.billboard=n),n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=WP.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.image=a,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n._batchIndex=t._batchIndex,n.outlineColor=t.outlineColor,t.style===L0.FILL_AND_OUTLINE?(n.color=t._fillColor,n.outlineWidth=t.outlineWidth):t.style===L0.FILL?(n.color=t._fillColor,n.outlineWidth=0):t.style===L0.OUTLINE&&(n.color=sp.TRANSPARENT,n.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function l1(e,t,n){return t===WP.CENTER?-e/2:t===WP.RIGHT?-(e+n.x):n.x}const u1=new Vt,h1=new Vt;function d1(e){const t=e._glyphs,n=e._renderedText;let i,r,o=0,a=0;const s=[];let c,u=Number.NEGATIVE_INFINITY,h=0,d=1;const f=t.length,p=e._backgroundBillboard,m=Vt.clone(Object(l.a)(p)?e._backgroundPadding:Vt.ZERO,h1);for(m.x/=e._relativeSize,m.y/=e._relativeSize,c=0;c<f;++c)"\n"===n.charAt(c)?(s.push(o),++d,o=0):(i=t[c],r=i.dimensions,h=Math.max(h,r.height-r.descent),u=Math.max(u,r.descent),o+=r.width-r.minx,c<f-1&&(o+=t[c+1].dimensions.minx),a=Math.max(a,o));s.push(o);const g=h+u,_=e.totalScale,y=e._horizontalOrigin,b=e._verticalOrigin;let v=0,O=s[v],w=l1(O,y,m);const A=(Object(l.a)(e._lineHeight)?e._lineHeight:1.2*e._fontSize)/e._relativeSize,E=A*(d-1);let T=a,C=g+E;Object(l.a)(p)&&(T+=2*m.x,C+=2*m.y,p._labelHorizontalOrigin=y),u1.x=w*_,u1.y=0;let x=!0,S=0;for(c=0;c<f;++c)if("\n"===n.charAt(c))++v,S+=A,O=s[v],w=l1(O,y,m),u1.x=w*_,x=!0;else if(i=t[c],r=i.dimensions,b===YP.TOP?(u1.y=r.height-h-m.y,u1.y+=PQ.PADDING):b===YP.CENTER?u1.y=(E+r.height-h)/2:b===YP.BASELINE?(u1.y=E,u1.y-=PQ.PADDING):(u1.y=E+u+m.y,u1.y-=PQ.PADDING),u1.y=(u1.y-r.descent-S)*_,x&&(u1.x-=PQ.PADDING*_,x=!1),Object(l.a)(i.billboard)&&(i.billboard._setTranslate(u1),i.billboard._labelDimensions.x=T,i.billboard._labelDimensions.y=C,i.billboard._labelHorizontalOrigin=y),c<f-1){const e=t[c+1];u1.x+=(r.width-r.minx+e.dimensions.minx)*_}if(Object(l.a)(p)&&n.split("\n").join("").length>0&&(w=y===WP.CENTER?-a/2-m.x:y===WP.RIGHT?-(a+2*m.x):0,u1.x=w*_,b===YP.TOP?u1.y=g-h-u:b===YP.CENTER?u1.y=(g-h)/2-u:b===YP.BASELINE?u1.y=-m.y-u:u1.y=0,u1.y=u1.y*_,p.width=T,p.height=C,p._setTranslate(u1),p._labelTranslate=Vt.clone(u1,p._labelTranslate)),e.heightReference===qP.CLAMP_TO_GROUND)for(c=0;c<f;++c){i=t[c];const e=i.billboard;Object(l.a)(e)&&(e._labelTranslate=Vt.clone(u1,e._labelTranslate))}}function f1(e,t){const n=t._glyphs;for(let t=0,i=n.length;t<i;++t)o1(e,n[t]);Object(l.a)(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,Object(l.a)(t._removeCallbackFunc)&&t._removeCallbackFunc(),sc(t)}function p1(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new x0({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new x0({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=sp.clone(sp.WHITE),this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.blendOption=Object(c.a)(e.blendOption,IQ.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(p1.prototype,{length:{get:function(){return this._labels.length}}}),p1.prototype.add=function(e){const t=new J0(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},p1.prototype.remove=function(e){if(Object(l.a)(e)&&e._labelCollection===this){const t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),f1(this,e),!0}return!1},p1.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)f1(this,e[t]);e.length=0},p1.prototype.contains=function(e){return Object(l.a)(e)&&e._labelCollection===this},p1.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return this._labels[e]},p1.prototype.update=function(e){if(!this.show)return;const t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;const i=e.context;Object(l.a)(this._textureAtlas)||(this._textureAtlas=new NQ({context:i}),t.textureAtlas=this._textureAtlas),Object(l.a)(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new NQ({context:i,initialSize:t1}),n.textureAtlas=this._backgroundTextureAtlas,function(e){const t=document.createElement("canvas");t.width=t1.x,t.height=t1.y;const n=t.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage("ID_WHITE_PIXEL",t)}(this._backgroundTextureAtlas));const r=this._labelsToUpdate.length;for(let e=0;e<r;++e){const t=this._labelsToUpdate[e];if(t.isDestroyed())continue;const n=t._glyphs.length;t._rebindAllGlyphs&&(c1(this,t),t._rebindAllGlyphs=!1),t._repositionAllGlyphs&&(d1(t),t._repositionAllGlyphs=!1);const i=t._glyphs.length-n;this._totalGlyphCount+=i}const o=n.length>0?IQ.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)},p1.prototype.isDestroyed=function(){return!1},p1.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),sc(this)};var m1=p1,g1="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\n\nvarying vec2  v_st;\nvarying float v_width;\nvarying vec4 v_pickColor;\nvarying float v_polylineAngle;\n\nvoid main()\n{\n    float texCoord = texCoordExpandAndBatchIndex.x;\n    float expandDir = texCoordExpandAndBatchIndex.y;\n    bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\n    float batchTableIndex = texCoordExpandAndBatchIndex.w;\n\n    vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\n    float width = widthAndShow.x + 0.5;\n    float show = widthAndShow.y;\n\n    if (width < 1.0)\n    {\n        show = 0.0;\n    }\n\n    vec4 pickColor = batchTable_getPickColor(batchTableIndex);\n\n    vec4 p, prev, next;\n    if (czm_morphTime == 1.0)\n    {\n        p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\n        prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\n        next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n        p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\n        prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\n        next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n    }\n    else\n    {\n        p = czm_columbusViewMorph(\n                czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\n                czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\n                czm_morphTime);\n        prev = czm_columbusViewMorph(\n                czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\n                czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\n                czm_morphTime);\n        next = czm_columbusViewMorph(\n                czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\n                czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\n                czm_morphTime);\n    }\n\n    #ifdef DISTANCE_DISPLAY_CONDITION\n        vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\n        vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\n        vec3 centerLow = centerLowAndRadius.xyz;\n        float radius = centerLowAndRadius.w;\n        vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\n\n        float lengthSq;\n        if (czm_sceneMode == czm_sceneMode2D)\n        {\n            lengthSq = czm_eyeHeight2D.y;\n        }\n        else\n        {\n            vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\n            lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n        }\n\n        float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\n        float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\n        if (lengthSq < nearSq || lengthSq > farSq)\n        {\n            show = 0.0;\n        }\n    #endif\n\n    float polylineAngle;\n    vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\n    gl_Position = czm_viewportOrthographic * positionWC * show;\n\n    v_st.s = texCoord;\n    v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\n\n    v_width = width;\n    v_pickColor = pickColor;\n    v_polylineAngle = polylineAngle;\n}\n";function _1(e,t){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._show=Object(c.a)(e.show,!0),this._width=Object(c.a)(e.width,1),this._loop=Object(c.a)(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,Object(l.a)(this._material)||(this._material=CR.fromType(CR.ColorType,{color:new sp(1,1,1,1)}));let n,i=e.positions;Object(l.a)(i)||(i=[]),this._positions=i,this._actualPositions=wl(i,O.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=i.slice()),this._actualPositions.push(O.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id,Object(l.a)(t)&&(n=Me.clone(t.modelMatrix)),this._modelMatrix=n,this._segments=Tg.wrapLongitude(this._actualPositions,n),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(E1),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=At.fromPoints(this._actualPositions),this._boundingVolumeWC=At.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new At}const y1=_1.POSITION_INDEX=0,b1=_1.SHOW_INDEX=1,v1=_1.WIDTH_INDEX=2,O1=_1.MATERIAL_INDEX=3,w1=_1.POSITION_SIZE_INDEX=4,A1=_1.DISTANCE_DISPLAY_CONDITION=5,E1=_1.NUMBER_OF_PROPERTIES=6;function T1(e,t){++e._propertiesChanged[t];const n=e._polylineCollection;Object(l.a)(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(_1.prototype,{show:{get:function(){return this._show},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");e!==this._show&&(this._show=e,T1(this,b1))}},positions:{get:function(){return this._positions},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");let t=wl(e,O.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(O.clone(t[0]))),this._actualPositions.length===t.length&&this._actualPositions.length===this._length||T1(this,w1),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=At.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=At.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),T1(this,y1),this.update()}},material:{get:function(){return this._material},set:function(e){if(!Object(l.a)(e))throw new u.a("material is required.");this._material!==e&&(this._material=e,T1(this,O1))}},width:{get:function(){return this._width},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");e!==this._width&&(this._width=e,T1(this,v1))}},loop:{get:function(){return this._loop},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!O.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(O.clone(t[0]))):t.length>2&&O.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,T1(this,w1)}}},id:{get:function(){return this._id},set:function(e){this._id=e,Object(l.a)(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!Object(l.a)(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far distance must be greater than near distance.");eb.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=eb.clone(e,this._distanceDisplayCondition),T1(this,A1))}}}),_1.prototype.update=function(){let e=Me.IDENTITY;Object(l.a)(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);const t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[y1]>0||this._propertiesChanged[w1]>0;if(Me.equals(e,this._modelMatrix)&&!i||(this._segments=Tg.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=At.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=Me.clone(e,this._modelMatrix),this._segments.positions.length!==t)T1(this,w1);else{const e=n.length;for(let t=0;t<e;++t)if(n[t]!==this._segments.lengths[t]){T1(this,w1);break}}},_1.prototype.getPickId=function(e){return Object(l.a)(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},_1.prototype._clean=function(){this._dirty=!1;const e=this._propertiesChanged;for(let t=0;t<E1-1;++t)e[t]=0},_1.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var C1=_1;const x1=C1.SHOW_INDEX,S1=C1.WIDTH_INDEX,I1=C1.POSITION_INDEX,P1=C1.MATERIAL_INDEX,D1=C1.POSITION_SIZE_INDEX,R1=C1.DISTANCE_DISPLAY_CONDITION,j1=C1.NUMBER_OF_PROPERTIES,M1={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function L1(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=Me.clone(Me.IDENTITY),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(j1),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:KN.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=sp.clone(sp.WHITE);const t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(L1.prototype,{length:{get:function(){return W1(this),this._polylines.length}}}),L1.prototype.add=function(e){const t=new C1(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},L1.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,Object(l.a)(e._bucket)){const t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1},L1.prototype.removeAll=function(){Y1(this),K1(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},L1.prototype.contains=function(e){return Object(l.a)(e)&&e._polylineCollection===this},L1.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return W1(this),this._polylines[e]};const N1=new Mh,B1=new _e,F1=new Vt;L1.prototype.update=function(e){if(W1(this),0===this._polylines.length||!this.show)return;!function(e,t){const n=t.mode;e._mode===n&&Me.equals(e._modelMatrix,e.modelMatrix)||(e._mode=n,e._modelMatrix=Me.clone(e.modelMatrix),e._createVertexArray=!0)}(this,e);const t=e.context,n=e.mapProjection;let i,r=this._propertiesChanged;if(this._createBatchTable){if(0===MD.maximumVertexTextureImageUnits)throw new ye.a("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");!function(e,t){Object(l.a)(e._batchTable)&&e._batchTable.destroy();const n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:gs.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:gs.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:gs.FLOAT,componentsPerAttribute:2}];e._batchTable=new hB(t,n,e._polylines.length)}(this,t),this._createBatchTable=!1}if(this._createVertexArray||function(e){let t=!1;const n=e._propertiesChanged,i=e._positionBufferUsage;n[I1]?i.bufferUsage!==KN.STREAM_DRAW?(t=!0,i.bufferUsage=KN.STREAM_DRAW,i.frameCount=100):i.frameCount=100:i.bufferUsage!==KN.STATIC_DRAW&&(0===i.frameCount?(t=!0,i.bufferUsage=KN.STATIC_DRAW):i.frameCount--);return t}(this))V1(this,t,n);else if(this._polylinesUpdated){const o=this._polylinesToUpdate;if(this._mode!==AB.SCENE3D){const e=o.length;for(let t=0;t<e;++t)i=o[t],i.update()}if(r[D1]||r[P1])V1(this,t,n);else{const t=o.length,a=this._polylineBuckets;for(let s=0;s<t;++s){i=o[s],r=i._propertiesChanged;const t=i._bucket;let c=0;for(const e in a)if(a.hasOwnProperty(e)){if(a[e]===t){r[I1]&&t.writeUpdate(c,i,this._positionBuffer,n);break}c+=a[e].lengthOfPositions}if((r[x1]||r[S1])&&this._batchTable.setBatchedAttribute(i._index,0,new Vt(i._width,i._show)),this._batchTable.attributes.length>2){if(r[I1]||r[D1]){const t=e.mode===AB.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,n=Mh.fromCartesian(t.center,N1),r=_e.fromElements(n.low.x,n.low.y,n.low.z,t.radius,B1);this._batchTable.setBatchedAttribute(i._index,2,n.high),this._batchTable.setBatchedAttribute(i._index,3,r)}if(r[R1]){const e=F1;e.x=0,e.y=Number.MAX_VALUE;const t=i.distanceDisplayCondition;Object(l.a)(t)&&(e.x=t.near,e.y=t.far),this._batchTable.setBatchedAttribute(i._index,4,e)}}i._clean()}}o.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let e=0;e<j1;++e)r[e]=0;let o=Me.IDENTITY;e.mode===AB.SCENE3D&&(o=this.modelMatrix);const a=e.passes,s=0!==e.morphTime;if(Object(l.a)(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===s||(this._opaqueRS=vj.fromCache({depthMask:s,depthTest:{enabled:s}})),Object(l.a)(this._translucentRS)&&this._translucentRS.depthTest.enabled===s||(this._translucentRS=vj.fromCache({blending:SD.ALPHA_BLEND,depthMask:!s,depthTest:{enabled:s}})),this._batchTable.update(e),a.render||a.pick){!function(e,t,n,i){const r=t.context,o=t.commandList,a=n.length;let s=0,c=!0;const u=e._vertexArrays,h=e.debugShowBoundingVolume,d=e._batchTable.getUniformMapCallback(),f=u.length;for(let p=0;p<f;++p){const f=u[p],m=f.buckets,g=m.length;for(let u=0;u<g;++u){const p=m[u];let g=p.offset;const _=p.bucket.shaderProgram,y=p.bucket.polylines,b=y.length;let v,O,w,A,E=0;for(let u=0;u<b;++u){const m=y[u],b=q1(m._material);if(b!==v){if(Object(l.a)(v)&&E>0){const t=O.isTranslucent();s>=a?(w=new XR({owner:e}),n.push(w)):w=n[s],++s,A=Object(up.a)(d(O._uniforms),e._uniformMap),w.boundingVolume=At.clone(z1,w.boundingVolume),w.modelMatrix=i,w.shaderProgram=_,w.vertexArray=f.va,w.renderState=t?e._translucentRS:e._opaqueRS,w.pass=t?KR.TRANSLUCENT:KR.OPAQUE,w.debugShowBoundingVolume=h,w.pickId="v_pickColor",w.uniformMap=A,w.count=E,w.offset=g,g+=E,E=0,c=!0,o.push(w)}O=m._material,O.update(r),v=b}const T=m._locatorBuckets,C=T.length;for(let e=0;e<C;++e){const t=T[e];t.locator===p&&(E+=t.count)}let x;t.mode===AB.SCENE3D?x=m._boundingVolumeWC:t.mode===AB.COLUMBUS_VIEW?x=m._boundingVolume2D:t.mode===AB.SCENE2D?Object(l.a)(m._boundingVolume2D)&&(x=At.clone(m._boundingVolume2D,k1),x.center.x=0):Object(l.a)(m._boundingVolumeWC)&&Object(l.a)(m._boundingVolume2D)&&(x=At.union(m._boundingVolumeWC,m._boundingVolume2D,k1)),c?(c=!1,At.clone(x,z1)):At.union(x,z1,z1)}Object(l.a)(v)&&E>0&&(s>=a?(w=new XR({owner:e}),n.push(w)):w=n[s],++s,A=Object(up.a)(d(O._uniforms),e._uniformMap),w.boundingVolume=At.clone(z1,w.boundingVolume),w.modelMatrix=i,w.shaderProgram=_,w.vertexArray=f.va,w.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,w.pass=O.isTranslucent()?KR.TRANSLUCENT:KR.OPAQUE,w.debugShowBoundingVolume=h,w.pickId="v_pickColor",w.uniformMap=A,w.count=E,w.offset=g,c=!0,o.push(w)),v=void 0}}n.length=s}(this,e,this._colorCommands,o)}};const z1=new At,k1=new At;L1.prototype.isDestroyed=function(){return!1},L1.prototype.destroy=function(){return X1(this),Y1(this),K1(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),sc(this)};const U1=[0,0,0];function V1(e,t,n){e._createVertexArray=!1,Y1(e),X1(e),function(e){const t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let e=0;e<o;++e){const o=r[e];if(o._actualPositions.length>1){o.update();const e=o.material;let r=i[e.type];Object(l.a)(r)||(r=i[e.type]=new Z1(e,t,n)),r.addPolyline(o)}}}(e);const i=[[]];let r=i[0];const o=e._batchTable,a=e._useHighlightColor,s=[0];let c=0;const u=[[]];let d=0;const f=e._polylineBuckets;let p,m;for(p in f)f.hasOwnProperty(p)&&(m=f[p],m.updateShader(t,o,a),d+=m.lengthOfPositions);if(d>0){const a=e._mode,g=new Float32Array(6*d*3),_=new Float32Array(4*d);let y,b=0,v=0,O=0;for(p in f)if(f.hasOwnProperty(p)){m=f[p],m.write(g,_,b,v,O,o,t,n),a===AB.MORPHING&&(Object(l.a)(y)||(y=new Float32Array(6*d*3)),m.writeForMorph(y,b));const e=m.lengthOfPositions;b+=6*e*3,v+=4*e,O+=4*e,c=m.updateIndices(i,s,u,c)}const w=e._positionBufferUsage.bufferUsage,A=KN.STATIC_DRAW;let E;e._positionBuffer=ZN.createVertexBuffer({context:t,typedArray:g,usage:w}),Object(l.a)(y)&&(E=ZN.createVertexBuffer({context:t,typedArray:y,usage:w})),e._texCoordExpandAndBatchIndexBuffer=ZN.createVertexBuffer({context:t,typedArray:_,usage:A});const T=3*Float32Array.BYTES_PER_ELEMENT,C=4*Float32Array.BYTES_PER_ELEMENT;let x=0;const S=i.length;for(let n=0;n<S;++n)if(r=i[n],r.length>0){const i=new Uint16Array(r),o=ZN.createIndexBuffer({context:t,typedArray:i,usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT});x+=s[n];const c=6*(n*(T*h.a.SIXTY_FOUR_KILOBYTES)-x*T),l=T+c,d=T+l,f=T+d,p=T+f,m=T+p,g=n*(C*h.a.SIXTY_FOUR_KILOBYTES)-x*C,_=[{index:M1.position3DHigh,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:c,strideInBytes:6*T},{index:M1.position3DLow,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:l,strideInBytes:6*T},{index:M1.position2DHigh,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:c,strideInBytes:6*T},{index:M1.position2DLow,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:l,strideInBytes:6*T},{index:M1.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:d,strideInBytes:6*T},{index:M1.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:f,strideInBytes:6*T},{index:M1.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:d,strideInBytes:6*T},{index:M1.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:f,strideInBytes:6*T},{index:M1.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:p,strideInBytes:6*T},{index:M1.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:m,strideInBytes:6*T},{index:M1.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:p,strideInBytes:6*T},{index:M1.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:gs.FLOAT,offsetInBytes:m,strideInBytes:6*T},{index:M1.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:gs.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:g}];let y,b,v,O;a===AB.SCENE3D?(b=e._positionBuffer,y="vertexBuffer",v=U1,O="value"):a===AB.SCENE2D||a===AB.COLUMBUS_VIEW?(b=U1,y="value",v=e._positionBuffer,O="vertexBuffer"):(b=E,y="vertexBuffer",v=e._positionBuffer,O="vertexBuffer"),_[0][y]=b,_[1][y]=b,_[2][O]=v,_[3][O]=v,_[4][y]=b,_[5][y]=b,_[6][O]=v,_[7][O]=v,_[8][y]=b,_[9][y]=b,_[10][O]=v,_[11][O]=v;const w=new iB({context:t,attributes:_,indexBuffer:o});e._vertexArrays.push({va:w,buckets:u[n]})}}}function H1(e,t){return t instanceof JD?t.id:t}const G1=[];function q1(e){const t=CR._uniformList[e.type],n=t.length;G1.length=2*n;let i=0;for(let r=0;r<n;++r){const n=t[r];G1[i]=n,G1[i+1]=e._uniforms[n](),i+=2}return`${e.type}:${JSON.stringify(G1,H1)}`}function W1(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;const t=[],n=[];let i,r=0;const o=e._polylines.length;for(let a=0;a<o;++a)i=e._polylines[a],i.isDestroyed||(i._index=r++,n.push(i),t.push(i));e._polylines=t,e._polylinesToUpdate=n}}function Y1(e){const t=e._polylines,n=t.length;for(let e=0;e<n;++e)if(!t[e].isDestroyed){const n=t[e]._bucket;Object(l.a)(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function X1(e){const t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}function K1(e){const t=e._polylines,n=t.length;for(let e=0;e<n;++e)t[e].isDestroyed||t[e]._destroy()}function J1(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Z1(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}function $1(e){return O.dot(O.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(xi.ORIGIN_ZX_PLANE)===W.INTERSECTING}L1.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},Z1.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Z1.prototype.updateShader=function(e,t,n){if(Object(l.a)(this.shaderProgram))return;const i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&i.push("POLYLINE_DASH"),Jr.isInternetExplorer()||i.push("CLIP_POLYLINE");const r=new UN({defines:i,sources:["varying vec4 v_pickColor;\n",this.material.shaderSource,Dz]}),o=t.getVertexShaderCallback()(g1),a=new UN({defines:i,sources:[Tz,o]});this.shaderProgram=oM.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:r,attributeLocations:M1})},Z1.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===AB.SCENE3D||!$1(e))return t=e._actualPositions.length,4*t-4;let n=0;const i=e._segments.lengths;t=i.length;for(let e=0;e<t;++e)n+=4*i[e]-4;return n};const Q1=new O,e2=new O,t2=new O,n2=new O,i2=new _e,r2=new Vt;Z1.prototype.write=function(e,t,n,i,r,o,a,s){const c=this.mode,u=s.ellipsoid.maximumRadius*h.a.PI,d=this.polylines,f=d.length;for(let i=0;i<f;++i){const h=d[i],f=h.width,p=h.show&&f>0,m=h._index,g=this.getSegments(h,s),_=g.positions,y=g.lengths,b=_.length,v=h.getPickId(a).color;let w,A=0,E=0;for(let i=0;i<b;++i){0===i?h._loop?w=_[b-2]:(w=n2,O.subtract(_[0],_[1],w),O.add(_[0],w,w)):w=_[i-1],O.clone(w,e2),O.clone(_[i],Q1),i===b-1?h._loop?w=_[1]:(w=n2,O.subtract(_[b-1],_[b-2],w),O.add(_[b-1],w,w)):w=_[i+1],O.clone(w,t2);const o=y[A];i===E+o&&(E+=o,++A);const a=i-E==0,s=i===E+y[A]-1;c===AB.SCENE2D&&(e2.z=0,Q1.z=0,t2.z=0),c!==AB.SCENE2D&&c!==AB.MORPHING||(a||s)&&u-Math.abs(Q1.x)<1&&((Q1.x<0&&e2.x>0||Q1.x>0&&e2.x<0)&&O.clone(Q1,e2),(Q1.x<0&&t2.x>0||Q1.x>0&&t2.x<0)&&O.clone(Q1,t2));const l=s?2:4;for(let o=a?2:0;o<l;++o){Mh.writeElements(Q1,e,n),Mh.writeElements(e2,e,n+6),Mh.writeElements(t2,e,n+12);const a=o-2<0?-1:1;t[r]=i/(b-1),t[r+1]=o%2*2-1,t[r+2]=a,t[r+3]=m,n+=18,r+=4}}const T=i2;T.x=sp.floatToByte(v.red),T.y=sp.floatToByte(v.green),T.z=sp.floatToByte(v.blue),T.w=sp.floatToByte(v.alpha);const C=r2;C.x=f,C.y=p?1:0;const x=c===AB.SCENE2D?h._boundingVolume2D:h._boundingVolumeWC,S=Mh.fromCartesian(x.center,N1),I=S.high,P=_e.fromElements(S.low.x,S.low.y,S.low.z,x.radius,B1),D=F1;D.x=0,D.y=Number.MAX_VALUE;const R=h.distanceDisplayCondition;Object(l.a)(R)&&(D.x=R.near,D.y=R.far),o.setBatchedAttribute(m,0,C),o.setBatchedAttribute(m,1,T),o.attributes.length>2&&(o.setBatchedAttribute(m,2,I),o.setBatchedAttribute(m,3,P),o.setBatchedAttribute(m,4,D))}};const o2=new O,a2=new O,s2=new O,c2=new O;Z1.prototype.writeForMorph=function(e,t){const n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){const r=i[o],a=r._segments.positions,s=r._segments.lengths,c=a.length;let l=0,u=0;for(let i=0;i<c;++i){let o;0===i?r._loop?o=a[c-2]:(o=c2,O.subtract(a[0],a[1],o),O.add(a[0],o,o)):o=a[i-1],o=Me.multiplyByPoint(n,o,a2);const h=Me.multiplyByPoint(n,a[i],o2);let d;i===c-1?r._loop?d=a[1]:(d=c2,O.subtract(a[c-1],a[c-2],d),O.add(a[c-1],d,d)):d=a[i+1],d=Me.multiplyByPoint(n,d,s2);const f=s[l];i===u+f&&(u+=f,++l);const p=i-u==0,m=i===u+s[l]-1?2:4;for(let n=p?2:0;n<m;++n)Mh.writeElements(h,e,t),Mh.writeElements(o,e,t+6),Mh.writeElements(d,e,t+12),t+=18}}};const l2=new Array(1);Z1.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new J1(0,i,this);n[r].push(o);let a=0,s=e[e.length-1],c=0;s.length>0&&(c=s[s.length-1]+1);const l=this.polylines,u=l.length;for(let d=0;d<u;++d){const u=l[d];let f;if(u._locatorBuckets=[],this.mode===AB.SCENE3D){f=l2;const e=u._actualPositions.length;if(!(e>0))continue;f[0]=e}else f=u._segments.lengths;const p=f.length;if(p>0){let l=0;for(let d=0;d<p;++d){const p=f[d]-1;for(let d=0;d<p;++d)c+4>h.a.SIXTY_FOUR_KILOBYTES&&(u._locatorBuckets.push({locator:o,count:l}),l=0,t.push(4),s=[],e.push(s),c=0,o.count=a,a=0,i=0,o=new J1(0,0,this),n[++r]=[o]),s.push(c,c+2,c+1),s.push(c+1,c+2,c+3),l+=6,a+=6,i+=6,c+=4}u._locatorBuckets.push({locator:o,count:l}),c+4>h.a.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),c=0,o.count=a,i=0,a=0,o=new J1(0,0,this),n[++r]=[o])}u._clean()}return o.count=a,i},Z1.prototype.getPolylineStartIndex=function(e){const t=this.polylines;let n=0;const i=t.length;for(let r=0;r<i;++r){const i=t[r];if(i===e)break;n+=i._actualLength}return n};const u2={positions:void 0,lengths:void 0},h2=new Array(1),d2=new O,f2=new R;let p2;Z1.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===AB.SCENE3D)return h2[0]=n.length,u2.positions=n,u2.lengths=h2,u2;$1(e)&&(n=e._segments.positions);const i=t.ellipsoid,r=[],o=this.modelMatrix,a=n.length;let s,c=d2;for(let e=0;e<a;++e)s=n[e],c=Me.multiplyByPoint(o,s,c),r.push(t.project(i.cartesianToCartographic(c,f2)));if(r.length>0){e._boundingVolume2D=At.fromPoints(r,e._boundingVolume2D);const t=e._boundingVolume2D.center;e._boundingVolume2D.center=new O(t.z,t.x,t.y)}return u2.positions=r,u2.lengths=e._segments.lengths,u2},Z1.prototype.writeUpdate=function(e,t,n,i){const r=this.mode,o=i.ellipsoid.maximumRadius*h.a.PI;let a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);let s=p2;const c=6*a*3;!Object(l.a)(s)||s.length<c?s=p2=new Float32Array(c):s.length>c&&(s=new Float32Array(s.buffer,0,c));const u=this.getSegments(t,i),h=u.positions,d=u.lengths;let f,p=0,m=0,g=0;a=h.length;for(let e=0;e<a;++e){0===e?t._loop?f=h[a-2]:(f=n2,O.subtract(h[0],h[1],f),O.add(h[0],f,f)):f=h[e-1],O.clone(f,e2),O.clone(h[e],Q1),e===a-1?t._loop?f=h[1]:(f=n2,O.subtract(h[a-1],h[a-2],f),O.add(h[a-1],f,f)):f=h[e+1],O.clone(f,t2);const n=d[m];e===g+n&&(g+=n,++m);const i=e-g==0,c=e===g+d[m]-1;r===AB.SCENE2D&&(e2.z=0,Q1.z=0,t2.z=0),r!==AB.SCENE2D&&r!==AB.MORPHING||(i||c)&&o-Math.abs(Q1.x)<1&&((Q1.x<0&&e2.x>0||Q1.x>0&&e2.x<0)&&O.clone(Q1,e2),(Q1.x<0&&t2.x>0||Q1.x>0&&t2.x<0)&&O.clone(Q1,t2));const l=c?2:4;for(let e=i?2:0;e<l;++e)Mh.writeElements(Q1,s,p),Mh.writeElements(e2,s,p+6),Mh.writeElements(t2,s,p+12),p+=18}n.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var m2=L1;function g2(e){var t;this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new x0({batchTable:e.batchTable}),this._labelCollection=new m1({batchTable:e.batchTable}),this._polylineCollection=new m2,this._polylineCollection._useHighlightColor=!0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._update=function(e,t){},this._readyPromise=(t=this,new Promise((function(e,n){t._update=function(t,i){const r=function(e,t){let n;if(!Object(l.a)(e._verticesPromise)){n=e._positions;let i=e._packedBuffer;Object(l.a)(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=function(e,t){const n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+Be.packedLength+H.packedLength,a=new Float64Array(o);let s=0;return a[s++]=i,a[s++]=r,Be.pack(n,a,s),s+=Be.packedLength,H.pack(t,a,s),a}(e,t));const r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},a=e._verticesPromise=_2.scheduleTask(o,r);if(!Object(l.a)(a))return;return a.then((function(t){e._positions=new Float64Array(t.positions);const i=e._billboardCollection,r=e._labelCollection,o=e._polylineCollection;n=e._positions;const a=e._batchIds,s=n.length/3;for(let e=0;e<s;++e){const t=a[e],s=O.unpack(n,3*e,y2),c=i.add();c.position=s,c._batchIndex=t;const l=r.add();l.text=" ",l.position=s,l._batchIndex=t,o.add().positions=[O.clone(s),O.clone(s)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}))}}(t,i.mapProjection.ellipsoid);t._ready&&(t._polylineCollection.update(i),t._billboardCollection.update(i),t._labelCollection.update(i)),Object(l.a)(r)&&r.then((function(){e()})).catch((function(e){n(e)}))}})))}Object.defineProperties(g2.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}},readyPromise:{get:function(){return this._readyPromise}}});const _2=new _c("createVectorTilePoints",5),y2=new O;g2.prototype.createFeatures=function(e,t){const n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,a=o.length;for(let s=0;s<a;++s){const a=o[s],c=n.get(s),l=i.get(s),u=r.get(s);t[a]=new R0(e,a,c,l,u)}},g2.prototype.applyDebugSettings=function(e,t){e?(sp.clone(t,this._billboardCollection._highlightColor),sp.clone(t,this._labelCollection._highlightColor),sp.clone(t,this._polylineCollection._highlightColor)):(sp.clone(sp.WHITE,this._billboardCollection._highlightColor),sp.clone(sp.WHITE,this._labelCollection._highlightColor),sp.clone(sp.WHITE,this._polylineCollection._highlightColor))};const b2=new sp,v2=new sp,O2=new sp,w2=new sp,A2=new sp,E2=new sp,T2=new TE,C2=new TE,x2=new eb;g2.prototype.applyStyle=function(e,t){if(!Object(l.a)(e))return void function(e,t){const n=e._batchIds,i=n.length;for(let e=0;e<i;++e){const i=t[n[e]];i.show=!0,i.pointSize=R0.defaultPointSize,i.color=R0.defaultColor,i.pointOutlineColor=R0.defaultPointOutlineColor,i.pointOutlineWidth=R0.defaultPointOutlineWidth,i.labelColor=sp.WHITE,i.labelOutlineColor=sp.WHITE,i.labelOutlineWidth=1,i.font="30px sans-serif",i.labelStyle=L0.FILL,i.labelText=void 0,i.backgroundColor=new sp(.165,.165,.165,.8),i.backgroundPadding=new Vt(7,5),i.backgroundEnabled=!1,i.scaleByDistance=void 0,i.translucencyByDistance=void 0,i.distanceDisplayCondition=void 0,i.heightOffset=0,i.anchorLineEnabled=!1,i.anchorLineColor=sp.WHITE,i.image=void 0,i.disableDepthTestDistance=0,i.horizontalOrigin=WP.CENTER,i.verticalOrigin=YP.CENTER,i.labelHorizontalOrigin=WP.RIGHT,i.labelVerticalOrigin=YP.BASELINE}}(this,t);const n=this._batchIds,i=n.length;for(let r=0;r<i;++r){const i=t[n[r]];if(Object(l.a)(e.show)&&(i.show=e.show.evaluate(i)),Object(l.a)(e.pointSize)&&(i.pointSize=e.pointSize.evaluate(i)),Object(l.a)(e.color)&&(i.color=e.color.evaluateColor(i,b2)),Object(l.a)(e.pointOutlineColor)&&(i.pointOutlineColor=e.pointOutlineColor.evaluateColor(i,v2)),Object(l.a)(e.pointOutlineWidth)&&(i.pointOutlineWidth=e.pointOutlineWidth.evaluate(i)),Object(l.a)(e.labelColor)&&(i.labelColor=e.labelColor.evaluateColor(i,O2)),Object(l.a)(e.labelOutlineColor)&&(i.labelOutlineColor=e.labelOutlineColor.evaluateColor(i,w2)),Object(l.a)(e.labelOutlineWidth)&&(i.labelOutlineWidth=e.labelOutlineWidth.evaluate(i)),Object(l.a)(e.font)&&(i.font=e.font.evaluate(i)),Object(l.a)(e.labelStyle)&&(i.labelStyle=e.labelStyle.evaluate(i)),Object(l.a)(e.labelText)?i.labelText=e.labelText.evaluate(i):i.labelText=void 0,Object(l.a)(e.backgroundColor)&&(i.backgroundColor=e.backgroundColor.evaluateColor(i,A2)),Object(l.a)(e.backgroundPadding)&&(i.backgroundPadding=e.backgroundPadding.evaluate(i)),Object(l.a)(e.backgroundEnabled)&&(i.backgroundEnabled=e.backgroundEnabled.evaluate(i)),Object(l.a)(e.scaleByDistance)){const t=e.scaleByDistance.evaluate(i);T2.near=t.x,T2.nearValue=t.y,T2.far=t.z,T2.farValue=t.w,i.scaleByDistance=T2}else i.scaleByDistance=void 0;if(Object(l.a)(e.translucencyByDistance)){const t=e.translucencyByDistance.evaluate(i);C2.near=t.x,C2.nearValue=t.y,C2.far=t.z,C2.farValue=t.w,i.translucencyByDistance=C2}else i.translucencyByDistance=void 0;if(Object(l.a)(e.distanceDisplayCondition)){const t=e.distanceDisplayCondition.evaluate(i);x2.near=t.x,x2.far=t.y,i.distanceDisplayCondition=x2}else i.distanceDisplayCondition=void 0;Object(l.a)(e.heightOffset)&&(i.heightOffset=e.heightOffset.evaluate(i)),Object(l.a)(e.anchorLineEnabled)&&(i.anchorLineEnabled=e.anchorLineEnabled.evaluate(i)),Object(l.a)(e.anchorLineColor)&&(i.anchorLineColor=e.anchorLineColor.evaluateColor(i,E2)),Object(l.a)(e.image)?i.image=e.image.evaluate(i):i.image=void 0,Object(l.a)(e.disableDepthTestDistance)&&(i.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(i)),Object(l.a)(e.horizontalOrigin)&&(i.horizontalOrigin=e.horizontalOrigin.evaluate(i)),Object(l.a)(e.verticalOrigin)&&(i.verticalOrigin=e.verticalOrigin.evaluate(i)),Object(l.a)(e.labelHorizontalOrigin)&&(i.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(i)),Object(l.a)(e.labelVerticalOrigin)&&(i.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(i))}},g2.prototype.update=function(e){this._update(this,e)},g2.prototype.isDestroyed=function(){return!1},g2.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),sc(this)};var S2=g2;function I2(e){var t;this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=Object(c.a)(e.center,O.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._update=function(e,t){},this._readyPromise=(t=this,new Promise((function(e,n){t._update=function(t,i){const r=function(e){if(!Object(l.a)(e._primitive)&&!Object(l.a)(e._verticesPromise)){let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!Object(l.a)(a)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(Be.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(o.length);const c=e._batchTable,l=a.length;for(let e=0;e<l;++e){const t=c.getColor(e,D2);a[e]=t.toRgba()}s=e._packedBuffer=function(e){const t=new Float64Array(3+O.packedLength+H.packedLength+Be.packedLength);let n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,O.pack(e._center,t,n),n+=O.packedLength,H.pack(e._ellipsoid,t,n),n+=H.packedLength,Be.pack(e._rectangle,t,n),t}(e)}const c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,a.buffer,s.buffer],u={packedBuffer:s.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:a.buffer};let h=e._polygonMinimumHeights,d=e._polygonMaximumHeights;Object(l.a)(h)&&Object(l.a)(d)&&(h=h.slice(),d=d.slice(),c.push(h.buffer,d.buffer),u.minimumHeights=h,u.maximumHeights=d);const f=e._verticesPromise=P2.scheduleTask(u,c);if(!Object(l.a)(f))return;return f.then((function(t){e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;const n=new Float64Array(t.packedBuffer),i=n[0];!function(e,t){let n=1;const i=t[n++],r=e._boundingVolumes=new Array(i);for(let e=0;e<i;++e)r[e]=fs.unpack(t,n),n+=fs.packedLength;const o=t[n++],a=e._batchedIndices=new Array(o);for(let e=0;e<o;++e){const i=sp.unpack(t,n);n+=sp.packedLength;const r=t[n++],o=t[n++],s=t[n++],c=new Array(s);for(let e=0;e<s;++e)c[e]=t[n++];a[e]=new dG({color:i,offset:r,count:o,batchIds:c})}}(e,n),e._indices=2===wc.getSizeInBytes(i)?new Uint16Array(t.indices):new Uint32Array(t.indices),e._indexOffsets=new Uint32Array(t.indexOffsets),e._indexCounts=new Uint32Array(t.indexCounts),e._batchedPositions=new Float32Array(t.positions),e._vertexBatchIds=new Uint16Array(t.batchIds),e._ready=!0}))}}(t);t._ready&&(t._primitive.debugWireframe=t.debugWireframe,t._primitive.forceRebatch=t.forceRebatch,t._primitive.classificationType=t.classificationType,t._primitive.update(i)),Object(l.a)(r)&&r.then((function(){!function(e){e._ready&&!Object(l.a)(e._primitive)&&(e._primitive=new cq({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._verticesPromise=void 0)}(t),e(t)})).catch((function(e){n(e)}))}}))),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=qN.BOTH}Object.defineProperties(I2.prototype,{trianglesLength:{get:function(){return Object(l.a)(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return Object(l.a)(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise}}});const P2=new _c("createVectorTilePolygons",5),D2=new sp;I2.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},I2.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},I2.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},I2.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},I2.prototype.update=function(e){this._update(this,e)},I2.prototype.isDestroyed=function(){return!1},I2.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),sc(this)};var R2=I2,j2="attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\n\nuniform mat4 u_modifiedModelView;\n\nvoid main()\n{\n    float expandDir = expandAndWidth.x;\n    float width = abs(expandAndWidth.y) + 0.5;\n    bool usePrev = expandAndWidth.y < 0.0;\n\n    vec4 p = u_modifiedModelView * currentPosition;\n    vec4 prev = u_modifiedModelView * previousPosition;\n    vec4 next = u_modifiedModelView * nextPosition;\n\n    float angle;\n    vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\n    gl_Position = czm_viewportOrthographic * positionWC;\n}\n";function M2(e){var t;this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=sp.clone(sp.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._update=function(e,t){},this._readyPromise=(t=this,new Promise((function(e,n){t._update=function(t,i){const r=i.context,o=function(e,t){if(!Object(l.a)(e._va)&&!Object(l.a)(e._verticesPromise)){let t=e._positions,n=e._widths,i=e._counts,r=e._transferrableBatchIds,o=e._packedBuffer;Object(l.a)(o)||(t=e._positions=t.slice(),n=e._widths=n.slice(),i=e._counts=i.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),o=e._packedBuffer=function(e){const t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,a=2+Be.packedLength+H.packedLength+O.packedLength,s=new Float64Array(a);let c=0;return s[c++]=n,s[c++]=i,Be.pack(t,s,c),c+=Be.packedLength,H.pack(r,s,c),c+=H.packedLength,O.pack(o,s,c),s}(e));const a=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer],s={positions:t.buffer,widths:n.buffer,counts:i.buffer,batchIds:r.buffer,packedBuffer:o.buffer,keepDecodedPositions:e._keepDecodedPositions},c=e._verticesPromise=L2.scheduleTask(s,a);if(!Object(l.a)(c))return;return c.then((function(t){e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(t.decodedPositions),e._decodedPositionOffsets=new Uint32Array(t.decodedPositionOffsets)),e._currentPositions=new Float32Array(t.currentPositions),e._previousPositions=new Float32Array(t.previousPositions),e._nextPositions=new Float32Array(t.nextPositions),e._expandAndWidth=new Float32Array(t.expandAndWidth),e._vertexBatchIds=new Uint16Array(t.batchIds);const n=t.indexDatatype;e._indices=n===wc.UNSIGNED_SHORT?new Uint16Array(t.indices):new Uint32Array(t.indices),e._ready=!0}))}}(t);if(function(e,t){Object(l.a)(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){const n=t.uniformState.view;return Me.clone(n,B2),Me.multiplyByPoint(B2,e._center,F2),Me.setTranslation(B2,F2,B2),B2},u_highlightColor:function(){return e._highlightColor}})}(t,r),function(e,t){if(Object(l.a)(e._sp))return;const n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(j2),r=n.getFragmentShaderCallback(!1,void 0,!1)("uniform vec4 u_highlightColor; \nvoid main()\n{\n    gl_FragColor = u_highlightColor;\n}\n"),o=new UN({defines:["VECTOR_TILE",Jr.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Tz,i]}),a=new UN({defines:["VECTOR_TILE"],sources:[r]});e._sp=oM.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:N2})}(t,r),a=t,Object(l.a)(a._rs)||(a._rs=vj.fromCache({blending:SD.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:{enabled:!0,factor:-5,units:-5}})),t._ready){const e=i.passes;(e.render||e.pick)&&function(e,t){if(!Object(l.a)(e._command)){const t=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new XR({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:t,boundingVolume:e._boundingVolume,pass:KR.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}(t,i)}var a;Object(l.a)(o)&&o.then((function(){!function(e,t){if(e._ready&&!Object(l.a)(e._va)){const n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,a=e._vertexBatchIds,s=e._indices;let c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+a.byteLength+s.byteLength,e._trianglesLength=s.length/3,e._geometryByteLength=c;const l=ZN.createVertexBuffer({context:t,typedArray:i,usage:KN.STATIC_DRAW}),u=ZN.createVertexBuffer({context:t,typedArray:n,usage:KN.STATIC_DRAW}),h=ZN.createVertexBuffer({context:t,typedArray:r,usage:KN.STATIC_DRAW}),d=ZN.createVertexBuffer({context:t,typedArray:o,usage:KN.STATIC_DRAW}),f=ZN.createVertexBuffer({context:t,typedArray:a,usage:KN.STATIC_DRAW}),p=ZN.createIndexBuffer({context:t,typedArray:s,usage:KN.STATIC_DRAW,indexDatatype:2===s.BYTES_PER_ELEMENT?wc.UNSIGNED_SHORT:wc.UNSIGNED_INT}),m=[{index:N2.previousPosition,vertexBuffer:l,componentDatatype:gs.FLOAT,componentsPerAttribute:3},{index:N2.currentPosition,vertexBuffer:u,componentDatatype:gs.FLOAT,componentsPerAttribute:3},{index:N2.nextPosition,vertexBuffer:h,componentDatatype:gs.FLOAT,componentsPerAttribute:3},{index:N2.expandAndWidth,vertexBuffer:d,componentDatatype:gs.FLOAT,componentsPerAttribute:2},{index:N2.a_batchId,vertexBuffer:f,componentDatatype:gs.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new iB({context:t,attributes:m,indexBuffer:p}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}(t,r),e()})).catch((function(e){n(e)}))}}))),this._verticesPromise=void 0}Object.defineProperties(M2.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise}}});const L2=new _c("createVectorTilePolylines",5),N2={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};const B2=new Me,F2=new O;M2.getPolylinePositions=function(e,t){const n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!Object(l.a)(n)||!Object(l.a)(i))return;let o,a;const s=n.length;let c=0,u=0;for(o=0;o<s;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(0===c)return;const h=new Float64Array(3*c);for(o=0;o<s;++o)if(n[o]===t){const e=r[o],t=r[o+1]-e;for(a=0;a<t;++a){const t=3*(e+a);h[u++]=i[t],h[u++]=i[t+1],h[u++]=i[t+2]}}return h},M2.prototype.getPositions=function(e){return M2.getPolylinePositions(this,e)},M2.prototype.createFeatures=function(e,t){const n=this._batchIds,i=n.length;for(let r=0;r<i;++r){const i=n[r];t[i]=new jV(e,i)}},M2.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};const z2=new sp,k2=sp.WHITE;M2.prototype.applyStyle=function(e,t){if(!Object(l.a)(e))return void function(e,t){const n=e._batchIds,i=n.length;for(let e=0;e<i;++e){const i=t[n[e]];i.show=!0,i.color=sp.WHITE}}(this,t);const n=this._batchIds,i=n.length;for(let r=0;r<i;++r){const i=t[n[r]];i.color=Object(l.a)(e.color)?e.color.evaluateColor(i,z2):k2,i.show=!Object(l.a)(e.show)||e.show.evaluate(i)}},M2.prototype.update=function(e){this._update(this,e)},M2.prototype.isDestroyed=function(){return!1},M2.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),sc(this)};var U2=M2,V2='attribute vec3 startEllipsoidNormal;\nattribute vec3 endEllipsoidNormal;\nattribute vec4 startPositionAndHeight;\nattribute vec4 endPositionAndHeight;\nattribute vec4 startFaceNormalAndVertexCorner;\nattribute vec4 endFaceNormalAndHalfWidth;\nattribute float a_batchId;\n\nuniform mat4 u_modifiedModelView;\nuniform vec2 u_minimumMaximumVectorHeights;\n\nvarying vec4 v_startPlaneEC;\nvarying vec4 v_endPlaneEC;\nvarying vec4 v_rightPlaneEC;\nvarying float v_halfWidth;\nvarying vec3 v_volumeUpEC;\n\nvoid main()\n{\n    // vertex corner IDs\n    //          3-----------7\n    //         /|   left   /|\n    //        / | 1       / |\n    //       2-----------6  5  end\n    //       | /         | /\n    // start |/  right   |/\n    //       0-----------4\n    //\n    float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end\n    float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top\n\n    vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;\n    vec3 right = normalize(cross(forward, startEllipsoidNormal));\n\n    vec4 position = vec4(startPositionAndHeight.xyz, 1.0);\n    position.xyz += forward * isEnd;\n\n    v_volumeUpEC = czm_normal * normalize(cross(right, forward));\n\n    // Push for volume height\n    float offset;\n    vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);\n\n    // offset height to create volume\n    offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);\n    offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;\n    position.xyz += offset * ellipsoidNormal;\n\n    // move from RTC to EC\n    position = u_modifiedModelView * position;\n    right = czm_normal * right;\n\n    // Push for width in a direction that is in the start or end plane and in a plane with right\n    // N = normalEC ("right-facing" direction for push)\n    // R = right\n    // p = angle between N and R\n    // w = distance to push along R if R == N\n    // d = distance to push along N\n    //\n    //   N   R\n    //  {  p| }      * cos(p) = dot(N, R) = w / d\n    //  d  |  |w    * d = w / dot(N, R)\n    //    { | }\n    //       o---------- polyline segment ----\x3e\n    //\n    vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);\n    scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));\n    vec3 miterPushNormal = czm_normal * normalize(scratchNormal);\n\n    offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC\n    offset = offset / dot(miterPushNormal, right);\n    position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));\n\n    gl_Position = czm_depthClamp(czm_projection * position);\n\n    position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);\n    vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;\n    v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));\n    v_rightPlaneEC = vec4(right, -dot(right, position.xyz));\n\n    position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);\n    vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;\n    v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));\n    v_halfWidth = endFaceNormalAndHalfWidth.w;\n}\n',H2="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\nvarying vec4 v_startPlaneEC;\nvarying vec4 v_endPlaneEC;\nvarying vec4 v_rightPlaneEC;\nvarying float v_halfWidth;\nvarying vec3 v_volumeUpEC;\n\nuniform vec4 u_highlightColor;\nvoid main()\n{\n    float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\n\n    // Discard for sky\n    if (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n        gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5);\n        return;\n#else // DEBUG_SHOW_VOLUME\n        discard;\n#endif // DEBUG_SHOW_VOLUME\n    }\n\n    vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n    eyeCoordinate /= eyeCoordinate.w;\n\n    float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);\n\n    // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction\n    halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));\n\n    // Check distance of the eye coordinate against the right-facing plane\n    float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n\n    // Check eye coordinate against the mitering planes\n    float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);\n    float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);\n\n    if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n        gl_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);\n        return;\n#else // DEBUG_SHOW_VOLUME\n        discard;\n#endif // DEBUG_SHOW_VOLUME\n    }\n    gl_FragColor = u_highlightColor;\n\n    czm_writeDepthClamp();\n}\n";function G2(e){var t;this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new Vt(nn._defaultMinTerrainHeight,nn._defaultMaxTerrainHeight),this._boundingVolume=fs.fromRectangle(e.rectangle,nn._defaultMinTerrainHeight,nn._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=sp.clone(sp.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._update=function(e,t){},this._readyPromise=(t=this,nn.initialize().then((function(){return function(e,t,n){const i=nn.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,a=e._minimumMaximumVectorHeights;a.x=r,a.y=o;const s=e._boundingVolume,c=e._rectangle;fs.fromRectangle(c,r,o,n,s)}(t,t._rectangle,t._ellipsoid),new Promise((function(e,n){t._update=function(t,i){const r=i.context,o=function(e,t){if(!Object(l.a)(e._va)&&!Object(l.a)(e._verticesPromise)){let t=e._positions,n=e._widths,i=e._counts,r=e._transferrableBatchIds,o=e._packedBuffer;Object(l.a)(o)||(t=e._positions=t.slice(),n=e._widths=n.slice(),i=e._counts=i.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),o=e._packedBuffer=function(e){const t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,a=2+Be.packedLength+H.packedLength+O.packedLength,s=new Float64Array(a);let c=0;return s[c++]=n,s[c++]=i,Be.pack(t,s,c),c+=Be.packedLength,H.pack(r,s,c),c+=H.packedLength,O.pack(o,s,c),s}(e));const a=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer],s={positions:t.buffer,widths:n.buffer,counts:i.buffer,batchIds:r.buffer,packedBuffer:o.buffer,keepDecodedPositions:e._keepDecodedPositions},c=e._verticesPromise=q2.scheduleTask(s,a);if(!Object(l.a)(c))return;return c.then((function(t){e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(t.decodedPositions),e._decodedPositionOffsets=new Uint32Array(t.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(t.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(t.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(t.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(t.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(t.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(t.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(t.vertexBatchIds);const n=t.indexDatatype;e._indices=n===wc.UNSIGNED_SHORT?new Uint16Array(t.indices):new Uint32Array(t.indices),e._ready=!0}))}}(t);if(function(e,t){Object(l.a)(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){const n=t.uniformState.view;return Me.clone(n,Y2),Me.multiplyByPoint(Y2,e._center,X2),Me.setTranslation(Y2,X2,Y2),Y2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}(t,r),function(e,t){if(Object(l.a)(e._sp))return;const n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(V2),r=n.getFragmentShaderCallback(!1,void 0,!0)(H2),o=new UN({defines:["VECTOR_TILE",Jr.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Tz,i]}),a=new UN({defines:["VECTOR_TILE"],sources:[r]});e._sp=oM.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:W2})}(t,r),a=t,Object(l.a)(a._rs)||(a._rs=K2(!1),a._rs3DTiles=K2(!0)),t._ready){const e=i.passes;(e.render||e.pick)&&function(e,t){let n=e._command;if(!Object(l.a)(e._command)){const t=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new XR({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:t,boundingVolume:e._boundingVolume,pass:KR.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});const i=XR.shallowClone(n,n.derivedCommands.tileset);i.renderState=e._rs3DTiles,i.pass=KR.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=i}const i=e._classificationType;i!==qN.TERRAIN&&i!==qN.BOTH||t.commandList.push(n),i!==qN.CESIUM_3D_TILE&&i!==qN.BOTH||t.commandList.push(n.derivedCommands.tileset)}(t,i)}var a;Object(l.a)(o)&&o.then((function(){!function(e,t){if(e._ready&&!Object(l.a)(e._va)){const n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,a=e._startFaceNormalAndVertexCornerIds,s=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,l=e._indices;let u=n.byteLength+i.byteLength;u+=r.byteLength+o.byteLength,u+=a.byteLength+s.byteLength,u+=c.byteLength+l.byteLength,e._trianglesLength=l.length/3,e._geometryByteLength=u;const h=ZN.createVertexBuffer({context:t,typedArray:n,usage:KN.STATIC_DRAW}),d=ZN.createVertexBuffer({context:t,typedArray:i,usage:KN.STATIC_DRAW}),f=ZN.createVertexBuffer({context:t,typedArray:r,usage:KN.STATIC_DRAW}),p=ZN.createVertexBuffer({context:t,typedArray:o,usage:KN.STATIC_DRAW}),m=ZN.createVertexBuffer({context:t,typedArray:a,usage:KN.STATIC_DRAW}),g=ZN.createVertexBuffer({context:t,typedArray:s,usage:KN.STATIC_DRAW}),_=ZN.createVertexBuffer({context:t,typedArray:c,usage:KN.STATIC_DRAW}),y=ZN.createIndexBuffer({context:t,typedArray:l,usage:KN.STATIC_DRAW,indexDatatype:2===l.BYTES_PER_ELEMENT?wc.UNSIGNED_SHORT:wc.UNSIGNED_INT}),b=[{index:W2.startEllipsoidNormal,vertexBuffer:h,componentDatatype:gs.FLOAT,componentsPerAttribute:3},{index:W2.endEllipsoidNormal,vertexBuffer:d,componentDatatype:gs.FLOAT,componentsPerAttribute:3},{index:W2.startPositionAndHeight,vertexBuffer:f,componentDatatype:gs.FLOAT,componentsPerAttribute:4},{index:W2.endPositionAndHeight,vertexBuffer:p,componentDatatype:gs.FLOAT,componentsPerAttribute:4},{index:W2.startFaceNormalAndVertexCorner,vertexBuffer:m,componentDatatype:gs.FLOAT,componentsPerAttribute:4},{index:W2.endFaceNormalAndHalfWidth,vertexBuffer:g,componentDatatype:gs.FLOAT,componentsPerAttribute:4},{index:W2.a_batchId,vertexBuffer:_,componentDatatype:gs.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new iB({context:t,attributes:b,indexBuffer:y}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}(t,r),e(t)})).catch((function(e){n(e)}))}}))}))),this._verticesPromise=void 0}Object.defineProperties(G2.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise}}});const q2=new _c("createVectorTileClampedPolylines"),W2={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};const Y2=new Me,X2=new O;function K2(e){return vj.fromCache({cull:{enabled:!0,face:PD.FRONT},blending:SD.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:UF.EQUAL,frontOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},backFunction:UF.EQUAL,backOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},reference:qF.CESIUM_3D_TILE_MASK,mask:qF.CESIUM_3D_TILE_MASK}})}G2.prototype.getPositions=function(e){return U2.getPolylinePositions(this,e)},G2.prototype.createFeatures=function(e,t){const n=this._batchIds,i=n.length;for(let r=0;r<i;++r){const i=n[r];t[i]=new jV(e,i)}},G2.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};const J2=new sp,Z2=sp.WHITE;G2.prototype.applyStyle=function(e,t){if(!Object(l.a)(e))return void function(e,t){const n=e._batchIds,i=n.length;for(let e=0;e<i;++e){const i=t[n[e]];i.show=!0,i.color=sp.WHITE}}(this,t);const n=this._batchIds,i=n.length;for(let r=0;r<i;++r){const i=t[n[r]];i.color=Object(l.a)(e.color)?e.color.evaluateColor(i,J2):Z2,i.show=!Object(l.a)(e.show)||e.show.evaluate(i)}},G2.prototype.update=function(e){this._update(this,e)},G2.prototype.isDestroyed=function(){return!1},G2.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),sc(this)};var $2=G2;function Q2(e,t,n,i,r){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,function(e,t,n){n=Object(c.a)(n,0);const i=new Uint8Array(t),r=new DataView(t);n+=e3;const o=r.getUint32(n,!0);if(1!==o)throw new ye.a(`Only Vector tile version 1 is supported.  Version ${o} is not.`);n+=e3;const a=r.getUint32(n,!0);if(n+=e3,0===a)return Promise.resolve(e);const s=r.getUint32(n,!0);if(n+=e3,0===s)throw new ye.a("Feature table must have a byte length greater than zero");const u=r.getUint32(n,!0);n+=e3;const d=r.getUint32(n,!0);n+=e3;const f=r.getUint32(n,!0);n+=e3;const p=r.getUint32(n,!0);n+=e3;const m=r.getUint32(n,!0);n+=e3;const g=r.getUint32(n,!0);n+=e3;const _=r.getUint32(n,!0),y=qu(i,n+=e3,s);n+=s;const b=new Uint8Array(t,n,u);let v,w;n+=u,d>0&&(v=qu(i,n,d),n+=d,f>0&&(w=new Uint8Array(t,n,f),w=new Uint8Array(w),n+=f));const A=Object(c.a)(y.POLYGONS_LENGTH,0),E=Object(c.a)(y.POLYLINES_LENGTH,0),T=Object(c.a)(y.POINTS_LENGTH,0),C=A+E+T,x=new DV(e,C,v,w,function(e){return function(t,n){Object(l.a)(e._polygons)&&e._polygons.updateCommands(t,n)}}(e));if(e._batchTable=x,0===C)return;const S=new NV(y,b),I=S.getGlobalProperty("REGION");if(!Object(l.a)(I))throw new ye.a("Feature table global property: REGION must be defined");const P=Be.unpack(I),D=I[4],R=I[5],j=e._tile.computedTransform;let M=S.getGlobalProperty("RTC_CENTER",gs.FLOAT,3);Object(l.a)(M)?(M=O.unpack(M),Me.multiplyByPoint(j,M,M)):(M=Be.center(P),M.height=h.a.lerp(D,R,.5),M=H.WGS84.cartographicToCartesian(M));const L=function(e,t){let n,i,r,o;const a=Object(c.a)(e.POLYGONS_LENGTH,0),s=Object(c.a)(e.POLYLINES_LENGTH,0),u=Object(c.a)(e.POINTS_LENGTH,0);if(a>0&&Object(l.a)(e.POLYGON_BATCH_IDS)){const i=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,i,a)}if(s>0&&Object(l.a)(e.POLYLINE_BATCH_IDS)){const n=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,n,s)}if(u>0&&Object(l.a)(e.POINT_BATCH_IDS)){const n=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,n,u)}const h=Object(l.a)(n)||Object(l.a)(i)||Object(l.a)(r),d=a>0&&!Object(l.a)(n)||s>0&&!Object(l.a)(i)||u>0&&!Object(l.a)(r);if(h&&d)throw new ye.a("If one group of batch ids is defined, then all batch ids must be defined.");if(!Object(l.a)(n)&&!Object(l.a)(i)&&!Object(l.a)(r)){let e=0;if(!Object(l.a)(n)&&a>0)for(n=new Uint16Array(a),o=0;o<a;++o)n[o]=e++;if(!Object(l.a)(i)&&s>0)for(i=new Uint16Array(s),o=0;o<s;++o)i[o]=e++;if(!Object(l.a)(r)&&u>0)for(r=new Uint16Array(u),o=0;o<u;++o)r[o]=e++}return{polygons:n,polylines:i,points:r}}(y,b);if(n+=(4-n%4)%4,A>0){S.featuresLength=A;const i=Object(c.a)(S.getPropertyArray("POLYGON_COUNTS",gs.UNSIGNED_INT,1),S.getPropertyArray("POLYGON_COUNT",gs.UNSIGNED_INT,1));if(!Object(l.a)(i))throw new ye.a("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");const r=Object(c.a)(S.getPropertyArray("POLYGON_INDEX_COUNTS",gs.UNSIGNED_INT,1),S.getPropertyArray("POLYGON_INDEX_COUNT",gs.UNSIGNED_INT,1));if(!Object(l.a)(r))throw new ye.a("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");const o=i.reduce((function(e,t){return e+2*t}),0),a=r.reduce((function(e,t){return e+t}),0),s=new Uint32Array(t,n,a);n+=p;const u=new Uint16Array(t,n,o);let h,d;n+=m,Object(l.a)(y.POLYGON_MINIMUM_HEIGHTS)&&Object(l.a)(y.POLYGON_MAXIMUM_HEIGHTS)&&(h=S.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",gs.FLOAT,1),d=S.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",gs.FLOAT,1)),e._polygons=new R2({positions:u,counts:i,indexCounts:r,indices:s,minimumHeight:D,maximumHeight:R,polygonMinimumHeights:h,polygonMaximumHeights:d,center:M,rectangle:P,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:x,batchIds:L.polygons,modelMatrix:j})}if(E>0){S.featuresLength=E;const i=Object(c.a)(S.getPropertyArray("POLYLINE_COUNTS",gs.UNSIGNED_INT,1),S.getPropertyArray("POLYLINE_COUNT",gs.UNSIGNED_INT,1));if(!Object(l.a)(i))throw new ye.a("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let r=S.getPropertyArray("POLYLINE_WIDTHS",gs.UNSIGNED_SHORT,1);if(!Object(l.a)(r)){r=new Uint16Array(E);for(let e=0;e<E;++e)r[e]=2}const o=i.reduce((function(e,t){return e+3*t}),0),a=new Uint16Array(t,n,o);n+=g;const s=e._tileset,u=s.examineVectorLinesFunction;if(Object(l.a)(u)){!function(e,t,n,i,r,o){const a=t.length;let s=0;for(let c=0;c<a;c++){const a=3*t[c],l=e.slice(s,s+a);s+=a,o(l,n[c],r,i)}}(Jy(new Uint16Array(a),P,D,R,H.WGS84),i,L.polylines,x,e.url,u)}let h=t3;Object(l.a)(s.classificationType)&&(h=n3),e._polylines=h({positions:a,widths:r,counts:i,batchIds:L.polylines,minimumHeight:D,maximumHeight:R,center:M,rectangle:P,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:x,classificationType:s.classificationType,keepDecodedPositions:s.vectorKeepDecodedPositions})}if(T>0){const i=new Uint16Array(t,n,3*T);n+=_,e._points=new S2({positions:i,batchIds:L.points,minimumHeight:D,maximumHeight:R,rectangle:P,batchTable:x})}Promise.resolve(e)}(this,i,r)}Object.defineProperties(Q2.prototype,{featuresLength:{get:function(){return Object(l.a)(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return Object(l.a)(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return Object(l.a)(this._polygons)&&(e+=this._polygons.trianglesLength),Object(l.a)(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return Object(l.a)(this._polygons)&&(e+=this._polygons.geometryByteLength),Object(l.a)(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return Object(l.a)(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return Object(l.a)(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},readyPromise:{get:function(){const e=Object(l.a)(this._points)?this._points.readyPromise:void 0,t=Object(l.a)(this._polygons)?this._polygons.readyPromise:void 0,n=Object(l.a)(this._polylines)?this._polylines.readyPromise:void 0,i=this;return Promise.all([e,t,n]).then((function(){return i}))}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});const e3=Uint32Array.BYTES_PER_ELEMENT;function t3(e){return new U2(e)}function n3(e){return new $2(e)}function i3(e){const t=e.featuresLength;if(!Object(l.a)(e._features)&&t>0){const n=new Array(t);Object(l.a)(e._polygons)&&e._polygons.createFeatures(e,n),Object(l.a)(e._polylines)&&e._polylines.createFeatures(e,n),Object(l.a)(e._points)&&e._points.createFeatures(e,n),e._features=n}}Q2.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Q2.prototype.getFeature=function(e){const t=this.featuresLength;if(!Object(l.a)(e)||e<0||e>=t)throw new u.a(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return i3(this),this._features[e]},Q2.prototype.applyDebugSettings=function(e,t){Object(l.a)(this._polygons)&&this._polygons.applyDebugSettings(e,t),Object(l.a)(this._polylines)&&this._polylines.applyDebugSettings(e,t),Object(l.a)(this._points)&&this._points.applyDebugSettings(e,t)},Q2.prototype.applyStyle=function(e){i3(this),Object(l.a)(this._polygons)&&this._polygons.applyStyle(e,this._features),Object(l.a)(this._polylines)&&this._polylines.applyStyle(e,this._features),Object(l.a)(this._points)&&this._points.applyStyle(e,this._features)},Q2.prototype.update=function(e,t){let n=!0;Object(l.a)(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons._ready),Object(l.a)(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines._ready),Object(l.a)(this._points)&&(this._points.update(t),n=n&&this._points._ready),Object(l.a)(this._batchTable)&&n&&this._batchTable.update(e,t)},Q2.prototype.getPolylinePositions=function(e){const t=this._polylines;if(Object(l.a)(t))return t.getPositions(e)},Q2.prototype.isDestroyed=function(){return!1},Q2.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),sc(this)};var r3=Q2;function o3(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.number("options.count",e.count),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(o3.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(Object(l.a)(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return Object(l.a)(this._metadataTable)&&(e+=this._metadataTable.byteLength),Object(l.a)(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}}),o3.prototype.hasProperty=function(e,t){return s.a.typeOf.number("index",e),s.a.typeOf.string("propertyId",t),!(!Object(l.a)(this._metadataTable)||!this._metadataTable.hasProperty(t))||(!(!Object(l.a)(this._jsonMetadataTable)||!this._jsonMetadataTable.hasProperty(t))||!(!Object(l.a)(this._batchTableHierarchy)||!this._batchTableHierarchy.hasProperty(e,t)))},o3.prototype.hasPropertyBySemantic=function(e,t){return s.a.typeOf.number("index",e),s.a.typeOf.string("semantic",t),!!Object(l.a)(this._metadataTable)&&this._metadataTable.hasPropertyBySemantic(t)},o3.prototype.propertyExists=function(e){return s.a.typeOf.string("propertyId",e),!(!Object(l.a)(this._metadataTable)||!this._metadataTable.hasProperty(e))||(!(!Object(l.a)(this._jsonMetadataTable)||!this._jsonMetadataTable.hasProperty(e))||!(!Object(l.a)(this._batchTableHierarchy)||!this._batchTableHierarchy.propertyExists(e)))},o3.prototype.propertyExistsBySemantic=function(e){return s.a.typeOf.string("semantic",e),!!Object(l.a)(this._metadataTable)&&this._metadataTable.hasPropertyBySemantic(e)};const a3=[];function s3(e,t){if(!Object(l.a)(e)||e<0||e>=t)throw new u.a("featureId is required and must be between zero and featuresLength - 1 ("+t-NaN)}o3.prototype.getPropertyIds=function(e,t){return(t=Object(l.a)(t)?t:[]).length=0,Object(l.a)(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(a3)),Object(l.a)(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(a3)),Object(l.a)(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,a3)),t},o3.prototype.getProperty=function(e,t){let n;return Object(l.a)(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),Object(l.a)(n))||Object(l.a)(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),Object(l.a)(n))||Object(l.a)(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),Object(l.a)(n))?n:void 0},o3.prototype.setProperty=function(e,t,n){return!(!Object(l.a)(this._metadataTable)||!this._metadataTable.setProperty(e,t,n))||(!(!Object(l.a)(this._jsonMetadataTable)||!this._jsonMetadataTable.setProperty(e,t,n))||Object(l.a)(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))},o3.prototype.getPropertyBySemantic=function(e,t){if(Object(l.a)(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)},o3.prototype.setPropertyBySemantic=function(e,t,n){return!!Object(l.a)(this._metadataTable)&&this._metadataTable.setPropertyBySemantic(e,t,n)},o3.prototype.getPropertyTypedArray=function(e){if(s.a.typeOf.string("propertyId",e),Object(l.a)(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)},o3.prototype.getPropertyTypedArrayBySemantic=function(e){if(s.a.typeOf.string("semantic",e),Object(l.a)(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)},o3.prototype.isClass=function(e,t){s3(e,this.count),s.a.typeOf.string("className",t);const n=this._batchTableHierarchy;return!!Object(l.a)(n)&&n.isClass(e,t)},o3.prototype.isExactClass=function(e,t){return s3(e,this.count),s.a.typeOf.string("className",t),this.getExactClassName(e)===t},o3.prototype.getExactClassName=function(e){s3(e,this.count);const t=this._batchTableHierarchy;if(Object(l.a)(t))return t.getClassName(e)};var c3=o3;function l3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).property,n=e.classProperty,i=e.textures;s.a.typeOf.object("options.property",t),s.a.typeOf.object("options.classProperty",n),s.a.typeOf.object("options.textures",i);const r=Object(l.a)(t.channels)?t.channels:[0],o=t,a=GK.createModelTextureReader({textureInfo:o,channels:d3(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let u=t.offset,h=t.scale;const d=n.hasValueTransform||Object(l.a)(u)||Object(l.a)(h);u=Object(c.a)(u,n.offset),h=Object(c.a)(h,n.scale),u=n.unpackVectorAndMatrixTypes(u),h=n.unpackVectorAndMatrixTypes(h),this._offset=u,this._scale=h,this._hasValueTransform=d,this._textureReader=a,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(l3.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),l3.prototype.isGpuCompatible=function(){const e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?!e.isVariableLengthArray&&e.arrayLength<=4&&t===ZX.SCALAR&&n===KX.UINT8:!(!ZX.isVectorType(t)&&t!==ZX.SCALAR)&&n===KX.UINT8};const u3=[void 0,"float","vec2","vec3","vec4"],h3=[void 0,"int","ivec2","ivec3","ivec4"];function d3(e){return e.map((function(e){return"rgba".charAt(e)})).join("")}l3.prototype.getGlslType=function(){const e=this._classProperty;let t=ZX.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?u3[t]:h3[t]},l3.prototype.unpackInShader=function(e){if(this._classProperty.normalized)return e;return`${this.getGlslType()}(255.0 * ${e})`};var f3=l3;function p3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).propertyTexture,n=e.class,i=e.textures;s.a.typeOf.object("options.propertyTexture",t),s.a.typeOf.object("options.class",n),s.a.typeOf.object("options.textures",i);const r=t.extensions,o=t.extras,a={};if(Object(l.a)(t.properties))for(const e in t.properties)t.properties.hasOwnProperty(e)&&(a[e]=new f3({property:t.properties[e],classProperty:n.properties[e],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=a,this._extras=o,this._extensions=r}Object.defineProperties(p3.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),p3.prototype.getProperty=function(e){return s.a.typeOf.string("propertyId",e),this._properties[e]};var m3=p3;function g3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).property,n=e.classProperty;s.a.typeOf.object("options.property",t),s.a.typeOf.object("options.classProperty",n),this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale;const o=n.hasValueTransform||Object(l.a)(i)||Object(l.a)(r);i=Object(c.a)(i,n.offset),r=Object(c.a)(r,n.scale),i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}function _3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).propertyAttribute,n=e.class;s.a.typeOf.object("options.propertyAttribute",t),s.a.typeOf.object("options.class",n);const i={};if(Object(l.a)(t.properties))for(const e in t.properties)t.properties.hasOwnProperty(e)&&(i[e]=new g3({property:t.properties[e],classProperty:n.properties[e]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}function y3(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.schema",e.schema),this._schema=e.schema;const t=e.propertyTables;this._propertyTableCount=Object(l.a)(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(g3.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),Object.defineProperties(_3.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),_3.prototype.getProperty=function(e){return s.a.typeOf.string("propertyId",e),this._properties[e]},Object.defineProperties(y3.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!Object(l.a)(this._propertyTables))return 0;let e=0;const t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}}),y3.prototype.getPropertyTable=function(e){return s.a.typeOf.number("propertyTableId",e),this._propertyTables[e]},y3.prototype.getPropertyTexture=function(e){return s.a.typeOf.number("propertyTextureId",e),this._propertyTextures[e]},y3.prototype.getPropertyAttribute=function(e){return s.a.typeOf.number("propertyAttributeId",e),this._propertyAttributes[e]};var b3=y3;function v3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).extension,n=e.schema;s.a.typeOf.object("options.extension",t),s.a.typeOf.object("options.schema",n);const i=[];if(Object(l.a)(t.propertyTables))for(let r=0;r<t.propertyTables.length;r++){const o=t.propertyTables[r],a=n.classes[o.class],s=new mK({count:o.count,properties:o.properties,class:a,bufferViews:e.bufferViews});i.push(new c3({id:r,name:o.name,count:o.count,metadataTable:s,extras:o.extras,extensions:o.extensions}))}const r=[];if(Object(l.a)(t.propertyTextures))for(let i=0;i<t.propertyTextures.length;i++){const o=t.propertyTextures[i];r.push(new m3({id:i,name:o.name,propertyTexture:o,class:n.classes[o.class],textures:e.textures}))}const o=[];if(Object(l.a)(t.propertyAttributes))for(let e=0;e<t.propertyAttributes.length;e++){const i=t.propertyAttributes[e];o.push(new _3({id:e,name:i.name,class:n.classes[i.class],propertyAttribute:i}))}return new b3({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function O3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).extension,n=e.schema;let i;s.a.typeOf.object("options.extension",t),s.a.typeOf.object("options.schema",n);const r=[];let o;if(Object(l.a)(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){const a=o[i],s=t.featureTables[a],c=n.classes[s.class],l=new mK({count:s.count,properties:s.properties,class:c,bufferViews:e.bufferViews});r.push(new c3({id:a,count:s.count,metadataTable:l,extras:s.extras,extensions:s.extensions}))}const a=[];if(Object(l.a)(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){const r=o[i],s=t.featureTextures[r];a.push(new m3({id:r,propertyTexture:w3(s),class:n.classes[s.class],textures:e.textures}))}return new b3({schema:n,propertyTables:r,propertyTextures:a,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function w3(e){const t={class:e.class,properties:{}},n=e.properties;for(const e in n)if(n.hasOwnProperty(e)){const i=n[e],r={channels:A3(i.channels),extras:i.extras,extensions:i.extensions};t.properties[e]=Object(up.a)(i.texture,r,!0)}return t}function A3(e){const t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}function E3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltf,n=e.extension,i=e.extensionLegacy,r=e.gltfResource,o=e.baseResource,a=e.supportedImageFormats,h=e.cacheKey,d=Object(c.a)(e.asynchronous,!0);if(s.a.typeOf.object("options.gltf",t),s.a.typeOf.object("options.gltfResource",r),s.a.typeOf.object("options.baseResource",o),s.a.typeOf.object("options.supportedImageFormats",a),!Object(l.a)(e.extension)&&!Object(l.a)(e.extensionLegacy))throw new u.a("One of options.extension or options.extensionLegacy must be specified");this._gltfResource=r,this._baseResource=o,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=a,this._cacheKey=h,this._asynchronous=d,this._bufferViewLoaders=[],this._textureLoaders=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=_K.UNLOADED,this._promise=void 0}function T3(e,t){for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],r=i.values,o=i.arrayOffsets,a=i.stringOffsets;Object(l.a)(r)&&(t[r]=!0),Object(l.a)(o)&&(t[o]=!0),Object(l.a)(a)&&(t[a]=!0)}}function C3(e,t){for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,a=i.stringOffsetBufferView;Object(l.a)(r)&&(t[r]=!0),Object(l.a)(o)&&(t[o]=!0),Object(l.a)(a)&&(t[a]=!0)}}function x3(e,t){for(const n in e)if(e.hasOwnProperty(n)){const i=e[n];t[i.index]=i}}function S3(e,t){for(const n in e)if(e.hasOwnProperty(n)){const i=e[n].texture;t[i.index]=i}}function I3(e){const t=e._bufferViewLoaders,n=t.length;for(let e=0;e<n;++e)bJ.unload(t[e]);e._bufferViewLoaders.length=0}Object(l.a)(Object.create)&&(E3.prototype=Object.create(gK.prototype),E3.prototype.constructor=E3),Object.defineProperties(E3.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}}),E3.prototype.load=function(){const e=function(e){let t;t=Object(l.a)(e._extension)?function(e){const t=e.propertyTables,n={};if(Object(l.a)(t))for(let e=0;e<t.length;e++){T3(t[e].properties,n)}return n}(e._extension):function(e){const t=e.featureTables,n={};if(Object(l.a)(t))for(const e in t)if(t.hasOwnProperty(e)){const i=t[e].properties;Object(l.a)(i)&&C3(i,n)}return n}(e._extensionLegacy);const n=[],i={};for(const r in t)if(t.hasOwnProperty(r)){const t=bJ.loadBufferView({gltf:e._gltf,bufferViewId:parseInt(r),gltfResource:e._gltfResource,baseResource:e._baseResource});n.push(t.promise),e._bufferViewLoaders.push(t),i[r]=t}return Promise.all(n).then((function(){const t={};for(const e in i)if(i.hasOwnProperty(e)){const n=i[e],r=new Uint8Array(n.typedArray);t[e]=r}return I3(e),t}))}(this),t=function(e){let t;t=Object(l.a)(e._extension)?function(e){const t={},n=e.propertyTextures;if(Object(l.a)(n))for(let e=0;e<n.length;e++){const i=n[e].properties;Object(l.a)(i)&&x3(i,t)}return t}(e._extension):function(e){const t={},n=e.featureTextures;if(Object(l.a)(n))for(const e in n)if(n.hasOwnProperty(e)){const i=n[e].properties;Object(l.a)(i)&&S3(i,t)}return t}(e._extensionLegacy);const n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,a=e._asynchronous,s=[],c={};for(const l in t)if(t.hasOwnProperty(l)){const u=bJ.loadTexture({gltf:n,textureInfo:t[l],gltfResource:i,baseResource:r,supportedImageFormats:o,asynchronous:a});s.push(u.promise),e._textureLoaders.push(u),c[l]=u}return Promise.all(s).then((function(){const e={};for(const t in c)if(c.hasOwnProperty(t)){const n=c[t];e[t]=n.texture}return e}))}(this),n=function(e){const t=Object(c.a)(e._extension,e._extensionLegacy);let n;if(Object(l.a)(t.schemaUri)){const i=e._baseResource.getDerivedResource({url:t.schemaUri});n=bJ.loadSchema({resource:i})}else n=bJ.loadSchema({schema:t.schema});return e._schemaLoader=n,n.promise.then((function(e){return e.schema}))}(this);this._gltf=void 0,this._state=_K.LOADING;const i=this;this._promise=Promise.all([e,t,n]).then((function(e){if(i.isDestroyed())return;const t=e[0],n=e[1],r=e[2];return Object(l.a)(i._extension)?i._structuralMetadata=v3({extension:i._extension,schema:r,bufferViews:t,textures:n}):i._structuralMetadata=O3({extension:i._extensionLegacy,schema:r,bufferViews:t,textures:n}),i._state=_K.READY,i})).catch((function(e){if(i.isDestroyed())return;i.unload(),i._state=_K.FAILED;return Promise.reject(i.getError("Failed to load structural metadata",e))}))},E3.prototype.process=function(e){if(s.a.typeOf.object("frameState",e),this._state!==_K.LOADING)return;const t=this._textureLoaders,n=t.length;for(let i=0;i<n;++i){t[i].process(e)}},E3.prototype.unload=function(){I3(this),function(e){const t=e._textureLoaders,n=t.length;for(let e=0;e<n;++e)bJ.unload(t[e]);e._textureLoaders.length=0}(this),Object(l.a)(this._schemaLoader)&&bJ.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};const P3={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID",fromGltfSemantic:function(e){s.a.typeOf.string("gltfSemantic",e);let t=e;const n=/^(\w+)_\d+$/.exec(e);switch(null!==n&&(t=n[1]),t){case"TRANSLATION":return P3.TRANSLATION;case"ROTATION":return P3.ROTATION;case"SCALE":return P3.SCALE;case"_FEATURE_ID":return P3.FEATURE_ID}}};var D3=Object.freeze(P3);function R3(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;s.a.typeOf.object("options.triangleIndices",t),s.a.typeOf.object("options.outlineIndices",n),s.a.typeOf.number("options.originalVertexCount",i),this._triangleIndices=t,this._originalVertexCount=i,this._edges=new B3(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],function(e){let t=e._triangleIndices;const n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,a={};for(let e=0;e<t.length;e+=3){let s=t[e],c=t[e+1],u=t[e+2];const h=!1,d=h||n.hasEdge(s,c),f=h||n.hasEdge(c,u),p=h||n.hasEdge(u,s);let m=j3(i,s,c,u,d,f,p);for(;Object(l.a)(m);){let n=a[m];if(!Object(l.a)(n)){n=o+r.length;let e=m;for(;e>=o;)e=r[e-o];r.push(e),a[m]=n}n>65534&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):n>255&&t instanceof Uint8Array&&(t=new Uint16Array(t)),m===s?(s=n,t[e]=n):m===c?(c=n,t[e+1]=n):(u=n,t[e+2]=n),m=j3(i,s,c,u,d,f,p)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}(this)}function j3(e,t,n,i,r,o,a){const s=a?1:0,c=r?1:0,l=M3(e,t,s,c,0);if(0===l)return t;const u=r?1:0,h=o?1:0,d=M3(e,n,0,u,h);if(0===d)return n;const f=a?1:0,p=o?1:0,m=M3(e,i,f,0,p);if(0===m)return i;const g=l&d&m;let _,y,b;if(1&g)_=0,y=1,b=2;else if(2&g)_=0,b=1,y=2;else if(4&g)y=0,_=1,b=2;else if(8&g)y=0,b=1,_=2;else if(16&g)b=0,_=1,y=2;else{if(!(32&g)){const e=L3(l),r=L3(d),o=L3(m);return e<r&&e<o?t:r<o?n:i}b=0,y=1,_=2}const v=3*t;e[v+_]=s,e[v+y]=c,e[v+b]=0;const O=3*n;e[O+_]=0,e[O+y]=u,e[O+b]=h;const w=3*i;e[w+_]=f,e[w+y]=0,e[w+b]=p}function M3(e,t,n,i,r){const o=3*t,a=e[o],s=e[o+1],c=e[o+2];return Object(l.a)(a)?(a===n&&s===i&&c===r)<<0|(a===n&&s===r&&c===i)<<1|(a===i&&s===n&&c===r)<<2|(a===i&&s===r&&c===n)<<3|(a===r&&s===n&&c===i)<<4|(a===r&&s===i&&c===n)<<5:63}function L3(e){return(1&e)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function N3(e){const t=new Uint8Array(e);return t[e-1]=192,8===e?t[e-1]=96:4===e?t[e-1]=48:2===e?t[e-1]=24:1===e&&(t[e-1]=12),t}function B3(e,t){this._originalVertexCount=t,this._edges=new Set;for(let t=0;t<e.length;t+=2){const n=e[t],i=e[t+1],r=Math.min(n,i),o=Math.max(n,i),a=r*this._originalVertexCount+o;this._edges.add(a)}}function F3(e){s.a.typeOf.object("attribute",e),this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function z3(e){s.a.typeOf.object("primitive",e),this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}Object.defineProperties(R3.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}}),R3.prototype.updateAttribute=function(e){const t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=new(0,e.constructor)(e.length+r*i);o.set(e);for(let e=0;e<r;e++){const r=t[e]*i,a=n+e*i;for(let e=0;e<i;e++)o[a+e]=o[r+e]}return o},R3.createTexture=function(e){let t=e.cache.modelOutliningCache;if(Object(l.a)(t)||(t=e.cache.modelOutliningCache={}),Object(l.a)(t.outlineTexture))return t.outlineTexture;const n=Math.min(4096,MD.maximumTextureSize);let i=n;const r=N3(i),o=[];for(;i>1;)i>>=1,o.push(N3(i));const a=new JD({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:aT.LUMINANCE,sampler:new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.LINEAR_MIPMAP_LINEAR,magnificationFilter:kD.LINEAR})});return t.outlineTexture=a,a},B3.prototype.hasEdge=function(e,t){const n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)},z3.prototype.postProcess=function(e){this.needsOutlines&&(function(e){const t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new R3({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=wc.fromTypedArray(n.typedArray);const o=new F3(function(e){const t=new UK.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=gs.FLOAT,t.type=Cs.VEC3,t.normalized=!1,t.count=e.length/3,t}(r.outlineCoordinates));o.loadBuffer=!0,o.loadTypedArray=!1,e.attributePlans.push(o),t.outlineCoordinates=o.attribute;const a=e.attributePlans,s=e.attributePlans.length;for(let e=0;e<s;e++){const t=a[e].attribute;t.typedArray=r.updateAttribute(t.typedArray)}}(this),function(e,t){(function(e,t){const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=n.attribute,o=r.typedArray;if(n.loadBuffer){const e=ZN.createVertexBuffer({typedArray:o,context:t,usage:KN.STATIC_DRAW});e.vertexArrayDestroyable=!1,r.buffer=e}n.loadTypedArray||(r.typedArray=void 0)}})(e.attributePlans,t),Object(l.a)(e.indicesPlan)&&function(e,t){const n=e.indices;if(e.loadBuffer){const e=ZN.createIndexBuffer({typedArray:n.typedArray,context:t,usage:KN.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=e,e.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}(e.indicesPlan,t)}(this,e))},z3.AttributeLoadPlan=F3,z3.IndicesLoadPlan=function(e){s.a.typeOf.object("indices",e),this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1};var k3=z3;function U3(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.webp=Object(c.a)(e.webp,!1),this.basis=Object(c.a)(e.basis,!1)}const V3=UK.Attribute,H3=UK.Indices,G3=UK.FeatureIdAttribute,q3=UK.FeatureIdTexture,W3=UK.FeatureIdImplicitRange,Y3=UK.MorphTarget,X3=UK.Primitive,K3=UK.Instances,J3=UK.Skin,Z3=UK.Node,$3=UK.AnimatedPropertyType,Q3=UK.AnimationSampler,e4=UK.AnimationTarget,t4=UK.AnimationChannel,n4=UK.Animation,i4=UK.ArticulationStage,r4=UK.Articulation,o4=UK.Asset,a4=UK.Scene,s4=UK.Components,c4=UK.MetallicRoughness,l4=UK.SpecularGlossiness,u4=UK.Material,h4=0,d4=1,f4=2,p4=3,m4=4,g4=5,_4=6,y4=7,b4=8;function v4(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).gltfResource;let n=e.baseResource;const i=e.typedArray,r=Object(c.a)(e.releaseGltfJson,!1),o=Object(c.a)(e.asynchronous,!0),a=Object(c.a)(e.incrementallyLoadTextures,!0),u=Object(c.a)(e.upAxis,HU.Y),h=Object(c.a)(e.forwardAxis,HU.Z),d=Object(c.a)(e.loadAttributesAsTypedArray,!1),f=Object(c.a)(e.loadAttributesFor2D,!1),p=Object(c.a)(e.loadIndicesForWireframe,!1),m=Object(c.a)(e.loadPrimitiveOutline,!0),g=Object(c.a)(e.renameBatchIdSemantic,!1);s.a.typeOf.object("options.gltfResource",t),n=Object(l.a)(n)?n:t.clone(),this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=n,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=a,this._upAxis=u,this._forwardAxis=h,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=f,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=m,this._renameBatchIdSemantic=g,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=h4,this._textureState=h4,this._promise=void 0,this._texturesLoadedPromise=void 0,this._process=function(e,t){},this._processTextures=function(e,t){},this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._structuralMetadataLoader=void 0,this._postProcessBuffers=[],this._components=void 0}function O4(e,t){e.unload();return t=e.getError("Failed to load glTF",t),Promise.reject(t)}function w4(e,t){const n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;Object(l.a)(r)&&n.push(r.buffer);const o=i.attributes,a=o.length;for(let e=0;e<a;e++){const t=o[e];Object(l.a)(t.buffer)&&n.push(t.buffer)}const s=i.indices;Object(l.a)(s)&&Object(l.a)(s.buffer)&&n.push(s.buffer)}function A4(e,t,n){let i=t.byteOffset;const r=VV(e,t),o=t.count,a=UV(t.type),s=t.componentType,c=gs.getSizeInBytes(s),l=o*a;if(r===c*a)return n=new Uint8Array(n),gs.createArrayBufferView(s,n.buffer,n.byteOffset+i,l);const u=gs.createTypedArray(s,l),h=new DataView(n.buffer),d=new Array(a),f=$V(t.componentType);i=n.byteOffset+i;for(let e=0;e<o;++e){f(h,i,a,c,d);for(let t=0;t<a;++t)u[e*a+t]=d[t];i+=r}return u}function E4(e,t,n,i){const r=t.accessors[n],o=r.count,a=new Array(o),s=r.bufferView;if(Object(l.a)(s)){const n=function(e,t,n){const i=bJ.loadBufferView({gltf:t,bufferViewId:n,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(i),i}(e,t,s).promise.then((function(n){if(e.isDestroyed())return;const o=n.typedArray,s=A4(t,r,o);i=Object(c.a)(i,!1),function(e,t,n,i){const r=e.type,o=e.count;if(r===Cs.SCALAR)for(let e=0;e<o;e++)n[e]=t[e];else if(r===Cs.VEC4&&i)for(let e=0;e<o;e++)n[e]=To.unpack(t,4*e);else{const e=Cs.getMathType(r),i=Cs.getNumberOfComponents(r);for(let r=0;r<o;r++)n[r]=e.unpack(t,r*i)}}(r,s,a,i)}));return e._loaderPromises.push(n),a}return function(e,t){const n=e.type;if(n===Cs.SCALAR)return t.fill(0);const i=Cs.getMathType(n);return t.fill(i.clone(i.ZERO))}(r,a)}function T4(e,t){if(Object(l.a)(t))return e===Number?t[0]:e.unpack(t)}function C4(e,t,n,i,r){const o=e.accessors[t],a=Cs.getMathType(o.type),s=new V3;return s.name=n,s.semantic=i,s.setIndex=r,s.constant=function(e){return e===Number?0:new e}(a),s.componentDatatype=o.componentType,s.normalized=Object(c.a)(o.normalized,!1),s.count=o.count,s.type=o.type,s.min=T4(a,o.min),s.max=T4(a,o.max),s.byteOffset=o.byteOffset,s.byteStride=VV(e,o),s}function x4(e){const t=/^\w+_(\d+)$/.exec(e);if(null!==t)return parseInt(t[1])}Object(l.a)(Object.create)&&(v4.prototype=Object.create(gK.prototype),v4.prototype.constructor=v4),Object.defineProperties(v4.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}},texturesLoadedPromise:{get:function(){return this._texturesLoadedPromise}}}),v4.prototype.load=function(){const e=bJ.loadGltfJson({gltfResource:this._gltfResource,baseResource:this._baseResource,typedArray:this._typedArray,gltfJson:this._gltfJson});this._gltfJsonLoader=e,this._state=d4,this._textureState=d4;const t=this;let n;const i=new Promise((function(e,i){n=new Promise((function(n,r){t._process=function(t,n){if(Jr.supportsWebP.initialized){if(t._state===f4){t._state=p4;const e=new U3({webp:Jr.supportsWebP(),basis:n.context.supportsBasis});let o;o=Object(l.a)(t._gltfJsonLoader)?t._gltfJsonLoader.gltf:t._gltfJson,function(e,t,n,i,r,o){const a=Object(c.a)(t.extensions,c.a.EMPTY_OBJECT),s=a.EXT_structural_metadata,u=a.EXT_feature_metadata;if(Object(l.a)(u)){const t=u.featureTables,n=u.featureTextures,i=Object(l.a)(t)?t:[],r=Object(l.a)(n)?n:[];e._sortedPropertyTableIds=Object.keys(i).sort(),e._sortedFeatureTextureIds=Object.keys(r).sort()}const h=function(e,t,n,i){let r,o;const a=t.nodes.length,s=new Array(a);for(r=0;r<a;++r){const o=G4(e,t,t.nodes[r],n,i);o.index=r,s[r]=o}for(r=0;r<a;++r){const e=t.nodes[r].children;if(Object(l.a)(e)){const t=e.length;for(o=0;o<t;++o)s[r].children.push(s[e[o]])}}return s}(e,t,n,i),d=function(e,t,n){let i;const r=t.skins;if(!Object(l.a)(r))return[];const o=t.skins.length,a=new Array(o);for(i=0;i<o;++i){const r=q4(e,t,t.skins[i],n);r.index=i,a[i]=r}const s=n.length;for(i=0;i<s;++i){const e=t.nodes[i].skin;Object(l.a)(e)&&(n[i].skin=a[e])}return a}(e,t,h),f=function(e,t,n){let i;const r=t.animations;if(!Object(l.a)(r))return[];const o=t.animations.length,a=new Array(o);for(i=0;i<o;++i){const r=X4(e,t,t.animations[i],n);r.index=i,a[i]=r}return a}(e,t,h),p=function(e){const t=Object(c.a)(e.extensions,c.a.EMPTY_OBJECT).AGI_articulations;if(!Object(l.a)(t))return[];const n=t.articulations;if(!Object(l.a)(n))return[];const i=n.length,r=new Array(i);for(let e=0;e<i;e++){const t=J4(n[e]);r[e]=t}return r}(t),m=function(e,t){const n=new a4,i=function(e){let t;Object(l.a)(e.scenes)&&Object(l.a)(e.scene)&&(t=e.scenes[e.scene].nodes);return t=Object(c.a)(t,e.nodes),t=Object(l.a)(t)?t:[],t}(e);return n.nodes=i.map((function(e){return t[e]})),n}(t,h),g=new s4,_=new o4,y=t.asset.copyright;if(Object(l.a)(y)){const e=y.split(";").map((function(e){return new ln(e.trim())}));_.credits=e}if(g.asset=_,g.scene=m,g.nodes=h,g.skins=d,g.animations=f,g.articulations=p,g.upAxis=e._upAxis,g.forwardAxis=e._forwardAxis,e._components=g,Object(l.a)(s)||Object(l.a)(u)){const i=function(e,t,n,i,r){const o=new E3({gltf:t,extension:n,extensionLegacy:i,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:r,asynchronous:e._asynchronous});return o.load(),e._structuralMetadataLoader=o,o}(e,t,s,u,n).promise.then((function(t){e.isDestroyed()||(g.structuralMetadata=t.structuralMetadata)}));e._loaderPromises.push(i)}const b=[];b.push.apply(b,e._loaderPromises),e._incrementallyLoadTextures||b.push.apply(b,e._texturesPromises);Promise.all(b).then((function(){e.isDestroyed()||(e._state=m4)})).catch(r),Promise.all(e._texturesPromises).then((function(){e.isDestroyed()||(e._textureState=g4)})).catch(o)}(t,o,e,n,i,r),Object(l.a)(t._gltfJsonLoader)&&t._releaseGltfJson&&(bJ.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0)}t._state===p4&&function(e,t){const n=e._bufferViewLoaders,i=n.length;for(let e=0;e<i;++e)n[e].process(t);const r=e._geometryLoaders,o=r.length;for(let e=0;e<o;++e)r[e].process(t);Object(l.a)(e._structuralMetadataLoader)&&e._structuralMetadataLoader.process(t)}(t,n),t._state===m4&&(!function(e,t){const n=e._primitiveLoadPlans,i=n.length;for(let r=0;r<i;r++){const i=n[r];i.postProcess(t),i.needsOutlines&&w4(e,i)}}(t,n.context),t._state=g4),t._state===g4&&(Z4(t),t._state=_4,e(t))}else Jr.supportsWebP.initialize()},t._processTextures=function(e,t){if(e._textureState===f4&&(e._textureState=p4),e._textureState===p4){let n;const i=e._textureLoaders,r=i.length;for(n=0;n<r;++n)i[n].process(t)}e._textureState===g4&&(e._textureState=_4,n(e))}}))}));return this._promise=e.promise.then((function(){if(!t.isDestroyed())return t._state=f4,t._textureState=f4,i})).catch((function(e){if(!t.isDestroyed())return t._state=y4,t._textureState=y4,O4(t,e)})),this._texturesLoadedPromise=n.catch((function(e){if(!t.isDestroyed())return t._textureState=y4,O4(t,e)})),this._promise},v4.prototype.process=function(e){s.a.typeOf.object("frameState",e),this._process(this,e),this._processTextures(this,e)};const S4={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function I4(e,t,n){let i=n;!e._renameBatchIdSemantic||"_BATCHID"!==n&&"BATCHID"!==n||(i="_FEATURE_ID_0");const r=t.fromGltfSemantic(i),o=S4;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function P4(e,t,n,i,r,o,a,s){const c=t.accessors[n],u=c.bufferView,h=i.gltfSemantic,d=i.renamedSemantic,f=i.modelSemantic,p=Object(l.a)(f)?x4(d):void 0,m=C4(t,n,h,f,p);if(!Object(l.a)(r)&&!Object(l.a)(u))return m;const g=function(e,t,n,i,r,o,a,s){const c=t.accessors[n].bufferView,l=bJ.loadVertexBuffer({gltf:t,gltfResource:e._gltfResource,baseResource:e._baseResource,bufferViewId:c,draco:r,attributeSemantic:i,accessorId:n,asynchronous:e._asynchronous,dequantize:o,loadBuffer:a,loadTypedArray:s});return e._geometryLoaders.push(l),l}(e,t,n,h,r,o,a,s).promise.then((function(n){e.isDestroyed()||(Object(l.a)(r)&&Object(l.a)(r.attributes)&&Object(l.a)(r.attributes[h])?function(e,t,n,i){e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i&&(e.typedArray=gs.createArrayBufferView(t.quantization.componentDatatype,t.typedArray.buffer))}(m,n,a,s):function(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){const r=i.typedArray;n.typedArray=A4(e,t,r),n.byteOffset=0,n.byteStride=void 0}}(t,c,m,n,a,s))}));return e._loaderPromises.push(g),m}function D4(e,t,n,i,r,o,a,s){const c=I4(e,TZ,i),l=c.modelSemantic===TZ.POSITION&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,u=e._loadAttributesAsTypedArray,h=!u,d=u||l,f=P4(e,t,n,c,r,!1,!a&&h,!!a||d),p=new k3.AttributeLoadPlan(f);return p.loadBuffer=h,p.loadTypedArray=d,p}function R4(e,t,n,i,r,o){const a=Object(l.a)(i.ROTATION),s=Object(l.a)(i.TRANSLATION)&&Object(l.a)(t.accessors[i.TRANSLATION].min)&&Object(l.a)(t.accessors[i.TRANSLATION].max),c=I4(e,D3,r),u=c.modelSemantic,h=u===D3.TRANSLATION||u===D3.ROTATION||u===D3.SCALE,d=u===D3.TRANSLATION&&e._loadAttributesFor2D&&!o.scene3DOnly;let f=e._loadAttributesAsTypedArray||(a||!s)&&h||u===D3.FEATURE_ID||!o.context.instancedArrays;const p=!f;return f=f||d,P4(e,t,n,c,void 0,!0,p,f)}function j4(e,t,n,i,r,o){const a=t.accessors[n],s=a.bufferView;if(!Object(l.a)(i)&&!Object(l.a)(s))return;const c=new H3;c.count=a.count;const u=e._loadAttributesAsTypedArray,h=e._loadIndicesForWireframe&&!o.context.webgl2,d=!u,f=u||h,p=function(e,t,n,i,r,o){const a=bJ.loadIndexBuffer({gltf:t,accessorId:n,gltfResource:e._gltfResource,baseResource:e._baseResource,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o});return e._geometryLoaders.push(a),a}(e,t,n,i,!r&&d,!!r||f).promise.then((function(t){e.isDestroyed()||(c.indexDatatype=t.indexDatatype,c.buffer=t.buffer,c.typedArray=t.typedArray)}));e._loaderPromises.push(p);const m=new k3.IndicesLoadPlan(c);return m.loadBuffer=d,m.loadTypedArray=f,m}function M4(e,t,n,i,r){const o=GK.getImageIdFromTexture({gltf:t,textureId:n.index,supportedImageFormats:i});if(!Object(l.a)(o))return;const a=bJ.loadTexture({gltf:t,textureInfo:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:i,asynchronous:e._asynchronous});e._textureLoaders.push(a);const s=GK.createModelTextureReader({textureInfo:n}),c=a.promise.then((function(t){e.isUnloaded()||e.isDestroyed()||(s.texture=t.texture,Object(l.a)(r)&&(s.texture.sampler=r))}));return e._texturesPromises.push(c),s}function L4(e,t){const n=new G3;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function N4(e,t,n,i){const r=new G3,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=x4(o.attribute),r.positionalLabel=i,r}function B4(e,t){const n=new W3;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function F4(e,t,n,i){const r=new W3,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=Object(c.a)(o.constant,0);const a=Object(c.a)(o.divisor,0);return r.repeat=0===a?void 0:a,r.positionalLabel=i,r}function z4(e,t,n,i,r){const o=new q3;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=r;const a=n.texture;o.textureReader=M4(e,t,a,i,WD.NEAREST);const s=(Object(l.a)(a.channels)?a.channels:[0]).map((function(e){return"rgba".charAt(e)})).join("");return o.textureReader.channels=s,o}function k4(e,t,n,i,r,o,a){const s=new q3,c=n.featureIds,l=c.texture;return s.featureCount=o,s.propertyTableId=i,s.textureReader=M4(e,t,l,r,WD.NEAREST),s.textureReader.channels=c.channels,s.positionalLabel=a,s}function U4(e,t,n,i,r,o){const a=new Y3;for(const s in n)if(n.hasOwnProperty(s)){const c=D4(e,t,n[s],s,void 0,!1,i,o);a.attributes.push(c.attribute),r.attributePlans.push(c)}return a}function V4(e,t,n,i,r,o){const a=new X3,s=new k3(a);e._primitiveLoadPlans.push(s);const u=n.material;Object(l.a)(u)&&(a.material=function(e,t,n,i){const r=new u4,o=Object(c.a)(n.extensions,c.a.EMPTY_OBJECT),a=o.KHR_materials_pbrSpecularGlossiness,s=n.pbrMetallicRoughness;if(r.unlit=Object(l.a)(o.KHR_materials_unlit),Object(l.a)(a)){const n=new l4;r.specularGlossiness=n,Object(l.a)(a.diffuseTexture)&&(n.diffuseTexture=M4(e,t,a.diffuseTexture,i)),Object(l.a)(a.specularGlossinessTexture)&&Object(l.a)(a.specularGlossinessTexture)&&(n.specularGlossinessTexture=M4(e,t,a.specularGlossinessTexture,i)),n.diffuseFactor=T4(_e,a.diffuseFactor),n.specularFactor=T4(O,a.specularFactor),n.glossinessFactor=a.glossinessFactor,r.pbrSpecularGlossiness=a}else if(Object(l.a)(s)){const n=new c4;Object(l.a)(s.baseColorTexture)&&(n.baseColorTexture=M4(e,t,s.baseColorTexture,i)),Object(l.a)(s.metallicRoughnessTexture)&&(n.metallicRoughnessTexture=M4(e,t,s.metallicRoughnessTexture,i)),n.baseColorFactor=T4(_e,s.baseColorFactor),n.metallicFactor=s.metallicFactor,n.roughnessFactor=s.roughnessFactor,r.metallicRoughness=n}return Object(l.a)(n.emissiveTexture)&&(r.emissiveTexture=M4(e,t,n.emissiveTexture,i)),Object(l.a)(n.normalTexture)&&(r.normalTexture=M4(e,t,n.normalTexture,i)),Object(l.a)(n.occlusionTexture)&&(r.occlusionTexture=M4(e,t,n.occlusionTexture,i)),r.emissiveFactor=T4(O,n.emissiveFactor),r.alphaMode=n.alphaMode,r.alphaCutoff=n.alphaCutoff,r.doubleSided=n.doubleSided,r}(e,t,t.materials[u],r));const h=Object(c.a)(n.extensions,c.a.EMPTY_OBJECT);let d=!1;const f=h.CESIUM_primitive_outline;e._loadPrimitiveOutline&&Object(l.a)(f)&&(d=!0,s.needsOutlines=!0,s.outlineIndices=function(e,t,n){const i=n.indices;return E4(e,t,i,!1)}(e,t,f));const p=h.KHR_draco_mesh_compression,m=n.attributes;if(Object(l.a)(m))for(const n in m)if(m.hasOwnProperty(n)){const r=D4(e,t,m[n],n,p,i,d,o);s.attributePlans.push(r),a.attributes.push(r.attribute)}const g=n.targets;if(Object(l.a)(g)){const n=g.length;for(let i=0;i<n;++i)a.morphTargets.push(U4(e,t,g[i],d,s,o))}const _=n.indices;if(Object(l.a)(_)){const n=j4(e,t,_,p,d,o);Object(l.a)(n)&&(s.indicesPlan=n,a.indices=n.indices)}const y=h.EXT_structural_metadata,b=h.EXT_mesh_features,v=h.EXT_feature_metadata,w=Object(l.a)(v);return Object(l.a)(b)?function(e,t,n,i,r){let o;o=Object(l.a)(i)&&Object(l.a)(i.featureIds)?i.featureIds:[];for(let i=0;i<o.length;i++){const a=o[i],s="featureId_"+i;let c;c=Object(l.a)(a.texture)?z4(e,t,a,r,s):Object(l.a)(a.attribute)?L4(a,s):B4(a,s),n.featureIds.push(c)}}(e,t,a,b,r):w&&function(e,t,n,i,r){const o=t.extensions.EXT_feature_metadata.featureTables;let a=0;const s=i.featureIdAttributes;if(Object(l.a)(s)){const t=s.length;for(let i=0;i<t;++i){const t=s[i],r=t.featureTable,c=e._sortedPropertyTableIds.indexOf(r),u=o[r].count,h="featureId_"+a;let d;a++,d=Object(l.a)(t.featureIds.attribute)?N4(t,c,u,h):F4(t,c,u,h),n.featureIds.push(d)}}const c=i.featureIdTextures;if(Object(l.a)(c)){const i=c.length;for(let s=0;s<i;++s){const i=c[s],l=i.featureTable,u=e._sortedPropertyTableIds.indexOf(l),h=o[l].count,d="featureId_"+a;a++;const f=k4(e,t,i,u,r,h,d);n.featureIds.push(f)}}}(e,t,a,v,r),Object(l.a)(y)?function(e,t){if(!Object(l.a)(t))return;Object(l.a)(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures);Object(l.a)(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes)}(a,y):w&&function(e,t,n){Object(l.a)(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map((function(t){return e._sortedFeatureTextureIds.indexOf(t)})))}(e,a,v),a.primitiveType=n.mode,a}function H4(e,t,n,i){const r=n.EXT_mesh_gpu_instancing,o=new K3,a=r.attributes;if(Object(l.a)(a))for(const n in a)if(a.hasOwnProperty(n)){const r=a[n];o.attributes.push(R4(e,t,r,a,n,i))}const s=Object(c.a)(r.extensions,c.a.EMPTY_OBJECT),u=n.EXT_instance_features,h=s.EXT_feature_metadata;return Object(l.a)(u)?function(e,t){const n=t.featureIds;for(let t=0;t<n.length;t++){const i=n[t],r="instanceFeatureId_"+t;let o;o=Object(l.a)(i.attribute)?L4(i,r):B4(i,r),e.featureIds.push(o)}}(o,u):Object(l.a)(h)&&function(e,t,n,i){const r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(Object(l.a)(o)){const e=o.length;for(let n=0;n<e;++n){const e=o[n],a=e.featureTable,s=i.indexOf(a),c=r[a].count,u="instanceFeatureId_"+n;let h;h=Object(l.a)(e.featureIds.attribute)?N4(e,s,c,u):F4(e,s,c,u),t.featureIds.push(h)}}}(t,o,h,e._sortedPropertyTableIds),o}function G4(e,t,n,i,r){const o=new Z3;o.name=n.name,o.matrix=T4(Me,n.matrix),o.translation=T4(O,n.translation),o.rotation=T4(To,n.rotation),o.scale=T4(O,n.scale);const a=Object(c.a)(n.extensions,c.a.EMPTY_OBJECT),s=a.EXT_mesh_gpu_instancing,u=a.AGI_articulations;Object(l.a)(s)&&(o.instances=H4(e,t,a,r)),Object(l.a)(u)&&(o.articulationName=u.articulationName);const h=n.mesh;if(Object(l.a)(h)){const a=t.meshes[h],s=a.primitives,u=s.length;for(let n=0;n<u;++n)o.primitives.push(V4(e,t,s[n],Object(l.a)(o.instances),i,r));const d=Object(c.a)(n.weights,a.weights),f=o.primitives[0].morphTargets.length;o.morphWeights=Object(l.a)(d)?d.slice():new Array(f).fill(0)}return o}function q4(e,t,n,i){const r=new J3,o=n.joints,a=o.length,s=new Array(a);for(let e=0;e<a;++e)s[e]=i[o[e]];r.joints=s;const c=n.inverseBindMatrices;return Object(l.a)(c)?r.inverseBindMatrices=E4(e,t,c):r.inverseBindMatrices=new Array(a).fill(Me.IDENTITY),r}function W4(e,t,n){const i=new Q3,r=n.input;i.input=E4(e,t,r);const o=n.interpolation;i.interpolation=Object(c.a)(FA[o],FA.LINEAR);const a=n.output;return i.output=E4(e,t,a,!0),i}function Y4(e,t,n){const i=new t4,r=e.sampler;return i.sampler=t[r],i.target=function(e,t){const n=new e4,i=e.node;if(!Object(l.a)(i))return;n.node=t[i];const r=e.path.toUpperCase();return n.path=$3[r],n}(e.target,n),i}function X4(e,t,n,i){let r;const o=new n4;o.name=n.name;const a=n.samplers,s=a.length,c=new Array(s);for(r=0;r<s;r++){const n=W4(e,t,a[r]);n.index=r,c[r]=n}const l=n.channels,u=l.length,h=new Array(u);for(r=0;r<u;r++)h[r]=Y4(l[r],c,i);return o.samplers=c,o.channels=h,o}function K4(e){const t=new i4;t.name=e.name;const n=e.type.toUpperCase();return t.type=Al[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function J4(e){const t=new r4;t.name=e.name;const n=e.stages,i=n.length,r=new Array(i);for(let e=0;e<i;e++){const t=K4(n[e]);r[e]=t}return t.stages=r,t}function Z4(e){const t=e._bufferViewLoaders,n=t.length;for(let e=0;e<n;++e)bJ.unload(t[e]);e._bufferViewLoaders.length=0}v4.prototype.isUnloaded=function(){return this._state===b4},v4.prototype.unload=function(){var e;Object(l.a)(this._gltfJsonLoader)&&bJ.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,function(e){const t=e._textureLoaders,n=t.length;for(let e=0;e<n;++e)bJ.unload(t[e]);e._textureLoaders.length=0}(this),Z4(this),function(e){const t=e._geometryLoaders,n=t.length;for(let e=0;e<n;++e)bJ.unload(t[e]);e._geometryLoaders.length=0}(this),function(e){const t=e._postProcessBuffers,n=t.length;for(let e=0;e<n;e++){const n=t[e];n.isDestroyed()||n.destroy()}t.length=0}(this),e=this,Object(l.a)(e._structuralMetadataLoader)&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0),this._components=void 0,this._state=b4};const $4=UK.AnimatedPropertyType;function Q4(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).channel,n=e.runtimeAnimation,i=e.runtimeNode;s.a.typeOf.object("options.channel",t),s.a.typeOf.object("options.runtimeAnimation",n),s.a.typeOf.object("options.runtimeNode",i),this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,function(e){const t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,s=e._runtimeNode,c=Object(l.a)(s.morphWeights)?s.morphWeights.length:1,u=function(e,t,n,i,r){const o=[];if(i===$4.WEIGHTS){const a=t.length/r;let s,c;for(s=0;s<r;s++){const l=new Array(a);let u=s;if(n===FA.CUBICSPLINE)for(c=0;c<a;c+=3)l[c]=t[u],l[c+1]=t[u+r],l[c+2]=t[u+2*r],u+=3*r;else for(c=0;c<a;c++)l[c]=t[u],u+=r;o.push(e5(e,l,n,i))}}else o.push(e5(e,t,n,i));return o}(i,r,o,a,c);switch(e._splines=u,e._path=a,a){case $4.TRANSLATION:case $4.SCALE:t5=new O;break;case $4.ROTATION:t5=new To;break;case $4.WEIGHTS:}}(this)}function e5(e,t,n,i){if(1===e.length&&1===t.length)return new pp(t[0]);switch(n){case FA.STEP:return new RI({times:e,points:t});case FA.CUBICSPLINE:return function(e,t){const n=[],i=[],r=[],o=t.length;for(let e=0;e<o;e+=3)i.push(t[e]),n.push(t[e+1]),r.push(t[e+2]);return i.splice(0,1),r.length=r.length-1,new Mu({times:e,points:n,inTangents:i,outTangents:r})}(e,t);case FA.LINEAR:return i===$4.ROTATION?new jC({times:e,points:t}):new Eu({times:e,points:t})}}let t5;Object.defineProperties(Q4.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}}),Q4.prototype.animate=function(e){const t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===$4.WEIGHTS){const n=r.morphWeights,o=n.length;for(let r=0;r<o;r++){const o=t[r],a=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n[r]=o.evaluate(a)}}else{if(r.userAnimated)return;{const o=t[0],a=i.clampAnimations?o.clampTime(e):o.wrapTime(e);r[n]=o.evaluate(a,t5)}}};var n5=Q4;function i5(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=tr.clone(n.startTime),this._delay=Object(c.a)(n.delay,0),this._stopTime=tr.clone(n.stopTime),this.removeOnStop=Object(c.a)(n.removeOnStop,!1),this._multiplier=Object(c.a)(n.multiplier,1),this._reverse=Object(c.a)(n.reverse,!1),this._loop=Object(c.a)(n.loop,rW.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new un.a,this.update=new un.a,this.stop=new un.a,this._state=oW.STOPPED,this._computedStartTime=void 0,this._duration=void 0;const i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,function(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE;const i=e._model.sceneGraph,r=e._animation.channels,o=r.length,a=[];for(let s=0;s<o;s++){const o=r[s],c=o.target;if(!Object(l.a)(c))continue;const u=c.node.index,h=i._runtimeNodes[u],d=new n5({channel:o,runtimeAnimation:e,runtimeNode:h}),f=o.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(d)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}(this)}Object.defineProperties(i5.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}}),i5.prototype.animate=function(e){const t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var r5=i5;function o5(e){this.animationAdded=new un.a,this.animationRemoved=new un.a,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}function a5(e,t,n){const i=e._model,r=new r5(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}Object.defineProperties(o5.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}}),o5.prototype.add=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=this._model;if(!t.ready)throw new u.a("Animations are not loaded.  Wait for ModelExperimental.readyPromise to resolve.");const n=t.sceneGraph.components.animations;if(!Object(l.a)(e.name)&&!Object(l.a)(e.index))throw new u.a("Either options.name or options.index must be defined.");if(Object(l.a)(e.multiplier)&&e.multiplier<=0)throw new u.a("options.multiplier must be greater than zero.");if(Object(l.a)(e.index)&&(e.index>=n.length||e.index<0))throw new u.a("options.index must be a valid animation index.");let i=e.index;if(Object(l.a)(i))return a5(this,n[i],e);const r=n.length;for(let t=0;t<r;++t)if(n[t].name===e.name){i=t;break}if(!Object(l.a)(i))throw new u.a("options.name must be a valid animation name.");return a5(this,n[i],e)},o5.prototype.addAll=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=this._model;if(!t.ready)throw new u.a("Animations are not loaded.  Wait for Model.readyPromise to resolve.");if(Object(l.a)(e.multiplier)&&e.multiplier<=0)throw new u.a("options.multiplier must be greater than zero.");const n=t.sceneGraph.components.animations,i=[],r=n.length;for(let t=0;t<r;++t){const r=a5(this,n[t],e);i.push(r)}return i},o5.prototype.remove=function(e){if(!Object(l.a)(e))return!1;const t=this._runtimeAnimations,n=t.indexOf(e);return-1!==n&&(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0)},o5.prototype.removeAll=function(){const e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])},o5.prototype.contains=function(e){return!!Object(l.a)(e)&&-1!==this._runtimeAnimations.indexOf(e)},o5.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");if(e>=this._runtimeAnimations.length||e<0)throw new u.a("index must be valid within the range of the collection");return this._runtimeAnimations[e]};const s5=[];function c5(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}o5.prototype.update=function(e){const t=this._runtimeAnimations;let n=t.length;if(0===n)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&tr.equals(e.time,this._previousTime))return!1;this._previousTime=tr.clone(e.time,this._previousTime);let i=!1;const r=e.time,o=this._model;for(let o=0;o<n;++o){const n=t[o];Object(l.a)(n._computedStartTime)||(n._computedStartTime=tr.addSeconds(Object(c.a)(n.startTime,r),n.delay,new tr)),Object(l.a)(n._duration)||(n._duration=n.localStopTime*(1/n.multiplier));const a=n._computedStartTime,s=n._duration,u=n.stopTime,d=tr.lessThanOrEquals(a,r),f=Object(l.a)(u)&&tr.greaterThan(r,u);let p=0;if(0!==s){const e=tr.secondsDifference(f?u:r,a);p=Object(l.a)(n._animationTime)?n._animationTime(s,e):e/s}const m=n.loop===rW.REPEAT||n.loop===rW.MIRRORED_REPEAT,g=(d||m&&!Object(l.a)(n.startTime))&&(p<=1||m)&&!f;if(p===n._prevAnimationDelta){if(g!==(n._state===oW.STOPPED))continue}if(n._prevAnimationDelta=p,g||n._state===oW.ANIMATING){if(g&&n._state===oW.STOPPED&&(n._state=oW.ANIMATING,n.start.numberOfListeners>0&&e.afterRender.push(n._raiseStartEvent)),n.loop===rW.REPEAT)p-=Math.floor(p);else if(n.loop===rW.MIRRORED_REPEAT){const e=Math.floor(p),t=p-e;p=e%2==1?1-t:t}n.reverse&&(p=1-p);let t=p*s*n.multiplier;t=h.a.clamp(t,n.localStartTime,n.localStopTime),n.animate(t),n.update.numberOfListeners>0&&(n._updateEventTime=t,e.afterRender.push(n._raiseUpdateEvent)),i=!0,g||(n._state=oW.STOPPED,n.stop.numberOfListeners>0&&e.afterRender.push(n._raiseStopEvent),n.removeOnStop&&s5.push(n))}}n=s5.length;for(let i=0;i<n;++i){const n=s5[i];t.splice(t.indexOf(n),1),e.afterRender.push(c5(this,o,n))}return s5.length=0,i};var l5=o5;const u5={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2,getStyleCommandsNeeded:function(e,t){return 0===t?u5.ALL_OPAQUE:t===e?u5.ALL_TRANSLUCENT:u5.OPAQUE_AND_TRANSLUCENT}};var h5=Object.freeze(u5);function d5(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).command,n=e.primitiveRenderResources,i=Object(c.a)(e.useSilhouetteCommands,!1);s.a.typeOf.object("options.command",t),s.a.typeOf.object("options.primitiveRenderResources",n),this._command=t,this._translucentCommand=void 0,this._modelMatrix=Me.clone(t.modelMatrix,new Me),this._modelMatrix2DDirty=!1,this._styleCommandsNeeded=n.styleCommandsNeeded,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=n.model.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._useSilhouetteCommands=i,this._commandList=[],this._commandList2D=[],this._silhouetteCommandList=[],this._silhouetteCommandList2D=[],this._runtimePrimitive=n.runtimePrimitive,this._model=n.model,function(e){const t=e._command,n=e._styleCommandsNeeded;if(Object(l.a)(n)&&t.pass!==KR.TRANSLUCENT){const i=function(e){const t=XR.shallowClone(e);t.pass=KR.TRANSLUCENT;const n=Object(Zf.a)(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=SD.ALPHA_BLEND,t.renderState=vj.fromCache(n),t}(t);switch(n){case h5.ALL_OPAQUE:break;case h5.ALL_TRANSLUCENT:case h5.OPAQUE_AND_TRANSLUCENT:e._translucentCommand=i;break;default:throw new ye.a("styleCommandsNeeded is not a valid value.")}}!function(e){const t=e._commandList,n=e._commandList2D;t.length=0,n.length=0;const i=e._styleCommandsNeeded,r=e._command,o=e._translucentCommand;if(Object(l.a)(i)&&Object(l.a)(o))switch(i){case h5.ALL_OPAQUE:t.push(r);break;case h5.ALL_TRANSLUCENT:t.push(o);break;case h5.OPAQUE_AND_TRANSLUCENT:t.push(r,o);break;default:throw new ye.a("styleCommandsNeeded is not a valid value.")}else t.push(r);if(e._useSilhouetteCommands){const n=t.length,i=[],r=e._model;for(let e=0;e<n;e++){const n=t[e],o=m5(n,r),a=g5(n,r);t[e]=o,i.push(a)}const o=e._silhouetteCommandList;o.push.apply(o,i)}}(e)}(this)}Object.defineProperties(d5.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=Me.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,function(e){const t=e.modelMatrix,n=e.runtimePrimitive.boundingSphere,i=e._commandList,r=i.length;for(let e=0;e<r;e++){const r=i[e];r.modelMatrix=Me.clone(t,r.modelMatrix),r.boundingVolume=At.transform(n,r.modelMatrix,r.boundingVolume)}if(!e._useSilhouetteCommands)return;const o=e._silhouetteCommandList;for(let e=0;e<r;e++){const i=o[e];i.modelMatrix=Me.clone(t,i.modelMatrix),i.boundingVolume=At.transform(n,i.modelMatrix,i.boundingVolume)}}(this)}},boundingVolume:{get:function(){return this._command.boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,function(e){const t=e.shadows,n=TB.castShadows(t),i=TB.receiveShadows(t),r=e.getAllCommands(),o=r.length;for(let e=0;e<o;e++){const t=r[e],o=t.uniformMap.model_silhouettePass;Object(l.a)(o)&&o()||(t.castShadows=n,t.receiveShadows=i)}}(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,function(e){let t=e.backFaceCulling;const n=e.runtimePrimitive.primitive.material.doubleSided,i=e._model.isTranslucent(),r=e._useSilhouetteCommands;t=t&&!n&&!i&&!r;const o=e.getAllCommands(),a=o.length;for(let e=0;e<a;e++){const n=o[e];if(n.pass===KR.TRANSLUCENT)continue;const i=Object(Zf.a)(n.renderState,!0);i.cull.enabled=t,n.renderState=vj.fromCache(i)}}(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,function(e){const t=e.cullFace,n=e.getAllCommands(),i=n.length;for(let e=0;e<i;e++){const i=n[e],r=Object(Zf.a)(i.renderState,!0);r.cull.face=t,i.renderState=vj.fromCache(r)}}(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,function(e){const t=e.debugShowBoundingVolume,n=e.getAllCommands(),i=n.length;for(let e=0;e<i;e++){n[e].debugShowBoundingVolume=t}}(this))}}});const f5=new Me;function p5(e){const t=XR.shallowClone(e);return t.modelMatrix=new Me,t.boundingVolume=new At,t}function m5(e,t){const n=t._silhouetteId%255,i=XR.shallowClone(e);let r=Object(Zf.a)(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:ps.ALWAYS,backFunction:ps.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.REPLACE},backOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.depthMask=!1),r=vj.fromCache(r),i.renderState=r,i}function g5(e,t){const n=t._silhouetteId%255,i=XR.shallowClone(e);let r=Object(Zf.a)(e.renderState,!0);r.depthTest.enabled=!0,r.cull.enabled=!1;(e.pass===KR.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=KR.TRANSLUCENT,r.depthMask=!1,r.blending=SD.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:ps.NOTEQUAL,backFunction:ps.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.KEEP},backOperation:{fail:ps.KEEP,zFail:ps.KEEP,zPass:ps.KEEP}},r=vj.fromCache(r);const o=Object(Zf.a)(e.uniformMap);return o.model_silhouettePass=function(){return!0},i.renderState=r,i.uniformMap=o,i.castShadows=!1,i.receiveShadows=!1,i}function _5(e,t){if(t.mode!==AB.SCENE2D||e.model._projectTo2D)return!1;const n=t.mapProjection.ellipsoid.maximumRadius*h.a.PI,i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius;return r<n&&o>n||r<-n&&o>-n}d5.prototype.getCommands=function(e){const t=this._commandList,n=this._commandList2D,i=_5(this,e);if(i&&0===n.length){const e=t.length;for(let i=0;i<e;i++){const e=p5(t[i]);n.push(e)}if(this._useSilhouetteCommands){const t=this._silhouetteCommandList,n=this._silhouetteCommandList2D;for(let i=0;i<e;i++){const e=p5(t[i]);n.push(e)}}this._modelMatrix2DDirty=!0}this._modelMatrix2DDirty&&(!function(e,t){const n=e.modelMatrix,i=e.runtimePrimitive.boundingSphere,r=e._commandList2D,o=r.length;if(0===o)return;const a=Me.clone(n,f5);a[13]-=2*h.a.sign(n[13])*h.a.PI*t.mapProjection.ellipsoid.maximumRadius;for(let e=0;e<o;e++){const t=r[e];t.modelMatrix=Me.clone(a,t.modelMatrix),t.boundingVolume=At.transform(i,t.modelMatrix,t.boundingVolume)}if(!e._useSilhouetteCommands)return;const s=e._silhouetteCommandList2D;for(let e=0;e<o;e++){const t=s[e];t.modelMatrix=Me.clone(a,t.modelMatrix),t.boundingVolume=At.transform(i,t.modelMatrix,t.boundingVolume)}}(this,e),this._modelMatrix2DDirty=!1);const r=[];return r.push.apply(r,t),i&&r.push.apply(r,n),r},d5.prototype.getSilhouetteCommands=function(e){if(!this._useSilhouetteCommands)return[];const t=[],n=this._silhouetteCommandList,i=this._silhouetteCommandList2D;return t.push.apply(t,n),_5(this,e)&&t.push.apply(t,i),t},d5.prototype.getAllCommands=function(){const e=[];return e.push.apply(e,this._commandList),e.push.apply(e,this._commandList2D),e.push.apply(e,this._silhouetteCommandList),e.push.apply(e,this._silhouetteCommandList2D),e};var y5=d5,b5="#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT)\n    #ifdef GL_OES_standard_derivatives\n    #extension GL_OES_standard_derivatives : enable\n    #endif\n#endif\n\nczm_modelMaterial defaultModelMaterial()\n{\n    czm_modelMaterial material;\n    material.diffuse = vec3(0.0);\n    material.specular = vec3(1.0);\n    material.roughness = 1.0;\n    material.occlusion = 1.0;\n    material.normalEC = vec3(0.0, 0.0, 1.0);\n    material.emissive = vec3(0.0);\n    material.alpha = 1.0;\n    return material;\n}\n\nvec4 handleAlpha(vec3 color, float alpha)\n{\n    #ifdef ALPHA_MODE_MASK\n    if (alpha < u_alphaCutoff) {\n        discard;\n    }\n    #endif\n\n    return vec4(color, alpha);\n}\n\nSelectedFeature selectedFeature;\n\nvoid main()\n{\n    #ifdef HAS_MODEL_SPLITTER\n    modelSplitterStage();\n    #endif\n\n    czm_modelMaterial material = defaultModelMaterial();\n\n    ProcessedAttributes attributes;\n    geometryStage(attributes);\n\n    FeatureIds featureIds;\n    featureIdStage(featureIds, attributes);\n\n    Metadata metadata;\n    MetadataClass metadataClass;\n    metadataStage(metadata, metadataClass, attributes);\n\n    #ifdef HAS_SELECTED_FEATURE_ID\n    selectedFeatureIdStage(selectedFeature, featureIds);\n    #endif\n\n    #ifndef CUSTOM_SHADER_REPLACE_MATERIAL\n    materialStage(material, attributes, selectedFeature);\n    #endif\n\n    #ifdef HAS_CUSTOM_FRAGMENT_SHADER\n    customShaderStage(material, attributes, featureIds, metadata, metadataClass);\n    #endif\n\n    lightingStage(material, attributes);\n\n    #ifdef HAS_SELECTED_FEATURE_ID\n    cpuStylingStage(material, selectedFeature);\n    #endif\n\n    #ifdef HAS_MODEL_COLOR\n    modelColorStage(material);\n    #endif\n\n    #ifdef HAS_PRIMITIVE_OUTLINE\n    primitiveOutlineStage(material);\n    #endif\n\n    vec4 color = handleAlpha(material.diffuse, material.alpha);\n\n    #ifdef HAS_CLIPPING_PLANES\n    modelClippingPlanesStage(color);\n    #endif\n\n    #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)\n    silhouetteStage(color);\n    #endif\n\n    gl_FragColor = color;\n}\n",v5="precision highp float;\n\nczm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {\n    czm_modelVertexOutput vsOutput;\n    vsOutput.positionMC = positionMC;\n    vsOutput.pointSize = 1.0;\n    return vsOutput;\n}\n\nvoid main() \n{\n    // Initialize the attributes struct with all\n    // attributes except quantized ones.\n    ProcessedAttributes attributes;\n    initializeAttributes(attributes);\n\n    // Dequantize the quantized ones and add them to the\n    // attributes struct.\n    #ifdef USE_DEQUANTIZATION\n    dequantizationStage(attributes);\n    #endif\n\n    #ifdef HAS_MORPH_TARGETS\n    morphTargetsStage(attributes);\n    #endif\n\n    #ifdef HAS_SKINNING\n    skinningStage(attributes);\n    #endif\n\n    #ifdef HAS_PRIMITIVE_OUTLINE\n    primitiveOutlineStage();\n    #endif\n\n    // Compute the bitangent according to the formula in the glTF spec.\n    // Normal and tangents can be affected by morphing and skinning, so\n    // the bitangent should not be computed until their values are finalized.\n    #ifdef HAS_BITANGENTS\n    attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);\n    #endif\n\n    FeatureIds featureIds;\n    featureIdStage(featureIds, attributes);\n\n    #ifdef HAS_SELECTED_FEATURE_ID\n    SelectedFeature feature;\n    selectedFeatureIdStage(feature, featureIds);\n    // Handle any show properties that come from the style.\n    cpuStylingStage(attributes.positionMC, feature);\n    #endif\n\n    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\n    // The scene mode 2D pipeline stage and instancing stage add a different\n    // model view matrix to accurately project the model to 2D. However, the\n    // output positions and normals should be transformed by the 3D matrices\n    // to keep the data the same for the fragment shader.\n    mat4 modelView = czm_modelView3D;\n    mat3 normal = czm_normal3D;\n    #else\n    // These are used for individual model projection because they will\n    // automatically change based on the scene mode.\n    mat4 modelView = czm_modelView;\n    mat3 normal = czm_normal;\n    #endif\n\n    // Update the position for this instance in place\n    #ifdef HAS_INSTANCING\n\n        // The legacy instance stage is used when rendering i3dm models that \n        // encode instances transforms in world space, as opposed to glTF models\n        // that use EXT_mesh_gpu_instancing, where instance transforms are encoded\n        // in object space.\n        #ifdef USE_LEGACY_INSTANCING\n        mat4 instanceModelView;\n        mat3 instanceModelViewInverseTranspose;\n        \n        legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);\n\n        modelView = instanceModelView;\n        normal = instanceModelViewInverseTranspose;\n        #else\n        instancingStage(attributes);\n        #endif\n\n        #ifdef USE_PICKING\n        v_pickColor = a_pickColor;\n        #endif\n\n    #endif\n\n    Metadata metadata;\n    MetadataClass metadataClass;\n    metadataStage(metadata, metadataClass, attributes);\n\n    #ifdef HAS_CUSTOM_VERTEX_SHADER\n    czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);\n    customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass);\n    #endif\n\n    // Compute the final position in each coordinate system needed.\n    // This returns the value that will be assigned to gl_Position.\n    vec4 positionClip = geometryStage(attributes, modelView, normal);    \n\n    #ifdef HAS_SILHOUETTE\n    silhouetteStage(attributes, positionClip);\n    #endif\n\n    #ifdef HAS_POINT_CLOUD_SHOW_STYLE\n    float show = pointCloudShowStylingStage(attributes, metadata);\n    #else\n    float show = 1.0;\n    #endif\n\n    #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n    v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);\n    #endif\n\n    #ifdef PRIMITIVE_TYPE_POINTS\n        #ifdef HAS_CUSTOM_VERTEX_SHADER\n        gl_PointSize = vsOutput.pointSize;\n        #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)\n        gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);\n        #else\n        gl_PointSize = 1.0;\n        #endif\n\n        gl_PointSize *= show;\n    #endif\n\n    gl_Position = show * positionClip;\n}\n";function O5(){}O5.getFailedLoadFunction=function(e,t,n){return function(e){let i=`Failed to load ${t}: ${n}`;Object(l.a)(e)&&(i+="\n"+e.message);const r=new ye.a(i);return Object(l.a)(e)&&(r.stack=`Original stack:\n${e.stack}\nHandler stack:\n${r.stack}`),Promise.reject(r)}},O5.getNodeTransform=function(e){return Object(l.a)(e.matrix)?e.matrix:Me.fromTranslationQuaternionRotationScale(Object(l.a)(e.translation)?e.translation:O.ZERO,Object(l.a)(e.rotation)?e.rotation:To.IDENTITY,Object(l.a)(e.scale)?e.scale:O.ONE)},O5.getAttributeBySemantic=function(e,t,n){const i=e.attributes,r=i.length;for(let e=0;e<r;++e){const r=i[e],o=!Object(l.a)(n)||r.setIndex===n;if(r.semantic===t&&o)return r}},O5.getAttributeByName=function(e,t){const n=e.attributes,i=n.length;for(let e=0;e<i;++e){const i=n[e];if(i.name===t)return i}},O5.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.positionalLabel===t||i.label===t)return i}},O5.hasQuantizedAttributes=function(e){if(!Object(l.a)(e))return!1;for(let t=0;t<e.length;t++){const n=e[t];if(Object(l.a)(n.quantization))return!0}return!1},O5.getAttributeInfo=function(e){const t=e.semantic,n=e.setIndex;let i,r=!1;Object(l.a)(t)?(i=TZ.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());const o=/^color_\d+$/.test(i),a=e.type;let s=Cs.getGlslType(a);o&&(s="vec4");const c=Object(l.a)(e.quantization);let u;return c&&(u=o?"vec4":Cs.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:s,quantizedGlslType:u}};const w5=new O,A5=new O;O5.getPositionMinMax=function(e,t,n){const i=O5.getAttributeBySemantic(e,"POSITION");let r=i.max,o=i.min;return Object(l.a)(n)&&Object(l.a)(t)&&(o=O.add(o,t,A5),r=O.add(r,n,w5)),{min:o,max:r}},O5.getAxisCorrectionMatrix=function(e,t,n){return n=Me.clone(Me.IDENTITY,n),e===HU.Y?n=Me.clone(HU.Y_UP_TO_Z_UP,n):e===HU.X&&(n=Me.clone(HU.X_UP_TO_Z_UP,n)),t===HU.Z&&(n=Me.multiplyTransformation(n,HU.Z_UP_TO_X_UP,n)),n};const E5=new ce;function T5(e,t){const n=e.shaderBuilder;n.addVertexLines([v5]),n.addFragmentLines([b5]);const i=e.model,r=t.context,o=function(e){const t=e.wireframeIndexBuffer;if(Object(l.a)(t))return t;const n=e.indices;if(!Object(l.a)(n))return;if(!Object(l.a)(n.buffer))throw new u.a("Indices must be provided as a Buffer");return n.buffer}(e),a=new iB({context:r,indexBuffer:o,attributes:e.attributes});i._pipelineResources.push(a);const s=n.buildShaderProgram(t.context);i._pipelineResources.push(s);const c=e.alphaOptions.pass,h=i.sceneGraph,d=Me.multiplyTransformation(h.computedModelMatrix,e.runtimeNode.computedTransform,new Me);let f;if(t.mode!==AB.SCENE3D&&!t.scene3DOnly&&i._projectTo2D){f=e.runtimePrimitive.boundingSphere2D}else f=At.transform(e.boundingSphere,d,e.boundingSphere);let p=Object(Zf.a)(vj.fromCache(e.renderStateOptions),!0);i.opaquePass===KR.CESIUM_3D_TILE&&(p.stencilTest=qF.setCesium3DTileBit(),p.stencilMask=qF.CESIUM_3D_TILE_MASK),p.cull.face=O5.getCullFace(d,e.primitiveType),p=vj.fromCache(p);const m=e.count,g=new XR({boundingVolume:f,modelMatrix:d,uniformMap:e.uniformMap,renderState:p,vertexArray:a,shaderProgram:s,cull:i.cull,pass:c,count:m,pickId:e.pickId,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:i.debugShowBoundingVolume,castShadows:TB.castShadows(i.shadows),receiveShadows:TB.receiveShadows(i.shadows)}),_=i.hasSilhouette(t);return new y5({primitiveRenderResources:e,command:g,useSilhouetteCommands:_})}O5.getCullFace=function(e,t){if(!zl.isTriangles(t))return PD.BACK;const n=Me.getMatrix3(e,E5);return ce.determinant(n)<0?PD.FRONT:PD.BACK},O5.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t="_"+t),t};var C5="vec3 proceduralIBL(\n    vec3 positionEC,\n    vec3 normalEC,\n    vec3 lightDirectionEC,\n    vec3 lightColorHdr,\n    czm_pbrParameters pbrParameters\n) {\n    vec3 v = -positionEC;\n    vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));\n    vec3 vWC = -normalize(positionWC);\n    vec3 l = normalize(lightDirectionEC);\n    vec3 n = normalEC;\n    vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n\n    float NdotL = clamp(dot(n, l), 0.001, 1.0);\n    float NdotV = abs(dot(n, v)) + 0.001;\n\n    // Figure out if the reflection vector hits the ellipsoid\n    float vertexRadius = length(positionWC);\n    float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n    float reflectionDotNadir = dot(r, normalize(positionWC));\n    // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.\n    r.x = -r.x;\n    r = -normalize(czm_temeToPseudoFixed * r);\n    r.x = -r.x;\n\n    vec3 diffuseColor = pbrParameters.diffuseColor;\n    float roughness = pbrParameters.roughness;\n    vec3 specularColor = pbrParameters.f0;\n\n    float inverseRoughness = 1.04 - roughness;\n    inverseRoughness *= inverseRoughness;\n    vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n\n    float atmosphereHeight = 0.05;\n    float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n    float blendRegionOffset = roughness * -1.0;\n    float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n    float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n    float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n    float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n    vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n    vec3 nadirColor = belowHorizonColor * 0.5;\n    vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n    vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n    vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n    vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); \n    float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;  \n    float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n    vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n    float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n    vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n    specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n    specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n\n    // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf\n    #ifdef USE_SUN_LUMINANCE \n    // Angle between sun and zenith\n    float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);\n    float S = acos(LdotZenith);\n    // Angle between zenith and current pixel\n    float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);\n    // Angle between sun and current pixel\n    float gamma = acos(NdotL);\n    float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n    float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n    float luminance = model_luminanceAtZenith * (numerator / denominator);\n    #endif \n\n    vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n    vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);\n    float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n    vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n    iblColor *= lightColor;\n\n    #ifdef USE_SUN_LUMINANCE \n    iblColor *= luminance;\n    #endif\n\n    return iblColor;\n}\n\nvec3 textureIBL(\n    vec3 positionEC,\n    vec3 normalEC,\n    vec3 lightDirectionEC,\n    czm_pbrParameters pbrParameters\n) {\n    vec3 diffuseColor = pbrParameters.diffuseColor;\n    float roughness = pbrParameters.roughness;\n    vec3 specularColor = pbrParameters.f0;\n\n    vec3 v = -positionEC;\n    vec3 n = normalEC;\n    vec3 l = normalize(lightDirectionEC);\n    vec3 h = normalize(v + l);\n\n    float NdotV = abs(dot(n, v)) + 0.001;\n    float VdotH = clamp(dot(v, h), 0.0, 1.0);\n\n    const mat3 yUpToZUp = mat3(\n        -1.0, 0.0, 0.0,\n        0.0, 0.0, -1.0, \n        0.0, 1.0, 0.0\n    ); \n    vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); \n\n    #ifdef DIFFUSE_IBL \n        #ifdef CUSTOM_SPHERICAL_HARMONICS\n        vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); \n        #else\n        vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n        #endif \n    #else \n    vec3 diffuseIrradiance = vec3(0.0); \n    #endif \n\n    #ifdef SPECULAR_IBL\n    vec3 r0 = specularColor.rgb;\n    float reflectance = max(max(r0.r, r0.g), r0.b);\n    vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n    vec3 F = fresnelSchlick2(r0, r90, VdotH);\n    \n    vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n      #ifdef CUSTOM_SPECULAR_IBL \n      vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);\n      #else \n      vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir,  roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n      #endif \n    specularIBL *= F * brdfLut.x + brdfLut.y;\n    #else \n    vec3 specularIBL = vec3(0.0); \n    #endif\n\n    return diffuseColor * diffuseIrradiance + specularColor * specularIBL;\n}\n\nvec3 imageBasedLightingStage(\n    vec3 positionEC,\n    vec3 normalEC,\n    vec3 lightDirectionEC,\n    vec3 lightColorHdr,\n    czm_pbrParameters pbrParameters\n) {\n  #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\n  // Environment maps were provided, use them for IBL\n  return textureIBL(\n      positionEC,\n      normalEC,\n      lightDirectionEC,\n      pbrParameters\n  );\n  #else\n  // Use the procedural IBL if there are no environment maps\n  return proceduralIBL(\n      positionEC,\n      normalEC,\n      lightDirectionEC,\n      lightColorHdr,\n      pbrParameters\n  );\n  #endif\n}";const x5={VERTEX:0,FRAGMENT:1,BOTH:2,includesVertexShader:function(e){return s.a.typeOf.number("destination",e),e===x5.VERTEX||e===x5.BOTH},includesFragmentShader:function(e){return s.a.typeOf.number("destination",e),e===x5.FRAGMENT||e===x5.BOTH}};var S5=Object.freeze(x5);const I5={name:"ImageBasedLightingPipelineStage",process:function(e,t,n){const i=t.imageBasedLighting,r=e.shaderBuilder;if(r.addDefine("USE_IBL_LIGHTING",void 0,S5.FRAGMENT),r.addUniform("vec2","model_iblFactor",S5.FRAGMENT),FU.isSupported(n.context)){(i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",S5.FRAGMENT),Object(l.a)(i.sphericalHarmonicCoefficients)?(r.addDefine("DIFFUSE_IBL",void 0,S5.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,S5.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",S5.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,S5.FRAGMENT),Object(l.a)(i.specularEnvironmentMapAtlas)&&i.specularEnvironmentMapAtlas.ready?(r.addDefine("SPECULAR_IBL",void 0,S5.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,S5.FRAGMENT),r.addUniform("sampler2D","model_specularEnvironmentMaps",S5.FRAGMENT),r.addUniform("vec2","model_specularEnvironmentMapsSize",S5.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",S5.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,S5.FRAGMENT)}Object(l.a)(i.luminanceAtZenith)&&(r.addDefine("USE_SUN_LUMINANCE",void 0,S5.FRAGMENT),r.addUniform("float","model_luminanceAtZenith",S5.FRAGMENT)),r.addFragmentLines([C5]);const o={model_iblFactor:function(){return i.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return i.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return i.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return i.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return i.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentMapAtlas.maximumMipmapLevel}};e.uniformMap=Object(up.a)(o,e.uniformMap)}};var P5=I5;const D5=h.a.EPSILON16;function R5(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).stage,n=e.runtimeArticulation;s.a.typeOf.object("options.stage",t),s.a.typeOf.object("options.runtimeArticulation",n),this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(R5.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){s.a.typeOf.number("value",e),e=h.a.clamp(e,this.minimumValue,this.maximumValue),h.a.equalsEpsilon(this._currentValue,e,D5)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});const j5=new O,M5=new ce;function L5(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).articulation,n=e.sceneGraph;s.a.typeOf.object("options.articulation",t),s.a.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,function(e){const t=e.articulation.stages,n=t.length,i=e._runtimeStages,r=e._runtimeStagesByName;for(let o=0;o<n;o++){const n=t[o],a=new R5({stage:n,runtimeArticulation:e});i.push(a);const s=n.name;r[s]=a}}(this)}R5.prototype.applyStageToMatrix=function(e){s.a.typeOf.object("result",e);const t=this.type,n=this.currentValue,i=j5;let r;switch(t){case Al.XROTATE:r=ce.fromRotationX(h.a.toRadians(n),M5),e=Me.multiplyByMatrix3(e,r,e);break;case Al.YROTATE:r=ce.fromRotationY(h.a.toRadians(n),M5),e=Me.multiplyByMatrix3(e,r,e);break;case Al.ZROTATE:r=ce.fromRotationZ(h.a.toRadians(n),M5),e=Me.multiplyByMatrix3(e,r,e);break;case Al.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=Me.multiplyByTranslation(e,i,e);break;case Al.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=Me.multiplyByTranslation(e,i,e);break;case Al.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=Me.multiplyByTranslation(e,i,e);break;case Al.XSCALE:i.x=n,i.y=1,i.z=1,e=Me.multiplyByScale(e,i,e);break;case Al.YSCALE:i.x=1,i.y=n,i.z=1,e=Me.multiplyByScale(e,i,e);break;case Al.ZSCALE:i.x=1,i.y=1,i.z=n,e=Me.multiplyByScale(e,i,e);break;case Al.UNIFORMSCALE:e=Me.multiplyByUniformScale(e,n,e)}return e},Object.defineProperties(L5.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}}),L5.prototype.setArticulationStage=function(e,t){const n=this._runtimeStagesByName[e];Object(l.a)(n)&&(n.currentValue=t)};const N5=new Me,B5=new Me;L5.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e,t=Me.clone(Me.IDENTITY,N5);const n=this._runtimeStages,i=n.length;for(e=0;e<i;e++){t=n[e].applyStageToMatrix(t)}const r=this._runtimeNodes,o=r.length;for(e=0;e<o;e++){const n=r[e],i=Me.multiplyTransformation(n.originalTransform,t,B5);n.transform=i}};var F5="void modelColorStage(inout czm_modelMaterial material)\n{\n    material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);\n    float highlight = ceil(model_colorBlend);\n    material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);\n    material.alpha *= model_color.a;\n}";const z5={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend",process:function(e,t,n){const i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,S5.FRAGMENT),i.addFragmentLines([F5]);const r={},o=t.color;0!==o.alpha||t.hasSilhouette(n)||(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=KR.TRANSLUCENT),i.addUniform("vec4",z5.COLOR_UNIFORM_NAME,S5.FRAGMENT),r[z5.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",z5.COLOR_BLEND_UNIFORM_NAME,S5.FRAGMENT),r[z5.COLOR_BLEND_UNIFORM_NAME]=function(){return kq.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Object(up.a)(r,e.uniformMap)}};var k5=z5,U5="#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE\nvec4 getClippingPlane(\n    highp sampler2D packedClippingPlanes,\n    int clippingPlaneNumber,\n    mat4 transform\n) {\n    int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;\n    int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\n    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\n    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n    float v = (float(pixY) + 0.5) * pixelHeight;\n    vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n    return czm_transformPlane(plane, transform);\n}\n#else\n// Handle uint8 clipping texture instead\nvec4 getClippingPlane(\n    highp sampler2D packedClippingPlanes,\n    int clippingPlaneNumber,\n    mat4 transform\n) {\n    int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each\n    int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;\n    int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\n    float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\n    float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n    float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n    float v = (float(pixY) + 0.5) * pixelHeight;\n    vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n    vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n    vec4 plane;\n    plane.xyz = czm_octDecode(oct, 65535.0);\n    plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + pixelWidth, v)));\n    return czm_transformPlane(plane, transform);\n}\n#endif\n\nfloat clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {\n    vec4 position = czm_windowToEyeCoordinates(fragCoord);\n    vec3 clipNormal = vec3(0.0);\n    vec3 clipPosition = vec3(0.0);\n    float pixelWidth = czm_metersPerPixel(position);\n    \n    #ifdef UNION_CLIPPING_REGIONS\n    float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.\n    #else\n    float clipAmount = 0.0;\n    bool clipped = true;\n    #endif\n\n    for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {\n        vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n        clipNormal = clippingPlane.xyz;\n        clipPosition = -clippingPlane.w * clipNormal;\n        float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n        \n        #ifdef UNION_CLIPPING_REGIONS\n        clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n        if (amount <= 0.0) {\n            discard;\n        }\n        #else\n        clipAmount = max(amount, clipAmount);\n        clipped = clipped && (amount <= 0.0);\n        #endif\n    }\n\n    #ifndef UNION_CLIPPING_REGIONS\n    if (clipped) {\n        discard;\n    }\n    #endif\n    \n    return clipAmount;\n}\n\nvoid modelClippingPlanesStage(inout vec4 color)\n{\n    float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);\n    vec4 clippingPlanesEdgeColor = vec4(1.0);\n    clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;\n    float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;\n    \n    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {\n        color = clippingPlanesEdgeColor;\n    }\n}\n";const V5={name:"ModelClippingPlanesPipelineStage"},H5=new Vt;V5.process=function(e,t,n){const i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,S5.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,S5.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,S5.FRAGMENT),Fq.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,S5.FRAGMENT);const a=Fq.getTextureResolution(i,r,H5);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",a.x,S5.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",a.y,S5.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",S5.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",S5.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",S5.FRAGMENT),o.addFragmentLines([U5]);const s={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){const e=sp.clone(i.edgeColor);return e.alpha=i.edgeWidth,e},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Object(up.a)(s,e.uniformMap)};var G5=V5;function q5(e,t){s.a.typeOf.object("model",e),s.a.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties(q5.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){Object(l.a)(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var W5="mat4 getInstancingTransform()\n{\n    mat4 instancingTransform;\n\n    #ifdef HAS_INSTANCE_MATRICES\n    instancingTransform = mat4(\n        a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1\n        a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2\n        a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3\n        a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0  // Column 4\n    );\n    #else\n    vec3 translation = vec3(0.0, 0.0, 0.0);\n    vec3 scale = vec3(1.0, 1.0, 1.0);\n    \n        #ifdef HAS_INSTANCE_TRANSLATION\n        translation = a_instanceTranslation;\n        #endif\n        #ifdef HAS_INSTANCE_SCALE\n        scale = a_instanceScale;\n        #endif\n\n    instancingTransform = mat4(\n        scale.x, 0.0, 0.0, 0.0,\n        0.0, scale.y, 0.0, 0.0,\n        0.0, 0.0, scale.z, 0.0,\n        translation.x, translation.y, translation.z, 1.0\n    ); \n    #endif\n\n    return instancingTransform;\n}\n\n#ifdef USE_2D_INSTANCING\nmat4 getInstancingTransform2D()\n{\n    mat4 instancingTransform2D;\n\n    #ifdef HAS_INSTANCE_MATRICES\n    instancingTransform2D = mat4(\n        a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1\n        a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2\n        a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3\n        a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0  // Column 4\n    );\n    #else\n    vec3 translation2D = vec3(0.0, 0.0, 0.0);\n    vec3 scale = vec3(1.0, 1.0, 1.0);\n    \n        #ifdef HAS_INSTANCE_TRANSLATION\n        translation2D = a_instanceTranslation2D;\n        #endif\n        #ifdef HAS_INSTANCE_SCALE\n        scale = a_instanceScale;\n        #endif\n\n    instancingTransform2D = mat4(\n        scale.x, 0.0, 0.0, 0.0,\n        0.0, scale.y, 0.0, 0.0,\n        0.0, 0.0, scale.z, 0.0,\n        translation2D.x, translation2D.y, translation2D.z, 1.0\n    ); \n    #endif\n\n    return instancingTransform2D;\n}\n#endif\n",Y5="void instancingStage(inout ProcessedAttributes attributes) \n{\n    vec3 positionMC = attributes.positionMC;\n    \n    mat4 instancingTransform = getInstancingTransform();\n    attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;\n\n    #ifdef USE_2D_INSTANCING\n    mat4 instancingTransform2D = getInstancingTransform2D();\n    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\n    #endif\n}\n",X5="void legacyInstancingStage(\n    inout ProcessedAttributes attributes,\n    out mat4 instanceModelView,\n    out mat3 instanceModelViewInverseTranspose)\n{\n    vec3 positionMC = attributes.positionMC;\n    mat4 instancingTransform = getInstancingTransform();\n\n    mat4 instanceModel = instancingTransform * u_instance_nodeTransform;\n    instanceModelView = u_instance_modifiedModelView;\n    instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);\n\n    attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;\n    \n    #ifdef USE_2D_INSTANCING\n    mat4 instancingTransform2D = getInstancingTransform2D();\n    attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\n    #endif\n}\n";const K5=new Me,J5=new Me,Z5=new Me,$5={name:"InstancingPipelineStage"};$5.process=function(e,t,n){const i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines([W5]);const a=e.model,s=a.sceneGraph,c=n.mode!==AB.SCENE3D&&!n.scene3DOnly&&a._projectTo2D,u=[];!function(e,t,n,i,r){const o=O5.getAttributeBySemantic(n,D3.TRANSLATION);let a,s;Object(l.a)(o)&&(a=o.max,s=o.min);const c=O5.getAttributeBySemantic(n,D3.ROTATION),u=e.shaderBuilder,h=n.attributes[0].count,d=Object(l.a)(c)||!Object(l.a)(a)||!Object(l.a)(s),f=e.model.statistics;let p;if(d){u.addDefine("HAS_INSTANCE_MATRICES");const r="Transform";p=p6(n,h,e);const o=m6(u6(p),t);e.model._pipelineResources.push(o),g6(e,o,i,r),f.addBuffer(o,!1)}else{if(Object(l.a)(o)){u.addDefine("HAS_INSTANCE_TRANSLATION");const n=o.max,r=o.min;e.instancingTranslationMax=n,e.instancingTranslationMin=r;let a=o.buffer,s=o.byteOffset,c=o.byteStride;Object(l.a)(a)||(a=m6(o.typedArray,t),e.model._pipelineResources.push(a),s=0,c=void 0,f.addBuffer(a,!1));_6(e,a,s,c,i,"Translation")}const r=O5.getAttributeBySemantic(n,D3.SCALE);if(Object(l.a)(r)){u.addDefine("HAS_INSTANCE_SCALE");let n=r.buffer,o=r.byteOffset,a=r.byteStride;Object(l.a)(n)||(n=m6(r.typedArray,t),e.model._pipelineResources.push(n),o=0,a=void 0,f.addBuffer(n,!1));_6(e,n,o,a,i,"Scale")}}if(!r)return;const m=Object(Zf.a)(t);m.mode=AB.COLUMBUS_VIEW;const g=function(e,t){const n=e.model.sceneGraph.computedModelMatrix,i=Me.multiplyByPoint(n,e.instancingTranslationMin,c6),r=iQ.computeActualWgs84Position(t,i,i),o=Me.multiplyByPoint(n,e.instancingTranslationMax,l6),a=iQ.computeActualWgs84Position(t,o,o);return O.lerp(r,a,.5,new O)}(e,m);e.instancingReferencePoint2D=g;const _=e.runtimeNode;if(d){let n=_.instancingTransformsBuffer2D;if(!Object(l.a)(n)){const i=u6(function(e,t,n,i){const r=r6,o=o6;i6(t,r,o);const a=t.instancingReferencePoint2D,s=e.length;for(let t=0;t<s;t++){const s=t6(e[t],r,o,n,a6),c=Me.getTranslation(s,s6),l=O.subtract(c,a,c);i[t]=Me.setTranslation(s,l,i[t])}return i}(p,e,m,p));n=m6(i,t),e.model._modelResources.push(n),_.instancingTransformsBuffer2D=n}g6(e,n,i,"Transform2D")}else{let n=_.instancingTranslationBuffer2D;if(!Object(l.a)(n)){const i=function(e,t){const n=new Array(t),i=e.typedArray;for(let e=0;e<t;e++)n[e]=new O(i[3*e],i[3*e+1],i[3*e+2]);return n}(o,h),r=function(e){const t=e.length,n=new Float32Array(3*t);for(let i=0;i<t;i++){const t=e[i],r=3*i;n[r+0]=t[0],n[r+1]=t[4],n[r+2]=t[8]}return n}(function(e,t,n,i){const r=r6,o=o6;i6(t,r,o);const a=t.instancingReferencePoint2D,s=e.length;for(let t=0;t<s;t++){const s=e[t],c=n6(s,r,o,n,s);i[t]=O.subtract(c,a,i[t])}return i}(i,e,m,i));n=m6(r,t),e.model._modelResources.push(n),_.instancingTranslationBuffer2D=n}_6(e,n,0,void 0,i,"Translation2D")}}(e,n,i,u,c),function(e,t,n,i){const r=n.attributes,o=e.model,a=e.shaderBuilder;for(let n=0;n<r.length;n++){const s=r[n];if(s.semantic!==D3.FEATURE_ID)continue;s.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s.setIndex+1);const c=ZN.createVertexBuffer({context:t.context,typedArray:s.typedArray,usage:KN.STATIC_DRAW});c.vertexArrayDestroyable=!1,o._pipelineResources.push(c);const l=!1;o.statistics.addBuffer(c,l),i.push({index:e.attributeIndex++,vertexBuffer:c,componentsPerAttribute:Cs.getNumberOfComponents(s.type),componentDatatype:s.componentDatatype,normalize:!1,offsetInBytes:s.byteOffset,strideInBytes:s.byteStride,instanceDivisor:1}),a.addAttribute("float","a_instanceFeatureId_"+s.setIndex)}}(e,n,i,u);const h={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,S5.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",S5.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",S5.VERTEX),h.u_instance_modifiedModelView=function(){let e=Me.multiplyTransformation(a.modelMatrix,s.components.transform,K5);return c?Me.multiplyTransformation(n.context.uniformState.view3D,e,K5):(n.mode!==AB.SCENE3D&&(e=ca.basisTo2D(n.mapProjection,e,K5)),Me.multiplyTransformation(n.context.uniformState.view,e,K5))},h.u_instance_nodeTransform=function(){return Me.multiplyTransformation(s.axisCorrectionMatrix,e.runtimeNode.computedTransform,J5)},o.addVertexLines([X5])):o.addVertexLines([Y5]),c){o.addDefine("USE_2D_INSTANCING",void 0,S5.VERTEX),o.addUniform("mat4","u_modelView2D",S5.VERTEX);const t=n.context,i=Me.fromTranslation(e.instancingReferencePoint2D,new Me);h.u_modelView2D=function(){return Me.multiplyTransformation(t.uniformState.view,i,Z5)}}e.uniformMap=Object(up.a)(h,e.uniformMap),e.instanceCount=r,e.attributes.push.apply(e.attributes,u)};const Q5=new Me,e6=new O;function t6(e,t,n,i,r){let o=Me.multiplyTransformation(t,e,Q5);return o=Me.multiplyTransformation(o,n,Q5),r=ca.basisTo2D(i.mapProjection,o,r)}function n6(e,t,n,i,r){const o=Me.fromTranslation(e,Q5);let a=Me.multiplyTransformation(t,o,Q5);a=Me.multiplyTransformation(a,n,Q5);const s=Me.getTranslation(a,e6);return r=iQ.computeActualWgs84Position(i,s,r)}function i6(e,t,n){const i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=Me.multiplyTransformation(i.modelMatrix,r.components.transform,t),n=Me.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=Me.clone(r.computedModelMatrix,t),t=Me.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=Me.clone(Me.IDENTITY,n))}const r6=new Me,o6=new Me,a6=new Me,s6=new O;const c6=new O,l6=new O;function u6(e){const t=e.length,n=new Float32Array(12*t);for(let i=0;i<t;i++){const t=e[i],r=12*i;n[r+0]=t[0],n[r+1]=t[4],n[r+2]=t[8],n[r+3]=t[12],n[r+4]=t[1],n[r+5]=t[5],n[r+6]=t[9],n[r+7]=t[13],n[r+8]=t[2],n[r+9]=t[6],n[r+10]=t[10],n[r+11]=t[14]}return n}const h6=new O,d6=new To,f6=new O;function p6(e,t,n){const i=new Array(t),r=O5.getAttributeBySemantic(e,D3.TRANSLATION),o=O5.getAttributeBySemantic(e,D3.ROTATION),a=O5.getAttributeBySemantic(e,D3.SCALE),s=new O(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new O(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=Object(l.a)(r),h=Object(l.a)(o),d=Object(l.a)(a),f=u?r.typedArray:new Float32Array(3*t),p=h?o.typedArray:new Float32Array(4*t);let m;d?m=a.typedArray:(m=new Float32Array(3*t),m.fill(1));for(let e=0;e<t;e++){const t=new O(f[3*e],f[3*e+1],f[3*e+2],h6);O.maximumByComponent(s,t,s),O.minimumByComponent(c,t,c);const n=new To(p[4*e],p[4*e+1],p[4*e+2],h?p[4*e+3]:1,d6),r=new O(m[3*e],m[3*e+1],m[3*e+2],f6),o=Me.fromTranslationQuaternionRotationScale(t,n,r,new Me);i[e]=o}return n.instancingTranslationMax=s,n.instancingTranslationMin=c,i}function m6(e,t){const n=ZN.createVertexBuffer({context:t.context,typedArray:e,usage:KN.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function g6(e,t,n,i){const r=gs.getSizeInBytes(gs.FLOAT),o=12*r,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:o,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:4*r,strideInBytes:o,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:8*r,strideInBytes:o,instanceDivisor:1}],s=e.shaderBuilder;s.addAttribute("vec4",`a_instancing${i}Row0`),s.addAttribute("vec4",`a_instancing${i}Row1`),s.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function _6(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:gs.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1});e.shaderBuilder.addAttribute("vec3","a_instance"+o)}$5._getInstanceTransformsAsMatrices=p6,$5._transformsToTypedArray=u6;var y6=$5;const b6={};b6.name="ModelMatrixUpdateStage",b6.update=function(e,t,n){const i=n.mode!==AB.SCENE3D;if((!i||!t._model._projectTo2D)&&e._transformDirty){!function e(t,n,i,r){let o;r=Me.multiplyTransformation(r,t.transform,new Me),t.updateComputedTransform();const a=t.runtimePrimitives.length;for(o=0;o<a;o++){const e=t.runtimePrimitives[o].drawCommand;e.modelMatrix=Me.multiplyTransformation(i,r,e.modelMatrix),e.cullFace=O5.getCullFace(e.modelMatrix,e.primitiveType)}const s=t.children.length;for(o=0;o<s;o++){const a=n._runtimeNodes[t.children[o]];a._transformToRoot=Me.clone(r,a._transformToRoot),e(a,n,i,r),a._transformDirty=!1}}(e,t,i?t._computedModelMatrix2D:t._computedModelMatrix,e.transformToRoot),e._transformDirty=!1}};var v6=b6;const O6={};function w6(e,t){if(!Object(l.a)(t))return;const n=t.attributes,i=n.length;for(let t=0;t<i;t++){const i=n[t];if(Object(l.a)(i.buffer)){const t=!1;e.addBuffer(i.buffer,t)}}}function A6(e,t){if(Object(l.a)(t.instancingTransformsBuffer2D)){const n=!1;e.addBuffer(t.instancingTransformsBuffer2D,n)}if(Object(l.a)(t.instancingTranslationBuffer2D)){const n=!1;e.addBuffer(t.instancingTranslationBuffer2D,n)}}O6.name="NodeStatisticsPipelineStage",O6.process=function(e,t,n){const i=e.model.statistics,r=e.runtimeNode;w6(i,t.instances),A6(i,r)},O6._countInstancingAttributes=w6,O6._countInstancing2DBuffers=A6;var E6=O6;function T6(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;s.a.typeOf.object("options.node",t),s.a.typeOf.object("options.transform",n),s.a.typeOf.object("options.transformToRoot",i),s.a.typeOf.object("options.sceneGraph",r),s.a.typeOf.object("options.children",o),this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=Me.clone(n,this._originalTransform),this._transform=Me.clone(n,this._transform),this._transformToRoot=Me.clone(i,this._transformToRoot),this._computedTransform=new Me,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,function(e){const t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=Me.multiply(n,t,i);const r=e.node;Object(l.a)(r.matrix)||(e._transformParameters=new $I(r.translation,r.rotation,r.scale));Object(l.a)(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());const o=r.articulationName;if(Object(l.a)(o)){const t=e.sceneGraph,n=t._runtimeArticulations[o];Object(l.a)(n)&&n.runtimeNodes.push(e)}}(this)}function C6(e,t){e._transformDirty=!0,e._transform=Me.fromTranslationRotationScale(t,e._transform)}Object.defineProperties(T6.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=Me.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return Object(l.a)(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){const t=this._transformParameters;if(!Object(l.a)(t))throw new u.a("The translation of a node cannot be set if it was defined using a matrix in the model.");const n=t.translation;O.equals(n,e)||(t.translation=O.clone(e,t.translation),C6(this,t))}},rotation:{get:function(){return Object(l.a)(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){const t=this._transformParameters;if(!Object(l.a)(t))throw new u.a("The rotation of a node cannot be set if it was defined using a matrix in the model.");const n=t.rotation;To.equals(n,e)||(t.rotation=To.clone(e,t.rotation),C6(this,t))}},scale:{get:function(){return Object(l.a)(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){const t=this._transformParameters;if(!Object(l.a)(t))throw new u.a("The scale of a node cannot be set if it was defined using a matrix in the model.");const n=t.scale;O.equals(n,e)||(t.scale=O.clone(e,t.scale),C6(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){const t=e.length;if(this._morphWeights.length!==t)throw new u.a("value must have the same length as the original weights array.");for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}}),T6.prototype.getChild=function(e){if(s.a.typeOf.number("index",e),e<0||e>=this.children.length)throw new u.a("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]},T6.prototype.configurePipeline=function(){const e=this.node,t=this.pipelineStages;t.length=0;const n=this.updateStages;n.length=0,Object(l.a)(e.instances)&&t.push(y6),t.push(E6),n.push(v6)},T6.prototype.updateComputedTransform=function(){this._computedTransform=Me.multiply(this._transformToRoot,this._transform,this._computedTransform)},T6.prototype.updateJointMatrices=function(){const e=this._runtimeSkin;if(!Object(l.a)(e))return;e.updateJointMatrices();const t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let e=0;e<i;e++){Object(l.a)(t[e])||(t[e]=new Me);const i=Me.multiplyTransformation(this.transformToRoot,this.transform,t[e]),r=Me.inverseTransformation(i,t[e]);t[e]=Me.multiplyTransformation(r,n[e],t[e])}};const x6={name:"AlphaPipelineStage",process:function(e,t,n){const i=e.alphaOptions,r=e.model;i.pass=Object(c.a)(i.pass,r.opaquePass);const o=e.renderStateOptions;i.pass===KR.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=SD.ALPHA_BLEND);const a=e.shaderBuilder,s=e.uniformMap;Object(l.a)(i.alphaCutoff)&&(a.addDefine("ALPHA_MODE_MASK",void 0,S5.FRAGMENT),a.addUniform("float","u_alphaCutoff",S5.FRAGMENT),s.u_alphaCutoff=function(){return i.alphaCutoff})}};var S6=x6;const I6={name:"BatchTexturePipelineStage",process:function(e,t,n){const i=e.shaderBuilder,r={},o=e.model,a=o.featureTables[o.featureTableId],s=a.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return s};const l=a.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return Object(c.a)(l.batchTexture,l.defaultTexture)},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return l.textureStep},l.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=Object(up.a)(r,e.uniformMap)}};var P6=I6;const D6={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL",getDefineName:function(e){return"CUSTOM_SHADER_"+e}};var R6=Object.freeze(D6),j6="void customShaderStage(\n    inout czm_modelVertexOutput vsOutput, \n    inout ProcessedAttributes attributes, \n    FeatureIds featureIds,\n    Metadata metadata,\n    MetadataClass metadataClass\n) {\n    // VertexInput and initializeInputStruct() are dynamically generated in JS, \n    // see CustomShaderPipelineStage.js\n    VertexInput vsInput;\n    initializeInputStruct(vsInput, attributes);\n    vsInput.featureIds = featureIds;\n    vsInput.metadata = metadata;\n    vsInput.metadataClass = metadataClass;\n    vertexMain(vsInput, vsOutput);\n    attributes.positionMC = vsOutput.positionMC;\n}\n",M6="void customShaderStage(\n    inout czm_modelMaterial material,\n    ProcessedAttributes attributes,\n    FeatureIds featureIds,\n    Metadata metadata,\n    MetadataClass metadataClass\n) {\n    // FragmentInput and initializeInputStruct() are dynamically generated in JS, \n    // see CustomShaderPipelineStage.js\n    FragmentInput fsInput;\n    initializeInputStruct(fsInput, attributes);\n    fsInput.featureIds = featureIds;\n    fsInput.metadata = metadata;\n    fsInput.metadataClass = metadataClass;\n    fragmentMain(fsInput, material);\n}\n",L6="void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {\n  initializeFeatureIds(featureIds, attributes);\n  initializeFeatureIdAliases(featureIds);\n}\n",N6="void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) \n{\n  initializeFeatureIds(featureIds, attributes);\n  initializeFeatureIdAliases(featureIds);\n  setFeatureIdVaryings();\n}\n";const B6={};function F6(e,t,n){const i=e.shaderBuilder;i.addStructField(B6.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(B6.STRUCT_ID_FEATURE_IDS_FS,"int",n);const r=t.setIndex,o=n.replace(/_\d+$/,"_"),a=`a_${o}${r}`,s=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${a}));`,l=`featureIds.${n} = int(czm_round(${s}));`;i.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[l]),i.addVarying("float",s),i.addFunctionLines(B6.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}function z6(e,t,n){const i=e.shaderBuilder;i.addStructField(B6.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(B6.STRUCT_ID_FEATURE_IDS_FS,"int",n);const r=t.setIndex,o=n.replace(/_\d+$/,"_"),a=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),i.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}function k6(e,t,n,i,r,o){!function(e,t,n,i,r){const o=e.model;let a,s;if(Object(l.a)(t.repeat)){const e=function(e,t){const n=e.offset,i=e.repeat,r=new Float32Array(t);for(let e=0;e<t;e++)r[e]=n+Math.floor(e/i);return r}(t,n);a=ZN.createVertexBuffer({context:r.context,typedArray:e,usage:KN.STATIC_DRAW}),a.vertexArrayDestroyable=!1,o._pipelineResources.push(a);const i=!1;o.statistics.addBuffer(a,i)}else s=[t.offset];const c={index:e.attributeIndex++,instanceDivisor:i,value:s,vertexBuffer:a,normalize:!1,componentsPerAttribute:1,componentDatatype:gs.FLOAT,strideInBytes:gs.getSizeInBytes(gs.FLOAT),offsetInBytes:0};e.attributes.push(c)}(e,t,i,r,o);const a=e.shaderBuilder,s="a_implicit_"+n;a.addAttribute("float",s);const c="v_implicit_"+n;a.addVarying("float",c),a.addStructField(B6.STRUCT_ID_FEATURE_IDS_VS,"int",n),a.addStructField(B6.STRUCT_ID_FEATURE_IDS_FS,"int",n),a.addFunctionLines(B6.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${s};`]),a.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${s}));`]),a.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function U6(e,t,n,i,r){const o="u_featureIdTexture_"+i,a=e.uniformMap,s=t.textureReader;a[o]=function(){return Object(c.a)(s.texture,r.context.defaultTexture)};const l=s.channels,u=e.shaderBuilder;u.addStructField(B6.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,S5.FRAGMENT);const h=`featureIds.${n} = czm_unpackUint(${`texture2D(${o}, ${"v_texCoord_"+s.texCoord}).${l}`});`;u.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[h])}function V6(e,t,n,i){const r=e.shaderBuilder,o=S5.includesVertexShader(i);o&&r.addStructField(B6.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(B6.STRUCT_ID_FEATURE_IDS_FS,"int",n);const a=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),r.addFunctionLines(B6.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}B6.name="FeatureIdPipelineStage",B6.STRUCT_ID_FEATURE_IDS_VS="FeatureIdsVS",B6.STRUCT_ID_FEATURE_IDS_FS="FeatureIdsFS",B6.STRUCT_NAME_FEATURE_IDS="FeatureIds",B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS="initializeFeatureIdsVS",B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS="initializeFeatureIdsFS",B6.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS="initializeFeatureIdAliasesVS",B6.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS="initializeFeatureIdAliasesFS",B6.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS="void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",B6.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES="void initializeFeatureIdAliases(inout FeatureIds featureIds)",B6.FUNCTION_ID_SET_FEATURE_ID_VARYINGS="setFeatureIdVaryings",B6.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS="void setFeatureIdVaryings()",B6.process=function(e,t,n){const i=e.shaderBuilder;!function(e){e.addStruct(B6.STRUCT_ID_FEATURE_IDS_VS,B6.STRUCT_NAME_FEATURE_IDS,S5.VERTEX),e.addStruct(B6.STRUCT_ID_FEATURE_IDS_FS,B6.STRUCT_NAME_FEATURE_IDS,S5.FRAGMENT),e.addFunction(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,B6.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,S5.VERTEX),e.addFunction(B6.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,B6.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,S5.FRAGMENT),e.addFunction(B6.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,B6.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,S5.VERTEX),e.addFunction(B6.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,B6.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,S5.FRAGMENT),e.addFunction(B6.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,B6.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,S5.VERTEX)}(i);const r=e.runtimeNode.node.instances;Object(l.a)(r)&&function(e,t,n){const i=t.featureIds,r=t.attributes[0].count;for(let t=0;t<i.length;t++){const o=i[t],a=o.positionalLabel;if(o instanceof UK.FeatureIdAttribute)F6(e,o,a);else{k6(e,o,a,r,1,n)}const s=o.label;Object(l.a)(s)&&V6(e,a,s,S5.BOTH)}}(e,r,n),function(e,t,n){const i=t.featureIds,r=O5.getAttributeBySemantic(t,TZ.POSITION).count;for(let t=0;t<i.length;t++){const o=i[t],a=o.positionalLabel;let s=S5.BOTH;o instanceof UK.FeatureIdAttribute?z6(e,o,a):o instanceof UK.FeatureIdImplicitRange?k6(e,o,a,r,void 0,n):(U6(e,o,a,t,n),s=S5.FRAGMENT);const c=o.label;Object(l.a)(c)&&V6(e,a,c,s)}}(e,t,n),i.addVertexLines([N6]),i.addFragmentLines([L6])};var H6=B6,G6="void metadataStage(out Metadata metadata, out MetadataClass metadataClass, ProcessedAttributes attributes)\n{\n  initializeMetadata(metadata, metadataClass, attributes);\n}\n",q6="void metadataStage(out Metadata metadata, out MetadataClass metadataClass, ProcessedAttributes attributes)\n{\n  initializeMetadata(metadata, metadataClass, attributes);\n  setMetadataVaryings();\n}\n";const W6={};function Y6(e,t){for(let n=0;n<e.length;n++){const i=e[n].properties;for(const e in i)if(i.hasOwnProperty(e)){t(e,i[e])}}}function X6(e,t){const n=t.metadataVariable,i=`u_${n}_offset`,r=`u_${n}_scale`,{shaderBuilder:o,uniformMap:a}=t.renderResources,s=t.glslType,c=t.shaderDestination;return o.addUniform(s,i,c),o.addUniform(s,r,c),a[i]=()=>t.offset,a[r]=()=>t.scale,`czm_valueTransform(${i}, ${r}, ${e})`}W6.name="MetadataPipelineStage",W6.STRUCT_ID_METADATA_VS="MetadataVS",W6.STRUCT_ID_METADATA_FS="MetadataFS",W6.STRUCT_NAME_METADATA="Metadata",W6.STRUCT_ID_METADATACLASS_VS="MetadataClassVS",W6.STRUCT_ID_METADATACLASS_FS="MetadataClassFS",W6.STRUCT_NAME_METADATACLASS="MetadataClass",W6.FUNCTION_ID_INITIALIZE_METADATA_VS="initializeMetadataVS",W6.FUNCTION_ID_INITIALIZE_METADATA_FS="initializeMetadataFS",W6.FUNCTION_SIGNATURE_INITIALIZE_METADATA="void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, ProcessedAttributes attributes)",W6.FUNCTION_ID_SET_METADATA_VARYINGS="setMetadataVaryings",W6.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS="void setMetadataVaryings()",W6.METADATACLASS_FIELDS=[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],W6.process=function(e,t,n){const{shaderBuilder:i,model:r}=e,o=Object(c.a)(r.structuralMetadata,{}),{propertyAttributes:a,propertyTextures:s}=o,u=new Set;Object(l.a)(a)&&function(e,t,n){const{getAttributeByName:i,getAttributeInfo:r}=O5;Y6(n,(function(n,o){const a=i(t,o.attribute),s=r(a).glslType;e.add(s)}))}(u,t,a),Object(l.a)(s)&&function(e,t){Y6(t,(function(t,n){const i=n.getGlslType();e.add(i)}))}(u,s),function(e,t){const n=W6.METADATACLASS_FIELDS;for(const i of t){const t=i+"MetadataClass",r=t+"VS",o=t+"FS";e.addStruct(r,t,S5.VERTEX),e.addStruct(o,t,S5.FRAGMENT);for(let t=0;t<n.length;t++){const a=n[t].shaderName;e.addStructField(r,i,a),e.addStructField(o,i,a)}}}(i,u),function(e){e.addStruct(W6.STRUCT_ID_METADATA_VS,W6.STRUCT_NAME_METADATA,S5.VERTEX),e.addStruct(W6.STRUCT_ID_METADATA_FS,W6.STRUCT_NAME_METADATA,S5.FRAGMENT),e.addStruct(W6.STRUCT_ID_METADATACLASS_VS,W6.STRUCT_NAME_METADATACLASS,S5.VERTEX),e.addStruct(W6.STRUCT_ID_METADATACLASS_FS,W6.STRUCT_NAME_METADATACLASS,S5.FRAGMENT),e.addFunction(W6.FUNCTION_ID_INITIALIZE_METADATA_VS,W6.FUNCTION_SIGNATURE_INITIALIZE_METADATA,S5.VERTEX),e.addFunction(W6.FUNCTION_ID_INITIALIZE_METADATA_FS,W6.FUNCTION_SIGNATURE_INITIALIZE_METADATA,S5.FRAGMENT),e.addFunction(W6.FUNCTION_ID_SET_METADATA_VARYINGS,W6.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,S5.VERTEX)}(i),i.addVertexLines([q6]),i.addFragmentLines([G6]),Object(l.a)(a)&&function(e,t,n){const{getAttributeByName:i,getAttributeInfo:r}=O5;Y6(n,(function(n,o){const a=i(t,o.attribute),s=r(a);!function(e,t,n,i){const r=O5.sanitizeGlslIdentifier(n),o=t.variableName,a=t.glslType,s=e.shaderBuilder;s.addStructField(W6.STRUCT_ID_METADATA_VS,a,r),s.addStructField(W6.STRUCT_ID_METADATA_FS,a,r);const c=a+"MetadataClass";s.addStructField(W6.STRUCT_ID_METADATACLASS_VS,c,r),s.addStructField(W6.STRUCT_ID_METADATACLASS_FS,c,r);let u="attributes."+o;i.hasValueTransform&&(u=X6(u,{renderResources:e,glslType:a,metadataVariable:r,shaderDestination:S5.BOTH,offset:i.offset,scale:i.scale}));const h=`metadata.${r} = ${u};`;s.addFunctionLines(W6.FUNCTION_ID_INITIALIZE_METADATA_VS,[h]),s.addFunctionLines(W6.FUNCTION_ID_INITIALIZE_METADATA_FS,[h]);const d=W6.METADATACLASS_FIELDS;for(let e=0;e<d.length;e++){const{specName:t,shaderName:n}=d[e],o=i.classProperty[t];if(!Object(l.a)(o))continue;const c=`metadataClass.${r}.${n} = ${a}(${o});`;s.addFunctionLines(W6.FUNCTION_ID_INITIALIZE_METADATA_VS,[c]),s.addFunctionLines(W6.FUNCTION_ID_INITIALIZE_METADATA_FS,[c])}}(e,s,n,o)}))}(e,t,a),Object(l.a)(s)&&function(e,t){Y6(t,(function(t,n){n.isGpuCompatible()&&function(e,t,n){const i=n.textureReader,r="u_propertyTexture_"+i.index;e.uniformMap.hasOwnProperty(r)||function(e,t,n){const{shaderBuilder:i,uniformMap:r}=e;i.addUniform("sampler2D",t,S5.FRAGMENT),r[t]=()=>n.texture}(e,r,i);const o=O5.sanitizeGlslIdentifier(t),a=n.getGlslType(),s=e.shaderBuilder;s.addStructField(W6.STRUCT_ID_METADATA_FS,a,o);const c=a+"MetadataClass";s.addStructField(W6.STRUCT_ID_METADATACLASS_FS,c,o);const u="attributes.texCoord_"+i.texCoord,h=i.channels;let d=`texture2D(${r}, ${u}).${h}`;d=n.unpackInShader(d),n.hasValueTransform&&(d=X6(d,{renderResources:e,glslType:a,metadataVariable:o,shaderDestination:S5.FRAGMENT,offset:n.offset,scale:n.scale}));const f=`metadata.${o} = ${d};`;s.addFunctionLines(W6.FUNCTION_ID_INITIALIZE_METADATA_FS,[f]);const p=W6.METADATACLASS_FIELDS;for(let e=0;e<p.length;e++){const{specName:t,shaderName:i}=p[e],r=n.classProperty[t];if(!Object(l.a)(r))continue;const c=`metadataClass.${o}.${i} = ${a}(${r});`;s.addFunctionLines(W6.FUNCTION_ID_INITIALIZE_METADATA_FS,[c])}}(e,t,n)}))}(e,s)};var K6=W6;const J6={};J6.name="CustomShaderPipelineStage",J6.STRUCT_ID_ATTRIBUTES_VS="AttributesVS",J6.STRUCT_ID_ATTRIBUTES_FS="AttributesFS",J6.STRUCT_NAME_ATTRIBUTES="Attributes",J6.STRUCT_ID_VERTEX_INPUT="VertexInput",J6.STRUCT_NAME_VERTEX_INPUT="VertexInput",J6.STRUCT_ID_FRAGMENT_INPUT="FragmentInput",J6.STRUCT_NAME_FRAGMENT_INPUT="FragmentInput",J6.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS="initializeInputStructVS",J6.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS="void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",J6.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS="initializeInputStructFS",J6.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS="void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",J6.process=function(e,t,n){const i=e.shaderBuilder,r=e.model.customShader;Object(l.a)(r.lightingModel)&&(e.lightingOptions.lightingModel=r.lightingModel);const o=e.alphaOptions;r.isTranslucent?o.pass=KR.TRANSLUCENT:o.pass=void 0;const a=function(e,t){const n={enabled:!1},i={enabled:!1},r=function(e){const t={};for(let n=0;n<e.length;n++){const i=e[n],r=O5.getAttributeInfo(i);t[r.variableName]=r}return t}(t.attributes);Object(l.a)(e.vertexShaderText)&&function(e,t,n){const i=t8(t,e.usedVariablesVertex.attributeSet,!1),r=i.addToShader,o=i.missingAttributes;let a,s;const c=[],u=[];for(a in r)if(r.hasOwnProperty(a)){const e=[r[a].glslType,a];c.push(e),s=`vsInput.attributes.${a} = attributes.${a};`,u.push(s)}for(let e=0;e<o.length;e++){a=o[e];const t=Q6(a);if(!Object(l.a)(t))return void J6._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${a}, disabling custom vertex shader`);c.push(t.attributeField),s=`vsInput.attributes.${a} = ${t.value};`,u.push(s)}n.enabled=!0,n.attributeFields=c,n.initializationLines=u}(e,r,n);Object(l.a)(e.fragmentShaderText)&&function(e,t,n){const i=t8(t,e.usedVariablesFragment.attributeSet,!0),r=i.addToShader,o=i.missingAttributes;let a,s;const c=[],u=[];for(a in r)if(r.hasOwnProperty(a)){const e=[r[a].glslType,a];c.push(e),s=`fsInput.attributes.${a} = attributes.${a};`,u.push(s)}for(let e=0;e<o.length;e++){a=o[e];const t=Q6(a);if(!Object(l.a)(t))return void J6._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${a}, disabling custom fragment shader.`);c.push(t.attributeField),s=`fsInput.attributes.${a} = ${t.value};`,u.push(s)}const h=function(e){const t=[],n=[],i=e.usedVariablesFragment.attributeSet;i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;"));i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;"));return{attributeFields:t,initializationLines:n}}(e);n.enabled=!0,n.attributeFields=c.concat(h.attributeFields),n.initializationLines=h.initializationLines.concat(u)}(e,r,i);const o=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&i.enabled;return{vertexLines:n,fragmentLines:i,vertexLinesEnabled:n.enabled,fragmentLinesEnabled:i.enabled,customShaderEnabled:n.enabled||i.enabled,shouldComputePositionWC:o}}(r,t);if(!a.customShaderEnabled)return;if(function(e,t,n){const i=n.vertexLines;i.enabled&&(!function(e,t){let n,i=J6.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(i,J6.STRUCT_NAME_ATTRIBUTES,S5.VERTEX);const r=t.attributeFields;for(n=0;n<r.length;n++){const t=r[n],o=t[0],a=t[1];e.addStructField(i,o,a)}i=J6.STRUCT_ID_VERTEX_INPUT,e.addStruct(i,J6.STRUCT_NAME_VERTEX_INPUT,S5.VERTEX),e.addStructField(i,J6.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(i,H6.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(i,K6.STRUCT_NAME_METADATA,"metadata"),e.addStructField(i,K6.STRUCT_NAME_METADATACLASS,"metadataClass");const o=J6.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,J6.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,S5.VERTEX);const a=t.initializationLines;e.addFunctionLines(o,a)}(e,i),e.addVertexLines(["#line 0",t.vertexShaderText,j6]));const r=n.fragmentLines;r.enabled&&(!function(e,t){let n,i,r,o,a=J6.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(a,J6.STRUCT_NAME_ATTRIBUTES,S5.FRAGMENT);const s=t.attributeFields;for(n=0;n<s.length;n++)i=s[n],r=i[0],o=i[1],e.addStructField(a,r,o);a=J6.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(a,J6.STRUCT_NAME_FRAGMENT_INPUT,S5.FRAGMENT),e.addStructField(a,J6.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(a,H6.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(a,K6.STRUCT_NAME_METADATA,"metadata"),e.addStructField(a,K6.STRUCT_NAME_METADATACLASS,"metadataClass");const c=J6.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(c,J6.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,S5.FRAGMENT);const l=t.initializationLines;e.addFunctionLines(c,l)}(e,r),e.addFragmentLines(["#line 0",t.fragmentShaderText,M6]))}(i,r,a),a.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,S5.BOTH),Object(l.a)(r.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,S5.VERTEX),Object(l.a)(r.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,S5.FRAGMENT);const e=R6.getDefineName(r.mode);i.addDefine(e,void 0,S5.FRAGMENT)}const s=r.uniforms;for(const e in s)if(s.hasOwnProperty(e)){const t=s[e];i.addUniform(t.type,e)}const c=r.varyings;for(const e in c)if(c.hasOwnProperty(e)){const t=c[e];i.addVarying(t,e)}e.uniformMap=Object(up.a)(e.uniformMap,r.uniformMap)};const Z6={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},$6={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Q6(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");const n=Z6[t],i=$6[t];if(Object(l.a)(n))return{attributeField:[n,e],value:i}}const e8={positionWC:!0,positionEC:!0};function t8(e,t,n){let i,r;const o={};for(r in e)if(e.hasOwnProperty(r)){const a=e[r];i=r,n&&"normalMC"===r?i="normalEC":n&&"tangentMC"===r&&(i="tangentEC"),t.hasOwnProperty(i)&&(o[i]=a)}const a=[];for(r in t)if(t.hasOwnProperty(r)){if(e8.hasOwnProperty(r))continue;i=r,n&&"normalEC"===r?i="normalMC":n&&"tangentEC"===r&&(i="tangentMC"),e.hasOwnProperty(i)||a.push(r)}return{addToShader:o,missingAttributes:a}}J6._oneTimeWarning=cl;var n8=J6,i8="void filterByPassType(inout vec3 positionMC, vec4 featureColor)\n{\n    bool styleTranslucent = (featureColor.a != 1.0);\n    // Only render translucent features in the translucent pass (if the style or the original command has translucency).\n    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\n    {\n        // If the model has a translucent silhouette, it needs to render during the silhouette color command,\n        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\n        #ifdef HAS_SILHOUETTE\n        positionMC *= float(model_silhouettePass);\n        #else\n        positionMC *= 0.0;\n        #endif\n    }\n    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\n    else if (czm_pass != czm_passTranslucent && styleTranslucent)\n    {\n        positionMC *= 0.0;\n    }\n}\n\nvoid cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)\n{\n    float show = ceil(feature.color.a);\n    positionMC *= show;\n\n    #ifdef HAS_SELECTED_FEATURE_ID_ATTRIBUTE\n    filterByPassType(positionMC, feature.color);\n    #endif\n}\n",r8="void filterByPassType(vec4 featureColor)\n{\n    bool styleTranslucent = (featureColor.a != 1.0);\n    // Only render translucent features in the translucent pass (if the style or the original command has translucency).\n    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\n    {   \n        // If the model has a translucent silhouette, it needs to render during the silhouette color command,\n        // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\n        #ifdef HAS_SILHOUETTE\n        if(!model_silhouettePass) {\n            discard;\n        }\n        #else\n        discard;\n        #endif\n    }\n    // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\n    else if (czm_pass != czm_passTranslucent && styleTranslucent)\n    {\n        discard;\n    }\n}\n\nvoid cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)\n{\n    vec4 featureColor = feature.color;\n\n    if (featureColor.a == 0.0)\n    {\n        discard;\n    }\n\n    // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.\n    // So, we only apply in in the fragment shader if the feature ID texture is used.\n    #ifdef HAS_SELECTED_FEATURE_ID_TEXTURE\n    filterByPassType(featureColor);\n    #endif\n\n    featureColor = czm_gammaCorrect(featureColor);\n\n    float highlight = ceil(model_colorBlend);\n    material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);\n    material.alpha *= featureColor.a;\n}\n";const o8={name:"CPUStylingPipelineStage",process:function(e,t,n){const i=e.model,r=e.shaderBuilder;r.addVertexLines([i8]),r.addFragmentLines([r8]),r.addDefine("USE_CPU_STYLING",void 0,S5.BOTH),Object(l.a)(i.color)||(r.addUniform("float",k5.COLOR_BLEND_UNIFORM_NAME,S5.FRAGMENT),e.uniformMap[k5.COLOR_BLEND_UNIFORM_NAME]=function(){return kq.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",S5.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===KR.TRANSLUCENT};const o=i.featureTables[i.featureTableId],a=h5.getStyleCommandsNeeded(o.featuresLength,o.batchTexture.translucentFeaturesLength);a===h5.ALL_TRANSLUCENT&&(e.alphaOptions.pass=KR.TRANSLUCENT),e.styleCommandsNeeded=a}};var a8=o8;const s8={};function c8(e,t){const n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){const e="model_normalizationRange_"+r;n.addUniform("float",e,S5.VERTEX),i[e]=function(){return o.normalizationRange}}else{const e="model_quantizedVolumeOffset_"+r,a="model_quantizedVolumeStepSize_"+r,s=t.glslType;n.addUniform(s,e,S5.VERTEX),n.addUniform(s,a,S5.VERTEX);let c=o.quantizedVolumeOffset,l=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(c=l8(c,0),l=l8(l,1)),i[e]=function(){return c},i[a]=function(){return l}}}function l8(e,t){return e instanceof _e?e:new _e(e.x,e.y,e.z,t)}function u8(e,t){const n=t.variableName,i=t.attribute.quantization;let r;r=i.octEncoded?function(e,t){const n="attributes."+e,i="a_quantized_"+e,r="model_normalizationRange_"+e,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}(n,i):function(e){return`${"attributes."+e} = ${"model_quantizedVolumeOffset_"+e} + ${"a_quantized_"+e} * ${"model_quantizedVolumeStepSize_"+e};`}(n),e.addFunctionLines(s8.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}s8.name="DequantizationPipelineStage",s8.FUNCTION_ID_DEQUANTIZATION_STAGE_VS="dequantizationStage",s8.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS="void dequantizationStage(inout ProcessedAttributes attributes)",s8.process=function(e,t,n){const i=e.shaderBuilder;i.addFunction(s8.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,s8.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,S5.VERTEX),i.addDefine("USE_DEQUANTIZATION",void 0,S5.VERTEX);const r=t.attributes;for(let t=0;t<r.length;t++){const n=r[t],o=n.quantization;if(!Object(l.a)(o))continue;const a=O5.getAttributeInfo(n);u8(i,a),c8(e,a)}};var h8=s8,d8="void geometryStage(out ProcessedAttributes attributes)\n{\n  attributes.positionMC = v_positionMC;\n  attributes.positionEC = v_positionEC;\n\n  #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER\n  attributes.positionWC = v_positionWC;\n  #endif\n\n  #ifdef HAS_NORMALS\n  // renormalize after interpolation\n  attributes.normalEC = normalize(v_normalEC);\n  #endif\n\n  #ifdef HAS_TANGENTS\n  attributes.tangentEC = normalize(v_tangentEC);\n  #endif\n\n  #ifdef HAS_BITANGENTS\n  attributes.bitangentEC = normalize(v_bitangentEC);\n  #endif\n\n  // Everything else is dynamically generated in GeometryPipelineStage\n  setDynamicVaryings(attributes);\n}\n",f8="vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) \n{\n    vec4 computedPosition;\n\n    // Compute positions in different coordinate systems\n    vec3 positionMC = attributes.positionMC;\n    v_positionMC = positionMC;\n    v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;\n\n    #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\n    vec3 position2D = attributes.position2D;\n    vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;\n    computedPosition = czm_projection * vec4(positionEC, 1.0);\n    #else\n    computedPosition = czm_projection * vec4(v_positionEC, 1.0);\n    #endif\n\n    // Sometimes the custom shader and/or style needs this\n    #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE)\n    // Note that this is a 32-bit position which may result in jitter on small\n    // scales.\n    v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\n    #endif\n\n    #ifdef HAS_NORMALS\n    v_normalEC = normal * attributes.normalMC;\n    #endif\n\n    #ifdef HAS_TANGENTS\n    v_tangentEC = normalize(normal * attributes.tangentMC);    \n    #endif\n\n    #ifdef HAS_BITANGENTS\n    v_bitangentEC = normalize(normal * attributes.bitangentMC);\n    #endif\n\n    // All other varyings need to be dynamically generated in\n    // GeometryPipelineStage\n    setDynamicVaryings(attributes);\n    \n    return computedPosition;\n}\n";const p8={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON",is3DTiles:function(e){switch(s.a.typeOf.string("modelType",e),e){case p8.TILE_GLTF:case p8.TILE_B3DM:case p8.TILE_I3DM:case p8.TILE_PNTS:case p8.TILE_GEOJSON:return!0;case p8.GLTF:return!1;default:throw new u.a("modelType is not a valid value.")}}};var m8=Object.freeze(p8),g8="vec2 computeSt(float featureId)\n{\n    float stepX = model_textureStep.x;\n    float centerX = model_textureStep.y;\n\n    #ifdef MULTILINE_BATCH_TEXTURE\n    float stepY = model_textureStep.z;\n    float centerY = model_textureStep.w;\n\n    float xId = mod(featureId, model_textureDimensions.x); \n    float yId = floor(featureId / model_textureDimensions.x);\n    \n    return vec2(centerX + (xId * stepX), centerY + (yId * stepY));\n    #else\n    return vec2(centerX + (featureId * stepX), 0.5);\n    #endif\n}\n\nvoid selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)\n{   \n    int featureId = featureIds.SELECTED_FEATURE_ID;\n\n\n    if (featureId < model_featuresLength)\n    {\n        vec2 featureSt = computeSt(float(featureId));\n\n        feature.id = featureId;\n        feature.st = featureSt;\n        feature.color = texture2D(model_batchTexture, featureSt);\n    }\n    // Floating point comparisons can be unreliable in GLSL, so we\n    // increment the feature ID to make sure it's always greater\n    // then the model_featuresLength - a condition we check for in the\n    // pick ID, to avoid sampling the pick texture if the feature ID is\n    // greater than the number of features.\n    else\n    {\n        feature.id = model_featuresLength + 1;\n        feature.st = vec2(0.0);\n        feature.color = vec4(1.0);\n    }\n\n    #ifdef HAS_NULL_FEATURE_ID\n    if (featureId == model_nullFeatureId) {\n        feature.id = featureId;\n        feature.st = vec2(0.0);\n        feature.color = vec4(1.0);\n    }\n    #endif\n}\n";const _8={};function y8(e){return e instanceof UK.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function b8(e){return e instanceof UK.FeatureIdTexture?S5.FRAGMENT:S5.BOTH}_8.name="SelectedFeatureIdPipelineStage",_8.STRUCT_ID_SELECTED_FEATURE="SelectedFeature",_8.STRUCT_NAME_SELECTED_FEATURE="SelectedFeature",_8.FUNCTION_ID_FEATURE_VARYINGS_VS="updateFeatureStructVS",_8.FUNCTION_ID_FEATURE_VARYINGS_FS="updateFeatureStructFS",_8.FUNCTION_SIGNATURE_UPDATE_FEATURE="void updateFeatureStruct(inout SelectedFeature feature)",_8.process=function(e,t,n){const i=e.shaderBuilder;e.hasPropertyTable=!0;const r=function(e,t,n){let i,r;if(Object(l.a)(t.instances)&&(r=O5.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),Object(l.a)(r)))return i=Object(c.a)(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:b8(r),featureIdDefine:y8(r)};return r=O5.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=Object(c.a)(r.label,r.positionalLabel),{featureIds:r,variableName:i,shaderDestination:b8(r),featureIdDefine:y8(r)}}(e.model,e.runtimeNode.node,t),o=r.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,o),i.addDefine("SELECTED_FEATURE_ID",r.variableName,o),i.addDefine(r.featureIdDefine,void 0,o),function(e){e.addStructField(_8.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(_8.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(_8.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}(i);const a=r.featureIds.nullFeatureId,s=e.uniformMap;Object(l.a)(a)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,o),i.addUniform("int","model_nullFeatureId",o),s.model_nullFeatureId=function(){return a}),r.shaderDestination===S5.BOTH&&i.addVertexLines([g8]),i.addFragmentLines([g8])};var v8=_8;const O8={};function w8(e,t,n,i,r,o){const a=e.shaderBuilder,s=O5.getAttributeInfo(t),c=r&&!o;i>1?function(e,t,n,i){const r=t.quantization;let o,a;Object(l.a)(r)?(o=r.type,a=r.componentDatatype):(o=t.type,a=t.componentDatatype);const s=t.normalized,c=Cs.getNumberOfComponents(o)/i,u=gs.getSizeInBytes(a),h=c*u,d=t.byteStride;for(let r=0;r<i;r++){const i=t.byteOffset+r*h,o={index:n+r,vertexBuffer:t.buffer,componentsPerAttribute:c,componentDatatype:a,offsetInBytes:i,strideInBytes:d,normalize:s};e.attributes.push(o)}}(e,t,n,i):function(e,t,n,i){const r=t.quantization;let o,a;Object(l.a)(r)?(o=r.type,a=r.componentDatatype):(o=t.type,a=t.componentDatatype);const s=t.semantic,c=t.setIndex;s===TZ.FEATURE_ID&&c>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=c+1);const u=s===TZ.POSITION,h=u?0:n,d=Cs.getNumberOfComponents(o),f={index:h,value:Object(l.a)(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(f),!u||!i)return;const p=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:p,count:t.count,componentsPerAttribute:d,componentDatatype:gs.FLOAT,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(m)}(e,t,n,c),function(e,t,n){const i=t.attribute.semantic,r=t.variableName;let o,a;t.isQuantized?(o="a_quantized_"+r,a=t.quantizedGlslType):(o="a_"+r,a=t.glslType);const s=i===TZ.POSITION;s?e.setPositionAttribute(a,o):e.addAttribute(a,o);s&&n&&e.addAttribute("vec3","a_position2D")}(a,s,c),function(e,t){const n=t.variableName;let i,r="v_"+n;"normalMC"===n?(r="v_normalEC",i=t.glslType):"tangentMC"===n?(i="vec3",r="v_tangentEC"):i=t.glslType;e.addVarying(i,r)}(a,s),Object(l.a)(t.semantic)&&function(e,t){const n=t.semantic,i=t.setIndex;switch(n){case TZ.NORMAL:e.addDefine("HAS_NORMALS");break;case TZ.TANGENT:e.addDefine("HAS_TANGENTS");break;case TZ.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case TZ.TEXCOORD:case TZ.COLOR:e.addDefine(`HAS_${n}_${i}`)}}(a,t),function(e,t,n){const i=O8.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=O8.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,o=t.variableName;"tangentMC"===o?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):"normalMC"===o?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,t.glslType,o),e.addStructField(r,t.glslType,o));"positionMC"===o&&n&&e.addStructField(i,"vec3","position2D")}(a,s,r),function(e,t,n){const i=O8.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if("positionMC"===r&&n){const t="attributes.position2D = a_position2D;";e.addFunctionLines(i,[t])}if(t.isQuantized)return;const o=[];"tangentMC"===r?(o.push("attributes.tangentMC = a_tangentMC.xyz;"),o.push("attributes.tangentSignMC = a_tangentMC.w;")):o.push(`attributes.${r} = a_${r};`);e.addFunctionLines(i,o)}(a,s,c),function(e,t){const n=t.attribute.semantic,i=t.attribute.setIndex;if(Object(l.a)(n)&&!Object(l.a)(i))return;let r=O8.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS;const o=t.variableName;let a=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[a]),r=O8.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[a])}(a,s)}O8.name="GeometryPipelineStage",O8.STRUCT_ID_PROCESSED_ATTRIBUTES_VS="ProcessedAttributesVS",O8.STRUCT_ID_PROCESSED_ATTRIBUTES_FS="ProcessedAttributesFS",O8.STRUCT_NAME_PROCESSED_ATTRIBUTES="ProcessedAttributes",O8.FUNCTION_ID_INITIALIZE_ATTRIBUTES="initializeAttributes",O8.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES="void initializeAttributes(out ProcessedAttributes attributes)",O8.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS="setDynamicVaryingsVS",O8.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS="setDynamicVaryingsFS",O8.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS="void setDynamicVaryings(inout ProcessedAttributes attributes)",O8.process=function(e,t,n){const i=e.shaderBuilder;i.addStruct(O8.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",S5.VERTEX),i.addStruct(O8.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",S5.FRAGMENT),i.addStruct(v8.STRUCT_ID_SELECTED_FEATURE,v8.STRUCT_NAME_SELECTED_FEATURE,S5.BOTH),i.addFunction(O8.FUNCTION_ID_INITIALIZE_ATTRIBUTES,O8.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,S5.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(O8.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(O8.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(O8.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,O8.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,S5.VERTEX),i.addFunction(O8.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,O8.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,S5.FRAGMENT);const r=e.model;r.type===m8.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,S5.FRAGMENT);const o=n.mode!==AB.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,a=Object(l.a)(e.runtimeNode.node.instances),s=o&&!a,c=t.attributes.length;for(let n=0;n<c;n++){const i=t.attributes[n],r=Cs.getAttributeLocationCount(i.type),c=i.semantic===TZ.POSITION;if(!Object(l.a)(i.buffer)&&!Object(l.a)(i.constant))throw new u.a("Attributes must be provided as a Buffer or constant value");let h;r>1?(h=e.attributeIndex,e.attributeIndex+=r):h=c&&!s?0:e.attributeIndex++,w8(e,i,h,r,o,a)}!function(e,t){let n=!1,i=!1;for(let e=0;e<t.length;e++){const r=t[e];r.semantic===TZ.NORMAL?n=!0:r.semantic===TZ.TANGENT&&(i=!0)}if(!n||!i)return;e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(O8.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(O8.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC")}(i,t.attributes),t.primitiveType===zl.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines([f8]),i.addFragmentLines([d8])};var A8=O8,E8="#ifdef LIGHTING_PBR\nvec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)\n{\n    czm_pbrParameters pbrParameters;\n    pbrParameters.diffuseColor = inputMaterial.diffuse;\n    pbrParameters.f0 = inputMaterial.specular;\n    pbrParameters.roughness = inputMaterial.roughness;\n    \n    #ifdef USE_CUSTOM_LIGHT_COLOR\n    vec3 lightColorHdr = model_lightColorHdr;\n    #else\n    vec3 lightColorHdr = czm_lightColorHdr;\n    #endif\n\n    vec3 color = inputMaterial.diffuse;\n    #ifdef HAS_NORMALS\n    color = czm_pbrLighting(\n        attributes.positionEC,\n        inputMaterial.normalEC,\n        czm_lightDirectionEC,\n        lightColorHdr,\n        pbrParameters\n    );\n\n        #ifdef USE_IBL_LIGHTING\n        color += imageBasedLightingStage(\n            attributes.positionEC,\n            inputMaterial.normalEC,\n            czm_lightDirectionEC,\n            lightColorHdr,\n            pbrParameters\n        );\n        #endif\n    #endif\n\n    color *= inputMaterial.occlusion;\n    color += inputMaterial.emissive;\n\n    // In HDR mode, the frame buffer is in linear color space. The\n    // post-processing stages (see PostProcessStageCollection) will handle\n    // tonemapping. However, if HDR is not enabled, we must tonemap else large\n    // values may be clamped to 1.0\n    #ifndef HDR \n    color = czm_acesTonemapping(color);\n    #endif \n\n    return color;\n}\n#endif\n\nvoid lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)\n{\n    // Even though the lighting will only set the diffuse color,\n    // pass all other properties so further stages have access to them.\n    vec3 color = vec3(0.0);\n\n    #ifdef LIGHTING_PBR\n    color = computePbrLighting(material, attributes);\n    #else // unlit\n    color = material.diffuse;\n    #endif\n\n    #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n    // The colors resulting from point cloud styles are adjusted differently.\n    color = czm_gammaCorrect(color);\n    #elif !defined(HDR)\n    // If HDR is not enabled, the frame buffer stores sRGB colors rather than\n    // linear colors so the linear value must be converted.\n    color = czm_linearToSrgb(color);\n    #endif\n\n    material.diffuse = color;\n}\n";var T8=Object.freeze({UNLIT:0,PBR:1});const C8={name:"LightingPipelineStage",process:function(e,t){const n=e.model,i=e.lightingOptions,r=e.shaderBuilder;if(Object(l.a)(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,S5.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",S5.FRAGMENT);e.uniformMap.model_lightColorHdr=function(){return n.lightColor}}i.lightingModel===T8.PBR?r.addDefine("LIGHTING_PBR",void 0,S5.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,S5.FRAGMENT),r.addFragmentLines([E8])}};var x8=C8,S8="// If the style color is white, it implies the feature has not been styled.\nbool isDefaultStyleColor(vec3 color)\n{\n    return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));\n}\n\nvec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)\n{\n    vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);\n    vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;\n    return color;\n}\n\nvec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)\n{\n    return vec2(textureTransform * vec3(texCoord, 1.0));\n}\n\n#ifdef HAS_NORMALS\nvec3 computeNormal(ProcessedAttributes attributes)\n{\n    // Geometry normal. This is already normalized \n    vec3 ng = attributes.normalEC;\n\n    vec3 normal = ng;\n    #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)\n    vec2 normalTexCoords = TEXCOORD_NORMAL;\n        #ifdef HAS_NORMAL_TEXTURE_TRANSFORM\n        normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);\n        #endif\n\n        // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set\n        #ifdef HAS_BITANGENTS\n        vec3 t = attributes.tangentEC;\n        vec3 b = attributes.bitangentEC;\n        mat3 tbn = mat3(t, b, ng);\n        vec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;\n        normal = normalize(tbn * (2.0 * n - 1.0));\n        #elif defined(GL_OES_standard_derivatives)\n        // Compute tangents\n        vec3 positionEC = attributes.positionEC;\n        vec3 pos_dx = dFdx(positionEC);\n        vec3 pos_dy = dFdy(positionEC);\n        vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));\n        vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));\n        vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n        t = normalize(t - ng * dot(ng, t));\n        vec3 b = normalize(cross(ng, t));\n        mat3 tbn = mat3(t, b, ng);\n        vec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;\n        normal = normalize(tbn * (2.0 * n - 1.0));\n        #endif\n    #endif\n\n    #ifdef HAS_DOUBLE_SIDED_MATERIAL\n    if (czm_backFacing()) {\n        normal = -normal;\n    }\n    #endif\n\n    return normal;\n}\n#endif\n\nvoid materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)\n{\n\n    #ifdef HAS_NORMALS\n    material.normalEC = computeNormal(attributes);\n    #endif\n\n    vec4 baseColorWithAlpha = vec4(1.0);\n    // Regardless of whether we use PBR, set a base color\n    #ifdef HAS_BASE_COLOR_TEXTURE\n    vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;\n\n        #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM\n        baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);\n        #endif\n\n    baseColorWithAlpha = czm_srgbToLinear(texture2D(u_baseColorTexture, baseColorTexCoords));\n\n        #ifdef HAS_BASE_COLOR_FACTOR\n        baseColorWithAlpha *= u_baseColorFactor;\n        #endif\n    #elif defined(HAS_BASE_COLOR_FACTOR)\n    baseColorWithAlpha = u_baseColorFactor;\n    #endif\n\n    #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n    baseColorWithAlpha = v_pointCloudColor;\n    #elif defined(HAS_COLOR_0)\n    vec4 color = attributes.color_0;\n        // .pnts files store colors in the sRGB color space\n        #ifdef HAS_SRGB_COLOR\n        color = czm_srgbToLinear(color);\n        #endif\n    baseColorWithAlpha *= color;\n    #endif\n\n    material.diffuse = baseColorWithAlpha.rgb;\n    material.alpha = baseColorWithAlpha.a;\n\n    #ifdef USE_CPU_STYLING\n    material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);\n    #endif\n\n    #ifdef HAS_OCCLUSION_TEXTURE\n    vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;\n        #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM\n        occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);\n        #endif\n    material.occlusion = texture2D(u_occlusionTexture, occlusionTexCoords).r;\n    #endif\n\n    #ifdef HAS_EMISSIVE_TEXTURE\n    vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;\n        #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM\n        emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);\n        #endif\n\n    vec3 emissive = czm_srgbToLinear(texture2D(u_emissiveTexture, emissiveTexCoords).rgb);\n        #ifdef HAS_EMISSIVE_FACTOR\n        emissive *= u_emissiveFactor;\n        #endif\n    material.emissive = emissive;\n    #elif defined(HAS_EMISSIVE_FACTOR)\n    material.emissive = u_emissiveFactor;\n    #endif\n\n    #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)\n        #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE\n        vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;\n          #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM\n          specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);\n          #endif\n\n        vec4 specularGlossiness = czm_srgbToLinear(texture2D(u_specularGlossinessTexture, specularGlossinessTexCoords));\n        vec3 specular = specularGlossiness.rgb;\n        float glossiness = specularGlossiness.a;\n            #ifdef HAS_SPECULAR_FACTOR\n            specular *= u_specularFactor;\n            #endif\n\n            #ifdef HAS_GLOSSINESS_FACTOR\n            glossiness *= u_glossinessFactor;\n            #endif\n        #else\n            #ifdef HAS_SPECULAR_FACTOR\n            vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n            #else\n            vec3 specular = vec3(1.0);\n            #endif\n\n            #ifdef HAS_GLOSSINESS_FACTOR\n            float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n            #else\n            float glossiness = 1.0;\n            #endif\n        #endif\n\n        #ifdef HAS_DIFFUSE_TEXTURE\n        vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;\n            #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM\n            diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);\n            #endif\n\n        vec4 diffuse = czm_srgbToLinear(texture2D(u_diffuseTexture, diffuseTexCoords));\n            #ifdef HAS_DIFFUSE_FACTOR\n            diffuse *= u_diffuseFactor;\n            #endif\n        #elif defined(HAS_DIFFUSE_FACTOR)\n        vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n        #else\n        vec4 diffuse = vec4(1.0);\n        #endif\n    czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(\n      diffuse.rgb,\n      specular,\n      glossiness\n    );\n    material.diffuse = parameters.diffuseColor;\n    // the specular glossiness extension's alpha overrides anything set\n    // by the base material.\n    material.alpha = diffuse.a;\n    material.specular = parameters.f0;\n    material.roughness = parameters.roughness;\n    #elif defined(LIGHTING_PBR)\n        #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE\n        vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;\n            #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM\n            metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);\n            #endif\n\n        vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\n        float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n        float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n            #ifdef HAS_METALLIC_FACTOR\n            metalness *= u_metallicFactor;\n            #endif\n\n            #ifdef HAS_ROUGHNESS_FACTOR\n            roughness *= u_roughnessFactor;\n            #endif\n        #else\n            #ifdef HAS_METALLIC_FACTOR\n            float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n            #else\n            float metalness = 1.0;\n            #endif\n\n            #ifdef HAS_ROUGHNESS_FACTOR\n            float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n            #else\n            float roughness = 1.0;\n            #endif\n        #endif\n    czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(\n      material.diffuse,\n      metalness,\n      roughness\n    );\n    material.diffuse = parameters.diffuseColor;\n    material.specular = parameters.f0;\n    material.roughness = parameters.roughness;\n    #endif\n}\n";const I8=UK.Material,P8=UK.MetallicRoughness,D8=UK.SpecularGlossiness,R8={};function j8(e,t,n,i,r){const o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,S5.FRAGMENT);const a=i+"Transform";e.addUniform("mat3",a,S5.FRAGMENT),t[a]=function(){return n.transform}}function M8(e,t,n,i,r,o){e.addUniform("sampler2D",i,S5.FRAGMENT),t[i]=function(){return Object(c.a)(n.texture,o)};const a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,S5.FRAGMENT);const s="v_texCoord_"+n.texCoord,u="TEXCOORD_"+r;e.addDefine(u,s,S5.FRAGMENT);const h=n.transform;Object(l.a)(h)&&!ce.equals(h,ce.IDENTITY)&&j8(e,t,n,i,r)}R8.name="MaterialPipelineStage",R8.process=function(e,t,n){const i=t.material,r=e.uniformMap,o=e.shaderBuilder,a=n.context.defaultTexture;!function(e,t,n,i,r,o){const a=e.emissiveTexture;Object(l.a)(a)&&M8(n,t,a,"u_emissiveTexture","EMISSIVE",o);const s=e.emissiveFactor;Object(l.a)(s)&&!O.equals(s,I8.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",S5.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,S5.FRAGMENT));const c=e.normalTexture;Object(l.a)(c)&&M8(n,t,c,"u_normalTexture","NORMAL",r);const u=e.occlusionTexture;Object(l.a)(u)&&M8(n,t,u,"u_occlusionTexture","OCCLUSION",i)}(i,r,o,a,n.context.defaultNormalTexture,n.context.defaultEmissiveTexture),Object(l.a)(i.specularGlossiness)?function(e,t,n,i){const r=e.specularGlossiness;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,S5.FRAGMENT);const o=r.diffuseTexture;Object(l.a)(o)&&M8(n,t,o,"u_diffuseTexture","DIFFUSE",i);const a=r.diffuseFactor;Object(l.a)(a)&&!_e.equals(a,D8.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",S5.FRAGMENT),t.u_diffuseFactor=function(){return r.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,S5.FRAGMENT));const s=r.specularGlossinessTexture;Object(l.a)(s)&&M8(n,t,s,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i);const c=r.specularFactor;Object(l.a)(c)&&!O.equals(c,D8.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_specularFactor",S5.FRAGMENT),t.u_specularFactor=function(){return r.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,S5.FRAGMENT));const u=r.glossinessFactor;Object(l.a)(u)&&u!==D8.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",S5.FRAGMENT),t.u_glossinessFactor=function(){return r.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,S5.FRAGMENT))}(i,r,o,a):function(e,t,n,i){const r=e.metallicRoughness;n.addDefine("USE_METALLIC_ROUGHNESS",void 0,S5.FRAGMENT);const o=r.baseColorTexture;Object(l.a)(o)&&M8(n,t,o,"u_baseColorTexture","BASE_COLOR",i);const a=r.baseColorFactor;Object(l.a)(a)&&!_e.equals(a,P8.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",S5.FRAGMENT),t.u_baseColorFactor=function(){return r.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,S5.FRAGMENT));const s=r.metallicRoughnessTexture;Object(l.a)(s)&&M8(n,t,s,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);const c=r.metallicFactor;Object(l.a)(c)&&c!==P8.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",S5.FRAGMENT),t.u_metallicFactor=function(){return r.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,S5.FRAGMENT));const u=r.roughnessFactor;Object(l.a)(u)&&u!==P8.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",S5.FRAGMENT),t.u_roughnessFactor=function(){return r.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,S5.FRAGMENT))}(i,r,o,a);const s=O5.getAttributeBySemantic(t,TZ.NORMAL),c=e.lightingOptions;i.unlit||!s?c.lightingModel=T8.UNLIT:c.lightingModel=T8.PBR;const u=e.model.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=u;const h=e.alphaOptions;i.alphaMode===LK.BLEND?h.pass=KR.TRANSLUCENT:i.alphaMode===LK.MASK&&(h.alphaCutoff=i.alphaCutoff),o.addFragmentLines([S8]),i.doubleSided&&o.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,S5.FRAGMENT)},R8._processTexture=M8,R8._processTextureTransform=j8;var L8=R8,N8="void morphTargetsStage(inout ProcessedAttributes attributes) \n{\n    vec3 positionMC = attributes.positionMC;\n    attributes.positionMC = getMorphedPosition(positionMC);\n\n    #ifdef HAS_NORMALS\n    vec3 normalMC = attributes.normalMC;\n    attributes.normalMC = getMorphedNormal(normalMC);\n    #endif\n\n    #ifdef HAS_TANGENTS\n    vec3 tangentMC = attributes.tangentMC;\n    attributes.tangentMC = getMorphedTangent(tangentMC);\n    #endif\n}";const B8={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};B8.process=function(e,t){const n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,S5.VERTEX),function(e){e.addFunction(B8.FUNCTION_ID_GET_MORPHED_POSITION,B8.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,S5.VERTEX);e.addFunctionLines(B8.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(B8.FUNCTION_ID_GET_MORPHED_NORMAL,B8.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,S5.VERTEX);e.addFunctionLines(B8.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(B8.FUNCTION_ID_GET_MORPHED_TANGENT,B8.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,S5.VERTEX);e.addFunctionLines(B8.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}(n);const i=t.morphTargets.length;for(let n=0;n<i;n++){const i=t.morphTargets[n].attributes,r=i.length;for(let t=0;t<r;t++){const r=i[t],o=r.semantic;o!==TZ.POSITION&&o!==TZ.NORMAL&&o!==TZ.TANGENT||(z8(e,r,e.attributeIndex,n),e.attributeIndex++)}}!function(e){e.addFunctionLines(B8.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]);e.addFunctionLines(B8.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]);e.addFunctionLines(B8.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}(n);const r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,S5.VERTEX),n.addVertexLines([N8]);const o={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Object(up.a)(o,e.uniformMap)};const F8={attributeString:void 0,functionId:void 0};function z8(e,t,n,i){const r=e.shaderBuilder;!function(e,t,n){const i={index:n,value:Object(l.a)(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Cs.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}(e,t,n);!function(e,t,n){const i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}(r,function(e,t){switch(e.semantic){case TZ.POSITION:t.attributeString="Position",t.functionId=B8.FUNCTION_ID_GET_MORPHED_POSITION;break;case TZ.NORMAL:t.attributeString="Normal",t.functionId=B8.FUNCTION_ID_GET_MORPHED_NORMAL;break;case TZ.TANGENT:t.attributeString="Tangent",t.functionId=B8.FUNCTION_ID_GET_MORPHED_TANGENT}return t}(t,F8),i)}var k8=B8;const U8={};function V8(e,t){const n=e.model,i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive};let r;if(m8.is3DTiles(n.type)){const e=n.content;r={content:e,primitive:e.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,Object(l.a)(t)&&(r.instanceId=t),r}U8.name="PickingPipelineStage",U8.process=function(e,t,n){const i=n.context,r=e.runtimeNode,o=e.shaderBuilder,a=e.model,s=r.node.instances;if(e.hasPropertyTable)!function(e,t,n){const i=e.model;let r,o;const a=i.featureIdLabel,s=i.instanceFeatureIdLabel;Object(l.a)(i.featureTableId)?r=i.featureTableId:Object(l.a)(n)?(o=O5.getFeatureIdsByLabel(n.featureIds,s),r=o.propertyTableId):(o=O5.getFeatureIdsByLabel(t.featureIds,a),r=o.propertyTableId);const u=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",S5.FRAGMENT);const h=u.batchTexture;e.uniformMap.model_pickTexture=function(){return Object(c.a)(h.pickTexture,h.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture2D(model_pickTexture, selectedFeature.st) : vec4(0.0))"}(e,t,s);else if(Object(l.a)(s))!function(e,t){const n=e.instanceCount,i=new Array(n),r=new Uint8Array(4*n),o=e.model,a=o._pipelineResources;for(let o=0;o<n;o++){const n=V8(e,o),s=t.createPickId(n);a.push(s),i[o]=s;const c=s.color;r[4*o+0]=sp.floatToByte(c.red),r[4*o+1]=sp.floatToByte(c.green),r[4*o+2]=sp.floatToByte(c.blue),r[4*o+3]=sp.floatToByte(c.alpha)}o._pickIds=i;const s=ZN.createVertexBuffer({context:t,typedArray:r,usage:KN.STATIC_DRAW});s.vertexArrayDestroyable=!1;o.statistics.addBuffer(s,!1),a.push(s);const c={index:e.attributeIndex++,vertexBuffer:s,componentsPerAttribute:4,componentDatatype:gs.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(c);const l=e.shaderBuilder;l.addDefine("USE_PICKING",void 0,S5.BOTH),l.addAttribute("vec4","a_pickColor"),l.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}(e,i);else{const t=V8(e),n=i.createPickId(t);a._pipelineResources.push(n),a._pickIds.push(n),o.addUniform("vec4","czm_pickColor",S5.FRAGMENT);e.uniformMap.czm_pickColor=function(){return n.color},e.pickId="czm_pickColor"}};var H8=U8,G8="float getPointSizeFromAttenuation(vec3 positionEC) {\n  // Variables are packed into a single vector to minimize gl.uniformXXX() calls\n  float pointSize = model_pointCloudParameters.x;\n  float geometricError = model_pointCloudParameters.y;\n  float depthMultiplier = model_pointCloudParameters.z;\n\n  float depth = -positionEC.z;\n  return min((geometricError / depth) * depthMultiplier, pointSize);\n}\n\n#ifdef HAS_POINT_CLOUD_SHOW_STYLE\nfloat pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n  float tiles3d_tileset_time = model_pointCloudParameters.w;\n  return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\nvec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n  float tiles3d_tileset_time = model_pointCloudParameters.w;\n  return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n  float tiles3d_tileset_time = model_pointCloudParameters.w;\n  return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));\n}\n#elif defined(HAS_POINT_CLOUD_ATTENUATION)\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n  return getPointSizeFromAttenuation(v_positionEC);\n}\n#endif";const q8=new _e,W8={name:"PointCloudStylingPipelineStage"};W8.process=function(e,t,n){const i=e.shaderBuilder,r=e.model,o=r.style,a=r.structuralMetadata,s=Object(l.a)(a)?a.propertyAttributes:void 0,u=Object(l.a)(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,d=!Object(l.a)(s)&&u;if(Object(l.a)(o)&&!d){const n=function(e,t){const n=X8,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction("getColorFromStyle(ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time)",t,i),n.showStyleFunction=e.getShowShaderFunction("getShowFromStyle(ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time)",t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction("getPointSizeFromStyle(ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time)",t,i),n.styleTranslucent=Object(l.a)(n.colorStyleFunction)&&i.translucent,n}(o,function(e){const t=Object(Zf.a)(K8);if(!Object(l.a)(e))return t;for(let n=0;n<e.length;n++){const i=e[n].properties;for(const e in i)i.hasOwnProperty(e)&&(t[e]="metadata."+e)}return t}(s));!function(e,t){const n=t.colorStyleFunction;Object(l.a)(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,S5.BOTH),e.addVertexLines([n]),e.addVarying("vec4","v_pointCloudColor"));const i=t.showStyleFunction;Object(l.a)(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,S5.VERTEX),e.addVertexLines([i]));const r=t.pointSizeStyleFunction;Object(l.a)(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,S5.VERTEX),e.addVertexLines([r]))}(i,n);const r=function(e){const t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];Object(l.a)(t)&&J8(t,r);Object(l.a)(n)&&J8(n,r);Object(l.a)(i)&&J8(i,r);return r}(n).indexOf("normalMC")>=0,a=O5.getAttributeBySemantic(t,TZ.NORMAL);if(r&&!a)throw new ye.a("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,S5.VERTEX);n.styleTranslucent&&(e.alphaOptions.pass=KR.TRANSLUCENT)}const f=r.pointCloudShading;let p,m,g;r._attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,S5.VERTEX),m8.is3DTiles(r.type)&&(m=!0,p=r.content,g=p.tile.refine===wZ.ADD),i.addUniform("vec4","model_pointCloudParameters",S5.VERTEX),i.addVertexLines([G8]);e.uniformMap.model_pointCloudParameters=function(){const i=q8;let r=1;m&&(r=g?5:p.tileset.maximumScreenSpaceError),i.x=Object(c.a)(f.maximumAttenuation,r),i.x*=n.pixelRatio;const o=function(e,t,n,i){if(Object(l.a)(i)){const e=i.tile.geometricError;if(e>0)return e}if(Object(l.a)(n.baseResolution))return n.baseResolution;const r=O5.getAttributeBySemantic(t,TZ.POSITION),o=r.count,a=e.runtimeNode.transform;let s=O.subtract(r.max,r.min,Y8);s=Me.multiplyByPointAsVector(a,s,Y8);const c=s.x*s.y*s.z;return h.a.cbrt(c/o)}(e,t,f,p);i.y=o*f.geometricErrorScale;const a=n.context,s=n.camera.frustum;let u;return u=n.mode===AB.SCENE2D||s instanceof nv?Number.POSITIVE_INFINITY:a.drawingBufferHeight/n.camera.frustum.sseDenominator,i.z=u,m&&(i.w=p.tileset.timeSinceLoad),i}};const Y8=new O;const X8={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},K8={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function J8(e,t){const n=/attributes\.(\w+)/g;let i=n.exec(e);for(;null!==i;){const r=i[1];-1===t.indexOf(r)&&t.push(r),i=n.exec(e)}}var Z8=W8,$8="void primitiveOutlineStage() {\n    v_outlineCoordinates = a_outlineCoordinates;\n}\n",Q8="void primitiveOutlineStage(inout czm_modelMaterial material) {\n    if (!model_showOutline) {\n        return;\n    }\n\n    float outlineX = \n        texture2D(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\n    float outlineY = \n        texture2D(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\n    float outlineZ = \n        texture2D(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\n    float outlineness = max(outlineX, max(outlineY, outlineZ));\n\n    material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);\n}\n\n";const e9={name:"PrimitiveOutlinePipelineStage",process:function(e,t,n){const i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,S5.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");const o=t.outlineCoordinates,a={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Cs.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(a),i.addUniform("sampler2D","model_outlineTexture",S5.FRAGMENT);const s=R3.createTexture(n.context);r.model_outlineTexture=function(){return s};const c=e.model;i.addUniform("vec4","model_outlineColor",S5.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",S5.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines([$8]),i.addFragmentLines([Q8])}};var t9=e9;const n9={};function i9(e,t){const n=Object(l.a)(t.indices)?t.indices.count:O5.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===zl.POINTS?e.pointsLength+=n:zl.isTriangles(i)&&(e.trianglesLength+=function(e,t){switch(e){case zl.TRIANGLES:return t/3;case zl.TRIANGLE_STRIP:case zl.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}(i,n));const r=t.attributes,o=r.length;for(let t=0;t<o;t++){const n=r[t];if(Object(l.a)(n.buffer)){const t=Object(l.a)(n.typedArray);e.addBuffer(n.buffer,t)}}const a=t.outlineCoordinates;if(Object(l.a)(a)&&Object(l.a)(a.buffer)){const t=!1;e.addBuffer(a.buffer,t)}const s=t.indices;if(Object(l.a)(s)&&Object(l.a)(s.buffer)){const t=Object(l.a)(s.typedArray);e.addBuffer(s.buffer,t)}}function r9(e,t){const n=t.positionBuffer2D;if(Object(l.a)(n)){const t=!0;e.addBuffer(n,t)}}function o9(e,t){const n=t.morphTargets;if(!Object(l.a)(n))return;const i=n.length;for(let t=0;t<i;t++){const i=n[t].attributes,r=i.length;for(let t=0;t<r;t++){const n=i[t];Object(l.a)(n.buffer)&&e.addBuffer(n.buffer,!1)}}}function a9(e,t){const n=function(e){const t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;Object(l.a)(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture));return n}(t),i=n.length;for(let t=0;t<i;t++){const i=n[t];Object(l.a)(i)&&Object(l.a)(i.texture)&&e.addTexture(i.texture)}}function s9(e,t){const n=t.length;for(let i=0;i<n;i++){const n=t[i];if(n instanceof UK.FeatureIdTexture){const t=n.textureReader;Object(l.a)(t.texture)&&e.addTexture(t.texture)}}}function c9(e,t){const n=t.structuralMetadata;Object(l.a)(n)&&(!function(e,t){const n=t.propertyTextures;if(!Object(l.a)(n))return;const i=n.length;for(let t=0;t<i;t++){const i=n[t].properties;for(const t in i)if(i.hasOwnProperty(t)){const n=i[t].textureReader;Object(l.a)(n.texture)&&e.addTexture(n.texture)}}}(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);const i=t.featureTables;if(!Object(l.a)(i))return;const r=i.length;for(let t=0;t<r;t++){const n=i[t];e.addBatchTexture(n.batchTexture)}}n9.name="PrimitiveStatisticsPipelineStage",n9.process=function(e,t,n){const i=e.model,r=i.statistics;i9(r,t),r9(r,e.runtimePrimitive),o9(r,t),a9(r,t.material),s9(r,t.featureIds),c9(r,i)},n9._countGeometry=i9,n9._count2DPositions=r9,n9._countMorphTargetAttributes=o9,n9._countMaterialTextures=a9,n9._countFeatureIdTextures=s9,n9._countBinaryMetadata=c9;var l9=n9;const u9=new Me,h9=new Me,d9={name:"SceneMode2DPipelineStage"};d9.process=function(e,t,n){const i=O5.getAttributeBySemantic(t,TZ.POSITION),r=e.shaderBuilder,o=e.model,a=o.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,c=Me.multiplyTransformation(a,s,u9),u=function(e,t,n){const i=Me.multiplyByPoint(t,e.positionMin,f9),r=iQ.computeActualWgs84Position(n,i,i),o=Me.multiplyByPoint(t,e.positionMax,p9),a=iQ.computeActualWgs84Position(n,o,o);return At.fromCornerPoints(r,a,new At)}(e,c,n),h=e.runtimePrimitive;h.boundingSphere2D=u;const d=e.runtimeNode.node.instances;if(Object(l.a)(d))return;if(Object(l.a)(i.typedArray)){const e=function(e,t,n,i){const r=Object(Zf.a)(i);r.mode=AB.COLUMBUS_VIEW;const o=n.center,a=function(e,t,n,i){let r;r=Object(l.a)(e.quantization)?function(e,t){const n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let t=0;t<n;t+=3){const n=O.fromArray(e,t,m9),a=O.multiplyComponents(n,o,n),s=O.add(a,r,a);i[t]=s.x,i[t+1]=s.y,i[t+2]=s.z}return i}(e.typedArray,e.quantization):e.typedArray.slice();const o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,a=r.length,s=Object(l.a)(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let e=o;e<a;e+=s){const o=O.fromArray(r,e,m9);if(isNaN(o.x)||isNaN(o.y)||isNaN(o.z))continue;const a=Me.multiplyByPoint(t,o,o),s=iQ.computeActualWgs84Position(i,a,a),c=O.subtract(s,n,s);r[e]=c.x,r[e+1]=c.y,r[e+2]=c.z}return r}(e,t,o,r),s=ZN.createVertexBuffer({context:i.context,typedArray:a,usage:KN.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}(i,c,u,n);h.positionBuffer2D=e,o._modelResources.push(e),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,S5.VERTEX),r.addUniform("mat4","u_modelView2D",S5.VERTEX);const f=Me.fromTranslation(u.center,new Me),p=n.context,m={u_modelView2D:function(){return Me.multiplyTransformation(p.uniformState.view,f,h9)}};e.uniformMap=Object(up.a)(m,e.uniformMap)};const f9=new O,p9=new O;const m9=new O;var g9=d9,_9="void skinningStage(inout ProcessedAttributes attributes) \n{\n    mat4 skinningMatrix = getSkinningMatrix();\n    mat3 skinningMatrixMat3 = mat3(skinningMatrix);\n\n    vec4 positionMC = vec4(attributes.positionMC, 1.0);\n    attributes.positionMC = vec3(skinningMatrix * positionMC);\n\n    #ifdef HAS_NORMALS\n    vec3 normalMC = attributes.normalMC;\n    attributes.normalMC = skinningMatrixMat3 * normalMC;\n    #endif\n\n    #ifdef HAS_TANGENTS\n    vec3 tangentMC = attributes.tangentMC;\n    attributes.tangentMC = skinningMatrixMat3 * tangentMC;\n    #endif\n}";const y9={};y9.name="SkinningPipelineStage",y9.FUNCTION_ID_GET_SKINNING_MATRIX="getSkinningMatrix",y9.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX="mat4 getSkinningMatrix()",y9.process=function(e,t){const n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,S5.VERTEX),function(e,t){e.addFunction(y9.FUNCTION_ID_GET_SKINNING_MATRIX,y9.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,S5.VERTEX);let n,i;e.addFunctionLines(y9.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);const r=["x","y","z","w"],o=function(e){let t=-1;const n=e.attributes,i=n.length;for(let e=0;e<i;e++){const i=n[e];(i.semantic===TZ.JOINTS||i.semantic===TZ.WEIGHTS)&&(t=Math.max(t,i.setIndex))}return t}(t);for(n=0;n<=o;n++)for(i=0;i<=3;i++){const t=r[i],o=`skinnedMatrix += a_weights_${n}.${t} * u_jointMatrices[int(a_joints_${n}.${t})];`;e.addFunctionLines(y9.FUNCTION_ID_GET_SKINNING_MATRIX,[o])}e.addFunctionLines(y9.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}(n,t);const i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,S5.VERTEX),n.addVertexLines([_9]);const o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Object(up.a)(o,e.uniformMap)};var b9=y9;const v9={};v9.name="WireframePipelineStage",v9.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,S5.FRAGMENT);const i=e.model,r=function(e,t,n){const i=O5.getAttributeBySemantic(e,TZ.POSITION).count,r=n.context.webgl2;let o;if(Object(l.a)(t)){const e=t.buffer,n=t.count;if(Object(l.a)(e)&&r){const t=e.sizeInBytes===n;o=t?new Uint8Array(n):wc.createTypedArray(i,n),e.getBufferData(o)}else o=t.typedArray}const a=e.primitiveType,s=BP.createWireframeIndices(a,i,o),c=wc.fromSizeInBytes(s.BYTES_PER_ELEMENT);return ZN.createIndexBuffer({context:n.context,typedArray:s,usage:KN.STATIC_DRAW,indexDatatype:c})}(t,e.indices,n);i._pipelineResources.push(r),e.wireframeIndexBuffer=r;i.statistics.addBuffer(r,!1);const o=e.primitiveType,a=e.count;e.primitiveType=zl.LINES,e.count=BP.getWireframeIndicesCount(o,a)};var O9=v9;function w9(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).primitive,n=e.node,i=e.model;s.a.typeOf.object("options.primitive",t),s.a.typeOf.object("options.node",n),s.a.typeOf.object("options.model",i),this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.updateStages=[]}function A9(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.skin",e.skin),s.a.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;const t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],function(e){const t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;const i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,a=e.joints,s=e._jointMatrices;for(let e=0;e<r;e++){const t=i[e].index,r=o[t];a.push(r);const c=n[e],l=E9(r,c,new Me);s.push(l)}}(this)}function E9(e,t,n){const i=Me.multiplyTransformation(e.transformToRoot,e.transform,n);return n=Me.multiplyTransformation(i,t,n)}function T9(){this.pass=void 0,this.alphaCutoff=void 0}function C9(e){this.name=e,this.fields=[]}function x9(e){this.signature=e,this.body=[]}function S9(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}function I9(e){s.a.typeOf.object("model",e),this.shaderBuilder=new S9,this.model=e,this.uniformMap={},this.alphaOptions=new T9,this.renderStateOptions=vj.getState(vj.fromCache({depthTest:{enabled:!0,func:YN.LESS_OR_EQUAL}}))}w9.prototype.configurePipeline=function(e){const t=this.pipelineStages;t.length=0;const n=this.primitive,i=this.node,r=this.model,o=r.customShader,a=r.style,s=e.context.webgl2,c=e.mode!==AB.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,u=Object(l.a)(n.morphTargets)&&n.morphTargets.length>0,h=Object(l.a)(i.skin),d=Object(l.a)(o),f=!(d&&Object(l.a)(o.fragmentShaderText))||o.mode!==R6.REPLACE_MATERIAL,p=O5.hasQuantizedAttributes(n.attributes),m=r.debugWireframe&&zl.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||s),g=r.pointCloudShading,_=Object(l.a)(g)&&g.attenuation,y=n.primitiveType===zl.POINTS&&(Object(l.a)(a)||_),b=r._enableShowOutline&&Object(l.a)(n.outlineCoordinates),v=function(e,t,n){let i;if(Object(l.a)(t.instances)&&(i=O5.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),Object(l.a)(i)))return{hasFeatureIds:!0,hasPropertyTable:Object(l.a)(i.propertyTableId)};if(i=O5.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),Object(l.a)(i))return{hasFeatureIds:!0,hasPropertyTable:Object(l.a)(i.propertyTableId)};return{hasFeatureIds:!1,hasPropertyTable:!1}}(r,i,n);c&&t.push(g9),t.push(A8),m&&t.push(O9),u&&t.push(k8),h&&t.push(b9),y&&t.push(Z8),p&&t.push(h8),f&&t.push(L8),t.push(H6),t.push(K6),v.hasPropertyTable&&(t.push(v8),t.push(P6),t.push(a8)),d&&t.push(n8),t.push(x8),r.allowPicking&&t.push(H8),b&&t.push(t9),t.push(S6),t.push(l9)},Object.defineProperties(A9.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}}),A9.prototype.updateJointMatrices=function(){const e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){const t=this.joints[n],i=this.inverseBindMatrices[n];e[n]=E9(t,i,e[n])}},C9.prototype.addField=function(e,t){const n=`    ${e} ${t};`;this.fields.push(n)},C9.prototype.generateGlslLines=function(){let e=this.fields;return 0===e.length&&(e=["    float _empty;"]),[].concat("struct "+this.name,"{",e,"};")},x9.prototype.addLines=function(e){const t=e.map((function(e){return"    "+e}));Array.prototype.push.apply(this.body,t)},x9.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")},Object.defineProperties(S9.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}}),S9.prototype.addDefine=function(e,t,n){s.a.typeOf.string("identifier",e),n=Object(c.a)(n,S5.BOTH);let i=e;Object(l.a)(t)&&(i+=" "+t.toString()),S5.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),S5.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)},S9.prototype.addStruct=function(e,t,n){s.a.typeOf.string("structId",e),s.a.typeOf.string("structName",t),s.a.typeOf.number("destination",n),this._structs[e]=new C9(t),S5.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),S5.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)},S9.prototype.addStructField=function(e,t,n){s.a.typeOf.string("structId",e),s.a.typeOf.string("type",t),s.a.typeOf.string("identifier",n),this._structs[e].addField(t,n)},S9.prototype.addFunction=function(e,t,n){s.a.typeOf.string("functionName",e),s.a.typeOf.string("signature",t),s.a.typeOf.number("destination",n),this._functions[e]=new x9(t),S5.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),S5.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)},S9.prototype.addFunctionLines=function(e,t){s.a.typeOf.string("functionName",e),s.a.typeOf.object("lines",t),this._functions[e].addLines(t)},S9.prototype.addUniform=function(e,t,n){s.a.typeOf.string("type",e),s.a.typeOf.string("identifier",t),n=Object(c.a)(n,S5.BOTH);const i=`uniform ${e} ${t};`;S5.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),S5.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)},S9.prototype.setPositionAttribute=function(e,t){if(s.a.typeOf.string("type",e),s.a.typeOf.string("identifier",t),Object(l.a)(this._positionAttributeLine))throw new u.a("setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()");return this._positionAttributeLine=`attribute ${e} ${t};`,this._attributeLocations[t]=0,0},S9.prototype.addAttribute=function(e,t){s.a.typeOf.string("type",e),s.a.typeOf.string("identifier",t);const n=`attribute ${e} ${t};`;this._attributeLines.push(n);const i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=function(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}(e),i},S9.prototype.addVarying=function(e,t){s.a.typeOf.string("type",e),s.a.typeOf.string("identifier",t);const n=`varying ${e} ${t};`;this._vertexShaderParts.varyingLines.push(n),this._fragmentShaderParts.varyingLines.push(n)},S9.prototype.addVertexLines=function(e){s.a.typeOf.object("lines",e),Array.prototype.push.apply(this._vertexShaderParts.shaderLines,e)},S9.prototype.addFragmentLines=function(e){s.a.typeOf.object("lines",e),Array.prototype.push.apply(this._fragmentShaderParts.shaderLines,e)},S9.prototype.buildShaderProgram=function(e){s.a.typeOf.object("context",e);const t=Object(l.a)(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=function(e){const t=[],n=[];let i,r,o,a,s=e._vertexShaderParts.structIds;for(i=0;i<s.length;i++)r=s[i],o=e._structs[r],a=o.generateGlslLines(),t.push.apply(t,a);for(s=e._fragmentShaderParts.structIds,i=0;i<s.length;i++)r=s[i],o=e._structs[r],a=o.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}(this),i=function(e){const t=[],n=[];let i,r,o,a,s=e._vertexShaderParts.functionIds;for(i=0;i<s.length;i++)r=s[i],o=e._functions[r],a=o.generateGlslLines(),t.push.apply(t,a);for(s=e._fragmentShaderParts.functionIds,i=0;i<s.length;i++)r=s[i],o=e._functions[r],a=o.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join("\n"),o=new UN({defines:this._vertexShaderParts.defineLines,sources:[r]}),a=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join("\n"),c=new UN({defines:this._fragmentShaderParts.defineLines,sources:[a]});return oM.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:c,attributeLocations:this._attributeLocations})},S9.prototype.clone=function(){return Object(Zf.a)(this,!0)};var P9="void silhouetteStage(inout vec4 color) {\n    if(model_silhouettePass) {\n        color = czm_gammaCorrect(model_silhouetteColor);\n    }\n}",D9="void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {\n     #ifdef HAS_NORMALS\n     if(model_silhouettePass) {\n          vec3 normal = normalize(czm_normal3D * attributes.normalMC);\n          normal.x *= czm_projection[0][0];\n          normal.y *= czm_projection[1][1];\n          positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;\n    }\n    #endif\n}\n";const R9={name:"ModelSilhouettePipelineStage",silhouettesLength:0,process:function(e,t,n){Object(l.a)(t._silhouetteId)||(t._silhouetteId=++R9.silhouettesLength);const i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,S5.BOTH),i.addVertexLines([D9]),i.addFragmentLines([P9]),i.addUniform("vec4","model_silhouetteColor",S5.FRAGMENT),i.addUniform("float","model_silhouetteSize",S5.VERTEX),i.addUniform("bool","model_silhouettePass",S5.BOTH);const r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Object(up.a)(r,e.uniformMap)}};var j9=R9,M9="void modelSplitterStage()\n{\n    // Don't split when rendering the shadow map, because it is rendered from\n    // the perspective of a totally different camera.\n#ifndef SHADOW_MAP\n    if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\n    if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\n#endif\n}\n";const L9={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection",process:function(e,t,n){const i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,S5.FRAGMENT),i.addFragmentLines([M9]);const r={};i.addUniform("float",L9.SPLIT_DIRECTION_UNIFORM_NAME,S5.FRAGMENT),r[L9.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Object(up.a)(r,e.uniformMap)}};var N9=L9;function B9(e,t){s.a.typeOf.object("modelRenderResources",e),s.a.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Object(Zf.a)(e.uniformMap),this.alphaOptions=Object(Zf.a)(e.alphaOptions),this.renderStateOptions=Object(Zf.a)(e.renderStateOptions,!0),this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.instancingTranslationMax=void 0,this.instancingTranslationMin=void 0,this.instancingReferencePoint2D=void 0}function F9(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.lightingModel=Object(c.a)(e.lightingModel,T8.UNLIT)}function z9(e,t){s.a.typeOf.object("nodeRenderResources",e),s.a.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.hasPropertyTable=!1,this.uniformMap=Object(Zf.a)(e.uniformMap),this.alphaOptions=Object(Zf.a)(e.alphaOptions),this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;const n=t.primitive;this.count=Object(l.a)(n.indices)?n.indices.count:O5.getAttributeBySemantic(n,"POSITION").count,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;const i=O5.getPositionMinMax(n,e.instancingTranslationMin,e.instancingTranslationMax);this.positionMin=O.clone(i.min,new O),this.positionMax=O.clone(i.max,new O),this.boundingSphere=At.fromCornerPoints(this.positionMin,this.positionMax,new At),this.lightingOptions=new F9,this.pickId=void 0,this.renderStateOptions=Object(Zf.a)(e.renderStateOptions,!0),this.styleCommandsNeeded=void 0}function k9(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).modelComponents;s.a.typeOf.object("options.model",e.model),s.a.typeOf.object("options.modelComponents",t),this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=Me.clone(Me.IDENTITY),this._computedModelMatrix2D=Me.clone(Me.IDENTITY),this._axisCorrectionMatrix=O5.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new Me),this._runtimeArticulations={},function(e){const t=e._components,n=t.scene,i=e._model.modelMatrix;U9(e,i);const r=t.articulations,o=r.length,a=e._runtimeArticulations;for(let t=0;t<o;t++){const n=new L5({articulation:r[t],sceneGraph:e}),i=n.name;a[i]=n}const s=t.nodes,c=s.length;e._runtimeNodes=new Array(c);const l=n.nodes.length,u=Me.IDENTITY;for(let t=0;t<l;t++){const i=n.nodes[t],r=H9(e,i,u);e._rootNodes.push(r)}const h=t.skins,d=e._runtimeSkins,f=h.length;for(let t=0;t<f;t++){const n=h[t];d.push(new A9({skin:n,sceneGraph:e}))}const p=e._skinnedNodes,m=p.length;for(let t=0;t<m;t++){const n=p[t],i=e._runtimeNodes[n],r=s[n].skin.index;i._runtimeSkin=d[r],i.updateJointMatrices()}e.applyArticulations()}(this)}function U9(e,t){const n=e._components,i=e._model;e._computedModelMatrix=Me.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=Me.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=Me.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}Object.defineProperties(k9.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});const V9=new O;function H9(e,t,n){const i=[],r=O5.getNodeTransform(t),o=t.children.length;for(let a=0;a<o;a++){const o=H9(e,t.children[a],Me.multiplyTransformation(n,r,new Me));i.push(o)}const a=new T6({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),s=t.primitives.length;for(let n=0;n<s;n++)a.runtimePrimitives.push(new w9({primitive:t.primitives[n],node:t,model:e._model}));const c=t.index;e._runtimeNodes[c]=a,Object(l.a)(t.skin)&&e._skinnedNodes.push(c);const u=t.name;if(Object(l.a)(u)){const t=e._model,n=new q5(t,a);t._nodesByName[u]=n}return c}const G9=new O,q9=new O,W9=new O,Y9=new O;function X9(e,t,n,i){if(n&&!t.show)return;const r=t.children.length;for(let o=0;o<r;o++){X9(e,t.getChild(o),n,i)}const o=t.runtimePrimitives,a=o.length;for(let e=0;e<a;e++){i(o[e])}}function K9(e,t,n){const i=e._rootNodes,r=i.length;for(let o=0;o<r;o++){const r=i[o];X9(e,e._runtimeNodes[r],t,n)}}function J9(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Tl}function Z9(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}function $9(e){const t=e.model,n=e.propertyTable;s.a.typeOf.object("propertyTable",n),s.a.typeOf.object("model",t),this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=h5.ALL_OPAQUE,function(e){const t=e._model,n=m8.is3DTiles(t.type),i=e._propertyTable.count;if(0===i)return;let r;const o=new Array(i);if(n){const e=t.content;for(r=0;r<i;r++)o[r]=new jV(e,r)}else for(r=0;r<i;r++)o[r]=new Z9({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new XU({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}(this)}k9.prototype.buildDrawCommands=function(e){const t=this._model,n=new I9(t);t.statistics.clear(),this.configurePipeline(e);const i=this.modelPipelineStages;let r,o,a;for(r=0;r<i.length;r++){i[r].process(n,t,e)}const s=O.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,G9),c=O.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,q9);for(r=0;r<this._runtimeNodes.length;r++){const t=this._runtimeNodes[r];t.configurePipeline();const i=t.pipelineStages,l=new B9(n,t);for(o=0;o<i.length;o++){i[o].process(l,t.node,e)}const u=t.computedTransform;for(o=0;o<t.runtimePrimitives.length;o++){const n=t.runtimePrimitives[o];n.configurePipeline(e);const i=n.pipelineStages,r=new z9(l,n);for(a=0;a<i.length;a++){i[a].process(r,n.primitive,e)}n.boundingSphere=At.clone(r.boundingSphere,new At);const h=Me.multiplyByPoint(u,r.positionMin,W9),d=Me.multiplyByPoint(u,r.positionMax,Y9);O.minimumByComponent(s,h,s),O.maximumByComponent(c,d,c);const f=T5(r,e);n.drawCommand=f}}this._boundingSphere=At.fromCornerPoints(s,c,new At),this._boundingSphere=At.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),t._boundingSphere=At.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale},k9.prototype.configurePipeline=function(e){const t=this.modelPipelineStages;t.length=0;const n=this._model;Object(l.a)(n.color)&&t.push(k5),n.imageBasedLighting.enabled&&t.push(P5),n.isClippingEnabled()&&t.push(G5),Object(l.a)(n.splitDirection)&&n.splitDirection!==IW.NONE&&t.push(N9),n.hasSilhouette(e)&&t.push(j9)},k9.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){const o=this._runtimeNodes[n];for(i=0;i<o.updateStages.length;i++){o.updateStages[i].update(o,this,e)}const a=e.mode!==AB.SCENE3D&&this._model._projectTo2D;for(t&&!a&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){const e=o.runtimePrimitives[i];for(r=0;r<e.updateStages.length;r++){e.updateStages[r].update(e,this)}}}},k9.prototype.updateModelMatrix=function(e,t){U9(this,e),t.mode!==AB.SCENE3D&&function(e,t){const n=e._computedModelMatrix,i=Me.getTranslation(n,V9);if(O.equals(i,O.ZERO)){const i=e.boundingSphere.center,r=ca.wgs84To2DModelMatrix(t.mapProjection,i,e._computedModelMatrix2D);e._computedModelMatrix2D=Me.multiply(r,n,e._computedModelMatrix2D)}else e._computedModelMatrix2D=ca.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);e._boundingSphere2D=At.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}(this,t);const n=this._rootNodes;for(let e=0;e<n.length;e++){this._runtimeNodes[n[e]]._transformDirty=!0}},k9.prototype.updateJointMatrices=function(){const e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){const t=e[n];this._runtimeNodes[t].updateJointMatrices()}},k9.prototype.updateBackFaceCulling=function(e){K9(this,!1,(function(t){t.drawCommand.backFaceCulling=e}))},k9.prototype.updateShadows=function(e){K9(this,!1,(function(t){t.drawCommand.shadows=e}))},k9.prototype.updateShowBoundingVolume=function(e){K9(this,!1,(function(t){t.drawCommand.debugShowBoundingVolume=e}))},k9.prototype.getDrawCommands=function(e){const t=[],n=[],i=this._model.hasSilhouette(e);return K9(this,!0,(function(r){const o=r.drawCommand,a=o.getCommands(e);if(t.push.apply(t,a),i){const t=o.getSilhouetteCommands(e);n.push.apply(n,t)}})),t.push.apply(t,n),t},k9.prototype.setArticulationStage=function(e,t){const n=e.split(" ");if(2!==n.length)return;const i=n[0],r=n[1],o=this._runtimeArticulations[i];Object(l.a)(o)&&o.setArticulationStage(r,t)},k9.prototype.applyArticulations=function(){const e=this._runtimeArticulations;for(const t in e)if(e.hasOwnProperty(t)){e[t].apply()}},Object.defineProperties(J9.prototype,{batchTexturesByteLength:{get:function(){const e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values;let n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}}),J9.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()},J9.prototype.addBuffer=function(e,t){if(s.a.typeOf.object("buffer",e),s.a.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){const n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0},J9.prototype.addTexture=function(e){s.a.typeOf.object("texture",e),this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0},J9.prototype.addBatchTexture=function(e){s.a.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)},Object.defineProperties(Z9.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return Object(l.a)(this._color)||(this._color=new sp),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}}),Z9.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)},Z9.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)},Z9.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)},Z9.prototype.getPropertyNames=function(e){return ll("ModelFeature.getPropertyNames","ModelFeature.getPropertyNames is deprecated in CesiumJS 1.95, and will be removed in 1.98. Use ModelFeature.getPropertyIds instead"),this._featureTable.getPropertyIds(e)},Z9.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)},Z9.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)},Object.defineProperties($9.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return Object(l.a)(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}}),$9.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);const t=h5.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)},$9.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)},$9.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)},$9.prototype.getShow=function(e){return this._batchTexture.getShow(e)},$9.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)},$9.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)},$9.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)},$9.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)},$9.prototype.getFeature=function(e){return this._features[e]},$9.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)},$9.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)},$9.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)},$9.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)},$9.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)},$9.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)},$9.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)},$9.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)},$9.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};const Q9=new sp;$9.prototype.applyStyle=function(e){if(!Object(l.a)(e))return this.setAllColor(XU.DEFAULT_COLOR_VALUE),void this.setAllShow(XU.DEFAULT_SHOW_VALUE);for(let t=0;t<this._featuresLength;t++){const n=this.getFeature(t),i=Object(l.a)(e.color)?Object(c.a)(e.color.evaluateColor(n,Q9),XU.DEFAULT_COLOR_VALUE):XU.DEFAULT_COLOR_VALUE,r=Object(l.a)(e.show)?Object(c.a)(e.show.evaluate(n),XU.DEFAULT_SHOW_VALUE):XU.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}},$9.prototype.isDestroyed=function(){return!1},$9.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),sc(this)};const e7={};function t7(e){s.a.typeOf.number.greaterThan("options.count",e.count,0),s.a.typeOf.object("options.properties",e.properties),this._count=e.count,this._properties=Object(Zf.a)(e.properties,!0)}function n7(e){s.a.typeOf.number("options.count",e.count),s.a.typeOf.object("options.batchTable",e.batchTable);const t=e.count,n=e.batchTable,i=e.binaryBody,r=Object(c.a)(e.parseAsPropertyAttributes,!1),o=e.customAttributeOutput;if(r&&!Object(l.a)(o))throw new u.a("customAttributeOutput is required when parsing batch table as property attributes");const a=function(e){const t=e.HIERARCHY,n=e.extras,i=e.extensions;let r;Object(l.a)(t)?(n7._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):Object(l.a)(i)&&(r=i["3DTILES_batch_table_hierarchy"]);const o={},a={};for(const t in e){if(!e.hasOwnProperty(t)||"HIERARCHY"===t||"extensions"===t||"extras"===t)continue;const n=e[t];Array.isArray(n)?o[t]=n:a[t]=n}return{binaryProperties:a,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}(n),h=new t7({count:t,properties:a.jsonProperties}),d=function(e,t){if(Object(l.a)(e))return new rV({extension:e,binaryBody:t});return}(a.hierarchy,i),f=QK.BATCH_TABLE_CLASS_NAME;let p,m,g;if(r){const e=function(e,t,n,i,r){const o={},a={};let s=0;for(const t in n){if(!n.hasOwnProperty(t))continue;const c=n[t];if(!Object(l.a)(i)&&!Object(l.a)(c.typedArray))throw new ye.a(`Property ${t} requires a batch table binary.`);let u=O5.sanitizeGlslIdentifier(t);(""===u||o.hasOwnProperty(u))&&(u="property_"+s,s++);const h=i7(c);h.name=t,o[u]=h;let d=u.toUpperCase();d.startsWith("_")||(d="_"+d);let f=c.typedArray;if(!Object(l.a)(f)){const t=iV(c);f=t.createArrayBufferView(i.buffer,i.byteOffset+c.byteOffset,e)}const p=new UK.Attribute;p.name=d,p.count=e,p.type=c.type,p.componentDatatype=gs.fromTypedArray(f),p.typedArray=f,r.push(p),a[u]={attribute:d}}const c={classes:{}};c.classes[t]={properties:o};const u=new oJ(c);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:u,transcodedClass:u.classes[t]}}(t,f,a.binaryProperties,i,o);g=e.transcodedSchema;m=[new _3({propertyAttribute:e.propertyAttributeJson,class:e.transcodedClass})]}else{const e=function(e,t,n,i){const r={},o={},a={};let s=0;for(const t in n){if(!n.hasOwnProperty(t))continue;if(!Object(l.a)(i))throw new ye.a(`Property ${t} requires a batch table binary.`);const c=n[t],u=iV(c);o[t]={bufferView:s},r[t]=i7(c),a[s]=u.createArrayBufferView(i.buffer,i.byteOffset+c.byteOffset,e),s++}const c={classes:{}};c.classes[t]={properties:r};const u=new oJ(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:a,transcodedSchema:u,transcodedClass:u.classes[t]}}(t,f,a.binaryProperties,i);g=e.transcodedSchema;const n=e.featureTableJson;p=new mK({count:n.count,properties:n.properties,class:e.transcodedClass,bufferViews:e.bufferViewsTypedArrays}),m=[]}const _={schema:g,propertyTables:[new c3({id:0,name:"Batch Table",count:t,metadataTable:p,jsonMetadataTable:h,batchTableHierarchy:d})],propertyAttributes:m,extensions:a.extensions,extras:a.extras};return new b3(_)}function i7(e){const t=function(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}(e.componentType);return{type:e.type,componentType:t}}t7.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,e7)},t7.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,e7,e)},t7.prototype.getProperty=function(e,t){if(s.a.typeOf.number("index",e),s.a.typeOf.string("propertyId",t),e<0||e>=this._count)throw new u.a(`index must be in the range [0, ${this._count})`);const n=this._properties[t];if(Object(l.a)(n))return Object(Zf.a)(n[e],!0)},t7.prototype.setProperty=function(e,t,n){if(s.a.typeOf.number("index",e),s.a.typeOf.string("propertyId",t),e<0||e>=this._count)throw new u.a(`index must be in the range [0, ${this._count})`);const i=this._properties[t];return!!Object(l.a)(i)&&(i[e]=Object(Zf.a)(n,!0),!0)},n7._deprecationWarning=ll;const r7=0,o7=1,a7=2,s7=3,c7=4,l7=UK.FeatureIdAttribute;function u7(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).b3dmResource;let n=e.baseResource;const i=e.arrayBuffer,r=Object(c.a)(e.byteOffset,0),o=Object(c.a)(e.releaseGltfJson,!1),a=Object(c.a)(e.asynchronous,!0),u=Object(c.a)(e.incrementallyLoadTextures,!0),h=Object(c.a)(e.upAxis,HU.Y),d=Object(c.a)(e.forwardAxis,HU.X),f=Object(c.a)(e.loadAttributesAsTypedArray,!1),p=Object(c.a)(e.loadAttributesFor2D,!1),m=Object(c.a)(e.loadIndicesForWireframe,!1),g=Object(c.a)(e.loadPrimitiveOutline,!0);s.a.typeOf.object("options.b3dmResource",t),s.a.typeOf.object("options.arrayBuffer",i),n=Object(l.a)(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=a,this._incrementallyLoadTextures=u,this._upAxis=h,this._forwardAxis=d,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=p,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=g,this._state=r7,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=Me.IDENTITY}function h7(e){const t=e.children.length;for(let n=0;n<t;n++)h7(e.children[n]);const n=e.primitives.length;for(let t=0;t<n;t++){const n=e.primitives[t],i=O5.getAttributeBySemantic(n,TZ.FEATURE_ID);if(Object(l.a)(i)){i.setIndex=0;const e=new l7;e.propertyTableId=0,e.setIndex=0,e.positionalLabel="featureId_0",n.featureIds.push(e)}}}Object(l.a)(Object.create)&&(u7.prototype=Object.create(gK.prototype),u7.prototype.constructor=u7),Object.defineProperties(u7.prototype,{promise:{get:function(){return this._promise}},texturesLoadedPromise:{get:function(){return this._gltfLoader.texturesLoadedPromise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}}),u7.prototype.load=function(){const e=YU.parse(this._arrayBuffer,this._byteOffset);let t=e.batchLength;const n=e.featureTableJson,i=e.featureTableBinary,r=e.batchTableJson,o=e.batchTableBinary,a=new NV(n,i);t=a.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;const s=a.getGlobalProperty("RTC_CENTER",gs.FLOAT,3);Object(l.a)(s)&&(this._transform=Me.fromTranslation(O.fromArray(s))),this._batchTable={json:r,binary:o};const c=new v4({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=o7;const u=this;return c.load(),this._promise=c.promise.then((function(){if(u.isDestroyed())return;const e=c.components;return e.transform=u._transform,function(e,t){const n=e._batchTable,i=e._batchLength;if(0===i)return;let r;if(Object(l.a)(n.json))r=n7({count:i,batchTable:n.json,binaryBody:n.binary});else{const e=new c3({name:QK.BATCH_TABLE_CLASS_NAME,count:i});r=new b3({schema:{},propertyTables:[e]})}const o=t.scene.nodes,a=o.length;for(let e=0;e<a;e++)h7(o[e]);t.structuralMetadata=r}(u,e),u._components=e,u._state=s7,u})).catch((function(e){if(!u.isDestroyed())return function(e,t){e.unload(),e._state=c7;return t=e.getError("Failed to load b3dm",t),Promise.reject(t)}(u,e)})),this._promise},u7.prototype.process=function(e){s.a.typeOf.object("frameState",e),this._state===o7&&(this._state=a7),this._state===a7&&this._gltfLoader.process(e)},u7.prototype.unload=function(){Object(l.a)(this._gltfLoader)&&this._gltfLoader.unload(),this._components=void 0};var d7=u7;function f7(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.geoJson",e.geoJson),this._geoJson=e.geoJson,this._promise=void 0,this._process=function(e,t){},this._components=void 0}function p7(){this.lines=void 0,this.properties=void 0}function m7(){this.features=[]}function g7(e){const t=e[0],n=e[1],i=Object(c.a)(e[2],0);return new O(t,n,i)}function _7(e){const t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=g7(e[i]);return[n]}function y7(e){const t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=_7(e[i])[0];return n}Object(l.a)(Object.create)&&(f7.prototype=Object.create(gK.prototype),f7.prototype.constructor=f7),Object.defineProperties(f7.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}}),f7.prototype.load=function(){const e=this,t=new Promise((function(t){e._process=function(e,n){Object(l.a)(e._components)||(e._components=function(e,t){const n=new m7,i=O7[e.type];Object(l.a)(i)&&i(e,n);const r=n.features.length;if(0===r)throw new ye.a("GeoJSON must have at least one feature");const o={};for(let e=0;e<r;e++){const t=n.features[e],i=Object(c.a)(t.properties,c.a.EMPTY_OBJECT);for(const e in i)i.hasOwnProperty(e)&&(Object(l.a)(o[e])||(o[e]=new Array(r)))}for(let e=0;e<r;e++){const t=n.features[e];for(const n in o)if(o.hasOwnProperty(n)){const i=Object(c.a)(t.properties[n],"");o[n][e]=i}}const a=new t7({count:r,properties:o}),s=[new c3({id:0,count:r,jsonMetadataTable:a})],u=new oJ({}),h=new b3({schema:u,propertyTables:s}),d=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),f=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let e=0;e<r;e++){const t=n.features[e],i=t.lines.length;for(let e=0;e<i;e++){const n=t.lines[e],i=n.length;for(let e=0;e<i;e++)O.minimumByComponent(d,n[e],d),O.maximumByComponent(f,n[e],f)}}const p=O.midpoint(d,f,new O),m=O.fromDegrees(p.x,p.y,p.z,H.WGS84,new O),g=ca.eastNorthUpToFixedFrame(m,H.WGS84,new Me),_=Me.inverseTransformation(g,new Me);let y=0,b=0;for(let e=0;e<r;e++){const t=n.features[e],i=t.lines.length;for(let e=0;e<i;e++){const n=t.lines[e];y+=n.length,b+=2*(n.length-1)}}const v=new Float32Array(3*y),w=new Float32Array(y),A=wc.createTypedArray(y,b),E=wc.fromTypedArray(A),T=new O(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),C=new O(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let x=0,S=0;for(let e=0;e<r;e++){const t=n.features[e],i=t.lines.length;for(let n=0;n<i;n++){const i=t.lines[n],r=i.length;for(let t=0;t<r;t++){const n=i[t],o=O.fromDegrees(n.x,n.y,n.z,H.WGS84,w7),a=Me.multiplyByPoint(_,o,w7);O.minimumByComponent(T,a,T),O.maximumByComponent(C,a,C),O.pack(a,v,3*x),w[x]=e,t<r-1&&(A[2*S]=x,A[2*S+1]=x+1,S++),x++}}}const I=ZN.createVertexBuffer({typedArray:v,context:t.context,usage:KN.STATIC_DRAW});I.vertexArrayDestroyable=!1;const P=ZN.createVertexBuffer({typedArray:w,context:t.context,usage:KN.STATIC_DRAW});P.vertexArrayDestroyable=!1;const D=ZN.createIndexBuffer({typedArray:A,context:t.context,usage:KN.STATIC_DRAW,indexDatatype:E});D.vertexArrayDestroyable=!1;const R=new UK.Attribute;R.semantic=TZ.POSITION,R.componentDatatype=gs.FLOAT,R.type=Cs.VEC3,R.count=y,R.min=T,R.max=C,R.buffer=I;const j=new UK.Attribute;j.semantic=TZ.FEATURE_ID,j.setIndex=0,j.componentDatatype=gs.FLOAT,j.type=Cs.SCALAR,j.count=y,j.buffer=P;const M=[R,j],L=new UK.Material;L.unlit=!0;const N=new UK.Indices;N.indexDatatype=E,N.count=A.length,N.buffer=D;const B=new UK.FeatureIdAttribute;B.featureCount=r,B.propertyTableId=0,B.setIndex=0,B.positionalLabel="featureId_0";const F=[B],z=new UK.Primitive;z.attributes=M,z.indices=N,z.featureIds=F,z.primitiveType=zl.LINES,z.material=L;const k=[z],U=new UK.Node;U.index=0,U.primitives=k;const V=[U],G=new UK.Scene;G.nodes=V;const q=new UK.Components;return q.scene=G,q.nodes=V,q.transform=g,q.structuralMetadata=h,q}(e._geoJson,n),e._geoJson=void 0,t(e))}}));return this._promise=t,t},f7.prototype.process=function(e){s.a.typeOf.object("frameState",e),this._process(this,e)};const b7={LineString:_7,MultiLineString:function(e){const t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=_7(e[i])[0];return n},MultiPolygon:function(e){const t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,y7(e[i]));return n},Polygon:y7};function v7(e,t){if(!Object(l.a)(e.geometry))return;const n=e.geometry.type,i=b7[n],r=e.geometry.coordinates;if(!Object(l.a)(i))return;if(!Object(l.a)(r))return;const o=new p7;o.lines=i(r),o.properties=e.properties,t.features.push(o)}const O7={FeatureCollection:function(e,t){const n=e.features,i=n.length;for(let e=0;e<i;e++)v7(n[e],t)},Feature:v7},w7=new O;f7.prototype.unload=function(){this._components=void 0};const A7=0,E7=1,T7=2,C7=3,x7=4,S7=UK.Attribute,I7=UK.FeatureIdAttribute,P7=UK.Instances;function D7(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).i3dmResource,n=e.arrayBuffer;let i=e.baseResource;const r=Object(c.a)(e.byteOffset,0),o=Object(c.a)(e.releaseGltfJson,!1),a=Object(c.a)(e.asynchronous,!0),u=Object(c.a)(e.incrementallyLoadTextures,!0),h=Object(c.a)(e.upAxis,HU.Y),d=Object(c.a)(e.forwardAxis,HU.X),f=Object(c.a)(e.loadAttributesAsTypedArray,!1),p=Object(c.a)(e.loadIndicesForWireframe,!1),m=Object(c.a)(e.loadPrimitiveOutline,!0);s.a.typeOf.object("options.i3dmResource",t),s.a.typeOf.object("options.arrayBuffer",n),i=Object(l.a)(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=r,this._releaseGltfJson=o,this._asynchronous=a,this._incrementallyLoadTextures=u,this._upAxis=h,this._forwardAxis=d,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=m,this._state=A7,this._promise=void 0,this._gltfLoader=void 0,this._transform=Me.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}Object(l.a)(Object.create)&&(D7.prototype=Object.create(gK.prototype),D7.prototype.constructor=D7),Object.defineProperties(D7.prototype,{promise:{get:function(){return this._promise}},texturesLoadedPromise:{get:function(){return this._gltfLoader.texturesLoadedPromise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}}),D7.prototype.load=function(){const e=KJ.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,r=e.batchTableBinary,o=e.gltfFormat,a=new NV(t,n);this._featureTable=a;const s=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=s,!Object(l.a)(s))throw new ye.a("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=s;const c=a.getGlobalProperty("RTC_CENTER",gs.FLOAT,3);Object(l.a)(c)&&(this._transform=Me.fromTranslation(O.fromArray(c))),this._batchTable={json:i,binary:r};const u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(0===o){let t=Gu(e.gltf);t=t.replace(/[\s\0]+$/,"");const n=this._baseResource.getDerivedResource({url:t});u.gltfResource=n,u.baseResource=n}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;const h=new v4(u);this._gltfLoader=h,this._state=E7;const d=this;return h.load(),this._promise=h.promise.then((function(){if(d.isDestroyed())return;const e=h.components;return e.transform=d._transform,function(e,t){let n;const i=e._featureTable,r=e._instancesLength;if(0===r)return;const o=i.getGlobalProperty("RTC_CENTER",gs.FLOAT,3),a=i.getGlobalProperty("EAST_NORTH_UP"),s=i.hasProperty("NORMAL_UP")||i.hasProperty("NORMAL_UP_OCT32P")||a,c=i.hasProperty("SCALE")||i.hasProperty("SCALE_NON_UNIFORM"),u=function(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",gs.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){const t=e.getPropertyArray("POSITION_QUANTIZED",gs.UNSIGNED_SHORT,3),n=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",gs.FLOAT,3);if(!Object(l.a)(n))throw new ye.a("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",gs.FLOAT,3);if(!Object(l.a)(i))throw new ye.a("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const r=new Float32Array(t.length);for(let e=0;e<t.length/3;e++)for(let o=0;o<3;o++){const a=3*e+o;r[a]=t[a]/65535*i[o]+n[o]}return r}throw new ye.a("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}(i);let h,d;s&&(h=new Float32Array(4*r));c&&(d=new Float32Array(3*r));const f=new Float32Array(r),p=O.unpackArray(u);let m=new O;const g=new O,_=new O,y=new O,b=new ce,v=new To,w=new Array(4),A=new O,E=new Array(3),T=new Me;if(!Object(l.a)(o)){const e=At.fromPoints(p);for(n=0;n<p.length;n++)O.subtract(p[n],e.center,R7),u[3*n+0]=R7.x,u[3*n+1]=R7.y,u[3*n+2]=R7.z;t.transform=Me.fromTranslation(e.center)}for(n=0;n<r;n++){m=O.clone(p[n]),Object(l.a)(o)&&O.add(m,O.unpack(o),m),s&&(L7(i,a,n,v,m,_,g,y,b,T),To.pack(v,w,0),h[4*n+0]=w[0],h[4*n+1]=w[1],h[4*n+2]=w[2],h[4*n+3]=w[3]),c&&(N7(i,n,A),O.pack(A,E,0),d[3*n+0]=E[0],d[3*n+1]=E[1],d[3*n+2]=E[2]);let e=i.getProperty("BATCH_ID",gs.UNSIGNED_SHORT,1,n);Object(l.a)(e)||(e=n),f[n]=e}const C=new P7;C.transformInWorldSpace=!0;const x=new S7;if(x.name="Instance Translation",x.semantic=D3.TRANSLATION,x.componentDatatype=gs.FLOAT,x.type=Cs.VEC3,x.count=r,x.typedArray=u,C.attributes.push(x),s){const e=new S7;e.name="Instance Rotation",e.semantic=D3.ROTATION,e.componentDatatype=gs.FLOAT,e.type=Cs.VEC4,e.count=r,e.typedArray=h,C.attributes.push(e)}if(c){const e=new S7;e.name="Instance Scale",e.semantic=D3.SCALE,e.componentDatatype=gs.FLOAT,e.type=Cs.VEC3,e.count=r,e.typedArray=d,C.attributes.push(e)}const S=new S7;S.name="Instance Feature ID",S.setIndex=0,S.semantic=D3.FEATURE_ID,S.componentDatatype=gs.FLOAT,S.type=Cs.SCALAR,S.count=r,S.typedArray=f,C.attributes.push(S);const I=new I7;for(I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",C.featureIds.push(I),n=0;n<t.nodes.length;n++){const e=t.nodes[n];e.primitives.length>0&&(e.instances=C)}}(d,e),function(e,t){const n=e._batchTable,i=e._instancesLength;if(0===i)return;let r;if(Object(l.a)(n.json))r=n7({count:i,batchTable:n.json,binaryBody:n.binary});else{const e=new c3({name:QK.BATCH_TABLE_CLASS_NAME,count:i});r=new b3({schema:{},propertyTables:[e]})}t.structuralMetadata=r}(d,e),d._components=e,d._state=C7,d})).catch((function(e){if(!d.isDestroyed())return function(e,t){e.unload(),e._state=x7;return t=e.getError("Failed to load i3dm",t),Promise.reject(t)}(d,e)})),this._promise},D7.prototype.process=function(e){s.a.typeOf.object("frameState",e),this._state===E7&&(this._state=T7),this._state===T7&&this._gltfLoader.process(e)};const R7=new O,j7=new Array(4);const M7=new Array(4);function L7(e,t,n,i,r,o,a,s,c,u){const h=e.getProperty("NORMAL_UP",gs.FLOAT,3,n,j7),d=e.getProperty("NORMAL_RIGHT",gs.FLOAT,3,n,M7);let f=!1;if(Object(l.a)(h)){if(!Object(l.a)(d))throw new ye.a("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");O.unpack(h,0,o),O.unpack(d,0,a),f=!0}else{const i=e.getProperty("NORMAL_UP_OCT32P",gs.UNSIGNED_SHORT,2,n,j7),s=e.getProperty("NORMAL_RIGHT_OCT32P",gs.UNSIGNED_SHORT,2,n,M7);if(Object(l.a)(i)){if(!Object(l.a)(s))throw new ye.a("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");js.octDecodeInRange(i[0],i[1],65535,o),js.octDecodeInRange(s[0],s[1],65535,a),f=!0}else t?(ca.eastNorthUpToFixedFrame(r,H.WGS84,u),Me.getMatrix3(u,c)):ce.clone(ce.IDENTITY,c)}f&&(O.cross(a,o,s),O.normalize(s,s),ce.setColumn(c,0,a,c),ce.setColumn(c,1,o,c),ce.setColumn(c,2,s,c)),To.fromRotationMatrix(c,i)}function N7(e,t,n){n=O.fromElements(1,1,1,n);const i=e.getProperty("SCALE",gs.FLOAT,1,t);Object(l.a)(i)&&O.multiplyByScalar(n,i,n);const r=e.getProperty("SCALE_NON_UNIFORM",gs.FLOAT,3,t,j7);Object(l.a)(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}D7.prototype.unload=function(){Object(l.a)(this._gltfLoader)&&this._gltfLoader.unload(),this._components=void 0};var B7=D7;const F7=UK.Components,z7=UK.Scene,k7=UK.Node,U7=UK.Primitive,V7=UK.Attribute,H7=UK.Quantization,G7=UK.FeatureIdAttribute,q7=UK.Material,W7=UK.MetallicRoughness;function Y7(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).arrayBuffer,n=Object(c.a)(e.byteOffset,0);s.a.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=Object(c.a)(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._process=function(e){},this._state=_K.UNLOADED,this._buffers=[],this._components=void 0,this._transform=Me.IDENTITY}function X7(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new u.a("componentsPerAttribute must be a number from 1-4")}}function K7(e){switch(e){case ps.BYTE:return"BYTE";case ps.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ps.SHORT:return"SHORT";case ps.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ps.INT:return"INT";case ps.UNSIGNED_INT:return"UNSIGNED_INT";case ps.DOUBLE:return"DOUBLE";case ps.FLOAT:return"FLOAT";default:throw new u.a("value is not a valid WebGL constant")}}function J7(e,t,n){let i,r=t.typedArray;if(t.octEncoded&&(i=new H7,i.octEncoded=t.octEncoded,i.octEncodedZXY=t.octEncodedZXY,i.normalizationRange=t.quantizedRange,i.type=t.quantizedType,i.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){i=new H7;const e=t.quantizedRange;i.normalizationRange=e,i.quantizedVolumeOffset=O.ZERO;const n=t.quantizedVolumeScale;i.quantizedVolumeDimensions=n,i.quantizedVolumeStepSize=O.divideByScalar(n,e,new O),i.componentDatatype=t.quantizedComponentDatatype,i.type=t.quantizedType}const o=new V7;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=Object(c.a)(t.normalized,!1),o.min=t.min,o.max=t.max,o.quantization=i,t.isRGB565&&(r=js.decodeRGB565(r)),Object(l.a)(t.constantColor)){const e=new Array(4);o.constant=sp.pack(t.constantColor,e)}else{const t=ZN.createVertexBuffer({typedArray:r,context:n,usage:KN.STATIC_DRAW});t.vertexArrayDestroyable=!1,e._buffers.push(t),o.buffer=t}const a=e._loadAttributesFor2D;return o.semantic===TZ.POSITION&&a&&(o.typedArray=r),o}let Z7,$7;Object(l.a)(Object.create)&&(Y7.prototype=Object.create(gK.prototype),Y7.prototype.constructor=Y7),Object.defineProperties(Y7.prototype,{promise:{get:function(){return this._promise}},cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}}),Y7.prototype.load=function(){this._parsedContent=SZ.parse(this._arrayBuffer,this._byteOffset),this._state=_K.PROCESSING;const e=this;this._promise=new Promise((function(t,n){e._process=function(i){if(e._state===_K.PROCESSING){if(Object(l.a)(e._decodePromise))return;const r=function(e,t){const n=e._parsedContent.draco;let i;i=Object(l.a)(n)?qq.decodePointCloud(n,t):Promise.resolve();if(!Object(l.a)(i))return;return e._decodePromise=i,i.then((function(i){if(!e.isDestroyed())return Object(l.a)(i)&&function(e,t,n){e._state=_K.READY;const i=e._parsedContent;let r;if(Object(l.a)(n.POSITION)){if(r={name:"POSITION",semantic:TZ.POSITION,typedArray:n.POSITION.array,componentDatatype:gs.FLOAT,type:Cs.VEC3,isQuantized:!1},Object(l.a)(n.POSITION.data.quantization)){const e=n.POSITION.data.quantization,t=e.range,i=O.fromElements(t,t,t),o=O.unpack(e.minValues),a=(1<<e.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=a,r.quantizedVolumeOffset=o,r.quantizedVolumeScale=i,r.quantizedComponentDatatype=gs.UNSIGNED_SHORT,r.quantizedType=Cs.VEC3}i.positions=r}if(Object(l.a)(n.NORMAL)){if(r={name:"NORMAL",semantic:TZ.NORMAL,typedArray:n.NORMAL.array,componentDatatype:gs.FLOAT,type:Cs.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},Object(l.a)(n.NORMAL.data.quantization)){const e=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=e,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=gs.UNSIGNED_BYTE,r.quantizedType=Cs.VEC2}i.normals=r}Object(l.a)(n.RGBA)?i.colors={name:"COLOR",semantic:TZ.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:gs.UNSIGNED_BYTE,type:Cs.VEC4,normalized:!0,isTranslucent:!0}:Object(l.a)(n.RGB)&&(i.colors={name:"COLOR",semantic:TZ.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:gs.UNSIGNED_BYTE,type:Cs.VEC3,normalized:!0,isTranslucent:!1});if(Object(l.a)(n.BATCH_ID)){const e=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:TZ.FEATURE_ID,setIndex:0,typedArray:e,componentDatatype:gs.fromTypedArray(e),type:Cs.SCALAR}}let o=i.batchTableJson;const a=t.batchTableProperties;for(const e in a)if(a.hasOwnProperty(e)){const t=n[e];Object(l.a)(o)||(o={}),i.hasDracoBatchTable=!0;const r=t.data;o[e]={byteOffset:r.byteOffset,type:X7(r.componentsPerAttribute),componentType:K7(r.componentDatatype),typedArray:t.array}}i.batchTableJson=o}(e,n,i),function(e,t){const n=e._parsedContent,i=new W7;i.metallicFactor=0,i.roughnessFactor=.9;const r=new q7;r.metallicRoughness=i;const o=n.colors;Object(l.a)(o)&&o.isTranslucent&&(r.alphaMode=LK.BLEND);const a=!Object(l.a)(n.normals);r.unlit=a;const s=new U7;if(s.attributes=function(e,t,n){const i=[];let r;const o=t.positions;Object(l.a)(o)&&(!function(e){const t=e.typedArray,n=t.length/3,i=Math.min(n,20),r=function(e){if(!Object(l.a)($7)){Z7=new AZ.a(0),$7=new Array(e);for(let t=0;t<e;++t)$7[t]=Z7.random()}return $7}(20),o=Number.MAX_VALUE,a=-Number.MAX_VALUE;let s,c,u,h=O.fromElements(o,o,o,Q7),d=O.fromElements(a,a,a,eee);if(e.isQuantized)h=O.ZERO,d=e.quantizedVolumeScale;else for(s=0;s<i;++s)c=Math.floor(r[s]*n),u=O.unpack(t,3*c,tee),O.minimumByComponent(h,u,h),O.maximumByComponent(d,u,d);e.min=O.clone(h),e.max=O.clone(d)}(o),r=J7(e,o,n),r.count=t.pointsLength,i.push(r));Object(l.a)(t.normals)&&(r=J7(e,t.normals,n),i.push(r));Object(l.a)(t.colors)?(r=J7(e,t.colors,n),i.push(r)):(r=J7(e,nee,n),i.push(r));Object(l.a)(t.batchIds)&&(r=J7(e,t.batchIds,n),i.push(r));return i}(e,n,t),s.primitiveType=zl.POINTS,s.material=r,Object(l.a)(n.batchIds)){const e=new G7;e.propertyTableId=0,e.setIndex=0,e.positionalLabel="featureId_0",s.featureIds.push(e)}const u=new k7;u.index=0,u.primitives=[s];const h=new z7;h.nodes=[u],h.upAxis=HU.Z,h.forwardAxis=HU.X;const d=new F7;d.scene=h,d.nodes=[u];const f=[];d.structuralMetadata=function(e,t){const n=e.batchLength,i=e.pointsLength,r=e.batchTableBinary,o=!Object(l.a)(e.batchIds);if(Object(l.a)(r)||e.hasDracoBatchTable){return n7({count:Object(c.a)(n,i),batchTable:e.batchTableJson,binaryBody:r,parseAsPropertyAttributes:o,customAttributeOutput:t})}return new b3({schema:{},propertyTables:[]})}(n,f),f.length>0&&function(e,t,n,i){const r=t.attributes,o=n.length;for(let t=0;t<o;t++){const o=n[t],a=ZN.createVertexBuffer({typedArray:o.typedArray,context:i,usage:KN.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a,o.typedArray=void 0,r.push(o)}t.propertyAttributeIds=[0]}(e,s,f,t);Object(l.a)(n.rtcCenter)&&(d.transform=Me.multiplyByTranslation(d.transform,n.rtcCenter,d.transform));const p=n.positions;Object(l.a)(p)&&p.isQuantized&&(d.transform=Me.multiplyByTranslation(d.transform,p.quantizedVolumeOffset,d.transform));e._components=d,e._parsedContent=void 0}(e,t),e._state=_K.READY,e})).catch((function(t){e.unload(),e._state=_K.FAILED;return Promise.reject(e.getError("Failed to load Draco pnts",t))}))}(e,i.context);Object(l.a)(r)&&r.then(t).catch(n)}}}))},Y7.prototype.process=function(e){this._process(e)};const Q7=new O,eee=new O,tee=new O;const nee={name:TZ.COLOR,semantic:TZ.COLOR,setIndex:0,constantColor:sp.DARKGRAY,componentDatatype:gs.FLOAT,type:Cs.VEC4,isQuantized:!1,isTranslucent:!1};function iee(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.loader",e.loader),s.a.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=Object(c.a)(e.type,m8.GLTF),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=Me.clone(this.modelMatrix),this._scale=Object(c.a)(e.scale,1),this._minimumPixelSize=Object(c.a)(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=Object(l.a)(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=ce.clone(ce.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new l5(this),this._clampAnimations=Object(c.a)(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1;const t=e.color;this._color=Object(l.a)(t)?sp.clone(t):void 0,this._colorBlendMode=Object(c.a)(e.colorBlendMode,kq.HIGHLIGHT),this._colorBlendAmount=Object(c.a)(e.colorBlendAmount,.5);const n=Object(c.a)(e.silhouetteColor,sp.RED);this._silhouetteColor=sp.clone(n),this._silhouetteSize=Object(c.a)(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=Object(c.a)(e.cull,!0),this._opaquePass=Object(c.a)(e.opaquePass,KR.OPAQUE),this._allowPicking=Object(c.a)(e.allowPicking,!0),this._show=Object(c.a)(e.show,!0),this._style=void 0;let i=Object(c.a)(e.featureIdLabel,"featureId_0");"number"==typeof i&&(i="featureId_"+i),this._featureIdLabel=i;let r=Object(c.a)(e.instanceFeatureIdLabel,"instanceFeatureId_0");"number"==typeof r&&(r="instanceFeatureId_"+r),this._instanceFeatureIdLabel=r,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new At,this._initialRadius=void 0,this._heightReference=Object(c.a)(e.heightReference,qP.NONE),this._heightDirty=this._heightReference!==qP.NONE,this._removeUpdateHeightCallback=void 0,this._clampedModelMatrix=void 0;const o=e.scene;Object(l.a)(o)&&Object(l.a)(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener((function(){this._heightDirty=!0}),this)),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;const a=new v$(e.pointCloudShading);this._pointCloudShading=a,this._attenuation=a.attenuation;const u=e.clippingPlanes;Object(l.a)(u)&&void 0===u.owner?Fq.setOwner(u,this,"_clippingPlanes"):this._clippingPlanes=u,this._clippingPlanesState=0,this._clippingPlanesMatrix=Me.clone(Me.IDENTITY),this._lightColor=O.clone(e.lightColor),this._imageBasedLighting=Object(l.a)(e.imageBasedLighting)?e.imageBasedLighting:new zU,this._shouldDestroyImageBasedLighting=!Object(l.a)(e.imageBasedLighting),this._backFaceCulling=Object(c.a)(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=Object(c.a)(e.shadows,TB.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=Object(c.a)(e.enableDebugWireframe,!1),this._enableShowOutline=Object(c.a)(e.enableShowOutline,!0),this._debugWireframe=Object(c.a)(e.debugWireframe,!1);let h=e.credit;"string"==typeof h&&(h=new ln(h)),this._credit=h,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=Object(c.a)(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=Object(c.a)(e.splitDirection,IW.NONE),this._enableShowOutline=Object(c.a)(e.enableShowOutline,!0),this.showOutline=Object(c.a)(e.showOutline,!0),this.outlineColor=Object(c.a)(e.outlineColor,sp.BLACK),this._statistics=new J9,this._sceneMode=void 0,this._projectTo2D=Object(c.a)(e.projectTo2D,!1),this._completeLoad=function(e,t){},this._texturesLoadedPromise=void 0,this._readyPromise=function(e){const t=e._loader,n=e._resource;t.load();const i=t.promise.then((function(t){if(!Object(l.a)(t))return;const n=t.components;if(!Object(l.a)(n)){if(t.isUnloaded())return;throw new ye.a("Failed to load model.")}const i=n.structuralMetadata;Object(l.a)(i)&&i.propertyTableCount>0&&function(e,t){const n=e._featureTables,i=t.propertyTables,r=i.length;for(let t=0;t<r;t++){const r=i[t],o=new $9({model:e,propertyTable:r});n.push(o)}}(e,i);const r=new k9({model:e,modelComponents:n});e._sceneGraph=r,e._gltfCredits=r.components.asset.credits;const o=e._resource.credits;if(Object(l.a)(o)){const t=o.length;for(let n=0;n<t;n++)e._resourceCredits.push(o[n])}e._resourcesLoaded=!0})),r=Object(c.a)(t.texturesLoadedPromise,Promise.resolve());e._texturesLoadedPromise=r.then((function(){Object(l.a)(e)&&!e.isDestroyed()&&(e._texturesLoaded=!0,t._incrementallyLoadTextures&&e.resetDrawCommands())})).catch(O5.getFailedLoadFunction(e,"model",n));const o=new Promise((function(t,n){e._completeLoad=function(e,n){n.afterRender.push((function(){e._ready=!0,t(e)}))}}));return i.then((function(){return o})).catch(O5.getFailedLoadFunction(e,"model",n))}(this),this._sceneGraph=void 0,this._nodesByName={}}function ree(e,t){if(!Object(l.a)(e)&&!Object(l.a)(t))return!1;if(Object(l.a)(e)!==Object(l.a)(t))return!0;const n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Y7.prototype.unload=function(){const e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0},Object.defineProperties(iee.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},texturesLoadedPromise:{get:function(){return this._texturesLoadedPromise}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){s.a.defined("pointCloudShading",e),e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far must be greater than near");this._distanceDisplayCondition=eb.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this.applyStyle(e),this._style=e}},color:{get:function(){return this._color},set:function(e){ree(e,this._color)&&this.resetDrawCommands(),this._color=sp.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!sp.equals(e,this._silhouetteColor)){const t=ree(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=sp.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){const t=this._silhouetteSize,n=e>0&&0===t||0===e&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){if(!this._ready)throw new u.a("The model is not loaded. Use ModelExperimental.readyPromise or wait for ModelExperimental.ready to be true.");return this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){"number"==typeof e&&(e="featureId_"+e),s.a.typeOf.string("value",e),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){"number"==typeof e&&(e="instanceFeatureId_"+e),s.a.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(Fq.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(e){Object(l.a)(e)!==Object(l.a)(this._lightColor)&&this.resetDrawCommands(),this._lightColor=O.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){s.a.typeOf.object("imageBasedLighting",this._imageBasedLighting),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},pickIds:{get:function(){return this._pickIds}}}),iee.prototype.getNode=function(e){if(!this._ready)throw new u.a("The model is not loaded. Use ModelExperimental.readyPromise or wait for ModelExperimental.ready to be true.");return s.a.typeOf.string("name",e),this._nodesByName[e]},iee.prototype.setArticulationStage=function(e,t){if(s.a.typeOf.number("value",t),!this._ready)throw new u.a("The model is not loaded. Use ModelExperimental.readyPromise or wait for ModelExperimental.ready to be true.");this._sceneGraph.setArticulationStage(e,t)},iee.prototype.applyArticulations=function(){if(!this._ready)throw new u.a("The model is not loaded. Use ModelExperimental.readyPromise or wait for ModelExperimental.ready to be true.");this._sceneGraph.applyArticulations()},iee.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};const oee=new Me,aee=new ce,see=new Me;iee.prototype.update=function(e){if(function(e,t){e._resourcesLoaded&&e._texturesLoaded||e._loader.process(t)}(this,e),function(e,t){Object(l.a)(e._customShader)&&e._customShader.update(t)}(this,e),function(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}(this,e),!this._resourcesLoaded||e.mode===AB.MORPHING)return;!function(e){e.pointCloudShading.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=e.pointCloudShading.attenuation)}(this),function(e,t){e._silhouetteDirty&&(fee(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}(this,e),function(e,t){if(e.isClippingEnabled()){e._clippingPlanes.owner===e&&e._clippingPlanes.update(t);const n=e._clippingPlanes.clippingPlanesState;n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}}(this,e),function(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}(this,e),function(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;const t=e._sceneGraph.components,n=t.structuralMetadata;Object(l.a)(n)&&n.propertyTableCount>0&&(e.featureTableId=function(e,t){const n=t._featureIdLabel,i=t._instanceFeatureIdLabel;let r,o,a,s;for(r=0;r<e.nodes.length;r++)if(s=e.nodes[r],Object(l.a)(s.instances)&&(a=O5.getFeatureIdsByLabel(s.instances.featureIds,i),Object(l.a)(a)&&Object(l.a)(a.propertyTableId)))return a.propertyTableId;for(r=0;r<e.nodes.length;r++)for(s=e.nodes[r],o=0;o<s.primitives.length;o++){const e=s.primitives[o],t=O5.getFeatureIdsByLabel(e.featureIds,n);if(Object(l.a)(t))return t.propertyTableId}if(1===t._featureTables.length)return 0}(t,e),e.applyStyle(e._style))}(this),function(e,t){const n=e._featureTables,i=n.length;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&e.resetDrawCommands()}(this,e),this._defaultTexture=e.context.defaultTexture,function(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}(this,e),function(e,t){if(!Me.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==AB.SCENE3D&&e._projectTo2D)throw new u.a("ModelExperimental.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=Me.clone(e.modelMatrix,e._modelMatrix)}}(this,e),function(e){if(!e._updateModelMatrix&&!e._heightDirty&&0===e._minimumPixelSize)return;Object(l.a)(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);const t=e._scene;if(!Object(l.a)(t)||!Object(l.a)(t.globe)||e.heightReference===qP.NONE){if(e.heightReference!==qP.NONE)throw new u.a("Height reference is not supported without a scene and globe.");return void(e._clampedModelMatrix=void 0)}const n=t.globe,i=n.ellipsoid,r=e.modelMatrix;cee.x=r[12],cee.y=r[13],cee.z=r[14];const o=i.cartesianToCartographic(cee);Object(l.a)(e._clampedModelMatrix)||(e._clampedModelMatrix=Me.clone(r,new Me));const a=n._surface;e._removeUpdateHeightCallback=a.updateHeight(o,hee(e,i,o));const s=n.getHeight(o);if(Object(l.a)(s)){const t=hee(e,i,o);R.clone(o,lee),lee.height=s,i.cartographicToCartesian(lee,cee),t(cee)}e._heightDirty=!1,e._updateModelMatrix=!0}(this),function(e,t){if(!e._updateModelMatrix&&0===e._minimumPixelSize)return;const n=Object(l.a)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;e._clampedScale=Object(l.a)(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere=At.transform(e._sceneGraph.boundingSphere,n,e._boundingSphere),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._computedScale=function(e,t,n){let i=e.scale;if(0!==e.minimumPixelSize&&!e._projectTo2D){const r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);cee.x=t[12],cee.y=t[13],cee.z=t[14],e._sceneMode!==AB.SCENE3D&&iQ.computeActualWgs84Position(n,cee,cee);const a=e._boundingSphere.radius,s=function(e,t,n){return uee.center=e,uee.radius=t,n.camera.getPixelSize(uee,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}(cee,a,n),c=1/s;Math.min(c*(2*a),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*s/(2*e._initialRadius))}return Object(l.a)(e.maximumScale)?Math.min(e.maximumScale,i):i}(e,n,t)}(this,e),function(e,t){const n=Object(l.a)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=Object(c.a)(e.referenceMatrix,n),r=t.context,o=e._imageBasedLighting;if(o.useSphericalHarmonicCoefficients||o.useSpecularEnvironmentMaps){let t=aee,n=oee;n=Me.multiply(r.uniformState.view3D,i,n),t=Me.getMatrix3(n,t),t=ce.getRotation(t,t),e._iblReferenceFrameMatrix=ce.transpose(t,e._iblReferenceFrameMatrix)}if(e.isClippingEnabled()){let t=see;t=Me.multiply(r.uniformState.view3D,i,t),t=Me.multiply(t,e._clippingPlanes.modelMatrix,t),e._clippingPlanesMatrix=Me.inverseTranspose(t,e._clippingPlanesMatrix)}}(this,e);const t=this;t._ready?(function(e){if(!e._idDirty)return;e._idDirty=!1;const t=e._id,n=e._pickIds,i=n.length;for(let e=0;e<i;++e)n[e].object.id=t}(this),function(e,t){const n=e._sceneGraph;if(e._updateModelMatrix||0!==e._minimumPixelSize){const i=Object(l.a)(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(i,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1);e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1);e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);const i=e._userAnimationDirty||e._activeAnimations.update(t);n.update(t,i),e._userAnimationDirty=!1}(this,e),function(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1;const t=e._showCreditsOnScreen;Object(l.a)(e._credit)&&(e._credit.showOnScreen=t);const n=e._resourceCredits,i=n.length;for(let e=0;e<i;e++)n[e].showOnScreen=t;const r=e._gltfCredits,o=r.length;for(let e=0;e<o;e++)r[e].showOnScreen=t}(this),function(e,t){const n=function(e,t){const n=e.distanceDisplayCondition;if(!Object(l.a)(n))return!0;const i=n.near*n.near,r=n.far*n.far;let o;if(t.mode===AB.SCENE2D){const e=.5*(t.camera.frustum.right-t.camera.frustum.left);o=e*e}else{const n=Me.getTranslation(e.modelMatrix,dee);iQ.computeActualWgs84Position(t,n,n),o=O.distanceSquared(n,t.camera.positionWC)}return o>=i&&o<=r}(e,t),i=e.isInvisible(),r=e.hasSilhouette(t);if(e._show&&0!==e._computedScale&&n&&(!i||r)){!function(e,t){const n=t.creditDisplay,i=e._credit;Object(l.a)(i)&&n.addCredit(i);const r=e._resourceCredits,o=r.length;for(let e=0;e<o;e++)n.addCredit(r[e]);const a=e._gltfCredits,s=a.length;for(let e=0;e<s;e++)n.addCredit(a[e])}(e,t);const n=e._sceneGraph.getDrawCommands(t);t.commandList.push.apply(t.commandList,n)}}(this,e)):t._completeLoad(t,e)};const cee=new O,lee=new R;const uee=new At;function hee(e,t,n){return function(i){if(e.heightReference===qP.RELATIVE_TO_GROUND){const e=t.cartesianToCartographic(i,lee);e.height+=n.height,t.cartographicToCartesian(e,i)}const r=e._clampedModelMatrix;Me.clone(e.modelMatrix,r),r[12]=i.x,r[13]=i.y,r[14]=i.z,e._heightDirty=!0}}const dee=new O;function fee(e){return e.context.stencilBuffer}function pee(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading}}function mee(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0}function gee(e,t,n,i){const r={cull:!1,releaseGltfJson:!0,opaquePass:KR.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Object(up.a)(i,r)}iee.prototype.isTranslucent=function(){const e=this.color;return Object(l.a)(e)&&e.alpha>0&&e.alpha<1},iee.prototype.isInvisible=function(){const e=this.color;return Object(l.a)(e)&&0===e.alpha},iee.prototype.hasSilhouette=function(e){return fee(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0},iee.prototype.isClippingEnabled=function(){const e=this._clippingPlanes;return Object(l.a)(e)&&e.enabled&&0!==e.length},iee.prototype.isDestroyed=function(){return!1},iee.prototype.destroy=function(){const e=this._loader;Object(l.a)(e)&&e.destroy();const t=this._featureTables;if(Object(l.a)(t)){const e=t.length;for(let n=0;n<e;n++)t[n].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),Object(l.a)(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),Object(l.a)(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);const n=this._clippingPlanes;Object(l.a)(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,sc(this)},iee.prototype.destroyPipelineResources=function(){const e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0},iee.prototype.destroyModelResources=function(){const e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0},iee.fromGltf=function(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url)&&!Object(l.a)(e.gltf))throw new u.a("options.url is required.");const t=Object(c.a)(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},i=Object(c.a)(e.basePath,""),r=Tt.a.createIfNeeded(i);Object(l.a)(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=Tt.a.createIfNeeded(t);const o=pee(new v4(n),Object(l.a)(e.content)?m8.TILE_GLTF:m8.GLTF,e);o.resource=n.gltfResource;return new iee(o)},iee.fromB3dm=function(e){const t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline};return new iee(pee(new d7(t),m8.TILE_B3DM,e))},iee.fromPnts=function(e){return new iee(pee(new Y7({arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D}),m8.TILE_PNTS,e))},iee.fromI3dm=function(e){const t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline};return new iee(pee(new B7(t),m8.TILE_I3DM,e))},iee.fromGeoJson=function(e){return new iee(pee(new f7({geoJson:e.geoJson}),m8.TILE_GEOJSON,e))},iee.prototype.applyColorAndShow=function(e){const t=Object(l.a)(e)&&Object(l.a)(e.color),n=Object(l.a)(e)&&Object(l.a)(e.show);this._color=t?e.color.evaluateColor(void 0,this._color):sp.clone(sp.WHITE,this._color),this._show=!n||e.show.evaluate(void 0)},iee.prototype.applyStyle=function(e){this.resetDrawCommands();const t=this.type===m8.TILE_PNTS,n=Object(l.a)(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=Object(l.a)(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=Object(l.a)(i)&&Object(l.a)(i[0]);if(!t||n&&!r)if(n){this.featureTables[this.featureTableId].applyStyle(e)}else this.applyColorAndShow(e)},Object.defineProperties(mee.prototype,{featuresLength:{get:function(){const e=this._model,t=e.featureTables,n=e.featureTableId;return Object(l.a)(t)&&Object(l.a)(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){const e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){const e=this._model,t=e.featureTables,n=e.featureTableId;if(Object(l.a)(t)&&Object(l.a)(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}}),mee.prototype.getFeature=function(e){const t=this._model,n=t.featureTableId;if(!Object(l.a)(n))return;return t.featureTables[n].getFeature(e)},mee.prototype.hasProperty=function(e,t){const n=this._model,i=n.featureTableId;if(!Object(l.a)(i))return!1;return n.featureTables[i].hasProperty(e,t)},mee.prototype.applyDebugSettings=function(e,t){t=e?t:sp.WHITE,0===this.featuresLength?this._model.color=t:Object(l.a)(this.batchTable)&&this.batchTable.setAllColor(t)},mee.prototype.applyStyle=function(e){this._model.style=e},mee.prototype.update=function(e,t){const n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;const r=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,Object(l.a)(r)&&i.clippingPlanesDirty&&(n._clippingPlanes=r.enabled&&i._isClipped?r:void 0),Object(l.a)(r)&&Object(l.a)(n._clippingPlanes)&&n._clippingPlanes!==r&&(n._clippingPlanes=r),n.update(t)},mee.prototype.isDestroyed=function(){return!1},mee.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),sc(this)},mee.fromGltf=function(e,t,n,i){const r=new mee(e,t,n),o=gee(e,t,r,{gltf:i,basePath:n}),a=iee.fromGltf(o);return a.readyPromise.then((function(e){e.activeAnimations.addAll({loop:rW.REPEAT})})),r._model=a,r},mee.fromB3dm=function(e,t,n,i,r){const o=new mee(e,t,n),a=gee(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),s=iee.fromB3dm(a);return s.readyPromise.then((function(e){e.activeAnimations.addAll({loop:rW.REPEAT})})),o._model=s,o},mee.fromI3dm=function(e,t,n,i,r){const o=new mee(e,t,n),a=gee(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n}),s=iee.fromI3dm(a);return s.readyPromise.then((function(e){e.activeAnimations.addAll({loop:rW.REPEAT})})),o._model=s,o},mee.fromPnts=function(e,t,n,i,r){const o=new mee(e,t,n),a=gee(e,t,o,{arrayBuffer:i,byteOffset:r,resource:n});return o._model=iee.fromPnts(a),o},mee.fromGeoJson=function(e,t,n,i){const r=new mee(e,t,n),o=gee(e,t,r,{geoJson:i,resource:n});return r._model=iee.fromGeoJson(o),r};const _ee={b3dm:function(e,t,n,i,r){return e.enableModelExperimental?mee.fromB3dm(e,t,n,i,r):new xX(e,t,n,i,r)},pnts:function(e,t,n,i,r){return e.enableModelExperimental?mee.fromPnts(e,t,n,i,r):new x$(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return e.enableModelExperimental?mee.fromI3dm(e,t,n,i,r):new OZ(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return new PX(e,t,n,i,r,_ee)},externalTileset:function(e,t,n,i){return new I$(e,t,n,i)},geom:function(e,t,n,i,r){return new FX(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new r3(e,t,n,i,r)},subt:function(e,t,n,i,r){return new PJ(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return new PJ(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new ye.a("Invalid glb content");const o=new DataView(i,r).getUint32(8,!0),a=new Uint8Array(i,r,o);return mee.fromGltf(e,t,n,a)},gltf:function(e,t,n,i){return mee.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return mee.fromGeoJson(e,t,n,i)}};var yee=_ee;var bee=Object.freeze({UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5});const vee={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",isBinaryFormat:function(e){switch(e){case vee.BATCHED_3D_MODEL:case vee.INSTANCED_3D_MODEL:case vee.COMPOSITE:case vee.POINT_CLOUD:case vee.VECTOR:case vee.GEOMETRY:case vee.IMPLICIT_SUBTREE:case vee.GLTF_BINARY:return!0;default:return!1}}};var Oee=Object.freeze(vee);var wee=Object.freeze({NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0});function Aee(){}const Eee={stack:new lE,stackMaximumLength:0};function Tee(e){return e._visible&&e._inRequestVolume}function Cee(e){return e.hasEmptyContent||e.hasTilesetContent||e.hasImplicitContent}function xee(e,t){return 0!==t.children.length&&(t.hasTilesetContent||t.hasImplicitContent?!t.contentExpired:(t.hasEmptyContent,!0))}function See(e,t,n,i){const r=t.children,o=r.length;for(let e=0;e<o;++e){const t=r[e];t.updateVisibility(i),Tee(t)&&n.push(t)}}function Iee(e,t){(function(e){return!Cee(e)&&e.contentUnloaded}(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Pee(e,t,n){t._touchedFrame!==n.frameNumber&&(e._cache.touch(t),t._touchedFrame=n.frameNumber)}function Dee(e){++e.statistics.visited}function Ree(e,t,n){t.contentAvailable&&t.contentVisibility(n)!==W.OUTSIDE&&e._selectedTiles.push(t)}Aee.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e._hasMixedContent=!1;let n=!0;const i=e.root;if(i.updateVisibility(t),!Tee(i))return n;const r=Eee.stack;for(r.push(e.root);r.length>0;){Eee.stackMaximumLength=Math.max(Eee.stackMaximumLength,r.length);const i=r.pop(),o=i.refine===wZ.ADD,a=i.refine===wZ.REPLACE,s=xee(e,i);s&&See(e,i,r,t),(o||a&&!s)&&(Iee(e,i),Pee(e,i,t),Ree(e,i,t),Cee(i)||i.contentAvailable||(n=!1)),Dee(e)}return Eee.stack.trim(Eee.stackMaximumLength),n};var jee=Aee;function Mee(){}function Lee(e){return e._visible&&e._inRequestVolume}const Nee={stack:new lE,stackMaximumLength:0},Bee={stack:new lE,stackMaximumLength:0},Fee={stack:new lE,stackMaximumLength:0},zee={stack:new lE,stackMaximumLength:0,ancestorStack:new lE,ancestorStackMaximumLength:0};function kee(e){return e._skipLevelOfDetail}function Uee(e,t){e._emptyTiles.push(t)}function Vee(e,t,n){if(t.contentVisibility(n)!==W.OUTSIDE){const i=t.content;i.featurePropertiesDirty?(i.featurePropertiesDirty=!1,t.lastStyleTime=0,e._selectedTilesToStyle.push(t)):t._selectedFrame<n.frameNumber-1&&e._selectedTilesToStyle.push(t),t._selectedFrame=n.frameNumber,e._selectedTiles.push(t)}}function Hee(e,t,n){if(!kee(e))return void(t.contentAvailable&&Vee(e,t,n));const i=t.contentAvailable?t:t._ancestorWithContentAvailable;Object(l.a)(i)?i._shouldSelect=!0:function(e,t,n){const i=Fee.stack;for(i.push(t);i.length>0;){Fee.stackMaximumLength=Math.max(Fee.stackMaximumLength,i.length);const r=i.pop().children,o=r.length;for(let a=0;a<o;++a){const o=r[a];Lee(o)&&(o.contentAvailable?(Kee(e,o,n),qee(e,o,n),Vee(e,o,n)):o._depth-t._depth<2&&i.push(o))}}}(e,t,n)}function Gee(e,t,n){++e._statistics.visited,t._visitedFrame=n.frameNumber}function qee(e,t,n){t._touchedFrame!==n.frameNumber&&(e._cache.touch(t),t._touchedFrame=n.frameNumber)}function Wee(e,t,n){if(t._requestedFrame===n.frameNumber||!$ee(t)&&!t.contentExpired)return;if(!function(e,t,n){if(!e._cullRequestsWhileMoving)return!0;const i=t.boundingSphere,r=Math.max(2*i.radius,1),o=n.camera,a=0!==o.positionWCDeltaMagnitude?o.positionWCDeltaMagnitude:o.positionWCDeltaMagnitudeLastFrame;return e.cullRequestsWhileMovingMultiplier*a/r<1}(e,t,n))return;const i=n.camera.timeSinceMoved<e.foveatedTimeDelay;t.priorityDeferred&&i||(t._requestedFrame=n.frameNumber,e._requestedTiles.push(t))}function Yee(e,t,n){t._updatedVisibilityFrame!==e._updatedVisibilityFrame&&(t.updateVisibility(n),t._updatedVisibilityFrame=e._updatedVisibilityFrame)}function Xee(e,t,n){if(Yee(e,t,n),!Lee(t))return;const i=t.children.length>0;if((t.hasTilesetContent||t.hasImplicitContent)&&i){const i=t.children[0];return Xee(e,i,n),void(t._visible=i._visible)}if(function(e,t,n){const i=t.parent;return!(!Object(l.a)(i)||i.hasTilesetContent||i.hasImplicitContent||i.refine!==wZ.ADD)&&t.getScreenSpaceError(n,!0)<=e._maximumScreenSpaceError}(e,t,n))return void(t._visible=!1);const r=t.refine===wZ.REPLACE,o=t._optimChildrenWithinParent===wee.USE_OPTIMIZATION;return r&&o&&i&&!function(e,t,n){let i=!1;const r=t.children,o=r.length;for(let t=0;t<o;++t){const o=r[t];Yee(e,o,n),i=i||Lee(o)}return i}(e,t,n)?(++e._statistics.numberOfTilesCulledWithChildrenUnion,void(t._visible=!1)):void 0}function Kee(e,t,n){Xee(e,t,n),t.updateExpiration(),t._wasMinPriorityChild=!1,t._priorityHolder=t,function(e,t){e._maximumPriority.distance=Math.max(t._priorityHolder._distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._priorityHolder._distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(t._depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(t._depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(t._priorityHolder._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._priorityHolder._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.reverseScreenSpaceError=Math.max(t._priorityReverseScreenSpaceError,e._maximumPriority.reverseScreenSpaceError),e._minimumPriority.reverseScreenSpaceError=Math.min(t._priorityReverseScreenSpaceError,e._minimumPriority.reverseScreenSpaceError)}(e,t),t._shouldSelect=!1,t._finalResolution=!0}function Jee(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;const n=e.parent;if(Object(l.a)(n)){const i=!$ee(n)||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}}function Zee(e){return e.hasEmptyContent||e.hasTilesetContent||e.hasImplicitContent}function $ee(e){return!Zee(e)&&e.contentUnloaded}function Qee(e,t){const n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||Object(l.a)(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function ete(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function tte(e,t,n,i){let r;const o=t.refine===wZ.REPLACE,a=t.children,s=a.length;for(r=0;r<s;++r)Kee(e,a[r],i);a.sort(ete);const c=!kee(e)&&o&&!Zee(t);let l,u=!0,h=!1,d=-1,f=Number.MAX_VALUE;for(r=0;r<s;++r)if(l=a[r],Lee(l)?(n.push(l),l._foveatedFactor<f&&(d=r,f=l._foveatedFactor),h=!0):(c||e.loadSiblings)&&(l._foveatedFactor<f&&(d=r,f=l._foveatedFactor),Wee(e,l,i),qee(e,l,i)),c){let t;t=!!l._inRequestVolume&&(Zee(l)?ote(e,l,i):l.contentAvailable),u=u&&t}if(h||(u=!1),-1!==d&&!kee(e)&&o){const n=a[d];n._wasMinPriorityChild=!0;const i=(t._wasMinPriorityChild||t===e.root)&&f<=t._priorityHolder._foveatedFactor?t._priorityHolder:t;for(i._foveatedFactor=Math.min(n._foveatedFactor,i._foveatedFactor),i._distanceToCamera=Math.min(n._distanceToCamera,i._distanceToCamera),r=0;r<s;++r)l=a[r],l._priorityHolder=i}return u}function nte(e,t,n){return!kee(e)||!e.immediatelyLoadDesiredLevelOfDetail&&(!Object(l.a)(t._ancestorWithContent)||(0===t._screenSpaceError?t.parent._screenSpaceError>n:t._screenSpaceError>n))}function ite(e,t){return 0!==t.children.length&&(t.hasTilesetContent||t.hasImplicitContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function rte(e,t,n,i,r){const o=Nee.stack;for(o.push(t);o.length>0;){Nee.stackMaximumLength=Math.max(Nee.stackMaximumLength,o.length);const t=o.pop();Jee(t,r);const i=nte(e,t,n),a=t.refine===wZ.ADD,s=t.refine===wZ.REPLACE,c=t.parent,u=!Object(l.a)(c)||c._refines;let h=!1;ite(e,t)&&(h=tte(e,t,o,r)&&u);const d=!h&&u;Zee(t)?(Uee(e,t),Wee(e,t,r),d&&Hee(e,t,r)):a?(Hee(e,t,r),Wee(e,t,r)):s&&(i?(Wee(e,t,r),d&&Hee(e,t,r)):d?(Hee(e,t,r),Wee(e,t,r)):Qee(e,t)&&Wee(e,t,r)),Gee(e,t,r),qee(e,t,r),t._refines=h}}function ote(e,t,n){let i=!0;const r=Bee.stack;for(r.push(t);r.length>0;){Bee.stackMaximumLength=Math.max(Bee.stackMaximumLength,r.length);const t=r.pop(),o=t.children,a=o.length,s=Zee(t),c=s&&ite(e,t),l=s&&0===t.children.length;if(c||t.contentAvailable||l||(i=!1),Kee(e,t,n),Lee(t)||(Wee(e,t,n),qee(e,t,n)),c)for(let e=0;e<a;++e){const t=o[e];r.push(t)}}return i}function ate(e,t,n){const i=zee.stack,r=zee.ancestorStack;let o;for(i.push(t);i.length>0||r.length>0;){if(zee.stackMaximumLength=Math.max(zee.stackMaximumLength,i.length),zee.ancestorStackMaximumLength=Math.max(zee.ancestorStackMaximumLength,r.length),r.length>0){const t=r.peek();if(t._stackLength===i.length){r.pop(),t!==o&&(t._finalResolution=!1),Vee(e,t,n);continue}}const t=i.pop();if(!Object(l.a)(t))continue;const a=t.refine===wZ.ADD,s=t._shouldSelect,c=t.children,u=c.length,h=ite(e,t);if(s)if(a)Vee(e,t,n);else{if(t._selectionDepth=r.length,t._selectionDepth>0&&(e._hasMixedContent=!0),o=t,!h){Vee(e,t,n);continue}r.push(t),t._stackLength=i.length}if(h)for(let e=0;e<u;++e){const t=c[e];Lee(t)&&i.push(t)}}}Mee.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e._hasMixedContent=!1;const n=e.root;if(Kee(e,n,t),!Lee(n))return;if(n.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)return;kee(e)?e.immediatelyLoadDesiredLevelOfDetail?function(e,t,n){const i=Number.MAX_VALUE,r=e._maximumScreenSpaceError;rte(e,t,i,r,n),ate(e,t,n)}(e,n,t):function(e,t,n){const i=Math.max(e.baseScreenSpaceError,e.maximumScreenSpaceError),r=e.maximumScreenSpaceError;rte(e,t,i,r,n),ate(e,t,n)}(e,n,t):function(e,t,n){const i=e._maximumScreenSpaceError,r=e._maximumScreenSpaceError;rte(e,t,i,r,n)}(e,n,t),Nee.stack.trim(Nee.stackMaximumLength),Bee.stack.trim(Bee.stackMaximumLength),Fee.stack.trim(Fee.stackMaximumLength),zee.stack.trim(zee.stackMaximumLength),zee.ancestorStack.trim(zee.ancestorStackMaximumLength);const i=e._requestedTiles,r=i.length;for(let e=0;e<r;++e)i[e].updatePriority()};var ste=Mee;const cte={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},lte=new Array(cte.NUMBER_OF_PASSES);lte[cte.RENDER]=Object.freeze({traversal:ste,isRender:!0,requestTiles:!0,ignoreCommands:!1}),lte[cte.PICK]=Object.freeze({traversal:ste,isRender:!1,requestTiles:!1,ignoreCommands:!1}),lte[cte.SHADOW]=Object.freeze({traversal:ste,isRender:!1,requestTiles:!0,ignoreCommands:!1}),lte[cte.PRELOAD]=Object.freeze({traversal:ste,isRender:!1,requestTiles:!0,ignoreCommands:!0}),lte[cte.PRELOAD_FLIGHT]=Object.freeze({traversal:ste,isRender:!1,requestTiles:!0,ignoreCommands:!0}),lte[cte.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({traversal:ste,isRender:!1,requestTiles:!0,ignoreCommands:!0}),lte[cte.MOST_DETAILED_PRELOAD]=Object.freeze({traversal:jee,isRender:!1,requestTiles:!0,ignoreCommands:!0}),lte[cte.MOST_DETAILED_PICK]=Object.freeze({traversal:jee,isRender:!1,requestTiles:!1,ignoreCommands:!1}),cte.getPassOptions=function(e){return lte[e]};var ute=Object.freeze(cte);function hte(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(hte.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){throw new u.a("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new u.a("Empty3DTileContent cannot have group metadata")}}}),hte.prototype.hasProperty=function(e,t){return!1},hte.prototype.getFeature=function(e){},hte.prototype.applyDebugSettings=function(e,t){},hte.prototype.applyStyle=function(e){},hte.prototype.update=function(e,t){},hte.prototype.isDestroyed=function(){return!1},hte.prototype.destroy=function(){return sc(this)};var dte=hte;function fte(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).content,n=e.class;s.a.typeOf.object("options.content",t),s.a.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}function pte(e,t){const n=zX(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!Object(l.a)(n))return;if(!Object(l.a)(e.schema))return void pte._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");const i=Object(c.a)(e.schema.classes,c.a.EMPTY_OBJECT);if(Object(l.a)(n.class)){return new fte({content:n,class:i[n.class]})}}Object.defineProperties(fte.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),fte.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,this._class)},fte.prototype.hasPropertyBySemantic=function(e){return qX.hasPropertyBySemantic(e,this._properties,this._class)},fte.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,this._class,e)},fte.prototype.getProperty=function(e){return qX.getProperty(e,this._properties,this._class)},fte.prototype.setProperty=function(e,t){return qX.setProperty(e,t,this._properties,this._class)},fte.prototype.getPropertyBySemantic=function(e){return qX.getPropertyBySemantic(e,this._properties,this._class)},fte.prototype.setPropertyBySemantic=function(e,t){return qX.setPropertyBySemantic(e,t,this._properties,this._class)},pte._oneTimeWarning=cl;var mte=pte;function gte(e,t){const n=e.metadataExtension;if(!Object(l.a)(n))return;const i=n.groups,r=zX(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if("number"==typeof r)return i[r];const o=n.groupIds.findIndex((function(e){return e===r}));return o>=0?i[o]:void 0}function _te(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).tile,n=e.class;s.a.typeOf.object("options.tile",t),s.a.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}function yte(e,t){const n=zX(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!Object(l.a)(n))return;if(!Object(l.a)(e.schema))return void yte._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");const i=Object(c.a)(e.schema.classes,c.a.EMPTY_OBJECT);if(Object(l.a)(n.class)){return new _te({tile:n,class:i[n.class]})}}Object.defineProperties(_te.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),_te.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,this._class)},_te.prototype.hasPropertyBySemantic=function(e){return qX.hasPropertyBySemantic(e,this._properties,this._class)},_te.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,this._class,e)},_te.prototype.getProperty=function(e){return qX.getProperty(e,this._properties,this._class)},_te.prototype.setProperty=function(e,t){return qX.setProperty(e,t,this._properties,this._class)},_te.prototype.getPropertyBySemantic=function(e){return qX.getPropertyBySemantic(e,this._properties,this._class)},_te.prototype.setPropertyBySemantic=function(e,t){return qX.setPropertyBySemantic(e,t,this._properties,this._class)},yte._oneTimeWarning=cl;var bte=yte;function vte(e){const t=new Uint8Array(e);let n=Jv(t);if("glTF"===n&&(n="glb"),Oee.isBinaryFormat(n))return{contentType:n,binaryPayload:t};const i=function(e){let t;try{t=qu(e)}catch(e){throw new ye.a("Invalid tile content.")}return t}(t);if(Object(l.a)(i.root))return{contentType:Oee.EXTERNAL_TILESET,jsonPayload:i};if(Object(l.a)(i.asset))return{contentType:Oee.GLTF,jsonPayload:i};if(Object(l.a)(i.tileAvailability))return{contentType:Oee.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(Object(l.a)(i.type))return{contentType:Oee.GEOJSON,jsonPayload:i};throw new ye.a("Invalid tile content.")}function Ote(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;const r=Object(l.a)(i.contents)?i.contents:i.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0;const o=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(o),this._requests=new Array(o),this._innerContentResources=new Array(o),this._serverKeys=new Array(o);for(let e=0;e<o;e++){const t=n.getDerivedResource({url:r[e].uri}),i=Yx.a.getServerKey(t.getUrlComponent());this._innerContentResources[e]=t,this._serverKeys[e]=i}this._contentsFetchedPromise=void 0}function wte(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Ate(e,t,n,i){const r=e._innerContentResources[t].clone(),o=e.tile,a=e._serverKeys[t],s=new zc.a({throttle:!0,throttleByServer:!0,type:Uc.a.TILES3D,priorityFunction:function(){return o._priority},serverKey:a});r.request=s,e._requests[t]=s;const c=r.fetchArrayBuffer();return Object(l.a)(c)?c.then((function(t){if(!(n<e._cancelCount))return wte(e,-1),t})).catch((function(o){n<e._cancelCount||(r.request.state!==kc.a.CANCELLED?(wte(e,-1),Ete(e,t,o)):function(e,t){e._cancelCount++,e._tile._contentState=t;const n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;const i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}(e,i))})):Promise.resolve(void 0)}function Ete(e,t,n){const i=e._tileset,r=e._innerContentResources[t].url,o=Object(l.a)(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log("A content failed to load: "+r),console.log("Error: "+o))}function Tte(e){s.a.typeOf.object("options",e),s.a.typeOf.object("options.rectangle",e.rectangle),this.rectangle=Be.clone(e.rectangle),this.minimumHeight=Object(c.a)(e.minimumHeight,0),this.maximumHeight=Object(c.a)(e.maximumHeight,0),this.southwestCornerCartesian=new O,this.northeastCornerCartesian=new O,this.westNormal=new O,this.southNormal=new O,this.eastNormal=new O,this.northNormal=new O;const t=Object(c.a)(e.ellipsoid,H.WGS84);!function(e,t,n){n.cartographicToCartesian(Be.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(Be.northeast(t),e.northeastCornerCartesian),jte.longitude=t.west,jte.latitude=.5*(t.south+t.north),jte.height=0;const i=n.cartographicToCartesian(jte,Dte),r=O.cross(i,O.UNIT_Z,Ite);O.normalize(r,e.westNormal),jte.longitude=t.east;const o=n.cartographicToCartesian(jte,Rte),a=O.cross(O.UNIT_Z,o,Cte);O.normalize(a,e.eastNormal);let s=O.subtract(i,o,Cte);0===O.magnitude(s)&&(s=O.clone(r,s));const c=O.normalize(s,Pte),l=t.south;let u;if(l>0){jte.longitude=.5*(t.west+t.east),jte.latitude=l;const i=n.cartographicToCartesian(jte,Lte.origin);O.clone(c,Lte.direction);const r=xi.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Mte);vi.rayPlane(Lte,r,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(i,xte)}else u=n.geodeticSurfaceNormalCartographic(Be.southeast(t),xte);const h=O.cross(u,s,Ste);O.normalize(h,e.southNormal);const d=t.north;let f;if(d<0){jte.longitude=.5*(t.west+t.east),jte.latitude=d;const i=n.cartographicToCartesian(jte,Lte.origin);O.negate(c,Lte.direction);const r=xi.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Mte);vi.rayPlane(Lte,r,e.northeastCornerCartesian),f=n.geodeticSurfaceNormal(i,xte)}else f=n.geodeticSurfaceNormalCartographic(Be.northwest(t),xte);const p=O.cross(s,f,Ste);O.normalize(p,e.northNormal)}(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,Object(c.a)(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(Ote.prototype,{featurePropertiesDirty:{get:function(){const e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){const t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){if(!this._contentsCreated)return;const e=this._contents.map((function(e){return e.readyPromise})),t=this;return Promise.all(e).then((function(){return t}))}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){throw new u.a("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new u.a("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map((function(e){return e.uri}))}},contentsFetchedPromise:{get:function(){return this._contentsFetchedPromise}}}),Ote.prototype.requestInnerContents=function(){if(!function(e){const t={};for(let n=0;n<e.length;n++){const i=e[n];Object(l.a)(t[i])?t[i]++:t[i]=1}for(const e in t)if(t.hasOwnProperty(e)&&!Yx.a.serverHasOpenSlots(e,t[e]))return!1;return Yx.a.heapHasOpenSlots(e.length)}(this._serverKeys))return this._serverKeys.length;const e=this._innerContentHeaders;wte(this,e.length);for(let t=0;t<e.length;t++)this._arrayFetchPromises[t]=Ate(this,t,this._cancelCount,this._tile._contentState);return this._contentsFetchedPromise=function(e){const t=e._cancelCount;return Promise.all(e._arrayFetchPromises).then((function(n){if(t<e._cancelCount)return;const i=n.map((function(t,n){if(Object(l.a)(t))return function(e,t,n){const i=vte(t);if(i.contentType===Oee.EXTERNAL_TILESET){const t=new ye.a("External tilesets are disallowed inside multiple contents");return Ete(e,n,t)}e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Oee.GEOMETRY||i.contentType===Oee.VECTOR;const r=e._tileset,o=e._innerContentResources[n],a=e._tile;let s;const c=yee[i.contentType];s=Object(l.a)(i.binaryPayload)?c(r,a,o,i.binaryPayload.buffer,0):c(r,a,o,i.jsonPayload);const u=e._innerContentHeaders[n];if(a.hasImplicitContentMetadata){const e=a.implicitSubtree,t=a.implicitCoordinates;s.metadata=e.getContentMetadataView(t,n)}else a.hasImplicitContent||(s.metadata=mte(r,u));const h=gte(r,u);Object(l.a)(h)&&(s.group=new GU({metadata:h}));return s}(e,t,n)}));e._contentsCreated=!0,e._contents=i.filter(l.a)}))}(this),0},Ote.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){const t=this._requests[e];Object(l.a)(t)&&t.cancel()}},Ote.prototype.hasProperty=function(e,t){return!1},Ote.prototype.getFeature=function(e){},Ote.prototype.applyDebugSettings=function(e,t){const n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyDebugSettings(e,t)},Ote.prototype.applyStyle=function(e){const t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)},Ote.prototype.update=function(e,t){const n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].update(e,t)},Ote.prototype.isDestroyed=function(){return!1},Ote.prototype.destroy=function(){const e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return sc(this)},Object.defineProperties(Tte.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),Tte.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=fs.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=At.fromOrientedBoundingBox(this._orientedBoundingBox)};const Cte=new O,xte=new O,Ste=new O,Ite=new O,Pte=new O,Dte=new O,Rte=new O,jte=new R,Mte=new xi(O.UNIT_X,0),Lte=new Gn;const Nte=new O,Bte=new O,Fte=new O(0,-1,0),zte=new O(0,0,-1),kte=new O;Tte.prototype.distanceToCamera=function(e){s.a.defined("frameState",e);const t=function(e,t){const n=t.camera,i=n.positionWC,r=n.positionCartographic;let o,a,s,c=0;if(!Be.contains(e.rectangle,r)){let n=e.southwestCornerCartesian,r=e.northeastCornerCartesian,o=e.westNormal,a=e.southNormal,s=e.eastNormal,l=e.northNormal;t.mode!==AB.SCENE3D&&(n=t.mapProjection.project(Be.southwest(e.rectangle),Nte),n.z=n.y,n.y=n.x,n.x=0,r=t.mapProjection.project(Be.northeast(e.rectangle),Bte),r.z=r.y,r.y=r.x,r.x=0,o=Fte,s=O.UNIT_Y,a=zte,l=O.UNIT_Z);const u=O.subtract(i,n,kte),h=O.dot(u,o),d=O.dot(u,a),f=O.subtract(i,r,kte),p=O.dot(f,s),m=O.dot(f,l);h>0?c+=h*h:p>0&&(c+=p*p),d>0?c+=d*d:m>0&&(c+=m*m)}if(t.mode===AB.SCENE3D?(o=r.height,a=e.minimumHeight,s=e.maximumHeight):(o=i.x,a=0,s=0),o>s){const e=o-s;c+=e*e}else if(o<a){const e=a-o;c+=e*e}return Math.sqrt(c)}(this,e);if(e.mode===AB.SCENE3D&&Object(l.a)(this._orientedBoundingBox)){const n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t},Tte.prototype.intersectPlane=function(e){return s.a.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)},Tte.prototype.createDebugVolume=function(e){s.a.defined("color",e);const t=new Me.clone(Me.IDENTITY),n=new Vx({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Ph({geometry:n,id:"outline",modelMatrix:t,attributes:{color:lp.fromColor(e)}});return new hF({geometryInstances:i,appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1})};var Ute=Tte;let Vte=new R;function Hte(e){s.a.typeOf.object("options",e),s.a.typeOf.string("options.token",e.token);const t=cS.fromToken(e.token),n=Object(c.a)(e.minimumHeight,0),i=Object(c.a)(e.maximumHeight,0),r=Object(c.a)(e.ellipsoid,H.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;const o=function(e,t,n,i){const r=new Array(6),o=e.getCenter(),a=i.geodeticSurfaceNormal(o,Gte),s=i.cartesianToCartographic(o,qte);s.height=n;const c=i.cartographicToCartesian(s,Wte),l=xi.fromPointNormal(c,a);r[0]=l;let u,h=0;const d=[];let f,p;for(u=0;u<4;u++){f=e.getVertex(u),d[u]=f,p=i.cartesianToCartographic(f,Yte),p.height=t;const n=xi.getPointDistance(l,i.cartographicToCartesian(p,Xte));n<h&&(h=n)}const m=xi.clone(l);for(m.normal=O.negate(m.normal,m.normal),m.distance=-1*m.distance+h,r[1]=m,u=0;u<4;u++){f=d[u];const e=d[(u+1)%4],t=i.geodeticSurfaceNormal(f,Kte),n=O.subtract(e,f,Zte);let o=O.cross(n,t,Jte);o=O.normalize(o,o),r[2+u]=xi.fromPointNormal(f,o)}return r}(t,n,i,r);this._boundingPlanes=o;const a=function(e){const t=new Array(8);for(let n=0;n<4;n++)t[n]=dne(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=dne(e[1],e[2+(n+3)%4],e[2+n%4]);return t}(o);let l;for(this._vertices=a,this._edgeNormals=new Array(6),this._edgeNormals[0]=mne(o[0],a.slice(0,4)),l=0;l<4;l++)this._edgeNormals[0][l]=O.negate(this._edgeNormals[0][l],this._edgeNormals[0][l]);for(this._edgeNormals[1]=mne(o[1],a.slice(4,8)),l=0;l<4;l++)this._edgeNormals[2+l]=mne(o[2+l],[a[l%4],a[(l+1)%4],a[4+(l+1)%4],a[4+l]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],l=0;l<4;l++)this._planeVertices.push([this._vertices[l%4],this._vertices[(l+1)%4],this._vertices[4+(l+1)%4],this._vertices[4+l]]);const u=t.getCenter();Vte=r.cartesianToCartographic(u,Vte),Vte.height=(i+n)/2,this.center=r.cartographicToCartesian(Vte,u),this._boundingSphere=At.fromPoints(a)}const Gte=new O,qte=new R,Wte=new O,Yte=new R,Xte=new O,Kte=new O,Jte=new O,Zte=new O;let $te=new O,Qte=new O,ene=new O,tne=new O,nne=new O,ine=new O;const rne=new O,one=new O,ane=new O;let sne=new O,cne=new O,lne=new O,une=new O;const hne=new ce;function dne(e,t,n){$te=e.normal,Qte=t.normal,ene=n.normal,tne=O.multiplyByScalar(e.normal,-e.distance,tne),nne=O.multiplyByScalar(t.normal,-t.distance,nne),ine=O.multiplyByScalar(n.normal,-n.distance,ine),sne=O.multiplyByScalar(O.cross(Qte,ene,rne),O.dot(tne,$te),sne),cne=O.multiplyByScalar(O.cross(ene,$te,one),O.dot(nne,Qte),cne),lne=O.multiplyByScalar(O.cross($te,Qte,ane),O.dot(ine,ene),lne),hne[0]=$te.x,hne[1]=Qte.x,hne[2]=ene.x,hne[3]=$te.y,hne[4]=Qte.y,hne[5]=ene.y,hne[6]=$te.z,hne[7]=Qte.z,hne[8]=ene.z;const i=ce.determinant(hne);return une=O.add(sne,cne,une),une=O.add(une,lne,une),new O(une.x/i,une.y/i,une.z/i)}let fne=new O,pne=new O;function mne(e,t){const n=[];for(let i=0;i<4;i++)fne=O.subtract(t[(i+1)%4],t[i],fne),pne=O.cross(e.normal,fne,pne),pne=O.normalize(pne,pne),n[i]=O.clone(pne);return n}Object.defineProperties(Hte.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});const gne=new O;Hte.prototype.distanceToCamera=function(e){s.a.defined("frameState",e);const t=e.camera.positionWC,n=[],i=[];let r,o,a,c,l;for(xi.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):xi.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]),o=0;o<4;o++)a=2+o,xi.getPointDistance(this._boundingPlanes[a],t)>0&&(n.push(a),i.push(this._planeVertices[a]),r=this._edgeNormals[a]);if(0===n.length)return 0;if(1===n.length)return l=this._boundingPlanes[n[0]],c=One(xi.projectPointOntoPlane(l,t,gne),i[0],l,r),O.distance(c,t);if(2===n.length){if(0===n[0]){const e=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return c=bne(t,e[0],e[1]),O.distance(c,t)}let e,r=Number.MAX_VALUE;for(o=0;o<2;o++)l=this._boundingPlanes[n[o]],c=One(xi.projectPointOntoPlane(l,t,gne),i[o],l,this._edgeNormals[n[o]]),e=O.distanceSquared(c,t),e<r&&(r=e);return Math.sqrt(r)}if(n.length>3)return c=One(xi.projectPointOntoPlane(this._boundingPlanes[1],t,gne),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),O.distance(c,t);const u=2===n[1]&&5===n[2]?0:1;return 0===n[0]?O.distance(t,this._vertices[(n[1]-2+u)%4]):O.distance(t,this._vertices[4+(n[1]-2+u)%4])};const _ne=new O,yne=new O;function bne(e,t,n){const i=O.subtract(n,t,_ne),r=O.subtract(e,t,yne);let o=O.dot(i,r);if(o<=0)return t;const a=O.dot(i,i);return o>=a?n:(o/=a,new O((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}const vne=new xi(O.UNIT_X,0);function One(e,t,n,i){let r,o,a,s=Number.MAX_VALUE;for(let n=0;n<t.length;n++){const c=xi.fromPointNormal(t[n],i[n],vne);xi.getPointDistance(c,e)<0||(a=bne(e,t[n],t[(n+1)%4]),r=O.distance(e,a),r<s&&(s=r,o=a))}return Object(l.a)(o)?o:e}Hte.prototype.intersectPlane=function(e){s.a.defined("plane",e);let t=0,n=0;for(let i=0;i<this._vertices.length;i++){O.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++}return t===this._vertices.length?W.INSIDE:n===this._vertices.length?W.OUTSIDE:W.INTERSECTING},Hte.prototype.createDebugVolume=function(e){s.a.defined("color",e);const t=new Me.clone(Me.IDENTITY),n=new Xm({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Xm.createGeometry(n),r=new Ph({geometry:i,id:"outline",modelMatrix:t,attributes:{color:lp.fromColor(e)}}),o=new Xm({polygonHierarchy:{positions:this._planeVertices[1]}}),a=Xm.createGeometry(o),c=new Ph({geometry:a,id:"outline",modelMatrix:t,attributes:{color:lp.fromColor(e)}}),l=[];for(let n=0;n<4;n++){const i=new Xm({polygonHierarchy:{positions:this._planeVertices[2+n]}}),r=Xm.createGeometry(i);l[n]=new Ph({geometry:r,id:"outline",modelMatrix:t,attributes:{color:lp.fromColor(e)}})}return new hF({geometryInstances:[l[0],l[1],l[2],l[3],c,r],appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1})};var wne=Hte;function Ane(e,t){0===t&&(t=h.a.EPSILON7),this._boundingSphere=new At(e,t)}Object.defineProperties(Ane.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),Ane.prototype.distanceToCamera=function(e){s.a.defined("frameState",e);const t=this._boundingSphere;return Math.max(0,O.distance(t.center,e.camera.positionWC)-t.radius)},Ane.prototype.intersectPlane=function(e){return s.a.defined("plane",e),At.intersectPlane(this._boundingSphere,e)},Ane.prototype.update=function(e,t){O.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t},Ane.prototype.createDebugVolume=function(e){s.a.defined("color",e);const t=new SI({radius:this.radius}),n=Me.fromTranslation(this.center,new Me.clone(Me.IDENTITY)),i=new Ph({geometry:t,id:"outline",modelMatrix:n,attributes:{color:lp.fromColor(e)}});return new hF({geometryInstances:i,appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1})};var Ene=Ane;const Tne=new O,Cne=new O,xne=new O,Sne=new O;function Ine(e,t,n){n=O.cross(e,t,n);const i=O.magnitude(n);return O.multiplyByScalar(n,h.a.EPSILON7/i,n)}function Pne(e,t){const n=O.normalize(e,Sne);return Ine(e,O.equalsEpsilon(n,O.UNIT_X,h.a.EPSILON6)?O.UNIT_Y:O.UNIT_X,t)}function Dne(e){let t=ce.getColumn(e,0,Tne),n=ce.getColumn(e,1,Cne),i=ce.getColumn(e,2,xne);const r=O.equals(t,O.ZERO),o=O.equals(n,O.ZERO),a=O.equals(i,O.ZERO);return r||o||a?r&&o&&a?(e[0]=h.a.EPSILON7,e[4]=h.a.EPSILON7,e[8]=h.a.EPSILON7,e):(!r||o||a?r||!o||a?r||o||!a?r?o?a||(t=Pne(i,t),n=Ine(i,t,n)):(t=Pne(n,t),i=Ine(n,t,i)):(n=Pne(t,n),i=Ine(n,t,i)):i=Ine(n,t,i):n=Ine(t,i,n):t=Ine(n,i,t),ce.setColumn(e,0,t,e),ce.setColumn(e,1,n,e),ce.setColumn(e,2,i,e),e):e}function Rne(e,t){t=Dne(t),this._orientedBoundingBox=new fs(e,t),this._boundingSphere=At.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Rne.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),Rne.prototype.distanceToCamera=function(e){return s.a.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},Rne.prototype.intersectPlane=function(e){return s.a.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)},Rne.prototype.update=function(e,t){O.clone(e,this._orientedBoundingBox.center),t=Dne(t),ce.clone(t,this._orientedBoundingBox.halfAxes),At.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},Rne.prototype.createDebugVolume=function(e){s.a.defined("color",e);const t=new gu({minimum:new O(-1,-1,-1),maximum:new O(1,1,1)}),n=Me.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Ph({geometry:t,id:"outline",modelMatrix:n,attributes:{color:lp.fromColor(e)}});return new hF({geometryInstances:i,appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1})};var jne=Rne;function Mne(e,t,n,i){this._tileset=e,this._header=n;const r=Object(l.a)(n.contents),o=r&&n.contents.length>1||zX(n,"3DTILES_multiple_contents"),a=r&&!o?n.contents[0]:n.content;this._contentHeader=a,this.transform=Object(l.a)(n.transform)?Me.unpack(n.transform):Me.clone(Me.IDENTITY);const s=Object(l.a)(i)?i.computedTransform:e.modelMatrix,c=Me.multiply(s,this.transform,new Me),u=Object(l.a)(i)?i._initialTransform:Me.IDENTITY;let h,d,f,p;this._initialTransform=Me.multiply(u,this.transform,new Me),this.computedTransform=c,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0,Object(l.a)(a)&&Object(l.a)(a.boundingVolume)&&(h=this.createBoundingVolume(a.boundingVolume,c)),this._contentBoundingVolume=h,this._contentBoundingVolume2D=void 0,Object(l.a)(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,Object(l.a)(this._geometricError)||(this._geometricError=Object(l.a)(i)?i.geometricError:e._geometricError,Mne._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale(),Object(l.a)(n.refine)?("replace"!==n.refine&&"add"!==n.refine||Mne._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),f="REPLACE"===n.refine.toUpperCase()?wZ.REPLACE:wZ.ADD):f=Object(l.a)(i)?i.refine:wZ.REPLACE,this.refine=f,this.children=[],this.parent=i;let m,g,_,y=!1;if(t=Tt.a.createIfNeeded(t),o)m=bee.UNLOADED,g=t.clone();else if(Object(l.a)(a)){let n=a.uri;Object(l.a)(a.url)&&(Mne._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),n=a.url),""===n?(Mne._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),p=new dte(e,this),y=!0,m=bee.READY):(m=bee.UNLOADED,g=t.getDerivedResource({url:n}),_=Yx.a.getServerKey(g.getUrlComponent()))}else p=new dte(e,this),y=!0,m=bee.READY;this._content=p,this._contentResource=g,this._contentState=m,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=_,this.hasEmptyContent=y,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.metadata=bte(e,n),this.cacheNode=void 0;const b=n.expire;let v,O;Object(l.a)(b)&&(v=b.duration,Object(l.a)(b.date)&&(O=tr.fromIso8601(b.date))),this.expireDuration=v,this.expireDate=O,this.lastStyleTime=0,this._optimChildrenWithinParent=wee.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=sp.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new tr,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Mne._deprecationWarning=ll,Object.defineProperties(Mne.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return Object(c.a)(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},extras:{get:function(){return this._header.extras}},color:{get:function(){return Object(l.a)(this._color)||(this._color=new sp),sp.clone(this._color)},set:function(e){this._color=sp.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent||Object(l.a)(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===bee.READY}},contentUnloaded:{get:function(){return this._contentState===bee.UNLOADED}},contentExpired:{get:function(){return this._contentState===bee.EXPIRED}},contentFailed:{get:function(){return this._contentState===bee.FAILED}},contentReadyToProcessPromise:{get:function(){return this._contentReadyToProcessPromise}},contentReadyPromise:{get:function(){return this._contentReadyPromise}},commandsLength:{get:function(){return this._commandsLength}}});const Lne=new O;const Nne=new tr;function Bne(e){return function(){return e._priority}}function Fne(e,t,n){e._contentState===bee.PROCESSING&&--t.statistics.numberOfTilesProcessing,e._contentState=bee.FAILED}function zne(e,t){e._contentState===bee.PROCESSING?--t.statistics.numberOfTilesProcessing:--t.statistics.numberOfPendingRequests,e._contentState=bee.FAILED}Mne.prototype.getScreenSpaceError=function(e,t,n){const i=this._tileset,r=Object(c.a)(n,1),o=Object(l.a)(this.parent)?this.parent.geometricError:i._geometricError,a=t?o:this.geometricError;if(0===a)return 0;const s=e.camera;let u=s.frustum;const d=e.context,f=d.drawingBufferWidth,p=d.drawingBufferHeight*r;let m;if(e.mode===AB.SCENE2D||u instanceof nv){Object(l.a)(u._offCenterFrustum)&&(u=u._offCenterFrustum);m=a/(Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,p))}else{const e=Math.max(this._distanceToCamera,h.a.EPSILON7);if(m=a*p/(e*s.frustum.sseDenominator),i.dynamicScreenSpaceError){const t=i._dynamicScreenSpaceErrorComputedDensity,n=i.dynamicScreenSpaceErrorFactor;m-=h.a.fog(e,t)*n}}return m/=e.pixelRatio,m},Mne.prototype.updateVisibility=function(e){const t=this.parent,n=this._tileset,i=Object(l.a)(t)?t.computedTransform:n.modelMatrix,r=Object(l.a)(t)?t._visibilityPlaneMask:xy.MASK_INDETERMINATE;this.updateTransform(i),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==xy.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=function(e,t){const n=t.parent,i=Object(l.a)(n)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-i}(n,this),this._priorityProgressiveResolution=function(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;const i=t.parent,r=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=r,a=Object(l.a)(i)&&i._screenSpaceErrorProgressiveResolution>r;return o&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,n=!0),n}(n,this),this.priorityDeferred=function(e,t){const n=e._tileset,i=t.camera,r=e.boundingSphere,o=r.radius,a=O.multiplyByScalar(i.directionWC,e._centerZDepth,Lne),s=O.add(i.positionWC,a,Lne),c=O.subtract(s,r.center,Lne);if(O.magnitude(c)>o){const t=O.normalize(c,Lne),n=O.multiplyByScalar(t,o,Lne),a=O.add(r.center,n,Lne),s=O.subtract(a,i.positionWC,Lne),l=O.normalize(s,Lne);e._foveatedFactor=1-Math.abs(O.dot(i.directionWC,l))}else e._foveatedFactor=0;const u=e.refine===wZ.REPLACE,d=n._skipLevelOfDetail;if(u&&!d||!n.foveatedScreenSpaceError||1===n.foveatedConeSize||e._priorityProgressiveResolution&&u&&d||n._pass===ute.PRELOAD_FLIGHT||n._pass===ute.PRELOAD)return!1;const f=1-Math.cos(.5*i.frustum.fov),p=n.foveatedConeSize*f;if(e._foveatedFactor<=p)return!1;const m=f-p,g=h.a.clamp((e._foveatedFactor-p)/m,0,1),_=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.maximumScreenSpaceError,g),y=0===e._screenSpaceError&&Object(l.a)(e.parent)?.5*e.parent._screenSpaceError:e._screenSpaceError;return n.maximumScreenSpaceError-_<=y}(this,e)},Mne.prototype.updateExpiration=function(){if(Object(l.a)(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){const e=tr.now(Nne);tr.lessThan(this.expireDate,e)&&(this._contentState=bee.EXPIRED,this._expiredContent=this._content)}},Mne.prototype.requestContent=function(){return this.hasEmptyContent?0:this.hasMultipleContents?function(e){let t=e._content;const n=e._tileset;if(!Object(l.a)(t)){const i=zX(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new Ote(n,e,e._contentResource.clone(),i),e._content=t}const i=t.requestInnerContents();if(i>0)return i;e._contentState=bee.LOADING;const r=t.contentsFetchedPromise.then((function(){if(e._contentState===bee.LOADING&&Object(l.a)(t.readyPromise)){if(!e.isDestroyed())return e._contentState=bee.PROCESSING,t;Fne(e,n,"Tile was unloaded while content was loading")}}));return e._contentReadyToProcessPromise=r,e._contentReadyPromise=r.then((function(e){if(Object(l.a)(e))return t.readyPromise})).then((function(t){if(Object(l.a)(t)){if(!e.isDestroyed())return e._selectedFrame=0,e.lastStyleTime=0,tr.now(e._loadTimestamp),e._contentState=bee.READY,t;Fne(e,n,"Tile was unloaded while content was processing")}})).catch((function(t){Fne(e,n,t)})),0}(this):function(e){const t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});const i=new zc.a({throttle:!0,throttleByServer:!0,type:Uc.a.TILES3D,priorityFunction:Bne(e),serverKey:e._serverKey});e._request=i,t.request=i;const r=t.fetchArrayBuffer();if(!Object(l.a)(r))return 1;const o=e._contentState,a=e._tileset;e._contentState=bee.LOADING,++a.statistics.numberOfPendingRequests;const s=r.then((function(t){if(e.isDestroyed())return void zne(e,a);const i=function(e,t){const n=vte(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Oee.GEOMETRY||n.contentType===Oee.VECTOR,(n.contentType===Oee.IMPLICIT_SUBTREE||n.contentType===Oee.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0);n.contentType===Oee.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let r;const o=yee[n.contentType];r=Object(l.a)(n.binaryPayload)?o(i,e,e._contentResource,n.binaryPayload.buffer,0):o(i,e,e._contentResource,n.jsonPayload);const a=e._contentHeader;if(e.hasImplicitContentMetadata){const t=e.implicitSubtree,n=e.implicitCoordinates;r.metadata=t.getContentMetadataView(n,0)}else e.hasImplicitContent||(r.metadata=mte(i,a));const s=gte(i,a);Object(l.a)(s)&&(r.group=new GU({metadata:s}));return r}(e,t);return n&&(e.expireDate=void 0),e._content=i,e._contentState=bee.PROCESSING,i}));return e._contentReadyToProcessPromise=s,e._contentReadyPromise=s.then((function(e){if(Object(l.a)(e))return--a.statistics.numberOfPendingRequests,e.readyPromise})).then((function(t){if(Object(l.a)(t)){if(!e.isDestroyed())return function(e){if(Object(l.a)(e.expireDuration)){const t=tr.now(Nne);tr.addSeconds(t,e.expireDuration,t),Object(l.a)(e.expireDate)?tr.lessThan(e.expireDate,t)&&tr.clone(t,e.expireDate):e.expireDate=tr.clone(t)}}(e),e._selectedFrame=0,e.lastStyleTime=0,tr.now(e._loadTimestamp),e._contentState=bee.READY,t;zne(e,a)}})).catch((function(t){return i.state===kc.a.CANCELLED?(e._contentState=o,--a.statistics.numberOfPendingRequests,++a.statistics.numberOfAttemptedRequests,Promise.reject("Cancelled")):(zne(e,a),Promise.reject(t))})),0}(this)},Mne.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()},Mne.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||this.hasImplicitContent||(this._content=this._content&&this._content.destroy(),this._contentState=bee.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};const kne=new At;function Une(e,t){if(t.mode!==AB.SCENE3D&&!Object(l.a)(e._boundingVolume2D)){const n=e._boundingVolume.boundingSphere,i=At.projectTo2D(n,t.mapProjection,kne);e._boundingVolume2D=new Ene(i.center,i.radius)}return t.mode!==AB.SCENE3D?e._boundingVolume2D:e._boundingVolume}Mne.prototype.visibility=function(e,t){const n=e.cullingVolume,i=Une(this,e),r=this._tileset,o=r.clippingPlanes;if(Object(l.a)(o)&&o.enabled){const e=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=e!==W.INSIDE,e===W.OUTSIDE)return xy.MASK_OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)},Mne.prototype.contentVisibility=function(e){if(!Object(l.a)(this._contentBoundingVolume))return W.INSIDE;if(this._visibilityPlaneMask===xy.MASK_INSIDE)return W.INSIDE;const t=e.cullingVolume,n=function(e,t){if(t.mode!==AB.SCENE3D&&!Object(l.a)(e._contentBoundingVolume2D)){const n=e._contentBoundingVolume.boundingSphere,i=At.projectTo2D(n,t.mapProjection,kne);e._contentBoundingVolume2D=new Ene(i.center,i.radius)}return t.mode!==AB.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}(this,e),i=this._tileset,r=i.clippingPlanes;if(Object(l.a)(r)&&r.enabled){const e=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=e!==W.INSIDE,e===W.OUTSIDE)return W.OUTSIDE}return t.computeVisibility(n)},Mne.prototype.distanceToTile=function(e){return Une(this,e).distanceToCamera(e)};const Vne=new O;Mne.prototype.distanceToTileCenter=function(e){const t=Une(this,e).boundingVolume,n=O.subtract(t.center,e.camera.positionWC,Vne);return O.dot(e.camera.directionWC,n)},Mne.prototype.insideViewerRequestVolume=function(e){const t=this._viewerRequestVolume;return!Object(l.a)(t)||0===t.distanceToCamera(e)};const Hne=new ce,Gne=new O,qne=new ce,Wne=new O,Yne=new Be,Xne=new fs,Kne=new Me;function Jne(e,t,n,i){if(!Me.equalsEpsilon(t,n,h.a.EPSILON8))return function(e,t,n,i){const r=Be.unpack(e,0,Yne),o=e[4],a=e[5],s=fs.fromRectangle(r,o,a,H.WGS84,Xne);let c=s.center,u=s.halfAxes;t=Me.multiplyTransformation(t,Me.inverseTransformation(n,Kne),Kne),c=Me.multiplyByPoint(t,c,c);const h=Me.getMatrix3(t,Hne);return u=ce.multiply(h,u,u),Object(l.a)(i)&&i instanceof jne?(i.update(c,u),i):new jne(c,u)}(e,t,n,i);if(Object(l.a)(i))return i;const r=Be.unpack(e,0,Yne);return new Ute({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}Mne.prototype.createBoundingVolume=function(e,t,n){if(!Object(l.a)(e))throw new ye.a("boundingVolume must be defined");if(zX(e,"3DTILES_bounding_volume_S2"))return new wne(e.extensions["3DTILES_bounding_volume_S2"]);if(Object(l.a)(e.box))return function(e,t,n){let i=O.fromElements(e[0],e[1],e[2],Wne),r=ce.fromArray(e,3,qne);i=Me.multiplyByPoint(t,i,i);const o=Me.getMatrix3(t,Hne);return r=ce.multiply(o,r,r),Object(l.a)(n)?(n.update(i,r),n):new jne(i,r)}(e.box,t,n);if(Object(l.a)(e.region))return Jne(e.region,t,this._initialTransform,n);if(Object(l.a)(e.sphere))return function(e,t,n){let i=O.fromElements(e[0],e[1],e[2],Wne),r=e[3];i=Me.multiplyByPoint(t,i,i);const o=Me.getScale(t,Gne);return r*=O.maximumComponent(o),Object(l.a)(n)?(n.update(i,r),n):new Ene(i,r)}(e.sphere,t,n);throw new ye.a("boundingVolume must contain a sphere, region, or box")},Mne.prototype.updateTransform=function(e){e=Object(c.a)(e,Me.IDENTITY);const t=Me.multiply(e,this.transform,Kne);if(!!Me.equals(t,this.computedTransform))return;Me.clone(t,this.computedTransform);const n=this._header,i=this._contentHeader;this._boundingVolume=this.createBoundingVolume(n.boundingVolume,this.computedTransform,this._boundingVolume),Object(l.a)(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._contentBoundingVolume)),Object(l.a)(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(n.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()},Mne.prototype.updateGeometricErrorScale=function(){const e=Me.getScale(this.computedTransform,Gne),t=O.maximumComponent(e);this.geometricError=this._geometricError*t},Mne.prototype.update=function(e,t,n){const i=t.commandList.length;!function(e,t){const n=t.clippingPlanes;let i=0;Object(l.a)(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}(this,e),function(e,t,n,i){if(!i.isRender)return;const r=Object(l.a)(e._contentHeader)&&Object(l.a)(e._contentHeader.boundingVolume),o=e.hasEmptyContent||e.hasTilesetContent||e.hasImplicitContent,a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(a){let t;t=e._finalResolution?o?sp.DARKGRAY:sp.WHITE:sp.YELLOW,Object(l.a)(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(t)),e._debugBoundingVolume.update(n);const i=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");i.color=lp.toValue(t,i.color)}else!a&&Object(l.a)(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(Object(l.a)(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(sp.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&Object(l.a)(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&Object(l.a)(e._viewerRequestVolume)?(Object(l.a)(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(sp.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&Object(l.a)(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());const s=t.debugColorizeTiles&&!e._debugColorizeTiles||Object(l.a)(t._heatmap.tilePropertyName),c=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):c&&(e._debugColorizeTiles=!1,e.color=sp.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),c&&t.makeStyleDirty()}(this,e,t,n),function(e,t,n){const i=e._content,r=e._expiredContent;if(!e.hasMultipleContents&&Object(l.a)(r)){if(!e.contentReady)return void r.update(t,n);e._expiredContent.destroy(),e._expiredContent=void 0}i.update(t,n)}(this,e,t);const r=t.commandList.length-i;this._commandsLength=r;for(let e=0;e<r;++e){const n=t.commandList[i+e],r=n.pass===KR.TRANSLUCENT;n.depthForTranslucentClassification=r}this.clippingPlanesDirty=!1};const Zne=[];function $ne(e,t,n){const i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Qne(e,t,n){return Math.max(h.a.normalize(e,t,n)-h.a.EPSILON7,0)}Mne.prototype.process=function(e,t){const n=t.commandList;t.commandList=Zne,this._content.update(e,t),Zne.length=0,t.commandList=n},Mne.prototype.updatePriority=function(){const e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=Math.pow(10,8),o=Math.pow(10,9),a=Math.pow(10,10);let s=Qne(this._depth,n.depth,i.depth);s=t?1-s:s;const c=$ne(!e._skipLevelOfDetail&&this.refine===wZ.REPLACE?Qne(this._priorityHolder._distanceToCamera,n.distance,i.distance):Qne(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),4,0),l=this._priorityProgressiveResolution?0:r,u=$ne(Qne(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),4,4),h=this.priorityDeferred?o:0,d=e._pass===ute.PRELOAD_FLIGHT?0:a;this._priority=s+c+l+u+h+d},Mne.prototype.isDestroyed=function(){return!1},Mne.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),sc(this)};var eie=Mne;function tie(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).id,n=e.group,i=e.class;s.a.typeOf.object("options.group",n),s.a.typeOf.object("options.class",i);const r=Object(l.a)(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(tie.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),tie.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,this._class)},tie.prototype.hasPropertyBySemantic=function(e){return qX.hasPropertyBySemantic(e,this._properties,this._class)},tie.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,this._class,e)},tie.prototype.getProperty=function(e){return qX.getProperty(e,this._properties,this._class)},tie.prototype.setProperty=function(e,t){return qX.setProperty(e,t,this._properties,this._class)},tie.prototype.getPropertyBySemantic=function(e){return qX.getPropertyBySemantic(e,this._properties,this._class)},tie.prototype.setPropertyBySemantic=function(e,t){return qX.setPropertyBySemantic(e,t,this._properties,this._class)};var nie=tie;function iie(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).tileset,n=e.class;s.a.typeOf.object("options.tileset",t),s.a.typeOf.object("options.class",n);const i=Object(l.a)(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(iie.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}}),iie.prototype.hasProperty=function(e){return qX.hasProperty(e,this._properties,this._class)},iie.prototype.hasPropertyBySemantic=function(e){return qX.hasPropertyBySemantic(e,this._properties,this._class)},iie.prototype.getPropertyIds=function(e){return qX.getPropertyIds(this._properties,this._class,e)},iie.prototype.getProperty=function(e){return qX.getProperty(e,this._properties,this._class)},iie.prototype.setProperty=function(e,t){return qX.setProperty(e,t,this._properties,this._class)},iie.prototype.getPropertyBySemantic=function(e){return qX.getPropertyBySemantic(e,this._properties,this._class)},iie.prototype.setPropertyBySemantic=function(e,t){return qX.setPropertyBySemantic(e,t,this._properties,this._class)};var rie=iie;function oie(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).metadataJson,n=e.schema;s.a.typeOf.object("options.metadataJson",t),s.a.typeOf.object("options.schema",n);const i=Object(c.a)(t.metadata,t.tileset);let r;Object(l.a)(i)&&(r=new rie({tileset:i,class:n.classes[i.class]}));let o=[];const a=[],u=t.groups;if(Array.isArray(u)){const e=u.length;for(let t=0;t<e;t++){const e=u[t];a.push(new nie({group:e,class:n.classes[e.class]}))}}else if(Object(l.a)(u)){o=Object.keys(u).sort();const e=o.length;for(let t=0;t<e;t++){const e=o[t];if(u.hasOwnProperty(e)){const t=u[e];a.push(new nie({id:e,group:u[e],class:n.classes[t.class]}))}}}this._schema=n,this._groups=a,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(oie.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var aie=oie;const sie={},cie=new O;sie.checkChildrenWithinParent=function(e){s.a.typeOf.object("tile",e);const t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof jne||i instanceof Ute){const r=i._orientedBoundingBox;e._optimChildrenWithinParent=wee.USE_OPTIMIZATION;for(let i=0;i<n;++i){const n=t[i].boundingVolume;if(!(n instanceof jne||n instanceof Ute)){e._optimChildrenWithinParent=wee.SKIP_OPTIMIZATION;break}const o=n._orientedBoundingBox,a=O.subtract(o.center,r.center,cie),s=O.magnitude(a);O.divideByScalar(a,s,a);if(Math.abs(r.halfAxes[0]*a.x)+Math.abs(r.halfAxes[1]*a.y)+Math.abs(r.halfAxes[2]*a.z)+Math.abs(r.halfAxes[3]*a.x)+Math.abs(r.halfAxes[4]*a.y)+Math.abs(r.halfAxes[5]*a.z)+Math.abs(r.halfAxes[6]*a.x)+Math.abs(r.halfAxes[7]*a.y)+Math.abs(r.halfAxes[8]*a.z)<=Math.abs(o.halfAxes[0]*a.x)+Math.abs(o.halfAxes[1]*a.y)+Math.abs(o.halfAxes[2]*a.z)+Math.abs(o.halfAxes[3]*a.x)+Math.abs(o.halfAxes[4]*a.y)+Math.abs(o.halfAxes[5]*a.z)+Math.abs(o.halfAxes[6]*a.x)+Math.abs(o.halfAxes[7]*a.y)+Math.abs(o.halfAxes[8]*a.z)+s){e._optimChildrenWithinParent=wee.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===wee.USE_OPTIMIZATION};var lie=sie;function uie(){this._list=new fb,this._sentinel=this._list.add(),this._trimTiles=!1}uie.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},uie.prototype.touch=function(e){const t=e.cacheNode;Object(l.a)(t)&&this._list.splice(this._sentinel,t)},uie.prototype.add=function(e){Object(l.a)(e.cacheNode)||(e.cacheNode=this._list.add(e))},uie.prototype.unloadTile=function(e,t,n){const i=t.cacheNode;Object(l.a)(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))},uie.prototype.unloadTiles=function(e,t){const n=this._trimTiles;this._trimTiles=!1;const i=this._list,r=1024*e.maximumMemoryUsage*1024,o=this._sentinel;let a=i.head;for(;a!==o&&(e.totalMemoryUsageInBytes>r||n);){const n=a.item;a=a.next,this.unloadTile(e,n,t)}},uie.prototype.trim=function(){this._trimTiles=!0};var hie=uie;function die(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function fie(e,t){let n;return n="_loadTimestamp"===t?tr.toDate(e).getTime():e,n}die.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=fie(e,n),this._referenceMaximum[n]=fie(t,n)};const pie=[new sp(.1,.1,.1,1),new sp(.153,.278,.878,1),new sp(.827,.231,.49,1),new sp(.827,.188,.22,1),new sp(1,.592,.259,1),new sp(1,.843,0,1)];die.prototype.colorize=function(e,t){const n=this.tilePropertyName;if(!Object(l.a)(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;const i=function(e,t){const n=e.tilePropertyName;if(Object(l.a)(n)){const i=fie(t[n],n);return Object(l.a)(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;const a=o-r+h.a.EPSILON7,s=h.a.clamp(i-r,0,a)/a*(pie.length-1),c=Math.floor(s),u=Math.ceil(s),d=s-c,f=pie[c],p=pie[u],m=sp.clone(sp.WHITE);m.red=h.a.lerp(f.red,p.red,d),m.green=h.a.lerp(f.green,p.green,d),m.blue=h.a.lerp(f.blue,p.blue,d),e._debugColor=m},die.prototype.resetMinimumMaximum=function(){const e=this.tilePropertyName;if(Object(l.a)(e)){const t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=Object(l.a)(t)&&Object(l.a)(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var mie=die;function gie(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function _ie(e,t,n,i){const r=t.innerContents,o=t.pointsLength,a=t.trianglesLength,s=t.featuresLength,c=t.geometryByteLength,u=t.texturesByteLength,h=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-s:s,e.numberOfPointsLoaded+=n?-o:o,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-u:u,e.batchTableByteLength+=n?-h:h):(e.numberOfFeaturesSelected+=n?-s:s,e.numberOfPointsSelected+=n?-o:o,e.numberOfTrianglesSelected+=n?-a:a),Object(l.a)(r)){const t=r.length;for(let o=0;o<t;++o)_ie(e,r[o],n,i)}}gie.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},gie.prototype.incrementSelectionCounts=function(e){_ie(this,e,!1,!1)},gie.prototype.incrementLoadCounts=function(e){_ie(this,e,!1,!0)},gie.prototype.decrementLoadCounts=function(e){_ie(this,e,!0,!0)},gie.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var yie=gie;function bie(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(bie.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}}),bie.prototype.makeDirty=function(){this._styleDirty=!0},bie.prototype.resetDirty=function(){this._styleDirty=!1},bie.prototype.applyStyle=function(e){if(!e.ready)return;if(Object(l.a)(this._style)&&!this._style._ready)return;const t=this._styleDirty;t&&++this._lastStyleTime;const n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let e=0;e<o;++e){const t=r[e];if(t.lastStyleTime!==n){const e=t.content;t.lastStyleTime=n,e.applyStyle(this._style),i.numberOfFeaturesStyled+=e.featuresLength,++i.numberOfTilesStyled}}};var vie=bie;function Oie(e,t,n){const i=zX(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;s.a.typeOf.object("implicitTiling",i),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;const r=t.boundingVolume;if(!Object(l.a)(r.box)&&!Object(l.a)(r.region)&&!zX(r,"3DTILES_bounding_volume_S2"))throw new ye.a("Only box, region and 3DTILES_bounding_volume_S2 are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new Tt.a({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];const o=function(e){if(zX(e,"3DTILES_multiple_contents")){const t=e.extensions["3DTILES_multiple_contents"];return Object(l.a)(t.contents)?t.contents:t.content}if(Object(l.a)(e.contents))return e.contents;if(Object(l.a)(e.content))return[e.content];return[]}(t);for(let e=0;e<o.length;e++){const t=o[e];this.contentHeaders.push(Object(Zf.a)(t,!0));const n=new Tt.a({url:t.uri});this.contentUriTemplates.push(n)}this.contentCount=this.contentHeaders.length,this.tileHeader=function(e){const t=Object(Zf.a)(e,!0);Object(l.a)(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],0===Object.keys(t.extensions).length&&delete t.extensions);return delete t.implicitTiling,delete t.contents,delete t.content,t}(t),this.subdivisionScheme=HX[i.subdivisionScheme],this.branchingFactor=HX.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,Object(l.a)(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function wie(e){if(s.a.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),s.a.typeOf.number("options.subtreeLevels",e.subtreeLevels),s.a.typeOf.number("options.level",e.level),s.a.typeOf.number("options.x",e.x),s.a.typeOf.number("options.y",e.y),e.subdivisionScheme===HX.OCTREE&&s.a.typeOf.number("options.z",e.z),e.level<0)throw new u.a("level must be non-negative");if(e.x<0)throw new u.a("x must be non-negative");if(e.y<0)throw new u.a("y must be non-negative");if(e.subdivisionScheme===HX.OCTREE&&e.z<0)throw new u.a("z must be non-negative");const t=1<<e.level;if(e.x>=t)throw new u.a("x is out of range");if(e.y>=t)throw new u.a("y is out of range");if(e.subdivisionScheme===HX.OCTREE&&e.z>=t)throw new u.a("z is out of range");this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===HX.OCTREE&&(this.z=e.z)}function Aie(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new u.a("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new u.a("coordinates must have same subtreeLevels")}Object.defineProperties(wie.prototype,{childIndex:{get:function(){let e=0;return e|=1&this.x,e|=(1&this.y)<<1,this.subdivisionScheme===HX.OCTREE&&(e|=(1&this.z)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===HX.OCTREE?AE.encode3D(this.x,this.y,this.z):AE.encode2D(this.x,this.y)}},tileIndex:{get:function(){return(this.subdivisionScheme===HX.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3)+this.mortonIndex}}}),wie.prototype.getDescendantCoordinates=function(e){s.a.typeOf.object("offsetCoordinates",e),Aie(this,e);const t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===HX.OCTREE){const r=(this.z<<e.level)+e.z;return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})},wie.prototype.getAncestorCoordinates=function(e){if(s.a.typeOf.number("offsetLevels",e),e<0)throw new u.a("offsetLevels must be non-negative");if(e>this.level)throw new u.a("ancestor cannot be above the tileset root");const t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===HX.OCTREE){const e=Math.floor(this.z/t);return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:e})}return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})},wie.prototype.getOffsetCoordinates=function(e){if(s.a.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new u.a("this is not an ancestor of descendant");Aie(this,e);const t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===HX.OCTREE){const o=e.z%n;return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})},wie.prototype.getChildCoordinates=function(e){s.a.typeOf.number("childIndex",e);const t=HX.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new u.a("childIndex must be at least 0 and less than "+t);const n=this.level+1,i=2*this.x+e%2,r=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===HX.OCTREE){const t=2*this.z+Math.floor(e/4)%2;return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:t})}return new wie({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})},wie.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)},wie.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)},wie.prototype.isAncestor=function(e){s.a.typeOf.object("descendantCoordinates",e),Aie(this,e);const t=e.level-this.level;if(t<=0)return!1;const n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===HX.OCTREE){const n=e.z>>t,i=this.z===n;return r&&o&&i}return r&&o},wie.prototype.isEqual=function(e){return s.a.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme!==HX.OCTREE||this.z===e.z)},wie.prototype.isImplicitTilesetRoot=function(){return 0===this.level},wie.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels==0},wie.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels==this.subtreeLevels-1},wie.prototype.getTemplateValues=function(){const e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===HX.OCTREE&&(e.z=this.z),e};const Eie=[0,0,0];function Tie(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.url",e.url),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new hie,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=Object(c.a)(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=Object(c.a)(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new lE,this._maximumScreenSpaceError=Object(c.a)(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=Object(c.a)(e.maximumMemoryUsage,512),this._styleEngine=new vie,this._styleApplied=!1,this._modelMatrix=Object(l.a)(e.modelMatrix)?Me.clone(e.modelMatrix):Me.clone(Me.IDENTITY),this._statistics=new yie,this._statisticsLast=new yie,this._statisticsPerPass=new Array(ute.NUMBER_OF_PASSES);for(let e=0;e<ute.NUMBER_OF_PASSES;++e)this._statisticsPerPass[e]=new yie;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new mie(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=Object(c.a)(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=Object(c.a)(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=h.a.clamp(Object(c.a)(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=Object(c.a)(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84),this._initialClippingPlanesOriginMatrix=Me.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=Object(c.a)(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=Object(c.a)(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=Object(c.a)(e.preloadWhenHidden,!1),this.preloadFlightDestinations=Object(c.a)(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=Object(c.a)(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=Object(c.a)(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=Object(c.a)(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=Object(c.a)(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=Object(c.a)(e.foveatedInterpolationCallback,h.a.lerp),this.foveatedTimeDelay=Object(c.a)(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=Object(c.a)(e.shadows,TB.ENABLED),this.show=Object(c.a)(e.show,!0),this.colorBlendMode=fV.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new v$(e.pointCloudShading),this._pointCloudEyeDomeLighting=new y$,this.loadProgress=new un.a,this.allTilesLoaded=new un.a,this.initialTilesLoaded=new un.a,this.tileLoad=new un.a,this.tileUnload=new un.a,this.tileFailed=new un.a,this.tileVisible=new un.a,this.skipLevelOfDetail=Object(c.a)(e.skipLevelOfDetail,!1),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=Object(c.a)(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=Object(c.a)(e.skipScreenSpaceErrorFactor,16),this.skipLevels=Object(c.a)(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=Object(c.a)(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=Object(c.a)(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,Object(l.a)(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new zU,this._shouldDestroyImageBasedLighting=!0),this.lightColor=e.lightColor,this.backFaceCulling=Object(c.a)(e.backFaceCulling,!0),this._enableShowOutline=Object(c.a)(e.enableShowOutline,!0),this.showOutline=Object(c.a)(e.showOutline,!0),this.outlineColor=Object(c.a)(e.outlineColor,sp.BLACK),this.splitDirection=Object(c.a)(e.splitDirection,IW.NONE),this._projectTo2D=Object(c.a)(e.projectTo2D,!1),this.debugFreezeFrame=Object(c.a)(e.debugFreezeFrame,!1),this.debugColorizeTiles=Object(c.a)(e.debugColorizeTiles,!1),this._enableDebugWireframe=Object(c.a)(e.enableDebugWireframe,!1),this.debugWireframe=Object(c.a)(e.debugWireframe,!1),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=Object(c.a)(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=Object(c.a)(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=Object(c.a)(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=Object(c.a)(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=Object(c.a)(e.debugShowMemoryUsage,!1),this.debugShowUrl=Object(c.a)(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader,this.enableModelExperimental=Object(c.a)(e.enableModelExperimental,qb.enableModelExperimental);let t=Object(c.a)(e.featureIdLabel,"featureId_0");"number"==typeof t&&(t="featureId_"+t),this._featureIdLabel=t;let n=Object(c.a)(e.instanceFeatureIdLabel,"instanceFeatureId_0");"number"==typeof n&&(n="instanceFeatureId_"+n),this._instanceFeatureIdLabel=n,this._schemaLoader=void 0;const i=this;let r;this._readyPromise=Promise.resolve(e.url).then((function(e){let t;return r=Tt.a.createIfNeeded(e),i._resource=r,i._credits=r.credits,"json"===r.extension?t=r.getBaseUri(!0):r.isDataUri&&(t=""),i._url=r.url,i._basePath=t,Tie.loadJson(r)})).then((function(e){if(!i.isDestroyed())return function(e,t){const n=zX(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t;let i;if(Object(l.a)(n.schemaUri)){const t=e._resource.getDerivedResource({url:n.schemaUri});i=bJ.loadSchema({resource:t})}else{if(!Object(l.a)(n.schema))return Promise.resolve(t);i=bJ.loadSchema({schema:n.schema})}return e._schemaLoader=i,i.promise.then((function(i){return e._metadataExtension=new aie({schema:i.schema,metadataJson:n}),t}))}(i,e)})).then((function(t){if(i.isDestroyed())return;i._root=i.loadTileset(r,t);const n=Object(l.a)(t.asset.gltfUpAxis)?HU.fromName(t.asset.gltfUpAxis):HU.Y,o=Object(c.a)(e.modelUpAxis,n),a=Object(c.a)(e.modelForwardAxis,HU.X),s=t.asset;i._asset=s,i._properties=t.properties,i._geometricError=t.geometricError,i._extensionsUsed=t.extensionsUsed,i._extensions=t.extensions,i._modelUpAxis=o,i._modelForwardAxis=a,i._extras=t.extras;const u=s.extras;if(Object(l.a)(u)&&Object(l.a)(u.cesium)&&Object(l.a)(u.cesium.credits)){const e=u.cesium.credits;let t=i._credits;Object(l.a)(t)||(t=[],i._credits=t);for(let n=0;n<e.length;++n){const r=e[n];t.push(new ln(r.html,i._showCreditsOnScreen))}}const h=i._root.createBoundingVolume(t.root.boundingVolume,Me.IDENTITY).boundingSphere.center,d=i._ellipsoid.cartesianToCartographic(h);return Object(l.a)(d)&&d.height>nn._defaultMinTerrainHeight&&(i._initialClippingPlanesOriginMatrix=ca.eastNorthUpToFixedFrame(h)),i._clippingPlanesOriginMatrix=Me.clone(i._initialClippingPlanesOriginMatrix),i}))}function Cie(e,t,n,i){if(Object(l.a)(n.implicitTiling)||zX(n,"3DTILES_implicit_tiling")){const r=new Oie(t,n,e.schema),o=new wie({subdivisionScheme:r.subdivisionScheme,subtreeLevels:r.subtreeLevels,level:0,x:0,y:0,z:0}),a=r.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,s=!0,c=Object(Zf.a)(n,s);c.contents=[{uri:a}],delete c.content,delete c.extensions;const l=new eie(e,t,c,i);return l.implicitTileset=r,l.implicitCoordinates=o,l}return new eie(e,t,n,i)}wie.fromMortonIndex=function(e,t,n,i){let r;return e===HX.OCTREE?(r=AE.decode3D(i,Eie),new wie({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=AE.decode2D(i,Eie),new wie({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))},wie.fromTileIndex=function(e,t,n){let i,r,o;return e===HX.OCTREE?(i=Math.floor(h.a.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(h.a.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),wie.fromMortonIndex(e,t,i,o)},Object.defineProperties(Tie.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){if(!this.ready)throw new u.a("The tileset is not loaded.  Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._asset}},extensions:{get:function(){if(!this.ready)throw new u.a("The tileset is not loaded.  Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Fq.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){if(!this.ready)throw new u.a("The tileset is not loaded.  Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._properties}},ready:{get:function(){return Object(l.a)(this._root)}},readyPromise:{get:function(){return this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return ll("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(Object(l.a)(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(Object(l.a)(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){s.a.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMemoryUsage=e}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){s.a.defined("pointCloudShading",e),this._pointCloudShading=e}},root:{get:function(){if(!this.ready)throw new u.a("The tileset is not loaded.  Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._root}},boundingSphere:{get:function(){if(!this.ready)throw new u.a("The tileset is not loaded.  Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=Me.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){const e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return Object(l.a)(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(Me.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):Me.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){s.a.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),s.a.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){s.a.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),s.a.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){if(!this.ready)throw new u.a("The tileset is not loaded.  Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){s.a.typeOf.object("imageBasedLighting",this._imageBasedLighting),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){"number"==typeof e&&(e="featureId_"+e),s.a.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){"number"==typeof e&&(e="instanceFeatureId_"+e),s.a.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}}),Tie.loadJson=function(e){return Tt.a.createIfNeeded(e).fetchJson()},Tie.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},Tie.prototype.loadTileset=function(e,t,n){const i=t.asset;if(!Object(l.a)(i))throw new ye.a("Tileset must have an asset property.");if("0.0"!==i.version&&"1.0"!==i.version&&"1.1"!==i.version)throw new ye.a("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");Object(l.a)(t.extensionsRequired)&&Tie.checkSupportedExtensions(t.extensionsRequired);const r=this._statistics,o=i.tilesetVersion;Object(l.a)(o)&&(this._basePath+="?v="+o,(e=e.clone()).setQueryParameters({v:o}));const a=Cie(this,e,t.root,n);Object(l.a)(n)&&(n.children.push(a),a._depth=n._depth+1);const s=[];for(s.push(a);s.length>0;){const t=s.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&t.refine===wZ.ADD;const n=t._header.children;if(Object(l.a)(n)){const i=n.length;for(let r=0;r<i;++r){const i=Cie(this,e,n[r],t);t.children.push(i),i._depth=t._depth+1,s.push(i)}}this._cullWithChildrenBounds&&lie.checkChildrenWithinParent(t)}return a};const xie=new O,Sie=new R,Iie=new Me,Pie=new O,Die=new O,Rie=new O;function jie(e,t){if(t.hasEmptyContent)return;const n=e._statistics,i=t.contentExpired,r=t.requestContent();r>0?n.numberOfAttemptedRequests+=r:(i&&(t.hasTilesetContent||t.hasImplicitContent?function(e,t){const n=t,i=Uie;i.push(t);for(;i.length>0;){const r=(t=i.pop()).children,o=r.length;for(let e=0;e<o;++e)i.push(r[e]);t!==n&&(Hie(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(function(e,t){return function(){e._processingQueue.push(t),++e._statistics.numberOfTilesProcessing}}(e,t)).catch((function(e){})),t.contentReadyPromise.then(function(e,t){return function(n){--e._statistics.numberOfTilesProcessing,Object(l.a)(n)&&(t.hasTilesetContent||t.hasImplicitContent||(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(t)),e.tileLoad.raiseEvent(t))}}(e,t)).catch(function(e,t){return function(n){if(t._contentState!==bee.FAILED)return;const i=t._contentResource.url,r=Object(l.a)(n.message)?n.message:n.toString();e.tileFailed.numberOfListeners>0?e.tileFailed.raiseEvent({url:i,message:r}):(console.log("A 3D tile failed to load: "+i),console.log("Error: "+r))}}(e,t)))}function Mie(e,t){return e._priority-t._priority}Tie.prototype.postPassesUpdate=function(e){this.ready&&(!function(e,t){const n=e._requestedTilesInFlight;let i=0;const r=n.length;for(let e=0;e<r;++e){const r=n[e],o=t.frameNumber-r._touchedFrame>=1;r._contentState===bee.LOADING?o?(r.cancelRequests(),++i):i>0&&(n[e-i]=r):++i}n.length-=i}(this,e),function(e,t){const n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing;yie.clone(n,i);const c=r!==a||o!==s;c&&t.afterRender.push((function(){e.loadProgress.raiseEvent(r,o)}));e._tilesLoaded=0===n.numberOfPendingRequests&&0===n.numberOfTilesProcessing&&0===n.numberOfAttemptedRequests,c&&e._tilesLoaded&&(t.afterRender.push((function(){e.allTilesLoaded.raiseEvent()})),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push((function(){e.initialTilesLoaded.raiseEvent()}))))}(this,e),this._cache.unloadTiles(this,Vie),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)},Tie.prototype.prePassesUpdate=function(e){if(!this.ready)return;!function(e,t){!function(e){const t=e._processingQueue,n=t.length;let i=0;for(let e=0;e<n;++e){const n=t[e];n._contentState===bee.PROCESSING?i>0&&(t[e-i]=n):++i}t.length-=i}(e);const n=e._processingQueue,i=n.length;for(let r=0;r<i;++r)n[r].process(e,t)}(this,e);const t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,Object(l.a)(t)&&t.enabled&&t.update(e),Object(l.a)(this._loadTimestamp)||(this._loadTimestamp=tr.clone(e.time)),this._timeSinceLoad=Math.max(1e3*tr.secondsDifference(e.time,this._loadTimestamp),0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!Object(l.a)(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive,this.dynamicScreenSpaceError&&function(e,t){let n,i,r,o,a;const s=t.camera,c=e._root,l=c.contentBoundingVolume;if(l instanceof Ute)n=O.normalize(s.positionWC,xie),i=s.directionWC,r=s.positionCartographic.height,o=l.minimumHeight,a=l.maximumHeight;else{const e=Me.inverseTransformation(c.computedTransform,Iie),u=t.mapProjection.ellipsoid,h=l.boundingVolume,d=Me.multiplyByPoint(e,h.center,Pie);if(O.magnitude(d)>u.minimumRadius){const e=R.fromCartesian(d,u,Sie);n=O.normalize(s.positionWC,xie),i=s.directionWC,r=s.positionCartographic.height,o=0,a=2*e.height}else{const t=Me.multiplyByPoint(e,s.positionWC,Die);if(n=O.UNIT_Z,i=Me.multiplyByPointAsVector(e,s.directionWC,Rie),i=O.normalize(i,i),r=t.z,l instanceof jne){const e=c._header.boundingVolume.box[11];o=d.z-e,a=d.z+e}else if(l instanceof Ene){const e=h.radius;o=d.z-e,a=d.z+e}}}const u=o+(a-o)*e.dynamicScreenSpaceErrorHeightFalloff,d=a,f=h.a.clamp((r-u)/(d-u),0,1);let p=1-Math.abs(O.dot(i,n));p*=1-f;let m=e.dynamicScreenSpaceErrorDensity;m*=p,e._dynamicScreenSpaceErrorComputedDensity=m}(this,e),e.newFrame&&this._cache.reset()};const Lie=new O,Nie={maximumFractionDigits:3};function Bie(e){const t=e/1048576;return t<1?t.toLocaleString(void 0,Nie):Math.round(t).toLocaleString()}function Fie(e){const t=e.boundingVolume.boundingVolume,n=t.halfAxes,i=t.radius;let r=O.clone(t.center,Lie);if(Object(l.a)(n))r.x+=.75*(n[0]+n[3]+n[6]),r.y+=.75*(n[1]+n[4]+n[7]),r.z+=.75*(n[2]+n[5]+n[8]);else if(Object(l.a)(i)){let e=O.normalize(t.center,Lie);e=O.multiplyByScalar(e,.75*i,Lie),r=O.add(e,t.center,Lie)}return r}function zie(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+="\nGeometric error: "+e.geometricError,r++),t.debugShowRenderingStatistics){i+="\nCommands: "+e.commandsLength,r++;e.content.pointsLength>0&&(i+="\nPoints: "+e.content.pointsLength,r++);e.content.trianglesLength>0&&(i+="\nTriangles: "+e.content.trianglesLength,r++),i+="\nFeatures: "+e.content.featuresLength,r++}if(t.debugShowMemoryUsage&&(i+="\nTexture Memory: "+Bie(e.content.texturesByteLength),i+="\nGeometry Memory: "+Bie(e.content.geometryByteLength),r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+="\nUrls:";const t=e.content.innerContentUrls;for(let e=0;e<t.length;e++)i+="\n- "+t[e];r+=t.length}else i+="\nUrl: "+e._contentHeader.uri,r++;const o={text:i.substring(1),position:n,font:19-r+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function kie(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;const i=n.isRender,r=e._statistics,o=t.commandList,a=o.length,s=e._selectedTiles,c=s.length,u=e._emptyTiles,h=u.length,d=e.tileVisible;let f,p;const m=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&c>0;e._backfaceCommands.length=0,m&&(Object(l.a)(e._stencilClearCommand)||(e._stencilClearCommand=new UU({stencil:0,pass:KR.CESIUM_3D_TILE,renderState:vj.fromCache({stencilMask:qF.SKIP_LOD_MASK})})),o.push(e._stencilClearCommand));const g=o.length;for(f=0;f<c;++f)p=s[f],i&&d.raiseEvent(p),p.update(e,t,n),r.incrementSelectionCounts(p.content),++r.selected;for(f=0;f<h;++f)p=u[f],p.update(e,t,n);let _=o.length-g;if(e._backfaceCommands.trim(),m){const t=e._backfaceCommands.values,n=t.length;for(o.length+=n,f=_-1;f>=0;--f)o[g+n+f]=o[g+f];for(f=0;f<n;++f)o[g+f]=t[f]}_=o.length-a,r.numberOfCommands=_,i&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&_>0&&e._pointCloudEyeDomeLighting.update(t,a,e.pointCloudShading,e.boundingSphere),i&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(Object(l.a)(e._tileDebugLabels)||(e._tileDebugLabels=new m1),function(e,t){let n,i;const r=e._selectedTiles,o=r.length,a=e._emptyTiles,s=a.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(Object(l.a)(e.debugPickedTile)){const t=Object(l.a)(e.debugPickPosition)?e.debugPickPosition:Fie(e.debugPickedTile);zie(e.debugPickedTile,e,t).pixelOffset=new Vt(15,-15)}}else{for(n=0;n<o;++n)i=r[n],zie(i,e,Fie(i));for(n=0;n<s;++n)i=a[n],(i.hasTilesetContent||i.hasImplicitContent)&&zie(i,e,Fie(i))}e._tileDebugLabels.update(t)}(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}const Uie=[];function Vie(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Hie(e,t){e._cache.unloadTile(e,t,Vie),t.destroy()}function Gie(e,t,n,i){if(t.mode===AB.MORPHING)return!1;if(!e.ready)return!1;const r=e._statistics;r.clear();const o=i.isRender;++e._updatedVisibilityFrame,function(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}(e),function(e,t){t.frameNumber===e._updatedModelMatrixFrame&&Object(l.a)(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!Me.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=Me.clone(e.modelMatrix,e._previousModelMatrix)))}(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;const a=i.traversal.selectTiles(e,t);if(i.requestTiles&&function(e,t){const n=e._requestedTiles,i=n.length;n.sort(Mie);for(let t=0;t<i;++t)jie(e,n[t])}(e),kie(e,t,i),yie.clone(r,n),o){const n=e._credits;if(Object(l.a)(n)&&0!==r.selected){const i=n.length;for(let r=0;r<i;++r){const i=n[r];i.showOnScreen=e._showCreditsOnScreen,t.creditDisplay.addCredit(i)}}}return a}Tie.prototype.trimLoadedTiles=function(){this._cache.trim()},Tie.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)},Tie.prototype.updateForPass=function(e,t){s.a.typeOf.object("frameState",e),s.a.typeOf.object("tilesetPassState",t);const n=t.pass;if(n===ute.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===ute.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===ute.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;const i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;const a=ute.getPassOptions(n),l=a.ignoreCommands,u=Object(c.a)(t.commandList,i),h=u.length;e.commandList=u,e.camera=Object(c.a)(t.camera,r),e.cullingVolume=Object(c.a)(t.cullingVolume,o);const d=this._statisticsPerPass[n];(this.show||l)&&(this._pass=n,t.ready=Gie(this,e,d,a)),l&&(u.length=h),e.commandList=i,e.camera=r,e.cullingVolume=o},Tie.prototype.hasExtension=function(e){return!!Object(l.a)(this._extensionsUsed)&&this._extensionsUsed.indexOf(e)>-1},Tie.prototype.isDestroyed=function(){return!1},Tie.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),Object(l.a)(this._schemaLoader)&&bJ.unload(this._schemaLoader),Object(l.a)(this._root)){const e=Uie;for(e.push(this._root);e.length>0;){const t=e.pop();t.destroy();const n=t.children,i=n.length;for(let t=0;t<i;++t)e.push(n[t])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,sc(this)},Tie.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0},Tie.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!Tie.supportedExtensions[e[t]])throw new ye.a("Unsupported 3D Tiles Extension: "+e[t])};var qie=Tie;const Wie=new Me;function Yie(e,t){if(!Object(l.a)(e))throw new u.a("scene is required.");if(!Object(l.a)(t))throw new u.a("entityCollection is required.");t.collectionChanged.addEventListener(Yie.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Tl,this._onCollectionChanged(t,t.values,[],[])}function Xie(e,t,n,i){const r=n[t.id];Object(l.a)(r)&&(i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}function Kie(e,t,n){e.readyPromise.catch((function(e){console.error(e),n[t.id].loadFail=!0}))}Yie.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){const o=t[r],a=o._tileset;let s,c=n[o.id];const u=o.isShowing&&o.isAvailable(e)&&JP.getValueOrDefault(a._show,e,!0);let h;if(u&&(h=o.computeModelMatrix(e,Wie),s=Tt.a.createIfNeeded(JP.getValueOrUndefined(a._uri,e))),!u){Object(l.a)(c)&&(c.tilesetPrimitive.show=!1);continue}let d=Object(l.a)(c)?c.tilesetPrimitive:void 0;Object(l.a)(d)&&s.url===c.url||(Object(l.a)(d)&&(i.removeAndDestroy(d),delete n[o.id]),d=new qie({url:s}),d.id=o,i.add(d),c={tilesetPrimitive:d,url:s.url,loadFail:!1},n[o.id]=c,Kie(d,o,n)),d.show=!0,Object(l.a)(h)&&(d.modelMatrix=h),d.maximumScreenSpaceError=JP.getValueOrDefault(a.maximumScreenSpaceError,e,d.maximumScreenSpaceError)}return!0},Yie.prototype.isDestroyed=function(){return!1},Yie.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Yie.prototype._onCollectionChanged,this);const e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Xie(this,e[i],t,n);return sc(this)},Yie.prototype.getBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("entity is required.");if(!Object(l.a)(t))throw new u.a("result is required.");const n=this._tilesetHash[e.id];if(!Object(l.a)(n)||n.loadFail)return XP.FAILED;const i=n.tilesetPrimitive;return Object(l.a)(i)&&i.show?i.ready?(At.clone(i.boundingSphere,t),XP.DONE):XP.PENDING:XP.FAILED},Yie.prototype._onCollectionChanged=function(e,t,n,i){let r,o;const a=this._entitiesToVisualize,s=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],Object(l.a)(o._tileset)&&a.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],Object(l.a)(o._tileset)?a.set(o.id,o):(Xie(this,o,s,c),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Xie(this,o,s,c),a.remove(o.id)};var Jie=Yie;const Zie=sp.WHITE,$ie=sp.BLACK,Qie=new Vt(2,2);function ere(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(ere.prototype,{isConstant:{get:function(){return JP.isConstant(this._evenColor)&&JP.isConstant(this._oddColor)&&JP.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:VP("evenColor"),oddColor:VP("oddColor"),repeat:VP("repeat")}),ere.prototype.getType=function(e){return"Checkerboard"},ere.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.lightColor=JP.getValueOrClonedDefault(this._evenColor,e,Zie,t.lightColor),t.darkColor=JP.getValueOrClonedDefault(this._oddColor,e,$ie,t.darkColor),t.repeat=JP.getValueOrDefault(this._repeat,e,Qie),t},ere.prototype.equals=function(e){return this===e||e instanceof ere&&JP.equals(this._evenColor,e._evenColor)&&JP.equals(this._oddColor,e._oddColor)&&JP.equals(this._repeat,e._repeat)};var tre=ere;const nre={id:void 0};function ire(e){if(e._firing)e._refire=!0;else if(0===e._suspendCount){const t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(0!==i.length||0!==t.length||0!==n.length){e._firing=!0;do{e._refire=!1;const r=t.values.slice(0),o=n.values.slice(0),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,a)}while(e._refire);e._firing=!1}}}function rre(e){this._owner=e,this._entities=new Tl,this._addedEntities=new Tl,this._removedEntities=new Tl,this._changedEntities=new Tl,this._suspendCount=0,this._collectionChanged=new un.a,this._id=fy(),this._show=!0,this._firing=!1,this._refire=!1}rre.prototype.suspendEvents=function(){this._suspendCount++},rre.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new u.a("resumeEvents can not be called before suspendEvents.");this._suspendCount--,ire(this)},Object.defineProperties(rre.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");if(e===this._show)return;let t;this.suspendEvents();const n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){const e=n[t],r=i[t];e!==r.isShowing&&r.definitionChanged.raiseEvent(r,"isShowing",r.isShowing,e)}this.resumeEvents()}},owner:{get:function(){return this._owner}}}),rre.prototype.computeAvailability=function(){let e=JA.MAXIMUM_VALUE,t=JA.MINIMUM_VALUE;const n=this._entities.values;for(let i=0,r=n.length;i<r;i++){const r=n[i].availability;if(Object(l.a)(r)){const n=r.start,i=r.stop;tr.lessThan(n,e)&&!n.equals(JA.MINIMUM_VALUE)&&(e=n),tr.greaterThan(i,t)&&!i.equals(JA.MAXIMUM_VALUE)&&(t=i)}}return JA.MAXIMUM_VALUE.equals(e)&&(e=JA.MINIMUM_VALUE),JA.MINIMUM_VALUE.equals(t)&&(t=JA.MAXIMUM_VALUE),new YA({start:e,stop:t})},rre.prototype.add=function(e){if(!Object(l.a)(e))throw new u.a("entity is required.");e instanceof Yk||(e=new Yk(e));const t=e.id,n=this._entities;if(n.contains(t))throw new ye.a(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(rre.prototype._onEntityDefinitionChanged,this),ire(this),e},rre.prototype.remove=function(e){return!!Object(l.a)(e)&&this.removeById(e.id)},rre.prototype.contains=function(e){if(!Object(l.a)(e))throw new u.a("entity is required");return this._entities.get(e.id)===e},rre.prototype.removeById=function(e){if(!Object(l.a)(e))return!1;const t=this._entities.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,t),this._changedEntities.remove(e)),this._entities.remove(e),t.definitionChanged.removeEventListener(rre.prototype._onEntityDefinitionChanged,this),ire(this),!0)},rre.prototype.removeAll=function(){const e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let e=0;e<t;e++){const t=n[e],o=t.id,a=i.get(o);Object(l.a)(a)||(t.definitionChanged.removeEventListener(rre.prototype._onEntityDefinitionChanged,this),r.set(o,t))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),ire(this)},rre.prototype.getById=function(e){if(!Object(l.a)(e))throw new u.a("id is required.");return this._entities.get(e)},rre.prototype.getOrCreateEntity=function(e){if(!Object(l.a)(e))throw new u.a("id is required.");let t=this._entities.get(e);return Object(l.a)(t)||(nre.id=e,t=new Yk(nre),this.add(t)),t},rre.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),ire(this)};var ore=rre;const are={id:void 0},sre=new Array(2);function cre(e){const t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function lre(e,t,n,i){sre[0]=n,sre[1]=i.id,t[JSON.stringify(sre)]=i.definitionChanged.addEventListener(dre.prototype._onDefinitionChanged,e)}function ure(e,t,n,i){sre[0]=n,sre[1]=i.id;const r=JSON.stringify(sre);t[r](),t[r]=void 0}function hre(e){if(e._shouldRecomposite=!0,0!==e._suspendCount)return;const t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length;let o,a,s,c,u;const h=e._composite,d=new ore(e),f=e._eventHash;let p;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(dre.prototype._onCollectionChanged,e),s=u.values,p=u.id,c=s.length-1;c>-1;c--)a=s[c],ure(0,f,p,a);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(dre.prototype._onCollectionChanged,e),s=u.values,p=u.id,c=s.length-1;c>-1;c--){a=s[c],lre(e,f,p,a);let t=d.getById(a.id);Object(l.a)(t)||(t=h.getById(a.id),Object(l.a)(t)?cre(t):(are.id=a.id,t=new Yk(are)),d.add(t)),t.merge(a)}e._collectionsCopy=t.slice(0),h.suspendEvents(),h.removeAll();const m=d.values;for(o=0;o<m.length;o++)h.add(m[o]);h.resumeEvents()}function dre(e,t){this._owner=t,this._composite=new ore(this),this._suspendCount=0,this._collections=Object(l.a)(e)?e.slice():[],this._collectionsCopy=[],this._id=fy(),this._eventHash={},hre(this),this._shouldRecomposite=!1}function fre(e,t){if(!Object(l.a)(t))throw new u.a("collection is required.");const n=e.indexOf(t);if(-1===n)throw new u.a("collection is not in this composite.");return n}function pre(e,t,n){const i=e._collections;if((t=h.a.clamp(t,0,i.length-1))===(n=h.a.clamp(n,0,i.length-1)))return;const r=i[t];i[t]=i[n],i[n]=r,hre(e)}Object.defineProperties(dre.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),dre.prototype.addCollection=function(e,t){const n=Object(l.a)(t);if(!Object(l.a)(e))throw new u.a("collection is required.");if(n){if(t<0)throw new u.a("index must be greater than or equal to zero.");if(t>this._collections.length)throw new u.a("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),hre(this)},dre.prototype.removeCollection=function(e){const t=this._collections.indexOf(e);return-1!==t&&(this._collections.splice(t,1),hre(this),!0)},dre.prototype.removeAllCollections=function(){this._collections.length=0,hre(this)},dre.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},dre.prototype.contains=function(e){return this._composite.contains(e)},dre.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},dre.prototype.getCollection=function(e){if(!Object(l.a)(e))throw new u.a("index is required.","index");return this._collections[e]},dre.prototype.getCollectionsLength=function(){return this._collections.length},dre.prototype.raiseCollection=function(e){const t=fre(this._collections,e);pre(this,t,t+1)},dre.prototype.lowerCollection=function(e){const t=fre(this._collections,e);pre(this,t,t-1)},dre.prototype.raiseCollectionToTop=function(e){const t=fre(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),hre(this))},dre.prototype.lowerCollectionToBottom=function(e){const t=fre(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),hre(this))},dre.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},dre.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new u.a("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(hre(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},dre.prototype.computeAvailability=function(){return this._composite.computeAvailability()},dre.prototype.getById=function(e){return this._composite.getById(e)},dre.prototype._onCollectionChanged=function(e,t,n){const i=this._collectionsCopy,r=i.length,o=this._composite;let a,s,c,u;o.suspendEvents();const h=n.length,d=this._eventHash,f=e.id;for(a=0;a<h;a++){const e=n[a];ure(0,d,f,e);const t=e.id;for(s=r-1;s>=0;s--)c=i[s].getById(t),Object(l.a)(c)&&(Object(l.a)(u)||(u=o.getById(t),cre(u)),u.merge(c));Object(l.a)(u)||o.removeById(t),u=void 0}const p=t.length;for(a=0;a<p;a++){const e=t[a];lre(this,d,f,e);const n=e.id;for(s=r-1;s>=0;s--)c=i[s].getById(n),Object(l.a)(c)&&(Object(l.a)(u)||(u=o.getById(n),Object(l.a)(u)?cre(u):(are.id=n,u=new Yk(are),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()},dre.prototype._onDefinitionChanged=function(e,t,n,i){const r=this._collections,o=this._composite,a=r.length,s=e.id,c=o.getById(s);let u=c[t];const h=!Object(l.a)(u);let d=!0;for(let n=a-1;n>=0;n--){const i=r[n].getById(e.id);if(Object(l.a)(i)){const e=i[t];if(Object(l.a)(e)){if(d){if(d=!1,!Object(l.a)(e.merge)||!Object(l.a)(e.clone)){u=e;break}u=e.clone(u)}u.merge(e)}}}h&&-1===c.propertyNames.indexOf(t)&&c.addProperty(t),c[t]=u};var mre=dre;function gre(){this._eventHelper=new Gb,this._definitionChanged=new un.a,this._intervals=new YI,this._intervals.changedEvent.addEventListener(gre.prototype._intervalsChanged,this)}Object.defineProperties(gre.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),gre.prototype.getValue=function(e,t){if(!Object(l.a)(e))throw new u.a("time is required");const n=this._intervals.findDataForIntervalContainingDate(e);if(Object(l.a)(n))return n.getValue(e,t)},gre.prototype.equals=function(e){return this===e||e instanceof gre&&this._intervals.equals(e._intervals,JP.equals)},gre.prototype._intervalsChanged=function(){!function(e,t,n,i){function r(){n.raiseEvent(e)}const o=[];t.removeAll();const a=i.length;for(let e=0;e<a;e++){const n=i.get(e);Object(l.a)(n.data)&&-1===o.indexOf(n.data)&&t.add(n.data.definitionChanged,r)}}(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var _re=gre;function yre(){this._definitionChanged=new un.a,this._composite=new _re,this._composite.definitionChanged.addEventListener(yre.prototype._raiseDefinitionChanged,this)}Object.defineProperties(yre.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),yre.prototype.getType=function(e){if(!Object(l.a)(e))throw new u.a("time is required");const t=this._composite._intervals.findDataForIntervalContainingDate(e);if(Object(l.a)(t))return t.getType(e)},yre.prototype.getValue=function(e,t){if(!Object(l.a)(e))throw new u.a("time is required");const n=this._composite._intervals.findDataForIntervalContainingDate(e);if(Object(l.a)(n))return n.getValue(e,t)},yre.prototype.equals=function(e){return this===e||e instanceof yre&&this._composite.equals(e._composite,JP.equals)},yre.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var bre=yre;function vre(e){this._referenceFrame=Object(c.a)(e,Hx.FIXED),this._definitionChanged=new un.a,this._composite=new _re,this._composite.definitionChanged.addEventListener(vre.prototype._raiseDefinitionChanged,this)}Object.defineProperties(vre.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),vre.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Hx.FIXED,t)},vre.prototype.getValueInReferenceFrame=function(e,t,n){if(!Object(l.a)(e))throw new u.a("time is required.");if(!Object(l.a)(t))throw new u.a("referenceFrame is required.");const i=this._composite._intervals.findDataForIntervalContainingDate(e);if(Object(l.a)(i))return i.getValueInReferenceFrame(e,t,n)},vre.prototype.equals=function(e){return this===e||e instanceof vre&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,JP.equals)},vre.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ore=vre;const wre=new kP(0);function Are(e){iU.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}Object(l.a)(Object.create)&&(Are.prototype=Object.create(iU.prototype),Are.prototype.constructor=Are),Object.defineProperties(Are.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),Are.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!Object(l.a)(t.height)&&!Object(l.a)(t.extrudedHeight)&&mz.isSupported(this._scene)},Are.prototype._getIsClosed=function(e){const t=e.height,n=e.extrudedHeight;return 0===t||Object(l.a)(n)&&n!==t},Are.prototype._computeCenter=u.a.throwInstantiationError,Are.prototype._onEntityPropertyChanged=function(e,t,n,i){if(iU.prototype._onEntityPropertyChanged.call(this,e,t,n,i),-1===this._observedPropertyNames.indexOf(t))return;const r=this._entity[this._geometryPropertyName];if(!Object(l.a)(r))return;Object(l.a)(r.zIndex)&&(Object(l.a)(r.height)||Object(l.a)(r.extrudedHeight))&&cl(cl.geometryZIndex),this._zIndex=Object(c.a)(r.zIndex,wre),Object(l.a)(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);const o=r.heightReference,a=r.extrudedHeightReference;if(Object(l.a)(o)||Object(l.a)(a)){const e=new oU(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new lU(this._scene,e,o,a)}},Are.prototype.destroy=function(){Object(l.a)(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),iU.prototype.destroy.call(this)},Are.getGeometryHeight=function(e,t){if(s.a.defined("heightReference",t),Object(l.a)(e))return t!==qP.CLAMP_TO_GROUND?e:0;t!==qP.NONE&&cl(cl.geometryHeightReference)},Are.getGeometryExtrudedHeight=function(e,t){if(s.a.defined("extrudedHeightReference",t),Object(l.a)(e))return t!==qP.CLAMP_TO_GROUND?e:Are.CLAMP_TO_GROUND;t!==qP.NONE&&cl(cl.geometryExtrudedHeightReference)},Are.CLAMP_TO_GROUND="clamp",Are.computeGeometryOffsetAttribute=function(e,t,n,i){Object(l.a)(e)&&Object(l.a)(t)||(t=qP.NONE),Object(l.a)(n)&&Object(l.a)(i)||(i=qP.NONE);let r=0;return t!==qP.NONE&&r++,i===qP.RELATIVE_TO_GROUND&&r++,2===r?eu.ALL:1===r?eu.TOP:void 0};var Ere=Are;const Tre=new sp,Cre=O.ZERO,xre=new O,Sre=new Be;function Ire(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Pre(e,t){Ere.call(this,{entity:e,scene:t,geometryOptions:new Ire(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function Dre(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(Pre.prototype=Object.create(Ere.prototype),Pre.prototype.constructor=Pre),Pre.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nb.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,Tre)),Object(l.a)(t)||(t=sp.WHITE),i.color=lp.fromColor(t)}return Object(l.a)(this._options.offsetAttribute)&&(i.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,Cre,xre))),new Ph({id:t,geometry:new ry(this._options),attributes:i})},Pre.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,Tre),r={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return Object(l.a)(this._options.offsetAttribute)&&(r.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,Cre,xre))),new Ph({id:t,geometry:new dy(this._options),attributes:r})},Pre.prototype._computeCenter=function(e,t){const n=JP.getValueOrUndefined(this._entity.corridor.positions,e);if(Object(l.a)(n)&&0!==n.length)return O.clone(n[Math.floor(n.length/2)],t)},Pre.prototype._isHidden=function(e,t){return!Object(l.a)(t.positions)||!Object(l.a)(t.width)||iU.prototype._isHidden.call(this,e,t)},Pre.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!JP.isConstant(t.height)||!JP.isConstant(t.extrudedHeight)||!JP.isConstant(t.granularity)||!JP.isConstant(t.width)||!JP.isConstant(t.outlineWidth)||!JP.isConstant(t.cornerType)||!JP.isConstant(t.zIndex)||this._onTerrain&&!JP.isConstant(this._materialProperty)&&!(this._materialProperty instanceof NR)},Pre.prototype._setStaticOptions=function(e,t){let n=JP.getValueOrUndefined(t.height,JA.MINIMUM_VALUE);const i=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE);let r=JP.getValueOrUndefined(t.extrudedHeight,JA.MINIMUM_VALUE);const o=JP.getValueOrDefault(t.extrudedHeightReference,JA.MINIMUM_VALUE,qP.NONE);Object(l.a)(r)&&!Object(l.a)(n)&&(n=0);const a=this._options;a.vertexFormat=this._materialProperty instanceof NR?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(JA.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(JA.MINIMUM_VALUE),a.granularity=JP.getValueOrUndefined(t.granularity,JA.MINIMUM_VALUE),a.cornerType=JP.getValueOrUndefined(t.cornerType,JA.MINIMUM_VALUE),a.offsetAttribute=Ere.computeGeometryOffsetAttribute(n,i,r,o),a.height=Ere.getGeometryHeight(n,i),r=Ere.getGeometryExtrudedHeight(r,o),r===Ere.CLAMP_TO_GROUND&&(r=nn.getMinimumMaximumHeights(ry.computeRectangle(a,Sre)).minimumTerrainHeight),a.extrudedHeight=r},Pre.DynamicGeometryUpdater=Dre,Object(l.a)(Object.create)&&(Dre.prototype=Object.create(bz.prototype),Dre.prototype.constructor=Dre),Dre.prototype._isHidden=function(e,t,n){const i=this._options;return!Object(l.a)(i.positions)||!Object(l.a)(i.width)||bz.prototype._isHidden.call(this,e,t,n)},Dre.prototype._setOptions=function(e,t,n){const i=this._options;let r=JP.getValueOrUndefined(t.height,n);const o=JP.getValueOrDefault(t.heightReference,n,qP.NONE);let a=JP.getValueOrUndefined(t.extrudedHeight,n);const s=JP.getValueOrDefault(t.extrudedHeightReference,n,qP.NONE);Object(l.a)(a)&&!Object(l.a)(r)&&(r=0),i.positions=JP.getValueOrUndefined(t.positions,n),i.width=JP.getValueOrUndefined(t.width,n),i.granularity=JP.getValueOrUndefined(t.granularity,n),i.cornerType=JP.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Ere.computeGeometryOffsetAttribute(r,o,a,s),i.height=Ere.getGeometryHeight(r,o),a=Ere.getGeometryExtrudedHeight(a,s),a===Ere.CLAMP_TO_GROUND&&(a=nn.getMinimumMaximumHeights(ry.computeRectangle(i,Sre)).minimumTerrainHeight),i.extrudedHeight=a};var Rre=Pre;function jre(){u.a.throwInstantiationError()}Object.defineProperties(jre.prototype,{name:{get:u.a.throwInstantiationError},clock:{get:u.a.throwInstantiationError},entities:{get:u.a.throwInstantiationError},isLoading:{get:u.a.throwInstantiationError},changedEvent:{get:u.a.throwInstantiationError},errorEvent:{get:u.a.throwInstantiationError},loadingEvent:{get:u.a.throwInstantiationError},show:{get:u.a.throwInstantiationError},clustering:{get:u.a.throwInstantiationError}}),jre.prototype.update=function(e){u.a.throwInstantiationError()},jre.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Mre=jre;function Lre(e,t){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),Object(l.a)(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new u.a("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;if(Object(l.a)(n)){if(n.far<=n.near)throw new u.a("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=TE.clone(n)}if(Object(l.a)(i)){if(i.far<=i.near)throw new u.a("scaleByDistance.far must be greater than scaleByDistance.near.");i=TE.clone(i)}if(Object(l.a)(r)){if(r.far<=r.near)throw new u.a("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=eb.clone(r)}this._show=Object(c.a)(e.show,!0),this._position=O.clone(Object(c.a)(e.position,O.ZERO)),this._actualPosition=O.clone(this._position),this._color=sp.clone(Object(c.a)(e.color,sp.WHITE)),this._outlineColor=sp.clone(Object(c.a)(e.outlineColor,sp.TRANSPARENT)),this._outlineWidth=Object(c.a)(e.outlineWidth,0),this._pixelSize=Object(c.a)(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=Object(c.a)(e.disableDepthTestDistance,0),this._id=e.id,this._collection=Object(c.a)(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}const Nre=Lre.SHOW_INDEX=0,Bre=Lre.POSITION_INDEX=1,Fre=Lre.COLOR_INDEX=2,zre=Lre.OUTLINE_COLOR_INDEX=3,kre=Lre.OUTLINE_WIDTH_INDEX=4,Ure=Lre.PIXEL_SIZE_INDEX=5,Vre=Lre.SCALE_BY_DISTANCE_INDEX=6,Hre=Lre.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Gre=Lre.DISTANCE_DISPLAY_CONDITION_INDEX=8,qre=Lre.DISABLE_DEPTH_DISTANCE_INDEX=9;function Wre(e,t){const n=e._pointPrimitiveCollection;Object(l.a)(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Lre.NUMBER_OF_PROPERTIES=10,Object.defineProperties(Lre.prototype,{show:{get:function(){return this._show},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._show!==e&&(this._show=e,Wre(this,Nre))}},position:{get:function(){return this._position},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._position;O.equals(t,e)||(O.clone(e,t),O.clone(e,this._actualPosition),Wre(this,Bre))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far distance must be greater than near distance.");const t=this._scaleByDistance;TE.equals(t,e)||(this._scaleByDistance=TE.clone(e,t),Wre(this,Vre))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far distance must be greater than near distance.");const t=this._translucencyByDistance;TE.equals(t,e)||(this._translucencyByDistance=TE.clone(e,t),Wre(this,Hre))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._pixelSize!==e&&(this._pixelSize=e,Wre(this,Ure))}},color:{get:function(){return this._color},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._color;sp.equals(t,e)||(sp.clone(e,t),Wre(this,Fre))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");const t=this._outlineColor;sp.equals(t,e)||(sp.clone(e,t),Wre(this,zre))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Wre(this,kre))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(Object(l.a)(e)&&e.far<=e.near)throw new u.a("far must be greater than near");eb.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=eb.clone(e,this._distanceDisplayCondition),Wre(this,Gre))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!Object(l.a)(e)||e<0)throw new u.a("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,Wre(this,qre)}}},id:{get:function(){return this._id},set:function(e){this._id=e,Object(l.a)(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Wre(this,Nre))}}}),Lre.prototype.getPickId=function(e){return Object(l.a)(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},Lre.prototype._getActualPosition=function(){return this._actualPosition},Lre.prototype._setActualPosition=function(e){O.clone(e,this._actualPosition),Wre(this,Bre)};const Yre=new _e;Lre._computeActualPosition=function(e,t,n){return t.mode===AB.SCENE3D?e:(Me.multiplyByPoint(n,e,Yre),iQ.computeActualWgs84Position(t,Yre))};const Xre=new _e;Lre._computeScreenSpacePosition=function(e,t,n,i){const r=Me.multiplyByVector(e,_e.fromElements(t.x,t.y,t.z,1,Xre),Xre);return iQ.wgs84ToWindowCoordinates(n,r,i)},Lre.prototype.computeScreenSpacePosition=function(e,t){const n=this._pointPrimitiveCollection;if(Object(l.a)(t)||(t=new Vt),!Object(l.a)(n))throw new u.a("PointPrimitive must be in a collection.");if(!Object(l.a)(e))throw new u.a("scene is required.");const i=n.modelMatrix,r=Lre._computeScreenSpacePosition(i,this._actualPosition,e,t);if(Object(l.a)(r))return r.y=e.canvas.clientHeight-r.y,r},Lre.getScreenSpaceBoundingBox=function(e,t,n){const i=e.pixelSize,r=.5*i,o=t.x-r,a=t.y-r,s=i,c=i;return Object(l.a)(n)||(n=new Nl),n.x=o,n.y=a,n.width=s,n.height=c,n},Lre.prototype.equals=function(e){return this===e||Object(l.a)(e)&&this._id===e._id&&O.equals(this._position,e._position)&&sp.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&sp.equals(this._outlineColor,e._outlineColor)&&TE.equals(this._scaleByDistance,e._scaleByDistance)&&TE.equals(this._translucencyByDistance,e._translucencyByDistance)&&eb.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},Lre.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Kre=Lre,Jre="varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\n\nvoid main()\n{\n    // The distance in UV space from this fragment to the center of the point, at most 0.5.\n    float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n    // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.\n    float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n    float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n    float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\n\n    vec4 color = mix(v_outlineColor, v_color, innerAlpha);\n    color.a *= wholeAlpha;\n\n// Fully transparent parts of the billboard are not pickable.\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\n    if (color.a < 0.005)   // matches 0/255 and 1/255\n    {\n        discard;\n    }\n#else\n// The billboard is rendered twice. The opaque pass discards translucent fragments\n// and the translucent pass discards opaque fragments.\n#ifdef OPAQUE\n    if (color.a < 0.995)   // matches < 254/255\n    {\n        discard;\n    }\n#else\n    if (color.a >= 0.995)  // matches 254/255 and 255/255\n    {\n        discard;\n    }\n#endif\n#endif\n\n    gl_FragColor = czm_gammaCorrect(color);\n    czm_writeLogDepth();\n}\n",Zre='uniform float u_maxTotalPointSize;\n\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;                       // color, outlineColor, pick color\nattribute vec4 compressedAttribute1;                       // show, translucency by distance, some free space\nattribute vec4 scaleByDistance;                            // near, nearScale, far, farScale\nattribute vec3 distanceDisplayConditionAndDisableDepth;    // near, far, disableDepthTestDistance\n\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\n\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\n\nvoid main()\n{\n    // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition\n\n    // unpack attributes\n    vec3 positionHigh = positionHighAndSize.xyz;\n    vec3 positionLow = positionLowAndOutline.xyz;\n    float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\n    float totalSize = positionHighAndSize.w + outlineWidthBothSides;\n    float outlinePercent = outlineWidthBothSides / totalSize;\n    // Scale in response to browser-zoom.\n    totalSize *= czm_pixelRatio;\n    // Add padding for anti-aliasing on both sides.\n    totalSize += 3.0;\n\n    float temp = compressedAttribute1.x * SHIFT_RIGHT8;\n    float show = floor(temp);\n\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n    vec4 translucencyByDistance;\n    translucencyByDistance.x = compressedAttribute1.z;\n    translucencyByDistance.z = compressedAttribute1.w;\n\n    translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n\n    temp = compressedAttribute1.y * SHIFT_RIGHT8;\n    translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n\n    ///////////////////////////////////////////////////////////////////////////\n\n    vec4 color;\n    vec4 outlineColor;\n    vec4 pickColor;\n\n    // compressedAttribute0.z => pickColor.rgb\n\n    temp = compressedAttribute0.z * SHIFT_RIGHT8;\n    pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n    pickColor.r = floor(temp);\n\n    // compressedAttribute0.x => color.rgb\n\n    temp = compressedAttribute0.x * SHIFT_RIGHT8;\n    color.b = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    color.g = (temp - floor(temp)) * SHIFT_LEFT8;\n    color.r = floor(temp);\n\n    // compressedAttribute0.y => outlineColor.rgb\n\n    temp = compressedAttribute0.y * SHIFT_RIGHT8;\n    outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\n    temp = floor(temp) * SHIFT_RIGHT8;\n    outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\n    outlineColor.r = floor(temp);\n\n    // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a\n\n    temp = compressedAttribute0.w * SHIFT_RIGHT8;\n    pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\n    pickColor = pickColor / 255.0;\n\n    temp = floor(temp) * SHIFT_RIGHT8;\n    outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\n    outlineColor /= 255.0;\n    color.a = floor(temp);\n    color /= 255.0;\n\n    ///////////////////////////////////////////////////////////////////////////\n\n    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n    vec4 positionEC = czm_modelViewRelativeToEye * p;\n\n    ///////////////////////////////////////////////////////////////////////////\n\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\n    float lengthSq;\n    if (czm_sceneMode == czm_sceneMode2D)\n    {\n        // 2D camera distance is a special case\n        // treat all billboards as flattened to the z=0.0 plane\n        lengthSq = czm_eyeHeight2D.y;\n    }\n    else\n    {\n        lengthSq = dot(positionEC.xyz, positionEC.xyz);\n    }\n#endif\n\n#ifdef EYE_DISTANCE_SCALING\n    totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\n    // Clamp to max point size.\n    totalSize = min(totalSize, u_maxTotalPointSize);\n    // If size is too small, push vertex behind near plane for clipping.\n    // Note that context.minimumAliasedPointSize "will be at most 1.0".\n    if (totalSize < 1.0)\n    {\n        positionEC.xyz = vec3(0.0);\n        totalSize = 1.0;\n    }\n\n    float translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\n    translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\n    // push vertex behind near plane for clipping\n    if (translucency < 0.004)\n    {\n        positionEC.xyz = vec3(0.0);\n    }\n#endif\n\n#ifdef DISTANCE_DISPLAY_CONDITION\n    float nearSq = distanceDisplayConditionAndDisableDepth.x;\n    float farSq = distanceDisplayConditionAndDisableDepth.y;\n    if (lengthSq < nearSq || lengthSq > farSq) {\n        // push vertex behind camera to force it to be clipped\n        positionEC.xyz = vec3(0.0, 0.0, 1.0);\n    }\n#endif\n\n    gl_Position = czm_projection * positionEC;\n    czm_vertexLogDepth();\n\n#ifdef DISABLE_DEPTH_DISTANCE\n    float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\n    if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n    {\n        disableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n    }\n\n    if (disableDepthTestDistance != 0.0)\n    {\n        // Don\'t try to "multiply both sides" by w.  Greater/less-than comparisons won\'t work for negative values of w.\n        float zclip = gl_Position.z / gl_Position.w;\n        bool clipped = (zclip < -1.0 || zclip > 1.0);\n        if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n        {\n            // Position z on the near plane.\n            gl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\n            czm_vertexLogDepth(vec4(czm_currentFrustum.x));\n#endif\n        }\n    }\n#endif\n\n    v_color = color;\n    v_color.a *= translucency * show;\n    v_outlineColor = outlineColor;\n    v_outlineColor.a *= translucency * show;\n\n    v_innerPercent = 1.0 - outlinePercent;\n    v_pixelDistance = 2.0 / totalSize;\n    gl_PointSize = totalSize * show;\n    gl_Position *= show;\n\n    v_pickColor = pickColor;\n}\n';const $re=Kre.SHOW_INDEX,Qre=Kre.POSITION_INDEX,eoe=Kre.COLOR_INDEX,toe=Kre.OUTLINE_COLOR_INDEX,noe=Kre.OUTLINE_WIDTH_INDEX,ioe=Kre.PIXEL_SIZE_INDEX,roe=Kre.SCALE_BY_DISTANCE_INDEX,ooe=Kre.TRANSLUCENCY_BY_DISTANCE_INDEX,aoe=Kre.DISTANCE_DISPLAY_CONDITION_INDEX,soe=Kre.DISABLE_DEPTH_DISTANCE_INDEX,coe=Kre.NUMBER_OF_PROPERTIES,loe={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function uoe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(coe),this._maxPixelSize=1,this._baseVolume=new At,this._baseVolumeWC=new At,this._baseVolume2D=new At,this._boundingVolume=new At,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=Me.clone(Me.IDENTITY),this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.blendOption=Object(c.a)(e.blendOption,IQ.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=AB.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW,KN.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}function hoe(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}function doe(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let e=0,r=0;e<i;++e){const i=n[e];i&&(i._index=r++,t.push(i))}e._pointPrimitives=t}}Object.defineProperties(uoe.prototype,{length:{get:function(){return doe(this),this._pointPrimitives.length}}}),uoe.prototype.add=function(e){const t=new Kre(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},uoe.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},uoe.prototype.removeAll=function(){hoe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},uoe.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},uoe.prototype.contains=function(e){return Object(l.a)(e)&&e._pointPrimitiveCollection===this},uoe.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return doe(this),this._pointPrimitives[e]},uoe.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<coe;++i){const r=0===n[i]?KN.STATIC_DRAW:KN.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};const foe=new Mh;function poe(e,t,n,i){const r=i._index,o=i._getActualPosition();e._mode===AB.SCENE3D&&(At.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Mh.fromCartesian(o,foe);const a=i.pixelSize,s=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);const c=n[loe.positionHighAndSize],l=foe.high;c(r,l.x,l.y,l.z,a);const u=n[loe.positionLowAndOutline],h=foe.low;u(r,h.x,h.y,h.z,s)}function moe(e,t,n,i){const r=i._index,o=i.color,a=i.getPickId(t).color,s=i.outlineColor;let c=sp.floatToByte(o.red),l=sp.floatToByte(o.green),u=sp.floatToByte(o.blue);const h=65536*c+256*l+u;c=sp.floatToByte(s.red),l=sp.floatToByte(s.green),u=sp.floatToByte(s.blue);const d=65536*c+256*l+u;c=sp.floatToByte(a.red),l=sp.floatToByte(a.green),u=sp.floatToByte(a.blue);const f=65536*c+256*l+u,p=65536*sp.floatToByte(o.alpha)+256*sp.floatToByte(s.alpha)+sp.floatToByte(a.alpha);(0,n[loe.compressedAttribute0])(r,h,d,f,p)}function goe(e,t,n,i){const r=i._index;let o=0,a=1,s=1,c=1;const u=i.translucencyByDistance;Object(l.a)(u)&&(o=u.near,a=u.nearValue,s=u.far,c=u.farValue,1===a&&1===c||(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;0===i.color.alpha&&0===i.outlineColor.alpha&&(d=!1),a=h.a.clamp(a,0,1),a=1===a?255:255*a|0;const f=256*(d?1:0)+a;c=h.a.clamp(c,0,1),c=1===c?255:255*c|0;const p=c;(0,n[loe.compressedAttribute1])(r,f,p,o,s)}function _oe(e,t,n,i){const r=i._index,o=n[loe.scaleByDistance];let a=0,s=1,c=1,u=1;const h=i.scaleByDistance;Object(l.a)(h)&&(a=h.near,s=h.nearValue,c=h.far,u=h.farValue,1===s&&1===u||(e._shaderScaleByDistance=!0)),o(r,a,s,c,u)}function yoe(e,t,n,i){const r=i._index,o=n[loe.distanceDisplayConditionAndDisableDepth];let a=0,s=Number.MAX_VALUE;const c=i.distanceDisplayCondition;Object(l.a)(c)&&(a=c.near,s=c.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),o(r,a,s,u)}function boe(e,t,n,i){poe(e,0,n,i),moe(0,t,n,i),goe(e,0,n,i),_oe(e,0,n,i),yoe(e,0,n,i)}function voe(e,t,n,i,r,o){let a;i.mode===AB.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const s=[];for(let e=0;e<n;++e){const n=t[e],c=n.position,u=Kre._computeActualPosition(c,i,r);Object(l.a)(u)&&(n._setActualPosition(u),o?s.push(u):At.expand(a,u,a))}o&&At.fromPoints(s,a)}const Ooe=[];uoe.prototype.update=function(e){if(doe(this),!this.show)return;this._maxTotalPointSize=MD.maximumAliasedPointSize,function(e,t){const n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==AB.SCENE3D&&!Me.equals(o,e.modelMatrix)?(e._mode=n,Me.clone(e.modelMatrix,o),e._createVertexArray=!0,n!==AB.SCENE3D&&n!==AB.SCENE2D&&n!==AB.COLUMBUS_VIEW||voe(e,i,i.length,t,o,!0)):n===AB.MORPHING?voe(e,i,i.length,t,o,!0):n!==AB.SCENE2D&&n!==AB.COLUMBUS_VIEW||voe(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}(this,e);const t=this._pointPrimitives.length,n=this._pointPrimitivesToUpdate,i=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,o=this._createVertexArray;let a;const s=e.context,c=e.passes,u=c.pick;if(o||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let e=0;e<coe;++e)r[e]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),t>0){this._vaf=function(e,t,n){return new L$(e,[{index:loe.positionHighAndSize,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[Qre]},{index:loe.positionLowAndShow,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[Qre]},{index:loe.compressedAttribute0,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[eoe]},{index:loe.compressedAttribute1,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[ooe]},{index:loe.scaleByDistance,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:n[roe]},{index:loe.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:gs.FLOAT,usage:n[aoe]}],t)}(s,t,this._buffersUsage),a=this._vaf.writers;for(let e=0;e<t;++e){const t=this._pointPrimitives[e];t._dirty=!1,boe(this,s,a,t)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(i>0){const e=Ooe;e.length=0,(r[Qre]||r[noe]||r[ioe])&&e.push(poe),(r[eoe]||r[toe])&&e.push(moe),(r[$re]||r[ooe])&&e.push(goe),r[roe]&&e.push(_oe),(r[aoe]||r[soe])&&e.push(yoe);const o=e.length;if(a=this._vaf.writers,i/t>.1){for(let t=0;t<i;++t){const i=n[t];i._dirty=!1;for(let t=0;t<o;++t)e[t](this,s,a,i)}this._vaf.commit()}else{for(let t=0;t<i;++t){const i=n[t];i._dirty=!1;for(let t=0;t<o;++t)e[t](this,s,a,i);this._vaf.subCommit(i._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(i>1.5*t&&(n.length=t),!Object(l.a)(this._vaf)||!Object(l.a)(this._vaf.va))return;let h;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,At.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d=Me.IDENTITY;e.mode===AB.SCENE3D?(d=this.modelMatrix,h=At.clone(this._baseVolumeWC,this._boundingVolume)):h=At.clone(this._baseVolume2D,this._boundingVolume),function(e,t,n){const i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=i}(this,e,h);const f=this._blendOption!==this.blendOption;let p,m,g,_,y,b;this._blendOption=this.blendOption,f&&(this._blendOption===IQ.OPAQUE||this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=vj.fromCache({depthTest:{enabled:!0,func:ps.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===IQ.TRANSLUCENT||this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=vj.fromCache({depthTest:{enabled:!0,func:ps.LEQUAL},depthMask:!1,blending:SD.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance,(f||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(p=new UN({sources:[Zre]}),this._shaderScaleByDistance&&p.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&p.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&p.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&p.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT&&(m=new UN({defines:["OPAQUE"],sources:[Jre]}),this._sp=oM.replaceCache({context:s,shaderProgram:this._sp,vertexShaderSource:p,fragmentShaderSource:m,attributeLocations:loe}),m=new UN({defines:["TRANSLUCENT"],sources:[Jre]}),this._spTranslucent=oM.replaceCache({context:s,shaderProgram:this._spTranslucent,vertexShaderSource:p,fragmentShaderSource:m,attributeLocations:loe})),this._blendOption===IQ.OPAQUE&&(m=new UN({sources:[Jre]}),this._sp=oM.replaceCache({context:s,shaderProgram:this._sp,vertexShaderSource:p,fragmentShaderSource:m,attributeLocations:loe})),this._blendOption===IQ.TRANSLUCENT&&(m=new UN({sources:[Jre]}),this._spTranslucent=oM.replaceCache({context:s,shaderProgram:this._spTranslucent,vertexShaderSource:p,fragmentShaderSource:m,attributeLocations:loe})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);const v=e.commandList;if(c.render||u){const e=this._colorCommands,t=this._blendOption===IQ.OPAQUE,n=this._blendOption===IQ.OPAQUE_AND_TRANSLUCENT;g=this._vaf.va,_=g.length,e.length=_;const i=n?2*_:_;for(b=0;b<i;++b){const i=t||n&&b%2==0;y=e[b],Object(l.a)(y)||(y=e[b]=new XR),y.primitiveType=zl.POINTS,y.pass=i||!n?KR.OPAQUE:KR.TRANSLUCENT,y.owner=this;const r=n?Math.floor(b/2):b;y.boundingVolume=h,y.modelMatrix=d,y.shaderProgram=i?this._sp:this._spTranslucent,y.uniformMap=this._uniforms,y.vertexArray=g[r].va,y.renderState=i?this._rsOpaque:this._rsTranslucent,y.debugShowBoundingVolume=this.debugShowBoundingVolume,y.pickId="v_pickColor",v.push(y)}}},uoe.prototype.isDestroyed=function(){return!1},uoe.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),hoe(this._pointPrimitives),sc(this)};var woe=uoe;function Aoe(e,t,n,i,r,o){if(r-i<=n)return;const a=i+r>>1;!function e(t,n,i,r,o,a){for(;o>r;){if(o-r>600){const s=o-r+1,c=i-r+1,l=Math.log(s),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1),d=Math.max(r,Math.floor(i-c*u/s+h)),f=Math.min(o,Math.floor(i+(s-c)*u/s+h));e(t,n,i,d,f,a)}const s=n[2*i+a];let c=r,l=o;for(Eoe(t,n,r,i),n[2*o+a]>s&&Eoe(t,n,r,o);c<l;){for(Eoe(t,n,c,l),c++,l--;n[2*c+a]<s;)c++;for(;n[2*l+a]>s;)l--}n[2*r+a]===s?Eoe(t,n,r,l):(l++,Eoe(t,n,l,o)),l<=i&&(r=l+1),i<=l&&(o=l-1)}}(e,t,a,i,r,o%2),Aoe(e,t,n,i,a-1,o+1),Aoe(e,t,n,a+1,r,o+1)}function Eoe(e,t,n,i){Toe(e,n,i),Toe(t,2*n,2*i),Toe(t,2*n+1,2*i+1)}function Toe(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Coe(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}const xoe=e=>e[0],Soe=e=>e[1];class Ioe{constructor(e,t=xoe,n=Soe,i=64,r=Float64Array){this.nodeSize=i,this.points=e;const o=e.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(e.length),s=this.coords=new r(2*e.length);for(let i=0;i<e.length;i++)a[i]=i,s[2*i]=t(e[i]),s[2*i+1]=n(e[i]);Aoe(a,s,i,0,a.length-1,0)}range(e,t,n,i){return function(e,t,n,i,r,o,a){const s=[0,e.length-1,0],c=[];let l,u;for(;s.length;){const h=s.pop(),d=s.pop(),f=s.pop();if(d-f<=a){for(let a=f;a<=d;a++)l=t[2*a],u=t[2*a+1],l>=n&&l<=r&&u>=i&&u<=o&&c.push(e[a]);continue}const p=Math.floor((f+d)/2);l=t[2*p],u=t[2*p+1],l>=n&&l<=r&&u>=i&&u<=o&&c.push(e[p]);const m=(h+1)%2;(0===h?n<=l:i<=u)&&(s.push(f),s.push(p-1),s.push(m)),(0===h?r>=l:o>=u)&&(s.push(p+1),s.push(d),s.push(m))}return c}(this.ids,this.coords,e,t,n,i,this.nodeSize)}within(e,t,n){return function(e,t,n,i,r,o){const a=[0,e.length-1,0],s=[],c=r*r;for(;a.length;){const l=a.pop(),u=a.pop(),h=a.pop();if(u-h<=o){for(let r=h;r<=u;r++)Coe(t[2*r],t[2*r+1],n,i)<=c&&s.push(e[r]);continue}const d=Math.floor((h+u)/2),f=t[2*d],p=t[2*d+1];Coe(f,p,n,i)<=c&&s.push(e[d]);const m=(l+1)%2;(0===l?n-r<=f:i-r<=p)&&(a.push(h),a.push(d-1),a.push(m)),(0===l?n+r>=f:i+r>=p)&&(a.push(d+1),a.push(u),a.push(m))}return s}(this.ids,this.coords,e,t,n,this.nodeSize)}}function Poe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._enabled=Object(c.a)(e.enabled,!1),this._pixelRange=Object(c.a)(e.pixelRange,80),this._minimumClusterSize=Object(c.a)(e.minimumClusterSize,2),this._clusterBillboards=Object(c.a)(e.clusterBillboards,!0),this._clusterLabels=Object(c.a)(e.clusterLabels,!0),this._clusterPoints=Object(c.a)(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new un.a,this.show=Object(c.a)(e.show,!0)}function Doe(e){return e.coord.x}function Roe(e){return e.coord.y}function joe(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}const Moe=new Nl;function Loe(e,t,n,i,r){if(Object(l.a)(e._labelCollection)&&i._clusterLabels?r=J0.getScreenSpaceBoundingBox(e,t,r):Object(l.a)(e._billboardCollection)&&i._clusterBillboards?r=SQ.getScreenSpaceBoundingBox(e,t,r):Object(l.a)(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Kre.getScreenSpaceBoundingBox(e,t,r)),joe(r,n),i._clusterLabels&&!Object(l.a)(e._labelCollection)&&Object(l.a)(e.id)&&Foe(i,e.id.id)&&Object(l.a)(e.id._label)){const o=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(o),s=J0.getScreenSpaceBoundingBox(a,t,Moe);joe(s,n),r=Nl.union(r,s,r)}return r}function Noe(e,t){if(e.clusterShow=!0,!Object(l.a)(e._labelCollection)&&Object(l.a)(e.id)&&Foe(t,e.id.id)&&Object(l.a)(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex;t._labelCollection.get(n).clusterShow=!0}}function Boe(e,t,n,i){const r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function Foe(e,t){return Object(l.a)(e)&&Object(l.a)(e._collectionIndicesByEntity[t])&&Object(l.a)(e._collectionIndicesByEntity[t].labelIndex)}function zoe(e,t,n,i,r){if(!Object(l.a)(e))return;const o=e.length;for(let a=0;a<o;++a){const o=e.get(a);if(o.clusterShow=!1,!o.show||r._scene.mode===AB.SCENE3D&&!i.isPointVisible(o.position))continue;const s=r._clusterLabels&&Object(l.a)(o._labelCollection),c=r._clusterBillboards&&Object(l.a)(o.id._billboard),u=r._clusterPoints&&Object(l.a)(o.id._point);if(s&&(u||c))continue;const h=o.computeScreenSpacePosition(n);Object(l.a)(h)&&t.push({index:a,collection:e,clustered:!1,coord:h})}}const koe=new Nl,Uoe=new Nl,Voe=new Nl;function Hoe(e,t,n,i){return function(r){let o=this[e];Object(l.a)(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a,s,c=this._collectionIndicesByEntity[r.id];if(Object(l.a)(c)||(c=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),Object(l.a)(o)&&Object(l.a)(c[i]))return o.get(c[i]);Object(l.a)(o)||(o=this[e]=new t({scene:this._scene}));const u=this[n];u.length>0?(a=u.pop(),s=o.get(a)):(s=o.add(),a=o.length-1),c[i]=a;const h=this;return Promise.resolve().then((function(){h._clusterDirty=!0})),s}}function Goe(e,t){const n=e._collectionIndicesByEntity[t];Object(l.a)(n.billboardIndex)||Object(l.a)(n.labelIndex)||Object(l.a)(n.pointIndex)||delete e._collectionIndicesByEntity[t]}function qoe(e){if(!Object(l.a)(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}Poe.prototype._initialize=function(e){this._scene=e;const t=(n=this,function(e){if(Object(l.a)(e)&&e<.05||!n.enabled)return;const t=n._scene,i=n._labelCollection,r=n._billboardCollection,o=n._pointCollection;if(!Object(l.a)(i)&&!Object(l.a)(r)&&!Object(l.a)(o)||!n._clusterBillboards&&!n._clusterLabels&&!n._clusterPoints)return;let a=n._clusterLabelCollection,s=n._clusterBillboardCollection,c=n._clusterPointCollection;Object(l.a)(a)?a.removeAll():a=n._clusterLabelCollection=new m1({scene:t}),Object(l.a)(s)?s.removeAll():s=n._clusterBillboardCollection=new x0({scene:t}),Object(l.a)(c)?c.removeAll():c=n._clusterPointCollection=new woe;const u=n._pixelRange,h=n._minimumClusterSize,d=n._previousClusters,f=[],p=n._previousHeight,m=t.camera.positionCartographic.height,g=t.mapProjection.ellipsoid,_=t.camera.positionWC,y=new Rn(g,_),b=[];let v,w,A,E,T,C,x,S,I,P,D,R;n._clusterLabels&&zoe(i,b,t,y,n),n._clusterBillboards&&zoe(r,b,t,y,n),n._clusterPoints&&zoe(o,b,t,y,n);const j=new Ioe(b,Doe,Roe,64,Int32Array);if(m<p)for(A=d.length,v=0;v<A;++v){const e=d[v];if(!y.isPointVisible(e.position))continue;const i=SQ._computeScreenSpacePosition(Me.IDENTITY,e.position,O.ZERO,Vt.ZERO,t);if(!Object(l.a)(i))continue;const r=1-m/p;let o=e.width=e.width*r,a=e.height=e.height*r;o=Math.max(o,e.minimumWidth),a=Math.max(a,e.minimumHeight);const s=i.x-.5*o,c=i.y-.5*a,u=i.x+o,g=i.y+a;for(T=j.range(s,c,u,g),C=T.length,P=0,I=[],w=0;w<C;++w)x=T[w],S=b[x],S.clustered||(++P,D=S.collection,R=S.index,I.push(D.get(R).id));if(P>=h)for(Boe(e.position,P,I,n),f.push(e),w=0;w<C;++w)b[T[w]].clustered=!0}for(A=b.length,v=0;v<A;++v){const e=b[v];if(e.clustered)continue;e.clustered=!0,D=e.collection,R=e.index;const t=D.get(R);E=Loe(t,e.coord,u,n,koe);const i=Nl.clone(E,Uoe);T=j.range(E.x,E.y,E.x+E.width,E.y+E.height),C=T.length;const r=O.clone(t.position);for(P=1,I=[t.id],w=0;w<C;++w)if(x=T[w],S=b[x],!S.clustered){const e=S.collection.get(S.index),t=Loe(e,S.coord,u,n,Voe);O.add(e.position,r,r),Nl.union(i,t,i),++P,I.push(e.id)}if(P>=h){const e=O.multiplyByScalar(r,1/P,r);for(Boe(e,P,I,n),f.push({position:e,width:i.width,height:i.height,minimumWidth:E.width,minimumHeight:E.height}),w=0;w<C;++w)b[T[w]].clustered=!0}else Noe(t,n)}0===a.length&&(a.destroy(),n._clusterLabelCollection=void 0),0===s.length&&(s.destroy(),n._clusterBillboardCollection=void 0),0===c.length&&(c.destroy(),n._clusterPointCollection=void 0),n._previousClusters=f,n._previousHeight=m});var n;this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(Poe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),Poe.prototype.getLabel=Hoe("_labelCollection",m1,"_unusedLabelIndices","labelIndex"),Poe.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!Object(l.a)(this._labelCollection)||!Object(l.a)(t)||!Object(l.a)(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,Goe(this,e.id);const i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0},Poe.prototype.getBillboard=Hoe("_billboardCollection",x0,"_unusedBillboardIndices","billboardIndex"),Poe.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!Object(l.a)(this._billboardCollection)||!Object(l.a)(t)||!Object(l.a)(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,Goe(this,e.id);const i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0},Poe.prototype.getPoint=Hoe("_pointCollection",woe,"_unusedPointIndices","pointIndex"),Poe.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!Object(l.a)(this._pointCollection)||!Object(l.a)(t)||!Object(l.a)(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,Goe(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0},Poe.prototype.update=function(e){if(!this.show)return;let t;var n;Object(l.a)(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),Object(l.a)(this._billboardCollection)&&this._billboardCollection.length>0&&!Object(l.a)(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,(n=this).enabled||(Object(l.a)(n._clusterLabelCollection)&&n._clusterLabelCollection.destroy(),Object(l.a)(n._clusterBillboardCollection)&&n._clusterBillboardCollection.destroy(),Object(l.a)(n._clusterPointCollection)&&n._clusterPointCollection.destroy(),n._clusterLabelCollection=void 0,n._clusterBillboardCollection=void 0,n._clusterPointCollection=void 0,qoe(n._labelCollection),qoe(n._billboardCollection),qoe(n._pointCollection)),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),Object(l.a)(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),Object(l.a)(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),Object(l.a)(this._clusterPointCollection)&&this._clusterPointCollection.update(e),Object(l.a)(this._labelCollection)&&this._labelCollection.update(e),Object(l.a)(this._billboardCollection)&&this._billboardCollection.update(e),Object(l.a)(this._pointCollection)&&this._pointCollection.update(e)},Poe.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),Object(l.a)(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Woe=Poe;function Yoe(e){this._name=e,this._clock=void 0,this._changed=new un.a,this._error=new un.a,this._isLoading=!1,this._loading=new un.a,this._entityCollection=new ore(this),this._entityCluster=new Woe}Object.defineProperties(Yoe.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Mre.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!Object(l.a)(e))throw new u.a("value must be defined.");this._entityCluster=e}}}),Yoe.prototype.update=function(e){return!0};var Xoe=Yoe;const Koe=O.ZERO,Joe=new O,Zoe=new O,$oe=new sp;function Qoe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function eae(e,t){iU.call(this,{entity:e,scene:t,geometryOptions:new Qoe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function tae(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(eae.prototype=Object.create(iU.prototype),eae.prototype.constructor=eae),Object.defineProperties(eae.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),eae.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i=new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o={show:i,distanceDisplayCondition:nb.fromDistanceDisplayCondition(r),color:void 0,offset:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,$oe)),Object(l.a)(t)||(t=sp.WHITE),o.color=lp.fromColor(t)}return Object(l.a)(this._options.offsetAttribute)&&(o.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,Koe,Joe))),new Ph({id:t,geometry:new Uy(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:o})},eae.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,$oe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r),offset:void 0};return Object(l.a)(this._options.offsetAttribute)&&(o.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,Koe,Joe))),new Ph({id:t,geometry:new qy(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:o})},eae.prototype._computeCenter=function(e,t){return JP.getValueOrUndefined(this._entity.position,e,t)},eae.prototype._isHidden=function(e,t){return!Object(l.a)(e.position)||!Object(l.a)(t.length)||!Object(l.a)(t.topRadius)||!Object(l.a)(t.bottomRadius)||iU.prototype._isHidden.call(this,e,t)},eae.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&JP.isConstant(e.orientation)&&t.length.isConstant&&t.topRadius.isConstant&&t.bottomRadius.isConstant&&JP.isConstant(t.slices)&&JP.isConstant(t.outlineWidth)&&JP.isConstant(t.numberOfVerticalLines))},eae.prototype._setStaticOptions=function(e,t){const n=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof NR?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(JA.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(JA.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(JA.MINIMUM_VALUE),i.slices=JP.getValueOrUndefined(t.slices,JA.MINIMUM_VALUE),i.numberOfVerticalLines=JP.getValueOrUndefined(t.numberOfVerticalLines,JA.MINIMUM_VALUE),i.offsetAttribute=n!==qP.NONE?eu.ALL:void 0},eae.prototype._onEntityPropertyChanged=uU,eae.DynamicGeometryUpdater=tae,Object(l.a)(Object.create)&&(tae.prototype=Object.create(bz.prototype),tae.prototype.constructor=tae),tae.prototype._isHidden=function(e,t,n){const i=this._options,r=JP.getValueOrUndefined(e.position,n,Zoe);return!Object(l.a)(r)||!Object(l.a)(i.length)||!Object(l.a)(i.topRadius)||!Object(l.a)(i.bottomRadius)||bz.prototype._isHidden.call(this,e,t,n)},tae.prototype._setOptions=function(e,t,n){const i=JP.getValueOrDefault(t.heightReference,n,qP.NONE),r=this._options;r.length=JP.getValueOrUndefined(t.length,n),r.topRadius=JP.getValueOrUndefined(t.topRadius,n),r.bottomRadius=JP.getValueOrUndefined(t.bottomRadius,n),r.slices=JP.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=JP.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==qP.NONE?eu.ALL:void 0};var nae=eae;function iae(){this._definitionChanged=new un.a,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(iae.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:nk("startTime"),stopTime:nk("stopTime"),currentTime:nk("currentTime"),clockRange:nk("clockRange"),clockStep:nk("clockStep"),multiplier:nk("multiplier")}),iae.prototype.clone=function(e){return Object(l.a)(e)||(e=new iae),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},iae.prototype.equals=function(e){return this===e||Object(l.a)(e)&&tr.equals(this.startTime,e.startTime)&&tr.equals(this.stopTime,e.stopTime)&&tr.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},iae.prototype.merge=function(e){if(!Object(l.a)(e))throw new u.a("source is required.");this.startTime=Object(c.a)(this.startTime,e.startTime),this.stopTime=Object(c.a)(this.stopTime,e.stopTime),this.currentTime=Object(c.a)(this.currentTime,e.currentTime),this.clockRange=Object(c.a)(this.clockRange,e.clockRange),this.clockStep=Object(c.a)(this.clockStep,e.clockStep),this.multiplier=Object(c.a)(this.multiplier,e.multiplier)},iae.prototype.getValue=function(e){return Object(l.a)(e)||(e=new Jf),e.startTime=Object(c.a)(this.startTime,e.startTime),e.stopTime=Object(c.a)(this.stopTime,e.stopTime),e.currentTime=Object(c.a)(this.currentTime,e.currentTime),e.clockRange=Object(c.a)(this.clockRange,e.clockRange),e.multiplier=Object(c.a)(this.multiplier,e.multiplier),e.clockStep=Object(c.a)(this.clockStep,e.clockStep),e};var rae=iae;const oae=sp.WHITE,aae=new Vt(8,8),sae=new Vt(0,0),cae=new Vt(1,1);function lae(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(lae.prototype,{isConstant:{get:function(){return JP.isConstant(this._color)&&JP.isConstant(this._cellAlpha)&&JP.isConstant(this._lineCount)&&JP.isConstant(this._lineThickness)&&JP.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:VP("color"),cellAlpha:VP("cellAlpha"),lineCount:VP("lineCount"),lineThickness:VP("lineThickness"),lineOffset:VP("lineOffset")}),lae.prototype.getType=function(e){return"Grid"},lae.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.color=JP.getValueOrClonedDefault(this._color,e,oae,t.color),t.cellAlpha=JP.getValueOrDefault(this._cellAlpha,e,.1),t.lineCount=JP.getValueOrClonedDefault(this._lineCount,e,aae,t.lineCount),t.lineThickness=JP.getValueOrClonedDefault(this._lineThickness,e,cae,t.lineThickness),t.lineOffset=JP.getValueOrClonedDefault(this._lineOffset,e,sae,t.lineOffset),t},lae.prototype.equals=function(e){return this===e||e instanceof lae&&JP.equals(this._color,e._color)&&JP.equals(this._cellAlpha,e._cellAlpha)&&JP.equals(this._lineCount,e._lineCount)&&JP.equals(this._lineThickness,e._lineThickness)&&JP.equals(this._lineOffset,e._lineOffset)};var uae=lae;function hae(e){this._definitionChanged=new un.a,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(hae.prototype,{isConstant:{get:function(){return JP.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:VP("color")}),hae.prototype.getType=function(e){return"PolylineArrow"},hae.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.color=JP.getValueOrClonedDefault(this._color,e,sp.WHITE,t.color),t},hae.prototype.equals=function(e){return this===e||e instanceof hae&&JP.equals(this._color,e._color)};var dae=hae;const fae=sp.WHITE,pae=sp.TRANSPARENT;function mae(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(mae.prototype,{isConstant:{get:function(){return JP.isConstant(this._color)&&JP.isConstant(this._gapColor)&&JP.isConstant(this._dashLength)&&JP.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:VP("color"),gapColor:VP("gapColor"),dashLength:VP("dashLength"),dashPattern:VP("dashPattern")}),mae.prototype.getType=function(e){return"PolylineDash"},mae.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.color=JP.getValueOrClonedDefault(this._color,e,fae,t.color),t.gapColor=JP.getValueOrClonedDefault(this._gapColor,e,pae,t.gapColor),t.dashLength=JP.getValueOrDefault(this._dashLength,e,16,t.dashLength),t.dashPattern=JP.getValueOrDefault(this._dashPattern,e,255,t.dashPattern),t},mae.prototype.equals=function(e){return this===e||e instanceof mae&&JP.equals(this._color,e._color)&&JP.equals(this._gapColor,e._gapColor)&&JP.equals(this._dashLength,e._dashLength)&&JP.equals(this._dashPattern,e._dashPattern)};var gae=mae;const _ae=sp.WHITE;function yae(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(yae.prototype,{isConstant:{get:function(){return JP.isConstant(this._color)&&JP.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:VP("color"),glowPower:VP("glowPower"),taperPower:VP("taperPower")}),yae.prototype.getType=function(e){return"PolylineGlow"},yae.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.color=JP.getValueOrClonedDefault(this._color,e,_ae,t.color),t.glowPower=JP.getValueOrDefault(this._glowPower,e,.25,t.glowPower),t.taperPower=JP.getValueOrDefault(this._taperPower,e,1,t.taperPower),t},yae.prototype.equals=function(e){return this===e||e instanceof yae&&JP.equals(this._color,e._color)&&JP.equals(this._glowPower,e._glowPower)&&JP.equals(this._taperPower,e._taperPower)};var bae=yae;const vae=sp.WHITE,Oae=sp.BLACK;function wae(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(wae.prototype,{isConstant:{get:function(){return JP.isConstant(this._color)&&JP.isConstant(this._outlineColor)&&JP.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:VP("color"),outlineColor:VP("outlineColor"),outlineWidth:VP("outlineWidth")}),wae.prototype.getType=function(e){return"PolylineOutline"},wae.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.color=JP.getValueOrClonedDefault(this._color,e,vae,t.color),t.outlineColor=JP.getValueOrClonedDefault(this._outlineColor,e,Oae,t.outlineColor),t.outlineWidth=JP.getValueOrDefault(this._outlineWidth,e,1),t},wae.prototype.equals=function(e){return this===e||e instanceof wae&&JP.equals(this._color,e._color)&&JP.equals(this._outlineColor,e._outlineColor)&&JP.equals(this._outlineWidth,e._outlineWidth)};var Aae=wae;function Eae(e,t){this._value=void 0,this._definitionChanged=new un.a,this._eventHelper=new Gb,this._referenceFrame=Object(c.a)(t,Hx.FIXED),this.setValue(e)}Object.defineProperties(Eae.prototype,{isConstant:{get:function(){const e=this._value;if(!Object(l.a)(e))return!0;const t=e.length;for(let n=0;n<t;n++)if(!JP.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),Eae.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Hx.FIXED,t)},Eae.prototype.getValueInReferenceFrame=function(e,t,n){if(!Object(l.a)(e))throw new u.a("time is required.");if(!Object(l.a)(t))throw new u.a("referenceFrame is required.");const i=this._value;if(!Object(l.a)(i))return;const r=i.length;Object(l.a)(n)||(n=new Array(r));let o=0,a=0;for(;o<r;){const r=i[o].getValueInReferenceFrame(e,t,n[o]);Object(l.a)(r)&&(n[a]=r,a++),o++}return n.length=a,n},Eae.prototype.setValue=function(e){const t=this._eventHelper;if(t.removeAll(),Object(l.a)(e)){this._value=e.slice();const n=e.length;for(let i=0;i<n;i++){const n=e[i];Object(l.a)(n)&&t.add(n.definitionChanged,Eae.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},Eae.prototype.equals=function(e){return this===e||e instanceof Eae&&this._referenceFrame===e._referenceFrame&&JP.arrayEquals(this._value,e._value)},Eae.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Tae=Eae;function Cae(e){this._value=void 0,this._definitionChanged=new un.a,this._eventHelper=new Gb,this.setValue(e)}Object.defineProperties(Cae.prototype,{isConstant:{get:function(){const e=this._value;if(!Object(l.a)(e))return!0;const t=e.length;for(let n=0;n<t;n++)if(!JP.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),Cae.prototype.getValue=function(e,t){if(!Object(l.a)(e))throw new u.a("time is required.");const n=this._value;if(!Object(l.a)(n))return;const i=n.length;Object(l.a)(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){const n=this._value[r].getValue(e,t[r]);Object(l.a)(n)&&(t[o]=n,o++),r++}return t.length=o,t},Cae.prototype.setValue=function(e){const t=this._eventHelper;if(t.removeAll(),Object(l.a)(e)){this._value=e.slice();const n=e.length;for(let i=0;i<n;i++){const n=e[i];Object(l.a)(n)&&t.add(n.definitionChanged,Cae.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},Cae.prototype.equals=function(e){return this===e||e instanceof Cae&&JP.arrayEquals(this._value,e._value)},Cae.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var xae=Cae;function Sae(e){let t=e._targetProperty;if(!Object(l.a)(t)){let n=e._targetEntity;if(!Object(l.a)(n)){if(n=e._targetCollection.getById(e._targetId),!Object(l.a)(n))return void(e._targetEntity=e._targetProperty=void 0);n.definitionChanged.addEventListener(Iae.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}const i=e._targetPropertyNames;t=e._targetEntity;for(let e=0,n=i.length;e<n&&Object(l.a)(t);++e)t=t[i[e]];e._targetProperty=t}return t}function Iae(e,t,n){if(!Object(l.a)(e))throw new u.a("targetCollection is required.");if(!Object(l.a)(t)||""===t)throw new u.a("targetId is required.");if(!Object(l.a)(n)||0===n.length)throw new u.a("targetPropertyNames is required.");for(let e=0;e<n.length;e++){const t=n[e];if(!Object(l.a)(t)||""===t)throw new u.a("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new un.a,e.collectionChanged.addEventListener(Iae.prototype._onCollectionChanged,this)}Object.defineProperties(Iae.prototype,{isConstant:{get:function(){return JP.isConstant(Sae(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){const e=Sae(this);return Object(l.a)(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Sae(this)}}}),Iae.fromString=function(e,t){if(!Object(l.a)(e))throw new u.a("targetCollection is required.");if(!Object(l.a)(t))throw new u.a("referenceString is required.");let n;const i=[];let r=!0,o=!1,a="";for(let e=0;e<t.length;++e){const s=t.charAt(e);o?(a+=s,o=!1):"\\"===s?o=!0:r&&"#"===s?(n=a,r=!1,a=""):r||"."!==s?a+=s:(i.push(a),a="")}return i.push(a),new Iae(e,n,i)},Iae.prototype.getValue=function(e,t){const n=Sae(this);return Object(l.a)(n)?n.getValue(e,t):void 0},Iae.prototype.getValueInReferenceFrame=function(e,t,n){const i=Sae(this);return Object(l.a)(i)?i.getValueInReferenceFrame(e,t,n):void 0},Iae.prototype.getType=function(e){const t=Sae(this);return Object(l.a)(t)?t.getType(e):void 0},Iae.prototype.equals=function(e){if(this===e)return!0;const t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;const i=this._targetPropertyNames.length;for(let e=0;e<i;e++)if(t[e]!==n[e])return!1;return!0},Iae.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){Object(l.a)(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))},Iae.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;Object(l.a)(i)&&-1!==n.indexOf(i)?(i.definitionChanged.removeEventListener(Iae.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):Object(l.a)(i)||(i=Sae(this),Object(l.a)(i)&&this._definitionChanged.raiseEvent(this))};var Pae=Iae;var Dae={packedLength:1,pack:function(e,t,n){if(!Object(l.a)(e))throw new u.a("value is required");if(!Object(l.a)(t))throw new u.a("array is required");return t[n=Object(c.a)(n,0)]=e,t},unpack:function(e,t,n){if(!Object(l.a)(e))throw new u.a("array is required");return e[t=Object(c.a)(t,0)]},convertPackedArrayForInterpolation:function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("packedArray is required");let r;Object(l.a)(i)||(i=[]),t=Object(c.a)(t,0);for(let o=0,a=(n=Object(c.a)(n,e.length))-t+1;o<a;o++){const n=e[t+o];0===o||Math.abs(r-n)<Math.PI?i[o]=n:i[o]=n-h.a.TWO_PI,r=n}},unpackInterpolationResult:function(e,t,n,i,r){if(!Object(l.a)(e))throw new u.a("array is required");if(!Object(l.a)(t))throw new u.a("sourceArray is required");return(r=e[0])<0?r+h.a.TWO_PI:r}};const Rae={packedLength:1,pack:function(e,t,n){t[n=Object(c.a)(n,0)]=e},unpack:function(e,t,n){return e[t=Object(c.a)(t,0)]}};function jae(e,t,n){let i;const r=e.length,o=n.length,a=r+o;if(e.length=a,r!==t){let n=r-1;for(i=a-1;i>=t;i--)e[i]=e[n--]}for(i=0;i<o;i++)e[t++]=n[i]}function Mae(e,t){return e instanceof tr?e:"string"==typeof e?tr.fromIso8601(e):tr.addSeconds(t,e,new tr)}const Lae=[],Nae=[];function Bae(e,t,n,i,r){let o,a,s,c,u,h,d=0;for(;d<i.length;){u=Mae(i[d],e),s=Si(t,u,tr.compare);let f=0,p=0;if(s<0){for(s=~s,c=s*r,a=void 0,h=t[s];d<i.length&&(u=Mae(i[d],e),!(Object(l.a)(a)&&tr.compare(a,u)>=0||Object(l.a)(h)&&tr.compare(u,h)>=0));){for(Lae[f++]=u,d+=1,o=0;o<r;o++)Nae[p++]=i[d],d+=1;a=u}f>0&&(Nae.length=p,jae(n,c,Nae),Lae.length=f,jae(t,s,Lae))}else{for(o=0;o<r;o++)d++,n[s*r+o]=i[d];d++}}}function Fae(e,t){s.a.defined("type",e);let n=e;n===Number&&(n=Rae);let i,r=n.packedLength,o=Object(c.a)(n.packedInterpolationLength,r),a=0;if(Object(l.a)(t)){const e=t.length;i=new Array(e);for(let n=0;n<e;n++){let e=t[n];e===Number&&(e=Rae);const a=e.packedLength;r+=a,o+=Object(c.a)(e.packedInterpolationLength,a),i[n]=e}a=e}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=iE,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=r,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new un.a,this._derivativeTypes=t,this._innerDerivativeTypes=i,this._inputOrder=a,this._forwardExtrapolationType=Wb.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Wb.NONE,this._backwardExtrapolationDuration=0}function zae(e,t,n){const i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Object.defineProperties(Fae.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),Fae.prototype.getValue=function(e,t){s.a.defined("time",e);const n=this._times,i=n.length;if(0===i)return;let r;const o=this._innerType,a=this._values;let c=Si(n,e,tr.compare);if(c<0){if(c=~c,0===c){const i=n[c];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Wb.NONE||0!==r&&tr.secondsDifference(i,e)>r)return;if(this._backwardExtrapolationType===Wb.HOLD)return o.unpack(a,0,t)}if(c>=i){c=i-1;const s=n[c];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Wb.NONE||0!==r&&tr.secondsDifference(e,s)>r)return;if(this._forwardExtrapolationType===Wb.HOLD)return c=i-1,o.unpack(a,c*o.packedLength,t)}const s=this._xTable,u=this._yTable,h=this._interpolationAlgorithm,d=this._packedInterpolationLength,f=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;const e=Math.min(h.getRequiredDataPoints(this._interpolationDegree,f),i);e!==this._numberOfPoints&&(this._numberOfPoints=e,s.length=e,u.length=e*d)}const p=this._numberOfPoints-1;if(p<1)return;let m=0,g=i-1;if(g-m+1>=p+1){let e=c-(p/2|0)-1;e<m&&(e=m);let t=e+p;t>g&&(t=g,e=t-p,e<m&&(e=m)),m=e,g=t}const _=g-m+1;for(let e=0;e<_;++e)s[e]=tr.secondsDifference(n[m+e],n[g]);if(Object(l.a)(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(a,m,g,u);else{let e=0;const t=this._packedLength;let n=m*t;const i=(g+1)*t;for(;n<i;)u[e]=a[n],n++,e++}const y=tr.secondsDifference(e,n[g]);let b;if(0!==f&&Object(l.a)(h.interpolate)){const e=Math.floor(d/(f+1));b=h.interpolate(y,s,u,e,f,f,this._interpolationResult)}else b=h.interpolateOrderZero(y,s,u,d,this._interpolationResult);return Object(l.a)(o.unpackInterpolationResult)?o.unpackInterpolationResult(b,a,m,g,t):o.unpack(b,0,t)}return o.unpack(a,c*this._packedLength,t)},Fae.prototype.setInterpolationOptions=function(e){if(!Object(l.a)(e))return;let t=!1;const n=e.interpolationAlgorithm,i=e.interpolationDegree;Object(l.a)(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),Object(l.a)(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},Fae.prototype.addSample=function(e,t,n){const i=this._innerDerivativeTypes,r=Object(l.a)(i);s.a.defined("time",e),s.a.defined("value",t),r&&s.a.defined("derivatives",n);const o=this._innerType,a=[];if(a.push(e),o.pack(t,a,a.length),r){const e=i.length;for(let t=0;t<e;t++)i[t].pack(n[t],a,a.length)}Bae(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},Fae.prototype.addSamples=function(e,t,n){const i=this._innerDerivativeTypes,r=Object(l.a)(i);if(s.a.defined("times",e),s.a.defined("values",t),e.length!==t.length)throw new u.a("times and values must be the same length.");if(r&&(!Object(l.a)(n)||n.length!==e.length))throw new u.a("times and derivativeValues must be the same length.");const o=this._innerType,a=e.length,c=[];for(let s=0;s<a;s++)if(c.push(e[s]),o.pack(t[s],c,c.length),r){const e=n[s],t=i.length;for(let n=0;n<t;n++)i[n].pack(e[n],c,c.length)}Bae(void 0,this._times,this._values,c,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},Fae.prototype.addSamplesPackedArray=function(e,t){s.a.defined("packedSamples",e),Bae(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},Fae.prototype.removeSample=function(e){s.a.defined("time",e);const t=Si(this._times,e,tr.compare);return!(t<0)&&(zae(this,t,1),!0)},Fae.prototype.removeSamples=function(e){s.a.defined("timeInterval",e);const t=this._times;let n=Si(t,e.start,tr.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Si(t,e.stop,tr.compare);i<0?i=~i:e.isStopIncluded&&++i,zae(this,n,i-n)},Fae.prototype.equals=function(e){if(this===e)return!0;if(!Object(l.a)(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;const t=this._derivativeTypes,n=Object(l.a)(t),i=e._derivativeTypes;if(n!==Object(l.a)(i))return!1;let r,o;if(n){if(o=t.length,o!==i.length)return!1;for(r=0;r<o;r++)if(t[r]!==i[r])return!1}const a=this._times,s=e._times;if(o=a.length,o!==s.length)return!1;for(r=0;r<o;r++)if(!tr.equals(a[r],s[r]))return!1;const c=this._values,u=e._values;for(o=c.length,r=0;r<o;r++)if(c[r]!==u[r])return!1;return!0},Fae._mergeNewSamples=Bae;var kae=Fae;function Uae(e,t){let n;if((t=Object(c.a)(t,0))>0){n=new Array(t);for(let e=0;e<t;e++)n[e]=O}this._numberOfDerivatives=t,this._property=new kae(O,n),this._definitionChanged=new un.a,this._referenceFrame=Object(c.a)(e,Hx.FIXED),this._property._definitionChanged.addEventListener((function(){this._definitionChanged.raiseEvent(this)}),this)}Object.defineProperties(Uae.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),Uae.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Hx.FIXED,t)},Uae.prototype.getValueInReferenceFrame=function(e,t,n){if(s.a.defined("time",e),s.a.defined("referenceFrame",t),n=this._property.getValue(e,n),Object(l.a)(n))return Jz.convertToReferenceFrame(e,n,this._referenceFrame,t,n)},Uae.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},Uae.prototype.addSample=function(e,t,n){const i=this._numberOfDerivatives;if(i>0&&(!Object(l.a)(n)||n.length!==i))throw new u.a("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)},Uae.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)},Uae.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},Uae.prototype.removeSample=function(e){return this._property.removeSample(e)},Uae.prototype.removeSamples=function(e){this._property.removeSamples(e)},Uae.prototype.equals=function(e){return this===e||e instanceof Uae&&JP.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Vae=Uae;var Hae=Object.freeze({HORIZONTAL:0,VERTICAL:1});const Gae=Hae.HORIZONTAL,qae=sp.WHITE,Wae=sp.BLACK;function Yae(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._definitionChanged=new un.a,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(Yae.prototype,{isConstant:{get:function(){return JP.isConstant(this._orientation)&&JP.isConstant(this._evenColor)&&JP.isConstant(this._oddColor)&&JP.isConstant(this._offset)&&JP.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:VP("orientation"),evenColor:VP("evenColor"),oddColor:VP("oddColor"),offset:VP("offset"),repeat:VP("repeat")}),Yae.prototype.getType=function(e){return"Stripe"},Yae.prototype.getValue=function(e,t){return Object(l.a)(t)||(t={}),t.horizontal=JP.getValueOrDefault(this._orientation,e,Gae)===Hae.HORIZONTAL,t.evenColor=JP.getValueOrClonedDefault(this._evenColor,e,qae,t.evenColor),t.oddColor=JP.getValueOrClonedDefault(this._oddColor,e,Wae,t.oddColor),t.offset=JP.getValueOrDefault(this._offset,e,0),t.repeat=JP.getValueOrDefault(this._repeat,e,1),t},Yae.prototype.equals=function(e){return this===e||e instanceof Yae&&JP.equals(this._orientation,e._orientation)&&JP.equals(this._evenColor,e._evenColor)&&JP.equals(this._oddColor,e._oddColor)&&JP.equals(this._offset,e._offset)&&JP.equals(this._repeat,e._repeat)};var Xae=Yae;function Kae(e){this._definitionChanged=new un.a,this._intervals=new YI,this._intervals.changedEvent.addEventListener(Kae.prototype._intervalsChanged,this),this._referenceFrame=Object(c.a)(e,Hx.FIXED)}Object.defineProperties(Kae.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),Kae.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Hx.FIXED,t)},Kae.prototype.getValueInReferenceFrame=function(e,t,n){if(!Object(l.a)(e))throw new u.a("time is required.");if(!Object(l.a)(t))throw new u.a("referenceFrame is required.");const i=this._intervals.findDataForIntervalContainingDate(e);if(Object(l.a)(i))return Jz.convertToReferenceFrame(e,i,this._referenceFrame,t,n)},Kae.prototype.equals=function(e){return this===e||e instanceof Kae&&this._intervals.equals(e._intervals,JP.equals)&&this._referenceFrame===e._referenceFrame},Kae.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Jae=Kae;function Zae(){this._definitionChanged=new un.a,this._intervals=new YI,this._intervals.changedEvent.addEventListener(Zae.prototype._intervalsChanged,this)}Object.defineProperties(Zae.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),Zae.prototype.getValue=function(e,t){if(!Object(l.a)(e))throw new u.a("time is required");const n=this._intervals.findDataForIntervalContainingDate(e);return Object(l.a)(n)&&"function"==typeof n.clone?n.clone(t):n},Zae.prototype.equals=function(e){return this===e||e instanceof Zae&&this._intervals.equals(e._intervals,JP.equals)},Zae.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var $ae=Zae;function Qae(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new un.a,this._normalize=Object(c.a)(t,!0),this.position=e}Object.defineProperties(Qae.prototype,{isConstant:{get:function(){return JP.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){const t=this._position;t!==e&&(Object(l.a)(t)&&this._subscription(),this._position=e,Object(l.a)(e)&&(this._subscription=e._definitionChanged.addEventListener((function(){this._definitionChanged.raiseEvent(this)}),this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});const ese=new O,tse=new O,nse=new tr;Qae.prototype.getValue=function(e,t){return this._getValue(e,t)},Qae.prototype._getValue=function(e,t,n){if(!Object(l.a)(e))throw new u.a("time is required");Object(l.a)(t)||(t=new O);const i=this._position;if(JP.isConstant(i))return this._normalize?void 0:O.clone(O.ZERO,t);let r=i.getValue(e,ese),o=i.getValue(tr.addSeconds(e,1/60,nse),tse);if(!Object(l.a)(r))return;if(!Object(l.a)(o)&&(o=r,r=i.getValue(tr.addSeconds(e,-1/60,nse),tse),!Object(l.a)(r)))return;if(O.equals(r,o))return this._normalize?void 0:O.clone(O.ZERO,t);Object(l.a)(n)&&r.clone(n);const a=O.subtract(o,r,t);return this._normalize?O.normalize(a,t):O.divideByScalar(a,1/60,t)},Qae.prototype.equals=function(e){return this===e||e instanceof Qae&&JP.equals(this._position,e._position)};var ise=Qae;function rse(e,t){this._velocityVectorProperty=new ise(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new un.a,this.ellipsoid=Object(c.a)(t,H.WGS84);const n=this;this._velocityVectorProperty.definitionChanged.addEventListener((function(){n._definitionChanged.raiseEvent(n)}))}Object.defineProperties(rse.prototype,{isConstant:{get:function(){return JP.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});const ose=new O,ase=new O,sse=new ce;rse.prototype.getValue=function(e,t){const n=this._velocityVectorProperty._getValue(e,ase,ose);if(Object(l.a)(n))return ca.rotationMatrixFromPositionVelocity(ose,n,this._ellipsoid,sse),To.fromRotationMatrix(sse,t)},rse.prototype.equals=function(e){return this===e||e instanceof rse&&JP.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var cse=rse;function lse(){}let use;function hse(e,t){return"#"===t[0]&&(t=use+t),Pae.fromString(e,t)}function dse(e,t,n){if(Object(l.a)(n.reference))return hse(t,n.reference);if(Object(l.a)(n.velocityReference)){const i=hse(t,n.velocityReference);switch(e){case O:case lse:return new ise(i,e===lse);case To:return new cse(i)}}throw new ye.a(JSON.stringify(n)+" is not valid CZML.")}lse.packedLength=O.packedLength,lse.unpack=O.unpack,lse.pack=O.pack;const fse=new O,pse=new PI,mse=new R,gse=new YA,_se=new To;function yse(e,t){const n=Object(c.a)(e.uri,e);return Object(l.a)(t)?t.getDerivedResource({url:n}):Tt.a.createIfNeeded(n)}function bse(e){const t=e.cartesian;if(Object(l.a)(t))return t;const n=e.cartesianVelocity;if(Object(l.a)(n))return n;const i=e.unitCartesian;if(Object(l.a)(i))return i;const r=e.unitSpherical;if(Object(l.a)(r))return function(e){const t=e.length;if(pse.magnitude=1,2===t)return pse.clock=e[0],pse.cone=e[1],O.fromSpherical(pse,fse),[fse.x,fse.y,fse.z];const n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],pse.clock=e[i+1],pse.cone=e[i+2],O.fromSpherical(pse,fse),n[r+1]=fse.x,n[r+2]=fse.y,n[r+3]=fse.z;return n}(r);const o=e.spherical;if(Object(l.a)(o))return function(e){const t=e.length;if(3===t)return pse.clock=e[0],pse.cone=e[1],pse.magnitude=e[2],O.fromSpherical(pse,fse),[fse.x,fse.y,fse.z];const n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],pse.clock=e[i+1],pse.cone=e[i+2],pse.magnitude=e[i+3],O.fromSpherical(pse,fse),n[i+1]=fse.x,n[i+2]=fse.y,n[i+3]=fse.z;return n}(o);const a=e.cartographicRadians;if(Object(l.a)(a))return function(e){const t=e.length;if(3===t)return mse.longitude=e[0],mse.latitude=e[1],mse.height=e[2],H.WGS84.cartographicToCartesian(mse,fse),[fse.x,fse.y,fse.z];const n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],mse.longitude=e[i+1],mse.latitude=e[i+2],mse.height=e[i+3],H.WGS84.cartographicToCartesian(mse,fse),n[i+1]=fse.x,n[i+2]=fse.y,n[i+3]=fse.z;return n}(a);const s=e.cartographicDegrees;if(Object(l.a)(s))return function(e){const t=e.length;if(3===t)return mse.longitude=h.a.toRadians(e[0]),mse.latitude=h.a.toRadians(e[1]),mse.height=e[2],H.WGS84.cartographicToCartesian(mse,fse),[fse.x,fse.y,fse.z];const n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],mse.longitude=h.a.toRadians(e[i+1]),mse.latitude=h.a.toRadians(e[i+2]),mse.height=e[i+3],H.WGS84.cartographicToCartesian(mse,fse),n[i+1]=fse.x,n[i+2]=fse.y,n[i+3]=fse.z;return n}(s);throw new ye.a(JSON.stringify(e)+" is not a valid CZML interval.")}function vse(e,t){O.unpack(e,t,fse),O.normalize(fse,fse),O.pack(fse,e,t)}function Ose(e,t){To.unpack(e,t,_se),To.normalize(_se,_se),To.pack(_se,e,t)}function wse(e){return"boolean"==typeof e?Boolean:"number"==typeof e?Number:"string"==typeof e?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Nl:e.hasOwnProperty("cartesian2")?Vt:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?O:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?lse:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?sp:e.hasOwnProperty("arcType")?vl:e.hasOwnProperty("classificationType")?qN:e.hasOwnProperty("colorBlendMode")?kq:e.hasOwnProperty("cornerType")?Km:e.hasOwnProperty("heightReference")?qP:e.hasOwnProperty("horizontalOrigin")?WP:e.hasOwnProperty("date")?tr:e.hasOwnProperty("labelStyle")?L0:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?TE:e.hasOwnProperty("distanceDisplayCondition")?eb:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?To:e.hasOwnProperty("shadowMode")?TB:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Hae:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?Be:e.hasOwnProperty("uri")?rc.a:e.hasOwnProperty("verticalOrigin")?YP:Object}function Ase(e,t,n){switch(e){case vl:return vl[Object(c.a)(t.arcType,t)];case Array:return t.array;case Boolean:return Object(c.a)(t.boolean,t);case Nl:return t.boundingRectangle;case Vt:return t.cartesian2;case O:return bse(t);case lse:return function(e){const t=bse(e);if(3===t.length)return vse(t,0),t;for(let e=1;e<t.length;e+=4)vse(t,e);return t}(t);case sp:return function(e){let t=e.rgbaf;if(Object(l.a)(t))return t;const n=e.rgba;if(!Object(l.a)(n))return;const i=n.length;if(i===sp.packedLength)return[sp.byteToFloat(n[0]),sp.byteToFloat(n[1]),sp.byteToFloat(n[2]),sp.byteToFloat(n[3])];t=new Array(i);for(let e=0;e<i;e+=5)t[e]=n[e],t[e+1]=sp.byteToFloat(n[e+1]),t[e+2]=sp.byteToFloat(n[e+2]),t[e+3]=sp.byteToFloat(n[e+3]),t[e+4]=sp.byteToFloat(n[e+4]);return t}(t);case qN:return qN[Object(c.a)(t.classificationType,t)];case kq:return kq[Object(c.a)(t.colorBlendMode,t)];case Km:return Km[Object(c.a)(t.cornerType,t)];case qP:return qP[Object(c.a)(t.heightReference,t)];case WP:return WP[Object(c.a)(t.horizontalOrigin,t)];case Image:return yse(t,n);case tr:return tr.fromIso8601(Object(c.a)(t.date,t));case L0:return L0[Object(c.a)(t.labelStyle,t)];case Number:return Object(c.a)(t.number,t);case TE:return t.nearFarScalar;case eb:return t.distanceDisplayCondition;case Object:return Object(c.a)(Object(c.a)(t.object,t.value),t);case To:return function(e){const t=e.unitQuaternion;if(Object(l.a)(t)){if(4===t.length)return Ose(t,0),t;for(let e=1;e<t.length;e+=5)Ose(t,e)}return t}(t);case Dae:return Object(c.a)(t.number,t);case TB:return TB[Object(c.a)(Object(c.a)(t.shadowMode,t.shadows),t)];case String:return Object(c.a)(t.string,t);case Hae:return Hae[Object(c.a)(t.stripeOrientation,t)];case Be:return function(e){let t=e.wsen;if(Object(l.a)(t))return t;const n=e.wsenDegrees;if(!Object(l.a)(n))return;const i=n.length;if(i===Be.packedLength)return[h.a.toRadians(n[0]),h.a.toRadians(n[1]),h.a.toRadians(n[2]),h.a.toRadians(n[3])];t=new Array(i);for(let e=0;e<i;e+=5)t[e]=n[e],t[e+1]=h.a.toRadians(n[e+1]),t[e+2]=h.a.toRadians(n[e+2]),t[e+3]=h.a.toRadians(n[e+3]),t[e+4]=h.a.toRadians(n[e+4]);return t}(t);case rc.a:return yse(t,n);case YP:return YP[Object(c.a)(t.verticalOrigin,t)];default:throw new ye.a(e)}}const Ese={HERMITE:gA,LAGRANGE:tE,LINEAR:iE};function Tse(e,t){const n=e.interpolationAlgorithm,i=e.interpolationDegree;(Object(l.a)(n)||Object(l.a)(i))&&t.setInterpolationOptions({interpolationAlgorithm:Ese[n],interpolationDegree:i});const r=e.forwardExtrapolationType;Object(l.a)(r)&&(t.forwardExtrapolationType=Wb[r]);const o=e.forwardExtrapolationDuration;Object(l.a)(o)&&(t.forwardExtrapolationDuration=o);const a=e.backwardExtrapolationType;Object(l.a)(a)&&(t.backwardExtrapolationType=Wb[a]);const s=e.backwardExtrapolationDuration;Object(l.a)(s)&&(t.backwardExtrapolationDuration=s)}const Cse={iso8601:void 0};function xse(e){if(Object(l.a)(e))return Cse.iso8601=e,YA.fromIso8601(Cse)}function Sse(e){const t=JA.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Ise(e){const t=new _re;return t.intervals.addInterval(Sse(e)),t}function Pse(e){const t=new Ore(e.referenceFrame);return t.intervals.addInterval(Sse(e)),t}function Dse(e,t,n,i,r,o,a){let s,u,h,d=xse(i.interval);Object(l.a)(r)&&(d=Object(l.a)(d)?YA.intersect(d,r,gse):r);const f=!Object(l.a)(i.reference)&&!Object(l.a)(i.velocityReference),p=Object(l.a)(d)&&!d.equals(JA.MAXIMUM_INTERVAL);if(!0===i.delete)return p?function e(t,n){if(t instanceof kae)return void t.removeSamples(n);if(t instanceof $ae)return void t.intervals.removeInterval(n);if(t instanceof _re){const i=t.intervals;for(let t=0;t<i.length;++t){const r=YA.intersect(i.get(t),n,gse);r.isEmpty||e(r.data,n)}return void i.removeInterval(n)}}(t[n],d):void(t[n]=void 0);let m=!1;if(f){if(u=Ase(e,i,o),!Object(l.a)(u))return;s=Object(c.a)(e.packedLength,1),h=Object(c.a)(u.length,1),m=!Object(l.a)(i.array)&&"string"!=typeof u&&h>s&&e!==Object}const g="function"==typeof e.unpack&&e!==Dae;if(!m&&!p)return void(t[n]=f?new kP(g?e.unpack(u,0):u):dse(e,a,i));let _,y=t[n];const b=i.epoch;if(Object(l.a)(b)&&(_=tr.fromIso8601(b)),m&&!p)return y instanceof kae||(t[n]=y=new kae(e)),y.addSamplesPackedArray(u,_),void Tse(i,y);let v;if(!m&&p)return d=d.clone(),d.data=f?g?e.unpack(u,0):u:dse(e,a,i),Object(l.a)(y)||(t[n]=y=f?new $ae:new _re),void(f&&y instanceof $ae?y.intervals.addInterval(d):y instanceof _re?(f&&(d.data=new kP(d.data)),y.intervals.addInterval(d)):(t[n]=y=Ise(y),f&&(d.data=new kP(d.data)),y.intervals.addInterval(d)));Object(l.a)(y)||(t[n]=y=new _re),y instanceof _re||(t[n]=y=Ise(y));const O=y.intervals;v=O.findInterval(d),Object(l.a)(v)&&v.data instanceof kae||(v=d.clone(),v.data=new kae(e),O.addInterval(v)),v.data.addSamplesPackedArray(u,_),Tse(i,v.data)}function Rse(e,t,n,i,r,o,a){if(Object(l.a)(i))if(Array.isArray(i))for(let s=0,c=i.length;s<c;++s)Dse(e,t,n,i[s],r,o,a);else Dse(e,t,n,i,r,o,a)}function jse(e,t,n,i,r,o){let a=xse(n.interval);Object(l.a)(i)&&(a=Object(l.a)(a)?YA.intersect(a,i,gse):i);const s=Object(l.a)(n.cartesianVelocity)?1:0,u=O.packedLength*(s+1);let h,d;const f=!Object(l.a)(n.reference),p=Object(l.a)(a)&&!a.equals(JA.MAXIMUM_INTERVAL);if(!0===n.delete)return p?function e(t,n){if(t instanceof Vae)return void t.removeSamples(n);if(t instanceof Jae)return void t.intervals.removeInterval(n);if(t instanceof Ore){const i=t.intervals;for(let t=0;t<i.length;++t){const r=YA.intersect(i.get(t),n,gse);r.isEmpty||e(r.data,n)}return void i.removeInterval(n)}}(e[t],a):void(e[t]=void 0);let m,g=!1;if(f&&(Object(l.a)(n.referenceFrame)&&(m=Hx[n.referenceFrame]),m=Object(c.a)(m,Hx.FIXED),h=bse(n),d=Object(c.a)(h.length,1),g=d>u),!g&&!p)return void(e[t]=f?new $z(O.unpack(h),m):hse(o,n.reference));let _,y=e[t];const b=n.epoch;if(Object(l.a)(b)&&(_=tr.fromIso8601(b)),g&&!p)return y instanceof Vae&&(!Object(l.a)(m)||y.referenceFrame===m)||(e[t]=y=new Vae(m,s)),y.addSamplesPackedArray(h,_),void Tse(n,y);let v;if(!g&&p)return a=a.clone(),a.data=f?O.unpack(h):hse(o,n.reference),Object(l.a)(y)||(y=f?new Jae(m):new Ore(m),e[t]=y),void(f&&y instanceof Jae&&Object(l.a)(m)&&y.referenceFrame===m?y.intervals.addInterval(a):y instanceof Ore?(f&&(a.data=new $z(a.data,m)),y.intervals.addInterval(a)):(e[t]=y=Pse(y),f&&(a.data=new $z(a.data,m)),y.intervals.addInterval(a)));Object(l.a)(y)?y instanceof Ore||(e[t]=y=Pse(y)):e[t]=y=new Ore(m);const w=y.intervals;v=w.findInterval(a),Object(l.a)(v)&&v.data instanceof Vae&&(!Object(l.a)(m)||v.data.referenceFrame===m)||(v=a.clone(),v.data=new Vae(m,s),w.addInterval(v)),v.data.addSamplesPackedArray(h,_),Tse(n,v.data)}function Mse(e,t,n,i,r,o){if(Object(l.a)(n))if(Array.isArray(n))for(let r=0,a=n.length;r<a;++r)jse(e,t,n[r],i,0,o);else jse(e,t,n,i,0,o)}function Lse(e,t,n,i){Object(l.a)(n.references)?Fse(e,t,n.references,n.interval,i,xae,_re):(Object(l.a)(n.cartesian2)?n.array=Vt.unpackArray(n.cartesian2):Object(l.a)(n.cartesian)&&(n.array=Vt.unpackArray(n.cartesian)),Object(l.a)(n.array)&&Rse(Array,e,t,n,void 0,void 0,i))}function Nse(e,t,n,i,r,o){let a=xse(n.interval);Object(l.a)(i)&&(a=Object(l.a)(a)?YA.intersect(a,i,gse):i);let s,c,u,h=e[t];if(Object(l.a)(a)){h instanceof bre||(h=new bre,e[t]=h);const n=h.intervals;c=n.findInterval({start:a.start,stop:a.stop}),Object(l.a)(c)?s=c.data:(c=a.clone(),n.addInterval(c))}else s=h;Object(l.a)(n.solidColor)?(s instanceof NR||(s=new NR),u=n.solidColor,Rse(sp,s,"color",u.color,void 0,void 0,o)):Object(l.a)(n.grid)?(s instanceof uae||(s=new uae),u=n.grid,Rse(sp,s,"color",u.color,void 0,r,o),Rse(Number,s,"cellAlpha",u.cellAlpha,void 0,r,o),Rse(Vt,s,"lineCount",u.lineCount,void 0,r,o),Rse(Vt,s,"lineThickness",u.lineThickness,void 0,r,o),Rse(Vt,s,"lineOffset",u.lineOffset,void 0,r,o)):Object(l.a)(n.image)?(s instanceof Hz||(s=new Hz),u=n.image,Rse(Image,s,"image",u.image,void 0,r,o),Rse(Vt,s,"repeat",u.repeat,void 0,r,o),Rse(sp,s,"color",u.color,void 0,r,o),Rse(Boolean,s,"transparent",u.transparent,void 0,r,o)):Object(l.a)(n.stripe)?(s instanceof Xae||(s=new Xae),u=n.stripe,Rse(Hae,s,"orientation",u.orientation,void 0,r,o),Rse(sp,s,"evenColor",u.evenColor,void 0,r,o),Rse(sp,s,"oddColor",u.oddColor,void 0,r,o),Rse(Number,s,"offset",u.offset,void 0,r,o),Rse(Number,s,"repeat",u.repeat,void 0,r,o)):Object(l.a)(n.polylineOutline)?(s instanceof Aae||(s=new Aae),u=n.polylineOutline,Rse(sp,s,"color",u.color,void 0,r,o),Rse(sp,s,"outlineColor",u.outlineColor,void 0,r,o),Rse(Number,s,"outlineWidth",u.outlineWidth,void 0,r,o)):Object(l.a)(n.polylineGlow)?(s instanceof bae||(s=new bae),u=n.polylineGlow,Rse(sp,s,"color",u.color,void 0,r,o),Rse(Number,s,"glowPower",u.glowPower,void 0,r,o),Rse(Number,s,"taperPower",u.taperPower,void 0,r,o)):Object(l.a)(n.polylineArrow)?(s instanceof dae||(s=new dae),u=n.polylineArrow,Rse(sp,s,"color",u.color,void 0,void 0,o)):Object(l.a)(n.polylineDash)?(s instanceof gae||(s=new gae),u=n.polylineDash,Rse(sp,s,"color",u.color,void 0,void 0,o),Rse(sp,s,"gapColor",u.gapColor,void 0,void 0,o),Rse(Number,s,"dashLength",u.dashLength,void 0,r,o),Rse(Number,s,"dashPattern",u.dashPattern,void 0,r,o)):Object(l.a)(n.checkerboard)&&(s instanceof tre||(s=new tre),u=n.checkerboard,Rse(sp,s,"evenColor",u.evenColor,void 0,r,o),Rse(sp,s,"oddColor",u.oddColor,void 0,r,o),Rse(Vt,s,"repeat",u.repeat,void 0,r,o)),Object(l.a)(c)?c.data=s:e[t]=s}function Bse(e,t,n,i,r,o){if(Object(l.a)(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)Nse(e,t,n[a],i,r,o);else Nse(e,t,n,i,r,o)}function Fse(e,t,n,i,r,o,a){const s=n.map((function(e){return hse(r,e)}));if(Object(l.a)(i)){i=xse(i);let n=e[t];if(!(n instanceof a)){const i=new a;i.intervals.addInterval(Sse(n)),e[t]=n=i}i.data=new o(s),n.intervals.addInterval(i)}else e[t]=new o(s)}function zse(e,t,n,i){const r=n.references;Object(l.a)(r)?Fse(e,t,r,n.interval,i,xae,_re):Rse(Array,e,t,n,void 0,void 0,i)}function kse(e,t,n,i){if(Object(l.a)(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)zse(e,t,n[r],i);else zse(e,t,n,i)}function Use(e,t,n,i){const r=n.references;Object(l.a)(r)?Fse(e,t,r,n.interval,i,Tae,Ore):(Object(l.a)(n.cartesian)?n.array=O.unpackArray(n.cartesian):Object(l.a)(n.cartographicRadians)?n.array=O.fromRadiansArrayHeights(n.cartographicRadians):Object(l.a)(n.cartographicDegrees)&&(n.array=O.fromDegreesArrayHeights(n.cartographicDegrees)),Object(l.a)(n.array)&&Rse(Array,e,t,n,void 0,void 0,i))}function Vse(e,t,n,i){if(Object(l.a)(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Use(e,t,n[r],i);else Use(e,t,n,i)}function Hse(e){return O.unpackArray(e)}function Gse(e){return O.fromRadiansArrayHeights(e)}function qse(e){return O.fromDegreesArrayHeights(e)}function Wse(e,t,n,i){const r=n.references;if(Object(l.a)(r)){const o=r.map((function(e){const t={};return Fse(t,"positions",e,n.interval,i,Tae,Ore),t.positions}));e[t]=new Tae(o)}else Object(l.a)(n.cartesian)?n.array=n.cartesian.map(Hse):Object(l.a)(n.cartographicRadians)?n.array=n.cartographicRadians.map(Gse):Object(l.a)(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(qse)),Object(l.a)(n.array)&&Rse(Array,e,t,n,void 0,void 0,i)}function Yse(e,t,n,i,r){let o=xse(t.interval);Object(l.a)(n)&&(o=Object(l.a)(o)?YA.intersect(o,n,gse):n);let a=e.nodeTransformations;const s=Object.keys(t);for(let n=0,c=s.length;n<c;++n){const c=s[n];if("interval"===c)continue;const u=t[c];if(!Object(l.a)(u))continue;Object(l.a)(a)||(e.nodeTransformations=a=new gk),a.hasProperty(c)||a.addProperty(c);let h=a[c];Object(l.a)(h)||(a[c]=h=new fk),Rse(O,h,"translation",u.translation,o,i,r),Rse(To,h,"rotation",u.rotation,o,i,r),Rse(O,h,"scale",u.scale,o,i,r)}}function Xse(e,t,n,i,r){let o=xse(t.interval);Object(l.a)(n)&&(o=Object(l.a)(o)?YA.intersect(o,n,gse):n);let a=e.articulations;const s=Object.keys(t);for(let n=0,c=s.length;n<c;++n){const c=s[n];if("interval"===c)continue;const u=t[c];Object(l.a)(u)&&(Object(l.a)(a)||(e.articulations=a=new gk),a.hasProperty(c)||a.addProperty(c),Rse(Number,a,c,u,o,i,r))}}function Kse(e){this.polygon=e,this._definitionChanged=new un.a}function Jse(e){return e?vl.GEODESIC:vl.NONE}function Zse(e,t,n,i,r){let o=e.id;if(Object(l.a)(o)||(o=fy()),use=o,!Object(l.a)(r._version)&&"document"!==o)throw new ye.a("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(o);else if("document"===o)!function(e,t){const n=e.version;if(Object(l.a)(n)&&"string"==typeof n){const e=n.split(".");if(2===e.length){if("1"!==e[0])throw new ye.a("Cesium only supports CZML version 1.");t._version=n}}if(!Object(l.a)(t._version))throw new ye.a("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");const i=t._documentPacket;Object(l.a)(e.name)&&(i.name=e.name);const r=e.clock;if(Object(l.a)(r)){const e=i.clock;Object(l.a)(e)?(e.interval=Object(c.a)(r.interval,e.interval),e.currentTime=Object(c.a)(r.currentTime,e.currentTime),e.range=Object(c.a)(r.range,e.range),e.step=Object(c.a)(r.step,e.step),e.multiplier=Object(c.a)(r.multiplier,e.multiplier)):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}(e,r);else{const r=t.getOrCreateEntity(o),a=e.parent;Object(l.a)(a)&&(r.parent=t.getOrCreateEntity(a));for(let o=n.length-1;o>-1;o--)n[o](r,e,t,i)}use=void 0}function $se(e,t,n,i){if(!Object(l.a)(t))throw new u.a("czml is required.");let r=t,o=(n=Object(c.a)(n,c.a.EMPTY_OBJECT)).sourceUri,a=n.credit;if("string"==typeof a&&(a=new ln(a)),e._credit=a,"string"==typeof t||t instanceof Tt.a){r=(t=Tt.a.createIfNeeded(t)).fetchJson(),o=Object(c.a)(o,t.clone());const n=e._resourceCredits,i=t.credits;if(Object(l.a)(i)){const e=i.length;for(let t=0;t<e;t++)n.push(i[t])}}return o=Tt.a.createIfNeeded(o),Mre.setLoading(e,!0),Promise.resolve(r).then((function(t){return function(e,t,n,i){Mre.setLoading(e,!0);const r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Qse,r.removeAll());ece._processCzml(t,r,n,void 0,e);let o=function(e){let t;const n=e._documentPacket.clock;if(!Object(l.a)(n)){if(!Object(l.a)(e._clock)){const n=e._entityCollection.computeAvailability();if(!n.start.equals(JA.MINIMUM_VALUE)){const i=n.start,r=n.stop,o=tr.secondsDifference(r,i),a=Math.round(o/120);return t=new rae,t.startTime=tr.clone(i),t.stopTime=tr.clone(r),t.clockRange=qf.LOOP_STOP,t.multiplier=a,t.currentTime=tr.clone(i),t.clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}Object(l.a)(e._clock)?t=e._clock.clone():(t=new rae,t.startTime=JA.MINIMUM_VALUE.clone(),t.stopTime=JA.MAXIMUM_VALUE.clone(),t.currentTime=JA.MINIMUM_VALUE.clone(),t.clockRange=qf.LOOP_STOP,t.clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);const i=xse(n.interval);return Object(l.a)(i)&&(t.startTime=i.start,t.stopTime=i.stop),Object(l.a)(n.currentTime)&&(t.currentTime=tr.fromIso8601(n.currentTime)),Object(l.a)(n.range)&&(t.clockRange=Object(c.a)(qf[n.range],qf.LOOP_STOP)),Object(l.a)(n.step)&&(t.clockStep=Object(c.a)(Wf[n.step],Wf.SYSTEM_CLOCK_MULTIPLIER)),Object(l.a)(n.multiplier)&&(t.multiplier=n.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}(e);const a=e._documentPacket;Object(l.a)(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!Object(l.a)(e._name)&&Object(l.a)(n)&&(e._name=Yv(n.getUrlComponent()),o=!0);Mre.setLoading(e,!1),o&&e._changed.raiseEvent(e);return e}(e,t,o,i)})).catch((function(t){return Mre.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),Promise.reject(t)}))}function Qse(){this.name=void 0,this.clock=void 0}function ece(e){this._name=e,this._changed=new un.a,this._error=new un.a,this._isLoading=!1,this._loading=new un.a,this._clock=void 0,this._documentPacket=new Qse,this._version=void 0,this._entityCollection=new ore(this),this._entityCluster=new Woe,this._credit=void 0,this._resourceCredits=[]}Object.defineProperties(Kse.prototype,{isConstant:{get:function(){const e=this.polygon._positions,t=this.polygon._holes;return(!Object(l.a)(e)||e.isConstant)&&(!Object(l.a)(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}}),Kse.prototype.getValue=function(e,t){let n,i;return Object(l.a)(this.polygon._positions)&&(n=this.polygon._positions.getValue(e)),Object(l.a)(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),Object(l.a)(i)&&(i=i.map((function(e){return new QT(e)})))),Object(l.a)(t)?(t.positions=n,t.holes=i,t):new QT(n,i)},Kse.prototype.equals=function(e){return this===e||e instanceof Kse&&JP.equals(this.polygon._positions,e.polygon._positions)&&JP.equals(this.polygon._holes,e.polygon._holes)},ece.load=function(e,t){return(new ece).load(e,t)},Object.defineProperties(ece.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!Object(l.a)(e))throw new u.a("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}}),ece.updaters=[function(e,t,n,i){const r=t.billboard;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.billboard;Object(l.a)(a)||(e.billboard=a=new GP),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Image,a,"image",r.image,o,i,n),Rse(Number,a,"scale",r.scale,o,i,n),Rse(Vt,a,"pixelOffset",r.pixelOffset,o,i,n),Rse(O,a,"eyeOffset",r.eyeOffset,o,i,n),Rse(WP,a,"horizontalOrigin",r.horizontalOrigin,o,i,n),Rse(YP,a,"verticalOrigin",r.verticalOrigin,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(sp,a,"color",r.color,o,i,n),Rse(Dae,a,"rotation",r.rotation,o,i,n),function(e,t,n,i,r){Object(l.a)(t)&&Rse(lse,e,"alignedAxis",t,n,i,r)}(a,r.alignedAxis,o,i,n),Rse(Boolean,a,"sizeInMeters",r.sizeInMeters,o,i,n),Rse(Number,a,"width",r.width,o,i,n),Rse(Number,a,"height",r.height,o,i,n),Rse(TE,a,"scaleByDistance",r.scaleByDistance,o,i,n),Rse(TE,a,"translucencyByDistance",r.translucencyByDistance,o,i,n),Rse(TE,a,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Rse(Nl,a,"imageSubRegion",r.imageSubRegion,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(Number,a,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)},function(e,t,n,i){const r=t.box;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.box;Object(l.a)(a)||(e.box=a=new Yz),Rse(Boolean,a,"show",r.show,o,i,n),Rse(O,a,"dimensions",r.dimensions,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)},function(e,t,n,i){const r=t.corridor;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.corridor;Object(l.a)(a)||(e.corridor=a=new ek),Rse(Boolean,a,"show",r.show,o,i,n),Vse(a,"positions",r.positions,n),Rse(Number,a,"width",r.width,o,i,n),Rse(Number,a,"height",r.height,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Rse(qP,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Rse(Km,a,"cornerType",r.cornerType,o,i,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(qN,a,"classificationType",r.classificationType,o,i,n),Rse(Number,a,"zIndex",r.zIndex,o,i,n)},function(e,t,n,i){const r=t.cylinder;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.cylinder;Object(l.a)(a)||(e.cylinder=a=new rk),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Number,a,"length",r.length,o,i,n),Rse(Number,a,"topRadius",r.topRadius,o,i,n),Rse(Number,a,"bottomRadius",r.bottomRadius,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(Number,a,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Rse(Number,a,"slices",r.slices,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)},function(e,t,n,i){const r=t.ellipse;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.ellipse;Object(l.a)(a)||(e.ellipse=a=new ak),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Number,a,"semiMajorAxis",r.semiMajorAxis,o,i,n),Rse(Number,a,"semiMinorAxis",r.semiMinorAxis,o,i,n),Rse(Number,a,"height",r.height,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Rse(qP,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Rse(Dae,a,"rotation",r.rotation,o,i,n),Rse(Dae,a,"stRotation",r.stRotation,o,i,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(Number,a,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(qN,a,"classificationType",r.classificationType,o,i,n),Rse(Number,a,"zIndex",r.zIndex,o,i,n)},function(e,t,n,i){const r=t.ellipsoid;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.ellipsoid;Object(l.a)(a)||(e.ellipsoid=a=new ck),Rse(Boolean,a,"show",r.show,o,i,n),Rse(O,a,"radii",r.radii,o,i,n),Rse(O,a,"innerRadii",r.innerRadii,o,i,n),Rse(Number,a,"minimumClock",r.minimumClock,o,i,n),Rse(Number,a,"maximumClock",r.maximumClock,o,i,n),Rse(Number,a,"minimumCone",r.minimumCone,o,i,n),Rse(Number,a,"maximumCone",r.maximumCone,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(Number,a,"stackPartitions",r.stackPartitions,o,i,n),Rse(Number,a,"slicePartitions",r.slicePartitions,o,i,n),Rse(Number,a,"subdivisions",r.subdivisions,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)},function(e,t,n,i){const r=t.label;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.label;Object(l.a)(a)||(e.label=a=new uk),Rse(Boolean,a,"show",r.show,o,i,n),Rse(String,a,"text",r.text,o,i,n),Rse(String,a,"font",r.font,o,i,n),Rse(L0,a,"style",r.style,o,i,n),Rse(Number,a,"scale",r.scale,o,i,n),Rse(Boolean,a,"showBackground",r.showBackground,o,i,n),Rse(sp,a,"backgroundColor",r.backgroundColor,o,i,n),Rse(Vt,a,"backgroundPadding",r.backgroundPadding,o,i,n),Rse(Vt,a,"pixelOffset",r.pixelOffset,o,i,n),Rse(O,a,"eyeOffset",r.eyeOffset,o,i,n),Rse(WP,a,"horizontalOrigin",r.horizontalOrigin,o,i,n),Rse(YP,a,"verticalOrigin",r.verticalOrigin,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(sp,a,"fillColor",r.fillColor,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(TE,a,"translucencyByDistance",r.translucencyByDistance,o,i,n),Rse(TE,a,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Rse(TE,a,"scaleByDistance",r.scaleByDistance,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(Number,a,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)},function(e,t,n,i){const r=t.model;if(!Object(l.a)(r))return;const o=xse(r.interval);let a,s,c=e.model;Object(l.a)(c)||(e.model=c=new bk),Rse(Boolean,c,"show",r.show,o,i,n),Rse(rc.a,c,"uri",r.gltf,o,i,n),Rse(Number,c,"scale",r.scale,o,i,n),Rse(Number,c,"minimumPixelSize",r.minimumPixelSize,o,i,n),Rse(Number,c,"maximumScale",r.maximumScale,o,i,n),Rse(Boolean,c,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Rse(Boolean,c,"runAnimations",r.runAnimations,o,i,n),Rse(Boolean,c,"clampAnimations",r.clampAnimations,o,i,n),Rse(TB,c,"shadows",r.shadows,o,i,n),Rse(qP,c,"heightReference",r.heightReference,o,i,n),Rse(sp,c,"silhouetteColor",r.silhouetteColor,o,i,n),Rse(Number,c,"silhouetteSize",r.silhouetteSize,o,i,n),Rse(sp,c,"color",r.color,o,i,n),Rse(kq,c,"colorBlendMode",r.colorBlendMode,o,i,n),Rse(Number,c,"colorBlendAmount",r.colorBlendAmount,o,i,n),Rse(eb,c,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);const u=r.nodeTransformations;if(Object(l.a)(u))if(Array.isArray(u))for(a=0,s=u.length;a<s;++a)Yse(c,u[a],o,i,n);else Yse(c,u,o,i,n);const h=r.articulations;if(Object(l.a)(h))if(Array.isArray(h))for(a=0,s=h.length;a<s;++a)Xse(c,h[a],o,i,n);else Xse(c,h,o,i,n)},function(e,t,n,i){const r=t.name;Object(l.a)(r)&&(e.name=t.name)},function(e,t,n,i){const r=t.description;Object(l.a)(r)&&Rse(String,e,"description",r,void 0,i,n)},function(e,t,n,i){const r=t.path;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.path;Object(l.a)(a)||(e.path=a=new Ak),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Number,a,"leadTime",r.leadTime,o,i,n),Rse(Number,a,"trailTime",r.trailTime,o,i,n),Rse(Number,a,"width",r.width,o,i,n),Rse(Number,a,"resolution",r.resolution,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)},function(e,t,n,i){const r=t.point;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.point;Object(l.a)(a)||(e.point=a=new xk),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Number,a,"pixelSize",r.pixelSize,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(sp,a,"color",r.color,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(TE,a,"scaleByDistance",r.scaleByDistance,o,i,n),Rse(TE,a,"translucencyByDistance",r.translucencyByDistance,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(Number,a,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)},function(e,t,n,i){const r=t.polygon;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.polygon;Object(l.a)(a)||(e.polygon=a=new Ik),Rse(Boolean,a,"show",r.show,o,i,n),Vse(a,"_positions",r.positions,n),function(e,t,n,i){if(Object(l.a)(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Wse(e,t,n[r],i);else Wse(e,t,n,i)}(a,"_holes",r.holes,n),(Object(l.a)(a._positions)||Object(l.a)(a._holes))&&(a.hierarchy=new Kse(a)),Rse(Number,a,"height",r.height,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Rse(qP,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Rse(Dae,a,"stRotation",r.stRotation,o,i,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(Boolean,a,"perPositionHeight",r.perPositionHeight,o,i,n),Rse(Boolean,a,"closeTop",r.closeTop,o,i,n),Rse(Boolean,a,"closeBottom",r.closeBottom,o,i,n),Rse(vl,a,"arcType",r.arcType,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(qN,a,"classificationType",r.classificationType,o,i,n),Rse(Number,a,"zIndex",r.zIndex,o,i,n)},function(e,t,n,i){const r=t.polyline;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.polyline;if(Object(l.a)(a)||(e.polyline=a=new Dk),Rse(Boolean,a,"show",r.show,o,i,n),Vse(a,"positions",r.positions,n),Rse(Number,a,"width",r.width,o,i,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Bse(a,"material",r.material,o,i,n),Bse(a,"depthFailMaterial",r.depthFailMaterial,o,i,n),Rse(vl,a,"arcType",r.arcType,o,i,n),Rse(Boolean,a,"clampToGround",r.clampToGround,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(qN,a,"classificationType",r.classificationType,o,i,n),Rse(Number,a,"zIndex",r.zIndex,o,i,n),Object(l.a)(r.followSurface)&&!Object(l.a)(r.arcType)){const e={};Rse(Boolean,e,"followSurface",r.followSurface,o,i,n),a.arcType=(s=e.followSurface,c=Jse,new oU((function(e,t){return c(s.getValue(e,t))}),s.isConstant))}var s,c},function(e,t,n,i){const r=t.polylineVolume;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.polylineVolume;Object(l.a)(a)||(e.polylineVolume=a=new jk),Vse(a,"positions",r.positions,n),function(e,t,n,i){if(Object(l.a)(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)Lse(e,t,n[r],i);else Lse(e,t,n,i)}(a,"shape",r.shape,n),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Km,a,"cornerType",r.cornerType,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)},function(e,t,n,i){const r=t.properties;if(Object(l.a)(r)){Object(l.a)(e.properties)||(e.properties=new gk);for(const t in r)if(r.hasOwnProperty(t)){e.properties.hasProperty(t)||e.properties.addProperty(t);const o=r[t];if(Array.isArray(o))for(let r=0,a=o.length;r<a;++r)Dse(wse(o[r]),e.properties,t,o[r],void 0,i,n);else Dse(wse(o),e.properties,t,o,void 0,i,n)}}},function(e,t,n,i){const r=t.rectangle;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.rectangle;Object(l.a)(a)||(e.rectangle=a=new Lk),Rse(Boolean,a,"show",r.show,o,i,n),Rse(Be,a,"coordinates",r.coordinates,o,i,n),Rse(Number,a,"height",r.height,o,i,n),Rse(qP,a,"heightReference",r.heightReference,o,i,n),Rse(Number,a,"extrudedHeight",r.extrudedHeight,o,i,n),Rse(qP,a,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Rse(Dae,a,"rotation",r.rotation,o,i,n),Rse(Dae,a,"stRotation",r.stRotation,o,i,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Rse(qN,a,"classificationType",r.classificationType,o,i,n),Rse(Number,a,"zIndex",r.zIndex,o,i,n)},function(e,t,n,i){const r=t.position;Object(l.a)(r)&&Mse(e,"position",r,void 0,0,n)},function(e,t,n,i){const r=t.tileset;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.tileset;Object(l.a)(a)||(e.tileset=a=new Ok),Rse(Boolean,a,"show",r.show,o,i,n),Rse(rc.a,a,"uri",r.uri,o,i,n),Rse(Number,a,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)},function(e,t,n,i){const r=t.viewFrom;Object(l.a)(r)&&Rse(O,e,"viewFrom",r,void 0,i,n)},function(e,t,n,i){const r=t.wall;if(!Object(l.a)(r))return;const o=xse(r.interval);let a=e.wall;Object(l.a)(a)||(e.wall=a=new Bk),Rse(Boolean,a,"show",r.show,o,i,n),Vse(a,"positions",r.positions,n),kse(a,"minimumHeights",r.minimumHeights,n),kse(a,"maximumHeights",r.maximumHeights,n),Rse(Number,a,"granularity",r.granularity,o,i,n),Rse(Boolean,a,"fill",r.fill,o,i,n),Bse(a,"material",r.material,o,i,n),Rse(Boolean,a,"outline",r.outline,o,i,n),Rse(sp,a,"outlineColor",r.outlineColor,o,i,n),Rse(Number,a,"outlineWidth",r.outlineWidth,o,i,n),Rse(TB,a,"shadows",r.shadows,o,i,n),Rse(eb,a,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)},function(e,t,n,i){const r=t.orientation;Object(l.a)(r)&&Rse(To,e,"orientation",r,void 0,i,n)},function(e,t,n,i){const r=t.availability;if(!Object(l.a)(r))return;let o;if(Array.isArray(r))for(let e=0,t=r.length;e<t;++e)Object(l.a)(o)||(o=new YI),o.addInterval(xse(r[e]));else o=new YI,o.addInterval(xse(r));e.availability=o}],ece.prototype.process=function(e,t){return $se(this,e,t,!1)},ece.prototype.load=function(e,t){return $se(this,e,t,!0)},ece.prototype.update=function(e){return!0},ece.processPacketData=Rse,ece.processPositionPacketData=Mse,ece.processMaterialPacketData=Bse,ece._processCzml=function(e,t,n,i,r){if(i=Object(c.a)(i,ece.updaters),Array.isArray(e))for(let o=0,a=e.length;o<a;++o)Zse(e[o],t,i,n,r);else Zse(e,t,i,n,r)};var tce=ece;function nce(){this._dataSources=[],this._dataSourceAdded=new un.a,this._dataSourceRemoved=new un.a,this._dataSourceMoved=new un.a}function ice(e,t){if(!Object(l.a)(t))throw new u.a("dataSource is required.");const n=e.indexOf(t);if(-1===n)throw new u.a("dataSource is not in this collection.");return n}function rce(e,t,n){const i=e._dataSources,r=i.length-1;if((t=h.a.clamp(t,0,r))===(n=h.a.clamp(n,0,r)))return;const o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}Object.defineProperties(nce.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}}),nce.prototype.add=function(e){if(!Object(l.a)(e))throw new u.a("dataSource is required.");const t=this,n=this._dataSources;return Promise.resolve(e).then((function(e){return n===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e}))},nce.prototype.remove=function(e,t){t=Object(c.a)(t,!1);const n=this._dataSources.indexOf(e);return-1!==n&&(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&"function"==typeof e.destroy&&e.destroy(),!0)},nce.prototype.removeAll=function(e){e=Object(c.a)(e,!1);const t=this._dataSources;for(let n=0,i=t.length;n<i;++n){const i=t[n];this._dataSourceRemoved.raiseEvent(this,i),e&&"function"==typeof i.destroy&&i.destroy()}this._dataSources=[]},nce.prototype.contains=function(e){return-1!==this.indexOf(e)},nce.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},nce.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return this._dataSources[e]},nce.prototype.getByName=function(e){if(!Object(l.a)(e))throw new u.a("name is required.");return this._dataSources.filter((function(t){return t.name===e}))},nce.prototype.raise=function(e){const t=ice(this._dataSources,e);rce(this,t,t+1)},nce.prototype.lower=function(e){const t=ice(this._dataSources,e);rce(this,t,t-1)},nce.prototype.raiseToTop=function(e){const t=ice(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))},nce.prototype.lowerToBottom=function(e){const t=ice(this._dataSources,e);0!==t&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))},nce.prototype.isDestroyed=function(){return!1},nce.prototype.destroy=function(){return this.removeAll(!0),sc(this)};var oce=nce;function ace(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._primitives=[],this._guid=fy(),this._zIndex=void 0,this.show=Object(c.a)(e.show,!0),this.destroyPrimitives=Object(c.a)(e.destroyPrimitives,!0)}function sce(e,t){if(!e.contains(t))throw new u.a("primitive is not in this collection.");return e._primitives.indexOf(t)}Object.defineProperties(ace.prototype,{length:{get:function(){return this._primitives.length}}}),ace.prototype.add=function(e,t){const n=Object(l.a)(t);if(!Object(l.a)(e))throw new u.a("primitive is required.");if(n){if(t<0)throw new u.a("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new u.a("index must be less than or equal to the number of primitives.")}const i=e._external=e._external||{};return(i._composites=i._composites||{})[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),e},ace.prototype.remove=function(e){if(this.contains(e)){const t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},ace.prototype.removeAndDestroy=function(e){const t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},ace.prototype.removeAll=function(){const e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy();this._primitives=[]},ace.prototype.contains=function(e){return!!(Object(l.a)(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},ace.prototype.raise=function(e){if(Object(l.a)(e)){const t=sce(this,e),n=this._primitives;if(t!==n.length-1){const e=n[t];n[t]=n[t+1],n[t+1]=e}}},ace.prototype.raiseToTop=function(e){if(Object(l.a)(e)){const t=sce(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}},ace.prototype.lower=function(e){if(Object(l.a)(e)){const t=sce(this,e),n=this._primitives;if(0!==t){const e=n[t];n[t]=n[t-1],n[t-1]=e}}},ace.prototype.lowerToBottom=function(e){if(Object(l.a)(e)){const t=sce(this,e),n=this._primitives;0!==t&&(n.splice(t,1),n.unshift(e))}},ace.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return this._primitives[e]},ace.prototype.update=function(e){if(!this.show)return;const t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)},ace.prototype.prePassesUpdate=function(e){const t=this._primitives;for(let n=0;n<t.length;++n){const i=t[n];Object(l.a)(i.prePassesUpdate)&&i.prePassesUpdate(e)}},ace.prototype.updateForPass=function(e,t){const n=this._primitives;for(let i=0;i<n.length;++i){const r=n[i];Object(l.a)(r.updateForPass)&&r.updateForPass(e,t)}},ace.prototype.postPassesUpdate=function(e){const t=this._primitives;for(let n=0;n<t.length;++n){const i=t[n];Object(l.a)(i.postPassesUpdate)&&i.postPassesUpdate(e)}},ace.prototype.isDestroyed=function(){return!1},ace.prototype.destroy=function(){return this.removeAll(),sc(this)};var cce=ace;function lce(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(lce.prototype,{length:{get:function(){return this._length}}}),lce.prototype.add=function(e,t){s.a.defined("primitive",e),Object(l.a)(t)&&s.a.typeOf.number("zIndex",t),t=Object(c.a)(t,0);let n=this._collections[t];if(!Object(l.a)(n)){n=new cce({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;const e=this._collectionsArray;let i=0;for(;i<e.length&&e[i]._zIndex<t;)i++;e.splice(i,0,n)}return n.add(e),this._length++,e._zIndex=t,e},lce.prototype.set=function(e,t){return s.a.defined("primitive",e),s.a.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e},lce.prototype.remove=function(e,t){if(this.contains(e)){const n=e._zIndex,i=this._collections[n];let r;return r=t?i.remove(e):i.removeAndDestroy(e),r&&this._length--,0===i.length&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1},lce.prototype.removeAll=function(){const e=this._collectionsArray;for(let t=0;t<e.length;t++){const n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0},lce.prototype.contains=function(e){if(!Object(l.a)(e))return!1;const t=this._collections[e._zIndex];return Object(l.a)(t)&&t.contains(e)},lce.prototype.update=function(e){if(!this.show)return;const t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)},lce.prototype.isDestroyed=function(){return!1},lce.prototype.destroy=function(){return this.removeAll(),sc(this)};var uce=lce;function hce(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Tl}hce.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))},hce.prototype.remove=function(e){const t=e.id,n=this._dynamicUpdaters.get(t);Object(l.a)(n)&&(this._dynamicUpdaters.remove(t),n.destroy())},hce.prototype.update=function(e){const t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0},hce.prototype.removeAllPrimitives=function(){const e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},hce.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),Object(l.a)(e)&&Object(l.a)(e.getBoundingSphere)?e.getBoundingSphere(t):XP.FAILED};var dce=hce;const fce=new sp,pce=O.ZERO,mce=new O,gce=new Be;function _ce(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function yce(e,t){Ere.call(this,{entity:e,scene:t,geometryOptions:new _ce(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function bce(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(yce.prototype=Object.create(Ere.prototype),yce.prototype.constructor=yce),yce.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nb.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,fce)),Object(l.a)(t)||(t=sp.WHITE),i.color=lp.fromColor(t)}return Object(l.a)(this._options.offsetAttribute)&&(i.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,pce,mce))),new Ph({id:t,geometry:new xf(this._options),attributes:i})},yce.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,fce),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r),offset:void 0};return Object(l.a)(this._options.offsetAttribute)&&(o.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,pce,mce))),new Ph({id:t,geometry:new kf(this._options),attributes:o})},yce.prototype._computeCenter=function(e,t){return JP.getValueOrUndefined(this._entity.position,e,t)},yce.prototype._isHidden=function(e,t){const n=e.position;return!Object(l.a)(n)||!Object(l.a)(t.semiMajorAxis)||!Object(l.a)(t.semiMinorAxis)||iU.prototype._isHidden.call(this,e,t)},yce.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!JP.isConstant(t.rotation)||!JP.isConstant(t.height)||!JP.isConstant(t.extrudedHeight)||!JP.isConstant(t.granularity)||!JP.isConstant(t.stRotation)||!JP.isConstant(t.outlineWidth)||!JP.isConstant(t.numberOfVerticalLines)||!JP.isConstant(t.zIndex)||this._onTerrain&&!JP.isConstant(this._materialProperty)&&!(this._materialProperty instanceof NR)},yce.prototype._setStaticOptions=function(e,t){let n=JP.getValueOrUndefined(t.height,JA.MINIMUM_VALUE);const i=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE);let r=JP.getValueOrUndefined(t.extrudedHeight,JA.MINIMUM_VALUE);const o=JP.getValueOrDefault(t.extrudedHeightReference,JA.MINIMUM_VALUE,qP.NONE);Object(l.a)(r)&&!Object(l.a)(n)&&(n=0);const a=this._options;a.vertexFormat=this._materialProperty instanceof NR?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(JA.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(JA.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(JA.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=JP.getValueOrUndefined(t.rotation,JA.MINIMUM_VALUE),a.granularity=JP.getValueOrUndefined(t.granularity,JA.MINIMUM_VALUE),a.stRotation=JP.getValueOrUndefined(t.stRotation,JA.MINIMUM_VALUE),a.numberOfVerticalLines=JP.getValueOrUndefined(t.numberOfVerticalLines,JA.MINIMUM_VALUE),a.offsetAttribute=Ere.computeGeometryOffsetAttribute(n,i,r,o),a.height=Ere.getGeometryHeight(n,i),r=Ere.getGeometryExtrudedHeight(r,o),r===Ere.CLAMP_TO_GROUND&&(r=nn.getMinimumMaximumHeights(xf.computeRectangle(a,gce)).minimumTerrainHeight),a.extrudedHeight=r},yce.DynamicGeometryUpdater=bce,Object(l.a)(Object.create)&&(bce.prototype=Object.create(bz.prototype),bce.prototype.constructor=bce),bce.prototype._isHidden=function(e,t,n){const i=this._options;return!Object(l.a)(i.center)||!Object(l.a)(i.semiMajorAxis)||!Object(l.a)(i.semiMinorAxis)||bz.prototype._isHidden.call(this,e,t,n)},bce.prototype._setOptions=function(e,t,n){const i=this._options;let r=JP.getValueOrUndefined(t.height,n);const o=JP.getValueOrDefault(t.heightReference,n,qP.NONE);let a=JP.getValueOrUndefined(t.extrudedHeight,n);const s=JP.getValueOrDefault(t.extrudedHeightReference,n,qP.NONE);Object(l.a)(a)&&!Object(l.a)(r)&&(r=0),i.center=JP.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=JP.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=JP.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=JP.getValueOrUndefined(t.rotation,n),i.granularity=JP.getValueOrUndefined(t.granularity,n),i.stRotation=JP.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=JP.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Ere.computeGeometryOffsetAttribute(r,o,a,s),i.height=Ere.getGeometryHeight(r,o),a=Ere.getGeometryExtrudedHeight(a,s),a===Ere.CLAMP_TO_GROUND&&(a=nn.getMinimumMaximumHeights(xf.computeRectangle(i,gce)).minimumTerrainHeight),i.extrudedHeight=a};var vce=yce;const Oce=new NR(sp.WHITE),wce=O.ZERO,Ace=new O,Ece=new O,Tce=new O,Cce=new sp,xce=new O(1,1,1);function Sce(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Ice(e,t){iU.call(this,{entity:e,scene:t,geometryOptions:new Sce(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function Pce(e,t,n){bz.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new Me,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new O,this._material={}}Object(l.a)(Object.create)&&(Ice.prototype=Object.create(iU.prototype),Ice.prototype.constructor=Ice),Object.defineProperties(Ice.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),Ice.prototype.createFillGeometryInstance=function(e,t,n){s.a.defined("time",e);const i=this._entity,r=i.isAvailable(e);let o;const a=new QS(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),u={show:a,distanceDisplayCondition:nb.fromDistanceDisplayCondition(c),color:void 0,offset:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,Cce)),Object(l.a)(t)||(t=sp.WHITE),o=lp.fromColor(t),u.color=o}return Object(l.a)(this._options.offsetAttribute)&&(u.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,wce,Ace))),new Ph({id:i,geometry:new Rb(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,n),attributes:u})},Ice.prototype.createOutlineGeometryInstance=function(e,t,n){s.a.defined("time",e);const i=this._entity,r=i.isAvailable(e),o=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,Cce),a=this._distanceDisplayConditionProperty.getValue(e),c={show:new QS(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(o),distanceDisplayCondition:nb.fromDistanceDisplayCondition(a),offset:void 0};return Object(l.a)(this._options.offsetAttribute)&&(c.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,wce,Ace))),new Ph({id:i,geometry:new kb(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,n),attributes:c})},Ice.prototype._computeCenter=function(e,t){return JP.getValueOrUndefined(this._entity.position,e,t)},Ice.prototype._isHidden=function(e,t){return!Object(l.a)(e.position)||!Object(l.a)(t.radii)||iU.prototype._isHidden.call(this,e,t)},Ice.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&JP.isConstant(e.orientation)&&t.radii.isConstant&&JP.isConstant(t.innerRadii)&&JP.isConstant(t.stackPartitions)&&JP.isConstant(t.slicePartitions)&&JP.isConstant(t.outlineWidth)&&JP.isConstant(t.minimumClock)&&JP.isConstant(t.maximumClock)&&JP.isConstant(t.minimumCone)&&JP.isConstant(t.maximumCone)&&JP.isConstant(t.subdivisions))},Ice.prototype._setStaticOptions=function(e,t){const n=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof NR?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(JA.MINIMUM_VALUE,i.radii),i.innerRadii=JP.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=JP.getValueOrUndefined(t.minimumClock,JA.MINIMUM_VALUE),i.maximumClock=JP.getValueOrUndefined(t.maximumClock,JA.MINIMUM_VALUE),i.minimumCone=JP.getValueOrUndefined(t.minimumCone,JA.MINIMUM_VALUE),i.maximumCone=JP.getValueOrUndefined(t.maximumCone,JA.MINIMUM_VALUE),i.stackPartitions=JP.getValueOrUndefined(t.stackPartitions,JA.MINIMUM_VALUE),i.slicePartitions=JP.getValueOrUndefined(t.slicePartitions,JA.MINIMUM_VALUE),i.subdivisions=JP.getValueOrUndefined(t.subdivisions,JA.MINIMUM_VALUE),i.offsetAttribute=n!==qP.NONE?eu.ALL:void 0},Ice.prototype._onEntityPropertyChanged=uU,Ice.DynamicGeometryUpdater=Pce,Object(l.a)(Object.create)&&(Pce.prototype=Object.create(bz.prototype),Pce.prototype.constructor=Pce),Pce.prototype.update=function(e){s.a.defined("time",e);const t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!JP.getValueOrDefault(n.show,e,!0))return Object(l.a)(this._primitive)&&(this._primitive.show=!1),void(Object(l.a)(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));const i=JP.getValueOrUndefined(n.radii,e,Ece);let r=Object(l.a)(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,.5*i.z,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!Object(l.a)(r)||!Object(l.a)(i))return Object(l.a)(this._primitive)&&(this._primitive.show=!1),void(Object(l.a)(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));const o=JP.getValueOrDefault(n.fill,e,!0),a=JP.getValueOrDefault(n.outline,e,!1),u=JP.getValueOrClonedDefault(n.outlineColor,e,sp.BLACK,Cce),h=_z.getValue(e,Object(c.a)(n.material,Oce),this._material),d=JP.getValueOrUndefined(n.innerRadii,e,Tce),f=JP.getValueOrUndefined(n.minimumClock,e),p=JP.getValueOrUndefined(n.maximumClock,e),m=JP.getValueOrUndefined(n.minimumCone,e),g=JP.getValueOrUndefined(n.maximumCone,e),_=JP.getValueOrUndefined(n.stackPartitions,e),y=JP.getValueOrUndefined(n.slicePartitions,e),b=JP.getValueOrUndefined(n.subdivisions,e),v=JP.getValueOrDefault(n.outlineWidth,e,1),w=JP.getValueOrDefault(n.heightReference,e,qP.NONE),A=w!==qP.NONE?eu.ALL:void 0,E=this._scene.mode,T=E===AB.SCENE3D&&w===qP.NONE,C=this._options,x=this._geometryUpdater.shadowsProperty.getValue(e),S=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),I=JP.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,wce,Ace);if(!T||this._lastSceneMode!==E||!Object(l.a)(this._primitive)||C.stackPartitions!==_||C.slicePartitions!==y||Object(l.a)(d)&&!O.equals(C.innerRadii!==d)||C.minimumClock!==f||C.maximumClock!==p||C.minimumCone!==m||C.maximumCone!==g||C.subdivisions!==b||this._lastOutlineWidth!==v||C.offsetAttribute!==A){const t=this._primitives;if(t.removeAndDestroy(this._primitive),t.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=v,C.stackPartitions=_,C.slicePartitions=y,C.subdivisions=b,C.offsetAttribute=A,C.radii=O.clone(T?xce:i,C.radii),Object(l.a)(d))if(T){const e=O.magnitude(i);C.innerRadii=O.fromElements(d.x/e,d.y/e,d.z/e,C.innerRadii)}else C.innerRadii=O.clone(d,C.innerRadii);else C.innerRadii=void 0;C.minimumClock=f,C.maximumClock=p,C.minimumCone=m,C.maximumCone=g;const n=new SR({material:h,translucent:h.isTranslucent(),closed:!0});C.vertexFormat=n.vertexFormat;const r=this._geometryUpdater.createFillGeometryInstance(e,T,this._modelMatrix);this._primitive=t.add(new hF({geometryInstances:r,appearance:n,asynchronous:!1,shadows:x}));const s=this._geometryUpdater.createOutlineGeometryInstance(e,T,this._modelMatrix);this._outlinePrimitive=t.add(new hF({geometryInstances:s,appearance:new MR({flat:!0,translucent:255!==s.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(v)}}),asynchronous:!1,shadows:x})),this._lastShow=o,this._lastOutlineShow=a,this._lastOutlineColor=sp.clone(u,this._lastOutlineColor),this._lastDistanceDisplayCondition=S,this._lastOffset=O.clone(I,this._lastOffset)}else if(this._primitive.ready){const e=this._primitive,n=this._outlinePrimitive;e.show=!0,n.show=!0,e.appearance.material=h;let i=this._attributes;Object(l.a)(i)||(i=e.getGeometryInstanceAttributes(t),this._attributes=i),o!==this._lastShow&&(i.show=QS.toValue(o,i.show),this._lastShow=o);let r=this._outlineAttributes;Object(l.a)(r)||(r=n.getGeometryInstanceAttributes(t),this._outlineAttributes=r),a!==this._lastOutlineShow&&(r.show=QS.toValue(a,r.show),this._lastOutlineShow=a),sp.equals(u,this._lastOutlineColor)||(r.color=lp.toValue(u,r.color),sp.clone(u,this._lastOutlineColor)),eb.equals(S,this._lastDistanceDisplayCondition)||(i.distanceDisplayCondition=nb.toValue(S,i.distanceDisplayCondition),r.distanceDisplayCondition=nb.toValue(S,r.distanceDisplayCondition),eb.clone(S,this._lastDistanceDisplayCondition)),O.equals(I,this._lastOffset)||(i.offset=HE.toValue(I,i.offset),r.offset=HE.toValue(I,i.offset),O.clone(I,this._lastOffset))}T&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=Me.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var Dce=Ice;const Rce=new O,jce=new sp;function Mce(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Lce(e,t){iU.call(this,{entity:e,scene:t,geometryOptions:new Mce(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}function Nce(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(Lce.prototype=Object.create(iU.prototype),Lce.prototype.constructor=Lce),Lce.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e);let i,r;const o=new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=nb.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,jce)),Object(l.a)(t)||(t=sp.WHITE),r=lp.fromColor(t),i={show:o,distanceDisplayCondition:c,color:r}}else i={show:o,distanceDisplayCondition:c};const h=t.plane,d=this._options;let f=t.computeModelMatrix(e);const p=JP.getValueOrDefault(h.plane,e,d.plane),m=JP.getValueOrUndefined(h.dimensions,e,d.dimensions);return d.plane=p,d.dimensions=m,f=Gce(p,m,f,f),new Ph({id:t,geometry:new dT(this._options),modelMatrix:f,attributes:i})},Lce.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,jce),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,a=this._options;let c=t.computeModelMatrix(e);const l=JP.getValueOrDefault(o.plane,e,a.plane),h=JP.getValueOrUndefined(o.dimensions,e,a.dimensions);return a.plane=l,a.dimensions=h,c=Gce(l,h,c,c),new Ph({id:t,geometry:new gT,modelMatrix:c,attributes:{show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r)}})},Lce.prototype._isHidden=function(e,t){return!Object(l.a)(t.plane)||!Object(l.a)(t.dimensions)||!Object(l.a)(e.position)||iU.prototype._isHidden.call(this,e,t)},Lce.prototype._getIsClosed=function(e){return!1},Lce.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&JP.isConstant(e.orientation)&&t.plane.isConstant&&t.dimensions.isConstant&&JP.isConstant(t.outlineWidth))},Lce.prototype._setStaticOptions=function(e,t){const n=this._materialProperty instanceof NR,i=this._options;i.vertexFormat=n?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(JA.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(JA.MINIMUM_VALUE,i.dimensions)},Lce.DynamicGeometryUpdater=Nce,Object(l.a)(Object.create)&&(Nce.prototype=Object.create(bz.prototype),Nce.prototype.constructor=Nce),Nce.prototype._isHidden=function(e,t,n){const i=this._options,r=JP.getValueOrUndefined(e.position,n,Rce);return!Object(l.a)(r)||!Object(l.a)(i.plane)||!Object(l.a)(i.dimensions)||bz.prototype._isHidden.call(this,e,t,n)},Nce.prototype._setOptions=function(e,t,n){const i=this._options;i.plane=JP.getValueOrDefault(t.plane,n,i.plane),i.dimensions=JP.getValueOrUndefined(t.dimensions,n,i.dimensions)};const Bce=new O,Fce=new O,zce=new O,kce=new O,Uce=new ce,Vce=new ce,Hce=new Me;function Gce(e,t,n,i){const r=e.normal,o=e.distance,a=O.multiplyByScalar(r,-o,zce);let s=O.clone(O.UNIT_Z,Fce);h.a.equalsEpsilon(Math.abs(O.dot(s,r)),1,h.a.EPSILON8)&&(s=O.clone(O.UNIT_Y,s));const c=O.cross(s,r,Bce);s=O.cross(r,c,s),O.normalize(c,c),O.normalize(s,s);const l=Uce;ce.setColumn(l,0,c,l),ce.setColumn(l,1,s,l),ce.setColumn(l,2,r,l);const u=O.fromElements(t.x,t.y,1,kce),d=ce.multiplyByScale(l,u,Vce),f=Me.fromRotationTranslation(d,a,Hce);return Me.multiplyTransformation(n,f,i)}Lce.createPrimitiveMatrix=Gce;var qce=Lce;const Wce=new sp,Yce=O.ZERO,Xce=new O,Kce=new Be,Jce=[],Zce=new Vt;function $ce(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function Qce(e,t){Ere.call(this,{entity:e,scene:t,geometryOptions:new $ce(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function ele(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(Qce.prototype=Object.create(Ere.prototype),Qce.prototype.constructor=Qce),Qce.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nb.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,Wce)),Object(l.a)(t)||(t=sp.WHITE),r.color=lp.fromColor(t)}let o;return Object(l.a)(i.offsetAttribute)&&(r.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,Yce,Xce))),o=i.perPositionHeight&&!Object(l.a)(i.extrudedHeight)?new Gm(i):new $T(i),new Ph({id:t,geometry:o,attributes:r})},Qce.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=this._options,r=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,Wce),o=this._distanceDisplayConditionProperty.getValue(e),a={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(r),distanceDisplayCondition:nb.fromDistanceDisplayCondition(o),offset:void 0};let c;return Object(l.a)(i.offsetAttribute)&&(a.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,Yce,Xce))),c=i.perPositionHeight&&!Object(l.a)(i.extrudedHeight)?new Xm(i):new sC(i),new Ph({id:t,geometry:c,attributes:a})},Qce.prototype._computeCenter=function(e,t){const n=JP.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!Object(l.a)(n))return;const i=n.positions;if(0===i.length)return;const r=this._scene.mapProjection.ellipsoid,o=ma.fromPoints(i,r),a=o.projectPointsOntoPlane(i,Jce),s=a.length;let c=0,u=s-1,h=new Vt;for(let e=0;e<s;u=e++){const t=a[e],n=a[u],i=t.x*n.y-n.x*t.y;let r=Vt.add(t,n,Zce);r=Vt.multiplyByScalar(r,i,r),h=Vt.add(h,r,h),c+=i}const d=1/(3*c);return h=Vt.multiplyByScalar(h,d,h),o.projectPointOntoEllipsoid(h,t)},Qce.prototype._isHidden=function(e,t){return!Object(l.a)(t.hierarchy)||iU.prototype._isHidden.call(this,e,t)},Qce.prototype._isOnTerrain=function(e,t){const n=Ere.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=Object(l.a)(i)&&(!i.isConstant||i.getValue(JA.MINIMUM_VALUE));return n&&!r},Qce.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!JP.isConstant(t.height)||!JP.isConstant(t.extrudedHeight)||!JP.isConstant(t.granularity)||!JP.isConstant(t.stRotation)||!JP.isConstant(t.textureCoordinates)||!JP.isConstant(t.outlineWidth)||!JP.isConstant(t.perPositionHeight)||!JP.isConstant(t.closeTop)||!JP.isConstant(t.closeBottom)||!JP.isConstant(t.zIndex)||!JP.isConstant(t.arcType)||this._onTerrain&&!JP.isConstant(this._materialProperty)&&!(this._materialProperty instanceof NR)},Qce.prototype._setStaticOptions=function(e,t){const n=this._materialProperty instanceof NR,i=this._options;i.vertexFormat=n?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat;const r=t.hierarchy.getValue(JA.MINIMUM_VALUE);let o=JP.getValueOrUndefined(t.height,JA.MINIMUM_VALUE);const a=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE);let s=JP.getValueOrUndefined(t.extrudedHeight,JA.MINIMUM_VALUE);const c=JP.getValueOrDefault(t.extrudedHeightReference,JA.MINIMUM_VALUE,qP.NONE),u=JP.getValueOrDefault(t.perPositionHeight,JA.MINIMUM_VALUE,!1);let h;o=Ere.getGeometryHeight(o,a),u?(Object(l.a)(o)&&(o=void 0,cl("Entity polygons cannot have both height and perPositionHeight.  height will be ignored")),a!==qP.NONE&&u&&(o=void 0,cl("heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored"))):(Object(l.a)(s)&&!Object(l.a)(o)&&(o=0),h=Ere.computeGeometryOffsetAttribute(o,a,s,c)),i.polygonHierarchy=r,i.granularity=JP.getValueOrUndefined(t.granularity,JA.MINIMUM_VALUE),i.stRotation=JP.getValueOrUndefined(t.stRotation,JA.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=JP.getValueOrDefault(t.closeTop,JA.MINIMUM_VALUE,!0),i.closeBottom=JP.getValueOrDefault(t.closeBottom,JA.MINIMUM_VALUE,!0),i.offsetAttribute=h,i.height=o,i.arcType=JP.getValueOrDefault(t.arcType,JA.MINIMUM_VALUE,vl.GEODESIC),i.textureCoordinates=JP.getValueOrUndefined(t.textureCoordinates,JA.MINIMUM_VALUE),s=Ere.getGeometryExtrudedHeight(s,c),s===Ere.CLAMP_TO_GROUND&&(s=nn.getMinimumMaximumHeights($T.computeRectangle(i,Kce)).minimumTerrainHeight),i.extrudedHeight=s},Qce.prototype._getIsClosed=function(e){const t=e.height,n=e.extrudedHeight,i=Object(l.a)(n)&&n!==t;return!e.perPositionHeight&&(!i&&0===t||i&&e.closeTop&&e.closeBottom)},Qce.DynamicGeometryUpdater=ele,Object(l.a)(Object.create)&&(ele.prototype=Object.create(bz.prototype),ele.prototype.constructor=ele),ele.prototype._isHidden=function(e,t,n){return!Object(l.a)(this._options.polygonHierarchy)||bz.prototype._isHidden.call(this,e,t,n)},ele.prototype._setOptions=function(e,t,n){const i=this._options;i.polygonHierarchy=JP.getValueOrUndefined(t.hierarchy,n);let r=JP.getValueOrUndefined(t.height,n);const o=JP.getValueOrDefault(t.heightReference,n,qP.NONE),a=JP.getValueOrDefault(t.extrudedHeightReference,n,qP.NONE);let s=JP.getValueOrUndefined(t.extrudedHeight,n);const c=JP.getValueOrUndefined(t.perPositionHeight,n);let u;r=Ere.getGeometryHeight(r,a),c?(Object(l.a)(r)&&(r=void 0,cl("Entity polygons cannot have both height and perPositionHeight.  height will be ignored")),o!==qP.NONE&&c&&(r=void 0,cl("heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored"))):(Object(l.a)(s)&&!Object(l.a)(r)&&(r=0),u=Ere.computeGeometryOffsetAttribute(r,o,s,a)),i.granularity=JP.getValueOrUndefined(t.granularity,n),i.stRotation=JP.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=JP.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=JP.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=JP.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=JP.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=JP.getValueOrDefault(t.arcType,n,vl.GEODESIC),s=Ere.getGeometryExtrudedHeight(s,a),s===Ere.CLAMP_TO_GROUND&&(s=nn.getMinimumMaximumHeights($T.computeRectangle(i,Kce)).minimumTerrainHeight),i.extrudedHeight=s};var tle=Qce;const nle=new sp;function ile(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function rle(e,t){iU.call(this,{entity:e,scene:t,geometryOptions:new ile(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function ole(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(rle.prototype=Object.create(iU.prototype),rle.prototype.constructor=rle),rle.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e);let i,r;const o=new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=nb.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,nle)),Object(l.a)(t)||(t=sp.WHITE),r=lp.fromColor(t),i={show:o,distanceDisplayCondition:c,color:r}}else i={show:o,distanceDisplayCondition:c};return new Ph({id:t,geometry:new EC(this._options),attributes:i})},rle.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,nle),r=this._distanceDisplayConditionProperty.getValue(e);return new Ph({id:t,geometry:new IC(this._options),attributes:{show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r)}})},rle.prototype._isHidden=function(e,t){return!Object(l.a)(t.positions)||!Object(l.a)(t.shape)||iU.prototype._isHidden.call(this,e,t)},rle.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&t.shape.isConstant&&JP.isConstant(t.granularity)&&JP.isConstant(t.outlineWidth)&&JP.isConstant(t.cornerType))},rle.prototype._setStaticOptions=function(e,t){const n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof NR;r.vertexFormat=o?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(JA.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(JA.MINIMUM_VALUE,r.shape),r.granularity=Object(l.a)(n)?n.getValue(JA.MINIMUM_VALUE):void 0,r.cornerType=Object(l.a)(i)?i.getValue(JA.MINIMUM_VALUE):void 0},rle.DynamicGeometryUpdater=ole,Object(l.a)(Object.create)&&(ole.prototype=Object.create(bz.prototype),ole.prototype.constructor=ole),ole.prototype._isHidden=function(e,t,n){const i=this._options;return!Object(l.a)(i.polylinePositions)||!Object(l.a)(i.shapePositions)||bz.prototype._isHidden.call(this,e,t,n)},ole.prototype._setOptions=function(e,t,n){const i=this._options;i.polylinePositions=JP.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=JP.getValueOrUndefined(t.shape,n),i.granularity=JP.getValueOrUndefined(t.granularity,n),i.cornerType=JP.getValueOrUndefined(t.cornerType,n)};var ale=rle;const sle=new sp,cle=O.ZERO,lle=new O,ule=new Be,hle=new Be,dle=new R;function fle(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function ple(e,t){Ere.call(this,{entity:e,scene:t,geometryOptions:new fle(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function mle(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(ple.prototype=Object.create(Ere.prototype),ple.prototype.constructor=ple),ple.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:nb.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,sle)),Object(l.a)(t)||(t=sp.WHITE),i.color=lp.fromColor(t)}return Object(l.a)(this._options.offsetAttribute)&&(i.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,cle,lle))),new Ph({id:t,geometry:new Dx(this._options),attributes:i})},ple.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,sle),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r),offset:void 0};return Object(l.a)(this._options.offsetAttribute)&&(o.offset=HE.fromCartesian3(JP.getValueOrDefault(this._terrainOffsetProperty,e,cle,lle))),new Ph({id:t,geometry:new Vx(this._options),attributes:o})},ple.prototype._computeCenter=function(e,t){const n=JP.getValueOrUndefined(this._entity.rectangle.coordinates,e,hle);if(!Object(l.a)(n))return;const i=Be.center(n,dle);return R.toCartesian(i,H.WGS84,t)},ple.prototype._isHidden=function(e,t){return!Object(l.a)(t.coordinates)||iU.prototype._isHidden.call(this,e,t)},ple.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!JP.isConstant(t.height)||!JP.isConstant(t.extrudedHeight)||!JP.isConstant(t.granularity)||!JP.isConstant(t.stRotation)||!JP.isConstant(t.rotation)||!JP.isConstant(t.outlineWidth)||!JP.isConstant(t.zIndex)||this._onTerrain&&!JP.isConstant(this._materialProperty)&&!(this._materialProperty instanceof NR)},ple.prototype._setStaticOptions=function(e,t){const n=this._materialProperty instanceof NR;let i=JP.getValueOrUndefined(t.height,JA.MINIMUM_VALUE);const r=JP.getValueOrDefault(t.heightReference,JA.MINIMUM_VALUE,qP.NONE);let o=JP.getValueOrUndefined(t.extrudedHeight,JA.MINIMUM_VALUE);const a=JP.getValueOrDefault(t.extrudedHeightReference,JA.MINIMUM_VALUE,qP.NONE);Object(l.a)(o)&&!Object(l.a)(i)&&(i=0);const s=this._options;s.vertexFormat=n?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(JA.MINIMUM_VALUE,s.rectangle),s.granularity=JP.getValueOrUndefined(t.granularity,JA.MINIMUM_VALUE),s.stRotation=JP.getValueOrUndefined(t.stRotation,JA.MINIMUM_VALUE),s.rotation=JP.getValueOrUndefined(t.rotation,JA.MINIMUM_VALUE),s.offsetAttribute=Ere.computeGeometryOffsetAttribute(i,r,o,a),s.height=Ere.getGeometryHeight(i,r),o=Ere.getGeometryExtrudedHeight(o,a),o===Ere.CLAMP_TO_GROUND&&(o=nn.getMinimumMaximumHeights(Dx.computeRectangle(s,ule)).minimumTerrainHeight),s.extrudedHeight=o},ple.DynamicGeometryUpdater=mle,Object(l.a)(Object.create)&&(mle.prototype=Object.create(bz.prototype),mle.prototype.constructor=mle),mle.prototype._isHidden=function(e,t,n){return!Object(l.a)(this._options.rectangle)||bz.prototype._isHidden.call(this,e,t,n)},mle.prototype._setOptions=function(e,t,n){const i=this._options;let r=JP.getValueOrUndefined(t.height,n);const o=JP.getValueOrDefault(t.heightReference,n,qP.NONE);let a=JP.getValueOrUndefined(t.extrudedHeight,n);const s=JP.getValueOrDefault(t.extrudedHeightReference,n,qP.NONE);Object(l.a)(a)&&!Object(l.a)(r)&&(r=0),i.rectangle=JP.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=JP.getValueOrUndefined(t.granularity,n),i.stRotation=JP.getValueOrUndefined(t.stRotation,n),i.rotation=JP.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Ere.computeGeometryOffsetAttribute(r,o,a,s),i.height=Ere.getGeometryHeight(r,o),a=Ere.getGeometryExtrudedHeight(a,s),a===Ere.CLAMP_TO_GROUND&&(a=nn.getMinimumMaximumHeights(Dx.computeRectangle(i,ule)).minimumTerrainHeight),i.extrudedHeight=a};var gle=ple;const _le=new sp,yle=new eb,ble=new eb,vle=O.ZERO,Ole=new O;function wle(e,t,n,i,r,o,a){let s;this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tl,this.updaters=new Tl,this.updatersWithAttributes=new Tl,this.attributes=new Tl,this.subscriptions=new Tl,this.showsUpdated=new Tl,this.itemsToRemove=[],this.invalidated=!1,Object(l.a)(r)&&(s=r.definitionChanged.addEventListener(wle.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}function Ale(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}function Ele(e,t){for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.remove(t))return 0===i.updaters.length&&(e.splice(n,1),i.destroy()),!0}return!1}function Tle(e,t,n){let i=!1;const r=t.length;for(let o=0;o<r;++o){const r=t[o],a=r.itemsToRemove,s=a.length;if(s>0)for(o=0;o<s;o++){const t=a[o];r.remove(t),e.add(n,t),i=!0}}return i}function Cle(e,t,n,i){let r,o=t.length;for(r=o-1;r>=0;r--){const i=t[r];if(i.invalidated){t.splice(r,1);const o=i.updaters.values,a=o.length;for(let t=0;t<a;t++)e.add(n,o[t]);i.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}function xle(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(i.contains(t))return i.getBoundingSphere(t,n)}return XP.FAILED}function Sle(e){const t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}wle.prototype.onMaterialChanged=function(){this.invalidated=!0},wle.prototype.isMaterial=function(e){const t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t||!!Object(l.a)(t)&&t.equals(n)},wle.prototype.add=function(e,t){const n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&JP.isConstant(e.distanceDisplayConditionProperty)&&JP.isConstant(e.terrainOffsetProperty)){const t=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener((function(n,i,r,o){"isShowing"===i&&t.showsUpdated.set(e.id,e)})))}else this.updatersWithAttributes.set(n,e)},wle.prototype.remove=function(e){const t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);const e=this.subscriptions.get(t);return Object(l.a)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},wle.prototype.update=function(e){let t=!0,n=0,i=this.primitive;const r=this.primitives;let o;if(this.createPrimitive){const n=this.geometry.values;if(n.length>0){let o;Object(l.a)(i)&&(Object(l.a)(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),Object(l.a)(this.depthFailAppearanceType)&&(Object(l.a)(this.depthFailMaterialProperty)&&(this.depthFailMaterial=_z.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),o=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new hF({show:!1,asynchronous:!0,geometryInstances:n.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:o,shadows:this.shadows}),r.add(i),t=!1}else{Object(l.a)(i)&&(r.remove(i),i=void 0);const e=this.oldPrimitive;Object(l.a)(e)&&(r.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(Object(l.a)(i)&&i.ready){i.show=!0,Object(l.a)(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),!Object(l.a)(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof NR||(this.depthFailMaterial=_z.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);const t=this.updatersWithAttributes.values,a=t.length,s=this.waitingOnCreate;for(o=0;o<a;o++){const r=t[o],a=this.geometry.get(r.id);let c=this.attributes.get(a.id.id);if(Object(l.a)(c)||(c=i.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,c)),!r.fillMaterialProperty.isConstant||s){const t=r.fillMaterialProperty.color,i=JP.getValueOrDefault(t,e,sp.WHITE,_le);sp.equals(c._lastColor,i)||(c._lastColor=sp.clone(i,c._lastColor),c.color=lp.toValue(i,c.color),(this.translucent&&255===c.color[3]||!this.translucent&&255!==c.color[3])&&(this.itemsToRemove[n++]=r))}if(Object(l.a)(this.depthFailAppearanceType)&&r.depthFailMaterialProperty instanceof NR&&(!r.depthFailMaterialProperty.isConstant||s)){const t=r.depthFailMaterialProperty.color,n=JP.getValueOrDefault(t,e,sp.WHITE,_le);sp.equals(c._lastDepthFailColor,n)||(c._lastDepthFailColor=sp.clone(n,c._lastDepthFailColor),c.depthFailColor=lp.toValue(n,c.depthFailColor))}const u=r.entity.isShowing&&(r.hasConstantFill||r.isFilled(e));u!==(1===c.show[0])&&(c.show=QS.toValue(u,c.show));const h=r.distanceDisplayConditionProperty;if(!JP.isConstant(h)){const t=JP.getValueOrDefault(h,e,ble,yle);eb.equals(t,c._lastDistanceDisplayCondition)||(c._lastDistanceDisplayCondition=eb.clone(t,c._lastDistanceDisplayCondition),c.distanceDisplayCondition=nb.toValue(t,c.distanceDisplayCondition))}const d=r.terrainOffsetProperty;if(!JP.isConstant(d)){const t=JP.getValueOrDefault(d,e,vle,Ole);O.equals(t,c._lastOffset)||(c._lastOffset=O.clone(t,c._lastOffset),c.offset=HE.toValue(t,c.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else Object(l.a)(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t},wle.prototype.updateShows=function(e){const t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){const n=t[i],r=this.geometry.get(n.id);let o=this.attributes.get(r.id.id);Object(l.a)(o)||(o=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,o));const a=n.entity.isShowing;a!==(1===o.show[0])&&(o.show=QS.toValue(a,o.show),r.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},wle.prototype.contains=function(e){return this.updaters.contains(e.id)},wle.prototype.getBoundingSphere=function(e,t){const n=this.primitive;if(!n.ready)return XP.PENDING;const i=n.getGeometryInstanceAttributes(e.entity);return!Object(l.a)(i)||!Object(l.a)(i.boundingSphere)||Object(l.a)(i.show)&&0===i.show[0]?XP.FAILED:(i.boundingSphere.clone(t),XP.DONE)},wle.prototype.destroy=function(){const e=this.primitive,t=this.primitives;Object(l.a)(e)&&t.remove(e);const n=this.oldPrimitive;Object(l.a)(n)&&t.remove(n),Object(l.a)(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},Ale.prototype.add=function(e,t){let n,i;const r=t.createFillGeometryInstance(e);255===r.attributes.color.value[3]?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);const o=n.length;for(let e=0;e<o;e++){const i=n[e];if(i.isMaterial(t))return void i.add(t,r)}const a=new wle(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,r),n.push(a)},Ale.prototype.remove=function(e){Ele(this._solidItems,e)||Ele(this._translucentItems,e)},Ale.prototype.update=function(e){let t=Cle(this,this._solidItems,e,!0);t=Cle(this,this._translucentItems,e,t)&&t;const n=Tle(this,this._solidItems,e),i=Tle(this,this._translucentItems,e);return(n||i)&&(t=Cle(this,this._solidItems,e,t)&&t,t=Cle(this,this._translucentItems,e,t)&&t),t},Ale.prototype.getBoundingSphere=function(e,t){const n=xle(this._solidItems,e,t);return n===XP.FAILED?xle(this._translucentItems,e,t):n},Ale.prototype.removeAllPrimitives=function(){Sle(this._solidItems),Sle(this._translucentItems)};var Ile=Ale;const Ple=new eb,Dle=new eb,Rle=O.ZERO,jle=new O;function Mle(e,t,n,i,r,o,a){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=a,this.updaters=new Tl,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tl,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Tl,this.attributes=new Tl,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Mle.prototype.onMaterialChanged,this),this.subscriptions=new Tl,this.showsUpdated=new Tl}Mle.prototype.onMaterialChanged=function(){this.invalidated=!0},Mle.prototype.isMaterial=function(e){const t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=Object(l.a)(t)&&t.equals(n);return o=(!Object(l.a)(i)&&!Object(l.a)(r)||Object(l.a)(i)&&i.equals(r))&&o,o},Mle.prototype.add=function(e,t){const n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&JP.isConstant(t.distanceDisplayConditionProperty)&&JP.isConstant(t.terrainOffsetProperty)){const e=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener((function(n,i,r,o){"isShowing"===i&&e.showsUpdated.set(t.id,t)})))}else this.updatersWithAttributes.set(n,t);this.createPrimitive=!0},Mle.prototype.remove=function(e){const t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);const e=this.subscriptions.get(t);return Object(l.a)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};const Lle=new sp;function Nle(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}Mle.prototype.update=function(e){let t=!0,n=this.primitive;const i=this.primitives,r=this.geometry.values;let o;if(this.createPrimitive){if(r.length>0){let o;Object(l.a)(n)&&(Object(l.a)(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=_z.getValue(e,this.materialProperty,this.material),Object(l.a)(this.depthFailMaterialProperty)&&(this.depthFailMaterial=_z.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),o=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new hF({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:o,shadows:this.shadows}),i.add(n),t=!1}else{Object(l.a)(n)&&(i.remove(n),n=void 0);const e=this.oldPrimitive;Object(l.a)(e)&&(i.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(Object(l.a)(n)&&n.ready){n.show=!0,Object(l.a)(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=_z.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!Object(l.a)(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof NR||(this.depthFailMaterial=_z.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);const t=this.updatersWithAttributes.values,r=t.length;for(o=0;o<r;o++){const i=t[o],r=i.entity,a=this.geometry.get(i.id);let s=this.attributes.get(a.id.id);if(Object(l.a)(s)||(s=n.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s)),Object(l.a)(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof NR&&!i.depthFailMaterialProperty.isConstant){const t=i.depthFailMaterialProperty.color,n=JP.getValueOrDefault(t,e,sp.WHITE,Lle);sp.equals(s._lastDepthFailColor,n)||(s._lastDepthFailColor=sp.clone(n,s._lastDepthFailColor),s.depthFailColor=lp.toValue(n,s.depthFailColor))}const c=r.isShowing&&(i.hasConstantFill||i.isFilled(e));c!==(1===s.show[0])&&(s.show=QS.toValue(c,s.show));const u=i.distanceDisplayConditionProperty;if(!JP.isConstant(u)){const t=JP.getValueOrDefault(u,e,Dle,Ple);eb.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=eb.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nb.toValue(t,s.distanceDisplayCondition))}const h=i.terrainOffsetProperty;if(!JP.isConstant(h)){const t=JP.getValueOrDefault(h,e,Rle,jle);O.equals(t,s._lastOffset)||(s._lastOffset=O.clone(t,s._lastOffset),s.offset=HE.toValue(t,s.offset))}}this.updateShows(n)}else Object(l.a)(n)&&!n.ready&&(t=!1);return t},Mle.prototype.updateShows=function(e){const t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){const n=t[i],r=n.entity,o=this.geometry.get(n.id);let a=this.attributes.get(o.id.id);Object(l.a)(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));const s=r.isShowing;s!==(1===a.show[0])&&(a.show=QS.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},Mle.prototype.contains=function(e){return this.updaters.contains(e.id)},Mle.prototype.getBoundingSphere=function(e,t){const n=this.primitive;if(!n.ready)return XP.PENDING;const i=n.getGeometryInstanceAttributes(e.entity);return!Object(l.a)(i)||!Object(l.a)(i.boundingSphere)||Object(l.a)(i.show)&&0===i.show[0]?XP.FAILED:(i.boundingSphere.clone(t),XP.DONE)},Mle.prototype.destroy=function(){const e=this.primitive,t=this.primitives;Object(l.a)(e)&&t.remove(e);const n=this.oldPrimitive;Object(l.a)(n)&&t.remove(n),this.removeMaterialSubscription()},Nle.prototype.add=function(e,t){const n=this._items,i=n.length;for(let r=0;r<i;r++){const i=n[r];if(i.isMaterial(t))return void i.add(e,t)}const r=new Mle(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)},Nle.prototype.remove=function(e){const t=this._items;for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.remove(e)){0===i.updaters.length&&(t.splice(n,1),i.destroy());break}}},Nle.prototype.update=function(e){let t;const n=this._items;for(t=n.length-1;t>=0;t--){const i=n[t];if(i.invalidated){n.splice(t,1);const r=i.updaters.values,o=r.length;for(let t=0;t<o;t++)this.add(e,r[t]);i.destroy()}}let i=!0;for(t=0;t<n.length;t++)i=n[t].update(e)&&i;return i},Nle.prototype.getBoundingSphere=function(e,t){const n=this._items,i=n.length;for(let r=0;r<i;r++){const i=n[r];if(i.contains(e))return i.getBoundingSphere(e,t)}return XP.FAILED},Nle.prototype.removeAllPrimitives=function(){const e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Ble=Nle;const Fle=new sp,zle=new eb,kle=new eb;function Ule(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tl,this.updaters=new Tl,this.updatersWithAttributes=new Tl,this.attributes=new Tl,this.subscriptions=new Tl,this.showsUpdated=new Tl,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new VC}function Vle(e,t){this._batches=[],this._primitives=e,this._classificationType=t}Ule.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},Ule.prototype.add=function(e,t){const n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&JP.isConstant(e.distanceDisplayConditionProperty)){const t=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener((function(n,i,r,o){"isShowing"===i&&t.showsUpdated.set(e.id,e)})))}else this.updatersWithAttributes.set(n,e)},Ule.prototype.remove=function(e){const t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);const e=this.subscriptions.get(t);return Object(l.a)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Ule.prototype.update=function(e){let t=!0;let n=this.primitive;const i=this.primitives;let r;if(this.createPrimitive){const e=this.geometry.values;if(e.length>0)Object(l.a)(n)&&(Object(l.a)(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new mz({show:!1,asynchronous:!0,geometryInstances:e.slice(),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{Object(l.a)(n)&&(i.remove(n),n=void 0);const e=this.oldPrimitive;Object(l.a)(e)&&(i.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(Object(l.a)(n)&&n.ready){n.show=!0,Object(l.a)(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0);const t=this.updatersWithAttributes.values,o=t.length,a=this.waitingOnCreate;for(r=0;r<o;r++){const i=t[r],o=this.geometry.get(i.id);let s=this.attributes.get(o.id.id);if(Object(l.a)(s)||(s=n.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s)),!i.fillMaterialProperty.isConstant||a){const t=i.fillMaterialProperty.color,n=JP.getValueOrDefault(t,e,sp.WHITE,Fle);sp.equals(s._lastColor,n)||(s._lastColor=sp.clone(n,s._lastColor),s.color=lp.toValue(n,s.color))}const c=i.entity.isShowing&&(i.hasConstantFill||i.isFilled(e));c!==(1===s.show[0])&&(s.show=QS.toValue(c,s.show));const u=i.distanceDisplayConditionProperty;if(!JP.isConstant(u)){const t=JP.getValueOrDefault(u,e,kle,zle);eb.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=eb.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nb.toValue(t,s.distanceDisplayCondition))}}this.updateShows(n),this.waitingOnCreate=!1}else Object(l.a)(n)&&!n.ready&&(t=!1);return this.itemsToRemove.length=0,t},Ule.prototype.updateShows=function(e){const t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){const n=t[i],r=this.geometry.get(n.id);let o=this.attributes.get(r.id.id);Object(l.a)(o)||(o=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,o));const a=n.entity.isShowing;a!==(1===o.show[0])&&(o.show=QS.toValue(a,o.show),r.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Ule.prototype.contains=function(e){return this.updaters.contains(e.id)},Ule.prototype.getBoundingSphere=function(e,t){const n=this.primitive;if(!n.ready)return XP.PENDING;const i=n.getBoundingSphere(e.entity);return Object(l.a)(i)?(i.clone(t),XP.DONE):XP.FAILED},Ule.prototype.removeAllPrimitives=function(){const e=this.primitives,t=this.primitive;Object(l.a)(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());const n=this.oldPrimitive;Object(l.a)(n)&&(e.remove(n),this.oldPrimitive=void 0)},Vle.prototype.add=function(e,t){const n=t.createFillGeometryInstance(e),i=this._batches,r=JP.getValueOrDefault(t.zIndex,0);let o;const a=i.length;for(let e=0;e<a;++e){const t=i[e];if(t.zIndex===r&&!t.overlapping(n.geometry.rectangle)){o=t;break}}return Object(l.a)(o)||(o=new Ule(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o},Vle.prototype.remove=function(e){const t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return},Vle.prototype.update=function(e){let t,n,i=!0;const r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){const i=r[t],o=i.itemsToRemove,a=o.length;for(let t=0;t<a;t++){n=o[t],i.remove(n);const r=this.add(e,n);i.isDirty=!0,r.isDirty=!0}}for(t=o-1;t>=0;--t){const n=r[t];n.isDirty&&(i=r[t].update(e)&&i,n.isDirty=!1),0===n.geometry.length&&r.splice(t,1)}return i},Vle.prototype.getBoundingSphere=function(e,t){const n=this._batches,i=n.length;for(let r=0;r<i;++r){const i=n[r];if(i.contains(e))return i.getBoundingSphere(e,t)}return XP.FAILED},Vle.prototype.removeAllPrimitives=function(){const e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var Hle=Vle;const Gle=new eb,qle=new eb;function Wle(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Tl,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tl,this.material=void 0,this.updatersWithAttributes=new Tl,this.attributes=new Tl,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Wle.prototype.onMaterialChanged,this),this.subscriptions=new Tl,this.showsUpdated=new Tl,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new VC}function Yle(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}Wle.prototype.onMaterialChanged=function(){this.invalidated=!0},Wle.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},Wle.prototype.isMaterial=function(e){const t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof NR&&t instanceof NR||Object(l.a)(t)&&t.equals(n)},Wle.prototype.add=function(e,t,n){const i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&JP.isConstant(t.distanceDisplayConditionProperty)){const e=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener((function(n,i,r,o){"isShowing"===i&&e.showsUpdated.set(t.id,t)})))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},Wle.prototype.remove=function(e){const t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);const e=this.subscriptions.get(t);return Object(l.a)(e)&&(e(),this.subscriptions.remove(t)),!0}return!1},Wle.prototype.update=function(e){let t=!0,n=this.primitive;const i=this.primitives,r=this.geometry.values;let o;if(this.createPrimitive){if(r.length>0)Object(l.a)(n)&&(Object(l.a)(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=_z.getValue(e,this.materialProperty,this.material),n=new mz({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{Object(l.a)(n)&&(i.remove(n),n=void 0);const e=this.oldPrimitive;Object(l.a)(e)&&(i.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(Object(l.a)(n)&&n.ready){n.show=!0,Object(l.a)(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=_z.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;const t=this.updatersWithAttributes.values,r=t.length;for(o=0;o<r;o++){const i=t[o],r=i.entity,a=this.geometry.get(i.id);let s=this.attributes.get(a.id.id);Object(l.a)(s)||(s=n.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));const c=r.isShowing&&(i.hasConstantFill||i.isFilled(e));c!==(1===s.show[0])&&(s.show=QS.toValue(c,s.show));const u=i.distanceDisplayConditionProperty;if(!JP.isConstant(u)){const t=JP.getValueOrDefault(u,e,qle,Gle);eb.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=eb.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nb.toValue(t,s.distanceDisplayCondition))}}this.updateShows(n)}else Object(l.a)(n)&&!n.ready&&(t=!1);return t},Wle.prototype.updateShows=function(e){const t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){const n=t[i],r=n.entity,o=this.geometry.get(n.id);let a=this.attributes.get(o.id.id);Object(l.a)(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));const s=r.isShowing;s!==(1===a.show[0])&&(a.show=QS.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},Wle.prototype.contains=function(e){return this.updaters.contains(e.id)},Wle.prototype.getBoundingSphere=function(e,t){const n=this.primitive;if(!n.ready)return XP.PENDING;const i=n.getGeometryInstanceAttributes(e.entity);return!Object(l.a)(i)||!Object(l.a)(i.boundingSphere)||Object(l.a)(i.show)&&0===i.show[0]?XP.FAILED:(i.boundingSphere.clone(t),XP.DONE)},Wle.prototype.destroy=function(){const e=this.primitive,t=this.primitives;Object(l.a)(e)&&t.remove(e);const n=this.oldPrimitive;Object(l.a)(n)&&t.remove(n),this.removeMaterialSubscription()},Yle.prototype.add=function(e,t){const n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=zF.shouldUseSphericalCoordinates(r.geometry.rectangle),a=JP.getValueOrDefault(t.zIndex,0);for(let s=0;s<i;++s){const i=n[s];if(i.isMaterial(t)&&i.usingSphericalTextureCoordinates===o&&i.zIndex===a&&!i.overlapping(r.geometry.rectangle))return void i.add(e,t,r)}const s=new Wle(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,a);s.add(e,t,r),n.push(s)},Yle.prototype.remove=function(e){const t=this._items;for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.remove(e)){0===i.updaters.length&&(t.splice(n,1),i.destroy());break}}},Yle.prototype.update=function(e){let t;const n=this._items;for(t=n.length-1;t>=0;t--){const i=n[t];if(i.invalidated){n.splice(t,1);const r=i.updaters.values,o=r.length;for(let t=0;t<o;t++)this.add(e,r[t]);i.destroy()}}let i=!0;for(t=0;t<n.length;t++)i=n[t].update(e)&&i;return i},Yle.prototype.getBoundingSphere=function(e,t){const n=this._items,i=n.length;for(let r=0;r<i;r++){const i=n[r];if(i.contains(e))return i.getBoundingSphere(e,t)}return XP.FAILED},Yle.prototype.removeAllPrimitives=function(){const e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Xle=Yle;const Kle=new sp,Jle=new eb,Zle=new eb,$le=O.ZERO,Qle=new O;function eue(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tl,this.updaters=new Tl,this.updatersWithAttributes=new Tl,this.attributes=new Tl,this.itemsToRemove=[],this.subscriptions=new Tl,this.showsUpdated=new Tl}function tue(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Tl,this._translucentBatches=new Tl}eue.prototype.add=function(e,t){const n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&JP.isConstant(e.distanceDisplayConditionProperty)&&JP.isConstant(e.terrainOffsetProperty)){const t=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener((function(n,i,r,o){"isShowing"===i&&t.showsUpdated.set(e.id,e)})))}else this.updatersWithAttributes.set(n,e)},eue.prototype.remove=function(e){const t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);const e=this.subscriptions.get(t);return Object(l.a)(e)&&(e(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},eue.prototype.update=function(e){let t=!0,n=0,i=this.primitive;const r=this.primitives;let o;if(this.createPrimitive){const e=this.geometry.values;if(e.length>0)Object(l.a)(i)&&(Object(l.a)(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new hF({show:!1,asynchronous:!0,geometryInstances:e.slice(),appearance:new MR({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{Object(l.a)(i)&&(r.remove(i),i=void 0);const e=this.oldPrimitive;Object(l.a)(e)&&(r.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(Object(l.a)(i)&&i.ready){i.show=!0,Object(l.a)(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);const t=this.updatersWithAttributes.values,a=t.length,s=this.waitingOnCreate;for(o=0;o<a;o++){const r=t[o],a=this.geometry.get(r.id);let c=this.attributes.get(a.id.id);if(Object(l.a)(c)||(c=i.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,c)),!r.outlineColorProperty.isConstant||s){const t=r.outlineColorProperty,i=JP.getValueOrDefault(t,e,sp.WHITE,Kle);sp.equals(c._lastColor,i)||(c._lastColor=sp.clone(i,c._lastColor),c.color=lp.toValue(i,c.color),(this.translucent&&255===c.color[3]||!this.translucent&&255!==c.color[3])&&(this.itemsToRemove[n++]=r))}const u=r.entity.isShowing&&(r.hasConstantOutline||r.isOutlineVisible(e));u!==(1===c.show[0])&&(c.show=QS.toValue(u,c.show));const h=r.distanceDisplayConditionProperty;if(!JP.isConstant(h)){const t=JP.getValueOrDefault(h,e,Zle,Jle);eb.equals(t,c._lastDistanceDisplayCondition)||(c._lastDistanceDisplayCondition=eb.clone(t,c._lastDistanceDisplayCondition),c.distanceDisplayCondition=nb.toValue(t,c.distanceDisplayCondition))}const d=r.terrainOffsetProperty;if(!JP.isConstant(d)){const t=JP.getValueOrDefault(d,e,$le,Qle);O.equals(t,c._lastOffset)||(c._lastOffset=O.clone(t,c._lastOffset),c.offset=HE.toValue(t,c.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else Object(l.a)(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t},eue.prototype.updateShows=function(e){const t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){const n=t[i],r=this.geometry.get(n.id);let o=this.attributes.get(r.id.id);Object(l.a)(o)||(o=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,o));const a=n.entity.isShowing;a!==(1===o.show[0])&&(o.show=QS.toValue(a,o.show),r.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},eue.prototype.contains=function(e){return this.updaters.contains(e.id)},eue.prototype.getBoundingSphere=function(e,t){const n=this.primitive;if(!n.ready)return XP.PENDING;const i=n.getGeometryInstanceAttributes(e.entity);return!Object(l.a)(i)||!Object(l.a)(i.boundingSphere)||Object(l.a)(i.show)&&0===i.show[0]?XP.FAILED:(i.boundingSphere.clone(t),XP.DONE)},eue.prototype.removeAllPrimitives=function(){const e=this.primitives,t=this.primitive;Object(l.a)(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());const n=this.oldPrimitive;Object(l.a)(n)&&(e.remove(n),this.oldPrimitive=void 0)},tue.prototype.add=function(e,t){const n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth);let r,o;255===n.attributes.color.value[3]?(r=this._solidBatches,o=r.get(i),Object(l.a)(o)||(o=new eue(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),Object(l.a)(o)||(o=new eue(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))},tue.prototype.remove=function(e){let t;const n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;const r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return},tue.prototype.update=function(e){let t,n,i,r;const o=this._solidBatches.values,a=o.length,s=this._translucentBatches.values,c=s.length;let l,u=!0,h=!1;do{for(h=!1,n=0;n<a;n++){r=o[n],u=r.update(e),l=r.itemsToRemove;const a=l.length;if(a>0)for(h=!0,t=0;t<a;t++)i=l[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=s[n],u=r.update(e),l=r.itemsToRemove;const o=l.length;if(o>0)for(h=!0,t=0;t<o;t++)i=l[t],r.remove(i),this.add(e,i)}}while(h);return u},tue.prototype.getBoundingSphere=function(e,t){let n;const i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){const r=i[n];if(r.contains(e))return r.getBoundingSphere(e,t)}const o=this._translucentBatches.values,a=o.length;for(n=0;n<a;n++){const i=o[n];if(i.contains(e))return i.getBoundingSphere(e,t)}return XP.FAILED},tue.prototype.removeAllPrimitives=function(){let e;const t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();const i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var nue=tue;const iue=new sp;function rue(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function oue(e,t){iU.call(this,{entity:e,scene:t,geometryOptions:new rue(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function aue(e,t,n){bz.call(this,e,t,n)}Object(l.a)(Object.create)&&(oue.prototype=Object.create(iU.prototype),oue.prototype.constructor=oue),oue.prototype.createFillGeometryInstance=function(e){if(s.a.defined("time",e),!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e);let i,r;const o=new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=nb.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof NR){let t;Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(t=this._materialProperty.color.getValue(e,iue)),Object(l.a)(t)||(t=sp.WHITE),r=lp.fromColor(t),i={show:o,distanceDisplayCondition:c,color:r}}else i={show:o,distanceDisplayCondition:c};return new Ph({id:t,geometry:new SP(this._options),attributes:i})},oue.prototype.createOutlineGeometryInstance=function(e){if(s.a.defined("time",e),!this._outlineEnabled)throw new u.a("This instance does not represent an outlined geometry.");const t=this._entity,n=t.isAvailable(e),i=JP.getValueOrDefault(this._outlineColorProperty,e,sp.BLACK,iue),r=this._distanceDisplayConditionProperty.getValue(e);return new Ph({id:t,geometry:new MP(this._options),attributes:{show:new QS(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:lp.fromColor(i),distanceDisplayCondition:nb.fromDistanceDisplayCondition(r)}})},oue.prototype._isHidden=function(e,t){return!Object(l.a)(t.positions)||iU.prototype._isHidden.call(this,e,t)},oue.prototype._getIsClosed=function(e){return!1},oue.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&JP.isConstant(t.minimumHeights)&&JP.isConstant(t.maximumHeights)&&JP.isConstant(t.outlineWidth)&&JP.isConstant(t.granularity))},oue.prototype._setStaticOptions=function(e,t){const n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof NR,a=this._options;a.vertexFormat=o?MR.VERTEX_FORMAT:SR.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(JA.MINIMUM_VALUE,a.positions),a.minimumHeights=Object(l.a)(n)?n.getValue(JA.MINIMUM_VALUE,a.minimumHeights):void 0,a.maximumHeights=Object(l.a)(i)?i.getValue(JA.MINIMUM_VALUE,a.maximumHeights):void 0,a.granularity=Object(l.a)(r)?r.getValue(JA.MINIMUM_VALUE):void 0},oue.DynamicGeometryUpdater=aue,Object(l.a)(Object.create)&&(aue.prototype=Object.create(bz.prototype),aue.prototype.constructor=aue),aue.prototype._isHidden=function(e,t,n){return!Object(l.a)(this._options.positions)||bz.prototype._isHidden.call(this,e,t,n)},aue.prototype._setOptions=function(e,t,n){const i=this._options;i.positions=JP.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=JP.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=JP.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=JP.getValueOrUndefined(t.granularity,n)};var sue=oue;const cue=[],lue=[yU,nae,Rre,vce,Dce,qce,tle,ale,gle,sue];function uue(e,t){this.entity=e,this.scene=t;const n=new Array(lue.length),i=new un.a;function r(e){i.raiseEvent(e)}const o=new Gb;for(let i=0;i<n.length;i++){const a=new lue[i](e,t);o.add(a.geometryChanged,r),n[i]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(uue.prototype._onEntityPropertyChanged,this)}function hue(e,t,n,i){s.a.defined("scene",e),s.a.defined("entityCollection",t),n=Object(c.a)(n,e.primitives),i=Object(c.a)(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Tl,this._removedObjects=new Tl,this._changedObjects=new Tl;const r=TB.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(2*r),this._closedColorBatches=new Array(2*r),this._closedMaterialBatches=new Array(2*r),this._openColorBatches=new Array(2*r),this._openMaterialBatches=new Array(2*r);const o=Yk.supportsMaterialsforEntitiesOnTerrain(e);let a;for(this._supportsMaterialsforEntitiesOnTerrain=o,a=0;a<r;++a)this._outlineBatches[a]=new nue(n,e,a,!1),this._outlineBatches[r+a]=new nue(n,e,a,!0),this._closedColorBatches[a]=new Ile(n,MR,void 0,!0,a,!0),this._closedColorBatches[r+a]=new Ile(n,MR,void 0,!0,a,!1),this._closedMaterialBatches[a]=new Ble(n,SR,void 0,!0,a,!0),this._closedMaterialBatches[r+a]=new Ble(n,SR,void 0,!0,a,!1),this._openColorBatches[a]=new Ile(n,MR,void 0,!1,a,!0),this._openColorBatches[r+a]=new Ile(n,MR,void 0,!1,a,!1),this._openMaterialBatches[a]=new Ble(n,SR,void 0,!1,a,!0),this._openMaterialBatches[r+a]=new Ble(n,SR,void 0,!1,a,!1);const l=qN.NUMBER_OF_CLASSIFICATION_TYPES,u=new Array(l),h=[];if(o)for(a=0;a<l;++a)h.push(new Xle(i,a,SR)),u[a]=new Hle(i,a);else for(a=0;a<l;++a)u[a]=new Hle(i,a);this._groundColorBatches=u,this._groundMaterialBatches=h,this._dynamicBatch=new dce(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Tl,this._updaterSets=new Tl,this._entityCollection=t,t.collectionChanged.addEventListener(hue.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,cue)}uue.prototype._onEntityPropertyChanged=function(e,t,n,i){const r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)},uue.prototype.forEach=function(e){const t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])},uue.prototype.destroy=function(){this.eventHelper.removeAll();const e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),sc(this)},hue.prototype.update=function(e){s.a.defined("time",e);const t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,a=o.values;let c,l,u,h;const d=this;for(c=a.length-1;c>-1;c--)l=a[c],u=l.id,h=this._updaterSets.get(u),h.entity===l?h.forEach((function(t){d._removeUpdater(t),d._insertUpdaterIntoBatch(e,t)})):(r.push(l),n.push(l));for(c=r.length-1;c>-1;c--)l=r[c],u=l.id,h=this._updaterSets.get(u),h.forEach(this._removeUpdater.bind(this)),h.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(c=n.length-1;c>-1;c--)l=n[c],u=l.id,h=new uue(l,this._scene),this._updaterSets.set(u,h),h.forEach((function(t){d._insertUpdaterIntoBatch(e,t)})),this._subscriptions.set(u,h.geometryChanged.addEventListener(hue._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let f=!0;const p=this._batches,m=p.length;for(c=0;c<m;c++)f=p[c].update(e)&&f;return f};const due=[],fue=new At;hue.prototype.getBoundingSphere=function(e,t){s.a.defined("entity",e),s.a.defined("result",t);const n=due,i=fue;let r=0,o=XP.DONE;const a=this._batches,c=a.length,l=e.id,u=this._updaterSets.get(l).updaters;for(let e=0;e<u.length;e++){const t=u[e];for(let e=0;e<c;e++){if(o=a[e].getBoundingSphere(t,i),o===XP.PENDING)return XP.PENDING;o===XP.DONE&&(n[r]=At.clone(i,n[r]),r++)}}return 0===r?XP.FAILED:(n.length=r,At.fromBoundingSpheres(n,t),XP.DONE)},hue.prototype.isDestroyed=function(){return!1},hue.prototype.destroy=function(){let e;this._entityCollection.collectionChanged.removeEventListener(hue.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();const t=this._batches;let n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();const i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();const r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),sc(this)},hue.prototype._removeUpdater=function(e){const t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)},hue.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic)return void this._dynamicBatch.add(e,t);let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));const i=TB.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(Object(l.a)(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){const n=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof NR?this._groundColorBatches[n].add(e,t):this._groundMaterialBatches[n].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof NR?Object(l.a)(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):Object(l.a)(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof NR?Object(l.a)(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):Object(l.a)(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)},hue._onGeometryChanged=function(e){const t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;Object(l.a)(t.get(r))||Object(l.a)(n.get(r))||n.set(r,i)},hue.prototype._onCollectionChanged=function(e,t,n){const i=this._addedObjects,r=this._removedObjects,o=this._changedObjects;let a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(r.set(s,c),o.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,r.remove(s)?o.set(s,c):i.set(s,c)};var pue=hue;const mue=L0.FILL,gue=sp.WHITE,_ue=sp.BLACK,yue=new sp(.165,.165,.165,.8),bue=new Vt(7,5),vue=Vt.ZERO,Oue=O.ZERO,wue=qP.NONE,Aue=WP.CENTER,Eue=YP.CENTER,Tue=new O,Cue=new sp,xue=new sp,Sue=new sp,Iue=new Vt,Pue=new O,Due=new Vt,Rue=new TE,jue=new TE,Mue=new TE,Lue=new eb;function Nue(e){this.entity=e,this.label=void 0,this.index=void 0}function Bue(e,t){if(!Object(l.a)(e))throw new u.a("entityCluster is required.");if(!Object(l.a)(t))throw new u.a("entityCollection is required.");t.collectionChanged.addEventListener(Bue.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tl,this._onCollectionChanged(t,t.values,[],[])}function Fue(e,t,n){Object(l.a)(e)&&(e.label=void 0,n.removeLabel(t))}Bue.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){const r=t[i],o=r.entity,a=o._label;let s,c,u=r.label,h=o.isShowing&&o.isAvailable(e)&&JP.getValueOrDefault(a._show,e,!0);if(h&&(c=JP.getValueOrUndefined(o._position,e,Tue),s=JP.getValueOrUndefined(a._text,e),h=Object(l.a)(c)&&Object(l.a)(s)),!h){Fue(r,o,n);continue}JP.isConstant(o._position)||(n._clusterDirty=!0);let d=!1;const f=JP.getValueOrDefault(a._heightReference,e,wue);Object(l.a)(u)||(u=n.getLabel(o),u.id=o,r.label=u,d=O.equals(u.position,c)&&u.heightReference===f),u.show=!0,u.position=c,u.text=s,u.scale=JP.getValueOrDefault(a._scale,e,1),u.font=JP.getValueOrDefault(a._font,e,"30px sans-serif"),u.style=JP.getValueOrDefault(a._style,e,mue),u.fillColor=JP.getValueOrDefault(a._fillColor,e,gue,Cue),u.outlineColor=JP.getValueOrDefault(a._outlineColor,e,_ue,xue),u.outlineWidth=JP.getValueOrDefault(a._outlineWidth,e,1),u.showBackground=JP.getValueOrDefault(a._showBackground,e,!1),u.backgroundColor=JP.getValueOrDefault(a._backgroundColor,e,yue,Sue),u.backgroundPadding=JP.getValueOrDefault(a._backgroundPadding,e,bue,Iue),u.pixelOffset=JP.getValueOrDefault(a._pixelOffset,e,vue,Due),u.eyeOffset=JP.getValueOrDefault(a._eyeOffset,e,Oue,Pue),u.heightReference=f,u.horizontalOrigin=JP.getValueOrDefault(a._horizontalOrigin,e,Aue),u.verticalOrigin=JP.getValueOrDefault(a._verticalOrigin,e,Eue),u.translucencyByDistance=JP.getValueOrUndefined(a._translucencyByDistance,e,Rue),u.pixelOffsetScaleByDistance=JP.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,jue),u.scaleByDistance=JP.getValueOrUndefined(a._scaleByDistance,e,Mue),u.distanceDisplayCondition=JP.getValueOrUndefined(a._distanceDisplayCondition,e,Lue),u.disableDepthTestDistance=JP.getValueOrUndefined(a._disableDepthTestDistance,e),d&&u._updateClamping()}return!0},Bue.prototype.getBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("entity is required.");if(!Object(l.a)(t))throw new u.a("result is required.");const n=this._items.get(e.id);if(!Object(l.a)(n)||!Object(l.a)(n.label))return XP.FAILED;const i=n.label;return t.center=O.clone(Object(c.a)(i._clampedPosition,i.position),t.center),t.radius=0,XP.DONE},Bue.prototype.isDestroyed=function(){return!1},Bue.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Bue.prototype._onCollectionChanged,this);const e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return sc(this)},Bue.prototype._onCollectionChanged=function(e,t,n,i){let r,o;const a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],Object(l.a)(o._label)&&Object(l.a)(o._position)&&a.set(o.id,new Nue(o));for(r=i.length-1;r>-1;r--)o=i[r],Object(l.a)(o._label)&&Object(l.a)(o._position)?a.contains(o.id)||a.set(o.id,new Nue(o)):(Fue(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Fue(a.get(o.id),o,s),a.remove(o.id)};var zue=Bue;const kue=TB.ENABLED,Uue=qP.NONE,Vue=sp.RED,Hue=sp.WHITE,Gue=kq.HIGHLIGHT,que=new Vt(1,1),Wue=new Me,Yue=new Me,Xue=new sp;function Kue(e,t){s.a.typeOf.object("scene",e),s.a.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(Kue.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Tl,this._onCollectionChanged(t,t.values,[],[])}function Jue(e,t,n,i){const r=n[t.id];Object(l.a)(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Zue(e,t){const n=t[e.id];Object(l.a)(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}function $ue(e,t,n){e.readyPromise.catch((function(e){console.error(e),n[t.id].loadFail=!0}))}Kue.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){const o=t[r],a=o._model;let s,c,u=n[o.id],h=o.isShowing&&o.isAvailable(e)&&JP.getValueOrDefault(a._show,e,!0);if(h&&(c=o.computeModelMatrix(e,Wue),s=Tt.a.createIfNeeded(JP.getValueOrUndefined(a._uri,e)),h=Object(l.a)(c)&&Object(l.a)(s)),!h){Object(l.a)(u)&&(u.modelPrimitive.show=!1);continue}let d=Object(l.a)(u)?u.modelPrimitive:void 0;if(!Object(l.a)(d)||s.url!==u.url){Object(l.a)(d)&&(i.removeAndDestroy(d),delete n[o.id]);d=(qb.enableModelExperimental?iee:OX).fromGltf({url:s,incrementallyLoadTextures:JP.getValueOrDefault(a._incrementallyLoadTextures,e,!0),scene:this._scene}),d.id=o,i.add(d),u={modelPrimitive:d,url:s.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFail:!1},n[o.id]=u,$ue(d,o,n)}if(d.show=!0,d.scale=JP.getValueOrDefault(a._scale,e,1),d.minimumPixelSize=JP.getValueOrDefault(a._minimumPixelSize,e,0),d.maximumScale=JP.getValueOrUndefined(a._maximumScale,e),d.modelMatrix=Me.clone(c,d.modelMatrix),d.shadows=JP.getValueOrDefault(a._shadows,e,kue),d.heightReference=JP.getValueOrDefault(a._heightReference,e,Uue),d.distanceDisplayCondition=JP.getValueOrUndefined(a._distanceDisplayCondition,e),d.silhouetteColor=JP.getValueOrDefault(a._silhouetteColor,e,Vue,Xue),d.silhouetteSize=JP.getValueOrDefault(a._silhouetteSize,e,0),d.color=JP.getValueOrDefault(a._color,e,Hue,Xue),d.colorBlendMode=JP.getValueOrDefault(a._colorBlendMode,e,Gue),d.colorBlendAmount=JP.getValueOrDefault(a._colorBlendAmount,e,.5),d.clippingPlanes=JP.getValueOrUndefined(a._clippingPlanes,e),d.clampAnimations=JP.getValueOrDefault(a._clampAnimations,e,!0),d.imageBasedLighting.imageBasedLightingFactor=JP.getValueOrDefault(a._imageBasedLightingFactor,e,que),d.lightColor=JP.getValueOrUndefined(a._lightColor,e),d.ready){const t=JP.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==t&&(t?d.activeAnimations.addAll({loop:rW.REPEAT}):d.activeAnimations.removeAll(),u.animationsRunning=t);const n=JP.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(Object(l.a)(n)){const e=Object.keys(n);for(let t=0,i=e.length;t<i;++t){const i=e[t],r=n[i];if(!Object(l.a)(r))continue;const o=d.getNode(i);if(!Object(l.a)(o))continue;const a=Me.fromTranslationRotationScale(r,Yue);o.matrix=Me.multiply(o.originalMatrix,a,a)}}let i=!1;const r=JP.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(Object(l.a)(r)){const e=Object.keys(r);for(let t=0,n=e.length;t<n;++t){const n=e[t],o=r[n];Object(l.a)(o)&&(i=!0,d.setArticulationStage(n,o))}}i&&d.applyArticulations()}}return!0},Kue.prototype.isDestroyed=function(){return!1},Kue.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Kue.prototype._onCollectionChanged,this);const e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Jue(this,e[i],t,n);return sc(this)},Kue.prototype.getBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("entity is required.");if(!Object(l.a)(t))throw new u.a("result is required.");const n=this._modelHash[e.id];if(!Object(l.a)(n)||n.loadFail)return XP.FAILED;const i=n.modelPrimitive;if(!Object(l.a)(i)||!i.show)return XP.FAILED;if(!i.ready)return XP.PENDING;return i.heightReference===qP.NONE||Object(l.a)(i._clampedModelMatrix)?(At.clone(i.boundingSphere,t),XP.DONE):XP.PENDING},Kue.prototype._onCollectionChanged=function(e,t,n,i){let r,o;const a=this._entitiesToVisualize,s=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],Object(l.a)(o._model)&&Object(l.a)(o._position)&&a.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],Object(l.a)(o._model)&&Object(l.a)(o._position)?(Zue(o,s),a.set(o.id,o)):(Jue(this,o,s,c),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Jue(this,o,s,c),a.remove(o.id)};var Que=Kue;function ehe(e){this._definitionChanged=new un.a,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(ehe.prototype,{isConstant:{get:function(){return JP.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return Object(l.a)(this._value)?this._value.referenceFrame:Hx.FIXED}}}),ehe.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Hx.FIXED,t)},ehe.prototype.setValue=function(e){this._value!==e&&(this._value=e,Object(l.a)(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),Object(l.a)(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},ehe.prototype.getValueInReferenceFrame=function(e,t,n){if(!Object(l.a)(e))throw new u.a("time is required.");if(!Object(l.a)(t))throw new u.a("referenceFrame is required.");if(Object(l.a)(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),Object(l.a)(n)?H.WGS84.scaleToGeodeticSurface(n,n):void 0},ehe.prototype.equals=function(e){return this===e||e instanceof ehe&&this._value===e._value},ehe.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var the=ehe;const nhe=new YA,ihe=new YA,rhe=new YA;function ohe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function ahe(e,t,n,i,r,o,a,s){for(;e instanceof Pae;)e=e.resolvedProperty;if(e instanceof Vae){a=function(e,t,n,i,r,o,a,s,c){let u,h=s;u=e.getValueInReferenceFrame(t,o,c[h]),Object(l.a)(u)&&(c[h++]=u);let d=!Object(l.a)(r)||tr.lessThanOrEquals(r,t)||tr.greaterThanOrEquals(r,n),f=0;const p=i.length;let m=i[f];const g=n;let _,y,b,v=!1;for(;f<p;){if(!d&&tr.greaterThanOrEquals(m,r)&&(u=e.getValueInReferenceFrame(r,o,c[h]),Object(l.a)(u)&&(c[h++]=u),d=!0),tr.greaterThan(m,t)&&tr.lessThan(m,g)&&!m.equals(r)&&(u=e.getValueInReferenceFrame(m,o,c[h]),Object(l.a)(u)&&(c[h++]=u)),f<p-1){if(a>0&&!v){const e=i[f+1],t=tr.secondsDifference(e,m);v=t>a,v&&(_=Math.ceil(t/a),y=0,b=t/Math.max(_,2),_=Math.max(_-1,1))}if(v&&y<_){m=tr.addSeconds(m,b,new tr),y++;continue}}v=!1,f++,m=i[f]}return u=e.getValueInReferenceFrame(n,o,c[h]),Object(l.a)(u)&&(c[h++]=u),h}(e,t,n,e._property._times,i,r,o,a,s)}else a=e instanceof Ore?function(e,t,n,i,r,o,a,s){ihe.start=t,ihe.stop=n;let c=a;const l=e.intervals;for(let e=0;e<l.length;e++){const a=l.get(e);if(!YA.intersect(a,ihe,nhe).isEmpty){const e=a.start,l=a.stop;let u=t;tr.greaterThan(e,u)&&(u=e);let h=n;tr.lessThan(l,h)&&(h=l),c=ahe(a.data,u,h,i,r,o,c,s)}}return c}(e,t,n,i,r,o,a,s):e instanceof Jae?function(e,t,n,i,r,o,a,s){rhe.start=t,rhe.stop=n;let c=a;const u=e.intervals;for(let t=0;t<u.length;t++){const n=u.get(t);if(!YA.intersect(n,rhe,nhe).isEmpty){let t=n.start;n.isStartIncluded||(t=n.isStopIncluded?n.stop:tr.addSeconds(n.start,tr.secondsDifference(n.stop,n.start)/2,new tr));const i=e.getValueInReferenceFrame(t,r,s[c]);Object(l.a)(i)&&(s[c]=i,c++)}}return c}(e,t,n,0,r,0,a,s):e instanceof $z||e instanceof the&&JP.isConstant(e)?function(e,t,n,i,r,o,a,s){const c=e.getValueInReferenceFrame(t,r,s[a]);return Object(l.a)(c)&&(s[a++]=c),a}(e,t,0,0,r,0,a,s):function(e,t,n,i,r,o,a,s){let c,u=0,h=a,d=t;const f=Math.max(o,60);let p=!Object(l.a)(i)||tr.lessThanOrEquals(i,t)||tr.greaterThanOrEquals(i,n);for(;tr.lessThan(d,n);)!p&&tr.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,s[h]),Object(l.a)(c)&&(s[h]=c,h++)),c=e.getValueInReferenceFrame(d,r,s[h]),Object(l.a)(c)&&(s[h]=c,h++),u++,d=tr.addSeconds(t,f*u,new tr);return c=e.getValueInReferenceFrame(n,r,s[h]),Object(l.a)(c)&&(s[h]=c,h++),h}(e,t,n,i,r,o,a,s);return a}function she(e,t,n,i,r,o,a){Object(l.a)(a)||(a=[]);const s=ahe(e,t,n,i,r,o,0,a);return a.length=s,a}const che=new ce;function lhe(e,t){this._unusedIndexes=[],this._polylineCollection=new m2,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function uhe(e,t){if(!Object(l.a)(e))throw new u.a("scene is required.");if(!Object(l.a)(t))throw new u.a("entityCollection is required.");t.collectionChanged.addEventListener(uhe.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Tl,this._onCollectionChanged(t,t.values,[],[])}lhe.prototype.update=function(e){if(this._referenceFrame===Hx.INERTIAL){let t=ca.computeIcrfToFixedMatrix(e,che);Object(l.a)(t)||(t=ca.computeTemeToPseudoFixedMatrix(e,che)),Me.fromRotationTranslation(t,O.ZERO,this._polylineCollection.modelMatrix)}},lhe.prototype.updateObject=function(e,t){const n=t.entity,i=n._path,r=n._position;let o,a;const s=i._show;let c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!Object(l.a)(s)||s.getValue(e));if(u){const t=JP.getValueOrUndefined(i._leadTime,e),r=JP.getValueOrUndefined(i._trailTime,e),s=n._availability,c=Object(l.a)(s),h=Object(l.a)(t),d=Object(l.a)(r);if(u=c||h&&d,u){if(d&&(o=tr.addSeconds(e,-r,new tr)),h&&(a=tr.addSeconds(e,t,new tr)),c){const e=s.start,t=s.stop;d&&!tr.greaterThan(e,o)||(o=e),h&&!tr.lessThan(t,a)||(a=t)}u=tr.lessThan(o,a)}}if(!u)return void(Object(l.a)(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!Object(l.a)(c)){const e=this._unusedIndexes;if(e.length>0){const n=e.pop();c=this._polylineCollection.get(n),t.index=n}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}const h=JP.getValueOrDefault(i._resolution,e,60);c.show=!0,c.positions=she(r,o,a,e,this._referenceFrame,h,c.positions.slice()),c.material=_z.getValue(e,i._material,c.material),c.width=JP.getValueOrDefault(i._width,e,1),c.distanceDisplayCondition=JP.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)},lhe.prototype.removeObject=function(e){const t=e.polyline;Object(l.a)(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},lhe.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),sc(this)},uhe.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._updaters;for(const n in t)t.hasOwnProperty(n)&&t[n].update(e);const n=this._items.values;if(0===n.length&&Object(l.a)(this._updaters)&&Object.keys(this._updaters).length>0){for(const e in t)t.hasOwnProperty(e)&&t[e].destroy();this._updaters={}}for(let t=0,i=n.length;t<i;t++){const i=n[t],r=i.entity._position,o=i.updater;let a=Hx.FIXED;this._scene.mode===AB.SCENE3D&&(a=r.referenceFrame);let s=this._updaters[a];o===s&&Object(l.a)(s)?s.updateObject(e,i):(Object(l.a)(o)&&o.removeObject(i),Object(l.a)(s)||(s=new lhe(this._scene,a),s.update(e),this._updaters[a]=s),i.updater=s,Object(l.a)(s)&&s.updateObject(e,i))}return!0},uhe.prototype.isDestroyed=function(){return!1},uhe.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(uhe.prototype._onCollectionChanged,this);const e=this._updaters;for(const t in e)e.hasOwnProperty(t)&&e[t].destroy();return sc(this)},uhe.prototype._onCollectionChanged=function(e,t,n,i){let r,o,a;const s=this._items;for(r=t.length-1;r>-1;r--)o=t[r],Object(l.a)(o._path)&&Object(l.a)(o._position)&&s.set(o.id,new ohe(o));for(r=i.length-1;r>-1;r--)o=i[r],Object(l.a)(o._path)&&Object(l.a)(o._position)?s.contains(o.id)||s.set(o.id,new ohe(o)):(a=s.get(o.id),Object(l.a)(a)&&(Object(l.a)(a.updater)&&a.updater.removeObject(a),s.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],a=s.get(o.id),Object(l.a)(a)&&(Object(l.a)(a.updater)&&a.updater.removeObject(a),s.remove(o.id))},uhe._subSample=she;var hhe=uhe;const dhe=sp.WHITE,fhe=sp.BLACK,phe=new sp,mhe=new O,ghe=new sp,_he=new TE,yhe=new TE,bhe=new eb;function vhe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Ohe(e,t){if(!Object(l.a)(e))throw new u.a("entityCluster is required.");if(!Object(l.a)(t))throw new u.a("entityCollection is required.");t.collectionChanged.addEventListener(Ohe.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Tl,this._onCollectionChanged(t,t.values,[],[])}function whe(e,t,n){if(Object(l.a)(e)){const i=e.pointPrimitive;if(Object(l.a)(i))return e.pointPrimitive=void 0,void n.removePoint(t);const r=e.billboard;Object(l.a)(r)&&(e.billboard=void 0,n.removeBillboard(t))}}Ohe.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");const t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){const r=t[i],o=r.entity,a=o._point;let s=r.pointPrimitive,c=r.billboard;const u=JP.getValueOrDefault(a._heightReference,e,qP.NONE);let h,d=o.isShowing&&o.isAvailable(e)&&JP.getValueOrDefault(a._show,e,!0);if(d&&(h=JP.getValueOrUndefined(o._position,e,mhe),d=Object(l.a)(h)),!d){whe(r,o,n);continue}JP.isConstant(o._position)||(n._clusterDirty=!0);let f=!1,p=!1;if(u===qP.NONE||Object(l.a)(c)?u!==qP.NONE||Object(l.a)(s)||(Object(l.a)(c)&&(whe(r,o,n),c=void 0),s=n.getPoint(o),s.id=o,r.pointPrimitive=s):(Object(l.a)(s)&&(whe(r,o,n),s=void 0),c=n.getBillboard(o),c.id=o,c.image=void 0,r.billboard=c,f=!0,p=O.equals(c.position,h)&&c.heightReference===u),Object(l.a)(s))s.show=!0,s.position=h,s.scaleByDistance=JP.getValueOrUndefined(a._scaleByDistance,e,_he),s.translucencyByDistance=JP.getValueOrUndefined(a._translucencyByDistance,e,yhe),s.color=JP.getValueOrDefault(a._color,e,dhe,phe),s.outlineColor=JP.getValueOrDefault(a._outlineColor,e,fhe,ghe),s.outlineWidth=JP.getValueOrDefault(a._outlineWidth,e,0),s.pixelSize=JP.getValueOrDefault(a._pixelSize,e,1),s.distanceDisplayCondition=JP.getValueOrUndefined(a._distanceDisplayCondition,e,bhe),s.disableDepthTestDistance=JP.getValueOrDefault(a._disableDepthTestDistance,e,0);else if(Object(l.a)(c)){c.show=!0,c.position=h,c.scaleByDistance=JP.getValueOrUndefined(a._scaleByDistance,e,_he),c.translucencyByDistance=JP.getValueOrUndefined(a._translucencyByDistance,e,yhe),c.distanceDisplayCondition=JP.getValueOrUndefined(a._distanceDisplayCondition,e,bhe),c.disableDepthTestDistance=JP.getValueOrDefault(a._disableDepthTestDistance,e,0),c.heightReference=u;const t=JP.getValueOrDefault(a._color,e,dhe,phe),n=JP.getValueOrDefault(a._outlineColor,e,fhe,ghe),i=Math.round(JP.getValueOrDefault(a._outlineWidth,e,0));let o=Math.max(1,Math.round(JP.getValueOrDefault(a._pixelSize,e,1)));if(i>0?(c.scale=1,f=f||i!==r.outlineWidth||o!==r.pixelSize||!sp.equals(t,r.color)||!sp.equals(n,r.outlineColor)):(c.scale=o/50,o=50,f=f||i!==r.outlineWidth||!sp.equals(t,r.color)||!sp.equals(n,r.outlineColor)),f){r.color=sp.clone(t,r.color),r.outlineColor=sp.clone(n,r.outlineColor),r.pixelSize=o,r.outlineWidth=i;const e=t.alpha,a=t.toCssColorString(),s=n.toCssColorString(),l=JSON.stringify([a,o,s,i]);c.setImage(l,S0(e,a,s,i,o))}p&&c._updateClamping()}}return!0},Ohe.prototype.getBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("entity is required.");if(!Object(l.a)(t))throw new u.a("result is required.");const n=this._items.get(e.id);if(!Object(l.a)(n)||!Object(l.a)(n.pointPrimitive)&&!Object(l.a)(n.billboard))return XP.FAILED;if(Object(l.a)(n.pointPrimitive))t.center=O.clone(n.pointPrimitive.position,t.center);else{const e=n.billboard;if(!Object(l.a)(e._clampedPosition))return XP.PENDING;t.center=O.clone(e._clampedPosition,t.center)}return t.radius=0,XP.DONE},Ohe.prototype.isDestroyed=function(){return!1},Ohe.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ohe.prototype._onCollectionChanged,this);const e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return sc(this)},Ohe.prototype._onCollectionChanged=function(e,t,n,i){let r,o;const a=this._items,s=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],Object(l.a)(o._point)&&Object(l.a)(o._position)&&a.set(o.id,new vhe(o));for(r=i.length-1;r>-1;r--)o=i[r],Object(l.a)(o._point)&&Object(l.a)(o._position)?a.contains(o.id)||a.set(o.id,new vhe(o)):(whe(a.get(o.id),o,s),a.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],whe(a.get(o.id),o,s),a.remove(o.id)};var Ahe=Ohe;const Ehe=new kP(0),The={},Che=new sp,xhe=new NR(sp.WHITE),She=new kP(!0),Ihe=new kP(TB.DISABLED),Phe=new kP(new eb),Dhe=new kP(qN.BOTH);function Rhe(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function jhe(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Mhe(e,t){if(!Object(l.a)(e))throw new u.a("entity is required");if(!Object(l.a)(t))throw new u.a("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Mhe.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new un.a,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Rhe,this._groundGeometryOptions=new jhe,this._id="polyline-"+e.id,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Yk.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Mhe.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!Object(l.a)(this._entity.availability)&&JP.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}}),Mhe.prototype.isOutlineVisible=function(e){return!1},Mhe.prototype.isFilled=function(e){const t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return Object(c.a)(n,!1)},Mhe.prototype.createFillGeometryInstance=function(e){if(!Object(l.a)(e))throw new u.a("time is required.");if(!this._fillEnabled)throw new u.a("This instance does not represent a filled geometry.");const t=this._entity,n=t.isAvailable(e),i=new QS(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o={show:i,distanceDisplayCondition:nb.fromDistanceDisplayCondition(r)};let a;return this._materialProperty instanceof NR&&(Object(l.a)(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Che)),Object(l.a)(a)||(a=sp.WHITE),o.color=lp.fromColor(a)),this.clampToGround?new Ph({id:t,geometry:new cA(this._groundGeometryOptions),attributes:o}):(Object(l.a)(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof NR&&(Object(l.a)(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Che)),Object(l.a)(a)||(a=sp.WHITE),o.depthFailColor=lp.fromColor(a)),new Ph({id:t,geometry:new yC(this._geometryOptions),attributes:o}))},Mhe.prototype.createOutlineGeometryInstance=function(e){throw new u.a("This instance does not represent an outlined geometry.")},Mhe.prototype.isDestroyed=function(){return!1},Mhe.prototype.destroy=function(){this._entitySubscription(),sc(this)},Mhe.prototype._onEntityPropertyChanged=function(e,t,n,i){if("availability"!==t&&"polyline"!==t)return;const r=this._entity.polyline;if(!Object(l.a)(r))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));const o=r.positions,a=r.show;if(Object(l.a)(a)&&a.isConstant&&!a.getValue(JA.MINIMUM_VALUE)||!Object(l.a)(o))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));const s=r.zIndex,u=Object(c.a)(r.material,xhe),h=u instanceof NR;this._materialProperty=u,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=Object(c.a)(a,She),this._shadowsProperty=Object(c.a)(r.shadows,Ihe),this._distanceDisplayConditionProperty=Object(c.a)(r.distanceDisplayCondition,Phe),this._classificationTypeProperty=Object(c.a)(r.classificationType,Dhe),this._fillEnabled=!0,this._zIndex=Object(c.a)(s,Ehe);const d=r.width,f=r.arcType,p=r.clampToGround,m=r.granularity;if(o.isConstant&&JP.isConstant(d)&&JP.isConstant(f)&&JP.isConstant(m)&&JP.isConstant(p)&&JP.isConstant(s)){const e=this._geometryOptions,t=o.getValue(JA.MINIMUM_VALUE,e.positions);if(!Object(l.a)(t)||t.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));let n;n=h&&(!Object(l.a)(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof NR)?Iz.VERTEX_FORMAT:Lz.VERTEX_FORMAT,e.vertexFormat=n,e.positions=t,e.width=Object(l.a)(d)?d.getValue(JA.MINIMUM_VALUE):void 0,e.arcType=Object(l.a)(f)?f.getValue(JA.MINIMUM_VALUE):void 0,e.granularity=Object(l.a)(m)?m.getValue(JA.MINIMUM_VALUE):void 0;const i=this._groundGeometryOptions;i.positions=t,i.width=e.width,i.arcType=e.arcType,i.granularity=e.granularity,this._clampToGround=!!Object(l.a)(p)&&p.getValue(JA.MINIMUM_VALUE),!this._clampToGround&&Object(l.a)(s)&&cl("Entity polylines must have clampToGround: true when using zIndex.  zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))},Mhe.prototype.createDynamicUpdater=function(e,t){if(s.a.defined("primitives",e),s.a.defined("groundPrimitives",t),!this._dynamic)throw new u.a("This instance does not represent dynamic geometry.");return new Nhe(e,t,this)};const Lhe={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Nhe(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Bhe(e){if(Object(l.a)(e._line))return e._line;const t=e._geometryUpdater._scene.id;let n=The[t];const i=e._primitives;!Object(l.a)(n)||n.isDestroyed()?(n=new m2,The[t]=n,i.add(n)):i.contains(n)||i.add(n);const r=n.add();return r.id=e._geometryUpdater._entity,e._line=r,r}Nhe.prototype.update=function(e){const t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions;let o=JP.getValueOrUndefined(r,e,this._positions);t._clampToGround=JP.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=JP.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=JP.getValueOrDefault(i._arcType,e,vl.GEODESIC),t._groundGeometryOptions.granularity=JP.getValueOrDefault(i._granularity,e,9999);const a=this._groundPrimitives;if(Object(l.a)(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!JP.getValueOrDefault(i._show,e,!0))return;if(!Object(l.a)(o)||o.length<2)return;const r=t.fillMaterialProperty;let s;if(r instanceof NR)s=new Iz;else{const t=_z.getValue(e,r,this._material);s=new Lz({material:t,translucent:t.isTranslucent()}),this._material=t}return this._groundPolylinePrimitive=a.add(new zz({geometryInstances:t.createFillGeometryInstance(e),appearance:s,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),JP.getValueOrUndefined(t.zIndex,e)),void(Object(l.a)(this._line)&&(this._line.show=!1))}const s=Bhe(this);if(!n.isShowing||!n.isAvailable(e)||!JP.getValueOrDefault(i._show,e,!0))return void(s.show=!1);if(!Object(l.a)(o)||o.length<2)return void(s.show=!1);let c=vl.GEODESIC;c=JP.getValueOrDefault(i._arcType,e,c);const u=t._scene.globe;c!==vl.NONE&&Object(l.a)(u)&&(Lhe.ellipsoid=u.ellipsoid,Lhe.positions=o,Lhe.granularity=JP.getValueOrUndefined(i._granularity,e),Lhe.height=Tg.extractHeights(o,u.ellipsoid),o=c===vl.GEODESIC?Tg.generateCartesianArc(Lhe):Tg.generateCartesianRhumbArc(Lhe)),s.show=!0,s.positions=o.slice(),s.material=_z.getValue(e,t.fillMaterialProperty,s.material),s.width=JP.getValueOrDefault(i._width,e,1),s.distanceDisplayCondition=JP.getValueOrUndefined(i._distanceDisplayCondition,e,s.distanceDisplayCondition)},Nhe.prototype.getBoundingSphere=function(e){if(s.a.defined("result",e),this._geometryUpdater.clampToGround){const t=this._groundPolylinePrimitive;if(Object(l.a)(t)&&t.show&&t.ready){const n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(Object(l.a)(n)&&Object(l.a)(n.boundingSphere))return At.clone(n.boundingSphere,e),XP.DONE}return Object(l.a)(t)&&!t.ready?XP.PENDING:XP.DONE}{const t=Bhe(this);if(t.show&&t.positions.length>0)return At.fromPoints(t.positions,e),XP.DONE}return XP.FAILED},Nhe.prototype.isDestroyed=function(){return!1},Nhe.prototype.destroy=function(){const e=this._geometryUpdater._scene.id,t=The[e];Object(l.a)(t)&&(t.remove(this._line),0===t.length&&(this._primitives.removeAndDestroy(t),delete The[e])),Object(l.a)(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),sc(this)};var Fhe=Mhe;const zhe=new sp,khe=new eb,Uhe=new eb;function Vhe(e,t,n,i,r){let o;o=n instanceof NR?Iz:Lz,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Tl,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Tl,this.material=void 0,this.updatersWithAttributes=new Tl,this.attributes=new Tl,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Vhe.prototype.onMaterialChanged,this),this.subscriptions=new Tl,this.showsUpdated=new Tl,this.zIndex=i,this._asynchronous=r}function Hhe(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=Object(c.a)(n,!0)}Vhe.prototype.onMaterialChanged=function(){this.invalidated=!0},Vhe.prototype.isMaterial=function(e){const t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof NR&&t instanceof NR||Object(l.a)(t)&&t.equals(n)},Vhe.prototype.add=function(e,t,n){const i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&JP.isConstant(t.distanceDisplayConditionProperty)){const e=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener((function(n,i,r,o){"isShowing"===i&&e.showsUpdated.set(t.id,t)})))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},Vhe.prototype.remove=function(e){const t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);const e=this.subscriptions.get(t);return Object(l.a)(e)&&(e(),this.subscriptions.remove(t)),!0}return!1},Vhe.prototype.update=function(e){let t=!0,n=this.primitive;const i=this.orderedGroundPrimitives,r=this.geometry.values;let o;if(this.createPrimitive){if(r.length>0)Object(l.a)(n)&&(Object(l.a)(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new zz({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Lz&&(this.material=_z.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{Object(l.a)(n)&&(i.remove(n),n=void 0);const e=this.oldPrimitive;Object(l.a)(e)&&(i.remove(e),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(Object(l.a)(n)&&n.ready){n.show=!0,Object(l.a)(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Lz&&(this.material=_z.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);const t=this.updatersWithAttributes.values,r=t.length;for(o=0;o<r;o++){const i=t[o],r=i.entity,a=this.geometry.get(i.id);let s=this.attributes.get(a.id.id);if(Object(l.a)(s)||(s=n.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s)),!i.fillMaterialProperty.isConstant){const t=i.fillMaterialProperty.color,n=JP.getValueOrDefault(t,e,sp.WHITE,zhe);sp.equals(s._lastColor,n)||(s._lastColor=sp.clone(n,s._lastColor),s.color=lp.toValue(n,s.color))}const c=r.isShowing&&(i.hasConstantFill||i.isFilled(e));c!==(1===s.show[0])&&(s.show=QS.toValue(c,s.show));const u=i.distanceDisplayConditionProperty;if(!JP.isConstant(u)){const t=JP.getValueOrDefault(u,e,Uhe,khe);eb.equals(t,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=eb.clone(t,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=nb.toValue(t,s.distanceDisplayCondition))}}this.updateShows(n)}else Object(l.a)(n)&&!n.ready&&(t=!1);return t},Vhe.prototype.updateShows=function(e){const t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){const n=t[i],r=n.entity,o=this.geometry.get(n.id);let a=this.attributes.get(o.id.id);Object(l.a)(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));const s=r.isShowing;s!==(1===a.show[0])&&(a.show=QS.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},Vhe.prototype.contains=function(e){return this.updaters.contains(e.id)},Vhe.prototype.getBoundingSphere=function(e,t){const n=this.primitive;if(!n.ready)return XP.PENDING;const i=n.getGeometryInstanceAttributes(e.entity);return!Object(l.a)(i)||!Object(l.a)(i.boundingSphere)||Object(l.a)(i.show)&&0===i.show[0]?XP.FAILED:(i.boundingSphere.clone(t),XP.DONE)},Vhe.prototype.destroy=function(){const e=this.primitive,t=this.orderedGroundPrimitives;Object(l.a)(e)&&t.remove(e);const n=this.oldPrimitive;Object(l.a)(n)&&t.remove(n),this.removeMaterialSubscription()},Hhe.prototype.add=function(e,t){const n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=JP.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){const i=n[a];if(i.isMaterial(t)&&i.zIndex===o)return void i.add(e,t,r)}const a=new Vhe(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);a.add(e,t,r),n.push(a)},Hhe.prototype.remove=function(e){const t=this._items;for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.remove(e)){0===i.updaters.length&&(t.splice(n,1),i.destroy());break}}},Hhe.prototype.update=function(e){let t;const n=this._items;for(t=n.length-1;t>=0;t--){const i=n[t];if(i.invalidated){n.splice(t,1);const r=i.updaters.values,o=r.length;for(let t=0;t<o;t++)this.add(e,r[t]);i.destroy()}}let i=!0;for(t=0;t<n.length;t++)i=n[t].update(e)&&i;return i},Hhe.prototype.getBoundingSphere=function(e,t){const n=this._items,i=n.length;for(let r=0;r<i;r++){const i=n[r];if(i.contains(e))return i.getBoundingSphere(e,t)}return XP.FAILED},Hhe.prototype.removeAllPrimitives=function(){const e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Ghe=Hhe;const qhe=[];function Whe(e,t){const n=e._batches,i=n.length;for(let e=0;e<i;e++)n[e].remove(t)}function Yhe(e,t,n){if(n.isDynamic)return void e._dynamicBatch.add(t,n);if(n.clampToGround&&n.fillEnabled){const i=n.classificationTypeProperty.getValue(t);return void e._groundBatches[i].add(t,n)}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r,o=0;Object(l.a)(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof NR?1:2),Object(l.a)(i)&&(r=i+o*TB.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof NR?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Xhe(e,t,n,i){let r;s.a.defined("scene",e),s.a.defined("entityCollection",t),i=Object(c.a)(i,e.groundPrimitives),n=Object(c.a)(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Tl,this._removedObjects=new Tl,this._changedObjects=new Tl;const o=TB.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(3*o),this._materialBatches=new Array(3*o),r=0;r<o;++r)this._colorBatches[r]=new Ile(n,Iz,void 0,!1,r),this._materialBatches[r]=new Ble(n,Lz,void 0,!1,r),this._colorBatches[r+o]=new Ile(n,Iz,Iz,!1,r),this._materialBatches[r+o]=new Ble(n,Lz,Iz,!1,r),this._colorBatches[r+2*o]=new Ile(n,Iz,Lz,!1,r),this._materialBatches[r+2*o]=new Ble(n,Lz,Lz,!1,r);this._dynamicBatch=new dce(n,i);const a=qN.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),r=0;r<a;++r)this._groundBatches[r]=new Ghe(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Tl,this._updaters=new Tl,this._entityCollection=t,t.collectionChanged.addEventListener(Xhe.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,qhe)}Xhe.prototype.update=function(e){s.a.defined("time",e);const t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,a=o.values;let c,l,u,h;for(c=a.length-1;c>-1;c--)l=a[c],u=l.id,h=this._updaters.get(u),h.entity===l?(Whe(this,h),Yhe(this,e,h)):(r.push(l),n.push(l));for(c=r.length-1;c>-1;c--)l=r[c],u=l.id,h=this._updaters.get(u),Whe(this,h),h.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(c=n.length-1;c>-1;c--)l=n[c],u=l.id,h=new Fhe(l,this._scene),this._updaters.set(u,h),Yhe(this,e,h),this._subscriptions.set(u,h.geometryChanged.addEventListener(Xhe._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0;const f=this._batches,p=f.length;for(c=0;c<p;c++)d=f[c].update(e)&&d;return d};const Khe=[],Jhe=new At;Xhe.prototype.getBoundingSphere=function(e,t){s.a.defined("entity",e),s.a.defined("result",t);const n=Khe,i=Jhe;let r=0,o=XP.DONE;const a=this._batches,c=a.length,l=this._updaters.get(e.id);for(let e=0;e<c;e++){if(o=a[e].getBoundingSphere(l,i),o===XP.PENDING)return XP.PENDING;o===XP.DONE&&(n[r]=At.clone(i,n[r]),r++)}return 0===r?XP.FAILED:(n.length=r,At.fromBoundingSpheres(n,t),XP.DONE)},Xhe.prototype.isDestroyed=function(){return!1},Xhe.prototype.destroy=function(){let e;this._entityCollection.collectionChanged.removeEventListener(Xhe.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();const t=this._batches;let n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();const i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),sc(this)},Xhe._onGeometryChanged=function(e){const t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;Object(l.a)(t.get(r))||Object(l.a)(n.get(r))||n.set(r,i)},Xhe.prototype._onCollectionChanged=function(e,t,n){const i=this._addedObjects,r=this._removedObjects,o=this._changedObjects;let a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(r.set(s,c),o.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,r.remove(s)?o.set(s,c):i.set(s,c)};var Zhe=Xhe;function $he(e){s.a.typeOf.object("options",e),s.a.typeOf.object("options.scene",e.scene),s.a.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),mz.initializeTerrainHeights(),zz.initializeTerrainHeights();const t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Gb,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=Object(c.a)(e.visualizersCallback,$he.defaultVisualizersCallback);let i=!1;const r=new cce,o=new cce;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let e=0,t=n.length;e<t;e++)this._onDataSourceAdded(n,n.get(e));const a=new Xoe;let l,u;if(this._onDataSourceAdded(void 0,a),this._defaultDataSource=a,!i){const e=this,i=function(){t.primitives.add(r),t.groundPrimitives.add(o),l(),u(),e._removeDefaultDataSourceListener=void 0,e._removeDataSourceCollectionListener=void 0};l=a.entities.collectionChanged.addEventListener(i),u=n.dataSourceAdded.addEventListener(i)}this._removeDefaultDataSourceListener=l,this._removeDataSourceCollectionListener=u,this._ready=!1}$he.defaultVisualizersCallback=function(e,t,n){const i=n.entities;return[new gD(t,i),new pue(e,i,n._primitives,n._groundPrimitives),new zue(t,i),new Que(e,i),new Jie(e,i),new Ahe(t,i),new hhe(e,i),new Zhe(e,i,n._primitives,n._groundPrimitives)]},Object.defineProperties($he.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),$he.prototype.isDestroyed=function(){return!1},$he.prototype.destroy=function(){this._eventHelper.removeAll();const e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),Object(l.a)(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),sc(this)},$he.prototype.update=function(e){if(s.a.defined("time",e),!nn.initialized)return this._ready=!1,!1;let t,n,i,r,o=!0;const a=this._dataSourceCollection,c=a.length;for(t=0;t<c;t++){const s=a.get(t);for(Object(l.a)(s.update)&&(o=s.update(e)&&o),i=s._visualizers,r=i.length,n=0;n<r;n++)o=i[n].update(e)&&o}for(i=this._defaultDataSource._visualizers,r=i.length,n=0;n<r;n++)o=i[n].update(e)&&o;return this._ready=o,o},$he.prototype._postRender=function(){const e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){const n=t.get(i),r=n.credit;Object(l.a)(r)&&e.creditDisplay.addCredit(r);const o=n._resourceCredits;if(Object(l.a)(o)){const t=o.length;for(let n=0;n<t;n++)e.creditDisplay.addCredit(o[n])}}};const Qhe=[],ede=new At;$he.prototype.getBoundingSphere=function(e,t,n){if(s.a.defined("entity",e),s.a.typeOf.bool("allowPartial",t),s.a.defined("result",n),!this._ready)return XP.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;const t=this._dataSourceCollection;for(r=t.length,i=0;i<r;i++){const n=t.get(i);if(n.entities.contains(e)){o=n;break}}}if(!Object(l.a)(o))return XP.FAILED;const a=Qhe,c=ede;let u=0,h=XP.DONE;const d=o._visualizers,f=d.length;for(i=0;i<f;i++){const n=d[i];if(Object(l.a)(n.getBoundingSphere)){if(h=d[i].getBoundingSphere(e,c),!t&&h===XP.PENDING)return XP.PENDING;h===XP.DONE&&(a[u]=At.clone(c,a[u]),u++)}}return 0===u?XP.FAILED:(a.length=u,At.fromBoundingSpheres(a,n),XP.DONE)},$he.prototype._onDataSourceAdded=function(e,t){const n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new cce),a=r.add(new uce);t._primitives=o,t._groundPrimitives=a;const s=t.clustering;s._initialize(n),o.add(s),t._visualizers=this._visualizersCallback(n,s,t)},$he.prototype._onDataSourceRemoved=function(e,t){const n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,a=t.clustering;r.remove(a);const s=t._visualizers,c=s.length;for(let e=0;e<c;e++)s[e].destroy();n.remove(r),i.remove(o),t._visualizers=void 0},$he.prototype._onDataSourceMoved=function(e,t,n){const i=this._primitives,r=this._groundPrimitives,o=e._primitives,a=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(a)):t===n-1?(i.lower(o),r.lower(a)):0===t?(i.lowerToBottom(o),r.lowerToBottom(a),i.raise(o),r.raise(a)):(i.raiseToTop(o),r.raiseToTop(a))};var tde=$he;const nde=new ce,ide=new ce,rde=new ce,ode=new Me,ade=new O,sde=new O,cde=new O,lde=new O,ude=new O,hde=new O,dde=new tr;function fde(e,t,n){s.a.defined("entity",e),s.a.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=Object(c.a)(n,H.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new O,this._defaultOffset3D=void 0,this._offset3D=new O}Object.defineProperties(fde,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=O.clone(e,new O)}}}),fde.defaultOffset3D=new O(-14e3,3500,3500);const pde=new uA,mde=new O;fde.prototype.update=function(e,t){s.a.defined("time",e);const n=this.scene,i=this.ellipsoid,r=n.mode;if(r===AB.MORPHING)return;const o=this.entity,a=o.position;if(!Object(l.a)(a))return;const c=o!==this._lastEntity,u=r!==this._mode,d=n.camera;let f=c||u,p=!0;if(c){const n=o.viewFrom,r=Object(l.a)(n);if(!r&&Object(l.a)(t)){pde.pitch=-h.a.PI_OVER_FOUR,pde.range=0;const n=a.getValue(e,mde);if(Object(l.a)(n)){const e=2-1/Math.max(1,O.magnitude(n)/i.maximumRadius);pde.pitch*=e}d.viewBoundingSphere(t,pde),this.boundingSphere=t,f=!1,p=!1}else r&&Object(l.a)(n.getValue(e,this._offset3D))||O.clone(fde._defaultOffset3D,this._offset3D)}else u||this._mode===AB.SCENE2D||O.clone(d.position,this._offset3D);this._lastEntity=o,this._mode=r,function(e,t,n,i,r,o,a){const s=e.scene.mode;let c=r.getValue(o,e._lastCartesian);if(Object(l.a)(c)){let n,u,d,f,p,m,g=!1,_=!1;if(s===AB.SCENE3D){tr.addSeconds(o,.001,dde);let e=r.getValue(dde,ade);if(Object(l.a)(e)||(tr.addSeconds(o,-.001,dde),e=r.getValue(dde,ade),_=!0),Object(l.a)(e)){let t,i=ca.computeFixedToIcrfMatrix(o,nde),r=ca.computeFixedToIcrfMatrix(dde,ide);Object(l.a)(i)&&Object(l.a)(r)?t=ce.transpose(i,rde):(t=ca.computeTemeToPseudoFixedMatrix(o,rde),i=ce.transpose(t,nde),r=ca.computeTemeToPseudoFixedMatrix(dde,ide),ce.transpose(r,r));const s=ce.multiplyByVector(i,c,ude),f=ce.multiplyByVector(r,e,hde);O.subtract(s,f,lde);const p=1e3*O.magnitude(lde),m=h.a.GRAVITATIONALPARAMETER,y=-m/(p*p-2*m/O.magnitude(s));y<0||y>1.25*a.maximumRadius?(n=sde,O.normalize(c,n),O.negate(n,n),d=O.clone(O.UNIT_Z,cde),u=O.cross(d,n,ade),O.magnitude(u)>h.a.EPSILON7&&(O.normalize(n,n),O.normalize(u,u),d=O.cross(n,u,cde),O.normalize(d,d),g=!0)):O.equalsEpsilon(c,e,h.a.EPSILON7)||(d=sde,O.normalize(s,d),O.normalize(f,f),u=O.cross(d,f,cde),_&&(u=O.multiplyByScalar(u,-1,u)),O.equalsEpsilon(u,O.ZERO,h.a.EPSILON7)||(n=O.cross(u,d,ade),ce.multiplyByVector(t,n,n),ce.multiplyByVector(t,u,u),ce.multiplyByVector(t,d,d),O.normalize(n,n),O.normalize(u,u),O.normalize(d,d),g=!0))}}Object(l.a)(e.boundingSphere)&&(c=e.boundingSphere.center),i&&(f=O.clone(t.position,lde),p=O.clone(t.direction,ude),m=O.clone(t.up,hde));const y=ode;g?(y[0]=n.x,y[1]=n.y,y[2]=n.z,y[3]=0,y[4]=u.x,y[5]=u.y,y[6]=u.z,y[7]=0,y[8]=d.x,y[9]=d.y,y[10]=d.z,y[11]=0,y[12]=c.x,y[13]=c.y,y[14]=c.z,y[15]=0):ca.eastNorthUpToFixedFrame(c,a,y),t._setTransform(y),i&&(O.clone(f,t.position),O.clone(p,t.direction),O.clone(m,t.up),O.cross(p,m,t.right))}if(n){const n=s===AB.SCENE2D||O.equals(e._offset3D,O.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,n)}}(this,d,f,p,a,e,i)};var gde=fde;var _de=(()=>{function e(e){return t(e.map(([e,t])=>new Array(e).fill(t,0,e)))}function t(e){return e.reduce((e,n)=>e.concat(Array.isArray(n)?t(n):n),[])}const n=[0,1,2,3].concat(...e([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function i(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.build_tree=function(n){const i=e.dyn_tree,r=e.stat_desc.static_tree,o=e.stat_desc.elems;let a,s,c,l=-1;for(n.heap_len=0,n.heap_max=573,a=0;a<o;a++)0!==i[2*a]?(n.heap[++n.heap_len]=l=a,n.depth[a]=0):i[2*a+1]=0;for(;n.heap_len<2;)c=n.heap[++n.heap_len]=l<2?++l:0,i[2*c]=1,n.depth[c]=0,n.opt_len--,r&&(n.static_len-=r[2*c+1]);for(e.max_code=l,a=Math.floor(n.heap_len/2);a>=1;a--)n.pqdownheap(i,a);c=o;do{a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],n.pqdownheap(i,1),s=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=s,i[2*c]=i[2*a]+i[2*s],n.depth[c]=Math.max(n.depth[a],n.depth[s])+1,i[2*a+1]=i[2*s+1]=c,n.heap[1]=c++,n.pqdownheap(i,1)}while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],function(t){const n=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,a=e.stat_desc.max_length;let s,c,l,u,h,d,f=0;for(u=0;u<=15;u++)t.bl_count[u]=0;for(n[2*t.heap[t.heap_max]+1]=0,s=t.heap_max+1;s<573;s++)c=t.heap[s],u=n[2*n[2*c+1]+1]+1,u>a&&(u=a,f++),n[2*c+1]=u,c>e.max_code||(t.bl_count[u]++,h=0,c>=o&&(h=r[c-o]),d=n[2*c],t.opt_len+=d*(u+h),i&&(t.static_len+=d*(i[2*c+1]+h)));if(0!==f){do{for(u=a-1;0===t.bl_count[u];)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[a]--,f-=2}while(f>0);for(u=a;0!==u;u--)for(c=t.bl_count[u];0!==c;)l=t.heap[--s],l>e.max_code||(n[2*l+1]!=u&&(t.opt_len+=(u-n[2*l+1])*n[2*l],n[2*l+1]=u),c--)}}(n),function(e,n,i){const r=[];let o,a,s,c=0;for(o=1;o<=15;o++)r[o]=c=c+i[o-1]<<1;for(a=0;a<=n;a++)s=e[2*a+1],0!==s&&(e[2*a]=t(r[s]++,s))}(i,e.max_code,n.bl_count)}}function r(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r}i._length_code=[0,1,2,3,4,5,6,7].concat(...e([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),i.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],i.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],i.d_code=function(e){return e<256?n[e]:n[256+(e>>>7)]},i.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],i.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],i.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],i.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const o=e([[144,8],[112,9],[24,7],[8,8]]);r.static_ltree=t([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map((e,t)=>[e,o[t]]));const a=e([[30,5]]);r.static_dtree=t([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map((e,t)=>[e,a[t]])),r.static_l_desc=new r(r.static_ltree,i.extra_lbits,257,286,15),r.static_d_desc=new r(r.static_dtree,i.extra_dbits,0,30,15),r.static_bl_desc=new r(null,i.extra_blbits,0,19,7);function s(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}const c=[new s(0,0,0,0,0),new s(4,4,8,4,1),new s(4,5,16,8,1),new s(4,6,32,32,1),new s(4,4,16,16,2),new s(8,16,32,32,2),new s(8,16,128,128,2),new s(8,32,128,256,2),new s(32,128,258,1024,2),new s(32,258,258,4096,2)],l=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function u(e,t,n,i){const r=e[2*t],o=e[2*n];return r<o||r==o&&i[t]<=i[n]}function h(){const e=this;let t,n,o,a,s,h,d,f,p,m,g,_,y,b,v,O,w,A,E,T,C,x,S,I,P,D,R,j,M,L,N,B,F;const z=new i,k=new i,U=new i;let V,H,G,q,W,Y;function X(){let t;for(t=0;t<286;t++)N[2*t]=0;for(t=0;t<30;t++)B[2*t]=0;for(t=0;t<19;t++)F[2*t]=0;N[512]=1,e.opt_len=e.static_len=0,H=G=0}function K(e,t){let n,i=-1,r=e[1],o=0,a=7,s=4;0===r&&(a=138,s=3),e[2*(t+1)+1]=65535;for(let c=0;c<=t;c++)n=r,r=e[2*(c+1)+1],++o<a&&n==r||(o<s?F[2*n]+=o:0!==n?(n!=i&&F[2*n]++,F[32]++):o<=10?F[34]++:F[36]++,o=0,i=n,0===r?(a=138,s=3):n==r?(a=6,s=3):(a=7,s=4))}function J(t){e.pending_buf[e.pending++]=t}function Z(e){J(255&e),J(e>>>8&255)}function $(e,t){let n;const i=t;Y>16-i?(n=e,W|=n<<Y&65535,Z(W),W=n>>>16-Y,Y+=i-16):(W|=e<<Y&65535,Y+=i)}function Q(e,t){const n=2*e;$(65535&t[n],65535&t[n+1])}function ee(e,t){let n,i,r=-1,o=e[1],a=0,s=7,c=4;for(0===o&&(s=138,c=3),n=0;n<=t;n++)if(i=o,o=e[2*(n+1)+1],!(++a<s&&i==o)){if(a<c)do{Q(i,F)}while(0!=--a);else 0!==i?(i!=r&&(Q(i,F),a--),Q(16,F),$(a-3,2)):a<=10?(Q(17,F),$(a-3,3)):(Q(18,F),$(a-11,7));a=0,r=i,0===o?(s=138,c=3):i==o?(s=6,c=3):(s=7,c=4)}}function te(){16==Y?(Z(W),W=0,Y=0):Y>=8&&(J(255&W),W>>>=8,Y-=8)}function ne(t,n){let r,o,a;if(e.dist_buf[H]=t,e.lc_buf[H]=255&n,H++,0===t?N[2*n]++:(G++,t--,N[2*(i._length_code[n]+256+1)]++,B[2*i.d_code(t)]++),0==(8191&H)&&R>2){for(r=8*H,o=C-w,a=0;a<30;a++)r+=B[2*a]*(5+i.extra_dbits[a]);if(r>>>=3,G<Math.floor(H/2)&&r<Math.floor(o/2))return!0}return H==V-1}function ie(t,n){let r,o,a,s,c=0;if(0!==H)do{r=e.dist_buf[c],o=e.lc_buf[c],c++,0===r?Q(o,t):(a=i._length_code[o],Q(a+256+1,t),s=i.extra_lbits[a],0!==s&&(o-=i.base_length[a],$(o,s)),r--,a=i.d_code(r),Q(a,n),s=i.extra_dbits[a],0!==s&&(r-=i.base_dist[a],$(r,s)))}while(c<H);Q(256,t),q=t[513]}function re(){Y>8?Z(W):Y>0&&J(255&W),W=0,Y=0}function oe(t,n,i){$(0+(i?1:0),3),function(t,n,i){re(),q=8,i&&(Z(n),Z(~n)),e.pending_buf.set(f.subarray(t,t+n),e.pending),e.pending+=n}(t,n,!0)}function ae(t,n,o){let a,s,c=0;R>0?(z.build_tree(e),k.build_tree(e),c=function(){let t;for(K(N,z.max_code),K(B,k.max_code),U.build_tree(e),t=18;t>=3&&0===F[2*i.bl_order[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(),a=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=a&&(a=s)):a=s=n+5,n+4<=a&&-1!=t?oe(t,n,o):s==a?($(2+(o?1:0),3),ie(r.static_ltree,r.static_dtree)):($(4+(o?1:0),3),function(e,t,n){let r;for($(e-257,5),$(t-1,5),$(n-4,4),r=0;r<n;r++)$(F[2*i.bl_order[r]+1],3);ee(N,e-1),ee(B,t-1)}(z.max_code+1,k.max_code+1,c+1),ie(N,B)),X(),o&&re()}function se(e){ae(w>=0?w:-1,C-w,e),w=C,t.flush_pending()}function ce(){let e,n,i,r;do{if(r=p-S-C,0===r&&0===C&&0===S)r=s;else if(-1==r)r--;else if(C>=s+s-262){f.set(f.subarray(s,s+s),0),x-=s,C-=s,w-=s,e=y,i=e;do{n=65535&g[--i],g[i]=n>=s?n-s:0}while(0!=--e);e=s,i=e;do{n=65535&m[--i],m[i]=n>=s?n-s:0}while(0!=--e);r+=s}if(0===t.avail_in)return;e=t.read_buf(f,C+S,r),S+=e,S>=3&&(_=255&f[C],_=(_<<O^255&f[C+1])&v)}while(S<262&&0!==t.avail_in)}function le(e){let t,n,i=P,r=C,o=I;const a=C>s-262?C-(s-262):0;let c=L;const l=d,u=C+258;let h=f[r+o-1],p=f[r+o];I>=M&&(i>>=2),c>S&&(c=S);do{if(t=e,f[t+o]==p&&f[t+o-1]==h&&f[t]==f[r]&&f[++t]==f[r+1]){r+=2,t++;do{}while(f[++r]==f[++t]&&f[++r]==f[++t]&&f[++r]==f[++t]&&f[++r]==f[++t]&&f[++r]==f[++t]&&f[++r]==f[++t]&&f[++r]==f[++t]&&f[++r]==f[++t]&&r<u);if(n=258-(u-r),r=u-258,n>o){if(x=e,o=n,n>=c)break;h=f[r+o-1],p=f[r+o]}}}while((e=65535&m[e&l])>a&&0!=--i);return o<=S?o:S}function ue(t){return t.total_in=t.total_out=0,t.msg=null,e.pending=0,e.pending_out=0,n=113,a=0,z.dyn_tree=N,z.stat_desc=r.static_l_desc,k.dyn_tree=B,k.stat_desc=r.static_d_desc,U.dyn_tree=F,U.stat_desc=r.static_bl_desc,W=0,Y=0,q=8,X(),function(){p=2*s,g[y-1]=0;for(let e=0;e<y-1;e++)g[e]=0;D=c[R].max_lazy,M=c[R].good_length,L=c[R].nice_length,P=c[R].max_chain,C=0,w=0,S=0,A=I=2,T=0,_=0}(),0}e.depth=[],e.bl_count=[],e.heap=[],N=[],B=[],F=[],e.pqdownheap=function(t,n){const i=e.heap,r=i[n];let o=n<<1;for(;o<=e.heap_len&&(o<e.heap_len&&u(t,i[o+1],i[o],e.depth)&&o++,!u(t,r,i[o],e.depth));)i[n]=i[o],n=o,o<<=1;i[n]=r},e.deflateInit=function(t,n,i,r,a,c){return r||(r=8),a||(a=8),c||(c=0),t.msg=null,-1==n&&(n=6),a<1||a>9||8!=r||i<9||i>15||n<0||n>9||c<0||c>2?-2:(t.dstate=e,h=i,s=1<<h,d=s-1,b=a+7,y=1<<b,v=y-1,O=Math.floor((b+3-1)/3),f=new Uint8Array(2*s),m=[],g=[],V=1<<a+6,e.pending_buf=new Uint8Array(4*V),o=4*V,e.dist_buf=new Uint16Array(V),e.lc_buf=new Uint8Array(V),R=n,j=c,ue(t))},e.deflateEnd=function(){return 42!=n&&113!=n&&666!=n?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,g=null,m=null,f=null,e.dstate=null,113==n?-3:0)},e.deflateParams=function(e,t,n){let i=0;return-1==t&&(t=6),t<0||t>9||n<0||n>2?-2:(c[R].func!=c[t].func&&0!==e.total_in&&(i=e.deflate(1)),R!=t&&(R=t,D=c[R].max_lazy,M=c[R].good_length,L=c[R].nice_length,P=c[R].max_chain),j=n,i)},e.deflateSetDictionary=function(e,t,i){let r,o=i,a=0;if(!t||42!=n)return-2;if(o<3)return 0;for(o>s-262&&(o=s-262,a=i-o),f.set(t.subarray(a,a+o),0),C=o,w=o,_=255&f[0],_=(_<<O^255&f[1])&v,r=0;r<=o-3;r++)_=(_<<O^255&f[r+2])&v,m[r&d]=g[_],g[_]=r;return 0},e.deflate=function(i,u){let p,b,P,M,L;if(u>4||u<0)return-2;if(!i.next_out||!i.next_in&&0!==i.avail_in||666==n&&4!=u)return i.msg=l[4],-2;if(0===i.avail_out)return i.msg=l[7],-5;var N;if(t=i,M=a,a=u,42==n&&(b=8+(h-8<<4)<<8,P=(R-1&255)>>1,P>3&&(P=3),b|=P<<6,0!==C&&(b|=32),b+=31-b%31,n=113,J((N=b)>>8&255),J(255&N)),0!==e.pending){if(t.flush_pending(),0===t.avail_out)return a=-1,0}else if(0===t.avail_in&&u<=M&&4!=u)return t.msg=l[7],-5;if(666==n&&0!==t.avail_in)return i.msg=l[7],-5;if(0!==t.avail_in||0!==S||0!=u&&666!=n){switch(L=-1,c[R].func){case 0:L=function(e){let n,i=65535;for(i>o-5&&(i=o-5);;){if(S<=1){if(ce(),0===S&&0==e)return 0;if(0===S)break}if(C+=S,S=0,n=w+i,(0===C||C>=n)&&(S=C-n,C=n,se(!1),0===t.avail_out))return 0;if(C-w>=s-262&&(se(!1),0===t.avail_out))return 0}return se(4==e),0===t.avail_out?4==e?2:0:4==e?3:1}(u);break;case 1:L=function(e){let n,i=0;for(;;){if(S<262){if(ce(),S<262&&0==e)return 0;if(0===S)break}if(S>=3&&(_=(_<<O^255&f[C+2])&v,i=65535&g[_],m[C&d]=g[_],g[_]=C),0!==i&&(C-i&65535)<=s-262&&2!=j&&(A=le(i)),A>=3)if(n=ne(C-x,A-3),S-=A,A<=D&&S>=3){A--;do{C++,_=(_<<O^255&f[C+2])&v,i=65535&g[_],m[C&d]=g[_],g[_]=C}while(0!=--A);C++}else C+=A,A=0,_=255&f[C],_=(_<<O^255&f[C+1])&v;else n=ne(0,255&f[C]),S--,C++;if(n&&(se(!1),0===t.avail_out))return 0}return se(4==e),0===t.avail_out?4==e?2:0:4==e?3:1}(u);break;case 2:L=function(e){let n,i,r=0;for(;;){if(S<262){if(ce(),S<262&&0==e)return 0;if(0===S)break}if(S>=3&&(_=(_<<O^255&f[C+2])&v,r=65535&g[_],m[C&d]=g[_],g[_]=C),I=A,E=x,A=2,0!==r&&I<D&&(C-r&65535)<=s-262&&(2!=j&&(A=le(r)),A<=5&&(1==j||3==A&&C-x>4096)&&(A=2)),I>=3&&A<=I){i=C+S-3,n=ne(C-1-E,I-3),S-=I-1,I-=2;do{++C<=i&&(_=(_<<O^255&f[C+2])&v,r=65535&g[_],m[C&d]=g[_],g[_]=C)}while(0!=--I);if(T=0,A=2,C++,n&&(se(!1),0===t.avail_out))return 0}else if(0!==T){if(n=ne(0,255&f[C-1]),n&&se(!1),C++,S--,0===t.avail_out)return 0}else T=1,C++,S--}return 0!==T&&(n=ne(0,255&f[C-1]),T=0),se(4==e),0===t.avail_out?4==e?2:0:4==e?3:1}(u)}if(2!=L&&3!=L||(n=666),0==L||2==L)return 0===t.avail_out&&(a=-1),0;if(1==L){if(1==u)$(2,3),Q(256,r.static_ltree),te(),1+q+10-Y<9&&($(2,3),Q(256,r.static_ltree),te()),q=7;else if(oe(0,0,!1),3==u)for(p=0;p<y;p++)g[p]=0;if(t.flush_pending(),0===t.avail_out)return a=-1,0}}return 4!=u?0:1}}function d(){this.next_in_index=0,this.next_out_index=0,this.avail_in=0,this.total_in=0,this.avail_out=0,this.total_out=0}return d.prototype={deflateInit(e,t){return this.dstate=new h,t||(t=15),this.dstate.deflateInit(this,e,t)},deflate(e){return this.dstate?this.dstate.deflate(this,e):-2},deflateEnd(){if(!this.dstate)return-2;const e=this.dstate.deflateEnd();return this.dstate=null,e},deflateParams(e,t){return this.dstate?this.dstate.deflateParams(this,e,t):-2},deflateSetDictionary(e,t){return this.dstate?this.dstate.deflateSetDictionary(this,e,t):-2},read_buf(e,t,n){let i=this.avail_in;return i>n&&(i=n),0===i?0:(this.avail_in-=i,e.set(this.next_in.subarray(this.next_in_index,this.next_in_index+i),t),this.next_in_index+=i,this.total_in+=i,i)},flush_pending(){const e=this;let t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,0===e.dstate.pending&&(e.dstate.pending_out=0))}},function(e){const t=new d,n=(i=e&&e.chunkSize?e.chunkSize:65536)+5*(Math.floor(i/16383)+1);var i;const r=new Uint8Array(n);let o=e?e.level:-1;void 0===o&&(o=-1),t.deflateInit(o),t.next_out=r,this.append=function(e,i){let o,a,s=0,c=0,l=0;const u=[];if(e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=n,o=t.deflate(0),0!=o)throw new Error("deflating: "+t.msg);t.next_out_index&&(t.next_out_index==n?u.push(new Uint8Array(r)):u.push(r.slice(0,t.next_out_index))),l+=t.next_out_index,i&&t.next_in_index>0&&t.next_in_index!=s&&(i(t.next_in_index),s=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return u.length>1?(a=new Uint8Array(l),u.forEach((function(e){a.set(e,c),c+=e.length}))):a=u[0]||new Uint8Array,a}},this.flush=function(){let e,i,o=0,a=0;const s=[];do{if(t.next_out_index=0,t.avail_out=n,e=t.deflate(4),1!=e&&0!=e)throw new Error("deflating: "+t.msg);n-t.avail_out>0&&s.push(r.slice(0,t.next_out_index)),a+=t.next_out_index}while(t.avail_in>0||0===t.avail_out);return t.deflateEnd(),i=new Uint8Array(a),s.forEach((function(e){i.set(e,o),o+=e.length})),i}}})();var yde=(()=>{const e=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],t=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],n=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function s(){let e,t,n,s,c,l;function u(e,t,i,r,o,a,u,h,d,f,p){let m,g,_,y,b,v,O,w,A,E,T,C,x,S,I;E=0,b=i;do{n[e[t+E]]++,E++,b--}while(0!==b);if(n[0]==i)return u[0]=-1,h[0]=0,0;for(w=h[0],v=1;v<=15&&0===n[v];v++);for(O=v,w<v&&(w=v),b=15;0!==b&&0===n[b];b--);for(_=b,w>b&&(w=b),h[0]=w,S=1<<v;v<b;v++,S<<=1)if((S-=n[v])<0)return-3;if((S-=n[b])<0)return-3;for(n[b]+=S,l[1]=v=0,E=1,x=2;0!=--b;)l[x]=v+=n[E],x++,E++;b=0,E=0;do{0!==(v=e[t+E])&&(p[l[v]++]=b),E++}while(++b<i);for(i=l[_],l[0]=b=0,E=0,y=-1,C=-w,c[0]=0,T=0,I=0;O<=_;O++)for(m=n[O];0!=m--;){for(;O>C+w;){if(y++,C+=w,I=_-C,I=I>w?w:I,(g=1<<(v=O-C))>m+1&&(g-=m+1,x=O,v<I))for(;++v<I&&!((g<<=1)<=n[++x]);)g-=n[x];if(I=1<<v,f[0]+I>1440)return-3;c[y]=T=f[0],f[0]+=I,0!==y?(l[y]=b,s[0]=v,s[1]=w,v=b>>>C-w,s[2]=T-c[y-1]-v,d.set(s,3*(c[y-1]+v))):u[0]=T}for(s[1]=O-C,E>=i?s[0]=192:p[E]<r?(s[0]=p[E]<256?0:96,s[2]=p[E++]):(s[0]=a[p[E]-r]+16+64,s[2]=o[p[E++]-r]),g=1<<O-C,v=b>>>C;v<I;v+=g)d.set(s,3*(T+v));for(v=1<<O-1;0!=(b&v);v>>>=1)b^=v;for(b^=v,A=(1<<C)-1;(b&A)!=l[y];)y--,C-=w,A=(1<<C)-1}return 0!==S&&1!=_?-5:0}function h(i){let r;for(e||(e=[],t=[],n=new Int32Array(16),s=[],c=new Int32Array(15),l=new Int32Array(16)),t.length<i&&(t=[]),r=0;r<i;r++)t[r]=0;for(r=0;r<16;r++)n[r]=0;for(r=0;r<3;r++)s[r]=0;c.set(n.subarray(0,15),0),l.set(n.subarray(0,16),0)}this.inflate_trees_bits=function(n,i,r,o,a){let s;return h(19),e[0]=0,s=u(n,0,19,19,null,null,r,i,o,e,t),-3==s?a.msg="oversubscribed dynamic bit lengths tree":-5!=s&&0!==i[0]||(a.msg="incomplete dynamic bit lengths tree",s=-3),s},this.inflate_trees_dynamic=function(n,s,c,l,d,f,p,m,g){let _;return h(288),e[0]=0,_=u(c,0,n,257,i,r,f,l,m,e,t),0!=_||0===l[0]?(-3==_?g.msg="oversubscribed literal/length tree":-4!=_&&(g.msg="incomplete literal/length tree",_=-3),_):(h(288),_=u(c,n,s,0,o,a,p,d,m,e,t),0!=_||0===d[0]&&n>257?(-3==_?g.msg="oversubscribed distance tree":-5==_?(g.msg="incomplete distance tree",_=-3):-4!=_&&(g.msg="empty distance tree with lengths",_=-3),_):0)}}s.inflate_trees_fixed=function(e,i,r,o){return e[0]=9,i[0]=5,r[0]=t,o[0]=n,0};function c(){let t,n,i,r,o=0,a=0,s=0,c=0,l=0,u=0,h=0,d=0,f=0,p=0;function m(t,n,i,r,o,a,s,c){let l,u,h,d,f,p,m,g,_,y,b,v,O,w,A,E;m=c.next_in_index,g=c.avail_in,f=s.bitb,p=s.bitk,_=s.write,y=_<s.read?s.read-_-1:s.end-_,b=e[t],v=e[n];do{for(;p<20;)g--,f|=(255&c.read_byte(m++))<<p,p+=8;if(l=f&b,u=i,h=r,E=3*(h+l),0!==(d=u[E]))for(;;){if(f>>=u[E+1],p-=u[E+1],0!=(16&d)){for(d&=15,O=u[E+2]+(f&e[d]),f>>=d,p-=d;p<15;)g--,f|=(255&c.read_byte(m++))<<p,p+=8;for(l=f&v,u=o,h=a,E=3*(h+l),d=u[E];;){if(f>>=u[E+1],p-=u[E+1],0!=(16&d)){for(d&=15;p<d;)g--,f|=(255&c.read_byte(m++))<<p,p+=8;if(w=u[E+2]+(f&e[d]),f>>=d,p-=d,y-=O,_>=w)A=_-w,_-A>0&&2>_-A?(s.win[_++]=s.win[A++],s.win[_++]=s.win[A++],O-=2):(s.win.set(s.win.subarray(A,A+2),_),_+=2,A+=2,O-=2);else{A=_-w;do{A+=s.end}while(A<0);if(d=s.end-A,O>d){if(O-=d,_-A>0&&d>_-A)do{s.win[_++]=s.win[A++]}while(0!=--d);else s.win.set(s.win.subarray(A,A+d),_),_+=d,A+=d,d=0;A=0}}if(_-A>0&&O>_-A)do{s.win[_++]=s.win[A++]}while(0!=--O);else s.win.set(s.win.subarray(A,A+O),_),_+=O,A+=O,O=0;break}if(0!=(64&d))return c.msg="invalid distance code",O=c.avail_in-g,O=p>>3<O?p>>3:O,g+=O,m-=O,p-=O<<3,s.bitb=f,s.bitk=p,c.avail_in=g,c.total_in+=m-c.next_in_index,c.next_in_index=m,s.write=_,-3;l+=u[E+2],l+=f&e[d],E=3*(h+l),d=u[E]}break}if(0!=(64&d))return 0!=(32&d)?(O=c.avail_in-g,O=p>>3<O?p>>3:O,g+=O,m-=O,p-=O<<3,s.bitb=f,s.bitk=p,c.avail_in=g,c.total_in+=m-c.next_in_index,c.next_in_index=m,s.write=_,1):(c.msg="invalid literal/length code",O=c.avail_in-g,O=p>>3<O?p>>3:O,g+=O,m-=O,p-=O<<3,s.bitb=f,s.bitk=p,c.avail_in=g,c.total_in+=m-c.next_in_index,c.next_in_index=m,s.write=_,-3);if(l+=u[E+2],l+=f&e[d],E=3*(h+l),0===(d=u[E])){f>>=u[E+1],p-=u[E+1],s.win[_++]=u[E+2],y--;break}}else f>>=u[E+1],p-=u[E+1],s.win[_++]=u[E+2],y--}while(y>=258&&g>=10);return O=c.avail_in-g,O=p>>3<O?p>>3:O,g+=O,m-=O,p-=O<<3,s.bitb=f,s.bitk=p,c.avail_in=g,c.total_in+=m-c.next_in_index,c.next_in_index=m,s.write=_,0}this.init=function(e,o,a,s,c,l){t=0,h=e,d=o,i=a,f=s,r=c,p=l,n=null},this.proc=function(g,_,y){let b,v,O,w,A,E,T,C=0,x=0,S=0;for(S=_.next_in_index,w=_.avail_in,C=g.bitb,x=g.bitk,A=g.write,E=A<g.read?g.read-A-1:g.end-A;;)switch(t){case 0:if(E>=258&&w>=10&&(g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,y=m(h,d,i,f,r,p,g,_),S=_.next_in_index,w=_.avail_in,C=g.bitb,x=g.bitk,A=g.write,E=A<g.read?g.read-A-1:g.end-A,0!=y)){t=1==y?7:9;break}s=h,n=i,a=f,t=1;case 1:for(b=s;x<b;){if(0===w)return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);y=0,w--,C|=(255&_.read_byte(S++))<<x,x+=8}if(v=3*(a+(C&e[b])),C>>>=n[v+1],x-=n[v+1],O=n[v],0===O){c=n[v+2],t=6;break}if(0!=(16&O)){l=15&O,o=n[v+2],t=2;break}if(0==(64&O)){s=O,a=v/3+n[v+2];break}if(0!=(32&O)){t=7;break}return t=9,_.msg="invalid literal/length code",y=-3,g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);case 2:for(b=l;x<b;){if(0===w)return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);y=0,w--,C|=(255&_.read_byte(S++))<<x,x+=8}o+=C&e[b],C>>=b,x-=b,s=d,n=r,a=p,t=3;case 3:for(b=s;x<b;){if(0===w)return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);y=0,w--,C|=(255&_.read_byte(S++))<<x,x+=8}if(v=3*(a+(C&e[b])),C>>=n[v+1],x-=n[v+1],O=n[v],0!=(16&O)){l=15&O,u=n[v+2],t=4;break}if(0==(64&O)){s=O,a=v/3+n[v+2];break}return t=9,_.msg="invalid distance code",y=-3,g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);case 4:for(b=l;x<b;){if(0===w)return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);y=0,w--,C|=(255&_.read_byte(S++))<<x,x+=8}u+=C&e[b],C>>=b,x-=b,t=5;case 5:for(T=A-u;T<0;)T+=g.end;for(;0!==o;){if(0===E&&(A==g.end&&0!==g.read&&(A=0,E=A<g.read?g.read-A-1:g.end-A),0===E&&(g.write=A,y=g.inflate_flush(_,y),A=g.write,E=A<g.read?g.read-A-1:g.end-A,A==g.end&&0!==g.read&&(A=0,E=A<g.read?g.read-A-1:g.end-A),0===E)))return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);g.win[A++]=g.win[T++],E--,T==g.end&&(T=0),o--}t=0;break;case 6:if(0===E&&(A==g.end&&0!==g.read&&(A=0,E=A<g.read?g.read-A-1:g.end-A),0===E&&(g.write=A,y=g.inflate_flush(_,y),A=g.write,E=A<g.read?g.read-A-1:g.end-A,A==g.end&&0!==g.read&&(A=0,E=A<g.read?g.read-A-1:g.end-A),0===E)))return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);y=0,g.win[A++]=c,E--,t=0;break;case 7:if(x>7&&(x-=8,w++,S--),g.write=A,y=g.inflate_flush(_,y),A=g.write,E=A<g.read?g.read-A-1:g.end-A,g.read!=g.write)return g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);t=8;case 8:return y=1,g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);case 9:return y=-3,g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y);default:return y=-2,g.bitb=C,g.bitk=x,_.avail_in=w,_.total_in+=S-_.next_in_index,_.next_in_index=S,g.write=A,g.inflate_flush(_,y)}},this.free=function(){}}const l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function u(t,n){const i=this;let r,o=0,a=0,u=0,h=0;const d=[0],f=[0],p=new c;let m=0,g=new Int32Array(4320);const _=new s;i.bitk=0,i.bitb=0,i.win=new Uint8Array(n),i.end=n,i.read=0,i.write=0,i.reset=function(e,t){t&&(t[0]=0),6==o&&p.free(e),o=0,i.bitk=0,i.bitb=0,i.read=i.write=0},i.reset(t,null),i.inflate_flush=function(e,t){let n,r,o;return r=e.next_out_index,o=i.read,n=(o<=i.write?i.write:i.end)-o,n>e.avail_out&&(n=e.avail_out),0!==n&&-5==t&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(i.win.subarray(o,o+n),r),r+=n,o+=n,o==i.end&&(o=0,i.write==i.end&&(i.write=0),n=i.write-o,n>e.avail_out&&(n=e.avail_out),0!==n&&-5==t&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(i.win.subarray(o,o+n),r),r+=n,o+=n),e.next_out_index=r,i.read=o,t},i.proc=function(t,n){let c,y,b,v,O,w,A,E;for(v=t.next_in_index,O=t.avail_in,y=i.bitb,b=i.bitk,w=i.write,A=w<i.read?i.read-w-1:i.end-w;;){let T,C,x,S,I,P,D,R;switch(o){case 0:for(;b<3;){if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);n=0,O--,y|=(255&t.read_byte(v++))<<b,b+=8}switch(c=7&y,m=1&c,c>>>1){case 0:y>>>=3,b-=3,c=7&b,y>>>=c,b-=c,o=1;break;case 1:T=[],C=[],x=[[]],S=[[]],s.inflate_trees_fixed(T,C,x,S),p.init(T[0],C[0],x[0],0,S[0],0),y>>>=3,b-=3,o=6;break;case 2:y>>>=3,b-=3,o=3;break;case 3:return y>>>=3,b-=3,o=9,t.msg="invalid block type",n=-3,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n)}break;case 1:for(;b<32;){if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);n=0,O--,y|=(255&t.read_byte(v++))<<b,b+=8}if((~y>>>16&65535)!=(65535&y))return o=9,t.msg="invalid stored block lengths",n=-3,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);a=65535&y,y=b=0,o=0!==a?2:0!==m?7:0;break;case 2:if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);if(0===A&&(w==i.end&&0!==i.read&&(w=0,A=w<i.read?i.read-w-1:i.end-w),0===A&&(i.write=w,n=i.inflate_flush(t,n),w=i.write,A=w<i.read?i.read-w-1:i.end-w,w==i.end&&0!==i.read&&(w=0,A=w<i.read?i.read-w-1:i.end-w),0===A)))return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);if(n=0,c=a,c>O&&(c=O),c>A&&(c=A),i.win.set(t.read_buf(v,c),w),v+=c,O-=c,w+=c,A-=c,0!=(a-=c))break;o=0!==m?7:0;break;case 3:for(;b<14;){if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);n=0,O--,y|=(255&t.read_byte(v++))<<b,b+=8}if(u=c=16383&y,(31&c)>29||(c>>5&31)>29)return o=9,t.msg="too many length or distance symbols",n=-3,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);if(c=258+(31&c)+(c>>5&31),!r||r.length<c)r=[];else for(E=0;E<c;E++)r[E]=0;y>>>=14,b-=14,h=0,o=4;case 4:for(;h<4+(u>>>10);){for(;b<3;){if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);n=0,O--,y|=(255&t.read_byte(v++))<<b,b+=8}r[l[h++]]=7&y,y>>>=3,b-=3}for(;h<19;)r[l[h++]]=0;if(d[0]=7,c=_.inflate_trees_bits(r,d,f,g,t),0!=c)return-3==(n=c)&&(r=null,o=9),i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);h=0,o=5;case 5:for(;c=u,!(h>=258+(31&c)+(c>>5&31));){let a,s;for(c=d[0];b<c;){if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);n=0,O--,y|=(255&t.read_byte(v++))<<b,b+=8}if(c=g[3*(f[0]+(y&e[c]))+1],s=g[3*(f[0]+(y&e[c]))+2],s<16)y>>>=c,b-=c,r[h++]=s;else{for(E=18==s?7:s-14,a=18==s?11:3;b<c+E;){if(0===O)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);n=0,O--,y|=(255&t.read_byte(v++))<<b,b+=8}if(y>>>=c,b-=c,a+=y&e[E],y>>>=E,b-=E,E=h,c=u,E+a>258+(31&c)+(c>>5&31)||16==s&&E<1)return r=null,o=9,t.msg="invalid bit length repeat",n=-3,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);s=16==s?r[E-1]:0;do{r[E++]=s}while(0!=--a);h=E}}if(f[0]=-1,I=[],P=[],D=[],R=[],I[0]=9,P[0]=6,c=u,c=_.inflate_trees_dynamic(257+(31&c),1+(c>>5&31),r,I,P,D,R,g,t),0!=c)return-3==c&&(r=null,o=9),n=c,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);p.init(I[0],P[0],g,D[0],g,R[0]),o=6;case 6:if(i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,1!=(n=p.proc(i,t,n)))return i.inflate_flush(t,n);if(n=0,p.free(t),v=t.next_in_index,O=t.avail_in,y=i.bitb,b=i.bitk,w=i.write,A=w<i.read?i.read-w-1:i.end-w,0===m){o=0;break}o=7;case 7:if(i.write=w,n=i.inflate_flush(t,n),w=i.write,A=w<i.read?i.read-w-1:i.end-w,i.read!=i.write)return i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);o=8;case 8:return n=1,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);case 9:return n=-3,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n);default:return n=-2,i.bitb=y,i.bitk=b,t.avail_in=O,t.total_in+=v-t.next_in_index,t.next_in_index=v,i.write=w,i.inflate_flush(t,n)}}},i.free=function(e){i.reset(e,null),i.win=null,g=null},i.set_dictionary=function(e,t,n){i.win.set(e.subarray(t,t+n),0),i.read=i.write=n},i.sync_point=function(){return 1==o?1:0}}const h=[0,0,255,255];function d(){const e=this;function t(e){return e&&e.istate?(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=7,e.istate.blocks.reset(e,null),0):-2}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=function(t){return e.blocks&&e.blocks.free(t),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new u(n,1<<i),t(n),0)},e.inflate=function(e,t){let n,i;if(!e||!e.istate||!e.next_in)return-2;const r=e.istate;for(t=4==t?-5:0,n=-5;;)switch(r.mode){case 0:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,8!=(15&(r.method=e.read_byte(e.next_in_index++)))){r.mode=13,e.msg="unknown compression method",r.marker=5;break}if(8+(r.method>>4)>r.wbits){r.mode=13,e.msg="invalid win size",r.marker=5;break}r.mode=1;case 1:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,i=255&e.read_byte(e.next_in_index++),((r.method<<8)+i)%31!=0){r.mode=13,e.msg="incorrect header check",r.marker=5;break}if(0==(32&i)){r.mode=7;break}r.mode=2;case 2:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,r.mode=3;case 3:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,r.mode=4;case 4:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,r.mode=5;case 5:return 0===e.avail_in?n:(n=t,e.avail_in--,e.total_in++,r.need+=255&e.read_byte(e.next_in_index++),r.mode=6,2);case 6:return r.mode=13,e.msg="need dictionary",r.marker=0,-2;case 7:if(n=r.blocks.proc(e,n),-3==n){r.mode=13,r.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,r.blocks.reset(e,r.was),r.mode=12;case 12:return e.avail_in=0,1;case 13:return-3;default:return-2}},e.inflateSetDictionary=function(e,t,n){let i=0,r=n;if(!e||!e.istate||6!=e.istate.mode)return-2;const o=e.istate;return r>=1<<o.wbits&&(r=(1<<o.wbits)-1,i=n-r),o.blocks.set_dictionary(t,i,r),o.mode=7,0},e.inflateSync=function(e){let n,i,r,o,a;if(!e||!e.istate)return-2;const s=e.istate;if(13!=s.mode&&(s.mode=13,s.marker=0),0===(n=e.avail_in))return-5;for(i=e.next_in_index,r=s.marker;0!==n&&r<4;)e.read_byte(i)==h[r]?r++:r=0!==e.read_byte(i)?0:4-r,i++,n--;return e.total_in+=i-e.next_in_index,e.next_in_index=i,e.avail_in=n,s.marker=r,4!=r?-3:(o=e.total_in,a=e.total_out,t(e),e.total_in=o,e.total_out=a,s.mode=7,0)},e.inflateSyncPoint=function(e){return e&&e.istate&&e.istate.blocks?e.istate.blocks.sync_point():-2}}function f(){}return f.prototype={inflateInit(e){return this.istate=new d,e||(e=15),this.istate.inflateInit(this,e)},inflate(e){return this.istate?this.istate.inflate(this,e):-2},inflateEnd(){if(!this.istate)return-2;const e=this.istate.inflateEnd(this);return this.istate=null,e},inflateSync(){return this.istate?this.istate.inflateSync(this):-2},inflateSetDictionary(e,t){return this.istate?this.istate.inflateSetDictionary(this,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}},function(e){const t=new f,n=e&&e.chunkSize?Math.floor(2*e.chunkSize):131072,i=new Uint8Array(n);let r=!1;t.inflateInit(),t.next_out=i,this.append=function(e,o){const a=[];let s,c,l=0,u=0,h=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=n,0!==t.avail_in||r||(t.next_in_index=0,r=!0),s=t.inflate(0),r&&-5===s){if(0!==t.avail_in)throw new Error("inflating: bad input")}else if(0!==s&&1!==s)throw new Error("inflating: "+t.msg);if((r||1===s)&&t.avail_in===e.length)throw new Error("inflating: bad input");t.next_out_index&&(t.next_out_index===n?a.push(new Uint8Array(i)):a.push(i.slice(0,t.next_out_index))),h+=t.next_out_index,o&&t.next_in_index>0&&t.next_in_index!=l&&(o(t.next_in_index),l=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return a.length>1?(c=new Uint8Array(h),a.forEach((function(e){c.set(e,u),u+=e.length}))):c=a[0]||new Uint8Array,c}},this.flush=function(){t.inflateEnd()}}})();const bde={chunkSize:524288,maxWorkers:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},vde=Object.assign({},bde);function Ode(){return vde}function wde(e){return Math.max(e.chunkSize,64)}function Ade(e){const{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:r,useCompressionStream:o,useWebWorkers:a,Deflate:s,Inflate:c,workerScripts:l}=e;if(Ede("baseURL",t),Ede("chunkSize",n),Ede("maxWorkers",i),Ede("terminateWorkerTimeout",r),Ede("useCompressionStream",o),Ede("useWebWorkers",a),Ede("Deflate",s),Ede("Inflate",c),void 0!==l){const{deflate:e,inflate:t}=l;if((e||t)&&(vde.workerScripts||(vde.workerScripts={})),e){if(!Array.isArray(e))throw new Error("workerScripts.deflate must be an array");vde.workerScripts.deflate=e}if(t){if(!Array.isArray(t))throw new Error("workerScripts.inflate must be an array");vde.workerScripts.inflate=t}}}function Ede(e,t){void 0!==t&&(vde[e]=t)}function Tde(){return"application/octet-stream"}const Cde=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=t>>>1^3988292384:t>>>=1;Cde[e]=t}var xde=class{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,i=0|e.length;n<i;n++)t=t>>>8^Cde[255&(t^e[n])];this.crc=t}get(){return~this.crc}};class Sde extends TransformStream{constructor(){super({start(){this.crc32=new xde},transform(e){this.crc32.append(e)},flush(e){const t=new Uint8Array(4);new DataView(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}var Ide=Sde,Pde=function(e){if("undefined"==typeof TextEncoder){e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new TextEncoder).encode(e)};const Dde={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],i=Dde.getPartial(n);return 32===i?e.concat(t):Dde._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+Dde.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,Math.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=Dde.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>Math.round(e/1099511627776)||32,_shiftRight(e,t,n,i){for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(let r=0;r<e.length;r++)i.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,o=Dde.getPartial(r);return i.push(Dde.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},Rde={bytes:{fromBits(e){const t=Dde.bitLength(e)/8,n=new Uint8Array(t);let i;for(let r=0;r<t;r++)0==(3&r)&&(i=e[r/4]),n[r]=i>>>24,i<<=8;return n},toBits(e){const t=[];let n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],3==(3&n)&&(t.push(i),i=0);return 3&n&&t.push(Dde.partial(8*(3&n),i)),t}}},jde={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};jde.sha1.prototype={blockSize:512,reset(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update(e){const t=this;"string"==typeof e&&(e=Rde.utf8String.toBits(e));const n=t._buffer=Dde.concat(t._buffer,e),i=t._length,r=t._length=i+Dde.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(n);let a=0;for(let e=t.blockSize+i-(t.blockSize+i&t.blockSize-1);e<=r;e+=t.blockSize)t._block(o.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),t},finalize(){const e=this;let t=e._buffer;const n=e._h;t=Dde.concat(t,[Dde.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,i)=>e<=19?t&n|~t&i:e<=39?t^n^i:e<=59?t&n|t&i|n&i:e<=79?t^n^i:void 0,_S:(e,t)=>t<<e|t>>>32-e,_block(e){const t=this,n=t._h,i=Array(80);for(let t=0;t<16;t++)i[t]=e[t];let r=n[0],o=n[1],a=n[2],s=n[3],c=n[4];for(let e=0;e<=79;e++){e>=16&&(i[e]=t._S(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const n=t._S(5,r)+t._f(e,o,a,s)+c+i[e]+t._key[Math.floor(e/20)]|0;c=s,s=a,a=t._S(30,o),o=r,r=n}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0}};const Mde={aes:class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],i=t._tables[1],r=e.length;let o,a,s,c=1;if(4!==r&&6!==r&&8!==r)throw new Error("invalid aes key size");for(t._key=[a=e.slice(0),s=[]],o=r;o<4*r+28;o++){let e=a[o-1];(o%r==0||8===r&&o%r==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%r==0&&(e=e<<8^e>>>24^c<<24,c=c<<1^283*(c>>7))),a[o]=a[o-r]^e}for(let e=0;o;e++,o--){const t=a[3&e?o:o-4];s[e]=o<=4||e<4?t:i[0][n[t>>>24]]^i[1][n[t>>16&255]]^i[2][n[t>>8&255]]^i[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[];let a,s,c,l;for(let e=0;e<256;e++)o[(r[e]=e<<1^283*(e>>7))^e]=e;for(let u=a=0;!n[u];u^=s||1,a=o[a]||1){let o=a^a<<1^a<<2^a<<3^a<<4;o=o>>8^255&o^99,n[u]=o,i[o]=u,l=r[c=r[s=r[u]]];let h=16843009*l^65537*c^257*s^16843008*u,d=257*r[o]^16843008*o;for(let n=0;n<4;n++)e[n][u]=d=d<<24^d>>>8,t[n][o]=h=h<<24^h>>>8}for(let n=0;n<5;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new Error("invalid aes block size");const n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],a=o[0],s=o[1],c=o[2],l=o[3],u=o[4];let h,d,f,p=e[0]^n[0],m=e[t?3:1]^n[1],g=e[2]^n[2],_=e[t?1:3]^n[3],y=4;for(let e=0;e<i;e++)h=a[p>>>24]^s[m>>16&255]^c[g>>8&255]^l[255&_]^n[y],d=a[m>>>24]^s[g>>16&255]^c[_>>8&255]^l[255&p]^n[y+1],f=a[g>>>24]^s[_>>16&255]^c[p>>8&255]^l[255&m]^n[y+2],_=a[_>>>24]^s[p>>16&255]^c[m>>8&255]^l[255&g]^n[y+3],y+=4,p=h,m=d,g=f;for(let e=0;e<4;e++)r[t?3&-e:e]=u[p>>>24]<<24^u[m>>16&255]<<16^u[g>>8&255]<<8^u[255&_]^n[y++],h=p,p=m,m=g,g=_,_=h;return r}}},Lde={getRandomValues(e){const t=new Uint32Array(e.buffer),n=e=>{let t=987654321;const n=4294967295;return function(){t=36969*(65535&t)+(t>>16)&n;return(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i,r=0;r<e.length;r+=4){const e=n(4294967296*(i||Math.random()));i=987654071*e(),t[r/4]=4294967296*e()|0}return e}},Nde={ctrGladman:class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];const r=Dde.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);const i=e.encrypt(n);t[r]^=i[0],t[r+1]^=i[1],t[r+2]^=i[2],t[r+3]^=i[3]}return Dde.clamp(t,r)}}},Bde={importKey:e=>new Bde.hmacSha1(Rde.bytes.toBits(e)),pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");const r=1+(i>>5)<<2;let o,a,s,c,l;const u=new ArrayBuffer(r),h=new DataView(u);let d=0;const f=Dde;for(t=Rde.bytes.toBits(t),l=1;d<(r||1);l++){for(o=a=e.encrypt(f.concat(t,[l])),s=1;s<n;s++)for(a=e.encrypt(a),c=0;c<a.length;c++)o[c]^=a[c];for(s=0;d<(r||1)&&s<o.length;s++)h.setInt32(d,o[s]),d+=4}return u.slice(0,i/8)},hmacSha1:class{constructor(e){const t=this._hash=jde.sha1,n=[[],[]],i=t.prototype.blockSize/32;this._baseHash=[new t,new t],e.length>i&&(e=t.hash(e));for(let t=0;t<i;t++)n[0][t]=909522486^e[t],n[1][t]=1549556828^e[t];this._baseHash[0].update(n[0]),this._baseHash[1].update(n[1]),this._resultHash=new t(this._baseHash[0])}reset(){this._resultHash=new this._hash(this._baseHash[0]),this._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this._resultHash.finalize(),t=new this._hash(this._baseHash[1]).update(e).finalize();return this.reset(),t}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},Fde="undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues,zde="Invalid password";function kde(e){return Fde?crypto.getRandomValues(e):Lde.getRandomValues(e)}const Ude={name:"PBKDF2"},Vde=Object.assign({hash:{name:"HMAC"}},Ude),Hde=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Ude),Gde=["deriveBits"],qde=[8,12,16],Wde=[16,24,32],Yde=[0,0,0,0],Xde="undefined"!=typeof crypto,Kde=Xde&&void 0!==crypto.subtle,Jde=Xde&&Kde&&"function"==typeof crypto.subtle.importKey,Zde=Xde&&Kde&&"function"==typeof crypto.subtle.deriveBits,$de=Rde.bytes,Qde=Mde.aes,efe=Nde.ctrGladman,tfe=Bde.hmacSha1;class nfe extends TransformStream{constructor(e,t,n){let i;super({start(){Object.assign(this,{ready:new Promise(e=>this.resolveReady=e),password:e,signed:t,strength:n-1,pending:new Uint8Array})},async transform(e,t){const n=this;if(n.password){const t=n.password;n.password=null;const i=sfe(e,0,qde[n.strength]+2);await async function(e,t,n){await ofe(e,n,sfe(t,0,qde[e.strength]));const i=sfe(t,qde[e.strength]),r=e.keys.passwordVerification;if(r[0]!=i[0]||r[1]!=i[1])throw new Error(zde)}(n,i,t),n.ctr=new efe(new Qde(n.keys.key),Array.from(Yde)),n.hmac=new tfe(n.keys.authentication),e=sfe(e,qde[n.strength]+2),n.resolveReady()}else await n.ready;const i=new Uint8Array(e.length-10-(e.length-10)%16);t.enqueue(rfe(n,e,i,0,10,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,r=sfe(n,0,n.length-10),o=sfe(n,n.length-10);let a=new Uint8Array;if(r.length){const e=lfe($de,r);t.hmac.update(e);const n=t.ctr.update(e);a=cfe($de,n)}if(i.valid=!0,t.signed){const e=sfe(cfe($de,t.hmac.digest()),0,10);for(let t=0;t<10;t++)e[t]!=o[t]&&(i.valid=!1)}e.enqueue(a)}}),i=this}}class ife extends TransformStream{constructor(e,t){let n;super({start(){Object.assign(this,{ready:new Promise(e=>this.resolveReady=e),password:e,strength:t-1,pending:new Uint8Array})},async transform(e,t){const n=this;let i=new Uint8Array;if(n.password){const e=n.password;n.password=null,i=await async function(e,t){const n=kde(new Uint8Array(qde[e.strength]));return await ofe(e,t,n),afe(n,e.keys.passwordVerification)}(n,e),n.ctr=new efe(new Qde(n.keys.key),Array.from(Yde)),n.hmac=new tfe(n.keys.authentication),n.resolveReady()}else await n.ready;const r=new Uint8Array(i.length+e.length-e.length%16);r.set(i,0),t.enqueue(rfe(n,e,r,i.length,0))},async flush(e){const t=this;await t.ready;let i=new Uint8Array;if(t.pending.length){const e=t.ctr.update(lfe($de,t.pending));t.hmac.update(e),i=cfe($de,e)}n.signature=cfe($de,t.hmac.digest()).slice(0,10),e.enqueue(afe(i,n.signature))}}),n=this}}function rfe(e,t,n,i,r,o){const a=t.length-r;let s;for(e.pending.length&&(t=afe(e.pending,t),n=function(e,t){if(t&&t>e.length){const n=e;(e=new Uint8Array(t)).set(n,0)}return e}(n,a-a%16)),s=0;s<=a-16;s+=16){const r=lfe($de,sfe(t,s,s+16));o&&e.hmac.update(r);const a=e.ctr.update(r);o||e.hmac.update(a),n.set(cfe($de,a),s+i)}return e.pending=sfe(t,s),n}async function ofe(e,t,n){const i=Pde(t),r=await function(e,t,n,i,r){return Jde?crypto.subtle.importKey(e,t,n,i,r):Bde.importKey(t)}("raw",i,Vde,!1,Gde),o=await async function(e,t,n){return Zde?await crypto.subtle.deriveBits(e,t,n):Bde.pbkdf2(t,e.salt,Hde.iterations,n)}(Object.assign({salt:n},Hde),r,8*(2*Wde[e.strength]+2)),a=new Uint8Array(o);e.keys={key:lfe($de,sfe(a,0,Wde[e.strength])),authentication:lfe($de,sfe(a,Wde[e.strength],2*Wde[e.strength])),passwordVerification:sfe(a,2*Wde[e.strength])}}function afe(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function sfe(e,t,n){return e.subarray(t,n)}function cfe(e,t){return e.fromBits(t)}function lfe(e,t){return e.toBits(t)}class ufe extends TransformStream{constructor(e,t){let n;super({start(){Object.assign(this,{password:e,passwordVerification:t}),pfe(this,e)},transform(e,t){const n=this;if(n.password){const t=dfe(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new Error(zde);e=e.subarray(12)}t.enqueue(dfe(n,e))},flush(){n.valid=!0}}),n=this}}class hfe extends TransformStream{constructor(e,t){super({start(){Object.assign(this,{password:e,passwordVerification:t}),pfe(this,e)},transform(e,t){const n=this;let i,r;if(n.password){n.password=null;const t=kde(new Uint8Array(12));t[11]=n.passwordVerification,i=new Uint8Array(e.length+t.length),i.set(ffe(n,t),0),r=12}else i=new Uint8Array(e.length),r=0;i.set(ffe(n,e),r),t.enqueue(i)},flush(){}})}}function dfe(e,t){const n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=gfe(e)^t[i],mfe(e,n[i]);return n}function ffe(e,t){const n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=gfe(e)^t[i],mfe(e,t[i]);return n}function pfe(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new xde(e.keys[0]),e.crcKey2=new xde(e.keys[2]);for(let n=0;n<t.length;n++)mfe(e,t.charCodeAt(n))}function mfe(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=yfe(e.keys[1]+_fe(e.keys[0])),e.keys[1]=yfe(Math.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function gfe(e){const t=2|e.keys[2];return _fe(Math.imul(t,1^t)>>>8)}function _fe(e){return 255&e}function yfe(e){return 4294967295&e}class bfe extends TransformStream{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}var vfe=bfe;const Ofe="Invalid signature",wfe="undefined"==typeof CompressionStream,Afe="undefined"==typeof DecompressionStream;let Efe=!0,Tfe=!0;class Cfe extends TransformStream{constructor(e,t,{chunkSize:n},...i){super({},...i);const{compressed:r,encrypted:o,useCompressionStream:a,password:s,passwordVerification:c,encryptionStrength:l,zipCrypto:u,signed:h,level:d}=t,f=this;let p,m,g=Ife(super.readable);if(o&&!u||!h||([g,p]=g.tee(),p=p.pipeThrough(new Ide)),r)if(void 0!==a&&!a||wfe&&!Tfe)g=Sfe(e,g,{chunkSize:n,level:d});else try{g=g.pipeThrough(new CompressionStream("deflate-raw"))}catch(t){Tfe=!1,g=Sfe(e,g,{chunkSize:n,level:d})}o&&(u?g=g.pipeThrough(new hfe(s,c)):(m=new ife(s,l),g=g.pipeThrough(m))),Pfe(f,g,async()=>{let e;o&&!u&&(e=m.signature),o&&!u||!h||(e=await p.getReader().read(),e=new DataView(e.value.buffer).getUint32(0)),f.signature=e})}}class xfe extends TransformStream{constructor(e,t,{chunkSize:n},...i){super({},...i);const{zipCrypto:r,encrypted:o,password:a,passwordVerification:s,signed:c,encryptionStrength:l,compressed:u,useCompressionStream:h}=t;let d,f,p=Ife(super.readable);if(o&&(r?p=p.pipeThrough(new ufe(a,s)):(f=new nfe(a,c,l),p=p.pipeThrough(f))),u)if(void 0!==h&&!h||Afe&&!Efe)p=Sfe(e,p,{chunkSize:n});else try{p=p.pipeThrough(new DecompressionStream("deflate-raw"))}catch(t){Efe=!1,p=Sfe(e,p,{chunkSize:n})}o&&!r||!c||([p,d]=p.tee(),d=d.pipeThrough(new Ide)),Pfe(this,p,async()=>{if(o&&!r&&!f.valid)throw new Error(Ofe);if((!o||r)&&c){const e=await d.getReader().read(),n=new DataView(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new Error(Ofe)}})}}function Sfe(e,t,n){return t.pipeThrough(new vfe(e,n))}function Ife(e){return e.pipeThrough(new TransformStream({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Pfe(e,t,n){t=t.pipeThrough(new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get:()=>t})}class Dfe{constructor(e,t,n,i,r){const{codecType:o}=i;let a;o.startsWith("deflate")?a=Cfe:o.startsWith("inflate")&&(a=xfe),Object.assign(this,{StreamConstructor:a,CodecConstructor:e,readable:t,writable:n,options:i,config:r})}async run(){const{StreamConstructor:e,CodecConstructor:t,readable:n,writable:i,options:r,config:o}=this,a=new e(t,r,o);let s=0;await n.pipeThrough(a).pipeThrough(new TransformStream({transform(e,t){e&&e.length&&(s+=e.length,t.enqueue(e))}})).pipeTo(i,{preventClose:!0,preventAbort:!0});const{signature:c}=a;return{size:s,signature:c}}}let Rfe,jfe=!0,Mfe=!0;class Lfe{constructor(e,t,n,i){const{readable:r,writable:o}=t,{options:a,config:s,streamOptions:c,useWebWorkers:l,transferStreams:u,scripts:h,codecConstructor:d}=n;Object.assign(e,{busy:!0,codecConstructor:d,readable:r,writable:o,options:Object.assign({},a),scripts:h,transferStreams:u,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,i(e)}});const{signal:f,onstart:p,onprogress:m,size:g,onend:_}=c;let y=0;const b={};return p&&(b.start=()=>Nfe(p,g)),b.transform=async(e,t)=>{y+=e.length,m&&await Nfe(m,y,g),t.enqueue(e)},b.flush=()=>{r.size=y,_&&Nfe(_,y)},e.readable=r.pipeThrough(new TransformStream(b,{highWaterMark:1,size:()=>s.chunkSize}),{signal:f}),void 0===Rfe&&(Rfe="undefined"!=typeof Worker),l&&Rfe?function(e,{baseURL:t,chunkSize:n}){const i={type:"module"};if(Object.assign(e,{streams:{},result:new Promise((t,n)=>{e.resolveResult=t,e.rejectResult=n})}),!e.interface){if(jfe)try{e.worker=o({})}catch(t){jfe=!1,e.worker=o(i)}else e.worker=o(i);e.worker.addEventListener("message",(async function(t){const n=t.data,{resolveResult:i,rejectResult:r,onTaskFinished:o}=e,{reader:s,writer:c}=e.streams,{type:l,data:u,messageId:h,result:d}=n,f=n.error;try{if(f){const{message:e,stack:t,code:n,name:i}=f,r=new Error(e);Object.assign(r,{stack:t,code:n,name:i}),p(r)}else{if("pull"==l){const{value:e,done:t}=await s.read();a({type:"data",data:e,done:t,messageId:h})}"data"==l&&(await c.ready,await c.write(new Uint8Array(u)),a({type:"ack",messageId:h})),"close"==l&&p(null,d)}}catch(e){p(e)}function p(e,t){e?r(e):i(t),c&&c.releaseLock(),o()}}),!1),e.interface={run(){const{readable:t,writable:i,options:o}=e,s={type:"start",scripts:e.scripts.slice(1),options:o,config:{chunkSize:n}};if(e.transferStreams&&Mfe){a({...s,readable:t,writable:i})||(Mfe=!1,r(t,i))}else a(s),r(t,i);return e.result}}}return e.interface;function r(t,n){Object.assign(e.streams,{reader:t.getReader(),writer:n.getWriter()})}function o(n){let i,r;i=e.scripts[0],"function"==typeof i&&(i=i());try{r=new URL(i,t)}catch(e){r=i}return new Worker(r,n)}function a(t){const{worker:n,writer:i,onTaskFinished:r}=e;try{let{data:e,readable:i,writable:r}=t;const o=[];if(e){const{buffer:n,length:i}=e;i!=n.byteLength&&(e=new Uint8Array(e)),t.data=e.buffer,o.push(t.data)}if(i&&o.push(i),r&&o.push(r),o.length)try{return n.postMessage(t,o),!0}catch(e){t.readable=t.writable=null,n.postMessage(t)}else n.postMessage(t)}catch(e){throw i&&i.releaseLock(),r(),e}}}(e,s):function(e,t){const n=new Dfe(e.codecConstructor,e.readable,e.writable,e.options,t),{onTaskFinished:i}=e;return{async run(){try{return await n.run()}finally{i()}}}}(e,s)}}async function Nfe(e,...t){try{await e(...t)}catch(e){}}let Bfe=[];const Ffe=[];let zfe=0;async function kfe(e,t){const{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:a,codecType:s,compressed:c,signed:l,encrypted:u}=n,{workerScripts:h}=i;t.transferStreams=r||void 0===r;const d=!(c||l||u||t.transferStreams);let f;if(t.useWebWorkers=!d&&(o||void 0===o&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[s]:[],n.useCompressionStream=void 0===a?i.useCompressionStream:a,Bfe.length<i.maxWorkers){const n={indexWorker:zfe};zfe++,Bfe.push(n),f=new Lfe(n,e,t,p)}else{const n=Bfe.find(e=>!e.busy);n?(Ufe(n),f=new Lfe(n,e,t,p)):f=await new Promise(n=>Ffe.push({resolve:n,stream:e,workerOptions:t}))}return f.run();function p(e){if(Ffe.length){const[{resolve:t,stream:n,workerOptions:i}]=Ffe.splice(0,1);t(new Lfe(e,n,i,p))}else if(e.worker){const{terminateWorkerTimeout:t}=i;Ufe(e),Number.isFinite(t)&&t>=0&&(e.terminateTimeout=setTimeout(()=>{Bfe=Bfe.filter(t=>t!=e),e.terminate()},t))}else Bfe=Bfe.filter(t=>t!=e)}}function Ufe(e){const{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}function Vfe(){Bfe.forEach(e=>{Ufe(e),e.terminate()})}const Hfe="HTTP Range not supported",Gfe=65536;class qfe{constructor(){this.size=0}init(){this.initialized=!0}}class Wfe extends qfe{get readable(){const e=this,{chunkSize:t=Gfe}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(i){const{offset:r=0,size:o}=n,{chunkOffset:a}=this;i.enqueue(await e.readUint8Array(r+a,Math.min(t,o-a))),a+t>o?i.close():this.chunkOffset+=t}});return n}}class Yfe extends qfe{constructor(){super();const e=this,t=new WritableStream({write:t=>e.writeUint8Array(t)});Object.defineProperty(e,"writable",{get:()=>t})}writeUint8Array(){}}class Xfe extends Wfe{constructor(e){super(),this.blobReader=new $fe(new Blob([e],{type:"text/plain"}))}init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}readUint8Array(e,t){return this.blobReader.readUint8Array(e,t)}}class Kfe extends Yfe{constructor(e){super(),this.encoding=e,this.blob=new Blob([],{type:"text/plain"})}writeUint8Array(e){this.blob=new Blob([this.blob,e.buffer],{type:"text/plain"})}getData(){const e=this;if(e.blob.text&&(void 0===e.encoding||e.encoding&&"utf-8"==e.encoding.toLowerCase()))return e.blob.text();{const t=new FileReader;return new Promise((n,i)=>{t.onload=e=>n(e.target.result),t.onerror=()=>i(t.error),t.readAsText(e.blob,e.encoding)})}}}class Jfe extends Wfe{constructor(e){super();this.dataURI=e;let t=e.length;for(;"="==e.charAt(t-1);)t--;this.dataStart=e.indexOf(",")+1,this.size=Math.floor(.75*(t-this.dataStart))}readUint8Array(e,t){const n=new Uint8Array(t),i=4*Math.floor(e/3),r=this.dataStart,o=atob(this.dataURI.substring(i+r,4*Math.ceil((e+t)/3)+r)),a=e-3*Math.floor(i/4);for(let e=a;e<a+t;e++)n[e-a]=o.charCodeAt(e);return n}}class Zfe extends Yfe{constructor(e){super(),this.data="data:"+(e||"")+";base64,",this.pending=[]}writeUint8Array(e){const t=this;let n=0,i=t.pending;const r=t.pending.length;for(t.pending="",n=0;n<3*Math.floor((r+e.length)/3)-r;n++)i+=String.fromCharCode(e[n]);for(;n<e.length;n++)t.pending+=String.fromCharCode(e[n]);i.length>2?t.data+=btoa(i):t.pending=i}getData(){return this.data+btoa(this.pending)}}class $fe extends Wfe{constructor(e){super(),this.blob=e,this.size=e.size}async readUint8Array(e,t){return new Uint8Array(await this.blob.slice(e,e+t).arrayBuffer())}}class Qfe extends qfe{constructor(e){super();const t=new TransformStream,n=[];e&&n.push(["content-type",e]),Object.defineProperty(this,"writable",{get:()=>t.writable}),this.blob=new Response(t.readable,{headers:n}).blob()}getData(){return this.blob}}class epe extends Wfe{constructor(e,t){super();this.url=e,this.preventHeadRequest=t.preventHeadRequest,this.useRangeHeader=t.useRangeHeader,this.forceRangeRequests=t.forceRangeRequests,this.options=t=Object.assign({},t),delete t.preventHeadRequest,delete t.useRangeHeader,delete t.forceRangeRequests,delete t.useXHR}async init(){super.init(),await npe(this,upe,ape)}readUint8Array(e,t){return ipe(this,e,t,upe,ape)}}class tpe extends Wfe{constructor(e,t){super();this.url=e,this.preventHeadRequest=t.preventHeadRequest,this.useRangeHeader=t.useRangeHeader,this.forceRangeRequests=t.forceRangeRequests,this.options=t}async init(){super.init(),await npe(this,hpe,spe)}readUint8Array(e,t){return ipe(this,e,t,hpe,spe)}}async function npe(e,t,n){if(function(e){const{baseURL:t}=Ode(),{protocol:n}=new URL(e,t);return"http:"==n||"https:"==n}(e.url)&&(e.useRangeHeader||e.forceRangeRequests)){const i=await t("GET",e,rpe(e));if(!e.forceRangeRequests&&"bytes"!=i.headers.get("Accept-Ranges"))throw new Error(Hfe);{let r;const o=i.headers.get("Content-Range");if(o){const e=o.trim().split(/\s*\/\s*/);if(e.length){const t=e[1];t&&"*"!=t&&(r=Number(t))}}void 0===r?await lpe(e,t,n):e.size=r}}else await lpe(e,t,n)}async function ipe(e,t,n,i,r){if(e.useRangeHeader||e.forceRangeRequests){const r=await i("GET",e,rpe(e,t,n));if(206!=r.status)throw new Error(Hfe);return new Uint8Array(await r.arrayBuffer())}return e.data||await r(e,e.options),new Uint8Array(e.data.subarray(t,t+n))}function rpe(e,t=0,n=1){return Object.assign({},ope(e),{Range:"bytes="+t+"-"+(t+n-1)})}function ope(e){const t=e.options.headers;if(t)return Symbol.iterator in t?Object.fromEntries(t):t}async function ape(e){await cpe(e,upe)}async function spe(e){await cpe(e,hpe)}async function cpe(e,t){const n=await t("GET",e,ope(e));e.data=new Uint8Array(await n.arrayBuffer()),e.size||(e.size=e.data.length)}async function lpe(e,t,n){if(e.preventHeadRequest)await n(e,e.options);else{const i=(await t("HEAD",e,ope(e))).headers.get("Content-Length");i?e.size=Number(i):await n(e,e.options)}}async function upe(e,{options:t,url:n},i){const r=await fetch(n,Object.assign({},t,{method:e,headers:i}));if(r.status<400)return r;throw 416==r.status?new Error(Hfe):new Error("HTTP error "+(r.statusText||r.status))}function hpe(e,{url:t},n){return new Promise((i,r)=>{const o=new XMLHttpRequest;if(o.addEventListener("load",()=>{if(o.status<400){const e=[];o.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{const n=t.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,e=>e.toUpperCase()),e.push(n)}),i({status:o.status,arrayBuffer:()=>o.response,headers:new Map(e)})}else r(416==o.status?new Error(Hfe):new Error("HTTP error "+(o.statusText||o.status)))},!1),o.addEventListener("error",e=>r(e.detail.error),!1),o.open(e,t),n)for(const e of Object.entries(n))o.setRequestHeader(e[0],e[1]);o.responseType="arraybuffer",o.send()})}class dpe extends Wfe{constructor(e,t={}){super();this.url=e,this.reader=t.useXHR?new tpe(e,t):new epe(e,t)}set size(e){}get size(){return this.reader.size}async init(){super.init(),await this.reader.init()}readUint8Array(e,t){return this.reader.readUint8Array(e,t)}}class fpe extends dpe{constructor(e,t={}){t.useRangeHeader=!0,super(e,t)}}class ppe extends Wfe{constructor(e){super(),this.array=e,this.size=e.length}readUint8Array(e,t){return this.array.slice(e,e+t)}}class mpe extends Yfe{init(e=0){super.init();this.offset=0,this.array=new Uint8Array(e)}writeUint8Array(e){const t=this;if(t.offset+e.length>t.array.length){const n=t.array;t.array=new Uint8Array(n.length+e.length),t.array.set(n)}t.array.set(e,t.offset),t.offset+=e.length}getData(){return this.array}}async function gpe(e,t){e.init&&!e.initialized&&await e.init(t)}const _pe=new Date(2107,11,31),ype=new Date(1980,0,1),bpe="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),vpe=256==bpe.length;var Ope=function(e,t){return t&&"cp437"==t.trim().toLowerCase()?(e=>{if(vpe){let t="";for(let n=0;n<e.length;n++)t+=bpe[e[n]];return t}return(new TextDecoder).decode(e)})(e):new TextDecoder(t).decode(e)};const wpe=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"];class Ape{constructor(e){wpe.forEach(t=>this[t]=e[t])}}const Epe="File format is not recognized",Tpe="End of central directory not found",Cpe="End of Zip64 central directory not found",xpe="End of Zip64 central directory locator not found",Spe="Central directory header not found",Ipe="Local file header not found",Ppe="Zip64 extra field not found",Dpe="File contains encrypted entry",Rpe="Encryption method not supported",jpe="Compression method not supported",Mpe=["uncompressedSize","compressedSize","offset"];class Lpe{constructor(e,t={}){Object.assign(this,{reader:e,options:t,config:Ode()})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:i}=t;if(await gpe(n),void 0===n.size||!n.readUint8Array){const e=await new Response(n.readable).blob();n=new $fe(e)}if(n.size<22)throw new Error(Epe);n.chunkSize=wde(i);const r=await async function(e,t,n,i,r){const o=new Uint8Array(4);!function(e,t,n){e.setUint32(t,n,!0)}(Ype(o),0,t);const a=i+r;return await s(i)||await s(Math.min(a,n));async function s(t){const r=n-t,a=await Xpe(e,r,t);for(let e=a.length-i;e>=0;e--)if(a[e]==o[0]&&a[e+1]==o[1]&&a[e+2]==o[2]&&a[e+3]==o[3])return{offset:r+e,buffer:a.slice(e,e+i).buffer}}}(n,101010256,n.size,22,1048560);if(!r)throw new Error(Tpe);const o=Ype(r);let a=qpe(o,12),s=qpe(o,16);const c=r.offset,l=Gpe(o,20),u=c+22+l;let h=Gpe(o,8),d=0,f=0;if(4294967295==s||4294967295==a||65535==h){const e=Ype(await Xpe(n,r.offset-20,20));if(117853008!=qpe(e,0))throw new Error(Cpe);s=Wpe(e,8);let t=await Xpe(n,s,56),i=Ype(t);const o=r.offset-20-56;if(101075792!=qpe(i,0)&&s!=o){const e=s;s=o,d=s-e,t=await Xpe(n,s,56),i=Ype(t)}if(101075792!=qpe(i,0))throw new Error(xpe);h=Wpe(i,32),a=Wpe(i,40),s-=a}if(s<0||s>=n.size)throw new Error(Epe);let p=0,m=await Xpe(n,s,a),g=Ype(m);if(a){const e=r.offset-a;if(33639248!=qpe(g,p)&&s!=e){const t=s;s=e,d=s-t,m=await Xpe(n,s,a),g=Ype(m)}}if(s<0||s>=n.size)throw new Error(Epe);const _=kpe(t,e,"filenameEncoding"),y=kpe(t,e,"commentEncoding");for(let r=0;r<h;r++){const o=new Npe(n,i,t.options);if(33639248!=qpe(g,p))throw new Error(Spe);Bpe(o,g,p+6);const a=Boolean(o.bitFlag.languageEncodingFlag),s=p+46,c=s+o.filenameLength,l=c+o.extraFieldLength,u=Gpe(g,p+4),b=0==(0&u);Object.assign(o,{versionMadeBy:u,msDosCompatible:b,compressedSize:0,uncompressedSize:0,commentLength:Gpe(g,p+32),directory:b&&16==(16&Hpe(g,p+38)),offset:qpe(g,p+42)+d,internalFileAttribute:Gpe(g,p+36),externalFileAttribute:qpe(g,p+38),rawFilename:m.subarray(s,c),filenameUTF8:a,commentUTF8:a,rawExtraField:m.subarray(c,l)}),f=Math.max(o.offset,f);const v=l+o.commentLength;o.rawComment=m.subarray(l,v);const[O,w]=await Promise.all([Ope(o.rawFilename,o.filenameUTF8?"utf-8":_||"cp437"),Ope(o.rawComment,o.commentUTF8?"utf-8":y||"cp437")]);o.filename=O,o.comment=w,!o.directory&&o.filename.endsWith("/")&&(o.directory=!0),await Fpe(o,o,g,p+6);const A=new Ape(o);if(A.getData=(e,t)=>o.getData(e,A,t),p=v,e.onprogress)try{await e.onprogress(r+1,h,new Ape(o))}catch(e){}yield A}const b=kpe(t,e,"extractPrependedData"),v=kpe(t,e,"extractAppendedData");return b&&(t.prependedData=f>0?await Xpe(n,0,f):new Uint8Array),t.comment=l?await Xpe(n,c+22,l):new Uint8Array,v&&(t.appendedData=u<n.size?await Xpe(n,u,n.size-u):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class Npe{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n={}){const{reader:i,offset:r,extraFieldAES:o,compressionMethod:a,config:s,bitFlag:c,signature:l,rawLastModDate:u,uncompressedSize:h,compressedSize:d}=this,f=this.localDirectory={};let p=await Xpe(i,r,30);const m=Ype(p);let g=kpe(this,n,"password");if(g=g&&g.length&&g,o&&99!=o.originalCompressionMethod)throw new Error(jpe);if(0!=a&&8!=a)throw new Error(jpe);if(67324752!=qpe(m,0))throw new Error(Ipe);Bpe(f,m,4),p=await Xpe(i,r,30+f.filenameLength+f.extraFieldLength),f.rawExtraField=p.subarray(30+f.filenameLength),await Fpe(this,f,m,4),t.lastAccessDate=f.lastAccessDate,t.creationDate=f.creationDate;const _=this.encrypted&&f.encrypted,y=_&&!o;if(_){if(!y&&void 0===o.strength)throw new Error(Rpe);if(!g)throw new Error(Dpe)}const b=r+30+f.filenameLength+f.extraFieldLength,v=i.readable;v.offset=b;const O=v.size=d,{writable:w}=e;void 0===w.size&&(w.size=0);const A=kpe(this,n,"signal"),E=kpe(this,n,"preventClose");await gpe(e,h);const{onstart:T,onprogress:C,onend:x}=n,S={options:{codecType:"inflate",password:g,zipCrypto:y,encryptionStrength:o&&o.strength,signed:kpe(this,n,"checkSignature"),passwordVerification:y&&(c.dataDescriptor?u>>>8&255:l>>>24&255),signature:l,compressed:0!=a,encrypted:_,useWebWorkers:kpe(this,n,"useWebWorkers"),useCompressionStream:kpe(this,n,"useCompressionStream"),transferStreams:kpe(this,n,"transferStreams"),preventClose:E},config:s,streamOptions:{signal:A,size:O,onstart:T,onprogress:C,onend:x},codecConstructor:s.Inflate};if(w.size+=(await kfe({readable:v,writable:w},S)).size,!E)try{await w.close()}catch(e){}return e.getData?e.getData():w}}function Bpe(e,t,n){const i=e.rawBitFlag=Gpe(t,n+2),r=1==(1&i),o=qpe(t,n+6);Object.assign(e,{encrypted:r,version:Gpe(t,n),bitFlag:{level:(6&i)>>1,dataDescriptor:8==(8&i),languageEncodingFlag:2048==(2048&i)},rawLastModDate:o,lastModDate:Upe(o),filenameLength:Gpe(t,n+22),extraFieldLength:Gpe(t,n+24)})}async function Fpe(e,t,n,i){const{rawExtraField:r}=t,o=t.extraField=new Map,a=Ype(new Uint8Array(r));let s=0;try{for(;s<r.length;){const e=Gpe(a,s),t=Gpe(a,s+2);o.set(e,{type:e,data:r.slice(s+4,s+4+t)}),s+=4+t}}catch(e){}const c=Gpe(n,i+4);t.signature=qpe(n,i+10),t.uncompressedSize=qpe(n,i+18),t.compressedSize=qpe(n,i+14);const l=o.get(1);l&&(!function(e,t){t.zip64=!0;const n=Ype(e.data);e.values=[];for(let t=0;t<Math.floor(e.data.length/8);t++)e.values.push(Wpe(n,0+8*t));const i=Mpe.filter(e=>4294967295==t[e]);for(let t=0;t<i.length;t++)e[i[t]]=e.values[t];Mpe.forEach(n=>{if(4294967295==t[n]){if(void 0===e[n])throw new Error(Ppe);t[n]=e[n]}})}(l,t),t.extraFieldZip64=l);const u=o.get(28789);u&&(await zpe(u,"filename","rawFilename",t,e),t.extraFieldUnicodePath=u);const h=o.get(25461);h&&(await zpe(h,"comment","rawComment",t,e),t.extraFieldUnicodeComment=h);const d=o.get(39169);d?(!function(e,t,n){const i=Ype(e.data);e.vendorVersion=Hpe(i,0),e.vendorId=Hpe(i,2);const r=Hpe(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=Gpe(i,5)}(d,t,c),t.extraFieldAES=d):t.compressionMethod=c;const f=o.get(10);f&&(!function(e,t){const n=Ype(e.data);let i,r=4;try{for(;r<e.data.length&&!i;){const t=Gpe(n,r),o=Gpe(n,r+2);1==t&&(i=e.data.slice(r+4,r+4+o)),r+=4+o}}catch(e){}try{if(i&&24==i.length){const n=Ype(i),r=n.getBigUint64(0,!0),o=n.getBigUint64(8,!0),a=n.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:r,rawLastAccessDate:o,rawCreationDate:a});const s=Vpe(r),c=Vpe(o),l=Vpe(a),u={lastModDate:s,lastAccessDate:c,creationDate:l};Object.assign(e,u),Object.assign(t,u)}}catch(e){}}(f,t),t.extraFieldNTFS=f);const p=o.get(21589);p&&(!function(e,t){const n=Ype(e.data),i=Hpe(n,0),r=[],o=[];1==(1&i)&&(r.push("lastModDate"),o.push("rawLastModDate"));2==(2&i)&&(r.push("lastAccessDate"),o.push("rawLastAccessDate"));4==(4&i)&&(r.push("creationDate"),o.push("rawCreationDate"));let a=1;r.forEach((i,r)=>{if(e.data.length>=a+4){const s=qpe(n,a);t[i]=e[i]=new Date(1e3*s);const c=o[r];e[c]=s}a+=4})}(p,t),t.extraFieldExtendedTimestamp=p)}async function zpe(e,t,n,i,r){const o=Ype(e.data);e.version=Hpe(o,0),e.signature=qpe(o,1);const a=new xde;a.append(r[n]);const s=Ype(new Uint8Array(4));s.setUint32(0,a.get(),!0),e[t]=await Ope(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==qpe(s,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function kpe(e,t,n){return void 0===t[n]?e.options[n]:t[n]}function Upe(e){const t=(4294901760&e)>>16,n=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(e){}}function Vpe(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Hpe(e,t){return e.getUint8(t)}function Gpe(e,t){return e.getUint16(t,!0)}function qpe(e,t){return e.getUint32(t,!0)}function Wpe(e,t){return Number(e.getBigUint64(t,!0))}function Ype(e){return new DataView(e.buffer)}function Xpe(e,t,n){return e.readUint8Array(t,n)}const Kpe="File already exists",Jpe="Zip file comment exceeds 64KB",Zpe="File entry comment exceeds 64KB",$pe="File entry name exceeds 64KB",Qpe="Version exceeds 65535",eme="The strength must equal 1, 2, or 3",tme="Extra field type exceeds 65535",nme="Extra field data exceeds 64KB",ime="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",rme=new Uint8Array([7,0,2,0,65,69,3,0,0]);let ome=0;const ame=[];class sme{constructor(e,t={}){null==e.writable.size&&(e.writable.size=0),Object.assign(this,{writer:e,options:t,config:Ode(),files:new Map,filenames:new Set,offset:e.writable.size,pendingEntriesSize:0,pendingAddFileCalls:new Set})}async add(e="",t,n={}){const i=this,{pendingAddFileCalls:r,config:o}=i;let a;ome<o.maxWorkers?ome++:await new Promise(e=>ame.push(e));try{if(e=e.trim(),i.filenames.has(e))throw new Error(Kpe);return i.filenames.add(e),a=async function(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith("/")?t+="/":i.directory=t.endsWith("/");const r=Pde(t);if(r.length>65535)throw new Error($pe);const o=i.comment||"",a=Pde(o);if(a.length>65535)throw new Error(Zpe);const s=e.options.version||i.version||0;if(s>65535)throw new Error(Qpe);const c=e.options.versionMadeBy||i.versionMadeBy||20;if(c>65535)throw new Error(Qpe);const l=ume(e,i,"lastModDate")||new Date,u=ume(e,i,"lastAccessDate"),h=ume(e,i,"creationDate"),d=ume(e,i,"password"),f=ume(e,i,"encryptionStrength")||3,p=ume(e,i,"zipCrypto");if(void 0!==d&&void 0!==f&&(f<1||f>3))throw new Error(eme);let m=new Uint8Array;const{extraField:g}=i;if(g){let e=0,t=0;g.forEach(t=>e+=4+t.length),m=new Uint8Array(e),g.forEach((e,n)=>{if(n>65535)throw new Error(tme);if(e.length>65535)throw new Error(nme);mme(m,new Uint16Array([n]),t),mme(m,new Uint16Array([e.length]),t+2),mme(m,e,t+4),t+=4+e.length})}let _=ume(e,i,"extendedTimestamp");void 0===_&&(_=!0);let y=0,b=0,v=ume(e,i,"keepOrder");void 0===v&&(v=!0);let O=0,w=ume(e,i,"msDosCompatible");void 0===w&&(w=!0);const A=ume(e,i,"internalFileAttribute")||0,E=ume(e,i,"externalFileAttribute")||0;n&&(await gpe(n),void 0===n.size?i.dataDescriptor=!0:O=n.size,y=function(e){return e+5*(Math.floor(e/16383)+1)}(O));let T=i.zip64||e.options.zip64||!1;if(e.offset+e.pendingEntriesSize>=4294967295||O>=4294967295||y>=4294967295){if(!1===i.zip64||!1===e.options.zip64||!v)throw new Error(ime);T=!0}const C=ume(e,i,"level"),x=ume(e,i,"useWebWorkers"),S=ume(e,i,"bufferedWrite");let I=ume(e,i,"dataDescriptor"),P=ume(e,i,"dataDescriptorSignature");const D=ume(e,i,"signal"),R=ume(e,i,"useCompressionStream");void 0===I&&(I=!0);I&&void 0===P&&(P=!1);const j=function(e){const{rawFilename:t,lastAccessDate:n,creationDate:i,password:r,level:o,zip64:a,zipCrypto:s,dataDescriptor:c,directory:l,rawExtraField:u,encryptionStrength:h,extendedTimestamp:d}=e;let f=e.version||20;const p=0!==o&&!l,m=Boolean(r&&r.length);let g,_,y;if(m&&!s){g=new Uint8Array(rme.length+2);const e=gme(g);dme(e,0,39169),mme(g,rme,2),hme(e,8,h)}else g=new Uint8Array;if(d){y=new Uint8Array(9+(n?4:0)+(i?4:0));const t=gme(y);dme(t,0,21589),dme(t,2,y.length-4);hme(t,4,1+(n?2:0)+(i?4:0)),fme(t,5,Math.floor(e.lastModDate.getTime()/1e3)),n&&fme(t,9,Math.floor(n.getTime()/1e3)),i&&fme(t,13,Math.floor(i.getTime()/1e3));try{_=new Uint8Array(36);const t=gme(_),r=lme(e.lastModDate);dme(t,0,10),dme(t,2,32),dme(t,8,1),dme(t,10,24),pme(t,12,r),pme(t,20,lme(n)||r),pme(t,28,lme(i)||r)}catch(e){_=new Uint8Array}}else _=y=new Uint8Array;let b=2048;c&&(b|=8);let v=0;p&&(v=8);a&&(f=f>45?f:45);m&&(b|=1,s||(f=f>51?f:51,v=99,p&&(g[9]=8)));const O=new Uint8Array(26),w=gme(O);dme(w,0,f),dme(w,2,b),dme(w,4,v);const A=new Uint32Array(1),E=gme(A);let T;T=e.lastModDate<ype?ype:e.lastModDate>_pe?_pe:e.lastModDate;dme(E,0,(T.getHours()<<6|T.getMinutes())<<5|T.getSeconds()/2),dme(E,2,(T.getFullYear()-1980<<4|T.getMonth()+1)<<5|T.getDate());const C=A[0];fme(w,6,C),dme(w,22,t.length);const x=g.length+y.length+_.length+u.length;dme(w,24,x);const S=new Uint8Array(30+t.length+x);return fme(gme(S),0,67324752),mme(S,O,4),mme(S,t,30),mme(S,g,30+t.length),mme(S,y,30+t.length+g.length),mme(S,_,30+t.length+g.length+y.length),mme(S,u,30+t.length+g.length+y.length+_.length),{localHeaderArray:S,headerArray:O,headerView:w,lastModDate:T,rawLastModDate:C,encrypted:m,compressed:p,version:f,compressionMethod:v,rawExtraFieldExtendedTimestamp:y,rawExtraFieldNTFS:_,rawExtraFieldAES:g}}(i=Object.assign({},i,{rawFilename:r,rawComment:a,version:s,versionMadeBy:c,lastModDate:l,lastAccessDate:u,creationDate:h,rawExtraField:m,zip64:T,password:d,level:C,useWebWorkers:x,encryptionStrength:f,extendedTimestamp:_,zipCrypto:p,bufferedWrite:S,keepOrder:v,dataDescriptor:I,dataDescriptorSignature:P,signal:D,msDosCompatible:w,internalFileAttribute:A,externalFileAttribute:E,useCompressionStream:R})),M=function(e){const{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e;let r,o=new Uint8Array,a=0;n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=gme(o),i&&(a=4,fme(r,0,134695760)));return{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:a}}(i);b=j.localHeaderArray.length+y+M.dataDescriptorArray.length,e.pendingEntriesSize+=b;const L=await async function(e,t,n,i,r){const{files:o,writer:a}=e,{keepOrder:s,dataDescriptor:c,zipCrypto:l,signal:u}=r,h=Array.from(o.values()).pop();let d,f,p,m,g,_={};o.set(t,_);try{let y;if(s&&(y=h&&h.lock,_.lock=new Promise(e=>p=e)),r.bufferedWrite||e.lockWriter||!c?(g=new Qfe,g.writable.size=0,d=!0,await gpe(a)):(g=a,e.lockWriter=Promise.resolve(),f=()=>delete e.lockWriter),await gpe(g),d||await y,_.writingData=!0,_=await async function(e,t,n,i,r,o){const{headerInfo:a,dataDescriptorInfo:s}=i,{localHeaderArray:c,headerArray:l,lastModDate:u,rawLastModDate:h,encrypted:d,compressed:f,version:p,compressionMethod:m,rawExtraFieldExtendedTimestamp:g,rawExtraFieldNTFS:_,rawExtraFieldAES:y}=a,{dataDescriptorArray:b}=s,{rawFilename:v,lastAccessDate:O,creationDate:w,password:A,level:E,zip64:T,zipCrypto:C,dataDescriptor:x,directory:S,versionMadeBy:I,rawComment:P,rawExtraField:D,useWebWorkers:R,onstart:j,onprogress:M,onend:L,signal:N,encryptionStrength:B,extendedTimestamp:F,msDosCompatible:z,internalFileAttribute:k,externalFileAttribute:U,useCompressionStream:V}=o,H={lock:n.lock,versionMadeBy:I,zip64:T,directory:Boolean(S),filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:P,rawExtraFieldExtendedTimestamp:g,rawExtraFieldNTFS:_,rawExtraFieldAES:y,rawExtraField:D,extendedTimestamp:F,msDosCompatible:z,internalFileAttribute:k,externalFileAttribute:U};let G,q=0,W=0;const{writable:Y}=t;if(e){e.chunkSize=wde(r),await cme(Y,c);const t=e.readable,n=t.size=e.size,i={options:{codecType:"deflate",level:E,password:A,encryptionStrength:B,zipCrypto:d&&C,passwordVerification:d&&C&&h>>8&255,signed:!0,compressed:f,encrypted:d,useWebWorkers:R,useCompressionStream:V,transferStreams:!1},config:r,streamOptions:{signal:N,size:n,onstart:j,onprogress:M,onend:L},codecConstructor:r.Deflate},o=await kfe({readable:t,writable:Y},i);Y.size+=o.size,G=o.signature,q=e.size=t.size,W=o.size}else await cme(Y,c);const X=T?new Uint8Array(28):new Uint8Array;e&&function(e,t){const{signature:n,rawExtraFieldZip64:i,compressedSize:r,uncompressedSize:o,headerInfo:a,dataDescriptorInfo:s}=e,{headerView:c,encrypted:l}=a,{dataDescriptorView:u,dataDescriptorOffset:h}=s,{zip64:d,zipCrypto:f,dataDescriptor:p}=t;l&&!f||void 0===n||(fme(c,10,n),p&&fme(u,h,n));if(d){const e=gme(i);dme(e,0,1),dme(e,2,24),fme(c,14,4294967295),pme(e,12,BigInt(r)),fme(c,18,4294967295),pme(e,4,BigInt(o)),p&&(pme(u,h+4,BigInt(r)),pme(u,h+12,BigInt(o)))}else fme(c,14,r),fme(c,18,o),p&&(fme(u,h+4,r),fme(u,h+8,o))}({signature:G,rawExtraFieldZip64:X,compressedSize:W,uncompressedSize:q,headerInfo:a,dataDescriptorInfo:s},o);x&&await cme(Y,b);return Object.assign(H,{compressedSize:W,lastModDate:u,rawLastModDate:h,creationDate:w,lastAccessDate:O,encrypted:d,length:c.length+W+b.length,compressionMethod:m,version:p,headerArray:l,signature:G,rawExtraFieldZip64:X}),H}(n,g,_,i,e.config,r),o.set(t,_),_.filename=t,d){await g.writable.close();let t=await g.getData();await y,await async function t(){const{lockWriter:n}=e;if(n)return await n.then(()=>delete e.lockWriter),t();e.lockWriter=new Promise(e=>f=e)}(),m=!0;const{writable:n}=a;if(!c){const e=await function(e,t,n){return t||n?e.slice(t,n).arrayBuffer():e.arrayBuffer()}(t,0,26),i=new DataView(e);_.encrypted&&!l||fme(i,14,_.signature),_.zip64?(fme(i,18,4294967295),fme(i,22,4294967295)):(fme(i,18,_.compressedSize),fme(i,22,_.uncompressedSize)),await cme(n,new Uint8Array(e)),t=t.slice(e.byteLength)}await t.stream().pipeTo(n,{preventClose:!0,signal:u}),m=!1}if(_.offset=e.offset,_.zip64){pme(gme(_.rawExtraFieldZip64),20,BigInt(_.offset))}else if(_.offset>=4294967295)throw new Error(ime);return e.offset+=_.length,_}catch(n){throw(d&&m||!d&&_.writingData)&&(e.hasCorruptedEntries=!0,n&&(n.corruptedEntry=!0),d?e.offset+=g.writable.size:e.offset=g.writable.size),o.delete(t),n}finally{p&&p(),f&&f()}}(e,t,n,{headerInfo:j,dataDescriptorInfo:M},i);b&&(e.pendingEntriesSize-=b);return Object.assign(L,{name:t,comment:o,extraField:g}),new Ape(L)}(i,e,t,n),r.add(a),await a}catch(t){throw i.filenames.delete(e),t}finally{r.delete(a);const e=ame.shift();e?e():ome--}}async close(e=new Uint8Array,t={}){const{pendingAddFileCalls:n,writer:i}=this,{writable:r}=i;for(;n.size;)await Promise.all(Array.from(n));return await async function(e,t,n){const{files:i}=e;let r=0,o=0,a=e.offset,s=i.size;for(const[,e]of i)o+=46+e.rawFilename.length+e.rawComment.length+e.rawExtraFieldZip64.length+e.rawExtraFieldAES.length+e.rawExtraFieldExtendedTimestamp.length+e.rawExtraFieldNTFS.length+e.rawExtraField.length;let c=n.zip64||e.options.zip64||!1;if(a>=4294967295||o>=4294967295||s>=65535){if(!1===n.zip64||!1===e.options.zip64)throw new Error(ime);c=!0}const l=new Uint8Array(o+(c?98:22)),u=gme(l);for(const[e,t]of Array.from(i.values()).entries()){const{rawFilename:o,rawExtraFieldZip64:a,rawExtraFieldAES:s,rawExtraField:c,rawComment:h,versionMadeBy:d,headerArray:f,directory:p,zip64:m,msDosCompatible:g,internalFileAttribute:_,externalFileAttribute:y}=t;let b,v;if(t.extendedTimestamp){v=t.rawExtraFieldNTFS,b=new Uint8Array(9);const e=gme(b);dme(e,0,21589),dme(e,2,b.length-4),hme(e,4,1),fme(e,5,Math.floor(t.lastModDate.getTime()/1e3))}else v=b=new Uint8Array;const O=a.length+s.length+b.length+v.length+c.length;if(fme(u,r,33639248),dme(u,r+4,d),mme(l,f,r+6),dme(u,r+30,O),dme(u,r+32,h.length),dme(u,r+36,_),y?fme(u,r+38,y):p&&g&&hme(u,r+38,16),fme(u,r+42,m?4294967295:t.offset),mme(l,o,r+46),mme(l,a,r+46+o.length),mme(l,s,r+46+o.length+a.length),mme(l,b,r+46+o.length+a.length+s.length),mme(l,v,r+46+o.length+a.length+s.length+b.length),mme(l,c,r+46+o.length+a.length+s.length+b.length+v.length),mme(l,h,r+46+o.length+O),r+=46+o.length+O+h.length,n.onprogress)try{await n.onprogress(e+1,i.size,new Ape(t))}catch(e){}}c&&(fme(u,r,101075792),pme(u,r+4,BigInt(44)),dme(u,r+12,45),dme(u,r+14,45),pme(u,r+24,BigInt(s)),pme(u,r+32,BigInt(s)),pme(u,r+40,BigInt(o)),pme(u,r+48,BigInt(a)),fme(u,r+56,117853008),pme(u,r+64,BigInt(a)+BigInt(o)),fme(u,r+72,1),s=65535,a=4294967295,o=4294967295,r+=76);if(fme(u,r,101010256),dme(u,r+8,s),dme(u,r+10,s),fme(u,r+12,o),fme(u,r+16,a),t&&t.length){if(!(t.length<=65535))throw new Error(Jpe);dme(u,r+20,t.length)}const{writable:h}=e.writer;await gpe(e.writer),await cme(h,l),t&&t.length&&await cme(h,t)}(this,e,t),i.preventClose||t.preventClose||await r.close(),i.getData?i.getData():r}}async function cme(e,t){const n=e.getWriter();await n.ready,e.size+=t.length,await n.write(t),n.releaseLock()}function lme(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ume(e,t,n){return void 0===t[n]?e.options[n]:t[n]}function hme(e,t,n){e.setUint8(t,n)}function dme(e,t,n){e.setUint16(t,n,!0)}function fme(e,t,n){e.setUint32(t,n,!0)}function pme(e,t,n){e.setBigUint64(t,n,!0)}function mme(e,t,n){e.set(t,n)}function gme(e){return new DataView(e.buffer)}Ade({Deflate:_de,Inflate:yde});const _me="http://www.google.com/kml/ext/2.2";function yme(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}const bme=/^data:image\/([^,;]+)/;function vme(e,t){return function(n){e._files[t]=n}}function Ome(e){this._time=e}function wme(){this._ids={},this._styles={},this._count=0}function Ame(){this._ids={}}function Eme(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).entities,n=Object(c.a)(e.kmz,!1);if(!Object(l.a)(t))throw new u.a("entities is required.");const r=Eme._createState(e),o=t.values.filter((function(e){return!Object(l.a)(e.parent)})),a=r.kmlDoc,s=a.documentElement;s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:gx",_me);const h=a.createElement("Document");s.appendChild(h),function e(t,n,i){const r=t.kmlDoc,o=t.styleCache,a=t.valueGetter,s=t.idManager,c=i.length;let u,h,d;for(let f=0;f<c;++f){const c=i[f];let p;u=[],h=[],d=[],Sme(t,c,h,d),Rme(t,c.polyline,h,d),Mme(t,c.rectangle,h,d,u),Mme(t,c.polygon,h,d,u),Nme(t,c,c.model,h,d);const m=c.availability;Object(l.a)(m)&&(p=r.createElement("TimeSpan"),tr.equals(m.start,JA.MINIMUM_VALUE)||p.appendChild(kme(r,"begin",tr.toIso8601(m.start))),tr.equals(m.stop,JA.MAXIMUM_VALUE)||p.appendChild(kme(r,"end",tr.toIso8601(m.stop))));for(let e=0;e<u.length;++e){const t=u[e];t.setAttribute("id",s.get(c.id)),t.appendChild(kme(r,"name",c.name)),t.appendChild(kme(r,"visibility",c.show)),t.appendChild(kme(r,"description",c.description)),Object(l.a)(p)&&t.appendChild(p),n.appendChild(t)}const g=h.length;if(g>0){const e=r.createElement("Placemark");e.setAttribute("id",s.get(c.id));let t=c.name;const i=c.label;if(Object(l.a)(i)){const e=r.createElement("LabelStyle"),n=a.get(i.text);t=Object(l.a)(n)&&n.length>0?n:t;const o=a.getColor(i.fillColor);Object(l.a)(o)&&(e.appendChild(kme(r,"color",o)),e.appendChild(kme(r,"colorMode","normal")));const s=a.get(i.scale);Object(l.a)(s)&&e.appendChild(kme(r,"scale",s)),d.push(e)}e.appendChild(kme(r,"name",t)),e.appendChild(kme(r,"visibility",c.show)),e.appendChild(kme(r,"description",c.description)),Object(l.a)(p)&&e.appendChild(p),n.appendChild(e);const u=d.length;if(u>0){const t=r.createElement("Style");for(let e=0;e<u;++e)t.appendChild(d[e]);e.appendChild(kme(r,"styleUrl",o.get(t)))}if(1===h.length)e.appendChild(h[0]);else if(h.length>1){const t=r.createElement("MultiGeometry");for(let e=0;e<g;++e)t.appendChild(h[e]);e.appendChild(t)}}const _=c._children;if(_.length>0){const i=r.createElement("Folder");i.setAttribute("id",s.get(c.id)),i.appendChild(kme(r,"name",c.name)),i.appendChild(kme(r,"visibility",c.show)),i.appendChild(kme(r,"description",c.description)),n.appendChild(i),e(t,i,_)}}}(r,h,o),r.styleCache.save(h);const d=r.externalFileHandler;return d.promise.then((function(){const e=(new XMLSerializer).serializeToString(r.kmlDoc);return n?function(e,t){const n=Lt("ThirdParty/Workers/z-worker-pako.js");i.configure({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});const r=new i.BlobWriter,o=new i.ZipWriter(r);return o.add("doc.kml",new i.TextReader(e)).then((function(){const e=Object.keys(t);return function e(t,n,r,o){if(n.length===o)return;const a=n[o];return t.add(a,new i.BlobReader(r[a])).then((function(){return e(t,n,r,o+1)}))}(o,e,t,0)})).then((function(){return o.close()})).then((function(e){return{kmz:e}}))}(e,d.files):{kml:e,externalFiles:d.files}}))}yme.prototype.texture=function(e){const t=this;let n;if("string"==typeof e||e instanceof Tt.a){if(!(e=Tt.a.createIfNeeded(e)).isDataUri)return e.url;const i=e.url.match(bme);n="texture_"+ ++this._count,Object(l.a)(i)&&(n+="."+i[1]);const r=e.fetchBlob().then((function(e){t._files[n]=e}));return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;const i=new Promise(i=>{e.toBlob((function(e){t._files[n]=e,i()}))});return this._promises.push(i),n}return""},yme.prototype.model=function(e,t){const n=this._modelCallback;if(!Object(l.a)(n))throw new ye.a("Encountered a model entity while exporting to KML, but no model callback was supplied.");const i={},r=n(e,t,i);for(const e in i)if(i.hasOwnProperty(e)){const t=Promise.resolve(i[e]);this._promises.push(t),t.then(vme(this,e))}return r},Object.defineProperties(yme.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}}),Ome.prototype.get=function(e,t,n){let i;return Object(l.a)(e)&&(i=Object(l.a)(e.getValue)?e.getValue(this._time,n):e),Object(c.a)(i,t)},Ome.prototype.getColor=function(e,t){const n=this.get(e,t);if(Object(l.a)(n))return Ume(n)},Ome.prototype.getMaterialType=function(e){if(Object(l.a)(e))return e.getType(this._time)},wme.prototype.get=function(e){const t=this._ids,n=e.innerHTML;if(Object(l.a)(t[n]))return t[n];let i="style-"+ ++this._count;return e.setAttribute("id",i),i="#"+i,t[n]=i,this._styles[n]=e,i},wme.prototype.save=function(e){const t=this._styles,n=e.childNodes[0];for(const i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)},Ame.prototype.get=function(e){if(!Object(l.a)(e))return this.get(fy());const t=this._ids;return Object(l.a)(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)},Eme._createState=function(e){const t=e.entities,n=new wme,i=t.computeAvailability(),r=Object(l.a)(e.time)?e.time:i.start;let o=Object(c.a)(e.defaultAvailability,i);const a=Object(c.a)(e.sampleDuration,60);o.start===JA.MINIMUM_VALUE?o.stop===JA.MAXIMUM_VALUE?o=new YA:tr.addSeconds(o.stop,-10*a,o.start):o.stop===JA.MAXIMUM_VALUE&&tr.addSeconds(o.start,10*a,o.stop);const s=new yme(e.modelCallback);return{kmlDoc:document.implementation.createDocument("http://www.opengis.net/kml/2.2","kml"),ellipsoid:Object(c.a)(e.ellipsoid,H.WGS84),idManager:new Ame,styleCache:n,externalFileHandler:s,time:r,valueGetter:new Ome(r),sampleDuration:a,defaultAvailability:new YI([o])}};const Tme=new O,Cme=new R,xme=new tr;function Sme(e,t,n,i){const r=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter,s=Object(c.a)(t.billboard,t.point);if(!Object(l.a)(s)&&!Object(l.a)(t.path))return;const u=t.position;if(!u.isConstant)return void Ime(e,t,s,n,i);a.get(u,void 0,Tme);const h=kme(r,"coordinates",zme(Tme,o)),d=r.createElement("Point"),f=r.createElement("altitudeMode");f.appendChild(Fme(e,s.heightReference)),d.appendChild(f),d.appendChild(h),n.push(d);const p=s instanceof GP?Dme(e,s):Pme(e,s);i.push(p)}function Ime(e,t,n,i,r){const o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;let u;const h=t.position;let d=!0;h instanceof Ore?(u=h.intervals,d=!1):u=Object(c.a)(t.availability,e.defaultAvailability);const f=n instanceof bk;let p,m,g;const _=[];for(p=0;p<u.length;++p){const t=u.get(p);let i=d?h:t.data;const r=o.createElement("altitudeMode");i instanceof the?(i=i._value,r.appendChild(Fme(e,qP.CLAMP_TO_GROUND))):Object(l.a)(n)?r.appendChild(Fme(e,n.heightReference)):r.appendChild(Fme(e,qP.NONE));const c=[],y=[];if(i.isConstant){s.get(i,void 0,Tme);const e=kme(o,"coordinates",zme(Tme,a));c.push(tr.toIso8601(t.start)),y.push(e),c.push(tr.toIso8601(t.stop)),y.push(e)}else if(i instanceof Vae)for(g=i._property._times,m=0;m<g.length;++m)c.push(tr.toIso8601(g[m])),i.getValueInReferenceFrame(g[m],Hx.FIXED,Tme),y.push(zme(Tme,a));else if(i instanceof kae){g=i._times;const e=i._values;for(m=0;m<g.length;++m)c.push(tr.toIso8601(g[m])),O.fromArray(e,3*m,Tme),y.push(zme(Tme,a))}else{const n=e.sampleDuration;t.start.clone(xme),t.isStartIncluded||tr.addSeconds(xme,n,xme);const r=t.stop;for(;tr.lessThan(xme,r);)i.getValue(xme,Tme),c.push(tr.toIso8601(xme)),y.push(zme(Tme,a)),tr.addSeconds(xme,n,xme);t.isStopIncluded&&tr.equals(xme,r)&&(i.getValue(xme,Tme),c.push(tr.toIso8601(xme)),y.push(zme(Tme,a)))}const b=o.createElementNS(_me,"Track");b.appendChild(r);for(let e=0;e<c.length;++e){const t=kme(o,"when",c[e]),n=kme(o,"coord",y[e],_me);b.appendChild(t),b.appendChild(n)}f&&b.appendChild(Lme(e,n)),_.push(b)}if(1===_.length)i.push(_[0]);else if(_.length>1){const e=o.createElementNS(_me,"MultiTrack");for(p=0;p<_.length;++p)e.appendChild(_[p]);i.push(e)}if(Object(l.a)(n)&&!f){const t=n instanceof GP?Dme(e,n):Pme(e,n);r.push(t)}const y=t.path;if(Object(l.a)(y)){const t=s.get(y.width),n=y.material;if(Object(l.a)(n)||Object(l.a)(t)){const i=o.createElement("LineStyle");Object(l.a)(t)&&i.appendChild(kme(o,"width",t)),Bme(e,n,i),r.push(i)}}}function Pme(e,t){const n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);Object(l.a)(o)&&(r.appendChild(kme(n,"color",o)),r.appendChild(kme(n,"colorMode","normal")));const a=i.get(t.pixelSize);return Object(l.a)(a)&&r.appendChild(kme(n,"scale",a/32)),r}function Dme(e,t){const n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle");let a=i.get(t.image);if(Object(l.a)(a)){a=r.texture(a);const e=n.createElement("Icon");e.appendChild(kme(n,"href",a));const s=i.get(t.imageSubRegion);Object(l.a)(s)&&(e.appendChild(kme(n,"x",s.x,_me)),e.appendChild(kme(n,"y",s.y,_me)),e.appendChild(kme(n,"w",s.width,_me)),e.appendChild(kme(n,"h",s.height,_me))),o.appendChild(e)}const s=i.getColor(t.color);Object(l.a)(s)&&(o.appendChild(kme(n,"color",s)),o.appendChild(kme(n,"colorMode","normal")));let u=i.get(t.scale);Object(l.a)(u)&&o.appendChild(kme(n,"scale",u));const d=i.get(t.pixelOffset);if(Object(l.a)(d)){u=Object(c.a)(u,1),Vt.divideByScalar(d,u,d);const e=i.get(t.width,32),r=i.get(t.height,32),a=i.get(t.horizontalOrigin,WP.CENTER);a===WP.CENTER?d.x-=.5*e:a===WP.RIGHT&&(d.x-=e);const s=i.get(t.verticalOrigin,YP.CENTER);s===YP.TOP?d.y+=r:s===YP.CENTER&&(d.y+=.5*r);const l=n.createElement("hotSpot");l.setAttribute("x",-d.x),l.setAttribute("y",d.y),l.setAttribute("xunits","pixels"),l.setAttribute("yunits","pixels"),o.appendChild(l)}let f=i.get(t.rotation);const p=i.get(t.alignedAxis);return Object(l.a)(f)&&O.equals(O.UNIT_Z,p)&&(f=h.a.toDegrees(-f),0===f&&(f=360),o.appendChild(kme(n,"heading",f))),o}function Rme(e,t,n,i){const r=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter;if(!Object(l.a)(t))return;const s=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=a.get(t.clampToGround,!1);let h;u?(s.appendChild(kme(r,"tessellate",!0)),h=r.createTextNode("clampToGround")):h=r.createTextNode("absolute"),c.appendChild(h),s.appendChild(c);const d=t.positions,f=kme(r,"coordinates",zme(a.get(d),o));s.appendChild(f);const p=a.get(t.zIndex);u&&Object(l.a)(p)&&s.appendChild(kme(r,"drawOrder",p,_me)),n.push(s);const m=r.createElement("LineStyle"),g=a.get(t.width);Object(l.a)(g)&&m.appendChild(kme(r,"width",g)),Bme(e,t.material,m),i.push(m)}function jme(e,t,n,i){const r=e.kmlDoc,o=e.ellipsoid,a=[],s=t.length;for(let e=0;e<s;++e)R.fromCartesian(t[e],o,Cme),a.push(`${h.a.toDegrees(Cme.longitude)},${h.a.toDegrees(Cme.latitude)},${i?Cme.height:n}`);const c=kme(r,"coordinates",a.join(" ")),l=r.createElement("LinearRing");return l.appendChild(c),l}function Mme(e,t,n,i,r){const o=e.kmlDoc,a=e.valueGetter;if(!Object(l.a)(t))return;const s=t instanceof Lk;if(s&&"Image"===a.getMaterialType(t.material))return void function(e,t,n){const i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,a=i.createElement("GroundOverlay"),s=i.createElement("altitudeMode");s.appendChild(Fme(e,t.heightReference)),a.appendChild(s);const c=r.get(t.height);Object(l.a)(c)&&a.appendChild(kme(i,"altitude",c));const u=r.get(t.coordinates),d=i.createElement("LatLonBox");d.appendChild(kme(i,"north",h.a.toDegrees(u.north))),d.appendChild(kme(i,"south",h.a.toDegrees(u.south))),d.appendChild(kme(i,"east",h.a.toDegrees(u.east))),d.appendChild(kme(i,"west",h.a.toDegrees(u.west))),a.appendChild(d);const f=r.get(t.material),p=o.texture(f.image),m=i.createElement("Icon");m.appendChild(kme(i,"href",p)),a.appendChild(m);const g=f.color;Object(l.a)(g)&&a.appendChild(kme(i,"color",Ume(f.color)));n.push(a)}(e,t,r);const c=o.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&c.appendChild(kme(o,"extrude",!0));const d=s?function(e,t,n){const i=e.kmlDoc,r=e.valueGetter;let o=r.get(t.height,0);n>0&&(o=n);const a=t.coordinates,s=r.get(a),c=[],l=[Be.northeast,Be.southeast,Be.southwest,Be.northwest];for(let e=0;e<4;++e)l[e](s,Cme),c.push(`${h.a.toDegrees(Cme.longitude)},${h.a.toDegrees(Cme.latitude)},${o}`);const u=kme(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),f=i.createElement("LinearRing");return f.appendChild(u),d.appendChild(f),[d]}(e,t,u):function(e,t,n){const i=e.kmlDoc,r=e.valueGetter;let o=r.get(t.height,0);const a=r.get(t.perPositionHeight,!1);!a&&n>0&&(o=n);const s=[],c=t.hierarchy,u=r.get(c),h=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(jme(e,h,o,a)),s.push(d);const f=u.holes;if(Object(l.a)(f)){const t=f.length;for(let n=0;n<t;++n){const t=i.createElement("innerBoundaryIs");t.appendChild(jme(e,f[n].positions,o,a)),s.push(t)}}return s}(e,t,u),f=d.length;for(let e=0;e<f;++e)c.appendChild(d[e]);const p=o.createElement("altitudeMode");p.appendChild(Fme(e,t.heightReference)),c.appendChild(p),n.push(c);const m=o.createElement("PolyStyle"),g=a.get(t.fill,!1);g&&m.appendChild(kme(o,"fill",g)),Bme(e,t.material,m);const _=a.get(t.outline,!1);if(_){m.appendChild(kme(o,"outline",_));const e=o.createElement("LineStyle"),n=a.get(t.outlineWidth,1);e.appendChild(kme(o,"width",n));const r=a.getColor(t.outlineColor,sp.BLACK);e.appendChild(kme(o,"color",r)),e.appendChild(kme(o,"colorMode","normal")),i.push(e)}i.push(m)}function Lme(e,t){const n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),a=i.get(t.scale);if(Object(l.a)(a)){const e=n.createElement("scale");e.appendChild(kme(n,"x",a)),e.appendChild(kme(n,"y",a)),e.appendChild(kme(n,"z",a)),o.appendChild(e)}const s=n.createElement("Link"),c=r.model(t,e.time);return s.appendChild(kme(n,"href",c)),o.appendChild(s),o}function Nme(e,t,n,i,r){const o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(!Object(l.a)(n))return;const c=t.position;if(!c.isConstant)return void Ime(e,t,n,i,r);const u=Lme(e,n),d=o.createElement("altitudeMode");d.appendChild(Fme(e,n.heightReference)),u.appendChild(d),s.get(c,void 0,Tme),R.fromCartesian(Tme,a,Cme);const f=o.createElement("Location");f.appendChild(kme(o,"longitude",h.a.toDegrees(Cme.longitude))),f.appendChild(kme(o,"latitude",h.a.toDegrees(Cme.latitude))),f.appendChild(kme(o,"altitude",Cme.height)),u.appendChild(f),i.push(u)}function Bme(e,t,n){const i=e.kmlDoc,r=e.valueGetter;if(!Object(l.a)(t))return;const o=r.get(t);if(!Object(l.a)(o))return;let a;let s,c;switch(r.getMaterialType(t)){case"Image":a=Ume(sp.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=Ume(o.color);break;case"PolylineOutline":a=Ume(o.color),s=Ume(o.outlineColor),c=o.outlineWidth,n.appendChild(kme(i,"outerColor",s,_me)),n.appendChild(kme(i,"outerWidth",c,_me));break;case"Stripe":a=Ume(o.oddColor)}Object(l.a)(a)&&(n.appendChild(kme(i,"color",a)),n.appendChild(kme(i,"colorMode","normal")))}function Fme(e,t){const n=e.kmlDoc;let i;switch(e.valueGetter.get(t,qP.NONE)){case qP.NONE:i=n.createTextNode("absolute");break;case qP.CLAMP_TO_GROUND:i=n.createTextNode("clampToGround");break;case qP.RELATIVE_TO_GROUND:i=n.createTextNode("relativeToGround")}return i}function zme(e,t){Array.isArray(e)||(e=[e]);const n=e.length,i=[];for(let r=0;r<n;++r)R.fromCartesian(e[r],t,Cme),i.push(`${h.a.toDegrees(Cme.longitude)},${h.a.toDegrees(Cme.latitude)},${Cme.height}`);return i.join(" ")}function kme(e,t,n,i){"boolean"==typeof(n=Object(c.a)(n,""))&&(n=n?"1":"0");const r=Object(l.a)(i)?e.createElementNS(i,t):e.createElement(t),o="string"===n&&-1!==n.indexOf("<")?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function Ume(e){let t="";const n=e.toBytes();for(let e=3;e>=0;--e)t+=n[e]<16?"0"+n[e].toString(16):n[e].toString(16);return t}var Vme=Eme,Hme=function(e){return e},Gme=function(e){if(null==e)return Hme;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var c=2,l=e.length,u=new Array(l);for(u[0]=(t+=e[0])*i+o,u[1]=(n+=e[1])*r+a;c<l;)u[c]=e[c],++c;return u}},qme=function(e){var t,n=Gme(e.transform),i=1/0,r=i,o=-i,a=-i;function s(e){(e=n(e))[0]<i&&(i=e[0]),e[0]>o&&(o=e[0]),e[1]<r&&(r=e[1]),e[1]>a&&(a=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":s(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(s)}}for(t in e.arcs.forEach((function(e){for(var t,s=-1,c=e.length;++s<c;)(t=n(e[s],s))[0]<i&&(i=t[0]),t[0]>o&&(o=t[0]),t[1]<r&&(r=t[1]),t[1]>a&&(a=t[1])})),e.objects)c(e.objects[t]);return[i,r,o,a]},Wme=function(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return Yme(e,t)}))}:Yme(e,t)};function Yme(e,t){var n=t.id,i=t.bbox,r=null==t.properties?{}:t.properties,o=Xme(e,t);return null==n&&null==i?{type:"Feature",properties:r,geometry:o}:null==i?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function Xme(e,t){var n=Gme(e.transform),i=e.arcs;function r(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],o=0,a=r.length;o<a;++o)t.push(n(r[o],o));e<0&&function(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}(t,a)}function o(e){return n(e)}function a(e){for(var t=[],n=0,i=e.length;n<i;++n)r(e[n],t);return t.length<2&&t.push(t[0]),t}function s(e){for(var t=a(e);t.length<4;)t.push(t[0]);return t}function c(e){return e.map(s)}return function e(t){var n,i=t.type;switch(i){case"GeometryCollection":return{type:i,geometries:t.geometries.map(e)};case"Point":n=o(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(o);break;case"LineString":n=a(t.arcs);break;case"MultiLineString":n=t.arcs.map(a);break;case"Polygon":n=c(t.arcs);break;case"MultiPolygon":n=t.arcs.map(c);break;default:return null}return{type:i,coordinates:n}}(t)}var Kme=function(e,t){var n={},i={},r={},o=[],a=-1;function s(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach((function(e){n[e<0?~e:e]=1})),o.push(r)}}return t.forEach((function(n,i){var r,o=e.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=t[++a],t[a]=n,t[i]=r)})),t.forEach((function(t){var n,o,a=function(t){var n,i=e.arcs[t<0?~t:t],r=i[0];e.transform?(n=[0,0],i.forEach((function(e){n[0]+=e[0],n[1]+=e[1]}))):n=i[i.length-1];return t<0?[n,r]:[r,n]}(t),s=a[0],c=a[1];if(n=r[s])if(delete r[n.end],n.push(t),n.end=c,o=i[c]){delete i[o.start];var l=o===n?n:n.concat(o);i[l.start=n.start]=r[l.end=o.end]=l}else i[n.start]=r[n.end]=n;else if(n=i[c])if(delete i[n.start],n.unshift(t),n.start=s,o=r[s]){delete r[o.end];var u=o===n?n:o.concat(n);i[u.start=o.start]=r[u.end=n.end]=u}else i[n.start]=r[n.end]=n;else i[(n=[t]).start=s]=r[n.end=c]=n})),s(r,i),s(i,r),t.forEach((function(e){n[e<0?~e:e]||o.push([e])})),o},Jme=function(e){return Xme(e,Zme.apply(this,arguments))};function Zme(e,t,n){var i,r,o;if(arguments.length>1)i=$me(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:Kme(e,i)}}function $me(e,t,n){var i,r=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:i})}function s(e){e.forEach(a)}function c(e){e.forEach(s)}return function e(t){switch(i=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":c(t.arcs);break;case"MultiPolygon":!function(e){e.forEach(c)}(t.arcs)}}(t),o.forEach(null==n?function(e){r.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&r.push(e[0].i)}),r}var Qme=function(e){return Xme(e,ege.apply(this,arguments))};function ege(e,t){var n={},i=[],r=[];function o(e){e.forEach((function(t){t.forEach((function(t){(n[t=t<0?~t:t]||(n[t]=[])).push(e)}))})),i.push(e)}function a(t){return function(e){for(var t,n=-1,i=e.length,r=e[i-1],o=0;++n<i;)t=r,r=e[n],o+=t[0]*r[1]-t[1]*r[0];return Math.abs(o)}(Xme(e,{type:"Polygon",arcs:[t]}).coordinates[0])}return t.forEach((function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":o(t.arcs);break;case"MultiPolygon":t.arcs.forEach(o)}})),i.forEach((function(e){if(!e._){var t=[],i=[e];for(e._=1,r.push(t);e=i.pop();)t.push(e),e.forEach((function(e){e.forEach((function(e){n[e<0?~e:e].forEach((function(e){e._||(e._=1,i.push(e))}))}))}))}})),i.forEach((function(e){delete e._})),{type:"MultiPolygon",arcs:r.map((function(t){var i,r=[];if(t.forEach((function(e){e.forEach((function(e){e.forEach((function(e){n[e<0?~e:e].length<2&&r.push(e)}))}))})),(i=(r=Kme(e,r)).length)>1)for(var o,s,c=1,l=a(r[0]);c<i;++c)(o=a(r[c]))>l&&(s=r[0],r[0]=r[c],r[c]=s,l=o);return r})).filter((function(e){return e.length>0}))}}var tge=function(e,t){for(var n=0,i=e.length;n<i;){var r=n+i>>>1;e[r]<t?n=r+1:i=r}return n},nge=function(e){var t={},n=e.map((function(){return[]}));function i(e,n){e.forEach((function(e){e<0&&(e=~e);var i=t[e];i?i.push(n):t[e]=[n]}))}function r(e,t){e.forEach((function(e){i(e,t)}))}var o={LineString:i,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach((function(e){r(e,t)}))}};for(var a in e.forEach((function e(t,n){"GeometryCollection"===t.type?t.geometries.forEach((function(t){e(t,n)})):t.type in o&&o[t.type](t.arcs,n)})),t)for(var s=t[a],c=s.length,l=0;l<c;++l)for(var u=l+1;u<c;++u){var h,d=s[l],f=s[u];(h=n[d])[a=tge(h,f)]!==f&&h.splice(a,0,f),(h=n[f])[a=tge(h,d)]!==d&&h.splice(a,0,d)}return n},ige=function(e){if(null==e)return Hme;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var c=2,l=e.length,u=new Array(l),h=Math.round((e[0]-o)/i),d=Math.round((e[1]-a)/r);for(u[0]=h-t,t=h,u[1]=d-n,n=d;c<l;)u[c]=e[c],++c;return u}},rge=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)s=e.bbox;else{if(!((n=Math.floor(t))>=2))throw new Error("n must be ≥2");var n,i=(s=e.bbox||qme(e))[0],r=s[1],o=s[2],a=s[3];t={scale:[o-i?(o-i)/(n-1):1,a-r?(a-r)/(n-1):1],translate:[i,r]}}var s,c,l=ige(t),u=e.objects,h={};function d(e){return l(e)}function f(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(f)};break;case"Point":t={type:"Point",coordinates:d(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(d)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in u)h[c]=f(u[c]);return{type:"Topology",bbox:s,transform:t,objects:h,arcs:e.arcs.map((function(e){var t,n=0,i=1,r=e.length,o=new Array(r);for(o[0]=l(e[0],0);++n<r;)((t=l(e[n],n))[0]||t[1])&&(o[i++]=t);return 1===i&&(o[i++]=[0,0]),o.length=i,o}))}};function oge(e){return O.fromDegrees(e[0],e[1],e[2])}const age={"urn:ogc:def:crs:OGC:1.3:CRS84":oge,"EPSG:4326":oge,"urn:ogc:def:crs:EPSG::4326":oge},sge={},cge={};let lge,uge=48,hge=sp.ROYALBLUE,dge=sp.YELLOW,fge=2,pge=sp.fromBytes(255,255,0,100),mge=!1;const gge={small:24,medium:48,large:64},_ge=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function yge(e,t){let n="";for(const i in e)if(e.hasOwnProperty(i)){if(i===t||-1!==_ge.indexOf(i))continue;const r=e[i];Object(l.a)(r)&&(n+="object"==typeof r?`<tr><th>${i}</th><td>${yge(r)}</td></tr>`:`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function bge(e,t){return new oU(function(e,t,n){let i;return function(r,o){return Object(l.a)(i)||(i=e(t,n)),i}}(yge,e,t),!0)}function vge(e,t,n){let i=e.id;if(Object(l.a)(i)&&"Feature"===e.type){let e=2,n=i;for(;Object(l.a)(t.getById(n));)n=`${i}_${e}`,e++;i=n}else i=fy();const r=t.getOrCreateEntity(i),o=e.properties;if(Object(l.a)(o)){let e;r.properties=o;const t=o.title;if(Object(l.a)(t))r.name=t,e="title";else{let t=Number.MAX_VALUE;for(const n in o)if(o.hasOwnProperty(n)&&o[n]){const i=n.toLowerCase();if(t>1&&"title"===i){t=1,e=n;break}t>2&&"name"===i?(t=2,e=n):t>3&&/title/i.test(n)?(t=3,e=n):t>4&&/name/i.test(n)&&(t=4,e=n)}Object(l.a)(e)&&(r.name=o[e])}const i=o.description;null!==i&&(r.description=Object(l.a)(i)?new kP(i):n(o,e))}return r}function Oge(e,t){const n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}const wge={Feature:Ege,FeatureCollection:function(e,t,n,i,r){const o=t.features;for(let t=0,n=o.length;t<n;t++)Ege(e,o[t],void 0,i,r)},GeometryCollection:Tge,LineString:Pge,MultiLineString:Dge,MultiPoint:Sge,MultiPolygon:Mge,Point:xge,Polygon:jge,Topology:Lge},Age={GeometryCollection:Tge,LineString:Pge,MultiLineString:Dge,MultiPoint:Sge,MultiPolygon:Mge,Point:xge,Polygon:jge,Topology:Lge};function Ege(e,t,n,i,r){if(null===t.geometry)return void vge(t,e._entityCollection,r.describe);if(!Object(l.a)(t.geometry))throw new ye.a("feature.geometry is required.");const o=t.geometry.type,a=Age[o];if(!Object(l.a)(a))throw new ye.a("Unknown geometry type: "+o);a(e,t,t.geometry,i,r)}function Tge(e,t,n,i,r){const o=n.geometries;for(let n=0,a=o.length;n<a;n++){const a=o[n],s=a.type,c=Age[s];if(!Object(l.a)(c))throw new ye.a("Unknown geometry type: "+s);c(e,t,a,i,r)}}function Cge(e,t,n,i,r){let o=r.markerSymbol,a=r.markerColor,s=r.markerSize;const u=t.properties;if(Object(l.a)(u)){const e=u["marker-color"];Object(l.a)(e)&&(a=sp.fromCssColorString(e)),s=Object(c.a)(gge[u["marker-size"]],s);const t=u["marker-symbol"];Object(l.a)(t)&&(o=t)}let h;h=Object(l.a)(o)?1===o.length?e._pinBuilder.fromText(o.toUpperCase(),a,s):e._pinBuilder.fromMakiIconId(o,a,s):e._pinBuilder.fromColor(a,s);const d=new GP;d.verticalOrigin=new kP(YP.BOTTOM),2===i.length&&r.clampToGround&&(d.heightReference=qP.CLAMP_TO_GROUND);const f=vge(t,e._entityCollection,r.describe);f.billboard=d,f.position=new $z(n(i));const p=Promise.resolve(h).then((function(e){d.image=new kP(e)})).catch((function(){d.image=new kP(e._pinBuilder.fromColor(a,s))}));e._promises.push(p)}function xge(e,t,n,i,r){Cge(e,t,i,n.coordinates,r)}function Sge(e,t,n,i,r){const o=n.coordinates;for(let n=0;n<o.length;n++)Cge(e,t,i,o[n],r)}function Ige(e,t,n,i,r){let o=r.strokeMaterialProperty,a=r.strokeWidthProperty;const s=t.properties;if(Object(l.a)(s)){const e=s["stroke-width"];let t;Object(l.a)(e)&&(a=new kP(e));const n=s.stroke;Object(l.a)(n)&&(t=sp.fromCssColorString(n));const i=s["stroke-opacity"];Object(l.a)(i)&&1!==i&&(Object(l.a)(t)||(t=o.color.getValue().clone()),t.alpha=i),Object(l.a)(t)&&(o=new NR(t))}const c=vge(t,e._entityCollection,r.describe),u=new Dk;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=a,u.positions=new kP(Oge(i,n)),u.arcType=vl.RHUMB}function Pge(e,t,n,i,r){Ige(e,t,i,n.coordinates,r)}function Dge(e,t,n,i,r){const o=n.coordinates;for(let n=0;n<o.length;n++)Ige(e,t,i,o[n],r)}function Rge(e,t,n,i,r){if(0===i.length||0===i[0].length)return;let o=r.strokeMaterialProperty.color,a=r.fillMaterialProperty,s=r.strokeWidthProperty;const c=t.properties;if(Object(l.a)(c)){const e=c["stroke-width"];let t;Object(l.a)(e)&&(s=new kP(e));const n=c.stroke;Object(l.a)(n)&&(t=sp.fromCssColorString(n));let i,r=c["stroke-opacity"];Object(l.a)(r)&&1!==r&&(Object(l.a)(t)||(t=o.getValue().clone()),t.alpha=r),Object(l.a)(t)&&(o=new kP(t));const u=c.fill,h=a.color.getValue();Object(l.a)(u)&&(i=sp.fromCssColorString(u),i.alpha=h.alpha),r=c["fill-opacity"],Object(l.a)(r)&&r!==h.alpha&&(Object(l.a)(i)||(i=h.clone()),i.alpha=r),Object(l.a)(i)&&(a=new NR(i))}const u=new Ik;u.outline=new kP(!0),u.outlineColor=o,u.outlineWidth=s,u.material=a,u.arcType=vl.RHUMB;const h=[];for(let e=1,t=i.length;e<t;e++)h.push(new QT(Oge(i[e],n)));const d=i[0];u.hierarchy=new kP(new QT(Oge(d,n),h)),d[0].length>2?u.perPositionHeight=new kP(!0):r.clampToGround||(u.height=0);vge(t,e._entityCollection,r.describe).polygon=u}function jge(e,t,n,i,r){Rge(e,t,i,n.coordinates,r)}function Mge(e,t,n,i,r){const o=n.coordinates;for(let n=0;n<o.length;n++)Rge(e,t,i,o[n],r)}function Lge(e,t,n,i,o){for(const t in n.objects)if(n.objects.hasOwnProperty(t)){const a=r.feature(n,n.objects[t]);(0,wge[a.type])(e,a,a,i,o)}}function Nge(e){this._name=e,this._changed=new un.a,this._error=new un.a,this._isLoading=!1,this._loading=new un.a,this._entityCollection=new ore(this),this._promises=[],this._pinBuilder=new nT,this._entityCluster=new Woe,this._credit=void 0,this._resourceCredits=[]}function Bge(e,t,n,i){if(!Object(l.a)(t))throw new u.a("data is required.");Mre.setLoading(e,!0);let r=(n=Object(c.a)(n,c.a.EMPTY_OBJECT)).credit;"string"==typeof r&&(r=new ln(r)),e._credit=r;let o=t,a=n.sourceUri;if("string"==typeof t||t instanceof Tt.a){o=(t=Tt.a.createIfNeeded(t)).fetchJson(),a=Object(c.a)(a,t.getUrlComponent());const n=e._resourceCredits,i=t.credits;if(Object(l.a)(i)){const e=i.length;for(let t=0;t<e;t++)n.push(i[t])}}return n={describe:Object(c.a)(n.describe,bge),markerSize:Object(c.a)(n.markerSize,uge),markerSymbol:Object(c.a)(n.markerSymbol,lge),markerColor:Object(c.a)(n.markerColor,hge),strokeWidthProperty:new kP(Object(c.a)(n.strokeWidth,fge)),strokeMaterialProperty:new NR(Object(c.a)(n.stroke,dge)),fillMaterialProperty:new NR(Object(c.a)(n.fill,pge)),clampToGround:Object(c.a)(n.clampToGround,mge)},Promise.resolve(o).then((function(t){return function(e,t,n,i,r){let o;Object(l.a)(i)&&(o=Yv(i));Object(l.a)(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));const a=wge[t.type];if(!Object(l.a)(a))throw new ye.a("Unsupported GeoJSON object type: "+t.type);const s=t.crs;let c=null!==s?oge:null;if(Object(l.a)(s)){if(!Object(l.a)(s.properties))throw new ye.a("crs.properties is undefined.");const e=s.properties;if("name"===s.type){if(c=age[e.name],!Object(l.a)(c))throw new ye.a("Unknown crs name: "+e.name)}else if("link"===s.type){let t=sge[e.href];if(Object(l.a)(t)||(t=cge[e.type]),!Object(l.a)(t))throw new ye.a("Unable to resolve crs link: "+JSON.stringify(e));c=t(e)}else{if("EPSG"!==s.type)throw new ye.a("Unknown crs type: "+s.type);if(c=age["EPSG:"+e.code],!Object(l.a)(c))throw new ye.a("Unknown crs EPSG code: "+e.code)}}return Promise.resolve(c).then((function(i){return r&&e._entityCollection.removeAll(),null!==i&&a(e,t,t,i,n),Promise.all(e._promises).then((function(){return e._promises.length=0,Mre.setLoading(e,!1),e}))}))}(e,t,n,a,i)})).catch((function(t){throw Mre.setLoading(e,!1),e._error.raiseEvent(e,t),t}))}Nge.load=function(e,t){return(new Nge).load(e,t)},Object.defineProperties(Nge,{markerSize:{get:function(){return uge},set:function(e){uge=e}},markerSymbol:{get:function(){return lge},set:function(e){lge=e}},markerColor:{get:function(){return hge},set:function(e){hge=e}},stroke:{get:function(){return dge},set:function(e){dge=e}},strokeWidth:{get:function(){return fge},set:function(e){fge=e}},fill:{get:function(){return pge},set:function(e){pge=e}},clampToGround:{get:function(){return mge},set:function(e){mge=e}},crsNames:{get:function(){return age}},crsLinkHrefs:{get:function(){return sge}},crsLinkTypes:{get:function(){return cge}}}),Object.defineProperties(Nge.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!Object(l.a)(e))throw new u.a("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}}),Nge.prototype.load=function(e,t){return Bge(this,e,t,!0)},Nge.prototype.process=function(e,t){return Bge(this,e,t,!1)},Nge.prototype.update=function(e){return!0};var Fge=Nge;function zge(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1}function kge(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function Uge(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var Vge=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),i=this.whitespaceRegex,r=n?n.split(i):[],o=e.split(i);t=o.shift();)-1===zge(r,t)&&r.push(t);return this.getAttrs().class=r.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),i=this.whitespaceRegex,r=n?n.split(i):[],o=e.split(i);r.length&&(t=o.shift());){var a=zge(r,t);-1!==a&&r.splice(a,1)}return this.getAttrs().class=r.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}();var Hge=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new Vge({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],i=e.getCssClassSuffixes(),r=0,o=i.length;r<o;r++)n.push(t+"-"+i[r]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,i=t.location;return"smart"===i?function(e,t,n){var i,r;null==n?(n="&hellip;",r=3,i=8):(r=n.length,i=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},a=function(e,t){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),a="";return o<0&&(a=e.substr(o)),e.substr(0,r)+n+a};if(e.length<=t)return e;var s=t-r,c=function(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.substr(i[0].length)),(i=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=i[1],n=n.substr(i[0].length)),(i=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=i[1],n=n.substr(i[0].length)),(i=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=i[1],n=n.substr(i[0].length)),(i=n.match(/^#(.*?)$/i))&&(t.fragment=i[1]),t}(e);if(c.query){var l=c.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);l&&(c.query=c.query.substr(0,l[1].length),e=o(c))}if(e.length<=t)return e;if(c.host&&(c.host=c.host.replace(/^www\./,""),e=o(c)),e.length<=t)return e;var u="";if(c.host&&(u+=c.host),u.length>=s)return c.host.length==t?(c.host.substr(0,t-r)+n).substr(0,s+i):a(u,s).substr(0,s+i);var h="";if(c.path&&(h+="/"+c.path),c.query&&(h+="?"+c.query),h){if((u+h).length>=s)return(u+h).length==t?(u+h).substr(0,t):(u+a(h,s-u.length)).substr(0,s+i);u+=h}if(c.fragment){var d="#"+c.fragment;if((u+d).length>=s)return(u+d).length==t?(u+d).substr(0,t):(u+a(d,s-u.length)).substr(0,s+i);u+=d}if(c.scheme&&c.host){var f=c.scheme+"://";if((u+f).length<s)return(f+u).substr(0,t)}if(u.length<=t)return u;var p="";return s>0&&(p=u.substr(-1*Math.floor(s/2))),(u.substr(0,Math.ceil(s/2))+n+p).substr(0,s+i)}(e,n):"middle"===i?function(e,t,n){if(e.length<=t)return e;var i,r;null==n?(n="&hellip;",i=8,r=3):(i=n.length,r=n.length);var o=t-r,a="";return o>0&&(a=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+a).substr(0,o+i)}(e,n):function(e,t,n){return function(e,t,n){var i;return e.length>t&&(null==n?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}(e,t,n)}(e,n)},e}(),Gge=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),qge=function(e,t){return(qge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Wge(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}qge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Yge=function(){return(Yge=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.create;Object.create;var Xge,Kge=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return Wge(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Gge),Jge=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return Wge(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;case"tiktok":return"https://www.tiktok.com/tag/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Gge),Zge=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return Wge(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Gge),$ge=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return Wge(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Gge),Qge=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Wge(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch(e){return t}},t}(Gge),e_e=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},t_e=/[A-Za-z]/,n_e=/[\d]/,i_e=/[\D]/,r_e=/\s/,o_e=/['"]/,a_e=/[\x00-\x1F\x7F]/,s_e=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,c_e=s_e+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,l_e=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,u_e=c_e+l_e,h_e=c_e+l_e,d_e=new RegExp("[".concat(h_e,"]")),f_e="(?:["+l_e+"]{1,3}\\.){3}["+l_e+"]{1,3}",p_e="["+h_e+"](?:["+h_e+"\\-_]{0,61}["+h_e+"])?",m_e=function(e){return"(?=("+p_e+"))\\"+e},g_e=function(e){return"(?:"+m_e(e)+"(?:\\."+m_e(e+1)+"){0,126}|"+f_e+")"},__e=(new RegExp("["+h_e+".\\-]*["+h_e+"\\-]"),d_e),y_e=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,b_e=new RegExp("[".concat(h_e,"!#$%&'*+/=?^_`{|}~-]")),v_e=new RegExp("^".concat(y_e.source,"$")),O_e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=b_e,t.strictTldRegex=v_e,t}return Wge(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,i=this.strictTldRegex,r=[],o=e.length,a=new w_e,s={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,l=0,u=a;c<o;){var h=e.charAt(c);switch(l){case 0:d(h);break;case 1:f(e.charAt(c-1),h);break;case 2:p(h);break;case 3:m(h);break;case 4:g(h);break;case 5:_(h);break;case 6:y(h);break;case 7:b(h);break;default:Uge(l)}c++}return w(),r;function d(e){"m"===e?v(1):n.test(e)&&v()}function f(e,t){":"===e?n.test(t)?(l=2,u=new w_e(Yge(Yge({},u),{hasMailtoPrefix:!0}))):O():s[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:O())}function p(e){"."===e?l=3:"@"===e?l=4:n.test(e)||O()}function m(e){"."===e||"@"===e?O():n.test(e)?l=2:O()}function g(e){__e.test(e)?l=5:O()}function _(e){"."===e?l=7:"-"===e?l=6:__e.test(e)||w()}function y(e){"-"===e||"."===e?w():__e.test(e)?l=5:w()}function b(e){"."===e||"-"===e?w():__e.test(e)?(l=5,u=new w_e(Yge(Yge({},u),{hasDomainDot:!0}))):w()}function v(e){void 0===e&&(e=2),l=e,u=new w_e({idx:c})}function O(){l=0,u=a}function w(){if(u.hasDomainDot){var n=e.slice(u.idx,c);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=u.hasMailtoPrefix?n.slice("mailto:".length):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return i.test(t)})(o)&&r.push(new Kge({tagBuilder:t,matchedText:n,offset:u.idx,email:o}))}O()}},t}(e_e),w_e=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},A_e=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&(!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+s_e+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),E_e=(Xge=new RegExp("[/?#](?:["+h_e+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+h_e+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,g_e(2),")","|","(","(//)?",/(?:www\.)/.source,g_e(6),")","|","(","(//)?",g_e(10)+"\\.",y_e.source,"(?![-"+u_e+"])",")",")","(?::[0-9]+)?","(?:"+Xge.source+")?"].join(""),"gi")),T_e=new RegExp("["+h_e+"]"),C_e=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=E_e,n.wordCharRegExp=T_e,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Wge(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,i=this.stripPrefix,r=this.stripTrailingSlash,o=this.decodePercentEncoding,a=this.tagBuilder,s=[],c=function(){var n=t[0],c=t[1],u=t[4],h=t[5],d=t[9],f=t.index,p=h||d,m=e.charAt(f-1);if(!A_e.isValid(n,c))return"continue";if(f>0&&"@"===m)return"continue";if(f>0&&p&&l.wordCharRegExp.test(m))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var g=l.matchHasInvalidCharAfterTld(n,c);g>-1&&(n=n.substr(0,g))}var _=["http://","https://"].find((function(e){return!!c&&-1!==c.indexOf(e)}));if(_){var y=n.indexOf(_);n=n.substr(y),c=c.substr(y),f+=y}var b=c?"scheme":u?"www":"tld",v=!!c;s.push(new Qge({tagBuilder:a,matchedText:n,offset:f,urlMatchType:b,url:n,protocolUrlMatch:v,protocolRelativeMatch:!!p,stripPrefix:i,stripTrailingSlash:r,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)c();return s},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var i=0,r=0,o=e.length-1;r<o;r++){var a=e.charAt(r);a===t?i++:a===n&&(i=Math.max(i-1,0))}return 0===i},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var i=new RegExp("^((.?//)?[-."+h_e+"]*[-"+h_e+"]\\.[-"+h_e+"]+)").exec(e);return null===i?-1:(n+=i[1].length,e=e.slice(i[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(e_e),x_e=new RegExp("[_".concat(h_e,"]")),S_e=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.serviceName=t.serviceName,n}return Wge(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.serviceName,i=[],r=e.length,o=0,a=-1,s=0;o<r;){var c=e.charAt(o);switch(s){case 0:l(c);break;case 1:u(c);break;case 2:h(c);break;case 3:d(c);break;default:Uge(s)}o++}return f(),i;function l(e){"#"===e?(s=2,a=o):d_e.test(e)&&(s=1)}function u(e){d_e.test(e)||(s=0)}function h(e){s=x_e.test(e)?3:d_e.test(e)?1:0}function d(e){x_e.test(e)||(f(),a=-1,s=d_e.test(e)?1:0)}function f(){if(a>-1&&o-a<=140){var r=e.slice(a,o),s=new Jge({tagBuilder:t,matchedText:r,offset:a,serviceName:n,hashtag:r.slice(1)});i.push(s)}}},t}(e_e),I_e=["twitter","facebook","instagram","tiktok"],P_e=new RegExp("".concat(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source,"|").concat(/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source),"g"),D_e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=P_e,t}return Wge(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,i=this.tagBuilder,r=[];null!==(t=n.exec(e));){var o=t[0],a=o.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),c=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),u=!c.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&u&&r.push(new $ge({tagBuilder:i,matchedText:o,offset:t.index,number:a,plusSign:s}))}return r},t.prototype.testMatch=function(e){return i_e.test(e)},t}(e_e),R_e=new RegExp("@[_".concat(h_e,"]{1,50}(?![_").concat(h_e,"])"),"g"),j_e=new RegExp("@[_.".concat(h_e,"]{1,30}(?![_").concat(h_e,"])"),"g"),M_e=new RegExp("@[-_.".concat(h_e,"]{1,50}(?![-_").concat(h_e,"])"),"g"),L_e=new RegExp("@[_.".concat(h_e,"]{1,23}[_").concat(h_e,"](?![_").concat(h_e,"])"),"g"),N_e=new RegExp("[^"+h_e+"]"),B_e=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:R_e,instagram:j_e,soundcloud:M_e,tiktok:L_e},n.nonWordCharRegex=N_e,n.serviceName=t.serviceName,n}return Wge(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,i=this.matcherRegexes[this.serviceName],r=this.nonWordCharRegex,o=this.tagBuilder,a=[];if(!i)return a;for(;null!==(t=i.exec(e));){var s=t.index,c=e.charAt(s-1);if(0===s||r.test(c)){var l=t[0].replace(/\.+$/g,""),u=l.slice(1);a.push(new Zge({tagBuilder:o,matchedText:l,offset:s,serviceName:n,mention:u}))}}return a},t}(e_e);function F_e(e,t){for(var n,i=t.onOpenTag,r=t.onCloseTag,o=t.onText,a=t.onComment,s=t.onDoctype,c=new z_e,l=0,u=e.length,h=0,d=0,f=c;l<u;){var p=e.charAt(l);switch(h){case 0:m(p);break;case 1:g(p);break;case 2:y(p);break;case 3:_(p);break;case 4:b(p);break;case 5:v(p);break;case 6:O(p);break;case 7:w(p);break;case 8:A(p);break;case 9:E(p);break;case 10:T(p);break;case 11:C(p);break;case 12:x(p);break;case 13:S(p);break;case 14:I(p);break;case 15:P(p);break;case 16:D(p);break;case 17:R(p);break;case 18:j(p);break;case 19:M(p);break;case 20:L(p);break;default:Uge(h)}l++}function m(e){"<"===e&&B()}function g(e){"!"===e?h=13:"/"===e?(h=2,f=new z_e(Yge(Yge({},f),{isClosing:!0}))):"<"===e?B():t_e.test(e)?(h=3,f=new z_e(Yge(Yge({},f),{isOpening:!0}))):(h=0,f=c)}function _(e){r_e.test(e)?(f=new z_e(Yge(Yge({},f),{name:z()})),h=4):"<"===e?B():"/"===e?(f=new z_e(Yge(Yge({},f),{name:z()})),h=12):">"===e?(f=new z_e(Yge(Yge({},f),{name:z()})),F()):t_e.test(e)||n_e.test(e)||":"===e||N()}function y(e){">"===e?N():t_e.test(e)?h=3:N()}function b(e){r_e.test(e)||("/"===e?h=12:">"===e?F():"<"===e?B():"="===e||o_e.test(e)||a_e.test(e)?N():h=5)}function v(e){r_e.test(e)?h=6:"/"===e?h=12:"="===e?h=7:">"===e?F():"<"===e?B():o_e.test(e)&&N()}function O(e){r_e.test(e)||("/"===e?h=12:"="===e?h=7:">"===e?F():"<"===e?B():o_e.test(e)?N():h=5)}function w(e){r_e.test(e)||('"'===e?h=8:"'"===e?h=9:/[>=`]/.test(e)?N():"<"===e?B():h=10)}function A(e){'"'===e&&(h=11)}function E(e){"'"===e&&(h=11)}function T(e){r_e.test(e)?h=4:">"===e?F():"<"===e&&B()}function C(e){r_e.test(e)?h=4:"/"===e?h=12:">"===e?F():"<"===e?B():(h=4,l--)}function x(e){">"===e?(f=new z_e(Yge(Yge({},f),{isClosing:!0})),F()):h=4}function S(t){"--"===e.substr(l,2)?(l+=2,f=new z_e(Yge(Yge({},f),{type:"comment"})),h=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,f=new z_e(Yge(Yge({},f),{type:"doctype"})),h=20):N()}function I(e){"-"===e?h=15:">"===e?N():h=16}function P(e){"-"===e?h=18:">"===e?N():h=16}function D(e){"-"===e&&(h=17)}function R(e){h="-"===e?18:16}function j(e){">"===e?F():"!"===e?h=19:"-"===e||(h=16)}function M(e){"-"===e?h=17:">"===e?F():h=16}function L(e){">"===e?F():"<"===e&&B()}function N(){h=0,f=c}function B(){h=1,f=new z_e({idx:l})}function F(){var t=e.slice(d,f.idx);t&&o(t,d),"comment"===f.type?a(f.idx):"doctype"===f.type?s(f.idx):(f.isOpening&&i(f.name,f.idx),f.isClosing&&r(f.name,f.idx)),N(),d=l+1}function z(){var t=f.idx+(f.isClosing?2:1);return e.slice(t,l).toLowerCase()}d<l&&(n=e.slice(d,l),o(n,d),d=l+1)}var z_e=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},k_e=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&-1===["twitter","instagram","soundcloud","tiktok"].indexOf(n))throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(!1!==i&&-1===I_e.indexOf(i))throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],i=0,r=[];return F_e(e,{onOpenTag:function(e){n.indexOf(e)>=0&&i++},onText:function(e,n){if(0===i){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,i=[],r=0;n=t.exec(e);)i.push(e.substring(r,n.index)),i.push(n[0]),r=n.index+n[0].length;return i.push(e.substring(r)),i}(e,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),a=n;o.forEach((function(e,n){if(n%2==0){var i=t.parseText(e,a);r.push.apply(r,i)}a+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(i=Math.max(i-1,0))},onComment:function(e){},onDoctype:function(e){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;){var n=e[t],i=n.getOffset(),r=n.getMatchedText().length,o=i+r;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>r?t:t+1;e.splice(a,1);continue}if(e[t+1].getOffset()<o){e.splice(t+1,1);continue}}t++}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||kge(e,(function(e){return"hashtag"===e.getType()})),this.email||kge(e,(function(e){return"email"===e.getType()})),this.phone||kge(e,(function(e){return"phone"===e.getType()})),this.mention||kge(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||kge(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||kge(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||kge(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),i=[],r=0,o=n.length;r<o;r++){for(var a=n[r].parseMatches(e),s=0,c=a.length;s<c;s++)a[s].setOffset(t+a[s].getOffset());i.push.apply(i,a)}return i},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),n=[],i=0,r=0,o=t.length;r<o;r++){var a=t[r];n.push(e.substring(i,a.getOffset())),n.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return n.push(e.substring(i)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof Vge?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new S_e({tagBuilder:e,serviceName:this.hashtag}),new O_e({tagBuilder:e}),new D_e({tagBuilder:e}),new B_e({tagBuilder:e,serviceName:this.mention}),new C_e({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new Hge({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.16.2",e.AnchorTagBuilder=Hge,e.HtmlTag=Vge,e.matcher={Email:O_e,Hashtag:S_e,Matcher:e_e,Mention:B_e,Phone:D_e,Url:C_e},e.match={Email:Kge,Hashtag:Jge,Match:Gge,Mention:Zge,Phone:$ge,Url:Qge},e}();let U_e;"undefined"!=typeof DOMParser&&(U_e=new DOMParser);const V_e=new k_e({stripPrefix:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),H_e={gpx:[null,void 0,"http://www.topografix.com/GPX/1/1"]};function G_e(e,t){let n=Y_e(e,"id");n=Object(l.a)(n)?n:fy();return t.getOrCreateEntity(n)}function q_e(e){const t=W_e(e,"lon"),n=W_e(e,"lat"),i=J_e(e,"ele",H_e.gpx);return O.fromDegrees(t,n,i)}function W_e(e,t){if(!Object(l.a)(e))return;const n=e.getAttribute(t);if(null!==n){const e=parseFloat(n);return isNaN(e)?void 0:e}}function Y_e(e,t){if(!Object(l.a)(e))return;const n=e.getAttribute(t);return null!==n?n:void 0}function X_e(e,t,n){if(!Object(l.a)(e))return;const i=e.childNodes,r=i.length;for(let e=0;e<r;e++){const r=i[e];if(r.localName===t&&-1!==n.indexOf(r.namespaceURI))return r}}function K_e(e,t,n){if(!Object(l.a)(e))return;const i=[],r=e.getElementsByTagName(t),o=r.length;for(let e=0;e<o;e++){const o=r[e];o.localName===t&&-1!==n.indexOf(o.namespaceURI)&&i.push(o)}return i}function J_e(e,t,n){const i=X_e(e,t,n);if(Object(l.a)(i)){const e=parseFloat(i.textContent);return isNaN(e)?void 0:e}}function Z_e(e,t,n){const i=X_e(e,t,n);if(Object(l.a)(i))return i.textContent.trim()}function $_e(e){const t=new GP;return t.width=32,t.height=32,t.scaleByDistance=new TE(2414016,1,16093e3,.1),t.pixelOffsetScaleByDistance=new TE(2414016,1,16093e3,.1),t.verticalOrigin=new kP(YP.BOTTOM),t.image=e,t}function Q_e(e){const t=new Dk;return t.width=4,t.material=new Aae,t.material.color=Object(l.a)(e)?e:sp.RED,t.material.outlineWidth=2,t.material.outlineColor=sp.BLACK,t}const eye={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}};let tye;function nye(e,t){let n,i="";const r=Object.keys(eye),o=r.length;for(n=0;n<o;n++){const t=r[n],o=eye[t];o.value=Object(c.a)(Z_e(e,o.tag,H_e.gpx),""),Object(l.a)(o.value)&&""!==o.value&&(i=`${i}<p>${o.text}: ${o.value}</p>`)}if(!Object(l.a)(i)||""===i)return;i=V_e.link(i),tye.innerHTML=i;const a=tye.querySelectorAll("a");for(n=0;n<a.length;n++)a[n].setAttribute("target","_blank");const s=sp.WHITE,u=sp.BLACK;let h='<div class="cesium-infoBox-description-lighter" style="';return h+="overflow:auto;",h+="word-wrap:break-word;",h+=`background-color:${s.toCssColorString()};`,h+=`color:${u.toCssColorString()};`,h+='">',h+=tye.innerHTML+"</div>",tye.innerHTML="",h}function iye(e,t,n,i){const r=q_e(t),o=G_e(t,n);o.position=r;const a=Object(l.a)(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",sp.RED,32);o.billboard=$_e(a);const s=Z_e(t,"name",H_e.gpx);o.name=s,o.label=function(){const e=new uk;return e.translucencyByDistance=new TE(3e6,1,5e6,0),e.pixelOffset=new Vt(17,0),e.horizontalOrigin=WP.LEFT,e.font="16px sans-serif",e.style=L0.FILL_AND_OUTLINE,e}(),o.label.text=s,o.description=nye(t),i.clampToGround&&(o.billboard.heightReference=qP.CLAMP_TO_GROUND,o.label.heightReference=qP.CLAMP_TO_GROUND)}function rye(e){const t={positions:[],times:[]},n=K_e(e,"trkpt",H_e.gpx);let i;for(let e=0;e<n.length;e++){const r=q_e(n[e]);t.positions.push(r),i=Z_e(n[e],"time",H_e.gpx),Object(l.a)(i)&&t.times.push(tr.fromIso8601(i))}return t}function oye(e){const t=X_e(e,"author",H_e.gpx);if(Object(l.a)(t)){const e={name:Z_e(t,"name",H_e.gpx),email:aye(t),link:sye(t)};if(Object(l.a)(e.name)||Object(l.a)(e.email)||Object(l.a)(e.link))return e}}function aye(e){const t=X_e(e,"email",H_e.gpx);if(Object(l.a)(t)){return`${Z_e(t,"id",H_e.gpx)}@${Z_e(t,"domain",H_e.gpx)}`}}function sye(e){const t=X_e(e,"link",H_e.gpx);if(Object(l.a)(t)){const e={href:Y_e(t,"href"),text:Z_e(t,"text",H_e.gpx),mimeType:Z_e(t,"type",H_e.gpx)};if(Object(l.a)(e.href)||Object(l.a)(e.text)||Object(l.a)(e.mimeType))return e}}function cye(e){const t=X_e(e,"copyright",H_e.gpx);if(Object(l.a)(t)){const e={author:Y_e(t,"author"),year:Z_e(t,"year",H_e.gpx),license:Z_e(t,"license",H_e.gpx)};if(Object(l.a)(e.author)||Object(l.a)(e.year)||Object(l.a)(e.license))return e}}function lye(e){const t=X_e(e,"bounds",H_e.gpx);if(Object(l.a)(t)){const e={minLat:J_e(t,"minlat",H_e.gpx),maxLat:J_e(t,"maxlat",H_e.gpx),minLon:J_e(t,"minlon",H_e.gpx),maxLon:J_e(t,"maxlon",H_e.gpx)};if(Object(l.a)(e.minLat)||Object(l.a)(e.maxLat)||Object(l.a)(e.minLon)||Object(l.a)(e.maxLon))return e}}"undefined"!=typeof document&&(tye=document.createElement("div"));const uye={wpt:iye,rte:function(e,t,n,i){const r=G_e(t,n);r.description=nye(t);const o=K_e(t,"rtept",H_e.gpx),a=new Array(o.length);for(let t=0;t<o.length;t++)iye(e,o[t],n,i),a[t]=q_e(o[t]);r.polyline=Q_e(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=a},trk:function(e,t,n,i){const r=G_e(t,n);r.description=nye(t);const o=K_e(t,"trkseg",H_e.gpx);let a,s=[],c=[],u=!0;const h=new Vae;for(let e=0;e<o.length;e++)a=rye(o[e]),s=s.concat(a.positions),a.times.length>0?(c=c.concat(a.times),h.addSamples(c,s),u=u&&!0):u=!1;if(u){const t=Object(l.a)(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",sp.RED,32);r.billboard=$_e(t),r.position=h,i.clampToGround&&(r.billboard.heightReference=qP.CLAMP_TO_GROUND),r.availability=new YI,r.availability.addInterval(new YA({start:c[0],stop:c[c.length-1]}))}r.polyline=Q_e(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}};function hye(e,t,n){const i=e._entityCollection;i.removeAll();const r=t.documentElement,o=Y_e(r,"version"),a=Y_e(r,"creator");let s;const c=function(e){const t=X_e(e,"metadata",H_e.gpx);if(Object(l.a)(t)){const e={name:Z_e(t,"name",H_e.gpx),desc:Z_e(t,"desc",H_e.gpx),author:oye(t),copyright:cye(t),link:sye(t),time:Z_e(t,"time",H_e.gpx),keywords:Z_e(t,"keywords",H_e.gpx),bounds:lye(t)};if(Object(l.a)(e.name)||Object(l.a)(e.desc)||Object(l.a)(e.author)||Object(l.a)(e.copyright)||Object(l.a)(e.link)||Object(l.a)(e.time)||Object(l.a)(e.keywords)||Object(l.a)(e.bounds))return e}}(r);let u;Object(l.a)(c)&&(s=c.name),"gpx"===r.localName?function(e,t,n,i){const r=Object.keys(uye),o=r.length;for(let a=0;a<o;a++){const o=r[a],s=uye[o],c=t.childNodes,l=c.length;for(let t=0;t<l;t++){const r=c[t];r.localName===o&&-1!==H_e.gpx.indexOf(r.namespaceURI)&&s(e,r,n,i)}}}(e,r,i,n):console.log("GPX - Unsupported node: "+r.localName);const h=i.computeAvailability();let d=h.start,f=h.stop;const p=tr.equals(d,JA.MINIMUM_VALUE),m=tr.equals(f,JA.MAXIMUM_VALUE);if(!p||!m){let e;p&&(e=new Date,e.setHours(0,0,0,0),d=tr.fromDate(e)),m&&(e=new Date,e.setHours(24,0,0,0),f=tr.fromDate(e)),u=new rae,u.startTime=d,u.stopTime=f,u.currentTime=tr.clone(d),u.clockRange=qf.LOOP_STOP,u.clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(tr.secondsDifference(f,d)/60,1),31556900))}let g=!1;return e._name!==s&&(e._name=s,g=!0),e._creator!==a&&(e._creator=a,g=!0),function(e,t){if(!Object(l.a)(e)&&!Object(l.a)(t))return!1;if(Object(l.a)(e)&&Object(l.a)(t))return e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds;return!0}(e._metadata,c)&&(e._metadata=c,g=!0),e._version!==o&&(e._version=o,g=!0),u!==e._clock&&(g=!0,e._clock=u),g&&e._changed.raiseEvent(e),Mre.setLoading(e,!1),e}function dye(e,t,n,i){i=Object(c.a)(i,c.a.EMPTY_OBJECT);let r=n;if("string"==typeof n||n instanceof Tt.a){r=(n=Tt.a.createIfNeeded(n)).fetchBlob();const t=e._resourceCredits,i=n.credits;if(Object(l.a)(i)){const e=i.length;for(let n=0;n<e;n++)t.push(i[n])}}return Promise.resolve(r).then((function(t){return t instanceof Blob?(n=t,new Promise((e,t)=>{const i=new FileReader;i.addEventListener("load",(function(){e(i.result)})),i.addEventListener("error",(function(){t(i.error)})),i.readAsText(n)})).then((function(t){let n,r;try{n=U_e.parseFromString(t,"application/xml")}catch(e){r=e.toString()}if(Object(l.a)(r)||n.body||"parsererror"===n.documentElement.tagName){let e=Object(l.a)(r)?r:n.documentElement.firstChild.nodeValue;throw e||(e=n.body.innerText),new ye.a(e)}return hye(e,n,i)})):hye(e,t,i);var n})).catch((function(t){return e._error.raiseEvent(e,t),console.log(t),Promise.reject(t)}))}function fye(){this._changed=new un.a,this._error=new un.a,this._loading=new un.a,this._clock=void 0,this._entityCollection=new ore,this._entityCluster=new Woe,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new nT}fye.load=function(e,t){return(new fye).load(e,t)},Object.defineProperties(fye.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!Object(l.a)(e))throw new u.a("value must be defined.");this._entityCluster=e}}}),fye.prototype.update=function(e){return!0},fye.prototype.load=function(e,t){if(!Object(l.a)(e))throw new u.a("data is required.");t=Object(c.a)(t,c.a.EMPTY_OBJECT),Mre.setLoading(this,!0);const n=this._name,i=this;return dye(this,this._entityCollection,e,t).then((function(){let e;const t=i._entityCollection.computeAvailability();let r=t.start,o=t.stop;const a=tr.equals(r,JA.MINIMUM_VALUE),s=tr.equals(o,JA.MAXIMUM_VALUE);if(!a||!s){let t;a&&(t=new Date,t.setHours(0,0,0,0),r=tr.fromDate(t)),s&&(t=new Date,t.setHours(24,0,0,0),o=tr.fromDate(t)),e=new rae,e.startTime=r,e.stopTime=o,e.currentTime=tr.clone(r),e.clockRange=qf.LOOP_STOP,e.clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(tr.secondsDifference(o,r)/60,1),31556900))}let c=!1;return e!==i._clock&&(i._clock=e,c=!0),n!==i._name&&(c=!0),c&&i._changed.raiseEvent(i),Mre.setLoading(i,!1),i})).catch((function(e){return Mre.setLoading(i,!1),i._error.raiseEvent(i,e),console.log(e),Promise.reject(e)}))};var pye=fye;var mye=function(e,t){this.position=e,this.headingPitchRoll=t};var gye=function(e){if("string"==typeof e){const t=document.getElementById(e);if(null===t)throw new u.a(`Element with id "${e}" does not exist in the document.`);e=t}return e};var _ye=function(e,t){this.position=e,this.headingPitchRange=t};function yye(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new un.a,this.tourEnd=new un.a,this.entryStart=new un.a,this.entryEnd=new un.a,this._activeEntries=[]}function bye(e){for(let t=e.pop();void 0!==t;t=e.pop())t.stop()}function vye(e,t,n){const i=this.playlist[this.playlistIndex];if(i){const r=Oye.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{const o=this;i.play((function(){o.entryEnd.raiseEvent(i);const e=o._activeEntries.indexOf(i);e>=0&&o._activeEntries.splice(e,1)})),r(e,t,n)}}else Object(l.a)(n)&&n(!1)}function Oye(e,t,n,i){const r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{const i=this._activeEntries.indexOf(r);i>=0&&this._activeEntries.splice(i,1),this.playlistIndex++,vye.call(this,e,t,n)}}yye.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},yye.prototype.play=function(e,t){this.tourStart.raiseEvent();const n=this;vye.call(this,e,t,(function(e){n.playlistIndex=0,e||bye(n._activeEntries),n.tourEnd.raiseEvent(e)}))},yye.prototype.stop=function(){bye(this._activeEntries)};var wye=yye;function Aye(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}Aye.prototype.play=function(e,t,n){if(this.activeCamera=t,Object(l.a)(e)&&null!==e){const t=this;this.activeCallback=function(n){delete t.activeCallback,delete t.activeCamera,e(!Object(l.a)(n)&&n)}}const i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){const e=new At(this.view.position);t.flyToBoundingSphere(e,i)}},Aye.prototype.stop=function(){Object(l.a)(this.activeCamera)&&this.activeCamera.cancelFlight(),Object(l.a)(this.activeCallback)&&this.activeCallback(!0)},Aye.prototype.getCameraOptions=function(e){let t={duration:this.duration};return Object(l.a)(this.activeCallback)&&(t.complete=this.activeCallback),"smooth"===this.flyToMode&&(t.easingFunction=_b.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),Object(l.a)(e)&&(t=Object(up.a)(t,e)),t};var Eye=Aye;function Tye(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Tye.prototype.play=function(e){const t=this;this.activeCallback=e,this.timeout=setTimeout((function(){delete t.activeCallback,e(!1)}),1e3*this.duration)},Tye.prototype.stop=function(){clearTimeout(this.timeout),Object(l.a)(this.activeCallback)&&this.activeCallback(!0)};var Cye=Tye;const xye={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=Object(Wv.a)(t),xye[t]}};let Sye;"undefined"!=typeof DOMParser&&(Sye=new DOMParser);const Iye=new k_e({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),Pye=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Dye=["http://www.google.com/kml/ext/2.2"],Rye={kml:Pye,gx:Dye,atom:["http://www.w3.org/2005/Atom"],kmlgx:Pye.concat(Dye)},jye={Document:vbe,Folder:function(e,t,n,i){const r=bbe(e,t,n),o=Object(Zf.a)(n);o.parentEntity=r.entity,vbe(e,t,o,i)},Placemark:function(e,t,n,i){const r=bbe(e,t,n),o=r.entity,a=r.styleEntity;let s=!1;const c=t.childNodes;for(let t=0,i=c.length;t<i&&!s;t++){const i=c.item(t),r=_be[i.localName];Object(l.a)(r)&&(r(e,n.entityCollection,i,o,a,o.id),s=!0)}s||(o.merge(a),fbe(e,o,a))},NetworkLink:function(e,t,n,i){const r=bbe(e,t,n).entity,o=n.sourceResource,a=n.uriResolver;let s=Wye(t,"Link",Rye.kml);Object(l.a)(s)||(s=Wye(t,"Url",Rye.kml));if(Object(l.a)(s)){let t,u,h=Jye(s,"href",Rye.kml);if(Object(l.a)(h)){let d=h;if(h=$ye(h,o,n.uriResolver),/^data:/.test(h.getUrlComponent()))/\.kmz/i.test(o.getUrlComponent())||(d=o.getDerivedResource({url:d}));else{d=h.clone(),t=Jye(s,"viewRefreshMode",Rye.kml),u=Object(c.a)(Jye(s,"viewBoundScale",Rye.kml),1);const n="onStop"===t?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",i=Object(c.a)(Jye(s,"viewFormat",Rye.kml),n),r=Jye(s,"httpQuery",Rye.kml);Object(l.a)(i)&&h.setQueryParameters(Object(MC.a)(Ibe(i))),Object(l.a)(r)&&h.setQueryParameters(Object(MC.a)(Ibe(r)));const o=e._ellipsoid;Mbe(h,e.camera,e.canvas,u,e._lastCameraView.bbox,o)}const f={sourceUri:d,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},p=new ore,m=Bbe(e,p,h,f).then((function(n){const i=e._entityCollection,o=p.values;i.suspendEvents();for(let e=0;e<o.length;e++){const t=o[e];Object(l.a)(t.parent)||(t.parent=r,zbe(t)),i.add(t)}i.resumeEvents();const a=Jye(s,"refreshMode",Rye.kml);let d=Object(c.a)(Kye(s,"refreshInterval",Rye.kml),0);if("onInterval"===a&&d>0||"onExpire"===a||"onStop"===t){const t=Wye(n,"NetworkLinkControl",Rye.kml),i=Object(l.a)(t),o=tr.now(),f={id:fy(),href:h,cookie:{},lastUpdated:o,updating:!1,entity:r,viewBoundScale:u,needsUpdate:!1,cameraUpdateTime:o};let p=0;if(i&&(f.cookie=Object(MC.a)(Object(c.a)(Jye(t,"cookie",Rye.kml),"")),p=Object(c.a)(Kye(t,"minRefreshPeriod",Rye.kml),0)),"onInterval"===a)i&&(d=Math.max(p,d)),f.refreshMode=Cbe,f.time=d;else if("onExpire"===a){let e;if(i&&(e=Jye(t,"expires",Rye.kml)),Object(l.a)(e))try{const t=tr.fromIso8601(e),n=tr.secondsDifference(t,o);n>0&&n<p&&tr.addSeconds(o,p,t),f.refreshMode=xbe,f.time=t}catch(e){cl("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else cl("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else Object(l.a)(e.camera)?(f.refreshMode=Sbe,f.time=Object(c.a)(Kye(s,"viewRefreshTime",Rye.kml),0)):cl("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");Object(l.a)(f.refreshMode)&&e._networkLinks.set(f.id,f)}else"onRegion"===t&&cl("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")})).catch((function(t){cl("An error occured during loading "+h.url),e._error.raiseEvent(e,t)}));i.addPromise(m)}}},GroundOverlay:function(e,t,n,i){const r=bbe(e,t,n).entity;let o,a=!1;const s=e._ellipsoid,c=Hye(Wye(t,"LatLonQuad",Rye.gx),s),u=Kye(t,"drawOrder",Rye.kml);if(Object(l.a)(c))o=ibe(),o.hierarchy=new QT(c),o.zIndex=u,r.polygon=o,a=!0;else{o=new Lk,o.zIndex=u,r.rectangle=o;const e=Wye(t,"LatLonBox",Rye.kml);if(Object(l.a)(e)){let t=Kye(e,"west",Rye.kml),n=Kye(e,"south",Rye.kml),i=Kye(e,"east",Rye.kml),r=Kye(e,"north",Rye.kml);Object(l.a)(t)&&(t=h.a.negativePiToPi(h.a.toRadians(t))),Object(l.a)(n)&&(n=h.a.clampToLatitudeRange(h.a.toRadians(n))),Object(l.a)(i)&&(i=h.a.negativePiToPi(h.a.toRadians(i))),Object(l.a)(r)&&(r=h.a.clampToLatitudeRange(h.a.toRadians(r))),o.coordinates=new Be(t,n,i,r);const a=Kye(e,"rotation",Rye.kml);if(Object(l.a)(a)){const e=h.a.toRadians(a);o.rotation=e,o.stRotation=e}}}const d=Wye(t,"Icon",Rye.kml),f=obe(d,e,n.sourceResource,n.uriResolver,!0);if(Object(l.a)(f)){a&&cl("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");const e=Kye(d,"x",Rye.gx),n=Kye(d,"y",Rye.gx),i=Kye(d,"w",Rye.gx),r=Kye(d,"h",Rye.gx);(Object(l.a)(e)||Object(l.a)(n)||Object(l.a)(i)||Object(l.a)(r))&&cl("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),o.material=f,o.material.color=tbe(t,"color",Rye.kml),o.material.transparent=!0}else o.material=tbe(t,"color",Rye.kml);let p=Jye(t,"altitudeMode",Rye.kml);Object(l.a)(p)?"absolute"===p?(o.height=Kye(t,"altitude",Rye.kml),o.zIndex=void 0):"clampToGround"!==p&&cl("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+p):(p=Jye(t,"altitudeMode",Rye.gx),"relativeToSeaFloor"===p?(cl("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),o.height=Kye(t,"altitude",Rye.kml),o.zIndex=void 0):"clampToSeaFloor"===p?cl("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):Object(l.a)(p)&&cl("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+p))},PhotoOverlay:Tbe,ScreenOverlay:function(e,t,n,i){const r=n.screenOverlayContainer;if(!Object(l.a)(r))return;const o=n.sourceResource,a=n.uriResolver,s=obe(Wye(t,"Icon",Rye.kml),e,o,a,!1);if(!Object(l.a)(s))return;const c=document.createElement("img");e._screenOverlays.push(c),c.src=s.url,c.onload=function(){const e=["position: absolute"],n=Wye(t,"screenXY",Rye.kml),i=Wye(t,"overlayXY",Rye.kml),r=Wye(t,"size",Rye.kml);let o,a,s,u,h,d;Object(l.a)(r)&&(o=Gye(r,"x"),a=Gye(r,"y"),s=qye(r,"xunits"),u=qye(r,"yunits"),Object(l.a)(o)&&-1!==o&&0!==o&&("fraction"===s?h=`width: ${Math.floor(100*o)}%`:"pixels"===s&&(h=`width: ${o}px`),e.push(h)),Object(l.a)(a)&&-1!==a&&0!==a&&("fraction"===u?d=`height: ${Math.floor(100*a)}%`:"pixels"===u&&(d=`height: ${a}px`),e.push(d))),c.style=e.join(";");let f=0,p=c.height;Object(l.a)(i)&&(o=Gye(i,"x"),a=Gye(i,"y"),s=qye(i,"xunits"),u=qye(i,"yunits"),Object(l.a)(o)&&("fraction"===s?f=o*c.width:("pixels"===s||"insetPixels"===s)&&(f=o)),Object(l.a)(a)&&("fraction"===u?p=a*c.height:("pixels"===u||"insetPixels"===u)&&(p=a))),Object(l.a)(n)&&(o=Gye(n,"x"),a=Gye(n,"y"),s=qye(n,"xunits"),u=qye(n,"yunits"),Object(l.a)(o)&&("fraction"===s?h=`left: calc(${Math.floor(100*o)}% - ${f}px)`:"pixels"===s?h=`left: ${o-f}px`:"insetPixels"===s&&(h=`right: ${o-f}px`),e.push(h)),Object(l.a)(a)&&("fraction"===u?d=`bottom: calc(${Math.floor(100*a)}% - ${p}px)`:"pixels"===u?d=`bottom: ${a-p}px`:"insetPixels"===u&&(d=`top: ${a-p}px`),e.push(d))),c.style=e.join(";")},r.appendChild(c)},Tour:function(e,t,n,i){const r=Jye(t,"name",Rye.kml),o=qye(t,"id"),a=new wye(r,o),s=Wye(t,"Playlist",Rye.gx);if(s){const t=e._ellipsoid,n=s.childNodes;for(let e=0;e<n.length;e++){const i=n[e];if(i.localName){const e=Obe[i.localName];e?e(a,i,t):console.log("Unknown KML Tour playlist entry type "+i.localName)}}}e._kmlTours.push(a)}};function Mye(e){this._dataSource=e,this._deferred=Object(oc.a)(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}function Lye(e){const t={xsi:"http://www.w3.org/2001/XMLSchema-instance"};let n,i,r,o;for(const a in t)t.hasOwnProperty(a)&&(r=RegExp(`[< ]${a}:`),o=`xmlns:${a}=`,r.test(e)&&-1===e.indexOf(o)&&(Object(l.a)(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[a]}"`));return Object(l.a)(n)&&(e=n+i),e}function Nye(e){let t=e.indexOf("xmlns:");const n=e.indexOf(">",t);let i,r,o;for(;-1!==t&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),-1!==t?(o=e.indexOf('"',e.indexOf('"',t)+1),t=(e=e.slice(0,t-1)+e.slice(o+1,e.length)).indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}function Bye(e,t){const n=Object(c.a)(xye.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new i.Data64URIWriter(n))).then((function(n){t[e.filename]=n}))}function Fye(e,t,n,i){const r=i.keys,o=new rc.a("."),a=e.querySelectorAll(t);for(let e=0;e<a.length;e++){const s=a[e],c=s.getAttribute(n),l=new rc.a(c).absoluteTo(o).toString(),u=r.indexOf(l);if(-1!==u){const e=r[u];s.setAttribute(n,i[e]),"a"===t&&null===s.getAttribute("download")&&s.setAttribute("download",e)}}}function zye(e,t,n,i){const r=e.querySelectorAll(t);for(let e=0;e<r.length;e++){const t=r[e],o=$ye(t.getAttribute(n),i);t.setAttribute(n,o.url)}}function kye(e,t,n){let i=qye(e,"id");i=Object(l.a)(i)&&0!==i.length?i:fy(),Object(l.a)(n)&&(i=n+i);let r=t.getById(i);return Object(l.a)(r)&&(i=fy(),Object(l.a)(n)&&(i=n+i)),r=t.add(new Yk({id:i})),Object(l.a)(r.kml)||(r.addProperty("kml"),r.kml=new Ube),r}function Uye(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function Vye(e,t){if(!Object(l.a)(e))return O.fromDegrees(0,0,0,t);const n=e.match(/[^\s,\n]+/g);if(!Object(l.a)(n))return O.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,O.fromDegrees(i,r,o,t)}function Hye(e,t){if(!Object(l.a)(e))return;const n=e.textContent.match(/[^\s\n]+/g);if(!Object(l.a)(n))return;const i=n.length,r=new Array(i);let o=0;for(let e=0;e<i;e++)r[o++]=Vye(n[e],t);return r}function Gye(e,t){if(!Object(l.a)(e))return;const n=e.getAttribute(t);if(null!==n){const e=parseFloat(n);return isNaN(e)?void 0:e}}function qye(e,t){if(!Object(l.a)(e))return;const n=e.getAttribute(t);return null!==n?n:void 0}function Wye(e,t,n){if(!Object(l.a)(e))return;const i=e.childNodes,r=i.length;for(let e=0;e<r;e++){const r=i[e];if(r.localName===t&&-1!==n.indexOf(r.namespaceURI))return r}}function Yye(e,t,n){if(!Object(l.a)(e))return;const i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let e=0;e<o;e++){const o=r[e];o.localName===t&&-1!==n.indexOf(o.namespaceURI)&&i.push(o)}return i}function Xye(e,t,n){if(!Object(l.a)(e))return[];const i=[],r=e.childNodes,o=r.length;for(let e=0;e<o;e++){const o=r[e];o.localName===t&&-1!==n.indexOf(o.namespaceURI)&&i.push(o)}return i}function Kye(e,t,n){const i=Wye(e,t,n);if(Object(l.a)(i)){const e=parseFloat(i.textContent);return isNaN(e)?void 0:e}}function Jye(e,t,n){const i=Wye(e,t,n);if(Object(l.a)(i))return i.textContent.trim()}function Zye(e,t,n){const i=Wye(e,t,n);if(Object(l.a)(i)){const e=i.textContent.trim();return"1"===e||/^true$/i.test(e)}}function $ye(e,t,n){if(!Object(l.a)(e))return;let i;if(Object(l.a)(n)){let r=n[e=e.replace(/\\/g,"/")];if(Object(l.a)(r))i=new Tt.a({url:r});else{const o=new rc.a(t.getUrlComponent());r=n[new rc.a(e).absoluteTo(o)],Object(l.a)(r)&&(i=new Tt.a({url:r}))}}return Object(l.a)(i)||(i=t.getDerivedResource({url:e})),i}Object.defineProperties(Mye.prototype,{dataSource:{get:function(){return this._dataSource}}}),Mye.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0},Mye.prototype.addPromise=function(e){this._promises.push(e)},Mye.prototype.wait=function(){const e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])},Mye.prototype.process=function(){const e=1===this._stack.length;return e&&(this._started=Fbe._getTimestamp()),this._process(e)},Mye.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;const e=this;setTimeout((function(){e._timeoutSet=!1,e._started=Fbe._getTimestamp(),e._process(!0)}),0)},Mye.prototype._nextNode=function(){const e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]},Mye.prototype._pop=function(){const e=this._stack;return e.pop(),0!==e.length||(this._deferred.resolve(),!1)},Mye.prototype._process=function(e){const t=this.dataSource,n=this._stack[this._stack.length-1].processingData;let i=this._nextNode();for(;Object(l.a)(i);){const e=jye[i.localName];if(Object(l.a)(e)&&(-1!==Rye.kml.indexOf(i.namespaceURI)||-1!==Rye.gx.indexOf(i.namespaceURI))&&(e(t,i,n,this),this._timeoutSet||Fbe._getTimestamp()>this._started+this._timeThreshold))return void this._giveUpTime();i=this._nextNode()}this._pop()&&e&&this._process(!0)};const Qye={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function ebe(e,t){if(!Object(l.a)(e)||/^\s*$/gm.test(e))return;"#"===e[0]&&(e=e.substring(1));const n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Qye.maximumRed=o,Qye.red=void 0):(Qye.maximumRed=void 0,Qye.red=0),r>0?(Qye.maximumGreen=r,Qye.green=void 0):(Qye.maximumGreen=void 0,Qye.green=0),i>0?(Qye.maximumBlue=i,Qye.blue=void 0):(Qye.maximumBlue=void 0,Qye.blue=0),Qye.alpha=n,sp.fromRandom(Qye)):new sp(o,r,i,n)}function tbe(e,t,n){const i=Jye(e,t,n);if(Object(l.a)(i))return ebe(i,"random"===Jye(e,"colorMode",n))}function nbe(){const e=new GP;return e.width=32,e.height=32,e.scaleByDistance=new TE(2414016,1,16093e3,.1),e.pixelOffsetScaleByDistance=new TE(2414016,1,16093e3,.1),e}function ibe(){const e=new Ik;return e.outline=!0,e.outlineColor=sp.WHITE,e}function rbe(){const e=new uk;return e.translucencyByDistance=new TE(3e6,1,5e6,0),e.pixelOffset=new Vt(17,0),e.horizontalOrigin=WP.LEFT,e.font="16px sans-serif",e.style=L0.FILL_AND_OUTLINE,e}function obe(e,t,n,i,r){let o=Jye(e,"href",Rye.kml);if(!Object(l.a)(o)||0===o.length)return;if(0===o.indexOf("root://icons/palette-")){const t=o.charAt(21);let n=Object(c.a)(Kye(e,"x",Rye.gx),0),i=Object(c.a)(Kye(e,"y",Rye.gx),0);n=Math.min(n/32,7),i=7-Math.min(i/32,7);o=`https://maps.google.com/mapfiles/kml/pal${t}/icon${8*i+n}.png`}const a=$ye(o,n,i);if(r){const n=Jye(e,"refreshMode",Rye.kml),i=Jye(e,"viewRefreshMode",Rye.kml);"onInterval"===n||"onExpire"===n?cl("kml-refreshMode-"+n,"KML - Unsupported Icon refreshMode: "+n):"onStop"!==i&&"onRegion"!==i||cl("kml-refreshMode-"+i,"KML - Unsupported Icon viewRefreshMode: "+i);const r=Object(c.a)(Jye(e,"viewBoundScale",Rye.kml),1),o="onStop"===i?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",s=Object(c.a)(Jye(e,"viewFormat",Rye.kml),o),u=Jye(e,"httpQuery",Rye.kml);Object(l.a)(s)&&a.setQueryParameters(Object(MC.a)(Ibe(s))),Object(l.a)(u)&&a.setQueryParameters(Object(MC.a)(Ibe(u)));const h=t._ellipsoid;return Mbe(a,t.camera,t.canvas,r,t._lastCameraView.bbox,h),a}return a}function abe(e,t,n,i,r){let o=Kye(t,"scale",Rye.kml);const a=Kye(t,"heading",Rye.kml),s=tbe(t,"color",Rye.kml),u=Wye(t,"Icon",Rye.kml);let d=obe(u,e,i,r,!1);Object(l.a)(u)&&!Object(l.a)(d)&&(d=!1);const f=Kye(u,"x",Rye.gx),p=Kye(u,"y",Rye.gx),m=Kye(u,"w",Rye.gx),g=Kye(u,"h",Rye.gx),_=Wye(t,"hotSpot",Rye.kml),y=Gye(_,"x"),b=Gye(_,"y"),v=qye(_,"xunits"),w=qye(_,"yunits");let A,E,T=n.billboard;Object(l.a)(T)||(T=nbe(),n.billboard=T),T.image=d,T.scale=o,T.color=s,(Object(l.a)(f)||Object(l.a)(p)||Object(l.a)(m)||Object(l.a)(g))&&(T.imageSubRegion=new Nl(f,p,m,g)),Object(l.a)(a)&&0!==a&&(T.rotation=h.a.toRadians(-a),T.alignedAxis=O.UNIT_Z),o=Object(c.a)(o,1),Object(l.a)(y)&&("pixels"===v?A=-y*o:"insetPixels"===v?A=(y-32)*o:"fraction"===v&&(A=32*-y*o),A+=16*o),Object(l.a)(b)&&("pixels"===w?E=b*o:"insetPixels"===w?E=(32-b)*o:"fraction"===w&&(E=32*b*o),E-=16*o),(Object(l.a)(A)||Object(l.a)(E))&&(T.pixelOffset=new Vt(A,E))}function sbe(e,t,n,i,r){for(let o=0,a=t.childNodes.length;o<a;o++){const a=t.childNodes.item(o);if("IconStyle"===a.localName)abe(e,a,n,i,r);else if("LabelStyle"===a.localName){let e=n.label;Object(l.a)(e)||(e=rbe(),n.label=e),e.scale=Object(c.a)(Kye(a,"scale",Rye.kml),e.scale),e.fillColor=Object(c.a)(tbe(a,"color",Rye.kml),e.fillColor),e.text=n.name}else if("LineStyle"===a.localName){let e=n.polyline;Object(l.a)(e)||(e=new Dk,n.polyline=e),e.width=Kye(a,"width",Rye.kml),e.material=tbe(a,"color",Rye.kml),Object(l.a)(tbe(a,"outerColor",Rye.gx))&&cl("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),Object(l.a)(Kye(a,"outerWidth",Rye.gx))&&cl("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),Object(l.a)(Kye(a,"physicalWidth",Rye.gx))&&cl("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),Object(l.a)(Zye(a,"labelVisibility",Rye.gx))&&cl("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===a.localName){let e=n.polygon;Object(l.a)(e)||(e=ibe(),n.polygon=e),e.material=Object(c.a)(tbe(a,"color",Rye.kml),e.material),e.fill=Object(c.a)(Zye(a,"fill",Rye.kml),e.fill),e.outline=Object(c.a)(Zye(a,"outline",Rye.kml),e.outline)}else if("BalloonStyle"===a.localName){const e=Object(c.a)(ebe(Jye(a,"bgColor",Rye.kml)),sp.WHITE),t=Object(c.a)(ebe(Jye(a,"textColor",Rye.kml)),sp.BLACK),i=Jye(a,"text",Rye.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:e,textColor:t,text:i}}else if("ListStyle"===a.localName){const e=Jye(a,"listItemType",Rye.kml);"radioFolder"!==e&&"checkOffOnly"!==e||cl("kml-listStyle-"+e,"KML - Unsupported ListStyle with listItemType: "+e)}}}function cbe(e,t,n){return t.fetchXML().then((function(i){return lbe(e,i,n,t,!0)}))}function lbe(e,t,n,i,r,o){let a,s,c,u;const h=Yye(t,"Style",Rye.kml);if(Object(l.a)(h)){const t=h.length;for(a=0;a<t;a++)u=h[a],s=qye(u,"id"),Object(l.a)(s)&&(s="#"+s,r&&Object(l.a)(i)&&(s=i.getUrlComponent()+s),Object(l.a)(n.getById(s))||(c=new Yk({id:s}),n.add(c),sbe(e,u,c,i,o)))}const d=Yye(t,"StyleMap",Rye.kml);if(Object(l.a)(d)){const t=d.length;for(a=0;a<t;a++){const t=d[a];if(s=qye(t,"id"),Object(l.a)(s)){const a=Xye(t,"Pair",Rye.kml);for(let t=0;t<a.length;t++){const h=a[t],d=Jye(h,"key",Rye.kml);if("normal"===d){if(s="#"+s,r&&Object(l.a)(i)&&(s=i.getUrlComponent()+s),!Object(l.a)(n.getById(s))){c=n.getOrCreateEntity(s);let t=Jye(h,"styleUrl",Rye.kml);if(Object(l.a)(t)){"#"!==t[0]&&(t="#"+t),r&&Object(l.a)(i)&&(t=i.getUrlComponent()+t);const e=n.getById(t);Object(l.a)(e)&&c.merge(e)}else u=Wye(h,"Style",Rye.kml),sbe(e,u,c,i,o)}}else cl("kml-styleMap-"+d,"KML - Unsupported StyleMap key: "+d)}}}}const f=[],p=t.getElementsByTagName("styleUrl"),m=p.length;for(a=0;a<m;a++){const t=p[a].textContent;if("#"!==t[0]){const r=t.split("#");if(2===r.length){const t=r[0],o=i.getDerivedResource({url:t});f.push(cbe(e,o,n))}}}return f}function ube(e,t,n){const i=new Pae(e,t.id,["position"]),r=new the(t.position);t.polyline=Object(l.a)(n.polyline)?n.polyline.clone():new Dk,t.polyline.positions=new Tae([i,r])}function hbe(e,t){return!Object(l.a)(e)&&!Object(l.a)(t)||"clampToGround"===e?qP.CLAMP_TO_GROUND:"relativeToGround"===e?qP.RELATIVE_TO_GROUND:"absolute"===e?qP.NONE:"clampToSeaFloor"===t?(cl("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),qP.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(cl("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),qP.RELATIVE_TO_GROUND):(Object(l.a)(e)?cl("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):cl("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),qP.CLAMP_TO_GROUND)}function dbe(e,t,n){return"relativeToSeaFloor"===n||"absolute"===t||"relativeToGround"===t?e:((Object(l.a)(t)&&"clampToGround"!==t||Object(l.a)(n)&&"clampToSeaFloor"!==n)&&cl("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+Object(c.a)(t,n)),new the(e))}function fbe(e,t,n,i){let r=t.label;Object(l.a)(r)||(r=Object(l.a)(n.label)?n.label.clone():rbe(),t.label=r),r.text=t.name;let o=t.billboard;Object(l.a)(o)||(o=Object(l.a)(n.billboard)?n.billboard.clone():nbe(),t.billboard=o),Object(l.a)(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(sp.YELLOW,64);let a=1;Object(l.a)(o.scale)&&(a=o.scale.getValue(),0!==a?r.pixelOffset=new Vt(16*a+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)),Object(l.a)(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function pbe(e,t){let n=e.path;Object(l.a)(n)||(n=new Ak,n.leadTime=0,e.path=n);const i=t.polyline;Object(l.a)(i)&&(n.material=i.material,n.width=i.width)}function mbe(e,t,n,i,r){const o=Wye(n,"coordinates",Rye.kml),a=Jye(n,"altitudeMode",Rye.kml),s=Jye(n,"altitudeMode",Rye.gx),u=Zye(n,"extrude",Rye.kml),h=Zye(n,"tessellate",Rye.kml),d=Uye(a,s),f=Kye(n,"drawOrder",Rye.gx),p=e._ellipsoid,m=Hye(o,p);let g=r.polyline;if(d&&u){const e=new Bk;i.wall=e,e.positions=m;const t=r.polygon;Object(l.a)(t)&&(e.fill=t.fill,e.material=t.material),e.outline=!0,Object(l.a)(g)?(e.outlineColor=Object(l.a)(g.material)?g.material.color:sp.WHITE,e.outlineWidth=g.width):Object(l.a)(t)&&(e.outlineColor=Object(l.a)(t.material)?t.material.color:sp.WHITE)}else if(e._clampToGround&&!d&&h){const e=new Dk;e.clampToGround=!0,i.polyline=e,e.positions=m,Object(l.a)(g)?(e.material=Object(l.a)(g.material)?g.material.color.getValue(JA.MINIMUM_VALUE):sp.WHITE,e.width=Object(c.a)(g.width,1)):(e.material=sp.WHITE,e.width=1),e.zIndex=f}else Object(l.a)(f)&&cl("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!h&&cl("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),g=Object(l.a)(g)?g.clone():new Dk,i.polyline=g,g.positions=function(e,t,n,i){if(!Object(l.a)(e))return;if("relativeToSeaFloor"===n||"absolute"===t||"relativeToGround"===t)return e;(Object(l.a)(t)&&"clampToGround"!==t||Object(l.a)(n)&&"clampToSeaFloor"!==n)&&cl("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+Object(c.a)(t,n));const r=e.length;for(let t=0;t<r;t++){const n=e[t];i.scaleToGeodeticSurface(n,n)}return e}(m,a,s,p),h&&!d||(g.arcType=vl.NONE);return!0}function gbe(e,t,n,i,r,o,a,s,c){const l=e[0],u=e[e.length-1],h=new Vae;h.addSamples(e,t),n.intervals.addInterval(new YA({start:l,stop:u,isStartIncluded:c,isStopIncluded:c,data:dbe(h,a,s)})),i.addInterval(new YA({start:l,stop:u,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new YA({start:l,stop:u,isStartIncluded:c,isStopIncluded:c,data:o}))}const _be={Point:function(e,t,n,i,r){const o=Jye(n,"coordinates",Rye.kml),a=Jye(n,"altitudeMode",Rye.kml),s=Jye(n,"altitudeMode",Rye.gx),c=Zye(n,"extrude",Rye.kml),l=Vye(o,e._ellipsoid);return i.position=l,fbe(e,i,r,hbe(a,s)),c&&Uye(a,s)&&ube(t,i,r),!0},LineString:mbe,LinearRing:mbe,Polygon:function(e,t,n,i,r){const o=Wye(n,"outerBoundaryIs",Rye.kml);let a=Wye(o,"LinearRing",Rye.kml),s=Wye(a,"coordinates",Rye.kml);const c=e._ellipsoid;let u=Hye(s,c);const h=Zye(n,"extrude",Rye.kml),d=Uye(Jye(n,"altitudeMode",Rye.kml),Jye(n,"altitudeMode",Rye.gx)),f=Object(l.a)(r.polygon)?r.polygon.clone():ibe(),p=r.polyline;if(Object(l.a)(p)&&(f.outlineColor=Object(l.a)(p.material)?p.material.color:sp.WHITE,f.outlineWidth=p.width),i.polygon=f,d?(f.perPositionHeight=!0,f.extrudedHeight=h?0:void 0):e._clampToGround||(f.height=0),Object(l.a)(u)){const e=new QT(u),t=Xye(n,"innerBoundaryIs",Rye.kml);for(let n=0;n<t.length;n++){a=Xye(t[n],"LinearRing",Rye.kml);for(let t=0;t<a.length;t++)s=Wye(a[t],"coordinates",Rye.kml),u=Hye(s,c),Object(l.a)(u)&&e.holes.push(new QT(u))}f.hierarchy=e}return!0},Track:function(e,t,n,i,r){const o=Jye(n,"altitudeMode",Rye.kml),a=Jye(n,"altitudeMode",Rye.gx),s=Xye(n,"coord",Rye.gx),c=Xye(n,"angles",Rye.gx),l=Xye(n,"when",Rye.kml),u=Zye(n,"extrude",Rye.kml),h=Uye(o,a),d=e._ellipsoid;c.length>0&&cl("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");const f=Math.min(s.length,l.length),p=[],m=[];for(let e=0;e<f;e++){const t=Vye(s[e].textContent,d);p.push(t),m.push(tr.fromIso8601(l[e].textContent))}const g=new Vae;return g.addSamples(m,p),i.position=g,fbe(e,i,r,hbe(o,a)),pbe(i,r),i.availability=new YI,l.length>0&&i.availability.addInterval(new YA({start:m[0],stop:m[m.length-1]})),h&&u&&ube(t,i,r),!0},MultiTrack:function(e,t,n,i,r){const o=Zye(n,"interpolate",Rye.gx),a=Xye(n,"Track",Rye.gx);let s,c,u,h=!1;const d=new $ae,f=new YI,p=new Ore,m=e._ellipsoid;for(let e=0,t=a.length;e<t;e++){const t=a[e],n=Xye(t,"when",Rye.kml),i=Xye(t,"coord",Rye.gx),r=Jye(t,"altitudeMode",Rye.kml),g=Jye(t,"altitudeMode",Rye.gx),_=Uye(r,g),y=Zye(t,"extrude",Rye.kml),b=Math.min(i.length,n.length),v=[];s=[];for(let e=0;e<b;e++){const t=Vye(i[e].textContent,m);v.push(t),s.push(tr.fromIso8601(n[e].textContent))}o&&(Object(l.a)(c)&&gbe([c,s[0]],[u,v[0]],p,f,d,!1,"absolute",void 0,!1),c=s[b-1],u=v[v.length-1]),gbe(s,v,p,f,d,_&&y,r,g,!0),h=h||_&&y}return i.availability=f,i.position=p,fbe(e,i,r),pbe(i,r),h&&(ube(t,i,r),i.polyline.show=d),!0},MultiGeometry:function(e,t,n,i,r,o){const a=n.childNodes;let s=!1;for(let n=0,c=a.length;n<c;n++){const c=a.item(n),u=_be[c.localName];if(Object(l.a)(u)){const n=kye(c,t,o);n.parent=i,n.name=i.name,n.availability=i.availability,n.description=i.description,n.kml=i.kml,u(e,t,c,n,r)&&(s=!0)}}return s},Model:function(e,t,n,i,r){return cl("kml-unsupportedGeometry","KML - Unsupported geometry: "+n.localName),!1}};let ybe;function bbe(e,t,n){const i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,a=n.uriResolver,s=kye(t,i,n.context),u=s.kml,h=function(e,t,n,i,r){const o=new Yk;let a,s=-1;const c=t.childNodes,u=c.length;for(let e=0;e<u;e++){const t=c[e];"Style"!==t.localName&&"StyleMap"!==t.localName||(s=e)}if(-1!==s){const t=c[s];if("Style"===t.localName)sbe(e,t,o,i,r);else{const s=Xye(t,"Pair",Rye.kml);for(let t=0;t<s.length;t++){const c=s[t],u=Jye(c,"key",Rye.kml);if("normal"===u){const t=Jye(c,"styleUrl",Rye.kml);if(Object(l.a)(t))a=n.getById(t),Object(l.a)(a)||(a=n.getById("#"+t)),Object(l.a)(a)&&o.merge(a);else{sbe(e,Wye(c,"Style",Rye.kml),o,i,r)}}else cl("kml-styleMap-"+u,"KML - Unsupported StyleMap key: "+u)}}}const h=Jye(t,"styleUrl",Rye.kml);if(Object(l.a)(h)){let e=h;if("#"!==h[0]&&-1!==h.indexOf("#")){const t=h.split("#"),n=t[0];e=`${i.getDerivedResource({url:n}).getUrlComponent()}#${t[1]}`}a=n.getById(e),Object(l.a)(a)||(a=n.getById("#"+e)),Object(l.a)(a)&&o.merge(a)}return o}(e,t,n.styleCollection,o,a),d=Jye(t,"name",Rye.kml);s.name=d,s.parent=r;let f=function(e){const t=Wye(e,"TimeSpan",Rye.kmlgx);if(!Object(l.a)(t))return;let n;const i=Wye(t,"begin",Rye.kmlgx);let r=Object(l.a)(i)?tr.fromIso8601(i.textContent):void 0;const o=Wye(t,"end",Rye.kmlgx);let a=Object(l.a)(o)?tr.fromIso8601(o.textContent):void 0;if(Object(l.a)(r)&&Object(l.a)(a)){if(tr.lessThan(a,r)){const e=r;r=a,a=e}n=new YI,n.addInterval(new YA({start:r,stop:a}))}else Object(l.a)(r)?(n=new YI,n.addInterval(new YA({start:r,stop:JA.MAXIMUM_VALUE}))):Object(l.a)(a)&&(n=new YI,n.addInterval(new YA({start:JA.MINIMUM_VALUE,stop:a})));return n}(t);Object(l.a)(f)||(f=function(e){const t=Wye(e,"TimeStamp",Rye.kmlgx),n=Jye(t,"when",Rye.kmlgx);if(!Object(l.a)(t)||!Object(l.a)(n)||0===n.length)return;const i=tr.fromIso8601(n),r=new YI;return r.addInterval(new YA({start:i,stop:JA.MAXIMUM_VALUE})),r}(t)),s.availability=f,zbe(s);const p=Zye(t,"visibility",Rye.kml);s.show=function e(t){return!t||t.show&&e(t.parent)}(r)&&Object(c.a)(p,!0);const m=Wye(t,"author",Rye.atom),g=u.author;g.name=Jye(m,"name",Rye.atom),g.uri=Jye(m,"uri",Rye.atom),g.email=Jye(m,"email",Rye.atom);const _=Wye(t,"link",Rye.atom),y=u.link;y.href=qye(_,"href"),y.hreflang=qye(_,"hreflang"),y.rel=qye(_,"rel"),y.type=qye(_,"type"),y.title=qye(_,"title"),y.length=qye(_,"length"),u.address=Jye(t,"address",Rye.kml),u.phoneNumber=Jye(t,"phoneNumber",Rye.kml),u.snippet=Jye(t,"Snippet",Rye.kml),function(e,t){const n=Wye(e,"ExtendedData",Rye.kml);if(!Object(l.a)(n))return;Object(l.a)(Wye(n,"SchemaData",Rye.kml))&&cl("kml-schemaData","KML - SchemaData is unsupported"),Object(l.a)(qye(n,"xmlns:prefix"))&&cl("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");const i={},r=Xye(n,"Data",Rye.kml);if(Object(l.a)(r)){const e=r.length;for(let t=0;t<e;t++){const e=r[t],n=qye(e,"name");Object(l.a)(n)&&(i[n]={displayName:Jye(e,"displayName",Rye.kml),value:Jye(e,"value",Rye.kml)})}}t.kml.extendedData=i}(t,s),function(e,t,n,i,r){let o,a,s;const u=t.kml,h=u.extendedData,d=Jye(e,"description",Rye.kml),f=Object(c.a)(t.balloonStyle,n.balloonStyle);let p,m=sp.WHITE,g=sp.BLACK,_=d;if(Object(l.a)(f)&&(m=Object(c.a)(f.bgColor,sp.WHITE),g=Object(c.a)(f.textColor,sp.BLACK),_=Object(c.a)(f.text,d)),Object(l.a)(_)){if(_=_.replace("$[name]",Object(c.a)(t.name,"")),_=_.replace("$[description]",Object(c.a)(d,"")),_=_.replace("$[address]",Object(c.a)(u.address,"")),_=_.replace("$[Snippet]",Object(c.a)(u.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),Object(l.a)(h)){const e=_.match(/\$\[.+?\]/g);if(null!==e)for(o=0;o<e.length;o++){const t=e[o];let n=t.substr(2,t.length-3);const i=/\/displayName$/.test(n);n=n.replace(/\/displayName$/,""),p=h[n],Object(l.a)(p)&&(p=i?p.displayName:p.value),Object(l.a)(p)&&(_=_.replace(t,Object(c.a)(p,"")))}}}else if(Object(l.a)(h)&&(s=Object.keys(h),s.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<s.length;o++)a=s[o],p=h[a],_+=`<tr><th>${Object(c.a)(p.displayName,a)}</th><td>${Object(c.a)(p.value,"")}</td></tr>`;_+="</tbody></table>"}if(!Object(l.a)(_))return;_=Iye.link(_),ybe.innerHTML=_;const y=ybe.querySelectorAll("a");for(o=0;o<y.length;o++)y[o].setAttribute("target","_blank");Object(l.a)(i)&&i.keys.length>1&&(Fye(ybe,"a","href",i),Fye(ybe,"link","href",i),Fye(ybe,"area","href",i),Fye(ybe,"img","src",i),Fye(ybe,"iframe","src",i),Fye(ybe,"video","src",i),Fye(ybe,"audio","src",i),Fye(ybe,"source","src",i),Fye(ybe,"track","src",i),Fye(ybe,"input","src",i),Fye(ybe,"embed","src",i),Fye(ybe,"script","src",i),Fye(ybe,"video","poster",i)),zye(ybe,"a","href",r),zye(ybe,"link","href",r),zye(ybe,"area","href",r),zye(ybe,"img","src",r),zye(ybe,"iframe","src",r),zye(ybe,"video","src",r),zye(ybe,"audio","src",r),zye(ybe,"source","src",r),zye(ybe,"track","src",r),zye(ybe,"input","src",r),zye(ybe,"embed","src",r),zye(ybe,"script","src",r),zye(ybe,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${m.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=ybe.innerHTML+"</div>",ybe.innerHTML="",t.description=b}(t,s,h,a,o);const b=e._ellipsoid;return Ebe(t,s,b),Abe(t,s,b),Object(l.a)(Wye(t,"Region",Rye.kml))&&cl("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:h}}function vbe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}"undefined"!=typeof document&&(ybe=document.createElement("div"));const Obe={FlyTo:function(e,t,n){const i=Kye(t,"duration",Rye.gx),r=Jye(t,"flyToMode",Rye.gx),o={kml:{}};Ebe(t,o,n),Abe(t,o,n);const a=o.kml.lookAt||o.kml.camera,s=new Eye(i,r,a);e.addPlaylistEntry(s)},Wait:function(e,t){const n=Kye(t,"duration",Rye.gx);e.addPlaylistEntry(new Cye(n))},SoundCue:wbe,AnimatedUpdate:wbe,TourControl:wbe};function wbe(e,t){cl("KML Tour unsupported node "+t.localName)}function Abe(e,t,n){const i=Wye(e,"Camera",Rye.kml);if(Object(l.a)(i)){const e=Object(c.a)(Kye(i,"longitude",Rye.kml),0),r=Object(c.a)(Kye(i,"latitude",Rye.kml),0),o=Object(c.a)(Kye(i,"altitude",Rye.kml),0),a=Object(c.a)(Kye(i,"heading",Rye.kml),0),s=Object(c.a)(Kye(i,"tilt",Rye.kml),0),l=Object(c.a)(Kye(i,"roll",Rye.kml),0),u=O.fromDegrees(e,r,o,n),h=ur.fromDegrees(a,s-90,l);t.kml.camera=new mye(u,h)}}function Ebe(e,t,n){const i=Wye(e,"LookAt",Rye.kml);if(Object(l.a)(i)){const e=Object(c.a)(Kye(i,"longitude",Rye.kml),0),r=Object(c.a)(Kye(i,"latitude",Rye.kml),0),o=Object(c.a)(Kye(i,"altitude",Rye.kml),0);let a=Kye(i,"heading",Rye.kml),s=Kye(i,"tilt",Rye.kml);const l=Object(c.a)(Kye(i,"range",Rye.kml),0);s=h.a.toRadians(Object(c.a)(s,0)),a=h.a.toRadians(Object(c.a)(a,0));const u=new uA(a,s-h.a.PI_OVER_TWO,l),d=O.fromDegrees(e,r,o,n);t.kml.lookAt=new _ye(d,u)}}function Tbe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),cl("kml-unsupportedFeature-"+t.nodeName,"KML - Unsupported feature: "+t.nodeName)}const Cbe=0,xbe=1,Sbe=2;function Ibe(e){if(!Object(l.a)(e)||0===e.length)return"";const t=e[0];return"&"!==t&&"?"!==t||(e=e.substring(1)),e}const Pbe=new Be,Dbe=new R,Rbe=new Vt,jbe=new O;function Mbe(e,t,n,i,r,o){function a(e){return e<-h.a.PI_OVER_TWO?-h.a.PI_OVER_TWO:e>h.a.PI_OVER_TWO?h.a.PI_OVER_TWO:e}function s(e){return e>h.a.PI?e-h.a.TWO_PI:e<-h.a.PI?e+h.a.TWO_PI:e}let u=Object(CE.a)(e.queryParameters);if(u=u.replace(/%5B/g,"[").replace(/%5D/g,"]"),Object(l.a)(t)&&t._mode!==AB.MORPHING){let e,d;if(r=Object(c.a)(r,Pbe),Object(l.a)(n)&&(Rbe.x=.5*n.clientWidth,Rbe.y=.5*n.clientHeight,e=t.pickEllipsoid(Rbe,o,jbe)),Object(l.a)(e)?d=o.cartesianToCartographic(e,Dbe):(d=Be.center(r,Dbe),e=o.cartographicToCartesian(d)),Object(l.a)(i)&&!h.a.equalsEpsilon(i,1,h.a.EPSILON9)){const e=r.width*i*.5,t=r.height*i*.5;r=new Be(s(d.longitude-e),a(d.latitude-t),s(d.longitude+e),a(d.latitude+t))}u=u.replace("[bboxWest]",h.a.toDegrees(r.west).toString()),u=u.replace("[bboxSouth]",h.a.toDegrees(r.south).toString()),u=u.replace("[bboxEast]",h.a.toDegrees(r.east).toString()),u=u.replace("[bboxNorth]",h.a.toDegrees(r.north).toString());const f=h.a.toDegrees(d.longitude).toString(),p=h.a.toDegrees(d.latitude).toString();u=u.replace("[lookatLon]",f),u=u.replace("[lookatLat]",p),u=u.replace("[lookatTilt]",h.a.toDegrees(t.pitch).toString()),u=u.replace("[lookatHeading]",h.a.toDegrees(t.heading).toString()),u=u.replace("[lookatRange]",O.distance(t.positionWC,e)),u=u.replace("[lookatTerrainLon]",f),u=u.replace("[lookatTerrainLat]",p),u=u.replace("[lookatTerrainAlt]",d.height.toString()),o.cartesianToCartographic(t.positionWC,Dbe),u=u.replace("[cameraLon]",h.a.toDegrees(Dbe.longitude).toString()),u=u.replace("[cameraLat]",h.a.toDegrees(Dbe.latitude).toString()),u=u.replace("[cameraAlt]",h.a.toDegrees(Dbe.height).toString());const m=t.frustum,g=m.aspectRatio;let _="",y="";if(Object(l.a)(g)){const e=h.a.toDegrees(m.fov);g>1?(_=e,y=e/g):(y=e,_=e*g)}u=u.replace("[horizFov]",_.toString()),u=u.replace("[vertFov]",y.toString())}else u=u.replace("[bboxWest]","-180"),u=u.replace("[bboxSouth]","-90"),u=u.replace("[bboxEast]","180"),u=u.replace("[bboxNorth]","90"),u=u.replace("[lookatLon]",""),u=u.replace("[lookatLat]",""),u=u.replace("[lookatRange]",""),u=u.replace("[lookatTilt]",""),u=u.replace("[lookatHeading]",""),u=u.replace("[lookatTerrainLon]",""),u=u.replace("[lookatTerrainLat]",""),u=u.replace("[lookatTerrainAlt]",""),u=u.replace("[cameraLon]",""),u=u.replace("[cameraLat]",""),u=u.replace("[cameraAlt]",""),u=u.replace("[horizFov]",""),u=u.replace("[vertFov]","");Object(l.a)(n)?(u=u.replace("[horizPixels]",n.clientWidth),u=u.replace("[vertPixels]",n.clientHeight)):(u=u.replace("[horizPixels]",""),u=u.replace("[vertPixels]","")),u=u.replace("[terrainEnabled]","1"),u=u.replace("[clientVersion]","1"),u=u.replace("[kmlVersion]","2.2"),u=u.replace("[clientName]","Cesium"),u=u.replace("[language]","English"),e.setQueryParameters(Object(MC.a)(u))}function Lbe(e,t,n,i,r,o,a){t.removeAll();const s=n.documentElement;let c=Jye("Document"===s.localName?s:Wye(s,"Document",Rye.kml),"name",Rye.kml);Object(l.a)(c)||(c=Yv(i.getUrlComponent())),Object(l.a)(e._name)||(e._name=c);const u=new Fbe._DeferredLoading(e),h=new ore(e);return Promise.all(lbe(e,n,h,i,!1,r)).then((function(){let s=n.documentElement;if("kml"===s.localName){const e=s.childNodes;for(let t=0;t<e.length;t++){const n=e[t];if(Object(l.a)(jye[n.localName])){s=n;break}}}const c={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:r,context:a,screenOverlayContainer:o};return t.suspendEvents(),function(e,t,n,i){const r=jye[t.localName];Object(l.a)(r)?r(e,t,n,i):Tbe(e,t,n)}(e,s,c,u),t.resumeEvents(),u.wait().then((function(){return n.documentElement}))}))}function Nbe(e,t,n,r,o){const a=Lt("ThirdParty/Workers/z-worker-pako.js");i.configure({workerScripts:{deflate:[a,"./pako_deflate.min.js"],inflate:[a,"./pako_inflate.min.js"]}});const s=new i.ZipReader(new i.BlobReader(n));return Promise.resolve(s.getEntries()).then((function(n){const a=[],c={};let u;for(let e=0;e<n.length;e++){const t=n[e];t.directory||(/\.kml$/i.test(t.filename)?Object(l.a)(u)&&/\//i.test(t.filename)?a.push(Bye(t,c)):(Object(l.a)(u)&&a.push(Bye(u,c)),u=t):a.push(Bye(t,c)))}return Object(l.a)(u)&&a.push(function(e,t){return Promise.resolve(e.getData(new i.TextWriter)).then((function(e){e=Nye(e=Lye(e)),t.kml=Sye.parseFromString(e,"application/xml")}))}(u,c)),Promise.all(a).then((function(){if(s.close(),!Object(l.a)(c.kml))throw new ye.a("KMZ file does not contain a KML document.");return c.keys=Object.keys(c),Lbe(e,t,c.kml,r,c,o)}))}))}function Bbe(e,t,n,i){let r=(i=Object(c.a)(i,c.a.EMPTY_OBJECT)).sourceUri;const o=i.uriResolver,a=i.context;let s=i.screenOverlayContainer,u=n;if("string"==typeof n||n instanceof Tt.a){u=(n=Tt.a.createIfNeeded(n)).fetchBlob(),r=Object(c.a)(r,n.clone());const t=e._resourceCredits,i=n.credits;if(Object(l.a)(i)){const e=i.length;for(let n=0;n<e;n++)t.push(i[n])}}else r=Object(c.a)(r,Tt.a.DEFAULT.clone());return r=Tt.a.createIfNeeded(r),Object(l.a)(s)&&(s=gye(s)),Promise.resolve(u).then((function(n){return n instanceof Blob?function(e){const t=e.slice(0,Math.min(4,e.size)),n=Object(oc.a)(),i=new FileReader;return i.addEventListener("load",(function(){n.resolve(1347093252===new DataView(i.result).getUint32(0,!1))})),i.addEventListener("error",(function(){n.reject(i.error)})),i.readAsArrayBuffer(t),n.promise}(n).then((function(i){return i?Nbe(e,t,n,r,s):function(e){const t=Object(oc.a)(),n=new FileReader;return n.addEventListener("load",(function(){t.resolve(n.result)})),n.addEventListener("error",(function(){t.reject(n.error)})),n.readAsText(e),t.promise}(n).then((function(n){let i,c;n=Nye(n=Lye(n));try{i=Sye.parseFromString(n,"application/xml")}catch(e){c=e.toString()}if(Object(l.a)(c)||i.body||"parsererror"===i.documentElement.tagName){let e=Object(l.a)(c)?c:i.documentElement.firstChild.nodeValue;throw e||(e=i.body.innerText),new ye.a(e)}return Lbe(e,t,i,r,o,s,a)}))})):Lbe(e,t,n,r,o,s,a)})).catch((function(t){return e._error.raiseEvent(e,t),console.log(t),Promise.reject(t)}))}function Fbe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).camera,n=e.canvas;this._changed=new un.a,this._error=new un.a,this._loading=new un.a,this._refresh=new un.a,this._unsupportedNode=new un.a,this._clock=void 0,this._entityCollection=new ore(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new nT,this._networkLinks=new Tl,this._entityCluster=new Woe,this.canvas=n,this.camera=t,this._lastCameraView={position:Object(l.a)(t)?O.clone(t.positionWC):void 0,direction:Object(l.a)(t)?O.clone(t.directionWC):void 0,up:Object(l.a)(t)?O.clone(t.upWC):void 0,bbox:Object(l.a)(t)?t.computeViewRectangle():Be.clone(Be.MAX_VALUE)},this._ellipsoid=Object(c.a)(e.ellipsoid,H.WGS84);let i=e.credit;"string"==typeof i&&(i=new ln(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}function zbe(e){const t=e.parent;if(Object(l.a)(t)){const n=t.availability;if(Object(l.a)(n)){const t=e.availability;Object(l.a)(t)?t.intersect(n):e.availability=n}}}Fbe.load=function(e,t){return new Fbe(t=Object(c.a)(t,c.a.EMPTY_OBJECT)).load(e,t)},Object.defineProperties(Fbe.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!Object(l.a)(e))throw new u.a("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}}),Fbe.prototype.load=function(e,t){if(!Object(l.a)(e))throw new u.a("data is required.");t=Object(c.a)(t,c.a.EMPTY_OBJECT),Mre.setLoading(this,!0);const n=this._name;this._name=void 0,this._clampToGround=Object(c.a)(t.clampToGround,!1);const i=this;return Bbe(this,this._entityCollection,e,t).then((function(){let e;const t=i._entityCollection.computeAvailability();let r=t.start,o=t.stop;const a=tr.equals(r,JA.MINIMUM_VALUE),s=tr.equals(o,JA.MAXIMUM_VALUE);if(!a||!s){let t;a&&(t=new Date,t.setHours(0,0,0,0),r=tr.fromDate(t)),s&&(t=new Date,t.setHours(24,0,0,0),o=tr.fromDate(t)),e=new rae,e.startTime=r,e.stopTime=o,e.currentTime=tr.clone(r),e.clockRange=qf.LOOP_STOP,e.clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(tr.secondsDifference(o,r)/60,1),31556900))}let c=!1;return e!==i._clock&&(i._clock=e,c=!0),n!==i._name&&(c=!0),c&&i._changed.raiseEvent(i),Mre.setLoading(i,!1),i})).catch((function(e){return Mre.setLoading(i,!1),i._error.raiseEvent(i,e),console.log(e),Promise.reject(e)}))},Fbe.prototype.destroy=function(){for(;this._screenOverlays.length>0;){this._screenOverlays.pop().remove()}};const kbe=new Tl;function Ube(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Fbe.prototype.update=function(e){const t=this._networkLinks;if(0===t.length)return!0;const n=tr.now(),i=this;kbe.removeAll();let r=!1;const o=this._lastCameraView,a=this.camera;!Object(l.a)(a)||a.positionWC.equalsEpsilon(o.position,h.a.EPSILON7)&&a.directionWC.equalsEpsilon(o.direction,h.a.EPSILON7)&&a.upWC.equalsEpsilon(o.up,h.a.EPSILON7)||(o.position=O.clone(a.positionWC),o.direction=O.clone(a.directionWC),o.up=O.clone(a.upWC),o.bbox=a.computeViewRectangle(),r=!0);const s=new Tl;let u=!1;return t.values.forEach((function(e){const t=e.entity;if(!kbe.contains(t.id)){if(!e.updating){let a=!1;if(e.refreshMode===Cbe?tr.secondsDifference(n,e.lastUpdated)>e.time&&(a=!0):e.refreshMode===xbe?tr.greaterThan(n,e.time)&&(a=!0):e.refreshMode===Sbe&&(r&&(e.needsUpdate=!0,e.cameraUpdateTime=n),e.needsUpdate&&tr.secondsDifference(n,e.cameraUpdateTime)>=e.time&&(a=!0)),a){!function e(t){const n=t._children,i=n.length;for(let t=0;t<i;++t){const i=n[t];kbe.set(i.id,i),e(i)}}(t),e.updating=!0;const n=new ore,r=e.href.clone();r.setQueryParameters(e.cookie);const a=Object(c.a)(i._ellipsoid,H.WGS84);Mbe(r,i.camera,i.canvas,e.viewBoundScale,o.bbox,a),Bbe(i,n,r,{context:t.id}).then(function(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let a=!1;const s=Wye(o,"NetworkLinkControl",Rye.kml);let u=0;if(Object(l.a)(s)){if(Object(l.a)(Wye(s,"Update",Rye.kml)))return cl("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void i.remove(t.id);t.cookie=Object(MC.a)(Object(c.a)(Jye(s,"cookie",Rye.kml),"")),u=Object(c.a)(Kye(s,"minRefreshPeriod",Rye.kml),0)}const h=tr.now(),d=t.refreshMode;if(d===Cbe)Object(l.a)(s)&&(t.time=Math.max(u,t.time));else if(d===xbe){let e;if(Object(l.a)(s)&&(e=Jye(s,"expires",Rye.kml)),Object(l.a)(e))try{const n=tr.fromIso8601(e),i=tr.secondsDifference(n,h);i>0&&i<u&&tr.addSeconds(h,u,n),t.time=n}catch(e){cl("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),a=!0}else cl("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),a=!0}const f=t.entity,p=e._entityCollection,m=n.values;function g(e){p.remove(e);const t=e._children,n=t.length;for(let e=0;e<n;++e)g(t[e])}p.suspendEvents();const _=p.values.slice();let y;for(y=0;y<_.length;++y){const e=_[y];e.parent===f&&(e.parent=void 0,g(e))}for(p.resumeEvents(),p.suspendEvents(),y=0;y<m.length;y++){const e=m[y];Object(l.a)(e.parent)||(e.parent=f,zbe(e)),p.add(e)}p.resumeEvents(),a?i.remove(t.id):t.lastUpdated=h;const b=p.computeAvailability(),v=b.start,O=b.stop,w=tr.equals(v,JA.MINIMUM_VALUE),A=tr.equals(O,JA.MAXIMUM_VALUE);if(!w||!A){const t=e._clock;t.startTime===v&&t.stopTime===O||(t.startTime=v,t.stopTime=O,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}(i,e,n,s,r)).catch((function(t){const n=`NetworkLink ${e.href} refresh failed: ${t}`;console.log(n),i._error.raiseEvent(i,n)})),u=!0}}s.set(e.id,e)}})),u&&(this._networkLinks=s,this._changed.raiseEvent(this)),!0},Fbe._DeferredLoading=Mye,Fbe._getTimestamp=Xf;var Vbe=Fbe;function Hbe(){u.a.throwInstantiationError()}Hbe.prototype.update=u.a.throwInstantiationError,Hbe.prototype.getBoundingSphere=u.a.throwInstantiationError,Hbe.prototype.isDestroyed=u.a.throwInstantiationError,Hbe.prototype.destroy=u.a.throwInstantiationError;var Gbe=Hbe,qbe="attribute vec4 position;\nattribute vec2 textureCoordinates;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main() \n{\n    gl_Position = position;\n    v_textureCoordinates = textureCoordinates;\n}\n";function Wbe(e){this._context=e}let Ybe;const Xbe=new XR({primitiveType:zl.TRIANGLES}),Kbe=new UU({color:new sp(0,0,0,0)});Wbe.prototype.execute=function(e){if(s.a.defined("computeCommand",e),Object(l.a)(e.preExecute)&&e.preExecute(e),!Object(l.a)(e.fragmentShaderSource)&&!Object(l.a)(e.shaderProgram))throw new u.a("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");s.a.defined("computeCommand.outputTexture",e.outputTexture);const t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=Object(l.a)(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),a=Object(l.a)(e.shaderProgram)?e.shaderProgram:function(e,t){return oM.fromCache({context:e,vertexShaderSource:qbe,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}(r,e.fragmentShaderSource),c=function(e,t){return new i$({context:e,colorTextures:[t],destroyAttachments:!1})}(r,t),h=function(e,t){return Object(l.a)(Ybe)&&Ybe.viewport.width===e&&Ybe.viewport.height===t||(Ybe=vj.fromCache({viewport:new Nl(0,0,e,t)})),Ybe}(n,i),d=e.uniformMap,f=Kbe;f.framebuffer=c,f.renderState=h,f.execute(r);const p=Xbe;p.vertexArray=o,p.renderState=h,p.shaderProgram=a,p.uniformMap=d,p.framebuffer=c,p.execute(r),c.destroy(),e.persists||(a.destroy(),Object(l.a)(e.vertexArray)&&o.destroy()),Object(l.a)(e.postExecute)&&e.postExecute(t)},Wbe.prototype.isDestroyed=function(){return!1},Wbe.prototype.destroy=function(){return sc(this)};var Jbe=Wbe;var Zbe=function(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0};function $be(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function Qbe(e,t){const n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){const i=n[r]+t.keyword;Qbe(e,e._shaders[i])}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Object.defineProperties($be.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),$be.prototype.replaceShaderProgram=function(e){return Object(l.a)(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)},$be.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource;const i=e.attributeLocations;"string"==typeof t&&(t=new UN({sources:[t]})),"string"==typeof n&&(n=new UN({sources:[n]}));const r=t.createCombinedVertexShader(this._context),o=n.createCombinedFragmentShader(this._context),a=r+o+JSON.stringify(i);let s;if(Object(l.a)(this._shaders[a]))s=this._shaders[a],delete this._shadersToRelease[a];else{const e=this._context,c=new oM({gl:e._gl,logShaderCompilation:e.logShaderCompilation,debugShaders:e.debugShaders,vertexShaderSource:t,vertexShaderText:r,fragmentShaderSource:n,fragmentShaderText:o,attributeLocations:i});s={cache:this,shaderProgram:c,keyword:a,derivedKeywords:[],count:0},c._cachedShader=s,this._shaders[a]=s,++this._numberOfShaders}return++s.count,s.shaderProgram},$be.prototype.replaceDerivedShaderProgram=function(e,t,n){const i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(Object(l.a)(o)){Qbe(this,o);const e=i.derivedKeywords.indexOf(t);e>-1&&i.derivedKeywords.splice(e,1)}return this.createDerivedShaderProgram(e,t,n)},$be.prototype.getDerivedShaderProgram=function(e,t){const n=t+e._cachedShader.keyword,i=this._shaders[n];if(Object(l.a)(i))return i.shaderProgram},$be.prototype.createDerivedShaderProgram=function(e,t,n){const i=e._cachedShader,r=t+i.keyword;let o=n.vertexShaderSource,a=n.fragmentShaderSource;const s=n.attributeLocations;"string"==typeof o&&(o=new UN({sources:[o]})),"string"==typeof a&&(a=new UN({sources:[a]}));const c=this._context,l=o.createCombinedVertexShader(c),u=a.createCombinedFragmentShader(c),h=new oM({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:l,fragmentShaderSource:a,fragmentShaderText:u,attributeLocations:s}),d={cache:this,shaderProgram:h,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=d,this._shaders[r]=d,h},$be.prototype.destroyReleasedShaderPrograms=function(){const e=this._shadersToRelease;for(const t in e)if(e.hasOwnProperty(t)){Qbe(this,e[t]),--this._numberOfShaders}this._shadersToRelease={}},$be.prototype.releaseShaderProgram=function(e){if(Object(l.a)(e)){const t=e._cachedShader;t&&0==--t.count&&(this._shadersToRelease[t.keyword]=t)}},$be.prototype.isDestroyed=function(){return!1},$be.prototype.destroy=function(){const e=this._shaders;for(const t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return sc(this)};var eve=$be;function tve(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(tve.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}}),tve.prototype.getTexture=function(e){const t=this._textures[e];if(Object(l.a)(t))return delete this._texturesToRelease[e],++t.count,t.texture},tve.prototype.addTexture=function(e,t){const n={texture:t,count:1};t.finalDestroy=t.destroy;const i=this;t.destroy=function(){0==--n.count&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures},tve.prototype.destroyReleasedTextures=function(){const e=this._texturesToRelease;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}},tve.prototype.isDestroyed=function(){return!1},tve.prototype.destroy=function(){const e=this._textures;for(const t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return sc(this)};var nve=tve;var ive=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.color=sp.clone(Object(c.a)(e.color,sp.WHITE)),this.intensity=Object(c.a)(e.intensity,2)};function rve(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Nl,this._viewportCartesian4=new _e,this._viewportDirty=!1,this._viewportOrthographicMatrix=Me.clone(Me.IDENTITY),this._viewportTransformation=Me.clone(Me.IDENTITY),this._model=Me.clone(Me.IDENTITY),this._view=Me.clone(Me.IDENTITY),this._inverseView=Me.clone(Me.IDENTITY),this._projection=Me.clone(Me.IDENTITY),this._infiniteProjection=Me.clone(Me.IDENTITY),this._entireFrustum=new Vt,this._currentFrustum=new Vt,this._frustumPlanes=new _e,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=ce.clone(Me.IDENTITY),this._view3DDirty=!0,this._view3D=new Me,this._inverseView3DDirty=!0,this._inverseView3D=new Me,this._inverseModelDirty=!0,this._inverseModel=new Me,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new ce,this._viewRotation=new ce,this._inverseViewRotation=new ce,this._viewRotation3D=new ce,this._inverseViewRotation3D=new ce,this._inverseProjectionDirty=!0,this._inverseProjection=new Me,this._modelViewDirty=!0,this._modelView=new Me,this._modelView3DDirty=!0,this._modelView3D=new Me,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new Me,this._inverseModelViewDirty=!0,this._inverseModelView=new Me,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new Me,this._viewProjectionDirty=!0,this._viewProjection=new Me,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new Me,this._modelViewProjectionDirty=!0,this._modelViewProjection=new Me,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new Me,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new Me,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new Me,this._normalDirty=!0,this._normal=new ce,this._normal3DDirty=!0,this._normal3D=new ce,this._inverseNormalDirty=!0,this._inverseNormal=new ce,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new ce,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Mh,this._cameraPosition=new O,this._sunPositionWC=new O,this._sunPositionColumbusView=new O,this._sunDirectionWC=new O,this._sunDirectionEC=new O,this._moonDirectionEC=new O,this._lightDirectionWC=new O,this._lightDirectionEC=new O,this._lightColor=new O,this._lightColorHdr=new O,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new O,this._cameraRight=new O,this._cameraUp=new O,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new Vt,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new sp,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new Vt,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(rve.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Nl.equals(e,this._viewport)){Nl.clone(e,this._viewport);const t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return lve(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return lve(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){Me.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,Me.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){const e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,Me.getMatrix3(this.inverseModel,e),ce.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return bve(this),this._view3D}},viewRotation:{get:function(){return bve(this),this._viewRotation}},viewRotation3D:{get:function(){return bve(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return vve(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return vve(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){var e;return(e=this)._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===AB.SCENE2D||e._mode===AB.MORPHING||e._orthographicIn3D?Me.clone(Me.ZERO,e._inverseProjection):Me.inverse(e._projection,e._inverseProjection)),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){var e;return(e=this)._modelViewDirty&&(e._modelViewDirty=!1,Me.multiplyTransformation(e._view,e._model,e._modelView)),this._modelView}},modelView3D:{get:function(){var e;return(e=this)._modelView3DDirty&&(e._modelView3DDirty=!1,Me.multiplyTransformation(e.view3D,e._model,e._modelView3D)),this._modelView3D}},modelViewRelativeToEye:{get:function(){return function(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;const t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){var e;return(e=this)._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,Me.inverse(e.modelView,e._inverseModelView)),this._inverseModelView}},inverseModelView3D:{get:function(){var e;return(e=this)._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,Me.inverse(e.modelView3D,e._inverseModelView3D)),this._inverseModelView3D}},viewProjection:{get:function(){var e;return(e=this)._viewProjectionDirty&&(e._viewProjectionDirty=!1,Me.multiply(e._projection,e._view,e._viewProjection)),this._viewProjection}},inverseViewProjection:{get:function(){var e;return(e=this)._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,Me.inverse(e.viewProjection,e._inverseViewProjection)),this._inverseViewProjection}},modelViewProjection:{get:function(){var e;return(e=this)._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,Me.multiply(e._projection,e.modelView,e._modelViewProjection)),this._modelViewProjection}},inverseModelViewProjection:{get:function(){var e;return(e=this)._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,Me.inverse(e.modelViewProjection,e._inverseModelViewProjection)),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){var e;return(e=this)._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,Me.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye)),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){var e;return(e=this)._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,Me.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection)),this._modelViewInfiniteProjection}},normal:{get:function(){return function(e){if(e._normalDirty){e._normalDirty=!1;const t=e._normal;Me.getMatrix3(e.inverseModelView,t),ce.getRotation(t,t),ce.transpose(t,t)}}(this),this._normal}},normal3D:{get:function(){return function(e){if(e._normal3DDirty){e._normal3DDirty=!1;const t=e._normal3D;Me.getMatrix3(e.inverseModelView3D,t),ce.getRotation(t,t),ce.transpose(t,t)}}(this),this._normal3D}},inverseNormal:{get:function(){var e;return(e=this)._inverseNormalDirty&&(e._inverseNormalDirty=!1,Me.getMatrix3(e.inverseModelView,e._inverseNormal),ce.getRotation(e._inverseNormal,e._inverseNormal)),this._inverseNormal}},inverseNormal3D:{get:function(){var e;return(e=this)._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,Me.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),ce.getRotation(e._inverseNormal3D,e._inverseNormal3D)),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return hve(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return hve(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return Object(c.a)(this._ellipsoid,H.WGS84)}}});let ove=new ce;const ave=new R;rve.prototype.updateCamera=function(e){var t,n;t=this,n=e.viewMatrix,Me.clone(n,t._view),Me.getMatrix3(n,t._viewRotation),t._view3DDirty=!0,t._inverseView3DDirty=!0,t._modelViewDirty=!0,t._modelView3DDirty=!0,t._modelViewRelativeToEyeDirty=!0,t._inverseModelViewDirty=!0,t._inverseModelView3DDirty=!0,t._viewProjectionDirty=!0,t._inverseViewProjectionDirty=!0,t._modelViewProjectionDirty=!0,t._modelViewProjectionRelativeToEyeDirty=!0,t._modelViewInfiniteProjectionDirty=!0,t._normalDirty=!0,t._inverseNormalDirty=!0,t._normal3DDirty=!0,t._inverseNormal3DDirty=!0,function(e,t){Me.clone(t,e._inverseView),Me.getMatrix3(t,e._inverseViewRotation)}(this,e.inverseViewMatrix),function(e,t){O.clone(t.positionWC,e._cameraPosition),O.clone(t.directionWC,e._cameraDirection),O.clone(t.rightWC,e._cameraRight),O.clone(t.upWC,e._cameraUp);const n=t.positionCartographic;Object(l.a)(n)?e._eyeHeight=n.height:e._eyeHeight=-e._ellipsoid.maximumRadius,e._encodedCameraPositionMCDirty=!0}(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==AB.SCENE2D&&e.frustum instanceof nv},rve.prototype.updateFrustum=function(e){var t,n;t=this,n=e.projectionMatrix,Me.clone(n,t._projection),t._inverseProjectionDirty=!0,t._viewProjectionDirty=!0,t._inverseViewProjectionDirty=!0,t._modelViewProjectionDirty=!0,t._modelViewProjectionRelativeToEyeDirty=!0,Object(l.a)(e.infiniteProjectionMatrix)&&function(e,t){Me.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=h.a.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne,Object(l.a)(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},rve.prototype.updatePass=function(e){this._pass=e};const sve=[],cve=new ive;function lve(e){if(e._viewportDirty){const t=e._viewport;Me.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),Me.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}rve.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;const t=e.camera;this.updateCamera(t),e.mode===AB.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),function(e,t){Object(l.a)(ca.computeIcrfToFixedMatrix(t.time,ove))||(ove=ca.computeTemeToPseudoFixedMatrix(t.time,ove));let n=pI.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);ce.multiplyByVector(ove,n,n),O.normalize(n,e._sunDirectionWC),n=ce.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),O.normalize(n,n),n=pI.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),ce.multiplyByVector(ove,n,n),ce.multiplyByVector(e.viewRotation3D,n,n),O.normalize(n,n);const i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,ave);i.project(r,e._sunPositionColumbusView)}(this,e);const n=Object(c.a)(e.light,cve);n instanceof ive?(this._lightDirectionWC=O.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=O.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=O.normalize(O.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=ce.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));const i=n.color;let r=O.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=O.multiplyByScalar(r,n.intensity,r);const o=O.maximumComponent(r);o>1?O.divideByScalar(r,o,this._lightColor):O.clone(r,this._lightColor);const a=e.brdfLutGenerator,s=Object(l.a)(a)?a.colorTexture:void 0;this._brdfLut=s,this._environmentMap=Object(c.a)(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=Object(c.a)(e.sphericalHarmonicCoefficients,sve),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,Object(l.a)(this._specularEnvironmentMaps)&&Vt.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=ca.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;const u=t.frustum.fov,h=this._viewport;let d;d=Object(l.a)(u)?h.height>h.width?2*Math.tan(.5*u)/h.height:2*Math.tan(.5*u)/h.width:1/Math.max(h.width,h.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,sp.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};const uve=new O;function hve(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,Me.multiplyByPoint(e.inverseModel,e._cameraPosition,uve),Mh.fromCartesian(uve,e._encodedCameraPositionMC))}const dve=new O,fve=new O,pve=new O,mve=new O,gve=new R,_ve=new O,yve=new Me;function bve(e){e._view3DDirty&&(e._mode===AB.SCENE3D?Me.clone(e._view,e._view3D):function(e,t,n,i,r,o,a,s){const c=dve;c.x=e.y,c.y=e.z,c.z=e.x;const u=fve;u.x=n.y,u.y=n.z,u.z=n.x;const d=pve;d.x=i.y,d.y=i.z,d.z=i.x;const f=mve;f.x=t.y,f.y=t.z,f.z=t.x,o===AB.SCENE2D&&(c.z=.5*r);const p=a.unproject(c,gve);p.longitude=h.a.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=h.a.clamp(p.latitude,-h.a.PI_OVER_TWO,h.a.PI_OVER_TWO);const m=a.ellipsoid,g=m.cartographicToCartesian(p,_ve),_=ca.eastNorthUpToFixedFrame(g,m,yve);Me.multiplyByPointAsVector(_,u,u),Me.multiplyByPointAsVector(_,d,d),Me.multiplyByPointAsVector(_,f,f),Object(l.a)(s)||(s=new Me),s[0]=u.x,s[1]=d.x,s[2]=-f.x,s[3]=0,s[4]=u.y,s[5]=d.y,s[6]=-f.y,s[7]=0,s[8]=u.z,s[9]=d.z,s[10]=-f.z,s[11]=0,s[12]=-O.dot(u,g),s[13]=-O.dot(d,g),s[14]=O.dot(f,g),s[15]=1}(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),Me.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function vve(e){e._inverseView3DDirty&&(Me.inverseTransformation(e.view3D,e._inverseView3D),Me.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var Ove=rve;function wve(e,t,n){const i=e.getError();if(i!==e.NO_ERROR)throw new ye.a(function(e,t,n,i){let r=`${function(e,t){let n="WebGL Error:  ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}(e,i)}: ${t.name}(`;for(let e=0;e<n.length;++e)0!==e&&(r+=", "),r+=n[e];return r+=");",r}(e,t,n,i))}function Ave(e,t,n){return{get:function(){const i=e[t];return n(e,"get: "+t,i),e[t]},set:function(i){e[t]=i,n(e,"set: "+t,i)}}}function Eve(e,t){const n=t.length;for(let i=0;i<n;++i){const n=e.getExtension(t[i]);if(n)return n}}function Tve(e,t){if("undefined"==typeof WebGLRenderingContext)throw new ye.a("The browser does not support WebGL.  Visit http://get.webgl.org.");s.a.defined("canvas",e),this._canvas=e,t=Object(Zf.a)(t,!0),(t=Object(c.a)(t,{})).allowTextureFilterAnisotropic=Object(c.a)(t.allowTextureFilterAnisotropic,!0);const n=Object(c.a)(t.webgl,{});n.alpha=Object(c.a)(n.alpha,!1),n.stencil=Object(c.a)(n.stencil,!0);const i=Object(c.a)(t.requestWebgl2,!1)&&"undefined"!=typeof WebGL2RenderingContext;let r,o=!1;const a=t.getWebGLStub;if(Object(l.a)(a))r=a(e,n);else if(i&&(r=e.getContext("webgl2",n)||e.getContext("experimental-webgl2",n)||void 0,Object(l.a)(r)&&(o=!0)),Object(l.a)(r)||(r=e.getContext("webgl",n)||e.getContext("experimental-webgl",n)||void 0),!Object(l.a)(r))throw new ye.a("The browser supports WebGL, but initialization failed.");this._originalGLContext=r,this._gl=r,this._webgl2=o,this._id=fy(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new eve(this),this._textureCache=new nve;const u=r;this._stencilBits=u.getParameter(u.STENCIL_BITS),MD._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),MD._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),MD._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),MD._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),MD._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),MD._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),MD._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),MD._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),MD._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),MD._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),MD._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;const h=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);MD._minimumAliasedLineWidth=h[0],MD._maximumAliasedLineWidth=h[1];const d=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);MD._minimumAliasedPointSize=d[0],MD._maximumAliasedPointSize=d[1];const f=u.getParameter(u.MAX_VIEWPORT_DIMS);MD._maximumViewportWidth=f[0],MD._maximumViewportHeight=f[1];const p=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);MD._highpFloatSupported=0!==p.precision;const m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);MD._highpIntSupported=0!==m.rangeMax,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Eve(u,["OES_standard_derivatives"]),this._blendMinmax=!!Eve(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Eve(u,["OES_element_index_uint"]),this._depthTexture=!!Eve(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Eve(u,["EXT_frag_depth"]),this._debugShaders=Eve(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Eve(u,["OES_texture_float"]),this._textureHalfFloat=!!Eve(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Eve(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Eve(u,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Eve(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Eve(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Eve(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Eve(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Eve(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Eve(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Eve(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Eve(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Eve(u,["EXT_texture_compression_bptc"]),sE.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);const g=t.allowTextureFilterAnisotropic?Eve(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;let _,y,b,v,O,w,A,E,T,C;if(this._textureFilterAnisotropic=g,MD._maximumTextureFilterAnisotropy=Object(l.a)(g)?u.getParameter(g.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,o){const e=this;_=function(){return e._gl.createVertexArray()},y=function(t){e._gl.bindVertexArray(t)},b=function(t){e._gl.deleteVertexArray(t)},v=function(e,t,n,i,r){u.drawElementsInstanced(e,t,n,i,r)},O=function(e,t,n,i){u.drawArraysInstanced(e,t,n,i)},w=function(e,t){u.vertexAttribDivisor(e,t)},A=function(e){u.drawBuffers(e)}}else E=Eve(u,["OES_vertex_array_object"]),Object(l.a)(E)&&(_=function(){return E.createVertexArrayOES()},y=function(e){E.bindVertexArrayOES(e)},b=function(e){E.deleteVertexArrayOES(e)}),T=Eve(u,["ANGLE_instanced_arrays"]),Object(l.a)(T)&&(v=function(e,t,n,i,r){T.drawElementsInstancedANGLE(e,t,n,i,r)},O=function(e,t,n,i){T.drawArraysInstancedANGLE(e,t,n,i)},w=function(e,t){T.vertexAttribDivisorANGLE(e,t)}),C=Eve(u,["WEBGL_draw_buffers"]),Object(l.a)(C)&&(A=function(e){C.drawBuffersWEBGL(e)});this.glCreateVertexArray=_,this.glBindVertexArray=y,this.glDeleteVertexArray=b,this.glDrawElementsInstanced=v,this.glDrawArraysInstanced=O,this.glVertexAttribDivisor=w,this.glDrawBuffers=A,this._vertexArrayObject=!!E,this._instancedArrays=!!T,this._drawBuffers=!!C,MD._maximumDrawBuffers=this.drawBuffers?u.getParameter(ps.MAX_DRAW_BUFFERS):1,MD._maximumColorAttachments=this.drawBuffers?u.getParameter(ps.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new sp(0,0,0,0),this._clearDepth=1,this._clearStencil=0;const x=new Ove,S=new Zbe(this),I=vj.fromCache();this._defaultPassState=S,this._defaultRenderState=I,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=x,this._currentRenderState=I,this._currentPassState=S,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let e=0;e<MD._maximumVertexAttributes;e++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=t,this.cache={},vj.apply(u,I,S)}const Cve={};function xve(e,t,n,i){const r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,vj.partialApply(e._gl,r,t,o,n,i)}let Sve;function Ive(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Sve;if(Object(l.a)(t))t._bind(),function(e){if(e.validateFramebuffer){const t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let e;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:e="Framebuffer is not complete.  Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached.  Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:e="Framebuffer is not complete.  Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:e="Framebuffer is not complete.  Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:e="Framebuffer is not complete.  Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new u.a(e)}}}(e),n=t._getActiveColorAttachments();else{const t=e._gl;t.bindFramebuffer(t.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}Object.defineProperties(Tve.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=function(e,t){if(!Object(l.a)(t))return e;function n(n){return function(){const i=n.apply(e,arguments);return t(e,n,arguments),i}}const i={};for(const r in e){const o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,Ave(e,r,t))}return i}(this._originalGLContext,e?wve:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new JD({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return void 0===this._defaultEmissiveTexture&&(this._defaultEmissiveTexture=new JD({context:this,pixelFormat:aT.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return void 0===this._defaultNormalTexture&&(this._defaultNormalTexture=new JD({context:this,pixelFormat:aT.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){const e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new XD({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return Cve}}}),"undefined"!=typeof WebGLRenderingContext&&(Sve=[ps.BACK]);const Pve=new UU;Tve.prototype.clear=function(e,t){e=Object(c.a)(e,Pve),t=Object(c.a)(t,this._defaultPassState);const n=this._gl;let i=0;const r=e.color,o=e.depth,a=e.stencil;Object(l.a)(r)&&(sp.equals(this._clearColor,r)||(sp.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),Object(l.a)(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),Object(l.a)(a)&&(a!==this._clearStencil&&(this._clearStencil=a,n.clearStencil(a)),i|=n.STENCIL_BUFFER_BIT);xve(this,Object(c.a)(e.renderState,this._defaultRenderState),t,!0);Ive(this,Object(c.a)(e.framebuffer,t.framebuffer)),n.clear(i)},Tve.prototype.draw=function(e,t,n,i){s.a.defined("drawCommand",e),s.a.defined("drawCommand.shaderProgram",e._shaderProgram),t=Object(c.a)(t,this._defaultPassState);const r=Object(c.a)(e._framebuffer,t.framebuffer),o=Object(c.a)(e._renderState,this._defaultRenderState);n=Object(c.a)(n,e._shaderProgram),i=Object(c.a)(i,e._uniformMap),function(e,t,n,i,r){if(Object(l.a)(t)&&r.depthTest&&r.depthTest.enabled&&!t.hasDepthAttachment)throw new u.a("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");Ive(e,t),xve(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}(this,r,t,n,o),function(e,t,n,i){const r=t._primitiveType,o=t._vertexArray;let a=t._offset,h=t._count;const d=t.instanceCount;if(!zl.validate(r))throw new u.a("drawCommand.primitiveType is required and must be valid.");if(s.a.defined("drawCommand.vertexArray",o),s.a.typeOf.number.greaterThanOrEquals("drawCommand.offset",a,0),Object(l.a)(h)&&s.a.typeOf.number.greaterThanOrEquals("drawCommand.count",h,0),s.a.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",d,0),d>0&&!e.instancedArrays)throw new u.a("Instanced arrays extension is not supported");e._us.model=Object(c.a)(t._modelMatrix,Me.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();const f=o.indexBuffer;Object(l.a)(f)?(a*=f.bytesPerIndex,h=Object(c.a)(h,f.numberOfIndices),0===d?e._gl.drawElements(r,h,f.indexDatatype,a):e.glDrawElementsInstanced(r,h,f.indexDatatype,a,d)):(h=Object(c.a)(h,o.numberOfVertices),0===d?e._gl.drawArrays(r,a,h):e.glDrawArraysInstanced(r,a,h,d)),o._unBind()}(this,e,n,i)},Tve.prototype.endFrame=function(){const e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);const t=Sve;this.drawBuffers&&this.glDrawBuffers(t);const n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let t=0;t<n;++t)e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},Tve.prototype.readPixels=function(e){const t=this._gl;e=Object(c.a)(e,c.a.EMPTY_OBJECT);const n=Math.max(Object(c.a)(e.x,0),0),i=Math.max(Object(c.a)(e.y,0),0),r=Object(c.a)(e.width,t.drawingBufferWidth),o=Object(c.a)(e.height,t.drawingBufferHeight),a=e.framebuffer;s.a.typeOf.number.greaterThan("readState.width",r,0),s.a.typeOf.number.greaterThan("readState.height",o,0);let u=rT.UNSIGNED_BYTE;Object(l.a)(a)&&a.numberOfColorAttachments>0&&(u=a.getColorTexture(0).pixelDatatype);const h=aT.createTypedArray(aT.RGBA,u,r,o);return Ive(this,a),t.readPixels(n,i,r,o,aT.RGBA,rT.toWebGLConstant(u,this),h),h};const Dve={position:0,textureCoordinates:1};function Rve(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Tve.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!Object(l.a)(e)){const t=new Zl({attributes:{position:new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:zl.TRIANGLES});e=iB.fromGeometry({context:this,geometry:t,attributeLocations:Dve,bufferUsage:KN.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},Tve.prototype.createViewportQuadCommand=function(e,t){return t=Object(c.a)(t,c.a.EMPTY_OBJECT),new XR({vertexArray:this.getViewportQuadVertexArray(),primitiveType:zl.TRIANGLES,renderState:t.renderState,shaderProgram:oM.fromCache({context:this,vertexShaderSource:qbe,fragmentShaderSource:e,attributeLocations:Dve}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},Tve.prototype.getObjectByPickColor=function(e){return s.a.defined("pickColor",e),this._pickObjects[e.toRgba()]},Object.defineProperties(Rve.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),Rve.prototype.destroy=function(){delete this._pickObjects[this.key]},Tve.prototype.createPickId=function(e){s.a.defined("object",e),++this._nextPickColor[0];const t=this._nextPickColor[0];if(0===t)throw new ye.a("Out of unique Pick IDs.");return this._pickObjects[t]=e,new Rve(this._pickObjects,t,sp.fromRgba(t))},Tve.prototype.isDestroyed=function(){return!1},Tve.prototype.destroy=function(){const e=this.cache;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];Object(l.a)(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),sc(this)};var jve=Tve;var Mve=function(e,t,n){if(s.a.defined("context",e),!(Object(l.a)(t)&&Object(l.a)(t.positiveX)&&Object(l.a)(t.negativeX)&&Object(l.a)(t.positiveY)&&Object(l.a)(t.negativeY)&&Object(l.a)(t.positiveZ)&&Object(l.a)(t.negativeZ)))throw new u.a("urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");const i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[Tt.a.createIfNeeded(t.positiveX).fetchImage(i),Tt.a.createIfNeeded(t.negativeX).fetchImage(i),Tt.a.createIfNeeded(t.positiveY).fetchImage(i),Tt.a.createIfNeeded(t.negativeY).fetchImage(i),Tt.a.createIfNeeded(t.positiveZ).fetchImage(i),Tt.a.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then((function(t){return new XD({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})}))};function Lve(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.missingImageUrl))throw new u.a("options.missingImageUrl is required.");if(!Object(l.a)(e.pixelsToCheck))throw new u.a("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;const t=Tt.a.createIfNeeded(e.missingImageUrl),n=this;t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then((function(t){Object(l.a)(t.blob)&&(n._missingImageByteLength=t.blob.size);let i=Object(Kv.a)(t);if(e.disableCheckIfAllPixelsAreTransparent){let n=!0;const r=t.width,o=e.pixelsToCheck;for(let e=0,t=o.length;n&&e<t;++e){const t=o[e];i[4*t.x+t.y*r+3]>0&&(n=!1)}n&&(i=void 0)}n._missingImagePixels=i,n._isReady=!0})).catch((function(){n._missingImagePixels=void 0,n._isReady=!0}))}Lve.prototype.isReady=function(){return this._isReady},Lve.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new u.a("shouldDiscardImage must not be called before the discard policy is ready.");const t=this._pixelsToCheck,n=this._missingImagePixels;if(!Object(l.a)(n))return!1;if(Object(l.a)(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;const i=Object(Kv.a)(e),r=e.width;for(let e=0,o=t.length;e<o;++e){const o=t[e],a=4*o.x+o.y*r;for(let e=0;e<4;++e){const t=a+e;if(i[t]!==n[t])return!1}}return!0};var Nve=Lve;function Bve(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}Bve.prototype.configureNameFromProperties=function(e){let t,n=10;for(const i in e)if(e.hasOwnProperty(i)&&e[i]){const e=i.toLowerCase();n>1&&"name"===e?(n=1,t=i):n>2&&"title"===e?(n=2,t=i):n>3&&/name/i.test(i)?(n=3,t=i):n>4&&/title/i.test(i)&&(n=4,t=i)}Object(l.a)(t)&&(this.name=e[t])},Bve.prototype.configureDescriptionFromProperties=function(e){this.description=function e(t){let n='<table class="cesium-infoBox-defaultTable">';for(const i in t)if(t.hasOwnProperty(i)){const r=t[i];Object(l.a)(r)&&(n+="object"==typeof r?`<tr><td>${i}</td><td>${e(r)}</td></tr>`:`<tr><td>${i}</td><td>${r}</td></tr>`)}return n+="</table>",n}(e)};var Fve=Bve;function zve(){this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,u.a.throwInstantiationError()}Object.defineProperties(zve.prototype,{ready:{get:u.a.throwInstantiationError},readyPromise:{get:u.a.throwInstantiationError},rectangle:{get:u.a.throwInstantiationError},tileWidth:{get:u.a.throwInstantiationError},tileHeight:{get:u.a.throwInstantiationError},maximumLevel:{get:u.a.throwInstantiationError},minimumLevel:{get:u.a.throwInstantiationError},tilingScheme:{get:u.a.throwInstantiationError},tileDiscardPolicy:{get:u.a.throwInstantiationError},errorEvent:{get:u.a.throwInstantiationError},credit:{get:u.a.throwInstantiationError},proxy:{get:u.a.throwInstantiationError},hasAlphaChannel:{get:u.a.throwInstantiationError}}),zve.prototype.getTileCredits=function(e,t,n){u.a.throwInstantiationError()},zve.prototype.requestImage=function(e,t,n,i){u.a.throwInstantiationError()},zve.prototype.pickFeatures=function(e,t,n,i,r){u.a.throwInstantiationError()};const kve=/\.ktx2$/i;zve.loadImage=function(e,t){s.a.defined("url",t);const n=Tt.a.createIfNeeded(t);return kve.test(n.url)?sE(n):Object(l.a)(e)&&Object(l.a)(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Uve=zve;function Vve(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url))throw new u.a("options.url is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;const t=Tt.a.createIfNeeded(e.url);t.appendForwardSlash(),Object(l.a)(e.token)&&t.setQueryParameters({token:e.token}),this._resource=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=Object(c.a)(e.tileWidth,256),this._tileHeight=Object(c.a)(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=Object(c.a)(e.tilingScheme,new Gt({ellipsoid:e.ellipsoid})),this._useTiles=Object(c.a)(e.usePreCachedTilesIfAvailable,!0),this._rectangle=Object(c.a)(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers;let n=e.credit;"string"==typeof n&&(n=new ln(n)),this._credit=n,this.enablePickFeatures=Object(c.a)(e.enablePickFeatures,!0),this._errorEvent=new un.a,this._ready=!1;const i=this;let r;function o(t){const n=t.tileInfo;if(Object(l.a)(n)){if(i._tileWidth=n.rows,i._tileHeight=n.cols,102100===n.spatialReference.wkid||102113===n.spatialReference.wkid)i._tilingScheme=new pl({ellipsoid:e.ellipsoid});else{if(4326!==t.tileInfo.spatialReference.wkid){const e=`Tile spatial reference WKID ${t.tileInfo.spatialReference.wkid} is not supported.`;return r=dl.reportError(r,i,i._errorEvent,e,void 0,void 0,void 0),r.retry?s():Promise.reject(new ye.a(e))}i._tilingScheme=new Gt({ellipsoid:e.ellipsoid})}if(i._maximumLevel=t.tileInfo.lods.length-1,Object(l.a)(t.fullExtent)){if(Object(l.a)(t.fullExtent.spatialReference)&&Object(l.a)(t.fullExtent.spatialReference.wkid))if(102100===t.fullExtent.spatialReference.wkid||102113===t.fullExtent.spatialReference.wkid){const e=new Zs,n=t.fullExtent,r=e.unproject(new O(Math.max(n.xmin,-i._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(n.ymin,-i._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),o=e.unproject(new O(Math.min(n.xmax,i._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(n.ymax,i._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));i._rectangle=new Be(r.longitude,r.latitude,o.longitude,o.latitude)}else{if(4326!==t.fullExtent.spatialReference.wkid){const e=`fullExtent.spatialReference WKID ${t.fullExtent.spatialReference.wkid} is not supported.`;return r=dl.reportError(r,i,i._errorEvent,e,void 0,void 0,void 0),r.retry?s():Promise.reject(new ye.a(e))}i._rectangle=Be.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax)}}else i._rectangle=i._tilingScheme.rectangle;Object(l.a)(i._tileDiscardPolicy)||(i._tileDiscardPolicy=new Nve({missingImageUrl:Hve(i,0,0,i._maximumLevel).url,pixelsToCheck:[new Vt(0,0),new Vt(200,20),new Vt(20,200),new Vt(80,110),new Vt(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),i._useTiles=!0}else i._useTiles=!1;return Object(l.a)(t.copyrightText)&&t.copyrightText.length>0&&(i._credit=new ln(t.copyrightText)),i._ready=!0,dl.reportSuccess(r),Promise.resolve(!0)}function a(e){const t=`An error occurred while accessing ${i._resource.url}.`;return r=dl.reportError(r,i,i._errorEvent,t,void 0,void 0,void 0),Promise.reject(new ye.a(t))}function s(){return i._resource.getDerivedResource({queryParameters:{f:"json"}}).fetchJsonp().then(o).catch(a)}this._useTiles?this._readyPromise=s():(this._ready=!0,this._readyPromise=Promise.resolve(!0))}function Hve(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{const a=e._tilingScheme.tileXYToNativeRectangle(t,n,i),s={bbox:`${a.west},${a.south},${a.east},${a.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof q?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:s})}return o}Object.defineProperties(Vve.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){if(!this._ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new u.a("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),Vve.prototype.getTileCredits=function(e,t,n){},Vve.prototype.requestImage=function(e,t,n,i){if(!this._ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");return Uve.loadImage(this,Hve(this,e,t,n,i))},Vve.prototype.pickFeatures=function(e,t,n,i,r){if(!this._ready)throw new u.a("pickFeatures must not be called before the imagery provider is ready.");if(!this.enablePickFeatures)return;const o=this._tilingScheme.tileXYToNativeRectangle(e,t,n);let a,s,c;if(this._tilingScheme.projection instanceof q)a=h.a.toDegrees(i),s=h.a.toDegrees(r),c="4326";else{const e=this._tilingScheme.projection.project(new R(i,r,0));a=e.x,s=e.y,c="3857"}let d="visible";Object(l.a)(this._layers)&&(d+=":"+this._layers);const f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${a},${s}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then((function(e){const t=[],n=e.results;if(!Object(l.a)(n))return t;for(let e=0;e<n.length;++e){const i=n[e],r=new Fve;if(r.data=i,r.name=i.value,r.properties=i.attributes,r.configureDescriptionFromProperties(i.attributes),"esriGeometryPoint"===i.geometryType&&i.geometry){const e=i.geometry.spatialReference&&i.geometry.spatialReference.wkid?i.geometry.spatialReference.wkid:4326;if(4326===e||4283===e)r.position=R.fromDegrees(i.geometry.x,i.geometry.y,i.geometry.z);else if(102100===e||900913===e||3857===e){const e=new Zs;r.position=e.unproject(new O(i.geometry.x,i.geometry.y,i.geometry.z))}}t.push(r)}return t}))};var Gve=Vve;function qve(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new h$,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new Vt,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}function Wve(e){const t=e._framebuffers;if(!Object(l.a)(t))return;const n=t.length;for(let e=0;e<n;++e)t[e].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Yve(e){const t=e._commands;if(!Object(l.a)(t))return;const n=t.length;for(let e=0;e<n;++e)t[e].shaderProgram.destroy();e._commands=void 0}function Xve(e,t){let n;if(0===t)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{const i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Kve(e,t){let n="uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates; \nfloat sampleTexture(vec2 offset) { \n";return n+=0===e?"    vec4 color = texture2D(colorTexture, v_textureCoordinates + offset); \n    return czm_luminance(color.rgb); \n":"    return texture2D(colorTexture, v_textureCoordinates + offset).r; \n",n+="}\n\n",n+="uniform vec2 colorTextureDimensions; \nuniform vec2 minMaxLuminance; \nuniform sampler2D previousLuminance; \nvoid main() { \n    float color = 0.0; \n    float xStep = 1.0 / colorTextureDimensions.x; \n    float yStep = 1.0 / colorTextureDimensions.y; \n    int count = 0; \n    for (int i = 0; i < 3; ++i) { \n        for (int j = 0; j < 3; ++j) { \n            vec2 offset; \n            offset.x = -xStep + float(i) * xStep; \n            offset.y = -yStep + float(j) * yStep; \n            if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \n                continue; \n            } \n            color += sampleTexture(offset); \n            ++count; \n        } \n    } \n    if (count > 0) { \n        color /= float(count); \n    } \n",e===t-1&&(n+="    float previous = texture2D(previousLuminance, vec2(0.5)).r; \n    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n    color = previous + (color - previous) / (60.0 * 1.5); \n    color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n"),n+="    gl_FragColor = vec4(color); \n} \n",n}Object.defineProperties(qve.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){const e=this._framebuffers;if(Object(l.a)(e))return e[e.length-1].getColorTexture(0)}}}),qve.prototype.clear=function(e){const t=this._framebuffers;if(!Object(l.a)(t))return;let n=this._clearCommand;Object(l.a)(n)||(n=this._clearCommand=new UU({color:new sp(0,0,0,0),framebuffer:void 0}));const i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)},qve.prototype.update=function(e){const t=e.drawingBufferWidth,n=e.drawingBufferHeight;t===this._width&&n===this._height||(this._width=t,this._height=n,function(e,t){Wve(e);let n=e._width,i=e._height;const r=t.halfFloatingPointTexture?rT.HALF_FLOAT:rT.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),a=new Array(o);for(let e=0;e<o;++e)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),a[e]=new h$,a[e].update(t,n,i,1,r);const s=a[o-1].getColorTexture(0);e._previousLuminance.update(t,s.width,s.height,1,r),e._framebuffers=a}(this,e),function(e,t){Yve(e);const n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(Kve(o,i),{framebuffer:n[o].framebuffer,uniformMap:Xve(e,o)});e._commands=r}(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;const i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r},qve.prototype.execute=function(e,t){this._colorTexture=t;const n=this._commands;if(!Object(l.a)(n))return;const i=n.length;for(let t=0;t<i;++t)n[t].execute(e)},qve.prototype.isDestroyed=function(){return!1},qve.prototype.destroy=function(){return Wve(this),Yve(this),sc(this)};var Jve=qve;var Zve=Object.freeze({AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"});function $ve(e){}let Qve;$ve.prototype.isReady=function(){return!0},$ve.prototype.shouldDiscardImage=function(e){return $ve.EMPTY_IMAGE===e},Object.defineProperties($ve,{EMPTY_IMAGE:{get:function(){return Object(l.a)(Qve)||(Qve=new Image,Qve.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),Qve}}});var eOe=$ve;function tOe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).key;if(!Object(l.a)(e.url))throw new u.a("options.url is required.");if(!Object(l.a)(t))throw new u.a("options.key is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=1,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._key=t,this._resource=Tt.a.createIfNeeded(e.url),this._resource.appendForwardSlash(),this._tileProtocol=e.tileProtocol,this._mapStyle=Object(c.a)(e.mapStyle,Zve.AERIAL),this._culture=Object(c.a)(e.culture,""),this._tileDiscardPolicy=e.tileDiscardPolicy,Object(l.a)(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new eOe),this._proxy=e.proxy,this._credit=new ln(`<a href="http://www.bing.com"><img src="${tOe.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new pl({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new un.a,this._ready=!1;let n=this._tileProtocol;if(Object(l.a)(n))n.length>0&&":"===n[n.length-1]&&(n=n.substr(0,n.length-1));else{n="http:"===document.location.protocol?"http":"https"}const i=this._resource.getDerivedResource({url:"REST/v1/Imagery/Metadata/"+this._mapStyle,queryParameters:{incl:"ImageryProviders",key:this._key,uriScheme:n}}),r=this;let o;function a(e){if(1!==e.resourceSets.length)return s();const t=e.resourceSets[0].resources[0];r._tileWidth=t.imageWidth,r._tileHeight=t.imageHeight,r._maximumLevel=t.zoomMax-1,r._imageUrlSubdomains=t.imageUrlSubdomains,r._imageUrlTemplate=t.imageUrl;let n=r._attributionList=t.imageryProviders;n||(n=r._attributionList=[]);for(let e=0,t=n.length;e<t;++e){const t=n[e];if(t.credit instanceof ln)break;t.credit=new ln(t.attribution);const i=t.coverageAreas;for(let e=0,n=t.coverageAreas.length;e<n;++e){const t=i[e],n=t.bbox;t.bbox=new Be(h.a.toRadians(n[1]),h.a.toRadians(n[0]),h.a.toRadians(n[3]),h.a.toRadians(n[2]))}}return r._ready=!0,dl.reportSuccess(o),Promise.resolve(!0)}function s(e){const t=`An error occurred while accessing ${i.url}.`;return o=dl.reportError(o,r,r._errorEvent,t,void 0,void 0,void 0),o.retry?f():Promise.reject(new ye.a(t))}const d=i.url;function f(){const e=i.fetchJsonp("jsonp");return tOe._metadataCache[d]=e,e.then(a).catch(s)}const p=tOe._metadataCache[d];Object(l.a)(p)?this._readyPromise=p.then(a).catch(s):this._readyPromise=f()}Object.defineProperties(tOe.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){if(!this._ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new u.a("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});const nOe=new Be;tOe.prototype.getTileCredits=function(e,t,n){if(!this._ready)throw new u.a("getTileCredits must not be called before the imagery provider is ready.");const i=this._tilingScheme.tileXYToRectangle(e,t,n,nOe);return function(e,t,n){++t;const i=[];for(let r=0,o=e.length;r<o;++r){const o=e[r],a=o.coverageAreas;let s=!1;for(let e=0,i=o.coverageAreas.length;!s&&e<i;++e){const i=a[e];if(t>=i.zoomMin&&t<=i.zoomMax){const e=Be.intersection(n,i.bbox,iOe);Object(l.a)(e)&&(s=!0)}}s&&i.push(o.credit)}return i}(this._attributionList,n,i)},tOe.prototype.requestImage=function(e,t,n,i){if(!this._ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");const r=Uve.loadImage(this,function(e,t,n,i,r){const o=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+n+i)%a.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:tOe.tileXYToQuadKey(t,n,i),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}(this,e,t,n,i));if(Object(l.a)(r))return r.catch((function(e){return Object(l.a)(e.blob)&&0===e.blob.size?eOe.EMPTY_IMAGE:Promise.reject(e)}))},tOe.prototype.pickFeatures=function(e,t,n,i,r){},tOe.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){const n=1<<r;let o=0;0!=(e&n)&&(o|=1),0!=(t&n)&&(o|=2),i+=o}return i},tOe.quadKeyToTileXY=function(e){let t=0,n=0;const i=e.length-1;for(let r=i;r>=0;--r){const o=1<<r,a=+e[i-r];0!=(1&a)&&(t|=o),0!=(2&a)&&(n|=o)}return{x:t,y:n,level:i}},tOe._logoUrl=void 0,Object.defineProperties(tOe,{logoUrl:{get:function(){return Object(l.a)(tOe._logoUrl)||(tOe._logoUrl=Lt("Assets/Images/bing_maps_credit.png")),tOe._logoUrl},set:function(e){s.a.defined("value",e),tOe._logoUrl=e}}});const iOe=new Be;tOe._metadataCache={};var rOe=tOe;const oOe=new O(1,1,1);function aOe(e){e=Object(c.a)(e,oOe),s.a.defined("dimensions",e),s.a.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),s.a.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),s.a.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=O.clone(e)}Object.defineProperties(aOe.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){s.a.defined("value",e),s.a.typeOf.number.greaterThanOrEquals("value.x",e.x,0),s.a.typeOf.number.greaterThanOrEquals("value.y",e.y,0),s.a.typeOf.number.greaterThanOrEquals("value.z",e.z,0),O.clone(e,this._dimensions)}}});const sOe=new O;aOe.prototype.emit=function(e){const t=this._dimensions,n=O.multiplyByScalar(t,.5,sOe),i=h.a.randomBetween(-n.x,n.x),r=h.a.randomBetween(-n.y,n.y),o=h.a.randomBetween(-n.z,n.z);e.position=O.fromElements(i,r,o,e.position),e.velocity=O.normalize(e.position,e.velocity)};var cOe=aOe,lOe="varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\n\nfloat vdcRadicalInverse(int i)\n{\n    float r;\n    float base = 2.0;\n    float value = 0.0;\n    float invBase = 1.0 / base;\n    float invBi = invBase;\n    for (int x = 0; x < 100; x++)\n    {\n        if (i <= 0)\n        {\n            break;\n        }\n        r = mod(float(i), base);\n        value += r * invBi;\n        invBi *= invBase;\n        i = int(float(i) * invBase);\n    }\n    return value;\n}\n\nvec2 hammersley2D(int i, int N)\n{\n    return vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\n\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\n    float a = roughness * roughness;\n    float phi = 2.0 * M_PI * xi.x;\n    float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\n    float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n    vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\n    vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n    vec3 tangentX = normalize(cross(upVector, N));\n    vec3 tangentY = cross(N, tangentX);\n    return tangentX * H.x + tangentY * H.y + N * H.z;\n}\n\nfloat G1_Smith(float NdotV, float k)\n{\n    return NdotV / (NdotV * (1.0 - k) + k);\n}\n\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\n    float k = roughness * roughness / 2.0;\n    return G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\n\nvec2 integrateBrdf(float roughness, float NdotV)\n{\n    vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\n    float A = 0.0;\n    float B = 0.0;\n    const int NumSamples = 1024;\n    for (int i = 0; i < NumSamples; i++)\n    {\n        vec2 xi = hammersley2D(i, NumSamples);\n        vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\n        vec3 L = 2.0 * dot(V, H) * H - V;\n        float NdotL = clamp(L.z, 0.0, 1.0);\n        float NdotH = clamp(H.z, 0.0, 1.0);\n        float VdotH = clamp(dot(V, H), 0.0, 1.0);\n        if (NdotL > 0.0)\n        {\n            float G = G_Smith(roughness, NdotV, NdotL);\n            float G_Vis = G * VdotH / (NdotH * NdotV);\n            float Fc = pow(1.0 - VdotH, 5.0);\n            A += (1.0 - Fc) * G_Vis;\n            B += Fc * G_Vis;\n        }\n    }\n    return vec2(A, B) / float(NumSamples);\n}\n\nvoid main()\n{\n    gl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n";function uOe(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(uOe.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),uOe.prototype.update=function(e){if(!Object(l.a)(this._colorTexture)){const t=e.context,n=new JD({context:t,width:256,height:256,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,sampler:WD.NEAREST});this._colorTexture=n;const i=new i$({context:t,colorTextures:[n],destroyAttachments:!1});!function(e,t,n){const i=t.createViewportQuadCommand(lOe,{framebuffer:n,renderState:vj.fromCache({viewport:new Nl(0,0,256,256)})});e._drawCommand=i}(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},uOe.prototype.isDestroyed=function(){return!1},uOe.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),sc(this)};var hOe=uOe;const dOe={};const fOe=new O,pOe=new O;function mOe(e,t,n,i){if(Object(l.a)(i)&&n(.5)>i){const i=n(0),r=n(1),o=n(.5),a=o-i,s=o-r;return function(o){const c=n(o);if(o<=.5){const t=(c-i)/a;return h.a.lerp(e,-h.a.PI_OVER_TWO,t)}const l=(c-r)/s;return h.a.lerp(-h.a.PI_OVER_TWO,t,1-l)}}return function(n){return h.a.lerp(e,t,n)}}function gOe(e,t,n,i,r){let o=r;const a=Math.max(n,i);if(!Object(l.a)(o)){const n=e.position,i=t,r=e.up,a=e.right,s=e.frustum,c=O.subtract(n,i,fOe),l=O.magnitude(O.multiplyByScalar(r,O.dot(c,r),pOe)),u=O.magnitude(O.multiplyByScalar(a,O.dot(c,a),pOe));o=Math.min(.2*function(e,t,n){let i,r,o;if(e instanceof dv){const a=Math.tan(.5*e.fovy);return i=e.near,r=e.near*a,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}return e instanceof lv?(i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r)):Math.max(t,n)}(s,l,u),1e9)}if(a<o){const e=8,t=1e6,r=-Math.pow((o-n)*t,1/e),a=Math.pow((o-i)*t,1/e);return function(n){const i=n*(a-r)+r;return-Math.pow(i,e)/t+o}}return function(e){return h.a.lerp(n,i,e)}}function _Oe(e,t){return h.a.equalsEpsilon(e,h.a.TWO_PI,h.a.EPSILON11)&&(e=0),t>e+Math.PI?e+=h.a.TWO_PI:t<e-Math.PI&&(e-=h.a.TWO_PI),e}const yOe=new O;function bOe(e,t,n,i,r,o,a,s){const c=e.camera,l=O.clone(c.position,yOe),u=c.pitch,d=_Oe(c.heading,i),f=_Oe(c.roll,o),p=gOe(c,n,l.z,n.z,a),m=mOe(u,r,p,s);return function(e){const r=e.time/t;c.setView({orientation:{heading:h.a.lerp(d,i,r),pitch:m(r),roll:h.a.lerp(f,o,r)}}),Vt.lerp(l,n,r,c.position),c.position.z=p(r)}}const vOe=new R,OOe=new R;function wOe(e,t,n,i,r,o,a,s,c,u){const d=e.camera,f=e.mapProjection.ellipsoid,p=R.clone(d.positionCartographic,vOe),m=d.pitch,g=_Oe(d.heading,i),_=_Oe(d.roll,o),y=f.cartesianToCartographic(n,OOe);p.longitude=h.a.zeroToTwoPi(p.longitude),y.longitude=h.a.zeroToTwoPi(y.longitude);let b=!1;if(Object(l.a)(s)){const e=h.a.zeroToTwoPi(s),t=Math.min(p.longitude,y.longitude),n=Math.max(p.longitude,y.longitude),i=e>=t&&e<=n;if(Object(l.a)(c)){const e=Math.abs(p.longitude-y.longitude),t=h.a.TWO_PI-e;(i?e:t)<(i?t:e)*c&&!i&&(b=!0)}else i||(b=!0)}b?function(e,t){e.longitude<t.longitude?e.longitude+=h.a.TWO_PI:t.longitude+=h.a.TWO_PI}(p,y):function(e,t){const n=e.longitude-t.longitude;n<-h.a.PI?e.longitude+=h.a.TWO_PI:n>h.a.PI&&(t.longitude+=h.a.TWO_PI)}(p,y);const v=gOe(d,n,p.height,y.height,a),w=mOe(m,r,v,u);return function(){const e=p.longitude,n=y.longitude,r=p.latitude,a=y.latitude;return function(s){const c=s.time/t,l=O.fromRadians(h.a.lerp(e,n,c),h.a.lerp(r,a,c),v(c),f);d.setView({destination:l,orientation:{heading:h.a.lerp(g,i,c),pitch:w(c),roll:h.a.lerp(_,o,c)}})}}()}function AOe(e,t,n,i,r,o,a){const s=e.camera,c=O.clone(s.position,yOe),l=_Oe(s.heading,i),u=s.frustum.right-s.frustum.left,d=gOe(s,n,u,n.z,a);return function(e){const r=e.time/t;s.setView({orientation:{heading:h.a.lerp(l,i,r)}}),Vt.lerp(c,n,r,s.position);const o=d(r),a=s.frustum,u=a.top/a.right,f=.5*(o-(a.right-a.left));a.right+=f,a.left-=f,a.top=u*a.right,a.bottom=-a.top}}const EOe=new R,TOe=new O;function COe(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function xOe(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}dOe.createTween=function(e,t){let n=(t=Object(c.a)(t,c.a.EMPTY_OBJECT)).destination;if(!Object(l.a)(e))throw new u.a("scene is required.");if(!Object(l.a)(n))throw new u.a("destination is required.");const i=e.mode;if(i===AB.MORPHING)return COe();const r=Object(c.a)(t.convert,!0),o=e.mapProjection,a=o.ellipsoid,s=t.maximumHeight,d=t.flyOverLongitude,f=t.flyOverLongitudeWeight,p=t.pitchAdjustHeight;let m=t.easingFunction;r&&i!==AB.SCENE3D&&(a.cartesianToCartographic(n,EOe),n=o.project(EOe,TOe));const g=e.camera,_=t.endTransform;Object(l.a)(_)&&g._setTransform(_);let y=t.duration;Object(l.a)(y)||(y=Math.ceil(O.distance(g.position,n)/1e6)+2,y=Math.min(y,3));const b=Object(c.a)(t.heading,0),v=Object(c.a)(t.pitch,-h.a.PI_OVER_TWO),w=Object(c.a)(t.roll,0),A=e.screenSpaceCameraController;A.enableInputs=!1;const E=xOe(A,t.complete),T=xOe(A,t.cancel),C=g.frustum;let x=e.mode===AB.SCENE2D;if(x=x&&Vt.equalsEpsilon(g.position,n,h.a.EPSILON6),x=x&&h.a.equalsEpsilon(Math.max(C.right-C.left,C.top-C.bottom),n.z,h.a.EPSILON6),x=x||e.mode!==AB.SCENE2D&&O.equalsEpsilon(n,g.position,h.a.EPSILON10),x=x&&h.a.equalsEpsilon(h.a.negativePiToPi(b),h.a.negativePiToPi(g.heading),h.a.EPSILON10)&&h.a.equalsEpsilon(h.a.negativePiToPi(v),h.a.negativePiToPi(g.pitch),h.a.EPSILON10)&&h.a.equalsEpsilon(h.a.negativePiToPi(w),h.a.negativePiToPi(g.roll),h.a.EPSILON10),x)return COe(E,T);const S=new Array(4);if(S[AB.SCENE2D]=AOe,S[AB.SCENE3D]=wOe,S[AB.COLUMBUS_VIEW]=bOe,y<=0){return COe((function(){S[i](e,1,n,b,v,w,s,d,f,p)({time:1}),"function"==typeof E&&E()}),T)}const I=S[i](e,y,n,b,v,w,s,d,f,p);if(!Object(l.a)(m)){const e=g.positionCartographic.height;m=e>(i===AB.SCENE3D?a.cartesianToCartographic(n).height:n.z)&&e>11500?_b.CUBIC_OUT:_b.QUINTIC_IN_OUT}return{duration:y,easingFunction:m,startObject:{time:0},stopObject:{time:y},update:I,complete:E,cancel:T}};var SOe=dOe;var IOe=Object.freeze({ROTATE:0,INFINITE_SCROLL:1});function POe(e){if(!Object(l.a)(e))throw new u.a("scene is required.");this._scene=e,this._transform=Me.clone(Me.IDENTITY),this._invTransform=Me.clone(Me.IDENTITY),this._actualTransform=Me.clone(Me.IDENTITY),this._actualInvTransform=Me.clone(Me.IDENTITY),this._transformChanged=!1,this.position=new O,this._position=new O,this._positionWC=new O,this._positionCartographic=new R,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new O,this._direction=new O,this._directionWC=new O,this.up=new O,this._up=new O,this._upWC=new O,this.right=new O,this._right=new O,this._rightWC=new O,this.frustum=new dv,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=h.a.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new un.a,this._moveEnd=new un.a,this._changed=new un.a,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new Me,this._invViewMatrix=new Me,DOe(this),this._mode=AB.SCENE3D,this._modeChanged=!0;const t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new R(Math.PI,h.a.PI_OVER_TWO)),this._max2Dfrustum=void 0,Ywe(this,POe.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=O.magnitude(this.position);n+=n*POe.DEFAULT_VIEW_FACTOR,O.normalize(this.position,this.position),O.multiplyByScalar(this.position,n,this.position)}function DOe(e){Me.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),Me.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),Me.inverseTransformation(e._viewMatrix,e._invViewMatrix)}POe.TRANSFORM_2D=new Me(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),POe.TRANSFORM_2D_INVERSE=Me.inverseTransformation(POe.TRANSFORM_2D,new Me),POe.DEFAULT_VIEW_RECTANGLE=Be.fromDegrees(-95,-20,-70,90),POe.DEFAULT_VIEW_FACTOR=.5,POe.DEFAULT_OFFSET=new uA(0,-h.a.PI_OVER_FOUR,0),POe.prototype.canPreloadFlight=function(){return Object(l.a)(this._currentFlight)&&this._mode!==AB.SCENE2D},POe.prototype._updateCameraChanged=function(){const e=this;if(function(e){if(Object(l.a)(e._oldPositionWC)){e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;const t=O.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=O.magnitude(t),e._oldPositionWC=O.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Xf()):e.timeSinceMoved=Math.max(Xf()-e._lastMovedTimestamp,0)/1e3}else e._oldPositionWC=O.clone(e.positionWC,e._oldPositionWC)}(e),0===e._changed.numberOfListeners)return;const t=e.percentageChanged,n=e.heading;Object(l.a)(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%h.a.TWO_PI;i=i>h.a.PI?h.a.TWO_PI-i:i;const r=i/Math.PI;if(r>t&&(e._changed.raiseEvent(r),e._changedHeading=n),e._mode===AB.SCENE2D){if(!Object(l.a)(e._changedFrustum))return e._changedPosition=O.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());const n=e.position,i=e._changedPosition,r=e.frustum,o=e._changedFrustum,a=n.x+r.left,s=n.x+r.right,c=i.x+o.left,u=i.x+o.right,h=n.y+r.bottom,d=n.y+r.top,f=i.y+o.bottom,p=i.y+o.top,m=Math.max(a,c),g=Math.min(s,u),_=Math.max(h,f),y=Math.min(d,p);let b;if(m>=g||_>=d)b=1;else{let e=o;a<c&&s>u&&h<f&&d>p&&(e=r),b=1-(g-m)*(y-_)/((e.right-e.left)*(e.top-e.bottom))}return void(b>t&&(e._changed.raiseEvent(b),e._changedPosition=O.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!Object(l.a)(e._changedDirection))return e._changedPosition=O.clone(e.positionWC,e._changedPosition),void(e._changedDirection=O.clone(e.directionWC,e._changedDirection));const o=h.a.acosClamped(O.dot(e.directionWC,e._changedDirection));let a;a=Object(l.a)(e.frustum.fovy)?o/(.5*e.frustum.fovy):o;const s=O.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(a>t||s>t)&&(e._changed.raiseEvent(Math.max(a,s)),e._changedPosition=O.clone(e.positionWC,e._changedPosition),e._changedDirection=O.clone(e.directionWC,e._changedDirection))};const ROe=new R,jOe=new O,MOe=new O,LOe=new _e,NOe=new _e,BOe=new _e,FOe=new _e,zOe=new _e;const kOe=new O;function UOe(e){const t=e._mode;let n=!1,i=0;t===AB.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position;const o=!O.equals(r,e.position)||n;o&&(r=O.clone(e.position,e._position));let a=e._direction;const s=!O.equals(a,e.direction);s&&(O.normalize(e.direction,e.direction),a=O.clone(e.direction,e._direction));let c=e._up;const l=!O.equals(c,e.up);l&&(O.normalize(e.up,e.up),c=O.clone(e.up,e._up));let u=e._right;const d=!O.equals(u,e.right);d&&(O.normalize(e.right,e.right),u=O.clone(e.right,e._right));const f=e._transformChanged||e._modeChanged;e._transformChanged=!1,f&&(Me.inverseTransformation(e._transform,e._invTransform),e._mode===AB.COLUMBUS_VIEW||e._mode===AB.SCENE2D?Me.equals(Me.IDENTITY,e._transform)?Me.clone(POe.TRANSFORM_2D,e._actualTransform):e._mode===AB.COLUMBUS_VIEW?function(e){ca.basisTo2D(e._projection,e._transform,e._actualTransform)}(e):function(e){const t=e._projection,n=t.ellipsoid,i=Me.getColumn(e._transform,3,LOe),r=n.cartesianToCartographic(i,ROe),o=t.project(r,jOe),a=NOe;a.x=o.z,a.y=o.x,a.z=o.y,a.w=1;const s=_e.clone(_e.UNIT_X,zOe),c=_e.add(Me.getColumn(e._transform,0,MOe),i,MOe);n.cartesianToCartographic(c,r),t.project(r,o);const l=BOe;l.x=o.z,l.y=o.x,l.z=o.y,l.w=0,O.subtract(l,a,l),l.x=0;const u=FOe;if(O.magnitudeSquared(l)>h.a.EPSILON10)O.cross(s,l,u);else{const s=_e.add(Me.getColumn(e._transform,1,MOe),i,MOe);n.cartesianToCartographic(s,r),t.project(r,o),u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,O.subtract(u,a,u),u.x=0,O.magnitudeSquared(u)<h.a.EPSILON10&&(_e.clone(_e.UNIT_Y,l),_e.clone(_e.UNIT_Z,u))}O.cross(u,s,l),O.normalize(l,l),O.cross(s,l,u),O.normalize(u,u),Me.setColumn(e._actualTransform,0,l,e._actualTransform),Me.setColumn(e._actualTransform,1,u,e._actualTransform),Me.setColumn(e._actualTransform,2,s,e._actualTransform),Me.setColumn(e._actualTransform,3,a,e._actualTransform)}(e):Me.clone(e._transform,e._actualTransform),Me.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);const p=e._actualTransform;if(o||f)if(e._positionWC=Me.multiplyByPoint(p,r,e._positionWC),t===AB.SCENE3D||t===AB.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{const n=kOe;n.x=e._positionWC.y,n.y=e._positionWC.z,n.z=e._positionWC.x,t===AB.SCENE2D&&(n.z=i),e._projection.unproject(n,e._positionCartographic)}if(s||l||d){const t=O.dot(a,O.cross(c,u,kOe));if(Math.abs(1-t)>h.a.EPSILON2){const t=1/O.magnitudeSquared(c),n=O.dot(c,a)*t,i=O.multiplyByScalar(a,n,kOe);c=O.normalize(O.subtract(c,i,e._up),e._up),O.clone(c,e.up),u=O.cross(a,c,e._right),O.clone(u,e.right)}}(s||f)&&(e._directionWC=Me.multiplyByPointAsVector(p,a,e._directionWC),O.normalize(e._directionWC,e._directionWC)),(l||f)&&(e._upWC=Me.multiplyByPointAsVector(p,c,e._upWC),O.normalize(e._upWC,e._upWC)),(d||f)&&(e._rightWC=Me.multiplyByPointAsVector(p,u,e._rightWC),O.normalize(e._rightWC,e._rightWC)),(o||s||l||d||f)&&DOe(e)}function VOe(e,t){let n;return n=h.a.equalsEpsilon(Math.abs(e.z),1,h.a.EPSILON3)?Math.atan2(t.y,t.x)-h.a.PI_OVER_TWO:Math.atan2(e.y,e.x)-h.a.PI_OVER_TWO,h.a.TWO_PI-h.a.zeroToTwoPi(n)}function HOe(e){return h.a.PI_OVER_TWO-h.a.acosClamped(e.z)}function GOe(e,t,n){let i=0;return h.a.equalsEpsilon(Math.abs(e.z),1,h.a.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=h.a.zeroToTwoPi(i+h.a.TWO_PI)),i}const qOe=new Me,WOe=new Me;Object.defineProperties(POe.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return UOe(this),this._invTransform}},viewMatrix:{get:function(){return UOe(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return UOe(this),this._invViewMatrix}},positionCartographic:{get:function(){return UOe(this),this._positionCartographic}},positionWC:{get:function(){return UOe(this),this._positionWC}},directionWC:{get:function(){return UOe(this),this._directionWC}},upWC:{get:function(){return UOe(this),this._upWC}},rightWC:{get:function(){return UOe(this),this._rightWC}},heading:{get:function(){if(this._mode!==AB.MORPHING){const e=this._projection.ellipsoid,t=Me.clone(this._transform,qOe),n=ca.eastNorthUpToFixedFrame(this.positionWC,e,WOe);this._setTransform(n);const i=VOe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==AB.MORPHING){const e=this._projection.ellipsoid,t=Me.clone(this._transform,qOe),n=ca.eastNorthUpToFixedFrame(this.positionWC,e,WOe);this._setTransform(n);const i=HOe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==AB.MORPHING){const e=this._projection.ellipsoid,t=Me.clone(this._transform,qOe),n=ca.eastNorthUpToFixedFrame(this.positionWC,e,WOe);this._setTransform(n);const i=GOe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),POe.prototype.update=function(e){if(!Object(l.a)(e))throw new u.a("mode is required.");if(e===AB.SCENE2D&&!(this.frustum instanceof Qb))throw new u.a("An OrthographicOffCenterFrustum is required in 2D.");if(!(e!==AB.SCENE3D&&e!==AB.COLUMBUS_VIEW||this.frustum instanceof dv||this.frustum instanceof nv))throw new u.a("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==AB.MORPHING,t=this._mode===AB.SCENE2D),t){const e=this._max2Dfrustum=this.frustum.clone();if(!(e instanceof Qb))throw new u.a("The camera frustum is expected to be orthographic for 2D camera control.");const t=2,n=e.top/e.right;e.right=this._maxCoord.x*t,e.left=-e.right,e.top=n*e.right,e.bottom=-e.top}this._mode===AB.SCENE2D&&pwe(this,this.position)};const YOe=new O,XOe=new O,KOe=new O;POe.prototype._setTransform=function(e){const t=O.clone(this.positionWC,YOe),n=O.clone(this.upWC,XOe),i=O.clone(this.directionWC,KOe);Me.clone(e,this._transform),this._transformChanged=!0,UOe(this);const r=this._actualInvTransform;Me.multiplyByPoint(r,t,this.position),Me.multiplyByPointAsVector(r,i,this.direction),Me.multiplyByPointAsVector(r,n,this.up),O.cross(this.direction,this.up,this.right),UOe(this)};const JOe=new Vt,ZOe=new Gn,$Oe=new O,QOe=new O;function ewe(e){if(!Me.equals(Me.IDENTITY,e.transform))return O.magnitude(e.position);const t=e._scene,n=t.globe,i=JOe;let r,o,a;if(i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2,Object(l.a)(n)){const o=e.getPickRay(i,ZOe);r=n.pickWorldCoordinates(o,t,!0,$Oe)}if(t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,QOe)),Object(l.a)(r)||Object(l.a)(o)){const t=Object(l.a)(o)?O.distance(o,e.positionWC):Number.POSITIVE_INFINITY,n=Object(l.a)(r)?O.distance(r,e.positionWC):Number.POSITIVE_INFINITY;a=Math.min(t,n)}else a=Math.max(e.positionCartographic.height,0);return a}POe.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof nv&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=ewe(this)))};const twe=new O,nwe=new Me,iwe=new Me,rwe=new To,owe=new ce,awe=new R;const swe=new O,cwe=new O,lwe=new O;function uwe(e,t,n,i){const r=O.clone(n.direction,swe),o=O.clone(n.up,cwe);if(e._scene.mode===AB.SCENE3D){const n=e._projection.ellipsoid,i=ca.eastNorthUpToFixedFrame(t,n,qOe),a=Me.inverseTransformation(i,WOe);Me.multiplyByPointAsVector(a,r,r),Me.multiplyByPointAsVector(a,o,o)}const a=O.cross(r,o,lwe);return i.heading=VOe(r,o),i.pitch=HOe(r),i.roll=GOe(r,o,a),i}const hwe={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},dwe=new ur;POe.prototype.setView=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);let t=Object(c.a)(e.orientation,c.a.EMPTY_OBJECT);const n=this._mode;if(n===AB.MORPHING)return;Object(l.a)(e.endTransform)&&this._setTransform(e.endTransform);let i=Object(c.a)(e.convert,!0),r=Object(c.a)(e.destination,O.clone(this.positionWC,twe));Object(l.a)(r)&&Object(l.a)(r.west)&&(r=this.getRectangleCameraCoordinates(r,twe),i=!1),Object(l.a)(t.direction)&&(t=uwe(this,r,t,hwe.orientation)),dwe.heading=Object(c.a)(t.heading,0),dwe.pitch=Object(c.a)(t.pitch,-h.a.PI_OVER_TWO),dwe.roll=Object(c.a)(t.roll,0),n===AB.SCENE3D?function(e,t,n){const i=Me.clone(e.transform,nwe),r=ca.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,iwe);e._setTransform(r),O.clone(O.ZERO,e.position),n.heading=n.heading-h.a.PI_OVER_TWO;const o=To.fromHeadingPitchRoll(n,rwe),a=ce.fromQuaternion(o,owe);ce.getColumn(a,0,e.direction),ce.getColumn(a,2,e.up),O.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}(this,r,dwe):n===AB.SCENE2D?function(e,t,n,i){const r=Me.clone(e.transform,nwe);if(e._setTransform(Me.IDENTITY),!O.equals(t,e.positionWC)){if(i){const n=e._projection,i=n.ellipsoid.cartesianToCartographic(t,awe);t=n.project(i,twe)}Vt.clone(t,e.position);const n=.5*-t.z,r=-n,o=e.frustum;if(r>n){const e=o.top/o.right;o.right=r,o.left=n,o.top=o.right*e,o.bottom=-o.top}}if(e._scene.mapMode2D===IOe.ROTATE){n.heading=n.heading-h.a.PI_OVER_TWO,n.pitch=-h.a.PI_OVER_TWO,n.roll=0;const t=To.fromHeadingPitchRoll(n,rwe),i=ce.fromQuaternion(t,owe);ce.getColumn(i,2,e.up),O.cross(e.direction,e.up,e.right)}e._setTransform(r)}(this,r,dwe,i):function(e,t,n,i){const r=Me.clone(e.transform,nwe);if(e._setTransform(Me.IDENTITY),!O.equals(t,e.positionWC)){if(i){const n=e._projection,i=n.ellipsoid.cartesianToCartographic(t,awe);t=n.project(i,twe)}O.clone(t,e.position)}n.heading=n.heading-h.a.PI_OVER_TWO;const o=To.fromHeadingPitchRoll(n,rwe),a=ce.fromQuaternion(o,owe);ce.getColumn(a,0,e.direction),ce.getColumn(a,2,e.up),O.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}(this,r,dwe,i)};const fwe=new O;function pwe(e,t){const n=e._scene.mapMode2D===IOe.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y;let o,a;n?(a=i,o=-a):(a=t.x-2*i,o=t.x+2*i),t.x>i&&(t.x=a),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}POe.prototype.flyHome=function(e){const t=this._mode;if(t===AB.MORPHING&&this._scene.completeMorph(),t===AB.SCENE2D)this.flyTo({destination:POe.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:Me.IDENTITY});else if(t===AB.SCENE3D){const t=this.getRectangleCameraCoordinates(POe.DEFAULT_VIEW_RECTANGLE);let n=O.magnitude(t);n+=n*POe.DEFAULT_VIEW_FACTOR,O.normalize(t,t),O.multiplyByScalar(t,n,t),this.flyTo({destination:t,duration:e,endTransform:Me.IDENTITY})}else if(t===AB.COLUMBUS_VIEW){const t=this._projection.ellipsoid.maximumRadius;let n=new O(0,-1,1);n=O.multiplyByScalar(O.normalize(n,n),5*t,n),this.flyTo({destination:n,duration:e,orientation:{heading:0,pitch:-Math.acos(O.normalize(n,fwe).z),roll:0},endTransform:Me.IDENTITY,convert:!1})}},POe.prototype.worldToCameraCoordinates=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required.");return Object(l.a)(t)||(t=new _e),UOe(this),Me.multiplyByVector(this._actualInvTransform,e,t)},POe.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required.");return Object(l.a)(t)||(t=new O),UOe(this),Me.multiplyByPoint(this._actualInvTransform,e,t)},POe.prototype.worldToCameraCoordinatesVector=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required.");return Object(l.a)(t)||(t=new O),UOe(this),Me.multiplyByPointAsVector(this._actualInvTransform,e,t)},POe.prototype.cameraToWorldCoordinates=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required.");return Object(l.a)(t)||(t=new _e),UOe(this),Me.multiplyByVector(this._actualTransform,e,t)},POe.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required.");return Object(l.a)(t)||(t=new O),UOe(this),Me.multiplyByPoint(this._actualTransform,e,t)},POe.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!Object(l.a)(e))throw new u.a("cartesian is required.");return Object(l.a)(t)||(t=new O),UOe(this),Me.multiplyByPointAsVector(this._actualTransform,e,t)};const mwe=new O;POe.prototype.move=function(e,t){if(!Object(l.a)(e))throw new u.a("direction is required.");const n=this.position;O.multiplyByScalar(e,t,mwe),O.add(n,mwe,n),this._mode===AB.SCENE2D&&pwe(this,n),this._adjustOrthographicFrustum(!0)},POe.prototype.moveForward=function(e){e=Object(c.a)(e,this.defaultMoveAmount),this._mode===AB.SCENE2D?Cwe(this,e):this.move(this.direction,e)},POe.prototype.moveBackward=function(e){e=Object(c.a)(e,this.defaultMoveAmount),this._mode===AB.SCENE2D?Cwe(this,-e):this.move(this.direction,-e)},POe.prototype.moveUp=function(e){e=Object(c.a)(e,this.defaultMoveAmount),this.move(this.up,e)},POe.prototype.moveDown=function(e){e=Object(c.a)(e,this.defaultMoveAmount),this.move(this.up,-e)},POe.prototype.moveRight=function(e){e=Object(c.a)(e,this.defaultMoveAmount),this.move(this.right,e)},POe.prototype.moveLeft=function(e){e=Object(c.a)(e,this.defaultMoveAmount),this.move(this.right,-e)},POe.prototype.lookLeft=function(e){e=Object(c.a)(e,this.defaultLookAmount),this._mode!==AB.SCENE2D&&this.look(this.up,-e)},POe.prototype.lookRight=function(e){e=Object(c.a)(e,this.defaultLookAmount),this._mode!==AB.SCENE2D&&this.look(this.up,e)},POe.prototype.lookUp=function(e){e=Object(c.a)(e,this.defaultLookAmount),this._mode!==AB.SCENE2D&&this.look(this.right,-e)},POe.prototype.lookDown=function(e){e=Object(c.a)(e,this.defaultLookAmount),this._mode!==AB.SCENE2D&&this.look(this.right,e)};const gwe=new To,_we=new ce;POe.prototype.look=function(e,t){if(!Object(l.a)(e))throw new u.a("axis is required.");const n=Object(c.a)(t,this.defaultLookAmount),i=To.fromAxisAngle(e,-n,gwe),r=ce.fromQuaternion(i,_we),o=this.direction,a=this.up,s=this.right;ce.multiplyByVector(r,o,o),ce.multiplyByVector(r,a,a),ce.multiplyByVector(r,s,s)},POe.prototype.twistLeft=function(e){e=Object(c.a)(e,this.defaultLookAmount),this.look(this.direction,e)},POe.prototype.twistRight=function(e){e=Object(c.a)(e,this.defaultLookAmount),this.look(this.direction,-e)};const ywe=new To,bwe=new ce;POe.prototype.rotate=function(e,t){if(!Object(l.a)(e))throw new u.a("axis is required.");const n=Object(c.a)(t,this.defaultRotateAmount),i=To.fromAxisAngle(e,-n,ywe),r=ce.fromQuaternion(i,bwe);ce.multiplyByVector(r,this.position,this.position),ce.multiplyByVector(r,this.direction,this.direction),ce.multiplyByVector(r,this.up,this.up),O.cross(this.direction,this.up,this.right),O.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},POe.prototype.rotateDown=function(e){Ewe(this,e=Object(c.a)(e,this.defaultRotateAmount))},POe.prototype.rotateUp=function(e){Ewe(this,-(e=Object(c.a)(e,this.defaultRotateAmount)))};const vwe=new O,Owe=new O,wwe=new O,Awe=new O;function Ewe(e,t){const n=e.position;if(Object(l.a)(e.constrainedAxis)&&!O.equalsEpsilon(e.position,O.ZERO,h.a.EPSILON2)){const i=O.normalize(n,vwe),r=O.equalsEpsilon(i,e.constrainedAxis,h.a.EPSILON2),o=O.equalsEpsilon(i,O.negate(e.constrainedAxis,Awe),h.a.EPSILON2);if(r||o)(r&&t<0||o&&t>0)&&e.rotate(e.right,t);else{const n=O.normalize(e.constrainedAxis,Owe);let r=O.dot(i,n),o=h.a.acosClamped(r);t>0&&t>o&&(t=o-h.a.EPSILON4),r=O.dot(i,O.negate(n,Awe)),o=h.a.acosClamped(r),t<0&&-t>o&&(t=-o+h.a.EPSILON4);const a=O.cross(n,i,wwe);e.rotate(a,t)}}else e.rotate(e.right,t)}function Twe(e,t){Object(l.a)(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function Cwe(e,t){const n=e.frustum;if(!(n instanceof Qb&&Object(l.a)(n.left)&&Object(l.a)(n.right)&&Object(l.a)(n.bottom)&&Object(l.a)(n.top)))throw new u.a("The camera frustum is expected to be orthographic for 2D camera control.");let i;if(t*=.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===IOe.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,r=-a),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,a=e._maxCoord.x;e._scene.mapMode2D===IOe.ROTATE&&(a*=e.maximumZoomFactor),r>a&&(r=a,o=-a),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function xwe(e,t){e.move(e.direction,t)}POe.prototype.rotateRight=function(e){Twe(this,-(e=Object(c.a)(e,this.defaultRotateAmount)))},POe.prototype.rotateLeft=function(e){Twe(this,e=Object(c.a)(e,this.defaultRotateAmount))},POe.prototype.zoomIn=function(e){e=Object(c.a)(e,this.defaultZoomAmount),this._mode===AB.SCENE2D?Cwe(this,e):xwe(this,e)},POe.prototype.zoomOut=function(e){e=Object(c.a)(e,this.defaultZoomAmount),this._mode===AB.SCENE2D?Cwe(this,-e):xwe(this,-e)},POe.prototype.getMagnitude=function(){return this._mode===AB.SCENE3D?O.magnitude(this.position):this._mode===AB.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===AB.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};const Swe=new Me;POe.prototype.lookAt=function(e,t){if(!Object(l.a)(e))throw new u.a("target is required");if(!Object(l.a)(t))throw new u.a("offset is required");if(this._mode===AB.MORPHING)throw new u.a("lookAt is not supported while morphing.");const n=ca.eastNorthUpToFixedFrame(e,H.WGS84,Swe);this.lookAtTransform(n,t)};const Iwe=new O,Pwe=new To,Dwe=new To,Rwe=new ce;function jwe(e,t,n){t=h.a.clamp(t,-h.a.PI_OVER_TWO,h.a.PI_OVER_TWO),e=h.a.zeroToTwoPi(e)-h.a.PI_OVER_TWO;const i=To.fromAxisAngle(O.UNIT_Y,-t,Pwe),r=To.fromAxisAngle(O.UNIT_Z,-e,Dwe),o=To.multiply(r,i,r),a=ce.fromQuaternion(o,Rwe),s=O.clone(O.UNIT_X,Iwe);return ce.multiplyByVector(a,s,s),O.negate(s,s),O.multiplyByScalar(s,n,s),s}POe.prototype.lookAtTransform=function(e,t){if(!Object(l.a)(e))throw new u.a("transform is required");if(this._mode===AB.MORPHING)throw new u.a("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!Object(l.a)(t))return;let n;if(n=Object(l.a)(t.heading)?jwe(t.heading,t.pitch,t.range):t,this._mode===AB.SCENE2D){Vt.clone(Vt.ZERO,this.position),O.negate(n,this.up),this.up.z=0,O.magnitudeSquared(this.up)<h.a.EPSILON10&&O.clone(O.UNIT_Y,this.up),O.normalize(this.up,this.up),this._setTransform(Me.IDENTITY),O.negate(O.UNIT_Z,this.direction),O.cross(this.direction,this.up,this.right),O.normalize(this.right,this.right);const t=this.frustum,i=t.top/t.right;return t.right=.5*O.magnitude(n),t.left=-t.right,t.top=i*t.right,t.bottom=-t.top,void this._setTransform(e)}O.clone(n,this.position),O.negate(this.position,this.direction),O.normalize(this.direction,this.direction),O.cross(this.direction,O.UNIT_Z,this.right),O.magnitudeSquared(this.right)<h.a.EPSILON10&&O.clone(O.UNIT_X,this.right),O.normalize(this.right,this.right),O.cross(this.right,this.direction,this.up),O.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};const Mwe=new R,Lwe=new R,Nwe=new O,Bwe=new O,Fwe=new O,zwe=new O,kwe=new O,Uwe=new O,Vwe=new O,Hwe=new O,Gwe={direction:new O,right:new O,up:new O};let qwe;function Wwe(e,t,n,i){return Math.abs(O.dot(t,n))/i-O.dot(e,n)}function Ywe(e,t,n,i){const r=e._projection.ellipsoid,o=i?e:Gwe,a=t.north,s=t.south;let c=t.east;const u=t.west;u>c&&(c+=h.a.TWO_PI);const d=.5*(u+c);let f;if(s<-h.a.PI_OVER_TWO+h.a.RADIANS_PER_DEGREE&&a>h.a.PI_OVER_TWO-h.a.RADIANS_PER_DEGREE)f=0;else{const e=Mwe;e.longitude=d,e.latitude=a,e.height=0;const t=Lwe;t.longitude=d,t.latitude=s,t.height=0;let n=qwe;Object(l.a)(n)&&n.ellipsoid===r||(qwe=n=new tg(void 0,void 0,r)),n.setEndPoints(e,t),f=n.interpolateUsingFraction(.5,Mwe).latitude}const p=Mwe;p.longitude=d,p.latitude=f,p.height=0;const m=r.cartographicToCartesian(p,Vwe),g=Mwe;g.longitude=c,g.latitude=a;const _=r.cartographicToCartesian(g,Nwe);g.longitude=u;const y=r.cartographicToCartesian(g,Fwe);g.longitude=d;const b=r.cartographicToCartesian(g,kwe);g.latitude=s;const v=r.cartographicToCartesian(g,Uwe);g.longitude=c;const w=r.cartographicToCartesian(g,zwe);g.longitude=u;const A=r.cartographicToCartesian(g,Bwe);O.subtract(y,m,y),O.subtract(w,m,w),O.subtract(_,m,_),O.subtract(A,m,A),O.subtract(b,m,b),O.subtract(v,m,v);const E=r.geodeticSurfaceNormal(m,o.direction);O.negate(E,E);const T=O.cross(E,O.UNIT_Z,o.right);O.normalize(T,T);const C=O.cross(T,E,o.up);let x;if(e.frustum instanceof nv){const t=Math.max(O.distance(_,y),O.distance(w,A)),n=Math.max(O.distance(_,w),O.distance(y,A));let i,r;const o=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,a=n*o;t>a?(i=t,r=i/o):(r=n,i=a),x=Math.max(i,r)}else{const t=Math.tan(.5*e.frustum.fovy),n=e.frustum.aspectRatio*t;if(x=Math.max(Wwe(E,C,y,t),Wwe(E,C,w,t),Wwe(E,C,_,t),Wwe(E,C,A,t),Wwe(E,C,b,t),Wwe(E,C,v,t),Wwe(E,T,y,n),Wwe(E,T,w,n),Wwe(E,T,_,n),Wwe(E,T,A,n),Wwe(E,T,b,n),Wwe(E,T,v,n)),s<0&&a>0){const e=Mwe;e.longitude=u,e.latitude=0,e.height=0;let i=r.cartographicToCartesian(e,Hwe);O.subtract(i,m,i),x=Math.max(x,Wwe(E,C,i,t),Wwe(E,T,i,n)),e.longitude=c,i=r.cartographicToCartesian(e,Hwe),O.subtract(i,m,i),x=Math.max(x,Wwe(E,C,i,t),Wwe(E,T,i,n))}}return O.add(m,O.multiplyByScalar(E,-x,Hwe),n)}const Xwe=new R,Kwe=new O,Jwe=new O;const Zwe=new R,$we=new O,Qwe=new O;POe.prototype.getRectangleCameraCoordinates=function(e,t){if(!Object(l.a)(e))throw new u.a("rectangle is required");const n=this._mode;return Object(l.a)(t)||(t=new O),n===AB.SCENE3D?Ywe(this,e,t):n===AB.COLUMBUS_VIEW?function(e,t,n){const i=e._projection;t.west>t.east&&(t=Be.MAX_VALUE);const r=e._actualTransform,o=e._actualInvTransform,a=Xwe;a.longitude=t.east,a.latitude=t.north;const s=i.project(a,Kwe);Me.multiplyByPoint(r,s,s),Me.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;const c=i.project(a,Jwe);if(Me.multiplyByPoint(r,c,c),Me.multiplyByPoint(o,c,c),n.x=.5*(s.x-c.x)+c.x,n.y=.5*(s.y-c.y)+c.y,Object(l.a)(e.frustum.fovy)){const t=Math.tan(.5*e.frustum.fovy),i=e.frustum.aspectRatio*t;n.z=.5*Math.max((s.x-c.x)/i,(s.y-c.y)/t)}else{const e=s.x-c.x,t=s.y-c.y;n.z=Math.max(e,t)}return n}(this,e,t):n===AB.SCENE2D?function(e,t,n){const i=e._projection;let r=t.east;t.west>t.east&&(e._scene.mapMode2D===IOe.INFINITE_SCROLL?r+=h.a.TWO_PI:r=(t=Be.MAX_VALUE).east);let o=Zwe;o.longitude=r,o.latitude=t.north;const a=i.project(o,$we);o.longitude=t.west,o.latitude=t.south;const s=i.project(o,Qwe),c=.5*Math.abs(a.x-s.x);let l,u,d=.5*Math.abs(a.y-s.y);const f=e.frustum.right/e.frustum.top,p=d*f;return c>p?(l=c,u=l/f):(u=d,l=p),d=Math.max(2*l,2*u),n.x=.5*(a.x-s.x)+s.x,n.y=.5*(a.y-s.y)+s.y,o=i.unproject(n,o),o.height=d,n=i.project(o,n)}(this,e,t):void 0};const eAe=new Gn;const tAe=new Gn;const nAe=new Gn;POe.prototype.pickEllipsoid=function(e,t,n){if(!Object(l.a)(e))throw new u.a("windowPosition is required.");const i=this._scene.canvas;if(0!==i.clientWidth&&0!==i.clientHeight){if(Object(l.a)(n)||(n=new O),t=Object(c.a)(t,H.WGS84),this._mode===AB.SCENE3D)n=function(e,t,n,i){n=Object(c.a)(n,H.WGS84);const r=e.getPickRay(t,eAe),o=vi.rayEllipsoid(r,n);if(!o)return;const a=o.start>0?o.start:o.stop;return Gn.getPoint(r,a,i)}(this,e,t,n);else if(this._mode===AB.SCENE2D)n=function(e,t,n,i){let r=e.getPickRay(t,tAe).origin;r=O.fromElements(r.y,r.z,0,r);const o=n.unproject(r);if(!(o.latitude<-h.a.PI_OVER_TWO||o.latitude>h.a.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(o,i)}(this,e,this._projection,n);else{if(this._mode!==AB.COLUMBUS_VIEW)return;n=function(e,t,n,i){const r=e.getPickRay(t,nAe),o=-r.origin.x/r.direction.x;Gn.getPoint(r,o,i);const a=n.unproject(new O(i.y,i.z,0));if(!(a.latitude<-h.a.PI_OVER_TWO||a.latitude>h.a.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(a,i)}(this,e,this._projection,n)}return n}};const iAe=new O,rAe=new O,oAe=new O;const aAe=new O;POe.prototype.getPickRay=function(e,t){if(!Object(l.a)(e))throw new u.a("windowPosition is required.");Object(l.a)(t)||(t=new Gn);const n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;const i=this.frustum;return Object(l.a)(i.aspectRatio)&&Object(l.a)(i.fov)&&Object(l.a)(i.near)?function(e,t,n){const i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,a=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*a,c=e.frustum.near,l=2/r*t.x-1,u=2/o*(o-t.y)-1,h=e.positionWC;O.clone(h,n.origin);const d=O.multiplyByScalar(e.directionWC,c,iAe);O.add(h,d,d);const f=O.multiplyByScalar(e.rightWC,l*c*s,rAe),p=O.multiplyByScalar(e.upWC,u*c*a,oAe),m=O.add(d,f,n.direction);return O.add(m,p,m),O.subtract(m,h,m),O.normalize(m,m),n}(this,e,t):function(e,t,n){const i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight;let a=e.frustum;Object(l.a)(a._offCenterFrustum)&&(a=a._offCenterFrustum);let s=2/r*t.x-1;s*=.5*(a.right-a.left);let c=2/o*(o-t.y)-1;c*=.5*(a.top-a.bottom);const u=n.origin;return O.clone(e.position,u),O.multiplyByScalar(e.right,s,aAe),O.add(aAe,u,u),O.multiplyByScalar(e.up,c,aAe),O.add(aAe,u,u),O.clone(e.directionWC,n.direction),e._mode!==AB.COLUMBUS_VIEW&&e._mode!==AB.SCENE2D||O.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}(this,e,t)};const sAe=new O,cAe=new O;POe.prototype.distanceToBoundingSphere=function(e){if(!Object(l.a)(e))throw new u.a("boundingSphere is required.");const t=O.subtract(this.positionWC,e.center,sAe),n=O.multiplyByScalar(this.directionWC,O.dot(t,this.directionWC),cAe);return Math.max(0,O.magnitude(n)-e.radius)};const lAe=new Vt;POe.prototype.getPixelSize=function(e,t,n){if(!Object(l.a)(e))throw new u.a("boundingSphere is required.");if(!Object(l.a)(t))throw new u.a("drawingBufferWidth is required.");if(!Object(l.a)(n))throw new u.a("drawingBufferHeight is required.");const i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,lAe);return Math.max(r.x,r.y)};const uAe=new O,hAe=new O,dAe=new O,fAe=new O;function pAe(e,t){let n=e.position;const i=e.direction,r=e.worldToCameraCoordinatesVector(O.UNIT_X,uAe),o=-O.dot(r,n)/O.dot(r,i),a=O.add(n,O.multiplyByScalar(i,o,hAe),hAe);e.cameraToWorldCoordinatesPoint(a,a),n=e.cameraToWorldCoordinatesPoint(e.position,dAe);const s=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*s,l=O.magnitude(O.subtract(n,a,fAe)),u=c*l,h=s*l,d=e._maxCoord.x,f=e._maxCoord.y,p=Math.max(u-d,d),m=Math.max(h-f,f);if(n.z<-p||n.z>p||n.y<-m||n.y>m){const i=a.y<-p||a.y>p,r=a.z<-m||a.z>m;if(i||r)return function(e,t,n,i,r,o){const a=O.clone(t);return n.y>i?a.y-=n.y-i:n.y<-i&&(a.y+=-i-n.y),n.z>r?a.z-=n.z-r:n.z<-r&&(a.z+=-r-n.z),{easingFunction:_b.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:function(n){const i=O.lerp(t,a,n.time,new O);e.worldToCameraCoordinatesPoint(i,e.position)}}}(e,n,a,p,m,t)}}POe.prototype.createCorrectPositionTween=function(e){if(!Object(l.a)(e))throw new u.a("duration is required.");if(this._mode===AB.COLUMBUS_VIEW)return pAe(this,e)};const mAe=new O,gAe={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};POe.prototype.cancelFlight=function(){Object(l.a)(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},POe.prototype.completeFlight=function(){if(Object(l.a)(this._currentFlight)){this._currentFlight.cancelTween();const e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=gAe.destination,e.orientation.heading=gAe.heading,e.orientation.pitch=gAe.pitch,e.orientation.roll=gAe.roll,this.setView(e),Object(l.a)(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}},POe.prototype.flyTo=function(e){let t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).destination;if(!Object(l.a)(t))throw new u.a("destination is required.");if(this._mode===AB.MORPHING)return;this.cancelFlight();let n=Object(c.a)(e.orientation,c.a.EMPTY_OBJECT);if(Object(l.a)(n.direction)&&(n=uwe(this,t,n,hwe.orientation)),Object(l.a)(e.duration)&&e.duration<=0){const t=hwe;return t.destination=e.destination,t.orientation.heading=n.heading,t.orientation.pitch=n.pitch,t.orientation.roll=n.roll,t.convert=e.convert,t.endTransform=e.endTransform,this.setView(t),void("function"==typeof e.complete&&e.complete())}const i=Object(l.a)(t.west);i&&(t=this.getRectangleCameraCoordinates(t,mAe));const r=this;let o;gAe.destination=t,gAe.heading=n.heading,gAe.pitch=n.pitch,gAe.roll=n.roll,gAe.duration=e.duration,gAe.complete=function(){o===r._currentFlight&&(r._currentFlight=void 0),Object(l.a)(e.complete)&&e.complete()},gAe.cancel=e.cancel,gAe.endTransform=e.endTransform,gAe.convert=!i&&e.convert,gAe.maximumHeight=e.maximumHeight,gAe.pitchAdjustHeight=e.pitchAdjustHeight,gAe.flyOverLongitude=e.flyOverLongitude,gAe.flyOverLongitudeWeight=e.flyOverLongitudeWeight,gAe.easingFunction=e.easingFunction;const a=this._scene,s=SOe.createTween(a,gAe);if(0===s.duration)return void("function"==typeof s.complete&&s.complete());o=a.tweens.add(s),this._currentFlight=o;let h=this._scene.preloadFlightCamera;this._mode!==AB.SCENE2D&&(Object(l.a)(h)||(h=POe.clone(this)),h.setView({destination:t,orientation:n}),this._scene.preloadFlightCullingVolume=h.frustum.computeCullingVolume(h.positionWC,h.directionWC,h.upWC))};function _Ae(e,t,n){n=uA.clone(Object(l.a)(n)?n:POe.DEFAULT_OFFSET);const i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!Object(l.a)(o)||0===o){const o=t.radius;0===o?n.range=100:e.frustum instanceof nv||e._mode===AB.SCENE2D?n.range=function(e,t){let n,i,r=e.frustum;Object(l.a)(r._offCenterFrustum)&&(r=r._offCenterFrustum);const o=r.right/r.top,a=t*o;return t>a?(n=t,i=n/o):(i=t,n=a),1.5*Math.max(n,i)}(e,o):n.range=function(e,t){const n=e.frustum,i=Math.tan(.5*n.fovy),r=n.aspectRatio*i;return Math.max(t/r,t/i)}(e,o),n.range=h.a.clamp(n.range,i,r)}return n}POe.prototype.viewBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("boundingSphere is required.");if(this._mode===AB.MORPHING)throw new u.a("viewBoundingSphere is not supported while morphing.");t=_Ae(this,e,t),this.lookAt(e.center,t)};const yAe=new Me,bAe=new O,vAe=new O,OAe=new O,wAe=new O,AAe=new _e,EAe=new To,TAe=new ce;POe.prototype.flyToBoundingSphere=function(e,t){if(!Object(l.a)(e))throw new u.a("boundingSphere is required.");t=Object(c.a)(t,c.a.EMPTY_OBJECT);const n=this._mode===AB.SCENE2D||this._mode===AB.COLUMBUS_VIEW;this._setTransform(Me.IDENTITY);const i=_Ae(this,e,t.offset);let r;r=n?O.multiplyByScalar(O.UNIT_Z,i.range,bAe):jwe(i.heading,i.pitch,i.range);const o=ca.eastNorthUpToFixedFrame(e.center,H.WGS84,yAe);let a,s;if(Me.multiplyByPoint(o,r,r),!n){if(a=O.subtract(e.center,r,vAe),O.normalize(a,a),s=Me.multiplyByPointAsVector(o,O.UNIT_Z,OAe),1-Math.abs(O.dot(a,s))<h.a.EPSILON6){const e=To.fromAxisAngle(a,i.heading,EAe),t=ce.fromQuaternion(e,TAe);O.fromCartesian4(Me.getColumn(o,1,AAe),s),ce.multiplyByVector(t,s,s)}const t=O.cross(a,s,wAe);O.cross(t,a,s),O.normalize(s,s)}this.flyTo({destination:r,orientation:{direction:a,up:s},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};const CAe=new O,xAe=new O,SAe=new O,IAe=new O,PAe=[new O,new O,new O,new O];const DAe=new Vt,RAe=new O,jAe=[new R,new R,new R,new R];function MAe(e,t,n,i,r,o){DAe.x=e,DAe.y=t;const a=i.pickEllipsoid(DAe,r,RAe);return Object(l.a)(a)?(jAe[n]=r.cartesianToCartographic(a,jAe[n]),1):(jAe[n]=r.cartesianToCartographic(o[n],jAe[n]),0)}POe.prototype.computeViewRectangle=function(e,t){e=Object(c.a)(e,H.WGS84);const n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new At(O.ZERO,e.maximumRadius);if(n.computeVisibility(i)===W.OUTSIDE)return;const r=this._scene.canvas,o=r.clientWidth,a=r.clientHeight;let s=0;const l=function(e,t){const n=t.radii,i=e.positionWC,r=O.multiplyComponents(t.oneOverRadii,i,CAe),o=O.magnitude(r),a=O.normalize(r,xAe);let s,c;O.equalsEpsilon(a,O.UNIT_Z,h.a.EPSILON10)?(s=new O(0,1,0),c=new O(0,0,1)):(s=O.normalize(O.cross(O.UNIT_Z,a,SAe),SAe),c=O.normalize(O.cross(a,s,IAe),IAe));const l=Math.sqrt(O.magnitudeSquared(r)-1),u=O.multiplyByScalar(a,1/o,CAe),d=l/o,f=O.multiplyByScalar(s,d,xAe),p=O.multiplyByScalar(c,d,SAe),m=O.add(u,p,PAe[0]);O.subtract(m,f,m),O.multiplyComponents(n,m,m);const g=O.subtract(u,p,PAe[1]);O.subtract(g,f,g),O.multiplyComponents(n,g,g);const _=O.subtract(u,p,PAe[2]);O.add(_,f,_),O.multiplyComponents(n,_,_);const y=O.add(u,p,PAe[3]);return O.add(y,f,y),O.multiplyComponents(n,y,y),PAe}(this,e);if(s+=MAe(0,0,0,this,e,l),s+=MAe(0,a,1,this,e,l),s+=MAe(o,a,2,this,e,l),s+=MAe(o,0,3,this,e,l),s<2)return Be.MAX_VALUE;t=Be.fromCartographicArray(jAe,t);let u=0,d=jAe[3].longitude;for(let e=0;e<4;++e){const t=jAe[e].longitude,n=Math.abs(t-d);n>h.a.PI?u+=h.a.TWO_PI-n:u+=n,d=t}return h.a.equalsEpsilon(Math.abs(u),h.a.TWO_PI,h.a.EPSILON9)&&(t.west=-h.a.PI,t.east=h.a.PI,jAe[0].latitude>=0?t.north=h.a.PI_OVER_TWO:t.south=-h.a.PI_OVER_TWO),t},POe.prototype.switchToPerspectiveFrustum=function(){if(this._mode===AB.SCENE2D||this.frustum instanceof dv)return;const e=this._scene;this.frustum=new dv,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=h.a.toRadians(60)},POe.prototype.switchToOrthographicFrustum=function(){if(this._mode===AB.SCENE2D||this.frustum instanceof nv)return;const e=ewe(this),t=this._scene;this.frustum=new nv,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e},POe.clone=function(e,t){return Object(l.a)(t)||(t=new POe(e._scene)),O.clone(e.position,t.position),O.clone(e.direction,t.direction),O.clone(e.up,t.up),O.clone(e.right,t.right),Me.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var LAe=POe;var NAe=Object.freeze({LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4});function BAe(e,t){let n=e;return Object(l.a)(t)&&(n+="+"+t),n}function FAe(e,t,n){const i=BAe(NAe.PINCH,t),r=e._update,o=e._isDown,a=e._eventStartPosition,s=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,a[i]=new Vt;let u=e._movement[i];Object(l.a)(u)||(u=e._movement[i]={}),u.distance={startPosition:new Vt,endPosition:new Vt},u.angleAndHeight={startPosition:new Vt,endPosition:new Vt},u.prevAngle=0,e._eventHandler.setInputAction((function(t){e._buttonsDown++,o[i]=!0,s[i]=new Date,Vt.lerp(t.position1,t.position2,.5,a[i])}),fS.PINCH_START,t),e._eventHandler.setInputAction((function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date}),fS.PINCH_END,t),e._eventHandler.setInputAction((function(e){if(o[i]){r[i]?(t=e,a=u,Vt.clone(t.distance.startPosition,a.distance.startPosition),Vt.clone(t.distance.endPosition,a.distance.endPosition),Vt.clone(t.angleAndHeight.startPosition,a.angleAndHeight.startPosition),Vt.clone(t.angleAndHeight.endPosition,a.angleAndHeight.endPosition),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(Vt.clone(e.distance.endPosition,u.distance.endPosition),Vt.clone(e.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let o=u.angleAndHeight.endPosition.x;const s=u.prevAngle,c=2*Math.PI;for(;o>=s+Math.PI;)o-=c;for(;o<s-Math.PI;)o+=c;u.angleAndHeight.endPosition.x=-o*n.clientWidth/12,u.angleAndHeight.startPosition.x=-s*n.clientWidth/12}var t,a}),fS.PINCH_MOVE,t)}function zAe(e,t){const n=BAe(NAe.WHEEL,t),i=e._update;i[n]=!0;let r=e._movement[n];Object(l.a)(r)||(r=e._movement[n]={}),r.startPosition=new Vt,r.endPosition=new Vt,e._eventHandler.setInputAction((function(e){const t=15*h.a.toRadians(e);i[n]?(Vt.clone(Vt.ZERO,r.startPosition),r.endPosition.x=0,r.endPosition.y=t,i[n]=!1):r.endPosition.y=r.endPosition.y+t}),fS.WHEEL,t)}function kAe(e,t,n){const i=BAe(n,t),r=e._isDown,o=e._eventStartPosition,a=e._pressTime,s=e._releaseTime;r[i]=!1,o[i]=new Vt;let c,u,h=e._lastMovement[i];Object(l.a)(h)||(h=e._lastMovement[i]={startPosition:new Vt,endPosition:new Vt,valid:!1}),n===NAe.LEFT_DRAG?(c=fS.LEFT_DOWN,u=fS.LEFT_UP):n===NAe.RIGHT_DRAG?(c=fS.RIGHT_DOWN,u=fS.RIGHT_UP):n===NAe.MIDDLE_DRAG&&(c=fS.MIDDLE_DOWN,u=fS.MIDDLE_UP),e._eventHandler.setInputAction((function(t){e._buttonsDown++,h.valid=!1,r[i]=!0,a[i]=new Date,Vt.clone(t.position,o[i])}),c,t),e._eventHandler.setInputAction((function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,s[i]=new Date}),u,t)}function UAe(e,t){Vt.clone(e.startPosition,t.startPosition),Vt.clone(e.endPosition,t.endPosition)}function VAe(e,t){const n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(const i in NAe)if(NAe.hasOwnProperty(i)){const r=NAe[i];if(Object(l.a)(r)){const i=BAe(r,t);n[i]=!0,Object(l.a)(e._lastMovement[i])||(e._lastMovement[i]={startPosition:new Vt,endPosition:new Vt,valid:!1}),Object(l.a)(e._movement[i])||(e._movement[i]={startPosition:new Vt,endPosition:new Vt})}}e._eventHandler.setInputAction((function(a){for(const e in NAe)if(NAe.hasOwnProperty(e)){const s=NAe[e];if(Object(l.a)(s)){const e=BAe(s,t);o[e]&&(n[e]?(UAe(i[e],r[e]),r[e].valid=!0,UAe(a,i[e]),n[e]=!1):Vt.clone(a.endPosition,i[e].endPosition))}}Vt.clone(a.endPosition,e._currentMousePosition)}),fS.MOUSE_MOVE,t)}function HAe(e){if(!Object(l.a)(e))throw new u.a("canvas is required.");this._eventHandler=new ZS(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new Vt,zAe(this,void 0),FAe(this,void 0,e),kAe(this,void 0,NAe.LEFT_DRAG),kAe(this,void 0,NAe.RIGHT_DRAG),kAe(this,void 0,NAe.MIDDLE_DRAG),VAe(this,void 0);for(const t in ZA)if(ZA.hasOwnProperty(t)){const n=ZA[t];Object(l.a)(n)&&(zAe(this,n),FAe(this,n,e),kAe(this,n,NAe.LEFT_DRAG),kAe(this,n,NAe.RIGHT_DRAG),kAe(this,n,NAe.MIDDLE_DRAG),VAe(this,n))}}Object.defineProperties(HAe.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){const e=!(this._update[BAe(NAe.WHEEL)]&&this._update[BAe(NAe.WHEEL,ZA.SHIFT)]&&this._update[BAe(NAe.WHEEL,ZA.CTRL)]&&this._update[BAe(NAe.WHEEL,ZA.ALT)]);return this._buttonsDown>0||e}}}),HAe.prototype.isMoving=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=BAe(e,t);return!this._update[n]},HAe.prototype.getMovement=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=BAe(e,t);return this._movement[n]},HAe.prototype.getLastMovement=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=BAe(e,t),i=this._lastMovement[n];if(i.valid)return i},HAe.prototype.isButtonDown=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=BAe(e,t);return this._isDown[n]},HAe.prototype.getStartMousePosition=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");if(e===NAe.WHEEL)return this._currentMousePosition;const n=BAe(e,t);return this._eventStartPosition[n]},HAe.prototype.getButtonPressTime=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=BAe(e,t);return this._pressTime[n]},HAe.prototype.getButtonReleaseTime=function(e,t){if(!Object(l.a)(e))throw new u.a("type is required.");const n=BAe(e,t);return this._releaseTime[n]},HAe.prototype.reset=function(){for(const e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},HAe.prototype.isDestroyed=function(){return!1},HAe.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),sc(this)};var GAe=HAe;function qAe(){this.featurePropertiesDirty=!1}Object.defineProperties(qAe.prototype,{featuresLength:{get:function(){u.a.throwInstantiationError()}},pointsLength:{get:function(){u.a.throwInstantiationError()}},trianglesLength:{get:function(){u.a.throwInstantiationError()}},geometryByteLength:{get:function(){u.a.throwInstantiationError()}},texturesByteLength:{get:function(){u.a.throwInstantiationError()}},batchTableByteLength:{get:function(){u.a.throwInstantiationError()}},innerContents:{get:function(){u.a.throwInstantiationError()}},readyPromise:{get:function(){u.a.throwInstantiationError()}},tileset:{get:function(){u.a.throwInstantiationError()}},tile:{get:function(){u.a.throwInstantiationError()}},url:{get:function(){u.a.throwInstantiationError()}},batchTable:{get:function(){u.a.throwInstantiationError()}},metadata:{get:function(){u.a.throwInstantiationError()},set:function(e){u.a.throwInstantiationError()}},group:{get:function(){u.a.throwInstantiationError()},set:function(e){u.a.throwInstantiationError()}}}),qAe.prototype.hasProperty=function(e,t){u.a.throwInstantiationError()},qAe.prototype.getFeature=function(e){u.a.throwInstantiationError()},qAe.prototype.applyDebugSettings=function(e,t){u.a.throwInstantiationError()},qAe.prototype.applyStyle=function(e){u.a.throwInstantiationError()},qAe.prototype.update=function(e,t){u.a.throwInstantiationError()},qAe.prototype.isDestroyed=function(){u.a.throwInstantiationError()},qAe.prototype.destroy=function(){u.a.throwInstantiationError()};var WAe=qAe;var YAe=function(e){s.a.typeOf.object("options",e),s.a.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1};function XAe(e,t){this._conditionsExpression=Object(Zf.a)(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,function(e,t){const n=[],i=e._conditions;if(!Object(l.a)(i))return;const r=i.length;for(let e=0;e<r;++e){const r=i[e],o=String(r[0]),a=String(r[1]);n.push(new KAe(new WG(o,t),new WG(a,t)))}e._runtimeConditions=n}(this,t)}function KAe(e,t){this.condition=e,this.expression=t}Object.defineProperties(XAe.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),XAe.prototype.evaluate=function(e,t){const n=this._runtimeConditions;if(!Object(l.a)(n))return;const i=n.length;for(let r=0;r<i;++r){const i=n[r];if(i.condition.evaluate(e))return i.expression.evaluate(e,t)}},XAe.prototype.evaluateColor=function(e,t){const n=this._runtimeConditions;if(!Object(l.a)(n))return;const i=n.length;for(let r=0;r<i;++r){const i=n[r];if(i.condition.evaluate(e))return i.expression.evaluateColor(e,t)}},XAe.prototype.getShaderFunction=function(e,t,n,i){const r=this._runtimeConditions;if(!Object(l.a)(r)||0===r.length)return;let o="";const a=r.length;for(let e=0;e<a;++e){const i=r[e];o+=`    ${0===e?"if":"else if"} (${i.condition.getShaderExpression(t,n)})\n    {\n        return ${i.expression.getShaderExpression(t,n)};\n    }\n`}return o=`${i} ${e}\n{\n${o}    return ${i}(1.0);\n}\n`,o},XAe.prototype.getVariables=function(){let e=[];const t=this._runtimeConditions;if(!Object(l.a)(t)||0===t.length)return e;const n=t.length;for(let i=0;i<n;++i){const n=t[i];e.push.apply(e,n.condition.getVariables()),e.push.apply(e,n.expression.getVariables())}return e=e.filter((function(e,t,n){return n.indexOf(e)===t})),e};var JAe=XAe;function ZAe(e){if(this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,"string"==typeof e||e instanceof Tt.a){ll("Cesium3DTileStyle constructor","string or Resource style parameter in the Cesium3DTileStyle constructor was deprecated in CesiumJS 1.94.  If loading a style from a url, use Cesium3DTileStyle.fromUrl instead.");const t=Tt.a.createIfNeeded(e),n=this;this._readyPromise=t.fetchJson(e).then((function(e){return $Ae(n,e),n}))}else $Ae(this,e),this._readyPromise=Promise.resolve(this)}function $Ae(e,t){t=Object(c.a)(Object(Zf.a)(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;const n={};if(Object(l.a)(t.meta)){const e=t.defines,i=Object(c.a)(t.meta,c.a.EMPTY_OBJECT);for(const t in i)i.hasOwnProperty(t)&&(n[t]=new WG(i[t],e))}e._meta=n,e._ready=!0}function QAe(e,t){const n=Object(c.a)(e._style,c.a.EMPTY_OBJECT).defines;if(Object(l.a)(t))return"boolean"==typeof t||"number"==typeof t?new WG(String(t)):"string"==typeof t?new WG(t,n):Object(l.a)(t.conditions)?new JAe(t,n):t}function eEe(e){if(Object(l.a)(e))return Object(l.a)(e.expression)?e.expression:Object(l.a)(e.conditionsExpression)?Object(Zf.a)(e.conditionsExpression,!0):e}Object.defineProperties(ZAe.prototype,{style:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._style}},ready:{get:function(){return ll("ready","ready was deprecated in CesiumJS 1.94.  It will be removed in 1.96.  If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."),this._ready}},readyPromise:{get:function(){return ll("readyPromise","readyPromise was deprecated in CesiumJS 1.94.  It will be removed in 1.96.  If loading a style from a url, use Cesium3DTileStyle.fromUrl instead."),this._readyPromise}},show:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._show},set:function(e){this._show=QAe(this,e),this._style.show=eEe(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._color},set:function(e){this._color=QAe(this,e),this._style.color=eEe(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pointSize},set:function(e){this._pointSize=QAe(this,e),this._style.pointSize=eEe(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pointOutlineColor},set:function(e){this._pointOutlineColor=QAe(this,e),this._style.pointOutlineColor=eEe(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=QAe(this,e),this._style.pointOutlineWidth=eEe(this._pointOutlineWidth)}},labelColor:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelColor},set:function(e){this._labelColor=QAe(this,e),this._style.labelColor=eEe(this._labelColor)}},labelOutlineColor:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelOutlineColor},set:function(e){this._labelOutlineColor=QAe(this,e),this._style.labelOutlineColor=eEe(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=QAe(this,e),this._style.labelOutlineWidth=eEe(this._labelOutlineWidth)}},font:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._font},set:function(e){this._font=QAe(this,e),this._style.font=eEe(this._font)}},labelStyle:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelStyle},set:function(e){this._labelStyle=QAe(this,e),this._style.labelStyle=eEe(this._labelStyle)}},labelText:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelText},set:function(e){this._labelText=QAe(this,e),this._style.labelText=eEe(this._labelText)}},backgroundColor:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._backgroundColor},set:function(e){this._backgroundColor=QAe(this,e),this._style.backgroundColor=eEe(this._backgroundColor)}},backgroundPadding:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._backgroundPadding},set:function(e){this._backgroundPadding=QAe(this,e),this._style.backgroundPadding=eEe(this._backgroundPadding)}},backgroundEnabled:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._backgroundEnabled},set:function(e){this._backgroundEnabled=QAe(this,e),this._style.backgroundEnabled=eEe(this._backgroundEnabled)}},scaleByDistance:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._scaleByDistance},set:function(e){this._scaleByDistance=QAe(this,e),this._style.scaleByDistance=eEe(this._scaleByDistance)}},translucencyByDistance:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._translucencyByDistance},set:function(e){this._translucencyByDistance=QAe(this,e),this._style.translucencyByDistance=eEe(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=QAe(this,e),this._style.distanceDisplayCondition=eEe(this._distanceDisplayCondition)}},heightOffset:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._heightOffset},set:function(e){this._heightOffset=QAe(this,e),this._style.heightOffset=eEe(this._heightOffset)}},anchorLineEnabled:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=QAe(this,e),this._style.anchorLineEnabled=eEe(this._anchorLineEnabled)}},anchorLineColor:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._anchorLineColor},set:function(e){this._anchorLineColor=QAe(this,e),this._style.anchorLineColor=eEe(this._anchorLineColor)}},image:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._image},set:function(e){this._image=QAe(this,e),this._style.image=eEe(this._image)}},disableDepthTestDistance:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=QAe(this,e),this._style.disableDepthTestDistance=eEe(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._horizontalOrigin},set:function(e){this._horizontalOrigin=QAe(this,e),this._style.horizontalOrigin=eEe(this._horizontalOrigin)}},verticalOrigin:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._verticalOrigin},set:function(e){this._verticalOrigin=QAe(this,e),this._style.verticalOrigin=eEe(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=QAe(this,e),this._style.labelHorizontalOrigin=eEe(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=QAe(this,e),this._style.labelVerticalOrigin=eEe(this._labelVerticalOrigin)}},meta:{get:function(){if(!this._ready)throw new u.a("The style is not loaded.  Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._meta},set:function(e){this._meta=e}}}),ZAe.fromUrl=function(e){if(!Object(l.a)(e))throw new u.a("url is required");return Tt.a.createIfNeeded(e).fetchJson(e).then((function(e){return new ZAe(e)}))},ZAe.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,Object(l.a)(this.color)&&Object(l.a)(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)},ZAe.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady||(this._showShaderFunctionReady=!0,Object(l.a)(this.show)&&Object(l.a)(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0),this._showShaderFunction},ZAe.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady||(this._pointSizeShaderFunctionReady=!0,Object(l.a)(this.pointSize)&&Object(l.a)(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0),this._pointSizeShaderFunction},ZAe.prototype.getVariables=function(){let e=[];return Object(l.a)(this.color)&&Object(l.a)(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),Object(l.a)(this.show)&&Object(l.a)(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),Object(l.a)(this.pointSize)&&Object(l.a)(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter((function(e,t,n){return n.indexOf(e)===t})),e};var tEe=ZAe;function nEe(e){e=Object(c.a)(e,1),s.a.typeOf.number.greaterThan("radius",e,0),this._radius=Object(c.a)(e,1)}Object.defineProperties(nEe.prototype,{radius:{get:function(){return this._radius},set:function(e){s.a.typeOf.number.greaterThan("value",e,0),this._radius=e}}}),nEe.prototype.emit=function(e){const t=h.a.randomBetween(0,h.a.TWO_PI),n=h.a.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t);e.position=O.fromElements(i,r,0,e.position),e.velocity=O.clone(O.UNIT_Z,e.velocity)};var iEe=nEe;const rEe={CUMULUS:0,validate:function(e){return e===rEe.CUMULUS}};var oEe=Object.freeze(rEe),aEe="uniform sampler2D u_noiseTexture;\nuniform vec3 u_noiseTextureDimensions;\nuniform float u_noiseDetail;\nvarying vec2 v_offset;\nvarying vec3 v_maximumSize;\nvarying vec4 v_color;\nvarying float v_slice;\nvarying float v_brightness;\n\nfloat wrap(float value, float rangeLength) {\n    if(value < 0.0) {\n        float absValue = abs(value);\n        float modValue = mod(absValue, rangeLength);\n        return mod(rangeLength - modValue, rangeLength);\n    }\n    return mod(value, rangeLength);\n}\n\nvec3 wrapVec(vec3 value, float rangeLength) {\n    return vec3(wrap(value.x, rangeLength),\n                wrap(value.y, rangeLength),\n                wrap(value.z, rangeLength));\n}\n\nfloat textureSliceWidth = u_noiseTextureDimensions.x;\nfloat noiseTextureRows = u_noiseTextureDimensions.y;\nfloat inverseNoiseTextureRows = u_noiseTextureDimensions.z;\n\nfloat textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;\nvec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,\n                                          inverseNoiseTextureRows / textureSliceWidth);\n\nvec2 voxelToUV(vec3 voxelIndex) {\n    vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);\n    float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);\n    float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);\n\n    float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;\n    float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;\n    return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;\n}\n\n// Interpolate a voxel with its neighbor (along the positive X-axis)\nvec4 lerpSamplesX(vec3 voxelIndex, float x) {\n    vec2 uv0 = voxelToUV(voxelIndex);\n    vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));\n    vec4 sample0 = texture2D(u_noiseTexture, uv0);\n    vec4 sample1 = texture2D(u_noiseTexture, uv1);\n    return mix(sample0, sample1, x);\n}\n\nvec4 sampleNoiseTexture(vec3 position) {\n    vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);\n    vec3 lerpValue = fract(recenteredPos);\n    vec3 voxelIndex = floor(recenteredPos);\n\n    vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);\n    vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);\n    vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);\n    vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);\n\n    vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);\n    vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);\n    return mix(yLerp0, yLerp1, lerpValue.z);\n}\n\n// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).\nbool intersectSphere(vec3 origin, vec3 dir, float slice,\n                     out vec3 point, out vec3 normal) {\n    float A = dot(dir, dir);\n    float B = dot(origin, dir);\n    float C = dot(origin, origin) - 0.25;\n    float discriminant = (B * B) - (A * C);\n    if(discriminant < 0.0) {\n        return false;\n    }\n    float root = sqrt(discriminant);\n    float t = (-B - root) / A;\n    if(t < 0.0) {\n        t = (-B + root) / A;\n    }\n    point = origin + t * dir;\n\n    if(slice >= 0.0) {\n        point.z = (slice / 2.0) - 0.5;\n        if(length(point) > 0.5) {\n            return false;\n        }\n    }\n\n    normal = normalize(point);\n    point -= czm_epsilon2 * normal;\n    return true;\n}\n\n// Transforms the ray origin and direction into unit sphere space,\n// then transforms the result back into the ellipsoid's space.\nbool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,\n                        out vec3 point, out vec3 normal) {\n    if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {\n        return false;\n    }\n\n    vec3 o = (origin - center) / scale;\n    vec3 d = dir / scale;\n    vec3 p, n;\n    bool intersected = intersectSphere(o, d, slice, p, n);\n    if(intersected) {\n        point = (p * scale) + center;\n        normal = n;\n    }\n    return intersected;\n}\n\n// Assume that if phase shift is being called for octave i,\n// the frequency is of i - 1. This saves us from doing extra\n// division / multiplication operations.\nvec2 phaseShift2D(vec2 p, vec2 freq) {\n    return (czm_pi / 2.0) * sin(freq.yx * p.yx);\n}\n\nvec2 phaseShift3D(vec3 p, vec2 freq) {\n    return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));\n}\n\n// The cloud texture function derived from Gardner's 1985 paper,\n// \"Visual Simulation of Clouds.\"\n// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf\nconst float T0    = 0.6;  // contrast of the texture pattern\nconst float k     = 0.1;  // computed to produce a maximum value of 1\nconst float C0    = 0.8;  // coefficient\nconst float FX0   = 0.6;  // frequency X\nconst float FY0   = 0.6;  // frequency Y\nconst int octaves = 5;\n\nfloat T(vec3 point) {\n    vec2 sum = vec2(0.0);\n    float Ci = C0;\n    vec2 FXY = vec2(FX0, FY0);\n    vec2 PXY = vec2(0.0);\n    for(int i = 1; i <= octaves; i++) {\n        PXY = phaseShift3D(point, FXY);\n        Ci *= 0.707;\n        FXY *= 2.0;\n        vec2 sinTerm = sin(FXY * point.xy + PXY);\n        sum += Ci * sinTerm + vec2(T0);\n    }\n    return k * sum.x * sum.y;\n}\n\nconst float a = 0.5;  // fraction of surface reflection due to ambient or scattered light,\nconst float t = 0.4;  // fraction of texture shading\nconst float s = 0.25; // fraction of specular reflection\n\nfloat I(float Id, float Is, float It) {\n    return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;\n}\n\nconst vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));\n\nvec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,\n               float brightness) {\n    vec3 cloudPoint, cloudNormal;\n    if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,\n                            cloudPoint, cloudNormal)) {\n        return vec4(0.0);\n    }\n\n    float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);  // diffuse reflection\n    float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);   // specular reflection\n    float It = T(cloudPoint);                                 // texture function\n    float intensity = I(Id, Is, It);\n    vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));\n\n    vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);\n    float W = noise.x;\n    float W2 = noise.y;\n    float W3 = noise.z;\n\n    // The dot product between the cloud's normal and the ray's direction is greatest\n    // in the center of the ellipsoid's surface. It decreases towards the edge.\n    // Thus, it is used to blur the areas leading to the edges of the ellipsoid,\n    // so that no harsh lines appear.\n\n    // The first (and biggest) layer of worley noise is then subtracted from this.\n    // The final result is scaled up so that the base cloud is not too translucent.\n    float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);\n    float TR = pow(ndDot, 3.0) - W; // translucency\n    TR *= 1.3;\n\n    // Subtracting the second and third layers of worley noise is more complicated.\n    // If these layers of noise were simply subtracted from the current translucency,\n    // the shape derived from the first layer of noise would be completely deleted.\n    // The erosion of this noise should thus be constricted to the edges of the cloud.\n    // However, because the edges of the ellipsoid were already blurred away, mapping\n    // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.\n    // The value of (0.5 - ndDot) provides the best compromise.\n    float minusDot = 0.5 - ndDot;\n\n    // Even with the previous calculation, subtracting the second layer of wnoise\n    // erode too much of the cloud. The addition of it, however, will detailed\n    // volume to the cloud. As long as the noise is only added and not subtracted,\n    // the results are aesthetically pleasing.\n\n    // The minusDot product is mapped in a way that it is larger at the edges of\n    // the ellipsoid, so a subtraction and min operation are used instead of\n    // an addition and max one.\n    TR -= min(minusDot * W2, 0.0);\n\n    // The third level of worley noise is subtracted from the result, with some\n    // modifications. First, a scalar is added to minusDot so that the noise\n    // starts affecting the shape farther away from the center of the ellipsoid's\n    // surface. Then, it is scaled down so its impact is not too intense.\n    TR -= 0.8 * (minusDot + 0.25) * W3;\n\n    // The texture function's shading does not correlate with the shape of the cloud\n    // produced by the layers of noise, so an extra shading scalar is calculated.\n    // The darkest areas of the cloud are assigned to be where the noise erodes\n    // the cloud the most. This is then interpolated based on the translucency\n    // and the diffuse shading term of that point in the cloud.\n    float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);\n\n    // To avoid values that are too dark, this scalar is increased by a small amount\n    // and clamped so it never goes to zero.\n    shading = clamp(shading + 0.2, 0.3, 1.0);\n\n    // Finally, the contrast of the cloud's color is increased.\n    vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);\n    return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;\n}\n\nvoid main() {\n#ifdef DEBUG_BILLBOARDS\n    gl_FragColor = vec4(0.0, 0.5, 0.5, 1.0);\n#endif\n    // To avoid calculations with high values,\n    // we raycast from an arbitrarily smaller space.\n    vec2 coordinate = v_maximumSize.xy * v_offset;\n\n    vec3 ellipsoidScale = 0.82 * v_maximumSize;\n    vec3 ellipsoidCenter = vec3(0.0);\n\n    float zOffset = max(ellipsoidScale.z - 10.0, 0.0);\n    vec3 eye = vec3(0, 0, -10.0 - zOffset);\n    vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);\n    vec3 rayOrigin = eye;\n#ifdef DEBUG_ELLIPSOIDS\n    vec3 point, normal;\n    if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,\n                          point, normal)) {\n        gl_FragColor = v_brightness * v_color;\n    }\n#else\n#ifndef DEBUG_BILLBOARDS\n    vec4 cloud = drawCloud(rayOrigin, rayDir,\n                           ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);\n    if(cloud.w < 0.01) {\n        discard;\n    }\n    gl_FragColor = cloud;\n#endif\n#endif\n}\n",sEe="#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScaleX;\nattribute vec4 positionLowAndScaleY;\nattribute vec4 packedAttribute0;\nattribute vec4 packedAttribute1;\nattribute vec4 color;\n\nvarying vec2 v_offset;\nvarying vec3 v_maximumSize;\nvarying vec4 v_color;\nvarying float v_slice;\nvarying float v_brightness;\n\nvoid main() {\n    // Unpack attributes.\n    vec3 positionHigh = positionHighAndScaleX.xyz;\n    vec3 positionLow = positionLowAndScaleY.xyz;\n    vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);\n\n    float show = packedAttribute0.x;\n    float brightness = packedAttribute0.y;\n    vec2 coordinates = packedAttribute0.wz;\n    vec3 maximumSize = packedAttribute1.xyz;\n    float slice = packedAttribute1.w;\n\n#ifdef INSTANCED\n    vec2 dir = direction;\n#else\n    vec2 dir = coordinates;\n#endif\n\n    vec2 offset = dir - vec2(0.5, 0.5);\n    vec2 scaledOffset = scale * offset;\n    vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n    vec4 positionEC = czm_modelViewRelativeToEye * p;\n    positionEC.xy += scaledOffset;\n    \n    positionEC.xyz *= show;\n    gl_Position = czm_projection * positionEC;\n\n    v_offset = offset;\n    v_maximumSize = maximumSize;\n    v_color = color;\n    v_slice = slice;\n    v_brightness = brightness;\n}\n",cEe="uniform vec3 u_noiseTextureDimensions;\nuniform float u_noiseDetail;\nuniform vec3 u_noiseOffset;\nvarying vec2 v_position;\n\nfloat textureSliceWidth = u_noiseTextureDimensions.x;\nfloat inverseNoiseTextureRows = u_noiseTextureDimensions.z;\n\nfloat wrap(float value, float rangeLength) {\n    if(value < 0.0) {\n        float absValue = abs(value);\n        float modValue = mod(absValue, rangeLength);\n        return mod(rangeLength - modValue, rangeLength);\n    }\n    return mod(value, rangeLength);\n}\n\nvec3 wrapVec(vec3 value, float rangeLength) {\n    return vec3(wrap(value.x, rangeLength),\n                wrap(value.y, rangeLength),\n                wrap(value.z, rangeLength));\n}\n\nvec3 random3(vec3 p) {\n    float dot1 = dot(p, vec3(127.1, 311.7, 932.8));\n    float dot2 = dot(p, vec3(269.5, 183.3, 421.4));\n    return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));\n}\n\n// Frequency corresponds to cell size.\n// The higher the frequency, the smaller the cell size.\nvec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {\n    vec3 cell = centerCell + offset;\n    cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);\n    cell += floor(u_noiseOffset / u_noiseDetail);\n    vec3 p = offset + random3(cell);\n    return p;\n}\n\nfloat worleyNoise(vec3 p, float freq) {\n    vec3 centerCell = floor(p * freq);\n    vec3 pointInCell = fract(p * freq);\n    float shortestDistance = 1000.0;\n\n    for(float z = -1.0; z <= 1.0; z++) {\n        for(float y = -1.0; y <= 1.0; y++) {\n            for(float x = -1.0; x <= 1.0; x++) {\n                vec3 offset = vec3(x, y, z);\n                vec3 point = getWorleyCellPoint(centerCell, offset, freq);\n\n                float distance = length(pointInCell - point);\n                if(distance < shortestDistance) {\n                    shortestDistance = distance;\n                }\n            }\n        }\n    }\n\n    return shortestDistance;\n}\n\nconst float MAX_FBM_ITERATIONS = 10.0;\n\nfloat worleyFBMNoise(vec3 p, float octaves, float scale) {\n    float noise = 0.0;\n    float freq = 1.0;\n    float persistence = 0.625;\n    for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {\n        if(i >= octaves) {\n            break;\n        }\n\n        noise += worleyNoise(p * scale, freq * scale) * persistence;\n        persistence *= 0.5;\n        freq *= 2.0;\n    }\n    return noise;\n}\n\nvoid main() {\n    float x = mod(v_position.x, textureSliceWidth);\n    float y = mod(v_position.y, textureSliceWidth);\n    float sliceRow = floor(v_position.y / textureSliceWidth);\n    float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;\n\n    vec3 position = vec3(x, y, z);\n    position /= u_noiseDetail;\n    float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);\n    float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);\n    float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);\n    gl_FragColor = vec4(worley0, worley1, worley2, 1.0);\n}\n",lEe="uniform vec3 u_noiseTextureDimensions;\nattribute vec2 position;\n\nvarying vec2 v_position;\n\nvoid main()\n{\n    gl_Position = vec4(position, 0.1, 1.0);\n\n    float textureSliceWidth = u_noiseTextureDimensions.x;\n    float noiseTextureRows = u_noiseTextureDimensions.y;\n    float inverseNoiseTextureRows = u_noiseTextureDimensions.z;\n    vec2 transformedPos = (position * 0.5) + vec2(0.5);\n    transformedPos *= textureSliceWidth;\n    transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;\n    transformedPos.y *= noiseTextureRows;\n    v_position = transformedPos;\n}\n";function uEe(e,t){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._show=Object(c.a)(e.show,!0),this._position=O.clone(Object(c.a)(e.position,O.ZERO)),!Object(l.a)(e.scale)&&Object(l.a)(e.maximumSize))this._maximumSize=O.clone(e.maximumSize),this._scale=new Vt(this._maximumSize.x,this._maximumSize.y);else{this._scale=Vt.clone(Object(c.a)(e.scale,new Vt(20,12)));const t=new O(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=O.clone(Object(c.a)(e.maximumSize,t))}this._slice=Object(c.a)(e.slice,-1),this._color=sp.clone(Object(c.a)(e.color,sp.WHITE)),this._brightness=Object(c.a)(e.brightness,1),this._cloudCollection=t,this._index=-1}const hEe=uEe.SHOW_INDEX=0,dEe=uEe.POSITION_INDEX=1,fEe=uEe.SCALE_INDEX=2,pEe=uEe.MAXIMUM_SIZE_INDEX=3,mEe=uEe.SLICE_INDEX=4,gEe=uEe.BRIGHTNESS_INDEX=5,_Ee=uEe.COLOR_INDEX=6;function yEe(e,t){const n=e._cloudCollection;Object(l.a)(n)&&(n._updateCloud(e,t),e._dirty=!0)}uEe.NUMBER_OF_PROPERTIES=7,Object.defineProperties(uEe.prototype,{show:{get:function(){return this._show},set:function(e){s.a.typeOf.bool("value",e),this._show!==e&&(this._show=e,yEe(this,hEe))}},position:{get:function(){return this._position},set:function(e){s.a.typeOf.object("value",e);const t=this._position;O.equals(t,e)||(O.clone(e,t),yEe(this,dEe))}},scale:{get:function(){return this._scale},set:function(e){s.a.typeOf.object("value",e);const t=this._scale;Vt.equals(t,e)||(Vt.clone(e,t),yEe(this,fEe))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){s.a.typeOf.object("value",e);const t=this._maximumSize;O.equals(t,e)||(O.clone(e,t),yEe(this,pEe))}},color:{get:function(){return this._color},set:function(e){s.a.typeOf.object("value",e);const t=this._color;sp.equals(t,e)||(sp.clone(e,t),yEe(this,_Ee))}},slice:{get:function(){return this._slice},set:function(e){s.a.typeOf.number("value",e);this._slice!==e&&(this._slice=e,yEe(this,mEe))}},brightness:{get:function(){return this._brightness},set:function(e){s.a.typeOf.number("value",e);this._brightness!==e&&(this._brightness=e,yEe(this,gEe))}}}),uEe.prototype._destroy=function(){this._cloudCollection=void 0};var bEe=uEe;let vEe;const OEe=new O,wEe={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},AEe={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},EEe=bEe.SHOW_INDEX,TEe=bEe.POSITION_INDEX,CEe=bEe.SCALE_INDEX,xEe=bEe.MAXIMUM_SIZE_INDEX,SEe=bEe.SLICE_INDEX,IEe=bEe.BRIGHTNESS_INDEX,PEe=bEe.NUMBER_OF_PROPERTIES,DEe=bEe.COLOR_INDEX;function REe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(PEe),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=Object(c.a)(e.noiseDetail,16),this.noiseOffset=O.clone(Object(c.a)(e.noiseOffset,O.ZERO)),this._loading=!1,this._ready=!1;const t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:jEe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=Object(c.a)(e.show,!0),this._colorCommands=[],this.debugBillboards=Object(c.a)(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=Object(c.a)(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function jEe(e){return function(){return OEe.x=e._textureSliceWidth,OEe.y=e._noiseTextureRows,OEe.z=1/e._noiseTextureRows,OEe}}function MEe(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}function LEe(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;const t=[],n=e._clouds,i=n.length;for(let e=0,r=0;e<i;++e){const i=n[e];Object(l.a)(i)&&(n._index=r++,t.push(i))}e._clouds=t}}Object.defineProperties(REe.prototype,{length:{get:function(){return LEe(this),this._clouds.length}}}),REe.prototype.add=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.cloudType,oEe.CUMULUS);if(!oEe.validate(t))throw new u.a("invalid cloud type");let n;return t===oEe.CUMULUS&&(n=new bEe(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n},REe.prototype.remove=function(e){return!!this.contains(e)&&(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},REe.prototype.removeAll=function(){MEe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0},REe.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]},REe.prototype.contains=function(e){return Object(l.a)(e)&&e._cloudCollection===this},REe.prototype.get=function(e){return s.a.typeOf.number("index",e),LEe(this),this._clouds[e]};const NEe=new Float32Array([-1,-1,1,-1,1,1,-1,1]),BEe=new Uint16Array([0,1,2,0,2,3]);let FEe;function zEe(e){let t=e.cache.cloudCollection_indexBufferBatched;if(Object(l.a)(t))return t;const n=new Uint16Array(98298);for(let e=0,t=0;e<98298;e+=6,t+=4)n[e]=t,n[e+1]=t+1,n[e+2]=t+2,n[e+3]=t,n[e+4]=t+2,n[e+5]=t+3;return t=ZN.createIndexBuffer({context:e,typedArray:n,usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=t,t}function kEe(e){let t=e.cache.cloudCollection_indexBufferInstanced;return Object(l.a)(t)||(t=ZN.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function UEe(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return Object(l.a)(t)||(t=ZN.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:KN.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}const VEe=new Mh;function HEe(e,t,n,i){let r;const o=n[vEe.positionHighAndScaleX],a=n[vEe.positionLowAndScaleY],s=i.position;Mh.fromCartesian(s,VEe);const c=i.scale,l=VEe.high,u=VEe.low;e._instanced?(r=i._index,o(r,l.x,l.y,l.z,c.x),a(r,u.x,u.y,u.z,c.y)):(r=4*i._index,o(r+0,l.x,l.y,l.z,c.x),o(r+1,l.x,l.y,l.z,c.x),o(r+2,l.x,l.y,l.z,c.x),o(r+3,l.x,l.y,l.z,c.x),a(r+0,u.x,u.y,u.z,c.y),a(r+1,u.x,u.y,u.z,c.y),a(r+2,u.x,u.y,u.z,c.y),a(r+3,u.x,u.y,u.z,c.y))}function GEe(e,t,n,i){let r;const o=n[vEe.packedAttribute0],a=i.show,s=i.brightness;e._instanced?(r=i._index,o(r,a,s,0,0)):(r=4*i._index,o(r+0,a,s,0,0),o(r+1,a,s,1,0),o(r+2,a,s,1,1),o(r+3,a,s,0,1))}function qEe(e,t,n,i){let r;const o=n[vEe.packedAttribute1],a=i.maximumSize,s=i.slice;e._instanced?(r=i._index,o(r,a.x,a.y,a.z,s)):(r=4*i._index,o(r+0,a.x,a.y,a.z,s),o(r+1,a.x,a.y,a.z,s),o(r+2,a.x,a.y,a.z,s),o(r+3,a.x,a.y,a.z,s))}function WEe(e,t,n,i){let r;const o=n[vEe.color],a=i.color,s=sp.floatToByte(a.red),c=sp.floatToByte(a.green),l=sp.floatToByte(a.blue),u=sp.floatToByte(a.alpha);e._instanced?(r=i._index,o(r,s,c,l,u)):(r=4*i._index,o(r+0,s,c,l,u),o(r+1,s,c,l,u),o(r+2,s,c,l,u),o(r+3,s,c,l,u))}function YEe(e,t,n,i){HEe(e,0,n,i),GEe(e,0,n,i),qEe(e,0,n,i),WEe(e,0,n,i)}function XEe(e,t,n,i){const r=e,o=r._textureSliceWidth,a=r._noiseTextureRows;if(o/a<1||o%a!=0)throw new u.a("noiseTextureRows must evenly divide textureSliceWidth");const s=t.context;r._vaNoise=function(e){const t=ZN.createVertexBuffer({context:e,typedArray:NEe,usage:KN.STATIC_DRAW}),n=ZN.createIndexBuffer({context:e,typedArray:BEe,usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:gs.FLOAT}];return new iB({context:e,attributes:i,indexBuffer:n})}(s),r._spNoise=oM.fromCache({context:s,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});const c=r.noiseDetail,l=r.noiseOffset;r._noiseTexture=new JD({context:s,width:o*o/a,height:o*a,pixelDatatype:rT.UNSIGNED_BYTE,pixelFormat:aT.RGBA,sampler:new WD({wrapS:GD.REPEAT,wrapT:GD.REPEAT,minificationFilter:VD.NEAREST,magnificationFilter:kD.NEAREST})});const h=new vU({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:jEe(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return l}},persists:!1,owner:e,postExecute:function(e){r._ready=!0,r._loading=!1}});t.commandList.push(h),r._loading=!0}function KEe(e,t){const n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();const r=e._clouds,o=r.length;if(o>0){n._vaf=function(e,t,n){const i=[{index:vEe.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:KN.STATIC_DRAW},{index:vEe.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:KN.STATIC_DRAW},{index:vEe.packedAttribute0,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:KN.STATIC_DRAW},{index:vEe.packedAttribute1,componentsPerAttribute:4,componentDatatype:gs.FLOAT,usage:KN.STATIC_DRAW},{index:vEe.color,componentsPerAttribute:4,componentDatatype:gs.UNSIGNED_BYTE,normalize:!0,usage:KN.STATIC_DRAW}];return n&&i.push({index:vEe.direction,componentsPerAttribute:2,componentDatatype:gs.FLOAT,vertexBuffer:UEe(e)}),new L$(e,i,n?t:4*t,n)}(i,o,n._instanced);const t=n._vaf.writers;let a;for(a=0;a<o;++a){YEe(e,0,t,r[a])}n._vaf.commit(FEe(i))}}const JEe=[];REe.prototype.update=function(e){if(LEe(this),!this.show)return;const t=this.debugBillboards||this.debugEllipsoids;this._ready=!!t||Object(l.a)(this._noiseTexture),this._ready||this._loading||t||XEe(this,e,lEe,cEe),this._instanced=e.context.instancedArrays,vEe=this._instanced?AEe:wEe,FEe=this._instanced?kEe:zEe;const n=this._clouds.length,i=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?KEe(this,e):r>0&&function(e,t){const n=t.context,i=e,r=i._clouds.length,o=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,s=i._propertiesChanged,c=JEe;c.length=0,(s[TEe]||s[CEe])&&c.push(HEe),(s[EEe]||s[IEe])&&c.push(GEe),(s[xEe]||s[SEe])&&c.push(qEe),s[DEe]&&c.push(WEe);const l=c.length,u=i._vaf.writers;let h,d,f;if(a/r>.1){for(h=0;h<a;++h)for(d=o[h],d._dirty=!1,f=0;f<l;++f)c[f](e,t,u,d);i._vaf.commit(FEe(n))}else{for(h=0;h<a;++h){for(d=o[h],d._dirty=!1,f=0;f<l;++f)c[f](e,t,u,d);i._instanced?i._vaf.subCommit(d._index,1):i._vaf.subCommit(4*d._index,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}(this,e),r>1.5*n&&(i.length=n),!Object(l.a)(this._vaf)||!Object(l.a)(this._vaf.va)||!this._ready&!t||(this._spCreated&&this.debugBillboards===this._compiledDebugBillboards&&this.debugEllipsoids===this._compiledDebugEllipsoids||function(e,t,n,i){const r=t.context,o=e,a=new UN({defines:[],sources:[n]});o._instanced&&a.defines.push("INSTANCED");const s=new UN({defines:[],sources:[i]});o.debugBillboards&&s.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&s.defines.push("DEBUG_ELLIPSOIDS"),o._sp=oM.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:vEe}),o._rs=vj.fromCache({depthTest:{enabled:!0,func:ps.LESS},depthMask:!1,blending:SD.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}(this,e,sEe,aEe),function(e,t){const n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){const t=n._colorCommands,i=n._vaf.va,a=i.length;t.length=a;for(let s=0;s<a;s++){let a=t[s];Object(l.a)(a)||(a=t[s]=new XR),a.pass=KR.TRANSLUCENT,a.owner=e,a.uniformMap=r,a.count=i[s].indicesCount,a.vertexArray=i[s].va,a.shaderProgram=n._sp,a.renderState=n._rs,n._instanced&&(a.count=6,a.instanceCount=n._clouds.length),o.push(a)}}}(this,e))},REe.prototype.isDestroyed=function(){return!1},REe.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),MEe(this._clouds),sc(this)};var ZEe=REe;function $Ee(e,t){const n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid;let o;const a=t.camera.getRectangleCameraCoordinates(e);return o=t.mode===AB.SCENE3D?r.cartesianToCartographic(a):i.unproject(a),Object(l.a)(n)?n.readyPromise.then((function(){const i=n.availability;if(!Object(l.a)(i)||t.mode===AB.SCENE2D)return o;const r=[Be.center(e),Be.southeast(e),Be.southwest(e),Be.northeast(e),Be.northwest(e)];return $Ee._sampleTerrainMostDetailed(n,r).then((function(e){const t=e.reduce((function(e,t){return Math.max(t.height,e)}),-Number.MAX_VALUE),n=o;return n.height+=t,n}))})):Promise.resolve(o)}$Ee._sampleTerrainMostDetailed=dS;var QEe=$Ee;const eTe=h.a.toRadians(30);function tTe(e){this._angle=Object(c.a)(e,eTe)}Object.defineProperties(tTe.prototype,{angle:{get:function(){return this._angle},set:function(e){s.a.typeOf.number("value",e),this._angle=e}}}),tTe.prototype.emit=function(e){const t=Math.tan(this._angle),n=h.a.randomBetween(0,h.a.TWO_PI),i=h.a.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n);e.velocity=O.fromElements(r,o,1,e.velocity),O.normalize(e.velocity,e.velocity),e.position=O.clone(O.ZERO,e.position)};var nTe=tTe;const iTe=new sp,rTe=new sp,oTe=new sp,aTe=new sp,sTe=new _e,cTe=new Uint8Array(4);function lTe(e,t,n,i){const r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return sp.lerp(t.color,n.color,r,i)}function uTe(e,t){return{height:e,color:sp.clone(t)}}function hTe(e){return e=(e=(e=e.filter((function(e,t,n){const i=t>0,r=t<n.length-1,o=!i||e.height===n[t-1].height,a=!r||e.height===n[t+1].height;return!o||!a}))).filter((function(e,t,n){const i=t>0,r=t<n.length-1,o=!!i&&sp.equals(e.color,n[t-1].color),a=!!r&&sp.equals(e.color,n[t+1].color);return!o||!a}))).filter((function(e,t,n){const i=t>0,r=!!i&&sp.equals(e.color,n[t-1].color),o=!i||e.height===n[t-1].height;return!r||!o}))}function dTe(e){const t=function(e){let t,n;const i=[],r=e.length;for(t=0;t<r;t++){const r=e[t],o=r.entries,a=o.length;if(!Array.isArray(o)||0===a)throw new u.a("entries must be an array with size > 0.");let s=[];for(n=0;n<a;n++){const e=o[n];if(!Object(l.a)(e.height))throw new u.a("entry requires a height.");if(!Object(l.a)(e.color))throw new u.a("entry requires a color.");const t=h.a.clamp(e.height,fTe._minimumHeight,fTe._maximumHeight),i=sp.clone(e.color,iTe);i.red*=i.alpha,i.green*=i.alpha,i.blue*=i.alpha,s.push(uTe(t,i))}let d=!0,f=!0;for(n=0;n<a-1;n++){const e=s[n+0],t=s[n+1];d=d&&e.height<=t.height,f=f&&e.height>=t.height}f?s=s.reverse():d||mE(s,(function(e,t){return h.a.sign(e.height-t.height)}));let p=Object(c.a)(r.extendDownwards,!1),m=Object(c.a)(r.extendUpwards,!1);1!==s.length||p||m||(p=!0,m=!0),p&&s.splice(0,0,uTe(fTe._minimumHeight,s[0].color)),m&&s.splice(s.length,0,uTe(fTe._maximumHeight,s[s.length-1].color)),s=hTe(s),i.push(s)}return i}(e);let n,i=[],r=[];function o(e,t){i.push(uTe(e,t))}function a(e,t,n){let i=sp.multiplyByScalar(n,1-t.alpha,aTe);i=sp.add(i,t,i),o(e,i)}const s=t.length;for(n=0;n<s;n++){const e=t[n];let s=0,c=0;r=i,i=[];const u=e.length,h=r.length;for(;s<u||c<h;){const t=s<u?e[s]:void 0,n=s>0?e[s-1]:void 0,i=s<u-1?e[s+1]:void 0,d=c<h?r[c]:void 0,f=c>0?r[c-1]:void 0,p=c<h-1?r[c+1]:void 0;if(Object(l.a)(t)&&Object(l.a)(d)&&t.height===d.height){const e=Object(l.a)(p)&&d.height===p.height,r=!Object(l.a)(f),u=!Object(l.a)(p),h=Object(l.a)(i)&&t.height===i.height,m=!Object(l.a)(n),g=!Object(l.a)(i);e?h?(a(t.height,t.color,d.color),a(t.height,i.color,p.color)):m?(o(t.height,d.color),a(t.height,t.color,p.color)):g?(a(t.height,t.color,d.color),o(t.height,p.color)):(a(t.height,t.color,d.color),a(t.height,t.color,p.color)):r?h?(o(t.height,t.color),a(t.height,i.color,d.color)):g?(o(t.height,t.color),o(t.height,d.color)):(m||o(t.height,t.color),a(t.height,t.color,d.color)):u?h?(a(t.height,t.color,d.color),o(t.height,i.color)):m?(o(t.height,d.color),o(t.height,t.color)):g?a(t.height,t.color,d.color):(a(t.height,t.color,d.color),o(t.height,t.color)):h?(a(t.height,t.color,d.color),a(t.height,i.color,d.color)):m?(o(t.height,d.color),a(t.height,t.color,d.color)):g?(a(t.height,t.color,d.color),o(t.height,d.color)):a(t.height,t.color,d.color),s+=h?2:1,c+=e?2:1}else if(Object(l.a)(t)&&Object(l.a)(d)&&Object(l.a)(f)&&t.height<d.height){const e=lTe(t.height,f,d,oTe);Object(l.a)(n)?Object(l.a)(i)?a(t.height,t.color,e):(a(t.height,t.color,e),o(t.height,e)):(o(t.height,e),a(t.height,t.color,e)),s++}else if(Object(l.a)(d)&&Object(l.a)(t)&&Object(l.a)(n)&&d.height<t.height){const e=lTe(d.height,n,t,rTe);Object(l.a)(f)?Object(l.a)(p)?a(d.height,e,d.color):(a(d.height,e,d.color),o(d.height,e)):(o(d.height,e),a(d.height,e,d.color)),c++}else Object(l.a)(t)&&(!Object(l.a)(d)||t.height<d.height)?(!Object(l.a)(d)||Object(l.a)(f)||Object(l.a)(i)?(Object(l.a)(d)||!Object(l.a)(f)||Object(l.a)(n)||(o(f.height,fTe._emptyColor),o(t.height,fTe._emptyColor)),o(t.height,t.color)):(o(t.height,t.color),o(t.height,fTe._emptyColor),o(d.height,fTe._emptyColor)),s++):Object(l.a)(d)&&(!Object(l.a)(t)||d.height<t.height)&&(o(d.height,d.color),c++)}}return hTe(i)}function fTe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).scene,n=e.layers;s.a.typeOf.object("options.scene",t),s.a.defined("options.layers",n),s.a.typeOf.number.greaterThan("options.layers.length",n.length,0);const i=dTe(n),r=i.length;let o,a,l,u;if(!fTe._useFloatTexture(t.context))for(l=rT.UNSIGNED_BYTE,u=aT.RGBA,a=new Uint8Array(4*r),o=0;o<r;o++)_e.packFloat(i[o].height,sTe),_e.pack(sTe,a,4*o);else for(l=rT.FLOAT,u=aT.LUMINANCE,a=new Float32Array(r),o=0;o<r;o++)a[o]=i[o].height;const h=JD.create({context:t.context,pixelFormat:u,pixelDatatype:l,source:{arrayBufferView:a,width:r,height:1},sampler:new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.NEAREST,magnificationFilter:kD.NEAREST})}),d=new Uint8Array(4*r);for(o=0;o<r;o++){i[o].color.toBytes(cTe),d[4*o+0]=cTe[0],d[4*o+1]=cTe[1],d[4*o+2]=cTe[2],d[4*o+3]=cTe[3]}const f=JD.create({context:t.context,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,source:{arrayBufferView:d,width:r,height:1},sampler:new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.LINEAR,magnificationFilter:kD.LINEAR})});return CR.fromType("ElevationBand",{heights:h,colors:f})}fTe._useFloatTexture=function(e){return e.floatingPointTexture},fTe._maximumHeight=5906376425472,fTe._minimumHeight=-5906376425472,fTe._emptyColor=new sp(0,0,0,0);var pTe=fTe;var mTe=function(e){e=Object(up.a)(e,{url:vy.fromAssetId(96188)});const t=new qie(e);let n=e.style;if(!Object(l.a)(n)){const t=Object(c.a)(e.defaultColor,sp.WHITE).toCssColorString();n=new tEe({color:"Boolean(${feature['cesium#color']}) ? color(${feature['cesium#color']}) : "+t})}return t.style=n,t};var gTe=function(e){const t=[];let n=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).geometry;if(!Object(l.a)(n))throw new u.a("options.geometry is required.");Object(l.a)(n.attributes)&&Object(l.a)(n.primitiveType)||(n=n.constructor.createGeometry(n));const i=n.attributes,r=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),o=Object(c.a)(e.length,1e4);if(Object(l.a)(i.normal)&&t.push(new Ph({geometry:$d.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new lp(1,0,0,1)},modelMatrix:r})),Object(l.a)(i.tangent)&&t.push(new Ph({geometry:$d.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new lp(0,1,0,1)},modelMatrix:r})),Object(l.a)(i.bitangent)&&t.push(new Ph({geometry:$d.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new lp(0,0,1,1)},modelMatrix:r})),t.length>0)return new hF({asynchronous:!1,geometryInstances:t,appearance:new MR({flat:!0,translucent:!1})})};const _Te=/{[^}]+}/g,yTe={x:function(e,t,n,i){return STe(e,"{x}",t)},y:function(e,t,n,i){return STe(e,"{y}",n)},z:function(e,t,n,i){return STe(e,"{z}",i)},s:function(e,t,n,i){const r=(t+n+i)%e._subdomains.length;return e._subdomains[r]},reverseX:function(e,t,n,i){const r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return STe(e,"{reverseX}",r)},reverseY:function(e,t,n,i){const r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return STe(e,"{reverseY}",r)},reverseZ:function(e,t,n,i){const r=e.maximumLevel,o=Object(l.a)(r)&&i<r?r-i-1:i;return STe(e,"{reverseZ}",o)},westDegrees:function(e,t,n,i){return ITe(e,t,n,i),wTe.west},southDegrees:function(e,t,n,i){return ITe(e,t,n,i),wTe.south},eastDegrees:function(e,t,n,i){return ITe(e,t,n,i),wTe.east},northDegrees:function(e,t,n,i){return ITe(e,t,n,i),wTe.north},westProjected:function(e,t,n,i){return PTe(e,t,n,i),ETe.west},southProjected:function(e,t,n,i){return PTe(e,t,n,i),ETe.south},eastProjected:function(e,t,n,i){return PTe(e,t,n,i),ETe.east},northProjected:function(e,t,n,i){return PTe(e,t,n,i),ETe.north},width:function(e,t,n,i){return e.tileWidth},height:function(e,t,n,i){return e.tileHeight}},bTe=Object(up.a)(yTe,{i:function(e,t,n,i,r,o,a){return jTe(e,t,n,i,r,o),CTe.x},j:function(e,t,n,i,r,o,a){return jTe(e,t,n,i,r,o),CTe.y},reverseI:function(e,t,n,i,r,o,a){return jTe(e,t,n,i,r,o),e.tileWidth-CTe.x-1},reverseJ:function(e,t,n,i,r,o,a){return jTe(e,t,n,i,r,o),e.tileHeight-CTe.y-1},longitudeDegrees:function(e,t,n,i,r,o,a){return h.a.toDegrees(r)},latitudeDegrees:function(e,t,n,i,r,o,a){return h.a.toDegrees(o)},longitudeProjected:function(e,t,n,i,r,o,a){return LTe(e,t,n,i,r,o),RTe.x},latitudeProjected:function(e,t,n,i,r,o,a){return LTe(e,t,n,i,r,o),RTe.y},format:function(e,t,n,i,r,o,a){return a}});function vTe(e){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.then)&&!Object(l.a)(e.url))throw new u.a("options is required.");this._errorEvent=new un.a,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}Object.defineProperties(vTe.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){if(!this.ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this.ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this.ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this.ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this.ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this.ready)throw new u.a("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this.ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return Object(l.a)(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){if(!this.ready)throw new u.a("credit must not be called before the imagery provider is ready.");return this._credit}},hasAlphaChannel:{get:function(){if(!this.ready)throw new u.a("hasAlphaChannel must not be called before the imagery provider is ready.");return this._hasAlphaChannel}}}),vTe.prototype.reinitialize=function(e){const t=this;t._readyPromise=Promise.resolve(e).then((function(e){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.url))throw new u.a("options.url is required.");const n=e.customTags,i=Object(up.a)(yTe,n),r=Object(up.a)(bTe,n),o=Tt.a.createIfNeeded(e.url),a=Tt.a.createIfNeeded(e.pickFeaturesUrl);t.enablePickFeatures=Object(c.a)(e.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=Object(c.a)(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():Object(l.a)(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=Object(c.a)(e.tileWidth,256),t._tileHeight=Object(c.a)(e.tileHeight,256),t._minimumLevel=Object(c.a)(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=Object(c.a)(e.tilingScheme,new pl({ellipsoid:e.ellipsoid})),t._rectangle=Object(c.a)(e.rectangle,t._tilingScheme.rectangle),t._rectangle=Be.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=Object(c.a)(e.hasAlphaChannel,!0);let s=e.credit;return"string"==typeof s&&(s=new ln(s)),t._credit=s,t._resource=o,t._tags=i,t._pickFeaturesResource=a,t._pickFeaturesTags=r,!0}))},vTe.prototype.getTileCredits=function(e,t,n){if(!this.ready)throw new u.a("getTileCredits must not be called before the imagery provider is ready.")},vTe.prototype.requestImage=function(e,t,n,i){if(!this.ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");return Uve.loadImage(this,function(e,t,n,i,r){OTe=!1,ATe=!1;const o=e._resource,a=o.getUrlComponent(!0),s=e._tags,c={},u=a.match(_Te);Object(l.a)(u)&&u.forEach((function(r){const o=r.substring(1,r.length-1);Object(l.a)(s[o])&&(c[o]=s[o](e,t,n,i))}));return o.getDerivedResource({request:r,templateValues:c})}(this,e,t,n,i))},vTe.prototype.pickFeatures=function(e,t,n,i,r){if(!this.ready)throw new u.a("pickFeatures must not be called before the imagery provider is ready.");if(!this.enablePickFeatures||!Object(l.a)(this._pickFeaturesResource)||0===this._getFeatureInfoFormats.length)return;let o=0;const a=this;function s(e,t){return e.callback(t)}return function c(){if(o>=a._getFeatureInfoFormats.length)return Promise.resolve([]);const u=a._getFeatureInfoFormats[o],h=function(e,t,n,i,r,o,a){OTe=!1,ATe=!1,TTe=!1,xTe=!1;const s=e._pickFeaturesResource,c=s.getUrlComponent(!0),u=e._pickFeaturesTags,h={},d=c.match(_Te);Object(l.a)(d)&&d.forEach((function(s){const c=s.substring(1,s.length-1);Object(l.a)(u[c])&&(h[c]=u[c](e,t,n,i,r,o,a))}));return s.getDerivedResource({templateValues:h})}(a,e,t,n,i,r,u.format);return++o,"json"===u.type?h.fetchJson().then(u.callback).catch(c):"xml"===u.type?h.fetchXML().then(u.callback).catch(c):"text"===u.type||"html"===u.type?h.fetchText().then(u.callback).catch(c):h.fetch({responseType:u.format}).then(s.bind(void 0,u)).catch(c)}()};let OTe=!1;const wTe=new Be;let ATe=!1;const ETe=new Be;let TTe=!1;const CTe=new Vt;let xTe=!1;function STe(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){const i=e.urlSchemeZeroPadding[t];if("string"==typeof i){const e=i.length;e>1&&(n=n.length>=e?n:new Array(e-n.toString().length+1).join("0")+n)}}return n}function ITe(e,t,n,i){OTe||(e.tilingScheme.tileXYToRectangle(t,n,i,wTe),wTe.west=h.a.toDegrees(wTe.west),wTe.south=h.a.toDegrees(wTe.south),wTe.east=h.a.toDegrees(wTe.east),wTe.north=h.a.toDegrees(wTe.north),OTe=!0)}function PTe(e,t,n,i){ATe||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,ETe),ATe=!0)}const DTe=new Be,RTe=new O;function jTe(e,t,n,i,r,o,a){if(TTe)return;LTe(e,t,n,i,r,o);const s=RTe,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,DTe);CTe.x=e.tileWidth*(s.x-c.west)/c.width|0,CTe.y=e.tileHeight*(c.north-s.y)/c.height|0,TTe=!0}const MTe=new R;function LTe(e,t,n,i,r,o,a){if(!xTe){if(e.tilingScheme.projection instanceof q)RTe.x=h.a.toDegrees(r),RTe.y=h.a.toDegrees(o);else{const t=MTe;t.longitude=r,t.latitude=o,e.tilingScheme.projection.project(t,RTe)}xTe=!0}}var NTe=vTe;function BTe(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url))throw new u.a("options.url is required.");let t;this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);const n=this,i=Promise.resolve(e.url).then((function(e){return t=Tt.a.createIfNeeded(e),t.appendForwardSlash(),n._tmsResource=t,n._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),n._requestMetadata()})).catch(e=>Promise.reject(e));NTe.call(this,i),this._promise=i}function FTe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function zTe(e,t,n){const i=e.positionToTileXY(Be.southwest(t),n),r=e.positionToTileXY(Be.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Object(l.a)(Object.create)&&(BTe.prototype=Object.create(NTe.prototype),BTe.prototype.constructor=BTe),BTe.prototype._requestMetadata=function(){return this._xmlResource.fetchXML().then(this._metadataSuccess).catch(e=>e instanceof Wx.a?this._metadataFailure():Promise.reject(e))},BTe.prototype._metadataSuccess=function(e){const t=/tileformat/i,n=/tileset/i,i=/tilesets/i,r=/boundingbox/i;let o,a,s;const u=[],h=this._xmlResource;let d=this._metadataError;const f=this._requestMetadata,p=e.childNodes[0].childNodes;for(let e=0;e<p.length;e++)if(t.test(p.item(e).nodeName))o=p.item(e);else if(i.test(p.item(e).nodeName)){s=p.item(e);const t=p.item(e).childNodes;for(let e=0;e<t.length;e++)n.test(t.item(e).nodeName)&&u.push(t.item(e))}else r.test(p.item(e).nodeName)&&(a=p.item(e));let m;if(!Object(l.a)(s)||!Object(l.a)(a))return m=`Unable to find expected tilesets or bbox attributes in ${h.url}.`,d=dl.reportError(d,this,this.errorEvent,m),d.retry?(this._metadataError=d,f()):Promise.reject(new ye.a(m));const g=this._options,_=Object(c.a)(g.fileExtension,o.getAttribute("extension")),y=Object(c.a)(g.tileWidth,parseInt(o.getAttribute("width"),10)),b=Object(c.a)(g.tileHeight,parseInt(o.getAttribute("height"),10));let v=Object(c.a)(g.minimumLevel,parseInt(u[0].getAttribute("order"),10));const O=Object(c.a)(g.maximumLevel,parseInt(u[u.length-1].getAttribute("order"),10)),w=s.getAttribute("profile");let A=g.tilingScheme;if(!Object(l.a)(A))if("geodetic"===w||"global-geodetic"===w)A=new Gt({ellipsoid:g.ellipsoid});else{if("mercator"!==w&&"global-mercator"!==w)return m=`${h.url}specifies an unsupported profile attribute, ${w}.`,d=dl.reportError(d,this,this.errorEvent,m),d.retry?(this._metadataError=d,f()):Promise.reject(new ye.a(m));A=new pl({ellipsoid:g.ellipsoid})}let E=Be.clone(g.rectangle);if(!Object(l.a)(E)){let e,t,n,i;Object(c.a)(g.flipXY,!1)?(n=new Vt(parseFloat(a.getAttribute("miny")),parseFloat(a.getAttribute("minx"))),i=new Vt(parseFloat(a.getAttribute("maxy")),parseFloat(a.getAttribute("maxx")))):(n=new Vt(parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny"))),i=new Vt(parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))));const r="geodetic"===w||"mercator"===w;if(A.projection instanceof q||r)e=R.fromDegrees(n.x,n.y),t=R.fromDegrees(i.x,i.y);else{const r=A.projection;e=r.unproject(n),t=r.unproject(i)}E=new Be(e.longitude,e.latitude,t.longitude,t.latitude)}E=FTe(E,A),v=zTe(A,E,v);const T=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+_});return Promise.resolve({url:T,tilingScheme:A,rectangle:E,tileWidth:y,tileHeight:b,minimumLevel:v,maximumLevel:O,tileDiscardPolicy:g.tileDiscardPolicy,credit:g.credit})},BTe.prototype._metadataFailure=function(){const e=this._options,t=Object(c.a)(e.fileExtension,"png"),n=Object(c.a)(e.tileWidth,256),i=Object(c.a)(e.tileHeight,256),r=e.maximumLevel,o=Object(l.a)(e.tilingScheme)?e.tilingScheme:new pl({ellipsoid:e.ellipsoid});let a=Object(c.a)(e.rectangle,o.rectangle);a=FTe(a,o);const s=zTe(o,a,e.minimumLevel),u=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+t});return Promise.resolve({url:u,tilingScheme:o,rectangle:a,tileWidth:n,tileHeight:i,minimumLevel:s,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit})};var kTe=BTe;function UTe(e){if(e=Object(c.a)(e,{}),!Object(l.a)(e.url))throw new u.a("options.url is required.");if(!Object(l.a)(e.channel))throw new u.a("options.channel is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=1.9,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;const t=e.url,n=Object(c.a)(e.path,"/default_map"),i=Tt.a.createIfNeeded(t).getDerivedResource({url:"/"===n[0]?n.substring(1):n});i.appendForwardSlash(),this._resource=i,this._url=t,this._path=n,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new ln(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${UTe.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new un.a,this._ready=!1;const r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),o=this;let a;function s(t){let n,i,r;try{n=JSON.parse(t)}catch(e){n=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(let e=0;e<n.layers.length;e++)if(n.layers[e].id===o._channel){i=n.layers[e];break}if(!Object(l.a)(i))return r=`Could not find layer with channel (id) of ${o._channel}.`,a=dl.reportError(a,o,o._errorEvent,r),a.retry?d():Promise.reject(new ye.a(r));if(!Object(l.a)(i.version))return r=`Could not find a version in channel (id) ${o._channel}.`,a=dl.reportError(a,o,o._errorEvent,r),a.retry?d():Promise.reject(new ye.a(r));if(o._version=i.version,Object(l.a)(n.projection)&&"flat"===n.projection)o._tilingScheme=new Gt({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Be(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:e.ellipsoid});else{if(Object(l.a)(n.projection)&&"mercator"!==n.projection)return r=`Unsupported projection ${n.projection}.`,a=dl.reportError(a,o,o._errorEvent,r),a.retry?d():Promise.reject(new ye.a(r));o._tilingScheme=new pl({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid})}return o._ready=!0,dl.reportSuccess(a),Promise.resolve(!0)}function h(e){const t=Object(c.a)(e.message,`An error occurred while accessing ${r.url}.`);return a=dl.reportError(a,o,o._errorEvent,t),Promise.reject(new ye.a(t))}function d(){return r.fetchText().then(s).catch(h)}this._readyPromise=d()}Object.defineProperties(UTe.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){if(!this._ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},version:{get:function(){if(!this._ready)throw new u.a("version must not be called before the imagery provider is ready.");return this._version}},requestType:{get:function(){if(!this._ready)throw new u.a("requestType must not be called before the imagery provider is ready.");return this._requestType}},rectangle:{get:function(){if(!this._ready)throw new u.a("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),UTe.prototype.getTileCredits=function(e,t,n){},UTe.prototype.requestImage=function(e,t,n,i){if(!this._ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");const r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Uve.loadImage(this,r)},UTe.prototype.pickFeatures=function(e,t,n,i,r){},UTe._logoUrl=void 0,Object.defineProperties(UTe,{logoUrl:{get:function(){return Object(l.a)(UTe._logoUrl)||(UTe._logoUrl=Lt("Assets/Images/google_earth_credit.png")),UTe._logoUrl},set:function(e){s.a.defined("value",e),UTe._logoUrl=e}}});var VTe=UTe;const HTe=/\/$/,GTe=new ln('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function qTe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).mapId;if(!Object(l.a)(t))throw new u.a("options.mapId is required.");const n=e.accessToken;if(!Object(l.a)(n))throw new u.a("options.accessToken is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;const i=Tt.a.createIfNeeded(Object(c.a)(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let r=Object(c.a)(e.format,"png");/\./.test(r)||(r="."+r),this._format=r;let o,a=i.getUrlComponent();HTe.test(a)||(a+="/"),a+=`${t}/{z}/{x}/{y}${this._format}`,i.url=a,i.setQueryParameters({access_token:n}),Object(l.a)(e.credit)?(o=e.credit,"string"==typeof o&&(o=new ln(o))):o=GTe,this._resource=i,this._imageryProvider=new NTe({url:i,credit:o,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(qTe.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),qTe.prototype.getTileCredits=function(e,t,n){},qTe.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)},qTe.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)},qTe._defaultCredit=GTe;var WTe=qTe;function YTe(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url))throw new u.a("options.url is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;const t=Tt.a.createIfNeeded(e.url),n=Object(c.a)(e.rectangle,Be.MAX_VALUE),i=new Gt({rectangle:n,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=i,this._resource=t,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new un.a,this._ready=!1;let r=e.credit;"string"==typeof r&&(r=new ln(r)),this._credit=r;const o=this;let a;function s(e){return o._image=e,o._tileWidth=e.width,o._tileHeight=e.height,o._ready=!0,dl.reportSuccess(o._errorEvent),Promise.resolve(!0)}function h(e){const n=`Failed to load image ${t.url}.`;return a=dl.reportError(a,o,o._errorEvent,n,0,0,0),a.retry?d():Promise.reject(new ye.a(n))}function d(){return Uve.loadImage(null,t).then(s).catch(h)}this._readyPromise=d()}Object.defineProperties(YTe.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){if(!this._ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return 0}},minimumLevel:{get:function(){if(!this._ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.")}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),YTe.prototype.getTileCredits=function(e,t,n){},YTe.prototype.requestImage=function(e,t,n,i){if(!this._ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");if(Object(l.a)(this._image))return Promise.resolve(this._image)},YTe.prototype.pickFeatures=function(e,t,n,i,r){};var XTe=YTe;function KTe(e){const t=[],n=e.features;for(let e=0;e<n.length;++e){const i=n[e],r=new Fve;if(r.data=i,r.properties=i.properties,r.configureNameFromProperties(i.properties),r.configureDescriptionFromProperties(i.properties),Object(l.a)(i.geometry)&&"Point"===i.geometry.type){const e=i.geometry.coordinates[0],t=i.geometry.coordinates[1];r.position=R.fromDegrees(e,t)}t.push(r)}return t}function JTe(e){const t=e.documentElement;if("MultiFeatureCollection"===t.localName&&"http://www.mapinfo.com/mxp"===t.namespaceURI)return function(e){const t=[],n=e.documentElement.getElementsByTagNameNS("http://www.mapinfo.com/mxp","Feature");for(let e=0;e<n.length;++e){const i=n[e],r={},o=i.getElementsByTagNameNS("http://www.mapinfo.com/mxp","Val");for(let e=0;e<o.length;++e){const t=o[e];if(t.hasAttribute("ref")){const e=t.getAttribute("ref"),n=t.textContent.trim();r[e]=n}}const a=new Fve;a.data=i,a.properties=r,a.configureNameFromProperties(r),a.configureDescriptionFromProperties(r),t.push(a)}return t}(e);if("FeatureInfoResponse"===t.localName&&"http://www.esri.com/wms"===t.namespaceURI)return function(e){const t=e.documentElement,n=[];let i;const r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let e=0;e<r.length;++e){const t=r[e];i={};const o=t.attributes;for(let e=0;e<o.length;++e){const t=o[e];i[t.name]=t.value}n.push($Te(t,i))}else{const e=t.getElementsByTagNameNS("*","FeatureInfo");for(let t=0;t<e.length;++t){const r=e[t];i={};const o=r.childNodes;for(let e=0;e<o.length;++e){const t=o[e];t.nodeType===Node.ELEMENT_NODE&&(i[t.localName]=t.textContent)}n.push($Te(r,i))}}return n}(e);if("FeatureCollection"===t.localName&&"http://www.opengis.net/wfs"===t.namespaceURI)return function(e){const t=[],n=e.documentElement.getElementsByTagNameNS("http://www.opengis.net/gml","featureMember");for(let e=0;e<n.length;++e){const i=n[e],r={};ZTe(i,r),t.push($Te(i,r))}return t}(e);if("ServiceExceptionReport"===t.localName)throw new ye.a((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?function(e){const t=[];let n;const i=e.documentElement.childNodes;for(let e=0;e<i.length;e++)if(i[e].nodeType===Node.ELEMENT_NODE){n=i[e];break}if(!Object(l.a)(n))throw new ye.a("Unable to find first child of the feature info xml document");const r=n.childNodes;for(let e=0;e<r.length;++e){const n=r[e];if(n.nodeType===Node.ELEMENT_NODE){const e={};ZTe(n,e),t.push($Te(n,e))}}return t}(e):function(e){const t=(new XMLSerializer).serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);const r=new Fve;return r.data=e,r.description=n.innerHTML,[r]}(e)}function ZTe(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){const r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),"Point"!==r.localName&&"LineString"!==r.localName&&"Polygon"!==r.localName&&"boundedBy"!==r.localName&&(r.hasChildNodes()&&ZTe(r,t)&&(t[r.localName]=r.textContent))}return n}function $Te(e,t){const n=new Fve;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}const QTe=/<body>\s*<\/body>/im,eCe=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,tCe=/<title>([\s\S]*)<\/title>/im;function nCe(e){if(QTe.test(e))return;if(eCe.test(e))return;let t;const n=tCe.exec(e);n&&n.length>1&&(t=n[1]);const i=new Fve;return i.name=t,i.description=e,i.data=e,[i]}var iCe=function(e,t,n){if(!Object(l.a)(e))throw new u.a("type is required.");if(this.type=e,!Object(l.a)(t))if("json"===e)t="application/json";else if("xml"===e)t="text/xml";else if("html"===e)t="text/html";else{if("text"!==e)throw new u.a('format is required when type is not "json", "xml", "html", or "text".');t="text/plain"}if(this.format=t,!Object(l.a)(n))if("json"===e)n=KTe;else if("xml"===e)n=JTe;else if("html"===e)n=nCe;else{if("text"!==e)throw new u.a('callback is required when type is not "json", "xml", "html", or "text".');n=nCe}this.callback=n};function rCe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.clock",e.clock),s.a.typeOf.object("options.times",e.times),s.a.typeOf.func("options.requestImageFunction",e.requestImageFunction),s.a.typeOf.func("options.reloadFunction",e.reloadFunction),this._tileCache={},this._tilesRequestedForInterval=[];const t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}function oCe(e,t,n){return`${e}-${t}-${n}`}function aCe(e){const t=e._times;if(!Object(l.a)(t))return;const n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&0!==o)return;let a,s=t.indexOf(i);if(s<0)return;const c=t.get(s);return o>0?(a=tr.secondsDifference(c.stop,i),++s):(a=tr.secondsDifference(c.start,i),--s),a/=o,s>=0&&a<=5?t.get(s):void 0}function sCe(e,t,n){const i=e._times.indexOf(n.start),r=e._tileCache;let o=r[i];Object(l.a)(o)||(o=r[i]={});const a=t.key;if(Object(l.a)(o[a]))return!0;const s=function(e){const t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}(a),c=new zc.a({throttle:!1,throttleByServer:!0,type:Uc.a.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,c,n);return!!Object(l.a)(u)&&(o[a]={promise:u,request:c},!0)}Object.defineProperties(rCe.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),rCe.prototype.getFromCache=function(e,t,n,i){const r=oCe(e,t,n);let o;const a=this._tileCache[this._currentIntervalIndex];if(Object(l.a)(a)&&Object(l.a)(a[r])){const e=a[r];o=e.promise.catch((function(t){throw i.state=e.request.state,t})),delete a[r]}return o},rCe.prototype.checkApproachingInterval=function(e,t,n,i){const r=oCe(e,t,n),o=this._tilesRequestedForInterval,a=aCe(this),s={key:r,priorityFunction:i.priorityFunction};Object(l.a)(a)&&sCe(this,s,a)||o.push(s),o.length>=512&&o.splice(0,256)},rCe.prototype._clockOnTick=function(e){const t=e.currentTime,n=this._times.indexOf(t),i=this._currentIntervalIndex;if(n!==i){const e=this._tileCache[i];for(const t in e)e.hasOwnProperty(t)&&e[t].request.cancel();return delete this._tileCache[i],this._tilesRequestedForInterval=[],this._currentIntervalIndex=n,void this._reloadFunction()}const r=aCe(this);if(Object(l.a)(r)){const e=this._tilesRequestedForInterval;let t=!0;for(;t&&0!==e.length;){const n=e.pop();t=sCe(this,n,r),t||e.push(n)}}};var cCe=rCe;const lCe=[3034,3035,3042,3043,3044],uCe=[4471,4559];function hCe(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url))throw new u.a("options.url is required.");if(!Object(l.a)(e.layers))throw new u.a("options.layers is required.");if(Object(l.a)(e.times)&&!Object(l.a)(e.clock))throw new u.a("options.times was specified, so options.clock is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=Object(c.a)(e.getFeatureInfoUrl,e.url);const t=Tt.a.createIfNeeded(e.url),n=Tt.a.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(hCe.DefaultParameters,!0),n.setQueryParameters(hCe.GetFeatureInfoDefaultParameters,!0),Object(l.a)(e.parameters)&&t.setQueryParameters(fCe(e.parameters)),Object(l.a)(e.getFeatureInfoParameters)&&n.setQueryParameters(fCe(e.getFeatureInfoParameters));const i=this;this._reload=void 0,Object(l.a)(e.times)&&(this._timeDynamicImagery=new cCe({clock:e.clock,times:e.times,requestImageFunction:function(e,t,n,r,o){return dCe(i,e,t,n,r,o)},reloadFunction:function(){Object(l.a)(i._reload)&&i._reload()}}));const r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=Object(c.a)(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Zs?"EPSG:3857":"CRS:84");const t=r.crs.split(":");if("EPSG"===t[0]&&2===t.length){const e=Number(t[1]);(e>=4e3&&e<5e3&&!uCe.includes(e)||lCe.includes(e))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=Object(c.a)(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Zs?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);const o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new NTe({url:t,pickFeaturesUrl:n,tilingScheme:Object(c.a)(e.tilingScheme,new Gt({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:Object(c.a)(e.getFeatureInfoFormats,hCe.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function dCe(e,t,n,i,r,o){const a=Object(l.a)(o)?o.data:void 0,s=e._tileProvider;return Object(l.a)(a)&&s._resource.setQueryParameters(a),s.requestImage(t,n,i,r)}function fCe(e){const t={};for(const n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}Object.defineProperties(hCe.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}}),hCe.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)},hCe.prototype.requestImage=function(e,t,n,i){let r;const o=this._timeDynamicImagery;let a;return Object(l.a)(o)&&(a=o.currentInterval,r=o.getFromCache(e,t,n,i)),Object(l.a)(r)||(r=dCe(this,e,t,n,i,a)),Object(l.a)(r)&&Object(l.a)(o)&&o.checkApproachingInterval(e,t,n,i),r},hCe.prototype.pickFeatures=function(e,t,n,i,r){const o=this._timeDynamicImagery;return function(e,t,n,i,r,o,a){const s=Object(l.a)(a)?a.data:void 0,c=e._tileProvider;return Object(l.a)(s)&&c._pickFeaturesResource.setQueryParameters(s),c.pickFeatures(t,n,i,r,o)}(this,e,t,n,i,r,Object(l.a)(o)?o.currentInterval:void 0)},hCe.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),hCe.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),hCe.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new iCe("json","application/json")),Object.freeze(new iCe("xml","text/xml")),Object.freeze(new iCe("text","text/html"))]);var pCe=hCe;const mCe=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function gCe(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url))throw new u.a("options.url is required.");if(!Object(l.a)(e.layer))throw new u.a("options.layer is required.");if(!Object(l.a)(e.style))throw new u.a("options.style is required.");if(!Object(l.a)(e.tileMatrixSetID))throw new u.a("options.tileMatrixSetID is required.");if(Object(l.a)(e.times)&&!Object(l.a)(e.clock))throw new u.a("options.times was specified, so options.clock is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;const t=Tt.a.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,r=t.url,o=r.match(/{/g);if(!Object(l.a)(o)||1===o.length&&/{s}/.test(r))t.setQueryParameters(mCe),this._useKvp=!0;else{const e={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(e),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=Object(c.a)(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=Object(l.a)(e.tilingScheme)?e.tilingScheme:new pl({ellipsoid:e.ellipsoid}),this._tileWidth=Object(c.a)(e.tileWidth,256),this._tileHeight=Object(c.a)(e.tileHeight,256),this._minimumLevel=Object(c.a)(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=Object(c.a)(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;const a=this;this._reload=void 0,Object(l.a)(e.times)&&(this._timeDynamicImagery=new cCe({clock:e.clock,times:e.times,requestImageFunction:function(e,t,n,i,r){return _Ce(a,e,t,n,i,r)},reloadFunction:function(){Object(l.a)(a._reload)&&a._reload()}})),this._readyPromise=Promise.resolve(!0);const s=this._tilingScheme.positionToTileXY(Be.southwest(this._rectangle),this._minimumLevel),h=this._tilingScheme.positionToTileXY(Be.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(h.x-s.x)+1)*(Math.abs(h.y-s.y)+1);if(d>4)throw new u.a(`The imagery provider's rectangle and minimumLevel indicate that there are ${d} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new un.a;const f=e.credit;this._credit="string"==typeof f?new ln(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():Object(l.a)(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function _Ce(e,t,n,i,r,o){const a=e._tileMatrixLabels,s=Object(l.a)(a)?a[i]:i.toString(),c=e._subdomains,u=e._dimensions,h=Object(l.a)(o)?o.data:void 0;let d,f;if(e._useKvp){let o={};o.tilematrix=s,o.layer=e._layer,o.style=e._style,o.tilerow=n,o.tilecol=t,o.tilematrixset=e._tileMatrixSetID,o.format=e._format,Object(l.a)(u)&&(o=Object(up.a)(o,u)),Object(l.a)(h)&&(o=Object(up.a)(o,h)),f={s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({queryParameters:o,request:r}),d.setTemplateValues(f)}else f={TileMatrix:s,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},d=e._resource.getDerivedResource({request:r}),d.setTemplateValues(f),Object(l.a)(u)&&d.setTemplateValues(u),Object(l.a)(h)&&d.setTemplateValues(h);return Uve.loadImage(e,d)}Object.defineProperties(gCe.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,Object(l.a)(this._reload)&&this._reload())}}}),gCe.prototype.getTileCredits=function(e,t,n){},gCe.prototype.requestImage=function(e,t,n,i){let r;const o=this._timeDynamicImagery;let a;return Object(l.a)(o)&&(a=o.currentInterval,r=o.getFromCache(e,t,n,i)),Object(l.a)(r)||(r=_Ce(this,e,t,n,i,a)),Object(l.a)(r)&&Object(l.a)(o)&&o.checkApproachingInterval(e,t,n,i),r},gCe.prototype.pickFeatures=function(e,t,n,i,r){};var yCe=gCe;function bCe(e){return function(t){return new e(t)}}const vCe={ARCGIS_MAPSERVER:bCe(Gve),BING:bCe(rOe),GOOGLE_EARTH:bCe(VTe),MAPBOX:bCe(WTe),SINGLE_TILE:bCe(XTe),TMS:bCe(kTe),URL_TEMPLATE:bCe(NTe),WMS:bCe(pCe),WMTS:bCe(yCe)};function OCe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).assetId;s.a.typeOf.number("options.assetId",t),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new un.a;const n=this,i=vy._createEndpointResource(t,e),r=e.assetId.toString()+e.accessToken+e.server;let o=OCe._endpointCache[r];Object(l.a)(o)||(o=i.fetchJson(),OCe._endpointCache[r]=o),this._readyPromise=o.then((function(e){if("IMAGERY"!==e.type)return Promise.reject(new ye.a(`Cesium ion asset ${t} is not an imagery asset.`));let r;const o=e.externalType;if(Object(l.a)(o)){const t=vCe[o];if(!Object(l.a)(t))return Promise.reject(new ye.a("Unrecognized Cesium ion imagery type: "+o));r=t(e.options)}else r=new kTe({url:new vy(e,i)});return n._tileCredits=vy.getCreditsFromEndpoint(e,i),r.errorEvent.addEventListener((function(e){e.provider=n,n._errorEvent.raiseEvent(e)})),n._imageryProvider=r,r.readyPromise.then((function(){return n._ready=!0,!0}))}))}Object.defineProperties(OCe.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._imageryProvider.rectangle}},tileWidth:{get:function(){if(!this._ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._imageryProvider.tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){if(!this._ready)throw new u.a("credit must not be called before the imagery provider is ready.");return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){if(!this._ready)throw new u.a("hasAlphaChannel must not be called before the imagery provider is ready.");return this._imageryProvider.hasAlphaChannel},proxy:{get:function(){}}}}),OCe.prototype.getTileCredits=function(e,t,n){if(!this._ready)throw new u.a("getTileCredits must not be called before the imagery provider is ready.");const i=this._imageryProvider.getTileCredits(e,t,n);return Object(l.a)(i)?this._tileCredits.concat(i):this._tileCredits},OCe.prototype.requestImage=function(e,t,n,i){if(!this._ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");return this._imageryProvider.requestImage(e,t,n,i)},OCe.prototype.pickFeatures=function(e,t,n,i,r){if(!this._ready)throw new u.a("pickFeatures must not be called before the imagery provider is ready.");return this._imageryProvider.pickFeatures(e,t,n,i,r)},OCe._endpointCache={};var wCe=OCe;var ACe=Object.freeze({AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4});var ECe=function(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.style,ACe.AERIAL);return new wCe({assetId:t})};function TCe(e,t){this.credit=e,this.count=Object(c.a)(t,1)}function CCe(e){const t=document.createElement("span");return t.textContent=e,t.className="cesium-credit-delimiter",t}function xCe(e,t){if(Object(l.a)(t)){const n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function SCe(e,t,n,i){const r=e.childNodes;let o=-1;t.sort((function(e,t){return t.count-e.count}));for(let a=0;a<t.length;++a){const s=t[a].credit;if(Object(l.a)(s)){if(o=a,Object(l.a)(n)&&(o*=2,a>0)){const t=o-1;if(r.length<=t)e.appendChild(CCe(n));else{const i=r[t];"cesium-credit-delimiter"!==i.className&&e.replaceChild(CCe(n),i)}}const t=s.element;if(r.length<=o)e.appendChild(xCe(t,i));else{const n=r[o];n._creditId!==s._id&&e.replaceChild(xCe(t,i),n)}}}for(++o;o<r.length;)e.removeChild(r[o])}function ICe(e,t){let n=e+" {";for(const e in t)t.hasOwnProperty(e)&&(n+=`${e}: ${t[e]}; `);return n+=" }\n",n}function PCe(e,t,n){s.a.defined("container",e);const i=this;n=Object(c.a)(n,document.body);const r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);const o=document.createElement("div");function a(e){o.contains(e.target)||i.hideLightbox()}o.className="cesium-credit-lightbox",r.appendChild(o),r.addEventListener("click",a,!1);const l=document.createElement("div");l.className="cesium-credit-lightbox-title",l.textContent="Data provided by:",o.appendChild(l);const u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.innerHTML="&times;",u.className="cesium-credit-lightbox-close",o.appendChild(u);const h=document.createElement("ul");o.appendChild(h);const d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);const f=document.createElement("div");f.className="cesium-credit-textContainer",f.style.display="inline",e.appendChild(f);const p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),function(){let e="";e+=ICe(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),e+=ICe(".cesium-credit-lightbox",{"background-color":"#303336",color:"#ffffff",position:"relative","min-height":"100px",margin:"auto"}),e+=ICe(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:"#ffffff"}),e+=ICe(".cesium-credit-lightbox > ul > li a:hover",{color:"#48b"}),e+=ICe(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=ICe(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=ICe(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=ICe(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:"#ffffff"}),e+=ICe(".cesium-credit-lightbox-close:hover",{color:"#48b"}),e+=ICe(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=ICe(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=ICe(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=ICe(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:"#ffffff"}),e+=ICe(".cesium-credit-expand-link:hover",{color:"#48b"}),e+=ICe(".cesium-credit-text",{color:"#ffffff"}),e+=ICe(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});const t=document.head,n=document.createElement("style");n.innerHTML=e,t.insertBefore(n,t.firstChild)}();const m=ln.clone(PCe.cesiumCredit);this._delimiter=Object(c.a)(t," • "),this._screenContainer=f,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=h,this._lightbox=r,this._hideLightbox=a,this._expandLink=p,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Tl,lightboxCredits:new Tl},this._defaultCredit=void 0,this.viewport=n,this.container=e}function DCe(e,t,n,i){i=Object(c.a)(i,1);let r=t.get(n.id);if(Object(l.a)(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{const o=e._creditDisplayElementPool,a=e._creditDisplayElementPoolIndex;a<o.length?(r=o[a],r.credit=n,r.count=i):(r=new TCe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}let RCe;function jCe(){if(!Object(l.a)(RCe)){let e=Lt("Assets/Images/ion-credit.png");if(0!==e.indexOf("http://")&&0!==e.indexOf("https://")&&0!==e.indexOf("data:")){e=new rc.a(e).path()}RCe=new ln(`<a href="https://cesium.com/" target="_blank"><img src="${e}" title="Cesium ion"/></a>`,!0)}return PCe._cesiumCreditInitialized||(PCe._cesiumCredit=RCe,PCe._cesiumCreditInitialized=!0),RCe}PCe.prototype.addCredit=function(e){if(s.a.defined("credit",e),e._isIon)return Object(l.a)(this._defaultCredit)||(this._defaultCredit=ln.clone(jCe())),void(this._currentCesiumCredit=this._defaultCredit);let t;t=e.showOnScreen?this._currentFrameCredits.screenCredits:this._currentFrameCredits.lightboxCredits,DCe(this,t,e)},PCe.prototype.addDefaultCredit=function(e){s.a.defined("credit",e);const t=this._defaultCredits;(function(e,t){const n=e.length;for(let i=0;i<n;i++){const n=e[i];if(ln.equals(n,t))return!0}return!1})(t,e)||t.push(e)},PCe.prototype.removeDefaultCredit=function(e){s.a.defined("credit",e);const t=this._defaultCredits,n=t.indexOf(e);-1!==n&&t.splice(n,1)},PCe.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},PCe.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},PCe.prototype.update=function(){this._expanded&&function(e){const t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<576?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=Math.floor(.5*(i-t.clientHeight))+"px"),e._lastViewportWidth=n),n>=576&&i!==e._lastViewportHeight&&(t.style.marginTop=Math.floor(.5*(i-t.clientHeight))+"px",e._lastViewportHeight=i)}(this)},PCe.prototype.beginFrame=function(){const e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;const t=e.screenCredits;t.removeAll();const n=this._defaultCredits;for(let e=0;e<n.length;++e){DCe(this,t,n[e],Number.MAX_VALUE)}e.lightboxCredits.removeAll(),ln.equals(PCe.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=ln.clone(PCe.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},PCe.prototype.endFrame=function(){const e=this._currentFrameCredits.screenCredits.values;SCe(this._screenContainer,e,this._delimiter,void 0);const t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",SCe(this._creditList,t,void 0,"li"),function(e){const t=e._previousCesiumCredit,n=e._currentCesiumCredit;ln.equals(n,t)||(Object(l.a)(t)&&e._cesiumCreditContainer.removeChild(t.element),Object(l.a)(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}(this)},PCe.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),sc(this)},PCe.prototype.isDestroyed=function(){return!1},PCe._cesiumCredit=void 0,PCe._cesiumCreditInitialized=!1,Object.defineProperties(PCe,{cesiumCredit:{get:function(){return jCe(),PCe._cesiumCredit},set:function(e){PCe._cesiumCredit=e,PCe._cesiumCreditInitialized=!0}}}),PCe.CreditDisplayElement=TCe;var MCe=PCe;function LCe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).attributeName;let n=e.perInstanceAttribute;if(!Object(l.a)(t))throw new u.a("options.attributeName is required.");Object(l.a)(n)||(n=!1);let i=Object(c.a)(e.glslDatatype,"vec3");const r="v_"+t;let o;if("normal"===t||"tangent"===t||"bitangent"===t)o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); }\n`;else switch("st"===t&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); }\n`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); }\n`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); }\n`;break;case"vec4":o=`vec4 getColor() { return ${r}; }\n`;break;default:throw new u.a("options.glslDatatype must be float, vec2, vec3, or vec4.")}const a=`attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n${n?"":`attribute ${i} ${t};\n`}varying ${i} ${r};\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n${n?`${r} = czm_batchTable_${t}(batchId);\n`:`${r} = ${t};\n`}gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}`,s=`varying ${i} ${r};\n${o}\nvoid main()\n{\ngl_FragColor = getColor();\n}`;this.material=void 0,this.translucent=Object(c.a)(e.translucent,!1),this._vertexShaderSource=Object(c.a)(e.vertexShaderSource,a),this._fragmentShaderSource=Object(c.a)(e.fragmentShaderSource,s),this._renderState=RD.getDefaultRenderState(!1,!1,e.renderState),this._closed=Object(c.a)(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(LCe.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),LCe.prototype.getFragmentShaderSource=RD.prototype.getFragmentShaderSource,LCe.prototype.isTranslucent=RD.prototype.isTranslucent,LCe.prototype.getRenderState=RD.prototype.getRenderState;var NCe=LCe;function BCe(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.camera))throw new u.a("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=Object(c.a)(e.color,sp.CYAN),this._updateOnChange=Object(c.a)(e.updateOnChange,!0),this.show=Object(c.a)(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}const FCe=new O,zCe=new ce,kCe=new To,UCe=new dv,VCe=new lv,HCe=new nv,GCe=new Qb,qCe=new sp,WCe=[1,1e5];BCe.prototype.update=function(e){if(!this.show)return;const t=this._planesPrimitives,n=this._outlinePrimitives;let i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(0===t.length){const e=this._camera,r=e.frustum;let o,a;o=r instanceof dv?UCe:r instanceof lv?VCe:r instanceof nv?HCe:GCe,o=r.clone(o);let s=this._frustumSplits;!Object(l.a)(s)||s.length<=1?(s=WCe,s[0]=this._camera.frustum.near,s[1]=this._camera.frustum.far,a=1):a=s.length-1;const c=e.positionWC,u=e.directionWC,h=e.upWC;let d=e.rightWC;d=O.negate(d,FCe);const f=zCe;ce.setColumn(f,0,d,f),ce.setColumn(f,1,h,f),ce.setColumn(f,2,u,f);const p=To.fromRotationMatrix(f,kCe);for(t.length=n.length=a,i=0;i<a;++i)o.near=s[i],o.far=s[i+1],t[i]=new hF({geometryInstances:new Ph({geometry:new Rv({origin:c,orientation:p,frustum:o,_drawNearPlane:0===i}),attributes:{color:lp.fromColor(sp.fromAlpha(this._color,.1,qCe))},id:this.id,pickPrimitive:this}),appearance:new MR({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new hF({geometryInstances:new Ph({geometry:new Fv({origin:c,orientation:p,frustum:o,_drawNearPlane:0===i}),attributes:{color:lp.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)},BCe.prototype.isDestroyed=function(){return!1},BCe.prototype.destroy=function(){const e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return sc(this)};var YCe=BCe;function XCe(){this._cachedShowFrustumsShaders={}}const KCe=new sp;const JCe=new XR;XCe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){const i=t.shaderProgram.id;let r=this._cachedShowFrustumsShaders[i];Object(l.a)(r)||(r=function(e,t){const n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map((function(e){e=UN.replaceMain(e,"czm_Debug_main");const t=/gl_FragData\[(\d+)\]/g;let n;for(;null!==(n=t.exec(e));)-1===o.indexOf(n[1])&&o.push(n[1]);return e}));const a=o.length;let s,c="";if(c+="uniform vec3 debugShowCommandsColor;\n",c+="uniform vec3 debugShowFrustumsColor;\n",c+="void main() \n{ \n    czm_Debug_main(); \n",a>0)for(s=0;s<a;++s)c+=`    gl_FragData[${o[s]}].rgb *= debugShowCommandsColor;\n`,c+=`    gl_FragData[${o[s]}].rgb *= debugShowFrustumsColor;\n`;else c+="    gl_FragColor.rgb *= debugShowCommandsColor;\n",c+="    gl_FragColor.rgb *= debugShowFrustumsColor;\n";c+="}",r.sources.push(c);const l=function(e){const t={},n=e.vertexAttributes;for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e].index);return t}(i);return oM.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:l})}(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);const o=XR.shallowClone(t,JCe);o.shaderProgram=r,o.uniformMap=function(e,t){let n;return n=Object(l.a)(t.uniformMap)?t.uniformMap:{},Object(l.a)(n.debugShowCommandsColor)||Object(l.a)(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(Object(l.a)(t._debugColor)||(t._debugColor=sp.fromRandom()),t._debugColor):sp.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(KCe.red=1&t.debugOverlappingFrustums?1:0,KCe.green=2&t.debugOverlappingFrustums?1:0,KCe.blue=4&t.debugOverlappingFrustums?1:0,KCe.alpha=1,KCe):sp.WHITE}),n}(e,t),o.execute(e.context,n)};var ZCe=XCe;function $Ce(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.length=Object(c.a)(e.length,1e7),this._length=void 0,this.width=Object(c.a)(e.width,2),this._width=void 0,this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=new Me,this.id=e.id,this._id=void 0,this._primitive=void 0}$Ce.prototype.update=function(e){if(this.show){if(!Object(l.a)(this._primitive)||!Me.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=Me.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,Object(l.a)(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);const e=new Ph({geometry:new yC({positions:[O.ZERO,O.UNIT_X],width:this.width,vertexFormat:Iz.VERTEX_FORMAT,colors:[sp.RED,sp.RED],arcType:vl.NONE}),modelMatrix:Me.multiplyByUniformScale(this.modelMatrix,this.length,new Me),id:this.id,pickPrimitive:this}),t=new Ph({geometry:new yC({positions:[O.ZERO,O.UNIT_Y],width:this.width,vertexFormat:Iz.VERTEX_FORMAT,colors:[sp.GREEN,sp.GREEN],arcType:vl.NONE}),modelMatrix:Me.multiplyByUniformScale(this.modelMatrix,this.length,new Me),id:this.id,pickPrimitive:this}),n=new Ph({geometry:new yC({positions:[O.ZERO,O.UNIT_Z],width:this.width,vertexFormat:Iz.VERTEX_FORMAT,colors:[sp.BLUE,sp.BLUE],arcType:vl.NONE}),modelMatrix:Me.multiplyByUniformScale(this.modelMatrix,this.length,new Me),id:this.id,pickPrimitive:this});this._primitive=new hF({geometryInstances:[e,t,n],appearance:new Iz,asynchronous:!1})}this._primitive.update(e)}},$Ce.prototype.isDestroyed=function(){return!1},$Ce.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),sc(this)};var QCe=$Ce,exe="varying vec4 positionEC;\n\nvoid main()\n{\n    vec3 position;\n    vec3 direction;\n    if (czm_orthographicIn3D == 1.0)\n    {\n        vec2 uv = (gl_FragCoord.xy -  czm_viewport.xy) / czm_viewport.zw;\n        vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom\n        vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top\n        position = vec3(mix(minPlane, maxPlane, uv), 0.0);\n        direction = vec3(0.0, 0.0, -1.0);\n    } \n    else \n    {\n        position = vec3(0.0);\n        direction = normalize(positionEC.xyz);\n    }\n\n    czm_ray ray = czm_ray(position, direction);\n\n    vec3 ellipsoid_center = czm_view[3].xyz;\n\n    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\n    if (!czm_isEmpty(intersection))\n    {\n        gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n    }\n    else\n    {\n        discard;\n    }\n\n    czm_writeLogDepth();\n}\n",txe="attribute vec4 position;\n\nvarying vec4 positionEC;\n\nvoid main()\n{\n    positionEC = czm_modelView * position;\n    gl_Position = czm_projection * positionEC;\n\n    czm_vertexLogDepth();\n}\n";function nxe(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=Object(c.a)(e,0)}const ixe=Jr.supportsTypedArrays()?new Float32Array(12):[],rxe=new O,oxe=new O,axe=new O,sxe=new O,cxe=new O;nxe.prototype.update=function(e){if(this._mode=e.mode,e.mode!==AB.SCENE3D)return;const t=e.context,n=e.mapProjection.ellipsoid.radii,i=new H(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(Object(l.a)(this._command)||(this._rs=vj.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new XR({renderState:this._rs,boundingVolume:new At(O.ZERO,i.maximumRadius),pass:KR.OPAQUE,owner:this})),!Object(l.a)(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;const e=new UN({sources:[txe]}),n=new UN({sources:[exe]});if(r){const t="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n";n.sources.push(t),n.defines.push("LOG_DEPTH"),e.defines.push("LOG_DEPTH")}this._sp=oM.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:e,fragmentShaderSource:n,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}const o=function(e,t){const n=e.radii,i=t.camera;let r,o,a;if(i.frustum instanceof nv)r=O.ZERO,o=i.rightWC,a=i.upWC;else{const t=i.positionWC,n=O.multiplyComponents(e.oneOverRadii,t,rxe),s=O.normalize(n,oxe),c=O.normalize(O.cross(O.UNIT_Z,n,axe),axe),l=O.normalize(O.cross(s,c,sxe),sxe),u=O.magnitude(n),h=Math.sqrt(u*u-1);r=O.multiplyByScalar(s,1/u,rxe);const d=h/u;o=O.multiplyByScalar(c,d,oxe),a=O.multiplyByScalar(l,d,axe)}const s=O.add(r,a,cxe);O.subtract(s,o,s),O.multiplyComponents(n,s,s),O.pack(s,ixe,0);const c=O.subtract(r,a,cxe);O.subtract(c,o,c),O.multiplyComponents(n,c,c),O.pack(c,ixe,3);const l=O.add(r,a,cxe);O.add(l,o,l),O.multiplyComponents(n,l,l),O.pack(l,ixe,6);const u=O.subtract(r,a,cxe);return O.add(u,o,u),O.multiplyComponents(n,u,u),O.pack(u,ixe,9),ixe}(i,e);if(Object(l.a)(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{const e=new Zl({attributes:{position:new $l({componentDatatype:gs.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:zl.TRIANGLES});this._va=iB.fromGeometry({context:t,geometry:e,attributeLocations:{position:0},bufferUsage:KN.DYNAMIC_DRAW}),this._command.vertexArray=this._va}},nxe.prototype.execute=function(e,t){this._mode===AB.SCENE3D&&this._command.execute(e,t)},nxe.prototype.isDestroyed=function(){return!1},nxe.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var lxe=nxe;function uxe(){}const hxe=/\bgl_FragDepthEXT\b/,dxe=/\bdiscard\b/;uxe.createDepthOnlyDerivedCommand=function(e,t,n,i){let r,o;return Object(l.a)(i)||(i={}),Object(l.a)(i.depthOnlyCommand)&&(r=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=XR.shallowClone(t,i.depthOnlyCommand),Object(l.a)(r)&&i.shaderProgramId===t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o):(i.depthOnlyCommand.shaderProgram=function(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!Object(l.a)(n)){const i=t._attributeLocations;let r,o=t.fragmentShaderSource,a=!1;const s=o.sources;let c=s.length;for(r=0;r<c;++r)if(hxe.test(s[r])||dxe.test(s[r])){a=!0;break}let l=!1;const u=o.defines;for(c=u.length,r=0;r<c;++r)if("LOG_DEPTH"===u[r]){l=!0;break}let h;a||l?!a&&l&&(h="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\nvoid main() \n{ \n    gl_FragColor = vec4(1.0); \n    czm_writeLogDepth(); \n} \n",o=new UN({defines:["LOG_DEPTH"],sources:[h]})):(h="void main() \n{ \n    gl_FragColor = vec4(1.0); \n} \n",o=new UN({sources:[h]})),n=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}(n,t.shaderProgram),i.depthOnlyCommand.renderState=function(e,t){const n=e._depthOnlyRenderStateCache;let i=n[t.id];if(!Object(l.a)(i)){const e=vj.getState(t);e.depthMask=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=vj.fromCache(e),n[t.id]=i}return i}(e,t.renderState),i.shaderProgramId=t.shaderProgram.id),i};const fxe=/\s+czm_writeLogDepth\(/,pxe=/\s+czm_vertexLogDepth\(/,mxe=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;uxe.createLogDepthCommand=function(e,t,n){let i;return Object(l.a)(n)||(n={}),Object(l.a)(n.command)&&(i=n.command.shaderProgram),n.command=XR.shallowClone(e,n.command),Object(l.a)(i)&&n.shaderProgramId===e.shaderProgram.id?n.command.shaderProgram=i:(n.command.shaderProgram=function(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!Object(l.a)(n)){const i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();let a,s;r.defines=Object(l.a)(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),o.defines=Object(l.a)(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH");let c=!1,u=r.sources,h=u.length;for(a=0;a<h;++a)if(pxe.test(u[a])){c=!0;break}if(!c){for(a=0;a<h;++a)u[a]=UN.replaceMain(u[a],"czm_log_depth_main");s="\n\nvoid main() \n{ \n    czm_log_depth_main(); \n    czm_vertexLogDepth(); \n} \n",u.push(s)}for(u=o.sources,h=u.length,c=!1,a=0;a<h;++a)fxe.test(u[a])&&(c=!0);-1!==o.defines.indexOf("LOG_DEPTH_WRITE")&&(c=!0);let d=!0;for(a=0;a<h;++a)mxe.test(u[a])&&(d=!1);let f="";if(d&&(f+="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),!c){for(a=0;a<h;a++)u[a]=UN.replaceMain(u[a],"czm_log_depth_main");f+="\nvoid main() \n{ \n    czm_log_depth_main(); \n    czm_writeLogDepth(); \n} \n"}u.push(f),n=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id),n},uxe.createPickDerivedCommand=function(e,t,n,i){let r,o;return Object(l.a)(i)||(i={}),Object(l.a)(i.pickCommand)&&(r=i.pickCommand.shaderProgram,o=i.pickCommand.renderState),i.pickCommand=XR.shallowClone(t,i.pickCommand),Object(l.a)(r)&&i.shaderProgramId===t.shaderProgram.id?(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o):(i.pickCommand.shaderProgram=function(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!Object(l.a)(i)){const r=t._attributeLocations;let o=t.fragmentShaderSource;const a=o.sources,s=a.length,c=`void main() \n{ \n    czm_non_pick_main(); \n    if (gl_FragColor.a == 0.0) { \n        discard; \n    } \n    gl_FragColor = ${n}; \n} \n`,l=new Array(s+1);for(let e=0;e<s;++e)l[e]=UN.replaceMain(a[e],"czm_non_pick_main");l[s]=c,o=new UN({sources:l,defines:o.defines}),i=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:r})}return i}(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=function(e,t){const n=e.picking.pickRenderStateCache;let i=n[t.id];if(!Object(l.a)(i)){const e=vj.getState(t);e.blending.enabled=!1,e.depthMask=!0,i=vj.fromCache(e),n[t.id]=i}return i}(e,t.renderState),i.shaderProgramId=t.shaderProgram.id),i},uxe.createHdrCommand=function(e,t,n){let i;return Object(l.a)(n)||(n={}),Object(l.a)(n.command)&&(i=n.command.shaderProgram),n.command=XR.shallowClone(e,n.command),Object(l.a)(i)&&n.shaderProgramId===e.shaderProgram.id?n.command.shaderProgram=i:(n.command.shaderProgram=function(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!Object(l.a)(n)){const i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();r.defines=Object(l.a)(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=Object(l.a)(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),n=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}return n}(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id),n};var gxe=uxe;function _xe(e){if(!Object(l.a)(e))throw new u.a("scene is required.");this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;const t=this;function n(e){const n=e.alpha;if(!Object(l.a)(n))return t._alpha=void 0,t._beta=void 0,void(t._gamma=void 0);t._alpha=h.a.toRadians(n),t._beta=h.a.toRadians(e.beta),t._gamma=h.a.toRadians(e.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}const yxe=new To,bxe=new To,vxe=new ce;_xe.prototype.update=function(){if(!Object(l.a)(this._alpha))return;Object(l.a)(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);const e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;!function(e,t,n,i){const r=e.direction,o=e.right,a=e.up,s=To.fromAxisAngle(r,n,bxe),c=To.fromAxisAngle(o,i,yxe),l=To.multiply(c,s,c),u=To.fromAxisAngle(a,t,bxe);To.multiply(u,l,l);const h=ce.fromQuaternion(l,vxe);ce.multiplyByVector(h,o,o),ce.multiplyByVector(h,a,a),ce.multiplyByVector(h,r,r)}(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma},_xe.prototype.isDestroyed=function(){return!1},_xe.prototype.destroy=function(){return this._removeListener(),sc(this)};var Oxe=_xe;var wxe=function(e){if(s.a.typeOf.object("options",e),s.a.typeOf.object("options.direction",e.direction),O.equals(e.direction,O.ZERO))throw new u.a("options.direction cannot be zero-length");this.direction=O.clone(e.direction),this.color=sp.clone(Object(c.a)(e.color,sp.WHITE)),this.intensity=Object(c.a)(e.intensity,1)},Axe="#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\n\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\n\nvarying vec3 v_positionEC;\n\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\n    vec3 positionEC = czm_pointAlongRay(ray, intersection);\n    vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\n    vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\n    vec3 sphericalNormal = normalize(positionMC / u_radii);\n    vec3 normalMC = geodeticNormal * side;              // normalized surface normal (always facing the viewer) in model coordinates\n    vec3 normalEC = normalize(czm_normal * normalMC);   // normalized surface normal in eye coordiantes\n\n    vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\n    vec3 positionToEyeEC = -positionEC;\n\n    czm_materialInput materialInput;\n    materialInput.s = st.s;\n    materialInput.st = st;\n    materialInput.str = (positionMC + u_radii) / u_radii;\n    materialInput.normalEC = normalEC;\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\n    materialInput.positionToEyeEC = positionToEyeEC;\n    czm_material material = czm_getMaterial(materialInput);\n\n#ifdef ONLY_SUN_LIGHTING\n    return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);\n#else\n    return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n\nvoid main()\n{\n    // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii\n    // in the vertex shader. Only when it is larger than some constant, march along the ray.\n    // Otherwise perform one intersection test which will be the common case.\n\n    // Test if the ray intersects a sphere with the ellipsoid's maximum radius.\n    // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test\n    // may cause false negatives. This will discard fragments before marching the ray forward.\n    float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\n    vec3 direction = normalize(v_positionEC);\n    vec3 ellipsoidCenter = czm_modelView[3].xyz;\n\n    float t1 = -1.0;\n    float t2 = -1.0;\n\n    float b = -2.0 * dot(direction, ellipsoidCenter);\n    float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\n\n    float discriminant = b * b - 4.0 * c;\n    if (discriminant >= 0.0) {\n        t1 = (-b - sqrt(discriminant)) * 0.5;\n        t2 = (-b + sqrt(discriminant)) * 0.5;\n    }\n\n    if (t1 < 0.0 && t2 < 0.0) {\n        discard;\n    }\n\n    float t = min(t1, t2);\n    if (t < 0.0) {\n        t = 0.0;\n    }\n\n    // March ray forward to intersection with larger sphere and find\n    czm_ray ray = czm_ray(t * direction, direction);\n\n    vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\n\n    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\n\n    if (czm_isEmpty(intersection))\n    {\n        discard;\n    }\n\n    // If the viewer is outside, compute outsideFaceColor, with normals facing outward.\n    vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\n\n    // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.\n    vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\n\n    gl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\n    gl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n    t = (intersection.start != 0.0) ? intersection.start : intersection.stop;\n    vec3 positionEC = czm_pointAlongRay(ray, t);\n    vec4 positionCC = czm_projection * vec4(positionEC, 1.0);\n#ifdef LOG_DEPTH\n    czm_writeLogDepth(1.0 + positionCC.w);\n#else\n    float z = positionCC.z / positionCC.w;\n\n    float n = czm_depthRange.near;\n    float f = czm_depthRange.far;\n\n    gl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n#endif\n}\n",Exe="attribute vec3 position;\n\nuniform vec3 u_radii;\n\nvarying vec3 v_positionEC;\n\nvoid main()\n{\n    // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.\n    // Scale to consider the radii.  We could also do this once on the CPU when using the BoxGeometry,\n    // but doing it here allows us to change the radii without rewriting the vertex data, and\n    // allows all ellipsoids to reuse the same vertex data.\n    vec4 p = vec4(u_radii * position, 1.0);\n\n    v_positionEC = (czm_modelView * p).xyz;     // position in eye coordinates\n    gl_Position = czm_modelViewProjection * p;  // position in clip coordinates\n\n    // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums\n    // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the\n    // ellipsoid (does not write depth) that was rendered in the farther frustum.\n    //\n    // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates\n    // artifacts since some fragments can be alpha blended twice.  This is solved by only rendering\n    // the ellipsoid in the closest frustum to the viewer.\n    gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n\n    czm_vertexLogDepth();\n}\n";const Txe={position:0};function Cxe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.center=O.clone(Object(c.a)(e.center,O.ZERO)),this._center=new O,this.radii=O.clone(e.radii),this._radii=new O,this._oneOverEllipsoidRadiiSquared=new O,this._boundingSphere=new At,this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._modelMatrix=new Me,this._computedModelMatrix=new Me,this.show=Object(c.a)(e.show,!0),this.material=Object(c.a)(e.material,CR.fromType(CR.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=Object(c.a)(e.debugShowBoundingVolume,!1),this.onlySunLighting=Object(c.a)(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=Object(c.a)(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new XR({owner:Object(c.a)(e._owner,this)}),this._pickCommand=new XR({owner:Object(c.a)(e._owner,this),pickOnly:!0});const t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}const xxe="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n";Cxe.prototype.update=function(e){if(!this.show||e.mode!==AB.SCENE3D||!Object(l.a)(this.center)||!Object(l.a)(this.radii))return;if(!Object(l.a)(this.material))throw new u.a("this.material must be defined.");const t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;Object(l.a)(this._rs)&&!i||(this._translucent=n,this._rs=vj.fromCache({cull:{enabled:!0,face:PD.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?SD.ALPHA_BLEND:void 0})),Object(l.a)(this._va)||(this._va=function(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(Object(l.a)(t))return t;const n=uu.createGeometry(uu.fromDimensions({dimensions:new O(2,2,2),vertexFormat:nu.POSITION_ONLY}));return t=iB.fromGeometry({context:e,geometry:n,attributeLocations:Txe,bufferUsage:KN.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}(t));let r=!1;const o=this.radii;if(!O.equals(this._radii,o)){O.clone(o,this._radii);const e=this._oneOverEllipsoidRadiiSquared;e.x=1/(o.x*o.x),e.y=1/(o.y*o.y),e.z=1/(o.z*o.z),r=!0}Me.equals(this.modelMatrix,this._modelMatrix)&&O.equals(this.center,this._center)||(Me.clone(this.modelMatrix,this._modelMatrix),O.clone(this.center,this._center),Me.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(O.clone(O.ZERO,this._boundingSphere.center),this._boundingSphere.radius=O.maximumComponent(o),At.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));const a=this._material!==this.material;this._material=this.material,this._material.update(t);const s=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;const c=e.useLogDepth,h=this._useLogDepth!==c;this._useLogDepth=c;const d=this._colorCommand;let f,p;(a||s||i||h)&&(f=new UN({sources:[Exe]}),p=new UN({sources:[this.material.shaderSource,Axe]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(f.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH"),p.sources.push(xxe)),this._sp=oM.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:Txe}),d.vertexArray=this._va,d.renderState=this._rs,d.shaderProgram=this._sp,d.uniformMap=Object(up.a)(this._uniforms,this.material._uniforms),d.executeInClosestFrustum=n);const m=e.commandList,g=e.passes;if(g.render&&(d.boundingVolume=this._boundingSphere,d.debugShowBoundingVolume=this.debugShowBoundingVolume,d.modelMatrix=this._computedModelMatrix,d.pass=n?KR.TRANSLUCENT:KR.OPAQUE,m.push(d)),g.pick){const e=this._pickCommand;Object(l.a)(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(a||s||!Object(l.a)(this._pickSP)||h)&&(f=new UN({sources:[Exe]}),p=new UN({sources:[this.material.shaderSource,Axe],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(f.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH"),p.sources.push(xxe)),this._pickSP=oM.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:Txe}),e.vertexArray=this._va,e.renderState=this._rs,e.shaderProgram=this._pickSP,e.uniformMap=Object(up.a)(Object(up.a)(this._uniforms,this._pickUniforms),this.material._uniforms),e.executeInClosestFrustum=n),e.boundingVolume=this._boundingSphere,e.modelMatrix=this._computedModelMatrix,e.pass=n?KR.TRANSLUCENT:KR.OPAQUE,m.push(e)}},Cxe.prototype.isDestroyed=function(){return!1},Cxe.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),sc(this)};var Sxe=Cxe,Ixe="varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n    czm_materialInput materialInput;\n\n    vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\n    normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n    materialInput.s = v_st.s;\n    materialInput.st = v_st;\n    materialInput.str = vec3(v_st, 0.0);\n\n    // Convert tangent space material normal to eye space\n    materialInput.normalEC = normalEC;\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n\n    // Convert view vector to world space\n    vec3 positionToEyeEC = -v_positionEC;\n    materialInput.positionToEyeEC = positionToEyeEC;\n\n    czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n    gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",Pxe="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\n\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n    vec4 p = czm_computePosition();\n\n    v_positionMC = position3DHigh + position3DLow;           // position in model coordinates\n    v_positionEC = (czm_modelViewRelativeToEye * p).xyz;     // position in eye coordinates\n    v_st = st;\n\n    gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function Dxe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(c.a)(e.translucent,!0),n=Object(c.a)(e.aboveGround,!1);this.material=Object(l.a)(e.material)?e.material:CR.fromType(CR.ColorType),this.translucent=Object(c.a)(e.translucent,!0),this._vertexShaderSource=Object(c.a)(e.vertexShaderSource,Pxe),this._fragmentShaderSource=Object(c.a)(e.fragmentShaderSource,Ixe),this._renderState=RD.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=Object(c.a)(e.flat,!1),this._faceForward=Object(c.a)(e.faceForward,n),this._aboveGround=n}Object.defineProperties(Dxe.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return Dxe.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),Dxe.VERTEX_FORMAT=nu.POSITION_AND_ST,Dxe.prototype.getFragmentShaderSource=RD.prototype.getFragmentShaderSource,Dxe.prototype.isTranslucent=RD.prototype.isTranslucent,Dxe.prototype.getRenderState=RD.prototype.getRenderState;var Rxe=Dxe;function jxe(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}const Mxe=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],Lxe=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let e=0;e<Lxe.length;++e)Lxe[e]*=1e6;const Nxe=Lxe[1],Bxe=Lxe[Lxe.length-1];for(let e=0;e<Lxe.length;++e)Lxe[e]=(Lxe[e]-Bxe)/(Nxe-Bxe);let Fxe=0;const zxe=new O;jxe.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;const t=e.camera,n=t.positionCartographic;if(!Object(l.a)(n)||n.height>8e5||e.mode!==AB.SCENE3D)return void(e.fog.enabled=!1);const i=n.height,r=function(e){const t=Mxe,n=t.length;if(e<t[0])return Fxe=0,Fxe;if(e>t[n-1])return Fxe=n-2,Fxe;if(e>=t[Fxe]){if(Fxe+1<n&&e<t[Fxe+1])return Fxe;if(Fxe+2<n&&e<t[Fxe+2])return++Fxe,Fxe}else if(Fxe-1>=0&&e>=t[Fxe-1])return--Fxe,Fxe;let i;for(i=0;i<n-2&&!(e>=t[i]&&e<t[i+1]);++i);return Fxe=i,Fxe}(i),o=h.a.clamp((i-Mxe[r])/(Mxe[r+1]-Mxe[r]),0,1);let a=h.a.lerp(Lxe[r],Lxe[r+1],o);const s=1e6*this.density;a=a*(s-s/Nxe*Bxe)*1e-6;const c=O.normalize(t.positionWC,zxe);a*=1-Math.abs(O.dot(t.directionWC,c)),e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var kxe=jxe;function Uxe(e){if(!Object(l.a)(e)||!Object(l.a)(e.scene))throw new u.a("options.scene is required.");this._scene=e.scene,this.samplingWindow=Object(c.a)(e.samplingWindow,Uxe.defaultSettings.samplingWindow),this.quietPeriod=Object(c.a)(e.quietPeriod,Uxe.defaultSettings.quietPeriod),this.warmupPeriod=Object(c.a)(e.warmupPeriod,Uxe.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=Object(c.a)(e.minimumFrameRateDuringWarmup,Uxe.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=Object(c.a)(e.minimumFrameRateAfterWarmup,Uxe.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new un.a,this._nominalFrameRate=new un.a,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;const t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener((function(e,n){!function(e,t){if(e._pauseCount>0)return;const n=Xf();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/ji.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/ji.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);const t=n-e.samplingWindow/ji.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=t){for(;e._frameTimes.length>=2&&e._frameTimes[1]<t;)e._frameTimes.shift();const i=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/i;const r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);i>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}(t)})),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;const n=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;function i(){var e;e=t,document[e._hiddenPropertyName]?e.pause():e.unpause()}this._visibilityChangeRemoveListener=void 0,Object(l.a)(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Uxe.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},Uxe.fromScene=function(e){if(!Object(l.a)(e))throw new u.a("scene is required.");return Object(l.a)(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new Uxe({scene:e})),e._frameRateMonitor},Object.defineProperties(Uxe.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),Uxe.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},Uxe.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},Uxe.prototype.isDestroyed=function(){return!1},Uxe.prototype.destroy=function(){return this._preUpdateRemoveListener(),Object(l.a)(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),sc(this)};var Vxe=Uxe;var Hxe=function(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=AB.SCENE3D,this.morphTime=AB.getMorphTime(AB.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0};var Gxe=function(e,t){this.near=Object(c.a)(e,0),this.far=Object(c.a)(t,0);const n=KR.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let e=0;e<n;++e)i[e]=[],r[e]=0;this.commands=i,this.indices=r},qxe="uniform vec4 u_initialColor;\n\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_DAY_NIGHT_ALPHA\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\n#endif\n\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n\n#ifdef ENABLE_CLIPPING_PLANES\nuniform highp sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n\n#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\n\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift; // Hue, saturation, brightness\n#endif\n\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\n\n#ifdef TRANSLUCENT\nuniform vec4 u_frontFaceAlphaByDistance;\nuniform vec4 u_backFaceAlphaByDistance;\nuniform vec4 u_translucencyRectangle;\n#endif\n\n#ifdef UNDERGROUND_COLOR\nuniform vec4 u_undergroundColor;\nuniform vec4 u_undergroundColorAlphaByDistance;\n#endif\n\n#ifdef ENABLE_VERTEX_LIGHTING\nuniform float u_lambertDiffuseMultiplier;\n#endif\n\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\nvarying float v_aspect;\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\nvarying vec3 v_atmosphereRayleighColor;\nvarying vec3 v_atmosphereMieColor;\nvarying float v_atmosphereOpacity;\n#endif\n\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\n{\n    float startDistance = nearFarScalar.x;\n    float startValue = nearFarScalar.y;\n    float endDistance = nearFarScalar.z;\n    float endValue = nearFarScalar.w;\n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\n    return mix(startValue, endValue, t);\n}\n#endif\n\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\n{\n    return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\n#endif\n\n#ifdef TRANSLUCENT\nbool inTranslucencyRectangle()\n{\n    return\n        v_textureCoordinates.x > u_translucencyRectangle.x &&\n        v_textureCoordinates.x < u_translucencyRectangle.z &&\n        v_textureCoordinates.y > u_translucencyRectangle.y &&\n        v_textureCoordinates.y < u_translucencyRectangle.w;\n}\n#endif\n\nvec4 sampleAndBlend(\n    vec4 previousColor,\n    sampler2D textureToSample,\n    vec2 tileTextureCoordinates,\n    vec4 textureCoordinateRectangle,\n    vec4 textureCoordinateTranslationAndScale,\n    float textureAlpha,\n    float textureNightAlpha,\n    float textureDayAlpha,\n    float textureBrightness,\n    float textureContrast,\n    float textureHue,\n    float textureSaturation,\n    float textureOneOverGamma,\n    float split,\n    vec4 colorToAlpha,\n    float nightBlend)\n{\n    // This crazy step stuff sets the alpha to 0.0 if this following condition is true:\n    //    tileTextureCoordinates.s < textureCoordinateRectangle.s ||\n    //    tileTextureCoordinates.s > textureCoordinateRectangle.p ||\n    //    tileTextureCoordinates.t < textureCoordinateRectangle.t ||\n    //    tileTextureCoordinates.t > textureCoordinateRectangle.q\n    // In other words, the alpha is zero if the fragment is outside the rectangle\n    // covered by this texture.  Would an actual 'if' yield better performance?\n    vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\n    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n\n    alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\n    textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\n    textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\n#endif\n\n    vec2 translation = textureCoordinateTranslationAndScale.xy;\n    vec2 scale = textureCoordinateTranslationAndScale.zw;\n    vec2 textureCoordinates = tileTextureCoordinates * scale + translation;\n    vec4 value = texture2D(textureToSample, textureCoordinates);\n    vec3 color = value.rgb;\n    float alpha = value.a;\n\n#ifdef APPLY_COLOR_TO_ALPHA\n    vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\n    colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\n    alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n\n#if !defined(APPLY_GAMMA)\n    vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\n    color = tempColor.rgb;\n    alpha = tempColor.a;\n#else\n    color = pow(color, vec3(textureOneOverGamma));\n#endif\n\n#ifdef APPLY_SPLIT\n    float splitPosition = czm_splitPosition;\n    // Split to the left\n    if (split < 0.0 && gl_FragCoord.x > splitPosition) {\n       alpha = 0.0;\n    }\n    // Split to the right\n    else if (split > 0.0 && gl_FragCoord.x < splitPosition) {\n       alpha = 0.0;\n    }\n#endif\n\n#ifdef APPLY_BRIGHTNESS\n    color = mix(vec3(0.0), color, textureBrightness);\n#endif\n\n#ifdef APPLY_CONTRAST\n    color = mix(vec3(0.5), color, textureContrast);\n#endif\n\n#ifdef APPLY_HUE\n    color = czm_hue(color, textureHue);\n#endif\n\n#ifdef APPLY_SATURATION\n    color = czm_saturation(color, textureSaturation);\n#endif\n\n    float sourceAlpha = alpha * textureAlpha;\n    float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\n    outAlpha += sign(outAlpha) - 1.0;\n\n    vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\n\n    // When rendering imagery for a tile in multiple passes,\n    // some GPU/WebGL implementation combinations will not blend fragments in\n    // additional passes correctly if their computation includes an unmasked\n    // divide-by-zero operation,\n    // even if it's not in the output or if the output has alpha zero.\n    //\n    // For example, without sanitization for outAlpha,\n    // this renders without artifacts:\n    //   if (outAlpha == 0.0) { outColor = vec3(0.0); }\n    //\n    // but using czm_branchFreeTernary will cause portions of the tile that are\n    // alpha-zero in the additional pass to render as black instead of blending\n    // with the previous pass:\n    //   outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);\n    //\n    // So instead, sanitize against divide-by-zero,\n    // store this state on the sign of outAlpha, and correct on return.\n\n    return vec4(outColor, max(outAlpha, 0.0));\n}\n\nvec3 colorCorrect(vec3 rgb) {\n#ifdef COLOR_CORRECT\n    // Convert rgb color to hsb\n    vec3 hsb = czm_RGBToHSB(rgb);\n    // Perform hsb shift\n    hsb.x += u_hsbShift.x; // hue\n    hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation\n    hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness\n    // Convert shifted hsb back to rgb\n    rgb = czm_HSBToRGB(hsb);\n#endif\n    return rgb;\n}\n\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\n\nconst float fExposure = 2.0;\n\nvec3 computeEllipsoidPosition()\n{\n    float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\n    vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\n    xy *= czm_viewport.zw * mpp * 0.5;\n\n    vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\n    czm_ray ray = czm_ray(vec3(0.0), direction);\n\n    vec3 ellipsoid_center = czm_view[3].xyz;\n\n    czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\n\n    vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\n    return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\n}\n\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\n    if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\n        v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n        {\n            discard;\n        }\n#endif\n\n#ifdef ENABLE_CLIPPING_PLANES\n    float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\n\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\n    vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));   // normalized surface normal in model coordinates\n    vec3 normalEC = czm_normal3D * normalMC;                                         // normalized surface normal in eye coordiantes\n#endif\n\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\n    float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\n#else\n    float nightBlend = 0.0;\n#endif\n\n    // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0\n    // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the\n    // fragments on the edges of tiles even though the vertex shader is outputting\n    // coordinates strictly in the 0-1 range.\n    vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\n\n#ifdef SHOW_TILE_BOUNDARIES\n    if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\n        v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n    {\n        color = vec4(1.0, 0.0, 0.0, 1.0);\n    }\n#endif\n\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\n    float cameraDist;\n    if (czm_sceneMode == czm_sceneMode2D)\n    {\n        cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n    }\n    else if (czm_sceneMode == czm_sceneModeColumbusView)\n    {\n        cameraDist = -czm_view[3].z;\n    }\n    else\n    {\n        cameraDist = length(czm_view[3]);\n    }\n    float fadeOutDist = u_lightingFadeDistance.x;\n    float fadeInDist = u_lightingFadeDistance.y;\n    if (czm_sceneMode != czm_sceneMode3D) {\n        vec3 radii = czm_ellipsoidRadii;\n        float maxRadii = max(radii.x, max(radii.y, radii.z));\n        fadeOutDist -= maxRadii;\n        fadeInDist -= maxRadii;\n    }\n    float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\n    float fade = 0.0;\n#endif\n\n#ifdef SHOW_REFLECTIVE_OCEAN\n    vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\n    vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\n    vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\n    waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\n\n    float mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\n\n    if (mask > 0.0)\n    {\n        mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\n\n        vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\n        vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\n\n        vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\n\n        color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\n    }\n#endif\n\n#ifdef APPLY_MATERIAL\n    czm_materialInput materialInput;\n    materialInput.st = v_textureCoordinates.st;\n    materialInput.normalEC = normalize(v_normalEC);\n    materialInput.positionToEyeEC = -v_positionEC;\n    materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));     \n    materialInput.slope = v_slope;\n    materialInput.height = v_height;\n    materialInput.aspect = v_aspect;\n    czm_material material = czm_getMaterial(materialInput);\n    vec4 materialColor = vec4(material.diffuse, material.alpha);\n    color = alphaBlend(materialColor, color);\n#endif\n\n#ifdef ENABLE_VERTEX_LIGHTING\n    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + 0.3, 0.0, 1.0);\n    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\n    float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\n    diffuseIntensity = mix(1.0, diffuseIntensity, fade);\n    vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#else\n    vec4 finalColor = color;\n#endif\n\n#ifdef ENABLE_CLIPPING_PLANES\n    vec4 clippingPlanesEdgeColor = vec4(1.0);\n    clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\n    float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\n\n    if (clipDistance < clippingPlanesEdgeWidth)\n    {\n        finalColor = clippingPlanesEdgeColor;\n    }\n#endif\n\n#ifdef HIGHLIGHT_FILL_TILE\n    finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\n    vec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\n    vec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n\n#if defined(GROUND_ATMOSPHERE) || defined(FOG)\n    if (!czm_backFacing())\n    {\n        bool dynamicLighting = false;\n        #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\n            dynamicLighting = true;     \n        #endif\n\n        vec3 rayleighColor;\n        vec3 mieColor;\n        float opacity;\n\n        vec3 positionWC;\n        vec3 lightDirection;\n\n        // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.\n        // Otherwise, the scattering is computed in the vertex shader.\n        #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE\n            positionWC = computeEllipsoidPosition();\n            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\n            computeAtmosphereScattering(\n                positionWC,\n                lightDirection,\n                rayleighColor,\n                mieColor,\n                opacity\n            );\n        #else\n            positionWC = v_positionMC;\n            lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));\n            rayleighColor = v_atmosphereRayleighColor;\n            mieColor = v_atmosphereMieColor;\n            opacity = v_atmosphereOpacity;\n        #endif\n\n        rayleighColor = colorCorrect(rayleighColor);\n        mieColor = colorCorrect(mieColor);\n\n        vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);\n\n        // Fog is applied to tiles selected for fog, close to the Earth.\n        #ifdef FOG\n            vec3 fogColor = groundAtmosphereColor.rgb;\n            \n            // If there is lighting, apply that to the fog.\n            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\n                float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\n                fogColor *= darken;                \n            #endif\n\n            #ifndef HDR\n                fogColor.rgb = czm_acesTonemapping(fogColor.rgb);\n                fogColor.rgb = czm_inverseGamma(fogColor.rgb);\n            #endif\n            \n            const float modifier = 0.15;\n            finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a);\n\n        #else\n            // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.\n            // This value is larger near the \"circumference\", as it is further away from the camera. We use it to\n            // brighten up that area of the ground atmosphere.\n            const float transmittanceModifier = 0.5;\n            float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);\n\n            vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;\n\n            #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\n                float fadeInDist = u_nightFadeDistance.x;\n                float fadeOutDist = u_nightFadeDistance.y;\n            \n                float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);\n                float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);\n                vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);\n\n                finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);\n            #endif\n            \n            #ifndef HDR\n                finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);\n            #else\n                finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);\n            #endif\n            \n            finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);\n        #endif\n    }\n#endif\n\n#ifdef UNDERGROUND_COLOR\n    if (czm_backFacing())\n    {\n        float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\n        float distance = max(v_distance - distanceFromEllipsoid, 0.0);\n        float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\n        vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\n        finalColor = alphaBlend(undergroundColor, finalColor);\n    }\n#endif\n\n#ifdef TRANSLUCENT\n    if (inTranslucencyRectangle())\n    {\n      vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\n      finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n    }\n#endif\n    \n    gl_FragColor =  finalColor;\n}\n\n\n#ifdef SHOW_REFLECTIVE_OCEAN\n\nfloat waveFade(float edge0, float edge1, float x)\n{\n    float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n    return pow(1.0 - y, 5.0);\n}\n\nfloat linearFade(float edge0, float edge1, float x)\n{\n    return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\n\n// Based on water rendering by Jonas Wagner:\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\n\n// low altitude wave settings\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\n\n// high altitude wave settings\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\n\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\n{\n    vec3 positionToEyeEC = -positionEyeCoordinates;\n    float positionToEyeECLength = length(positionToEyeEC);\n\n    // The double normalize below works around a bug in Firefox on Android devices.\n    vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\n\n    // Fade out the waves as the camera moves far from the surface.\n    float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n\n#ifdef SHOW_OCEAN_WAVES\n    // high altitude waves\n    float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\n    vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\n    vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\n\n    // low altitude waves\n    time = czm_frameNumber * oceanAnimationSpeedLowAltitude;\n    noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\n    vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\n\n    // blend the 2 wave layers based on distance to surface\n    float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\n    float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\n    vec3 normalTangentSpace =\n        (highAltitudeFade * normalTangentSpaceHighAltitude) +\n        (lowAltitudeFade * normalTangentSpaceLowAltitude);\n    normalTangentSpace = normalize(normalTangentSpace);\n\n    // fade out the normal perturbation as we move farther from the water surface\n    normalTangentSpace.xy *= waveIntensity;\n    normalTangentSpace = normalize(normalTangentSpace);\n#else\n    vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\n\n    vec3 normalEC = enuToEye * normalTangentSpace;\n\n    const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\n\n    // Use diffuse light to highlight the waves\n    float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\n    vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\n\n#ifdef SHOW_OCEAN_WAVES\n    // Where diffuse light is low or non-existent, use wave highlights based solely on\n    // the wave bumpiness and no particular light direction.\n    float tsPerturbationRatio = normalTangentSpace.z;\n    vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\n    vec3 nonDiffuseHighlight = vec3(0.0);\n#endif\n\n    // Add specular highlights in 3D, and in all modes when zoomed in.\n    float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\n    float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\n    float specular = specularIntensity * surfaceReflectance;\n\n#ifdef HDR\n    specular *= 1.4;\n\n    float e = 0.2;\n    float d = 3.3;\n    float c = 1.7;\n\n    vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\n    vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\n\n    return vec4(color, imageryColor.a);\n}\n\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n",Wxe="#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\n\n#ifdef GEODETIC_SURFACE_NORMALS\nattribute vec3 geodeticSurfaceNormal;\n#endif\n\n#ifdef EXAGGERATION\nuniform vec2 u_terrainExaggerationAndRelativeHeight;\n#endif\n\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\n\n// Uniforms for 2D Mercator projection\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\n\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\n\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n\n#ifdef APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_aspect;\nvarying float v_height;\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_atmosphereRayleighColor;\nvarying vec3 v_atmosphereMieColor;\nvarying float v_atmosphereOpacity;\n#endif\n\n// These functions are generated at runtime.\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\n\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\n    return u_modifiedModelViewProjection * vec4(position, 1.0);\n}\n\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\n    // The width of a tile at level 11, in radians and assuming a single root tile, is\n    //   2.0 * czm_pi / pow(2.0, 11.0)\n    // We want to just linearly interpolate the 2D position from the texture coordinates\n    // when we're at this level or higher.  The constant below is the expression\n    // above evaluated and then rounded up at the 4th significant digit.\n    const float maxTileWidth = 0.003068;\n    float positionFraction = textureCoordinates.y;\n    float southLatitude = u_southAndNorthLatitude.x;\n    float northLatitude = u_southAndNorthLatitude.y;\n    if (northLatitude - southLatitude > maxTileWidth)\n    {\n        float southMercatorY = u_southMercatorYAndOneOverHeight.x;\n        float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\n\n        float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\n        currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\n        positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n    }\n    return positionFraction;\n}\n\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\n    return textureCoordinates.y;\n}\n\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\n    float yPositionFraction = get2DYPositionFraction(textureCoordinates);\n    vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\n    return u_modifiedModelViewProjection * rtcPosition2D;\n}\n\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\n    return getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\n\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\n    return getPositionPlanarEarth(position, height, textureCoordinates);\n}\n\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\n    // We do not do RTC while morphing, so there is potential for jitter.\n    // This is unlikely to be noticeable, though.\n    vec3 position3DWC = position + u_center3D;\n    float yPositionFraction = get2DYPositionFraction(textureCoordinates);\n    vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\n    vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\n    return czm_modelViewProjection * morphPosition;\n}\n\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\n\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\n    vec2 xy = czm_decompressTextureCoordinates(compressed0.x);\n    vec2 zh = czm_decompressTextureCoordinates(compressed0.y);\n    vec3 position = vec3(xy, zh.x);\n    float height = zh.y;\n    vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\n\n    height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\n    position = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\n    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\n    float encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\n    float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\n    float encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\n    float webMercatorT = textureCoordinates.y;\n    float encodedNormal = compressed0.w;\n#else\n    float webMercatorT = textureCoordinates.y;\n    float encodedNormal = 0.0;\n#endif\n\n#else\n    // A single float per element\n    vec3 position = position3DAndHeight.xyz;\n    float height = position3DAndHeight.w;\n    vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\n    float webMercatorT = textureCoordAndEncodedNormals.z;\n    float encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\n    float webMercatorT = textureCoordinates.y;\n    float encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\n    float webMercatorT = textureCoordAndEncodedNormals.z;\n    float encodedNormal = 0.0;\n#else\n    float webMercatorT = textureCoordinates.y;\n    float encodedNormal = 0.0;\n#endif\n\n#endif\n\n    vec3 position3DWC = position + u_center3D;\n\n#ifdef GEODETIC_SURFACE_NORMALS\n    vec3 ellipsoidNormal = geodeticSurfaceNormal;\n#else\n    vec3 ellipsoidNormal = normalize(position3DWC);\n#endif\n\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\n    float exaggeration = u_terrainExaggerationAndRelativeHeight.x;\n    float relativeHeight = u_terrainExaggerationAndRelativeHeight.y;\n    float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;\n\n    // stop from going through center of earth\n    float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);\n    newHeight = max(newHeight, -minRadius);\n\n    vec3 offset = ellipsoidNormal * (newHeight - height);\n    position += offset;\n    position3DWC += offset;\n    height = newHeight;\n#endif\n\n    gl_Position = getPosition(position, height, textureCoordinates);\n\n    v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\n    v_positionMC = position3DWC;  // position in model coordinates\n\n    v_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\n    vec3 normalMC = czm_octDecode(encodedNormal);\n\n#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)\n    vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;\n    vec3 rejection = normalMC - projection;\n    normalMC = normalize(projection + rejection * exaggeration);\n#endif\n\n    v_normalMC = normalMC;\n    v_normalEC = czm_normal3D * v_normalMC;\n#endif\n\n#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))\n\n    bool dynamicLighting = false;\n\n    #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\n        dynamicLighting = true;\n    #endif\n\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\n    vec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\n    vec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n\n    vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));\n\n    computeAtmosphereScattering(\n        position3DWC,\n        lightDirection,\n        v_atmosphereRayleighColor,\n        v_atmosphereMieColor,\n        v_atmosphereOpacity\n    );\n#endif\n\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\n    v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n\n#ifdef APPLY_MATERIAL\n    float northPoleZ = czm_ellipsoidRadii.z;\n    vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\n    vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\n    float dotProd = abs(dot(ellipsoidNormal, v_normalMC));\n    v_slope = acos(dotProd);\n    vec3 normalRejected = ellipsoidNormal * dotProd;\n    vec3 normalProjected = v_normalMC - normalRejected;\n    vec3 aspectVector = normalize(normalProjected);\n    v_aspect = acos(dot(aspectVector, vectorEastMC));\n    float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\n    v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\n    v_height = height;\n#endif\n}\n",Yxe="uniform vec3 u_radiiAndDynamicAtmosphereColor;\n\nuniform float u_atmosphereLightIntensity;\nuniform float u_atmosphereRayleighScaleHeight;\nuniform float u_atmosphereMieScaleHeight;\nuniform float u_atmosphereMieAnisotropy;\nuniform vec3 u_atmosphereRayleighCoefficient;\nuniform vec3 u_atmosphereMieCoefficient;\n\nconst float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.\nconst int PRIMARY_STEPS = 16; // Number of times the ray from the camera to the world position (primary ray) is sampled.\nconst int LIGHT_STEPS = 4; // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.\n\n/**\n * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as\n * the transmittance value for the ray.\n *\n * @param {czm_ray} primaryRay The ray from the camera to the position.\n * @param {float} primaryRayLength The length of the primary ray.\n * @param {vec3} lightDirection The direction of the light to calculate the scattering from.\n * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.\n * @param {vec3} mieColor The variable the Mie scattering will be written to.\n * @param {float} opacity The variable the transmittance will be written to.\n * @glslFunction\n */\nvoid computeScattering(\n    czm_ray primaryRay,\n    float primaryRayLength,\n    vec3 lightDirection,\n    float atmosphereInnerRadius,\n    out vec3 rayleighColor,\n    out vec3 mieColor,\n    out float opacity\n) {\n\n    // Initialize the default scattering amounts to 0.\n    rayleighColor = vec3(0.0);\n    mieColor = vec3(0.0);\n    opacity = 0.0;\n\n    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\n\n    vec3 origin = vec3(0.0);\n\n    // Calculate intersection from the camera to the outer ring of the atmosphere.\n    czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);\n\n    // Return empty colors if no intersection with the atmosphere geometry.\n    if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {\n        return;\n    }\n\n    // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.\n    primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);\n    // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.\n    primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));\n\n    // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.\n    float rayStepLength = (primaryRayAtmosphereIntersect.stop - primaryRayAtmosphereIntersect.start) / float(PRIMARY_STEPS);\n    float rayPositionLength = primaryRayAtmosphereIntersect.start;\n\n    vec3 rayleighAccumulation = vec3(0.0);\n    vec3 mieAccumulation = vec3(0.0);\n    vec2 opticalDepth = vec2(0.0);\n    vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);\n\n    // Sample positions on the primary ray.\n    for (int i = 0; i < PRIMARY_STEPS; i++) {\n        // Calculate sample position along viewpoint ray.\n        vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);\n        \n        // Calculate height of sample position above ellipsoid.\n        float sampleHeight = length(samplePosition) - atmosphereInnerRadius;\n\n        // Calculate and accumulate density of particles at the sample position.\n        vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;\n        opticalDepth += sampleDensity;\n\n        // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.\n        czm_ray lightRay = czm_ray(samplePosition, lightDirection);\n        czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);\n        \n        float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);\n        float lightPositionLength = 0.0;\n\n        vec2 lightOpticalDepth = vec2(0.0);\n\n        // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.\n        for (int j = 0; j < LIGHT_STEPS; j++) {\n\n            // Calculate sample position along light ray.\n            vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);\n\n            // Calculate height of the light sample position above ellipsoid.\n            float lightHeight = length(lightPosition) - atmosphereInnerRadius;\n\n            // Calculate density of photons at the light sample position.\n            lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;\n\n            // Increment distance on light ray.\n            lightPositionLength += lightStepLength;\n        }\n\n        // Compute attenuation via the primary ray and the light ray.\n        vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));\n\n        // Accumulate the scattering.\n        rayleighAccumulation += sampleDensity.x * attenuation;\n        mieAccumulation += sampleDensity.y * attenuation;\n\n        // Increment distance on primary ray.\n        rayPositionLength += rayStepLength;\n    }\n\n    // Compute the scattering amount.\n    rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;\n    mieColor = u_atmosphereMieCoefficient * mieAccumulation;\n\n    // Compute the transmittance i.e. how much light is passing through the atmosphere.\n    opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));\n}\n\nvec4 computeAtmosphereColor(\n    vec3 positionWC,\n    vec3 lightDirection,\n    vec3 rayleighColor,\n    vec3 mieColor,\n    float opacity\n) {\n    // Setup the primary ray: from the camera position to the vertex position.\n    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n\n    float cosAngle = dot(cameraToPositionWCDirection, lightDirection);\n    float cosAngleSq = cosAngle * cosAngle;\n\n    float G = u_atmosphereMieAnisotropy;\n    float GSq = G * G;\n\n    // The Rayleigh phase function.\n    float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);\n    // The Mie phase function.\n    float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));\n\n    // The final color is generated by combining the effects of the Rayleigh and Mie scattering.\n    vec3 rayleigh = rayleighPhase * rayleighColor;\n    vec3 mie = miePhase * mieColor;\n\n    vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;\n\n    return vec4(color, opacity);\n}\n",Xxe="void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {\n\n    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\n    \n    float atmosphereInnerRadius = length(positionWC);\n\n    computeScattering(\n        primaryRay,\n        length(cameraToPositionWC),\n        lightDirection,\n        atmosphereInnerRadius,\n        rayleighColor,\n        mieColor,\n        opacity\n    );\n}\n";function Kxe(e,t,n,i,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=r}function Jxe(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}Jxe.prototype.getShaderProgram=function(e){const t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,r=e.applyBrightness,o=e.applyContrast,a=e.applyHue,s=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,h=e.applyDayNightAlpha,d=e.applySplit,f=e.showReflectiveOcean,p=e.showOceanWaves,m=e.enableLighting,g=e.dynamicAtmosphereLighting,_=e.dynamicAtmosphereLightingFromSun,y=e.showGroundAtmosphere,b=e.perFragmentGroundAtmosphere,v=e.hasVertexNormals,O=e.useWebMercatorProjection,w=e.enableFog,A=e.enableClippingPlanes,E=e.clippingPlanes,T=e.clippedByBoundaries,C=e.hasImageryLayerCutout,x=e.colorCorrect,S=e.highlightFillTile,I=e.colorToAlpha,P=e.hasGeodeticSurfaceNormals,D=e.hasExaggeration,R=e.showUndergroundColor,j=e.translucent;let M=0,L="";const N=n.renderedMesh.encoding;N.quantization===Bs.BITS12&&(M=1,L="QUANTIZATION_BITS12");let B=0,F="";T&&(B=1,F="TILE_LIMIT_RECTANGLE");let z=0,k="";C&&(z=1,k="APPLY_IMAGERY_CUTOUT");const U=t.mode,V=U|r<<2|o<<3|a<<4|s<<5|c<<6|u<<7|f<<8|p<<9|m<<10|g<<11|_<<12|y<<13|b<<14|v<<15|O<<16|w<<17|M<<18|d<<19|A<<20|B<<21|z<<22|x<<23|S<<24|I<<25|P<<26|D<<27|R<<28|j<<29|h<<30;let H=0;Object(l.a)(E)&&E.length>0&&(H=A?E.clippingPlanesState:0);let G=n.surfaceShader;if(Object(l.a)(G)&&G.numberOfDayTextures===i&&G.flags===V&&G.material===this.material&&G.clippingShaderState===H)return G.shaderProgram;let q=this._shadersByTexturesFlags[i];if(Object(l.a)(q)||(q=this._shadersByTexturesFlags[i]=[]),G=q[V],!Object(l.a)(G)||G.material!==this.material||G.clippingShaderState!==H){const e=this.baseVertexShaderSource.clone(),n=this.baseFragmentShaderSource.clone();0!==H&&n.sources.unshift(Xq(E,t.context)),e.defines.push(L),n.defines.push("TEXTURE_UNITS "+i,F,k),r&&n.defines.push("APPLY_BRIGHTNESS"),o&&n.defines.push("APPLY_CONTRAST"),a&&n.defines.push("APPLY_HUE"),s&&n.defines.push("APPLY_SATURATION"),c&&n.defines.push("APPLY_GAMMA"),u&&n.defines.push("APPLY_ALPHA"),h&&n.defines.push("APPLY_DAY_NIGHT_ALPHA"),f&&(n.defines.push("SHOW_REFLECTIVE_OCEAN"),e.defines.push("SHOW_REFLECTIVE_OCEAN")),p&&n.defines.push("SHOW_OCEAN_WAVES"),I&&n.defines.push("APPLY_COLOR_TO_ALPHA"),R&&(e.defines.push("UNDERGROUND_COLOR"),n.defines.push("UNDERGROUND_COLOR")),j&&(e.defines.push("TRANSLUCENT"),n.defines.push("TRANSLUCENT")),m&&(v?(e.defines.push("ENABLE_VERTEX_LIGHTING"),n.defines.push("ENABLE_VERTEX_LIGHTING")):(e.defines.push("ENABLE_DAYNIGHT_SHADING"),n.defines.push("ENABLE_DAYNIGHT_SHADING"))),g&&(e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),n.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),_&&(e.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),n.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),y&&(e.defines.push("GROUND_ATMOSPHERE"),n.defines.push("GROUND_ATMOSPHERE"),b&&(e.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),n.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),e.defines.push("INCLUDE_WEB_MERCATOR_Y"),n.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(e.defines.push("FOG"),n.defines.push("FOG")),d&&n.defines.push("APPLY_SPLIT"),A&&n.defines.push("ENABLE_CLIPPING_PLANES"),x&&n.defines.push("COLOR_CORRECT"),S&&n.defines.push("HIGHLIGHT_FILL_TILE"),P&&e.defines.push("GEODETIC_SURFACE_NORMALS"),D&&e.defines.push("EXAGGERATION");let l="    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\n    {\n        vec4 color = initialColor;\n";C&&(l+="        vec4 cutoutAndColorResult;\n        bool texelUnclipped;\n");for(let e=0;e<i;++e)l+=C?`        cutoutAndColorResult = u_dayTextureCutoutRectangles[${e}];\n        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n        cutoutAndColorResult = sampleAndBlend(\n`:"        color = sampleAndBlend(\n",l+=`            color,\n            u_dayTextures[${e}],\n            u_dayTextureUseWebMercatorT[${e}] ? textureCoordinates.xz : textureCoordinates.xy,\n            u_dayTextureTexCoordsRectangle[${e}],\n            u_dayTextureTranslationAndScale[${e}],\n            ${u?`u_dayTextureAlpha[${e}]`:"1.0"},\n            ${h?`u_dayTextureNightAlpha[${e}]`:"1.0"},\n${h?`u_dayTextureDayAlpha[${e}]`:"1.0"},\n${r?`u_dayTextureBrightness[${e}]`:"0.0"},\n            ${o?`u_dayTextureContrast[${e}]`:"0.0"},\n            ${a?`u_dayTextureHue[${e}]`:"0.0"},\n            ${s?`u_dayTextureSaturation[${e}]`:"0.0"},\n            ${c?`u_dayTextureOneOverGamma[${e}]`:"0.0"},\n            ${d?`u_dayTextureSplit[${e}]`:"0.0"},\n            ${I?`u_colorsToAlpha[${e}]`:"vec4(0.0)"},\n        nightBlend        );\n`,C&&(l+="        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");l+="        return color;\n    }",n.sources.push(l),e.sources.push(function(e){let t;switch(e){case AB.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case AB.SCENE2D:case AB.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case AB.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}(U)),e.sources.push(function(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}(O));const T=oM.fromCache({context:t.context,vertexShaderSource:e,fragmentShaderSource:n,attributeLocations:N.getAttributeLocations()});G=q[V]=new Kxe(i,V,this.material,T,H)}return n.surfaceShader=G,G.shaderProgram},Jxe.prototype.destroy=function(){let e,t;const n=this._shadersByTexturesFlags;for(const i in n)if(n.hasOwnProperty(i)){const r=n[i];if(!Object(l.a)(r))continue;for(e in r)r.hasOwnProperty(e)&&(t=r[e],Object(l.a)(t)&&t.shaderProgram.destroy())}return sc(this)};var Zxe=Jxe;var $xe=Object.freeze({UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7});var Qxe=Object.freeze({START:0,LOADING:1,DONE:2,FAILED:3});var eSe=Object.freeze({FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6});function tSe(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new _e(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new O,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=eSe.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new At,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(tSe.prototype,{eligibleForUnloading:{get:function(){const e=this.terrainState;let t=!(e===eSe.RECEIVING||e===eSe.TRANSFORMING);const n=this.imagery;for(let e=0,i=n.length;t&&e<i;++e){const i=n[e];t=!Object(l.a)(i.loadingImagery)||i.loadingImagery.state!==$xe.TRANSITIONING}return t}},renderedMesh:{get:function(){return Object(l.a)(this.vertexArray)?this.mesh:Object(l.a)(this.fill)?this.fill.mesh:void 0}}});const nSe=new R;function iSe(e,t,n,i,r,o){let a=e.getExaggeratedPosition(i,r,o);if(Object(l.a)(t)&&t!==AB.SCENE3D){const e=n.ellipsoid.cartesianToCartographic(a,nSe);a=n.project(e,o),a=O.fromElements(a.z,a.x,a.y,o)}return a}const rSe=new O,oSe=new O,aSe=new O;function sSe(e,t,n,i){const r=e.renderedMesh,o=r.vertices,a=r.encoding,s=o.length/a.stride;let c=Ks.clone(a);c.hasGeodeticSurfaceNormals=t,c=Ks.clone(c);const l=c.stride,u=new Float32Array(s*l);t?a.addGeodeticSurfaceNormals(o,u,n):a.removeGeodeticSurfaceNormals(o,u),r.vertices=u,r.stride=l;r!==e.mesh?(tSe._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=tSe._createVertexArrayForMesh(i.context,r)):(tSe._freeVertexArray(e.vertexArray),e.vertexArray=tSe._createVertexArrayForMesh(i.context,r)),tSe._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}tSe.prototype.pick=function(e,t,n,i,r){const o=this.renderedMesh;if(!Object(l.a)(o))return;const a=o.vertices,s=o.indices,c=o.encoding,u=s.length;let h=Number.MAX_VALUE;for(let r=0;r<u;r+=3){const o=s[r],u=s[r+1],d=s[r+2],f=iSe(c,t,n,a,o,rSe),p=iSe(c,t,n,a,u,oSe),m=iSe(c,t,n,a,d,aSe),g=vi.rayTriangleParametric(e,f,p,m,i);Object(l.a)(g)&&g<h&&g>=0&&(h=g)}return h!==Number.MAX_VALUE?Gn.getPoint(e,h,r):void 0},tSe.prototype.freeResources=function(){Object(l.a)(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=eSe.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();const e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},tSe.prototype.freeVertexArray=function(){tSe._freeVertexArray(this.vertexArray),this.vertexArray=void 0,tSe._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},tSe.initialize=function(e,t,n){let i=e.data;Object(l.a)(i)||(i=e.data=new tSe),e.state===Qxe.START&&(!function(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!Object(l.a)(i)&&Object(l.a)(e.parent)){const t=e.parent,n=t.data;Object(l.a)(n)&&Object(l.a)(n.terrainData)&&(i=n.terrainData.isChildAvailable(t.x,t.y,e.x,e.y))}!1===i&&(e.data.terrainState=eSe.FAILED);for(let i=0,r=n.length;i<r;++i){const r=n.get(i);r.show&&r._createTileImagerySkeletons(e,t)}}(e,t,n),e.state=Qxe.LOADING)},tSe.processStateMachine=function(e,t,n,i,r,o,a){tSe.initialize(e,n,i);const s=e.data;if(e.state===Qxe.LOADING&&function(e,t,n,i,r,o){const a=e.data,s=e.parent;if(a.terrainState===eSe.FAILED&&void 0!==s){void 0!==s.data&&void 0!==s.data.terrainData&&!1!==s.data.terrainData.canUpsample||tSe.processStateMachine(s,t,n,i,r,o,!0)}a.terrainState===eSe.FAILED&&function(e,t,n,i,r,o,a){const s=t.parent;if(!s)return void(t.state=Qxe.FAILED);const c=s.data.terrainData,u=s.x,h=s.y,d=s.level;if(!Object(l.a)(c))return;const f=c.upsample(i.tilingScheme,u,h,d,r,o,a);if(!Object(l.a)(f))return;e.terrainState=eSe.RECEIVING,Promise.resolve(f).then((function(t){e.terrainData=t,e.terrainState=eSe.RECEIVED})).catch((function(){e.terrainState=eSe.FAILED}))}(a,e,0,n,e.x,e.y,e.level);a.terrainState===eSe.UNLOADED&&function(e,t,n,i,r){function o(){const a=new zc.a({throttle:!1,throttleByServer:!0,type:Uc.a.TERRAIN});e.request=a;const s=t.requestTileGeometry(n,i,r,a);Object(l.a)(s)?(e.terrainState=eSe.RECEIVING,Promise.resolve(s).then((function(t){!function(t){e.terrainData=t,e.terrainState=eSe.RECEIVED,e.request=void 0}(t)})).catch((function(a){!function(a){if(e.request.state===kc.a.CANCELLED)return e.terrainData=void 0,e.terrainState=eSe.UNLOADED,void(e.request=void 0);e.terrainState=eSe.FAILED,e.request=void 0;const s=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${a}"`;t._requestError=dl.reportError(t._requestError,t,t.errorEvent,s,n,i,r),t._requestError.retry&&o()}(a)}))):(e.terrainState=eSe.UNLOADED,e.request=void 0)}o()}(a,n,e.x,e.y,e.level);a.terrainState===eSe.RECEIVED&&function(e,t,n,i,r,o){const a=n.tilingScheme,s=cSe;s.tilingScheme=a,s.x=i,s.y=r,s.level=o,s.exaggeration=t.terrainExaggeration,s.exaggerationRelativeHeight=t.terrainExaggerationRelativeHeight,s.throttle=!0;const c=e.terrainData.createMesh(s);if(!Object(l.a)(c))return;e.terrainState=eSe.TRANSFORMING,Promise.resolve(c).then((function(t){e.mesh=t,e.terrainState=eSe.TRANSFORMED})).catch((function(){e.terrainState=eSe.FAILED}))}(a,t,n,e.x,e.y,e.level);a.terrainState===eSe.TRANSFORMED&&(!function(e,t,n,i,r,o,a){e.vertexArray=tSe._createVertexArrayForMesh(t,e.mesh),e.terrainState=eSe.READY,e.fill=e.fill&&e.fill.destroy(a)}(a,t.context,0,e.x,e.y,e.level,o),a.updateExaggeration(e,t,r));if(a.terrainState>=eSe.RECEIVED&&void 0===a.waterMaskTexture&&n.hasWaterMask){if(void 0!==a.terrainData.waterMask)!function(e,t){const n=t.terrainData.waterMask,i=function(e){let t=e.cache.tile_waterMaskData;if(!Object(l.a)(t)){const n=JD.create({context:e,pixelFormat:aT.LUMINANCE,pixelDatatype:rT.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;const i=new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.LINEAR,magnificationFilter:kD.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}(e);let r;const o=n.length;if(1===o){if(0===n[0])return;r=i.allWaterTexture}else{const t=Math.sqrt(o);r=JD.create({context:e,pixelFormat:aT.LUMINANCE,pixelDatatype:rT.UNSIGNED_BYTE,source:{width:t,height:t,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,_e.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}(t.context,a);else{const t=a._findAncestorTileWithTerrainData(e);Object(l.a)(t)&&Object(l.a)(t.data.waterMaskTexture)&&(a.waterMaskTexture=t.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,t,a.waterMaskTranslationAndScale))}}}(e,t,n,i,r,o),a)return;const c=e.renderable;e.renderable=Object(l.a)(s.vertexArray);const u=s.terrainState===eSe.READY;e.upsampledFromParent=Object(l.a)(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();const h=s.processImagery(e,n,t);if(u&&h){const t=e._loadedCallbacks,n={};for(const i in t)t.hasOwnProperty(i)&&(t[i](e)||(n[i]=t[i]));e._loadedCallbacks=n,e.state=Qxe.DONE}c&&(e.renderable=!0)},tSe.prototype.processImagery=function(e,t,n,i){const r=e.data;let o=e.upsampledFromParent,a=!1,s=!0;const c=r.imagery;let u,h;for(u=0,h=c.length;u<h;++u){const r=c[u];if(!Object(l.a)(r.loadingImagery)){o=!1;continue}if(r.loadingImagery.state===$xe.PLACEHOLDER){const n=r.loadingImagery.imageryLayer;if(n.imageryProvider.ready){r.freeResources(),c.splice(u,1),n._createTileImagerySkeletons(e,t,u),--u,h=c.length;continue}o=!1}const d=r.processStateMachine(e,n,i);s=s&&d,a=a||d||Object(l.a)(r.readyImagery),o=o&&Object(l.a)(r.loadingImagery)&&(r.loadingImagery.state===$xe.FAILED||r.loadingImagery.state===$xe.INVALID)}return e.upsampledFromParent=o,e.renderable=e.renderable&&(a||s),s},tSe.prototype.addGeodeticSurfaceNormals=function(e,t){sSe(this,!0,e,t)},tSe.prototype.removeGeodeticSurfaceNormals=function(e){sSe(this,!1,void 0,e)},tSe.prototype.updateExaggeration=function(e,t,n){const i=this,r=i.renderedMesh;if(void 0===r)return;const o=t.terrainExaggeration,a=t.terrainExaggerationRelativeHeight,s=1!==o,c=r.encoding,l=c.exaggeration!==o,u=c.exaggerationRelativeHeight!==a;if(l||u){if(l)if(s&&!c.hasGeodeticSurfaceNormals){const n=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(n,t)}else!s&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=o,c.exaggerationRelativeHeight=a,void 0!==n){n._tileToUpdateHeights.push(e);const t=e.customData,i=t.length;for(let e=0;e<i;e++){t[e].level=-1}}}};const cSe={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};tSe._createVertexArrayForMesh=function(e,t){const n=t.vertices,i=ZN.createVertexBuffer({context:e,typedArray:n,usage:KN.STATIC_DRAW}),r=t.encoding.getAttributes(i),o=t.indices.indexBuffers||{};let a=o[e.id];if(!Object(l.a)(a)||a.isDestroyed()){const n=t.indices;a=ZN.createIndexBuffer({context:e,typedArray:n,usage:KN.STATIC_DRAW,indexDatatype:wc.fromSizeInBytes(n.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,o[e.id]=a,t.indices.indexBuffers=o}else++a.referenceCount;return new iB({context:e,attributes:r,indexBuffer:a})},tSe._freeVertexArray=function(e){if(Object(l.a)(e)){const t=e.indexBuffer;e.isDestroyed()||e.destroy(),Object(l.a)(t)&&!t.isDestroyed()&&Object(l.a)(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}},tSe.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;Object(l.a)(t)&&(!Object(l.a)(t.data)||!Object(l.a)(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},tSe.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){const i=t.rectangle,r=e.rectangle,o=r.width,a=r.height,s=o/i.width,c=a/i.height;return n.x=s*(r.west-i.west)/o,n.y=c*(r.south-i.south)/a,n.z=s,n.w=c,n};var lSe=tSe,uSe="uniform sampler2D u_texture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    gl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",hSe="attribute vec4 position;\nattribute float webMercatorT;\n\nuniform vec2 u_textureDimensions;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    v_textureCoordinates = vec2(position.x, webMercatorT);\n    gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n";function dSe(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,0!==i){const r=t/2|0,o=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,o,a)}if(this.state=$xe.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!Object(l.a)(r)&&e.imageryProvider.ready){r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)}this.rectangle=r}dSe.createPlaceholder=function(e){const t=new dSe(e,0,0,0);return t.addReference(),t.state=$xe.PLACEHOLDER,t},dSe.prototype.addReference=function(){++this.referenceCount},dSe.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),Object(l.a)(this.parent)&&this.parent.releaseReference(),Object(l.a)(this.image)&&Object(l.a)(this.image.destroy)&&this.image.destroy(),Object(l.a)(this.texture)&&this.texture.destroy(),Object(l.a)(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),sc(this),0):this.referenceCount},dSe.prototype.processStateMachine=function(e,t,n){this.state!==$xe.UNLOADED||n||(this.state=$xe.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===$xe.RECEIVED&&(this.state=$xe.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));const i=this.state===$xe.READY&&t&&!this.texture;(this.state===$xe.TEXTURE_LOADED||i)&&(this.state=$xe.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var fSe=dSe;function pSe(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}pSe.prototype.freeResources=function(){Object(l.a)(this.readyImagery)&&this.readyImagery.releaseReference(),Object(l.a)(this.loadingImagery)&&this.loadingImagery.releaseReference()},pSe.prototype.processStateMachine=function(e,t,n){const i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===$xe.READY)return Object(l.a)(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o,a=i.parent;for(;Object(l.a)(a)&&(a.state!==$xe.READY||!this.useWebMercatorT&&!Object(l.a)(a.texture));)a.state!==$xe.FAILED&&a.state!==$xe.INVALID&&(o=o||a),a=a.parent;return this.readyImagery!==a&&(Object(l.a)(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=a,Object(l.a)(a)&&(a.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),(i.state===$xe.FAILED||i.state===$xe.INVALID)&&(!Object(l.a)(o)||(o.processStateMachine(t,!this.useWebMercatorT,n),!1))};var mSe=pSe;function gSe(e,t){this._imageryProvider=e,t=Object(c.a)(t,c.a.EMPTY_OBJECT),this.alpha=Object(c.a)(t.alpha,Object(c.a)(e.defaultAlpha,1)),this.nightAlpha=Object(c.a)(t.nightAlpha,Object(c.a)(e.defaultNightAlpha,1)),this.dayAlpha=Object(c.a)(t.dayAlpha,Object(c.a)(e.defaultDayAlpha,1)),this.brightness=Object(c.a)(t.brightness,Object(c.a)(e.defaultBrightness,gSe.DEFAULT_BRIGHTNESS)),this.contrast=Object(c.a)(t.contrast,Object(c.a)(e.defaultContrast,gSe.DEFAULT_CONTRAST)),this.hue=Object(c.a)(t.hue,Object(c.a)(e.defaultHue,gSe.DEFAULT_HUE)),this.saturation=Object(c.a)(t.saturation,Object(c.a)(e.defaultSaturation,gSe.DEFAULT_SATURATION)),this.gamma=Object(c.a)(t.gamma,Object(c.a)(e.defaultGamma,gSe.DEFAULT_GAMMA)),this.splitDirection=Object(c.a)(t.splitDirection,Object(c.a)(e.defaultSplit,gSe.DEFAULT_SPLIT)),this.minificationFilter=Object(c.a)(t.minificationFilter,Object(c.a)(e.defaultMinificationFilter,gSe.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=Object(c.a)(t.magnificationFilter,Object(c.a)(e.defaultMagnificationFilter,gSe.DEFAULT_MAGNIFICATION_FILTER)),this.show=Object(c.a)(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=Object(c.a)(t.rectangle,Be.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new mSe(fSe.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=Object(c.a)(t.colorToAlphaThreshold,gSe.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(gSe.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),gSe.DEFAULT_BRIGHTNESS=1,gSe.DEFAULT_CONTRAST=1,gSe.DEFAULT_HUE=0,gSe.DEFAULT_SATURATION=1,gSe.DEFAULT_GAMMA=1,gSe.DEFAULT_SPLIT=IW.NONE,gSe.DEFAULT_MINIFICATION_FILTER=VD.LINEAR,gSe.DEFAULT_MAGNIFICATION_FILTER=kD.LINEAR,gSe.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,gSe.prototype.isBaseLayer=function(){return this._isBaseLayer},gSe.prototype.isDestroyed=function(){return!1},gSe.prototype.destroy=function(){return sc(this)};const _Se=new Be,ySe=new Be,bSe=new Be,vSe=new Be;function OSe(e,t,n){return`${e}:${t}:${n}`}function wSe(e,t,n){return JSON.stringify([e,t,n])}gSe.prototype.getViewableRectangle=function(){const e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then((function(){return Be.intersection(e.rectangle,t)}))},gSe.prototype._createTileImagerySkeletons=function(e,t,n){const i=e.data;if(Object(l.a)(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(Object(l.a)(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;const r=this._imageryProvider;if(Object(l.a)(n)||(n=i.imagery.length),!r.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;const o=r.tilingScheme.projection instanceof Zs&&e.rectangle.north<Zs.MaximumLatitude&&e.rectangle.south>-Zs.MaximumLatitude,a=Be.intersection(r.rectangle,this._rectangle,_Se);let s=Be.intersection(e.rectangle,a,ySe);if(!Object(l.a)(s)){if(!this.isBaseLayer())return!1;const t=a,n=e.rectangle;s=ySe,n.south>=t.north?s.north=s.south=t.north:n.north<=t.south?s.north=s.south=t.south:(s.south=Math.max(n.south,t.south),s.north=Math.min(n.north,t.north)),n.west>=t.east?s.west=s.east=t.east:n.east<=t.west?s.west=s.east=t.west:(s.west=Math.max(n.west,t.west),s.east=Math.min(n.east,t.east))}let c=0;s.south>0?c=s.south:s.north<0&&(c=s.north);let u=function(e,t,n){const i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof q?1:Math.cos(n),s=r.rectangle,c=o.maximumRadius*s.width*a/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,l=Math.log(c)/Math.log(2);return 0|Math.round(l)}(this,1*t.getLevelMaximumGeometricError(e.level),c);u=Math.max(0,u);const h=r.maximumLevel;if(u>h&&(u=h),Object(l.a)(r.minimumLevel)){const e=r.minimumLevel;u<e&&(u=e)}const d=r.tilingScheme,f=d.positionToTileXY(Be.northwest(s),u),p=d.positionToTileXY(Be.southeast(s),u);let m=e.rectangle.width/512,g=e.rectangle.height/512;const _=d.tileXYToRectangle(f.x,f.y,u);Math.abs(_.south-e.rectangle.north)<g&&f.y<p.y&&++f.y,Math.abs(_.east-e.rectangle.west)<m&&f.x<p.x&&++f.x;const y=d.tileXYToRectangle(p.x,p.y,u);Math.abs(y.north-e.rectangle.south)<g&&p.y>f.y&&--p.y,Math.abs(y.west-e.rectangle.east)<m&&p.x>f.x&&--p.x;const b=Be.clone(e.rectangle,vSe);let v,O,w=d.tileXYToRectangle(f.x,f.y,u),A=Be.intersection(w,a,bSe);o?(d.rectangleToNativeRectangle(b,b),d.rectangleToNativeRectangle(w,w),d.rectangleToNativeRectangle(A,A),d.rectangleToNativeRectangle(a,a),v=d.tileXYToNativeRectangle.bind(d),m=b.width/512,g=b.height/512):v=d.tileXYToRectangle.bind(d);let E,T=0,C=1;!this.isBaseLayer()&&Math.abs(A.west-b.west)>=m&&(T=Math.min(1,(A.west-b.west)/b.width)),!this.isBaseLayer()&&Math.abs(A.north-b.north)>=g&&(C=Math.max(0,(A.north-b.south)/b.height));const x=C;for(let e=f.x;e<=p.x;e++)if(O=T,w=v(e,f.y,u),A=Be.simpleIntersection(w,a,bSe),Object(l.a)(A)){T=Math.min(1,(A.east-b.west)/b.width),e===p.x&&(this.isBaseLayer()||Math.abs(A.east-b.east)<m)&&(T=1),C=x;for(let t=f.y;t<=p.y;t++){if(E=C,w=v(e,t,u),A=Be.simpleIntersection(w,a,bSe),!Object(l.a)(A))continue;C=Math.max(0,(A.south-b.south)/b.height),t===p.y&&(this.isBaseLayer()||Math.abs(A.south-b.south)<g)&&(C=0);const r=new _e(O,C,T,E),s=this.getImageryFromCache(e,t,u);i.imagery.splice(n,0,new mSe(s,r,o)),++n}}return!0},gSe.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){const e=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=e.rectangleToNativeRectangle(n,_Se),i=e.rectangleToNativeRectangle(i,vSe)}const r=i.width,o=i.height,a=r/n.width,s=o/n.height;return new _e(a*(i.west-n.west)/r,s*(i.south-n.south)/o,a,s)},gSe.prototype._requestImagery=function(e){const t=this._imageryProvider,n=this;function i(i){if(e.request.state===kc.a.CANCELLED)return e.state=$xe.UNLOADED,void(e.request=void 0);e.state=$xe.FAILED,e.request=void 0;const o=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=dl.reportError(n._requestImageError,t,t.errorEvent,o,e.x,e.y,e.level,i),n._requestImageError.retry&&r()}function r(){const r=new zc.a({throttle:!1,throttleByServer:!0,type:Uc.a.IMAGERY});e.request=r,e.state=$xe.TRANSITIONING;const o=t.requestImage(e.x,e.y,e.level,r);if(!Object(l.a)(o))return e.state=$xe.UNLOADED,void(e.request=void 0);Object(l.a)(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),o.then((function(t){!function(t){if(!Object(l.a)(t))return i();e.image=t,e.state=$xe.RECEIVED,e.request=void 0,dl.reportSuccess(n._requestImageError)}(t)})).catch((function(e){i(e)}))}r()},gSe.prototype._createTextureWebGL=function(e,t){const n=new WD({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return Object(l.a)(i.internalFormat)?new JD({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new JD({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?aT.RGBA:aT.RGB,sampler:n})},gSe.prototype._createTexture=function(e,t){const n=this._imageryProvider,i=t.image;if(Object(l.a)(n.tileDiscardPolicy)){const e=n.tileDiscardPolicy;if(Object(l.a)(e)){if(!e.isReady())return void(t.state=$xe.RECEIVED);if(e.shouldDiscardImage(i))return void(t.state=$xe.INVALID)}}if(this.minificationFilter!==VD.NEAREST&&this.minificationFilter!==VD.LINEAR)throw new u.a("ImageryLayer minification filter must be NEAREST or LINEAR");const r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Zs?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=$xe.TEXTURE_LOADED},gSe.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter;const i=this.magnificationFilter;if(n===VD.LINEAR&&i===kD.LINEAR&&!aT.isCompressedFormat(t.pixelFormat)&&h.a.isPowerOfTwo(t.width)&&h.a.isPowerOfTwo(t.height)){n=VD.LINEAR_MIPMAP_LINEAR;const r=MD.maximumTextureFilterAnisotropy,o=Math.min(r,Object(c.a)(this._maximumAnisotropy,r)),a=OSe(n,i,o);let s=e.cache.imageryLayerMipmapSamplers;Object(l.a)(s)||(s={},e.cache.imageryLayerMipmapSamplers=s);let u=s[a];Object(l.a)(u)||(u=s[a]=new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:o})),t.generateMipmap(FD.NICEST),t.sampler=u}else{const r=OSe(n,i,0);let o=e.cache.imageryLayerNonMipmapSamplers;Object(l.a)(o)||(o={},e.cache.imageryLayerNonMipmapSamplers=o);let a=o[r];Object(l.a)(a)||(a=o[r]=new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}},gSe.prototype._reprojectTexture=function(e,t,n){const i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if((n=Object(c.a)(n,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof q)&&r.width/i.width>1e-5){const e=this;t.addReference();const n=new vU({persists:!0,owner:this,preExecute:function(e){!function(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!Object(l.a)(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){Object(l.a)(this.framebuffer)&&this.framebuffer.destroy(),Object(l.a)(this.vertexArray)&&this.vertexArray.destroy(),Object(l.a)(this.shaderProgram)&&this.shaderProgram.destroy()}};const e=new Float32Array(256);let n=0;for(let t=0;t<64;++t){const i=t/63;e[n++]=0,e[n++]=i,e[n++]=1,e[n++]=i}const i={position:0,webMercatorT:1},o=Pc.getRegularGridIndices(2,64),a=ZN.createIndexBuffer({context:t,typedArray:o,usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT});r.vertexArray=new iB({context:t,attributes:[{index:i.position,vertexBuffer:ZN.createVertexBuffer({context:t,typedArray:e,usage:KN.STATIC_DRAW}),componentsPerAttribute:2},{index:i.webMercatorT,vertexBuffer:ZN.createVertexBuffer({context:t,sizeInBytes:512,usage:KN.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:a});const s=new UN({sources:[hSe]});r.shaderProgram=oM.fromCache({context:t,vertexShaderSource:s,fragmentShaderSource:uSe,attributeLocations:i}),r.sampler=new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:VD.LINEAR,magnificationFilter:kD.LINEAR})}n.sampler=r.sampler;const o=n.width,a=n.height;ASe.textureDimensions.x=o,ASe.textureDimensions.y=a,ASe.texture=n;let s=Math.sin(i.south);const c=.5*Math.log((1+s)/(1-s));s=Math.sin(i.north);const u=1/(.5*Math.log((1+s)/(1-s))-c),d=new JD({context:t,width:o,height:a,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});h.a.isPowerOfTwo(o)&&h.a.isPowerOfTwo(a)&&d.generateMipmap(FD.NICEST);const f=i.south,p=i.north,m=ESe;let g=0;for(let e=0;e<64;++e){const t=e/63,n=h.a.lerp(f,p,t);s=Math.sin(n);const i=(.5*Math.log((1+s)/(1-s))-c)*u;m[g++]=i,m[g++]=i}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=ASe,e.vertexArray=r.vertexArray}(e,o,i,t.rectangle)},postExecute:function(n){t.texture=n,e._finalizeReprojectTexture(o,n),t.state=$xe.READY,t.releaseReference()},canceled:function(){t.state=$xe.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(n)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=$xe.READY},gSe.prototype.queueReprojectionCommands=function(e){const t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0},gSe.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach((function(e){Object(l.a)(e.canceled)&&e.canceled()})),this._reprojectComputeCommands.length=0},gSe.prototype.getImageryFromCache=function(e,t,n,i){const r=wSe(e,t,n);let o=this._imageryCache[r];return Object(l.a)(o)||(o=new fSe(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o},gSe.prototype.removeImageryFromCache=function(e){const t=wSe(e.x,e.y,e.level);delete this._imageryCache[t]};const ASe={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Vt,texture:void 0},ESe=Jr.supportsTypedArrays()?new Float32Array(128):void 0;var TSe=gSe;const CSe={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=CSe.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};var xSe=CSe;function SSe(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new _e}SSe.prototype.update=function(e,t,n){this.changedThisFrame&&(XSe(e,t,this.tile,n),this.changedThisFrame=!1)},SSe.prototype.destroy=function(e){this._destroyVertexArray(e),Object(l.a)(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)},SSe.prototype._destroyVertexArray=function(e){Object(l.a)(this.vertexArray)&&(Object(l.a)(e)?e.push(this.vertexArray):lSe._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};const ISe=new tm;function PSe(e,t,n,i,r,o,a,s,c){if(void 0===i)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==r||xSe.wasKicked(d._lastSelectionResult)||xSe.originalResult(d._lastSelectionResult)===xSe.CULLED);){if(a)return;const e=d.parent;if(o>=MI.NORTHWEST&&void 0!==e)switch(o){case MI.NORTHWEST:d=d===e.northwestChild?e:void 0;break;case MI.NORTHEAST:d=d===e.northeastChild?e:void 0;break;case MI.SOUTHWEST:d=d===e.southwestChild?e:void 0;break;case MI.SOUTHEAST:d=d===e.southeastChild?e:void 0}else d=e}if(void 0!==d)if(d._lastSelectionResult!==xSe.RENDERED){if(xSe.originalResult(i._lastSelectionResult)!==xSe.CULLED)switch(o){case MI.WEST:PSe(e,t,n,i.northwestChild,r,o,!0,s,c),PSe(e,t,n,i.southwestChild,r,o,!0,s,c);break;case MI.EAST:PSe(e,t,n,i.southeastChild,r,o,!0,s,c),PSe(e,t,n,i.northeastChild,r,o,!0,s,c);break;case MI.SOUTH:PSe(e,t,n,i.southwestChild,r,o,!0,s,c),PSe(e,t,n,i.southeastChild,r,o,!0,s,c);break;case MI.NORTH:PSe(e,t,n,i.northeastChild,r,o,!0,s,c),PSe(e,t,n,i.northwestChild,r,o,!0,s,c);break;case MI.NORTHWEST:PSe(e,t,n,i.northwestChild,r,o,!0,s,c);break;case MI.NORTHEAST:PSe(e,t,n,i.northeastChild,r,o,!0,s,c);break;case MI.SOUTHWEST:PSe(e,t,n,i.southwestChild,r,o,!0,s,c);break;case MI.SOUTHEAST:PSe(e,t,n,i.southeastChild,r,o,!0,s,c);break;default:throw new u.a("Invalid edge")}}else{if(Object(l.a)(d.data.vertexArray))return;!function(e,t,n,i,r,o,a,s){const c=i.data;if(void 0===c.fill)c.fill=new SSe(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,a.enqueue(i));!function(e,t,n,i,r,o){const a=i.data.fill;let s;const c=n.data.fill;Object(l.a)(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(XSe(e,t,n,o),c.changedThisFrame=!1),s=n.data.fill.mesh):s=n.data.mesh;let u,d,f,p,m,g;switch(r){case MI.WEST:u=a.westMeshes,d=a.westTiles;break;case MI.SOUTH:u=a.southMeshes,d=a.southTiles;break;case MI.EAST:u=a.eastMeshes,d=a.eastTiles;break;case MI.NORTH:u=a.northMeshes,d=a.northTiles;break;case MI.NORTHWEST:return a.changedThisFrame=a.changedThisFrame||a.northwestMesh!==s,a.northwestMesh=s,void(a.northwestTile=n);case MI.NORTHEAST:return a.changedThisFrame=a.changedThisFrame||a.northeastMesh!==s,a.northeastMesh=s,void(a.northeastTile=n);case MI.SOUTHWEST:return a.changedThisFrame=a.changedThisFrame||a.southwestMesh!==s,a.southwestMesh=s,void(a.southwestTile=n);case MI.SOUTHEAST:return a.changedThisFrame=a.changedThisFrame||a.southeastMesh!==s,a.southeastMesh=s,void(a.southeastTile=n)}if(n.level<=i.level)return a.changedThisFrame=a.changedThisFrame||u[0]!==s||1!==u.length,u[0]=s,d[0]=n,u.length=1,void(d.length=1);const _=n.rectangle;let y;const b=i.rectangle;switch(r){case MI.WEST:for(y=(b.north-b.south)*h.a.EPSILON5,f=0;f<d.length&&(m=d[f],g=m.rectangle,!h.a.greaterThan(_.north,g.south,y));++f);for(p=f;p<d.length&&(m=d[p],g=m.rectangle,!h.a.greaterThanOrEquals(_.south,g.north,y));++p);break;case MI.SOUTH:for(y=(b.east-b.west)*h.a.EPSILON5,f=0;f<d.length&&(m=d[f],g=m.rectangle,!h.a.lessThan(_.west,g.east,y));++f);for(p=f;p<d.length&&(m=d[p],g=m.rectangle,!h.a.lessThanOrEquals(_.east,g.west,y));++p);break;case MI.EAST:for(y=(b.north-b.south)*h.a.EPSILON5,f=0;f<d.length&&(m=d[f],g=m.rectangle,!h.a.lessThan(_.south,g.north,y));++f);for(p=f;p<d.length&&(m=d[p],g=m.rectangle,!h.a.lessThanOrEquals(_.north,g.south,y));++p);break;case MI.NORTH:for(y=(b.east-b.west)*h.a.EPSILON5,f=0;f<d.length&&(m=d[f],g=m.rectangle,!h.a.greaterThan(_.east,g.west,y));++f);for(p=f;p<d.length&&(m=d[p],g=m.rectangle,!h.a.greaterThanOrEquals(_.west,g.east,y));++p);}p-f==1?(a.changedThisFrame=a.changedThisFrame||u[f]!==s,u[f]=s,d[f]=n):(a.changedThisFrame=!0,u.splice(f,p-f,s),d.splice(f,p-f,n))}(e,t,n,i,r,s)}(e,t,n,d,o,r,s,c)}}SSe.updateFillTiles=function(e,t,n,i){const r=e._quadtree,o=r._levelZeroTiles,a=r._lastSelectionFrameNumber,s=ISe;s.clear();for(let e=0;e<t.length;++e){const n=t[e];Object(l.a)(n.data.vertexArray)&&s.enqueue(t[e])}let c=s.dequeue();for(;void 0!==c;){const t=c.findTileToWest(o),r=c.findTileToSouth(o),l=c.findTileToEast(o),u=c.findTileToNorth(o);PSe(e,n,c,t,a,MI.EAST,!1,s,i),PSe(e,n,c,r,a,MI.NORTH,!1,s,i),PSe(e,n,c,l,a,MI.WEST,!1,s,i),PSe(e,n,c,u,a,MI.SOUTH,!1,s,i);const h=t.findTileToNorth(o),d=t.findTileToSouth(o),f=l.findTileToNorth(o),p=l.findTileToSouth(o);PSe(e,n,c,h,a,MI.SOUTHEAST,!1,s,i),PSe(e,n,c,f,a,MI.SOUTHWEST,!1,s,i),PSe(e,n,c,d,a,MI.NORTHEAST,!1,s,i),PSe(e,n,c,p,a,MI.NORTHWEST,!1,s,i),c=s.dequeue()}};const DSe=new R,RSe=new R,jSe=new O,MSe=new O,LSe=new Vt,NSe=new Vt,BSe=new Vt;function FSe(){this.height=0,this.encodedNormal=new Vt}function zSe(e,t,n,i,r,o,a,s,c){if(Object(l.a)(r))return r;let u;if(Object(l.a)(o)&&Object(l.a)(a))u=.5*(o.height+a.height);else if(Object(l.a)(o))u=o.height;else if(Object(l.a)(a))u=a.height;else if(Object(l.a)(s))u=s.height;else{const t=e.tile.data.tileBoundingRegion;let n=0,i=0;Object(l.a)(t)&&(n=t.minimumHeight,i=t.maximumHeight),u=.5*(n+i)}return nIe(e,t,n,i,u,c),c}const kSe={minimumHeight:0,maximumHeight:0},USe=new O,VSe=new FSe,HSe=new FSe,GSe=new FSe,qSe=new FSe,WSe="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0,YSe={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function XSe(e,t,n,i){lSe.initialize(n,e.terrainProvider,e._imageryLayers);const r=n.data,o=r.fill,a=n.rectangle,s=t.terrainExaggeration,c=t.terrainExaggerationRelativeHeight,u=1!==s,h=n.tilingScheme.ellipsoid;let d=iIe(o,h,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,GSe),f=iIe(o,h,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,VSe),p=iIe(o,h,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,HSe),m=iIe(o,h,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,qSe);d=zSe(o,h,0,1,d,f,m,p,GSe),f=zSe(o,h,0,0,f,d,p,m,VSe),p=zSe(o,h,1,1,p,f,m,d,HSe),m=zSe(o,h,1,1,m,p,d,f,qSe);const g=f.height,_=p.height,y=d.height,b=m.height;let v=Math.min(g,_,y,b),w=Math.max(g,_,y,b);const A=.5*(v+w);let E,T;const C=e.getLevelMaximumGeometricError(n.level),x=h.maximumRadius-C;let S=4*Math.acos(x/h.maximumRadius);if(S*=1.5,a.width>S&&w-v<=C){const e=new Fc({width:9,height:9,buffer:WSe,structure:{heightOffset:w}}),t=YSe;t.tilingScheme=n.tilingScheme,t.x=n.x,t.y=n.y,t.level=n.level,t.exaggeration=s,t.exaggerationRelativeHeight=c,o.mesh=e._createMeshSync(t)}else{const t=u,i=Be.center(a,RSe);i.height=A;const r=h.cartographicToCartesian(i,USe),l=new Ks(r,void 0,void 0,void 0,void 0,!0,!0,t,s,c);let g,_=5;for(g=o.westMeshes,E=0,T=g.length;E<T;++E)_+=g[E].eastIndicesNorthToSouth.length;for(g=o.southMeshes,E=0,T=g.length;E<T;++E)_+=g[E].northIndicesWestToEast.length;for(g=o.eastMeshes,E=0,T=g.length;E<T;++E)_+=g[E].westIndicesSouthToNorth.length;for(g=o.northMeshes,E=0,T=g.length;E<T;++E)_+=g[E].southIndicesEastToWest.length;const y=kSe;y.minimumHeight=v,y.maximumHeight=w;const b=l.stride;let C=new Float32Array(_*b),x=0;const S=x;x=KSe(h,a,l,C,x,0,1,d.height,d.encodedNormal,1,y),x=oIe(o,h,l,C,x,o.westTiles,o.westMeshes,MI.EAST,y);const I=x;x=KSe(h,a,l,C,x,0,0,f.height,f.encodedNormal,0,y),x=oIe(o,h,l,C,x,o.southTiles,o.southMeshes,MI.NORTH,y);const P=x;x=KSe(h,a,l,C,x,1,0,p.height,p.encodedNormal,0,y),x=oIe(o,h,l,C,x,o.eastTiles,o.eastMeshes,MI.WEST,y);const D=x;x=KSe(h,a,l,C,x,1,1,m.height,m.encodedNormal,1,y),x=oIe(o,h,l,C,x,o.northTiles,o.northMeshes,MI.SOUTH,y),v=y.minimumHeight,w=y.maximumHeight;const R=fs.fromRectangle(a,v,w,n.tilingScheme.ellipsoid),j=Zs.geodeticLatitudeToMercatorAngle(a.south),M=1/(Zs.geodeticLatitudeToMercatorAngle(a.north)-j),L=(Zs.geodeticLatitudeToMercatorAngle(i.latitude)-j)*M,N=h.geodeticSurfaceNormalCartographic(DSe,MSe),B=js.octEncode(N,LSe),F=x;l.encode(C,x*b,R.center,Vt.fromElements(.5,.5,BSe),A,B,L,N),++x;const z=x,k=3*(z-1),U=k*(z<256?1:2);let V;if((C.length-z*b)*Float32Array.BYTES_PER_ELEMENT>=U){const e=z*b*Float32Array.BYTES_PER_ELEMENT;V=z<256?new Uint8Array(C.buffer,e,k):new Uint16Array(C.buffer,e,k)}else V=z<256?new Uint8Array(k):new Uint16Array(k);C=new Float32Array(C.buffer,0,z*b);let H=0;for(E=0;E<z-2;++E)V[H++]=F,V[H++]=E,V[H++]=E+1;V[H++]=F,V[H++]=E,V[H++]=0;const G=[];for(E=I;E>=S;--E)G.push(E);const q=[];for(E=P;E>=I;--E)q.push(E);const W=[];for(E=D;E>=P;--E)W.push(E);const Y=[];for(Y.push(0),E=F-1;E>=D;--E)Y.push(E);o.mesh=new vc(l.center,C,V,k,z,v,w,At.fromOrientedBoundingBox(R),function(e,t,n,i,r,o){const a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=uIe;return O.fromRadians(n.west,n.south,r,s,c[0]),O.fromRadians(n.east,n.south,r,s,c[1]),O.fromRadians(n.west,n.north,r,s,c[2]),O.fromRadians(n.east,n.north,r,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}(e,R.center,a,v,w),l.stride,R,l,G,q,W,Y)}const I=t.context;o._destroyVertexArray(i),o.vertexArray=lSe._createVertexArrayForMesh(I,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);const P=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){const e=r._findAncestorTileWithTerrainData(n);Object(l.a)(e)&&Object(l.a)(e.data.waterMaskTexture)&&(o.waterMaskTexture=e.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,e,o.waterMaskTranslationAndScale))}Object(l.a)(P)&&(--P.referenceCount,0===P.referenceCount&&P.destroy())}function KSe(e,t,n,i,r,o,a,s,c,l,u){const d=DSe;d.longitude=h.a.lerp(t.west,t.east,o),d.latitude=h.a.lerp(t.south,t.north,a),d.height=s;const f=e.cartographicToCartesian(d,jSe);let p;n.hasGeodeticSurfaceNormals&&(p=e.geodeticSurfaceNormal(f,MSe));const m=NSe;return m.x=o,m.y=a,n.encode(i,r*n.stride,f,m,s,c,l,p),u.minimumHeight=Math.min(u.minimumHeight,s),u.maximumHeight=Math.max(u.maximumHeight,s),r+1}const JSe=new Be;function ZSe(e,t,n,i){let r=e.rectangle;const o=t.rectangle;0===t.x&&1===n.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=Be.clone(e.rectangle,JSe),r.west-=h.a.TWO_PI,r.east-=h.a.TWO_PI):0===e.x&&0===n.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=Be.clone(e.rectangle,JSe),r.west+=h.a.TWO_PI,r.east+=h.a.TWO_PI);const a=r.east-r.west,s=(o.west-r.west)/a,c=(o.east-r.west)/a,l=r.north-r.south,u=(o.south-r.south)/l,d=(o.north-r.south)/l;let f=(n.x-s)/(c-s),p=(n.y-u)/(d-u);return Math.abs(f)<Math.EPSILON5?f=0:Math.abs(f-1)<Math.EPSILON5&&(f=1),Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),i.x=f,i.y=p,i}const $Se=new Vt;function QSe(e,t,n,i,r){const o=e.encoding,a=e.vertices;if(r.height=o.decodeHeight(a,t),o.hasVertexNormals)o.getOctEncodedNormal(a,t,r.encodedNormal);else{const e=r.encodedNormal;e.x=0,e.y=0}}const eIe=new Vt,tIe=new O;function nIe(e,t,n,i,r,o){o.height=r;const a=t.geodeticSurfaceNormalCartographic(DSe,jSe);js.octEncode(a,o.encodedNormal)}function iIe(e,t,n,i,r,o,a,s,c,u,h){if(lIe(e,t,s,a,!1,n,i,h)||lIe(e,t,u,c,!0,n,i,h))return h;let d,f;return cIe(r,o)?(d=0===n?0===i?o.eastIndicesNorthToSouth[0]:o.southIndicesEastToWest[0]:0===i?o.northIndicesWestToEast[0]:o.westIndicesSouthToNorth[0],QSe(o,d,0,0,h),h):(f=0===n?0===i?rIe(e.westMeshes,e.westTiles,MI.EAST,e.southMeshes,e.southTiles,MI.NORTH,n,i):rIe(e.northMeshes,e.northTiles,MI.SOUTH,e.westMeshes,e.westTiles,MI.EAST,n,i):0===i?rIe(e.southMeshes,e.southTiles,MI.NORTH,e.eastMeshes,e.eastTiles,MI.WEST,n,i):rIe(e.eastMeshes,e.eastTiles,MI.WEST,e.northMeshes,e.northTiles,MI.SOUTH,n,i),Object(l.a)(f)?(nIe(0,t,0,0,f,h),h):void 0)}function rIe(e,t,n,i,r,o,a,s){const c=sIe(e,t,!1,n,a,s),u=sIe(i,r,!0,o,a,s);return Object(l.a)(c)&&Object(l.a)(u)?.5*(c+u):Object(l.a)(c)?c:u}function oIe(e,t,n,i,r,o,a,s,c){for(let l=0;l<o.length;++l)r=aIe(e,t,n,i,r,o[l],a[l],s,c);return r}function aIe(e,t,n,i,r,o,a,s,c){let l=o.rectangle;s===MI.EAST&&0===e.tile.x?(l=Be.clone(o.rectangle,JSe),l.west-=h.a.TWO_PI,l.east-=h.a.TWO_PI):s===MI.WEST&&0===o.x&&(l=Be.clone(o.rectangle,JSe),l.west+=h.a.TWO_PI,l.east+=h.a.TWO_PI);const u=e.tile.rectangle;let d,f,p,m;switch(r>0&&(n.decodeTextureCoordinates(i,r-1,BSe),d=BSe.x,f=BSe.y),s){case MI.WEST:p=a.westIndicesSouthToNorth,m=!1;break;case MI.NORTH:p=a.northIndicesWestToEast,m=!0;break;case MI.EAST:p=a.eastIndicesNorthToSouth,m=!1;break;case MI.SOUTH:p=a.southIndicesEastToWest,m=!0}const g=o,_=e.tile,y=a.encoding,b=a.vertices,v=n.stride;let O,w;y.hasWebMercatorT&&(O=Zs.geodeticLatitudeToMercatorAngle(u.south),w=1/(Zs.geodeticLatitudeToMercatorAngle(u.north)-O));for(let e=0;e<p.length;++e){const o=p[e],a=y.decodeTextureCoordinates(b,o,BSe);ZSe(g,_,a,a);const s=a.x,l=a.y,A=m?s:l;if(A<0||A>1)continue;if(Math.abs(s-d)<h.a.EPSILON5&&Math.abs(l-f)<h.a.EPSILON5)continue;const E=Math.abs(s)<h.a.EPSILON5||Math.abs(s-1)<h.a.EPSILON5,T=Math.abs(l)<h.a.EPSILON5||Math.abs(l-1)<h.a.EPSILON5;if(E&&T)continue;const C=y.decodePosition(b,o,jSe),x=y.decodeHeight(b,o);let S;y.hasVertexNormals?S=y.getOctEncodedNormal(b,o,LSe):(S=LSe,S.x=0,S.y=0);let I,P=l;if(y.hasWebMercatorT){const e=h.a.lerp(u.south,u.north,l);P=(Zs.geodeticLatitudeToMercatorAngle(e)-O)*w}n.hasGeodeticSurfaceNormals&&(I=t.geodeticSurfaceNormal(C,MSe)),n.encode(i,r*v,C,a,x,S,P,I),c.minimumHeight=Math.min(c.minimumHeight,x),c.maximumHeight=Math.max(c.maximumHeight,x),++r}return r}function sIe(e,t,n,i,r,o){let a,s,c;n?(a=0,s=e.length,c=1):(a=e.length-1,s=-1,c=-1);for(let r=a;r!==s;r+=c){const o=e[r];if(!cIe(t[r],o))continue;let a;switch(i){case MI.WEST:a=o.westIndicesSouthToNorth;break;case MI.SOUTH:a=o.southIndicesEastToWest;break;case MI.EAST:a=o.eastIndicesNorthToSouth;break;case MI.NORTH:a=o.northIndicesWestToEast}const s=a[n?0:a.length-1];if(Object(l.a)(s))return o.encoding.decodeHeight(o.vertices,s)}}function cIe(e,t){return Object(l.a)(t)&&(!Object(l.a)(e.data.fill)||!e.data.fill.changedThisFrame)}function lIe(e,t,n,i,r,o,a,s){let c,l,u,d,f;const p=i[r?0:n.length-1],m=n[r?0:n.length-1];if(cIe(p,m)&&(0===o?0===a?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,l=r,u=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,l=!r,u=!1):0===a?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,l=!r,u=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,l=r,u=!r),c.length>0)){d=r?0:c.length-1,f=c[d],m.encoding.decodeTextureCoordinates(m.vertices,f,BSe);const n=ZSe(p,e.tile,BSe,BSe);if(n.x===o&&n.y===a)return QSe(m,f,0,0,s),!0;if(d=Si(c,l?o:a,(function(t,n){m.encoding.decodeTextureCoordinates(m.vertices,t,BSe);const i=ZSe(p,e.tile,BSe,BSe);return u?l?i.x-o:i.y-a:l?o-i.x:a-i.y})),!(d<0))return QSe(m,c[d],0,0,s),!0;if(d=~d,d>0&&d<c.length)return function(e,t,n,i,r,o,a,s,c,l){const u=i.encoding,d=i.vertices,f=ZSe(t,n,u.decodeTextureCoordinates(d,r,BSe),BSe),p=ZSe(t,n,u.decodeTextureCoordinates(d,o,NSe),NSe);let m;m=c?(a-f.x)/(p.x-f.x):(s-f.y)/(p.y-f.y);const g=u.decodeHeight(d,r),_=u.decodeHeight(d,o),y=n.rectangle;let b;if(DSe.longitude=h.a.lerp(y.west,y.east,a),DSe.latitude=h.a.lerp(y.south,y.north,s),l.height=DSe.height=h.a.lerp(g,_,m),u.hasVertexNormals){const e=u.getOctEncodedNormal(d,r,$Se),t=u.getOctEncodedNormal(d,o,eIe),n=js.octDecode(e.x,e.y,jSe),i=js.octDecode(t.x,t.y,tIe);b=O.lerp(n,i,m,jSe),O.normalize(b,b),js.octEncode(b,l.encodedNormal)}else b=e.geodeticSurfaceNormalCartographic(DSe,jSe),js.octEncode(b,l.encodedNormal)}(t,p,e.tile,m,c[d-1],c[d],o,a,l,s),!0}return!1}const uIe=[new O,new O,new O,new O];var hIe=SSe;function dIe(e){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.terrainProvider))throw new u.a("options.terrainProvider is required.");if(!Object(l.a)(e.imageryLayers))throw new u.a("options.imageryLayers is required.");if(!Object(l.a)(e.surfaceShaderSet))throw new u.a("options.surfaceShaderSet is required.");this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=TB.RECEIVE_ONLY,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new un.a,this._imageryLayers.layerAdded.addEventListener(dIe.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(dIe.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(dIe.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(dIe.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new un.a,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new sp(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=Be.clone(Be.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0}function fIe(e,t){let n=e.loadingImagery;Object(l.a)(n)||(n=e.readyImagery);let i=t.loadingImagery;return Object(l.a)(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function pIe(e,t){const n=t.globeTranslucencyState;if(n.translucent){const i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Object.defineProperties(dIe.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._baseColor=e,this._firstPassInitialColor=_e.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){if(this._terrainProvider!==e){if(!Object(l.a)(e))throw new u.a("terrainProvider is required.");this._terrainProvider=e,Object(l.a)(this._quadtree)&&this._quadtree.invalidateAllTiles()}}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Fq.setOwner(e,this,"_clippingPlanes")}}}),dIe.prototype.update=function(e){this._imageryLayers._update()},dIe.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile((function(e){e.data.imagery.sort(fIe)}))),function(e,t){const n=t.creditDisplay;e._terrainProvider.ready&&Object(l.a)(e._terrainProvider.credit)&&n.addCredit(e._terrainProvider.credit);const i=e._imageryLayers;for(let e=0,t=i.length;e<t;++e){const t=i.get(e).imageryProvider;t.ready&&Object(l.a)(t.credit)&&n.addCredit(t.credit)}}(this,e);const t=this._vertexArraysToDestroy,n=t.length;for(let e=0;e<n;++e)lSe._freeVertexArray(t[e]);t.length=0},dIe.prototype.beginUpdate=function(e){const t=this._tilesToRenderByTextureCount;for(let e=0,n=t.length;e<n;++e){const n=t[e];Object(l.a)(n)&&(n.length=0)}const n=this._clippingPlanes;Object(l.a)(n)&&n.enabled&&n.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},dIe.prototype.endUpdate=function(e){if(!Object(l.a)(this._renderState)){this._renderState=vj.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:YN.LESS}}),this._blendRenderState=vj.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:YN.LESS_OR_EQUAL},blending:SD.ALPHA_BLEND});let e=Object(Zf.a)(this._renderState,!0);e.cull.enabled=!1,this._disableCullingRenderState=vj.fromCache(e),e=Object(Zf.a)(this._blendRenderState,!0),e.cull.enabled=!1,this._disableCullingBlendRenderState=vj.fromCache(e)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&hIe.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);const t=this.quadtree,n=e.terrainExaggeration,i=e.terrainExaggerationRelativeHeight,r=this._oldTerrainExaggeration!==n||this._oldTerrainExaggerationRelativeHeight!==i;this._oldTerrainExaggeration=n,this._oldTerrainExaggerationRelativeHeight=i,r&&t.forEachLoadedTile((function(n){n.data.updateExaggeration(n,e,t)}));const o=this._tilesToRenderByTextureCount;for(let t=0,n=o.length;t<n;++t){const n=o[t];if(Object(l.a)(n))for(let t=0,i=n.length;t<i;++t){const i=n[t],r=i.data.tileBoundingRegion;WIe(this,i,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,r.minimumHeight)}}},dIe.prototype.updateForPick=function(e){const t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)pIe(t[n],e)},dIe.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},dIe.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},dIe.prototype.loadTile=function(e,t){let n,i=t.data,r=!0;Object(l.a)(i)&&(r=i.boundingVolumeSourceTile!==t||t._lastSelectionResult===xSe.CULLED_BUT_NEEDED,n=i.terrainState),lSe.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=t.data,r&&n!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==xE.NONE&&i.boundingVolumeSourceTile===t&&(r=!1,lSe.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))};const mIe=new At,gIe=new Be,_Ie=new Be,yIe=new R;function bIe(e,t){if(t.west<t.east)return t;const n=Be.clone(t,_Ie);return Be.center(e,yIe).longitude>0?n.east=h.a.PI:n.west=-h.a.PI,n}function vIe(e,t){if(t.cameraUnderground)return!0;if(t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;const n=e._clippingPlanes;return!(!Object(l.a)(n)||!n.enabled)||!Be.equals(e.cartographicLimitRectangle,Be.MAX_VALUE)}dIe.prototype.computeTileVisibility=function(e,t,n){const i=this.computeDistanceToTile(e,t);e._distance=i;const r=vIe(this,t);if(t.fog.enabled&&!r&&h.a.fog(i,t.fog.density)>=1)return xE.NONE;const o=e.data,a=o.tileBoundingRegion;if(void 0===o.boundingVolumeSourceTile)return xE.PARTIAL;const s=t.cullingVolume;let c=a.boundingVolume;Object(l.a)(c)||(c=a.boundingSphere),o.clippedByBoundaries=!1;const u=bIe(e.rectangle,this.cartographicLimitRectangle),d=Be.simpleIntersection(u,e.rectangle,gIe);if(!Object(l.a)(d))return xE.NONE;if(Be.equals(d,e.rectangle)||(o.clippedByBoundaries=!0),t.mode!==AB.SCENE3D&&(c=mIe,At.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,a.minimumHeight,a.maximumHeight,c),O.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===AB.MORPHING&&Object(l.a)(o.renderedMesh)&&(c=At.union(a.boundingSphere,c,c))),!Object(l.a)(c))return xE.PARTIAL;const f=this._clippingPlanes;if(Object(l.a)(f)&&f.enabled){const t=f.computeIntersectionWithBoundingVolume(c);if(e.isClipped=t!==W.INSIDE,t===W.OUTSIDE)return xE.NONE}let p;const m=s.computeVisibility(c);if(m===W.OUTSIDE?p=xE.NONE:m===W.INTERSECTING?p=xE.PARTIAL:m===W.INSIDE&&(p=xE.FULL),p===xE.NONE)return p;const g=t.mode===AB.SCENE3D&&t.camera.frustum instanceof nv;if(t.mode===AB.SCENE3D&&!g&&Object(l.a)(n)&&!r){const e=o.occludeePointInScaledSpace;return Object(l.a)(e)?n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(e,a.minimumHeight)?p:xE.NONE:p}return p},dIe.prototype.canRefine=function(e){if(Object(l.a)(e.data.terrainData))return!0;return void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};const OIe=[],wIe=[];dIe.prototype.canRenderWithoutLosingDetail=function(e,t){const n=e.data,i=OIe;i.length=this._imageryLayers.length;let r,o,a,s=!1,c=!1;for(Object(l.a)(n)&&(s=n.terrainState===eSe.READY,c=!0,r=n.imagery),o=0,a=i.length;o<a;++o)i[o]=c;if(Object(l.a)(r))for(o=0,a=r.length;o<a;++o){const e=r[o],t=e.loadingImagery,n=!Object(l.a)(t)||t.state===$xe.FAILED||t.state===$xe.INVALID,a=(e.loadingImagery||e.readyImagery).imageryLayer._layerIndex;i[a]=n&&i[a]}const u=this.quadtree._lastSelectionFrameNumber,h=wIe;for(h.length=0,h.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);h.length>0;){const e=h.pop(),t=e._lastSelectionResultFrame===u?e._lastSelectionResult:xSe.NONE;if(t===xSe.RENDERED){const t=e.data;if(!Object(l.a)(t))continue;if(!s&&e.data.terrainState===eSe.READY)return!1;const n=e.data.imagery;for(o=0,a=n.length;o<a;++o){const e=n[o],t=e.loadingImagery,r=!Object(l.a)(t)||t.state===$xe.FAILED||t.state===$xe.INVALID,a=(e.loadingImagery||e.readyImagery).imageryLayer._layerIndex;if(r&&!i[a])return!1}}else t===xSe.REFINED&&h.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild)}return!0};const AIe=new O;dIe.prototype.computeTileLoadPriority=function(e,t){const n=e.data;if(void 0===n)return 0;const i=n.tileBoundingRegion.boundingVolume;if(void 0===i)return 0;const r=t.camera.positionWC,o=t.camera.directionWC,a=O.subtract(i.center,r,AIe),s=O.magnitude(a);return s<h.a.EPSILON5?0:(O.divideByScalar(a,s,a),(1-O.dot(a,o))*e._distance)};const EIe=new Me,TIe=new Me,CIe=new _e,xIe=new _e,SIe=new _e,IIe=new O,PIe=new O,DIe=new O,RIe=new O;dIe.prototype.showTileThisFrame=function(e,t){let n=0;const i=e.data.imagery;for(let e=0,t=i.length;e<t;++e){const t=i[e];Object(l.a)(t.readyImagery)&&0!==t.readyImagery.imageryLayer.alpha&&++n}let r=this._tilesToRenderByTextureCount[n];Object(l.a)(r)||(r=[],this._tilesToRenderByTextureCount[n]=r),r.push(e);const o=e.data;Object(l.a)(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;const a=this._debug;++a.tilesRendered,a.texturesRendered+=n};const jIe=[new O,new O,new O,new O];function MIe(e,t,n,i,r,o){const a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=jIe;return O.fromRadians(n.west,n.south,r,s,c[0]),O.fromRadians(n.east,n.south,r,s,c[1]),O.fromRadians(n.west,n.north,r,s,c[2]),O.fromRadians(n.east,n.north,r,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}dIe.prototype.computeDistanceToTile=function(e,t){!function(e,t,n){let i=e.data;void 0===i&&(i=e.data=new lSe);const r=e.tilingScheme.ellipsoid;void 0===i.tileBoundingRegion&&(i.tileBoundingRegion=new Ute({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));const o=i.tileBoundingRegion,a=o.minimumHeight,s=o.maximumHeight;let c=!1,u=e;const h=i.mesh,d=i.terrainData;if(void 0!==h&&void 0!==h.minimumHeight&&void 0!==h.maximumHeight)o.minimumHeight=h.minimumHeight,o.maximumHeight=h.maximumHeight,c=!0;else if(void 0!==d&&void 0!==d._minimumHeight&&void 0!==d._maximumHeight)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let t=e.parent;for(;void 0!==t;){const e=t.data;if(void 0!==e){const t=e.mesh,n=e.terrainData;if(void 0!==t&&void 0!==t.minimumHeight&&void 0!==t.maximumHeight){o.minimumHeight=t.minimumHeight,o.maximumHeight=t.maximumHeight;break}if(void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight){o.minimumHeight=n._minimumHeight,o.maximumHeight=n._maximumHeight;break}}t=t.parent}u=t}if(void 0!==u){const d=n.terrainExaggeration,f=n.terrainExaggerationRelativeHeight;if(1!==d&&(c=!1,o.minimumHeight=Ns.getHeight(o.minimumHeight,d,f),o.maximumHeight=Ns.getHeight(o.maximumHeight,d,f)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=fs.clone(h.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=At.clone(h.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=O.clone(h.occludeePointInScaledSpace,i.occludeePointInScaledSpace),Object(l.a)(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=MIe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{const n=void 0===o._orientedBoundingBox||void 0===o._boundingSphere;(o.minimumHeight!==a||o.maximumHeight!==s||n)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=MIe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}(e,this,t);const n=e.data;if(void 0===n.boundingVolumeSourceTile)return 9999999999;const i=n.tileBoundingRegion,r=i.minimumHeight,o=i.maximumHeight;if(n.boundingVolumeSourceTile!==e){const e=t.camera.positionCartographic.height;Math.abs(e-r)>Math.abs(e-o)?(i.minimumHeight=r,i.maximumHeight=r):(i.minimumHeight=o,i.maximumHeight=o)}const a=i.distanceToCamera(t);return i.minimumHeight=r,i.maximumHeight=o,a},dIe.prototype.isDestroyed=function(){return!1},dIe.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),sc(this)},dIe.prototype._onLayerAdded=function(e,t){if(e.show){const t=this._terrainProvider,n=this,i=e.imageryProvider,r=this._imageryLayersUpdatedEvent;i._reload=function(){e._imageryCache={},n._quadtree.forEachLoadedTile((function(n){if(Object(l.a)(n._loadedCallbacks[e._layerIndex]))return;let i;const r=n.data.imagery,o=r.length;let a=-1,s=0;for(i=0;i<o;++i){const t=r[i];if(Object(c.a)(t.readyImagery,t.loadingImagery).imageryLayer===e)-1===a&&(a=i),++s;else if(-1!==a)break}if(-1===a)return;const u=a+s;e._createTileImagerySkeletons(n,t,u)&&(n._loadedCallbacks[e._layerIndex]=function(e,t,n){return function(i){let r,o,a=-1;const s=i.data.imagery,u=s.length;let h;for(h=0;h<u;++h)if(r=s[h],o=Object(c.a)(r.readyImagery,r.loadingImagery),o.imageryLayer===t){a=h;break}if(-1!==a){const u=a+e;if(r=s[u],o=Object(l.a)(r)?Object(c.a)(r.readyImagery,r.loadingImagery):void 0,!Object(l.a)(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(h=a;h<u;++h)s[h].freeResources();s.splice(a,e)}return!0}}(s,e,t),n.state=Qxe.LOADING)}))},this._quadtree.forEachLoadedTile((function(i){e._createTileImagerySkeletons(i,t)&&(i.state=Qxe.LOADING,0===i.level||i._lastSelectionResultFrame===n.quadtree._lastSelectionFrameNumber&&i._lastSelectionResult===xSe.RENDERED||(i.renderable=!1))})),this._layerOrderChanged=!0,r.raiseEvent()}},dIe.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile((function(t){const n=t.data.imagery;let i=-1,r=0;for(let t=0,o=n.length;t<o;++t){const o=n[t];let a=o.loadingImagery;if(Object(l.a)(a)||(a=o.readyImagery),a.imageryLayer===e)-1===i&&(i=t),o.freeResources(),++r;else if(-1!==i)break}-1!==i&&n.splice(i,r)})),Object(l.a)(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},dIe.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},dIe.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};const LIe=new Me,NIe=new Me;function BIe(e,t){const n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){const t=e.context.uniformState.view,n=Me.multiplyByPoint(t,this.properties.rtc,PIe);return Me.setTranslation(t,n,EIe),EIe},u_modifiedModelViewProjection:function(){const t=e.context.uniformState.view,n=e.context.uniformState.projection,i=Me.multiplyByPoint(t,this.properties.rtc,PIe);return Me.setTranslation(t,i,TIe),Me.multiply(n,TIe,TIe),TIe},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){const n=t._clippingPlanes;return Object(l.a)(n)&&Object(l.a)(n.texture)?n.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){const n=t._clippingPlanes,i=Object(l.a)(n)?Me.multiply(e.context.uniformState.view,n.modelMatrix,LIe):Me.IDENTITY;return Me.inverseTranspose(i,NIe)},u_clippingPlanesEdgeStyle:function(){const e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},properties:{initialColor:new _e(0,0,.5,1),fillHighlightColor:new sp(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Vt(65e5,9e6),nightFadeDistance:new Vt(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new O(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new O(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new O,center3D:void 0,rtc:new O,modifiedModelView:new Me,tileRectangle:new _e,terrainExaggerationAndRelativeHeight:new Vt(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Vt,southMercatorYAndOneOverHeight:new Vt,waterMask:void 0,waterMaskTranslationAndScale:new _e,minMaxHeight:new Vt,scaleAndBias:new Me,clippingPlanesEdgeColor:sp.clone(sp.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new _e,frontFaceAlphaByDistance:new _e,backFaceAlphaByDistance:new _e,localizedTranslucencyRectangle:new _e,undergroundColor:sp.clone(sp.TRANSPARENT),undergroundColorAlphaByDistance:new _e,lambertDiffuseMultiplier:0}};return Object(l.a)(t.materialUniformMap)?Object(up.a)(n,t.materialUniformMap):n}function FIe(e,t,n){const i=n.data;let r,o;if(Object(l.a)(i.vertexArray)?(r=i.mesh,o=i.vertexArray):Object(l.a)(i.fill)&&Object(l.a)(i.fill.vertexArray)&&(r=i.fill.mesh,o=i.fill.vertexArray),Object(l.a)(r)&&Object(l.a)(o)){if(Object(l.a)(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=function(e,t,n){const i={indices:n.indices,primitiveType:zl.TRIANGLES};$d.toWireframe(i);const r=i.indices,o=ZN.createIndexBuffer({context:e,typedArray:r,usage:KN.STATIC_DRAW,indexDatatype:wc.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new iB({context:e,attributes:t._attributes,indexBuffer:o})}(e,o,r),i.wireframeVertexArray.mesh=r}}let zIe,kIe,UIe;!function(){const e=new Ph({geometry:gu.fromDimensions({dimensions:new O(2,2,2)})}),t=new Ph({geometry:new SI({radius:1})});let n,i,r=new Me;function o(e){return new hF({geometryInstances:e,appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1})}zIe=function(t,a){return t===n||(UIe(),n=t,r=Me.fromRotationTranslation(t.halfAxes,t.center,r),e.modelMatrix=r,e.attributes.color=lp.fromColor(a),i=o(e)),i},kIe=function(e,a){return e===n||(UIe(),n=e,r=Me.fromTranslation(e.center,r),r=Me.multiplyByUniformScale(r,e.radius,r),t.modelMatrix=r,t.attributes.color=lp.fromColor(a),i=o(t)),i},UIe=function(){Object(l.a)(i)&&(i.destroy(),i=void 0,n=void 0)}}();const VIe=new _e(0,0,0,0),HIe={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},GIe=sp.TRANSPARENT,qIe=new TE;function WIe(e,t,n){const i=t.data;Object(l.a)(i.vertexArray)||(void 0===i.fill&&(i.fill=new hIe(t)),i.fill.update(e,n));const r=n.creditDisplay,o=i.terrainData;if(Object(l.a)(o)&&Object(l.a)(o.credits)){const e=o.credits;for(let t=0,n=e.length;t<n;++t)r.addCredit(e[t])}let a=MD.maximumTextureImageUnits,s=i.waterMaskTexture,d=i.waterMaskTranslationAndScale;!Object(l.a)(s)&&Object(l.a)(i.fill)&&(s=i.fill.waterMaskTexture,d=i.fill.waterMaskTranslationAndScale);const f=n.cameraUnderground,p=n.globeTranslucencyState,m=p.translucent,g=p.frontFaceAlphaByDistance,_=p.backFaceAlphaByDistance,y=p.rectangle,b=Object(c.a)(e.undergroundColor,GIe),v=Object(c.a)(e.undergroundColorAlphaByDistance,qIe),w=vIe(e,n)&&n.mode===AB.SCENE3D&&b.alpha>0&&(v.nearValue>0||v.farValue>0),A=e.lambertDiffuseMultiplier,E=e.hasWaterMask&&Object(l.a)(s),T=e.oceanNormalMap,C=E&&Object(l.a)(T),x=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,S=n.fog.enabled&&n.fog.renderable&&!f,I=e.showGroundAtmosphere&&n.mode===AB.SCENE3D,P=TB.castShadows(e.shadows)&&!m,D=TB.receiveShadows(e.shadows)&&!m,R=e.hueShift,j=e.saturationShift,M=e.brightnessShift;let L=!(h.a.equalsEpsilon(R,0,h.a.EPSILON7)&&h.a.equalsEpsilon(j,0,h.a.EPSILON7)&&h.a.equalsEpsilon(M,0,h.a.EPSILON7)),N=!1;if(I){N=O.magnitude(n.camera.positionWC)>e.nightFadeOutDistance}E&&--a,C&&--a,Object(l.a)(n.shadowState)&&n.shadowState.shadowsEnabled&&--a,Object(l.a)(e.clippingPlanes)&&e.clippingPlanes.enabled&&--a,a-=p.numberOfTextureUniforms;const B=i.renderedMesh;let F=B.center;const z=B.encoding,k=i.tileBoundingRegion,U=n.terrainExaggeration,V=n.terrainExaggerationRelativeHeight,H=1!==U,G=z.hasGeodeticSurfaceNormals,q=CIe;let W=0,Y=0,X=0,K=0,J=!1;if(n.mode!==AB.SCENE3D){const e=n.mapProjection,i=e.project(Be.southwest(t.rectangle),DIe),r=e.project(Be.northeast(t.rectangle),RIe);if(q.x=i.x,q.y=i.y,q.z=r.x,q.w=r.y,n.mode!==AB.MORPHING&&(F=IIe,F.x=0,F.y=.5*(q.z+q.x),F.z=.5*(q.w+q.y),q.x-=F.y,q.y-=F.z,q.z-=F.y,q.w-=F.z),n.mode===AB.SCENE2D&&z.quantization===Bs.BITS12){const e=1/(Math.pow(2,12)-1)*.5,t=(q.z-q.x)*e,n=(q.w-q.y)*e;q.x-=t,q.y-=n,q.z+=t,q.w+=n}e instanceof Zs&&(W=t.rectangle.south,Y=t.rectangle.north,X=Zs.geodeticLatitudeToMercatorAngle(W),K=1/(Zs.geodeticLatitudeToMercatorAngle(Y)-X),J=!0)}const Z=HIe;Z.frameState=n,Z.surfaceTile=i,Z.showReflectiveOcean=E,Z.showOceanWaves=C,Z.enableLighting=e.enableLighting,Z.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Z.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Z.showGroundAtmosphere=I,Z.atmosphereLightIntensity=e.atmosphereLightIntensity,Z.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Z.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Z.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Z.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Z.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Z.perFragmentGroundAtmosphere=N,Z.hasVertexNormals=x,Z.useWebMercatorProjection=J,Z.clippedByBoundaries=i.clippedByBoundaries,Z.hasGeodeticSurfaceNormals=G,Z.hasExaggeration=H;const $=i.imagery;let Q=0;const ee=$.length,te=e.showSkirts&&!f&&!m,ne=e.backFaceCulling&&!f&&!m,ie=ne?e._renderState:e._disableCullingRenderState,re=ne?e._blendRenderState:e._disableCullingBlendRenderState;let oe=ie,ae=e._firstPassInitialColor;const se=n.context;Object(l.a)(e._debug.boundingSphereTile)||UIe();if(e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;const t=e._drawCommands.length;for(let i=0;i<t;++i)e._uniformMaps[i]=BIe(n,e)}do{let o,c,E=0;if(e._drawCommands.length<=e._usedDrawCommands?(o=new XR,o.owner=t,o.cull=!1,o.boundingVolume=new At,o.orientedBoundingBox=void 0,c=BIe(n,e),e._drawCommands.push(o),e._uniformMaps.push(c)):(o=e._drawCommands[e._usedDrawCommands],c=e._uniformMaps[e._usedDrawCommands]),o.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){const e=k.boundingVolume,t=k.boundingSphere;Object(l.a)(e)?zIe(e,sp.RED).update(n):Object(l.a)(t)&&kIe(t,sp.RED).update(n)}const C=c.properties;_e.clone(ae,C.initialColor),C.oceanNormalMap=T,C.lightingFadeDistance.x=e.lightingFadeOutDistance,C.lightingFadeDistance.y=e.lightingFadeInDistance,C.nightFadeDistance.x=e.nightFadeOutDistance,C.nightFadeDistance.y=e.nightFadeInDistance,C.atmosphereLightIntensity=e.atmosphereLightIntensity,C.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,C.atmosphereMieCoefficient=e.atmosphereMieCoefficient,C.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,C.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,C.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,C.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;const x=f?_:g,N=f?g:_;Object(l.a)(x)&&(_e.fromElements(x.near,x.nearValue,x.far,x.farValue,C.frontFaceAlphaByDistance),_e.fromElements(N.near,N.nearValue,N.far,N.farValue,C.backFaceAlphaByDistance)),_e.fromElements(v.near,v.nearValue,v.far,v.farValue,C.undergroundColorAlphaByDistance),sp.clone(b,C.undergroundColor),C.lambertDiffuseMultiplier=A;const H=!Object(l.a)(i.vertexArray)&&Object(l.a)(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;H&&sp.clone(e.fillHighlightColor,C.fillHighlightColor),C.terrainExaggerationAndRelativeHeight.x=U,C.terrainExaggerationAndRelativeHeight.y=V,C.center3D=B.center,O.clone(F,C.rtc),_e.clone(q,C.tileRectangle),C.southAndNorthLatitude.x=W,C.southAndNorthLatitude.y=Y,C.southMercatorYAndOneOverHeight.x=X,C.southMercatorYAndOneOverHeight.y=K;const G=xIe,J=bIe(t.rectangle,e.cartographicLimitRectangle),ne=SIe,ie=bIe(t.rectangle,y);O.fromElements(R,j,M,C.hsbShift);const ce=t.rectangle,le=1/ce.width,ue=1/ce.height;G.x=(J.west-ce.west)*le,G.y=(J.south-ce.south)*ue,G.z=(J.east-ce.west)*le,G.w=(J.north-ce.south)*ue,_e.clone(G,C.localizedCartographicLimitRectangle),ne.x=(ie.west-ce.west)*le,ne.y=(ie.south-ce.south)*ue,ne.z=(ie.east-ce.west)*le,ne.w=(ie.north-ce.south)*ue,_e.clone(ne,C.localizedTranslucencyRectangle);const he=S&&h.a.fog(t._distance,n.fog.density)>h.a.EPSILON3;L=L&&(he||I);let de=!1,fe=!1,pe=!1,me=!1,ge=!1,ye=!1,be=!1,ve=!1,Oe=!1,we=!1;for(;E<a&&Q<ee;){const e=$[Q],n=e.readyImagery;if(++Q,!Object(l.a)(n)||0===n.imageryLayer.alpha)continue;const i=e.useWebMercatorT?n.textureWebMercator:n.texture;if(!Object(l.a)(i))throw new u.a("readyImagery is not actually ready!");const o=n.imageryLayer;Object(l.a)(e.textureTranslationAndScale)||(e.textureTranslationAndScale=o._calculateTextureTranslationAndScale(t,e)),C.dayTextures[E]=i,C.dayTextureTranslationAndScale[E]=e.textureTranslationAndScale,C.dayTextureTexCoordsRectangle[E]=e.textureCoordinateRectangle,C.dayTextureUseWebMercatorT[E]=e.useWebMercatorT,C.dayTextureAlpha[E]=o.alpha,ye=ye||1!==C.dayTextureAlpha[E],C.dayTextureNightAlpha[E]=o.nightAlpha,be=be||1!==C.dayTextureNightAlpha[E],C.dayTextureDayAlpha[E]=o.dayAlpha,be=be||1!==C.dayTextureDayAlpha[E],C.dayTextureBrightness[E]=o.brightness,de=de||C.dayTextureBrightness[E]!==TSe.DEFAULT_BRIGHTNESS,C.dayTextureContrast[E]=o.contrast,fe=fe||C.dayTextureContrast[E]!==TSe.DEFAULT_CONTRAST,C.dayTextureHue[E]=o.hue,pe=pe||C.dayTextureHue[E]!==TSe.DEFAULT_HUE,C.dayTextureSaturation[E]=o.saturation,me=me||C.dayTextureSaturation[E]!==TSe.DEFAULT_SATURATION,C.dayTextureOneOverGamma[E]=1/o.gamma,ge=ge||C.dayTextureOneOverGamma[E]!==1/TSe.DEFAULT_GAMMA,C.dayTextureSplit[E]=o.splitDirection,ve=ve||0!==C.dayTextureSplit[E];let a=C.dayTextureCutoutRectangles[E];if(Object(l.a)(a)||(a=C.dayTextureCutoutRectangles[E]=new _e),_e.clone(_e.ZERO,a),Object(l.a)(o.cutoutRectangle)){const e=bIe(ce,o.cutoutRectangle),t=Be.simpleIntersection(e,ce,gIe);Oe=Object(l.a)(t)||Oe,a.x=(e.west-ce.west)*le,a.y=(e.south-ce.south)*ue,a.z=(e.east-ce.west)*le,a.w=(e.north-ce.south)*ue}let s=C.colorsToAlpha[E];Object(l.a)(s)||(s=C.colorsToAlpha[E]=new _e);const c=Object(l.a)(o.colorToAlpha)&&o.colorToAlphaThreshold>0;if(we=we||c,c){const e=o.colorToAlpha;s.x=e.red,s.y=e.green,s.z=e.blue,s.w=o.colorToAlphaThreshold}else s.w=-1;if(Object(l.a)(n.credits)){const e=n.credits;for(let t=0,n=e.length;t<n;++t)r.addCredit(e[t])}++E}C.dayTextures.length=E,C.waterMask=s,_e.clone(d,C.waterMaskTranslationAndScale),C.minMaxHeight.x=z.minimumHeight,C.minMaxHeight.y=z.maximumHeight,Me.clone(z.matrix,C.scaleAndBias);const Ae=e._clippingPlanes,Ee=Object(l.a)(Ae)&&Ae.enabled&&t.isClipped;Ee&&(C.clippingPlanesEdgeColor=sp.clone(Ae.edgeColor,C.clippingPlanesEdgeColor),C.clippingPlanesEdgeWidth=Ae.edgeWidth),Z.numberOfDayTextures=E,Z.applyBrightness=de,Z.applyContrast=fe,Z.applyHue=pe,Z.applySaturation=me,Z.applyGamma=ge,Z.applyAlpha=ye,Z.applyDayNightAlpha=be,Z.applySplit=ve,Z.enableFog=he,Z.enableClippingPlanes=Ee,Z.clippingPlanes=Ae,Z.hasImageryLayerCutout=Oe,Z.colorCorrect=L,Z.highlightFillTile=H,Z.colorToAlpha=we,Z.showUndergroundColor=w,Z.translucent=m;let Te=i.renderedMesh.indices.length;te||(Te=i.renderedMesh.indexCountWithoutSkirts),o.shaderProgram=e._surfaceShaderSet.getShaderProgram(Z),o.castShadows=P,o.receiveShadows=D,o.renderState=oe,o.primitiveType=zl.TRIANGLES,o.vertexArray=i.vertexArray||i.fill.vertexArray,o.count=Te,o.uniformMap=c,o.pass=KR.GLOBE,e._debug.wireframe&&(FIe(se,0,t),Object(l.a)(i.wireframeVertexArray)&&(o.vertexArray=i.wireframeVertexArray,o.primitiveType=zl.LINES,o.count=2*Te));let Ce=o.boundingVolume;const xe=o.orientedBoundingBox;n.mode!==AB.SCENE3D?(At.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,k.minimumHeight,k.maximumHeight,Ce),O.fromElements(Ce.center.z,Ce.center.x,Ce.center.y,Ce.center),n.mode===AB.MORPHING&&(Ce=At.union(k.boundingSphere,Ce,Ce))):(o.boundingVolume=At.clone(k.boundingSphere,Ce),o.orientedBoundingBox=fs.clone(k.boundingVolume,xe)),o.dirty=!0,m&&p.updateDerivedCommands(o,n),pIe(o,n),oe=re,ae=VIe}while(Q<ee)}var YIe=dIe;function XIe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=Be.clone(Be.MAX_VALUE)}Object.defineProperties(XIe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){s.a.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){s.a.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),s.a.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(Object(l.a)(e)&&e.far<e.near)throw new u.a("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=TE.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){s.a.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),s.a.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(Object(l.a)(e)&&e.far<e.near)throw new u.a("far distance must be greater than near distance.");this._backFaceAlphaByDistance=TE.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){Object(l.a)(e)||(e=Be.clone(Be.MAX_VALUE)),Be.clone(e,this._rectangle)}}});var KIe=XIe;function JIe(){this._layers=[],this.layerAdded=new un.a,this.layerRemoved=new un.a,this.layerMoved=new un.a,this.layerShownOrHidden=new un.a}function ZIe(e,t){if(!Object(l.a)(t))throw new u.a("layer is required.");const n=e.indexOf(t);if(-1===n)throw new u.a("layer is not in this collection.");return n}function $Ie(e,t,n){const i=e._layers;if((t=h.a.clamp(t,0,i.length-1))===(n=h.a.clamp(n,0,i.length-1)))return;const r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}Object.defineProperties(JIe.prototype,{length:{get:function(){return this._layers.length}}}),JIe.prototype.add=function(e,t){const n=Object(l.a)(t);if(!Object(l.a)(e))throw new u.a("layer is required.");if(n){if(t<0)throw new u.a("index must be greater than or equal to zero.");if(t>this._layers.length)throw new u.a("index must be less than or equal to the number of layers.")}n?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)},JIe.prototype.addImageryProvider=function(e,t){if(!Object(l.a)(e))throw new u.a("imageryProvider is required.");const n=new TSe(e);return this.add(n,t),n},JIe.prototype.remove=function(e,t){t=Object(c.a)(t,!0);const n=this._layers.indexOf(e);return-1!==n&&(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0)},JIe.prototype.removeAll=function(e){e=Object(c.a)(e,!0);const t=this._layers;for(let n=0,i=t.length;n<i;n++){const i=t[n];this.layerRemoved.raiseEvent(i,n),e&&i.destroy()}this._layers=[]},JIe.prototype.contains=function(e){return-1!==this.indexOf(e)},JIe.prototype.indexOf=function(e){return this._layers.indexOf(e)},JIe.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.","index");return this._layers[e]},JIe.prototype.raise=function(e){const t=ZIe(this._layers,e);$Ie(this,t,t+1)},JIe.prototype.lower=function(e){const t=ZIe(this._layers,e);$Ie(this,t,t-1)},JIe.prototype.raiseToTop=function(e){const t=ZIe(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},JIe.prototype.lowerToBottom=function(e){const t=ZIe(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};const QIe=new Be;function ePe(e,t,n,i){const r=e.globe._surface._tilesToRender;let o;for(let e=0;!Object(l.a)(o)&&e<r.length;++e){const n=r[e];Be.contains(n.rectangle,t)&&(o=n)}if(!Object(l.a)(o))return;const a=o.data.imagery;for(let e=a.length-1;e>=0;--e){const r=a[e],s=r.readyImagery;if(!Object(l.a)(s))continue;const c=s.imageryLayer.imageryProvider;if(n&&!Object(l.a)(c.pickFeatures))continue;if(!Be.contains(s.rectangle,t))continue;const u=QIe,d=1/1024;u.west=h.a.lerp(o.rectangle.west,o.rectangle.east,r.textureCoordinateRectangle.x-d),u.east=h.a.lerp(o.rectangle.west,o.rectangle.east,r.textureCoordinateRectangle.z+d),u.south=h.a.lerp(o.rectangle.south,o.rectangle.north,r.textureCoordinateRectangle.y-d),u.north=h.a.lerp(o.rectangle.south,o.rectangle.north,r.textureCoordinateRectangle.w+d),Be.contains(u,t)&&i(s)}}JIe.prototype.pickImageryLayers=function(e,t){const n=t.globe.pick(e,t);if(!Object(l.a)(n))return;const i=t.globe.ellipsoid.cartesianToCartographic(n),r=[];return ePe(t,i,!1,(function(e){r.push(e.imageryLayer)})),0!==r.length?r:void 0},JIe.prototype.pickImageryLayerFeatures=function(e,t){const n=t.globe.pick(e,t);if(!Object(l.a)(n))return;const i=t.globe.ellipsoid.cartesianToCartographic(n),r=[],o=[];return ePe(t,i,!0,(function(e){const t=e.imageryLayer.imageryProvider.pickFeatures(e.x,e.y,e.level,i.longitude,i.latitude);Object(l.a)(t)&&(r.push(t),o.push(e.imageryLayer))})),0!==r.length?Promise.all(r).then((function(e){const t=[];for(let n=0;n<e.length;++n){const r=e[n],a=o[n];if(Object(l.a)(r)&&r.length>0)for(let e=0;e<r.length;++e){const n=r[e];n.imageryLayer=a,Object(l.a)(n.position)||(n.position=i),t.push(n)}}return t})):void 0},JIe.prototype.queueReprojectionCommands=function(e){const t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)},JIe.prototype.cancelReprojections=function(){const e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()},JIe.prototype.isDestroyed=function(){return!1},JIe.prototype.destroy=function(){return this.removeAll(!0),sc(this)},JIe.prototype._update=function(){let e=!0;const t=this._layers;let n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(Object(l.a)(i._show)&&(Object(l.a)(n)||(n=[]),n.push(i)),i._show=i.show);if(Object(l.a)(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var tPe=JIe;function nPe(e){this._ellipsoid=new Rn(e.ellipsoid,O.ZERO)}Object.defineProperties(nPe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var iPe=nPe;function rPe(e){if(!Object(l.a)(e))throw new u.a("options is required.");if(!Object(l.a)(e.x))throw new u.a("options.x is required.");if(!Object(l.a)(e.y))throw new u.a("options.y is required.");if(e.x<0||e.y<0)throw new u.a("options.x and options.y must be greater than or equal to zero.");if(!Object(l.a)(e.level))throw new u.a("options.level is required and must be greater than or equal to zero.");if(!Object(l.a)(e.tilingScheme))throw new u.a("options.tilingScheme is required.");this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=xSe.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Qxe.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function oPe(e){Object(l.a)(e)&&e.freeResources()}rPe.createLevelZeroTiles=function(e){if(!Object(l.a)(e))throw new u.a("tilingScheme is required.");const t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n);let r=0;for(let o=0;o<n;++o)for(let n=0;n<t;++n)i[r++]=new rPe({tilingScheme:e,x:n,y:o,level:0});return i},rPe.prototype._updateCustomData=function(e,t,n){let i,r,o,a=this.customData;if(Object(l.a)(t)&&Object(l.a)(n)){for(a=a.filter((function(e){return-1===n.indexOf(e)})),this._customData=a,o=this._rectangle,i=0;i<t.length;++i)r=t[i],Be.contains(o,r.positionCartographic)&&a.push(r);this._frameUpdated=e}else{const e=this._parent;if(Object(l.a)(e)&&this._frameUpdated!==e._frameUpdated){a.length=0,o=this._rectangle;const t=e.customData;for(i=0;i<t.length;++i)r=t[i],Be.contains(o,r.positionCartographic)&&a.push(r);this._frameUpdated=e._frameUpdated}}},Object.defineProperties(rPe.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return Object(l.a)(this._southwestChild)||(this._southwestChild=new rPe({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return Object(l.a)(this._southeastChild)||(this._southeastChild=new rPe({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return Object(l.a)(this._northwestChild)||(this._northwestChild=new rPe({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return Object(l.a)(this._northeastChild)||(this._northeastChild=new rPe({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<Qxe.DONE}},eligibleForUnloading:{get:function(){let e=!0;return Object(l.a)(this.data)&&(e=this.data.eligibleForUnloading,Object(l.a)(e)||(e=!0)),e}}}),rPe.prototype.findLevelZeroTile=function(e,t,n){const i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter((function(e){return e.x===t&&e.y===n}))[0]},rPe.prototype.findTileToWest=function(e){const t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;const n=t.findTileToWest(e);return void 0!==n?t.southwestChild===this?n.southeastChild:n.northeastChild:void 0},rPe.prototype.findTileToEast=function(e){const t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;const n=t.findTileToEast(e);return void 0!==n?t.southeastChild===this?n.southwestChild:n.northwestChild:void 0},rPe.prototype.findTileToSouth=function(e){const t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;const n=t.findTileToSouth(e);return void 0!==n?t.southwestChild===this?n.northwestChild:n.northeastChild:void 0},rPe.prototype.findTileToNorth=function(e){const t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;const n=t.findTileToNorth(e);return void 0!==n?t.northwestChild===this?n.southwestChild:n.southeastChild:void 0},rPe.prototype.freeResources=function(){this.state=Qxe.START,this.renderable=!1,this.upsampledFromParent=!1,Object(l.a)(this.data)&&Object(l.a)(this.data.freeResources)&&this.data.freeResources(),oPe(this._southwestChild),this._southwestChild=void 0,oPe(this._southeastChild),this._southeastChild=void 0,oPe(this._northwestChild),this._northwestChild=void 0,oPe(this._northeastChild),this._northeastChild=void 0};var aPe=rPe;function sPe(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function cPe(e,t){const n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}sPe.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},sPe.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&Object(l.a)(this._lastBeforeStartOfFrame)&&this.count>e&&Object(l.a)(t);){n=t!==this._lastBeforeStartOfFrame;const e=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),cPe(this,t)),t=e}},sPe.prototype.markTileRendered=function(e){const t=this.head;if(t!==e){if(++this.count,!Object(l.a)(t))return e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,void(this.tail=e);(Object(l.a)(e.replacementPrevious)||Object(l.a)(e.replacementNext))&&cPe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e}else e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext)};var lPe=sPe;function uPe(e){if(!Object(l.a)(e)||!Object(l.a)(e.tileProvider))throw new u.a("options.tileProvider is required.");if(Object(l.a)(e.tileProvider.quadtree))throw new u.a("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};const t=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new lPe,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=Object(c.a)(e.maximumScreenSpaceError,2),this.tileCacheSize=Object(c.a)(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new iPe({ellipsoid:t}),this._tileLoadProgressEvent=new un.a,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function hPe(e){const t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}let dPe;Object.defineProperties(uPe.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),uPe.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},uPe.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;Object(l.a)(t);)t.state!==Qxe.START&&e(t),t=t.replacementNext},uPe.prototype.forEachRenderedTile=function(e){const t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])},uPe.prototype.updateHeight=function(e,t){const n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t,removeFunc:function(){const e=n._addHeightCallbacks,t=e.length;for(let n=0;n<t;++n)if(e[n]===i){e.splice(n,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)}};return n._addHeightCallbacks.push(i),i.removeFunc},uPe.prototype.update=function(e){Object(l.a)(this._tileProvider.update)&&this._tileProvider.update(e)},uPe.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(!function(e){const t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,hPe(e);const n=e._levelZeroTiles;if(Object(l.a)(n))for(let t=0;t<n.length;++t){const i=n[t].customData,r=i.length;for(let t=0;t<r;++t){const n=i[t];n.level=0,e._addHeightCallbacks.push(n)}n[t].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),hPe(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},uPe.prototype.render=function(e){const t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),function(e,t){const n=e._debug;if(n.suspendLodUpdate)return;let i;e._tilesToRender.length=0;const r=e._tileProvider;if(!Object(l.a)(e._levelZeroTiles)){if(!r.ready)return;{const t=r.tilingScheme;e._levelZeroTiles=aPe.createLevelZeroTiles(t);const n=e._levelZeroTiles.length;if(gPe.length<n)for(gPe=new Array(n),i=0;i<n;++i)void 0===gPe[i]&&(gPe[i]=new yPe)}}let o;e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;const a=e._levelZeroTiles,s=a.length>1?e._occluders:void 0;dPe=t.camera.positionCartographic,a.sort(pPe);const c=e._addHeightCallbacks,u=e._removeHeightCallbacks,h=t.frameNumber;let d;if(c.length>0||u.length>0){for(i=0,d=a.length;i<d;++i)o=a[i],o._updateCustomData(h,c,u);c.length=0,u.length=0}const f=t.camera;e._cameraPositionCartographic=f.positionCartographic;const p=Me.getTranslation(f.transform,mPe);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(p,e._cameraReferenceFrameOriginCartographic),i=0,d=a.length;i<d;++i)o=a[i],e._tileReplacementQueue.markTileRendered(o),o.renderable?wPe(e,o,r,t,s,!1,gPe[i]):(_Pe(e,e._tileLoadQueueHigh,o,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}(this,e),function(e,t){const n=e._tileProvider,i=e._tilesToRender;for(let e=0,r=i.length;e<r;++e){const r=i[e];n.showTileThisFrame(r,t)}}(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)},uPe.prototype.endFrame=function(e){e.passes.render&&e.mode!==AB.MORPHING&&(function(e,t){const n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(0===n.length&&0===i.length&&0===r.length)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);const o=Xf()+e._loadQueueTimeSlice,a=e._tileProvider;let s=TPe(e,t,a,o,n,!1);s=TPe(e,t,a,o,i,s),TPe(e,t,a,o,r,s)}(this,e),function(e,t){if(!e.tileProvider.ready)return;const n=IPe;n.length=0;const i=e._tileToUpdateHeights,r=Xf(),o=e._updateHeightsTimeSlice,a=r+o,s=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid;let h;for(;i.length>0;){const t=i[0];if(!Object(l.a)(t.data)||!Object(l.a)(t.data.mesh)){const r=t._lastSelectionResultFrame===e._lastSelectionFrameNumber?t._lastSelectionResult:xSe.NONE;r!==xSe.RENDERED&&r!==xSe.CULLED_BUT_NEEDED||n.push(t),i.shift(),e._lastTileIndex=0;continue}const r=t.customData,o=r.length;let d=!1;for(h=e._lastTileIndex;h<o;++h){const e=r[h],n=t.data.terrainData,i=Object(l.a)(n)&&n.wasCreatedByUpsampling();if(t.level>e.level&&!i){if(Object(l.a)(e.positionOnEllipsoidSurface)||(e.positionOnEllipsoidSurface=O.fromRadians(e.positionCartographic.longitude,e.positionCartographic.latitude,0,u)),s===AB.SCENE3D){const n=u.geodeticSurfaceNormal(e.positionOnEllipsoidSurface,CPe.direction),i=u.getSurfaceNormalIntersectionWithZAxis(e.positionOnEllipsoidSurface,11500,CPe.origin);if(!Object(l.a)(i)){let i=0;Object(l.a)(t.data.tileBoundingRegion)&&(i=t.data.tileBoundingRegion.minimumHeight);const r=Math.min(i,-11500),o=O.multiplyByScalar(n,Math.abs(r)+1,SPe);O.subtract(e.positionOnEllipsoidSurface,o,CPe.origin)}}else R.clone(e.positionCartographic,xPe),xPe.height=-11500,c.project(xPe,SPe),O.fromElements(SPe.z,SPe.x,SPe.y,SPe),O.clone(SPe,CPe.origin),O.clone(O.UNIT_X,CPe.direction);const n=t.data.pick(CPe,s,c,!1,SPe);Object(l.a)(n)&&(Object(l.a)(e.callback)&&e.callback(n),e.level=t.level)}if(Xf()>=a){d=!0;break}}if(d){e._lastTileIndex=h;break}e._lastTileIndex=0,i.shift()}for(h=0;h<n.length;h++)i.push(n[h])}(this,e),function(e,t){const n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;(n!==e._lastTileLoadQueueLength||e._tilesInvalidated)&&(t.afterRender.push(un.a.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n)),e._lastTileLoadQueueLength=n);const i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce((function(e,t){return Math.max(e,t.level)}),-1),i.tilesRendered=e._tilesToRender.length,i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren&&i.maxDepthVisited===i.lastMaxDepthVisited||(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}(this,e))},uPe.prototype.isDestroyed=function(){return!1},uPe.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};const fPe=new R;function pPe(e,t){let n=Be.center(e.rectangle,fPe);const i=n.longitude-dPe.longitude,r=n.latitude-dPe.latitude;n=Be.center(t.rectangle,fPe);const o=n.longitude-dPe.longitude,a=n.latitude-dPe.latitude;return i*i+r*r-(o*o+a*a)}const mPe=new O;let gPe=[];function _Pe(e,t,n,i){n.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function yPe(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function bPe(){this.southwest=new yPe,this.southeast=new yPe,this.northwest=new yPe,this.northeast=new yPe}bPe.prototype.combine=function(e){const t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};const vPe=new Array(31);for(let e=0;e<vPe.length;++e)vPe[e]=new bPe;function OPe(e,t,n,i,r){const o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);const a=function(e,t,n){if(t.mode===AB.SCENE2D||t.camera.frustum instanceof nv||t.camera.frustum instanceof Qb)return function(e,t,n){let i=t.camera.frustum;Object(l.a)(i._offCenterFrustum)&&(i=i._offCenterFrustum);const r=t.context,o=r.drawingBufferWidth,a=r.drawingBufferHeight,s=e._tileProvider.getLevelMaximumGeometricError(n.level),c=Math.max(i.top-i.bottom,i.right-i.left)/Math.max(o,a);let u=s/c;t.fog.enabled&&t.mode!==AB.SCENE2D&&(u-=h.a.fog(n._distance,t.fog.density)*t.fog.sse);return u/=t.pixelRatio,u}(e,t,n);const i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator;let s=i*o/(r*a);t.fog.enabled&&(s-=h.a.fog(r,t.fog.density)*t.fog.sse);return s/=t.pixelRatio,s}(e,t,n)<e.maximumScreenSpaceError,s=n.southwestChild,c=n.southeastChild,u=n.northwestChild,d=n.northeastChild,f=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===f?n._lastSelectionResult:xSe.NONE,m=e.tileProvider;if(a||i){const o=xSe.originalResult(p)===xSe.RENDERED,s=xSe.originalResult(p)===xSe.CULLED||p===xSe.NONE,c=n.state===Qxe.DONE;let u=o||s||c;if(u||Object(l.a)(m.canRenderWithoutLosingDetail)&&(u=m.canRenderWithoutLosingDetail(n)),u)return a&&_Pe(e,e._tileLoadQueueMedium,n,t),APe(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===xSe.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=xSe.RENDERED,void(r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n));i=!0,a&&_Pe(e,e._tileLoadQueueHigh,n,t)}if(m.canRefine(n)){if(s.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&d.upsampledFromParent)return APe(e,n),_Pe(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(d),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===xSe.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=xSe.RENDERED,void(r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n));n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=xSe.REFINED;const a=e._tilesToRender.length,l=e._tileLoadQueueLow.length,h=e._tileLoadQueueMedium.length,f=e._tileLoadQueueHigh.length,m=e._tileToUpdateHeights.length;if(function(e,t,n,i,r,o,a,s){const c=o.camera.positionCartographic,l=e._tileProvider,u=e._occluders,h=vPe[t.level],d=h.southwest,f=h.southeast,p=h.northwest,m=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(wPe(e,t,l,o,u,a,d),wPe(e,n,l,o,u,a,f),wPe(e,i,l,o,u,a,p),wPe(e,r,l,o,u,a,m)):(wPe(e,i,l,o,u,a,p),wPe(e,t,l,o,u,a,d),wPe(e,r,l,o,u,a,m),wPe(e,n,l,o,u,a,f)):c.latitude<t.rectangle.north?(wPe(e,n,l,o,u,a,f),wPe(e,t,l,o,u,a,d),wPe(e,r,l,o,u,a,m),wPe(e,i,l,o,u,a,p)):(wPe(e,r,l,o,u,a,m),wPe(e,i,l,o,u,a,p),wPe(e,n,l,o,u,a,f),wPe(e,t,l,o,u,a,d));h.combine(s)}(e,s,c,u,d,t,i,r),a!==e._tilesToRender.length){const i=r.allAreRenderable,s=r.anyWereRenderedLastFrame,c=r.notYetRenderableCount;let u=!1;if(!i&&!s){const i=e._tilesToRender;for(let e=a;e<i.length;++e){let t=i[e];for(;void 0!==t&&t._lastSelectionResult!==xSe.KICKED&&t!==n;)t._lastSelectionResult=xSe.kick(t._lastSelectionResult),t=t.parent}e._tilesToRender.length=a,e._tileToUpdateHeights.length=m,APe(e,n),n._lastSelectionResult=xSe.RENDERED;const s=p===xSe.RENDERED;!s&&c>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=l,e._tileLoadQueueMedium.length=h,e._tileLoadQueueHigh.length=f,_Pe(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,u=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=s,s||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!u&&_Pe(e,e._tileLoadQueueLow,n,t)}}else n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=xSe.RENDERED,APe(e,n),_Pe(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===xSe.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function wPe(e,t,n,i,r,o,a){if(n.computeTileVisibility(t,i,r)!==xE.NONE)return OPe(e,i,t,o,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,function(e,t){const n=t.rectangle;return Object(l.a)(e._cameraPositionCartographic)&&Be.contains(n,e._cameraPositionCartographic)||Object(l.a)(e._cameraReferenceFrameOriginCartographic)&&Be.contains(n,e._cameraReferenceFrameOriginCartographic)}(e,t)){Object(l.a)(t.data)&&Object(l.a)(t.data.vertexArray)||_Pe(e,e._tileLoadQueueMedium,t,i);const n=e._lastSelectionFrameNumber,r=t._lastSelectionResultFrame===n?t._lastSelectionResult:xSe.NONE;r!==xSe.CULLED_BUT_NEEDED&&r!==xSe.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=xSe.CULLED_BUT_NEEDED}else e.preloadSiblings||0===t.level?(_Pe(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=xSe.CULLED):t._lastSelectionResult=xSe.CULLED;t._lastSelectionResultFrame=i.frameNumber}function APe(e,t){e._tilesToRender.push(t)}function EPe(e,t){return e._loadPriority-t._loadPriority}function TPe(e,t,n,i,r,o){void 0!==n.computeTileLoadPriority&&r.sort(EPe);for(let a=0,s=r.length;a<s&&(Xf()<i||!o);++a){const i=r[a];e._tileReplacementQueue.markTileRendered(i),n.loadTile(t,i),o=!0}return o}const CPe=new Gn,xPe=new R,SPe=new O,IPe=[];var PPe=uPe;function DPe(e){e=Object(c.a)(e,H.WGS84);const t=new Vb({ellipsoid:e}),n=new tPe;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Zxe,this._material=void 0,this._surface=new PPe({tileProvider:new YIe({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new un.a,this._undergroundColor=sp.clone(sp.BLACK),this._undergroundColorAlphaByDistance=new TE(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new KIe,RPe(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Tt.a({url:Lt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new O(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new O(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=TB.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0}function RPe(e){const t=[],n=Object(l.a)(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[Yxe,Xxe];!Object(l.a)(e._material)||n&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.materialUniformMap=void 0:(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms),i.push(qxe),e._surfaceShaderSet.baseVertexShaderSource=new UN({sources:[Yxe,Xxe,Wxe],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new UN({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}Object.defineProperties(DPe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return!Object(l.a)(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){Object(l.a)(e)||(e=Be.clone(Be.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),Object(l.a)(this._material)&&RPe(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,RPe(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=sp.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(Object(l.a)(e)&&e.far<e.near)throw new u.a("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=TE.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});const jPe=[],MPe={start:0,stop:0};DPe.prototype.pickWorldCoordinates=function(e,t,n,i){if(!Object(l.a)(e))throw new u.a("ray is required");if(!Object(l.a)(t))throw new u.a("scene is required");n=Object(c.a)(n,!0);const r=t.mode,o=t.mapProjection,a=jPe;a.length=0;const s=this._surface._tilesToRender;let h,d,f=s.length;for(d=0;d<f;++d){h=s[d];const t=h.data;if(!Object(l.a)(t))continue;let n=t.pickBoundingSphere;if(r!==AB.SCENE3D)t.pickBoundingSphere=n=At.fromRectangleWithHeights2D(h.rectangle,o,t.tileBoundingRegion.minimumHeight,t.tileBoundingRegion.maximumHeight,n),O.fromElements(n.center.z,n.center.x,n.center.y,n.center);else{if(!Object(l.a)(t.renderedMesh))continue;At.clone(t.tileBoundingRegion.boundingSphere,n)}const i=vi.raySphere(e,n,MPe);Object(l.a)(i)&&a.push(t)}var p;let m;for(a.sort((p=e.origin,function(e,t){return At.distanceSquaredTo(e.pickBoundingSphere,p)-At.distanceSquaredTo(t.pickBoundingSphere,p)})),f=a.length,d=0;d<f&&(m=a[d].pick(e,t.mode,t.mapProjection,n,i),!Object(l.a)(m));++d);return m};const LPe=new R;DPe.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),Object(l.a)(n)&&t.mode!==AB.SCENE3D){n=O.fromElements(n.y,n.z,n.x,n);const e=t.mapProjection.unproject(n,LPe);n=t.globe.ellipsoid.cartographicToCartesian(e,n)}return n};const NPe=new O,BPe=new O,FPe=new R,zPe=new Gn;function kPe(e,t){return Object(l.a)(e)&&Be.contains(e.rectangle,t)?e:void 0}DPe.prototype.getHeight=function(e){if(!Object(l.a)(e))throw new u.a("cartographic is required");const t=this._surface._levelZeroTiles;if(!Object(l.a)(t))return;let n,i;const r=t.length;for(i=0;i<r&&(n=t[i],!Be.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;Object(l.a)(n);)n=kPe(n._southwestChild,e)||kPe(n._southeastChild,e)||kPe(n._northwestChild,e)||n._northeastChild,Object(l.a)(n)&&Object(l.a)(n.data)&&Object(l.a)(n.data.renderedMesh)&&(o=n);if(n=o,!Object(l.a)(n)||!Object(l.a)(n.data)||!Object(l.a)(n.data.renderedMesh))return;const a=this._surface._tileProvider.tilingScheme.projection,s=this._surface._tileProvider.tilingScheme.ellipsoid,h=O.fromRadians(e.longitude,e.latitude,0,s,NPe),d=zPe,f=s.geodeticSurfaceNormal(h,d.direction),p=s.getSurfaceNormalIntersectionWithZAxis(h,11500,d.origin);if(!Object(l.a)(p)){let e;Object(l.a)(n.data.tileBoundingRegion)&&(e=n.data.tileBoundingRegion.minimumHeight);const t=Math.min(Object(c.a)(e,0),-11500),i=O.multiplyByScalar(f,Math.abs(t)+1,BPe);O.subtract(h,i,d.origin)}const m=n.data.pick(d,void 0,a,!1,BPe);return Object(l.a)(m)?s.cartesianToCartographic(m,FPe).height:void 0},DPe.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},DPe.prototype.beginFrame=function(e){const t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=this.showWaterEffect&&i.ready&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;const t=this._oceanNormalMapResource,n=t.url;if(Object(l.a)(n)){const i=this;t.fetchImage().then((function(t){n===i._oceanNormalMapResource.url&&(i._oceanNormalMap=i._oceanNormalMap&&i._oceanNormalMap.destroy(),i._oceanNormalMap=new JD({context:e.context,source:t}))}))}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}const o=e.passes,a=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=a===AB.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))},DPe.prototype.render=function(e){this.show&&(Object(l.a)(this._material)&&this._material.update(e.context),this._surface.render(e))},DPe.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},DPe.prototype.isDestroyed=function(){return!1},DPe.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),sc(this)};var UPe=DPe,VPe="uniform sampler2D colorTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    gl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n",HPe="uniform highp sampler2D u_depthTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n";function GPe(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new h$({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new h$({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new h$,this._tempCopyDepthFramebuffer=new h$,this._updateDepthFramebuffer=new h$({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Nl,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}function qPe(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;const o=!Nl.equals(e._viewport,r.viewport);let a=o!==e._useScissorTest;e._useScissorTest=o,Nl.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Nl.clone(r.viewport,e._scissorRectangle),a=!0),Object(l.a)(e._rs)&&Nl.equals(e._viewport,e._rs.viewport)&&!a||(e._rs=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:SD.ALPHA_BLEND}),e._rsUpdate=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:UF.EQUAL,frontOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},backFunction:UF.NEVER,reference:qF.CESIUM_3D_TILE_MASK,mask:qF.CESIUM_3D_TILE_MASK}})),Object(l.a)(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(HPe,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,Object(l.a)(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(VPe,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,Object(l.a)(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(HPe,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,Object(l.a)(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(VPe,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,Object(l.a)(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new UU({color:new sp(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Object.defineProperties(GPe.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}}),GPe.prototype.update=function(e,t,n,i,r,o){const a=n.width,s=n.height,c=r?e.halfFloatingPointTexture?rT.HALF_FLOAT:rT.FLOAT:rT.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,a,s):this._outputFramebuffer.update(e,a,s,i,c),this._copyDepthFramebuffer.update(e,a,s),qPe(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=o},GPe.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)},GPe.prototype.executeCopyDepth=function(e,t){Object(l.a)(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())},GPe.prototype.executeUpdateDepth=function(e,t,n,i){const r=Object(l.a)(i)?i:t.framebuffer.depthStencilTexture;if(n||r!==this.colorFramebufferManager.getDepthStencilTexture()){if(Object(l.a)(this._updateDepthCommand)){if(!Object(l.a)(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==r||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){const n=this._copyDepthFramebuffer.getColorTexture().width,i=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,n,i);const o=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(o,0),this._updateDepthFramebuffer.setDepthStencilTexture(r),this._updateDepthFramebuffer.update(e,n,i),qPe(this,e,n,i,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}}else Object(l.a)(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},GPe.prototype.executeCopyColor=function(e,t){Object(l.a)(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},GPe.prototype.clear=function(e,t,n){const i=this._clearGlobeColorCommand;Object(l.a)(i)&&(sp.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))},GPe.prototype.isDestroyed=function(){return!1},GPe.prototype.destroy=function(){var e;return(e=this)._pickColorFramebuffer.destroy(),e._outputFramebuffer.destroy(),e._copyDepthFramebuffer.destroy(),e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer.destroy(),Object(l.a)(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),Object(l.a)(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),Object(l.a)(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),Object(l.a)(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),sc(this)};var WPe=GPe;function YPe(){this._framebuffer=new h$({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new h$,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Nl,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(YPe.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}}),YPe.prototype.updateAndClear=function(e,t,n,i){const r=t.width,o=t.height;!function(e,t,n,i,r){const o=r?t.halfFloatingPointTexture?rT.HALF_FLOAT:rT.FLOAT:rT.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}(this,n,r,o,e),function(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;const o=!Nl.equals(e._viewport,r.viewport);let a=o!==e._useScissorTest;e._useScissorTest=o,Nl.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=Nl.clone(r.viewport,e._scissorRectangle),a=!0),Object(l.a)(e._renderState)&&Nl.equals(e._viewport,e._renderState.viewport)&&!a||(e._renderState=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),Object(l.a)(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(HPe,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),Object(l.a)(e._clearCommand)||(e._clearCommand=new UU({color:new sp(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}(this,n,r,o,i),this._useHdr=e},YPe.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)},YPe.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture},YPe.prototype.isDestroyed=function(){return!1},YPe.prototype.destroy=function(){var e;return(e=this)._framebuffer.destroy(),e._packedDepthFramebuffer.destroy(),sc(this)};var XPe=YPe;const KPe=0,JPe=1,ZPe=2,$Pe=3,QPe=4,eDe=5,tDe=6,nDe=7,iDe=8,rDe=9,oDe=10,aDe=11,sDe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function cDe(){this._frontFaceAlphaByDistance=new TE(0,1,0,1),this._backFaceAlphaByDistance=new TE(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=Be.clone(Be.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(aDe),this._derivedBlendCommandTypes=new Array(aDe),this._derivedPickCommandTypes=new Array(aDe),this._derivedCommandTypesToUpdate=new Array(aDe),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}function lDe(e,t,n,i){return e?Object(l.a)(n)?(TE.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function uDe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function hDe(e,t,n,i,r){let o=0;const a=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!a)return o;const c=t.cameraUnderground,l=e._requiresManualDepthTest,u=i?rDe:l?nDe:eDe,h=i?oDe:l?iDe:tDe;return t.mode===AB.SCENE2D?(r[o++]=ZPe,r[o++]=u,o):(s?(n||(r[o++]=QPe),c?(r[o++]=u,r[o++]=h):(r[o++]=h,r[o++]=u)):c?(n||(r[o++]=$Pe),r[o++]=KPe,r[o++]=h):(n||(r[o++]=ZPe),r[o++]=JPe,r[o++]=u),o)}function dDe(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function fDe(e,t){return e.indexOf(t)>-1}function pDe(e,t){dDe(e.defines,"TRANSLUCENT"),dDe(t.defines,"TRANSLUCENT")}function mDe(e,t){dDe(e.defines,"GROUND_ATMOSPHERE"),dDe(t.defines,"GROUND_ATMOSPHERE"),dDe(e.defines,"FOG"),dDe(t.defines,"FOG"),dDe(e.defines,"TRANSLUCENT"),dDe(t.defines,"TRANSLUCENT")}function gDe(e,t){if(fDe(t.defines,"TILE_LIMIT_RECTANGLE")||fDe(t.defines,"ENABLE_CLIPPING_PLANES"))return;t.sources=["void main() \n{ \n    gl_FragColor = vec4(1.0); \n} \n"]}function _De(e,t){const n=t.sources,i=n.length;for(let e=0;e<i;++e)n[e]=UN.replaceMain(n[e],"czm_globe_translucency_main");n.push("\n\nuniform sampler2D u_classificationTexture; \nvoid main() \n{ \n    vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n#ifdef MANUAL_DEPTH_TEST \n    float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st)); \n    if (logDepthOrDepth != 0.0) \n    { \n        vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \n        float depthEC = eyeCoordinate.z / eyeCoordinate.w; \n        if (v_positionEC.z < depthEC) \n        { \n            discard; \n        } \n    } \n#endif \n    czm_globe_translucency_main(); \n    vec4 classificationColor = texture2D(u_classificationTexture, st); \n    if (classificationColor.a > 0.0) \n    { \n        // Reverse premultiplication process to get the correct composited result of the classification primitives \n        classificationColor.rgb /= classificationColor.a; \n    } \n    gl_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + gl_FragColor * (1.0 - classificationColor.a); \n} \n")}function yDe(e,t){_De(0,t),dDe(e.defines,"GROUND_ATMOSPHERE"),dDe(t.defines,"GROUND_ATMOSPHERE"),dDe(e.defines,"FOG"),dDe(t.defines,"FOG")}function bDe(e,t){_De(0,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function vDe(e,t){yDe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function ODe(e,t){t.sources=["uniform sampler2D u_classificationTexture; \nvoid main() \n{ \n    vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n    vec4 pickColor = texture2D(u_classificationTexture, st); \n    if (pickColor == vec4(0.0)) \n    { \n        discard; \n    } \n    gl_FragColor = pickColor; \n} \n"]}function wDe(e,t,n,i,r,o){if(!Object(l.a)(r))return t;if(!i&&Object(l.a)(n))return n;let a=e.shaderCache.getDerivedShaderProgram(t,o);if(!Object(l.a)(a)){const n=t._attributeLocations,i=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();i.defines=Object(l.a)(i.defines)?i.defines.slice(0):[],s.defines=Object(l.a)(s.defines)?s.defines.slice(0):[],r(i,s),a=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:i,fragmentShaderSource:s,attributeLocations:n})}return a}function ADe(e){e.cull.face=PD.BACK,e.cull.enabled=!0}function EDe(e){e.cull.face=PD.FRONT,e.cull.enabled=!0}function TDe(e){e.cull.face=PD.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function CDe(e){e.cull.face=PD.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function xDe(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function SDe(e){e.cull.face=PD.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=SD.ALPHA_BLEND}function IDe(e){e.cull.face=PD.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=SD.ALPHA_BLEND}function PDe(e){e.cull.face=PD.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function DDe(e){e.cull.face=PD.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function RDe(e,t,n,i,r){if(!Object(l.a)(i))return e;if(!n&&Object(l.a)(t))return t;let o=r[e.id];if(!Object(l.a)(o)){const t=vj.getState(e);i(t),o=vj.fromCache(t),r[e.id]=o}return o}function jDe(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function MDe(e,t,n,i,r){return Object(l.a)(r)?!i&&Object(l.a)(n)?n:Object(up.a)(t,r(e),!1):t}function LDe(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}Object.defineProperties(cDe.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}}),cDe.prototype.update=function(e){const t=e.globe;if(!Object(l.a)(t)||!t.show)return this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,void(this._useDepthPlane=!1);this._frontFaceAlphaByDistance=lDe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=lDe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=uDe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=uDe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=function(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==AB.SCENE2D&&t.context.depthTexture}(this,e,t),this._sunVisibleThroughGlobe=function(e,t){const n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}(this,e),this._environmentVisible=function(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}(this,e),this._useDepthPlane=function(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}(this,e),this._numberOfTextureUniforms=function(e){let t=0;e._frontFaceTranslucent&&++t;e._requiresManualDepthTest&&++t;return t}(this),this._rectangle=Be.clone(t.translucency.rectangle,this._rectangle),function(e,t){let n;e._derivedCommandsLength=hDe(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=hDe(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=hDe(e,t,!1,!0,e._derivedPickCommandTypes);let i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<aDe;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;const o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!Object(l.a)(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=[new LDe({pass:KR.GLOBE,pickOnly:!1,getShaderProgramFunction:pDe,getRenderStateFunction:ADe,getUniformMapFunction:void 0}),new LDe({pass:KR.GLOBE,pickOnly:!1,getShaderProgramFunction:mDe,getRenderStateFunction:EDe,getUniformMapFunction:void 0}),new LDe({pass:KR.GLOBE,pickOnly:!1,getShaderProgramFunction:gDe,getRenderStateFunction:TDe,getUniformMapFunction:void 0}),new LDe({pass:KR.GLOBE,pickOnly:!1,getShaderProgramFunction:gDe,getRenderStateFunction:CDe,getUniformMapFunction:void 0}),new LDe({pass:KR.GLOBE,pickOnly:!1,getShaderProgramFunction:gDe,getRenderStateFunction:xDe,getUniformMapFunction:void 0}),new LDe({pass:KR.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:_De,getRenderStateFunction:SDe,getUniformMapFunction:jDe}),new LDe({pass:KR.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:yDe,getRenderStateFunction:IDe,getUniformMapFunction:jDe}),new LDe({pass:KR.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:bDe,getRenderStateFunction:SDe,getUniformMapFunction:jDe}),new LDe({pass:KR.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vDe,getRenderStateFunction:IDe,getUniformMapFunction:jDe}),new LDe({pass:KR.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:ODe,getRenderStateFunction:PDe,getUniformMapFunction:jDe}),new LDe({pass:KR.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:ODe,getRenderStateFunction:DDe,getUniformMapFunction:jDe})])}(this,e)};const NDe=new Array(aDe),BDe=new Array(aDe);function FDe(e,t,n,i,r,o,a){for(let s=0;s<t;++s){const t=e[s],c=t.derivedCommands.type;(!Object(l.a)(a)||a.indexOf(c)>-1)&&n(t,i,r,o)}}function zDe(e,t,n,i,r,o){for(let a=0;a<t;++a)n(e[a],i,r,o)}cDe.prototype.updateDerivedCommands=function(e,t){const n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(0!==i){for(let e=0;e<i;++e)BDe[e]=this._derivedCommandPacks[n[e]],NDe[e]=sDe[n[e]];!function(e,t,n,i,r,o,a){let s=t.derivedCommands.globeTranslucency;const u=e._derivedCommandsDirty;if(t.dirty||!Object(l.a)(s)||u){t.dirty=!1,Object(l.a)(s)||(s={},t.derivedCommands.globeTranslucency=s);const u=a.frameNumber,h=Object(c.a)(s.uniformMapDirtyFrame,0),d=Object(c.a)(s.shaderProgramDirtyFrame,0),f=Object(c.a)(s.renderStateDirtyFrame,0),p=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,g=s.renderStateId!==t.renderState.id;p&&(s.uniformMapDirtyFrame=u),m&&(s.shaderProgramDirtyFrame=u),g&&(s.renderStateDirtyFrame=u),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(let _=0;_<n;++_){const n=o[_],y=i[_],b=r[_];let v,O,w,A=s[b];Object(l.a)(A)?(v=A.uniformMap,O=A.shaderProgram,w=A.renderState):(v=void 0,O=void 0,w=void 0),A=XR.shallowClone(t,A),s[b]=A;const E=Object(c.a)(A.derivedCommands.uniformMapDirtyFrame,0),T=Object(c.a)(A.derivedCommands.shaderProgramDirtyFrame,0),C=Object(c.a)(A.derivedCommands.renderStateDirtyFrame,0),x=p||E<h,S=m||T<d,I=g||C<f;x&&(A.derivedCommands.uniformMapDirtyFrame=u),S&&(A.derivedCommands.shaderProgramDirtyFrame=u),I&&(A.derivedCommands.renderStateDirtyFrame=u),A.derivedCommands.type=y,A.pass=n.pass,A.pickOnly=n.pickOnly,A.uniformMap=MDe(e,t.uniformMap,v,x,n.getUniformMapFunction),A.shaderProgram=wDe(a.context,t.shaderProgram,O,S,n.getShaderProgramFunction,b),A.renderState=RDe(t.renderState,w,I,n.getRenderStateFunction,n.renderStateCache)}}}(this,e,i,n,NDe,BDe,t)}},cDe.prototype.pushDerivedCommands=function(e,t,n){const i=n.passes.pick;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),0===o)return void n.commandList.push(e);const a=e.derivedCommands.globeTranslucency;for(let e=0;e<o;++e){const t=sDe[r[e]];n.commandList.push(a[t])}};const kDe=[KPe,JPe],UDe=[ZPe,$Pe,QPe];cDe.prototype.executeGlobeCommands=function(e,t,n,i,r){const o=i.context,a=e.commands[KR.GLOBE],s=e.indices[KR.GLOBE];0!==s&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),FDe(a,s,t,i,o,r,kDe))},cDe.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){const o=i.context,a=e.commands[KR.GLOBE],s=e.indices[KR.GLOBE],c=e.commands[KR.TERRAIN_CLASSIFICATION],l=e.indices[KR.TERRAIN_CLASSIFICATION];if(0===s||0===l)return;const u=this._frontFaceTranslucent,h=this._backFaceTranslucent;if(u&&h||zDe(c,l,t,i,o,r),!u&&!h)return;this._globeTranslucencyFramebuffer=n;const d=o.uniformState.globeDepthTexture,f=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,FDe(a,s,t,i,o,r,UDe),o.depthTexture){const e=n.packDepth(o,r);o.uniformState.globeDepthTexture=e}zDe(c,l,t,i,o,r),o.uniformState.globeDepthTexture=d,r.framebuffer=f};var VDe=cDe;function HDe(){this._image=new Image}function GDe(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.url)&&!Object(l.a)(e.metadata))throw new u.a("options.url or options.metadata is required.");let t;if(this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,Object(l.a)(e.metadata))t=e.metadata;else{const n=Tt.a.createIfNeeded(e.url);t=new lO(n)}this._metadata=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Gt({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Be(-h.a.PI,-h.a.PI,h.a.PI,h.a.PI),ellipsoid:e.ellipsoid});let n=e.credit;"string"==typeof n&&(n=new ln(n)),this._credit=n,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,Object(l.a)(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new HDe),this._errorEvent=new un.a,this._ready=!1;const i=this;let r;this._readyPromise=t.readyPromise.then((function(e){if(!t.imageryPresent){const e=new ye.a(`The server ${t.url} doesn't have imagery`);return r=dl.reportError(r,i,i._errorEvent,e.message,void 0,void 0,void 0,e),Promise.reject(e)}return dl.reportSuccess(r),i._ready=e,e})).catch((function(e){return r=dl.reportError(r,i,i._errorEvent,e.message,void 0,void 0,void 0,e),Promise.reject(e)}))}HDe.prototype.isReady=function(){return!0},HDe.prototype.shouldDiscardImage=function(e){return e===this._image},Object.defineProperties(GDe.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){if(!this._ready)throw new u.a("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new u.a("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new u.a("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new u.a("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new u.a("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new u.a("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new u.a("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),GDe.prototype.getTileCredits=function(e,t,n){if(!this._ready)throw new u.a("getTileCredits must not be called before the imagery provider is ready.");const i=this._metadata,r=i.getTileInformation(e,t,n);if(Object(l.a)(r)){const e=i.providers[r.imageryProvider];if(Object(l.a)(e))return[e]}},GDe.prototype.requestImage=function(e,t,n,i){if(!this._ready)throw new u.a("requestImage must not be called before the imagery provider is ready.");const r=this._tileDiscardPolicy._image,o=this._metadata,a=lO.tileXYToQuadKey(e,t,n),s=o.getTileInformation(e,t,n);if(!Object(l.a)(s)){if(o.isValid(a)){const r=new zc.a({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});return void o.populateSubtree(e,t,n,r)}return Promise.resolve(r)}if(!s.hasImagery())return Promise.resolve(r);const c=function(e,t,n,i,r,o){const a=lO.tileXYToQuadKey(n,i,r);let s=t.imageryVersion;return s=Object(l.a)(s)&&s>0?s:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${a}-i.${s.toString()}`,request:o})}(this,s,e,t,n,i).fetchArrayBuffer();return Object(l.a)(c)?c.then((function(e){Yy(o.key,e);let t,n=new Uint8Array(e);const i=o.protoImagery;if(Object(l.a)(i)&&i||(t=function(e){if(e[6]==="JFIF".charCodeAt(0)&&e[7]==="JFIF".charCodeAt(1)&&e[8]==="JFIF".charCodeAt(2)&&e[9]==="JFIF".charCodeAt(3))return"image/jpeg";if(e[1]==="PNG".charCodeAt(0)&&e[2]==="PNG".charCodeAt(1)&&e[3]==="PNG".charCodeAt(2))return"image/png";return}(n)),!Object(l.a)(t)&&(!Object(l.a)(i)||i)){const e=function(e){const t=Zv.Reader.create(e),n=t.len,i={};for(;t.pos<n;){const e=t.uint32();let n;switch(e>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(n=i.copyrightIds,Object(l.a)(n)||(n=i.copyrightIds=[]),2==(7&e)){const e=t.uint32()+t.pos;for(;t.pos<e;)n.push(t.uint32())}else n.push(t.uint32());break;default:t.skipType(7&e)}}const r=i.imageType;if(Object(l.a)(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ye.a("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}const o=i.alphaType;Object(l.a)(o)&&0!==o&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha);return i}(n);t=e.imageType,n=e.imageData}return Object(l.a)(t)&&Object(l.a)(n)?rE({uint8Array:n,format:t,flipY:!0}):r})):void 0},GDe.prototype.pickFeatures=function(e,t,n,i,r){};var qDe=GDe;const WDe=new sp(1,1,1,.4),YDe=new sp(0,1,0,.05),XDe=new sp(0,.5,0,.2);function KDe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._tilingScheme=Object(l.a)(e.tilingScheme)?e.tilingScheme:new Gt({ellipsoid:e.ellipsoid}),this._cells=Object(c.a)(e.cells,8),this._color=Object(c.a)(e.color,WDe),this._glowColor=Object(c.a)(e.glowColor,YDe),this._glowWidth=Object(c.a)(e.glowWidth,6),this._backgroundColor=Object(c.a)(e.backgroundColor,XDe),this._errorEvent=new un.a,this._tileWidth=Object(c.a)(e.tileWidth,256),this._tileHeight=Object(c.a)(e.tileHeight,256),this._canvasSize=Object(c.a)(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=Promise.resolve(!0)}Object.defineProperties(KDe.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),KDe.prototype._drawGrid=function(e){const t=this._canvasSize;for(let n=0;n<=this._cells;++n){const i=1+n/this._cells*(t-1);e.moveTo(i,0),e.lineTo(i,t),e.moveTo(0,i),e.lineTo(t,i)}e.stroke()},KDe.prototype._createGridCanvas=function(){const e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;const t=this._canvasSize,n=e.getContext("2d"),i=this._backgroundColor.toCssColorString();n.fillStyle=i,n.fillRect(0,0,t,t);const r=this._glowColor.toCssColorString();n.strokeStyle=r,n.lineWidth=this._glowWidth,n.strokeRect(0,0,t,t),this._drawGrid(n),n.lineWidth=.5*this._glowWidth,n.strokeRect(0,0,t,t),this._drawGrid(n);const o=this._color.toCssColorString();return n.strokeStyle=o,n.lineWidth=2,n.strokeRect(0,0,t,t),n.lineWidth=1,this._drawGrid(n),e},KDe.prototype.getTileCredits=function(e,t,n){},KDe.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)},KDe.prototype.pickFeatures=function(e,t,n,i,r){};var JDe=KDe;function ZDe(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new h$({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new h$({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new UU({color:new sp(0,0,0,0),owner:this}),this._clearCommand=new UU({color:new sp(0,0,0,0),depth:1,stencil:0});const e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(ZDe.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),ZDe.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};const $De={depthMask:!1,stencilTest:{enabled:!0,frontFunction:UF.EQUAL,frontOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},backFunction:UF.NEVER,reference:0,mask:qF.CLASSIFICATION_MASK},blending:SD.ALPHA_BLEND},QDe={depthMask:!1,stencilTest:{enabled:!0,frontFunction:UF.NOT_EQUAL,frontOperation:{fail:HF.KEEP,zFail:HF.KEEP,zPass:HF.KEEP},backFunction:UF.NEVER,reference:0,mask:qF.CLASSIFICATION_MASK},blending:SD.ALPHA_BLEND},eRe={depthMask:!0,depthTest:{enabled:!0},stencilTest:qF.setCesium3DTileBit(),stencilMask:qF.CESIUM_3D_TILE_MASK,blending:SD.ALPHA_BLEND};ZDe.prototype.update=function(e,t,n){const i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;const o=this._numSamples!==t,a=e.drawingBufferWidth,s=e.drawingBufferHeight,c=!Object(l.a)(i)||i.width!==a||i.height!==s;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),Object(l.a)(this._previousFramebuffer)||(this._depthStencilTexture=new JD({context:e,width:a,height:s,pixelFormat:aT.DEPTH_STENCIL,pixelDatatype:rT.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new l$({context:e,width:a,height:s,format:s$.DEPTH24_STENCIL8,numSamples:t})))),!Object(l.a)(this._fbo.framebuffer)||c||r||o){let i,r;this._fbo.destroy(),this._fboClassified.destroy(),Object(l.a)(this._previousFramebuffer)?(i=n.getDepthStencilTexture(),r=n.getDepthStencilRenderbuffer()):(i=this._depthStencilTexture,r=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(i),Object(l.a)(r)&&this._fbo.setDepthStencilRenderbuffer(r),this._fbo.update(e,a,s,t),Object(l.a)(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(i),this._fboClassified.update(e,a,s))}if(Object(l.a)(this._rsUnclassified)||(this._rsUnclassified=vj.fromCache($De),this._rsClassified=vj.fromCache(QDe),this._rsDefault=vj.fromCache(eRe)),!Object(l.a)(this._unclassifiedCommand)||r||o){Object(l.a)(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());const t=Object(l.a)(this._previousFramebuffer)?"uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    vec4 color = texture2D(colorTexture, v_textureCoordinates);\n    if (color.a == 0.0)\n    {\n        discard;\n    }\n#ifdef UNCLASSIFIED\n    gl_FragColor = color * czm_invertClassificationColor;\n#else\n    gl_FragColor = color;\n#endif\n}\n":"#extension GL_EXT_frag_depth : enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    vec4 color = texture2D(colorTexture, v_textureCoordinates);\n    if (color.a == 0.0)\n    {\n        discard;\n    }\n    bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n    vec4 highlightColor = czm_invertClassificationColor;\n    if (isClassified)\n    {\n        discard;\n    }\n#else\n    vec4 highlightColor = vec4(1.0);\n    if (!isClassified)\n    {\n        discard;\n    }\n#endif\n    gl_FragColor = color * highlightColor;\n    gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\n}\n",n=new UN({defines:["UNCLASSIFIED"],sources:[t]}),i=new UN({sources:[t]});this._unclassifiedCommand=e.createViewportQuadCommand(n,{renderState:Object(l.a)(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(i,{renderState:Object(l.a)(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),Object(l.a)(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),Object(l.a)(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(VPe,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},ZDe.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)},ZDe.prototype.clear=function(e,t){Object(l.a)(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))},ZDe.prototype.executeClassified=function(e,t){if(!Object(l.a)(this._previousFramebuffer)){const n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)},ZDe.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},ZDe.prototype.isDestroyed=function(){return!1},ZDe.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),Object(l.a)(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),sc(this)};var tRe=ZDe;function nRe(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function iRe(e){if(Object(l.a)(e)&&e.length!==Kq.NUMBER_OF_JOB_TYPES)throw new u.a("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");const t=new Array(Kq.NUMBER_OF_JOB_TYPES);t[Kq.TEXTURE]=new nRe(Object(l.a)(e)?e[Kq.TEXTURE]:10),t[Kq.PROGRAM]=new nRe(Object(l.a)(e)?e[Kq.PROGRAM]:10),t[Kq.BUFFER]=new nRe(Object(l.a)(e)?e[Kq.BUFFER]:30);const n=t.length;let i,r=0;for(i=0;i<n;++i)r+=t[i].total;const o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}Object.defineProperties(nRe.prototype,{total:{get:function(){return this._total}}}),iRe.getTimestamp=Xf,Object.defineProperties(iRe.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),iRe.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},iRe.prototype.resetBudgets=function(){const e=this._budgets,t=e.length;for(let n=0;n<t;++n){const t=e[n];t.starvedLastFrame=t.starvedThisFrame,t.starvedThisFrame=!1,t.usedThisFrame=0,t.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},iRe.prototype.execute=function(e,t){const n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){const e=n.length;let t;for(t=0;t<e&&(o=n[t],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total)||o.starvedLastFrame);++t);if(t===e&&r)return!1;r&&(i.starvedThisFrame=!0)}const a=iRe.getTimestamp();e.execute();const s=iRe.getTimestamp()-a;return this._totalUsedThisFrame+=s,o?o.stolenFromMeThisFrame+=s:i.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var rRe=iRe;function oRe(){}Object.defineProperties(oRe.prototype,{color:{get:u.a.throwInstantiationError},intensity:{get:u.a.throwInstantiationError}});var aRe=oRe;const sRe=/\/$/,cRe=new ln('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function lRe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).styleId;if(!Object(l.a)(t))throw new u.a("options.styleId is required.");const n=e.accessToken;if(!Object(l.a)(n))throw new u.a("options.accessToken is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;const i=Tt.a.createIfNeeded(Object(c.a)(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;const r=Object(c.a)(e.tilesize,512);this._tilesize=r;const o=Object(c.a)(e.username,"mapbox");this._username=o;const a=Object(l.a)(e.scaleFactor)?"@2x":"";let s,h=i.getUrlComponent();sRe.test(h)||(h+="/"),h+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${a}`,i.url=h,i.setQueryParameters({access_token:n}),Object(l.a)(e.credit)?(s=e.credit,"string"==typeof s&&(s=new ln(s))):s=cRe,this._resource=i,this._imageryProvider=new NTe({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(lRe.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),lRe.prototype.getTileCredits=function(e,t,n){},lRe.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)},lRe.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)},lRe._defaultCredit=cRe;var uRe=lRe;function hRe(e){let t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).textureUrl;Object(l.a)(t)||(t=Lt("Assets/Textures/moonSmall.jpg")),this.show=Object(c.a)(e.show,!0),this.textureUrl=t,this._ellipsoid=Object(c.a)(e.ellipsoid,H.MOON),this.onlySunLighting=Object(c.a)(e.onlySunLighting,!0),this._ellipsoidPrimitive=new Sxe({radii:this.ellipsoid.radii,material:CR.fromType(CR.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new LA}Object.defineProperties(hRe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});const dRe=new ce,fRe=new ce,pRe=new O,mRe=[];hRe.prototype.update=function(e){if(!this.show)return;const t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;const n=e.time;Object(l.a)(ca.computeIcrfToFixedMatrix(n,dRe))||ca.computeTemeToPseudoFixedMatrix(n,dRe);const i=this._axes.evaluate(n,fRe);ce.transpose(i,i),ce.multiply(dRe,i,i);const r=pI.computeMoonPositionInEarthInertialFrame(n,pRe);ce.multiplyByVector(dRe,r,r),Me.fromRotationTranslation(i,r,t.modelMatrix);const o=e.commandList;return e.commandList=mRe,mRe.length=0,t.update(e),e.commandList=o,1===mRe.length?mRe[0]:void 0},hRe.prototype.isDestroyed=function(){return!1},hRe.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),sc(this)};var gRe=hRe;function _Re(e){}_Re.prototype.isReady=function(){return!0},_Re.prototype.shouldDiscardImage=function(e){return!1};var yRe=_Re,bRe="#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\n\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    if (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n    {\n#ifdef MRT\n        gl_FragData[0] = u_bgColor;\n        gl_FragData[1] = vec4(u_bgColor.a);\n#else\n        gl_FragColor = u_bgColor;\n#endif\n        return;\n    }\n    \n    discard;\n}\n",vRe="/**\n * Compositing for Weighted Blended Order-Independent Transparency. See:\n * - http://jcgt.org/published/0002/02/09/\n * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html\n */\n\nuniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    vec4 opaque = texture2D(u_opaque, v_textureCoordinates);\n    vec4 accum = texture2D(u_accumulation, v_textureCoordinates);\n    float r = texture2D(u_revealage, v_textureCoordinates).r;\n\n#ifdef MRT\n    vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\n    vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\n\n    gl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n\n    if (opaque != czm_backgroundColor)\n    {\n        gl_FragColor.a = 1.0;\n    }\n}\n";function ORe(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;const t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new h$({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new h$({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new h$({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new h$({createColorAttachments:!1}),this._opaqueClearCommand=new UU({color:new sp(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new UU({color:new sp(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new UU({color:new sp(0,0,0,0),owner:this}),this._alphaClearCommand=new UU({color:new sp(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Nl,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function wRe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function ARe(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function ERe(e){wRe(e),ARe(e)}ORe.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();const o=this._opaqueTexture.width,a=this._opaqueTexture.height,s=this._accumulationTexture,c=!Object(l.a)(s)||s.width!==o||s.height!==a||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,function(e,t,n,i){wRe(e),e._accumulationTexture=new JD({context:t,width:n,height:i,pixelFormat:aT.RGBA,pixelDatatype:rT.FLOAT});const r=new Float32Array(n*i*4);e._revealageTexture=new JD({context:t,pixelFormat:aT.RGBA,pixelDatatype:rT.FLOAT,source:{arrayBufferView:r,width:n,height:i},flipY:!1})}(this,e,o,a)),(!Object(l.a)(this._translucentFBO.framebuffer)||c||u)&&!function(e,t){ARe(e);const n=ps.FRAMEBUFFER_COMPLETE;let i=!0;const r=e._accumulationTexture.width,o=e._accumulationTexture.height;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),e._translucentFBO.status===n&&e._adjustTranslucentFBO.status===n||(ARe(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);const a=e._translucentFBO.status===n,s=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,l=e._adjustAlphaFBO.status===n;a&&s&&c&&l||(ERe(e),e._translucentMultipassSupport=!1,i=!1)}return i}(this,e))return;this._useHDR=i;const h=this;let d,f;Object(l.a)(this._compositeCommand)||(d=new UN({sources:[vRe]}),this._translucentMRTSupport&&d.defines.push("MRT"),f={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:f,owner:this})),Object(l.a)(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new UN({defines:["MRT"],sources:[bRe]}),f={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:f,owner:this})):this._translucentMultipassSupport&&(d=new UN({sources:[bRe]}),f={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:f,owner:this}),f={u_bgColor:function(){return h._alphaClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:f,owner:this}))),this._viewport.width=o,this._viewport.height=a;const p=!Nl.equals(this._viewport,t.viewport);let m=p!==this._useScissorTest;this._useScissorTest=p,Nl.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Nl.clone(t.viewport,this._scissorRectangle),m=!0),Object(l.a)(this._rs)&&Nl.equals(this._viewport,this._rs.viewport)&&!m||(this._rs=vj.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),Object(l.a)(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),Object(l.a)(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};const TRe={enabled:!0,color:new sp(0,0,0,0),equationRgb:ED.ADD,equationAlpha:ED.ADD,functionSourceRgb:CD.ONE,functionDestinationRgb:CD.ONE,functionSourceAlpha:CD.ZERO,functionDestinationAlpha:CD.ONE_MINUS_SOURCE_ALPHA},CRe={enabled:!0,color:new sp(0,0,0,0),equationRgb:ED.ADD,equationAlpha:ED.ADD,functionSourceRgb:CD.ONE,functionDestinationRgb:CD.ONE,functionSourceAlpha:CD.ONE,functionDestinationAlpha:CD.ONE},xRe={enabled:!0,color:new sp(0,0,0,0),equationRgb:ED.ADD,equationAlpha:ED.ADD,functionSourceRgb:CD.ZERO,functionDestinationRgb:CD.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:CD.ZERO,functionDestinationAlpha:CD.ONE_MINUS_SOURCE_ALPHA};function SRe(e,t,n,i){let r=n[i.id];if(!Object(l.a)(r)){const e=vj.getState(i);e.depthMask=!1,e.blending=t,r=vj.fromCache(e),n[i.id]=r}return r}function IRe(e,t,n,i){let r=e.shaderCache.getDerivedShaderProgram(t,n);if(!Object(l.a)(r)){const o=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map((function(e){return e=(e=(e=(e=UN.replaceMain(e,"czm_translucent_main")).replace(/gl_FragColor/g,"czm_gl_FragColor")).replace(/\bdiscard\b/g,"czm_discard = true")).replace(/czm_phong/g,"czm_translucentPhong")})),a.sources.splice(0,0,(-1!==i.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),a.sources.push(`void main()\n{\n    czm_translucent_main();\n    if (czm_discard)\n    {\n        discard;\n    }\n${i}}\n`),r=e.shaderCache.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:o})}return r}ORe.prototype.createDerivedCommands=function(e,t,n){if(Object(l.a)(n)||(n={}),this._translucentMRTSupport){let o,a;Object(l.a)(n.translucentCommand)&&(o=n.translucentCommand.shaderProgram,a=n.translucentCommand.renderState),n.translucentCommand=XR.shallowClone(e,n.translucentCommand),Object(l.a)(o)&&n.shaderProgramId===e.shaderProgram.id?(n.translucentCommand.shaderProgram=o,n.translucentCommand.renderState=a):(n.translucentCommand.shaderProgram=function(e,t){return IRe(e,t,"translucentMRT","    vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n    float ai = czm_gl_FragColor.a;\n    float wzi = czm_alphaWeight(ai);\n    gl_FragData[0] = vec4(Ci * wzi, ai);\n    gl_FragData[1] = vec4(ai * wzi);\n")}(t,e.shaderProgram),n.translucentCommand.renderState=(i=this,r=e.renderState,SRe(0,TRe,i._translucentRenderStateCache,r)),n.shaderProgramId=e.shaderProgram.id)}else{let i,r,o,a;Object(l.a)(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,a=n.alphaCommand.renderState),n.translucentCommand=XR.shallowClone(e,n.translucentCommand),n.alphaCommand=XR.shallowClone(e,n.alphaCommand),Object(l.a)(i)&&n.shaderProgramId===e.shaderProgram.id?(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=a):(n.translucentCommand.shaderProgram=function(e,t){return IRe(e,t,"translucentMultipass","    vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n    float ai = czm_gl_FragColor.a;\n    float wzi = czm_alphaWeight(ai);\n    gl_FragColor = vec4(Ci, ai) * wzi;\n")}(t,e.shaderProgram),n.translucentCommand.renderState=function(e,t,n){return SRe(0,CRe,e._translucentRenderStateCache,n)}(this,0,e.renderState),n.alphaCommand.shaderProgram=function(e,t){return IRe(e,t,"alphaMultipass","    float ai = czm_gl_FragColor.a;\n    gl_FragColor = vec4(ai);\n")}(t,e.shaderProgram),n.alphaCommand.renderState=function(e,t,n){return SRe(0,xRe,e._alphaRenderStateCache,n)}(this,0,e.renderState),n.shaderProgramId=e.shaderProgram.id)}var i,r;return n},ORe.prototype.executeCommands=function(e,t,n,i,r){this._translucentMRTSupport?function(e,t,n,i,r,o){const a=t.context,s=t.frameState.useLogDepth,c=t._hdr,u=i.framebuffer,h=r.length,d=t.frameState.shadowState.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i);const f=e._opaqueFBO.framebuffer;let p,m;i.framebuffer=e._translucentFBO.framebuffer;for(let e=0;e<h;++e)p=r[e],p=s?p.derivedCommands.logDepth.command:p,p=c?p.derivedCommands.hdr.command:p,m=d&&p.receiveShadows?p.derivedCommands.oit.shadows.translucentCommand:p.derivedCommands.oit.translucentCommand,n(m,t,a,i,f);Object(l.a)(o)&&(p=o.unclassifiedCommand,m=d&&p.receiveShadows?p.derivedCommands.oit.shadows.translucentCommand:p.derivedCommands.oit.translucentCommand,n(m,t,a,i,f)),i.framebuffer=u}(this,e,t,n,i,r):function(e,t,n,i,r,o){let a,s,c;const u=t.context,h=t.frameState.useLogDepth,d=t._hdr,f=i.framebuffer,p=r.length,m=t.frameState.shadowState.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(u,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(u,i);const g=e._opaqueFBO.framebuffer;for(i.framebuffer=e._translucentFBO.framebuffer,c=0;c<p;++c)a=r[c],a=h?a.derivedCommands.logDepth.command:a,a=d?a.derivedCommands.hdr.command:a,s=m&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,n(s,t,u,i,g);for(Object(l.a)(o)&&(a=o.unclassifiedCommand,s=m&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,n(s,t,u,i,g)),i.framebuffer=e._alphaFBO.framebuffer,c=0;c<p;++c)a=r[c],a=h?a.derivedCommands.logDepth.command:a,a=d?a.derivedCommands.hdr.command:a,s=m&&a.receiveShadows?a.derivedCommands.oit.shadows.alphaCommand:a.derivedCommands.oit.alphaCommand,n(s,t,u,i,g);Object(l.a)(o)&&(a=o.unclassifiedCommand,s=m&&a.receiveShadows?a.derivedCommands.oit.shadows.alphaCommand:a.derivedCommands.oit.alphaCommand,n(s,t,u,i,g)),i.framebuffer=f}(this,e,t,n,i,r)},ORe.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},ORe.prototype.clear=function(e,t,n){const i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,sp.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer;(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i},ORe.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},ORe.prototype.isDestroyed=function(){return!1},ORe.prototype.destroy=function(){return ERe(this),Object(l.a)(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),Object(l.a)(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),Object(l.a)(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),sc(this)};var PRe=ORe;const DRe=new ln("MapQuest, Open Street Map and contributors, CC-BY-SA");function RRe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Tt.a.createIfNeeded(Object(c.a)(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+="{z}/{x}/{y}."+Object(c.a)(e.fileExtension,"png");const n=new pl({ellipsoid:e.ellipsoid}),i=Object(c.a)(e.minimumLevel,0),r=e.maximumLevel,o=Object(c.a)(e.rectangle,n.rectangle),a=n.positionToTileXY(Be.southwest(o),i),s=n.positionToTileXY(Be.northeast(o),i),l=(Math.abs(s.x-a.x)+1)*(Math.abs(s.y-a.y)+1);if(l>4)throw new u.a(`The rectangle and minimumLevel indicate that there are ${l} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let h=Object(c.a)(e.credit,DRe);"string"==typeof h&&(h=new ln(h)),NTe.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:256,tileHeight:256,minimumLevel:i,maximumLevel:r,rectangle:o})}Object(l.a)(Object.create)&&(RRe.prototype=Object.create(NTe.prototype),RRe.prototype.constructor=RRe);var jRe=RRe;const MRe=new Vt(1,1);function LRe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.mass=Object(c.a)(e.mass,1),this.position=O.clone(Object(c.a)(e.position,O.ZERO)),this.velocity=O.clone(Object(c.a)(e.velocity,O.ZERO)),this.life=Object(c.a)(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=sp.clone(Object(c.a)(e.startColor,sp.WHITE)),this.endColor=sp.clone(Object(c.a)(e.endColor,sp.WHITE)),this.startScale=Object(c.a)(e.startScale,1),this.endScale=Object(c.a)(e.endScale,1),this.imageSize=Vt.clone(Object(c.a)(e.imageSize,MRe)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(LRe.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});const NRe=new O;LRe.prototype.update=function(e,t){return O.multiplyByScalar(this.velocity,e,NRe),O.add(this.position,NRe,this.position),Object(l.a)(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var BRe=LRe;function FRe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.time=Object(c.a)(e.time,0),this.minimum=Object(c.a)(e.minimum,0),this.maximum=Object(c.a)(e.maximum,50),this._complete=!1}Object.defineProperties(FRe.prototype,{complete:{get:function(){return this._complete}}});var zRe=FRe;function kRe(e){throw new u.a("This type should not be instantiated directly.  Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}kRe.prototype.emit=function(e){u.a.throwInstantiationError()};var URe=kRe;const VRe=new Vt(1,1);function HRe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.show=Object(c.a)(e.show,!0),this.updateCallback=e.updateCallback,this.loop=Object(c.a)(e.loop,!0),this.image=Object(c.a)(e.image,void 0);let t=e.emitter;Object(l.a)(t)||(t=new iEe(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this._emitterModelMatrix=Me.clone(Object(c.a)(e.emitterModelMatrix,Me.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new Me,this._startColor=sp.clone(Object(c.a)(e.color,Object(c.a)(e.startColor,sp.WHITE))),this._endColor=sp.clone(Object(c.a)(e.color,Object(c.a)(e.endColor,sp.WHITE))),this._startScale=Object(c.a)(e.scale,Object(c.a)(e.startScale,1)),this._endScale=Object(c.a)(e.scale,Object(c.a)(e.endScale,1)),this._emissionRate=Object(c.a)(e.emissionRate,5),this._minimumSpeed=Object(c.a)(e.speed,Object(c.a)(e.minimumSpeed,1)),this._maximumSpeed=Object(c.a)(e.speed,Object(c.a)(e.maximumSpeed,1)),this._minimumParticleLife=Object(c.a)(e.particleLife,Object(c.a)(e.minimumParticleLife,5)),this._maximumParticleLife=Object(c.a)(e.particleLife,Object(c.a)(e.maximumParticleLife,5)),this._minimumMass=Object(c.a)(e.mass,Object(c.a)(e.minimumMass,1)),this._maximumMass=Object(c.a)(e.mass,Object(c.a)(e.maximumMass,1)),this._minimumImageSize=Vt.clone(Object(c.a)(e.imageSize,Object(c.a)(e.minimumImageSize,VRe))),this._maximumImageSize=Vt.clone(Object(c.a)(e.imageSize,Object(c.a)(e.maximumImageSize,VRe))),this._sizeInMeters=Object(c.a)(e.sizeInMeters,!1),this._lifetime=Object(c.a)(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new un.a,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function GRe(e){let t=e._particlePool.pop();return Object(l.a)(t)||(t=new BRe),t}function qRe(e,t){e._particlePool.push(t)}function WRe(e){Object(l.a)(e._billboard)&&(e._billboard.show=!1)}function YRe(e,t){let n=t._billboard;Object(l.a)(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;const i=h.a.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=h.a.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=h.a.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=h.a.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new sp(i,r,o,a),n.scale=h.a.lerp(t.startScale,t.endScale,t.normalizedAge)}function XRe(e,t){t.startColor=sp.clone(e._startColor,t.startColor),t.endColor=sp.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=h.a.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=h.a.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=h.a.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=h.a.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;const n=h.a.randomBetween(e._minimumSpeed,e._maximumSpeed);O.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}Object.defineProperties(HRe.prototype,{emitter:{get:function(){return this._emitter},set:function(e){s.a.defined("value",e),this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){s.a.defined("value",e),this._matrixDirty=this._matrixDirty||!Me.equals(this._modelMatrix,e),Me.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){s.a.defined("value",e),this._matrixDirty=this._matrixDirty||!Me.equals(this._emitterModelMatrix,e),Me.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){s.a.defined("value",e),sp.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){s.a.defined("value",e),sp.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){s.a.typeOf.object("value",e),s.a.typeOf.number.greaterThanOrEquals("value.x",e.x,0),s.a.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){s.a.typeOf.object("value",e),s.a.typeOf.number.greaterThanOrEquals("value.x",e.x,0),s.a.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){s.a.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){s.a.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});const KRe=new O;HRe.prototype.update=function(e){if(!this.show)return;Object(l.a)(this._billboardCollection)||(this._billboardCollection=new x0),this._updateParticlePool&&(!function(e){const t=e._emissionRate,n=e._maximumParticleLife;let i=0;const r=e._bursts;if(Object(l.a)(r)){const e=r.length;for(let t=0;t<e;++t)i+=r[t].maximum}const o=e._billboardCollection,a=e.image,s=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,h=Math.max(s-c.length-u.length,0);for(let e=0;e<h;++e){const e=new BRe;e._billboard=o.add({image:a}),u.push(e)}e._particleEstimate=s}(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=tr.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);const n=this._particles,i=this._emitter,r=this.updateCallback;let o,a,s=n.length;for(o=0;o<s;++o)a=n[o],a.update(t,r)?YRe(this,a):(WRe(a),qRe(this,a),n[o]=n[s-1],--o,--s);n.length=s;const c=function(e,t){if(e._isComplete)return 0;const n=(t=h.a.mod(t,e._lifetime))*e._emissionRate;let i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),Object(l.a)(e.bursts)){const t=e.bursts.length;for(let n=0;n<t;n++){const t=e.bursts[n],r=e._currentTime;Object(l.a)(t)&&!t._complete&&r>t.time&&(i+=h.a.randomBetween(t.minimum,t.maximum),t._complete=!0)}}return i}(this,t);if(c>0&&Object(l.a)(i)){this._matrixDirty&&(this._combinedMatrix=Me.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);const e=this._combinedMatrix;for(o=0;o<c;o++)a=GRe(this),this._emitter.emit(a),O.add(a.position,a.velocity,KRe),Me.multiplyByPoint(e,KRe,KRe),a.position=Me.multiplyByPoint(e,a.position,a.position),O.subtract(KRe,a.position,a.velocity),O.normalize(a.velocity,a.velocity),XRe(this,a),YRe(this,a)}if(this._billboardCollection.update(e),this._previousTime=tr.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=h.a.mod(this._currentTime,this._lifetime),this.bursts){const e=this.bursts.length;for(o=0;o<e;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&function(e){const t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,a=e._particleEstimate,s=o-Math.max(a-r-o,0);for(let e=s;e<o;++e){const t=n[e];i.remove(t._billboard)}n.length=s}(this)},HRe.prototype.isDestroyed=function(){return!1},HRe.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),sc(this)};var JRe=HRe;function ZRe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=gye(e.container);if(!Object(l.a)(t))throw new u.a("container is required");this._container=t;const n=document.createElement("div");n.className="cesium-performanceDisplay";const i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);const r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Xf(),this._lastMsSampleTime=Xf(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;const o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(ZRe.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),ZRe.prototype.update=function(e){const t=Xf(),n=Object(c.a)(e,!0);this._fpsFrameCount++;const i=t-this._lastFpsSampleTime;if(i>1e3){let e="N/A";n&&(e=1e3*this._fpsFrameCount/i|0),this._fpsText.nodeValue=e+" FPS",this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;const r=t-this._lastMsSampleTime;if(r>200){let e="N/A";n&&(e=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=e+" MS",this._lastMsSampleTime=t,this._msFrameCount=0}},ZRe.prototype.destroy=function(){return sc(this)};var $Re=ZRe;function QRe(){this._framebuffer=new h$,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(QRe.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}}),QRe.prototype.update=function(e,t){!function(e,t,n){const i=n.width,r=n.height;e._framebuffer.update(t,i,r)}(this,e,t),function(e,t,n){if(!Object(l.a)(e._copyDepthCommand)){const n="uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";e._copyDepthCommand=t.createViewportQuadCommand(n,{renderState:vj.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}(this,e,t)};const eje=new _e,tje=new _e(1,1/255,1/65025,1/16581375);QRe.prototype.getDepth=function(e,t,n){if(!Object(l.a)(this.framebuffer))return;const i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=_e.unpack(i,0,eje);return _e.divideByScalar(r,255,r),_e.dot(r,tje)},QRe.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},QRe.prototype.isDestroyed=function(){return!1},QRe.prototype.destroy=function(){return this._framebuffer.destroy(),Object(l.a)(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=Object(l.a)(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),sc(this)};var nje=QRe;function ije(){this._framebuffer=new h$({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(ije.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}}),ije.prototype.update=function(e,t,n){const i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&function(e,t){const n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);const r=new Zbe(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new Nl},r.viewport=new Nl,e._passState=r}(this,e);const o=this.framebuffer,a=this._passState;return a.framebuffer=o,a.viewport.width=i,a.viewport.height=r,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=r-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a},ije.prototype.isDestroyed=function(){return!1},ije.prototype.destroy=function(){return this._framebuffer.destroy(),sc(this)};var rje=ije;function oje(e){const t=new Zbe(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Nl},t.viewport=new Nl,this._context=e,this._fb=new h$({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}oje.prototype.begin=function(e,t){const n=this._context,i=t.width,r=t.height;return Nl.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};const aje=new sp;oje.prototype.end=function(e){const t=Object(c.a)(e.width,1),n=Object(c.a)(e.height,1),i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.max(t,n),a=o*o,s=Math.floor(.5*t),u=Math.floor(.5*n);let h=0,d=0,f=0,p=-1;for(let e=0;e<a;++e){if(-s<=h&&h<=s&&-u<=d&&d<=u){const e=4*((u-d)*t+h+s);aje.red=sp.byteToFloat(r[e]),aje.green=sp.byteToFloat(r[e+1]),aje.blue=sp.byteToFloat(r[e+2]),aje.alpha=sp.byteToFloat(r[e+3]);const n=i.getObjectByPickColor(aje);if(Object(l.a)(n))return n}if(h===d||h<0&&-h===d||h>0&&h===1-d){const e=f;f=-p,p=e}h+=f,d+=p}},oje.prototype.isDestroyed=function(){return!1},oje.prototype.destroy=function(){return this._fb.destroy(),sc(this)};var sje=oje;function cje(){this._numSamples=1,this._colorFramebuffer=new h$({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new h$({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new sp(0,0,0,0),this._clearCommand=new UU({color:new sp(0,0,0,0),depth:1,owner:this})}Object.defineProperties(cje.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}}),cje.prototype.update=function(e,t,n,i){const r=t.width,o=t.height,a=n?e.halfFloatingPointTexture?rT.HALF_FLOAT:rT.FLOAT:rT.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,a),this._idFramebuffer.update(e,r,o)},cje.prototype.clear=function(e,t,n){sp.clone(n,this._clearCommand.color),sp.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)},cje.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer},cje.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer},cje.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)},cje.prototype.isDestroyed=function(){return!1},cje.prototype.destroy=function(){var e;return(e=this)._colorFramebuffer.destroy(),e._idFramebuffer.destroy(),sc(this)};var lje=cje;function uje(){}uje.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`},uje.createShadowCastVertexShader=function(e,t,n){const i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");const o=UN.findPositionVarying(e),a=Object(l.a)(o);if(t&&!a){const e=r.length;for(let t=0;t<e;++t)r[t]=UN.replaceMain(r[t],"czm_shadow_cast_main");const t="varying vec3 v_positionEC; \nvoid main() \n{ \n    czm_shadow_cast_main(); \n    v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";r.push(t)}return new UN({defines:i,sources:r})},uje.createShadowCastFragmentShader=function(e,t,n,i){const r=e.defines.slice(0),o=e.sources.slice(0);r.push("SHADOW_MAP");let a=UN.findPositionVarying(e);const s=Object(l.a)(a);s||(a="v_positionEC");const c=o.length;for(let e=0;e<c;++e)o[e]=UN.replaceMain(o[e],"czm_shadow_cast_main");let u="";return t&&(s||(u+="varying vec3 v_positionEC; \n"),u+="uniform vec4 shadowMap_lightPositionEC; \n"),u+=i?"void main() \n{ \n":"void main() \n{ \n    czm_shadow_cast_main(); \n    if (gl_FragColor.a == 0.0) \n    { \n       discard; \n    } \n",u+=t?`    float distance = length(${a}); \n    if (distance >= shadowMap_lightPositionEC.w) \n    { \n        discard; \n    } \n    distance /= shadowMap_lightPositionEC.w; // radius \n    gl_FragColor = czm_packDepth(distance); \n`:n?"    gl_FragColor = vec4(1.0); \n":"    gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",u+="} \n",o.push(u),new UN({defines:r,sources:o})},uje.getShadowReceiveShaderKeyword=function(e,t,n,i){return`receiveShadow ${e._usesDepthTexture}${e._polygonOffsetSupported}${e._isPointLight}${e._isSpotLight}${e._numberOfCascades>1}${e.debugCascadeColors}${e.softShadows}${t}${n}${i}`},uje.createShadowReceiveVertexShader=function(e,t,n){const i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new UN({defines:i,sources:r})},uje.createShadowReceiveFragmentShader=function(e,t,n,i,r){const o=UN.findNormalVarying(e),a=!i&&Object(l.a)(o)||i&&r,s=UN.findPositionVarying(e),c=Object(l.a)(s),u=t._usesDepthTexture,h=t._polygonOffsetSupported,d=t._isPointLight,f=t._isSpotLight,p=t._numberOfCascades>1,m=t.debugCascadeColors,g=t.softShadows,_=d?t._pointBias:i?t._terrainBias:t._primitiveBias,y=e.defines.slice(0),b=e.sources.slice(0),v=b.length;for(let e=0;e<v;++e)b[e]=UN.replaceMain(b[e],"czm_shadow_receive_main");d?y.push("USE_CUBE_MAP_SHADOW"):u&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!d&&y.push("USE_SOFT_SHADOWS"),p&&n&&i&&(a?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&a&&(y.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));let O,w="";return w+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",O=c?`    return vec4(${s}, 1.0); \n`:"#ifndef LOG_DEPTH \n    return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n    return vec4(v_logPositionEC, 1.0); \n#endif \n",w+=`uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n${O}} \nvec3 getNormalEC() \n{ \n${a?`    return normalize(${o}); \n`:"    return vec3(1.0); \n"}} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n${_.normalOffset&&a?"    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n    float normalOffsetScale = 1.0 - nDotL; \n    vec3 offset = normalOffset * normalOffsetScale * normalEC; \n    positionEC.xyz += offset; \n":""}} \n`,w+="void main() \n{ \n    czm_shadow_receive_main(); \n    vec4 positionEC = getPositionEC(); \n    vec3 normalEC = getNormalEC(); \n    float depth = -positionEC.z; \n",w+="    czm_shadowParameters shadowParameters; \n    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",i?w+="    shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(w+="    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),w+=d?"    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n    float distance = length(directionEC); \n    directionEC = normalize(directionEC); \n    float radius = shadowMap_lightPositionEC.w; \n    // Stop early if the fragment is beyond the point light radius \n    if (distance > radius) \n    { \n        return; \n    } \n    vec3 directionWC  = czm_inverseViewRotation * directionEC; \n    shadowParameters.depth = distance / radius; \n    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n    shadowParameters.texCoords = directionWC; \n    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":f?"    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    vec4 shadowPosition = shadowMap_matrix * positionEC; \n    // Spot light uses a perspective projection, so perform the perspective divide \n    shadowPosition /= shadowPosition.w; \n    // Stop early if the fragment is not in the shadow bounds \n    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n    { \n        return; \n    } \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?"    float maxDepth = shadowMap_cascadeSplits[1].w; \n    // Stop early if the eye depth exceeds the last cascade \n    if (depth > maxDepth) \n    { \n        return; \n    } \n    // Get the cascade based on the eye-space depth \n    vec4 weights = czm_cascadeWeights(depth); \n    // Apply normal offset \n    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    // Transform position into the cascade \n    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n    // Get visibility \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n    // Fade out shadows that are far away \n    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n    visibility = mix(visibility, 1.0, fade); \n"+(m?"    // Draw cascade colors for debugging \n    gl_FragColor *= czm_cascadeColor(weights); \n":""):"    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    vec4 shadowPosition = shadowMap_matrix * positionEC; \n    // Stop early if the fragment is not in the shadow bounds \n    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n    { \n        return; \n    } \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",w+="    gl_FragColor.rgb *= visibility; \n} \n",b.push(w),new UN({defines:y,sources:b})};var hje=uje;function dje(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).context;if(!Object(l.a)(t))throw new u.a("context is required.");if(!Object(l.a)(e.lightCamera))throw new u.a("lightCamera is required.");if(Object(l.a)(e.numberOfCascades)&&1!==e.numberOfCascades&&4!==e.numberOfCascades)throw new u.a("Only one or four cascades are supported.");this._enabled=Object(c.a)(e.enabled,!0),this._softShadows=Object(c.a)(e.softShadows,!1),this._normalOffset=Object(c.a)(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=Object(c.a)(e.fromLightSource,!0),this.darkness=Object(c.a)(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=Object(c.a)(e.fadingEnabled,!0),this.maximumDistance=Object(c.a)(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n,i=!0;(Jr.isInternetExplorer()||Jr.isEdge()||(Jr.isChrome()||Jr.isFirefox())&&Jr.isWindows()&&!t.depthTexture)&&(i=!1),this._polygonOffsetSupported=i,this._terrainBias={polygonOffset:i,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:i,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Me,this._shadowMapTexture=void 0,this._lightDirectionEC=new O,this._lightPositionEC=new _e,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new Sje,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new At,this._isPointLight=Object(c.a)(e.isPointLight,!1),this._pointLightRadius=Object(c.a)(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&Object(c.a)(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?Object(c.a)(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Vt,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Qb:Object(l.a)(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new _e,new _e],this._cascadeMatrices=[new Me,new Me,new Me,new Me],this._cascadeDistances=new _e,n=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(n);for(let e=0;e<n;++e)this._passes[e]=new fje(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,mje(this),this._clearCommand=new UU({depth:1,color:new sp}),this._clearPassState=new Zbe(t),this._size=Object(c.a)(e.size,2048),this.size=this._size}function fje(e){this.camera=new Sje,this.passState=new Zbe(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function pje(e,t){return vj.fromCache({cull:{enabled:!0,face:PD.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function mje(e){const t=!e._usesDepthTexture;e._primitiveRenderState=pje(t,e._primitiveBias),e._terrainRenderState=pje(t,e._terrainBias),e._pointRenderState=pje(t,e._pointBias)}function gje(e){const t=e._passes.length;for(let n=0;n<t;++n){const t=e._passes[n],i=t.framebuffer;Object(l.a)(i)&&!i.isDestroyed()&&i.destroy(),t.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function _je(e,t){e._isPointLight?function(e,t){const n=new l$({context:t,width:e._textureSize.x,height:e._textureSize.y,format:s$.DEPTH_COMPONENT16}),i=new XD({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,sampler:WD.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let i=0;i<6;++i){const o=new i$({context:t,depthRenderbuffer:n,colorTextures:[r[i]],destroyAttachments:!1}),a=e._passes[i];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}(e,t):e._usesDepthTexture?function(e,t){const n=new JD({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:aT.DEPTH_STENCIL,pixelDatatype:rT.UNSIGNED_INT_24_8,sampler:WD.NEAREST}),i=new i$({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let t=0;t<r;++t){const n=e._passes[t];n.framebuffer=i,n.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}(e,t):function(e,t){const n=new l$({context:t,width:e._textureSize.x,height:e._textureSize.y,format:s$.DEPTH_COMPONENT16}),i=new JD({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,sampler:WD.NEAREST}),r=new i$({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let t=0;t<o;++t){const n=e._passes[t];n.framebuffer=r,n.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}(e,t)}function yje(e,t){Object(l.a)(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(gje(e),_je(e,t),function(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ps.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,mje(e),gje(e),_je(e,t))}(e,t),bje(e,t))}function bje(e,t,n){n=Object(c.a)(n,0),(e._isPointLight||0===n)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}dje.MAXIMUM_DISTANCE=2e4,dje.prototype.debugCreateRenderStates=function(){mje(this)},Object.defineProperties(dje.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){!function(e,t){e._size=t;const n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=MD.maximumCubeMapSize>=t?t:MD.maximumCubeMapSize,r.x=t,r.y=t;const e=new Nl(0,0,t,t);n[0].passState.viewport=e,n[1].passState.viewport=e,n[2].passState.viewport=e,n[3].passState.viewport=e,n[4].passState.viewport=e,n[5].passState.viewport=e}else 1===i?(t=MD.maximumTextureSize>=t?t:MD.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new Nl(0,0,t,t)):4===i&&(t=MD.maximumTextureSize>=2*t?t:MD.maximumTextureSize/2,r.x=2*t,r.y=2*t,n[0].passState.viewport=new Nl(0,0,t,t),n[1].passState.viewport=new Nl(t,0,t,t),n[2].passState.viewport=new Nl(0,t,t,t),n[3].passState.viewport=new Nl(t,t,t,t));e._clearPassState.viewport=new Nl(0,0,r.x,r.y);for(let e=0;e<i;++e){const t=n[e],i=t.passState.viewport,o=i.x/r.x,a=i.y/r.y,s=i.width/r.x,c=i.height/r.y;t.textureOffsets=new Me(s,0,0,o,0,c,0,a,0,0,1,0,0,0,0,1)}}(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});const vje=new Nl;function Oje(e,t){const n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=.3*Math.min(i,r),a=vje;a.x=i-o,a.y=0,a.width=o,a.height=o;let s=e._debugShadowViewCommand;Object(l.a)(s)||(s=function(e,t){let n;n=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n    vec2 uv = v_textureCoordinates; \n    vec3 dir; \n \n    if (uv.y < 0.5) \n    { \n        if (uv.x < 0.333) \n        { \n            dir.x = -1.0; \n            dir.y = uv.x * 6.0 - 1.0; \n            dir.z = uv.y * 4.0 - 1.0; \n        } \n        else if (uv.x < 0.666) \n        { \n            dir.y = -1.0; \n            dir.x = uv.x * 6.0 - 3.0; \n            dir.z = uv.y * 4.0 - 1.0; \n        } \n        else \n        { \n            dir.z = -1.0; \n            dir.x = uv.x * 6.0 - 5.0; \n            dir.y = uv.y * 4.0 - 1.0; \n        } \n    } \n    else \n    { \n        if (uv.x < 0.333) \n        { \n            dir.x = 1.0; \n            dir.y = uv.x * 6.0 - 1.0; \n            dir.z = uv.y * 4.0 - 3.0; \n        } \n        else if (uv.x < 0.666) \n        { \n            dir.y = 1.0; \n            dir.x = uv.x * 6.0 - 3.0; \n            dir.z = uv.y * 4.0 - 3.0; \n        } \n        else \n        { \n            dir.z = 1.0; \n            dir.x = uv.x * 6.0 - 5.0; \n            dir.y = uv.y * 4.0 - 3.0; \n        } \n    } \n \n    float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n    gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":`uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n${e._usesDepthTexture?"    float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":"    float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n"}    gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n`;const i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=KR.OVERLAY,i}(e,n),e._debugShadowViewCommand=s),Object(l.a)(s.renderState)&&Nl.equals(s.renderState.viewport,a)||(s.renderState=vj.fromCache({viewport:Nl.clone(a)})),t.commandList.push(e._debugShadowViewCommand)}const wje=new Array(8);wje[0]=new _e(-1,-1,-1,1),wje[1]=new _e(1,-1,-1,1),wje[2]=new _e(1,1,-1,1),wje[3]=new _e(-1,1,-1,1),wje[4]=new _e(-1,-1,1,1),wje[5]=new _e(1,-1,1,1),wje[6]=new _e(1,1,1,1),wje[7]=new _e(-1,1,1,1);const Aje=new Me,Eje=new Array(8);for(let e=0;e<8;++e)Eje[e]=new _e;const Tje=[sp.RED,sp.GREEN,sp.BLUE,sp.MAGENTA],Cje=new O;function xje(e,t){Oje(e,t);const n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new YCe({camera:e._sceneCamera,color:sp.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new YCe({camera:e._shadowMapCamera,color:sp.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new YCe({camera:e._passes[i].camera,color:Tje[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!Object(l.a)(e._debugLightFrustum)||e._needsUpdate){const t=e._shadowMapCamera.positionWC,n=To.IDENTITY,i=2*e._pointLightRadius,r=O.fromElements(i,i,i,Cje),o=Me.fromTranslationQuaternionRotationScale(t,n,r,Aje);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=function(e,t){const n=new Ph({geometry:new gu({minimum:new O(-.5,-.5,-.5),maximum:new O(.5,.5,.5)}),attributes:{color:lp.fromColor(t)}}),i=new Ph({geometry:new SI({radius:.5}),attributes:{color:lp.fromColor(t)}});return new hF({geometryInstances:[n,i],appearance:new MR({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}(o,sp.YELLOW)}e._debugLightFrustum.update(t)}else Object(l.a)(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new YCe({camera:e._shadowMapCamera,color:sp.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function Sje(){this.viewMatrix=new Me,this.inverseViewMatrix=new Me,this.frustum=void 0,this.positionCartographic=new R,this.positionWC=new O,this.directionWC=O.clone(O.UNIT_Z),this.upWC=O.clone(O.UNIT_Y),this.rightWC=O.clone(O.UNIT_X),this.viewProjectionMatrix=new Me}Sje.prototype.clone=function(e){Me.clone(e.viewMatrix,this.viewMatrix),Me.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),R.clone(e.positionCartographic,this.positionCartographic),O.clone(e.positionWC,this.positionWC),O.clone(e.directionWC,this.directionWC),O.clone(e.upWC,this.upWC),O.clone(e.rightWC,this.rightWC)};const Ije=new Me(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);Sje.prototype.getViewProjection=function(){const e=this.viewMatrix,t=this.frustum.projectionMatrix;return Me.multiply(t,e,this.viewProjectionMatrix),Me.multiply(Ije,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};const Pje=new Array(5),Dje=new dv,Rje=new Array(4),jje=new O,Mje=new O;const Lje=new Me,Nje=new O,Bje=new O,Fje=new O;const zje=[new O(-1,0,0),new O(0,-1,0),new O(0,0,-1),new O(1,0,0),new O(0,1,0),new O(0,0,1)],kje=[new O(0,-1,0),new O(0,0,-1),new O(0,-1,0),new O(0,-1,0),new O(0,0,1),new O(0,-1,0)],Uje=[new O(0,0,1),new O(1,0,0),new O(-1,0,0),new O(0,0,-1),new O(1,0,0),new O(1,0,0)];const Vje=new O,Hje=new O,Gje=new At,qje=Gje.center;function Wje(e,t){const n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?O.clone(i.directionWC,o.directionWC):e._isPointLight?O.clone(i.positionWC,o.positionWC):o.clone(i);const a=e._lightDirectionEC;let s,c;Me.multiplyByPointAsVector(n.viewMatrix,o.directionWC,a),O.normalize(a,a),O.negate(a,a),Me.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,e._fitNearFar?(s=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,s+1)):(s=n.frustum.near,c=e.maximumDistance),e._sceneCamera=LAe.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=s,e._sceneCamera.frustum.far=c,e._distance=c-s,function(e,t){const n=e._sceneCamera,i=e._shadowMapCamera,r=Gje;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);const r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Vje),o=O.negate(i.directionWC,Hje),a=O.dot(r,o);if(e.fadingEnabled){const t=h.a.clamp(a/.1,0,1);e._darkness=h.a.lerp(1,e.darkness,t)}else e._darkness=e.darkness;if(a<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===W.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),At.clone(r,e._boundingSphere);else{const n=i.frustum.far/2,o=O.add(i.positionWC,O.multiplyByScalar(i.directionWC,n,qje),qje);r.center=o,r.radius=n,e._outOfView=t.cullingVolume.computeVisibility(r)===W.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),At.clone(r,e._boundingSphere)}}(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}dje.prototype.update=function(e){if(Wje(this,e),this._needsUpdate)if(yje(this,e.context),this._isPointLight&&function(e,t){const n=new dv;n.fov=h.a.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){const r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=zje[i],r.upWC=kje[i],r.rightWC=Uje[i],Me.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),Me.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}(this,e),this._cascadesEnabled&&(function(e,t){const n=e._shadowMapCamera,i=e._sceneCamera,r=Me.multiply(i.frustum.projectionMatrix,i.viewMatrix,Aje),o=Me.inverse(r,Aje),a=n.directionWC;let s=i.directionWC;O.equalsEpsilon(a,s,h.a.EPSILON10)&&(s=i.upWC);const c=O.cross(a,s,Nje);s=O.cross(c,a,Bje),O.normalize(s,s),O.normalize(c,c);const l=O.fromElements(0,0,0,Fje);let u=Me.computeView(l,a,s,c,Lje);const d=Me.multiply(u,o,Aje),f=O.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,jje),p=O.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Mje);for(let e=0;e<8;++e){const t=_e.clone(wje[e],Eje[e]);Me.multiplyByVector(d,t,t),O.divideByScalar(t,t.w,t),O.minimumByComponent(t,f,f),O.maximumByComponent(t,p,p)}p.z+=1e3,f.z-=10;const m=Fje;m.x=-.5*(f.x+p.x),m.y=-.5*(f.y+p.y),m.z=-p.z;const g=Me.fromTranslation(m,Aje);u=Me.multiply(g,u,u);const _=.5*(p.x-f.x),y=.5*(p.y-f.y),b=p.z-f.z,v=n.frustum;v.left=-_,v.right=_,v.bottom=-y,v.top=y,v.near=.01,v.far=b,Me.clone(u,n.viewMatrix),Me.inverse(u,n.inverseViewMatrix),Me.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),O.clone(a,n.directionWC),O.clone(s,n.upWC),O.clone(c,n.rightWC)}(this,e),this._numberOfCascades>1&&function(e,t){const n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,a=e._numberOfCascades;let s;const c=o-r,l=o/r;let u=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,u=.9);const f=Rje,p=Pje;for(p[0]=r,p[a]=o,s=0;s<a;++s){const e=(s+1)/a,t=r*Math.pow(l,e),n=r+c*e,i=h.a.lerp(n,t,u);p[s+1]=i,f[s]=i-p[s]}if(d){for(s=0;s<a;++s)f[s]=Math.min(f[s],e._maximumCascadeDistances[s]);let t=p[0];for(s=0;s<a-1;++s)t+=f[s],p[s+1]=t}_e.unpack(p,0,e._cascadeSplits[0]),_e.unpack(p,1,e._cascadeSplits[1]),_e.unpack(f,0,e._cascadeDistances);const m=n.frustum,g=m.left,_=m.right,y=m.bottom,b=m.top,v=m.near,w=m.far,A=n.positionWC,E=n.directionWC,T=n.upWC,C=i.frustum.clone(Dje),x=n.getViewProjection();for(s=0;s<a;++s){C.near=p[s],C.far=p[s+1];const t=Me.multiply(C.projectionMatrix,i.viewMatrix,Aje),r=Me.inverse(t,Aje),o=Me.multiply(x,r,Aje),a=O.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,jje),c=O.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Mje);for(let e=0;e<8;++e){const t=_e.clone(wje[e],Eje[e]);Me.multiplyByVector(o,t,t),O.divideByScalar(t,t.w,t),O.minimumByComponent(t,a,a),O.maximumByComponent(t,c,c)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0),a.z=0,c.x=Math.min(c.x,1),c.y=Math.min(c.y,1),c.z=Math.min(c.z,1);const l=e._passes[s],u=l.camera;u.clone(n);const h=u.frustum;h.left=g+a.x*(_-g),h.right=g+c.x*(_-g),h.bottom=y+a.y*(b-y),h.top=y+c.y*(b-y),h.near=v+a.z*(w-v),h.far=v+c.z*(w-v),l.cullingVolume=u.frustum.computeCullingVolume(A,E,T);const d=e._cascadeMatrices[s];Me.multiply(u.getViewProjection(),i.inverseViewMatrix,d),Me.multiply(l.textureOffsets,d,d)}}(this,e)),this._isPointLight)this._shadowMapCullingVolume=xy.fromBoundingSphere(this._boundingSphere);else{const e=this._shadowMapCamera,t=e.positionWC,n=e.directionWC,i=e.upWC;this._shadowMapCullingVolume=e.frustum.computeCullingVolume(t,n,i),1===this._passes.length&&this._passes[0].camera.clone(e)}if(1===this._passes.length){const e=this._sceneCamera.inverseViewMatrix;Me.multiply(this._shadowMapCamera.getViewProjection(),e,this._shadowMapMatrix)}this.debugShow&&xje(this,e)},dje.prototype.updatePass=function(e,t){bje(this,e,t)};const Yje=new Vt;function Xje(e,t,n){const i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){const t=Yje;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,_e.fromElements(t.x,t.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return _e.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new _e,combinedUniforms2:new _e};return Object(up.a)(t,r,!1)}function Kje(e,t,n,i,r,o){let a,s,c;if(Object(l.a)(o)&&(a=o.shaderProgram,s=o.renderState,c=o.uniformMap),(o=XR.shallowClone(n,o)).castShadows=!0,o.receiveShadows=!1,!Object(l.a)(a)||r!==n.shaderProgram.id||t){const t=n.shaderProgram,r=n.pass===KR.GLOBE,o=n.pass!==KR.TRANSLUCENT,u=e._isPointLight,h=e._usesDepthTexture,d=hje.getShadowCastShaderKeyword(u,r,h,o);if(a=i.shaderCache.getDerivedShaderProgram(t,d),!Object(l.a)(a)){const e=t.vertexShaderSource,n=t.fragmentShaderSource,s=hje.createShadowCastVertexShader(e,u,r),c=hje.createShadowCastFragmentShader(n,u,h,o);a=i.shaderCache.createDerivedShaderProgram(t,d,{vertexShaderSource:s,fragmentShaderSource:c,attributeLocations:t._attributeLocations})}s=e._primitiveRenderState,u?s=e._pointRenderState:r&&(s=e._terrainRenderState);n.renderState.cull.enabled||(s=Object(Zf.a)(s,!1),s.cull=Object(Zf.a)(s.cull,!1),s.cull.enabled=!1,s=vj.fromCache(s)),c=Xje(e,n.uniformMap,r)}return o.shaderProgram=a,o.renderState=s,o.uniformMap=c,o}dje.createReceiveDerivedCommand=function(e,t,n,i,r){Object(l.a)(r)||(r={});const o=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,c=a.fragmentShaderSource,u=t.pass===KR.GLOBE;let h=!1;if(u&&(h=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let o,d;Object(l.a)(r.receiveCommand)&&(o=r.receiveCommand.shaderProgram,d=r.receiveCommand.uniformMap),r.receiveCommand=XR.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;const f=r.receiveShaderCastShadows!==t.castShadows,p=r.receiveShaderProgramId!==t.shaderProgram.id;if(!Object(l.a)(o)||p||n||f){const n=hje.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,h);if(o=i.shaderCache.getDerivedShaderProgram(a,n),!Object(l.a)(o)){const r=hje.createShadowReceiveVertexShader(s,u,h),l=hje.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,h);o=i.shaderCache.createDerivedShaderProgram(a,n,{vertexShaderSource:r,fragmentShaderSource:l,attributeLocations:a._attributeLocations})}d=Xje(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=o,r.receiveCommand.uniformMap=d,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r},dje.createCastDerivedCommand=function(e,t,n,i,r){if(Object(l.a)(r)||(r={}),t.castShadows){let o=r.castCommands;Object(l.a)(o)||(o=r.castCommands=[]);const a=r.castShaderProgramId,s=e.length;o.length=s;for(let r=0;r<s;++r)o[r]=Kje(e[r],n,t,i,a,o[r]);r.castShaderProgramId=t.shaderProgram.id}return r},dje.prototype.isDestroyed=function(){return!1},dje.prototype.destroy=function(){gje(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return sc(this)};var Jje=dje,Zje="uniform sampler2D u_opaqueDepthTexture;\nuniform sampler2D u_translucentDepthTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    float opaqueDepth = texture2D(u_opaqueDepthTexture, v_textureCoordinates).r;\n    float translucentDepth = texture2D(u_translucentDepthTexture, v_textureCoordinates).r;\n    translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);\n    gl_FragColor = czm_packDepth(translucentDepth);\n}\n",$je="uniform sampler2D colorTexture;\n\n#ifdef DEBUG_SHOW_DEPTH\nuniform sampler2D u_packedTranslucentDepth;\n#endif\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n#ifdef DEBUG_SHOW_DEPTH\n    if (v_textureCoordinates.x < 0.5)\n    {\n        gl_FragColor.rgb = vec3(czm_unpackDepth(texture2D(u_packedTranslucentDepth, v_textureCoordinates)));\n        gl_FragColor.a = 1.0;\n    }\n#else\n    vec4 color = texture2D(colorTexture, v_textureCoordinates);\n\n#ifdef PICK\n    if (color == vec4(0.0))\n    {\n        discard;\n    }\n#else\n    // Reverse premultiplication process to get the correct composited result of the classification primitives\n    color.rgb /= color.a;\n#endif\n    gl_FragColor = color;\n#endif\n}\n";function Qje(e){this._drawClassificationFBO=new h$({createDepthAttachments:!1}),this._accumulationFBO=new h$({createDepthAttachments:!1}),this._packFBO=new h$,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new UU({color:new sp(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new UU({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Nl,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}function eMe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function tMe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function nMe(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;const r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;let a,s;if(e._drawClassificationFBO.isDirty(r,o)&&(function(e,t,n,i){eMe(e),e._translucentDepthStencilTexture=new JD({context:t,width:n,height:i,pixelFormat:aT.DEPTH_STENCIL,pixelDatatype:rT.UNSIGNED_INT_24_8,sampler:WD.NEAREST})}(e,t,r,o),function(e,t,n,i){tMe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}(e,t,r,o)),Object(l.a)(e._packDepthCommand)||(a=new UN({sources:[Zje]}),s={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),!Object(l.a)(e._compositeCommand)){a=new UN({sources:[$je]}),s={colorTexture:function(){return e._textureToComposite}},e._compositeCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e});const n=e._compositeCommand,i=n.shaderProgram,r=t.shaderCache.createDerivedShaderProgram(i,"pick",{vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:new UN({sources:a.sources,defines:["PICK"]}),attributeLocations:i._attributeLocations}),o=XR.shallowClone(n);o.shaderProgram=r,n.derivedCommands.pick=o}Object(l.a)(e._copyCommand)||(a=new UN({sources:[$je]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),Object(l.a)(e._accumulateCommand)||(a=new UN({sources:[$je]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),e._viewport.width=r,e._viewport.height=o;const c=!Nl.equals(e._viewport,n.viewport);let u=c!==e._useScissorTest;e._useScissorTest=c,Nl.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Nl.clone(n.viewport,e._scissorRectangle),u=!0),Object(l.a)(e._rsDepth)&&Nl.equals(e._viewport,e._rsDepth.viewport)&&!u||(e._rsDepth=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),Object(l.a)(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),Object(l.a)(e._rsAccumulate)&&Nl.equals(e._viewport,e._rsAccumulate.viewport)&&!u||(e._rsAccumulate=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:UF.EQUAL,reference:qF.CESIUM_3D_TILE_MASK}})),Object(l.a)(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),Object(l.a)(e._rsComp)&&Nl.equals(e._viewport,e._rsComp.viewport)&&!u||(e._rsComp=vj.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:SD.ALPHA_BLEND})),Object(l.a)(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Object.defineProperties(Qje.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}}),Qje.prototype.executeTranslucentCommands=function(e,t,n,i,r){const o=i.length;let a,s;const c=e.frameState.useLogDepth,l=e.context,u=n.framebuffer;for(s=0;s<o;++s)if(a=i[s],a=c?a.derivedCommands.logDepth.command:a,a.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(nMe(this,l,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(l,n),s=0;s<o;++s){if(a=i[s],a=c?a.derivedCommands.logDepth.command:a,!a.depthForTranslucentClassification)continue;t(a.derivedCommands.depth.depthOnlyCommand,e,l,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(l,n)),n.framebuffer=u}},Qje.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;const r=e.context,o=r.uniformState,a=n.framebuffer;2===this._frustumsDrawn&&(n.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(r,n)),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(KR.CESIUM_3D_TILE_CLASSIFICATION);const s=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();const c=i.commands[KR.CESIUM_3D_TILE_CLASSIFICATION],l=i.indices[KR.CESIUM_3D_TILE_CLASSIFICATION];for(let i=0;i<l;++i)t(c[i],e,r,n);o.globeDepthTexture=s,n.framebuffer=a,1!==this._frustumsDrawn&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=a)},Qje.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;1===this._frustumsDrawn?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture();(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),function(e,t,n){if(!e._hasTranslucentDepth)return;const i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n));e._hasTranslucentDepth=!1,e._frustumsDrawn=0}(this,e,t)},Qje.prototype.isSupported=function(){return this._supported},Qje.prototype.isDestroyed=function(){return!1},Qje.prototype.destroy=function(){return eMe(this),tMe(this),Object(l.a)(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),Object(l.a)(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),sc(this)};var iMe=Qje;function rMe(){this.command=void 0,this.near=void 0,this.far=void 0}function oMe(e,t,n){const i=e.context;let r,o;i.depthTexture&&(r=new WPe),e._useOIT&&i.depthTexture&&(o=new PRe(i));const a=new Zbe(i);a.viewport=Nl.clone(n),this.camera=t,this._cameraClone=LAe.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=a,this.pickFramebuffer=new sje(i),this.pickDepthFramebuffer=new rje,this.sceneFramebuffer=new lje,this.globeDepth=r,this.globeTranslucencyFramebuffer=new XPe,this.oit=o,this.translucentTileClassification=new iMe(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}const aMe=new O,sMe=new O;function cMe(e,t,n){const i=1/Math.max(1,function(e,t){const n=Math.max(Math.abs(e.x),Math.abs(t.x)),i=Math.max(Math.abs(e.y),Math.abs(t.y)),r=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(n,i),r)}(e.position,t.position));return O.multiplyByScalar(e.position,i,aMe),O.multiplyByScalar(t.position,i,sMe),O.equalsEpsilon(aMe,sMe,n)&&O.equalsEpsilon(e.direction,t.direction,n)&&O.equalsEpsilon(e.up,t.up,n)&&O.equalsEpsilon(e.right,t.right,n)&&Me.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}function lMe(e,t,n,i,r){t.debugShowFrustums&&(n.debugOverlappingFrustums=0);const o=e.frustumCommandsList,a=o.length;for(let e=0;e<a;++e){const a=o[e],s=a.near;if(i>a.far)continue;if(r<s)break;const c=n.pass,l=a.indices[c]++;if(a.commands[c][l]=n,t.debugShowFrustums&&(n.debugOverlappingFrustums|=1<<e),n.executeInClosestFrustum)break}if(t.debugShowFrustums){const t=e.debugFrustumStatistics.commandsInFrustums;t[n.debugOverlappingFrustums]=Object(l.a)(t[n.debugOverlappingFrustums])?t[n.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands}t.updateDerivedCommands(n)}oMe.prototype.checkForCameraUpdates=function(e){const t=this.camera,n=this._cameraClone;return cMe(t,n,h.a.EPSILON15)?(this._cameraStartFired&&Xf()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Xf(),LAe.clone(t,n),!0)};const uMe=new xy,hMe=new Y;oMe.prototype.createPotentiallyVisibleSet=function(e){const t=e.frameState,n=t.camera,i=n.directionWC,r=n.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});const c=this.frustumCommandsList,u=c.length,d=KR.NUMBER_OF_PASSES;for(let e=0;e<u;++e)for(let t=0;t<d;++t)c[e].indices[t]=0;o.length=0,a.length=0;const f=this._commandExtents,p=f.length;let m=0,g=+Number.MAX_VALUE,_=-Number.MAX_VALUE;const y=t.shadowState.shadowsEnabled;let b=+Number.MAX_VALUE,v=-Number.MAX_VALUE,O=Number.MAX_VALUE;const w=t.mode===AB.SCENE3D?t.occluder:void 0;let A=t.cullingVolume;const E=uMe.planes;for(let e=0;e<5;++e)E[e]=A.planes[e];A=uMe;const T=s.length;for(let t=0;t<T;++t){const c=s[t],u=c.pass;if(u===KR.COMPUTE)o.push(c);else if(u===KR.OVERLAY)a.push(c);else{let t,o;const a=c.boundingVolume;if(Object(l.a)(a)){if(!e.isVisible(c,A,w))continue;const n=a.computePlaneDistances(r,i,hMe);if(t=n.start,o=n.stop,g=Math.min(g,t),_=Math.max(_,o),y&&c.receiveShadows&&t<Jje.MAXIMUM_DISTANCE&&!(u===KR.GLOBE&&t<-100&&o>100)){const e=o-t;u!==KR.GLOBE&&t<100&&(O=Math.min(O,e)),b=Math.min(b,t),v=Math.max(v,o)}}else c instanceof UU?(t=n.frustum.near,o=n.frustum.far):(t=n.frustum.near,o=n.frustum.far,g=Math.min(g,t),_=Math.max(_,o));let s=f[m];Object(l.a)(s)||(s=f[m]=new rMe),s.command=c,s.near=t,s.far=o,m++}}let C,x;for(y&&(b=Math.min(Math.max(b,n.frustum.near),n.frustum.far),v=Math.max(Math.min(v,n.frustum.far),b)),y&&(t.shadowState.nearPlane=b,t.shadowState.farPlane=v,t.shadowState.closestObjectSize=O),function(e,t,n,i){const r=t.frameState,o=r.camera,a=r.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,s=t.mode===AB.SCENE2D,c=t.nearToFarDistance2D;let u;i*=1+h.a.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n),s?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));const d=e.frustumCommandsList;d.length=u;for(let e=0;e<u;++e){let t,r;s?(t=Math.min(i-c,n+e*c),r=Math.min(i,t+c)):(t=Math.max(n,Math.pow(a,e)*n),r=Math.min(i,a*t));let o=d[e];Object(l.a)(o)?(o.near=t,o.far=r):o=d[e]=new Gxe(t,r)}}(this,e,g,_),C=0;C<m;C++)x=f[C],lMe(this,e,x.command,x.near,x.far);if(m<p)for(C=m;C<p&&(x=f[C],Object(l.a)(x.command));C++)x.command=void 0;const S=c.length,I=t.frustumSplits;I.length=S+1;for(let e=0;e<S;++e)I[e]=c[e].near,e===S-1&&(I[e+1]=c[e].far)},oMe.prototype.destroy=function(){let e;this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();const t=this.pickDepths,n=t.length;for(e=0;e<n;++e)t[e].destroy()};var dMe=oMe;const fMe=new YAe({pass:ute.MOST_DETAILED_PRELOAD}),pMe=new YAe({pass:ute.MOST_DETAILED_PICK}),mMe=new YAe({pass:ute.PICK});function gMe(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;const t=new Nl(0,0,1,1),n=new LAe(e);n.frustum=new nv({width:.1,aspectRatio:1,near:.1}),this._pickOffscreenView=new dMe(e,n,t)}gMe.prototype.update=function(){this._pickPositionCacheDirty=!0},gMe.prototype.getPickDepth=function(e,t){const n=e.view.pickDepths;let i=n[t];return Object(l.a)(i)||(i=new nje,n[t]=i),i};const _Me=new Qb,yMe=new O,bMe=new O,vMe=new Vt,OMe=new Me;const wMe=new lv,AMe=new Vt;function EMe(e,t,n,i,r){const o=e.camera.frustum;return o instanceof nv||o instanceof Qb?function(e,t,n,i,r){const o=e.camera;let a=o.frustum;Object(l.a)(a._offCenterFrustum)&&(a=a._offCenterFrustum);let s=2*(t.x-r.x)/r.width-1;s*=.5*(a.right-a.left);let c=2*(r.height-t.y-r.y)/r.height-1;c*=.5*(a.top-a.bottom);const u=Me.clone(o.transform,OMe);o._setTransform(Me.IDENTITY);const h=O.clone(o.position,yMe);O.multiplyByScalar(o.right,s,bMe),O.add(bMe,h,h),O.multiplyByScalar(o.up,c,bMe),O.add(bMe,h,h),o._setTransform(u),e.mode===AB.SCENE2D&&O.fromElements(h.z,h.x,h.y,h);const d=a.getPixelDimensions(r.width,r.height,1,1,vMe),f=_Me;return f.right=.5*d.x,f.left=-f.right,f.top=.5*d.y,f.bottom=-f.top,f.near=a.near,f.far=a.far,f.computeCullingVolume(h,o.directionWC,o.upWC)}(e,t,0,0,r):function(e,t,n,i,r){const o=e.camera,a=o.frustum,s=a.near,c=Math.tan(.5*a.fovy),l=a.aspectRatio*c,u=(2*(t.x-r.x)/r.width-1)*s*l,h=(2*(r.height-t.y-r.y)/r.height-1)*s*c,d=a.getPixelDimensions(r.width,r.height,1,1,AMe),f=d.x*n*.5,p=d.y*i*.5,m=wMe;return m.top=h+p,m.bottom=h-p,m.right=u+f,m.left=u-f,m.near=s,m.far=a.far,m.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}(e,t,n,i,r)}let TMe=3,CMe=3,xMe=new Nl(0,0,TMe,CMe);const SMe=new Vt,IMe=new sp(0,0,0,0);gMe.prototype.pick=function(e,t,n,i){if(!Object(l.a)(t))throw new u.a("windowPosition is undefined.");TMe=Object(c.a)(n,3),CMe=Object(c.a)(i,TMe);const r=e.context,o=r.uniformState,a=e.frameState,s=e.defaultView;e.view=s;const h=s.viewport;h.x=0,h.y=0,h.width=r.drawingBufferWidth,h.height=r.drawingBufferHeight;let d=s.passState;d.viewport=Nl.clone(h,d.viewport);const f=iQ.transformWindowToDrawingBuffer(e,t,SMe);e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=EMe(e,f,TMe,CMe,h),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=mMe,o.update(a),e.updateEnvironment(),xMe.x=f.x-.5*(TMe-1),xMe.y=e.drawingBufferHeight-f.y-.5*(CMe-1),xMe.width=TMe,xMe.height=CMe,d=s.pickFramebuffer.begin(xMe,s.viewport),e.updateAndExecuteCommands(d,IMe),e.resolveFramebuffers(d);const p=s.pickFramebuffer.end(xMe);return r.endFrame(),p};const PMe=new dv,DMe=new lv,RMe=new nv,jMe=new Qb;gMe.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(!Object(l.a)(t))throw new u.a("windowPosition is undefined.");if(!e.context.depthTexture)throw new u.a("Picking from the depth buffer is not supported. Check pickPositionSupported.");const i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return O.clone(this._pickPositionCache[i],n);const r=e.frameState,o=e.context,a=o.uniformState,s=e.defaultView;e.view=s;const c=iQ.transformWindowToDrawingBuffer(e,t,SMe);e.pickTranslucentDepth?function(e,t){const n=e.context,i=e.frameState,r=e.environmentState,o=e.defaultView;e.view=o;const a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let s=o.passState;s.viewport=Nl.clone(a,s.viewport),e.clearPasses(i.passes),i.passes.pick=!0,i.passes.depth=!0,i.cullingVolume=EMe(e,t,1,1,a),i.tilesetPassState=mMe,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,s=o.pickDepthFramebuffer.update(n,t,a),e.updateAndExecuteCommands(s,IMe),e.resolveFramebuffers(s),n.endFrame()}(e,c):(e.updateFrameState(),a.update(r),e.updateEnvironment()),c.y=e.drawingBufferHeight-c.y;const h=e.camera;let d;d=Object(l.a)(h.frustum.fov)?h.frustum.clone(PMe):Object(l.a)(h.frustum.infiniteProjectionMatrix)?h.frustum.clone(DMe):Object(l.a)(h.frustum.width)?h.frustum.clone(RMe):h.frustum.clone(jMe);const f=s.frustumCommandsList,p=f.length;for(let t=0;t<p;++t){const s=this.getPickDepth(e,t).getDepth(o,c.x,c.y);if(Object(l.a)(s)&&(s>0&&s<1)){const o=f[t];let l;return e.mode===AB.SCENE2D?(l=h.position.z,h.position.z=l-o.near+1,d.far=Math.max(1,o.far-o.near),d.near=1,a.update(r),a.updateFrustum(d)):(d.near=o.near*(0!==t?e.opaqueFrustumNearOffset:1),d.far=o.far,a.updateFrustum(d)),n=iQ.drawingBufferToWgs84Coordinates(e,c,s,n),e.mode===AB.SCENE2D&&(h.position.z=l,a.update(r)),this._pickPositionCache[i]=O.clone(n),n}}this._pickPositionCache[i]=void 0};const MMe=new R;function LMe(e,t){let n,i;const r=[],o=[],a=[],s=[];Object(l.a)(e)||(e=Number.MAX_VALUE);let c=t();for(;Object(l.a)(c);){const n=c.object,u=c.position,h=c.exclude;if(Object(l.a)(u)&&!Object(l.a)(n)){r.push(c);break}if(!Object(l.a)(n)||!Object(l.a)(n.primitive))break;if(!h&&(r.push(c),0>=--e))break;const d=n.primitive;let f=!1;"function"==typeof d.getGeometryInstanceAttributes&&Object(l.a)(n.id)&&(i=d.getGeometryInstanceAttributes(n.id),Object(l.a)(i)&&Object(l.a)(i.show)&&(f=!0,i.show=QS.toValue(!1,i.show),a.push(i))),n instanceof jV&&(f=!0,n.show=!1,s.push(n)),f||(d.show=!1,o.push(d)),c=t()}for(n=0;n<o.length;++n)o[n].show=!0;for(n=0;n<a.length;++n)i=a[n],i.show=QS.toValue(!0,i.show);for(n=0;n<s.length;++n)s[n].show=!0;return r}gMe.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),Object(l.a)(n)&&e.mode!==AB.SCENE3D){O.fromElements(n.y,n.z,n.x,n);const t=e.mapProjection,i=t.ellipsoid,r=t.unproject(n,MMe);i.cartographicToCartesian(r,n)}return n},gMe.prototype.drillPick=function(e,t,n,i,r){const o=this;return LMe(n,(function(){const n=o.pick(e,t,i,r);if(Object(l.a)(n))return{object:n,position:void 0,exclude:!1}})).map((function(e){return e.object}))};const NMe=new O,BMe=new O;function FMe(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;const i=this;this.promise=new Promise(e=>{i._completePick=()=>{e()}})}function zMe(e,t,n,i){const r=t.direction,o=O.mostOrthogonalAxis(r,NMe),a=O.cross(r,o,NMe),s=O.cross(r,a,BMe);return i.position=t.origin,i.direction=r,i.up=s,i.right=a,i.frustum.width=Object(c.a)(n,.1),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function kMe(e,t,n){const i=t.frameState,r=n.ray,o=n.width,a=n.tilesets,s=e._pickOffscreenView.camera,c=zMe(0,r,o,s),l=fMe;l.camera=s,l.cullingVolume=c;let u=!0;const h=a.length;for(let e=0;e<h;++e){const n=a[e];n.show&&t.primitives.contains(n)&&(n.updateForPass(i,l),u=u&&l.ready)}return u&&n._completePick(),u}function UMe(e,t,n,i,r,o){const a=[];if(function e(t,n,i){const r=t.length;for(let o=0;o<r;++o){const r=t.get(o);r.show&&(Object(l.a)(r.isCesium3DTileset)?Object(l.a)(n)&&-1!==n.indexOf(r)||i.push(r):r instanceof cce&&e(r,n,i))}}(t.primitives,i,a),0===a.length)return Promise.resolve(o());const s=new FMe(n,r,a);return e._mostDetailedRayPicks.push(s),s.promise.then((function(){return o()}))}function VMe(e,t){return!(!Object(l.a)(e)||!Object(l.a)(t)||0===t.length)&&(t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1)}function HMe(e,t,n,i,r,o,a,s){return LMe(i,(function(){return function(e,t,n,i,r,o,a){const s=t.context,c=s.uniformState,u=t.frameState,h=e._pickOffscreenView;t.view=h,zMe(0,n,r,h.camera),xMe=Nl.clone(h.viewport,xMe);const d=h.pickFramebuffer.begin(xMe,h.viewport);let f;t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,u.tilesetPassState=a?pMe:mMe,c.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(d,IMe),t.resolveFramebuffers(d);const p=h.pickFramebuffer.end(xMe);if(t.context.depthTexture){const i=h.frustumCommandsList.length;for(let r=0;r<i;++r){const i=e.getPickDepth(t,r).getDepth(s,0,0);if(Object(l.a)(i)&&(i>0&&i<1)){const e=h.frustumCommandsList[r],o=e.near*(0!==r?t.opaqueFrustumNearOffset:1),a=o+i*(e.far-o);f=Gn.getPoint(n,a);break}}}if(t.view=t.defaultView,s.endFrame(),Object(l.a)(p)||Object(l.a)(f))return{object:p,position:f,exclude:!Object(l.a)(f)&&o||VMe(p,i)}}(e,t,n,r,o,a,s)}))}function GMe(e,t,n,i,r,o,a){const s=HMe(e,t,n,1,i,r,o,a);if(s.length>0)return s[0]}function qMe(e,t,n,i,r,o,a,s){return HMe(e,t,n,i,r,o,a,s)}function WMe(e,t){return new Promise((n,i)=>{t.then((function(t){const i=e.postRender.addEventListener((function(){i(),n(t)}));e.requestRender()})).catch((function(e){i(e)}))})}gMe.prototype.updateMostDetailedRayPicks=function(e){const t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)kMe(this,e,t[n])&&t.splice(n--,1)},gMe.prototype.pickFromRay=function(e,t,n,i){if(s.a.defined("ray",t),e.mode!==AB.SCENE3D)throw new u.a("Ray intersections are only supported in 3D mode.");return GMe(this,e,t,n,i,!1,!1)},gMe.prototype.drillPickFromRay=function(e,t,n,i,r){if(s.a.defined("ray",t),e.mode!==AB.SCENE3D)throw new u.a("Ray intersections are only supported in 3D mode.");return qMe(this,e,t,n,i,r,!1,!1)},gMe.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(s.a.defined("ray",t),e.mode!==AB.SCENE3D)throw new u.a("Ray intersections are only supported in 3D mode.");const r=this;return t=Gn.clone(t),n=Object(l.a)(n)?n.slice():n,WMe(e,UMe(r,e,t,n,i,(function(){return GMe(r,e,t,n,i,!1,!0)})))},gMe.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){if(s.a.defined("ray",t),e.mode!==AB.SCENE3D)throw new u.a("Ray intersections are only supported in 3D mode.");const o=this;return t=Gn.clone(t),i=Object(l.a)(i)?i.slice():i,WMe(e,UMe(o,e,t,i,r,(function(){return qMe(o,e,t,n,i,r,!1,!0)})))};const YMe=new O,XMe=new O,KMe=new Gn,JMe=new R;function ZMe(e,t){const n=e.globe,i=Object(l.a)(n)?n.ellipsoid:e.mapProjection.ellipsoid,r=nn._defaultMaxTerrainHeight,o=i.geodeticSurfaceNormalCartographic(t,XMe),a=R.toCartesian(t,i,YMe),s=KMe;s.origin=a,s.direction=o;const c=new Gn;return Gn.getPoint(s,r,c.origin),O.negate(o,c.direction),c}function $Me(e,t){const n=e.globe,i=Object(l.a)(n)?n.ellipsoid:e.mapProjection.ellipsoid;return ZMe(e,R.fromCartesian(t,i,JMe))}function QMe(e,t){const n=e.globe,i=Object(l.a)(n)?n.ellipsoid:e.mapProjection.ellipsoid;return R.fromCartesian(t,i,JMe).height}function eLe(e,t,n,i,r){const o=ZMe(t,n);return UMe(e,t,o,i,r,(function(){const n=GMe(e,t,o,i,r,!0,!0);if(Object(l.a)(n))return QMe(t,n.position)}))}function tLe(e,t,n,i,r,o){const a=$Me(t,n);return UMe(e,t,a,i,r,(function(){const n=GMe(e,t,a,i,r,!0,!0);if(Object(l.a)(n))return O.clone(n.position,o)}))}gMe.prototype.sampleHeight=function(e,t,n,i){if(s.a.defined("position",t),e.mode!==AB.SCENE3D)throw new u.a("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new u.a("sampleHeight requires depth texture support. Check sampleHeightSupported.");const r=GMe(this,e,ZMe(e,t),n,i,!0,!1);if(Object(l.a)(r))return QMe(e,r.position)},gMe.prototype.clampToHeight=function(e,t,n,i,r){if(s.a.defined("cartesian",t),e.mode!==AB.SCENE3D)throw new u.a("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new u.a("clampToHeight requires depth texture support. Check clampToHeightSupported.");const o=GMe(this,e,$Me(e,t),n,i,!0,!1);if(Object(l.a)(o))return O.clone(o.position,r)},gMe.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(s.a.defined("positions",t),e.mode!==AB.SCENE3D)throw new u.a("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new u.a("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=Object(l.a)(n)?n.slice():n;const r=t.length,o=new Array(r);for(let a=0;a<r;++a)o[a]=eLe(this,e,t[a],n,i);return WMe(e,Promise.all(o).then((function(e){const n=e.length;for(let i=0;i<n;++i)t[i].height=e[i];return t})))},gMe.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(s.a.defined("cartesians",t),e.mode!==AB.SCENE3D)throw new u.a("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new u.a("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=Object(l.a)(n)?n.slice():n;const r=t.length,o=new Array(r);for(let a=0;a<r;++a)o[a]=tLe(this,e,t[a],n,i,t[a]);return WMe(e,Promise.all(o).then((function(e){const n=e.length;for(let i=0;i<n;++i)t[i]=e[i];return t})))},gMe.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var nLe=gMe;var iLe={NEAREST:0,LINEAR:1};function rLe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).fragmentShader,n=Object(c.a)(e.textureScale,1),i=Object(c.a)(e.pixelFormat,aT.RGBA);if(s.a.typeOf.string("options.fragmentShader",t),s.a.typeOf.number.greaterThan("options.textureScale",n,0),s.a.typeOf.number.lessThanOrEquals("options.textureScale",n,1),!aT.isColorFormat(i))throw new u.a("options.pixelFormat must be a color format.");this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=Object(c.a)(e.forcePowerOfTwo,!1),this._sampleMode=Object(c.a)(e.sampleMode,iLe.NEAREST),this._pixelFormat=i,this._pixelDatatype=Object(c.a)(e.pixelDatatype,rT.UNSIGNED_BYTE),this._clearColor=Object(c.a)(e.clearColor,sp.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;const r=new Zbe;r.scissorTest={enabled:!0,rectangle:Object(l.a)(e.scissorRectangle)?Nl.clone(e.scissorRectangle):new Nl},this._passState=r,this._ready=!1;let o=e.name;Object(l.a)(o)||(o=fy()),this._name=o,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(rLe.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(Object(l.a)(this._textureCache)){const e=this._textureCache.getFramebuffer(this._name);if(Object(l.a)(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});const oLe=/uniform\s+sampler2D\s+depthTexture/g;function aLe(e,t,n){const i=t[n];return("string"==typeof i||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(i){const r=t[n];t[n]=i;const o=e._actualUniforms,a=o[n];Object(l.a)(a)&&a!==r&&a instanceof JD&&!Object(l.a)(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete o[n],delete o[n+"Dimensions"]),r instanceof JD&&e._texturesToRelease.push(r),"string"==typeof i||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData?e._dirtyUniforms.push(n):o[n]=i}}}function sLe(e,t){return function(){const n=e._actualUniforms[t];return"function"==typeof n?n():n}}function cLe(e,t){return function(){const n=e[t]();if(Object(l.a)(n))return n.dimensions}}function lLe(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function uLe(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function hLe(e){Object(l.a)(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();const t=e._textureCache;if(!Object(l.a)(t))return;const n=e._uniforms,i=e._actualUniforms;for(const r in i)i.hasOwnProperty(r)&&i[r]instanceof JD&&(Object(l.a)(t.getStageByName(n[r]))||i[r].destroy(),e._dirtyUniforms.push(r))}rLe.prototype._isSupported=function(e){return!oLe.test(this._fragmentShader)||e.depthTexture},rLe.prototype.update=function(e,t){if(this.enabled===this._enabled||this.enabled||hLe(this),this._enabled=this.enabled,!this._enabled)return;if(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=function(e){let t=Object(l.a)(e._selected)?e._selected.length:0;const n=Object(l.a)(e._parentSelected)?e._parentSelected:0;let i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,Object(l.a)(e._selected)&&Object(l.a)(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):Object(l.a)(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&Object(l.a)(e._combinedSelected)){if(!Object(l.a)(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return i}(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=Object(l.a)(this._selected)?this._selected.length:0,this._parentSelectedLength=Object(l.a)(this._parentSelected)?this._parentSelected.length:0,function(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;const n=e._combinedSelected;if(!Object(l.a)(n))return;let i,r,o=0;const a=n.length;for(i=0;i<a;++i)r=n[i],Object(l.a)(r.pickIds)?o+=r.pickIds.length:Object(l.a)(r.pickId)&&++o;if(0===a||0===o){const n=new Uint8Array(4);return n[0]=255,n[1]=255,n[2]=255,n[3]=255,void(e._selectedIdTexture=new JD({context:t,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,source:{arrayBufferView:n,width:1,height:1},sampler:WD.NEAREST}))}let s,c=0;const u=new Uint8Array(4*o);for(i=0;i<a;++i)if(r=n[i],Object(l.a)(r.pickIds)){const e=r.pickIds,t=e.length;for(let n=0;n<t;++n)s=e[n].color,u[c]=sp.floatToByte(s.red),u[c+1]=sp.floatToByte(s.green),u[c+2]=sp.floatToByte(s.blue),u[c+3]=sp.floatToByte(s.alpha),c+=4}else Object(l.a)(r.pickId)&&(s=r.pickId.color,u[c]=sp.floatToByte(s.red),u[c+1]=sp.floatToByte(s.green),u[c+2]=sp.floatToByte(s.blue),u[c+3]=sp.floatToByte(s.alpha),c+=4);e._selectedIdTexture=new JD({context:t,pixelFormat:aT.RGBA,pixelDatatype:rT.UNSIGNED_BYTE,source:{arrayBufferView:u,width:o,height:1},sampler:WD.NEAREST})}(this,e),function(e){if(Object(l.a)(e._uniformMap))return;const t={},n={},i=e._uniforms,r=e._actualUniforms;for(const o in i)if(i.hasOwnProperty(o)){"function"!=typeof i[o]?(t[o]=sLe(e,o),n[o]=aLe(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];const a=t[o]();("string"==typeof a||a instanceof JD||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[o+"Dimensions"]=cLe(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Object(up.a)(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}(this),function(e,t){let n,i,r;const o=e._texturesToRelease;let a=o.length;for(n=0;n<a;++n)i=o[n],i=i&&i.destroy();o.length=0;const s=e._texturesToCreate;for(a=s.length,n=0;n<a;++n){const i=s[n];r=i.name;const o=i.source;e._actualUniforms[r]=new JD({context:t,source:o})}s.length=0;const c=e._dirtyUniforms;if(0===c.length&&!Object(l.a)(e._texturePromise))return void(e._ready=!0);if(0===c.length||Object(l.a)(e._texturePromise))return;a=c.length;const u=e._uniforms,h=[];for(n=0;n<a;++n){r=c[n];const t=u[r],i=e._textureCache.getStageByName(t);if(Object(l.a)(i))e._actualUniforms[r]=uLe(e,t);else if("string"==typeof t){const n=new Tt.a({url:t});h.push(n.fetchImage().then(lLe(e,r)))}else e._texturesToCreate.push({name:r,source:t})}c.length=0,h.length>0?(e._ready=!1,e._texturePromise=Promise.all(h).then((function(){e._ready=!0,e._texturePromise=void 0}))):e._ready=!0}(this,e),function(e,t){if(Object(l.a)(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(Object(l.a)(e._selectedIdTexture)){const t=e._selectedIdTexture.width;n=n.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""),n=`#define CZM_SELECTED_FEATURE \nuniform sampler2D czm_idTexture; \nuniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nvarying vec2 v_textureCoordinates; \nbool czm_selected(vec2 offset) \n{ \n    bool selected = false;\n    vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \n    for (int i = 0; i < ${t}; ++i) \n    { \n        vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n        if (all(equal(id, selectedId))) \n        { \n            return true; \n        } \n    } \n    return false; \n} \n\nbool czm_selected() \n{ \n    return czm_selected(vec2(0.0)); \n} \n\n`+n}const i=new UN({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}(this,e),function(e){let t,n;e._sampleMode===iLe.LINEAR?(t=VD.LINEAR,n=kD.LINEAR):(t=VD.NEAREST,n=kD.NEAREST);const i=e._sampler;Object(l.a)(i)&&i.minificationFilter===t&&i.magnificationFilter===n||(e._sampler=new WD({wrapS:GD.CLAMP_TO_EDGE,wrapT:GD.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:n}))}(this),this._selectedDirty=!1,!this._ready)return;const n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!Object(l.a)(n))return;const i=n.getColorTexture(0);let r;i.width===e.drawingBufferWidth&&i.height===e.drawingBufferHeight||(r=this._renderState,Object(l.a)(r)&&i.width===r.viewport.width&&i.height===r.viewport.height||(this._renderState=vj.fromCache({viewport:new Nl(0,0,i.width,i.height)}))),this._command.renderState=r},rLe.prototype.execute=function(e,t,n,i){if(!(Object(l.a)(this._command)&&Object(l.a)(this._command.framebuffer)&&this._ready&&this._enabled))return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,WD.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);const r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;Object(l.a)(r)&&(r.context=e),this._command.execute(e,r)},rLe.prototype.isDestroyed=function(){return!1},rLe.prototype.destroy=function(){return hLe(this),sc(this)};var dLe=rLe,fLe="uniform sampler2D colorTexture;\n\nvarying vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\nvoid main()\n{\n    vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\n    vec3 color = fragmentColor.rgb;\n\n#ifdef AUTO_EXPOSURE\n    color /= texture2D(autoExposure, vec2(0.5)).r;\n#endif\n    color = czm_acesTonemapping(color);\n    color = czm_inverseGamma(color);\n\n    gl_FragColor = vec4(color, fragmentColor.a);\n}\n",pLe="uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\n\nvarying vec2 v_textureCoordinates;\n\nvec4 clipToEye(vec2 uv, float depth)\n{\n    vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\n    vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\n    posEC = posEC / posEC.w;\n    return posEC;\n}\n\n//Reconstruct Normal Without Edge Removation\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\n    vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\n    vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\n    vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\n    vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\n\n    vec3 up = posInCamera.xyz - posInCameraUp.xyz;\n    vec3 down = posInCameraDown.xyz - posInCamera.xyz;\n    vec3 left = posInCamera.xyz - posInCameraLeft.xyz;\n    vec3 right = posInCameraRight.xyz - posInCamera.xyz;\n\n    vec3 DX = length(left) < length(right) ? left : right;\n    vec3 DY = length(up) < length(down) ? up : down;\n\n    return normalize(cross(DY, DX));\n}\n\nvoid main(void)\n{\n    float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n    vec4 posInCamera = clipToEye(v_textureCoordinates, depth);\n\n    if (posInCamera.z > frustumLength)\n    {\n        gl_FragColor = vec4(1.0);\n        return;\n    }\n\n    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\n    float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\n    float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\n    float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\n    float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\n    vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\n\n    float ao = 0.0;\n    vec2 sampleDirection = vec2(1.0, 0.0);\n    float gapAngle = 90.0 * czm_radiansPerDegree;\n\n    // RandomNoise\n    float randomVal = texture2D(randomTexture, v_textureCoordinates).x;\n\n    //Loop for each direction\n    for (int i = 0; i < 4; i++)\n    {\n        float newGapAngle = gapAngle * (float(i) + randomVal);\n        float cosVal = cos(newGapAngle);\n        float sinVal = sin(newGapAngle);\n\n        //Rotate Sampling Direction\n        vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\n        float localAO = 0.0;\n        float localStepSize = stepSize;\n\n        //Loop for each step\n        for (int j = 0; j < 6; j++)\n        {\n            vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\n\n            //Exception Handling\n            if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n            {\n                break;\n            }\n\n            float stepDepthInfo = czm_readDepth(depthTexture, newCoords);\n            vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\n            vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\n            float len = length(diffVec);\n\n            if (len > lengthCap)\n            {\n                break;\n            }\n\n            float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\n            float weight = len / lengthCap;\n            weight = 1.0 - weight * weight;\n\n            if (dotVal < bias)\n            {\n                dotVal = 0.0;\n            }\n\n            localAO = max(localAO, dotVal * weight);\n            localStepSize += stepSize;\n        }\n        ao += localAO;\n    }\n\n    ao /= 4.0;\n    ao = 1.0 - clamp(ao, 0.0, 1.0);\n    ao = pow(ao, intensity);\n    gl_FragColor = vec4(vec3(ao), 1.0);\n}\n",mLe="uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    vec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\n    vec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\n    gl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\n}\n",gLe="uniform sampler2D colorTexture;\nuniform float gradations;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\n    if (czm_selected()) {\n        gl_FragColor = vec4(rgb, 1.0);\n        return;\n    }\n#endif\n    float luminance = czm_luminance(rgb);\n    float darkness = luminance * gradations;\n    darkness = (darkness - fract(darkness)) / gradations;\n    gl_FragColor = vec4(vec3(darkness), 1.0);\n}\n",_Le="uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    vec4 color = texture2D(colorTexture, v_textureCoordinates);\n\n#ifdef CZM_SELECTED_FEATURE\n    if (czm_selected()) {\n        gl_FragColor = color;\n        return;\n    }\n#endif\n\n    vec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\n    gl_FragColor = glowOnly ? bloom : bloom + color;\n}\n",yLe="uniform sampler2D colorTexture;\nuniform float brightness;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n    vec3 target = vec3(0.0);\n    gl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n",bLe="uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    vec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\n    sceneColor = czm_RGBToHSB(sceneColor);\n    sceneColor.z += brightness;\n    sceneColor = czm_HSBToRGB(sceneColor);\n\n    float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\n    sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\n    gl_FragColor = vec4(sceneColor, 1.0);\n}\n",vLe="uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\n\nvarying vec2 v_textureCoordinates;\n\nvec4 toEye(vec2 uv, float depth)\n{\n   vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\n   vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n   posInCamera = posInCamera / posInCamera.w;\n   return posInCamera;\n}\n\nfloat computeDepthBlur(float depth)\n{\n    float f;\n    if (depth < focalDistance)\n    {\n        f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n    }\n    else\n    {\n        f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\n        f = pow(f, 0.1);\n    }\n    f *= f;\n    f = clamp(f, 0.0, 1.0);\n    return pow(f, 0.5);\n}\n\nvoid main(void)\n{\n    float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n    vec4 posInCamera = toEye(v_textureCoordinates, depth);\n    float d = computeDepthBlur(-posInCamera.z);\n    gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\n}\n",OLe="uniform sampler2D depthTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    float depth = czm_readDepth(depthTexture, v_textureCoordinates);\n    gl_FragColor = vec4(vec3(depth), 1.0);\n}\n",wLe="uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    float directions[3];\n    directions[0] = -1.0;\n    directions[1] = 0.0;\n    directions[2] = 1.0;\n\n    float scalars[3];\n    scalars[0] = 3.0;\n    scalars[1] = 10.0;\n    scalars[2] = 3.0;\n\n    float padx = czm_pixelRatio / czm_viewport.z;\n    float pady = czm_pixelRatio / czm_viewport.w;\n\n#ifdef CZM_SELECTED_FEATURE\n    bool selected = false;\n    for (int i = 0; i < 3; ++i)\n    {\n        float dir = directions[i];\n        selected = selected || czm_selected(vec2(-padx, dir * pady));\n        selected = selected || czm_selected(vec2(padx, dir * pady));\n        selected = selected || czm_selected(vec2(dir * padx, -pady));\n        selected = selected || czm_selected(vec2(dir * padx, pady));\n        if (selected)\n        {\n            break;\n        }\n    }\n    if (!selected)\n    {\n        gl_FragColor = vec4(color.rgb, 0.0);\n        return;\n    }\n#endif\n\n    float horizEdge = 0.0;\n    float vertEdge = 0.0;\n\n    for (int i = 0; i < 3; ++i)\n    {\n        float dir = directions[i];\n        float scale = scalars[i];\n\n        horizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\n        horizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\n\n        vertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\n        vertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n    }\n\n    float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\n    gl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n",ALe="uniform sampler2D colorTexture;\n\nvarying vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\n// See slides 142 and 143:\n//     http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting\n\nvoid main()\n{\n    vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\n    vec3 color = fragmentColor.rgb;\n\n#ifdef AUTO_EXPOSURE\n    float exposure = texture2D(autoExposure, vec2(0.5)).r;\n    color /= exposure;\n#endif\n\n\tconst float A = 0.22; // shoulder strength\n\tconst float B = 0.30; // linear strength\n\tconst float C = 0.10; // linear angle\n\tconst float D = 0.20; // toe strength\n\tconst float E = 0.01; // toe numerator\n\tconst float F = 0.30; // toe denominator\n\n\tconst float white = 11.2; // linear white point value\n\n\tvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\n\tfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\n\n\tc = czm_inverseGamma(c / w);\n\tgl_FragColor = vec4(c, fragmentColor.a);\n}\n",ELe="varying vec2 v_textureCoordinates;\n\nuniform sampler2D colorTexture;\n\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\n\nvoid main()\n{\n    vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\n    vec4 color = FxaaPixelShader(\n        v_textureCoordinates,\n        colorTexture,\n        fxaaQualityRcpFrame,\n        fxaaQualitySubpix,\n        fxaaQualityEdgeThreshold,\n        fxaaQualityEdgeThresholdMin);\n    float alpha = texture2D(colorTexture, v_textureCoordinates).a;\n    gl_FragColor = vec4(color.rgb, alpha);\n}\n",TLe="#define SAMPLES 8\n\nuniform float delta;\nuniform float sigma;\nuniform float direction; // 0.0 for x direction, 1.0 for y direction\n\nuniform sampler2D colorTexture;\n\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\n\nvarying vec2 v_textureCoordinates;\n\n//  Incremental Computation of the Gaussian:\n//  https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html\n\nvoid main()\n{\n    vec2 st = v_textureCoordinates;\n    vec2 dir = vec2(1.0 - direction, direction);\n\n#ifdef USE_STEP_SIZE\n    vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\n#else\n    vec2 step = step;\n#endif\n\n    vec3 g;\n    g.x = 1.0 / (sqrt(czm_twoPi) * sigma);\n    g.y = exp((-0.5 * delta * delta) / (sigma * sigma));\n    g.z = g.y * g.y;\n\n    vec4 result = texture2D(colorTexture, st) * g.x;\n    for (int i = 1; i < SAMPLES; ++i)\n    {\n        g.xy *= g.yz;\n\n        vec2 offset = float(i) * dir * step;\n        result += texture2D(colorTexture, st - offset) * g.x;\n        result += texture2D(colorTexture, st + offset) * g.x;\n    }\n\n    gl_FragColor = result;\n}\n",CLe="uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float dirtAmount;\nuniform float earthRadius;\nuniform float intensity;\n\nvarying vec2 v_textureCoordinates;\n\n// whether it is in space or not\n// 6500000.0 is empirical value\n#define DISTANCE_TO_SPACE 6500000.0\n\n// return ndc from world coordinate biased earthRadius\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\n    vec4 positionEC = czm_view * vec4(WC, 1.0);\n    positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\n    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n    return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\n\n// Check if current pixel is included Earth\n// if then mask it gradually\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\n    vec2 NDC = texcoord * 2.0 - 1.0;\n    vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\n    vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\n    NDC.xy -= earthPosSC.xy;\n\n    float X = abs(NDC.x) * sceneSize.x;\n    float Y = abs(NDC.y) * sceneSize.y;\n\n    return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\n\n// For Chromatic effect\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\n    vec2 sceneSize = czm_viewport.zw;\n    vec3 color;\n    if(isSpace)\n    {\n        color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\n        color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\n        color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\n    }\n    else\n    {\n        color.r = texture2D(tex, texcoord + direction * distortion.r).r;\n        color.g = texture2D(tex, texcoord + direction * distortion.g).g;\n        color.b = texture2D(tex, texcoord + direction * distortion.b).b;\n    }\n    return vec4(clamp(color, 0.0, 1.0), 0.0);\n}\n\nvoid main(void)\n{\n    vec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\n    vec3 rgb = originalColor.rgb;\n    bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\n\n    // Sun position\n    vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\n    vec4 sunPositionEC = czm_view * sunPos;\n    vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\n    sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\n\n    // If sun is not in the screen space, use original color.\n    if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n    {\n        // Lens flare is disabled when not in space until #5932 is fixed.\n        //    https://github.com/CesiumGS/cesium/issues/5932\n        gl_FragColor = originalColor;\n        return;\n    }\n\n    vec2 texcoord = vec2(1.0) - v_textureCoordinates;\n    vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\n    vec2 invPixelSize = 1.0 / pixelSize;\n    vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\n\n    // ghost vector to image centre:\n    vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\n    vec3 direction = normalize(vec3(ghostVec, 0.0));\n\n    // sample ghosts:\n    vec4 result = vec4(0.0);\n    vec4 ghost = vec4(0.0);\n    for (int i = 0; i < 4; ++i)\n    {\n        vec2 offset = fract(texcoord + ghostVec * float(i));\n        // Only bright spots from the centre of the source image\n        ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n    }\n    result += ghost;\n\n    // sample halo\n    vec2 haloVec = normalize(ghostVec) * haloWidth;\n    float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n    weightForHalo = pow(1.0 - weightForHalo, 5.0);\n\n    result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\n\n    // dirt on lens\n    vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\n    if (dirtTexCoords.x > 1.0)\n    {\n        dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) :  fract(dirtTexCoords.x);\n    }\n    if (dirtTexCoords.y > 1.0)\n    {\n        dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) :  fract(dirtTexCoords.y);\n    }\n    result += dirtAmount * texture2D(dirtTexture, dirtTexCoords);\n\n    // Rotating starburst texture's coordinate\n    // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))\n    float camrot = czm_view[0].z + czm_view[1].y;\n    float cosValue = cos(camrot);\n    float sinValue = sin(camrot);\n    mat3 rotation = mat3(\n        cosValue, -sinValue, 0.0,\n        sinValue, cosValue, 0.0,\n        0.0, 0.0, 1.0\n    );\n\n    vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\n    vec3 st2 = vec3((rotation * st1).xy, 1.0);\n    vec3 st3 = st2 * 0.5 + vec3(0.5);\n    vec2 lensStarTexcoord = st3.xy;\n    float weightForLensFlare = length(vec3(sunPos.xy, 0.0));\n    float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\n\n    if (!isSpace)\n    {\n        result *= oneMinusWeightForLensFlare * intensity * 0.2;\n    }\n    else\n    {\n        result *= oneMinusWeightForLensFlare * intensity;\n        result *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n    }\n\n    result += texture2D(colorTexture, v_textureCoordinates);\n\n    gl_FragColor = result;\n}\n",xLe="uniform sampler2D colorTexture;\nuniform vec3 white;\n\nvarying vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\n// See equation 4:\n//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf\n\nvoid main()\n{\n    vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\n    vec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\n    float exposure = texture2D(autoExposure, vec2(0.5)).r;\n    color /= exposure;\n#endif\n    color = (color * (1.0 + color / white)) / (1.0 + color);\n    color = czm_inverseGamma(color);\n    gl_FragColor = vec4(color, fragmentColor.a);\n}\n",SLe="uniform sampler2D colorTexture;\n\nvarying vec2 v_textureCoordinates;\n\nfloat rand(vec2 co)\n{\n    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n    float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\n    vec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n    vec3 green = vec3(0.0, 1.0, 0.0);\n    gl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n",ILe="uniform sampler2D colorTexture;\n\nvarying vec2 v_textureCoordinates;\n\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\n\n// See equation 3:\n//    http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf\n\nvoid main()\n{\n    vec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\n    vec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\n    float exposure = texture2D(autoExposure, vec2(0.5)).r;\n    color /= exposure;\n#endif\n    color = color / (1.0 + color);\n    color = czm_inverseGamma(color);\n    gl_FragColor = vec4(color, fragmentColor.a);\n}\n",PLe="uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main(void)\n{\n    vec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\n    vec4 color = texture2D(colorTexture, v_textureCoordinates);\n    gl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n",DLe="/**\n * @license\n * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *  * Neither the name of NVIDIA CORPORATION nor the names of its\n *    contributors may be used to endorse or promote products derived\n *    from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples\n// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h\n\n// Steps used to integrate into Cesium:\n// * The following defines are set:\n//       #define FXAA_PC 1\n//       #define FXAA_WEBGL_1 1\n//       #define FXAA_GREEN_AS_LUMA 1\n//       #define FXAA_EARLY_EXIT 1\n//       #define FXAA_GLSL_120 1\n// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.\n// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace\n//   /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.\n// * There are no implicit conversions from ivec* to vec* so replace:\n//       #define FxaaInt2 ivec2\n//           with\n//       #define FxaaInt2 vec2\n// * The texture2DLod function is only available in vertex shaders so replace:\n//       #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n//       #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n//           with\n//       #define FxaaTexTop(t, p) texture2D(t, p)\n//       #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\n// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.\n// * The following parameters to FxaaPixelShader are unused and can be removed:\n//       fxaaConsolePosPos\n//       fxaaConsoleRcpFrameOpt\n//       fxaaConsoleRcpFrameOpt2\n//       fxaaConsole360RcpFrameOpt2\n//       fxaaConsoleEdgeSharpness\n//       fxaaConsoleEdgeThreshold\n//       fxaaConsoleEdgeThresholdMi\n//       fxaaConsole360ConstDir\n\n//\n// Choose the quality preset.\n// This needs to be compiled into the shader as it effects code.\n// Best option to include multiple presets is to\n// in each shader define the preset, then include this file.\n//\n// OPTIONS\n// -----------------------------------------------------------------------\n// 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n// 39       - no dither, very expensive\n//\n// NOTES\n// -----------------------------------------------------------------------\n// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n// 13 = about same speed as FXAA 3.9 and better than 12\n// 23 = closest to FXAA 3.9 visually and performance wise\n//  _ = the lowest digit is directly related to performance\n// _  = the highest digit is directly related to style\n//\n//#define FXAA_QUALITY_PRESET 12\n\n\n#if (FXAA_QUALITY_PRESET == 10)\n    #define FXAA_QUALITY_PS 3\n    #define FXAA_QUALITY_P0 1.5\n    #define FXAA_QUALITY_P1 3.0\n    #define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n    #define FXAA_QUALITY_PS 4\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 3.0\n    #define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n    #define FXAA_QUALITY_PS 5\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 4.0\n    #define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n    #define FXAA_QUALITY_PS 6\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 4.0\n    #define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n    #define FXAA_QUALITY_PS 7\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 4.0\n    #define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n    #define FXAA_QUALITY_PS 8\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 2.0\n    #define FXAA_QUALITY_P6 4.0\n    #define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n    #define FXAA_QUALITY_PS 3\n    #define FXAA_QUALITY_P0 1.5\n    #define FXAA_QUALITY_P1 2.0\n    #define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n    #define FXAA_QUALITY_PS 4\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n    #define FXAA_QUALITY_PS 5\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n    #define FXAA_QUALITY_PS 6\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n    #define FXAA_QUALITY_PS 7\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 3.0\n    #define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n    #define FXAA_QUALITY_PS 8\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 2.0\n    #define FXAA_QUALITY_P6 4.0\n    #define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n    #define FXAA_QUALITY_PS 9\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 2.0\n    #define FXAA_QUALITY_P6 2.0\n    #define FXAA_QUALITY_P7 4.0\n    #define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n    #define FXAA_QUALITY_PS 10\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 2.0\n    #define FXAA_QUALITY_P6 2.0\n    #define FXAA_QUALITY_P7 2.0\n    #define FXAA_QUALITY_P8 4.0\n    #define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n    #define FXAA_QUALITY_PS 11\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 2.0\n    #define FXAA_QUALITY_P6 2.0\n    #define FXAA_QUALITY_P7 2.0\n    #define FXAA_QUALITY_P8 2.0\n    #define FXAA_QUALITY_P9 4.0\n    #define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n    #define FXAA_QUALITY_PS 12\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.5\n    #define FXAA_QUALITY_P2 2.0\n    #define FXAA_QUALITY_P3 2.0\n    #define FXAA_QUALITY_P4 2.0\n    #define FXAA_QUALITY_P5 2.0\n    #define FXAA_QUALITY_P6 2.0\n    #define FXAA_QUALITY_P7 2.0\n    #define FXAA_QUALITY_P8 2.0\n    #define FXAA_QUALITY_P9 2.0\n    #define FXAA_QUALITY_P10 4.0\n    #define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n    #define FXAA_QUALITY_PS 12\n    #define FXAA_QUALITY_P0 1.0\n    #define FXAA_QUALITY_P1 1.0\n    #define FXAA_QUALITY_P2 1.0\n    #define FXAA_QUALITY_P3 1.0\n    #define FXAA_QUALITY_P4 1.0\n    #define FXAA_QUALITY_P5 1.5\n    #define FXAA_QUALITY_P6 2.0\n    #define FXAA_QUALITY_P7 2.0\n    #define FXAA_QUALITY_P8 2.0\n    #define FXAA_QUALITY_P9 2.0\n    #define FXAA_QUALITY_P10 4.0\n    #define FXAA_QUALITY_P11 8.0\n#endif\n\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\n\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n\nFxaaFloat4 FxaaPixelShader(\n    //\n    // Use noperspective interpolation here (turn off perspective interpolation).\n    // {xy} = center of pixel\n    FxaaFloat2 pos,\n    //\n    // Input color texture.\n    // {rgb_} = color in linear or perceptual color space\n    // if (FXAA_GREEN_AS_LUMA == 0)\n    //     {___a} = luma in perceptual color space (not linear)\n    FxaaTex tex,\n    //\n    // Only used on FXAA Quality.\n    // This must be from a constant/uniform.\n    // {x_} = 1.0/screenWidthInPixels\n    // {_y} = 1.0/screenHeightInPixels\n    FxaaFloat2 fxaaQualityRcpFrame,\n    //\n    // Only used on FXAA Quality.\n    // This used to be the FXAA_QUALITY_SUBPIX define.\n    // It is here now to allow easier tuning.\n    // Choose the amount of sub-pixel aliasing removal.\n    // This can effect sharpness.\n    //   1.00 - upper limit (softer)\n    //   0.75 - default amount of filtering\n    //   0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n    //   0.25 - almost off\n    //   0.00 - completely off\n    FxaaFloat fxaaQualitySubpix,\n    //\n    // Only used on FXAA Quality.\n    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.\n    // It is here now to allow easier tuning.\n    // The minimum amount of local contrast required to apply algorithm.\n    //   0.333 - too little (faster)\n    //   0.250 - low quality\n    //   0.166 - default\n    //   0.125 - high quality\n    //   0.063 - overkill (slower)\n    FxaaFloat fxaaQualityEdgeThreshold,\n    //\n    // Only used on FXAA Quality.\n    // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.\n    // It is here now to allow easier tuning.\n    // Trims the algorithm from processing darks.\n    //   0.0833 - upper limit (default, the start of visible unfiltered edges)\n    //   0.0625 - high quality (faster)\n    //   0.0312 - visible limit (slower)\n    // Special notes when using FXAA_GREEN_AS_LUMA,\n    //   Likely want to set this to zero.\n    //   As colors that are mostly not-green\n    //   will appear very dark in the green channel!\n    //   Tune by looking at mostly non-green content,\n    //   then start at zero and increase until aliasing is a problem.\n    FxaaFloat fxaaQualityEdgeThresholdMin\n) {\n/*--------------------------------------------------------------------------*/\n    FxaaFloat2 posM;\n    posM.x = pos.x;\n    posM.y = pos.y;\n    FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n    #define lumaM rgbyM.y\n    FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\n    FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\n    FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\n    FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n/*--------------------------------------------------------------------------*/\n    FxaaFloat maxSM = max(lumaS, lumaM);\n    FxaaFloat minSM = min(lumaS, lumaM);\n    FxaaFloat maxESM = max(lumaE, maxSM);\n    FxaaFloat minESM = min(lumaE, minSM);\n    FxaaFloat maxWN = max(lumaN, lumaW);\n    FxaaFloat minWN = min(lumaN, lumaW);\n    FxaaFloat rangeMax = max(maxWN, maxESM);\n    FxaaFloat rangeMin = min(minWN, minESM);\n    FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n    FxaaFloat range = rangeMax - rangeMin;\n    FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n    FxaaBool earlyExit = range < rangeMaxClamped;\n/*--------------------------------------------------------------------------*/\n    if(earlyExit)\n        return rgbyM;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\n    FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\n    FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\n    FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n/*--------------------------------------------------------------------------*/\n    FxaaFloat lumaNS = lumaN + lumaS;\n    FxaaFloat lumaWE = lumaW + lumaE;\n    FxaaFloat subpixRcpRange = 1.0/range;\n    FxaaFloat subpixNSWE = lumaNS + lumaWE;\n    FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n    FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat lumaNESE = lumaNE + lumaSE;\n    FxaaFloat lumaNWNE = lumaNW + lumaNE;\n    FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n    FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat lumaNWSW = lumaNW + lumaSW;\n    FxaaFloat lumaSWSE = lumaSW + lumaSE;\n    FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n    FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n    FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n    FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n    FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n    FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n    FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n    FxaaBool horzSpan = edgeHorz >= edgeVert;\n    FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n/*--------------------------------------------------------------------------*/\n    if(!horzSpan) lumaN = lumaW;\n    if(!horzSpan) lumaS = lumaE;\n    if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n    FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat gradientN = lumaN - lumaM;\n    FxaaFloat gradientS = lumaS - lumaM;\n    FxaaFloat lumaNN = lumaN + lumaM;\n    FxaaFloat lumaSS = lumaS + lumaM;\n    FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n    FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n    if(pairN) lengthSign = -lengthSign;\n    FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n/*--------------------------------------------------------------------------*/\n    FxaaFloat2 posB;\n    posB.x = posM.x;\n    posB.y = posM.y;\n    FxaaFloat2 offNP;\n    offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n    offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n    if(!horzSpan) posB.x += lengthSign * 0.5;\n    if( horzSpan) posB.y += lengthSign * 0.5;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat2 posN;\n    posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n    posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n    FxaaFloat2 posP;\n    posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n    posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n    FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n    FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n    FxaaFloat subpixE = subpixC * subpixC;\n    FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n/*--------------------------------------------------------------------------*/\n    if(!pairN) lumaNN = lumaSS;\n    FxaaFloat gradientScaled = gradient * 1.0/4.0;\n    FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n    FxaaFloat subpixF = subpixD * subpixE;\n    FxaaBool lumaMLTZero = lumaMM < 0.0;\n/*--------------------------------------------------------------------------*/\n    lumaEndN -= lumaNN * 0.5;\n    lumaEndP -= lumaNN * 0.5;\n    FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n    FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n    FxaaBool doneNP = (!doneN) || (!doneP);\n    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n/*--------------------------------------------------------------------------*/\n    if(doneNP) {\n        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n        doneN = abs(lumaEndN) >= gradientScaled;\n        doneP = abs(lumaEndP) >= gradientScaled;\n        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n        doneNP = (!doneN) || (!doneP);\n        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n/*--------------------------------------------------------------------------*/\n        #if (FXAA_QUALITY_PS > 3)\n        if(doneNP) {\n            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n            doneN = abs(lumaEndN) >= gradientScaled;\n            doneP = abs(lumaEndP) >= gradientScaled;\n            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n            doneNP = (!doneN) || (!doneP);\n            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n/*--------------------------------------------------------------------------*/\n            #if (FXAA_QUALITY_PS > 4)\n            if(doneNP) {\n                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                doneN = abs(lumaEndN) >= gradientScaled;\n                doneP = abs(lumaEndP) >= gradientScaled;\n                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n                doneNP = (!doneN) || (!doneP);\n                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n/*--------------------------------------------------------------------------*/\n                #if (FXAA_QUALITY_PS > 5)\n                if(doneNP) {\n                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                    doneN = abs(lumaEndN) >= gradientScaled;\n                    doneP = abs(lumaEndP) >= gradientScaled;\n                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n                    doneNP = (!doneN) || (!doneP);\n                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n/*--------------------------------------------------------------------------*/\n                    #if (FXAA_QUALITY_PS > 6)\n                    if(doneNP) {\n                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                        doneN = abs(lumaEndN) >= gradientScaled;\n                        doneP = abs(lumaEndP) >= gradientScaled;\n                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n                        doneNP = (!doneN) || (!doneP);\n                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n/*--------------------------------------------------------------------------*/\n                        #if (FXAA_QUALITY_PS > 7)\n                        if(doneNP) {\n                            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                            doneN = abs(lumaEndN) >= gradientScaled;\n                            doneP = abs(lumaEndP) >= gradientScaled;\n                            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n                            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n                            doneNP = (!doneN) || (!doneP);\n                            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n                            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n/*--------------------------------------------------------------------------*/\n    #if (FXAA_QUALITY_PS > 8)\n    if(doneNP) {\n        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n        doneN = abs(lumaEndN) >= gradientScaled;\n        doneP = abs(lumaEndP) >= gradientScaled;\n        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n        doneNP = (!doneN) || (!doneP);\n        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n/*--------------------------------------------------------------------------*/\n        #if (FXAA_QUALITY_PS > 9)\n        if(doneNP) {\n            if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n            if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n            if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n            if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n            doneN = abs(lumaEndN) >= gradientScaled;\n            doneP = abs(lumaEndP) >= gradientScaled;\n            if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n            if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n            doneNP = (!doneN) || (!doneP);\n            if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n            if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n/*--------------------------------------------------------------------------*/\n            #if (FXAA_QUALITY_PS > 10)\n            if(doneNP) {\n                if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                doneN = abs(lumaEndN) >= gradientScaled;\n                doneP = abs(lumaEndP) >= gradientScaled;\n                if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n                if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n                doneNP = (!doneN) || (!doneP);\n                if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n                if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n/*--------------------------------------------------------------------------*/\n                #if (FXAA_QUALITY_PS > 11)\n                if(doneNP) {\n                    if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                    if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                    if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                    if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                    doneN = abs(lumaEndN) >= gradientScaled;\n                    doneP = abs(lumaEndP) >= gradientScaled;\n                    if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n                    if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n                    doneNP = (!doneN) || (!doneP);\n                    if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n                    if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n/*--------------------------------------------------------------------------*/\n                    #if (FXAA_QUALITY_PS > 12)\n                    if(doneNP) {\n                        if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n                        if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n                        if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n                        if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n                        doneN = abs(lumaEndN) >= gradientScaled;\n                        doneP = abs(lumaEndP) >= gradientScaled;\n                        if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n                        if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n                        doneNP = (!doneN) || (!doneP);\n                        if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n                        if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n/*--------------------------------------------------------------------------*/\n                    }\n                    #endif\n/*--------------------------------------------------------------------------*/\n                }\n                #endif\n/*--------------------------------------------------------------------------*/\n            }\n            #endif\n/*--------------------------------------------------------------------------*/\n        }\n        #endif\n/*--------------------------------------------------------------------------*/\n    }\n    #endif\n/*--------------------------------------------------------------------------*/\n                        }\n                        #endif\n/*--------------------------------------------------------------------------*/\n                    }\n                    #endif\n/*--------------------------------------------------------------------------*/\n                }\n                #endif\n/*--------------------------------------------------------------------------*/\n            }\n            #endif\n/*--------------------------------------------------------------------------*/\n        }\n        #endif\n/*--------------------------------------------------------------------------*/\n    }\n/*--------------------------------------------------------------------------*/\n    FxaaFloat dstN = posM.x - posN.x;\n    FxaaFloat dstP = posP.x - posM.x;\n    if(!horzSpan) dstN = posM.y - posN.y;\n    if(!horzSpan) dstP = posP.y - posM.y;\n/*--------------------------------------------------------------------------*/\n    FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n    FxaaFloat spanLength = (dstP + dstN);\n    FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n    FxaaFloat spanLengthRcp = 1.0/spanLength;\n/*--------------------------------------------------------------------------*/\n    FxaaBool directionN = dstN < dstP;\n    FxaaFloat dst = min(dstN, dstP);\n    FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n    FxaaFloat subpixG = subpixF * subpixF;\n    FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n    FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n/*--------------------------------------------------------------------------*/\n    FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n    FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n    if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n    if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n    return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n";function RLe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.defined("options.stages",e.stages),s.a.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=Object(c.a)(e.inputPreviousStageTexture,!0);let t=e.name;Object(l.a)(t)||(t=fy()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(RLe.prototype,{ready:{get:function(){const e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){const t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}}),RLe.prototype._isSupported=function(e){const t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0},RLe.prototype.get=function(e){return s.a.typeOf.number.greaterThanOrEquals("index",e,0),s.a.typeOf.number.lessThan("index",e,this.length),this._stages[e]},RLe.prototype.update=function(e,t){this._selectedDirty=function(e){let t=Object(l.a)(e._selected)?e._selected.length:0;const n=Object(l.a)(e._parentSelected)?e._parentSelected:0;let i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,Object(l.a)(e._selected)&&Object(l.a)(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):Object(l.a)(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&Object(l.a)(e._combinedSelected)){if(!Object(l.a)(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return i}(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=Object(l.a)(this._selected)?this._selected.length:0,this._parentSelectedLength=Object(l.a)(this._parentSelected)?this._parentSelected.length:0;const n=this._stages,i=n.length;for(let r=0;r<i;++r){const i=n[r];this._selectedDirty&&(i.parentSelected=this._combinedSelected),i.update(e,t)}},RLe.prototype.isDestroyed=function(){return!1},RLe.prototype.destroy=function(){const e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return sc(this)};var jLe=RLe;const MLe={};function LLe(e){const t="#define USE_STEP_SIZE\n"+TLe,n=new dLe({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:iLe.LINEAR}),i=new dLe({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:iLe.LINEAR}),r={};return Object.defineProperties(r,{delta:{get:function(){return n.uniforms.delta},set:function(e){const t=n.uniforms,r=i.uniforms;t.delta=r.delta=e}},sigma:{get:function(){return n.uniforms.sigma},set:function(e){const t=n.uniforms,r=i.uniforms;t.sigma=r.sigma=e}},stepSize:{get:function(){return n.uniforms.stepSize},set:function(e){const t=n.uniforms,r=i.uniforms;t.stepSize=r.stepSize=e}}}),new jLe({name:e,stages:[n,i],uniforms:r})}MLe.createBlurStage=function(){return LLe("czm_blur")},MLe.createDepthOfFieldStage=function(){const e=LLe("czm_depth_of_field_blur"),t=new dLe({name:"czm_depth_of_field_composite",fragmentShader:vLe,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(e){t.uniforms.focalDistance=e}},delta:{get:function(){return e.uniforms.delta},set:function(t){e.uniforms.delta=t}},sigma:{get:function(){return e.uniforms.sigma},set:function(t){e.uniforms.sigma=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}}}),new jLe({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})},MLe.isDepthOfFieldSupported=function(e){return e.context.depthTexture},MLe.createEdgeDetectionStage=function(){const e=fy();return new dLe({name:"czm_edge_detection_"+e,fragmentShader:wLe,uniforms:{length:.25,color:sp.clone(sp.BLACK)}})},MLe.isEdgeDetectionSupported=function(e){return e.context.depthTexture},MLe.createSilhouetteStage=function(e){const t=function(e){if(!Object(l.a)(e))return MLe.createEdgeDetectionStage();const t=new jLe({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={};let i="",r="";for(let t=0;t<e.length;++t)i+=`uniform sampler2D edgeTexture${t}; \n`,r+=`        vec4 edge${t} = texture2D(edgeTexture${t}, v_textureCoordinates); \n        if (edge${t}.a > 0.0) \n        { \n            color = edge${t}; \n            break; \n        } \n`,n["edgeTexture"+t]=e[t].name;const o=i+"varying vec2 v_textureCoordinates; \nvoid main() { \n    vec4 color = vec4(0.0); \n"+`    for (int i = 0; i < ${e.length}; i++) \n`+`    { \n${r}    } \n    gl_FragColor = color; \n} \n`,a=new dLe({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new jLe({name:"czm_edge_detection_composite",stages:[t,a]})}(e),n=new dLe({name:"czm_silhouette_color_edges",fragmentShader:PLe,uniforms:{silhouetteTexture:t.name}});return new jLe({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})},MLe.isSilhouetteSupported=function(e){return e.context.depthTexture},MLe.createBloomStage=function(){const e=new dLe({name:"czm_bloom_contrast_bias",fragmentShader:bLe,uniforms:{contrast:128,brightness:-.3}}),t=LLe("czm_bloom_blur"),n=new jLe({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new dLe({name:"czm_bloom_generate_composite",fragmentShader:_Le,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(e){i.uniforms.glowOnly=e}},contrast:{get:function(){return e.uniforms.contrast},set:function(t){e.uniforms.contrast=t}},brightness:{get:function(){return e.uniforms.brightness},set:function(t){e.uniforms.brightness=t}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new jLe({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})},MLe.createAmbientOcclusionStage=function(){const e=new dLe({name:"czm_ambient_occlusion_generate",fragmentShader:pLe,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=LLe("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;const n=new jLe({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new dLe({name:"czm_ambient_occlusion_composite",fragmentShader:mLe,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),r={};return Object.defineProperties(r,{intensity:{get:function(){return e.uniforms.intensity},set:function(t){e.uniforms.intensity=t}},bias:{get:function(){return e.uniforms.bias},set:function(t){e.uniforms.bias=t}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(t){e.uniforms.lengthCap=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(t){e.uniforms.frustumLength=t}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(t){e.uniforms.randomTexture=t}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(e){i.uniforms.ambientOcclusionOnly=e}}}),new jLe({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})},MLe.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};const NLe=`#define FXAA_QUALITY_PRESET 39 \n${DLe}\n${ELe}`;MLe.createFXAAStage=function(){return new dLe({name:"czm_FXAA",fragmentShader:NLe,sampleMode:iLe.LINEAR})},MLe.createAcesTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return t+=fLe,new dLe({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0}})},MLe.createFilmicTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return t+=ALe,new dLe({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0}})},MLe.createReinhardTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return t+=ILe,new dLe({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0}})},MLe.createModifiedReinhardTonemappingStage=function(e){let t=e?"#define AUTO_EXPOSURE\n":"";return t+=xLe,new dLe({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:sp.WHITE,autoExposure:void 0}})},MLe.createAutoExposureStage=function(){return new Jve},MLe.createBlackAndWhiteStage=function(){return new dLe({name:"czm_black_and_white",fragmentShader:gLe,uniforms:{gradations:5}})},MLe.createBrightnessStage=function(){return new dLe({name:"czm_brightness",fragmentShader:yLe,uniforms:{brightness:.5}})},MLe.createNightVisionStage=function(){return new dLe({name:"czm_night_vision",fragmentShader:SLe})},MLe.createDepthViewStage=function(){return new dLe({name:"czm_depth_view",fragmentShader:OLe})},MLe.createLensFlareStage=function(){return new dLe({name:"czm_lens_flare",fragmentShader:CLe,uniforms:{dirtTexture:Lt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Lt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:H.WGS84.maximumRadius}})};var BLe=MLe;function FLe(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function zLe(e){for(;Object(l.a)(e.length);)e=e.get(e.length-1);return e.name}function kLe(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;const o=n[i.name]={};if(Object(l.a)(r)){o[zLe(e.getStageByName(r))]=!0}const a=i.uniforms;if(Object(l.a)(a)){const t=Object.getOwnPropertyNames(a),n=t.length;for(let i=0;i<n;++i){const n=a[t[i]];if("string"==typeof n){const t=e.getStageByName(n);Object(l.a)(t)&&(o[zLe(t)]=!0)}}}return i.name}function ULe(e,t,n,i,r){if(Object(l.a)(i.enabled)&&!i.enabled||Object(l.a)(i._isSupported)&&!i._isSupported(t))return r;const o=r,a=!Object(l.a)(i.inputPreviousStageTexture)||i.inputPreviousStageTexture;let s=r;const c=i.length;for(let o=0;o<c;++o){const c=i.get(o);s=Object(l.a)(c.length)?ULe(e,t,n,c,r):kLe(e,t,n,c,r),a&&(r=s)}let u,h;if(a)for(u=1;u<c;++u)h=zLe(i.get(u)),Object(l.a)(n[h])||(n[h]={}),n[h][o]=!0;else for(u=1;u<c;++u){h=zLe(i.get(u));const e=n[h];for(let t=0;t<u;++t)e[zLe(i.get(t))]=!0}return s}function VLe(e,t,n){const i=e._collection.getStageByName(t),r=i._textureScale,o=i._forcePowerOfTwo,a=i._pixelFormat,s=i._pixelDatatype,c=i._clearColor;let u,h;const d=e._framebuffers,f=d.length;for(u=0;u<f;++u){if(h=d[u],r!==h.textureScale||o!==h.forcePowerOfTwo||a!==h.pixelFormat||s!==h.pixelDatatype||!sp.equals(c,h.clearColor))continue;const e=h.stages,t=e.length;let i=!1;for(let r=0;r<t;++r)if(n[e[r]]){i=!0;break}if(!i)break}return Object(l.a)(h)&&u<f?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:o,pixelFormat:a,pixelDatatype:s,clearColor:c,stages:[t],buffer:new h$({pixelFormat:a,pixelDatatype:s}),clear:void 0},d.push(h),h)}function HLe(e,t){const n=function(e,t){const n={};if(Object(l.a)(e.ambientOcclusion)){const i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,a=e.fxaa;let s=ULe(e,t,n,i,void 0);s=ULe(e,t,n,r,s),s=kLe(e,t,n,o,s),s=ULe(e,t,n,e,s),kLe(e,t,n,a,s)}else ULe(e,t,n,e,void 0);return n}(e._collection,t);for(const t in n)n.hasOwnProperty(t)&&(e._stageNameToFramebuffer[t]=VLe(e,t,n[t]))}function GLe(e){const t=e._framebuffers,n=t.length;for(let e=0;e<n;++e){t[e].buffer.destroy()}}FLe.prototype.updateDependencies=function(){this._updateDependencies=!0},FLe.prototype.update=function(e){const t=this._collection,n=this._updateDependencies,i=Object(l.a)(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=Object(l.a)(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=Object(l.a)(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),a=Object(l.a)(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!Object(l.a)(t._activeStages)||t._activeStages.length>0||i||r||o||a;if((n||!s&&this._framebuffers.length>0)&&(GLe(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!s)return;0===this._framebuffers.length&&HLe(this,e);const c=e.drawingBufferWidth,u=e.drawingBufferHeight,d=this._width!==c||this._height!==u;(n||d)&&(this._width=c,this._height=u,this._updateDependencies=!1,GLe(this),function(e,t){const n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let e=0;e<o;++e){const o=r[e],a=o.textureScale;let s=Math.ceil(n*a),c=Math.ceil(i*a),l=Math.min(s,c);o.forcePowerOfTwo&&(h.a.isPowerOfTwo(l)||(l=h.a.nextPowerOfTwo(l)),s=l,c=l),o.buffer.update(t,s,c),o.clear=new UU({color:o.clearColor,framebuffer:o.buffer.framebuffer})}}(this,e))},FLe.prototype.clear=function(e){const t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)},FLe.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},FLe.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},FLe.prototype.getFramebuffer=function(e){const t=this._stageNameToFramebuffer[e];if(Object(l.a)(t))return t.buffer.framebuffer},FLe.prototype.isDestroyed=function(){return!1},FLe.prototype.destroy=function(){return GLe(this),sc(this)};var qLe=FLe;const WLe={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===WLe.REINHARD||e===WLe.MODIFIED_REINHARD||e===WLe.FILMIC||e===WLe.ACES}};var YLe=Object.freeze(WLe);const XLe=[];function KLe(){const e=BLe.createFXAAStage(),t=BLe.createAmbientOcclusionStage(),n=BLe.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=BLe.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=YLe.ACES;const i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;const r=new qLe(this),o={},a=XLe;for(a.push(e,t,n,i);a.length>0;){const e=a.pop();o[e.name]=e,e._textureCache=r;const t=e.length;if(Object(l.a)(t))for(let n=0;n<t;++n)a.push(e.get(n))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;const s=this;t.uniforms.randomTexture=function(){return s._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}function JLe(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;const t=[],n=e._stages,i=n.length;for(let e=0,r=0;e<i;++e){const i=n[e];i&&(i._index=r++,t.push(i))}e._stages=t}function ZLe(e){for(;Object(l.a)(e.length);)e=e.get(e.length-1);return e.outputTexture}function $Le(e,t,n,i,r){if(Object(l.a)(e.execute))return void e.execute(t,n,i,r);const o=e.length;let a;if(e.inputPreviousStageTexture)for($Le(e.get(0),t,n,i,r),a=1;a<o;++a)$Le(e.get(a),t,ZLe(e.get(a-1)),i,r);else for(a=0;a<o;++a)$Le(e.get(a),t,n,i,r)}Object.defineProperties(KLe.prototype,{ready:{get:function(){let e=!1;const t=this._stages;for(let n=t.length-1;n>=0;--n){const i=t[n];e=e||i.ready&&i.enabled}const n=this._fxaa,i=this._ao,r=this._bloom,o=this._tonemapping;return e=e||n.ready&&n.enabled,e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return JLe(this),this._stages.length}},outputTexture:{get:function(){const e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);const t=this._stages;for(let e=t.length-1;e>=0;--e){const n=t[e];if(Object(l.a)(n)&&n.ready&&n.enabled)return this.getOutputTexture(n.name)}const n=this._tonemapping;if(n.enabled&&n.ready)return this.getOutputTexture(n.name);const i=this._bloom;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);const r=this._ao;return r.enabled&&r.ready?this.getOutputTexture(r.name):void 0}},hasSelected:{get:function(){const e=this._stages.slice();for(;e.length>0;){const t=e.pop();if(!Object(l.a)(t))continue;if(Object(l.a)(t.selected))return!0;const n=t.length;if(Object(l.a)(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;if(!YLe.validate(e))throw new u.a("tonemapper was set to an invalid value.");Object(l.a)(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());const t=this._autoExposureEnabled;let n;switch(e){case YLe.REINHARD:n=BLe.createReinhardTonemappingStage(t);break;case YLe.MODIFIED_REINHARD:n=BLe.createModifiedReinhardTonemappingStage(t);break;case YLe.FILMIC:n=BLe.createFilmicTonemappingStage(t);break;default:n=BLe.createAcesTonemappingStage(t)}if(t){const e=this._autoExposure;n.uniforms.autoExposure=function(){return e.outputTexture}}this._tonemapper=e,this._tonemapping=n,Object(l.a)(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}}}),KLe.prototype.add=function(e){s.a.typeOf.object("stage",e);const t=this._stageNames,n=XLe;for(n.push(e);n.length>0;){const e=n.pop();if(Object(l.a)(t[e.name]))throw new u.a(e.name+" has already been added to the collection or does not have a unique name.");t[e.name]=e,e._textureCache=this._textureCache;const i=e.length;if(Object(l.a)(i))for(let t=0;t<i;++t)n.push(e.get(t))}const i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e},KLe.prototype.remove=function(e){if(!this.contains(e))return!1;const t=this._stageNames,n=XLe;for(n.push(e);n.length>0;){const e=n.pop();delete t[e.name];const i=e.length;if(Object(l.a)(i))for(let t=0;t<i;++t)n.push(e.get(t))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},KLe.prototype.contains=function(e){return Object(l.a)(e)&&Object(l.a)(e._index)&&e._textureCache===this._textureCache},KLe.prototype.get=function(e){JLe(this);const t=this._stages,n=t.length;return s.a.typeOf.number.greaterThanOrEquals("stages length",n,0),s.a.typeOf.number.greaterThanOrEquals("index",e,0),s.a.typeOf.number.lessThan("index",e,n),t[e]},KLe.prototype.removeAll=function(){const e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0},KLe.prototype.getStageByName=function(e){return this._stageNames[e]},KLe.prototype.update=function(e,t,n){JLe(this);const i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;const o=this._stages;let a,s,c=r.length=o.length,u=0;for(a=0;a<c;++a)s=o[a],s.ready&&s.enabled&&s._isSupported(e)&&(r[u++]=s);r.length=u;let h=u!==i.length;if(!h)for(a=0;a<u;++a)if(r[a]!==i[a]){h=!0;break}const d=this._ao,f=this._bloom,p=this._autoExposure,m=this._tonemapping,g=this._fxaa;m.enabled=n;const _=d.enabled&&d._isSupported(e),y=f.enabled&&f._isSupported(e),b=m.enabled&&m._isSupported(e),v=g.enabled&&g._isSupported(e);if((h||this._textureCacheDirty||_!==this._aoEnabled||y!==this._bloomEnabled||b!==this._tonemappingEnabled||v!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=_,this._bloomEnabled=y,this._tonemappingEnabled=b,this._fxaaEnabled=v,this._textureCacheDirty=!1),Object(l.a)(this._randomTexture)&&!_&&(this._randomTexture.destroy(),this._randomTexture=void 0),!Object(l.a)(this._randomTexture)&&_){c=196608;const t=new Uint8Array(c);for(a=0;a<c;a+=3)t[a]=Math.floor(255*Math.random());this._randomTexture=new JD({context:e,pixelFormat:aT.RGB,pixelDatatype:rT.UNSIGNED_BYTE,source:{arrayBufferView:t,width:256,height:256},sampler:new WD({wrapS:GD.REPEAT,wrapT:GD.REPEAT,minificationFilter:VD.NEAREST,magnificationFilter:kD.NEAREST})})}for(this._textureCache.update(e),g.update(e,t),d.update(e,t),f.update(e,t),m.update(e,t),this._autoExposureEnabled&&p.update(e,t),c=o.length,a=0;a<c;++a)o[a].update(e,t);for(u=0,a=0;a<c;++a)s=o[a],s.ready&&s.enabled&&s._isSupported(e)&&u++;h=u!==r.length,h&&this.update(e,t,n)},KLe.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},KLe.prototype.getOutputTexture=function(e){const t=this.getStageByName(e);if(Object(l.a)(t))return ZLe(t)},KLe.prototype.execute=function(e,t,n,i){const r=this._activeStages,o=r.length,a=this._fxaa,s=this._ao,c=this._bloom,l=this._autoExposure,u=this._tonemapping,h=s.enabled&&s._isSupported(e),d=c.enabled&&c._isSupported(e),f=this._autoExposureEnabled,p=u.enabled&&u._isSupported(e),m=a.enabled&&a._isSupported(e);if(!(m||h||d||p||0!==o))return;let g=t;h&&s.ready&&($Le(s,e,g,n,i),g=ZLe(s)),d&&c.ready&&($Le(c,e,g,n,i),g=ZLe(c)),f&&l.ready&&$Le(l,e,g,n,i),p&&u.ready&&($Le(u,e,g,n,i),g=ZLe(u));let _=g;if(o>0){$Le(r[0],e,g,n,i);for(let t=1;t<o;++t)$Le(r[t],e,ZLe(r[t-1]),n,i);_=ZLe(r[o-1])}m&&a.ready&&$Le(a,e,_,n,i)},KLe.prototype.copy=function(e,t){if(!Object(l.a)(this._copyColorCommand)){const t=this;this._copyColorCommand=e.createViewportQuadCommand(VPe,{uniformMap:{colorTexture:function(){return t.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},KLe.prototype.isDestroyed=function(){return!1},KLe.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),sc(this)};var QLe=KLe;function eNe(){u.a.throwInstantiationError()}eNe.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},Object.defineProperties(eNe.prototype,{quadtree:{get:u.a.throwInstantiationError,set:u.a.throwInstantiationError},ready:{get:u.a.throwInstantiationError},tilingScheme:{get:u.a.throwInstantiationError},errorEvent:{get:u.a.throwInstantiationError}}),eNe.prototype.update=u.a.throwInstantiationError,eNe.prototype.beginUpdate=u.a.throwInstantiationError,eNe.prototype.endUpdate=u.a.throwInstantiationError,eNe.prototype.getLevelMaximumGeometricError=u.a.throwInstantiationError,eNe.prototype.loadTile=u.a.throwInstantiationError,eNe.prototype.computeTileVisibility=u.a.throwInstantiationError,eNe.prototype.showTileThisFrame=u.a.throwInstantiationError,eNe.prototype.computeDistanceToTile=u.a.throwInstantiationError,eNe.prototype.isDestroyed=u.a.throwInstantiationError,eNe.prototype.destroy=u.a.throwInstantiationError;var tNe=eNe;function nNe(e){s.a.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}nNe.prototype.completeMorph=function(){Object(l.a)(this._completeMorph)&&this._completeMorph()},nNe.prototype.morphTo2D=function(e,t){Object(l.a)(this._completeMorph)&&this._completeMorph();const n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof nv,this._previousMode!==AB.SCENE2D&&this._previousMode!==AB.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,AB.SCENE2D,!0),n._mode=AB.MORPHING,n.camera._setTransform(Me.IDENTITY),this._previousMode===AB.COLUMBUS_VIEW?function(e,t){t*=.5;const n=e._scene,i=n.camera,r=O.clone(i.position,zNe),o=O.clone(i.direction,kNe),a=O.clone(i.up,UNe),s=O.negate(O.UNIT_Z,HNe),c=O.clone(O.UNIT_Y,GNe),u=VNe;if(t>0)O.clone(O.ZERO,VNe),u.z=5*n.mapProjection.ellipsoid.maximumRadius;else{O.clone(r,VNe);const e=WNe;Me.multiplyByPoint(LAe.TRANSFORM_2D,r,e.origin),Me.multiplyByPointAsVector(LAe.TRANSFORM_2D,o,e.direction);const t=n.globe;if(Object(l.a)(t)){const i=t.pickWorldCoordinates(e,n,!0,YNe);Object(l.a)(i)&&(Me.multiplyByPoint(LAe.TRANSFORM_2D_INVERSE,i,u),u.z+=O.distance(r,u))}}const h=qNe;h.right=.5*u.z,h.left=-h.right,h.top=h.right*(n.drawingBufferHeight/n.drawingBufferWidth),h.bottom=-h.top;const d=XNe;d.position=u,d.direction=s,d.up=c,d.frustum=h;const f=aBe(d);function p(e,t){e.position.z=t}_Ne(e,f);const m=n.tweens.add({duration:t,easingFunction:_b.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){BNe(r,u,e.time,i.position),BNe(o,s,e.time,i.direction),BNe(a,c,e.time,i.up),O.cross(i.direction,i.up,i.right),O.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)},complete:function(){FNe(e,t,d,p,f)}});e._currentTweens.push(m)}(this,e):function(e,t,n){t*=.5;const i=e._scene,r=i.camera,o=JNe;if(t>0)O.clone(O.ZERO,o.position),o.position.z=5*n.maximumRadius,O.negate(O.UNIT_Z,o.direction),O.clone(O.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,KNe),i.mapProjection.project(KNe,o.position),O.negate(O.UNIT_Z,o.direction),O.clone(O.UNIT_Y,o.up);const e=QNe;O.clone(o.position2D,e.origin);const t=O.clone(r.directionWC,e.direction),a=n.scaleToGeodeticSurface(r.positionWC,tBe),s=ca.eastNorthUpToFixedFrame(a,n,eBe);Me.inverseTransformation(s,s),Me.multiplyByPointAsVector(s,t,t),Me.multiplyByPointAsVector(LAe.TRANSFORM_2D,t,t);const c=i.globe;if(Object(l.a)(c)){const t=c.pickWorldCoordinates(e,i,!0,$Ne);if(Object(l.a)(t)){const e=O.distance(o.position2D,t);t.x+=e,O.clone(t,o.position2D)}}}function a(e,t){e.position.x=t}Me.multiplyByPoint(LAe.TRANSFORM_2D,o.position,o.position2D),Me.multiplyByPointAsVector(LAe.TRANSFORM_2D,o.direction,o.direction2D),Me.multiplyByPointAsVector(LAe.TRANSFORM_2D,o.up,o.up2D);const s=o.frustum;s.right=.5*o.position.z,s.left=-s.right,s.top=s.right*(i.drawingBufferHeight/i.drawingBufferWidth),s.bottom=-s.top;const c=ZNe;Me.multiplyByPoint(LAe.TRANSFORM_2D_INVERSE,o.position2D,c.position),O.clone(o.direction,c.direction),O.clone(o.up,c.up),c.frustum=s;const u=aBe(c);_Ne(e,u),iBe(e,t,o,(function(){FNe(e,t,o,a,u)}))}(this,e,t),0===e&&Object(l.a)(this._completeMorph)&&this._completeMorph())};const iNe=new O,rNe=new O,oNe=new O,aNe=new O,sNe=new O,cNe=new O,lNe=new O,uNe=new R,hNe=new Me,dNe=new dv,fNe=new nv,pNe={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};nNe.prototype.morphToColumbusView=function(e,t){Object(l.a)(this._completeMorph)&&this._completeMorph();const n=this._scene;if(this._previousMode=n.mode,this._previousMode===AB.COLUMBUS_VIEW||this._previousMode===AB.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,AB.COLUMBUS_VIEW,!0),n.camera._setTransform(Me.IDENTITY);let i=iNe;const r=rNe,o=oNe;if(e>0)i.x=0,i.y=-1,i.z=1,i=O.multiplyByScalar(O.normalize(i,i),5*t.maximumRadius,i),O.negate(O.normalize(i,r),r),O.cross(O.UNIT_X,r,o);else{const e=n.camera;if(this._previousMode===AB.SCENE2D)O.clone(e.position,i),i.z=e.frustum.right-e.frustum.left,O.negate(O.UNIT_Z,r),O.clone(O.UNIT_Y,o);else{O.clone(e.positionWC,i),O.clone(e.directionWC,r),O.clone(e.upWC,o);const a=t.scaleToGeodeticSurface(i,lNe),s=ca.eastNorthUpToFixedFrame(a,t,hNe);Me.inverseTransformation(s,s),n.mapProjection.project(t.cartesianToCartographic(i,uNe),i),Me.multiplyByPointAsVector(s,r,r),Me.multiplyByPointAsVector(s,o,o)}}let a;this._morphToOrthographic?(a=fNe,a.width=n.camera.frustum.right-n.camera.frustum.left,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(a=dNe,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=h.a.toRadians(60));const s=pNe;s.position=i,s.direction=r,s.up=o,s.frustum=a;const c=function(e){return function(t){const n=t._scene;n._mode=AB.COLUMBUS_VIEW,n.morphTime=AB.getMorphTime(AB.COLUMBUS_VIEW),yNe(t);const i=n.camera;(t._previousModeMode!==AB.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,O.clone(e.position,i.position),O.clone(e.direction,i.direction),O.clone(e.up,i.up),O.cross(i.direction,i.up,i.right),O.normalize(i.right,i.right));const r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);const o=Object(l.a)(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,AB.COLUMBUS_VIEW,o)}}(s);_Ne(this,c),this._previousMode===AB.SCENE2D?function(e,t,n,i){t*=.5;const r=e._scene,o=r.camera,a=O.clone(n.position,MNe),s=O.clone(n.direction,LNe),c=O.clone(n.up,NNe);function l(){o.frustum=n.frustum.clone();const l=O.clone(o.position,DNe),u=O.clone(o.direction,RNe),h=O.clone(o.up,jNe);l.z=a.z;const d=r.tweens.add({duration:t,easingFunction:_b.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){BNe(l,a,e.time,o.position),BNe(u,s,e.time,o.direction),BNe(h,c,e.time,o.up),O.cross(o.direction,o.up,o.right),O.normalize(o.right,o.right)},complete:function(){i(e)}});e._currentTweens.push(d)}r._mode=AB.MORPHING,e._morphToOrthographic?l():nBe(e,0,n,l)}(this,e,s,c):(s.position2D=Me.multiplyByPoint(LAe.TRANSFORM_2D,i,aNe),s.direction2D=Me.multiplyByPointAsVector(LAe.TRANSFORM_2D,r,sNe),s.up2D=Me.multiplyByPointAsVector(LAe.TRANSFORM_2D,o,cNe),n._mode=AB.MORPHING,iBe(this,e,s,c)),0===e&&Object(l.a)(this._completeMorph)&&this._completeMorph()};const mNe={position:new O,direction:new O,up:new O,frustum:void 0},gNe=new dv;function _Ne(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ZS(e._scene.canvas);const n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,fS.LEFT_DOWN),e._morphHandler.setInputAction(n,fS.MIDDLE_DOWN),e._morphHandler.setInputAction(n,fS.RIGHT_DOWN),e._morphHandler.setInputAction(n,fS.WHEEL)}}function yNe(e){const t=e._currentTweens;for(let e=0;e<t.length;++e)t[e].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}nNe.prototype.morphTo3D=function(e,t){Object(l.a)(this._completeMorph)&&this._completeMorph();const n=this._scene;if(this._previousMode=n.mode,this._previousMode!==AB.SCENE3D&&this._previousMode!==AB.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,AB.SCENE3D,!0),n._mode=AB.MORPHING,n.camera._setTransform(Me.IDENTITY),this._previousMode===AB.SCENE2D)!function(e,t,n){t/=3;const i=e._scene,r=i.camera;let o,a;t>0?(o=mNe,O.fromDegrees(0,0,5*n.maximumRadius,n,o.position),O.negate(o.position,o.direction),O.normalize(o.direction,o.direction),O.clone(O.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=wNe(e,n));e._morphToOrthographic?(a=PNe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.width=r.frustum.right-r.frustum.left):(a=gNe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.fov=h.a.toRadians(60));o.frustum=a;const s=oBe(o);let c;_Ne(e,s),c=e._morphToOrthographic?function(){INe(e,t,o,s)}:function(){nBe(e,t,o,(function(){INe(e,t,o,s)}))};t>0?(i._mode=AB.SCENE2D,r.flyTo({duration:t,destination:O.fromDegrees(0,0,5*n.maximumRadius,n,MNe),complete:function(){i._mode=AB.MORPHING,c()}})):c()}(this,e,t);else{let i,r;e>0?(i=mNe,O.fromDegrees(0,0,5*t.maximumRadius,t,i.position),O.negate(i.position,i.direction),O.normalize(i.direction,i.direction),O.clone(O.UNIT_Z,i.up)):i=wNe(this,t);const o=n.camera;o.frustum instanceof nv?r=o.frustum.clone():(r=gNe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=h.a.toRadians(60)),i.frustum=r;const a=oBe(i);_Ne(this,a),INe(this,e,i,a)}0===e&&Object(l.a)(this._completeMorph)&&this._completeMorph()}},nNe.prototype.isDestroyed=function(){return!1},nNe.prototype.destroy=function(){return yNe(this),sc(this)};const bNe=new R,vNe=new O,ONe=new Me;function wNe(e,t){const n=e._scene,i=n.camera,r=mNe,o=r.position,a=r.direction,s=r.up,c=n.mapProjection.unproject(i.position,bNe);t.cartographicToCartesian(c,o);const l=t.scaleToGeodeticSurface(o,vNe),u=ca.eastNorthUpToFixedFrame(l,t,ONe);return Me.multiplyByPointAsVector(u,i.direction,a),Me.multiplyByPointAsVector(u,i.up,s),r}const ANe=new O,ENe=new O,TNe=new O,CNe=new O,xNe=new O,SNe=new O;function INe(e,t,n,i){t*=.5;const r=e._scene,o=r.camera,a=O.clone(o.position,ANe),s=O.clone(o.direction,ENe),c=O.clone(o.up,TNe),l=Me.multiplyByPoint(LAe.TRANSFORM_2D_INVERSE,n.position,CNe),u=Me.multiplyByPointAsVector(LAe.TRANSFORM_2D_INVERSE,n.direction,xNe),h=Me.multiplyByPointAsVector(LAe.TRANSFORM_2D_INVERSE,n.up,SNe);const d=r.tweens.add({duration:t,easingFunction:_b.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){BNe(a,l,e.time,o.position),BNe(s,u,e.time,o.direction),BNe(c,h,e.time,o.up),O.cross(o.direction,o.up,o.right),O.normalize(o.right,o.right)},complete:function(){rBe(e,r,0,1,t,i)}});e._currentTweens.push(d)}const PNe=new nv,DNe=new O,RNe=new O,jNe=new O,MNe=new O,LNe=new O,NNe=new O;function BNe(e,t,n,i){return O.lerp(e,t,n,i)}function FNe(e,t,n,i,r){const o=e._scene,a=o.camera;if(a.frustum instanceof nv)return;const s=a.frustum.fov,c=.5*h.a.RADIANS_PER_DEGREE,l=n.position.z*Math.tan(.5*s);a.frustum.far=l/Math.tan(.5*c)+1e7;const u=o.tweens.add({duration:t,easingFunction:_b.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=h.a.lerp(s,c,e.time);const t=l/Math.tan(.5*a.frustum.fov);i(a,t)},complete:function(){a.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(u)}const zNe=new O,kNe=new O,UNe=new O,VNe=new O,HNe=new O,GNe=new O,qNe=new Qb,WNe=new Gn,YNe=new O,XNe={position:void 0,direction:void 0,up:void 0,frustum:void 0};const KNe=new R,JNe={position:new O,direction:new O,up:new O,position2D:new O,direction2D:new O,up2D:new O,frustum:new Qb},ZNe={position:new O,direction:new O,up:new O,frustum:void 0},$Ne=new O,QNe=new Gn,eBe=new Me,tBe=new O;function nBe(e,t,n,i){const r=e._scene,o=r.camera,a=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();const s=o.frustum.fov,c=.5*h.a.RADIANS_PER_DEGREE,l=a*Math.tan(.5*s);o.frustum.far=l/Math.tan(.5*c)+1e7,o.frustum.fov=c;const u=r.tweens.add({duration:t,easingFunction:_b.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){o.frustum.fov=h.a.lerp(c,s,e.time),o.position.z=l/Math.tan(.5*o.frustum.fov)},complete:function(){i(e)}});e._currentTweens.push(u)}function iBe(e,t,n,i){const r=e._scene,o=r.camera,a=O.clone(o.position,DNe),s=O.clone(o.direction,RNe),c=O.clone(o.up,jNe),l=O.clone(n.position2D,MNe),u=O.clone(n.direction2D,LNe),h=O.clone(n.up2D,NNe);const d=r.tweens.add({duration:t,easingFunction:_b.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){BNe(a,l,e.time,o.position),BNe(s,u,e.time,o.direction),BNe(c,h,e.time,o.up),O.cross(o.direction,o.up,o.right),O.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)},complete:function(){rBe(e,r,1,0,t,i)}});e._currentTweens.push(d)}function rBe(e,t,n,i,r,o){const a={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:_b.QUARTIC_OUT};Object(l.a)(o)&&(a.complete=function(){o(e)});const s=t.tweens.addProperty(a);e._currentTweens.push(s)}function oBe(e){return function(t){const n=t._scene;n._mode=AB.SCENE3D,n.morphTime=AB.getMorphTime(AB.SCENE3D),yNe(t);const i=n.camera;(t._previousMode!==AB.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,O.clone(e.position,i.position),O.clone(e.direction,i.direction),O.clone(e.up,i.up),O.cross(i.direction,i.up,i.right),O.normalize(i.right,i.right),i.frustum=e.frustum.clone());const r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);const o=Object(l.a)(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,AB.SCENE3D,o)}}function aBe(e){return function(t){const n=t._scene;n._mode=AB.SCENE2D,n.morphTime=AB.getMorphTime(AB.SCENE2D),yNe(t);const i=n.camera;O.clone(e.position,i.position),i.position.z=2*n.mapProjection.ellipsoid.maximumRadius,O.clone(e.direction,i.direction),O.clone(e.up,i.up),O.cross(i.direction,i.up,i.right),O.normalize(i.right,i.right),i.frustum=e.frustum.clone();const r=Object(l.a)(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,AB.SCENE2D,r)}}var sBe=nNe;function cBe(e,t,n,i,r,o,a,s,c,l){this._tweens=e,this._tweenjs=t,this._startObject=Object(Zf.a)(n),this._stopObject=Object(Zf.a)(i),this._duration=r,this._delay=o,this._easingFunction=a,this._update=s,this._complete=c,this.cancel=l,this.needsStart=!0}function lBe(){this._tweens=[]}Object.defineProperties(cBe.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),cBe.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(lBe.prototype,{length:{get:function(){return this._tweens.length}}}),lBe.prototype.add=function(e){if(e=Object(c.a)(e,c.a.EMPTY_OBJECT),!Object(l.a)(e.startObject)||!Object(l.a)(e.stopObject))throw new u.a("options.startObject and options.stopObject are required.");if(!Object(l.a)(e.duration)||e.duration<0)throw new u.a("options.duration is required and must be positive.");if(0===e.duration)return Object(l.a)(e.complete)&&e.complete(),new cBe(this);const t=e.duration/ji.SECONDS_PER_MILLISECOND,n=Object(c.a)(e.delay,0),i=n/ji.SECONDS_PER_MILLISECOND,r=Object(c.a)(e.easingFunction,_b.LINEAR_NONE),o=e.startObject,a=new mb.a.Tween(o);a.to(Object(Zf.a)(e.stopObject),t),a.delay(i),a.easing(r),Object(l.a)(e.update)&&a.onUpdate((function(){e.update(o)})),a.onComplete(Object(c.a)(e.complete,null)),a.repeat(Object(c.a)(e._repeat,0));const s=new cBe(this,a,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(s),s},lBe.prototype.addProperty=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).object,n=e.property,i=e.startValue,r=e.stopValue;if(!Object(l.a)(t)||!Object(l.a)(e.property))throw new u.a("options.object and options.property are required.");if(!Object(l.a)(t[n]))throw new u.a("options.object must have the specified property.");if(!Object(l.a)(i)||!Object(l.a)(r))throw new u.a("options.startValue and options.stopValue are required.");return this.add({startObject:{value:i},stopObject:{value:r},duration:Object(c.a)(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){t[n]=e.value},complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},lBe.prototype.addAlpha=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).material;if(!Object(l.a)(t))throw new u.a("options.material is required.");const n=[];for(const e in t.uniforms)t.uniforms.hasOwnProperty(e)&&Object(l.a)(t.uniforms[e])&&Object(l.a)(t.uniforms[e].alpha)&&n.push(e);if(0===n.length)throw new u.a("material has no properties with alpha components.");return this.add({startObject:{alpha:Object(c.a)(e.startValue,0)},stopObject:{alpha:Object(c.a)(e.stopValue,1)},duration:Object(c.a)(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){const i=n.length;for(let r=0;r<i;++r)t.uniforms[n[r]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},lBe.prototype.addOffsetIncrement=function(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).material;if(!Object(l.a)(t))throw new u.a("material is required.");if(!Object(l.a)(t.uniforms.offset))throw new u.a("material.uniforms must have an offset property.");const n=t.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},lBe.prototype.remove=function(e){if(!Object(l.a)(e))return!1;const t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),Object(l.a)(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},lBe.prototype.removeAll=function(){const e=this._tweens;for(let t=0;t<e.length;++t){const n=e[t];n.tweenjs.stop(),Object(l.a)(n.cancel)&&n.cancel()}e.length=0},lBe.prototype.contains=function(e){return Object(l.a)(e)&&-1!==this._tweens.indexOf(e)},lBe.prototype.get=function(e){if(!Object(l.a)(e))throw new u.a("index is required.");return this._tweens[e]},lBe.prototype.update=function(e){const t=this._tweens;let n=0;for(e=Object(l.a)(e)?e/ji.SECONDS_PER_MILLISECOND:Xf();n<t.length;){const i=t[n],r=i.tweenjs;i.needsStart?(i.needsStart=!1,r.start(e)):r.update(e)?n++:(r.stop(),t.splice(n,1))}};var uBe=lBe;function hBe(e){if(!Object(l.a)(e))throw new u.a("scene is required.");this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=NAe.LEFT_DRAG,this.zoomEventTypes=[NAe.RIGHT_DRAG,NAe.WHEEL,NAe.PINCH],this.rotateEventTypes=NAe.LEFT_DRAG,this.tiltEventTypes=[NAe.MIDDLE_DRAG,NAe.PINCH,{eventType:NAe.LEFT_DRAG,modifier:ZA.CTRL},{eventType:NAe.RIGHT_DRAG,modifier:ZA.CTRL}],this.lookEventTypes={eventType:NAe.LEFT_DRAG,modifier:ZA.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new GAe(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new uBe,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Vt(-1,-1),this._tiltCenter=new O,this._rotateMousePosition=new Vt(-1,-1),this._rotateStartPosition=new O,this._strafeStartPosition=new O,this._strafeMousePosition=new Vt,this._strafeEndMousePosition=new Vt,this._zoomMouseStart=new Vt(-1,-1),this._zoomWorldPosition=new O,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;const t=e.mapProjection;this._maxCoord=t.project(new R(Math.PI,h.a.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function dBe(e,t,n,i,r,o,a){let s=o[a];Object(l.a)(s)||(s=o[a]={startPosition:new Vt,endPosition:new Vt,motion:new Vt,inertiaEnabled:!0});const c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),d=c&&u&&(u.getTime()-c.getTime())/1e3,f=new Date,p=u&&(f.getTime()-u.getTime())/1e3;if(c&&u&&d<.4){const a=function(e,t){if(e<0)return 0;const n=25*(1-t);return Math.exp(-n*e)}(p,i),c=e.getLastMovement(t,n);if(!Object(l.a)(c)||(m=c,Vt.equalsEpsilon(m.startPosition,m.endPosition,h.a.EPSILON14))||!s.inertiaEnabled)return;if(s.motion.x=.5*(c.endPosition.x-c.startPosition.x),s.motion.y=.5*(c.endPosition.y-c.startPosition.y),s.startPosition=Vt.clone(c.startPosition,s.startPosition),s.endPosition=Vt.multiplyByScalar(s.motion,a,s.endPosition),s.endPosition=Vt.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||Vt.distance(s.startPosition,s.endPosition)<.5)return;if(!e.isButtonDown(t,n)){r(o,e.getStartMousePosition(t,n),s)}}var m}function fBe(e,t){if(Object(l.a)(t)){let n=e[t];Object(l.a)(n)&&(n.inertiaEnabled=!0);const i=e._inertiaDisablers[t];if(Object(l.a)(i)){const t=i.length;for(let r=0;r<t;++r)n=e[i[r]],Object(l.a)(n)&&(n.inertiaEnabled=!1)}}}const pBe=[];function mBe(e,t,n,i,r,o){if(!Object(l.a)(n))return;const a=e._aggregator;Array.isArray(n)||(pBe[0]=n,n=pBe);const s=n.length;for(let c=0;c<s;++c){const s=n[c],u=Object(l.a)(s.eventType)?s.eventType:s,h=s.modifier,d=a.isMoving(u,h)&&a.getMovement(u,h),f=a.getStartMousePosition(u,h);e.enableInputs&&t&&(d?(i(e,f,d),fBe(e,o)):r<1&&dBe(a,u,h,r,i,e,o))}}const gBe=new Gn,_Be=new O,yBe=new Vt,bBe=new O,vBe=new Vt,OBe=new O,wBe=new O,ABe=new O,EBe=new O,TBe=new O,CBe=new O,xBe=new O,SBe=new O,IBe=new O,PBe=new O,DBe=new O,RBe=new O,jBe=new O,MBe=new O,LBe=new O,NBe=new O,BBe=new O,FBe=new O,zBe={orientation:new ur};function kBe(e,t,n,i,r,o){let a=1;Object(l.a)(o)&&(a=h.a.clamp(Math.abs(o),.25,1));const s=n.endPosition.y-n.startPosition.y,c=s>0?e.minimumZoomDistance*a:0,u=e.maximumZoomDistance;let d=i*(r-c);d=h.a.clamp(d,e._minimumZoomRate,e._maximumZoomRate);let f=s/e._scene.canvas.clientHeight;f=Math.min(f,e.maximumMovementRatio);let p=d*f;if(e.enableCollisionDetection||0===e.minimumZoomDistance||!Object(l.a)(e._globe)){if(p>0&&Math.abs(r-c)<1)return;if(p<0&&Math.abs(r-u)<1)return;r-p<c?p=r-c-1:r-p>u&&(p=r-u)}const m=e._scene,g=m.camera,_=m.mode,y=zBe.orientation;if(y.heading=g.heading,y.pitch=g.pitch,y.roll=g.roll,g.frustum instanceof nv)return void(Math.abs(p)>0&&(g.zoomIn(p),g._adjustOrthographicFrustum()));const b=Vt.equals(t,e._zoomMouseStart);let v,w=e._zoomingOnVector,A=e._rotatingZoom;if(b||(e._zoomMouseStart=Vt.clone(t,e._zoomMouseStart),Object(l.a)(e._globe)&&(_===AB.SCENE2D?(v=g.getPickRay(t,gBe).origin,v=O.fromElements(v.y,v.z,v.x)):v=$Be(e,t,_Be)),Object(l.a)(v)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=O.clone(v,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,w=e._zoomingOnVector=!1,A=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition)return void g.zoomIn(p);let E=_===AB.COLUMBUS_VIEW;if(g.positionCartographic.height<2e6&&(A=!0),!b||A){if(_===AB.SCENE2D){const n=e._zoomWorldPosition,i=g.position;if(!O.equals(n,i)&&g.positionCartographic.height<2*e._maxCoord.x){const r=g.position.x,o=O.subtract(n,i,bBe);O.normalize(o,o);const a=O.distance(n,i)*p/(.5*g.getMagnitude());g.move(o,.5*a),(g.position.x<0&&r>0||g.position.x>0&&r<0)&&(v=g.getPickRay(t,gBe).origin,v=O.fromElements(v.y,v.z,v.x),e._zoomWorldPosition=O.clone(v,e._zoomWorldPosition))}}else if(_===AB.SCENE3D){const t=O.normalize(g.position,TBe);if(e._cameraUnderground||e._zoomingUnderground||g.positionCartographic.height<3e3&&Math.abs(O.dot(g.direction,t))<.6)E=!0;else{const n=m.canvas,i=vBe;i.x=n.clientWidth/2,i.y=n.clientHeight/2;const r=$Be(e,i,OBe);if(Object(l.a)(r))if(g.positionCartographic.height<1e6){if(!(O.dot(g.direction,t)>=-.5)){const n=xBe;O.clone(g.position,n);const i=e._zoomWorldPosition;let r=CBe;if(r=O.normalize(i,r),O.dot(r,t)<0)return;const o=LBe,a=PBe;O.clone(g.direction,a),O.add(n,O.multiplyByScalar(a,1e3,NBe),o);const s=DBe,c=RBe;O.subtract(i,n,s),O.normalize(s,c);const l=O.dot(t,c);if(l>=0)return void(e._zoomMouseStart.x=-1);const u=Math.acos(-l),d=O.magnitude(n),f=O.magnitude(i),m=d-p,_=O.magnitude(s),y=Math.asin(h.a.clamp(_/f*Math.sin(u),-1,1))-Math.asin(h.a.clamp(m/f*Math.sin(u),-1,1))+u,b=SBe;O.normalize(n,b);let v=IBe;v=O.cross(c,b,v),v=O.normalize(v,v),O.normalize(O.cross(b,v,NBe),a),O.multiplyByScalar(O.normalize(o,NBe),O.magnitude(o)-p,o),O.normalize(n,n),O.multiplyByScalar(n,m,n);const w=jBe;O.multiplyByScalar(O.add(O.multiplyByScalar(b,Math.cos(y)-1,BBe),O.multiplyByScalar(a,Math.sin(y),FBe),NBe),m,w),O.add(n,w,n),O.normalize(o,b),O.normalize(O.cross(b,v,NBe),a);const A=MBe;return O.multiplyByScalar(O.add(O.multiplyByScalar(b,Math.cos(y)-1,BBe),O.multiplyByScalar(a,Math.sin(y),FBe),NBe),O.magnitude(o),A),O.add(o,A,o),O.clone(n,g.position),O.normalize(O.subtract(o,n,NBe),g.direction),O.clone(g.direction,g.direction),O.cross(g.direction,g.up,g.right),O.cross(g.right,g.direction,g.up),void g.setView(zBe)}E=!0}else{const t=O.normalize(r,wBe),n=O.normalize(e._zoomWorldPosition,ABe),i=O.dot(n,t);if(i>0&&i<1){const e=h.a.acosClamped(i),r=O.cross(n,t,EBe),o=p/(Math.abs(e)>h.a.toRadians(20)?.75*g.positionCartographic.height:g.positionCartographic.height-p);g.rotate(r,e*o)}}else E=!0}}e._rotatingZoom=!E}if(!b&&E||w){let n;const i=iQ.wgs84ToWindowCoordinates(m,e._zoomWorldPosition,yBe);n=_!==AB.COLUMBUS_VIEW&&Vt.equals(t,e._zoomMouseStart)&&Object(l.a)(i)?g.getPickRay(i,gBe):g.getPickRay(t,gBe);const r=n.direction;_!==AB.COLUMBUS_VIEW&&_!==AB.SCENE2D||O.fromElements(r.y,r.z,r.x,r),g.move(r,p),e._zoomingOnVector=!0}else g.zoomIn(p);e._cameraUnderground||g.setView(zBe)}const UBe=new Gn,VBe=new Gn,HBe=new O;function GBe(e,t,n){const i=e._scene.camera;let r=i.getPickRay(n.startPosition,UBe).origin,o=i.getPickRay(n.endPosition,VBe).origin;r=O.fromElements(r.y,r.z,r.x,r),o=O.fromElements(o.y,o.z,o.x,o);const a=O.subtract(r,o,HBe),s=O.magnitude(a);s>0&&(O.normalize(a,a),i.move(a,s))}function qBe(e,t,n){Object(l.a)(n.distance)&&(n=n.distance);const i=e._scene.camera;kBe(e,t,n,e._zoomFactor,i.getMagnitude())}const WBe=new Vt,YBe=new Vt;function XBe(e,t,n){if(Object(l.a)(n.angleAndHeight))return void function(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate);i<e._minimumRotateRate&&(i=e._minimumRotateRate);const r=e._scene,o=r.camera,a=r.canvas;let s=(n.endPosition.x-n.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);const c=i*s*Math.PI*4;o.twistRight(c)}(e,0,n.angleAndHeight);const i=e._scene,r=i.camera,o=i.canvas,a=o.clientWidth,s=o.clientHeight;let c=WBe;c.x=2/a*n.startPosition.x-1,c.y=2/s*(s-n.startPosition.y)-1,c=Vt.normalize(c,c);let u=YBe;u.x=2/a*n.endPosition.x-1,u.y=2/s*(s-n.endPosition.y)-1,u=Vt.normalize(u,u);let d=h.a.acosClamped(c.x);c.y<0&&(d=h.a.TWO_PI-d);let f=h.a.acosClamped(u.x);u.y<0&&(f=h.a.TWO_PI-f);const p=f-d;r.twistRight(p)}const KBe=new Gn,JBe=new O,ZBe=new O;function $Be(e,t,n){const i=e._scene,r=e._globe,o=i.camera;if(!Object(l.a)(r))return;const a=!e._cameraUnderground;let s;i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,JBe));const c=o.getPickRay(t,KBe),u=r.pickWorldCoordinates(c,i,a,ZBe);return(Object(l.a)(s)?O.distance(s,o.positionWC):Number.POSITIVE_INFINITY)<(Object(l.a)(u)?O.distance(u,o.positionWC):Number.POSITIVE_INFINITY)?O.clone(s,n):O.clone(u,n)}const QBe=new R;function eFe(e){const t=e._ellipsoid,n=e._scene,i=n.camera;let r=0;if(n.mode===AB.SCENE3D){const e=t.cartesianToCartographic(i.position,QBe);Object(l.a)(e)&&(r=e.height)}else r=i.position.z;const o=Object(c.a)(e._scene.globeHeight,0);return Math.abs(o-r)}const tFe=new O;function nFe(e,t){const n=t.origin,i=t.direction,r=eFe(e),o=O.normalize(n,tFe);let a=Math.abs(O.dot(o,i));return a=2*Math.max(a,.5),r*a}function iFe(e,t,n,i){let r=O.distance(t.origin,n);const o=eFe(e);return r>h.a.clamp(5*o,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance)&&(r=Math.min(r,o/5),r=Math.max(r,100)),Gn.getPoint(t,r,i)}function rFe(e,t,n,i){let r;return Object(l.a)(n)?(r=O.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=eFe(e))):r=eFe(e),Gn.getPoint(t,r,i)}const oFe=new Vt;function aFe(e,t){const n=t.endPosition,i=Vt.subtract(t.endPosition,t.startPosition,oFe),r=e._strafeEndMousePosition;Vt.add(r,i,r),t.endPosition=r,UFe(e,t,e._strafeStartPosition),t.endPosition=n}const sFe=new Gn,cFe=new Gn,lFe=new O,uFe=new O,hFe=new O,dFe=new O,fFe=new xi(O.UNIT_X,0),pFe=new Vt,mFe=new Vt;function gFe(e,t,n){if(O.equals(t,e._translateMousePosition)||(e._looking=!1),O.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking)return void xze(e,t,n);if(e._strafing)return void aFe(e,n);const i=e._scene.camera,r=e._cameraUnderground,o=Vt.clone(n.startPosition,pFe),a=Vt.clone(n.endPosition,mFe);let s=i.getPickRay(o,sFe);const c=O.clone(O.ZERO,dFe),u=O.UNIT_X;let d;if(i.position.z<e._minimumPickingTerrainHeight&&(d=$Be(e,o,lFe),Object(l.a)(d)&&(c.x=d.x)),r||c.x>i.position.z&&Object(l.a)(d)){let i=d;return r&&(i=rFe(e,s,d,lFe)),Vt.clone(t,e._strafeMousePosition),Vt.clone(t,e._strafeEndMousePosition),O.clone(i,e._strafeStartPosition),e._strafing=!0,void UFe(e,n,e._strafeStartPosition)}const f=xi.fromPointNormal(c,u,fFe);s=i.getPickRay(o,sFe);const p=vi.rayPlane(s,f,lFe),m=i.getPickRay(a,cFe),g=vi.rayPlane(m,f,uFe);if(!Object(l.a)(p)||!Object(l.a)(g))return e._looking=!0,xze(e,t,n),void Vt.clone(t,e._translateMousePosition);const _=O.subtract(p,g,hFe),y=_.x;_.x=_.y,_.y=_.z,_.z=y;const b=O.magnitude(_);b>h.a.EPSILON6&&(O.normalize(_,_),i.move(_,b))}const _Fe=new Vt,yFe=new Gn,bFe=new O,vFe=new O,OFe=new Me,wFe=new Me,AFe=new O,EFe=new xi(O.UNIT_X,0),TFe=new O,CFe=new R,xFe=new Me,SFe=new To,IFe=new ce,PFe=new O;function DFe(e,t,n){if(Object(l.a)(n.angleAndHeight)&&(n=n.angleAndHeight),Vt.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking)return void xze(e,t,n);const i=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(i.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,function(e,t,n){const i=e._scene,r=i.camera,o=i.canvas,a=_Fe;a.x=o.clientWidth/2,a.y=o.clientHeight/2;const s=r.getPickRay(a,yFe),c=O.UNIT_X,u=s.origin,d=s.direction;let f;const p=O.dot(c,d);Math.abs(p)>h.a.EPSILON6&&(f=-O.dot(c,u)/p);if(!Object(l.a)(f)||f<=0)return e._looking=!0,xze(e,t,n),void Vt.clone(t,e._tiltCenterMousePosition);const m=O.multiplyByScalar(d,f,bFe);O.add(u,m,m);const g=i.mapProjection,_=g.ellipsoid;O.fromElements(m.y,m.z,m.x,m);const y=g.unproject(m,CFe);_.cartographicToCartesian(y,m);const b=ca.eastNorthUpToFixedFrame(m,_,OFe),v=e._globe,w=e._ellipsoid;e._globe=void 0,e._ellipsoid=H.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;const A=Me.clone(r.transform,xFe);r._setTransform(b),KFe(e,t,n,O.UNIT_Z),r._setTransform(A),e._globe=v,e._ellipsoid=w;const E=w.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}(e,t,n)):function(e,t,n){const i=e._scene,r=i.camera,o=e._cameraUnderground;let a,s;const c=O.UNIT_X;if(Vt.equals(t,e._tiltCenterMousePosition))a=O.clone(e._tiltCenter,bFe);else{if(r.position.z<e._minimumPickingTerrainHeight&&(a=$Be(e,t,bFe)),!Object(l.a)(a)){s=r.getPickRay(t,yFe);const i=s.origin,o=s.direction;let u;const d=O.dot(c,o);if(Math.abs(d)>h.a.EPSILON6&&(u=-O.dot(c,i)/d),!Object(l.a)(u)||u<=0)return e._looking=!0,xze(e,t,n),void Vt.clone(t,e._tiltCenterMousePosition);a=O.multiplyByScalar(o,u,bFe),O.add(i,a,a)}o&&(Object(l.a)(s)||(s=r.getPickRay(t,yFe)),iFe(e,s,a,a)),Vt.clone(t,e._tiltCenterMousePosition),O.clone(a,e._tiltCenter)}const u=i.canvas,d=_Fe;d.x=u.clientWidth/2,d.y=e._tiltCenterMousePosition.y,s=r.getPickRay(d,yFe);const f=O.clone(O.ZERO,AFe);f.x=a.x;const p=xi.fromPointNormal(f,c,EFe),m=vi.rayPlane(s,p,vFe),g=r._projection,_=g.ellipsoid;O.fromElements(a.y,a.z,a.x,a);let y=g.unproject(a,CFe);_.cartographicToCartesian(y,a);const b=ca.eastNorthUpToFixedFrame(a,_,OFe);let v;Object(l.a)(m)?(O.fromElements(m.y,m.z,m.x,m),y=g.unproject(m,CFe),_.cartographicToCartesian(y,m),v=ca.eastNorthUpToFixedFrame(m,_,wFe)):v=b;const w=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=H.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=O.UNIT_Z;const T=Me.clone(r.transform,xFe);r._setTransform(b);const C=O.cross(O.UNIT_Z,O.normalize(r.position,TFe),TFe),x=O.dot(r.right,C);if(KFe(e,t,n,E,!1,!0),r._setTransform(v),x<0){const i=n.startPosition.y-n.endPosition.y;(o&&i<0||!o&&i>0)&&(E=void 0);const a=r.constrainedAxis;r.constrainedAxis=void 0,KFe(e,t,n,E,!0,!1),r.constrainedAxis=a}else KFe(e,t,n,E,!0,!1);if(Object(l.a)(r.constrainedAxis)){const e=O.cross(r.direction,r.constrainedAxis,PFe);O.equalsEpsilon(e,O.ZERO,h.a.EPSILON6)||(O.dot(e,r.right)<0&&O.negate(e,e),O.cross(e,r.direction,r.up),O.cross(r.direction,r.up,r.right),O.normalize(r.up,r.up),O.normalize(r.right,r.right))}r._setTransform(T),e._globe=w,e._ellipsoid=A;const S=A.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S;const I=O.clone(r.positionWC,TFe);e.enableCollisionDetection&&Pze(e);if(!O.equals(r.positionWC,I)){r._setTransform(v),r.worldToCameraCoordinatesPoint(I,I);const e=O.magnitudeSquared(I);O.magnitudeSquared(r.position)>e&&(O.normalize(r.position,r.position),O.multiplyByScalar(r.position,Math.sqrt(e),r.position));const t=O.angleBetween(I,r.position),n=O.cross(I,r.position,I);O.normalize(n,n);const i=To.fromAxisAngle(n,t,SFe),o=ce.fromQuaternion(i,IFe);ce.multiplyByVector(o,r.direction,r.direction),ce.multiplyByVector(o,r.up,r.up),O.cross(r.direction,r.up,r.right),O.cross(r.right,r.direction,r.up),r._setTransform(T)}}(e,t,n)}const RFe=new Vt,jFe=new Gn,MFe=new O;function LFe(e,t,n){Object(l.a)(n.distance)&&(n=n.distance);const i=e._scene,r=i.camera,o=i.canvas,a=e._cameraUnderground;let s;a?s=t:(s=RFe,s.x=o.clientWidth/2,s.y=o.clientHeight/2);const c=r.getPickRay(s,jFe),u=c.origin,h=c.direction,d=r.position.z;let f,p;if(d<e._minimumPickingTerrainHeight&&(f=$Be(e,s,MFe)),Object(l.a)(f)&&(p=O.distance(u,f)),a){const t=nFe(e,c);p=Object(l.a)(p)?Math.min(p,t):t}if(!Object(l.a)(p)){const e=O.UNIT_X;p=-O.dot(e,u)/O.dot(e,h)}kBe(e,t,n,e._zoomFactor,p)}const NFe=new Gn,BFe=new xi(O.UNIT_X,0),FFe=new O,zFe=new O,kFe=new O;function UFe(e,t,n){const i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,NFe);let a=O.clone(r.direction,zFe);i.mode===AB.COLUMBUS_VIEW&&O.fromElements(a.z,a.x,a.y,a);const s=xi.fromPointNormal(n,a,BFe),c=vi.rayPlane(o,s,FFe);Object(l.a)(c)&&(a=O.subtract(n,c,a),i.mode===AB.COLUMBUS_VIEW&&O.fromElements(a.y,a.z,a.x,a),O.add(r.position,a,r.position))}const VFe=new O,HFe=new R,GFe=new O,qFe=new H,WFe=new O,YFe=new O;function XFe(e,t,n){const i=e._scene.camera,r=e._cameraUnderground;let o,a,s=e._ellipsoid;if(!Me.equals(i.transform,Me.IDENTITY))return void KFe(e,t,n);const c=s.geodeticSurfaceNormal(i.position,WFe);if(Vt.equals(t,e._rotateMousePosition)){if(e._looking)xze(e,t,n,c);else if(e._rotating)KFe(e,t,n);else if(e._strafing)aFe(e,n);else{if(O.magnitude(i.position)<O.magnitude(e._rotateStartPosition))return;o=O.magnitude(e._rotateStartPosition),a=GFe,a.x=a.y=a.z=o,s=H.fromCartesian3(a,qFe),rze(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;const u=s.cartesianToCartographic(i.positionWC,HFe).height,h=e._globe;if(Object(l.a)(h)&&u<e._minimumPickingTerrainHeight){const u=$Be(e,n.startPosition,kFe);if(Object(l.a)(u)){let c=!1;const l=i.getPickRay(n.startPosition,KBe);if(r)c=!0,rFe(e,l,u,u);else{const e=s.geodeticSurfaceNormal(u,YFe);c=!!(Math.abs(O.dot(l.direction,e))<.05)||O.magnitude(i.position)<O.magnitude(u)}c?(Vt.clone(t,e._strafeEndMousePosition),O.clone(u,e._strafeStartPosition),e._strafing=!0,UFe(e,n,e._strafeStartPosition)):(o=O.magnitude(u),a=GFe,a.x=a.y=a.z=o,s=H.fromCartesian3(a,qFe),rze(e,t,n,s),O.clone(u,e._rotateStartPosition))}else e._looking=!0,xze(e,t,n,c)}else Object(l.a)(i.pickEllipsoid(n.startPosition,e._ellipsoid,VFe))?(rze(e,t,n,e._ellipsoid),O.clone(VFe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,KFe(e,t,n)):(e._looking=!0,xze(e,t,n,c));Vt.clone(t,e._rotateMousePosition)}function KFe(e,t,n,i,r,o){r=Object(c.a)(r,!1),o=Object(c.a)(o,!1);const a=e._scene,s=a.camera,u=a.canvas,h=s.constrainedAxis;Object(l.a)(i)&&(s.constrainedAxis=i);const d=O.magnitude(s.position);let f=e._rotateFactor*(d-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/u.clientWidth,m=(n.startPosition.y-n.endPosition.y)/u.clientHeight;p=Math.min(p,e.maximumMovementRatio),m=Math.min(m,e.maximumMovementRatio);const g=f*p*Math.PI*2,_=f*m*Math.PI;r||s.rotateRight(g),o||s.rotateUp(_),s.constrainedAxis=h}const JFe=_e.clone(_e.UNIT_W),ZFe=_e.clone(_e.UNIT_W),$Fe=new O,QFe=new O,eze=new O,tze=new O,nze=new Vt,ize=new Vt;function rze(e,t,n,i){const r=e._scene.camera,o=Vt.clone(n.startPosition,nze),a=Vt.clone(n.endPosition,ize);let s=r.pickEllipsoid(o,i,JFe),c=r.pickEllipsoid(a,i,ZFe);if(!Object(l.a)(s)||!Object(l.a)(c))return e._rotating=!0,void KFe(e,0,n);if(s=r.worldToCameraCoordinates(s,s),c=r.worldToCameraCoordinates(c,c),Object(l.a)(r.constrainedAxis)){const e=r.constrainedAxis,t=O.mostOrthogonalAxis(e,$Fe);O.cross(t,e,t),O.normalize(t,t);const n=O.cross(e,t,QFe),i=O.magnitude(s),o=O.dot(e,s),a=Math.acos(o/i),l=O.multiplyByScalar(e,o,eze);O.subtract(s,l,l),O.normalize(l,l);const u=O.magnitude(c),d=O.dot(e,c),f=Math.acos(d/u),p=O.multiplyByScalar(e,d,tze);O.subtract(c,p,p),O.normalize(p,p);let m=Math.acos(O.dot(l,t));O.dot(l,n)<0&&(m=h.a.TWO_PI-m);let g=Math.acos(O.dot(p,t));O.dot(p,n)<0&&(g=h.a.TWO_PI-g);const _=m-g;let y;y=O.equalsEpsilon(e,r.position,h.a.EPSILON2)?r.right:O.cross(e,r.position,$Fe);const b=O.cross(e,y,$Fe),v=O.dot(b,O.subtract(s,e,QFe)),w=O.dot(b,O.subtract(c,e,QFe));let A;A=v>0&&w>0?f-a:v>0&&w<=0?O.dot(r.position,e)>0?-a-f:a+f:a-f,r.rotateRight(_),r.rotateUp(A)}else{O.normalize(s,s),O.normalize(c,c);const e=O.dot(s,c),t=O.cross(s,c,$Fe);if(e<1&&!O.equalsEpsilon(t,O.ZERO,h.a.EPSILON14)){const n=Math.acos(e);r.rotate(t,n)}}}const oze=new O,aze=new R;function sze(e,t,n){Object(l.a)(n.distance)&&(n=n.distance);const i=e._ellipsoid,r=e._scene,o=r.camera,a=r.canvas,s=e._cameraUnderground;let c;s?c=t:(c=RFe,c.x=a.clientWidth/2,c.y=a.clientHeight/2);const u=o.getPickRay(c,jFe);let h;const d=i.cartesianToCartographic(o.position,aze).height;let f;if(d<e._minimumPickingTerrainHeight&&(h=$Be(e,c,MFe)),Object(l.a)(h)&&(f=O.distance(u.origin,h)),s){const t=nFe(e,u);f=Object(l.a)(f)?Math.min(f,t):t}Object(l.a)(f)||(f=d);const p=O.normalize(o.position,oze);kBe(e,t,n,e._zoomFactor,f,O.dot(p,o.direction))}const cze=new Vt,lze=new Gn,uze=new O,hze=new O,dze=new Me,fze=new Me,pze=new Me,mze=new To,gze=new ce,_ze=new R,yze=new O;function bze(e,t,n){const i=e._scene.camera;if(!Me.equals(i.transform,Me.IDENTITY))return;if(Object(l.a)(n.angleAndHeight)&&(n=n.angleAndHeight),Vt.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){const r=e._ellipsoid.geodeticSurfaceNormal(i.position,yze);return void xze(e,t,n,r)}const r=e._ellipsoid.cartesianToCartographic(i.position,_ze);e._tiltOnEllipsoid||r.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,function(e,t,n){const i=e._ellipsoid,r=e._scene,o=r.camera,a=.25*e.minimumZoomDistance,s=i.cartesianToCartographic(o.positionWC,vze).height;if(s-a-1<h.a.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;const c=r.canvas,u=cze;u.x=c.clientWidth/2,u.y=c.clientHeight/2;const d=o.getPickRay(u,lze);let f;const p=vi.rayEllipsoid(d,i);if(Object(l.a)(p))f=Gn.getPoint(d,p.start,uze);else{if(!(s>e._minimumTrackBallHeight)){e._looking=!0;const i=e._ellipsoid.geodeticSurfaceNormal(o.position,yze);return xze(e,t,n,i),void Vt.clone(t,e._tiltCenterMousePosition)}{const e=vi.grazingAltitudeLocation(d,i);if(!Object(l.a)(e))return;const t=i.cartesianToCartographic(e,_ze);t.height=0,f=i.cartographicToCartesian(t,uze)}}const m=ca.eastNorthUpToFixedFrame(f,i,dze),g=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=H.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;const y=Me.clone(o.transform,pze);o._setTransform(m),KFe(e,0,n,O.UNIT_Z),o._setTransform(y),e._globe=g,e._ellipsoid=_;const b=_.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}(e,t,n)):function(e,t,n){const i=e._ellipsoid,r=e._scene,o=r.camera,a=e._cameraUnderground;let s,c,u;if(Vt.equals(t,e._tiltCenterMousePosition))s=O.clone(e._tiltCenter,uze);else{if(s=$Be(e,t,uze),!Object(l.a)(s)){if(c=o.getPickRay(t,lze),u=vi.rayEllipsoid(c,i),!Object(l.a)(u)){if(i.cartesianToCartographic(o.position,_ze).height<=e._minimumTrackBallHeight){e._looking=!0;const i=e._ellipsoid.geodeticSurfaceNormal(o.position,yze);xze(e,t,n,i),Vt.clone(t,e._tiltCenterMousePosition)}return}s=Gn.getPoint(c,u.start,uze)}a&&(Object(l.a)(c)||(c=o.getPickRay(t,lze)),iFe(e,c,s,s)),Vt.clone(t,e._tiltCenterMousePosition),O.clone(s,e._tiltCenter)}const d=r.canvas,f=cze;f.x=d.clientWidth/2,f.y=e._tiltCenterMousePosition.y,c=o.getPickRay(f,lze);const p=O.magnitude(s),m=O.fromElements(p,p,p,GFe),g=H.fromCartesian3(m,qFe);if(u=vi.rayEllipsoid(c,g),!Object(l.a)(u))return;const _=O.magnitude(c.origin)>p?u.start:u.stop,y=Gn.getPoint(c,_,hze),b=ca.eastNorthUpToFixedFrame(s,i,dze),v=ca.eastNorthUpToFixedFrame(y,g,fze),w=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=H.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=O.UNIT_Z;const T=Me.clone(o.transform,pze);o._setTransform(v);const C=O.cross(y,o.positionWC,PFe);if(O.dot(o.rightWC,C)<0){const t=n.startPosition.y-n.endPosition.y;(a&&t<0||!a&&t>0)&&(E=void 0);const i=o.constrainedAxis;o.constrainedAxis=void 0,KFe(e,0,n,E,!0,!1),o.constrainedAxis=i}else KFe(e,0,n,E,!0,!1);if(o._setTransform(b),KFe(e,0,n,E,!1,!0),Object(l.a)(o.constrainedAxis)){const e=O.cross(o.direction,o.constrainedAxis,PFe);O.equalsEpsilon(e,O.ZERO,h.a.EPSILON6)||(O.dot(e,o.right)<0&&O.negate(e,e),O.cross(e,o.direction,o.up),O.cross(o.direction,o.up,o.right),O.normalize(o.up,o.up),O.normalize(o.right,o.right))}o._setTransform(T),e._globe=w,e._ellipsoid=A;const x=A.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x;const S=O.clone(o.positionWC,PFe);e.enableCollisionDetection&&Pze(e);if(!O.equals(o.positionWC,S)){o._setTransform(v),o.worldToCameraCoordinatesPoint(S,S);const e=O.magnitudeSquared(S);O.magnitudeSquared(o.position)>e&&(O.normalize(o.position,o.position),O.multiplyByScalar(o.position,Math.sqrt(e),o.position));const t=O.angleBetween(S,o.position),n=O.cross(S,o.position,S);O.normalize(n,n);const i=To.fromAxisAngle(n,t,mze),r=ce.fromQuaternion(i,gze);ce.multiplyByVector(r,o.direction,o.direction),ce.multiplyByVector(r,o.up,o.up),O.cross(o.direction,o.up,o.right),O.cross(o.right,o.direction,o.up),o._setTransform(T)}}(e,t,n)}const vze=new R;const Oze=new Vt,wze=new Vt,Aze=new Gn,Eze=new Gn,Tze=new O,Cze=new O;function xze(e,t,n,i){const r=e._scene.camera,o=Oze;o.x=n.startPosition.x,o.y=0;const a=wze;a.x=n.endPosition.x,a.y=0;let s,u,d=r.getPickRay(o,Aze),f=r.getPickRay(a,Eze),p=0;r.frustum instanceof nv?(s=d.origin,u=f.origin,O.add(r.direction,s,s),O.add(r.direction,u,u),O.subtract(s,r.position,s),O.subtract(u,r.position,u),O.normalize(s,s),O.normalize(u,u)):(s=d.direction,u=f.direction);let m=O.dot(s,u);m<1&&(p=Math.acos(m)),p=n.startPosition.x>n.endPosition.x?-p:p;const g=e._horizontalRotationAxis;if(Object(l.a)(i)?r.look(i,-p):Object(l.a)(g)?r.look(g,-p):r.lookLeft(p),o.x=0,o.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,d=r.getPickRay(o,Aze),f=r.getPickRay(a,Eze),p=0,r.frustum instanceof nv?(s=d.origin,u=f.origin,O.add(r.direction,s,s),O.add(r.direction,u,u),O.subtract(s,r.position,s),O.subtract(u,r.position,u),O.normalize(s,s),O.normalize(u,u)):(s=d.direction,u=f.direction),m=O.dot(s,u),m<1&&(p=Math.acos(m)),p=n.startPosition.y>n.endPosition.y?-p:p,i=Object(c.a)(i,g),Object(l.a)(i)){const e=r.direction,t=O.negate(i,Tze),n=O.equalsEpsilon(e,i,h.a.EPSILON2),o=O.equalsEpsilon(e,t,h.a.EPSILON2);if(n||o)(n&&p<0||o&&p>0)&&r.look(r.right,-p);else{m=O.dot(e,i);let n=h.a.acosClamped(m);p>0&&p>n&&(p=n-h.a.EPSILON4),m=O.dot(e,t),n=h.a.acosClamped(m),p<0&&-p>n&&(p=-n+h.a.EPSILON4);const o=O.cross(i,e,Cze);r.look(o,p)}}else r.lookUp(p)}const Sze=new Me,Ize=new R;function Pze(e){e._adjustedHeightForTerrain=!0;const t=e._scene,n=t.mode,i=t.globe;if(!Object(l.a)(i)||n===AB.SCENE2D||n===AB.MORPHING)return;const r=t.camera,o=i.ellipsoid,a=t.mapProjection;let s,c;Me.equals(r.transform,Me.IDENTITY)||(s=Me.clone(r.transform,Sze),c=O.magnitude(r.position),r._setTransform(Me.IDENTITY));const u=Ize;n===AB.SCENE3D?o.cartesianToCartographic(r.position,u):a.unproject(r.position,u);let h=!1;if(u.height<e._minimumCollisionTerrainHeight){const t=e._scene.globeHeight;if(Object(l.a)(t)){const i=t+e.minimumZoomDistance;u.height<i&&(u.height=i,n===AB.SCENE3D?o.cartographicToCartesian(u,r.position):a.project(u,r.position),h=!0)}}Object(l.a)(s)&&(r._setTransform(s),h&&(O.normalize(r.position,r.position),O.negate(r.position,r.direction),O.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),O.normalize(r.direction,r.direction),O.cross(r.direction,r.up,r.right),O.cross(r.right,r.direction,r.up)))}hBe.prototype.onMap=function(){const e=this._scene,t=e.mode,n=e.camera;return t!==AB.COLUMBUS_VIEW||Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0};const Dze=new O,Rze=new O;hBe.prototype.update=function(){const e=this._scene,t=e.camera,n=e.globe,i=e.mode;Me.equals(t.transform,Me.IDENTITY)?(this._globe=n,this._ellipsoid=Object(l.a)(this._globe)?this._globe.ellipsoid:e.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=H.UNIT_SPHERE);const r=Object(l.a)(this._globe)?this._globe.terrainExaggeration:1,o=Object(l.a)(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=Ns.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=Ns.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=Ns.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&Object(l.a)(this._globe);const a=this._ellipsoid.maximumRadius;this._rotateFactor=1/a,this._rotateRateRangeAdjustment=a,this._adjustedHeightForTerrain=!1;const s=O.clone(t.positionWC,Dze),c=O.clone(t.directionWC,Rze);var u;if(i===AB.SCENE2D?function(e){const t=e._scene.mapMode2D===IOe.ROTATE;Me.equals(Me.IDENTITY,e._scene.camera.transform)?(mBe(e,e.enableTranslate,e.translateEventTypes,GBe,e.inertiaTranslate,"_lastInertiaTranslateMovement"),mBe(e,e.enableZoom,e.zoomEventTypes,qBe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&mBe(e,e.enableRotate,e.tiltEventTypes,XBe,e.inertiaSpin,"_lastInertiaTiltMovement")):(mBe(e,e.enableZoom,e.zoomEventTypes,qBe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&mBe(e,e.enableRotate,e.translateEventTypes,XBe,e.inertiaSpin,"_lastInertiaSpinMovement"))}(this):i===AB.COLUMBUS_VIEW?(this._horizontalRotationAxis=O.UNIT_Z,function(e){const t=e._scene.camera;if(Me.equals(Me.IDENTITY,t.transform)){const n=e._tweens;if(e._aggregator.anyButtonDown&&n.removeAll(),mBe(e,e.enableTilt,e.tiltEventTypes,DFe,e.inertiaSpin,"_lastInertiaTiltMovement"),mBe(e,e.enableTranslate,e.translateEventTypes,gFe,e.inertiaTranslate,"_lastInertiaTranslateMovement"),mBe(e,e.enableZoom,e.zoomEventTypes,LFe,e.inertiaZoom,"_lastInertiaZoomMovement"),mBe(e,e.enableLook,e.lookEventTypes,xze),!e._aggregator.anyButtonDown&&!n.contains(e._tween)){const i=t.createCorrectPositionTween(e.bounceAnimationTime);Object(l.a)(i)&&(e._tween=n.add(i))}n.update()}else mBe(e,e.enableRotate,e.rotateEventTypes,KFe,e.inertiaSpin,"_lastInertiaSpinMovement"),mBe(e,e.enableZoom,e.zoomEventTypes,sze,e.inertiaZoom,"_lastInertiaZoomMovement")}(this)):i===AB.SCENE3D&&(this._horizontalRotationAxis=void 0,mBe(u=this,u.enableRotate,u.rotateEventTypes,XFe,u.inertiaSpin,"_lastInertiaSpinMovement"),mBe(u,u.enableZoom,u.zoomEventTypes,sze,u.inertiaZoom,"_lastInertiaZoomMovement"),mBe(u,u.enableTilt,u.tiltEventTypes,bze,u.inertiaSpin,"_lastInertiaTiltMovement"),mBe(u,u.enableLook,u.lookEventTypes,xze)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){(!O.equals(s,t.positionWC)||!O.equals(c,t.directionWC))&&Pze(this)}this._aggregator.reset()},hBe.prototype.isDestroyed=function(){return!1},hBe.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),sc(this)};var jze=hBe,Mze="uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\n\nuniform vec2 center;\nuniform float radius;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    vec4 color0 = texture2D(colorTexture, v_textureCoordinates);\n    vec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\n\n    float x = length(gl_FragCoord.xy - center) / radius;\n    float t = smoothstep(0.5, 0.8, x);\n    gl_FragColor = mix(color0 + color1, color1, t);\n}\n",Lze='uniform sampler2D colorTexture;\n\nuniform float avgLuminance;\nuniform float threshold;\nuniform float offset;\n\nvarying vec2 v_textureCoordinates;\n\nfloat key(float avg)\n{\n    float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\n    return max(0.0, guess) + 0.1;\n}\n\n// See section 9. "The bright-pass filter" of Realtime HDR Rendering\n// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf\n\nvoid main()\n{\n    vec4 color = texture2D(colorTexture, v_textureCoordinates);\n    vec3 xyz = czm_RGBToXYZ(color.rgb);\n    float luminance = xyz.r;\n\n    float scaledLum = key(avgLuminance) * luminance / avgLuminance;\n    float brightLum = max(scaledLum - threshold, 0.0);\n    float brightness = brightLum / (offset + brightLum);\n\n    xyz.r = brightness;\n    gl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n';function Nze(){this._sceneFramebuffer=new lje;const e=new Array(6);e[0]=new dLe({fragmentShader:VPe,textureScale:.125,forcePowerOfTwo:!0,sampleMode:iLe.LINEAR});const t=e[1]=new dLe({fragmentShader:Lze,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.125,forcePowerOfTwo:!0}),n=this;this._delta=1,this._sigma=2,this._blurStep=new Vt,e[2]=new dLe({fragmentShader:TLe,uniforms:{step:function(){return n._blurStep.x=n._blurStep.y=1/t.outputTexture.width,n._blurStep},delta:function(){return n._delta},sigma:function(){return n._sigma},direction:0},textureScale:.125,forcePowerOfTwo:!0}),e[3]=new dLe({fragmentShader:TLe,uniforms:{step:function(){return n._blurStep.x=n._blurStep.y=1/t.outputTexture.width,n._blurStep},delta:function(){return n._delta},sigma:function(){return n._sigma},direction:1},textureScale:.125,forcePowerOfTwo:!0}),e[4]=new dLe({fragmentShader:VPe,sampleMode:iLe.LINEAR}),this._uCenter=new Vt,this._uRadius=void 0,e[5]=new dLe({fragmentShader:Mze,uniforms:{center:function(){return n._uCenter},radius:function(){return n._uRadius},colorTexture2:function(){return n._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new jLe({stages:e});const i=new qLe(this),r=e.length;for(let t=0;t<r;++t)e[t]._textureCache=i;this._textureCache=i,this.length=e.length}Nze.prototype.get=function(e){return this._stages.get(e)},Nze.prototype.getStageByName=function(e){const t=this._stages.length;for(let n=0;n<t;++n){const t=this._stages.get(n);if(t.name===e)return t}};const Bze=new _e,Fze=new Vt,zze=new Vt,kze=new Me;Nze.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)},Nze.prototype.update=function(e){const t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);const r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),function(e,t,n){const i=t.uniformState,r=i.sunPositionWC,o=i.view,a=i.viewProjection,s=i.projection;let c=Me.computeViewportTransformation(n,0,1,kze);const l=Me.multiplyByPoint(o,r,Bze);let u=ca.pointToGLWindowCoordinates(a,c,r,Fze);l.x+=h.a.SOLAR_RADIUS;const d=ca.pointToGLWindowCoordinates(s,c,l,l),f=30*Vt.magnitude(Vt.subtract(d,u,d))*2,p=zze;p.x=f,p.y=f,e._uCenter=Vt.clone(u,e._uCenter),e._uRadius=.15*Math.max(p.x,p.y);const m=t.drawingBufferWidth,g=t.drawingBufferHeight,_=e._stages,y=_.get(0),b=y.outputTexture.width,v=y.outputTexture.height,O=new Nl;O.width=b,O.height=v,c=Me.computeViewportTransformation(O,0,1,kze),u=ca.pointToGLWindowCoordinates(a,c,r,Fze),p.x*=b/m,p.y*=v/g;const w=y.scissorRectangle;w.x=Math.max(u.x-.5*p.x,0),w.y=Math.max(u.y-.5*p.y,0),w.width=Math.min(p.x,m),w.height=Math.min(p.y,g);for(let e=1;e<4;++e)Nl.clone(w,_.get(e).scissorRectangle)}(this,t,n),r},Nze.prototype.execute=function(e){const t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let t=1;t<i;++t)n.get(t).execute(e,n.get(t-1).outputTexture)},Nze.prototype.copy=function(e,t){if(!Object(l.a)(this._copyColorCommand)){const t=this;this._copyColorCommand=e.createViewportQuadCommand(VPe,{uniformMap:{colorTexture:function(){return t._stages.get(t._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},Nze.prototype.isDestroyed=function(){return!1},Nze.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),sc(this)};var Uze=Nze;const Vze=function(e){return function(){e.frameState.afterRender.push((function(){e.requestRender()}))}};function Hze(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).canvas;let n=e.creditContainer,i=e.creditViewport,r=Object(Zf.a)(e.contextOptions);if(Object(l.a)(r)||(r={}),Object(l.a)(r.webgl)||(r.webgl={}),r.webgl.powerPreference=Object(c.a)(r.webgl.powerPreference,"high-performance"),!Object(l.a)(t))throw new u.a("options and options.canvas are required.");const o=Object(l.a)(n),a=new jve(t,r);o||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),Object(l.a)(i)||(i=t.parentNode),this._id=fy(),this._jobScheduler=new rRe,this._frameState=new Hxe(a,new MCe(n," • ",i),this._jobScheduler),this._frameState.scene3DOnly=Object(c.a)(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=n,this._canvas=t,this._context=a,this._computeEngine=new Jbe(a),this._globe=void 0,this._globeTranslucencyState=new VDe,this._primitives=new cce,this._groundPrimitives=new cce,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=a.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new uBe,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=Object(c.a)(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new lxe(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new UU({color:new sp,stencil:0,owner:this}),this._depthClearCommand=new UU({depth:1,owner:this}),this._stencilClearCommand=new UU({stencil:0}),this._classificationStencilClearCommand=new UU({stencil:0,renderState:vj.fromCache({stencilMask:qF.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new sBe(this),this._preUpdate=new un.a,this._postUpdate=new un.a,this._renderError=new un.a,this._preRender=new un.a,this._postRender=new un.a,this._minimumDisableDepthTestDistance=0,this._debugInspector=new ZCe,this._msaaSamples=Object(c.a)(e.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new un.a,this.morphComplete=new un.a,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=sp.clone(sp.BLACK),this._mode=AB.SCENE3D,this._mapProjection=Object(l.a)(e.mapProjection)?e.mapProjection:new q,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new kxe,this._shadowMapCamera=new LAe(this),this.shadowMap=new Jje({context:a,lightCamera:this._shadowMapCamera,enabled:Object(c.a)(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=sp.clone(sp.WHITE),this._actualInvertClassificationColor=sp.clone(this._invertClassificationColor),this._invertClassification=new tRe,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new QLe,this._brdfLutGenerator=new hOe,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new jze(this),this._cameraUnderground=!1,this._mapMode2D=Object(c.a)(e.mapMode2D,IOe.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=Object(c.a)(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=Object(c.a)(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Yx.a.requestCompletedEvent.addEventListener(Vze(this)),this._removeTaskProcessorListenerCallback=_c.taskCompletedEvent.addEventListener(Vze(this)),this._removeGlobeCallbacks=[];const s=new Nl(0,0,a.drawingBufferWidth,a.drawingBufferHeight),h=new LAe(this);this._logDepthBuffer&&(h.frustum.near=.1,h.frustum.far=1e10),this.preloadFlightCamera=new LAe(this),this.preloadFlightCullingVolume=void 0,this._picking=new nLe(this),this._defaultView=new dMe(this,h,s),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new ive,Zze(this,0,tr.now()),this.updateFrameState(),this.initializeFrame()}function Gze(e,t,n){const i=e._frameState,r=e._context,o=e._view.oit,a=i.shadowState.lightShadowMaps,s=i.shadowState.lightShadowsEnabled;let c=t.derivedCommands;Object(l.a)(t.pickId)&&(c.picking=gxe.createPickDerivedCommand(e,t,r,c.picking)),t.pickOnly||(c.depth=gxe.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=gxe.createHdrCommand(t,r,c.hdr),c=(t=c.hdr.command).derivedCommands),s&&t.receiveShadows&&(c.shadows=Jje.createReceiveDerivedCommand(a,t,n,r,c.shadows)),t.pass===KR.TRANSLUCENT&&Object(l.a)(o)&&o.isSupported()&&(s&&t.receiveShadows?(c.oit=Object(l.a)(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Object.defineProperties(Hze.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return MD.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return MD.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return FU.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,function(e,t){for(let t=0;t<e._removeGlobeCallbacks.length;++t)e._removeGlobeCallbacks[t]();e._removeGlobeCallbacks.length=0;const n=[];Object(l.a)(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(Vze(e))),n.push(t.terrainProviderChanged.addEventListener(Vze(e)))),e._removeGlobeCallbacks=n}(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(Object(l.a)(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(Object(l.a)(this.globe))return this.globe.terrainProvider},set:function(e){Object(l.a)(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(Object(l.a)(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){if(this.scene3DOnly&&e!==AB.SCENE3D)throw new u.a("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===AB.SCENE2D)this.morphTo2D(0);else if(e===AB.SCENE3D)this.morphTo3D(0);else{if(e!==AB.COLUMBUS_VIEW)throw new u.a("value must be a valid SceneMode enumeration.");this.morphToColumbusView(0)}this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){if(this.camera.frustum instanceof nv)throw new u.a("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new LAe(this),Object(l.a)(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Oxe(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){if(!Object(l.a)(e)||e<0)throw new u.a("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){const t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){const e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,MD.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return.9999}},globeHeight:{get:function(){return this._globeHeight}}}),Hze.prototype.getCompressedTextureFormatSupported=function(e){const t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc"===e||"etc"===e)&&t.etc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1||("WEBGL_compressed_texture_astc"===e||"astc"===e)&&t.astc||("EXT_texture_compression_bptc"===e||"bc7"===e)&&t.bc7},Hze.prototype.updateDerivedCommands=function(e){if(!Object(l.a)(e.derivedCommands))return;const t=this._frameState,n=this._context;let i=!1;const r=t.shadowState.lastDirtyTime;e.lastDirtyTime!==r&&(e.lastDirtyTime=r,e.dirty=!0,i=!0);const o=t.useLogDepth,a=this._hdr,s=e.derivedCommands,c=Object(l.a)(s.logDepth),u=Object(l.a)(s.hdr),h=Object(l.a)(s.originalCommand),d=o&&!c,f=a&&!u,p=!(o&&a||h);if(e.dirty=e.dirty||d||f||p,e.dirty){e.dirty=!1;const r=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(s.shadows=Jje.createCastDerivedCommand(r,e,i,n,s.shadows)),(c||d)&&(s.logDepth=gxe.createLogDepthCommand(e,n,s.logDepth),Gze(this,s.logDepth.command,i)),(h||p)&&Gze(this,e,i)}};const qze=new YAe({pass:ute.RENDER}),Wze=new YAe({pass:ute.PRELOAD}),Yze=new YAe({pass:ute.PRELOAD_FLIGHT}),Xze=new YAe({pass:ute.REQUEST_RENDER_MODE_DEFER_CHECK}),Kze=new At;let Jze;function Zze(e,t,n){const i=e._frameState;i.frameNumber=t,i.time=tr.clone(n,i.time)}Hze.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1},Hze.prototype.updateFrameState=function(){const e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=function(e){const t=e.globe;if(e._mode===AB.SCENE3D&&Object(l.a)(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){const n=t.ellipsoid,i=e.frameState.minimumTerrainHeight;return Kze.radius=n.minimumRadius+i,Jze=UE.fromBoundingSphere(Kze,e.camera.positionWC,Jze),Jze}}(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof nv||this.camera.frustum instanceof Qb),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,Object(l.a)(this.globe)&&(t.terrainExaggeration=this.globe.terrainExaggeration,t.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),Object(l.a)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=sp.clone(this.invertClassificationColor,this._actualInvertClassificationColor),tRe.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,Object(l.a)(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0},Hze.prototype.isVisible=function(e,t,n){return Object(l.a)(e)&&(!Object(l.a)(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==W.OUTSIDE&&(!Object(l.a)(n)||!e.occlude||!e.boundingVolume.isOccluded(n)))};let $ze=new Me(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function Qze(e,t,n,i,r){const o=t._frameState;if(Object(l.a)(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof UU)return void e.execute(n,i);e.debugShowBoundingVolume&&Object(l.a)(e.boundingVolume)&&function(e,t,n,i){const r=t._frameState,o=r.context,a=e.boundingVolume;let s;Object(l.a)(t._debugVolume)&&t._debugVolume.destroy();let c=O.clone(a.center);if(r.mode!==AB.SCENE3D){c=Me.multiplyByPoint($ze,c,c);const e=r.mapProjection,t=e.unproject(c);c=e.ellipsoid.cartographicToCartesian(t)}if(Object(l.a)(a.radius)){const e=a.radius;s=$d.toWireframe(Rb.createGeometry(new Rb({radii:new O(e,e,e),vertexFormat:MR.FLAT_VERTEX_FORMAT}))),t._debugVolume=new hF({geometryInstances:new Ph({geometry:s,modelMatrix:Me.fromTranslation(c),attributes:{color:new lp(1,0,0,1)}}),appearance:new MR({flat:!0,translucent:!1}),asynchronous:!1})}else{const e=a.halfAxes;s=$d.toWireframe(uu.createGeometry(uu.fromDimensions({dimensions:new O(2,2,2),vertexFormat:MR.FLAT_VERTEX_FORMAT}))),t._debugVolume=new hF({geometryInstances:new Ph({geometry:s,modelMatrix:Me.fromRotationTranslation(e,c,new Me),attributes:{color:new lp(1,0,0,1)}}),appearance:new MR({flat:!0,translucent:!1}),asynchronous:!1})}const u=r.commandList,h=r.commandList=[];if(t._debugVolume.update(r),e=h[0],r.useLogDepth){e=gxe.createLogDepthCommand(e,o).command}let d;Object(l.a)(i)&&(d=n.framebuffer,n.framebuffer=i),e.execute(o,n),Object(l.a)(d)&&(n.framebuffer=d),r.commandList=u}(e,t,i,r),o.useLogDepth&&Object(l.a)(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);const a=o.passes;if(!a.pick&&!a.depth&&t._hdr&&Object(l.a)(e.derivedCommands)&&Object(l.a)(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth&&Object(l.a)(e.derivedCommands.picking))return void(e=e.derivedCommands.picking.pickCommand).execute(n,i);if(Object(l.a)(e.derivedCommands.depth))return void(e=e.derivedCommands.depth.depthOnlyCommand).execute(n,i)}t.debugShowCommands||t.debugShowFrustums?t._debugInspector.executeDebugShowFrustumsCommand(t,e,i):o.shadowState.lightShadowsEnabled&&e.receiveShadows&&Object(l.a)(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(n,i):e.execute(n,i)}function eke(e,t,n,i){const r=t._frameState;let o=e.derivedCommands;Object(l.a)(o)&&(r.useLogDepth&&Object(l.a)(o.logDepth)&&(e=o.logDepth.command),o=e.derivedCommands,Object(l.a)(o.picking)?(e=o.picking.pickCommand).execute(n,i):Object(l.a)(o.depth)&&(e=o.depth.depthOnlyCommand).execute(n,i))}function tke(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function nke(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+h.a.EPSILON12}function ike(e,t,n,i,r){const o=e.context;mE(i,tke,e.camera.positionWC),Object(l.a)(r)&&t(r.unclassifiedCommand,e,o,n);const a=i.length;for(let r=0;r<a;++r)t(i[r],e,o,n)}function rke(e,t,n,i,r){const o=e.context;mE(i,nke,e.camera.positionWC),Object(l.a)(r)&&t(r.unclassifiedCommand,e,o,n);const a=i.length;for(let r=0;r<a;++r)t(i[r],e,o,n)}$ze=Me.inverseTransformation($ze,$ze);const oke=new dv,ake=new lv,ske=new nv,cke=new Qb;function lke(e,t){const n=e.camera,i=e.context,r=e.frameState,o=i.uniformState;let a;o.updateCamera(n),a=Object(l.a)(n.frustum.fov)?n.frustum.clone(oke):Object(l.a)(n.frustum.infiniteProjectionMatrix)?n.frustum.clone(ake):Object(l.a)(n.frustum.width)?n.frustum.clone(ske):n.frustum.clone(cke),a.near=n.frustum.near,a.far=n.frustum.far,o.updateFrustum(a),o.updatePass(KR.ENVIRONMENT);const s=r.passes,c=s.pick,u=e._environmentState,h=e._view,d=u.renderTranslucentDepthForPick,f=u.useWebVR;if(!c){const n=u.skyBoxCommand;if(Object(l.a)(n)&&Qze(n,e,i,t),u.isSkyAtmosphereVisible&&Qze(u.skyAtmosphereCommand,e,i,t),u.isSunVisible&&(u.sunDrawCommand.execute(i,t),e.sunBloom&&!f)){let n;n=u.useGlobeDepthFramebuffer?h.globeDepth.framebuffer:u.usePostProcess?h.sceneFramebuffer.framebuffer:u.originalFramebuffer,e._sunPostProcess.execute(i),e._sunPostProcess.copy(i,n),t.framebuffer=n}u.isMoonVisible&&u.moonCommand.execute(i,t)}let p;u.useOIT?(Object(l.a)(e._executeOITFunction)||(e._executeOITFunction=function(e,t,n,r,o){h.globeDepth.prepareColorTextures(i),h.oit.executeCommands(e,t,n,r,o)}),p=e._executeOITFunction):p=s.render?ike:rke;const m=h.frustumCommandsList,g=m.length,_=u.clearGlobeDepth,y=u.useDepthPlane,b=e._globeTranslucencyState,v=b.translucent,O=e._view.globeTranslucencyFramebuffer,w=e._depthClearCommand,A=e._stencilClearCommand,E=e._classificationStencilClearCommand,T=e._depthPlane,C=u.usePostProcessSelected,x=n.position.z;let S;for(let s=0;s<g;++s){const f=g-s-1,I=m[f];e.mode===AB.SCENE2D?(n.position.z=x-I.near+1,a.far=Math.max(1,I.far-I.near),a.near=1,o.update(r),o.updateFrustum(a)):(a.near=0!==f?I.near*e.opaqueFrustumNearOffset:I.near,a.far=I.far,o.updateFrustum(a)),w.execute(i,t),i.stencilBuffer&&A.execute(i,t),o.updatePass(KR.GLOBE);let P=I.commands[KR.GLOBE],D=I.indices[KR.GLOBE];if(v)b.executeGlobeCommands(I,Qze,O,e,t);else for(S=0;S<D;++S)Qze(P[S],e,i,t);const R=h.globeDepth;if(Object(l.a)(R)&&u.useGlobeDepthFramebuffer&&R.executeCopyDepth(i,t),!u.renderTranslucentDepthForPick)if(o.updatePass(KR.TERRAIN_CLASSIFICATION),P=I.commands[KR.TERRAIN_CLASSIFICATION],D=I.indices[KR.TERRAIN_CLASSIFICATION],v)b.executeGlobeClassificationCommands(I,Qze,O,e,t);else for(S=0;S<D;++S)Qze(P[S],e,i,t);if(_&&(w.execute(i,t),y&&T.execute(i,t)),!u.useInvertClassification||c||u.renderTranslucentDepthForPick){for(o.updatePass(KR.CESIUM_3D_TILE),P=I.commands[KR.CESIUM_3D_TILE],D=I.indices[KR.CESIUM_3D_TILE],S=0;S<D;++S)Qze(P[S],e,i,t);if(D>0&&(Object(l.a)(R)&&u.useGlobeDepthFramebuffer&&(R.prepareColorTextures(i,_),R.executeUpdateDepth(i,t,_,R.depthStencilTexture)),!u.renderTranslucentDepthForPick))for(o.updatePass(KR.CESIUM_3D_TILE_CLASSIFICATION),P=I.commands[KR.CESIUM_3D_TILE_CLASSIFICATION],D=I.indices[KR.CESIUM_3D_TILE_CLASSIFICATION],S=0;S<D;++S)Qze(P[S],e,i,t)}else{e._invertClassification.clear(i,t);const n=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo.framebuffer,o.updatePass(KR.CESIUM_3D_TILE),P=I.commands[KR.CESIUM_3D_TILE],D=I.indices[KR.CESIUM_3D_TILE],S=0;S<D;++S)Qze(P[S],e,i,t);for(Object(l.a)(R)&&u.useGlobeDepthFramebuffer&&(e._invertClassification.prepareTextures(i),R.executeUpdateDepth(i,t,_,e._invertClassification._fbo.getDepthStencilTexture())),o.updatePass(KR.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),P=I.commands[KR.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],D=I.indices[KR.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],S=0;S<D;++S)Qze(P[S],e,i,t);for(t.framebuffer=n,e._invertClassification.executeClassified(i,t),1===r.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(i,t),D>0&&i.stencilBuffer&&E.execute(i,t),o.updatePass(KR.CESIUM_3D_TILE_CLASSIFICATION),P=I.commands[KR.CESIUM_3D_TILE_CLASSIFICATION],D=I.indices[KR.CESIUM_3D_TILE_CLASSIFICATION],S=0;S<D;++S)Qze(P[S],e,i,t)}for(D>0&&i.stencilBuffer&&A.execute(i,t),o.updatePass(KR.OPAQUE),P=I.commands[KR.OPAQUE],D=I.indices[KR.OPAQUE],S=0;S<D;++S)Qze(P[S],e,i,t);let j;0!==f&&e.mode!==AB.SCENE2D&&(a.near=I.near,o.updateFrustum(a)),!c&&u.useInvertClassification&&r.invertClassificationColor.alpha<1&&(j=e._invertClassification),o.updatePass(KR.TRANSLUCENT),P=I.commands[KR.TRANSLUCENT],P.length=I.indices[KR.TRANSLUCENT],p(e,Qze,t,P,j);if(I.indices[KR.CESIUM_3D_TILE_CLASSIFICATION]>0&&h.translucentTileClassification.isSupported()&&(h.translucentTileClassification.executeTranslucentCommands(e,Qze,t,P,R.depthStencilTexture),h.translucentTileClassification.executeClassificationCommands(e,Qze,t,I)),i.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){const n=R.depthStencilTexture,r=e._picking.getPickDepth(e,f);r.update(i,n),r.executeCopyDepth(i,t)}if(c||!C)continue;const M=t.framebuffer;if(t.framebuffer=h.sceneFramebuffer.getIdFramebuffer(),a.near=0!==f?I.near*e.opaqueFrustumNearOffset:I.near,a.far=I.far,o.updateFrustum(a),o.updatePass(KR.GLOBE),P=I.commands[KR.GLOBE],D=I.indices[KR.GLOBE],v)b.executeGlobeCommands(I,eke,O,e,t);else for(S=0;S<D;++S)eke(P[S],e,i,t);for(_&&(w.framebuffer=t.framebuffer,w.execute(i,t),w.framebuffer=void 0),_&&y&&T.execute(i,t),o.updatePass(KR.CESIUM_3D_TILE),P=I.commands[KR.CESIUM_3D_TILE],D=I.indices[KR.CESIUM_3D_TILE],S=0;S<D;++S)eke(P[S],e,i,t);for(o.updatePass(KR.OPAQUE),P=I.commands[KR.OPAQUE],D=I.indices[KR.OPAQUE],S=0;S<D;++S)eke(P[S],e,i,t);for(o.updatePass(KR.TRANSLUCENT),P=I.commands[KR.TRANSLUCENT],D=I.indices[KR.TRANSLUCENT],S=0;S<D;++S)eke(P[S],e,i,t);t.framebuffer=M}}function uke(e){e.context.uniformState.updatePass(KR.COMPUTE);const t=e._environmentState.sunComputeCommand;Object(l.a)(t)&&t.execute(e._computeEngine);const n=e._computeCommandList,i=n.length;for(let t=0;t<i;++t)n[t].execute(e._computeEngine)}function hke(e,t,n){const i=n.shadowMapCullingVolume,r=n.isPointLight,o=n.passes,a=o.length,s=t.length;for(let n=0;n<s;++n){const s=t[n];if(e.updateDerivedCommands(s),s.castShadows&&(s.pass===KR.GLOBE||s.pass===KR.CESIUM_3D_TILE||s.pass===KR.OPAQUE||s.pass===KR.TRANSLUCENT)&&e.isVisible(s,i))if(r)for(let e=0;e<a;++e)o[e].commandList.push(s);else if(1===a)o[0].commandList.push(s);else{let t=!1;for(let n=a-1;n>=0;--n){const i=o[n].cullingVolume;if(e.isVisible(s,i))o[n].commandList.push(s),t=!0;else if(t)break}}}}function dke(e){const t=e.frameState,n=t.shadowState.shadowMaps,i=n.length;if(!t.shadowState.shadowsEnabled)return;const r=e.context,o=r.uniformState;for(let t=0;t<i;++t){const i=n[t];if(i.outOfView)continue;const a=i.passes,s=a.length;for(let e=0;e<s;++e)a[e].commandList.length=0;hke(e,e.frameState.commandList,i);for(let n=0;n<s;++n){const a=i.passes[n];o.updateCamera(a.camera),i.updatePass(r,n);const s=a.commandList.length;for(let n=0;n<s;++n){const i=a.commandList[n];o.updatePass(i.pass),Qze(i.derivedCommands.shadows.castCommands[t],e,r,a.passState)}}}}const fke=new O;Hze.prototype.updateAndExecuteCommands=function(e,t){const n=this._frameState.mode;this._environmentState.useWebVR?function(e,t,n){const i=e._view,r=i.camera,o=e._environmentState.renderTranslucentDepthForPick;Tke(e,t,n),Eke(e),i.createPotentiallyVisibleSet(e),uke(e),o||dke(e);const a=t.viewport;a.x=0,a.y=0,a.width=.5*a.width;const s=LAe.clone(r,e._cameraVR);s.frustum=r.frustum;const l=r.frustum.near,u=l*Object(c.a)(e.focalLength,5),h=Object(c.a)(e.eyeSeparation,u/30),d=O.multiplyByScalar(s.right,.5*h,fke);r.frustum.aspectRatio=a.width/a.height;const f=.5*h*l/u;O.add(s.position,d,r.position),r.frustum.xOffset=f,lke(e,t),a.x=a.width,O.subtract(s.position,d,r.position),r.frustum.xOffset=-f,lke(e,t),LAe.clone(s,r)}(this,e,t):n!==AB.SCENE2D||this._mapMode2D===IOe.ROTATE?wke(!0,this,e,t):(Tke(this,e,t),function(e,t){const n=e.context,i=e.frameState,r=e.camera,o=t.viewport,a=Nl.clone(o,Oke);t.viewport=a;const s=pke,c=mke;e.mapProjection.project(s,c);const l=O.clone(r.position,gke),u=Me.clone(r.transform,yke),d=r.frustum.clone();r._setTransform(Me.IDENTITY);const f=Me.computeViewportTransformation(a,0,1,_ke),p=r.frustum.projectionMatrix,m=r.positionWC.y,g=O.fromElements(h.a.sign(m)*c.x-m,0,-r.positionWC.x,bke),_=ca.pointToGLWindowCoordinates(p,f,g,vke);_.x=Math.floor(_.x);const y=a.x,b=a.width;if(0===m||_.x<=y||_.x>=y+b)wke(!0,e,t);else if(Math.abs(y+.5*b-_.x)<1)a.width=_.x-a.x,r.position.x*=h.a.sign(r.position.x),r.frustum.right=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),wke(!0,e,t),a.x=_.x,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=0,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),wke(!1,e,t);else if(_.x>y+.5*b){a.width=_.x-y;const o=r.frustum.right;r.frustum.right=c.x-m,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),wke(!0,e,t),a.x=_.x,a.width=y+b-_.x,r.position.x=-r.position.x,r.frustum.left=-r.frustum.right,r.frustum.right=o-2*r.frustum.right,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),wke(!1,e,t)}else{a.x=_.x,a.width=y+b-_.x;const o=r.frustum.left;r.frustum.left=-c.x-m,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),wke(!0,e,t),a.x=y,a.width=_.x-y,r.position.x=-r.position.x,r.frustum.right=-r.frustum.left,r.frustum.left=o-2*r.frustum.left,i.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.uniformState.update(i),wke(!1,e,t)}r._setTransform(u),O.clone(l,r.position),r.frustum=d.clone(),t.viewport=o}(this,e))};const pke=new R(Math.PI,h.a.PI_OVER_TWO),mke=new O,gke=new O,_ke=new Me,yke=new Me,bke=new O,vke=new O,Oke=new Nl;function wke(e,t,n,i){const r=t._environmentState,o=t._view,a=r.renderTranslucentDepthForPick;e||(t.frameState.commandList.length=0),Eke(t),o.createPotentiallyVisibleSet(t),e&&(Object(l.a)(i)&&Tke(t,n,i),uke(t),a||dke(t)),lke(t,n)}const Ake=new xy;function Eke(e){const t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),function(e){const t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new YCe({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),Object(l.a)(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}(e),function(e){const t=e._frameState,n=t.shadowMaps,i=n.length,r=i>0&&!t.passes.pick&&e.mode===AB.SCENE3D;if(r!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=r),t.shadowState.lightShadowsEnabled=!1,r){for(let e=0;e<i;++e)if(n[e]!==t.shadowState.shadowMaps[e]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(let e=0;e<i;++e){const i=n[e];i.update(t),t.shadowState.shadowMaps.push(i),i.fromLightSource&&(t.shadowState.lightShadowMaps.push(i),t.shadowState.lightShadowsEnabled=!0),i.dirty&&(++t.shadowState.lastDirtyTime,i.dirty=!1)}}}(e),e._globe&&e._globe.render(t)}function Tke(e,t,n){const i=e._context,r=e._frameState,o=e._environmentState,a=e._view,s=e._frameState.passes.pick;Object(l.a)(a.globeDepth)&&(a.globeDepth.picking=s);const c=o.useWebVR;o.originalFramebuffer=t.framebuffer,Object(l.a)(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!c?e._sunPostProcess=new Uze:Object(l.a)(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!Object(l.a)(e.sun)&&Object(l.a)(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);const u=e._clearColorCommand;sp.clone(n,u.color),u.execute(i,t);const h=o.useGlobeDepthFramebuffer=Object(l.a)(a.globeDepth);h&&(a.globeDepth.update(i,t,a.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),a.globeDepth.clear(i,t,n));const d=a.oit,f=o.useOIT=!s&&Object(l.a)(d)&&d.isSupported();f&&(d.update(i,t,a.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),d.clear(i,t,n),o.useOIT=d.isSupported());const p=e.postProcessStages;let m=o.usePostProcess=!s&&(e._hdr||p.length>0||p.ambientOcclusion.enabled||p.fxaa.enabled||p.bloom.enabled);o.usePostProcessSelected=!1,m&&(a.sceneFramebuffer.update(i,a.viewport,e._hdr,e.msaaSamples),a.sceneFramebuffer.clear(i,t,n),p.update(i,r.useLogDepth,e._hdr),p.clear(i),m=o.usePostProcess=p.ready,o.usePostProcessSelected=m&&p.hasSelected),o.isSunVisible&&e.sunBloom&&!c?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=a.globeDepth.framebuffer:m&&(t.framebuffer=a.sceneFramebuffer.framebuffer),Object(l.a)(t.framebuffer)&&u.execute(i,t);if(o.useInvertClassification=!s&&Object(l.a)(t.framebuffer)&&e.invertClassification){let n;if(1===e.frameState.invertClassificationColor.alpha&&o.useGlobeDepthFramebuffer&&(n=a.globeDepth.framebuffer),Object(l.a)(n)||i.depthTexture){if(e._invertClassification.previousFramebuffer=n,e._invertClassification.update(i,e.msaaSamples,a.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&f){const t=e._invertClassification.unclassifiedCommand,n=t.derivedCommands;n.oit=d.createDerivedCommands(t,i,n.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(e._hdr,a.viewport,i,t)}function Cke(e){e._jobScheduler.resetBudgets();const t=e._frameState;e.primitives.prePassesUpdate(t),Object(l.a)(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function xke(e){const t=e._frameState;e.primitives.postPassesUpdate(t),Yx.a.update()}Hze.prototype.updateEnvironment=function(){const e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.skyAtmosphere,a=this.globe,s=this._globeTranslucencyState;if(!i||this._mode!==AB.SCENE2D&&t.camera.frustum instanceof nv||!s.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{Object(l.a)(o)?(Object(l.a)(a)&&(o.setDynamicAtmosphereColor(a.enableLighting&&a.dynamicAtmosphereLighting,a.dynamicAtmosphereLightingFromSun),n.isReadyForAtmosphere=n.isReadyForAtmosphere||a._surface._tilesToRender.length>0),n.skyAtmosphereCommand=o.update(e,a),Object(l.a)(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)):n.skyAtmosphereCommand=void 0,n.skyBoxCommand=Object(l.a)(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;const i=Object(l.a)(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=Object(l.a)(i)?i.drawCommand:void 0,n.sunComputeCommand=Object(l.a)(i)?i.computeCommand:void 0,n.moonCommand=Object(l.a)(this.moon)?this.moon.update(e):void 0}const c=n.clearGlobeDepth=Object(l.a)(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===AB.SCENE2D);(n.useDepthPlane=c&&this.mode===AB.SCENE3D&&s.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==AB.SCENE2D&&!r;const u=e.mode!==AB.SCENE3D||s.sunVisibleThroughGlobe?void 0:e.occluder;let h=e.cullingVolume;const d=Ake.planes;for(let e=0;e<5;++e)d[e]=h.planes[e];h=Ake,n.isSkyAtmosphereVisible=Object(l.a)(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(n.sunDrawCommand,h,u),n.isMoonVisible=this.isVisible(n.moonCommand,h,u);const f=this.specularEnvironmentMaps;let p=this._specularEnvironmentMapAtlas;!Object(l.a)(f)||Object(l.a)(p)&&p.url===f?!Object(l.a)(f)&&Object(l.a)(p)&&(p.destroy(),this._specularEnvironmentMapAtlas=void 0):(p=p&&p.destroy(),this._specularEnvironmentMapAtlas=new FU(f)),Object(l.a)(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)},Hze.prototype.resolveFramebuffers=function(e){const t=this._context,n=this._environmentState,i=this._view,r=i.globeDepth;Object(l.a)(r)&&r.prepareColorTextures(t);const o=n.useOIT,a=n.useGlobeDepthFramebuffer,s=n.usePostProcess,u=n.originalFramebuffer,h=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,f=i.sceneFramebuffer.idFramebuffer;o&&(e.framebuffer=s?d.framebuffer:u,i.oit.execute(t,e));const p=i.translucentTileClassification;if(p.hasTranslucentDepth&&p.isSupported()&&p.execute(this,e),s){i.sceneFramebuffer.prepareColorTextures(t);let e=d;a&&!o&&(e=h);const n=this.postProcessStages,r=e.getColorTexture(0),s=f.getColorTexture(0),l=Object(c.a)(h,d).getDepthStencilTexture();n.execute(t,r,l,s),n.copy(t,u)}o||s||!a||(e.framebuffer=u,r.executeCopyColor(t,e))},Hze.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=function(e){const t=e._globe,n=e.camera.positionCartographic;if(Object(l.a)(t)&&t.show&&Object(l.a)(n))return t.getHeight(n)}(this),this._cameraUnderground=function(e){const t=e.camera,n=e._mode,i=e.globe,r=e._screenSpaceCameraController,o=t.positionCartographic;if(!Object(l.a)(o))return!1;if(!r.onMap()&&o.height<0)return!0;if(!Object(l.a)(i)||!i.show||n===AB.SCENE2D||n===AB.MORPHING)return!1;const a=e._globeHeight;return Object(l.a)(a)&&o.height<a}(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),Object(l.a)(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};const Ske=new sp;function Ike(e){const t=e._frameState,n=e.context,i=n.uniformState,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=qze;let o=Object(c.a)(e.backgroundColor,sp.BLACK);e._hdr&&(o=sp.clone(o,Ske),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,e.fog.update(t),i.update(t);const a=e.shadowMap;Object(l.a)(a)&&a.enabled&&(!Object(l.a)(e.light)||e.light instanceof ive?O.negate(i.sunDirectionWC,e._shadowMapCamera.direction):O.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(a)),e._computeCommandList.length=0,e._overlayCommandList.length=0;const s=r.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;const u=r.passState;u.framebuffer=void 0,u.blendingEnabled=void 0,u.scissorTest=void 0,u.viewport=Nl.clone(s,u.viewport),Object(l.a)(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(u,o),e.resolveFramebuffers(u),u.framebuffer=void 0,function(e,t){e.context.uniformState.updatePass(KR.OVERLAY);const n=e.context,i=e._overlayCommandList,r=i.length;for(let e=0;e<r;++e)i[e].execute(n,t)}(e,u),Object(l.a)(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function Pke(e,t){try{t(e)}catch(t){if(e._renderError.raiseEvent(e,t),e.rethrowRenderErrors)throw t}}function Dke(e){return e._picking.updateMostDetailedRayPicks(e)}function Rke(e){const t=e._frameState;Wze.camera=t.camera,Wze.cullingVolume=t.cullingVolume;e.primitives.updateForPass(t,Wze)}function jke(e){const t=e._frameState;if(!t.camera.canPreloadFlight())return;Yze.camera=e.preloadFlightCamera,Yze.cullingVolume=e.preloadFlightCullingVolume;e.primitives.updateForPass(t,Yze)}function Mke(e){e.primitives.updateForPass(e._frameState,Xze)}Hze.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);const t=this._frameState;t.newFrame=!1,Object(l.a)(e)||(e=tr.now());const n=this._view.checkForCameraUpdates(this);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===AB.MORPHING;if(!i&&Object(l.a)(this.maximumRenderTimeChange)&&Object(l.a)(this._lastRenderTime)){const t=Math.abs(tr.secondsDifference(this._lastRenderTime,e));i=i||t>this.maximumRenderTimeChange}if(i){this._lastRenderTime=tr.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;Zze(this,h.a.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0}Pke(this,Cke),this.primitives.show&&(Pke(this,Dke),Pke(this,Rke),Pke(this,jke),i||Pke(this,Mke)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),Pke(this,Ike)),function(e,t){if(e.debugShowFramesPerSecond){if(!Object(l.a)(e._performanceDisplay)){const t=document.createElement("div");t.className="cesium-performanceDisplay-defaultContainer";e._canvas.parentNode.appendChild(t);const n=new $Re({container:t});e._performanceDisplay=n,e._performanceContainer=t}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else Object(l.a)(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}(this,i),Pke(this,xke),function(e){const t=e._frameState.afterRender;for(let n=0,i=t.length;n<i;++n)t[n](),e.requestRender();t.length=0}(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())},Hze.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Hze.prototype.requestRender=function(){this._renderRequested=!0},Hze.prototype.clampLineWidth=function(e){return Math.max(MD.minimumAliasedLineWidth,Math.min(e,MD.maximumAliasedLineWidth))},Hze.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)},Hze.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)},Hze.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)},Hze.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)},Hze.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)},Hze.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)},Hze.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)},Hze.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)},Hze.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)},Hze.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)},Hze.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)},Hze.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)},Hze.prototype.cartesianToCanvasCoordinates=function(e,t){return iQ.wgs84ToWindowCoordinates(this,e,t)},Hze.prototype.completeMorph=function(){this._transitioner.completeMorph()},Hze.prototype.morphTo2D=function(e){let t;const n=this.globe;t=Object(l.a)(n)?n.ellipsoid:this.mapProjection.ellipsoid,e=Object(c.a)(e,2),this._transitioner.morphTo2D(e,t)},Hze.prototype.morphToColumbusView=function(e){let t;const n=this.globe;t=Object(l.a)(n)?n.ellipsoid:this.mapProjection.ellipsoid,e=Object(c.a)(e,2),this._transitioner.morphToColumbusView(e,t)},Hze.prototype.morphTo3D=function(e){let t;const n=this.globe;t=Object(l.a)(n)?n.ellipsoid:this.mapProjection.ellipsoid,e=Object(c.a)(e,2),this._transitioner.morphTo3D(e,t)},Hze.prototype.isDestroyed=function(){return!1},Hze.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),Object(l.a)(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,sc(this)};var Lke=Hze,Nke="float interpolateByDistance(vec4 nearFarScalar, float distance)\n{\n    float startDistance = nearFarScalar.x;\n    float startValue = nearFarScalar.y;\n    float endDistance = nearFarScalar.z;\n    float endValue = nearFarScalar.w;\n    float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\n    return mix(startValue, endValue, t);\n}\n\nvec3 getLightDirection(vec3 positionWC)\n{\n    float lightEnum = u_radiiAndDynamicAtmosphereColor.z;\n    vec3 lightDirection =\n        positionWC * float(lightEnum == 0.0) +\n        czm_lightDirectionWC * float(lightEnum == 1.0) +\n        czm_sunDirectionWC * float(lightEnum == 2.0);\n    return normalize(lightDirection);\n}\n\nvoid computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)\n{\n    float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;\n\n    // Adjustment to the atmosphere radius applied based on the camera height.\n    float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;\n    float distanceAdjustMax = czm_ellipsoidRadii.x;\n    float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;\n    float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);\n\n    // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit \n    // for the position on the ellipsoid.\n    float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;\n    float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;\n\n    // Setup the primary ray: from the camera position to the vertex position.\n    vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;\n    vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);\n    czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);\n\n    underTranslucentGlobe = 0.0;\n\n    // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.\n    #if defined(GLOBE_TRANSLUCENT)\n\n        // Check for intersection with the inner radius of the atmopshere.\n        czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);\n        if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {\n            \n            // Compute position on globe.\n            vec3 direction = normalize(positionWC);\n            czm_ray ellipsoidRay = czm_ray(positionWC, -direction);\n            czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);\n            vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);\n\n            // Control the color using the camera angle.\n            float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));\n\n            // Control the opacity using the distance from Earth.\n            opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));\n            vec3 horizonColor = vec3(0.1, 0.2, 0.3);\n            vec3 nearColor = vec3(0.0);\n\n            rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);\n            \n            // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.\n            underTranslucentGlobe = 1.0;\n            return;\n        }\n    #endif\n\n    computeScattering(\n        primaryRay,\n        length(cameraToPositionWC),\n        lightDirection,\n        atmosphereInnerRadius,\n        rayleighColor,\n        mieColor,\n        opacity\n    );\n\n    // Alter the opacity based on how close the viewer is to the ground.\n    // (0.0 = At edge of atmosphere, 1.0 = On ground)\n    float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;\n    float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;\n    opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);\n\n    // Alter alpha based on time of day (0.0 = night , 1.0 = day)\n    float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\n    opacity *= pow(nightAlpha, 0.5);\n}\n",Bke="varying vec3 v_outerPositionWC;\n\nuniform vec3 u_hsbShift;\n\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\nvarying float v_opacity;\nvarying float v_translucent;\n#endif\n\nvoid main (void)\n{\n    vec3 lightDirection = getLightDirection(v_outerPositionWC);\n   \n    vec3 mieColor;\n    vec3 rayleighColor;\n    float opacity;\n    float translucent;\n\n    #ifdef PER_FRAGMENT_ATMOSPHERE\n        computeAtmosphereScattering(\n            v_outerPositionWC,\n            lightDirection,\n            rayleighColor,\n            mieColor,\n            opacity,\n            translucent\n        );\n    #else\n        mieColor = v_mieColor;\n        rayleighColor = v_rayleighColor;\n        opacity = v_opacity;\n        translucent = v_translucent;\n    #endif\n\n    vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);\n\n    #ifndef HDR\n        color.rgb = czm_acesTonemapping(color.rgb);\n        color.rgb = czm_inverseGamma(color.rgb);\n    #endif\n\n    #ifdef COLOR_CORRECT\n        // Convert rgb color to hsb\n        vec3 hsb = czm_RGBToHSB(color.rgb);\n        // Perform hsb shift\n        hsb.x += u_hsbShift.x; // hue\n        hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation\n        hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness\n        // Convert shifted hsb back to rgb\n        color.rgb = czm_HSBToRGB(hsb);\n    #endif\n\n    // For the parts of the sky atmosphere that are not behind a translucent globe,\n    // we mix in the default opacity so that the sky atmosphere still appears at distance.\n    // This is needed because the opacity in the sky atmosphere is initially adjusted based\n    // on the camera height.\n    if (translucent == 0.0) {\n        color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);\n    }\n\n    gl_FragColor = color;\n}\n",Fke="attribute vec4 position;\n\nvarying vec3 v_outerPositionWC;\n\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\nvarying float v_opacity;\nvarying float v_translucent;\n#endif\n\nvoid main(void)\n{\n    vec4 positionWC = czm_model * position;\n    vec3 lightDirection = getLightDirection(positionWC.xyz);\n\n    #ifndef PER_FRAGMENT_ATMOSPHERE\n        computeAtmosphereScattering(\n            positionWC.xyz,\n            lightDirection,\n            v_rayleighColor,\n            v_mieColor,\n            v_opacity,\n            v_translucent\n        );\n    #endif\n    \n    v_outerPositionWC = positionWC.xyz;\n    gl_Position = czm_modelViewProjection * position;\n}\n";function zke(e){e=Object(c.a)(e,H.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;const t=O.multiplyByScalar(e.radii,1.025,new O);this._scaleMatrix=Me.fromScale(t),this._modelMatrix=new Me,this._command=new XR({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new O(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new O(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new O;const n=new O;n.x=1.025*e.maximumRadius,n.y=e.maximumRadius,n.z=0,this._radiiAndDynamicAtmosphereColor=n;const i=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return i._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return i._hueSaturationBrightness.x=i.hueShift,i._hueSaturationBrightness.y=i.saturationShift,i._hueSaturationBrightness.z=i.brightnessShift,i._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return i.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return i.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return i.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return i.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return i.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return i.atmosphereMieAnisotropy}}}Object.defineProperties(zke.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),zke.prototype.setDynamicAtmosphereColor=function(e,t){const n=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=n};const kke=new Me;zke.prototype.update=function(e,t){if(!this.show)return;const n=e.mode;if(n!==AB.SCENE3D&&n!==AB.MORPHING)return;if(!e.passes.render)return;const i=Me.fromRotationTranslation(e.context.uniformState.inverseViewRotation,O.ZERO,kke),r=Me.multiplyTransformation(i,HU.Y_UP_TO_Z_UP,kke),o=Me.multiply(this._scaleMatrix,r,kke);Me.clone(o,this._modelMatrix);const a=e.context,s=(c=this,!(h.a.equalsEpsilon(c.hueShift,0,h.a.EPSILON7)&&h.a.equalsEpsilon(c.saturationShift,0,h.a.EPSILON7)&&h.a.equalsEpsilon(c.brightnessShift,0,h.a.EPSILON7)));var c;const u=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||u||!Object(l.a)(t)||!t.show,f=this._command;if(!Object(l.a)(f.vertexArray)){const e=Rb.createGeometry(new Rb({radii:new O(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:nu.POSITION_ONLY}));f.vertexArray=iB.fromGeometry({context:a,geometry:e,attributeLocations:$d.createAttributeLocations(e),bufferUsage:KN.STATIC_DRAW}),f.renderState=vj.fromCache({cull:{enabled:!0,face:PD.FRONT},blending:SD.ALPHA_BLEND,depthMask:!1})}const p=s|d<<2|u<<3;if(p!==this._flags){this._flags=p;const e=[];s&&e.push("COLOR_CORRECT"),d&&e.push("PER_FRAGMENT_ATMOSPHERE"),u&&e.push("GLOBE_TRANSLUCENT");const t=new UN({defines:e,sources:[Yxe,Nke,Fke]}),n=new UN({defines:e,sources:[Yxe,Nke,Bke]});this._spSkyAtmosphere=oM.fromCache({context:a,vertexShaderSource:t,fragmentShaderSource:n}),f.shaderProgram=this._spSkyAtmosphere}return f},zke.prototype.isDestroyed=function(){return!1},zke.prototype.destroy=function(){const e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),sc(this)};var Uke=zke,Vke="uniform samplerCube u_cubeMap;\n\nvarying vec3 v_texCoord;\n\nvoid main()\n{\n    vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n    gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",Hke="attribute vec3 position;\n\nvarying vec3 v_texCoord;\n\nvoid main()\n{\n    vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n    gl_Position = czm_projection * vec4(p, 1.0);\n    v_texCoord = position.xyz;\n}\n";function Gke(e){this.sources=e.sources,this._sources=void 0,this.show=Object(c.a)(e.show,!0),this._command=new XR({modelMatrix:Me.clone(Me.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}Gke.prototype.update=function(e,t){const n=this;if(!this.show)return;if(e.mode!==AB.SCENE3D&&e.mode!==AB.MORPHING)return;if(!e.passes.render)return;const i=e.context;if(this._sources!==this.sources){this._sources=this.sources;const e=this.sources;if(!(Object(l.a)(e.positiveX)&&Object(l.a)(e.negativeX)&&Object(l.a)(e.positiveY)&&Object(l.a)(e.negativeY)&&Object(l.a)(e.positiveZ)&&Object(l.a)(e.negativeZ)))throw new u.a("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof e.positiveX!=typeof e.negativeX||typeof e.positiveX!=typeof e.positiveY||typeof e.positiveX!=typeof e.negativeY||typeof e.positiveX!=typeof e.positiveZ||typeof e.positiveX!=typeof e.negativeZ)throw new u.a("this.sources properties must all be the same type.");"string"==typeof e.positiveX?Mve(i,this._sources).then((function(e){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=e})):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new XD({context:i,source:e}))}const r=this._command;if(!Object(l.a)(r.vertexArray)){r.uniformMap={u_cubeMap:function(){return n._cubeMap}};const e=uu.createGeometry(uu.fromDimensions({dimensions:new O(2,2,2),vertexFormat:nu.POSITION_ONLY})),t=this._attributeLocations=$d.createAttributeLocations(e);r.vertexArray=iB.fromGeometry({context:i,geometry:e,attributeLocations:t,bufferUsage:KN.STATIC_DRAW}),r.renderState=vj.fromCache({blending:SD.ALPHA_BLEND})}if(!Object(l.a)(r.shaderProgram)||this._useHdr!==t){const e=new UN({defines:[t?"HDR":""],sources:[Vke]});r.shaderProgram=oM.fromCache({context:i,vertexShaderSource:Hke,fragmentShaderSource:e,attributeLocations:this._attributeLocations}),this._useHdr=t}return Object(l.a)(this._cubeMap)?r:void 0},Gke.prototype.isDestroyed=function(){return!1},Gke.prototype.destroy=function(){const e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),sc(this)};var qke=Gke;function Wke(e){e=Object(c.a)(e,1),s.a.typeOf.number.greaterThan("radius",e,0),this._radius=Object(c.a)(e,1)}Object.defineProperties(Wke.prototype,{radius:{get:function(){return this._radius},set:function(e){s.a.typeOf.number.greaterThan("value",e,0),this._radius=e}}}),Wke.prototype.emit=function(e){const t=h.a.randomBetween(0,h.a.TWO_PI),n=h.a.randomBetween(0,h.a.PI),i=h.a.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),a=i*Math.cos(n);e.position=O.fromElements(r,o,a,e.position),e.velocity=O.normalize(e.position,e.velocity)};var Yke=Wke;function Xke(){}Xke.prototype.evaluate=function(e,t){u.a.throwInstantiationError()},Xke.prototype.evaluateColor=function(e,t){u.a.throwInstantiationError()},Xke.prototype.getShaderFunction=function(e,t,n,i){u.a.throwInstantiationError()},Xke.prototype.getVariables=function(){u.a.throwInstantiationError()};var Kke=Xke,Jke="uniform sampler2D u_texture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    vec4 color = texture2D(u_texture, v_textureCoordinates);\n    gl_FragColor = czm_gammaCorrect(color);\n}\n",Zke="uniform float u_radiusTS;\n\nvarying vec2 v_textureCoordinates;\n\nvec2 rotate(vec2 p, vec2 direction)\n{\n    return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\n\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\n{\n    vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\n    float radius = length(rotatedPosition) * lengthScalar;\n    float burst = 1.0 - smoothstep(0.0, 0.55, radius);\n    return vec4(burst);\n}\n\nvoid main()\n{\n    float lengthScalar = 2.0 / sqrt(2.0);\n    vec2 position = v_textureCoordinates - vec2(0.5);\n    float radius = length(position) * lengthScalar;\n    float surface = step(radius, u_radiusTS);\n    vec4 color = vec4(vec2(1.0), surface + 0.2, surface);\n\n    float glow = 1.0 - smoothstep(0.0, 0.55, radius);\n    color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\n\n    vec4 burst = vec4(0.0);\n\n    // The following loop has been manually unrolled for speed, to\n    // avoid sin() and cos().\n    //\n    //for (float i = 0.4; i < 3.2; i += 1.047) {\n    //    vec2 direction = vec2(sin(i), cos(i));\n    //    burst += 0.4 * addBurst(position, direction, lengthScalar);\n    //\n    //    direction = vec2(sin(i - 0.08), cos(i - 0.08));\n    //    burst += 0.3 * addBurst(position, direction, lengthScalar);\n    //}\n\n    burst += 0.4 * addBurst(position, vec2(0.38942,  0.92106), lengthScalar);  // angle == 0.4\n    burst += 0.4 * addBurst(position, vec2(0.99235,  0.12348), lengthScalar);  // angle == 0.4 + 1.047\n    burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);  // angle == 0.4 + 1.047 * 2.0\n\n    burst += 0.3 * addBurst(position, vec2(0.31457,  0.94924), lengthScalar);  // angle == 0.4 - 0.08\n    burst += 0.3 * addBurst(position, vec2(0.97931,  0.20239), lengthScalar);  // angle == 0.4 + 1.047 - 0.08\n    burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);  // angle == 0.4 + 1.047 * 2.0 - 0.08\n\n    // End of manual loop unrolling.\n\n    color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\n\n    gl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n",$ke="attribute vec2 direction;\n\nuniform float u_size;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main() \n{\n    vec4 position;\n    if (czm_morphTime == 1.0)\n    {\n        position = vec4(czm_sunPositionWC, 1.0);\n    }\n    else\n    {\n        position = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n    }\n    \n    vec4 positionEC = czm_view * position;\n    vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n    \n    vec2 halfSize = vec2(u_size * 0.5);\n    halfSize *= ((direction * 2.0) - 1.0);\n    \n    gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\n    \n    v_textureCoordinates = direction;\n}\n";function Qke(){this.show=!0,this._drawCommand=new XR({primitiveType:zl.TRIANGLES,boundingVolume:new At,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new At,this._boundingVolume2D=new At,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;const e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(Qke.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});const eUe=new Vt,tUe=new Vt,nUe=new _e,iUe=new _e;Qke.prototype.update=function(e,t,n){if(!this.show)return;const i=e.mode;if(i===AB.SCENE2D||i===AB.MORPHING)return;if(!e.passes.render)return;const r=e.context,o=t.viewport.width,a=t.viewport.height;if(!Object(l.a)(this._texture)||o!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=n;let e=Math.max(o,a);e=Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))-2),e=Math.max(1,e);const t=n?r.halfFloatingPointTexture?rT.HALF_FLOAT:rT.FLOAT:rT.UNSIGNED_BYTE;this._texture=new JD({context:r,width:e,height:e,pixelFormat:aT.RGBA,pixelDatatype:t}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;const i=this,s={u_radiusTS:function(){return i._radiusTS}};this._commands.computeCommand=new vU({fragmentShaderSource:Zke,outputTexture:this._texture,uniformMap:s,persists:!1,owner:this,postExecute:function(){i._commands.computeCommand=void 0}})}const s=this._drawCommand;if(!Object(l.a)(s.vertexArray)){const e={direction:0},t=new Uint8Array(8);t[0]=0,t[1]=0,t[2]=255,t[3]=0,t[4]=255,t[5]=255,t[6]=0,t[7]=255;const n=ZN.createVertexBuffer({context:r,typedArray:t,usage:KN.STATIC_DRAW}),i=[{index:e.direction,vertexBuffer:n,componentsPerAttribute:2,normalize:!0,componentDatatype:gs.UNSIGNED_BYTE}],o=ZN.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:KN.STATIC_DRAW,indexDatatype:wc.UNSIGNED_SHORT});s.vertexArray=new iB({context:r,attributes:i,indexBuffer:o}),s.shaderProgram=oM.fromCache({context:r,vertexShaderSource:$ke,fragmentShaderSource:Jke,attributeLocations:e}),s.renderState=vj.fromCache({blending:SD.ALPHA_BLEND}),s.uniformMap=this._uniformMap}const c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,d=this._boundingVolume,f=this._boundingVolume2D;O.clone(c,d.center),f.center.x=u.z,f.center.y=u.x,f.center.z=u.y,d.radius=h.a.SOLAR_RADIUS+h.a.SOLAR_RADIUS*this._glowLengthTS,f.radius=d.radius,i===AB.SCENE3D?At.clone(d,s.boundingVolume):i===AB.COLUMBUS_VIEW&&At.clone(f,s.boundingVolume);const p=iQ.computeActualWgs84Position(e,c,iUe),m=O.magnitude(O.subtract(p,e.camera.position,iUe)),g=r.uniformState.projection,_=nUe;_.x=0,_.y=0,_.z=-m,_.w=1;const y=Me.multiplyByVector(g,_,iUe),b=iQ.clipToGLWindowCoordinates(t.viewport,y,eUe);_.x=h.a.SOLAR_RADIUS;const v=Me.multiplyByVector(g,_,iUe),w=iQ.clipToGLWindowCoordinates(t.viewport,v,tUe);return this._size=Vt.magnitude(Vt.subtract(w,b,iUe)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands},Qke.prototype.isDestroyed=function(){return!1},Qke.prototype.destroy=function(){const e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),sc(this)};var rUe=Qke;function oUe(){}oUe.prototype.boundingVolume=void 0,oUe.prototype.boundingSphere=void 0,oUe.prototype.distanceToCamera=function(e){u.a.throwInstantiationError()},oUe.prototype.intersectPlane=function(e){u.a.throwInstantiationError()},oUe.prototype.createDebugVolume=function(e){u.a.throwInstantiationError()};var aUe=oUe;function sUe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this._tilingScheme=Object(l.a)(e.tilingScheme)?e.tilingScheme:new Gt({ellipsoid:e.ellipsoid}),this._color=Object(c.a)(e.color,sp.YELLOW),this._errorEvent=new un.a,this._tileWidth=Object(c.a)(e.tileWidth,256),this._tileHeight=Object(c.a)(e.tileHeight,256),this._readyPromise=Promise.resolve(!0),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0}Object.defineProperties(sUe.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),sUe.prototype.getTileCredits=function(e,t,n){},sUe.prototype.requestImage=function(e,t,n,i){const r=document.createElement("canvas");r.width=256,r.height=256;const o=r.getContext("2d"),a=this._color.toCssColorString();return o.strokeStyle=a,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=a,o.fillText("L: "+n,124,86),o.fillText("X: "+e,124,136),o.fillText("Y: "+t,124,186),Promise.resolve(r)},sUe.prototype.pickFeatures=function(e,t,n,i,r){};var cUe=sUe;function lUe(e){u.a.throwInstantiationError()}lUe.prototype.isReady=u.a.throwInstantiationError,lUe.prototype.shouldDiscardImage=u.a.throwInstantiationError;var uUe=lUe;var hUe=Object.freeze({START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3});function dUe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),s.a.typeOf.object("options.clock",e.clock),s.a.typeOf.object("options.intervals",e.intervals),this.show=Object(c.a)(e.show,!0),this.modelMatrix=Me.clone(Object(c.a)(e.modelMatrix,Me.IDENTITY)),this.shadows=Object(c.a)(e.shadows,TB.ENABLED),this.maximumMemoryUsage=Object(c.a)(e.maximumMemoryUsage,256),this.shading=new v$(e.shading),this.style=e.style,this.frameFailed=new un.a,this.frameChanged=new un.a,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new y$,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;const t=this;this._readyPromise=new Promise((function(e){t._resolveReadyPromise=e})),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}function fUe(e){return"uniform vec4 czm_pickColor;\n"+e}function pUe(){return"czm_pickColor"}Object.defineProperties(dUe.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Fq.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(Object(l.a)(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise}}}),dUe.prototype.makeStyleDirty=function(){this._styleDirty=!0},dUe.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};const mUe=new tr;function gUe(e){const t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function _Ue(e,t){return e._intervals.indexOf(t.start)}function yUe(e,t,n){const i=_Ue(e,t),r=e._frames;let o=r[i];if(!Object(l.a)(o)){const a=t.data.transform,s=Object(l.a)(a)?Me.fromArray(a):void 0,c=t.data.uri;o={pointCloud:void 0,transform:s,timestamp:Xf(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber},r[i]=o,Tt.a.fetchArrayBuffer({url:c}).then((function(t){var n;return o.pointCloud=new QZ({arrayBuffer:t,cull:!0,fragmentShaderLoaded:fUe,uniformMapLoaded:(n=e,function(e){return Object(up.a)(e,{czm_pickColor:function(){return n._pickId.color}})}),pickIdLoaded:pUe}),o.pointCloud.readyPromise})).catch(function(e,t){return function(n){const i=Object(l.a)(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log("A frame failed to load: "+t),console.log("Error: "+i))}}(e,c))}return o}function bUe(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);const r=t.pointCloud;if(Object(l.a)(r)&&!t.ready){const o=i.commandList,a=o.length;if(wUe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=a,t.sequential)){!function(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}(e,(Xf()-t.timestamp)/1e3)}}t.touchedFrameNumber=i.frameNumber}const vUe=new Me;const OUe=new v$;function wUe(e,t,n,i){const r=Object(c.a)(e.shading,OUe),o=t.pointCloud,a=Object(c.a)(t.transform,Me.IDENTITY);o.modelMatrix=Me.multiplyTransformation(e.modelMatrix,a,vUe),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=function(e,t){const n=e.shading;return Object(l.a)(n)&&Object(l.a)(n.baseResolution)?n.baseResolution:Object(l.a)(t.boundingSphere)?h.a.cbrt(t.boundingSphere.volume()/t.pointsLength):0}(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=function(e){const t=e.shading;return Object(l.a)(t)&&Object(l.a)(t.maximumAttenuation)?t.maximumAttenuation:10}(e),o.update(i),t.touchedFrameNumber=i.frameNumber}function AUe(e,t,n,i){bUe(e,yUe(e,t,i),n,i)}function EUe(e,t){const n=e._frames,i=n.length;for(let r=0;r<i;++r){const i=n[r];if(Object(l.a)(i)&&(!Object(l.a)(t)||t(i))){const t=i.pointCloud;i.ready&&(e._totalMemoryUsageInBytes-=t.geometryByteLength),Object(l.a)(t)&&t.destroy(),i===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function TUe(e,t,n,i,r){return!!Object(l.a)(n)&&(!!n.ready||(AUe(e,t,i,r),n.ready))}const CUe={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};dUe.prototype.update=function(e){if(e.mode===AB.MORPHING)return;if(!this.show)return;Object(l.a)(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),Object(l.a)(this._loadTimestamp)||(this._loadTimestamp=tr.clone(e.time));const t=Math.max(1e3*tr.secondsDifference(e.time,this._loadTimestamp),0),n=this._clippingPlanes;let i=0,r=!1;const o=Object(l.a)(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);const a=this._styleDirty;this._styleDirty=!1,(r||a)&&function(e,t,n){const i=e._frames,r=i.length;for(let e=0;e<r;++e){const r=i[e];Object(l.a)(r)&&Object(l.a)(r.pointCloud)&&(r.pointCloud.clippingPlanesDirty=t,r.pointCloud.styleDirty=n)}}(this,r,a),CUe.timeSinceLoad=t,CUe.isClipped=o;const s=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,h=u.length;let d=this._previousInterval,f=this._nextInterval;const p=function(e){const t=e._intervals,n=e._clock.currentTime,i=t.indexOf(n);return t.get(i)}(this);if(!Object(l.a)(p))return;let m=!1;const g=gUe(this),_=0===g;g!==this._clockMultiplier&&(m=!0,this._clockMultiplier=g),Object(l.a)(d)&&!_||(d=p),(!Object(l.a)(f)||m||function(e,t,n){const i=gUe(e),r=_Ue(e,t),o=_Ue(e,n);return i>=0?r>=o:r<=o}(this,p,f))&&(f=function(e,t){const n=e._intervals,i=e._clock,r=gUe(e);if(0===r)return;const o=e._getAverageLoadTime(),a=tr.addSeconds(i.currentTime,o*r,mUe);let s=n.indexOf(a);return s===_Ue(e,t)&&(r>=0?++s:--s),n.get(s)}(this,p)),d=function(e,t,n,i,r){let o,a,s;const c=e._intervals,l=e._frames,u=_Ue(e,n),h=_Ue(e,t);if(u>=h){for(o=u;o>=h;--o)if(a=c.get(o),s=l[o],TUe(e,a,s,i,r))return a}else for(o=u;o<=h;++o)if(a=c.get(o),s=l[o],TUe(e,a,s,i,r))return a;return t}(this,d,p,CUe,e);let y=function(e,t){const n=_Ue(e,t),i=e._frames[n];if(Object(l.a)(i)&&i.ready)return i}(this,d);Object(l.a)(y)||(AUe(this,d,CUe,e),y=this._lastRenderedFrame),Object(l.a)(y)&&wUe(this,y,CUe,e),Object(l.a)(f)&&AUe(this,f,CUe,e);const b=this;Object(l.a)(y)&&!Object(l.a)(this._lastRenderedFrame)&&e.afterRender.push((function(){b._resolveReadyPromise(b)})),Object(l.a)(y)&&y!==this._lastRenderedFrame&&b.frameChanged.numberOfListeners>0&&e.afterRender.push((function(){b.frameChanged.raiseEvent(b)})),this._previousInterval=d,this._nextInterval=f,this._lastRenderedFrame=y;this._totalMemoryUsageInBytes>1024*this.maximumMemoryUsage*1024&&EUe(this,function(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}(e));const v=u.length-h;Object(l.a)(s)&&s.attenuation&&s.eyeDomeLighting&&v>0&&c.update(e,h,s,this.boundingSphere)},dUe.prototype.isDestroyed=function(){return!1},dUe.prototype.destroy=function(){return EUe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),sc(this)};var xUe=dUe,SUe="\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    czm_materialInput materialInput;\n    \n    materialInput.s = v_textureCoordinates.s;\n    materialInput.st = v_textureCoordinates;\n    materialInput.str = vec3(v_textureCoordinates, 0.0);\n    materialInput.normalEC = vec3(0.0, 0.0, -1.0);\n    \n    czm_material material = czm_getMaterial(materialInput);\n\n    gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n";function IUe(e,t){this.show=!0,Object(l.a)(e)||(e=new Nl),this.rectangle=Nl.clone(e),Object(l.a)(t)||(t=CR.fromType(CR.ColorType,{color:new sp(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}IUe.prototype.update=function(e){if(!this.show)return;if(!Object(l.a)(this.material))throw new u.a("this.material must be defined.");if(!Object(l.a)(this.rectangle))throw new u.a("this.rectangle must be defined.");const t=this._rs;Object(l.a)(t)&&Nl.equals(t.viewport,this.rectangle)||(this._rs=vj.fromCache({blending:SD.ALPHA_BLEND,viewport:this.rectangle}));if(e.passes.render){const t=e.context;if(this._material!==this.material||!Object(l.a)(this._overlayCommand)){this._material=this.material,Object(l.a)(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();const e=new UN({sources:[this._material.shaderSource,SUe]});this._overlayCommand=t.createViewportQuadCommand(e,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=KR.OVERLAY}this._material.update(t),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}},IUe.prototype.isDestroyed=function(){return!1},IUe.prototype.destroy=function(){return Object(l.a)(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),sc(this)};var PUe=IUe,DUe=n(33);function RUe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=jUe(e,!0);return(t=t||Object.getOwnPropertyNames(e)).forEach((function(t){if("__knockoutObservables"!==t&&"__knockoutSubscribable"!==t&&!(t in i)){var r=e[t],o=r instanceof Array,a=n.isObservable(r)?r:o?n.observableArray(r):n.observable(r);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[t]=a,o&&function(e,t){var n=null;e.computed((function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=function(e,t,n){return function(e,t){var n=t.__knockoutSubscribable;if(!n){n=new e.subscribable,Object.defineProperty(t,"__knockoutSubscribable",{value:n});var i={};!function(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach((function(i){var r=e[i];e[i]=function(){var e=r.apply(this,arguments);return!0!==n.pause&&t.notifySubscribers(this),e}}))}(t,n,i),function(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach((function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})}))}(e,t,n,i)}return n}(e,n).subscribe(t)}(e,t,i))}))}(n,a)}})),e}function jUe(e,t){var n=e.__knockoutObservables;return!n&&t&&(n={},Object.defineProperty(e,"__knockoutObservables",{value:n})),n}function MUe(e,t,n){var i={owner:e,deferEvaluation:!0};if("function"==typeof n)i.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof n.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');i.read=n.get,i.write=n.set}return e[t]=this.computed(i),RUe.call(this,e,[t]),e}function LUe(e,t){if(!e)return null;var n=jUe(e,!1);return n&&n[t]||null}function NUe(e,t){var n=LUe(e,t);n&&n.valueHasMutated()}var BUe={attachToKo:function(e){e.track=RUe,e.getObservable=LUe,e.valueHasMutated=NUe,e.defineProperty=MUe}};var FUe={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){const i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","cesium-svgPath-svg");const r=document.createElementNS("http://www.w3.org/2000/svg","path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){const t=e.unwrap(n());r.setAttribute("d",e.unwrap(t.path));const o=e.unwrap(t.width),a=e.unwrap(t.height);i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${o} ${a}`),t.css&&i.setAttribute("class","cesium-svgPath-svg "+e.unwrap(t.css))},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}};BUe.attachToKo(DUe.a),FUe.register(DUe.a);var zUe=DUe.a,kUe=n(79),UUe=n(80),VUe=n.n(UUe),HUe=n(81),GUe=n.n(HUe),qUe=n(82),WUe=n.n(qUe);function YUe(e){Object(l.a)(e)||(e=new Jf),this._clock=e,this._eventHelper=new Gb,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=zUe.observable(tr.now()),this.systemTime.equalityComparer=tr.equals,this.startTime=zUe.observable(e.startTime),this.startTime.equalityComparer=tr.equals,this.startTime.subscribe((function(t){e.startTime=t,this.synchronize()}),this),this.stopTime=zUe.observable(e.stopTime),this.stopTime.equalityComparer=tr.equals,this.stopTime.subscribe((function(t){e.stopTime=t,this.synchronize()}),this),this.currentTime=zUe.observable(e.currentTime),this.currentTime.equalityComparer=tr.equals,this.currentTime.subscribe((function(t){e.currentTime=t,this.synchronize()}),this),this.multiplier=zUe.observable(e.multiplier),this.multiplier.subscribe((function(t){e.multiplier=t,this.synchronize()}),this),this.clockStep=zUe.observable(e.clockStep),this.clockStep.subscribe((function(t){e.clockStep=t,this.synchronize()}),this),this.clockRange=zUe.observable(e.clockRange),this.clockRange.subscribe((function(t){e.clockRange=t,this.synchronize()}),this),this.canAnimate=zUe.observable(e.canAnimate),this.canAnimate.subscribe((function(t){e.canAnimate=t,this.synchronize()}),this),this.shouldAnimate=zUe.observable(e.shouldAnimate),this.shouldAnimate.subscribe((function(t){e.shouldAnimate=t,this.synchronize()}),this),zUe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(YUe.prototype,{clock:{get:function(){return this._clock}}}),YUe.prototype.synchronize=function(){const e=this._clock;this.systemTime=tr.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},YUe.prototype.isDestroyed=function(){return!1},YUe.prototype.destroy=function(){this._eventHelper.removeAll(),sc(this)};var XUe=YUe;var KUe=function(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,u.a.throwInstantiationError()};var JUe=function(e,t){if(!Object(l.a)(e))throw new u.a("func is required.");t=Object(c.a)(t,!0);const n=new un.a,i=new un.a;function r(){if(!r.canExecute)throw new u.a("Cannot execute command, canExecute is false.");const t={args:arguments,cancel:!1};let o;return n.raiseEvent(t),t.cancel||(o=e.apply(null,arguments),i.raiseEvent(o)),o}return r.canExecute=t,zUe.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r};const ZUe={createCheckbox:function(e,t,n){s.a.typeOf.string("labelText",e),s.a.typeOf.string("checkedBinding",t);const i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let a="checked: "+t;return Object(l.a)(n)&&(a+=", enable: "+n),o.setAttribute("data-bind",a),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i},createSection:function(e,t,n,i){s.a.defined("panel",e),s.a.typeOf.string("headerText",t),s.a.typeOf.string("sectionVisibleBinding",n),s.a.typeOf.string("toggleSectionVisibilityBinding",i);const r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);const o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind","click: "+i),r.appendChild(o);const a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",r.appendChild(a),a}};var $Ue=ZUe;var QUe=function(e,t,n,i,r){return n.call(i,e[t]),zUe.getObservable(e,t).subscribe(n,i,r)};function eVe(e,t){if(!Object(l.a)(e))throw new u.a("command is required.");this._command=e,t=Object(c.a)(t,c.a.EMPTY_OBJECT),this.toggled=Object(c.a)(t.toggled,!1),this.tooltip=Object(c.a)(t.tooltip,""),zUe.track(this,["toggled","tooltip"])}Object.defineProperties(eVe.prototype,{command:{get:function(){return this._command}}});var tVe=eVe;var nVe=Object.freeze({FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"});function iVe(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}function rVe(e,t,n){const{id:i,textureUniform:r,image:o}=t,a=n.webgl2?oVe(r,o,n):function(e,t,n){const{typedArray:i,sampler:r}=e,o=aVe(r),a=r.wrapS===GD.REPEAT||r.wrapS===GD.MIRRORED_REPEAT||r.wrapT===GD.REPEAT||r.wrapT===GD.MIRRORED_REPEAT,{width:s,height:c}=Object(l.a)(i)?e:t,u=[s,c].every(h.a.isPowerOfTwo);if(!o&&!a||u)return oVe(e,t,n);if(!Object(l.a)(i)){const i=Xx(t);return oVe(e,i,n)}if(e.pixelDatatype===rT.UNSIGNED_BYTE){const e=Xv(i,s,c),t=Xx(e);return oVe({sampler:r},t,n)}o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):a&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly.");return sVe(e,n)}(r,o,n),s=e._textures[i];Object(l.a)(s)&&s!==n.defaultTexture&&s.destroy(),e._textures[i]=a}function oVe(e,t,n){const{typedArray:i,sampler:r}=e,o=Object(l.a)(i)?sVe(e,n):new JD({context:n,source:t,sampler:r});return aVe(r)&&o.generateMipmap(),o}function aVe(e){return[VD.NEAREST_MIPMAP_NEAREST,VD.NEAREST_MIPMAP_LINEAR,VD.LINEAR_MIPMAP_NEAREST,VD.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function sVe(e,t){const{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:a,sampler:s}=e;return new JD({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:a,width:r,height:o},sampler:s,flipY:!1})}function cVe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT),this.mode=Object(c.a)(e.mode,R6.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=Object(c.a)(e.uniforms,c.a.EMPTY_OBJECT),this.varyings=Object(c.a)(e.varyings,c.a.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.isTranslucent=Object(c.a)(e.isTranslucent,!1),this._textureManager=new iVe,this._defaultTexture=void 0,this.uniformMap=function(e){const t=e.uniforms,n={};for(const i in t)if(t.hasOwnProperty(i)){const r=t[i],o=r.type;if(o===nVe.SAMPLER_CUBE)throw new u.a("CustomShader does not support samplerCube uniforms");o===nVe.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=lVe(e,i)):n[i]=uVe(e,i)}return n}(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},function(e){const t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g;let r;const o=e.vertexShaderText;Object(l.a)(o)&&(r=e.usedVariablesVertex.attributeSet,hVe(o,t,r),r=e.usedVariablesVertex.featureIdSet,hVe(o,n,r),r=e.usedVariablesVertex.metadataSet,hVe(o,i,r));const a=e.fragmentShaderText;if(Object(l.a)(a)){r=e.usedVariablesFragment.attributeSet,hVe(a,t,r),r=e.usedVariablesFragment.featureIdSet,hVe(a,n,r),r=e.usedVariablesFragment.metadataSet,hVe(a,i,r);const o=/material\.(\w+)/g,s=e.usedVariablesFragment.materialSet;hVe(a,o,s)}}(this),function(e){const t=e.usedVariablesVertex.attributeSet;fVe(t,"position","positionMC","vertex"),fVe(t,"normal","normalMC","vertex"),fVe(t,"tangent","tangentMC","vertex"),fVe(t,"bitangent","bitangentMC","vertex"),fVe(t,"positionWC","positionMC","vertex"),fVe(t,"positionEC","positionMC","vertex"),fVe(t,"normalEC","normalMC","vertex"),fVe(t,"tangentEC","tangentMC","vertex"),fVe(t,"bitangentEC","bitangentMC","vertex");const n=e.usedVariablesFragment.attributeSet;fVe(n,"position","positionEC","fragment"),fVe(n,"normal","normalEC","fragment"),fVe(n,"tangent","tangentEC","fragment"),fVe(n,"bitangent","bitangentEC","fragment"),fVe(n,"normalMC","normalEC","fragment"),fVe(n,"tangentMC","tangentEC","fragment"),fVe(n,"bitangentMC","bitangentEC","fragment")}(this)}function lVe(e,t){return function(){return Object(c.a)(e._textureManager.getTexture(t),e._defaultTexture)}}function uVe(e,t){return function(){return e.uniforms[t].value}}function hVe(e,t,n){let i;for(;null!==(i=t.exec(e));){n[i[1]]=!0}}function dVe(e){return/^.*MC$/.test(e)?e+" (model coordinates)":/^.*WC$/.test(e)?e+" (Cartesian world coordinates)":/^.*EC$/.test(e)?e+" (eye coordinates)":e}function fVe(e,t,n,i){if(e.hasOwnProperty(t)){const e=`${dVe(t)} is not available in the ${i} shader. Did you mean ${dVe(n)} instead?`;throw new u.a(e)}}function pVe(e){e=Object(c.a)(e,c.a.EMPTY_OBJECT);const t=Object(l.a)(e.typedArray);if(t===Object(l.a)(e.url))throw new u.a("exactly one of options.typedArray, options.url must be defined");if(t&&(!Object(l.a)(e.width)||!Object(l.a)(e.height)))throw new u.a("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=Object(c.a)(e.pixelFormat,aT.RGBA),this.pixelDatatype=Object(c.a)(e.pixelDatatype,rT.UNSIGNED_BYTE);let n=e.url;"string"==typeof n&&(n=Tt.a.createIfNeeded(n)),this.resource=n;const i=Object(c.a)(e.repeat,!0)?GD.REPEAT:GD.CLAMP_TO_EDGE;this.sampler=new WD({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}iVe.prototype.getTexture=function(e){return this._textures[e]},iVe.prototype.loadTexture2D=function(e,t){Object(l.a)(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):function(e,t,n){n.resource.fetchImage().then((function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})})).catch((function(){const n=e._textures[t];Object(l.a)(n)&&n!==e._defaultTexture&&n.destroy(),e._textures[t]=e._defaultTexture}))}(this,e,t)},iVe.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;const t=e.context;this._defaultTexture=t.defaultTexture;const n=this._loadedImages;for(let e=0;e<n.length;e++){rVe(this,n[e],t)}n.length=0},iVe.prototype.isDestroyed=function(){return!1},iVe.prototype.destroy=function(){const e=this._textures;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];n!==this._defaultTexture&&n.destroy()}return sc(this)},cVe.prototype.setUniform=function(e,t){if(s.a.typeOf.string("uniformName",e),s.a.defined("value",t),!Object(l.a)(this.uniforms[e]))throw new u.a(`Uniform ${e} must be declared in the CustomShader constructor.`);const n=this.uniforms[e];n.type===nVe.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):Object(l.a)(t.clone)?n.value=t.clone(n.value):n.value=t},cVe.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)},cVe.prototype.isDestroyed=function(){return!1},cVe.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),sc(this)};var mVe=Object.freeze({FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"}),gVe="uniform sampler2D u_depthTexture;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main()\n{\n    float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n    z_window = czm_reverseLogDepth(z_window);\n    float n_range = czm_depthRange.near;\n    float f_range = czm_depthRange.far;\n    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n    gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";const _Ve="http://www.w3.org/2000/svg",yVe="http://www.w3.org/1999/xlink";let bVe;const vVe=sp.fromCssColorString("rgba(247,250,255,0.384)"),OVe=sp.fromCssColorString("rgba(143,191,255,0.216)"),wVe=sp.fromCssColorString("rgba(153,197,255,0.098)"),AVe=sp.fromCssColorString("rgba(255,255,255,0.086)"),EVe=sp.fromCssColorString("rgba(255,255,255,0.267)"),TVe=sp.fromCssColorString("rgba(255,255,255,0)"),CVe=sp.fromCssColorString("rgba(66,67,68,0.3)"),xVe=sp.fromCssColorString("rgba(0,0,0,0.5)");function SVe(e){return sp.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}const IVe={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function PVe(e){const t=document.createElementNS(_Ve,e.tagName);for(const n in e)if(e.hasOwnProperty(n)&&"tagName"!==n)if("children"===n){const n=e.children.length;for(let i=0;i<n;++i)t.appendChild(PVe(e.children[i]))}else 0===n.indexOf("xlink:")?t.setAttributeNS(yVe,n.substring(6),e[n]):"textContent"===n?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function DVe(e,t,n){const i=document.createElementNS(_Ve,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");const r=document.createElementNS(_Ve,"tspan");return r.textContent=n,i.appendChild(r),i}const RVe=new sp;function jVe(e,t){const n=t.alpha,i=1-n;return RVe.red=e.red*i+t.red*n,RVe.green=e.green*i+t.green*n,RVe.blue=e.blue*i+t.blue*n,RVe.toCssColorString()}function MVe(e,t,n){const i=IVe[n];return PVe({tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]})}function LVe(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;const n=this;this._clickFunction=function(){const e=n._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[QUe(t,"toggled",this.setToggled,this),QUe(t,"tooltip",this.setTooltip,this),QUe(t.command,"canExecute",this.setEnabled,this)]}function NVe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");if(!Object(l.a)(t))throw new u.a("viewModel is required.");e=gye(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;const n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);const r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];const o=document.createElementNS(_Ve,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",yVe);const a=document.createElementNS(_Ve,"g");this._topG=a,this._realtimeSVG=new LVe(function(e,t,n){const i=IVe[n],r=IVe.animation_pathWingButton;return PVe({tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]})}(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new LVe(MVe(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new LVe(MVe(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new LVe(MVe(84,99,"animation_pathPause"),t.pauseViewModel);const s=document.createElementNS(_Ve,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);const c=PVe({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;const h=IVe.animation_pathSwooshFX,d=IVe.animation_pathPointer,f=PVe({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:h.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:h.d},{tagName:h.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:h.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=f,this._shuttleRingPointer=PVe({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:d.tagName,d:d.d});const p=PVe({tagName:"g",transform:"translate(100,100)"});this._knobOuter=PVe({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});const m=PVe({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=DVe(0,-24,""),this._knobTime=DVe(0,-7,""),this._knobStatus=DVe(0,-41,"");const g=PVe({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),_=document.createElementNS(_Ve,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),a.appendChild(_),a.appendChild(p),a.appendChild(s),_.appendChild(c),_.appendChild(f),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(g),o.appendChild(a),e.appendChild(o);const y=this;function b(e){!function(e,t){const n=e._viewModel,i=n.shuttleRingDragging;if(!i||bVe===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"touchmove"===t.type&&1===t.touches.length){const r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect();let s,c;if("touchstart"===t.type||"touchmove"===t.type?(s=t.touches[0].clientX,c=t.touches[0].clientY):(s=t.clientX,c=t.clientY),!i&&(s>a.right||s<a.left||c<a.top||c>a.bottom))return;const l=e._shuttleRingPointer.getBoundingClientRect(),u=s-r-a.left,h=c-o-a.top;let d=180*Math.atan2(h,u)/Math.PI+90;d>180&&(d-=360);const f=n.shuttleRingAngle;i||s<l.right&&s>l.left&&c>l.top&&c<l.bottom?(bVe=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=d):d<f?n.slower():d>f&&n.faster(),t.preventDefault()}else e===bVe&&(bVe=void 0),n.shuttleRingDragging=!1}(y,e)}this._mouseCallback=b,c.addEventListener("mousedown",b,!0),c.addEventListener("touchstart",b,!0),f.addEventListener("mousedown",b,!0),f.addEventListener("touchstart",b,!0),n.addEventListener("mousemove",b,!0),n.addEventListener("touchmove",b,!0),n.addEventListener("mouseup",b,!0),n.addEventListener("touchend",b,!0),n.addEventListener("touchcancel",b,!0),this._shuttleRingPointer.addEventListener("mousedown",b,!0),this._shuttleRingPointer.addEventListener("touchstart",b,!0),this._knobOuter.addEventListener("mousedown",b,!0),this._knobOuter.addEventListener("touchstart",b,!0);const v=this._knobTime.childNodes[0],O=this._knobDate.childNodes[0],w=this._knobStatus.childNodes[0];let A;this._subscriptions=[QUe(t.pauseViewModel,"toggled",(function(e){A!==e&&(A=e,A?y._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):y._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))})),QUe(t,"shuttleRingAngle",(function(e){var t,n,i;t=y._shuttleRingPointer,n=y._knobOuter,i=e,t.setAttribute("transform",`translate(100,100) rotate(${i})`),n.setAttribute("transform",`rotate(${i})`)})),QUe(t,"dateLabel",(function(e){O.textContent!==e&&(O.textContent=e)})),QUe(t,"timeLabel",(function(e){v.textContent!==e&&(v.textContent=e)})),QUe(t,"multiplierLabel",(function(e){w.textContent!==e&&(w.textContent=e)}))],this.applyThemeChanges(),this.resize()}LVe.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);const e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();sc(this)},LVe.prototype.isDestroyed=function(){return!1},LVe.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},LVe.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},LVe.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},Object.defineProperties(NVe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),NVe.prototype.isDestroyed=function(){return!1},NVe.prototype.destroy=function(){Object(l.a)(this._observer)&&(this._observer.disconnect(),this._observer=void 0);const e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();const n=this._subscriptions;for(let e=0,t=n.length;e<t;e++)n[e].dispose();return sc(this)},NVe.prototype.resize=function(){const e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;const n=this._svgNode;let i=e,r=t;0===e&&0===t?(i=200,r=132):0===e?(r=t,i=t/132*200):0===t&&(i=e,r=e/200*132);const o=i/200,a=r/132;n.style.cssText=`width: ${i}px; height: ${r}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",i),n.setAttribute("height",r),n.setAttribute("viewBox",`0 0 ${i} ${r}`),this._topG.setAttribute("transform",`scale(${o},${a})`),this._centerX=Math.max(1,100*o),this._centerY=Math.max(1,100*a),this._lastHeight=e,this._lastWidth=t},NVe.prototype.applyThemeChanges=function(){const e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(Object(l.a)(this._observer))return;const t=this;return t._observer=new MutationObserver((function(){e.body.contains(t._container)&&(t._observer.disconnect(),t._observer=void 0,t.applyThemeChanges())})),void t._observer.observe(e,{childList:!0,subtree:!0})}const t=SVe(this._themeNormal),n=SVe(this._themeHover),i=SVe(this._themeSelect),r=SVe(this._themeDisabled),o=SVe(this._themeKnob),a=SVe(this._themePointer),s=SVe(this._themeSwoosh),c=SVe(this._themeSwooshHover),u=PVe({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jVe(t,vVe)},{tagName:"stop",offset:"12%","stop-color":jVe(t,OVe)},{tagName:"stop",offset:"46%","stop-color":jVe(t,wVe)},{tagName:"stop",offset:"81%","stop-color":jVe(t,AVe)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jVe(n,vVe)},{tagName:"stop",offset:"12%","stop-color":jVe(n,OVe)},{tagName:"stop",offset:"46%","stop-color":jVe(n,wVe)},{tagName:"stop",offset:"81%","stop-color":jVe(n,AVe)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jVe(i,vVe)},{tagName:"stop",offset:"12%","stop-color":jVe(i,OVe)},{tagName:"stop",offset:"46%","stop-color":jVe(i,wVe)},{tagName:"stop",offset:"81%","stop-color":jVe(i,AVe)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":jVe(r,EVe)},{tagName:"stop",offset:"75%","stop-color":jVe(r,TVe)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":s.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":jVe(a,xVe)},{tagName:"stop",offset:"100%","stop-color":jVe(a,xVe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":jVe(o,vVe)},{tagName:"stop",offset:"60%","stop-color":jVe(o,CVe)},{tagName:"stop",offset:"85%","stop-color":jVe(o,OVe)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":jVe(o,CVe)},{tagName:"stop",offset:"60%","stop-color":jVe(o,vVe)},{tagName:"stop",offset:"85%","stop-color":jVe(o,AVe)}]}]});Object(l.a)(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var BVe=NVe;const FVe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zVe(e,t){return e-t}function kVe(e,t){const n=Si(t,e,zVe);return n<0?~n:n}function UVe(e){if(!Object(l.a)(e))throw new u.a("clockViewModel is required.");const t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=UVe.defaultDateFormatter,this._timeFormatter=UVe.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,zUe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(UVe.defaultTicks),this.timeLabel=void 0,zUe.defineProperty(this,"timeLabel",(function(){return t._timeFormatter(t._clockViewModel.currentTime,t)})),this.dateLabel=void 0,zUe.defineProperty(this,"dateLabel",(function(){return t._dateFormatter(t._clockViewModel.currentTime,t)})),this.multiplierLabel=void 0,zUe.defineProperty(this,"multiplierLabel",(function(){const e=t._clockViewModel;if(e.clockStep===Wf.SYSTEM_CLOCK)return"Today";const n=e.multiplier;return n%1==0?n.toFixed(0)+"x":n.toFixed(3).replace(/0{0,3}$/,"")+"x"})),this.shuttleRingAngle=void 0,zUe.defineProperty(this,"shuttleRingAngle",{get:function(){return function(e,t,n){if(n.clockStep===Wf.SYSTEM_CLOCK)return 15;if(Math.abs(e)<=1)return 15*e;const i=t[t.length-1];let r,o;return e>i?e=i:e<-i&&(e=-i),e>0?(r=Math.log(i),o=(r-0)/90,(Math.log(e)-0)/o+15):(r=Math.log(-t[0]),o=(r-0)/90,-((Math.log(Math.abs(e))-0)/o+15))}(e.multiplier,t._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,105),-105);const n=t._allShuttleRingTicks,i=t._clockViewModel;if(i.clockStep=Wf.SYSTEM_CLOCK_MULTIPLIER,105===Math.abs(e))return void(i.multiplier=e>0?n[n.length-1]:n[0]);let r=function(e,t){if(Math.abs(e)<=15)return e/15;let n,i;return e>0?(n=Math.log(t[t.length-1]),i=(n-0)/90,Math.exp(0+i*(e-15))):(n=Math.log(-t[0]),i=(n-0)/90,-Math.exp(0+i*(Math.abs(e)-15)))}(e,n);if(t.snapToTicks)r=n[kVe(r,n)];else if(0!==r){const e=Math.abs(r);if(e>100){const t=e.toFixed(0).length-2,n=Math.pow(10,t);r=Math.round(r/n)*n|0}else e>15?r=Math.round(r):e>1?r=+r.toFixed(1):e>0&&(r=+r.toFixed(2))}i.multiplier=r}}),this._canAnimate=void 0,zUe.defineProperty(this,"_canAnimate",(function(){const e=t._clockViewModel,n=e.clockRange;if(t.shuttleRingDragging||n===qf.UNBOUNDED)return!0;const i=e.multiplier,r=e.currentTime,o=e.startTime;let a=!1;if(n===qf.LOOP_STOP)a=tr.greaterThan(r,o)||r.equals(o)&&i>0;else{const t=e.stopTime;a=tr.greaterThan(r,o)&&tr.lessThan(r,t)||r.equals(o)&&i>0||r.equals(t)&&i<0}return a||(e.shouldAnimate=!1),a})),this._isSystemTimeAvailable=void 0,zUe.defineProperty(this,"_isSystemTimeAvailable",(function(){const e=t._clockViewModel;if(e.clockRange===qf.UNBOUNDED)return!0;const n=e.systemTime;return tr.greaterThanOrEquals(n,e.startTime)&&tr.lessThanOrEquals(n,e.stopTime)})),this._isAnimating=void 0,zUe.defineProperty(this,"_isAnimating",(function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)}));const n=JUe((function(){const e=t._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:t._canAnimate&&(e.shouldAnimate=!0)}));this._pauseViewModel=new tVe(n,{toggled:zUe.computed((function(){return!t._isAnimating})),tooltip:"Pause"});const i=JUe((function(){const e=t._clockViewModel,n=e.multiplier;n>0&&(e.multiplier=-n),e.shouldAnimate=!0}));this._playReverseViewModel=new tVe(i,{toggled:zUe.computed((function(){return t._isAnimating&&e.multiplier<0})),tooltip:"Play Reverse"});const r=JUe((function(){const e=t._clockViewModel,n=e.multiplier;n<0&&(e.multiplier=-n),e.shouldAnimate=!0}));this._playForwardViewModel=new tVe(r,{toggled:zUe.computed((function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Wf.SYSTEM_CLOCK})),tooltip:"Play Forward"});const o=JUe((function(){t._clockViewModel.clockStep=Wf.SYSTEM_CLOCK}),zUe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new tVe(o,{toggled:zUe.computed((function(){return e.clockStep===Wf.SYSTEM_CLOCK})),tooltip:zUe.computed((function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"}))}),this._slower=JUe((function(){const e=t._clockViewModel,n=t._allShuttleRingTicks,i=kVe(e.multiplier,n)-1;i>=0&&(e.multiplier=n[i])})),this._faster=JUe((function(){const e=t._clockViewModel,n=t._allShuttleRingTicks,i=kVe(e.multiplier,n)+1;i<n.length&&(e.multiplier=n[i])}))}UVe.defaultDateFormatter=function(e,t){const n=tr.toGregorianDate(e);return`${FVe[n.month-1]} ${n.day} ${n.year}`},UVe.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],UVe.defaultTimeFormatter=function(e,t){const n=tr.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`},UVe.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},UVe.prototype.setShuttleRingTicks=function(e){if(!Object(l.a)(e))throw new u.a("positiveTicks is required.");let t,n,i;const r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(zVe);const a=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],0!==i&&a.push(-i);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},Object.defineProperties(UVe.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){if("function"!=typeof e)throw new u.a("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if("function"!=typeof e)throw new u.a("timeFormatter must be a function");this._timeFormatter=e}}}),UVe._maxShuttleRingAngle=105,UVe._realtimeShuttleRingAngle=15;var VVe=UVe;function HVe(e){const t=(e=Object(c.a)(e,c.a.EMPTY_OBJECT)).globe,n=Object(c.a)(e.imageryProviderViewModels,[]),i=Object(c.a)(e.terrainProviderViewModels,[]);if(!Object(l.a)(t))throw new u.a("globe is required");this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,zUe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);const r=zUe.getObservable(this,"imageryProviderViewModels"),o=zUe.pureComputed((function(){const e=r(),t={};let n;for(n=0;n<e.length;n++){const i=e[n],r=i.category;Object(l.a)(t[r])?t[r].push(i):t[r]=[i]}const i=Object.keys(t),o=[];for(n=0;n<i.length;n++){const e=i[n];o.push({name:e,providers:t[e]})}return o}));this._imageryProviders=o;const a=zUe.getObservable(this,"terrainProviderViewModels"),s=zUe.pureComputed((function(){const e=a(),t={};let n;for(n=0;n<e.length;n++){const i=e[n],r=i.category;Object(l.a)(t[r])?t[r].push(i):t[r]=[i]}const i=Object.keys(t),r=[];for(n=0;n<i.length;n++){const e=i[n];r.push({name:e,providers:t[e]})}return r}));this._terrainProviders=s,this.buttonTooltip=void 0,zUe.defineProperty(this,"buttonTooltip",(function(){const e=this.selectedImagery,t=this.selectedTerrain,n=Object(l.a)(e)?e.name:void 0,i=Object(l.a)(t)?t.name:void 0;return Object(l.a)(n)&&Object(l.a)(i)?`${n}\n${i}`:Object(l.a)(n)?n:i})),this.buttonImageUrl=void 0,zUe.defineProperty(this,"buttonImageUrl",(function(){const e=this.selectedImagery;if(Object(l.a)(e))return e.iconUrl})),this.selectedImagery=void 0;const h=zUe.observable();this._currentImageryProviders=[],zUe.defineProperty(this,"selectedImagery",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);let t;const n=this._currentImageryProviders,i=n.length,r=this._globe.imageryLayers;let o=!1;for(t=0;t<i;t++){const e=r.length;for(let i=0;i<e;i++){const e=r.get(i);if(e.imageryProvider===n[t]){r.remove(e),o=!0;break}}}if(Object(l.a)(e)){const n=e.creationCommand();if(Array.isArray(n)){for(t=n.length-1;t>=0;t--)r.addImageryProvider(n[t],0);this._currentImageryProviders=n.slice(0)}else if(this._currentImageryProviders=[n],o)r.addImageryProvider(n,0);else{const e=r.get(0);Object(l.a)(e)&&r.remove(e),r.addImageryProvider(n,0)}}h(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;const d=zUe.observable();zUe.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return void(this.dropDownVisible=!1);let t;Object(l.a)(e)&&(t=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(t instanceof Vb),this._globe.terrainProvider=t,d(e),this.dropDownVisible=!1}});const f=this;this._toggleDropDown=JUe((function(){f.dropDownVisible=!f.dropDownVisible})),this.selectedImagery=Object(c.a)(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=Object(c.a)(e.selectedTerrainProviderViewModel,i[0])}Object.defineProperties(HVe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var GVe=HVe;function qVe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");e=gye(e);const n=new GVe(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);const r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);const o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);const a=document.createElement("div");a.className="cesium-baseLayerPicker-sectionTitle",a.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),a.innerHTML="Imagery",o.appendChild(a);const s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(s);const c=document.createElement("div");c.className="cesium-baseLayerPicker-category",s.appendChild(c);const h=document.createElement("div");h.className="cesium-baseLayerPicker-categoryTitle",h.setAttribute("data-bind","text: name"),c.appendChild(h);const d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: providers"),c.appendChild(d);const f=document.createElement("div");f.className="cesium-baseLayerPicker-item",f.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),d.appendChild(f);const p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),f.appendChild(p);const m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),f.appendChild(m);const g=document.createElement("div");g.className="cesium-baseLayerPicker-sectionTitle",g.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),g.innerHTML="Terrain",o.appendChild(g);const _=document.createElement("div");_.className="cesium-baseLayerPicker-section",_.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(_);const y=document.createElement("div");y.className="cesium-baseLayerPicker-category",_.appendChild(y);const b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),y.appendChild(b);const v=document.createElement("div");v.className="cesium-baseLayerPicker-choices",v.setAttribute("data-bind","foreach: providers"),y.appendChild(v);const O=document.createElement("div");O.className="cesium-baseLayerPicker-item",O.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),v.appendChild(O);const w=document.createElement("img");w.className="cesium-baseLayerPicker-itemIcon",w.setAttribute("data-bind","attr: { src: iconUrl }"),w.setAttribute("draggable","false"),O.appendChild(w);const A=document.createElement("div");A.className="cesium-baseLayerPicker-itemLabel",A.setAttribute("data-bind","text: name"),O.appendChild(A),zUe.applyBindings(n,i),zUe.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(e){i.contains(e.target)||o.contains(e.target)||(n.dropDownVisible=!1)},Jr.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(qVe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),qVe.prototype.isDestroyed=function(){return!1},qVe.prototype.destroy=function(){return Jr.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),zUe.cleanNode(this._element),zUe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),sc(this)};var WVe=qVe;function YVe(e){if(!Object(l.a)(e.name))throw new u.a("options.name is required.");if(!Object(l.a)(e.tooltip))throw new u.a("options.tooltip is required.");if(!Object(l.a)(e.iconUrl))throw new u.a("options.iconUrl is required.");if("function"!=typeof e.creationFunction)throw new u.a("options.creationFunction is required.");let t=e.creationFunction;Object(l.a)(t.canExecute)||(t=JUe(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=Object(c.a)(e.category,""),zUe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(YVe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var XVe=YVe;var KVe=function(){const e=[];return e.push(new XVe({name:"Bing Maps Aerial",iconUrl:Lt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return ECe({style:ACe.AERIAL})}})),e.push(new XVe({name:"Bing Maps Aerial with Labels",iconUrl:Lt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return ECe({style:ACe.AERIAL_WITH_LABELS})}})),e.push(new XVe({name:"Bing Maps Roads",iconUrl:Lt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return ECe({style:ACe.ROAD})}})),e.push(new XVe({name:"ESRI World Imagery",iconUrl:Lt("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide.  The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal.  Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new Gve({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new XVe({name:"ESRI World Street Map",iconUrl:Lt("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new Gve({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new XVe({name:"ESRI National Geographic",iconUrl:Lt("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new Gve({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new XVe({name:"Open­Street­Map",iconUrl:Lt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",category:"Other",creationFunction:function(){return new jRe({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new XVe({name:"Stamen Watercolor",iconUrl:Lt("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new jRe({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new XVe({name:"Stamen Toner",iconUrl:Lt("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new jRe({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new XVe({name:"Sentinel-2",iconUrl:Lt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return new wCe({assetId:3954})}})),e.push(new XVe({name:"Blue Marble",iconUrl:Lt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new wCe({assetId:3845})}})),e.push(new XVe({name:"Earth at night",iconUrl:Lt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return new wCe({assetId:3812})}})),e.push(new XVe({name:"Natural Earth II",iconUrl:Lt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",category:"Cesium ion",creationFunction:function(){return new kTe({url:Lt("Assets/Textures/NaturalEarthII")})}})),e};var JVe=function(){const e=[];return e.push(new XVe({name:"WGS84 Ellipsoid",iconUrl:Lt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Vb}})),e.push(new XVe({name:"Cesium World Terrain",iconUrl:Lt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return Oy({requestWaterMask:!0,requestVertexNormals:!0})}})),e};function ZVe(e,t){t?e._eventHandler.setInputAction((function(t){const n=e._scene.pick(t.endPosition);Object(l.a)(n)&&n.primitive instanceof qie&&(e.tileset=n.primitive)}),fS.MOUSE_MOVE):(e._eventHandler.removeInputAction(fS.MOUSE_MOVE),e.picking=e.picking)}const $Ve={maximumFractionDigits:3};function QVe(e){const t=e/1048576;return t<1?t.toLocaleString(void 0,$Ve):Math.round(t).toLocaleString()}function eHe(e,t){if(!Object(l.a)(e))return"";const n=t?e._statisticsPerPass[ute.PICK]:e._statisticsPerPass[ute.RENDER];let i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${QVe(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${QVe(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${QVe(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function tHe(){const e=bJ.statistics;return`\n  <ul class="cesium-cesiumInspector-statistics">\n    <li><strong>Geometry Memory (MB): </strong>${QVe(e.geometryByteLength)}</li>\n    <li><strong>Texture Memory (MB): </strong>${QVe(e.texturesByteLength)}</li>\n  </ul>\n  `}const nHe=[{text:"Highlight",value:fV.HIGHLIGHT},{text:"Replace",value:fV.REPLACE},{text:"Mix",value:fV.MIX}],iHe=new sp(1,1,0,.4),rHe=new sp,oHe=new sp;function aHe(e,t){s.a.typeOf.object("scene",e),s.a.typeOf.object("performanceContainer",t);const n=this,i=e.canvas;this._eventHandler=new ZS(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new $Re({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,zUe.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=zUe.observable({}),this.properties=[],zUe.defineProperty(this,"properties",(function(){const e=[],t=n._properties();for(const n in t)t.hasOwnProperty(n)&&e.push(n);return e}));const r=zUe.observable();zUe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(e){r(e),Object(l.a)(n._tileset)&&(n._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;const o=zUe.observable();zUe.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(e){o(e),Object(l.a)(n._tileset)&&(n._tileset.colorBlendMode=e,n._scene.requestRender())}}),this.colorBlendMode=fV.HIGHLIGHT;const a=zUe.observable(),c=zUe.observable();zUe.defineProperty(this,"picking",{get:function(){return c()},set:function(t){c(t),t?n._eventHandler.setInputAction((function(t){const i=e.pick(t.endPosition);if(i instanceof jV?(n.feature=i,n.tile=i.content.tile):Object(l.a)(i)&&Object(l.a)(i.content)?(n.feature=void 0,n.tile=i.content.tile):(n.feature=void 0,n.tile=void 0),Object(l.a)(n._tileset)){if(a&&Object(l.a)(i)&&Object(l.a)(i.content)){let r;e.pickPositionSupported&&(r=e.pickPosition(t.endPosition),Object(l.a)(r)&&(n._tileset.debugPickPosition=r)),n._tileset.debugPickedTile=i.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}}),fS.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(fS.MOUSE_MOVE))}}),this.picking=!0;const u=zUe.observable();zUe.defineProperty(this,"colorize",{get:function(){return u()},set:function(e){u(e),Object(l.a)(n._tileset)&&(n._tileset.debugColorizeTiles=e,n._scene.requestRender())}}),this.colorize=!1;const h=zUe.observable();zUe.defineProperty(this,"wireframe",{get:function(){return h()},set:function(e){h(e),Object(l.a)(n._tileset)&&(n._tileset.debugWireframe=e,n._scene.requestRender())}}),this.wireframe=!1;const d=zUe.observable();zUe.defineProperty(this,"showBoundingVolumes",{get:function(){return d()},set:function(e){d(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowBoundingVolume=e,n._scene.requestRender())}}),this.showBoundingVolumes=!1;const f=zUe.observable();zUe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return f()},set:function(e){f(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=e,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;const p=zUe.observable();zUe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(e){p(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=e,n._scene.requestRender())}}),this.showRequestVolumes=!1;const m=zUe.observable();zUe.defineProperty(this,"freezeFrame",{get:function(){return m()},set:function(e){m(e),Object(l.a)(n._tileset)&&(n._tileset.debugFreezeFrame=e,n._scene.debugShowFrustumPlanes=e,n._scene.requestRender())}}),this.freezeFrame=!1,zUe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return a()},set:function(e){a(e),Object(l.a)(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=e,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;const g=zUe.observable();zUe.defineProperty(this,"showGeometricError",{get:function(){return g()},set:function(e){g(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowGeometricError=e,n._scene.requestRender())}}),this.showGeometricError=!1;const _=zUe.observable();zUe.defineProperty(this,"showRenderingStatistics",{get:function(){return _()},set:function(e){_(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowRenderingStatistics=e,n._scene.requestRender())}}),this.showRenderingStatistics=!1;const y=zUe.observable();zUe.defineProperty(this,"showMemoryUsage",{get:function(){return y()},set:function(e){y(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowMemoryUsage=e,n._scene.requestRender())}}),this.showMemoryUsage=!1;const b=zUe.observable();zUe.defineProperty(this,"showUrl",{get:function(){return b()},set:function(e){b(e),Object(l.a)(n._tileset)&&(n._tileset.debugShowUrl=e,n._scene.requestRender())}}),this.showUrl=!1;const v=zUe.observable();zUe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return v()},set:function(e){e=Number(e),isNaN(e)||(v(e),Object(l.a)(n._tileset)&&(n._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;const O=zUe.observable();zUe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),Object(l.a)(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,zUe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(O(),1/6)},set:function(e){O(Math.pow(e,6))}});const w=zUe.observable();zUe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return w()},set:function(e){e=Number(e),isNaN(e)||(w(e),Object(l.a)(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;const A=(E=this,function(e){const t=E._scene.pick(e.position);Object(l.a)(t)&&t.primitive instanceof qie&&(E.tileset=t.primitive),E.pickActive=!1});var E;const T=zUe.observable();zUe.defineProperty(this,"pickActive",{get:function(){return T()},set:function(e){T(e),e?n._eventHandler.setInputAction(A,fS.LEFT_CLICK):n._eventHandler.removeInputAction(fS.LEFT_CLICK)}});const C=zUe.observable();zUe.defineProperty(this,"pointCloudShading",{get:function(){return C()},set:function(e){C(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;const x=zUe.observable();zUe.defineProperty(this,"geometricErrorScale",{get:function(){return x()},set:function(e){e=Number(e),isNaN(e)||(x(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;const S=zUe.observable();zUe.defineProperty(this,"maximumAttenuation",{get:function(){return S()},set:function(e){e=Number(e),isNaN(e)||(S(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;const I=zUe.observable();zUe.defineProperty(this,"baseResolution",{get:function(){return I()},set:function(e){e=Number(e),isNaN(e)||(I(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;const P=zUe.observable();zUe.defineProperty(this,"eyeDomeLighting",{get:function(){return P()},set:function(e){P(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;const D=zUe.observable();zUe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;const R=zUe.observable();zUe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),Object(l.a)(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;const j=zUe.observable();zUe.defineProperty(this,"skipLevelOfDetail",{get:function(){return j()},set:function(e){j(e),Object(l.a)(n._tileset)&&(n._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;const M=zUe.observable();zUe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(e){e=Number(e),isNaN(e)||(M(e),Object(l.a)(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;const L=zUe.observable();zUe.defineProperty(this,"baseScreenSpaceError",{get:function(){return L()},set:function(e){e=Number(e),isNaN(e)||(L(e),Object(l.a)(n._tileset)&&(n._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;const N=zUe.observable();zUe.defineProperty(this,"skipLevels",{get:function(){return N()},set:function(e){e=Number(e),isNaN(e)||(N(e),Object(l.a)(n._tileset)&&(n._tileset.skipLevels=e))}}),this.skipLevels=1;const B=zUe.observable();zUe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(e){B(e),Object(l.a)(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;const F=zUe.observable();zUe.defineProperty(this,"loadSiblings",{get:function(){return F()},set:function(e){F(e),Object(l.a)(n._tileset)&&(n._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener((function(){n._update()})),Object(l.a)(this._tileset)||ZVe(this,!0)}function sHe(e){if(!Object(l.a)(e))return!1;if(e.featuresLength>0)return!0;const t=e.innerContents;if(Object(l.a)(t)){const e=t.length;for(let n=0;n<e;++n)if(!sHe(t[n]))return!1;return!0}return!1}Object.defineProperties(aHe.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return nHe}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,Object(l.a)(e)){const t=this;e.readyPromise.then((function(e){t.isDestroyed()||t._properties(e.properties)}));const n=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],i=n.length;for(let e=0;e<i;++e){const t=n[e];this[t]=this[t]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings;const r=e.pointCloudShading;this.pointCloudShading=r.attenuation,this.geometricErrorScale=r.geometricErrorScale,this.maximumAttenuation=r.maximumAttenuation?r.maximumAttenuation:0,this.baseResolution=r.baseResolution?r.baseResolution:0,this.eyeDomeLighting=r.eyeDomeLighting,this.eyeDomeLightingStrength=r.eyeDomeLightingStrength,this.eyeDomeLightingRadius=r.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=eHe(e,!1),this._pickStatisticsText=eHe(e,!0),this._resourceCacheStatisticsText=tHe(),ZVe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;const t=this._feature;Object(l.a)(t)&&!t.content.isDestroyed()&&(!this.colorize&&Object(l.a)(this._style)?t.color=Object(l.a)(this._style.color)?this._style.color.evaluateColor(t,rHe):sp.WHITE:t.color=oHe,this._scene.requestRender()),Object(l.a)(e)&&(sp.clone(e.color,oHe),e.color=iHe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;const t=this._tile;!Object(l.a)(t)||t.isDestroyed()||sHe(t.content)||(t.color=oHe,this._scene.requestRender()),Object(l.a)(e)&&!sHe(e.content)&&(sp.clone(e.color,oHe),e.color=iHe,this._scene.requestRender()),this._tile=e}}}),aHe.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},aHe.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},aHe.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},aHe.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},aHe.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},aHe.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},aHe.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},aHe.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},aHe.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},aHe.prototype.trimTilesCache=function(){Object(l.a)(this._tileset)&&this._tileset.trimLoadedTiles()},aHe.prototype.compileStyle=function(){const e=this._tileset;if(Object(l.a)(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new tEe(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},aHe.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();const e=t.target,n=e.selectionStart,i=e.selectionEnd;let r=i;const o=e.value.slice(n,i).split("\n"),a=o.length;let s;if(t.shiftKey)for(s=0;s<a;++s)" "===o[s][0]&&(" "===o[s][1]?(o[s]=o[s].substr(2),r-=2):(o[s]=o[s].substr(1),r-=1));else for(s=0;s<a;++s)o[s]="  "+o[s],r+=2;const c=o.join("\n");e.value=e.value.slice(0,n)+c+e.value.slice(i),e.selectionStart=n!==i?n:r,e.selectionEnd=r}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},aHe.prototype._update=function(){const e=this._tileset;if(this.performance&&this._performanceDisplay.update(),Object(l.a)(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);const t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null,"  ")))}this.showStatistics&&(this._statisticsText=eHe(e,!1),this._pickStatisticsText=eHe(e,!0),this._resourceCacheStatisticsText=tHe())},aHe.prototype.isDestroyed=function(){return!1},aHe.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();const e=this;return this._definedProperties.forEach((function(t){zUe.getObservable(e,t).dispose()})),sc(this)},aHe.getStatistics=eHe;var cHe=aHe;function lHe(e,t){s.a.defined("container",e),s.a.typeOf.object("scene",t),e=gye(e);const n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");const r=new cHe(t,i);this._viewModel=r,this._container=e,this._element=n;const o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);const a=document.createElement("div");this._panel=a,a.className="cesium-cesiumInspector-dropDown",n.appendChild(a);const c=$Ue.createSection,l=$Ue.createCheckbox,u=c(a,"Tileset","tilesetVisible","toggleTileset"),h=c(a,"Display","displayVisible","toggleDisplay"),d=c(a,"Update","updateVisible","toggleUpdate"),f=c(a,"Logging","loggingVisible","toggleLogging"),p=c(a,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),m=c(a,"Style","styleVisible","toggleStyle"),g=c(a,"Optimization","optimizationVisible","toggleOptimization"),_=document.createElement("div");_.className="field-group";const y=document.createElement("label");y.className="field-label",y.appendChild(document.createTextNode("Properties: "));const b=document.createElement("div");b.setAttribute("data-bind","text: properties"),_.appendChild(y),_.appendChild(b),u.appendChild(_),u.appendChild(hHe("togglePickTileset","Pick Tileset","pickActive")),u.appendChild(hHe("trimTilesCache","Trim Tiles Cache")),u.appendChild(l("Enable Picking","picking")),h.appendChild(l("Colorize","colorize")),h.appendChild(l("Wireframe","wireframe")),h.appendChild(l("Bounding Volumes","showBoundingVolumes")),h.appendChild(l("Content Volumes","showContentBoundingVolumes")),h.appendChild(l("Request Volumes","showRequestVolumes")),h.appendChild(l("Point Cloud Shading","pointCloudShading"));const v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(uHe("geometricErrorScale",0,2,.01,"Geometric Error Scale")),v.appendChild(uHe("maximumAttenuation",0,32,1,"Maximum Attenuation")),v.appendChild(uHe("baseResolution",0,1,.01,"Base Resolution")),v.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),h.appendChild(v);const O=document.createElement("div");O.setAttribute("data-bind","visible: eyeDomeLighting"),O.appendChild(uHe("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),O.appendChild(uHe("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),v.appendChild(O),d.appendChild(l("Freeze Frame","freezeFrame")),d.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));const w=document.createElement("div");w.appendChild(uHe("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),d.appendChild(w);const A=document.createElement("div");A.setAttribute("data-bind","visible: dynamicScreenSpaceError"),A.appendChild(uHe("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),A.appendChild(uHe("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),d.appendChild(A),f.appendChild(l("Performance","performance")),f.appendChild(i),f.appendChild(l("Statistics","showStatistics"));const E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(E),f.appendChild(l("Pick Statistics","showPickStatistics"));const T=document.createElement("div");T.className="cesium-3dTilesInspector-statistics",T.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(T),f.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));const C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(C);const x=document.createElement("div");m.appendChild(x),x.appendChild(document.createTextNode("Color Blend Mode: "));const S=document.createElement("select");S.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),x.appendChild(S);const I=document.createElement("textarea");I.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(I);const P=hHe("compileStyle","Compile (Ctrl+Enter)");x.appendChild(P);const D=document.createElement("div");D.className="cesium-cesiumInspector-error",D.setAttribute("data-bind","text: editorError"),x.appendChild(D),p.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),p.appendChild(l("Geometric Error","showGeometricError")),p.appendChild(l("Rendering Statistics","showRenderingStatistics")),p.appendChild(l("Memory Usage (MB)","showMemoryUsage")),p.appendChild(l("Url","showUrl")),g.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));const R=document.createElement("div");R.appendChild(uHe("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),g.appendChild(R);const j=document.createElement("div");j.appendChild(uHe("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),g.appendChild(j);const M=document.createElement("div");M.appendChild(uHe("skipLevels",0,10,1,"Min. levels to skip")),g.appendChild(M),g.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),g.appendChild(l("Load siblings of visible tiles","loadSiblings")),zUe.applyBindings(r,n)}function uHe(e,t,n,i,r,o){o=Object(c.a)(o,e);const a=document.createElement("input");a.setAttribute("data-bind","value: "+o),a.type="number";const s=document.createElement("input");s.type="range",s.min=t,s.max=n,s.step=i,s.setAttribute("data-bind",'valueUpdate: "input", value: '+e);const l=document.createElement("div");l.appendChild(s);const u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(r)),u.appendChild(a),u.appendChild(l),u}function hHe(e,t,n){const i=document.createElement("button");i.type="button",i.textContent=t,i.className="cesium-cesiumInspector-pickButton";let r="click: "+e;return Object(l.a)(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i}Object.defineProperties(lHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),lHe.prototype.isDestroyed=function(){return!1},lHe.prototype.destroy=function(){return zUe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),sc(this)};var dHe=lHe;function fHe(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}const pHe=new Gn,mHe=new O;function gHe(e,t){if(!Object(l.a)(e))throw new u.a("scene is required");if(!Object(l.a)(t))throw new u.a("performanceContainer is required");const n=this,i=e.canvas,r=new ZS(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;const o=this._scene.globe;let a;function s(e){const t=n._scene.pick({x:e.position.x,y:e.position.y});Object(l.a)(t)&&(n.primitive=Object(l.a)(t.collection)?t.collection:t.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}function c(e){let t;const i=o.ellipsoid,r=n._scene.camera.getPickRay(e.position,pHe),a=o.pick(r,n._scene,mHe);if(Object(l.a)(a)){const e=i.cartesianToCartographic(a),n=o._surface.tileProvider._tilesToRenderByTextureCount;for(let i=0;!t&&i<n.length;++i){const r=n[i];if(Object(l.a)(r))for(let n=0;!t&&n<r.length;++n){const i=r[n];Be.contains(i.rectangle,e)&&(t=i)}}}n.tile=t,n.pickTileActive=!1}o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",zUe.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=JUe((function(){n.dropDownVisible=!n.dropDownVisible})),this._toggleGeneral=JUe((function(){n.generalVisible=!n.generalVisible})),this._togglePrimitives=JUe((function(){n.primitivesVisible=!n.primitivesVisible})),this._toggleTerrain=JUe((function(){n.terrainVisible=!n.terrainVisible})),this._frustumsSubscription=zUe.getObservable(this,"frustums").subscribe((function(e){n._scene.debugShowFrustums=e,n._scene.requestRender()})),this._frustumPlanesSubscription=zUe.getObservable(this,"frustumPlanes").subscribe((function(e){n._scene.debugShowFrustumPlanes=e,n._scene.requestRender()})),this._performanceSubscription=zUe.getObservable(this,"performance").subscribe((function(e){e?n._performanceDisplay=new $Re({container:n._performanceContainer}):n._performanceContainer.innerHTML=""})),this._showPrimitiveBoundingSphere=JUe((function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0})),this._primitiveBoundingSphereSubscription=zUe.getObservable(this,"primitiveBoundingSphere").subscribe((function(){n._showPrimitiveBoundingSphere()})),this._showPrimitiveReferenceFrame=JUe((function(){if(n.primitiveReferenceFrame){const e=n._primitive.modelMatrix;n._modelMatrixPrimitive=new QCe({modelMatrix:e}),n._scene.primitives.add(n._modelMatrixPrimitive)}else Object(l.a)(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0})),this._primitiveReferenceFrameSubscription=zUe.getObservable(this,"primitiveReferenceFrame").subscribe((function(){n._showPrimitiveReferenceFrame()})),this._doFilterPrimitive=JUe((function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(e){return!(!Object(l.a)(n._modelMatrixPrimitive)||e.owner!==n._modelMatrixPrimitive._primitive)||!!Object(l.a)(n._primitive)&&(e.owner===n._primitive||e.owner===n._primitive._billboardCollection||e.owner.primitive===n._primitive)}:n._scene.debugCommandFilter=void 0,!0})),this._filterPrimitiveSubscription=zUe.getObservable(this,"filterPrimitive").subscribe((function(){n._doFilterPrimitive(),n._scene.requestRender()})),this._wireframeSubscription=zUe.getObservable(this,"wireframe").subscribe((function(e){o._surface.tileProvider._debug.wireframe=e,n._scene.requestRender()})),this._depthFrustumSubscription=zUe.getObservable(this,"depthFrustum").subscribe((function(e){n._scene.debugShowDepthFrustum=e,n._scene.requestRender()})),this._incrementDepthFrustum=JUe((function(){const e=n.depthFrustum+1;return n.depthFrustum=fHe(1,n._numberOfFrustums,e),n._scene.requestRender(),!0})),this._decrementDepthFrustum=JUe((function(){const e=n.depthFrustum-1;return n.depthFrustum=fHe(1,n._numberOfFrustums,e),n._scene.requestRender(),!0})),this._suspendUpdatesSubscription=zUe.getObservable(this,"suspendUpdates").subscribe((function(e){o._surface._debug.suspendLodUpdate=e,e||(n.filterTile=!1)})),this._showTileCoordinates=JUe((function(){return n.tileCoordinates&&!Object(l.a)(a)?a=e.imageryLayers.addImageryProvider(new cUe({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&Object(l.a)(a)&&(e.imageryLayers.remove(a),a=void 0),!0})),this._tileCoordinatesSubscription=zUe.getObservable(this,"tileCoordinates").subscribe((function(){n._showTileCoordinates(),n._scene.requestRender()})),this._tileBoundingSphereSubscription=zUe.getObservable(this,"tileBoundingSphere").subscribe((function(){n._showTileBoundingSphere(),n._scene.requestRender()})),this._showTileBoundingSphere=JUe((function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0})),this._doFilterTile=JUe((function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],Object(l.a)(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0})),this._filterTileSubscription=zUe.getObservable(this,"filterTile").subscribe((function(){n.doFilterTile(),n._scene.requestRender()})),this._pickPrimitive=JUe((function(){n.pickPrimitiveActive=!n.pickPrimitiveActive})),this._pickPrimitiveActiveSubscription=zUe.getObservable(this,"pickPrimitiveActive").subscribe((function(e){e?r.setInputAction(s,fS.LEFT_CLICK):r.removeInputAction(fS.LEFT_CLICK)})),this._pickTile=JUe((function(){n.pickTileActive=!n.pickTileActive})),this._pickTileActiveSubscription=zUe.getObservable(this,"pickTileActive").subscribe((function(e){e?r.setInputAction(c,fS.LEFT_CLICK):r.removeInputAction(fS.LEFT_CLICK)})),this._removePostRenderEvent=e.postRender.addEventListener((function(){n._update()}))}Object.defineProperties(gHe.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){const e=this;return JUe((function(){e.tile=e.tile.parent}))}},selectNW:{get:function(){const e=this;return JUe((function(){e.tile=e.tile.northwestChild}))}},selectNE:{get:function(){const e=this;return JUe((function(){e.tile=e.tile.northeastChild}))}},selectSW:{get:function(){const e=this;return JUe((function(){e.tile=e.tile.southwestChild}))}},selectSE:{get:function(){const e=this;return JUe((function(){e.tile=e.tile.southeastChild}))}},primitive:{get:function(){return this._primitive},set:function(e){const t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,Object(l.a)(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,Object(l.a)(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout((function(){e.show=!0}),50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(Object(l.a)(e)){this.hasPickedTile=!0;if(e!==this._tile){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;const t=e.data;Object(l.a)(t)&&Object(l.a)(t.tileBoundingRegion)?this.tileText+=`<br>Min: ${t.tileBoundingRegion.minimumHeight} Max: ${t.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),gHe.prototype._update=function(){this.frustums&&(this.frustumStatisticText=function(e){let t;if(Object(l.a)(e)){t="Command Statistics";const n=e.commandsInFrustums;for(const e in n)if(n.hasOwnProperty(e)){let i,r=parseInt(e,10);if(7===r)i="1, 2 and 3";else{const e=[];for(let t=2;t>=0;t--){const n=Math.pow(2,t);r>=n&&(e.push(t+1),r-=n)}i=e.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[e]} in frustum ${i}`}t+="<br>Total: "+e.totalCommands}return t}(this._scene.debugFrustumStatistics));const e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=fHe(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText="Cached shaders: "+this._scene.context.shaderCache.numberOfShaders},gHe.prototype.isDestroyed=function(){return!1},gHe.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),sc(this)};var _He=gHe;function yHe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");if(!Object(l.a)(t))throw new u.a("scene is required.");e=gye(e);const n=document.createElement("div"),i=new _He(t,n);this._viewModel=i,this._container=e;const r=document.createElement("div");this._element=r;const o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);const a=document.createElement("div");this._panel=a,a.className="cesium-cesiumInspector-dropDown",r.appendChild(a);const s=$Ue.createSection,c=$Ue.createCheckbox,h=s(a,"General","generalVisible","toggleGeneral"),d=c("Show Frustums","frustums"),f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStatistics",f.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),d.appendChild(f),h.appendChild(d),h.appendChild(c("Show Frustum Planes","frustumPlanes")),h.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",h.appendChild(n);const p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),h.appendChild(p);const m=document.createElement("div");h.appendChild(m);const g=document.createElement("span");g.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),m.appendChild(g);const _=document.createElement("span");_.setAttribute("data-bind","text: depthFrustumText"),m.appendChild(_);const y=document.createElement("input");y.type="button",y.value="-",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind","click: decrementDepthFrustum"),m.appendChild(y);const b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),m.appendChild(b);const v=s(a,"Primitives","primitivesVisible","togglePrimitives"),O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",v.appendChild(O);const w=document.createElement("input");w.type="button",w.value="Pick a primitive",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let A=document.createElement("div");A.className="cesium-cesiumInspector-center",A.appendChild(w),O.appendChild(A),O.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),O.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),O.appendChild(this._primitiveOnly);const E=s(a,"Terrain","terrainVisible","toggleTerrain"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",E.appendChild(T);const C=document.createElement("input");C.type="button",C.value="Pick a tile",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),A=document.createElement("div"),A.appendChild(C),A.className="cesium-cesiumInspector-center",T.appendChild(A);const x=document.createElement("div");T.appendChild(x);const S=document.createElement("input");S.type="button",S.value="Parent",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: selectParent");const I=document.createElement("input");I.type="button",I.value="NW",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectNW");const P=document.createElement("input");P.type="button",P.value="NE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectNE");const D=document.createElement("input");D.type="button",D.value="SW",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSW");const R=document.createElement("input");R.type="button",R.value="SE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectSE");const j=document.createElement("div");j.className="cesium-cesiumInspector-tileText",x.className="cesium-cesiumInspector-frustumStatistics",x.appendChild(j),x.setAttribute("data-bind","visible: hasPickedTile"),j.setAttribute("data-bind","html: tileText");const M=document.createElement("div");M.className="cesium-cesiumInspector-relativeText",M.textContent="Select relative:",x.appendChild(M);const L=document.createElement("table"),N=document.createElement("tr"),B=document.createElement("tr"),F=document.createElement("td");F.appendChild(S);const z=document.createElement("td");z.appendChild(I);const k=document.createElement("td");k.appendChild(P),N.appendChild(F),N.appendChild(z),N.appendChild(k);const U=document.createElement("td"),V=document.createElement("td");V.appendChild(D);const H=document.createElement("td");H.appendChild(R),B.appendChild(U),B.appendChild(V),B.appendChild(H),L.appendChild(N),L.appendChild(B),x.appendChild(L),T.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),T.appendChild(c("Show only selected","filterTile","hasPickedTile")),E.appendChild(c("Wireframe","wireframe")),E.appendChild(c("Suspend LOD update","suspendUpdates")),E.appendChild(c("Show tile coordinates","tileCoordinates")),zUe.applyBindings(i,this._element)}Object.defineProperties(yHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),yHe.prototype.isDestroyed=function(){return!1},yHe.prototype.destroy=function(){return zUe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),sc(this)};var bHe=yHe;function vHe(e){return Lt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}function OHe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,Object(l.a)(e._scene)&&(e._scene.pixelRatio=t),t}function wHe(e){const t=e._canvas;let n=t.clientWidth,i=t.clientHeight;const r=OHe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=0!==n&&0!==i,e._lastDevicePixelRatio=window.devicePixelRatio}function AHe(e){const t=e._canvas,n=t.width,i=t.height;if(0!==n&&0!==i){const t=e._scene.camera.frustum;Object(l.a)(t.aspectRatio)?t.aspectRatio=n/i:(t.top=t.right*(i/n),t.bottom=-t.top)}}function EHe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");e=gye(e),t=Object(c.a)(t,c.a.EMPTY_OBJECT);const n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);const i=document.createElement("canvas"),r=Jr.supportsImageRenderingPixelated();function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=Jr.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};Object(c.a)(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);const a=document.createElement("div");a.className="cesium-widget-credits";const s=Object(l.a)(t.creditContainer)?gye(t.creditContainer):n;s.appendChild(a);const h=Object(l.a)(t.creditViewport)?gye(t.creditViewport):n,d=Object(c.a)(t.showRenderLoopErrors,!0),f=Object(c.a)(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=h,this._creditContainer=s,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=d,this._resolutionScale=1,this._useBrowserRecommendedResolution=f,this._forceResize=!1,this._clock=Object(l.a)(t.clock)?t.clock:new Jf,wHe(this);try{const e=new Lke({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:h,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:Object(c.a)(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=e,e.camera.constrainedAxis=O.UNIT_Z,OHe(this),AHe(this);const n=Object(c.a)(e.mapProjection.ellipsoid,H.WGS84);let r=t.globe;Object(l.a)(r)||(r=new UPe(n)),!1!==r&&(e.globe=r,e.globe.shadows=Object(c.a)(t.terrainShadows,TB.RECEIVE_ONLY));let o=t.skyBox;Object(l.a)(o)||(o=new qke({sources:{positiveX:vHe("px"),negativeX:vHe("mx"),positiveY:vHe("py"),negativeY:vHe("my"),positiveZ:vHe("pz"),negativeZ:vHe("mz")}})),!1!==o&&(e.skyBox=o,e.sun=new rUe,e.moon=new gRe);let s=t.skyAtmosphere;Object(l.a)(s)||(s=new Uke(n)),!1!==s&&(e.skyAtmosphere=s);let u=!1!==t.globe&&t.imageryProvider;Object(l.a)(u)||(u=ECe()),!1!==u&&e.imageryLayers.addImageryProvider(u),Object(l.a)(t.terrainProvider)&&!1!==t.globe&&(e.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new ZS(i),Object(l.a)(t.sceneMode)&&(t.sceneMode===AB.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===AB.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=Object(c.a)(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;const d=this;this._onRenderError=function(e,t){if(d._useDefaultRenderLoop=!1,d._renderLoopRunning=!1,d._showRenderLoopErrors){const e="An error occurred while rendering.  Rendering has stopped.";d.showErrorPanel(e,void 0,t)}},e.renderError.addEventListener(this._onRenderError)}catch(e){if(d){const t="Error constructing CesiumWidget.",n='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:';this.showErrorPanel(t,n,e)}throw e}}Object.defineProperties(EHe.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(e<=0)throw new u.a("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&function(e){e._renderLoopRunning=!0;let t=0;requestAnimationFrame((function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{const r=e._targetFrameRate;if(Object(l.a)(r)){const o=1e3/r,a=i-t;a>o&&(e.resize(),e.render(),t=i-a%o),requestAnimationFrame(n)}else e.resize(),e.render(),requestAnimationFrame(n)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){const n="An error occurred while rendering.  Rendering has stopped.";e.showErrorPanel(n,void 0,t)}}else e._renderLoopRunning=!1}))}(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new u.a("resolutionScale must be greater than 0.");this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}}),EHe.prototype.showErrorPanel=function(e,t,n){const i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";const o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);const a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),o.appendChild(a);const s=document.createElement("div");function c(){s.style.maxHeight=Math.max(Math.round(.9*i.clientHeight-100),30)+"px"}s.className="cesium-widget-errorPanel-scroll",o.appendChild(s),c(),Object(l.a)(window.addEventListener)&&window.addEventListener("resize",c,!1);const u=Object(l.a)(t),h=Object(l.a)(n);if(u||h){const i=document.createElement("div");if(i.className="cesium-widget-errorPanel-message",s.appendChild(i),h){let i=ul(n);u||("string"==typeof n&&(n=new Error(n)),t=ul({name:n.name,message:n.message}),i=n.stack),"undefined"!=typeof console&&console.error(`${e}\n${t}\n${i}`);const r=document.createElement("div");r.className="cesium-widget-errorPanel-message-details collapsed";const a=document.createElement("span");a.className="cesium-widget-errorPanel-more-details",a.appendChild(document.createTextNode("See more...")),r.appendChild(a),r.onclick=function(e){r.removeChild(a),r.appendChild(document.createTextNode(i)),r.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",r.onclick=void 0},s.appendChild(r)}i.innerHTML=`<p>${t}</p>`}const d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);const f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){Object(l.a)(c)&&Object(l.a)(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(f),i.appendChild(r)},EHe.prototype.isDestroyed=function(){return!1},EHe.prototype.destroy=function(){Object(l.a)(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),sc(this)},EHe.prototype.resize=function(){const e=this._canvas;(this._forceResize||this._canvasClientWidth!==e.clientWidth||this._canvasClientHeight!==e.clientHeight||this._lastDevicePixelRatio!==window.devicePixelRatio)&&(this._forceResize=!1,wHe(this),AHe(this),this._scene.requestRender())},EHe.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();const e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};var THe=EHe;function CHe(e,t){Object(l.a)(t)||(t=document.body),t=gye(t);const n=this,i=zUe.observable(vr.fullscreen),r=zUe.observable(vr.enabled),o=t.ownerDocument;this.isFullscreen=void 0,zUe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,zUe.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(e){r(e&&vr.enabled)}}),this.tooltip=void 0,zUe.defineProperty(this,"tooltip",(function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"})),this._command=JUe((function(){vr.fullscreen?vr.exitFullscreen():vr.requestFullscreen(n._fullscreenElement)}),zUe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Object(c.a)(gye(e),o.body),this._callback=function(){i(vr.fullscreen)},o.addEventListener(vr.changeEventName,this._callback)}Object.defineProperties(CHe.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new u.a("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}}),CHe.prototype.isDestroyed=function(){return!1},CHe.prototype.destroy=function(){document.removeEventListener(vr.changeEventName,this._callback),sc(this)};var xHe=CHe;function SHe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");e=gye(e);const n=new xHe(t,e);n._exitFullScreenPath="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z",n._enterFullScreenPath="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z";const i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),zUe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(SHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SHe.prototype.isDestroyed=function(){return!1},SHe.prototype.destroy=function(){return this._viewModel.destroy(),zUe.cleanNode(this._element),this._container.removeChild(this._element),sc(this)};var IHe=SHe;function PHe(e){if(!Object(l.a)(e)||!Object(l.a)(e.scene))throw new u.a("options.scene is required.");Object(l.a)(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new vu,new VA({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new un.a,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=RHe,this._handleArrowUp=DHe;const t=this;this._suggestionsVisible=zUe.pureComputed((function(){const e=zUe.getObservable(t,"_suggestions")().length>0,n=zUe.getObservable(t,"_showSuggestions")();return e&&n})),this._searchCommand=JUe((function(e){if(e=Object(c.a)(e,Uv.SEARCH),t._focusTextbox=!1,Object(l.a)(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;var n;t.hideSuggestions(),t.isSearchInProgress?((n=t)._isSearchInProgress=!1,Object(l.a)(n._geocodePromise)&&(n._geocodePromise.cancel=!0,n._geocodePromise=void 0)):function(e,t,n){const i=e._searchText;if(MHe(i))return void e.showSuggestions();e._isSearchInProgress=!0;let r=Promise.resolve();for(let e=0;e<t.length;e++)r=jHe(r,t[e],i,n);e._geocodePromise=r,r.then((function(t){if(r.cancel)return;e._isSearchInProgress=!1;const n=t.value;if("fulfilled"===t.state&&Object(l.a)(n)&&n.length>0)return e._searchText=n[0].displayName,void e.destinationFound(e,n[0].destination);e._searchText=i+" (not found)"}))}(t,t._geocoderServices,e)})),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){const n="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(n||i)&&t.preventDefault(),!0},this.handleKeyUp=function(e,n){const i="ArrowDown"===n.key||"Down"===n.key||40===n.keyCode,r="ArrowUp"===n.key||"Up"===n.key||38===n.keyCode,o="Enter"===n.key||13===n.keyCode;return r?DHe(t):i?RHe(t):o&&t._searchCommand(),!0},this.activateSuggestion=function(e){t.hideSuggestions(),t._searchText=e.displayName;const n=e.destination;LHe(t),t.destinationFound(t,n)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(e,n){e!==t._selectedSuggestion&&(t._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=Object(c.a)(e.autocomplete,!0),this.destinationFound=Object(c.a)(e.destinationFound,PHe.flyToDestination),this._focusTextbox=!1,zUe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);const n=zUe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe((function(){PHe._updateSearchSuggestions(t)})),this.isSearchInProgress=void 0,zUe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,zUe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){if("string"!=typeof e)throw new u.a("value must be a valid string.");this._searchText=e}}),this.flightDuration=void 0,zUe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){if(Object(l.a)(e)&&e<0)throw new u.a("value must be positive.");this._flightDuration=e}})}function DHe(e){if(0===e._suggestions.length)return;const t=e._suggestions.indexOf(e._selectedSuggestion);if(-1===t||0===t)return void(e._selectedSuggestion=void 0);const n=t-1;e._selectedSuggestion=e._suggestions[n],PHe._adjustSuggestionsScroll(e,n)}function RHe(e){if(0===e._suggestions.length)return;const t=e._suggestions.length,n=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[n],PHe._adjustSuggestionsScroll(e,n)}function jHe(e,t,n,i){return e.then((function(e){if(Object(l.a)(e)&&"fulfilled"===e.state&&e.value.length>0)return e;return t.geocode(n,i).then((function(e){return{state:"fulfilled",value:e}})).catch((function(e){return{state:"rejected",reason:e}}))}))}function MHe(e){return/^\s*$/.test(e)}function LHe(e){zUe.getObservable(e,"_suggestions").removeAll()}Object.defineProperties(PHe.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),PHe.prototype.destroy=function(){this._suggestionSubscription.dispose()},PHe.flyToDestination=function(e,t){const n=e._scene,i=n.mapProjection.ellipsoid,r=n.camera,o=n.terrainProvider;let a,s=t;return t instanceof Be?h.a.equalsEpsilon(t.south,t.north,h.a.EPSILON7)&&h.a.equalsEpsilon(t.east,t.west,h.a.EPSILON7)?t=Be.center(t):a=QEe(t,n):t=i.cartesianToCartographic(t),Object(l.a)(a)||(a=function(e,t){const n=Object(l.a)(t)?t.availability:void 0;return Object(l.a)(n)?dS(t,[e]).then((function(t){return(e=t[0]).height+=1e3,e})):(e.height+=1e3,Promise.resolve(e))}(t,o)),a.then((function(e){s=i.cartographicToCartesian(e)})).finally((function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:Me.IDENTITY})}))},PHe._updateSearchSuggestions=function(e){if(!e.autoComplete)return;const t=e._searchText;if(LHe(e),MHe(t))return;let n=Promise.resolve([]);return e._geocoderServices.forEach((function(e){n=n.then((function(n){return n.length>=5?n:e.geocode(t,Uv.AUTOCOMPLETE).then((function(e){return n=n.concat(e)}))}))})),n.then((function(t){const n=e._suggestions;for(let e=0;e<t.length;e++)n.push(t[e])}))},PHe._adjustSuggestionsScroll=function(e,t){const n=gye(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(0===t)return void(i.scrollTop=0);const o=r.offsetTop;o+r.clientHeight>i.clientHeight?i.scrollTop=o+r.clientHeight:o<i.scrollTop&&(i.scrollTop=o)};var NHe=PHe;function BHe(e){if(!Object(l.a)(e)||!Object(l.a)(e.container))throw new u.a("options.container is required.");if(!Object(l.a)(e.scene))throw new u.a("options.scene is required.");const t=gye(e.container),n=new NHe(e);n._startSearchPath="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",n._stopSearchPath="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";const i=document.createElement("form");i.setAttribute("data-bind","submit: search");const r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout((function(){r.select()}),0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;const o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);const a=document.createElement("div");a.className="search-results",a.setAttribute("data-bind","visible: _suggestionsVisible");const s=document.createElement("ul");s.setAttribute("data-bind","foreach: _suggestions");const c=document.createElement("li");s.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),a.appendChild(s),t.appendChild(a),zUe.applyBindings(n,i),zUe.applyBindings(n,a),this._container=t,this._searchSuggestionsContainer=a,this._viewModel=n,this._form=i,this._onInputBegin=function(e){let i=e.target;"function"==typeof e.composedPath&&(i=e.composedPath()[0]),t.contains(i)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(e){n._focusTextbox=!0,n.showSuggestions()},Jr.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(BHe.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),BHe.prototype.isDestroyed=function(){return!1},BHe.prototype.destroy=function(){const e=this._container;return Jr.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),zUe.cleanNode(this._form),zUe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),sc(this)};var FHe=BHe;function zHe(e,t){if(!Object(l.a)(e))throw new u.a("scene is required.");this._scene=e,this._duration=t;const n=this;this._command=JUe((function(){n._scene.camera.flyHome(n._duration)})),this.tooltip="View Home",zUe.track(this,["tooltip"])}Object.defineProperties(zHe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(Object(l.a)(e)&&e<0)throw new u.a("value must be positive.");this._duration=e}}});var kHe=zHe;function UHe(e,t,n){if(!Object(l.a)(e))throw new u.a("container is required.");e=gye(e);const i=new kHe(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";const r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),zUe.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(UHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),UHe.prototype.isDestroyed=function(){return!1},UHe.prototype.destroy=function(){return zUe.cleanNode(this._element),this._container.removeChild(this._element),sc(this)};var VHe=UHe;function HHe(){this._cameraClicked=new un.a,this._closeClicked=new un.a,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",zUe.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,zUe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?"M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z":"M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z"}}),zUe.defineProperty(this,"_bodyless",{get:function(){return!Object(l.a)(this.description)||0===this.description.length}})}HHe.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},Object.defineProperties(HHe.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var GHe=HHe;function qHe(e){s.a.defined("container",e),e=gye(e);const t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);const n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);const i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);const r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="&times;",t.appendChild(r);const o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);const a=new GHe;zUe.applyBindings(a,t),this._container=e,this._element=t,this._frame=o,this._viewModel=a,this._descriptionSubscription=void 0;const c=this;o.addEventListener("load",(function(){const e=o.contentDocument,n=e.createElement("link");n.href=Lt("Widgets/InfoBox/InfoBoxDescription.css"),n.rel="stylesheet",n.type="text/css";const i=e.createElement("div");i.className="cesium-infoBox-description",e.head.appendChild(n),e.body.appendChild(i),c._descriptionSubscription=QUe(a,"description",(function(e){o.style.height="5px",i.innerHTML=e;let n=null;const r=i.firstElementChild;if(null!==r&&1===i.childNodes.length){const e=window.getComputedStyle(r);if(null!==e){const t=e["background-color"],i=sp.fromCssColorString(t);Object(l.a)(i)&&0!==i.alpha&&(n=e["background-color"])}}t.style["background-color"]=n;const a=i.getBoundingClientRect().height;o.style.height=a+"px"}))})),o.setAttribute("src","about:blank")}Object.defineProperties(qHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),qHe.prototype.isDestroyed=function(){return!1},qHe.prototype.destroy=function(){const e=this._container;return zUe.cleanNode(this._element),e.removeChild(this._element),Object(l.a)(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),sc(this)};var WHe=qHe;function YHe(){this.showInstructions=!1;const e=this;this._command=JUe((function(){e.showInstructions=!e.showInstructions})),this._showClick=JUe((function(){e._touch=!1})),this._showTouch=JUe((function(){e._touch=!0})),this._touch=!1,this.tooltip="Navigation Instructions",zUe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(YHe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var XHe=YHe;function KHe(e){if(!Object(l.a)(e)||!Object(l.a)(e.container))throw new u.a("options.container is required.");const t=gye(e.container),n=new XHe,i=Object(c.a)(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";const r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);const o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);const a=document.createElement("div");a.className="cesium-navigation-help",a.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(a);const s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');const h=document.createElement("img");h.src=Lt("Widgets/Images/NavigationHelp/Mouse.svg"),h.className="cesium-navigation-button-icon",h.style.width="25px",h.style.height="25px",s.appendChild(h),s.appendChild(document.createTextNode("Mouse"));const d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');const f=document.createElement("img");f.src=Lt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",d.appendChild(f),d.appendChild(document.createTextNode("Touch")),a.appendChild(s),a.appendChild(d);const p=document.createElement("div");p.className="cesium-click-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),p.innerHTML=`            <table>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">Left click + drag</div>                    </td>                </tr>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Right click + drag, or</div>                        <div class="cesium-navigation-help-details">Mouse wheel scroll</div>                    </td>                </tr>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Rotate view</div>                        <div class="cesium-navigation-help-details">Middle click + drag, or</div>                        <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div>                    </td>                </tr>            </table>`,a.appendChild(p);const m=document.createElement("div");m.className="cesium-touch-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),m.innerHTML=`            <table>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">One finger drag</div>                    </td>                </tr>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Two finger pinch</div>                    </td>                </tr>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Tilt view</div>                        <div class="cesium-navigation-help-details">Two finger drag, same direction</div>                    </td>                </tr>                <tr>                    <td><img src="${Lt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">Rotate view</div>                        <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div>                    </td>                </tr>            </table>`,a.appendChild(m),zUe.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(e){r.contains(e.target)||(n.showInstructions=!1)},Jr.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(KHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),KHe.prototype.isDestroyed=function(){return!1},KHe.prototype.destroy=function(){return Jr.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),zUe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),sc(this)};var JHe=KHe;function ZHe(e){if(!Object(l.a)(e)||!Object(l.a)(e.scene))throw new u.a("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=Object(c.a)(e.lowFrameRateMessage,"This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,zUe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);const t=this;this._dismissMessage=JUe((function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0}));const n=Vxe.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener((function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)})),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener((function(){t.showingLowFrameRateMessage=!1}))}Object.defineProperties(ZHe.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),ZHe.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),sc(this)};var $He=ZHe;function QHe(e){if(!Object(l.a)(e)||!Object(l.a)(e.container))throw new u.a("options.container is required.");if(!Object(l.a)(e.scene))throw new u.a("options.scene is required.");const t=gye(e.container),n=new $He(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");const r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="&times;",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);const o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),zUe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(QHe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),QHe.prototype.isDestroyed=function(){return!1},QHe.prototype.destroy=function(){return this._viewModel.destroy(),zUe.cleanNode(this._element),this._container.removeChild(this._element),sc(this)};var eGe=QHe;function tGe(e){if(!Object(l.a)(e))throw new u.a("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof nv,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,zUe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);const t=this;zUe.defineProperty(this,"selectedTooltip",(function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective})),this._toggleDropDown=JUe((function(){t.sceneMode===AB.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)})),this._eventHelper=new Gb,this._eventHelper.add(e.morphComplete,(function(e,n,i,r){t.sceneMode=i,t._orthographic=i===AB.SCENE2D||t._scene.camera.frustum instanceof nv})),this._eventHelper.add(e.preRender,(function(){t._flightInProgress=Object(l.a)(e.camera._currentFlight)})),this._switchToPerspective=JUe((function(){t.sceneMode!==AB.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)})),this._switchToOrthographic=JUe((function(){t.sceneMode!==AB.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)})),this._sceneMode=AB}Object.defineProperties(tGe.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}}),tGe.prototype.isDestroyed=function(){return!1},tGe.prototype.destroy=function(){this._eventHelper.removeAll(),sc(this)};var nGe=tGe;function iGe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");if(!Object(l.a)(t))throw new u.a("scene is required.");e=gye(e);const n=new nGe(t);n._perspectivePath="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",n._orthographicPath="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";const i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);const r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic,       "cesium-projectionPicker-buttonOrthographic": _orthographic,       "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress,        "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',i.appendChild(r);const o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),       "cesium-projectionPicker-none" : !_orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);const a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),       "cesium-projectionPicker-none" : _orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(a),zUe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(e){i.contains(e.target)||(n.dropDownVisible=!1)},Jr.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(iGe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),iGe.prototype.isDestroyed=function(){return!1},iGe.prototype.destroy=function(){return this._viewModel.destroy(),Jr.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),zUe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),sc(this)};var rGe=iGe;function oGe(e,t){if(!Object(l.a)(e))throw new u.a("scene is required.");this._scene=e;const n=this;this._eventHelper=new Gb,this._eventHelper.add(e.morphStart,(function(e,t,i,r){n.sceneMode=i,n.dropDownVisible=!1})),this._duration=Object(c.a)(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",zUe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,zUe.defineProperty(this,"selectedTooltip",(function(){const e=n.sceneMode;return e===AB.SCENE2D?n.tooltip2D:e===AB.SCENE3D?n.tooltip3D:n.tooltipColumbusView})),this._toggleDropDown=JUe((function(){n.dropDownVisible=!n.dropDownVisible})),this._morphTo2D=JUe((function(){e.morphTo2D(n._duration)})),this._morphTo3D=JUe((function(){e.morphTo3D(n._duration)})),this._morphToColumbusView=JUe((function(){e.morphToColumbusView(n._duration)})),this._sceneMode=AB}Object.defineProperties(oGe.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new u.a("duration value must be positive.");this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),oGe.prototype.isDestroyed=function(){return!1},oGe.prototype.destroy=function(){this._eventHelper.removeAll(),sc(this)};var aGe=oGe;function sGe(e,t,n){if(!Object(l.a)(e))throw new u.a("container is required.");if(!Object(l.a)(t))throw new u.a("scene is required.");e=gye(e);const i=new aGe(t,n);i._globePath="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878         -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132         -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285         11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z         M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201         5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461         -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",i._flatMapPath="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",i._columbusViewPath="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";const r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);const o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',r.appendChild(o);const a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(a);const s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(s);const c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),zUe.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.contains(e.target)||(i.dropDownVisible=!1)},Jr.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(sGe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),sGe.prototype.isDestroyed=function(){return!1},sGe.prototype.destroy=function(){return this._viewModel.destroy(),Jr.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),zUe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),sc(this)};var cGe=sGe;const lGe=new Vt;function uGe(e,t,n){if(!Object(l.a)(e))throw new u.a("scene is required.");if(!Object(l.a)(t))throw new u.a("selectionIndicatorElement is required.");if(!Object(l.a)(n))throw new u.a("container is required.");this._scene=e,this._screenPositionX="-1000px",this._screenPositionY="-1000px",this._tweens=e.tweens,this._container=Object(c.a)(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,zUe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,zUe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&Object(l.a)(this.position)}}),zUe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(t,n){return iQ.wgs84ToWindowCoordinates(e,t,n)}}uGe.prototype.update=function(){if(this.showSelection&&Object(l.a)(this.position)){const e=this.computeScreenSpacePosition(this.position,lGe);if(Object(l.a)(e)){const t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=.5*r;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX="-1000px",this._screenPositionY="-1000px"}},uGe.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:_b.EXPONENTIAL_OUT})},uGe.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:_b.EXPONENTIAL_OUT})},Object.defineProperties(uGe.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var hGe=uGe;function dGe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");e=gye(e),this._container=e;const n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;const i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");const o=document.createElementNS(i,"g");o.setAttribute("transform","translate(80,80)"),r.appendChild(o);const a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d","M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z"),o.appendChild(a),n.appendChild(r);const s=new hGe(t,this._element,this._container);this._viewModel=s,zUe.applyBindings(this._viewModel,this._element)}Object.defineProperties(dGe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),dGe.prototype.isDestroyed=function(){return!1},dGe.prototype.destroy=function(){const e=this._container;return zUe.cleanNode(this._element),e.removeChild(this._element),sc(this)};var fGe=dGe;function pGe(e,t,n){this._color=e,this._height=t,this._base=Object(c.a)(n,0)}pGe.prototype.getHeight=function(){return this._height},pGe.prototype.getBase=function(){return this._base},pGe.prototype.getStartTime=function(){return this._start},pGe.prototype.getStopTime=function(){return this._stop},pGe.prototype.setRange=function(e,t){this._start=e,this._stop=t},pGe.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){const n=tr.secondsDifference(this._start,e.epochJulian);let i=Math.round(e.timeBarWidth*e.getAlpha(n));const r=tr.secondsDifference(this._stop,e.epochJulian);let o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var mGe=pGe;function gGe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new sp(.5,.5,.5,1),this.backgroundColor=i||new sp(0,0,0,0)}gGe.prototype.render=function(e,t){const n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=tr.addSeconds(t.startJulian,t.duration,new tr);if(tr.lessThan(n,r)&&tr.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(tr.lessThanOrEquals(n,o)&&tr.greaterThanOrEquals(i,r)){let r,o,a;for(r=0;r<t.timeBarWidth;++r){const e=tr.addSeconds(t.startJulian,r/t.timeBarWidth*t.duration,new tr);!Object(l.a)(o)&&tr.greaterThanOrEquals(e,n)?o=r:!Object(l.a)(a)&&tr.greaterThanOrEquals(e,i)&&(a=r)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),Object(l.a)(o)&&(Object(l.a)(a)||(a=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(o,t.y,Math.max(a-o,1),this.height))}};var _Ge=gGe;let yGe=1e12;const bGe=0,vGe=1,OGe=2,wGe=3,AGe=4,EGe=0,TGe=1,CGe=2,xGe=3,SGe=4,IGe=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],PGe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function DGe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");if(!Object(l.a)(t))throw new u.a("clock is required.");const n=(e=gye(e)).ownerDocument;this.container=e;const i=n.createElement("div");var r;i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=bGe,this._touchMode=EGe,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=(r=this,function(e){r._mouseMode!==AGe&&(0===e.button?(r._mouseMode=vGe,r._scrubElement&&(r._scrubElement.style.backgroundPosition="-16px 0"),r._onMouseMove(e)):(r._mouseX=e.clientX,2===e.button?r._mouseMode=wGe:r._mouseMode=OGe)),e.preventDefault()}),this._onMouseUp=function(e){return function(t){e._mouseMode=bGe,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}(this),this._onMouseMove=function(e){return function(t){let n;if(e._mouseMode===vGe){t.preventDefault();const n=t.clientX-e._topDiv.getBoundingClientRect().left;n<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):n>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(n,n*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===OGe){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==n){const t=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(tr.addSeconds(e._startJulian,t,new tr),tr.addSeconds(e._endJulian,t,new tr))}}else e._mouseMode===wGe&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==n&&e.zoomFrom(Math.pow(1.01,n)))}}(this),this._onMouseWheel=function(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;yGe=Math.max(Math.min(Math.abs(n),yGe),1),n/=yGe,e.zoomFrom(Math.pow(1.05,-n))}}(this),this._onTouchStart=function(e){return function(t){const n=t.touches.length;let i,r;const o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=AGe,1===n?(i=tr.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=TGe,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===n?"-16px 0":"0 0")):(e._touchMode=xGe,e._touchState.centerX=t.touches[0].clientX-o)):2===n?(e._touchMode=CGe,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=SGe}}(this),this._onTouchMove=function(e){return function(t){let n,i,r,o,a,s,c=1;const u=e._topDiv.getBoundingClientRect().left;e._touchMode===xGe&&(e._touchMode=CGe),e._mouseMode=AGe,e._touchMode===TGe?(t.preventDefault(),1===t.changedTouches.length&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===CGe&&(r=t.touches.length,2===r?(o=.5*(t.touches[0].clientX+t.touches[1].clientX)-u,a=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):1===r&&(o=t.touches[0].clientX-u,a=0),Object(l.a)(o)&&(a>0&&e._touchState.spanX>0?(c=e._touchState.spanX/a,s=tr.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new tr)):(n=e._touchState.centerX-o,s=tr.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new tr)),e.zoomTo(s,tr.addSeconds(s,e._timeBarSecondsSpan*c,new tr)),e._touchState.centerX=o,e._touchState.spanX=a))}}(this),this._onTouchEnd=function(e){return function(t){const n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xGe?(e._touchMode=TGe,e._onTouchMove(t)):e._touchMode===TGe&&e._onTouchMove(t),e._mouseMode=AGe,1!==n?e._touchMode=n>0?SGe:EGe:e._touchMode===CGe&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}(this);const o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function RGe(e){return e<10?"0"+e.toString():e.toString()}DGe.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)},DGe.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)},DGe.prototype.isDestroyed=function(){return!1},DGe.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);const e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);const t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),sc(this)},DGe.prototype.addHighlightRange=function(e,t,n){const i=new mGe(e,t,n);return this._highlightRanges.push(i),this.resize(),i},DGe.prototype.addTrack=function(e,t,n,i){const r=new _Ge(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r},DGe.prototype.zoomTo=function(e,t){if(!Object(l.a)(e))throw new u.a("startTime is required.");if(!Object(l.a)(t))throw new u.a("stopTime is required");if(tr.lessThanOrEquals(t,e))throw new u.a("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=tr.secondsDifference(t,e),this._clock&&this._clock.clockRange!==qf.UNBOUNDED){const e=this._clock.startTime,t=this._clock.stopTime,n=tr.secondsDifference(t,e),i=tr.secondsDifference(e,this._startJulian),r=tr.secondsDifference(t,this._endJulian);this._timeBarSecondsSpan>=n?(this._timeBarSecondsSpan=n,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):i>0?(this._endJulian=tr.addSeconds(this._endJulian,i,new tr),this._startJulian=e,this._timeBarSecondsSpan=tr.secondsDifference(this._endJulian,this._startJulian)):r<0&&(this._startJulian=tr.addSeconds(this._startJulian,r,new tr),this._endJulian=t,this._timeBarSecondsSpan=tr.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();const n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)},DGe.prototype.zoomFrom=function(e){let t=tr.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;const n=this._timeBarSecondsSpan-t;this.zoomTo(tr.addSeconds(this._startJulian,t-t*e,new tr),tr.addSeconds(this._endJulian,n*e-n,new tr))},DGe.prototype.makeLabel=function(e){const t=tr.toGregorianDate(e),n=t.millisecond;let i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i="0"+i;i="."+i}return`${PGe[t.month-1]} ${t.day} ${t.year} ${RGe(t.hour)}:${RGe(t.minute)}:${RGe(t.second)}${i}`},DGe.prototype.smallestTicInPixels=7,DGe.prototype._makeTics=function(){const e=this._timeBarEle,t=tr.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8;let r;const o=this;this._needleEle.style.left=n.toString()+"px";let a="";let s=0,c=this._timeBarSecondsSpan;c<.01?(c=.01,this._timeBarSecondsSpan=.01,this._endJulian=tr.addSeconds(this._startJulian,.01,new tr)):c>31536e6&&(c=31536e6,this._timeBarSecondsSpan=31536e6,this._endJulian=tr.addSeconds(this._startJulian,31536e6,new tr));let l=this._timeBarEle.clientWidth;l<10&&(l=10);const u=this._startJulian,h=Math.min(c/l*1e-5,.4);let d;const f=tr.toGregorianDate(u);d=c>31536e4?tr.fromDate(new Date(Date.UTC(100*Math.floor(f.year/100),0))):c>31536e3?tr.fromDate(new Date(Date.UTC(10*Math.floor(f.year/10),0))):c>86400?tr.fromDate(new Date(Date.UTC(f.year,0))):tr.fromDate(new Date(Date.UTC(f.year,f.month,f.day)));const p=tr.secondsDifference(this._startJulian,tr.addSeconds(d,h,new tr));let m=p+c;function g(e){return Math.floor(p/e)*e}function _(e,t){return Math.ceil(e/t+.5)*t}function y(e){return(e-p)/c}function b(e,t){return e-t*Math.round(e/t)}this._epochJulian=d,this._rulerEle.innerHTML=this.makeLabel(tr.addSeconds(this._endJulian,-.01,new tr));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);const O=s;s-=1e-10;const w={startTime:p,startJulian:u,epochJulian:d,duration:c,timeBarWidth:l,getAlpha:y};this._highlightRanges.forEach((function(e){a+=e.render(w)}));let A=0,E=0,T=0,C=v/l;C>1&&(C=1),C*=this._timeBarSecondsSpan;let x=-1,S=-1;const I=IGe.length;let P;for(P=0;P<I;++P){const e=IGe[P];if(++x,A=e,e>C&&e>s)break;S<0&&l*(e/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(S=x)}if(x>0){for(;x>0;)if(--x,Math.abs(b(A,IGe[x]))<1e-5){IGe[x]>=s&&(E=IGe[x]);break}if(S>=0)for(;S<x;){if(Math.abs(b(E,IGe[S]))<1e-5&&IGe[S]>=s){T=IGe[S];break}++S}}s=O,s>1e-10&&T<1e-5&&Math.abs(s-A)>1e-10&&(T=s,s<=A+1e-10&&(E=0));let D,R=-999999;if(l*(T/this._timeBarSecondsSpan)>=3)for(r=g(T);r<=m;r=_(r,T))a+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(l*y(r)).toString()}px;"></span>`;if(l*(E/this._timeBarSecondsSpan)>=3)for(r=g(E);r<=m;r=_(r,E))a+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(l*y(r)).toString()}px;"></span>`;if(l*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,m+=A,r=g(A);const e=tr.computeTaiMinusUtc(d);for(;r<=m;){let t=tr.addSeconds(u,r-p,new tr);if(A>2.1){const n=tr.computeTaiMinusUtc(t);Math.abs(n-e)>.1&&(r+=n-e,t=tr.addSeconds(u,r-p,new tr))}const n=Math.round(l*y(r)),i=this.makeLabel(t);this._rulerEle.innerHTML=i,D=this._rulerEle.offsetWidth,D<10&&(D=v);const o=n-(D/2-1);o>R?(R=o+D+5,a+=`<span class="cesium-timeline-ticMain" style="left: ${n.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${o.toString()}px;">${i}</span>`):a+=`<span class="cesium-timeline-ticSub" style="left: ${n.toString()}px;"></span>`,r=_(r,A)}}else this._mainTicSpan=-1;a+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=a,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),w.y=0,this._trackList.forEach((function(e){e.render(o._context,w),w.y+=e.height}))},DGe.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;const e=this._scrubElement;if(Object(l.a)(this._scrubElement)){const t=tr.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=n-8+"px",this._needleEle.style.left=n+"px")}Object(l.a)(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(tr.addSeconds(this._startJulian,this._timelineDrag,new tr),tr.addSeconds(this._endJulian,this._timelineDrag,new tr)))},DGe.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=tr.addSeconds(this._startJulian,t,new tr),this._scrubElement){const t=e-8;this._scrubElement.style.left=t.toString()+"px",this._needleEle.style.left=e.toString()+"px"}const n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)},DGe.prototype.resize=function(){const e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=t+"px";let n=1;this._trackList.forEach((function(e){n+=e.height})),this._trackListEle.style.height=n.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var jGe=DGe;function MGe(){const e=window.screen;Object(l.a)(e)&&(Object(l.a)(e.unlockOrientation)?e.unlockOrientation():Object(l.a)(e.mozUnlockOrientation)?e.mozUnlockOrientation():Object(l.a)(e.msUnlockOrientation)?e.msUnlockOrientation():Object(l.a)(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function LGe(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(MGe(),e._locked=!1),e._noSleep.disable(),vr.exitFullscreen(),n(!1)):(vr.fullscreen||vr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=function(e){let t=!1;const n=window.screen;return Object(l.a)(n)&&(Object(l.a)(n.lockOrientation)?t=n.lockOrientation(e):Object(l.a)(n.mozLockOrientation)?t=n.mozLockOrientation(e):Object(l.a)(n.msLockOrientation)?t=n.msLockOrientation(e):Object(l.a)(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}("landscape")),t.useWebVR=!0,n(!0)))}function NGe(e,t){if(!Object(l.a)(e))throw new u.a("scene is required.");const n=this,i=zUe.observable(vr.enabled),r=zUe.observable(!1);this.isVRMode=void 0,zUe.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,zUe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(e){i(e&&vr.enabled)}}),this.tooltip=void 0,zUe.defineProperty(this,"tooltip",(function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}));const o=zUe.observable(!1);this._isOrthographic=void 0,zUe.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Gb,this._eventHelper.add(e.preRender,(function(){o(e.camera.frustum instanceof nv)})),this._locked=!1,this._noSleep=new GUe.a,this._command=JUe((function(){LGe(n,e,r,o)}),zUe.getObservable(this,"isVREnabled")),this._vrElement=Object(c.a)(gye(t),document.body),this._callback=function(){!vr.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(MGe(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(vr.changeEventName,this._callback)}Object.defineProperties(NGe.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new u.a("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}}),NGe.prototype.isDestroyed=function(){return!1},NGe.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(vr.changeEventName,this._callback),sc(this)};var BGe=NGe;function FGe(e,t,n){if(!Object(l.a)(e))throw new u.a("container is required.");if(!Object(l.a)(t))throw new u.a("scene is required.");e=gye(e);const i=new BGe(t,n);i._exitVRPath="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z",i._enterVRPath="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z";const r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),zUe.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(FGe.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),FGe.prototype.isDestroyed=function(){return!1},FGe.prototype.destroy=function(){return this._viewModel.destroy(),zUe.cleanNode(this._element),this._container.removeChild(this._element),sc(this)};var zGe=FGe;const kGe=new At;function UGe(e){const t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function VGe(e){const t=e.getPropertyIds();let n="";return t.forEach((function(t){const i=e.getProperty(t);Object(l.a)(i)&&(n+=`<tr><th>${t}</th><td>${i}</td></tr>`)})),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function HGe(e){let t;const n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){const r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}const r=n.length;for(t=0;t<r;t++){const e=n[t];if(Object(l.a)(e)&&""!==e)return e}return"Unnamed Feature"}function GGe(e,t){const n=e.scene.pick(t.position);if(Object(l.a)(n)){const e=Object(c.a)(n.id,n.primitive.id);if(e instanceof Yk)return e;if(n instanceof jV)return new Yk({name:HGe(n),description:VGe(n),feature:n})}if(Object(l.a)(e.scene.globe))return function(e,t){const n=e.scene,i=n.camera.getPickRay(t),r=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!Object(l.a)(r))return;const o=new Yk({id:"Loading...",description:"Loading feature information..."});return r.then((function(t){if(e.selectedEntity!==o)return;if(!Object(l.a)(t)||0===t.length)return void(e.selectedEntity=XGe());const n=t[0],i=new Yk({id:n.name,description:n.description});if(Object(l.a)(n.position)){const t=e.scene.globe.ellipsoid.cartographicToCartesian(n.position,YGe);i.position=new $z(t)}e.selectedEntity=i}),(function(){e.selectedEntity===o&&(e.selectedEntity=XGe())})),o}(e,t.position)}const qGe=new tr;function WGe(e,t,n){if(Object(l.a)(n)){const i=n.clock;if(Object(l.a)(i)&&(i.getValue(t),Object(l.a)(e))){const t=i.startTime;let n=i.stopTime;tr.equals(t,n)&&(n=tr.addSeconds(t,h.a.EPSILON2,qGe)),e.updateFromClock(),e.zoomTo(t,n)}}}const YGe=new O;function XGe(){return new Yk({id:"None",description:"No features found."})}function KGe(e,t){if(!Object(l.a)(e))throw new u.a("container is required.");e=gye(e),t=Object(c.a)(t,c.a.EMPTY_OBJECT);const n=!(Object(l.a)(t.globe)&&!1===t.globe||Object(l.a)(t.baseLayerPicker)&&!1===t.baseLayerPicker);if(!n&&Object(l.a)(t.selectedImageryProviderViewModel))throw new u.a("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");if(!n&&Object(l.a)(t.selectedTerrainProviderViewModel))throw new u.a("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");const i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);const o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);const a=document.createElement("div");a.className="cesium-viewer-bottom",r.appendChild(a);const s=Object(c.a)(t.scene3DOnly,!1);let h,d,f=!1;Object(l.a)(t.clockViewModel)?(d=t.clockViewModel,h=d.clock):(h=new Jf,d=new XUe(h),f=!0),Object(l.a)(t.shouldAnimate)&&(h.shouldAnimate=t.shouldAnimate);const p=new THe(o,{imageryProvider:!n&&!Object(l.a)(t.imageryProvider)&&void 0,clock:h,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:Object(l.a)(t.creditContainer)?t.creditContainer:a,creditViewport:t.creditViewport,scene3DOnly:s,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});let m=t.dataSources,g=!1;Object(l.a)(m)||(m=new oce,g=!0);const _=p.scene,y=new tde({scene:_,dataSourceCollection:m}),b=new Gb;let v,O;if(b.add(h.onTick,KGe.prototype._onTick,this),b.add(_.morphStart,KGe.prototype._clearTrackedObject,this),!Object(l.a)(t.selectionIndicator)||!1!==t.selectionIndicator){const e=document.createElement("div");e.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(e),v=new fGe(e,_)}if(!Object(l.a)(t.infoBox)||!1!==t.infoBox){const e=document.createElement("div");e.className="cesium-viewer-infoBoxContainer",r.appendChild(e),O=new WHe(e);const t=O.viewModel;b.add(t.cameraClicked,KGe.prototype._onInfoBoxCameraClicked,this),b.add(t.closeClicked,KGe.prototype._onInfoBoxClockClicked,this)}const w=document.createElement("div");let A,E,T,C,x,S,I,P,D,R,j,M,L,N,B;if(w.className="cesium-viewer-toolbar",r.appendChild(w),!Object(l.a)(t.geocoder)||!1!==t.geocoder){const e=document.createElement("div");let n;e.className="cesium-viewer-geocoderContainer",w.appendChild(e),Object(l.a)(t.geocoder)&&"boolean"!=typeof t.geocoder&&(n=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),A=new FHe({container:e,geocoderServices:n,scene:_}),b.add(A.viewModel.search.beforeExecute,KGe.prototype._clearObjects,this)}if(Object(l.a)(t.homeButton)&&!1===t.homeButton||(E=new VHe(w,_),Object(l.a)(A)&&b.add(E.viewModel.command.afterExecute,(function(){const e=A.viewModel;e.searchText="",e.isSearchInProgress&&e.search()})),b.add(E.viewModel.command.beforeExecute,KGe.prototype._clearTrackedObject,this)),!0===t.sceneModePicker&&s)throw new u.a("options.sceneModePicker is not available when options.scene3DOnly is set to true.");if(s||Object(l.a)(t.sceneModePicker)&&!1===t.sceneModePicker||(T=new cGe(w,_)),t.projectionPicker&&(C=new rGe(w,_)),n){const e=Object(c.a)(t.imageryProviderViewModels,KVe()),n=Object(c.a)(t.terrainProviderViewModels,JVe());x=new WVe(w,{globe:_.globe,imageryProviderViewModels:e,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:n,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});S=w.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(Object(l.a)(t.imageryProvider)&&!1!==t.imageryProvider&&(n&&(x.viewModel.selectedImagery=void 0),_.imageryLayers.removeAll(),_.imageryLayers.addImageryProvider(t.imageryProvider)),Object(l.a)(t.terrainProvider)&&(n&&(x.viewModel.selectedTerrain=void 0),_.terrainProvider=t.terrainProvider),!Object(l.a)(t.navigationHelpButton)||!1!==t.navigationHelpButton){let e=!0;try{if(Object(l.a)(window.localStorage)){const t=window.localStorage.getItem("cesium-hasSeenNavHelp");Object(l.a)(t)&&Boolean(t)?e=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}I=new JHe({container:w,instructionsInitiallyVisible:Object(c.a)(t.navigationInstructionsInitiallyVisible,e)})}if(!Object(l.a)(t.animation)||!1!==t.animation){const e=document.createElement("div");e.className="cesium-viewer-animationContainer",r.appendChild(e),P=new BVe(e,new VVe(d))}if(!Object(l.a)(t.timeline)||!1!==t.timeline){const e=document.createElement("div");e.className="cesium-viewer-timelineContainer",r.appendChild(e),D=new jGe(e,h),D.addEventListener("settime",UGe,!1),D.zoomTo(h.startTime,h.stopTime)}if(Object(l.a)(t.fullscreenButton)&&!1===t.fullscreenButton||(M=document.createElement("div"),M.className="cesium-viewer-fullscreenContainer",r.appendChild(M),R=new IHe(M,t.fullscreenElement),j=QUe(R.viewModel,"isFullscreenEnabled",(function(e){M.style.display=e?"block":"none",Object(l.a)(D)&&(D.container.style.right=M.clientWidth+"px",D.resize())}))),t.vrButton){const e=document.createElement("div");e.className="cesium-viewer-vrContainer",r.appendChild(e),L=new zGe(e,_,t.fullScreenElement),N=QUe(L.viewModel,"isVREnabled",(function(t){e.style.display=t?"block":"none",Object(l.a)(R)&&(e.style.right=M.clientWidth+"px"),Object(l.a)(D)&&(D.container.style.right=e.clientWidth+"px",D.resize())})),B=QUe(L.viewModel,"isVRMode",(function(e){!function(e,t){const n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,a=e._baseLayerPicker,s=e._animation,c=e._timeline,u=e._fullscreenButton,h=e._infoBox,d=e._selectionIndicator,f=t?"hidden":"visible";if(Object(l.a)(n)&&(n.container.style.visibility=f),Object(l.a)(i)&&(i.container.style.visibility=f),Object(l.a)(r)&&(r.container.style.visibility=f),Object(l.a)(o)&&(o.container.style.visibility=f),Object(l.a)(a)&&(a.container.style.visibility=f),Object(l.a)(s)&&(s.container.style.visibility=f),Object(l.a)(c)&&(c.container.style.visibility=f),Object(l.a)(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=f),Object(l.a)(h)&&(h.container.style.visibility=f),Object(l.a)(d)&&(d.container.style.visibility=f),e._container){const n=t||!Object(l.a)(u)?0:u.container.clientWidth;e._vrButton.container.style.right=n+"px",e.forceResize()}}(i,e)}))}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=j,this._vrSubscription=N,this._vrModeSubscription=B,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=Object(c.a)(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=a,this._element=r,this._cesiumWidget=p,this._selectionIndicator=v,this._infoBox=O,this._dataSourceCollection=m,this._destroyDataSourceCollection=g,this._dataSourceDisplay=y,this._clockViewModel=d,this._destroyClockViewModel=f,this._toolbar=w,this._homeButton=E,this._sceneModePicker=T,this._projectionPicker=C,this._baseLayerPicker=x,this._navigationHelpButton=I,this._animation=P,this._timeline=D,this._fullscreenButton=R,this._vrButton=L,this._geocoder=A,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=Object(l.a)(O)||Object(l.a)(v),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new un.a,this._trackedEntityChanged=new un.a,zUe.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),b.add(m.dataSourceAdded,KGe.prototype._onDataSourceAdded,this),b.add(m.dataSourceRemoved,KGe.prototype._onDataSourceRemoved,this),b.add(_.postUpdate,KGe.prototype.resize,this),b.add(_.postRender,KGe.prototype._postRender,this);const F=m.length;for(let e=0;e<F;e++)this._dataSourceAdded(m,m.get(e));this._dataSourceAdded(void 0,y.defaultDataSource),b.add(m.dataSourceAdded,KGe.prototype._dataSourceAdded,this),b.add(m.dataSourceRemoved,KGe.prototype._dataSourceRemoved,this),p.screenSpaceEventHandler.setInputAction((function(e){i.selectedEntity=GGe(i,e)}),fS.LEFT_CLICK),p.screenSpaceEventHandler.setInputAction((function(e){const t=GGe(i,e);Object(l.a)(t)?JP.getValueOrUndefined(t.position,i.clock.currentTime)?i.trackedEntity=t:i.zoomTo(t):Object(l.a)(i.trackedEntity)&&(i.trackedEntity=void 0)}),fS.LEFT_DOUBLE_CLICK)}function JGe(e,t,n,i){if(!Object(l.a)(t))throw new u.a("zoomTarget is required.");$Ge(e);const r=new Promise(t=>{e._completeZoom=function(e){t(e)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then((function(t){if(e._zoomPromise===r)if(t instanceof TSe)t.getViewableRectangle().then((function(t){return QEe(t,e.scene)})).then((function(t){e._zoomPromise===r&&(e._zoomTarget=t)}));else if(t instanceof qie)e._zoomTarget=t;else if(t instanceof xUe)e._zoomTarget=t;else if(t.isLoading&&Object(l.a)(t.loadingEvent)){const n=t.loadingEvent.addEventListener((function(){n(),e._zoomPromise===r&&(e._zoomTarget=t.entities.values.slice(0))}))}else Array.isArray(t)?e._zoomTarget=t.slice(0):(t=Object(c.a)(t.values,t),Object(l.a)(t.entities)&&(t=t.entities.values),Array.isArray(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t])})),e.scene.requestRender(),r}function ZGe(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function $Ge(e){const t=e._zoomPromise;Object(l.a)(t)&&(ZGe(e),e._completeZoom(!1))}Object.defineProperties(KGe.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,$Ge(this);const t=this.scene,n=t.mode;Object(l.a)(e)&&Object(l.a)(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,n!==AB.COLUMBUS_VIEW&&n!==AB.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),n!==AB.COLUMBUS_VIEW&&n!==AB.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Me.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;const t=Object(l.a)(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;Object(l.a)(e)?Object(l.a)(t)&&t.animateAppear():Object(l.a)(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,WGe(this._timeline,this.clock,e))}}}),KGe.prototype.extend=function(e,t){if(!Object(l.a)(e))throw new u.a("mixin is required.");e(this,t)},KGe.prototype.resize=function(){const e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=Object(l.a)(this._animation),o=Object(l.a)(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;const a=i-125,s=this._baseLayerPickerDropDown;if(Object(l.a)(s)&&(s.style.maxHeight=a+"px"),Object(l.a)(this._geocoder)){this._geocoder.searchSuggestionsContainer.style.maxHeight=a+"px"}Object(l.a)(this._infoBox)&&(this._infoBox.viewModel.maxHeight=a);const c=this._timeline;let u,h=0,d=0,f=0;if(r&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){const e=this._lastWidth;u=this._animation.container,n>900?(h=169,e<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(h=136,(e<600||e>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(h=106,(e>600||0===e)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=h+5}if(o&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){const e=this._fullscreenButton,t=this._vrButton,n=c.container,i=n.style;f=n.clientHeight+3,i.left=h+"px";let r=0;Object(l.a)(e)&&(r+=e.container.clientWidth),Object(l.a)(t)&&(r+=t.container.clientWidth),i.right=r+"px",c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=f+"px",this._lastWidth=n,this._lastHeight=i},KGe.prototype.forceResize=function(){this._lastWidth=0,this.resize()},KGe.prototype.render=function(){this._cesiumWidget.render()},KGe.prototype.isDestroyed=function(){return!1},KGe.prototype.destroy=function(){let e;this.screenSpaceEventHandler.removeInputAction(fS.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(fS.LEFT_DOUBLE_CLICK);const t=this.dataSources,n=t.length;for(e=0;e<n;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),Object(l.a)(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),Object(l.a)(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),Object(l.a)(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),Object(l.a)(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),Object(l.a)(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),Object(l.a)(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),Object(l.a)(this._timeline)&&(this._timeline.removeEventListener("settime",UGe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),Object(l.a)(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),Object(l.a)(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),Object(l.a)(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),Object(l.a)(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),sc(this)},KGe.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(KGe.prototype._onEntityCollectionChanged,this)},KGe.prototype._dataSourceRemoved=function(e,t){const n=t.entities;n.collectionChanged.removeEventListener(KGe.prototype._onEntityCollectionChanged,this),Object(l.a)(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),Object(l.a)(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},KGe.prototype._onTick=function(e){const t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=n);const i=this._entityView;if(Object(l.a)(i)){const e=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(e,!1,kGe)===XP.DONE&&i.update(t,kGe)}let r,o=!1;const a=this.selectedEntity,s=Object(l.a)(a)&&this._enableInfoOrSelection;if(s&&a.isShowing&&a.isAvailable(t)){this._dataSourceDisplay.getBoundingSphere(a,!0,kGe)!==XP.FAILED?r=kGe.center:Object(l.a)(a.position)&&(r=a.position.getValue(t,r)),o=Object(l.a)(r)}const u=Object(l.a)(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;Object(l.a)(u)&&(u.position=O.clone(r,u.position),u.showSelection=s&&o,u.update());const h=Object(l.a)(this._infoBox)?this._infoBox.viewModel:void 0;Object(l.a)(h)&&(h.showInfo=s,h.enableCamera=o,h.isCameraTracking=this.trackedEntity===this.selectedEntity,s?(h.titleText=Object(c.a)(a.name,a.id),h.description=JP.getValueOrDefault(a.description,t,"")):(h.titleText="",h.description=""))},KGe.prototype._onEntityCollectionChanged=function(e,t,n){const i=n.length;for(let e=0;e<i;e++){const t=n[e];this.trackedEntity===t&&(this.trackedEntity=void 0),this.selectedEntity===t&&(this.selectedEntity=void 0)}},KGe.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{const e=this.selectedEntity.position;Object(l.a)(e)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},KGe.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},KGe.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},KGe.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},KGe.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&WGe(this.timeline,this.clock,e)},KGe.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);const n=t.entities.id,i=this._eventHelper.add(t.changedEvent,KGe.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i},KGe.prototype._onDataSourceRemoved=function(e,t){const n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){const t=e.length;this._automaticallyTrackDataSourceClocks&&t>0?this.clockTrackedDataSource=e.get(t-1):this.clockTrackedDataSource=void 0}},KGe.prototype.zoomTo=function(e,t){return JGe(this,e,{offset:t},!1)},KGe.prototype.flyTo=function(e,t){return JGe(this,e,t,!0)},KGe.prototype._postRender=function(){!function(e){const t=e._zoomTarget;if(!Object(l.a)(t)||e.scene.mode===AB.MORPHING)return;const n=e.scene,i=n.camera,r=Object(c.a)(e._zoomOptions,{});let o;if(t instanceof qie)return t.readyPromise.then((function(){const n=t.boundingSphere;Object(l.a)(r.offset)||(r.offset=new uA(0,-.5,n.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,o):(i.viewBoundingSphere(n,r.offset),i.lookAtTransform(Me.IDENTITY),e._completeZoom(!0)),ZGe(e)})).catch(()=>{$Ge(e)});if(t instanceof xUe)return t.readyPromise.then((function(){const n=t.boundingSphere;Object(l.a)(r.offset)||(r.offset=new uA(0,-.5,n.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(n,o):(i.viewBoundingSphere(n,r.offset),i.lookAtTransform(Me.IDENTITY),e._completeZoom(!0)),ZGe(e)}));if(t instanceof R)return o={destination:n.mapProjection.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),void ZGe(e);const a=t,s=[];for(let t=0,n=a.length;t<n;t++){const n=e._dataSourceDisplay.getBoundingSphere(a[t],!1,kGe);if(n===XP.PENDING)return;n!==XP.FAILED&&s.push(At.clone(kGe))}if(0===s.length)return void $Ge(e);e.trackedEntity=void 0;const u=At.fromBoundingSpheres(s);e._zoomIsFlight?(ZGe(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(Me.IDENTITY),ZGe(e),e._completeZoom(!0))}(this),function(e){if(!e._needTrackedEntityUpdate)return;const t=e._trackedEntity,n=e.clock.currentTime,i=JP.getValueOrUndefined(t.position,n);if(!Object(l.a)(i))return;const r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,kGe);if(o===XP.PENDING)return;const a=r.mode;a!==AB.COLUMBUS_VIEW&&a!==AB.SCENE2D||(r.screenSpaceCameraController.enableTranslate=!1);a!==AB.COLUMBUS_VIEW&&a!==AB.SCENE3D||(r.screenSpaceCameraController.enableTilt=!1);const s=o!==XP.FAILED?kGe:void 0;e._entityView=new gde(t,r,r.mapProjection.ellipsoid),e._entityView.update(n,s),e._needTrackedEntityUpdate=!1}(this)};var QGe=KGe;var eqe=function(e){s.a.typeOf.object("viewer",e);const t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);const n=new dHe(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})};var tqe=function(e){if(!Object(l.a)(e))throw new u.a("viewer is required.");const t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);const n=new bHe(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})};function nqe(e){e.stopPropagation(),e.preventDefault()}function iqe(e,t){const n=e;Object(l.a)(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",nqe,!1),n.removeEventListener("dragover",nqe,!1),n.removeEventListener("dragexit",nqe,!1))}function rqe(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",nqe,!1),e.addEventListener("dragover",nqe,!1),e.addEventListener("dragexit",nqe,!1)}function oqe(e,t,n,i){const r=e.scene;return function(o){const a=t.name;try{let s;if(/\.czml$/i.test(a))s=tce.load(JSON.parse(o.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=Fge.load(JSON.parse(o.target.result),{sourceUri:a,clampToGround:i});else if(/\.(kml|kmz)$/i.test(a))s=Vbe.load(t,{sourceUri:a,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else{if(!/\.gpx$/i.test(a))return void e.dropError.raiseEvent(e,a,"Unrecognized file: "+a);s=pye.load(t,{sourceUri:a,proxy:n})}Object(l.a)(s)&&e.dataSources.add(s).then((function(t){e.flyToOnDrop&&e.flyTo(t)})).catch((function(t){e.dropError.raiseEvent(e,a,t)}))}catch(t){e.dropError.raiseEvent(e,a,t)}}}function aqe(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var sqe=function(e,t){if(!Object(l.a)(e))throw new u.a("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new u.a("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new u.a("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new u.a("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new u.a("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new u.a("flyToOnDrop is already defined by another mixin.");t=Object(c.a)(t,c.a.EMPTY_OBJECT);let n=!0,i=Object(c.a)(t.flyToOnDrop,!0);const r=new un.a;let o=Object(c.a)(t.clearOnDrop,!0),a=Object(c.a)(t.dropTarget,e.container),s=Object(c.a)(t.clampToGround,!0),h=t.proxy;function d(t){nqe(t),o&&(e.entities.removeAll(),e.dataSources.removeAll());const n=t.dataTransfer.files,i=n.length;for(let t=0;t<i;t++){const i=n[t],r=new FileReader;r.onload=oqe(e,i,h,s),r.onerror=aqe(e,i),r.readAsText(i)}}a=gye(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(e){if(!Object(l.a)(e))throw new u.a("value is required.");iqe(a,d),a=e,rqe(a,d)}},dropEnabled:{get:function(){return n},set:function(e){e!==n&&(e?rqe(a,d):iqe(a,d),n=e)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(e){o=e}},flyToOnDrop:{get:function(){return i},set:function(e){i=e}},proxy:{get:function(){return h},set:function(e){h=e}},clampToGround:{get:function(){return s},set:function(e){s=e}}}),rqe(a,d),e.destroy=FP(e,e.destroy,(function(){e.dropEnabled=!1})),e._handleDrop=d};var cqe=function(e,t){if(!Object(l.a)(e))throw new u.a("viewer is required.");t=Object(c.a)(t,c.a.EMPTY_OBJECT);const n=new eGe({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})};var lqe=function(e){let t;return function(n){const i=n.data,r=[],o={id:i.id,result:void 0,error:void 0};return Promise.resolve(function(e,t,n){let i;try{return i=e(t,n),i}catch(e){return Promise.reject(e)}}(e,i.parameters,r)).then((function(e){o.result=e})).catch((function(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e})).finally((function(){Object(l.a)(t)||(t=Object(c.a)(self.webkitPostMessage,self.postMessage)),i.canTransferArrayBuffer||(r.length=0);try{t(o,r)}catch(e){o.result=void 0,o.error=`postMessage failed with error: ${ul(e)}\n  with responseMessage: ${JSON.stringify(o)}`,t(o)}}))}};const uqe="1.96";var hqe=n(83),dqe=["version","accessToken","baseUrl","author","home_page","init","ready","use","mixin","Namespace","Initialized"];var fqe={version:"2.16.2",accessToken:"",logoImage:"",logoSize:[80,25],baseUrl:"./libs/dc-sdk/resources/",author:"Caven Chen <cavencj@gmail.com>",home_page:"https://www.dvgis.cn",Namespace:{Cesium:o,turf:hqe},Initialized:!1};!function(e){e.mixin=function(t){for(var n in t)dqe.indexOf(n)<0&&(e[n]=t[n]);return this}}(fqe),function(e){e.use=function(e,t){var n=this._installedPlugins||(this._installedPlugins={});if(this._installedPlugins[e.name])return this;var i=[];return t&&i.push(t),i.unshift(this),"function"==typeof e.install?e.install.apply(e,i):"function"==typeof e&&e.apply(null,i),n[e.name]=e,this}}(fqe),fqe.init=function(e){e&&e()};t.default=fqe}]).default}));
public/index.html
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-03-04 15:59:35
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-10-21 14:24:27
 * @LastEditTime: 2022-10-21 15:59:15
 * @FilePath: \sd-jg-school-web\public\index.html
 * @Description: 
 * 
@@ -34,6 +34,9 @@
        }
    </script>
    <!--基础包-->
    <!-- <script src="https://cdn.jsdelivr.net/npm/@dvgis/dc-sdk/dist/dc.base.min.js"></script> -->
    <script src="./depend/dc.base.min.js"></script>
    <script src="./depend/dc.core.min.js"></script>
    <script src="./depend/dc.chart.min.js"></script>
src/App.vue
@@ -1,11 +1,12 @@
<template>
    <div id="app" :class="{ cantdoit: cantdoits }">
    <div ref="appRef" id="app" :class="{ cantdoit: cantdoits }">
        <router-view v-if="isRouterActive"></router-view>
    </div>
</template>
<script>
import AMapLoader from '@amap/amap-jsapi-loader'
import DevicePixelRatio from './utils/devicePixelRatio'
export default {
    name: 'App',
@@ -19,7 +20,9 @@
        }
    },
    created () {
        if (!this._isMobile()) {
            new DevicePixelRatio().init()
        }
    },
    mounted () {
        var transmitData = {}
src/components/leftNav/index.vue
@@ -58,9 +58,9 @@
                    layer: 'leftTagLayer'
                },
                {
                    flag: true,
                    flag: false,
                    label: '道路',
                    img: '/zhjg/img/leftnav/way-checked.png',
                    img: '/zhjg/img/leftnav/way.png',
                    normal: '/zhjg/img/leftnav/way.png',
                    checked: '/zhjg/img/leftnav/way-checked.png',
                    layer: 'leftWayLayer'
@@ -98,9 +98,9 @@
                //     layer: 'leftAedLayer'
                // },
                {
                    flag: true,
                    flag: false,
                    label: '停车',
                    img: '/zhjg/img/leftnav/park-checked.png',
                    img: '/zhjg/img/leftnav/park.png',
                    normal: '/zhjg/img/leftnav/park.png',
                    checked: '/zhjg/img/leftnav/park-checked.png',
                    layer: 'leftParkLayer'
@@ -427,6 +427,8 @@
                    divIcon.attr.params = item
                    LeftNavLayer.leftWayLayer.addOverlay(divIcon)
                    LeftNavLayer.leftWayLayer.show = false
                })
            })
@@ -731,6 +733,8 @@
                    divIcon.attr.params = item
                    LeftNavLayer.leftParkLayer.addOverlay(divIcon)
                    LeftNavLayer.leftParkLayer.show = false
                })
            })
src/components/map/components/dimension.vue
@@ -264,6 +264,8 @@
                    // 最大
                    // global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = maxVH
                    // global.eagleViewer.scene.screenSpaceCameraController.maximumZoomDistance = maxVH + 1000
                    global.viewer.scene.screenSpaceCameraController.maximumZoomDistance = 3500
                    global.eagleViewer.scene.screenSpaceCameraController.maximumZoomDistance = 4500
                    // 设置相机缩小时的速率
                    // global.viewer.scene.screenSpaceCameraController._minimumZoomRate = 2000
src/main.js
@@ -2,8 +2,8 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-09-09 17:54:08
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-09-13 17:36:18
 * @FilePath: \smart-campus\src\main.js
 * @LastEditTime: 2022-10-21 16:45:08
 * @FilePath: \sd-jg-school-web\src\main.js
 * @Description:
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
src/styles/index.scss
@@ -54,22 +54,4 @@
    -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, .9);
    background-color: green;
    /*滚动条的背景颜色*/
}
/* 屏幕分辨率放大为 150 */
@media (-webkit-min-device-pixel-ratio: 1.5),
(min-resolution: 120dpi) {
    .app-main {
        transform: scale(0.665, 0.665);
        /* 缩放数值需要根据效果调试 */
        transform-origin: left top;
    }
}
/* 屏幕分辨率放大为 125 */
@media (-webkit-min-device-pixel-ratio: 1.25) {
    .app-main {
        transform: scale(0.799, 0.799);
        transform-origin: left top;
    }
}
src/utils/devicePixelRatio.js
New file
@@ -0,0 +1,72 @@
/*
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-10-21 16:42:56
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2022-10-21 16:43:01
 * @FilePath: \sd-jg-school-web\src\utils\devicePixelRatio.js
 * @Description:
 *
 * Copyright (c) 2022 by shuishen 1109946754@qq.com, All Rights Reserved.
 */
class DevicePixelRatio {
    constructor() {
        // this.flag = false
    }
    // 获取系统类型
    _getSystem () {
        const flag = false
        var agent = navigator.userAgent.toLowerCase()
        // var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
        // if(isMac) {
        // return false;
        // }
        // 现只针对windows处理,其它系统暂无该情况,如有,继续在此添加
        if (agent.indexOf('windows') >= 0) {
            return true
        }
    }
    // 获取页面缩放比例
    // _getDevicePixelRatio() {
    // let t = this;
    // }
    // 监听方法兼容写法
    _addHandler (element, type, handler) {
        if (element.addEventListener) {
            element.addEventListener(type, handler, false)
        } else if (element.attachEvent) {
            element.attachEvent('on' + type, handler)
        } else {
            element['on' + type] = handler
        }
    }
    // 校正浏览器缩放比例
    _correct () {
        const t = this
        // 页面devicePixelRatio(设备像素比例)变化后,计算页面body标签zoom修改其大小,来抵消devicePixelRatio带来的变化。
        document.getElementsByTagName('body')[0].style.zoom = 1 / window.devicePixelRatio
    }
    // 监听页面缩放
    _watch () {
        const t = this
        t._addHandler(window, 'resize', function () { // 注意这个方法是解决全局有两个window.resize
            // 重新校正
            t._correct()
        })
    }
    // 初始化页面比例
    init () {
        const t = this
        if (t._getSystem()) { // 判断设备,目前只在windows系统下校正浏览器缩放比例
            // 初始化页面校正浏览器缩放比例
            t._correct()
            // 开启监听页面缩放
            t._watch()
        }
    }
}
export default DevicePixelRatio
vue.config.js
@@ -75,12 +75,12 @@
            Vuex: 'Vuex',
            'vue-router': 'VueRouter',
            'element-ui': 'ELEMENT',
            echarts: 'echarts'
            // '@dvgis/dc-sdk/dist/dc.base.min': 'DC',
            // '@dvgis/dc-sdk/dist/dc.core.min': 'DcCore',
            // '@dvgis/dc-sdk/dist/dc.chart.min': 'DcChart',
            // '@dvgis/dc-sdk/dist/dc.mapv.min': 'DcMapv',
            // '@dvgis/dc-sdk/dist/dc.s3m.min': 'DcS3M'
            echarts: 'echarts',
            '@dvgis/dc-sdk/dist/dc.base.min': 'DC',
            '@dvgis/dc-sdk/dist/dc.core.min': 'DcCore',
            '@dvgis/dc-sdk/dist/dc.chart.min': 'DcChart',
            '@dvgis/dc-sdk/dist/dc.mapv.min': 'DcMapv',
            '@dvgis/dc-sdk/dist/dc.s3m.min': 'DcS3M'
        },
        // webpack plugins
        plugins: [