ow-eengine-power 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  (function(pt,Rt){typeof exports=="object"&&typeof module<"u"?Rt(exports):typeof define=="function"&&define.amd?define(["exports"],Rt):(pt=typeof globalThis<"u"?globalThis:pt||self,Rt(pt.OW_EEngine_Power={}))})(this,function(pt){"use strict";var UA=Object.defineProperty;var kA=(pt,Rt,h)=>Rt in pt?UA(pt,Rt,{enumerable:!0,configurable:!0,writable:!0,value:h}):pt[Rt]=h;var he=(pt,Rt,h)=>kA(pt,typeof Rt!="symbol"?Rt+"":Rt,h);var Rt=typeof document<"u"?document.currentScript:null;function h(e){return e!=null}function C(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}h(Object.create)&&(C.prototype=Object.create(Error.prototype),C.prototype.constructor=C),C.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return h(this.stack)&&(e+=`
2
- ${this.stack.toString()}`),e},C.throwInstantiationError=function(){throw new C("This function defines an interface and should not be called directly.")};const m={};m.typeOf={};function L0(e){return`${e} is required, actual value was undefined`}function mo(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}m.defined=function(e,t){if(!h(t))throw new C(L0(e))},m.typeOf.func=function(e,t){if(typeof t!="function")throw new C(mo(typeof t,"function",e))},m.typeOf.string=function(e,t){if(typeof t!="string")throw new C(mo(typeof t,"string",e))},m.typeOf.number=function(e,t){if(typeof t!="number")throw new C(mo(typeof t,"number",e))},m.typeOf.number.lessThan=function(e,t,n){if(m.typeOf.number(e,t),t>=n)throw new C(`Expected ${e} to be less than ${n}, actual value was ${t}`)},m.typeOf.number.lessThanOrEquals=function(e,t,n){if(m.typeOf.number(e,t),t>n)throw new C(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},m.typeOf.number.greaterThan=function(e,t,n){if(m.typeOf.number(e,t),t<=n)throw new C(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},m.typeOf.number.greaterThanOrEquals=function(e,t,n){if(m.typeOf.number(e,t),t<n)throw new C(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},m.typeOf.object=function(e,t){if(typeof t!="object")throw new C(mo(typeof t,"object",e))},m.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(mo(typeof t,"boolean",e))},m.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(mo(typeof t,"bigint",e))},m.typeOf.number.equals=function(e,t,n,i){if(m.typeOf.number(e,n),m.typeOf.number(t,i),n!==i)throw new C(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};function _(e,t){return e??t}_.EMPTY_OBJECT=Object.freeze({});var _o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ri=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};ri.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},ri.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},ri.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},ri.prototype.random_int31=function(){return this.random_int()>>>1},ri.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},ri.prototype.random=function(){return this.random_int()*(1/4294967296)},ri.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},ri.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};var M0=ri;const mh=rs(M0),S={};S.EPSILON1=.1,S.EPSILON2=.01,S.EPSILON3=.001,S.EPSILON4=1e-4,S.EPSILON5=1e-5,S.EPSILON6=1e-6,S.EPSILON7=1e-7,S.EPSILON8=1e-8,S.EPSILON9=1e-9,S.EPSILON10=1e-10,S.EPSILON11=1e-11,S.EPSILON12=1e-12,S.EPSILON13=1e-13,S.EPSILON14=1e-14,S.EPSILON15=1e-15,S.EPSILON16=1e-16,S.EPSILON17=1e-17,S.EPSILON18=1e-18,S.EPSILON19=1e-19,S.EPSILON20=1e-20,S.EPSILON21=1e-21,S.GRAVITATIONALPARAMETER=3986004418e5,S.SOLAR_RADIUS=6955e5,S.LUNAR_RADIUS=1737400,S.SIXTY_FOUR_KILOBYTES=64*1024,S.FOUR_GIGABYTES=4*1024*1024*1024,S.sign=_(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1}),S.signNotZero=function(e){return e<0?-1:1},S.toSNorm=function(e,t){return t=_(t,255),Math.round((S.clamp(e,-1,1)*.5+.5)*t)},S.fromSNorm=function(e,t){return t=_(t,255),S.clamp(e,0,t)/t*2-1},S.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:S.clamp((e-t)/n,0,1)},S.sinh=_(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),S.cosh=_(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),S.lerp=function(e,t,n){return(1-n)*e+n*t},S.PI=Math.PI,S.ONE_OVER_PI=1/Math.PI,S.PI_OVER_TWO=Math.PI/2,S.PI_OVER_THREE=Math.PI/3,S.PI_OVER_FOUR=Math.PI/4,S.PI_OVER_SIX=Math.PI/6,S.THREE_PI_OVER_TWO=3*Math.PI/2,S.TWO_PI=2*Math.PI,S.ONE_OVER_TWO_PI=1/(2*Math.PI),S.RADIANS_PER_DEGREE=Math.PI/180,S.DEGREES_PER_RADIAN=180/Math.PI,S.RADIANS_PER_ARCSECOND=S.RADIANS_PER_DEGREE/3600,S.toRadians=function(e){if(!h(e))throw new C("degrees is required.");return e*S.RADIANS_PER_DEGREE},S.toDegrees=function(e){if(!h(e))throw new C("radians is required.");return e*S.DEGREES_PER_RADIAN},S.convertLongitudeRange=function(e){if(!h(e))throw new C("angle is required.");const t=S.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},S.clampToLatitudeRange=function(e){if(!h(e))throw new C("angle is required.");return S.clamp(e,-1*S.PI_OVER_TWO,S.PI_OVER_TWO)},S.negativePiToPi=function(e){if(!h(e))throw new C("angle is required.");return e>=-S.PI&&e<=S.PI?e:S.zeroToTwoPi(e+S.PI)-S.PI},S.zeroToTwoPi=function(e){if(!h(e))throw new C("angle is required.");if(e>=0&&e<=S.TWO_PI)return e;const t=S.mod(e,S.TWO_PI);return Math.abs(t)<S.EPSILON14&&Math.abs(e)>S.EPSILON14?S.TWO_PI:t},S.mod=function(e,t){if(!h(e))throw new C("m is required.");if(!h(t))throw new C("n is required.");if(t===0)throw new C("divisor cannot be 0.");return S.sign(e)===S.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t},S.equalsEpsilon=function(e,t,n,i){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");n=_(n,0),i=_(i,n);const o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))},S.lessThan=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t<-n},S.lessThanOrEquals=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t<n},S.greaterThan=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t>n},S.greaterThanOrEquals=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t>-n};const ss=[1];S.factorial=function(e){if(typeof e!="number"||e<0)throw new C("A number greater than or equal to 0 is required.");const t=ss.length;if(e>=t){let n=ss[t-1];for(let i=t;i<=e;i++){const o=n*i;ss.push(o),n=o}}return ss[e]},S.incrementWrap=function(e,t,n){if(n=_(n,0),!h(e))throw new C("n is required.");if(t<=n)throw new C("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e},S.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0},S.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new C("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},S.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e},S.clamp=function(e,t,n){return m.typeOf.number("value",e),m.typeOf.number("min",t),m.typeOf.number("max",n),e<t?t:e>n?n:e};let _h=new mh;S.setRandomNumberSeed=function(e){if(!h(e))throw new C("seed is required.");_h=new mh(e)},S.nextRandomNumber=function(){return _h.random()},S.randomBetween=function(e,t){return S.nextRandomNumber()*(t-e)+e},S.acosClamped=function(e){if(!h(e))throw new C("value is required.");return Math.acos(S.clamp(e,-1,1))},S.asinClamped=function(e){if(!h(e))throw new C("value is required.");return Math.asin(S.clamp(e,-1,1))},S.chordLength=function(e,t){if(!h(e))throw new C("angle is required.");if(!h(t))throw new C("radius is required.");return 2*t*Math.sin(e*.5)},S.logBase=function(e,t){if(!h(e))throw new C("number is required.");if(!h(t))throw new C("base is required.");return Math.log(e)/Math.log(t)},S.cbrt=_(Math.cbrt,function(t){const n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n}),S.log2=_(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),S.fog=function(e,t){const n=e*t;return 1-Math.exp(-(n*n))},S.fastApproximateAtan=function(e){return m.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},S.fastApproximateAtan2=function(e,t){m.typeOf.number("x",e),m.typeOf.number("y",t);let n,i=Math.abs(e);n=Math.abs(t);const o=Math.max(i,n);n=Math.min(i,n);const s=n/o;if(isNaN(s))throw new C("either x or y must be nonzero");return i=S.fastApproximateAtan(s),i=Math.abs(t)>Math.abs(e)?S.PI_OVER_TWO-i:i,i=e<0?S.PI-i:i,i=t<0?-i:i,i};function f(e,t,n){this.x=_(e,0),this.y=_(t,0),this.z=_(n,0)}f.fromSpherical=function(e,t){m.typeOf.object("spherical",e),h(t)||(t=new f);const n=e.clock,i=e.cone,o=_(e.magnitude,1),s=o*Math.sin(i);return t.x=s*Math.cos(n),t.y=s*Math.sin(n),t.z=o*Math.cos(i),t},f.fromElements=function(e,t,n,i){return h(i)?(i.x=e,i.y=t,i.z=n,i):new f(e,t,n)},f.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new f(e.x,e.y,e.z)},f.fromCartesian4=f.clone,f.packedLength=3,f.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},f.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new f),n.x=e[t++],n.y=e[t++],n.z=e[t],n},f.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*3;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)f.pack(e[o],t,o*3);return t},f.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new C("array length must be a multiple of 3.");const n=e.length;h(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){const o=i/3;t[o]=f.unpack(e,i,t[o])}return t},f.fromArray=f.unpack,f.maximumComponent=function(e){return m.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},f.minimumComponent=function(e){return m.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},f.minimumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},f.maximumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},f.clamp=function(e,t,n,i){m.typeOf.object("value",e),m.typeOf.object("min",t),m.typeOf.object("max",n),m.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),a=S.clamp(e.z,t.z,n.z);return i.x=o,i.y=s,i.z=a,i},f.magnitudeSquared=function(e){return m.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},f.magnitude=function(e){return Math.sqrt(f.magnitudeSquared(e))};const as=new f;f.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,as),f.magnitude(as)},f.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,as),f.magnitudeSquared(as)},f.normalize=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.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 C("normalized result is not a number");return t},f.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},f.multiplyComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},f.divideComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},f.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},f.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},f.multiplyByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},f.divideByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},f.negate=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},f.abs=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const gh=new f;f.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),f.multiplyByScalar(t,n,gh),i=f.multiplyByScalar(e,1-n,i),f.add(gh,i,i)};const cs=new f,za=new f;f.angleBetween=function(e,t){m.typeOf.object("left",e),m.typeOf.object("right",t),f.normalize(e,cs),f.normalize(t,za);const n=f.dot(cs,za),i=f.magnitude(f.cross(cs,za,cs));return Math.atan2(i,n)};const U0=new f;f.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.normalize(e,U0);return f.abs(n,n),n.x<=n.y?n.x<=n.z?t=f.clone(f.UNIT_X,t):t=f.clone(f.UNIT_Z,t):n.y<=n.z?t=f.clone(f.UNIT_Y,t):t=f.clone(f.UNIT_Z,t),t},f.projectVector=function(e,t,n){m.defined("a",e),m.defined("b",t),m.defined("result",n);const i=f.dot(e,t)/f.dot(t,t);return f.multiplyByScalar(t,i,n)},f.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},f.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},f.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)},f.cross=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e.x,o=e.y,s=e.z,a=t.x,c=t.y,l=t.z,u=o*l-s*c,d=s*a-i*l,p=i*c-o*a;return n.x=u,n.y=d,n.z=p,n},f.midpoint=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n},f.fromDegrees=function(e,t,n,i,o){return m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),f.fromRadians(e,t,n,i,o)};let gn=new f,go=new f;f._ellipsoidRadiiSquared=new f(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),f.fromRadians=function(e,t,n,i,o){m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),n=_(n,0);const s=h(i)?i.radiiSquared:f._ellipsoidRadiiSquared,a=Math.cos(t);gn.x=a*Math.cos(e),gn.y=a*Math.sin(e),gn.z=Math.sin(t),gn=f.normalize(gn,gn),f.multiplyComponents(s,gn,go);const c=Math.sqrt(f.dot(gn,go));return go=f.divideByScalar(go,c,go),gn=f.multiplyByScalar(gn,n,gn),h(o)||(o=new f),f.add(go,gn,o)},f.fromDegreesArray=function(e,t,n){if(m.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;h(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const s=e[o],a=e[o+1],c=o/2;n[c]=f.fromDegrees(s,a,0,t,n[c])}return n},f.fromRadiansArray=function(e,t,n){if(m.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;h(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const s=e[o],a=e[o+1],c=o/2;n[c]=f.fromRadians(s,a,0,t,n[c])}return n},f.fromDegreesArrayHeights=function(e,t,n){if(m.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;h(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const s=e[o],a=e[o+1],c=e[o+2],l=o/3;n[l]=f.fromDegrees(s,a,c,t,n[l])}return n},f.fromRadiansArrayHeights=function(e,t,n){if(m.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;h(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const s=e[o],a=e[o+1],c=e[o+2],l=o/3;n[l]=f.fromRadians(s,a,c,t,n[l])}return n},f.ZERO=Object.freeze(new f(0,0,0)),f.ONE=Object.freeze(new f(1,1,1)),f.UNIT_X=Object.freeze(new f(1,0,0)),f.UNIT_Y=Object.freeze(new f(0,1,0)),f.UNIT_Z=Object.freeze(new f(0,0,1)),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t,n){return f.equalsEpsilon(this,e,t,n)},f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function Y(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.z=_(n,0),this.w=_(i,0)}Y.fromElements=function(e,t,n,i,o){return h(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Y(e,t,n,i)},Y.fromColor=function(e,t){return m.typeOf.object("color",e),h(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Y(e.red,e.green,e.blue,e.alpha)},Y.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Y(e.x,e.y,e.z,e.w)},Y.packedLength=4,Y.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Y.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Y),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},Y.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*4;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Y.pack(e[o],t,o*4);return t},Y.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;h(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=Y.unpack(e,i,t[o])}return t},Y.fromArray=Y.unpack,Y.maximumComponent=function(e){return m.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},Y.minimumComponent=function(e){return m.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},Y.minimumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},Y.maximumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},Y.clamp=function(e,t,n,i){m.typeOf.object("value",e),m.typeOf.object("min",t),m.typeOf.object("max",n),m.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),a=S.clamp(e.z,t.z,n.z),c=S.clamp(e.w,t.w,n.w);return i.x=o,i.y=s,i.z=a,i.w=c,i},Y.magnitudeSquared=function(e){return m.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Y.magnitude=function(e){return Math.sqrt(Y.magnitudeSquared(e))};const ls=new Y;Y.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,ls),Y.magnitude(ls)},Y.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,ls),Y.magnitudeSquared(ls)},Y.normalize=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=Y.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 C("normalized result is not a number");return t},Y.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Y.multiplyComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.divideComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.multiplyByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.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},Y.divideByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.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},Y.negate=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Y.abs=function(e,t){return m.typeOf.object("cartesian",e),m.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 yh=new Y;Y.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),Y.multiplyByScalar(t,n,yh),i=Y.multiplyByScalar(e,1-n,i),Y.add(yh,i,i)};const k0=new Y;Y.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=Y.normalize(e,k0);return Y.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Y.clone(Y.UNIT_X,t):t=Y.clone(Y.UNIT_W,t):n.z<=n.w?t=Y.clone(Y.UNIT_Z,t):t=Y.clone(Y.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Y.clone(Y.UNIT_Y,t):t=Y.clone(Y.UNIT_W,t):n.z<=n.w?t=Y.clone(Y.UNIT_Z,t):t=Y.clone(Y.UNIT_W,t),t},Y.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Y.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]},Y.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)&&S.equalsEpsilon(e.w,t.w,n,i)},Y.ZERO=Object.freeze(new Y(0,0,0,0)),Y.ONE=Object.freeze(new Y(1,1,1,1)),Y.UNIT_X=Object.freeze(new Y(1,0,0,0)),Y.UNIT_Y=Object.freeze(new Y(0,1,0,0)),Y.UNIT_Z=Object.freeze(new Y(0,0,1,0)),Y.UNIT_W=Object.freeze(new Y(0,0,0,1)),Y.prototype.clone=function(e){return Y.clone(this,e)},Y.prototype.equals=function(e){return Y.equals(this,e)},Y.prototype.equalsEpsilon=function(e,t,n){return Y.equalsEpsilon(this,e,t,n)},Y.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Pa=new Float32Array(1),Vt=new Uint8Array(Pa.buffer),V0=new Uint32Array([287454020]),xh=new Uint8Array(V0.buffer)[0]===68;Y.packFloat=function(e,t){return m.typeOf.number("value",e),h(t)||(t=new Y),Pa[0]=e,xh?(t.x=Vt[0],t.y=Vt[1],t.z=Vt[2],t.w=Vt[3]):(t.x=Vt[3],t.y=Vt[2],t.z=Vt[1],t.w=Vt[0]),t},Y.unpackFloat=function(e){return m.typeOf.object("packedFloat",e),xh?(Vt[0]=e.x,Vt[1]=e.y,Vt[2]=e.z,Vt[3]=e.w):(Vt[0]=e.w,Vt[1]=e.z,Vt[2]=e.y,Vt[3]=e.x),Pa[0]};function L(e,t,n,i,o,s,a,c,l){this[0]=_(e,0),this[1]=_(i,0),this[2]=_(a,0),this[3]=_(t,0),this[4]=_(o,0),this[5]=_(c,0),this[6]=_(n,0),this[7]=_(s,0),this[8]=_(l,0)}L.packedLength=9,L.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(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},L.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new L),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},L.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*9;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)L.pack(e[o],t,o*9);return t},L.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new C("array length must be a multiple of 9.");const n=e.length;h(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){const o=i/9;t[o]=L.unpack(e,i,t[o])}return t},L.clone=function(e,t){if(h(e))return h(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 L(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},L.fromArray=L.unpack,L.fromColumnMajorArray=function(e,t){return m.defined("values",e),L.clone(e,t)},L.fromRowMajorArray=function(e,t){return m.defined("values",e),h(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 L(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},L.fromQuaternion=function(e,t){m.typeOf.object("quaternion",e);const n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,s=e.x*e.w,a=e.y*e.y,c=e.y*e.z,l=e.y*e.w,u=e.z*e.z,d=e.z*e.w,p=e.w*e.w,g=n-a-u+p,y=2*(i-d),x=2*(o+l),E=2*(i+d),b=-n+a-u+p,D=2*(c-s),A=2*(o-l),O=2*(c+s),I=-n-a+u+p;return h(t)?(t[0]=g,t[1]=E,t[2]=A,t[3]=y,t[4]=b,t[5]=O,t[6]=x,t[7]=D,t[8]=I,t):new L(g,y,x,E,b,D,A,O,I)},L.fromHeadingPitchRoll=function(e,t){m.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),s=Math.sin(-e.pitch),a=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*i,u=-o*a+c*s*i,d=c*a+o*s*i,p=n*a,g=o*i+c*s*a,y=-c*i+o*s*a,x=-s,E=c*n,b=o*n;return h(t)?(t[0]=l,t[1]=p,t[2]=x,t[3]=u,t[4]=g,t[5]=E,t[6]=d,t[7]=y,t[8]=b,t):new L(l,u,d,p,g,y,x,E,b)},L.fromScale=function(e,t){return m.typeOf.object("scale",e),h(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 L(e.x,0,0,0,e.y,0,0,0,e.z)},L.fromUniformScale=function(e,t){return m.typeOf.number("scale",e),h(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 L(e,0,0,0,e,0,0,0,e)},L.fromCrossProduct=function(e,t){return m.typeOf.object("vector",e),h(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 L(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},L.fromRotationX=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(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 L(1,0,0,0,n,-i,0,i,n)},L.fromRotationY=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(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 L(n,0,i,0,1,0,-i,0,n)},L.fromRotationZ=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(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 L(n,-i,0,i,n,0,0,0,1)},L.toArray=function(e,t){return m.typeOf.object("matrix",e),h(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]]},L.getElementIndex=function(e,t){return m.typeOf.number.greaterThanOrEquals("row",t,0),m.typeOf.number.lessThanOrEquals("row",t,2),m.typeOf.number.greaterThanOrEquals("column",e,0),m.typeOf.number.lessThanOrEquals("column",e,2),e*3+t},L.getColumn=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("result",n);const i=t*3,o=e[i],s=e[i+1],a=e[i+2];return n.x=o,n.y=s,n.z=a,n},L.setColumn=function(e,t,n,i){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=L.clone(e,i);const o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i},L.getRow=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("result",n);const i=e[t],o=e[t+3],s=e[t+6];return n.x=i,n.y=o,n.z=s,n},L.setRow=function(e,t,n,i){return m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=L.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const G0=new f;L.setScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=L.getScale(e,G0),o=t.x/i.x,s=t.y/i.y,a=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};const q0=new f;L.setUniformScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.typeOf.object("result",n);const i=L.getScale(e,q0),o=t/i.x,s=t/i.y,a=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};const Ba=new f;L.getScale=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t.x=f.magnitude(f.fromElements(e[0],e[1],e[2],Ba)),t.y=f.magnitude(f.fromElements(e[3],e[4],e[5],Ba)),t.z=f.magnitude(f.fromElements(e[6],e[7],e[8],Ba)),t};const Ch=new f;L.getMaximumScale=function(e){return L.getScale(e,Ch),f.maximumComponent(Ch)};const H0=new f;L.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=L.getScale(e,H0);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 W0=new f;L.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=L.getScale(e,W0);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},L.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],s=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],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],p=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=s,n[3]=a,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=p,n},L.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},L.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},L.multiplyByVector=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z,a=e[0]*i+e[3]*o+e[6]*s,c=e[1]*i+e[4]*o+e[7]*s,l=e[2]*i+e[5]*o+e[8]*s;return n.x=a,n.y=c,n.z=l,n},L.multiplyByScalar=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scalar",t),m.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},L.multiplyByScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.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},L.multiplyByUniformScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.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},L.negate=function(e,t){return m.typeOf.object("matrix",e),m.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},L.transpose=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[3],o=e[6],s=e[1],a=e[4],c=e[7],l=e[2],u=e[5],d=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t};function j0(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}const Na=[1,0,0],Fa=[2,2,1];function Y0(e){let t=0;for(let n=0;n<3;++n){const i=e[L.getElementIndex(Fa[n],Na[n])];t+=2*i*i}return Math.sqrt(t)}function X0(e,t){const n=S.EPSILON15;let i=0,o=1;for(let u=0;u<3;++u){const d=Math.abs(e[L.getElementIndex(Fa[u],Na[u])]);d>i&&(o=u,i=d)}let s=1,a=0;const c=Na[o],l=Fa[o];if(Math.abs(e[L.getElementIndex(l,c)])>n){const u=e[L.getElementIndex(l,l)],d=e[L.getElementIndex(c,c)],p=e[L.getElementIndex(l,c)],g=(u-d)/2/p;let y;g<0?y=-1/(-g+Math.sqrt(1+g*g)):y=1/(g+Math.sqrt(1+g*g)),s=1/Math.sqrt(1+y*y),a=y*s}return t=L.clone(L.IDENTITY,t),t[L.getElementIndex(c,c)]=t[L.getElementIndex(l,l)]=s,t[L.getElementIndex(l,c)]=a,t[L.getElementIndex(c,l)]=-a,t}const hs=new L,Eh=new L;L.computeEigenDecomposition=function(e,t){m.typeOf.object("matrix",e);const n=S.EPSILON20,i=10;let o=0,s=0;h(t)||(t={});const a=t.unitary=L.clone(L.IDENTITY,t.unitary),c=t.diagonal=L.clone(e,t.diagonal),l=n*j0(c);for(;s<i&&Y0(c)>l;)X0(c,hs),L.transpose(hs,Eh),L.multiply(c,hs,c),L.multiply(Eh,c,c),L.multiply(a,hs,a),++o>2&&(++s,o=0);return t},L.abs=function(e,t){return m.typeOf.object("matrix",e),m.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},L.determinant=function(e){m.typeOf.object("matrix",e);const t=e[0],n=e[3],i=e[6],o=e[1],s=e[4],a=e[7],c=e[2],l=e[5],u=e[8];return t*(s*u-l*a)+o*(l*i-n*u)+c*(n*a-s*i)},L.inverse=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],d=e[8],p=L.determinant(e);if(Math.abs(p)<=S.EPSILON15)throw new C("matrix is not invertible");t[0]=a*d-u*c,t[1]=u*o-i*d,t[2]=i*c-a*o,t[3]=l*c-s*d,t[4]=n*d-l*o,t[5]=s*o-n*c,t[6]=s*u-l*a,t[7]=l*i-n*u,t[8]=n*a-s*i;const g=1/p;return L.multiplyByScalar(t,g,t)};const $0=new L;L.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),L.inverse(L.transpose(e,$0),t)},L.equals=function(e,t){return e===t||h(e)&&h(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]},L.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},L.IDENTITY=Object.freeze(new L(1,0,0,0,1,0,0,0,1)),L.ZERO=Object.freeze(new L(0,0,0,0,0,0,0,0,0)),L.COLUMN0ROW0=0,L.COLUMN0ROW1=1,L.COLUMN0ROW2=2,L.COLUMN1ROW0=3,L.COLUMN1ROW1=4,L.COLUMN1ROW2=5,L.COLUMN2ROW0=6,L.COLUMN2ROW1=7,L.COLUMN2ROW2=8,Object.defineProperties(L.prototype,{length:{get:function(){return L.packedLength}}}),L.prototype.clone=function(e){return L.clone(this,e)},L.prototype.equals=function(e){return L.equals(this,e)},L.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]},L.prototype.equalsEpsilon=function(e,t){return L.equalsEpsilon(this,e,t)},L.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
2
+ ${this.stack.toString()}`),e},C.throwInstantiationError=function(){throw new C("This function defines an interface and should not be called directly.")};const m={};m.typeOf={};function L0(e){return`${e} is required, actual value was undefined`}function mo(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}m.defined=function(e,t){if(!h(t))throw new C(L0(e))},m.typeOf.func=function(e,t){if(typeof t!="function")throw new C(mo(typeof t,"function",e))},m.typeOf.string=function(e,t){if(typeof t!="string")throw new C(mo(typeof t,"string",e))},m.typeOf.number=function(e,t){if(typeof t!="number")throw new C(mo(typeof t,"number",e))},m.typeOf.number.lessThan=function(e,t,n){if(m.typeOf.number(e,t),t>=n)throw new C(`Expected ${e} to be less than ${n}, actual value was ${t}`)},m.typeOf.number.lessThanOrEquals=function(e,t,n){if(m.typeOf.number(e,t),t>n)throw new C(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)},m.typeOf.number.greaterThan=function(e,t,n){if(m.typeOf.number(e,t),t<=n)throw new C(`Expected ${e} to be greater than ${n}, actual value was ${t}`)},m.typeOf.number.greaterThanOrEquals=function(e,t,n){if(m.typeOf.number(e,t),t<n)throw new C(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)},m.typeOf.object=function(e,t){if(typeof t!="object")throw new C(mo(typeof t,"object",e))},m.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(mo(typeof t,"boolean",e))},m.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(mo(typeof t,"bigint",e))},m.typeOf.number.equals=function(e,t,n,i){if(m.typeOf.number(e,n),m.typeOf.number(t,i),n!==i)throw new C(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};function _(e,t){return e??t}_.EMPTY_OBJECT=Object.freeze({});var _o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var si=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};si.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},si.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1566083941<<16)+(s&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648},si.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},si.prototype.random_int31=function(){return this.random_int()>>>1},si.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},si.prototype.random=function(){return this.random_int()*(1/4294967296)},si.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},si.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};var M0=si;const mh=rs(M0),S={};S.EPSILON1=.1,S.EPSILON2=.01,S.EPSILON3=.001,S.EPSILON4=1e-4,S.EPSILON5=1e-5,S.EPSILON6=1e-6,S.EPSILON7=1e-7,S.EPSILON8=1e-8,S.EPSILON9=1e-9,S.EPSILON10=1e-10,S.EPSILON11=1e-11,S.EPSILON12=1e-12,S.EPSILON13=1e-13,S.EPSILON14=1e-14,S.EPSILON15=1e-15,S.EPSILON16=1e-16,S.EPSILON17=1e-17,S.EPSILON18=1e-18,S.EPSILON19=1e-19,S.EPSILON20=1e-20,S.EPSILON21=1e-21,S.GRAVITATIONALPARAMETER=3986004418e5,S.SOLAR_RADIUS=6955e5,S.LUNAR_RADIUS=1737400,S.SIXTY_FOUR_KILOBYTES=64*1024,S.FOUR_GIGABYTES=4*1024*1024*1024,S.sign=_(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1}),S.signNotZero=function(e){return e<0?-1:1},S.toSNorm=function(e,t){return t=_(t,255),Math.round((S.clamp(e,-1,1)*.5+.5)*t)},S.fromSNorm=function(e,t){return t=_(t,255),S.clamp(e,0,t)/t*2-1},S.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:S.clamp((e-t)/n,0,1)},S.sinh=_(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2}),S.cosh=_(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2}),S.lerp=function(e,t,n){return(1-n)*e+n*t},S.PI=Math.PI,S.ONE_OVER_PI=1/Math.PI,S.PI_OVER_TWO=Math.PI/2,S.PI_OVER_THREE=Math.PI/3,S.PI_OVER_FOUR=Math.PI/4,S.PI_OVER_SIX=Math.PI/6,S.THREE_PI_OVER_TWO=3*Math.PI/2,S.TWO_PI=2*Math.PI,S.ONE_OVER_TWO_PI=1/(2*Math.PI),S.RADIANS_PER_DEGREE=Math.PI/180,S.DEGREES_PER_RADIAN=180/Math.PI,S.RADIANS_PER_ARCSECOND=S.RADIANS_PER_DEGREE/3600,S.toRadians=function(e){if(!h(e))throw new C("degrees is required.");return e*S.RADIANS_PER_DEGREE},S.toDegrees=function(e){if(!h(e))throw new C("radians is required.");return e*S.DEGREES_PER_RADIAN},S.convertLongitudeRange=function(e){if(!h(e))throw new C("angle is required.");const t=S.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},S.clampToLatitudeRange=function(e){if(!h(e))throw new C("angle is required.");return S.clamp(e,-1*S.PI_OVER_TWO,S.PI_OVER_TWO)},S.negativePiToPi=function(e){if(!h(e))throw new C("angle is required.");return e>=-S.PI&&e<=S.PI?e:S.zeroToTwoPi(e+S.PI)-S.PI},S.zeroToTwoPi=function(e){if(!h(e))throw new C("angle is required.");if(e>=0&&e<=S.TWO_PI)return e;const t=S.mod(e,S.TWO_PI);return Math.abs(t)<S.EPSILON14&&Math.abs(e)>S.EPSILON14?S.TWO_PI:t},S.mod=function(e,t){if(!h(e))throw new C("m is required.");if(!h(t))throw new C("n is required.");if(t===0)throw new C("divisor cannot be 0.");return S.sign(e)===S.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t},S.equalsEpsilon=function(e,t,n,i){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");n=_(n,0),i=_(i,n);const o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))},S.lessThan=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t<-n},S.lessThanOrEquals=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t<n},S.greaterThan=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t>n},S.greaterThanOrEquals=function(e,t,n){if(!h(e))throw new C("first is required.");if(!h(t))throw new C("second is required.");if(!h(n))throw new C("absoluteEpsilon is required.");return e-t>-n};const ss=[1];S.factorial=function(e){if(typeof e!="number"||e<0)throw new C("A number greater than or equal to 0 is required.");const t=ss.length;if(e>=t){let n=ss[t-1];for(let i=t;i<=e;i++){const o=n*i;ss.push(o),n=o}}return ss[e]},S.incrementWrap=function(e,t,n){if(n=_(n,0),!h(e))throw new C("n is required.");if(t<=n)throw new C("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e},S.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0},S.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new C("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},S.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e},S.clamp=function(e,t,n){return m.typeOf.number("value",e),m.typeOf.number("min",t),m.typeOf.number("max",n),e<t?t:e>n?n:e};let _h=new mh;S.setRandomNumberSeed=function(e){if(!h(e))throw new C("seed is required.");_h=new mh(e)},S.nextRandomNumber=function(){return _h.random()},S.randomBetween=function(e,t){return S.nextRandomNumber()*(t-e)+e},S.acosClamped=function(e){if(!h(e))throw new C("value is required.");return Math.acos(S.clamp(e,-1,1))},S.asinClamped=function(e){if(!h(e))throw new C("value is required.");return Math.asin(S.clamp(e,-1,1))},S.chordLength=function(e,t){if(!h(e))throw new C("angle is required.");if(!h(t))throw new C("radius is required.");return 2*t*Math.sin(e*.5)},S.logBase=function(e,t){if(!h(e))throw new C("number is required.");if(!h(t))throw new C("base is required.");return Math.log(e)/Math.log(t)},S.cbrt=_(Math.cbrt,function(t){const n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n}),S.log2=_(Math.log2,function(t){return Math.log(t)*Math.LOG2E}),S.fog=function(e,t){const n=e*t;return 1-Math.exp(-(n*n))},S.fastApproximateAtan=function(e){return m.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},S.fastApproximateAtan2=function(e,t){m.typeOf.number("x",e),m.typeOf.number("y",t);let n,i=Math.abs(e);n=Math.abs(t);const o=Math.max(i,n);n=Math.min(i,n);const s=n/o;if(isNaN(s))throw new C("either x or y must be nonzero");return i=S.fastApproximateAtan(s),i=Math.abs(t)>Math.abs(e)?S.PI_OVER_TWO-i:i,i=e<0?S.PI-i:i,i=t<0?-i:i,i};function f(e,t,n){this.x=_(e,0),this.y=_(t,0),this.z=_(n,0)}f.fromSpherical=function(e,t){m.typeOf.object("spherical",e),h(t)||(t=new f);const n=e.clock,i=e.cone,o=_(e.magnitude,1),s=o*Math.sin(i);return t.x=s*Math.cos(n),t.y=s*Math.sin(n),t.z=o*Math.cos(i),t},f.fromElements=function(e,t,n,i){return h(i)?(i.x=e,i.y=t,i.z=n,i):new f(e,t,n)},f.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new f(e.x,e.y,e.z)},f.fromCartesian4=f.clone,f.packedLength=3,f.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t},f.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new f),n.x=e[t++],n.y=e[t++],n.z=e[t],n},f.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*3;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)f.pack(e[o],t,o*3);return t},f.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new C("array length must be a multiple of 3.");const n=e.length;h(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){const o=i/3;t[o]=f.unpack(e,i,t[o])}return t},f.fromArray=f.unpack,f.maximumComponent=function(e){return m.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},f.minimumComponent=function(e){return m.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},f.minimumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},f.maximumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},f.clamp=function(e,t,n,i){m.typeOf.object("value",e),m.typeOf.object("min",t),m.typeOf.object("max",n),m.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),a=S.clamp(e.z,t.z,n.z);return i.x=o,i.y=s,i.z=a,i},f.magnitudeSquared=function(e){return m.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},f.magnitude=function(e){return Math.sqrt(f.magnitudeSquared(e))};const as=new f;f.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,as),f.magnitude(as)},f.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,as),f.magnitudeSquared(as)},f.normalize=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.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 C("normalized result is not a number");return t},f.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},f.multiplyComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},f.divideComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},f.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},f.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},f.multiplyByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},f.divideByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},f.negate=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},f.abs=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};const gh=new f;f.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),f.multiplyByScalar(t,n,gh),i=f.multiplyByScalar(e,1-n,i),f.add(gh,i,i)};const cs=new f,za=new f;f.angleBetween=function(e,t){m.typeOf.object("left",e),m.typeOf.object("right",t),f.normalize(e,cs),f.normalize(t,za);const n=f.dot(cs,za),i=f.magnitude(f.cross(cs,za,cs));return Math.atan2(i,n)};const U0=new f;f.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.normalize(e,U0);return f.abs(n,n),n.x<=n.y?n.x<=n.z?t=f.clone(f.UNIT_X,t):t=f.clone(f.UNIT_Z,t):n.y<=n.z?t=f.clone(f.UNIT_Y,t):t=f.clone(f.UNIT_Z,t),t},f.projectVector=function(e,t,n){m.defined("a",e),m.defined("b",t),m.defined("result",n);const i=f.dot(e,t)/f.dot(t,t);return f.multiplyByScalar(t,i,n)},f.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},f.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},f.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)},f.cross=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e.x,o=e.y,s=e.z,a=t.x,c=t.y,l=t.z,u=o*l-s*c,d=s*a-i*l,p=i*c-o*a;return n.x=u,n.y=d,n.z=p,n},f.midpoint=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n},f.fromDegrees=function(e,t,n,i,o){return m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),f.fromRadians(e,t,n,i,o)};let gn=new f,go=new f;f._ellipsoidRadiiSquared=new f(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),f.fromRadians=function(e,t,n,i,o){m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),n=_(n,0);const s=h(i)?i.radiiSquared:f._ellipsoidRadiiSquared,a=Math.cos(t);gn.x=a*Math.cos(e),gn.y=a*Math.sin(e),gn.z=Math.sin(t),gn=f.normalize(gn,gn),f.multiplyComponents(s,gn,go);const c=Math.sqrt(f.dot(gn,go));return go=f.divideByScalar(go,c,go),gn=f.multiplyByScalar(gn,n,gn),h(o)||(o=new f),f.add(go,gn,o)},f.fromDegreesArray=function(e,t,n){if(m.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;h(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const s=e[o],a=e[o+1],c=o/2;n[c]=f.fromDegrees(s,a,0,t,n[c])}return n},f.fromRadiansArray=function(e,t,n){if(m.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");const i=e.length;h(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){const s=e[o],a=e[o+1],c=o/2;n[c]=f.fromRadians(s,a,0,t,n[c])}return n},f.fromDegreesArrayHeights=function(e,t,n){if(m.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;h(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const s=e[o],a=e[o+1],c=e[o+2],l=o/3;n[l]=f.fromDegrees(s,a,c,t,n[l])}return n},f.fromRadiansArrayHeights=function(e,t,n){if(m.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");const i=e.length;h(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){const s=e[o],a=e[o+1],c=e[o+2],l=o/3;n[l]=f.fromRadians(s,a,c,t,n[l])}return n},f.ZERO=Object.freeze(new f(0,0,0)),f.ONE=Object.freeze(new f(1,1,1)),f.UNIT_X=Object.freeze(new f(1,0,0)),f.UNIT_Y=Object.freeze(new f(0,1,0)),f.UNIT_Z=Object.freeze(new f(0,0,1)),f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t,n){return f.equalsEpsilon(this,e,t,n)},f.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function Y(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.z=_(n,0),this.w=_(i,0)}Y.fromElements=function(e,t,n,i,o){return h(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new Y(e,t,n,i)},Y.fromColor=function(e,t){return m.typeOf.object("color",e),h(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Y(e.red,e.green,e.blue,e.alpha)},Y.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Y(e.x,e.y,e.z,e.w)},Y.packedLength=4,Y.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},Y.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Y),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n},Y.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*4;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Y.pack(e[o],t,o*4);return t},Y.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;h(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=Y.unpack(e,i,t[o])}return t},Y.fromArray=Y.unpack,Y.maximumComponent=function(e){return m.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},Y.minimumComponent=function(e){return m.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},Y.minimumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},Y.maximumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.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},Y.clamp=function(e,t,n,i){m.typeOf.object("value",e),m.typeOf.object("min",t),m.typeOf.object("max",n),m.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y),a=S.clamp(e.z,t.z,n.z),c=S.clamp(e.w,t.w,n.w);return i.x=o,i.y=s,i.z=a,i.w=c,i},Y.magnitudeSquared=function(e){return m.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Y.magnitude=function(e){return Math.sqrt(Y.magnitudeSquared(e))};const ls=new Y;Y.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,ls),Y.magnitude(ls)},Y.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,ls),Y.magnitudeSquared(ls)},Y.normalize=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=Y.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 C("normalized result is not a number");return t},Y.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Y.multiplyComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.divideComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},Y.multiplyByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.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},Y.divideByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.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},Y.negate=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Y.abs=function(e,t){return m.typeOf.object("cartesian",e),m.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 yh=new Y;Y.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),Y.multiplyByScalar(t,n,yh),i=Y.multiplyByScalar(e,1-n,i),Y.add(yh,i,i)};const k0=new Y;Y.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=Y.normalize(e,k0);return Y.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=Y.clone(Y.UNIT_X,t):t=Y.clone(Y.UNIT_W,t):n.z<=n.w?t=Y.clone(Y.UNIT_Z,t):t=Y.clone(Y.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=Y.clone(Y.UNIT_Y,t):t=Y.clone(Y.UNIT_W,t):n.z<=n.w?t=Y.clone(Y.UNIT_Z,t):t=Y.clone(Y.UNIT_W,t),t},Y.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Y.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]},Y.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)&&S.equalsEpsilon(e.z,t.z,n,i)&&S.equalsEpsilon(e.w,t.w,n,i)},Y.ZERO=Object.freeze(new Y(0,0,0,0)),Y.ONE=Object.freeze(new Y(1,1,1,1)),Y.UNIT_X=Object.freeze(new Y(1,0,0,0)),Y.UNIT_Y=Object.freeze(new Y(0,1,0,0)),Y.UNIT_Z=Object.freeze(new Y(0,0,1,0)),Y.UNIT_W=Object.freeze(new Y(0,0,0,1)),Y.prototype.clone=function(e){return Y.clone(this,e)},Y.prototype.equals=function(e){return Y.equals(this,e)},Y.prototype.equalsEpsilon=function(e,t,n){return Y.equalsEpsilon(this,e,t,n)},Y.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Pa=new Float32Array(1),Vt=new Uint8Array(Pa.buffer),V0=new Uint32Array([287454020]),xh=new Uint8Array(V0.buffer)[0]===68;Y.packFloat=function(e,t){return m.typeOf.number("value",e),h(t)||(t=new Y),Pa[0]=e,xh?(t.x=Vt[0],t.y=Vt[1],t.z=Vt[2],t.w=Vt[3]):(t.x=Vt[3],t.y=Vt[2],t.z=Vt[1],t.w=Vt[0]),t},Y.unpackFloat=function(e){return m.typeOf.object("packedFloat",e),xh?(Vt[0]=e.x,Vt[1]=e.y,Vt[2]=e.z,Vt[3]=e.w):(Vt[0]=e.w,Vt[1]=e.z,Vt[2]=e.y,Vt[3]=e.x),Pa[0]};function L(e,t,n,i,o,s,a,c,l){this[0]=_(e,0),this[1]=_(i,0),this[2]=_(a,0),this[3]=_(t,0),this[4]=_(o,0),this[5]=_(c,0),this[6]=_(n,0),this[7]=_(s,0),this[8]=_(l,0)}L.packedLength=9,L.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(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},L.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new L),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},L.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*9;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)L.pack(e[o],t,o*9);return t},L.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new C("array length must be a multiple of 9.");const n=e.length;h(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){const o=i/9;t[o]=L.unpack(e,i,t[o])}return t},L.clone=function(e,t){if(h(e))return h(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 L(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},L.fromArray=L.unpack,L.fromColumnMajorArray=function(e,t){return m.defined("values",e),L.clone(e,t)},L.fromRowMajorArray=function(e,t){return m.defined("values",e),h(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 L(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},L.fromQuaternion=function(e,t){m.typeOf.object("quaternion",e);const n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,s=e.x*e.w,a=e.y*e.y,c=e.y*e.z,l=e.y*e.w,u=e.z*e.z,d=e.z*e.w,p=e.w*e.w,g=n-a-u+p,y=2*(i-d),x=2*(o+l),E=2*(i+d),b=-n+a-u+p,D=2*(c-s),A=2*(o-l),O=2*(c+s),I=-n-a+u+p;return h(t)?(t[0]=g,t[1]=E,t[2]=A,t[3]=y,t[4]=b,t[5]=O,t[6]=x,t[7]=D,t[8]=I,t):new L(g,y,x,E,b,D,A,O,I)},L.fromHeadingPitchRoll=function(e,t){m.typeOf.object("headingPitchRoll",e);const n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),s=Math.sin(-e.pitch),a=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*i,u=-o*a+c*s*i,d=c*a+o*s*i,p=n*a,g=o*i+c*s*a,y=-c*i+o*s*a,x=-s,E=c*n,b=o*n;return h(t)?(t[0]=l,t[1]=p,t[2]=x,t[3]=u,t[4]=g,t[5]=E,t[6]=d,t[7]=y,t[8]=b,t):new L(l,u,d,p,g,y,x,E,b)},L.fromScale=function(e,t){return m.typeOf.object("scale",e),h(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 L(e.x,0,0,0,e.y,0,0,0,e.z)},L.fromUniformScale=function(e,t){return m.typeOf.number("scale",e),h(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 L(e,0,0,0,e,0,0,0,e)},L.fromCrossProduct=function(e,t){return m.typeOf.object("vector",e),h(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 L(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},L.fromRotationX=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(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 L(1,0,0,0,n,-i,0,i,n)},L.fromRotationY=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(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 L(n,0,i,0,1,0,-i,0,n)},L.fromRotationZ=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(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 L(n,-i,0,i,n,0,0,0,1)},L.toArray=function(e,t){return m.typeOf.object("matrix",e),h(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]]},L.getElementIndex=function(e,t){return m.typeOf.number.greaterThanOrEquals("row",t,0),m.typeOf.number.lessThanOrEquals("row",t,2),m.typeOf.number.greaterThanOrEquals("column",e,0),m.typeOf.number.lessThanOrEquals("column",e,2),e*3+t},L.getColumn=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("result",n);const i=t*3,o=e[i],s=e[i+1],a=e[i+2];return n.x=o,n.y=s,n.z=a,n},L.setColumn=function(e,t,n,i){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=L.clone(e,i);const o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i},L.getRow=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("result",n);const i=e[t],o=e[t+3],s=e[t+6];return n.x=i,n.y=o,n.z=s,n},L.setRow=function(e,t,n,i){return m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,2),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=L.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const G0=new f;L.setScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=L.getScale(e,G0),o=t.x/i.x,s=t.y/i.y,a=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};const q0=new f;L.setUniformScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.typeOf.object("result",n);const i=L.getScale(e,q0),o=t/i.x,s=t/i.y,a=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*s,n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};const Ba=new f;L.getScale=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t.x=f.magnitude(f.fromElements(e[0],e[1],e[2],Ba)),t.y=f.magnitude(f.fromElements(e[3],e[4],e[5],Ba)),t.z=f.magnitude(f.fromElements(e[6],e[7],e[8],Ba)),t};const Ch=new f;L.getMaximumScale=function(e){return L.getScale(e,Ch),f.maximumComponent(Ch)};const H0=new f;L.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=L.getScale(e,H0);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 W0=new f;L.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=L.getScale(e,W0);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},L.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],s=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],d=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],p=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=s,n[3]=a,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=p,n},L.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},L.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},L.multiplyByVector=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z,a=e[0]*i+e[3]*o+e[6]*s,c=e[1]*i+e[4]*o+e[7]*s,l=e[2]*i+e[5]*o+e[8]*s;return n.x=a,n.y=c,n.z=l,n},L.multiplyByScalar=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scalar",t),m.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},L.multiplyByScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.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},L.multiplyByUniformScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.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},L.negate=function(e,t){return m.typeOf.object("matrix",e),m.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},L.transpose=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[3],o=e[6],s=e[1],a=e[4],c=e[7],l=e[2],u=e[5],d=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t};function j0(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}const Na=[1,0,0],Fa=[2,2,1];function Y0(e){let t=0;for(let n=0;n<3;++n){const i=e[L.getElementIndex(Fa[n],Na[n])];t+=2*i*i}return Math.sqrt(t)}function X0(e,t){const n=S.EPSILON15;let i=0,o=1;for(let u=0;u<3;++u){const d=Math.abs(e[L.getElementIndex(Fa[u],Na[u])]);d>i&&(o=u,i=d)}let s=1,a=0;const c=Na[o],l=Fa[o];if(Math.abs(e[L.getElementIndex(l,c)])>n){const u=e[L.getElementIndex(l,l)],d=e[L.getElementIndex(c,c)],p=e[L.getElementIndex(l,c)],g=(u-d)/2/p;let y;g<0?y=-1/(-g+Math.sqrt(1+g*g)):y=1/(g+Math.sqrt(1+g*g)),s=1/Math.sqrt(1+y*y),a=y*s}return t=L.clone(L.IDENTITY,t),t[L.getElementIndex(c,c)]=t[L.getElementIndex(l,l)]=s,t[L.getElementIndex(l,c)]=a,t[L.getElementIndex(c,l)]=-a,t}const hs=new L,Eh=new L;L.computeEigenDecomposition=function(e,t){m.typeOf.object("matrix",e);const n=S.EPSILON20,i=10;let o=0,s=0;h(t)||(t={});const a=t.unitary=L.clone(L.IDENTITY,t.unitary),c=t.diagonal=L.clone(e,t.diagonal),l=n*j0(c);for(;s<i&&Y0(c)>l;)X0(c,hs),L.transpose(hs,Eh),L.multiply(c,hs,c),L.multiply(Eh,c,c),L.multiply(a,hs,a),++o>2&&(++s,o=0);return t},L.abs=function(e,t){return m.typeOf.object("matrix",e),m.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},L.determinant=function(e){m.typeOf.object("matrix",e);const t=e[0],n=e[3],i=e[6],o=e[1],s=e[4],a=e[7],c=e[2],l=e[5],u=e[8];return t*(s*u-l*a)+o*(l*i-n*u)+c*(n*a-s*i)},L.inverse=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],c=e[5],l=e[6],u=e[7],d=e[8],p=L.determinant(e);if(Math.abs(p)<=S.EPSILON15)throw new C("matrix is not invertible");t[0]=a*d-u*c,t[1]=u*o-i*d,t[2]=i*c-a*o,t[3]=l*c-s*d,t[4]=n*d-l*o,t[5]=s*o-n*c,t[6]=s*u-l*a,t[7]=l*i-n*u,t[8]=n*a-s*i;const g=1/p;return L.multiplyByScalar(t,g,t)};const $0=new L;L.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),L.inverse(L.transpose(e,$0),t)},L.equals=function(e,t){return e===t||h(e)&&h(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]},L.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},L.IDENTITY=Object.freeze(new L(1,0,0,0,1,0,0,0,1)),L.ZERO=Object.freeze(new L(0,0,0,0,0,0,0,0,0)),L.COLUMN0ROW0=0,L.COLUMN0ROW1=1,L.COLUMN0ROW2=2,L.COLUMN1ROW0=3,L.COLUMN1ROW1=4,L.COLUMN1ROW2=5,L.COLUMN2ROW0=6,L.COLUMN2ROW1=7,L.COLUMN2ROW2=8,Object.defineProperties(L.prototype,{length:{get:function(){return L.packedLength}}}),L.prototype.clone=function(e){return L.clone(this,e)},L.prototype.equals=function(e){return L.equals(this,e)},L.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]},L.prototype.equalsEpsilon=function(e,t){return L.equalsEpsilon(this,e,t)},L.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
3
3
  (${this[1]}, ${this[4]}, ${this[7]})
4
4
  (${this[2]}, ${this[5]}, ${this[8]})`};function at(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}h(Object.create)&&(at.prototype=Object.create(Error.prototype),at.prototype.constructor=at),at.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return h(this.stack)&&(e+=`
5
5
  ${this.stack.toString()}`),e};function N(e,t,n,i,o,s,a,c,l,u,d,p,g,y,x,E){this[0]=_(e,0),this[1]=_(o,0),this[2]=_(l,0),this[3]=_(g,0),this[4]=_(t,0),this[5]=_(s,0),this[6]=_(u,0),this[7]=_(y,0),this[8]=_(n,0),this[9]=_(a,0),this[10]=_(d,0),this[11]=_(x,0),this[12]=_(i,0),this[13]=_(c,0),this[14]=_(p,0),this[15]=_(E,0)}N.packedLength=16,N.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(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},N.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new N),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},N.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*16;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)N.pack(e[o],t,o*16);return t},N.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new C("array length must be a multiple of 16.");const n=e.length;h(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){const o=i/16;t[o]=N.unpack(e,i,t[o])}return t},N.clone=function(e,t){if(h(e))return h(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 N(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])},N.fromArray=N.unpack,N.fromColumnMajorArray=function(e,t){return m.defined("values",e),N.clone(e,t)},N.fromRowMajorArray=function(e,t){return m.defined("values",e),h(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 N(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])},N.fromRotationTranslation=function(e,t,n){return m.typeOf.object("rotation",e),t=_(t,f.ZERO),h(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 N(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)},N.fromTranslationQuaternionRotationScale=function(e,t,n,i){m.typeOf.object("translation",e),m.typeOf.object("rotation",t),m.typeOf.object("scale",n),h(i)||(i=new N);const o=n.x,s=n.y,a=n.z,c=t.x*t.x,l=t.x*t.y,u=t.x*t.z,d=t.x*t.w,p=t.y*t.y,g=t.y*t.z,y=t.y*t.w,x=t.z*t.z,E=t.z*t.w,b=t.w*t.w,D=c-p-x+b,A=2*(l-E),O=2*(u+y),I=2*(l+E),B=-c+p-x+b,M=2*(g-d),q=2*(u-y),P=2*(g+d),V=-c-p+x+b;return i[0]=D*o,i[1]=I*o,i[2]=q*o,i[3]=0,i[4]=A*s,i[5]=B*s,i[6]=P*s,i[7]=0,i[8]=O*a,i[9]=M*a,i[10]=V*a,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},N.fromTranslationRotationScale=function(e,t){return m.typeOf.object("translationRotationScale",e),N.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},N.fromTranslation=function(e,t){return m.typeOf.object("translation",e),N.fromRotationTranslation(L.IDENTITY,e,t)},N.fromScale=function(e,t){return m.typeOf.object("scale",e),h(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 N(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},N.fromUniformScale=function(e,t){return m.typeOf.number("scale",e),h(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 N(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},N.fromRotation=function(e,t){return m.typeOf.object("rotation",e),h(t)||(t=new N),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 yo=new f,xo=new f,$o=new f;N.fromCamera=function(e,t){m.typeOf.object("camera",e);const n=e.position,i=e.direction,o=e.up;m.typeOf.object("camera.position",n),m.typeOf.object("camera.direction",i),m.typeOf.object("camera.up",o),f.normalize(i,yo),f.normalize(f.cross(yo,o,xo),xo),f.normalize(f.cross(xo,yo,$o),$o);const s=xo.x,a=xo.y,c=xo.z,l=yo.x,u=yo.y,d=yo.z,p=$o.x,g=$o.y,y=$o.z,x=n.x,E=n.y,b=n.z,D=s*-x+a*-E+c*-b,A=p*-x+g*-E+y*-b,O=l*x+u*E+d*b;return h(t)?(t[0]=s,t[1]=p,t[2]=-l,t[3]=0,t[4]=a,t[5]=g,t[6]=-u,t[7]=0,t[8]=c,t[9]=y,t[10]=-d,t[11]=0,t[12]=D,t[13]=A,t[14]=O,t[15]=1,t):new N(s,a,c,D,p,g,y,A,-l,-u,-d,O,0,0,0,1)},N.computePerspectiveFieldOfView=function(e,t,n,i,o){m.typeOf.number.greaterThan("fovY",e,0),m.typeOf.number.lessThan("fovY",e,Math.PI),m.typeOf.number.greaterThan("near",n,0),m.typeOf.number.greaterThan("far",i,0),m.typeOf.object("result",o);const a=1/Math.tan(e*.5),c=a/t,l=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o},N.computeOrthographicOffCenter=function(e,t,n,i,o,s,a){m.typeOf.number("left",e),m.typeOf.number("right",t),m.typeOf.number("bottom",n),m.typeOf.number("top",i),m.typeOf.number("near",o),m.typeOf.number("far",s),m.typeOf.object("result",a);let c=1/(t-e),l=1/(i-n),u=1/(s-o);const d=-(t+e)*c,p=-(i+n)*l,g=-(s+o)*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]=d,a[13]=p,a[14]=g,a[15]=1,a},N.computePerspectiveOffCenter=function(e,t,n,i,o,s,a){m.typeOf.number("left",e),m.typeOf.number("right",t),m.typeOf.number("bottom",n),m.typeOf.number("top",i),m.typeOf.number("near",o),m.typeOf.number("far",s),m.typeOf.object("result",a);const c=2*o/(t-e),l=2*o/(i-n),u=(t+e)/(t-e),d=(i+n)/(i-n),p=-(s+o)/(s-o),g=-1,y=-2*s*o/(s-o);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]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=y,a[15]=0,a},N.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,s){m.typeOf.number("left",e),m.typeOf.number("right",t),m.typeOf.number("bottom",n),m.typeOf.number("top",i),m.typeOf.number("near",o),m.typeOf.object("result",s);const a=2*o/(t-e),c=2*o/(i-n),l=(t+e)/(t-e),u=(i+n)/(i-n),d=-1,p=-1,g=-2*o;return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=l,s[9]=u,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s},N.computeViewportTransformation=function(e,t,n,i){h(i)||(i=new N),e=_(e,_.EMPTY_OBJECT);const o=_(e.x,0),s=_(e.y,0),a=_(e.width,0),c=_(e.height,0);t=_(t,0),n=_(n,1);const l=a*.5,u=c*.5,d=(n-t)*.5,p=l,g=u,y=d,x=o+l,E=s+u,b=t+d,D=1;return i[0]=p,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=g,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=y,i[11]=0,i[12]=x,i[13]=E,i[14]=b,i[15]=D,i},N.computeView=function(e,t,n,i,o){return m.typeOf.object("position",e),m.typeOf.object("direction",t),m.typeOf.object("up",n),m.typeOf.object("right",i),m.typeOf.object("result",o),o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-f.dot(i,e),o[13]=-f.dot(n,e),o[14]=f.dot(t,e),o[15]=1,o},N.toArray=function(e,t){return m.typeOf.object("matrix",e),h(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]]},N.getElementIndex=function(e,t){return m.typeOf.number.greaterThanOrEquals("row",t,0),m.typeOf.number.lessThanOrEquals("row",t,3),m.typeOf.number.greaterThanOrEquals("column",e,0),m.typeOf.number.lessThanOrEquals("column",e,3),e*4+t},N.getColumn=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,3),m.typeOf.object("result",n);const i=t*4,o=e[i],s=e[i+1],a=e[i+2],c=e[i+3];return n.x=o,n.y=s,n.z=a,n.w=c,n},N.setColumn=function(e,t,n,i){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,3),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=N.clone(e,i);const o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i},N.getRow=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,3),m.typeOf.object("result",n);const i=e[t],o=e[t+4],s=e[t+8],a=e[t+12];return n.x=i,n.y=o,n.z=s,n.w=a,n},N.setRow=function(e,t,n,i){return m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,3),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=N.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i},N.setTranslation=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.object("translation",t),m.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 Z0=new f;N.setScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=N.getScale(e,Z0),o=t.x/i.x,s=t.y/i.y,a=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*s,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 K0=new f;N.setUniformScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.typeOf.object("result",n);const i=N.getScale(e,K0),o=t/i.x,s=t/i.y,a=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*s,n[5]=e[5]*s,n[6]=e[6]*s,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 La=new f;N.getScale=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t.x=f.magnitude(f.fromElements(e[0],e[1],e[2],La)),t.y=f.magnitude(f.fromElements(e[4],e[5],e[6],La)),t.z=f.magnitude(f.fromElements(e[8],e[9],e[10],La)),t};const bh=new f;N.getMaximumScale=function(e){return N.getScale(e,bh),f.maximumComponent(bh)};const Q0=new f;N.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=N.getScale(e,Q0);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 J0=new f;N.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=N.getScale(e,J0);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},N.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e[0],o=e[1],s=e[2],a=e[3],c=e[4],l=e[5],u=e[6],d=e[7],p=e[8],g=e[9],y=e[10],x=e[11],E=e[12],b=e[13],D=e[14],A=e[15],O=t[0],I=t[1],B=t[2],M=t[3],q=t[4],P=t[5],V=t[6],k=t[7],H=t[8],j=t[9],r=t[10],w=t[11],v=t[12],z=t[13],G=t[14],W=t[15],Z=i*O+c*I+p*B+E*M,X=o*O+l*I+g*B+b*M,ie=s*O+u*I+y*B+D*M,se=a*O+d*I+x*B+A*M,ge=i*q+c*P+p*V+E*k,be=o*q+l*P+g*V+b*k,xe=s*q+u*P+y*V+D*k,ze=a*q+d*P+x*V+A*k,je=i*H+c*j+p*r+E*w,tt=o*H+l*j+g*r+b*w,ut=s*H+u*j+y*r+D*w,Be=a*H+d*j+x*r+A*w,yt=i*v+c*z+p*G+E*W,Dt=o*v+l*z+g*G+b*W,xt=s*v+u*z+y*G+D*W,cn=a*v+d*z+x*G+A*W;return n[0]=Z,n[1]=X,n[2]=ie,n[3]=se,n[4]=ge,n[5]=be,n[6]=xe,n[7]=ze,n[8]=je,n[9]=tt,n[10]=ut,n[11]=Be,n[12]=yt,n[13]=Dt,n[14]=xt,n[15]=cn,n},N.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},N.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},N.multiplyTransformation=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e[0],o=e[1],s=e[2],a=e[4],c=e[5],l=e[6],u=e[8],d=e[9],p=e[10],g=e[12],y=e[13],x=e[14],E=t[0],b=t[1],D=t[2],A=t[4],O=t[5],I=t[6],B=t[8],M=t[9],q=t[10],P=t[12],V=t[13],k=t[14],H=i*E+a*b+u*D,j=o*E+c*b+d*D,r=s*E+l*b+p*D,w=i*A+a*O+u*I,v=o*A+c*O+d*I,z=s*A+l*O+p*I,G=i*B+a*M+u*q,W=o*B+c*M+d*q,Z=s*B+l*M+p*q,X=i*P+a*V+u*k+g,ie=o*P+c*V+d*k+y,se=s*P+l*V+p*k+x;return n[0]=H,n[1]=j,n[2]=r,n[3]=0,n[4]=w,n[5]=v,n[6]=z,n[7]=0,n[8]=G,n[9]=W,n[10]=Z,n[11]=0,n[12]=X,n[13]=ie,n[14]=se,n[15]=1,n},N.multiplyByMatrix3=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("rotation",t),m.typeOf.object("result",n);const i=e[0],o=e[1],s=e[2],a=e[4],c=e[5],l=e[6],u=e[8],d=e[9],p=e[10],g=t[0],y=t[1],x=t[2],E=t[3],b=t[4],D=t[5],A=t[6],O=t[7],I=t[8],B=i*g+a*y+u*x,M=o*g+c*y+d*x,q=s*g+l*y+p*x,P=i*E+a*b+u*D,V=o*E+c*b+d*D,k=s*E+l*b+p*D,H=i*A+a*O+u*I,j=o*A+c*O+d*I,r=s*A+l*O+p*I;return n[0]=B,n[1]=M,n[2]=q,n[3]=0,n[4]=P,n[5]=V,n[6]=k,n[7]=0,n[8]=H,n[9]=j,n[10]=r,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},N.multiplyByTranslation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("translation",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z,a=i*e[0]+o*e[4]+s*e[8]+e[12],c=i*e[1]+o*e[5]+s*e[9]+e[13],l=i*e[2]+o*e[6]+s*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},N.multiplyByScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z;return i===1&&o===1&&s===1?N.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=s*e[8],n[9]=s*e[9],n[10]=s*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)},N.multiplyByUniformScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.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},N.multiplyByVector=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z,a=t.w,c=e[0]*i+e[4]*o+e[8]*s+e[12]*a,l=e[1]*i+e[5]*o+e[9]*s+e[13]*a,u=e[2]*i+e[6]*o+e[10]*s+e[14]*a,d=e[3]*i+e[7]*o+e[11]*s+e[15]*a;return n.x=c,n.y=l,n.z=u,n.w=d,n},N.multiplyByPointAsVector=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z,a=e[0]*i+e[4]*o+e[8]*s,c=e[1]*i+e[5]*o+e[9]*s,l=e[2]*i+e[6]*o+e[10]*s;return n.x=a,n.y=c,n.z=l,n},N.multiplyByPoint=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=t.x,o=t.y,s=t.z,a=e[0]*i+e[4]*o+e[8]*s+e[12],c=e[1]*i+e[5]*o+e[9]*s+e[13],l=e[2]*i+e[6]*o+e[10]*s+e[14];return n.x=a,n.y=c,n.z=l,n},N.multiplyByScalar=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scalar",t),m.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},N.negate=function(e,t){return m.typeOf.object("matrix",e),m.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},N.transpose=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[1],i=e[2],o=e[3],s=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]=s,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=a,t[14]=c,t[15]=e[15],t},N.abs=function(e,t){return m.typeOf.object("matrix",e),m.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},N.equals=function(e,t){return e===t||h(e)&&h(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]},N.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},N.getTranslation=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},N.getMatrix3=function(e,t){return m.typeOf.object("matrix",e),m.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 e_=new L,t_=new L,n_=new Y,i_=new Y(0,0,0,1);N.inverse=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[4],o=e[8],s=e[12],a=e[1],c=e[5],l=e[9],u=e[13],d=e[2],p=e[6],g=e[10],y=e[14],x=e[3],E=e[7],b=e[11],D=e[15];let A=g*D,O=y*b,I=p*D,B=y*E,M=p*b,q=g*E,P=d*D,V=y*x,k=d*b,H=g*x,j=d*E,r=p*x;const w=A*c+B*l+M*u-(O*c+I*l+q*u),v=O*a+P*l+H*u-(A*a+V*l+k*u),z=I*a+V*c+j*u-(B*a+P*c+r*u),G=q*a+k*c+r*l-(M*a+H*c+j*l),W=O*i+I*o+q*s-(A*i+B*o+M*s),Z=A*n+V*o+k*s-(O*n+P*o+H*s),X=B*n+P*i+r*s-(I*n+V*i+j*s),ie=M*n+H*i+j*o-(q*n+k*i+r*o);A=o*u,O=s*l,I=i*u,B=s*c,M=i*l,q=o*c,P=n*u,V=s*a,k=n*l,H=o*a,j=n*c,r=i*a;const se=A*E+B*b+M*D-(O*E+I*b+q*D),ge=O*x+P*b+H*D-(A*x+V*b+k*D),be=I*x+V*E+j*D-(B*x+P*E+r*D),xe=q*x+k*E+r*b-(M*x+H*E+j*b),ze=I*g+q*y+O*p-(M*y+A*p+B*g),je=k*y+A*d+V*g-(P*g+H*y+O*d),tt=P*p+r*y+B*d-(j*y+I*d+V*p),ut=j*g+M*d+H*p-(k*p+r*g+q*d);let Be=n*w+i*v+o*z+s*G;if(Math.abs(Be)<S.EPSILON21){if(L.equalsEpsilon(N.getMatrix3(e,e_),t_,S.EPSILON7)&&Y.equals(N.getRow(e,3,n_),i_))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 at("matrix is not invertible because its determinate is zero.")}return Be=1/Be,t[0]=w*Be,t[1]=v*Be,t[2]=z*Be,t[3]=G*Be,t[4]=W*Be,t[5]=Z*Be,t[6]=X*Be,t[7]=ie*Be,t[8]=se*Be,t[9]=ge*Be,t[10]=be*Be,t[11]=xe*Be,t[12]=ze*Be,t[13]=je*Be,t[14]=tt*Be,t[15]=ut*Be,t},N.inverseTransformation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[1],o=e[2],s=e[4],a=e[5],c=e[6],l=e[8],u=e[9],d=e[10],p=e[12],g=e[13],y=e[14],x=-n*p-i*g-o*y,E=-s*p-a*g-c*y,b=-l*p-u*g-d*y;return t[0]=n,t[1]=s,t[2]=l,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=o,t[9]=c,t[10]=d,t[11]=0,t[12]=x,t[13]=E,t[14]=b,t[15]=1,t};const o_=new N;N.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),N.inverse(N.transpose(e,o_),t)},N.IDENTITY=Object.freeze(new N(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),N.ZERO=Object.freeze(new N(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),N.COLUMN0ROW0=0,N.COLUMN0ROW1=1,N.COLUMN0ROW2=2,N.COLUMN0ROW3=3,N.COLUMN1ROW0=4,N.COLUMN1ROW1=5,N.COLUMN1ROW2=6,N.COLUMN1ROW3=7,N.COLUMN2ROW0=8,N.COLUMN2ROW1=9,N.COLUMN2ROW2=10,N.COLUMN2ROW3=11,N.COLUMN3ROW0=12,N.COLUMN3ROW1=13,N.COLUMN3ROW2=14,N.COLUMN3ROW3=15,Object.defineProperties(N.prototype,{length:{get:function(){return N.packedLength}}}),N.prototype.clone=function(e){return N.clone(this,e)},N.prototype.equals=function(e){return N.equals(this,e)},N.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]},N.prototype.equalsEpsilon=function(e,t){return N.equalsEpsilon(this,e,t)},N.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
6
6
  (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
7
7
  (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
8
- (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};const R=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}),r_=new f;function re(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const zt={};zt[R.FLOAT]="float",zt[R.FLOAT_VEC2]="vec2",zt[R.FLOAT_VEC3]="vec3",zt[R.FLOAT_VEC4]="vec4",zt[R.INT]="int",zt[R.INT_VEC2]="ivec2",zt[R.INT_VEC3]="ivec3",zt[R.INT_VEC4]="ivec4",zt[R.BOOL]="bool",zt[R.BOOL_VEC2]="bvec2",zt[R.BOOL_VEC3]="bvec3",zt[R.BOOL_VEC4]="bvec4",zt[R.FLOAT_MAT2]="mat2",zt[R.FLOAT_MAT3]="mat3",zt[R.FLOAT_MAT4]="mat4",zt[R.SAMPLER_2D]="sampler2D",zt[R.SAMPLER_CUBE]="samplerCube",re.prototype.getDeclaration=function(e){let t=`uniform ${zt[this._datatype]} ${e}`;const n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};const fs={czm_viewport:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new re({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,r_)}}),czm_frameNumber:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new re({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new re({size:1,datatype:R.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new re({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new re({size:9,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};function Vn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function s_(){return!0}function Qe(e,t){t=_(t,"This object was destroyed, i.e., destroy() was called.");function n(){throw new C(t)}for(const i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=s_}const Ot={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT};Ot.getSizeInBytes=function(e){switch(e){case Ot.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ot.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ot.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")},Ot.fromSizeInBytes=function(e){switch(e){case 2:return Ot.UNSIGNED_SHORT;case 4:return Ot.UNSIGNED_INT;case 1:return Ot.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}},Ot.validate=function(e){return h(e)&&(e===Ot.UNSIGNED_BYTE||e===Ot.UNSIGNED_SHORT||e===Ot.UNSIGNED_INT)},Ot.createTypedArray=function(e,t){if(!h(e))throw new C("numberOfVertices is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},Ot.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!h(e))throw new C("numberOfVertices is required.");if(!h(t))throw new C("sourceArray is required.");if(!h(n))throw new C("byteOffset is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},Ot.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ot.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ot.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ot.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};const Ct=Object.freeze(Ot),us={STREAM_DRAW:R.STREAM_DRAW,STATIC_DRAW:R.STATIC_DRAW,DYNAMIC_DRAW:R.DYNAMIC_DRAW,validate:function(e){return e===us.STREAM_DRAW||e===us.STATIC_DRAW||e===us.DYNAMIC_DRAW}},De=Object.freeze(us);function vt(e){if(e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),!h(e.typedArray)&&!h(e.sizeInBytes))throw new C("Either options.sizeInBytes or options.typedArray is required.");if(h(e.typedArray)&&h(e.sizeInBytes))throw new C("Cannot pass in both options.sizeInBytes and options.typedArray.");if(h(e.typedArray)&&(m.typeOf.object("options.typedArray",e.typedArray),m.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!De.validate(e.usage))throw new C("usage is invalid.");const t=e.context._gl,n=e.bufferTarget,i=e.typedArray;let o=e.sizeInBytes;const s=e.usage,a=h(i);a&&(o=i.byteLength),m.typeOf.number.greaterThan("sizeInBytes",o,0);const c=t.createBuffer();t.bindBuffer(n,c),t.bufferData(n,a?i:o,s),t.bindBuffer(n,null),this._id=Vn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=s,this._buffer=c,this.vertexArrayDestroyable=!0}vt.createVertexBuffer=function(e){return m.defined("options.context",e.context),new vt({context:e.context,bufferTarget:R.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},vt.createIndexBuffer=function(e){if(m.defined("options.context",e.context),!Ct.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===Ct.UNSIGNED_INT&&!e.context.elementIndexUint)throw new C("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=Ct.getSizeInBytes(n),o=new vt({context:t,bufferTarget:R.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),s=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return s}}}),o},Object.defineProperties(vt.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),vt.prototype._getBuffer=function(){return this._buffer},vt.prototype.copyFromArrayView=function(e,t){t=_(t,0),m.defined("arrayView",e),m.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)},vt.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new C("A WebGL 2 context is required.");if(!h(e))throw new C("readBuffer must be defined.");if(!h(i)||i<=0)throw new C("sizeInBytes must be defined and be greater than zero.");if(!h(t)||t<0||t+i>e._sizeInBytes)throw new C("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!h(n)||n<0||n+i>this._sizeInBytes)throw new C("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 C("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==R.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===R.ELEMENT_ARRAY_BUFFER)throw new C("Can not copy an index buffer into another buffer type.");const o=R.COPY_READ_BUFFER,s=R.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(s,this._buffer),a.bindBuffer(o,e._buffer),a.copyBufferSubData(o,s,t,n,i),a.bindBuffer(s,null),a.bindBuffer(o,null)},vt.prototype.getBufferData=function(e,t,n,i){if(t=_(t,0),n=_(n,0),!this._webgl2)throw new C("A WebGL 2 context is required.");if(!h(e))throw new C("arrayView is required.");let o,s,a=e.byteLength;if(h(i)?(o=i,h(a)?s=1:(a=e.length,s=e.BYTES_PER_ELEMENT)):h(a)?(o=a-n,s=1):(a=e.length,o=a-n,s=e.BYTES_PER_ELEMENT),n<0||n>a)throw new C("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>a)throw new C("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new C("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*s>this._sizeInBytes)throw new C("sourceOffset + length must be less than the buffers size.");const c=this._gl,l=R.COPY_READ_BUFFER;c.bindBuffer(l,this._buffer),c.getBufferSubData(l,t,e,n,i),c.bindBuffer(l,null)},vt.prototype.isDestroyed=function(){return!1},vt.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),Qe(this)};let Di;const ct={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},en={};Object.defineProperties(en,{element:{get:function(){if(en.supportsFullscreen())return document[ct.fullscreenElement]}},changeEventName:{get:function(){if(en.supportsFullscreen())return ct.fullscreenchange}},errorEventName:{get:function(){if(en.supportsFullscreen())return ct.fullscreenerror}},enabled:{get:function(){if(en.supportsFullscreen())return document[ct.fullscreenEnabled]}},fullscreen:{get:function(){if(en.supportsFullscreen())return en.element!==null}}}),en.supportsFullscreen=function(){if(h(Di))return Di;Di=!1;const e=document.body;if(typeof e.requestFullscreen=="function")return ct.requestFullscreen="requestFullscreen",ct.exitFullscreen="exitFullscreen",ct.fullscreenEnabled="fullscreenEnabled",ct.fullscreenElement="fullscreenElement",ct.fullscreenchange="fullscreenchange",ct.fullscreenerror="fullscreenerror",Di=!0,Di;const t=["webkit","moz","o","ms","khtml"];let n;for(let i=0,o=t.length;i<o;++i){const s=t[i];n=`${s}RequestFullscreen`,typeof e[n]=="function"?(ct.requestFullscreen=n,Di=!0):(n=`${s}RequestFullScreen`,typeof e[n]=="function"&&(ct.requestFullscreen=n,Di=!0)),n=`${s}ExitFullscreen`,typeof document[n]=="function"?ct.exitFullscreen=n:(n=`${s}CancelFullScreen`,typeof document[n]=="function"&&(ct.exitFullscreen=n)),n=`${s}FullscreenEnabled`,document[n]!==void 0?ct.fullscreenEnabled=n:(n=`${s}FullScreenEnabled`,document[n]!==void 0&&(ct.fullscreenEnabled=n)),n=`${s}FullscreenElement`,document[n]!==void 0?ct.fullscreenElement=n:(n=`${s}FullScreenElement`,document[n]!==void 0&&(ct.fullscreenElement=n)),n=`${s}fullscreenchange`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenChange"),ct.fullscreenchange=n),n=`${s}fullscreenerror`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenError"),ct.fullscreenerror=n)}return Di},en.requestFullscreen=function(e,t){en.supportsFullscreen()&&e[ct.requestFullscreen]({vrDisplay:t})},en.exitFullscreen=function(){en.supportsFullscreen()&&document[ct.exitFullscreen]()},en._names=ct;let Gt;typeof navigator<"u"?Gt=navigator:Gt={};function Yi(e){const t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}let ds,wh;function Ma(){if(!h(ds)&&(ds=!1,!gs())){const e=/ Chrome\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ds=!0,wh=Yi(e[1]))}return ds}function a_(){return Ma()&&wh}let ps,Th;function Sh(){if(!h(ps)&&(ps=!1,!Ma()&&!gs()&&/ Safari\/[\.0-9]+/.test(Gt.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ps=!0,Th=Yi(e[1]))}return ps}function c_(){return Sh()&&Th}let ms,Ua;function Ah(){if(!h(ms)){ms=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Gt.userAgent);e!==null&&(ms=!0,Ua=Yi(e[1]),Ua.isNightly=!!e[2])}return ms}function l_(){return Ah()&&Ua}let Zo,ka;function Dh(){if(!h(Zo)){Zo=!1;let e;Gt.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Gt.userAgent),e!==null&&(Zo=!0,ka=Yi(e[1]))):Gt.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Gt.userAgent),e!==null&&(Zo=!0,ka=Yi(e[1])))}return Zo}function h_(){return Dh()&&ka}let _s,Oh;function gs(){if(!h(_s)){_s=!1;const e=/ Edg\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(_s=!0,Oh=Yi(e[1]))}return _s}function f_(){return gs()&&Oh}let ys,Va;function xs(){if(!h(ys)){ys=!1;const e=/Firefox\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ys=!0,Va=Yi(e[1]))}return ys}let Ga;function u_(){return h(Ga)||(Ga=/Windows/i.test(Gt.appVersion)),Ga}let qa;function d_(){return h(qa)||(qa=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),qa}function p_(){return xs()&&Va}let Ha;function m_(){return h(Ha)||(Ha=!xs()&&typeof PointerEvent<"u"&&(!h(Gt.pointerEnabled)||Gt.pointerEnabled)),Ha}let vh,Cs;function Ih(){if(!h(Cs)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;Cs=h(t)&&t!=="",Cs&&(vh=t)}return Cs}function __(){return Ih()?vh:void 0}function qt(){if(!qt.initialized)throw new C("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return qt._result}qt._promise=void 0,qt._result=void 0,qt.initialize=function(){return h(qt._promise)||(qt._promise=new Promise(e=>{const t=new Image;t.onload=function(){qt._result=t.width>0&&t.height>0,e(qt._result)},t.onerror=function(){qt._result=!1,e(qt._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),qt._promise},Object.defineProperties(qt,{initialized:{get:function(){return h(qt._result)}}});const Co=[];typeof ArrayBuffer<"u"&&(Co.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Co.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Co.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Co.push(BigInt64Array),typeof BigUint64Array<"u"&&Co.push(BigUint64Array));const _t={isChrome:Ma,chromeVersion:a_,isSafari:Sh,safariVersion:c_,isWebkit:Ah,webkitVersion:l_,isInternetExplorer:Dh,internetExplorerVersion:h_,isEdge:gs,edgeVersion:f_,isFirefox:xs,firefoxVersion:p_,isWindows:u_,isIPadOrIOS:d_,hardwareConcurrency:_(Gt.hardwareConcurrency,3),supportsPointerEvents:m_,supportsImageRenderingPixelated:Ih,supportsWebP:qt,imageRenderingValue:__,typedArrayTypes:Co};_t.supportsBasis=function(e){return _t.supportsWebAssembly()&&e.context.supportsBasis},_t.supportsFullscreen=function(){return en.supportsFullscreen()},_t.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},_t.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},_t.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},_t.supportsBigInt=function(){return typeof BigInt<"u"},_t.supportsWebWorkers=function(){return typeof Worker<"u"},_t.supportsWebAssembly=function(){return typeof WebAssembly<"u"},_t.supportsWebgl2=function(e){return m.defined("scene",e),e.context.webgl2},_t.supportsEsmWebWorkers=function(){return!xs()||parseInt(Va)>=114};function Wa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function T(e,t,n,i){this.red=_(e,1),this.green=_(t,1),this.blue=_(n,1),this.alpha=_(i,1)}T.fromCartesian4=function(e,t){return m.typeOf.object("cartesian",e),h(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new T(e.x,e.y,e.z,e.w)},T.fromBytes=function(e,t,n,i,o){return e=T.byteToFloat(_(e,255)),t=T.byteToFloat(_(t,255)),n=T.byteToFloat(_(n,255)),i=T.byteToFloat(_(i,255)),h(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new T(e,t,n,i)},T.fromAlpha=function(e,t,n){return m.typeOf.object("color",e),m.typeOf.number("alpha",t),h(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new T(e.red,e.green,e.blue,t)};let ja,Ya,si;_t.supportsTypedArrays()&&(ja=new ArrayBuffer(4),Ya=new Uint32Array(ja),si=new Uint8Array(ja)),T.fromRgba=function(e,t){return Ya[0]=e,T.fromBytes(si[0],si[1],si[2],si[3],t)},T.fromHsl=function(e,t,n,i,o){e=_(e,0)%1,t=_(t,0),n=_(n,0),i=_(i,1);let s=n,a=n,c=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;const u=2*n-l;s=Wa(u,l,e+1/3),a=Wa(u,l,e),c=Wa(u,l,e-1/3)}return h(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=i,o):new T(s,a,c,i)},T.fromRandom=function(e,t){e=_(e,_.EMPTY_OBJECT);let n=e.red;if(!h(n)){const a=_(e.minimumRed,0),c=_(e.maximumRed,1);m.typeOf.number.lessThanOrEquals("minimumRed",a,c),n=a+S.nextRandomNumber()*(c-a)}let i=e.green;if(!h(i)){const a=_(e.minimumGreen,0),c=_(e.maximumGreen,1);m.typeOf.number.lessThanOrEquals("minimumGreen",a,c),i=a+S.nextRandomNumber()*(c-a)}let o=e.blue;if(!h(o)){const a=_(e.minimumBlue,0),c=_(e.maximumBlue,1);m.typeOf.number.lessThanOrEquals("minimumBlue",a,c),o=a+S.nextRandomNumber()*(c-a)}let s=e.alpha;if(!h(s)){const a=_(e.minimumAlpha,0),c=_(e.maximumAlpha,1);m.typeOf.number.lessThanOrEquals("minumumAlpha",a,c),s=a+S.nextRandomNumber()*(c-a)}return h(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=s,t):new T(n,i,o,s)};const g_=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,y_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,x_=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,C_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;T.fromCssColorString=function(e,t){m.typeOf.string("color",e),h(t)||(t=new T),e=e.trim();const n=T[e.toUpperCase()];if(h(n))return T.clone(n,t),t;let i=g_.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(_(i[4],"f"),16)/15,t):(i=y_.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(_(i[4],"ff"),16)/255,t):(i=x_.exec(e),i!==null?(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(_(i[4],"1.0")),t):(i=C_.exec(e),i!==null?T.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(_(i[4],"1.0")),t):(t=void 0,t))))},T.packedLength=4,T.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t},T.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new T),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},T.byteToFloat=function(e){return e/255},T.floatToByte=function(e){return e===1?255:e*256|0},T.clone=function(e,t){if(h(e))return h(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new T(e.red,e.green,e.blue,e.alpha)},T.equals=function(e,t){return e===t||h(e)&&h(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},T.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]},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 this===e||h(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},T.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},T.prototype.toCssColorString=function(){const e=T.floatToByte(this.red),t=T.floatToByte(this.green),n=T.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},T.prototype.toCssHexString=function(){let e=T.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=T.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=T.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=T.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},T.prototype.toBytes=function(e){const t=T.floatToByte(this.red),n=T.floatToByte(this.green),i=T.floatToByte(this.blue),o=T.floatToByte(this.alpha);return h(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]},T.prototype.toRgba=function(){return si[0]=T.floatToByte(this.red),si[1]=T.floatToByte(this.green),si[2]=T.floatToByte(this.blue),si[3]=T.floatToByte(this.alpha),Ya[0]},T.prototype.brighten=function(e,t){return m.typeOf.number("magnitude",e),m.typeOf.number.greaterThanOrEquals("magnitude",e,0),m.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},T.prototype.darken=function(e,t){return m.typeOf.number("magnitude",e),m.typeOf.number.greaterThanOrEquals("magnitude",e,0),m.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},T.prototype.withAlpha=function(e,t){return T.fromAlpha(this,e,t)},T.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.multiply=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.divide=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.mod=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),i.red=S.lerp(e.red,t.red,n),i.green=S.lerp(e.green,t.green,n),i.blue=S.lerp(e.blue,t.blue,n),i.alpha=S.lerp(e.alpha,t.alpha,n),i},T.multiplyByScalar=function(e,t,n){return m.typeOf.object("color",e),m.typeOf.number("scalar",t),m.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},T.divideByScalar=function(e,t,n){return m.typeOf.object("color",e),m.typeOf.number("scalar",t),m.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},T.ALICEBLUE=Object.freeze(T.fromCssColorString("#F0F8FF")),T.ANTIQUEWHITE=Object.freeze(T.fromCssColorString("#FAEBD7")),T.AQUA=Object.freeze(T.fromCssColorString("#00FFFF")),T.AQUAMARINE=Object.freeze(T.fromCssColorString("#7FFFD4")),T.AZURE=Object.freeze(T.fromCssColorString("#F0FFFF")),T.BEIGE=Object.freeze(T.fromCssColorString("#F5F5DC")),T.BISQUE=Object.freeze(T.fromCssColorString("#FFE4C4")),T.BLACK=Object.freeze(T.fromCssColorString("#000000")),T.BLANCHEDALMOND=Object.freeze(T.fromCssColorString("#FFEBCD")),T.BLUE=Object.freeze(T.fromCssColorString("#0000FF")),T.BLUEVIOLET=Object.freeze(T.fromCssColorString("#8A2BE2")),T.BROWN=Object.freeze(T.fromCssColorString("#A52A2A")),T.BURLYWOOD=Object.freeze(T.fromCssColorString("#DEB887")),T.CADETBLUE=Object.freeze(T.fromCssColorString("#5F9EA0")),T.CHARTREUSE=Object.freeze(T.fromCssColorString("#7FFF00")),T.CHOCOLATE=Object.freeze(T.fromCssColorString("#D2691E")),T.CORAL=Object.freeze(T.fromCssColorString("#FF7F50")),T.CORNFLOWERBLUE=Object.freeze(T.fromCssColorString("#6495ED")),T.CORNSILK=Object.freeze(T.fromCssColorString("#FFF8DC")),T.CRIMSON=Object.freeze(T.fromCssColorString("#DC143C")),T.CYAN=Object.freeze(T.fromCssColorString("#00FFFF")),T.DARKBLUE=Object.freeze(T.fromCssColorString("#00008B")),T.DARKCYAN=Object.freeze(T.fromCssColorString("#008B8B")),T.DARKGOLDENROD=Object.freeze(T.fromCssColorString("#B8860B")),T.DARKGRAY=Object.freeze(T.fromCssColorString("#A9A9A9")),T.DARKGREEN=Object.freeze(T.fromCssColorString("#006400")),T.DARKGREY=T.DARKGRAY,T.DARKKHAKI=Object.freeze(T.fromCssColorString("#BDB76B")),T.DARKMAGENTA=Object.freeze(T.fromCssColorString("#8B008B")),T.DARKOLIVEGREEN=Object.freeze(T.fromCssColorString("#556B2F")),T.DARKORANGE=Object.freeze(T.fromCssColorString("#FF8C00")),T.DARKORCHID=Object.freeze(T.fromCssColorString("#9932CC")),T.DARKRED=Object.freeze(T.fromCssColorString("#8B0000")),T.DARKSALMON=Object.freeze(T.fromCssColorString("#E9967A")),T.DARKSEAGREEN=Object.freeze(T.fromCssColorString("#8FBC8F")),T.DARKSLATEBLUE=Object.freeze(T.fromCssColorString("#483D8B")),T.DARKSLATEGRAY=Object.freeze(T.fromCssColorString("#2F4F4F")),T.DARKSLATEGREY=T.DARKSLATEGRAY,T.DARKTURQUOISE=Object.freeze(T.fromCssColorString("#00CED1")),T.DARKVIOLET=Object.freeze(T.fromCssColorString("#9400D3")),T.DEEPPINK=Object.freeze(T.fromCssColorString("#FF1493")),T.DEEPSKYBLUE=Object.freeze(T.fromCssColorString("#00BFFF")),T.DIMGRAY=Object.freeze(T.fromCssColorString("#696969")),T.DIMGREY=T.DIMGRAY,T.DODGERBLUE=Object.freeze(T.fromCssColorString("#1E90FF")),T.FIREBRICK=Object.freeze(T.fromCssColorString("#B22222")),T.FLORALWHITE=Object.freeze(T.fromCssColorString("#FFFAF0")),T.FORESTGREEN=Object.freeze(T.fromCssColorString("#228B22")),T.FUCHSIA=Object.freeze(T.fromCssColorString("#FF00FF")),T.GAINSBORO=Object.freeze(T.fromCssColorString("#DCDCDC")),T.GHOSTWHITE=Object.freeze(T.fromCssColorString("#F8F8FF")),T.GOLD=Object.freeze(T.fromCssColorString("#FFD700")),T.GOLDENROD=Object.freeze(T.fromCssColorString("#DAA520")),T.GRAY=Object.freeze(T.fromCssColorString("#808080")),T.GREEN=Object.freeze(T.fromCssColorString("#008000")),T.GREENYELLOW=Object.freeze(T.fromCssColorString("#ADFF2F")),T.GREY=T.GRAY,T.HONEYDEW=Object.freeze(T.fromCssColorString("#F0FFF0")),T.HOTPINK=Object.freeze(T.fromCssColorString("#FF69B4")),T.INDIANRED=Object.freeze(T.fromCssColorString("#CD5C5C")),T.INDIGO=Object.freeze(T.fromCssColorString("#4B0082")),T.IVORY=Object.freeze(T.fromCssColorString("#FFFFF0")),T.KHAKI=Object.freeze(T.fromCssColorString("#F0E68C")),T.LAVENDER=Object.freeze(T.fromCssColorString("#E6E6FA")),T.LAVENDAR_BLUSH=Object.freeze(T.fromCssColorString("#FFF0F5")),T.LAWNGREEN=Object.freeze(T.fromCssColorString("#7CFC00")),T.LEMONCHIFFON=Object.freeze(T.fromCssColorString("#FFFACD")),T.LIGHTBLUE=Object.freeze(T.fromCssColorString("#ADD8E6")),T.LIGHTCORAL=Object.freeze(T.fromCssColorString("#F08080")),T.LIGHTCYAN=Object.freeze(T.fromCssColorString("#E0FFFF")),T.LIGHTGOLDENRODYELLOW=Object.freeze(T.fromCssColorString("#FAFAD2")),T.LIGHTGRAY=Object.freeze(T.fromCssColorString("#D3D3D3")),T.LIGHTGREEN=Object.freeze(T.fromCssColorString("#90EE90")),T.LIGHTGREY=T.LIGHTGRAY,T.LIGHTPINK=Object.freeze(T.fromCssColorString("#FFB6C1")),T.LIGHTSEAGREEN=Object.freeze(T.fromCssColorString("#20B2AA")),T.LIGHTSKYBLUE=Object.freeze(T.fromCssColorString("#87CEFA")),T.LIGHTSLATEGRAY=Object.freeze(T.fromCssColorString("#778899")),T.LIGHTSLATEGREY=T.LIGHTSLATEGRAY,T.LIGHTSTEELBLUE=Object.freeze(T.fromCssColorString("#B0C4DE")),T.LIGHTYELLOW=Object.freeze(T.fromCssColorString("#FFFFE0")),T.LIME=Object.freeze(T.fromCssColorString("#00FF00")),T.LIMEGREEN=Object.freeze(T.fromCssColorString("#32CD32")),T.LINEN=Object.freeze(T.fromCssColorString("#FAF0E6")),T.MAGENTA=Object.freeze(T.fromCssColorString("#FF00FF")),T.MAROON=Object.freeze(T.fromCssColorString("#800000")),T.MEDIUMAQUAMARINE=Object.freeze(T.fromCssColorString("#66CDAA")),T.MEDIUMBLUE=Object.freeze(T.fromCssColorString("#0000CD")),T.MEDIUMORCHID=Object.freeze(T.fromCssColorString("#BA55D3")),T.MEDIUMPURPLE=Object.freeze(T.fromCssColorString("#9370DB")),T.MEDIUMSEAGREEN=Object.freeze(T.fromCssColorString("#3CB371")),T.MEDIUMSLATEBLUE=Object.freeze(T.fromCssColorString("#7B68EE")),T.MEDIUMSPRINGGREEN=Object.freeze(T.fromCssColorString("#00FA9A")),T.MEDIUMTURQUOISE=Object.freeze(T.fromCssColorString("#48D1CC")),T.MEDIUMVIOLETRED=Object.freeze(T.fromCssColorString("#C71585")),T.MIDNIGHTBLUE=Object.freeze(T.fromCssColorString("#191970")),T.MINTCREAM=Object.freeze(T.fromCssColorString("#F5FFFA")),T.MISTYROSE=Object.freeze(T.fromCssColorString("#FFE4E1")),T.MOCCASIN=Object.freeze(T.fromCssColorString("#FFE4B5")),T.NAVAJOWHITE=Object.freeze(T.fromCssColorString("#FFDEAD")),T.NAVY=Object.freeze(T.fromCssColorString("#000080")),T.OLDLACE=Object.freeze(T.fromCssColorString("#FDF5E6")),T.OLIVE=Object.freeze(T.fromCssColorString("#808000")),T.OLIVEDRAB=Object.freeze(T.fromCssColorString("#6B8E23")),T.ORANGE=Object.freeze(T.fromCssColorString("#FFA500")),T.ORANGERED=Object.freeze(T.fromCssColorString("#FF4500")),T.ORCHID=Object.freeze(T.fromCssColorString("#DA70D6")),T.PALEGOLDENROD=Object.freeze(T.fromCssColorString("#EEE8AA")),T.PALEGREEN=Object.freeze(T.fromCssColorString("#98FB98")),T.PALETURQUOISE=Object.freeze(T.fromCssColorString("#AFEEEE")),T.PALEVIOLETRED=Object.freeze(T.fromCssColorString("#DB7093")),T.PAPAYAWHIP=Object.freeze(T.fromCssColorString("#FFEFD5")),T.PEACHPUFF=Object.freeze(T.fromCssColorString("#FFDAB9")),T.PERU=Object.freeze(T.fromCssColorString("#CD853F")),T.PINK=Object.freeze(T.fromCssColorString("#FFC0CB")),T.PLUM=Object.freeze(T.fromCssColorString("#DDA0DD")),T.POWDERBLUE=Object.freeze(T.fromCssColorString("#B0E0E6")),T.PURPLE=Object.freeze(T.fromCssColorString("#800080")),T.RED=Object.freeze(T.fromCssColorString("#FF0000")),T.ROSYBROWN=Object.freeze(T.fromCssColorString("#BC8F8F")),T.ROYALBLUE=Object.freeze(T.fromCssColorString("#4169E1")),T.SADDLEBROWN=Object.freeze(T.fromCssColorString("#8B4513")),T.SALMON=Object.freeze(T.fromCssColorString("#FA8072")),T.SANDYBROWN=Object.freeze(T.fromCssColorString("#F4A460")),T.SEAGREEN=Object.freeze(T.fromCssColorString("#2E8B57")),T.SEASHELL=Object.freeze(T.fromCssColorString("#FFF5EE")),T.SIENNA=Object.freeze(T.fromCssColorString("#A0522D")),T.SILVER=Object.freeze(T.fromCssColorString("#C0C0C0")),T.SKYBLUE=Object.freeze(T.fromCssColorString("#87CEEB")),T.SLATEBLUE=Object.freeze(T.fromCssColorString("#6A5ACD")),T.SLATEGRAY=Object.freeze(T.fromCssColorString("#708090")),T.SLATEGREY=T.SLATEGRAY,T.SNOW=Object.freeze(T.fromCssColorString("#FFFAFA")),T.SPRINGGREEN=Object.freeze(T.fromCssColorString("#00FF7F")),T.STEELBLUE=Object.freeze(T.fromCssColorString("#4682B4")),T.TAN=Object.freeze(T.fromCssColorString("#D2B48C")),T.TEAL=Object.freeze(T.fromCssColorString("#008080")),T.THISTLE=Object.freeze(T.fromCssColorString("#D8BFD8")),T.TOMATO=Object.freeze(T.fromCssColorString("#FF6347")),T.TURQUOISE=Object.freeze(T.fromCssColorString("#40E0D0")),T.VIOLET=Object.freeze(T.fromCssColorString("#EE82EE")),T.WHEAT=Object.freeze(T.fromCssColorString("#F5DEB3")),T.WHITE=Object.freeze(T.fromCssColorString("#FFFFFF")),T.WHITESMOKE=Object.freeze(T.fromCssColorString("#F5F5F5")),T.YELLOW=Object.freeze(T.fromCssColorString("#FFFF00")),T.YELLOWGREEN=Object.freeze(T.fromCssColorString("#9ACD32")),T.TRANSPARENT=Object.freeze(new T(0,0,0,0));const Pt=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,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11});function U(e,t){this.x=_(e,0),this.y=_(t,0)}U.fromElements=function(e,t,n){return h(n)?(n.x=e,n.y=t,n):new U(e,t)},U.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t):new U(e.x,e.y)},U.fromCartesian3=U.clone,U.fromCartesian4=U.clone,U.packedLength=2,U.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n]=e.y,t},U.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new U),n.x=e[t++],n.y=e[t],n},U.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*2;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)U.pack(e[o],t,o*2);return t},U.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new C("array length must be a multiple of 2.");const n=e.length;h(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){const o=i/2;t[o]=U.unpack(e,i,t[o])}return t},U.fromArray=U.unpack,U.maximumComponent=function(e){return m.typeOf.object("cartesian",e),Math.max(e.x,e.y)},U.minimumComponent=function(e){return m.typeOf.object("cartesian",e),Math.min(e.x,e.y)},U.minimumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},U.maximumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},U.clamp=function(e,t,n,i){m.typeOf.object("value",e),m.typeOf.object("min",t),m.typeOf.object("max",n),m.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y);return i.x=o,i.y=s,i},U.magnitudeSquared=function(e){return m.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},U.magnitude=function(e){return Math.sqrt(U.magnitudeSquared(e))};const Es=new U;U.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,Es),U.magnitude(Es)},U.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,Es),U.magnitudeSquared(Es)},U.normalize=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=U.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new C("normalized result is not a number");return t},U.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y},U.cross=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.y-e.y*t.x},U.multiplyComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n},U.divideComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n},U.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n},U.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n},U.multiplyByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n},U.divideByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n},U.negate=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},U.abs=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const Rh=new U;U.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),U.multiplyByScalar(t,n,Rh),i=U.multiplyByScalar(e,1-n,i),U.add(Rh,i,i)};const zh=new U,Ph=new U;U.angleBetween=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.normalize(e,zh),U.normalize(t,Ph),S.acosClamped(U.dot(zh,Ph))};const E_=new U;U.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=U.normalize(e,E_);return U.abs(n,n),n.x<=n.y?t=U.clone(U.UNIT_X,t):t=U.clone(U.UNIT_Y,t),t},U.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y},U.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},U.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)},U.ZERO=Object.freeze(new U(0,0)),U.ONE=Object.freeze(new U(1,1)),U.UNIT_X=Object.freeze(new U(1,0)),U.UNIT_Y=Object.freeze(new U(0,1)),U.prototype.clone=function(e){return U.clone(this,e)},U.prototype.equals=function(e){return U.equals(this,e)},U.prototype.equalsEpsilon=function(e,t,n){return U.equalsEpsilon(this,e,t,n)},U.prototype.toString=function(){return`(${this.x}, ${this.y})`};const b_=new f,w_=new f;function Bh(e,t,n,i,o){if(!h(e))throw new C("cartesian is required.");if(!h(t))throw new C("oneOverRadii is required.");if(!h(n))throw new C("oneOverRadiiSquared is required.");if(!h(i))throw new C("centerToleranceSquared is required.");const s=e.x,a=e.y,c=e.z,l=t.x,u=t.y,d=t.z,p=s*s*l*l,g=a*a*u*u,y=c*c*d*d,x=p+g+y,E=Math.sqrt(1/x),b=f.multiplyByScalar(e,E,b_);if(x<i)return isFinite(E)?f.clone(b,o):void 0;const D=n.x,A=n.y,O=n.z,I=w_;I.x=b.x*D*2,I.y=b.y*A*2,I.z=b.z*O*2;let B=(1-E)*f.magnitude(e)/(.5*f.magnitude(I)),M=0,q,P,V,k,H,j,r,w,v,z,G;do{B-=M,V=1/(1+B*D),k=1/(1+B*A),H=1/(1+B*O),j=V*V,r=k*k,w=H*H,v=j*V,z=r*k,G=w*H,q=p*j+g*r+y*w-1,P=p*v*D+g*z*A+y*G*O;const W=-2*P;M=q/W}while(Math.abs(q)>S.EPSILON12);return h(o)?(o.x=s*V,o.y=a*k,o.z=c*H,o):new f(s*V,a*k,c*H)}function ee(e,t,n){this.longitude=_(e,0),this.latitude=_(t,0),this.height=_(n,0)}ee.fromRadians=function(e,t,n,i){return m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),n=_(n,0),h(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new ee(e,t,n)},ee.fromDegrees=function(e,t,n,i){return m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),ee.fromRadians(e,t,n,i)};const T_=new f,S_=new f,A_=new f;ee._ellipsoidOneOverRadii=new f(1/6378137,1/6378137,1/6356752314245179e-9),ee._ellipsoidOneOverRadiiSquared=new f(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),ee._ellipsoidCenterToleranceSquared=S.EPSILON1,ee.fromCartesian=function(e,t,n){const i=h(t)?t.oneOverRadii:ee._ellipsoidOneOverRadii,o=h(t)?t.oneOverRadiiSquared:ee._ellipsoidOneOverRadiiSquared,s=h(t)?t._centerToleranceSquared:ee._ellipsoidCenterToleranceSquared,a=Bh(e,i,o,s,S_);if(!h(a))return;let c=f.multiplyComponents(a,o,T_);c=f.normalize(c,c);const l=f.subtract(e,a,A_),u=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=S.sign(f.dot(l,e))*f.magnitude(l);return h(n)?(n.longitude=u,n.latitude=d,n.height=p,n):new ee(u,d,p)},ee.toCartesian=function(e,t,n){return m.defined("cartographic",e),f.fromRadians(e.longitude,e.latitude,e.height,t,n)},ee.clone=function(e,t){if(h(e))return h(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new ee(e.longitude,e.latitude,e.height)},ee.equals=function(e,t){return e===t||h(e)&&h(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},ee.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},ee.ZERO=Object.freeze(new ee(0,0,0)),ee.prototype.clone=function(e){return ee.clone(this,e)},ee.prototype.equals=function(e){return ee.equals(this,e)},ee.prototype.equalsEpsilon=function(e,t){return ee.equalsEpsilon(this,e,t)},ee.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Nh(e,t,n,i){t=_(t,0),n=_(n,0),i=_(i,0),m.typeOf.number.greaterThanOrEquals("x",t,0),m.typeOf.number.greaterThanOrEquals("y",n,0),m.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new f(t,n,i),e._radiiSquared=new f(t*t,n*n,i*i),e._radiiToTheFourth=new f(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new f(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new f(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=S.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function le(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,Nh(this,e,t,n)}Object.defineProperties(le.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}}}),le.clone=function(e,t){if(!h(e))return;const n=e._radii;return h(t)?(f.clone(n,t._radii),f.clone(e._radiiSquared,t._radiiSquared),f.clone(e._radiiToTheFourth,t._radiiToTheFourth),f.clone(e._oneOverRadii,t._oneOverRadii),f.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new le(n.x,n.y,n.z)},le.fromCartesian3=function(e,t){return h(t)||(t=new le),h(e)&&Nh(t,e.x,e.y,e.z),t},le.WGS84=Object.freeze(new le(6378137,6378137,6356752314245179e-9)),le.UNIT_SPHERE=Object.freeze(new le(1,1,1)),le.MOON=Object.freeze(new le(S.LUNAR_RADIUS,S.LUNAR_RADIUS,S.LUNAR_RADIUS)),le._default=le.WGS84,Object.defineProperties(le,{default:{get:function(){return le._default},set:function(e){m.typeOf.object("value",e),le._default=e,f._ellipsoidRadiiSquared=e.radiiSquared,ee._ellipsoidOneOverRadii=e.oneOverRadii,ee._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,ee._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}}),le.prototype.clone=function(e){return le.clone(this,e)},le.packedLength=f.packedLength,le.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),f.pack(e._radii,t,n),t},le.unpack=function(e,t,n){m.defined("array",e),t=_(t,0);const i=f.unpack(e,t);return le.fromCartesian3(i,n)},le.prototype.geocentricSurfaceNormal=f.normalize,le.prototype.geodeticSurfaceNormalCartographic=function(e,t){m.typeOf.object("cartographic",e);const n=e.longitude,i=e.latitude,o=Math.cos(i),s=o*Math.cos(n),a=o*Math.sin(n),c=Math.sin(i);return h(t)||(t=new f),t.x=s,t.y=a,t.z=c,f.normalize(t,t)},le.prototype.geodeticSurfaceNormal=function(e,t){if(m.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new C("cartesian has a NaN component");if(!f.equalsEpsilon(e,f.ZERO,S.EPSILON14))return h(t)||(t=new f),t=f.multiplyComponents(e,this._oneOverRadiiSquared,t),f.normalize(t,t)};const D_=new f,O_=new f;le.prototype.cartographicToCartesian=function(e,t){const n=D_,i=O_;this.geodeticSurfaceNormalCartographic(e,n),f.multiplyComponents(this._radiiSquared,n,i);const o=Math.sqrt(f.dot(n,i));return f.divideByScalar(i,o,i),f.multiplyByScalar(n,e.height,n),h(t)||(t=new f),f.add(i,n,t)},le.prototype.cartographicArrayToCartesianArray=function(e,t){m.defined("cartographics",e);const n=e.length;h(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 v_=new f,I_=new f,R_=new f;le.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,I_);if(!h(n))return;const i=this.geodeticSurfaceNormal(n,v_),o=f.subtract(e,n,R_),s=Math.atan2(i.y,i.x),a=Math.asin(i.z),c=S.sign(f.dot(o,e))*f.magnitude(o);return h(t)?(t.longitude=s,t.latitude=a,t.height=c,t):new ee(s,a,c)},le.prototype.cartesianArrayToCartographicArray=function(e,t){m.defined("cartesians",e);const n=e.length;h(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},le.prototype.scaleToGeodeticSurface=function(e,t){return Bh(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},le.prototype.scaleToGeocentricSurface=function(e,t){m.typeOf.object("cartesian",e),h(t)||(t=new f);const n=e.x,i=e.y,o=e.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+i*i*s.y+o*o*s.z);return f.multiplyByScalar(e,a,t)},le.prototype.transformPositionToScaledSpace=function(e,t){return h(t)||(t=new f),f.multiplyComponents(e,this._oneOverRadii,t)},le.prototype.transformPositionFromScaledSpace=function(e,t){return h(t)||(t=new f),f.multiplyComponents(e,this._radii,t)},le.prototype.equals=function(e){return this===e||h(e)&&f.equals(this._radii,e._radii)},le.prototype.toString=function(){return this._radii.toString()},le.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(m.typeOf.object("position",e),!S.equalsEpsilon(this._radii.x,this._radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");m.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=_(t,0);const i=this._squaredXOverSquaredZ;if(h(n)||(n=new f),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};const z_=new f;le.prototype.getLocalCurvature=function(e,t){m.typeOf.object("surfacePosition",e),h(t)||(t=new U);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,z_),i=f.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,s=i*o**2;return U.fromElements(1/i,1/s,t)};const P_=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],B_=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Fh(e,t,n){m.typeOf.number("a",e),m.typeOf.number("b",t),m.typeOf.func("func",n);const i=.5*(t+e),o=.5*(t-e);let s=0;for(let a=0;a<5;a++){const c=o*P_[a];s+=B_[a]*(n(i+c)+n(i-c))}return s*=o,s}le.prototype.surfaceArea=function(e){m.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const i=e.south,o=e.north;for(;n<t;)n+=S.TWO_PI;const s=this._radiiSquared,a=s.x,c=s.y,l=s.z,u=a*c;return Fh(i,o,function(d){const p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Fh(t,n,function(y){const x=Math.cos(y),E=Math.sin(y);return Math.sqrt(u*g*g+l*(c*x*x+a*E*E)*p*p)})})};function Sn(e){this._ellipsoid=_(e,le.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Sn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Sn.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,s=e.height;return h(t)?(t.x=i,t.y=o,t.z=s,t):new f(i,o,s)},Sn.prototype.unproject=function(e,t){if(!h(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,s=e.z;return h(t)?(t.longitude=i,t.latitude=o,t.height=s,t):new ee(i,o,s)};const Et=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function Ko(e,t,n){m.defined("array",e),m.defined("itemToFind",t),m.defined("comparator",n);let i=0,o=e.length-1,s,a;for(;i<=o;){if(s=~~((i+o)/2),a=n(e[s],t),a<0){i=s+1;continue}if(a>0){o=s-1;continue}return s}return~(o+1)}function Xa(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}function $a(e){if(e===null||isNaN(e))throw new C("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}const Lh=[31,28,31,30,31,30,31,31,30,31,30,31];function Za(e,t,n,i,o,s,a,c){e=_(e,1),t=_(t,1),n=_(n,1),i=_(i,0),o=_(o,0),s=_(s,0),a=_(a,0),c=_(c,!1),E(),b(),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=s,this.millisecond=a,this.isLeapSecond=c;function E(){m.typeOf.number.greaterThanOrEquals("Year",e,1),m.typeOf.number.lessThanOrEquals("Year",e,9999),m.typeOf.number.greaterThanOrEquals("Month",t,1),m.typeOf.number.lessThanOrEquals("Month",t,12),m.typeOf.number.greaterThanOrEquals("Day",n,1),m.typeOf.number.lessThanOrEquals("Day",n,31),m.typeOf.number.greaterThanOrEquals("Hour",i,0),m.typeOf.number.lessThanOrEquals("Hour",i,23),m.typeOf.number.greaterThanOrEquals("Minute",o,0),m.typeOf.number.lessThanOrEquals("Minute",o,59),m.typeOf.bool("IsLeapSecond",c),m.typeOf.number.greaterThanOrEquals("Second",s,0),m.typeOf.number.lessThanOrEquals("Second",s,c?60:59),m.typeOf.number.greaterThanOrEquals("Millisecond",a,0),m.typeOf.number.lessThan("Millisecond",a,1e3)}function b(){const D=t===2&&$a(e)?Lh[t-1]+1:Lh[t-1];if(n>D)throw new C("Month and Day represents invalid date")}}function Ge(e,t){this.julianDate=e,this.offset=t}const nt=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:24000005e-1}),ve=Object.freeze({UTC:0,TAI:1}),Mh=new Za,bs=[31,28,31,30,31,30,31,31,30,31,30,31],ws=29;function Ka(e,t){return $.compare(e.julianDate,t.julianDate)}const Eo=new Ge;function Ts(e){Eo.julianDate=e;const t=$.leapSeconds;let n=Ko(t,Eo,Ka);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&$.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),$.addSeconds(e,i,e)}function Uh(e,t){Eo.julianDate=e;const n=$.leapSeconds;let i=Ko(n,Eo,Ka);if(i<0&&(i=~i),i===0)return $.addSeconds(e,-n[0].offset,t);if(i>=n.length)return $.addSeconds(e,-n[i-1].offset,t);const o=$.secondsDifference(n[i].julianDate,e);if(o===0)return $.addSeconds(e,-n[i].offset,t);if(!(o<=1))return $.addSeconds(e,-n[--i].offset,t)}function Oi(e,t,n){const i=t/nt.SECONDS_PER_DAY|0;return e+=i,t-=nt.SECONDS_PER_DAY*i,t<0&&(e--,t+=nt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Qa(e,t,n,i,o,s,a){const c=(t-14)/12|0,l=e+4800+c;let u=(1461*l/4|0)+(367*(t-2-12*c)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);const d=s+(i*nt.SECONDS_PER_HOUR+o*nt.SECONDS_PER_MINUTE+a*nt.SECONDS_PER_MILLISECOND);return d>=43200&&(u-=1),[u,d]}const N_=/^(\d{4})$/,F_=/^(\d{4})-(\d{2})$/,L_=/^(\d{4})-?(\d{3})$/,M_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,U_=/^(\d{4})-?(\d{2})-?(\d{2})$/,Ja=/([Z+\-])?(\d{2})?:?(\d{2})?$/,k_=/^(\d{2})(\.\d+)?/.source+Ja.source,V_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Ja.source,G_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Ja.source,An="Invalid ISO 8601 date.";function $(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=_(e,0),t=_(t,0),n=_(n,ve.UTC);const i=e|0;t=t+(e-i)*nt.SECONDS_PER_DAY,Oi(i,t,this),n===ve.UTC&&Ts(this)}$.fromGregorianDate=function(e,t){if(!(e instanceof Za))throw new C("date must be a valid GregorianDate.");const n=Qa(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return h(t)?(Oi(n[0],n[1],t),Ts(t),t):new $(n[0],n[1],ve.UTC)},$.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");const n=Qa(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return h(t)?(Oi(n[0],n[1],t),Ts(t),t):new $(n[0],n[1],ve.UTC)},$.fromIso8601=function(e,t){if(typeof e!="string")throw new C(An);e=e.replace(",",".");let n=e.split("T"),i,o=1,s=1,a=0,c=0,l=0,u=0;const d=n[0],p=n[1];let g,y;if(!h(d))throw new C(An);let x;if(n=d.match(U_),n!==null){if(x=d.split("-").length-1,x>0&&x!==2)throw new C(An);i=+n[1],o=+n[2],s=+n[3]}else if(n=d.match(F_),n!==null)i=+n[1],o=+n[2];else if(n=d.match(N_),n!==null)i=+n[1];else{let A;if(n=d.match(L_),n!==null){if(i=+n[1],A=+n[2],y=$a(i),A<1||y&&A>366||!y&&A>365)throw new C(An)}else if(n=d.match(M_),n!==null){i=+n[1];const O=+n[2],I=+n[3]||0;if(x=d.split("-").length-1,x>0&&(!h(n[3])&&x!==1||h(n[3])&&x!==2))throw new C(An);const B=new Date(Date.UTC(i,0,4));A=O*7+I-B.getUTCDay()-3}else throw new C(An);g=new Date(Date.UTC(i,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}if(y=$a(i),o<1||o>12||s<1||(o!==2||!y)&&s>bs[o-1]||y&&o===2&&s>ws)throw new C(An);let E;if(h(p)){if(n=p.match(G_),n!==null){if(x=p.split(":").length-1,x>0&&x!==2&&x!==3)throw new C(An);a=+n[1],c=+n[2],l=+n[3],u=+(n[4]||0)*1e3,E=5}else if(n=p.match(V_),n!==null){if(x=p.split(":").length-1,x>2)throw new C(An);a=+n[1],c=+n[2],l=+(n[3]||0)*60,E=4}else if(n=p.match(k_),n!==null)a=+n[1],c=+(n[2]||0)*60,E=3;else throw new C(An);if(c>=60||l>=61||a>24||a===24&&(c>0||l>0||u>0))throw new C(An);const A=n[E],O=+n[E+1],I=+(n[E+2]||0);switch(A){case"+":a=a-O,c=c-I;break;case"-":a=a+O,c=c+I;break;case"Z":break;default:c=c+new Date(Date.UTC(i,o-1,s,a,c)).getTimezoneOffset();break}}const b=l===60;for(b&&l--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(g=y&&o===2?ws:bs[o-1];s>g;)s-=g,o++,o>12&&(o-=12,i++),g=y&&o===2?ws:bs[o-1];for(;c<0;)c+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)o--,o<1&&(o+=12,i--),g=y&&o===2?ws:bs[o-1],s+=g;const D=Qa(i,o,s,a,c,l,u);return h(t)?(Oi(D[0],D[1],t),Ts(t)):t=new $(D[0],D[1],ve.UTC),b&&$.addSeconds(t,1,t),t},$.now=function(e){return $.fromDate(new Date,e)};const Ss=new $(0,0,ve.TAI);$.toGregorianDate=function(e,t){if(!h(e))throw new C("julianDate is required.");let n=!1,i=Uh(e,Ss);h(i)||($.addSeconds(e,-1,Ss),i=Uh(Ss,Ss),n=!0);let o=i.dayNumber;const s=i.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0;const c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;const l=4e3*(a+1)/1461001|0;a=a-(1461*l/4|0)+31|0;const u=80*a/2447|0,d=a-(2447*u/80|0)|0;a=u/11|0;const p=u+2-12*a|0,g=100*(c-49)+l+a|0;let y=s/nt.SECONDS_PER_HOUR|0,x=s-y*nt.SECONDS_PER_HOUR;const E=x/nt.SECONDS_PER_MINUTE|0;x=x-E*nt.SECONDS_PER_MINUTE;let b=x|0;const D=(x-b)/nt.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(b+=1),h(t)?(t.year=g,t.month=p,t.day=d,t.hour=y,t.minute=E,t.second=b,t.millisecond=D,t.isLeapSecond=n,t):new Za(g,p,d,y,E,b,D,n)},$.toDate=function(e){if(!h(e))throw new C("julianDate is required.");const t=$.toGregorianDate(e,Mh);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))},$.toIso8601=function(e,t){if(!h(e))throw new C("julianDate is required.");const n=$.toGregorianDate(e,Mh);let i=n.year,o=n.month,s=n.day,a=n.hour;const c=n.minute,l=n.second,u=n.millisecond;i===1e4&&o===1&&s===1&&a===0&&c===0&&l===0&&u===0&&(i=9999,o=12,s=31,a=24);let d;return!h(t)&&u!==0?(d=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${d}Z`):!h(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(d=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${d}Z`)},$.clone=function(e,t){if(h(e))return h(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new $(e.dayNumber,e.secondsOfDay,ve.TAI)},$.compare=function(e,t){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay},$.equals=function(e,t){return e===t||h(e)&&h(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},$.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(t)&&Math.abs($.secondsDifference(e,t))<=n},$.totalDays=function(e){if(!h(e))throw new C("julianDate is required.");return e.dayNumber+e.secondsOfDay/nt.SECONDS_PER_DAY},$.secondsDifference=function(e,t){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");return(e.dayNumber-t.dayNumber)*nt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},$.daysDifference=function(e,t){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/nt.SECONDS_PER_DAY;return n+i},$.computeTaiMinusUtc=function(e){Eo.julianDate=e;const t=$.leapSeconds;let n=Ko(t,Eo,Ka);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},$.addSeconds=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("seconds is required.");if(!h(n))throw new C("result is required.");return Oi(e.dayNumber,e.secondsOfDay+t,n)},$.addMinutes=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("minutes is required.");if(!h(n))throw new C("result is required.");const i=e.secondsOfDay+t*nt.SECONDS_PER_MINUTE;return Oi(e.dayNumber,i,n)},$.addHours=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("hours is required.");if(!h(n))throw new C("result is required.");const i=e.secondsOfDay+t*nt.SECONDS_PER_HOUR;return Oi(e.dayNumber,i,n)},$.addDays=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("days is required.");if(!h(n))throw new C("result is required.");const i=e.dayNumber+t;return Oi(i,e.secondsOfDay,n)},$.lessThan=function(e,t){return $.compare(e,t)<0},$.lessThanOrEquals=function(e,t){return $.compare(e,t)<=0},$.greaterThan=function(e,t){return $.compare(e,t)>0},$.greaterThanOrEquals=function(e,t){return $.compare(e,t)>=0},$.prototype.clone=function(e){return $.clone(this,e)},$.prototype.equals=function(e){return $.equals(this,e)},$.prototype.equalsEpsilon=function(e,t){return $.equalsEpsilon(this,e,t)},$.prototype.toString=function(){return $.toIso8601(this)},$.leapSeconds=[new Ge(new $(2441317,43210,ve.TAI),10),new Ge(new $(2441499,43211,ve.TAI),11),new Ge(new $(2441683,43212,ve.TAI),12),new Ge(new $(2442048,43213,ve.TAI),13),new Ge(new $(2442413,43214,ve.TAI),14),new Ge(new $(2442778,43215,ve.TAI),15),new Ge(new $(2443144,43216,ve.TAI),16),new Ge(new $(2443509,43217,ve.TAI),17),new Ge(new $(2443874,43218,ve.TAI),18),new Ge(new $(2444239,43219,ve.TAI),19),new Ge(new $(2444786,43220,ve.TAI),20),new Ge(new $(2445151,43221,ve.TAI),21),new Ge(new $(2445516,43222,ve.TAI),22),new Ge(new $(2446247,43223,ve.TAI),23),new Ge(new $(2447161,43224,ve.TAI),24),new Ge(new $(2447892,43225,ve.TAI),25),new Ge(new $(2448257,43226,ve.TAI),26),new Ge(new $(2448804,43227,ve.TAI),27),new Ge(new $(2449169,43228,ve.TAI),28),new Ge(new $(2449534,43229,ve.TAI),29),new Ge(new $(2450083,43230,ve.TAI),30),new Ge(new $(2450630,43231,ve.TAI),31),new Ge(new $(2451179,43232,ve.TAI),32),new Ge(new $(2453736,43233,ve.TAI),33),new Ge(new $(2454832,43234,ve.TAI),34),new Ge(new $(2456109,43235,ve.TAI),35),new Ge(new $(2457204,43236,ve.TAI),36),new Ge(new $(2457754,43237,ve.TAI),37)];var kh={exports:{}},Qo={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */Qo.exports;var Vh;function q_(){return Vh||(Vh=1,function(e,t){(function(n){var i=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,s=typeof _o=="object"&&_o;(s.global===s||s.window===s||s.self===s)&&(n=s);var a,c=2147483647,l=36,u=1,d=26,p=38,g=700,y=72,x=128,E="-",b=/^xn--/,D=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=l-u,B=Math.floor,M=String.fromCharCode,q;function P(X){throw new RangeError(O[X])}function V(X,ie){for(var se=X.length,ge=[];se--;)ge[se]=ie(X[se]);return ge}function k(X,ie){var se=X.split("@"),ge="";se.length>1&&(ge=se[0]+"@",X=se[1]),X=X.replace(A,".");var be=X.split("."),xe=V(be,ie).join(".");return ge+xe}function H(X){for(var ie=[],se=0,ge=X.length,be,xe;se<ge;)be=X.charCodeAt(se++),be>=55296&&be<=56319&&se<ge?(xe=X.charCodeAt(se++),(xe&64512)==56320?ie.push(((be&1023)<<10)+(xe&1023)+65536):(ie.push(be),se--)):ie.push(be);return ie}function j(X){return V(X,function(ie){var se="";return ie>65535&&(ie-=65536,se+=M(ie>>>10&1023|55296),ie=56320|ie&1023),se+=M(ie),se}).join("")}function r(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:l}function w(X,ie){return X+22+75*(X<26)-((ie!=0)<<5)}function v(X,ie,se){var ge=0;for(X=se?B(X/g):X>>1,X+=B(X/ie);X>I*d>>1;ge+=l)X=B(X/I);return B(ge+(I+1)*X/(X+p))}function z(X){var ie=[],se=X.length,ge,be=0,xe=x,ze=y,je,tt,ut,Be,yt,Dt,xt,cn,ln;for(je=X.lastIndexOf(E),je<0&&(je=0),tt=0;tt<je;++tt)X.charCodeAt(tt)>=128&&P("not-basic"),ie.push(X.charCodeAt(tt));for(ut=je>0?je+1:0;ut<se;){for(Be=be,yt=1,Dt=l;ut>=se&&P("invalid-input"),xt=r(X.charCodeAt(ut++)),(xt>=l||xt>B((c-be)/yt))&&P("overflow"),be+=xt*yt,cn=Dt<=ze?u:Dt>=ze+d?d:Dt-ze,!(xt<cn);Dt+=l)ln=l-cn,yt>B(c/ln)&&P("overflow"),yt*=ln;ge=ie.length+1,ze=v(be-Be,ge,Be==0),B(be/ge)>c-xe&&P("overflow"),xe+=B(be/ge),be%=ge,ie.splice(be++,0,xe)}return j(ie)}function G(X){var ie,se,ge,be,xe,ze,je,tt,ut,Be,yt,Dt=[],xt,cn,ln,kn;for(X=H(X),xt=X.length,ie=x,se=0,xe=y,ze=0;ze<xt;++ze)yt=X[ze],yt<128&&Dt.push(M(yt));for(ge=be=Dt.length,be&&Dt.push(E);ge<xt;){for(je=c,ze=0;ze<xt;++ze)yt=X[ze],yt>=ie&&yt<je&&(je=yt);for(cn=ge+1,je-ie>B((c-se)/cn)&&P("overflow"),se+=(je-ie)*cn,ie=je,ze=0;ze<xt;++ze)if(yt=X[ze],yt<ie&&++se>c&&P("overflow"),yt==ie){for(tt=se,ut=l;Be=ut<=xe?u:ut>=xe+d?d:ut-xe,!(tt<Be);ut+=l)kn=tt-Be,ln=l-Be,Dt.push(M(w(Be+kn%ln,0))),tt=B(kn/ln);Dt.push(M(w(tt,0))),xe=v(se,cn,ge==be),se=0,++ge}++se,++ie}return Dt.join("")}function W(X){return k(X,function(ie){return b.test(ie)?z(ie.slice(4).toLowerCase()):ie})}function Z(X){return k(X,function(ie){return D.test(ie)?"xn--"+G(ie):ie})}if(a={version:"1.3.2",ucs2:{decode:H,encode:j},decode:z,encode:G,toASCII:Z,toUnicode:W},i&&o)if(e.exports==i)o.exports=a;else for(q in a)a.hasOwnProperty(q)&&(i[q]=a[q]);else n.punycode=a})(_o)}(Qo,Qo.exports)),Qo.exports}var ec={exports:{}};/*!
8
+ (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};const R=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}),r_=new f;function re(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const zt={};zt[R.FLOAT]="float",zt[R.FLOAT_VEC2]="vec2",zt[R.FLOAT_VEC3]="vec3",zt[R.FLOAT_VEC4]="vec4",zt[R.INT]="int",zt[R.INT_VEC2]="ivec2",zt[R.INT_VEC3]="ivec3",zt[R.INT_VEC4]="ivec4",zt[R.BOOL]="bool",zt[R.BOOL_VEC2]="bvec2",zt[R.BOOL_VEC3]="bvec3",zt[R.BOOL_VEC4]="bvec4",zt[R.FLOAT_MAT2]="mat2",zt[R.FLOAT_MAT3]="mat3",zt[R.FLOAT_MAT4]="mat4",zt[R.SAMPLER_2D]="sampler2D",zt[R.SAMPLER_CUBE]="samplerCube",re.prototype.getDeclaration=function(e){let t=`uniform ${zt[this._datatype]} ${e}`;const n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};const fs={czm_viewport:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new re({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new re({size:1,datatype:R.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new re({size:1,datatype:R.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,r_)}}),czm_frameNumber:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new re({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new re({size:1,datatype:R.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new re({size:1,datatype:R.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new re({size:9,datatype:R.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new re({size:1,datatype:R.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogMinimumBrightness:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new re({size:1,datatype:R.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new re({size:1,datatype:R.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new re({size:1,datatype:R.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})};function Vn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function s_(){return!0}function Qe(e,t){t=_(t,"This object was destroyed, i.e., destroy() was called.");function n(){throw new C(t)}for(const i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=s_}const Ot={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT};Ot.getSizeInBytes=function(e){switch(e){case Ot.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ot.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ot.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")},Ot.fromSizeInBytes=function(e){switch(e){case 2:return Ot.UNSIGNED_SHORT;case 4:return Ot.UNSIGNED_INT;case 1:return Ot.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}},Ot.validate=function(e){return h(e)&&(e===Ot.UNSIGNED_BYTE||e===Ot.UNSIGNED_SHORT||e===Ot.UNSIGNED_INT)},Ot.createTypedArray=function(e,t){if(!h(e))throw new C("numberOfVertices is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},Ot.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!h(e))throw new C("numberOfVertices is required.");if(!h(t))throw new C("sourceArray is required.");if(!h(n))throw new C("byteOffset is required.");return e>=S.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},Ot.fromTypedArray=function(e){if(e instanceof Uint8Array)return Ot.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Ot.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Ot.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};const Ct=Object.freeze(Ot),us={STREAM_DRAW:R.STREAM_DRAW,STATIC_DRAW:R.STATIC_DRAW,DYNAMIC_DRAW:R.DYNAMIC_DRAW,validate:function(e){return e===us.STREAM_DRAW||e===us.STATIC_DRAW||e===us.DYNAMIC_DRAW}},De=Object.freeze(us);function vt(e){if(e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),!h(e.typedArray)&&!h(e.sizeInBytes))throw new C("Either options.sizeInBytes or options.typedArray is required.");if(h(e.typedArray)&&h(e.sizeInBytes))throw new C("Cannot pass in both options.sizeInBytes and options.typedArray.");if(h(e.typedArray)&&(m.typeOf.object("options.typedArray",e.typedArray),m.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!De.validate(e.usage))throw new C("usage is invalid.");const t=e.context._gl,n=e.bufferTarget,i=e.typedArray;let o=e.sizeInBytes;const s=e.usage,a=h(i);a&&(o=i.byteLength),m.typeOf.number.greaterThan("sizeInBytes",o,0);const c=t.createBuffer();t.bindBuffer(n,c),t.bufferData(n,a?i:o,s),t.bindBuffer(n,null),this._id=Vn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=s,this._buffer=c,this.vertexArrayDestroyable=!0}vt.createVertexBuffer=function(e){return m.defined("options.context",e.context),new vt({context:e.context,bufferTarget:R.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},vt.createIndexBuffer=function(e){if(m.defined("options.context",e.context),!Ct.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===Ct.UNSIGNED_INT&&!e.context.elementIndexUint)throw new C("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=Ct.getSizeInBytes(n),o=new vt({context:t,bufferTarget:R.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),s=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return s}}}),o},Object.defineProperties(vt.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),vt.prototype._getBuffer=function(){return this._buffer},vt.prototype.copyFromArrayView=function(e,t){t=_(t,0),m.defined("arrayView",e),m.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)},vt.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new C("A WebGL 2 context is required.");if(!h(e))throw new C("readBuffer must be defined.");if(!h(i)||i<=0)throw new C("sizeInBytes must be defined and be greater than zero.");if(!h(t)||t<0||t+i>e._sizeInBytes)throw new C("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!h(n)||n<0||n+i>this._sizeInBytes)throw new C("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 C("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==R.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==R.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===R.ELEMENT_ARRAY_BUFFER)throw new C("Can not copy an index buffer into another buffer type.");const o=R.COPY_READ_BUFFER,s=R.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(s,this._buffer),a.bindBuffer(o,e._buffer),a.copyBufferSubData(o,s,t,n,i),a.bindBuffer(s,null),a.bindBuffer(o,null)},vt.prototype.getBufferData=function(e,t,n,i){if(t=_(t,0),n=_(n,0),!this._webgl2)throw new C("A WebGL 2 context is required.");if(!h(e))throw new C("arrayView is required.");let o,s,a=e.byteLength;if(h(i)?(o=i,h(a)?s=1:(a=e.length,s=e.BYTES_PER_ELEMENT)):h(a)?(o=a-n,s=1):(a=e.length,o=a-n,s=e.BYTES_PER_ELEMENT),n<0||n>a)throw new C("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>a)throw new C("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new C("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*s>this._sizeInBytes)throw new C("sourceOffset + length must be less than the buffers size.");const c=this._gl,l=R.COPY_READ_BUFFER;c.bindBuffer(l,this._buffer),c.getBufferSubData(l,t,e,n,i),c.bindBuffer(l,null)},vt.prototype.isDestroyed=function(){return!1},vt.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),Qe(this)};let Oi;const ct={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},en={};Object.defineProperties(en,{element:{get:function(){if(en.supportsFullscreen())return document[ct.fullscreenElement]}},changeEventName:{get:function(){if(en.supportsFullscreen())return ct.fullscreenchange}},errorEventName:{get:function(){if(en.supportsFullscreen())return ct.fullscreenerror}},enabled:{get:function(){if(en.supportsFullscreen())return document[ct.fullscreenEnabled]}},fullscreen:{get:function(){if(en.supportsFullscreen())return en.element!==null}}}),en.supportsFullscreen=function(){if(h(Oi))return Oi;Oi=!1;const e=document.body;if(typeof e.requestFullscreen=="function")return ct.requestFullscreen="requestFullscreen",ct.exitFullscreen="exitFullscreen",ct.fullscreenEnabled="fullscreenEnabled",ct.fullscreenElement="fullscreenElement",ct.fullscreenchange="fullscreenchange",ct.fullscreenerror="fullscreenerror",Oi=!0,Oi;const t=["webkit","moz","o","ms","khtml"];let n;for(let i=0,o=t.length;i<o;++i){const s=t[i];n=`${s}RequestFullscreen`,typeof e[n]=="function"?(ct.requestFullscreen=n,Oi=!0):(n=`${s}RequestFullScreen`,typeof e[n]=="function"&&(ct.requestFullscreen=n,Oi=!0)),n=`${s}ExitFullscreen`,typeof document[n]=="function"?ct.exitFullscreen=n:(n=`${s}CancelFullScreen`,typeof document[n]=="function"&&(ct.exitFullscreen=n)),n=`${s}FullscreenEnabled`,document[n]!==void 0?ct.fullscreenEnabled=n:(n=`${s}FullScreenEnabled`,document[n]!==void 0&&(ct.fullscreenEnabled=n)),n=`${s}FullscreenElement`,document[n]!==void 0?ct.fullscreenElement=n:(n=`${s}FullScreenElement`,document[n]!==void 0&&(ct.fullscreenElement=n)),n=`${s}fullscreenchange`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenChange"),ct.fullscreenchange=n),n=`${s}fullscreenerror`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenError"),ct.fullscreenerror=n)}return Oi},en.requestFullscreen=function(e,t){en.supportsFullscreen()&&e[ct.requestFullscreen]({vrDisplay:t})},en.exitFullscreen=function(){en.supportsFullscreen()&&document[ct.exitFullscreen]()},en._names=ct;let Gt;typeof navigator<"u"?Gt=navigator:Gt={};function Xi(e){const t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}let ds,wh;function Ma(){if(!h(ds)&&(ds=!1,!gs())){const e=/ Chrome\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ds=!0,wh=Xi(e[1]))}return ds}function a_(){return Ma()&&wh}let ps,Th;function Sh(){if(!h(ps)&&(ps=!1,!Ma()&&!gs()&&/ Safari\/[\.0-9]+/.test(Gt.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ps=!0,Th=Xi(e[1]))}return ps}function c_(){return Sh()&&Th}let ms,Ua;function Ah(){if(!h(ms)){ms=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Gt.userAgent);e!==null&&(ms=!0,Ua=Xi(e[1]),Ua.isNightly=!!e[2])}return ms}function l_(){return Ah()&&Ua}let Zo,ka;function Dh(){if(!h(Zo)){Zo=!1;let e;Gt.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Gt.userAgent),e!==null&&(Zo=!0,ka=Xi(e[1]))):Gt.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Gt.userAgent),e!==null&&(Zo=!0,ka=Xi(e[1])))}return Zo}function h_(){return Dh()&&ka}let _s,Oh;function gs(){if(!h(_s)){_s=!1;const e=/ Edg\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(_s=!0,Oh=Xi(e[1]))}return _s}function f_(){return gs()&&Oh}let ys,Va;function xs(){if(!h(ys)){ys=!1;const e=/Firefox\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ys=!0,Va=Xi(e[1]))}return ys}let Ga;function u_(){return h(Ga)||(Ga=/Windows/i.test(Gt.appVersion)),Ga}let qa;function d_(){return h(qa)||(qa=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),qa}function p_(){return xs()&&Va}let Ha;function m_(){return h(Ha)||(Ha=!xs()&&typeof PointerEvent<"u"&&(!h(Gt.pointerEnabled)||Gt.pointerEnabled)),Ha}let vh,Cs;function Ih(){if(!h(Cs)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;Cs=h(t)&&t!=="",Cs&&(vh=t)}return Cs}function __(){return Ih()?vh:void 0}function qt(){if(!qt.initialized)throw new C("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return qt._result}qt._promise=void 0,qt._result=void 0,qt.initialize=function(){return h(qt._promise)||(qt._promise=new Promise(e=>{const t=new Image;t.onload=function(){qt._result=t.width>0&&t.height>0,e(qt._result)},t.onerror=function(){qt._result=!1,e(qt._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),qt._promise},Object.defineProperties(qt,{initialized:{get:function(){return h(qt._result)}}});const Co=[];typeof ArrayBuffer<"u"&&(Co.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Co.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&Co.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&Co.push(BigInt64Array),typeof BigUint64Array<"u"&&Co.push(BigUint64Array));const _t={isChrome:Ma,chromeVersion:a_,isSafari:Sh,safariVersion:c_,isWebkit:Ah,webkitVersion:l_,isInternetExplorer:Dh,internetExplorerVersion:h_,isEdge:gs,edgeVersion:f_,isFirefox:xs,firefoxVersion:p_,isWindows:u_,isIPadOrIOS:d_,hardwareConcurrency:_(Gt.hardwareConcurrency,3),supportsPointerEvents:m_,supportsImageRenderingPixelated:Ih,supportsWebP:qt,imageRenderingValue:__,typedArrayTypes:Co};_t.supportsBasis=function(e){return _t.supportsWebAssembly()&&e.context.supportsBasis},_t.supportsFullscreen=function(){return en.supportsFullscreen()},_t.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},_t.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},_t.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},_t.supportsBigInt=function(){return typeof BigInt<"u"},_t.supportsWebWorkers=function(){return typeof Worker<"u"},_t.supportsWebAssembly=function(){return typeof WebAssembly<"u"},_t.supportsWebgl2=function(e){return m.defined("scene",e),e.context.webgl2},_t.supportsEsmWebWorkers=function(){return!xs()||parseInt(Va)>=114};function Wa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function T(e,t,n,i){this.red=_(e,1),this.green=_(t,1),this.blue=_(n,1),this.alpha=_(i,1)}T.fromCartesian4=function(e,t){return m.typeOf.object("cartesian",e),h(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new T(e.x,e.y,e.z,e.w)},T.fromBytes=function(e,t,n,i,o){return e=T.byteToFloat(_(e,255)),t=T.byteToFloat(_(t,255)),n=T.byteToFloat(_(n,255)),i=T.byteToFloat(_(i,255)),h(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new T(e,t,n,i)},T.fromAlpha=function(e,t,n){return m.typeOf.object("color",e),m.typeOf.number("alpha",t),h(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new T(e.red,e.green,e.blue,t)};let ja,Ya,ai;_t.supportsTypedArrays()&&(ja=new ArrayBuffer(4),Ya=new Uint32Array(ja),ai=new Uint8Array(ja)),T.fromRgba=function(e,t){return Ya[0]=e,T.fromBytes(ai[0],ai[1],ai[2],ai[3],t)},T.fromHsl=function(e,t,n,i,o){e=_(e,0)%1,t=_(t,0),n=_(n,0),i=_(i,1);let s=n,a=n,c=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;const u=2*n-l;s=Wa(u,l,e+1/3),a=Wa(u,l,e),c=Wa(u,l,e-1/3)}return h(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=i,o):new T(s,a,c,i)},T.fromRandom=function(e,t){e=_(e,_.EMPTY_OBJECT);let n=e.red;if(!h(n)){const a=_(e.minimumRed,0),c=_(e.maximumRed,1);m.typeOf.number.lessThanOrEquals("minimumRed",a,c),n=a+S.nextRandomNumber()*(c-a)}let i=e.green;if(!h(i)){const a=_(e.minimumGreen,0),c=_(e.maximumGreen,1);m.typeOf.number.lessThanOrEquals("minimumGreen",a,c),i=a+S.nextRandomNumber()*(c-a)}let o=e.blue;if(!h(o)){const a=_(e.minimumBlue,0),c=_(e.maximumBlue,1);m.typeOf.number.lessThanOrEquals("minimumBlue",a,c),o=a+S.nextRandomNumber()*(c-a)}let s=e.alpha;if(!h(s)){const a=_(e.minimumAlpha,0),c=_(e.maximumAlpha,1);m.typeOf.number.lessThanOrEquals("minumumAlpha",a,c),s=a+S.nextRandomNumber()*(c-a)}return h(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=s,t):new T(n,i,o,s)};const g_=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,y_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,x_=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,C_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;T.fromCssColorString=function(e,t){m.typeOf.string("color",e),h(t)||(t=new T),e=e.trim();const n=T[e.toUpperCase()];if(h(n))return T.clone(n,t),t;let i=g_.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(_(i[4],"f"),16)/15,t):(i=y_.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(_(i[4],"ff"),16)/255,t):(i=x_.exec(e),i!==null?(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(_(i[4],"1.0")),t):(i=C_.exec(e),i!==null?T.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(_(i[4],"1.0")),t):(t=void 0,t))))},T.packedLength=4,T.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t},T.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new T),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},T.byteToFloat=function(e){return e/255},T.floatToByte=function(e){return e===1?255:e*256|0},T.clone=function(e,t){if(h(e))return h(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new T(e.red,e.green,e.blue,e.alpha)},T.equals=function(e,t){return e===t||h(e)&&h(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},T.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]},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 this===e||h(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},T.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},T.prototype.toCssColorString=function(){const e=T.floatToByte(this.red),t=T.floatToByte(this.green),n=T.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},T.prototype.toCssHexString=function(){let e=T.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=T.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=T.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=T.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},T.prototype.toBytes=function(e){const t=T.floatToByte(this.red),n=T.floatToByte(this.green),i=T.floatToByte(this.blue),o=T.floatToByte(this.alpha);return h(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]},T.prototype.toRgba=function(){return ai[0]=T.floatToByte(this.red),ai[1]=T.floatToByte(this.green),ai[2]=T.floatToByte(this.blue),ai[3]=T.floatToByte(this.alpha),Ya[0]},T.prototype.brighten=function(e,t){return m.typeOf.number("magnitude",e),m.typeOf.number.greaterThanOrEquals("magnitude",e,0),m.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},T.prototype.darken=function(e,t){return m.typeOf.number("magnitude",e),m.typeOf.number.greaterThanOrEquals("magnitude",e,0),m.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},T.prototype.withAlpha=function(e,t){return T.fromAlpha(this,e,t)},T.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.multiply=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.divide=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.mod=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},T.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),i.red=S.lerp(e.red,t.red,n),i.green=S.lerp(e.green,t.green,n),i.blue=S.lerp(e.blue,t.blue,n),i.alpha=S.lerp(e.alpha,t.alpha,n),i},T.multiplyByScalar=function(e,t,n){return m.typeOf.object("color",e),m.typeOf.number("scalar",t),m.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},T.divideByScalar=function(e,t,n){return m.typeOf.object("color",e),m.typeOf.number("scalar",t),m.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},T.ALICEBLUE=Object.freeze(T.fromCssColorString("#F0F8FF")),T.ANTIQUEWHITE=Object.freeze(T.fromCssColorString("#FAEBD7")),T.AQUA=Object.freeze(T.fromCssColorString("#00FFFF")),T.AQUAMARINE=Object.freeze(T.fromCssColorString("#7FFFD4")),T.AZURE=Object.freeze(T.fromCssColorString("#F0FFFF")),T.BEIGE=Object.freeze(T.fromCssColorString("#F5F5DC")),T.BISQUE=Object.freeze(T.fromCssColorString("#FFE4C4")),T.BLACK=Object.freeze(T.fromCssColorString("#000000")),T.BLANCHEDALMOND=Object.freeze(T.fromCssColorString("#FFEBCD")),T.BLUE=Object.freeze(T.fromCssColorString("#0000FF")),T.BLUEVIOLET=Object.freeze(T.fromCssColorString("#8A2BE2")),T.BROWN=Object.freeze(T.fromCssColorString("#A52A2A")),T.BURLYWOOD=Object.freeze(T.fromCssColorString("#DEB887")),T.CADETBLUE=Object.freeze(T.fromCssColorString("#5F9EA0")),T.CHARTREUSE=Object.freeze(T.fromCssColorString("#7FFF00")),T.CHOCOLATE=Object.freeze(T.fromCssColorString("#D2691E")),T.CORAL=Object.freeze(T.fromCssColorString("#FF7F50")),T.CORNFLOWERBLUE=Object.freeze(T.fromCssColorString("#6495ED")),T.CORNSILK=Object.freeze(T.fromCssColorString("#FFF8DC")),T.CRIMSON=Object.freeze(T.fromCssColorString("#DC143C")),T.CYAN=Object.freeze(T.fromCssColorString("#00FFFF")),T.DARKBLUE=Object.freeze(T.fromCssColorString("#00008B")),T.DARKCYAN=Object.freeze(T.fromCssColorString("#008B8B")),T.DARKGOLDENROD=Object.freeze(T.fromCssColorString("#B8860B")),T.DARKGRAY=Object.freeze(T.fromCssColorString("#A9A9A9")),T.DARKGREEN=Object.freeze(T.fromCssColorString("#006400")),T.DARKGREY=T.DARKGRAY,T.DARKKHAKI=Object.freeze(T.fromCssColorString("#BDB76B")),T.DARKMAGENTA=Object.freeze(T.fromCssColorString("#8B008B")),T.DARKOLIVEGREEN=Object.freeze(T.fromCssColorString("#556B2F")),T.DARKORANGE=Object.freeze(T.fromCssColorString("#FF8C00")),T.DARKORCHID=Object.freeze(T.fromCssColorString("#9932CC")),T.DARKRED=Object.freeze(T.fromCssColorString("#8B0000")),T.DARKSALMON=Object.freeze(T.fromCssColorString("#E9967A")),T.DARKSEAGREEN=Object.freeze(T.fromCssColorString("#8FBC8F")),T.DARKSLATEBLUE=Object.freeze(T.fromCssColorString("#483D8B")),T.DARKSLATEGRAY=Object.freeze(T.fromCssColorString("#2F4F4F")),T.DARKSLATEGREY=T.DARKSLATEGRAY,T.DARKTURQUOISE=Object.freeze(T.fromCssColorString("#00CED1")),T.DARKVIOLET=Object.freeze(T.fromCssColorString("#9400D3")),T.DEEPPINK=Object.freeze(T.fromCssColorString("#FF1493")),T.DEEPSKYBLUE=Object.freeze(T.fromCssColorString("#00BFFF")),T.DIMGRAY=Object.freeze(T.fromCssColorString("#696969")),T.DIMGREY=T.DIMGRAY,T.DODGERBLUE=Object.freeze(T.fromCssColorString("#1E90FF")),T.FIREBRICK=Object.freeze(T.fromCssColorString("#B22222")),T.FLORALWHITE=Object.freeze(T.fromCssColorString("#FFFAF0")),T.FORESTGREEN=Object.freeze(T.fromCssColorString("#228B22")),T.FUCHSIA=Object.freeze(T.fromCssColorString("#FF00FF")),T.GAINSBORO=Object.freeze(T.fromCssColorString("#DCDCDC")),T.GHOSTWHITE=Object.freeze(T.fromCssColorString("#F8F8FF")),T.GOLD=Object.freeze(T.fromCssColorString("#FFD700")),T.GOLDENROD=Object.freeze(T.fromCssColorString("#DAA520")),T.GRAY=Object.freeze(T.fromCssColorString("#808080")),T.GREEN=Object.freeze(T.fromCssColorString("#008000")),T.GREENYELLOW=Object.freeze(T.fromCssColorString("#ADFF2F")),T.GREY=T.GRAY,T.HONEYDEW=Object.freeze(T.fromCssColorString("#F0FFF0")),T.HOTPINK=Object.freeze(T.fromCssColorString("#FF69B4")),T.INDIANRED=Object.freeze(T.fromCssColorString("#CD5C5C")),T.INDIGO=Object.freeze(T.fromCssColorString("#4B0082")),T.IVORY=Object.freeze(T.fromCssColorString("#FFFFF0")),T.KHAKI=Object.freeze(T.fromCssColorString("#F0E68C")),T.LAVENDER=Object.freeze(T.fromCssColorString("#E6E6FA")),T.LAVENDAR_BLUSH=Object.freeze(T.fromCssColorString("#FFF0F5")),T.LAWNGREEN=Object.freeze(T.fromCssColorString("#7CFC00")),T.LEMONCHIFFON=Object.freeze(T.fromCssColorString("#FFFACD")),T.LIGHTBLUE=Object.freeze(T.fromCssColorString("#ADD8E6")),T.LIGHTCORAL=Object.freeze(T.fromCssColorString("#F08080")),T.LIGHTCYAN=Object.freeze(T.fromCssColorString("#E0FFFF")),T.LIGHTGOLDENRODYELLOW=Object.freeze(T.fromCssColorString("#FAFAD2")),T.LIGHTGRAY=Object.freeze(T.fromCssColorString("#D3D3D3")),T.LIGHTGREEN=Object.freeze(T.fromCssColorString("#90EE90")),T.LIGHTGREY=T.LIGHTGRAY,T.LIGHTPINK=Object.freeze(T.fromCssColorString("#FFB6C1")),T.LIGHTSEAGREEN=Object.freeze(T.fromCssColorString("#20B2AA")),T.LIGHTSKYBLUE=Object.freeze(T.fromCssColorString("#87CEFA")),T.LIGHTSLATEGRAY=Object.freeze(T.fromCssColorString("#778899")),T.LIGHTSLATEGREY=T.LIGHTSLATEGRAY,T.LIGHTSTEELBLUE=Object.freeze(T.fromCssColorString("#B0C4DE")),T.LIGHTYELLOW=Object.freeze(T.fromCssColorString("#FFFFE0")),T.LIME=Object.freeze(T.fromCssColorString("#00FF00")),T.LIMEGREEN=Object.freeze(T.fromCssColorString("#32CD32")),T.LINEN=Object.freeze(T.fromCssColorString("#FAF0E6")),T.MAGENTA=Object.freeze(T.fromCssColorString("#FF00FF")),T.MAROON=Object.freeze(T.fromCssColorString("#800000")),T.MEDIUMAQUAMARINE=Object.freeze(T.fromCssColorString("#66CDAA")),T.MEDIUMBLUE=Object.freeze(T.fromCssColorString("#0000CD")),T.MEDIUMORCHID=Object.freeze(T.fromCssColorString("#BA55D3")),T.MEDIUMPURPLE=Object.freeze(T.fromCssColorString("#9370DB")),T.MEDIUMSEAGREEN=Object.freeze(T.fromCssColorString("#3CB371")),T.MEDIUMSLATEBLUE=Object.freeze(T.fromCssColorString("#7B68EE")),T.MEDIUMSPRINGGREEN=Object.freeze(T.fromCssColorString("#00FA9A")),T.MEDIUMTURQUOISE=Object.freeze(T.fromCssColorString("#48D1CC")),T.MEDIUMVIOLETRED=Object.freeze(T.fromCssColorString("#C71585")),T.MIDNIGHTBLUE=Object.freeze(T.fromCssColorString("#191970")),T.MINTCREAM=Object.freeze(T.fromCssColorString("#F5FFFA")),T.MISTYROSE=Object.freeze(T.fromCssColorString("#FFE4E1")),T.MOCCASIN=Object.freeze(T.fromCssColorString("#FFE4B5")),T.NAVAJOWHITE=Object.freeze(T.fromCssColorString("#FFDEAD")),T.NAVY=Object.freeze(T.fromCssColorString("#000080")),T.OLDLACE=Object.freeze(T.fromCssColorString("#FDF5E6")),T.OLIVE=Object.freeze(T.fromCssColorString("#808000")),T.OLIVEDRAB=Object.freeze(T.fromCssColorString("#6B8E23")),T.ORANGE=Object.freeze(T.fromCssColorString("#FFA500")),T.ORANGERED=Object.freeze(T.fromCssColorString("#FF4500")),T.ORCHID=Object.freeze(T.fromCssColorString("#DA70D6")),T.PALEGOLDENROD=Object.freeze(T.fromCssColorString("#EEE8AA")),T.PALEGREEN=Object.freeze(T.fromCssColorString("#98FB98")),T.PALETURQUOISE=Object.freeze(T.fromCssColorString("#AFEEEE")),T.PALEVIOLETRED=Object.freeze(T.fromCssColorString("#DB7093")),T.PAPAYAWHIP=Object.freeze(T.fromCssColorString("#FFEFD5")),T.PEACHPUFF=Object.freeze(T.fromCssColorString("#FFDAB9")),T.PERU=Object.freeze(T.fromCssColorString("#CD853F")),T.PINK=Object.freeze(T.fromCssColorString("#FFC0CB")),T.PLUM=Object.freeze(T.fromCssColorString("#DDA0DD")),T.POWDERBLUE=Object.freeze(T.fromCssColorString("#B0E0E6")),T.PURPLE=Object.freeze(T.fromCssColorString("#800080")),T.RED=Object.freeze(T.fromCssColorString("#FF0000")),T.ROSYBROWN=Object.freeze(T.fromCssColorString("#BC8F8F")),T.ROYALBLUE=Object.freeze(T.fromCssColorString("#4169E1")),T.SADDLEBROWN=Object.freeze(T.fromCssColorString("#8B4513")),T.SALMON=Object.freeze(T.fromCssColorString("#FA8072")),T.SANDYBROWN=Object.freeze(T.fromCssColorString("#F4A460")),T.SEAGREEN=Object.freeze(T.fromCssColorString("#2E8B57")),T.SEASHELL=Object.freeze(T.fromCssColorString("#FFF5EE")),T.SIENNA=Object.freeze(T.fromCssColorString("#A0522D")),T.SILVER=Object.freeze(T.fromCssColorString("#C0C0C0")),T.SKYBLUE=Object.freeze(T.fromCssColorString("#87CEEB")),T.SLATEBLUE=Object.freeze(T.fromCssColorString("#6A5ACD")),T.SLATEGRAY=Object.freeze(T.fromCssColorString("#708090")),T.SLATEGREY=T.SLATEGRAY,T.SNOW=Object.freeze(T.fromCssColorString("#FFFAFA")),T.SPRINGGREEN=Object.freeze(T.fromCssColorString("#00FF7F")),T.STEELBLUE=Object.freeze(T.fromCssColorString("#4682B4")),T.TAN=Object.freeze(T.fromCssColorString("#D2B48C")),T.TEAL=Object.freeze(T.fromCssColorString("#008080")),T.THISTLE=Object.freeze(T.fromCssColorString("#D8BFD8")),T.TOMATO=Object.freeze(T.fromCssColorString("#FF6347")),T.TURQUOISE=Object.freeze(T.fromCssColorString("#40E0D0")),T.VIOLET=Object.freeze(T.fromCssColorString("#EE82EE")),T.WHEAT=Object.freeze(T.fromCssColorString("#F5DEB3")),T.WHITE=Object.freeze(T.fromCssColorString("#FFFFFF")),T.WHITESMOKE=Object.freeze(T.fromCssColorString("#F5F5F5")),T.YELLOW=Object.freeze(T.fromCssColorString("#FFFF00")),T.YELLOWGREEN=Object.freeze(T.fromCssColorString("#9ACD32")),T.TRANSPARENT=Object.freeze(new T(0,0,0,0));const Pt=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,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11});function U(e,t){this.x=_(e,0),this.y=_(t,0)}U.fromElements=function(e,t,n){return h(n)?(n.x=e,n.y=t,n):new U(e,t)},U.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t):new U(e.x,e.y)},U.fromCartesian3=U.clone,U.fromCartesian4=U.clone,U.packedLength=2,U.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n]=e.y,t},U.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new U),n.x=e[t++],n.y=e[t],n},U.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*2;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)U.pack(e[o],t,o*2);return t},U.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new C("array length must be a multiple of 2.");const n=e.length;h(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){const o=i/2;t[o]=U.unpack(e,i,t[o])}return t},U.fromArray=U.unpack,U.maximumComponent=function(e){return m.typeOf.object("cartesian",e),Math.max(e.x,e.y)},U.minimumComponent=function(e){return m.typeOf.object("cartesian",e),Math.min(e.x,e.y)},U.minimumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},U.maximumByComponent=function(e,t,n){return m.typeOf.object("first",e),m.typeOf.object("second",t),m.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},U.clamp=function(e,t,n,i){m.typeOf.object("value",e),m.typeOf.object("min",t),m.typeOf.object("max",n),m.typeOf.object("result",i);const o=S.clamp(e.x,t.x,n.x),s=S.clamp(e.y,t.y,n.y);return i.x=o,i.y=s,i},U.magnitudeSquared=function(e){return m.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},U.magnitude=function(e){return Math.sqrt(U.magnitudeSquared(e))};const Es=new U;U.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,Es),U.magnitude(Es)},U.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,Es),U.magnitudeSquared(Es)},U.normalize=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=U.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new C("normalized result is not a number");return t},U.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y},U.cross=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.y-e.y*t.x},U.multiplyComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n},U.divideComponents=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n},U.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n},U.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n},U.multiplyByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n},U.divideByScalar=function(e,t,n){return m.typeOf.object("cartesian",e),m.typeOf.number("scalar",t),m.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n},U.negate=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},U.abs=function(e,t){return m.typeOf.object("cartesian",e),m.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};const Rh=new U;U.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),U.multiplyByScalar(t,n,Rh),i=U.multiplyByScalar(e,1-n,i),U.add(Rh,i,i)};const zh=new U,Ph=new U;U.angleBetween=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.normalize(e,zh),U.normalize(t,Ph),S.acosClamped(U.dot(zh,Ph))};const E_=new U;U.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=U.normalize(e,E_);return U.abs(n,n),n.x<=n.y?t=U.clone(U.UNIT_X,t):t=U.clone(U.UNIT_Y,t),t},U.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y},U.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},U.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.x,t.x,n,i)&&S.equalsEpsilon(e.y,t.y,n,i)},U.ZERO=Object.freeze(new U(0,0)),U.ONE=Object.freeze(new U(1,1)),U.UNIT_X=Object.freeze(new U(1,0)),U.UNIT_Y=Object.freeze(new U(0,1)),U.prototype.clone=function(e){return U.clone(this,e)},U.prototype.equals=function(e){return U.equals(this,e)},U.prototype.equalsEpsilon=function(e,t,n){return U.equalsEpsilon(this,e,t,n)},U.prototype.toString=function(){return`(${this.x}, ${this.y})`};const b_=new f,w_=new f;function Bh(e,t,n,i,o){if(!h(e))throw new C("cartesian is required.");if(!h(t))throw new C("oneOverRadii is required.");if(!h(n))throw new C("oneOverRadiiSquared is required.");if(!h(i))throw new C("centerToleranceSquared is required.");const s=e.x,a=e.y,c=e.z,l=t.x,u=t.y,d=t.z,p=s*s*l*l,g=a*a*u*u,y=c*c*d*d,x=p+g+y,E=Math.sqrt(1/x),b=f.multiplyByScalar(e,E,b_);if(x<i)return isFinite(E)?f.clone(b,o):void 0;const D=n.x,A=n.y,O=n.z,I=w_;I.x=b.x*D*2,I.y=b.y*A*2,I.z=b.z*O*2;let B=(1-E)*f.magnitude(e)/(.5*f.magnitude(I)),M=0,q,P,V,k,H,j,r,w,v,z,G;do{B-=M,V=1/(1+B*D),k=1/(1+B*A),H=1/(1+B*O),j=V*V,r=k*k,w=H*H,v=j*V,z=r*k,G=w*H,q=p*j+g*r+y*w-1,P=p*v*D+g*z*A+y*G*O;const W=-2*P;M=q/W}while(Math.abs(q)>S.EPSILON12);return h(o)?(o.x=s*V,o.y=a*k,o.z=c*H,o):new f(s*V,a*k,c*H)}function ee(e,t,n){this.longitude=_(e,0),this.latitude=_(t,0),this.height=_(n,0)}ee.fromRadians=function(e,t,n,i){return m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),n=_(n,0),h(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new ee(e,t,n)},ee.fromDegrees=function(e,t,n,i){return m.typeOf.number("longitude",e),m.typeOf.number("latitude",t),e=S.toRadians(e),t=S.toRadians(t),ee.fromRadians(e,t,n,i)};const T_=new f,S_=new f,A_=new f;ee._ellipsoidOneOverRadii=new f(1/6378137,1/6378137,1/6356752314245179e-9),ee._ellipsoidOneOverRadiiSquared=new f(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),ee._ellipsoidCenterToleranceSquared=S.EPSILON1,ee.fromCartesian=function(e,t,n){const i=h(t)?t.oneOverRadii:ee._ellipsoidOneOverRadii,o=h(t)?t.oneOverRadiiSquared:ee._ellipsoidOneOverRadiiSquared,s=h(t)?t._centerToleranceSquared:ee._ellipsoidCenterToleranceSquared,a=Bh(e,i,o,s,S_);if(!h(a))return;let c=f.multiplyComponents(a,o,T_);c=f.normalize(c,c);const l=f.subtract(e,a,A_),u=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=S.sign(f.dot(l,e))*f.magnitude(l);return h(n)?(n.longitude=u,n.latitude=d,n.height=p,n):new ee(u,d,p)},ee.toCartesian=function(e,t,n){return m.defined("cartographic",e),f.fromRadians(e.longitude,e.latitude,e.height,t,n)},ee.clone=function(e,t){if(h(e))return h(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new ee(e.longitude,e.latitude,e.height)},ee.equals=function(e,t){return e===t||h(e)&&h(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},ee.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},ee.ZERO=Object.freeze(new ee(0,0,0)),ee.prototype.clone=function(e){return ee.clone(this,e)},ee.prototype.equals=function(e){return ee.equals(this,e)},ee.prototype.equalsEpsilon=function(e,t){return ee.equalsEpsilon(this,e,t)},ee.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Nh(e,t,n,i){t=_(t,0),n=_(n,0),i=_(i,0),m.typeOf.number.greaterThanOrEquals("x",t,0),m.typeOf.number.greaterThanOrEquals("y",n,0),m.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new f(t,n,i),e._radiiSquared=new f(t*t,n*n,i*i),e._radiiToTheFourth=new f(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new f(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new f(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=S.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function le(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,Nh(this,e,t,n)}Object.defineProperties(le.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}}}),le.clone=function(e,t){if(!h(e))return;const n=e._radii;return h(t)?(f.clone(n,t._radii),f.clone(e._radiiSquared,t._radiiSquared),f.clone(e._radiiToTheFourth,t._radiiToTheFourth),f.clone(e._oneOverRadii,t._oneOverRadii),f.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new le(n.x,n.y,n.z)},le.fromCartesian3=function(e,t){return h(t)||(t=new le),h(e)&&Nh(t,e.x,e.y,e.z),t},le.WGS84=Object.freeze(new le(6378137,6378137,6356752314245179e-9)),le.UNIT_SPHERE=Object.freeze(new le(1,1,1)),le.MOON=Object.freeze(new le(S.LUNAR_RADIUS,S.LUNAR_RADIUS,S.LUNAR_RADIUS)),le._default=le.WGS84,Object.defineProperties(le,{default:{get:function(){return le._default},set:function(e){m.typeOf.object("value",e),le._default=e,f._ellipsoidRadiiSquared=e.radiiSquared,ee._ellipsoidOneOverRadii=e.oneOverRadii,ee._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,ee._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}}),le.prototype.clone=function(e){return le.clone(this,e)},le.packedLength=f.packedLength,le.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),f.pack(e._radii,t,n),t},le.unpack=function(e,t,n){m.defined("array",e),t=_(t,0);const i=f.unpack(e,t);return le.fromCartesian3(i,n)},le.prototype.geocentricSurfaceNormal=f.normalize,le.prototype.geodeticSurfaceNormalCartographic=function(e,t){m.typeOf.object("cartographic",e);const n=e.longitude,i=e.latitude,o=Math.cos(i),s=o*Math.cos(n),a=o*Math.sin(n),c=Math.sin(i);return h(t)||(t=new f),t.x=s,t.y=a,t.z=c,f.normalize(t,t)},le.prototype.geodeticSurfaceNormal=function(e,t){if(m.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new C("cartesian has a NaN component");if(!f.equalsEpsilon(e,f.ZERO,S.EPSILON14))return h(t)||(t=new f),t=f.multiplyComponents(e,this._oneOverRadiiSquared,t),f.normalize(t,t)};const D_=new f,O_=new f;le.prototype.cartographicToCartesian=function(e,t){const n=D_,i=O_;this.geodeticSurfaceNormalCartographic(e,n),f.multiplyComponents(this._radiiSquared,n,i);const o=Math.sqrt(f.dot(n,i));return f.divideByScalar(i,o,i),f.multiplyByScalar(n,e.height,n),h(t)||(t=new f),f.add(i,n,t)},le.prototype.cartographicArrayToCartesianArray=function(e,t){m.defined("cartographics",e);const n=e.length;h(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 v_=new f,I_=new f,R_=new f;le.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,I_);if(!h(n))return;const i=this.geodeticSurfaceNormal(n,v_),o=f.subtract(e,n,R_),s=Math.atan2(i.y,i.x),a=Math.asin(i.z),c=S.sign(f.dot(o,e))*f.magnitude(o);return h(t)?(t.longitude=s,t.latitude=a,t.height=c,t):new ee(s,a,c)},le.prototype.cartesianArrayToCartographicArray=function(e,t){m.defined("cartesians",e);const n=e.length;h(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},le.prototype.scaleToGeodeticSurface=function(e,t){return Bh(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},le.prototype.scaleToGeocentricSurface=function(e,t){m.typeOf.object("cartesian",e),h(t)||(t=new f);const n=e.x,i=e.y,o=e.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(n*n*s.x+i*i*s.y+o*o*s.z);return f.multiplyByScalar(e,a,t)},le.prototype.transformPositionToScaledSpace=function(e,t){return h(t)||(t=new f),f.multiplyComponents(e,this._oneOverRadii,t)},le.prototype.transformPositionFromScaledSpace=function(e,t){return h(t)||(t=new f),f.multiplyComponents(e,this._radii,t)},le.prototype.equals=function(e){return this===e||h(e)&&f.equals(this._radii,e._radii)},le.prototype.toString=function(){return this._radii.toString()},le.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(m.typeOf.object("position",e),!S.equalsEpsilon(this._radii.x,this._radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");m.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=_(t,0);const i=this._squaredXOverSquaredZ;if(h(n)||(n=new f),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};const z_=new f;le.prototype.getLocalCurvature=function(e,t){m.typeOf.object("surfacePosition",e),h(t)||(t=new U);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,z_),i=f.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,s=i*o**2;return U.fromElements(1/i,1/s,t)};const P_=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],B_=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Fh(e,t,n){m.typeOf.number("a",e),m.typeOf.number("b",t),m.typeOf.func("func",n);const i=.5*(t+e),o=.5*(t-e);let s=0;for(let a=0;a<5;a++){const c=o*P_[a];s+=B_[a]*(n(i+c)+n(i-c))}return s*=o,s}le.prototype.surfaceArea=function(e){m.typeOf.object("rectangle",e);const t=e.west;let n=e.east;const i=e.south,o=e.north;for(;n<t;)n+=S.TWO_PI;const s=this._radiiSquared,a=s.x,c=s.y,l=s.z,u=a*c;return Fh(i,o,function(d){const p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Fh(t,n,function(y){const x=Math.cos(y),E=Math.sin(y);return Math.sqrt(u*g*g+l*(c*x*x+a*E*E)*p*p)})})};function Sn(e){this._ellipsoid=_(e,le.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Sn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Sn.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,s=e.height;return h(t)?(t.x=i,t.y=o,t.z=s,t):new f(i,o,s)},Sn.prototype.unproject=function(e,t){if(!h(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,s=e.z;return h(t)?(t.longitude=i,t.latitude=o,t.height=s,t):new ee(i,o,s)};const Et=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function Ko(e,t,n){m.defined("array",e),m.defined("itemToFind",t),m.defined("comparator",n);let i=0,o=e.length-1,s,a;for(;i<=o;){if(s=~~((i+o)/2),a=n(e[s],t),a<0){i=s+1;continue}if(a>0){o=s-1;continue}return s}return~(o+1)}function Xa(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}function $a(e){if(e===null||isNaN(e))throw new C("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}const Lh=[31,28,31,30,31,30,31,31,30,31,30,31];function Za(e,t,n,i,o,s,a,c){e=_(e,1),t=_(t,1),n=_(n,1),i=_(i,0),o=_(o,0),s=_(s,0),a=_(a,0),c=_(c,!1),E(),b(),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=s,this.millisecond=a,this.isLeapSecond=c;function E(){m.typeOf.number.greaterThanOrEquals("Year",e,1),m.typeOf.number.lessThanOrEquals("Year",e,9999),m.typeOf.number.greaterThanOrEquals("Month",t,1),m.typeOf.number.lessThanOrEquals("Month",t,12),m.typeOf.number.greaterThanOrEquals("Day",n,1),m.typeOf.number.lessThanOrEquals("Day",n,31),m.typeOf.number.greaterThanOrEquals("Hour",i,0),m.typeOf.number.lessThanOrEquals("Hour",i,23),m.typeOf.number.greaterThanOrEquals("Minute",o,0),m.typeOf.number.lessThanOrEquals("Minute",o,59),m.typeOf.bool("IsLeapSecond",c),m.typeOf.number.greaterThanOrEquals("Second",s,0),m.typeOf.number.lessThanOrEquals("Second",s,c?60:59),m.typeOf.number.greaterThanOrEquals("Millisecond",a,0),m.typeOf.number.lessThan("Millisecond",a,1e3)}function b(){const D=t===2&&$a(e)?Lh[t-1]+1:Lh[t-1];if(n>D)throw new C("Month and Day represents invalid date")}}function Ge(e,t){this.julianDate=e,this.offset=t}const nt=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:24000005e-1}),ve=Object.freeze({UTC:0,TAI:1}),Mh=new Za,bs=[31,28,31,30,31,30,31,31,30,31,30,31],ws=29;function Ka(e,t){return $.compare(e.julianDate,t.julianDate)}const Eo=new Ge;function Ts(e){Eo.julianDate=e;const t=$.leapSeconds;let n=Ko(t,Eo,Ka);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&$.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),$.addSeconds(e,i,e)}function Uh(e,t){Eo.julianDate=e;const n=$.leapSeconds;let i=Ko(n,Eo,Ka);if(i<0&&(i=~i),i===0)return $.addSeconds(e,-n[0].offset,t);if(i>=n.length)return $.addSeconds(e,-n[i-1].offset,t);const o=$.secondsDifference(n[i].julianDate,e);if(o===0)return $.addSeconds(e,-n[i].offset,t);if(!(o<=1))return $.addSeconds(e,-n[--i].offset,t)}function vi(e,t,n){const i=t/nt.SECONDS_PER_DAY|0;return e+=i,t-=nt.SECONDS_PER_DAY*i,t<0&&(e--,t+=nt.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Qa(e,t,n,i,o,s,a){const c=(t-14)/12|0,l=e+4800+c;let u=(1461*l/4|0)+(367*(t-2-12*c)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);const d=s+(i*nt.SECONDS_PER_HOUR+o*nt.SECONDS_PER_MINUTE+a*nt.SECONDS_PER_MILLISECOND);return d>=43200&&(u-=1),[u,d]}const N_=/^(\d{4})$/,F_=/^(\d{4})-(\d{2})$/,L_=/^(\d{4})-?(\d{3})$/,M_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,U_=/^(\d{4})-?(\d{2})-?(\d{2})$/,Ja=/([Z+\-])?(\d{2})?:?(\d{2})?$/,k_=/^(\d{2})(\.\d+)?/.source+Ja.source,V_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Ja.source,G_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Ja.source,An="Invalid ISO 8601 date.";function $(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=_(e,0),t=_(t,0),n=_(n,ve.UTC);const i=e|0;t=t+(e-i)*nt.SECONDS_PER_DAY,vi(i,t,this),n===ve.UTC&&Ts(this)}$.fromGregorianDate=function(e,t){if(!(e instanceof Za))throw new C("date must be a valid GregorianDate.");const n=Qa(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return h(t)?(vi(n[0],n[1],t),Ts(t),t):new $(n[0],n[1],ve.UTC)},$.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");const n=Qa(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return h(t)?(vi(n[0],n[1],t),Ts(t),t):new $(n[0],n[1],ve.UTC)},$.fromIso8601=function(e,t){if(typeof e!="string")throw new C(An);e=e.replace(",",".");let n=e.split("T"),i,o=1,s=1,a=0,c=0,l=0,u=0;const d=n[0],p=n[1];let g,y;if(!h(d))throw new C(An);let x;if(n=d.match(U_),n!==null){if(x=d.split("-").length-1,x>0&&x!==2)throw new C(An);i=+n[1],o=+n[2],s=+n[3]}else if(n=d.match(F_),n!==null)i=+n[1],o=+n[2];else if(n=d.match(N_),n!==null)i=+n[1];else{let A;if(n=d.match(L_),n!==null){if(i=+n[1],A=+n[2],y=$a(i),A<1||y&&A>366||!y&&A>365)throw new C(An)}else if(n=d.match(M_),n!==null){i=+n[1];const O=+n[2],I=+n[3]||0;if(x=d.split("-").length-1,x>0&&(!h(n[3])&&x!==1||h(n[3])&&x!==2))throw new C(An);const B=new Date(Date.UTC(i,0,4));A=O*7+I-B.getUTCDay()-3}else throw new C(An);g=new Date(Date.UTC(i,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}if(y=$a(i),o<1||o>12||s<1||(o!==2||!y)&&s>bs[o-1]||y&&o===2&&s>ws)throw new C(An);let E;if(h(p)){if(n=p.match(G_),n!==null){if(x=p.split(":").length-1,x>0&&x!==2&&x!==3)throw new C(An);a=+n[1],c=+n[2],l=+n[3],u=+(n[4]||0)*1e3,E=5}else if(n=p.match(V_),n!==null){if(x=p.split(":").length-1,x>2)throw new C(An);a=+n[1],c=+n[2],l=+(n[3]||0)*60,E=4}else if(n=p.match(k_),n!==null)a=+n[1],c=+(n[2]||0)*60,E=3;else throw new C(An);if(c>=60||l>=61||a>24||a===24&&(c>0||l>0||u>0))throw new C(An);const A=n[E],O=+n[E+1],I=+(n[E+2]||0);switch(A){case"+":a=a-O,c=c-I;break;case"-":a=a+O,c=c+I;break;case"Z":break;default:c=c+new Date(Date.UTC(i,o-1,s,a,c)).getTimezoneOffset();break}}const b=l===60;for(b&&l--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(g=y&&o===2?ws:bs[o-1];s>g;)s-=g,o++,o>12&&(o-=12,i++),g=y&&o===2?ws:bs[o-1];for(;c<0;)c+=60,a--;for(;a<0;)a+=24,s--;for(;s<1;)o--,o<1&&(o+=12,i--),g=y&&o===2?ws:bs[o-1],s+=g;const D=Qa(i,o,s,a,c,l,u);return h(t)?(vi(D[0],D[1],t),Ts(t)):t=new $(D[0],D[1],ve.UTC),b&&$.addSeconds(t,1,t),t},$.now=function(e){return $.fromDate(new Date,e)};const Ss=new $(0,0,ve.TAI);$.toGregorianDate=function(e,t){if(!h(e))throw new C("julianDate is required.");let n=!1,i=Uh(e,Ss);h(i)||($.addSeconds(e,-1,Ss),i=Uh(Ss,Ss),n=!0);let o=i.dayNumber;const s=i.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0;const c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;const l=4e3*(a+1)/1461001|0;a=a-(1461*l/4|0)+31|0;const u=80*a/2447|0,d=a-(2447*u/80|0)|0;a=u/11|0;const p=u+2-12*a|0,g=100*(c-49)+l+a|0;let y=s/nt.SECONDS_PER_HOUR|0,x=s-y*nt.SECONDS_PER_HOUR;const E=x/nt.SECONDS_PER_MINUTE|0;x=x-E*nt.SECONDS_PER_MINUTE;let b=x|0;const D=(x-b)/nt.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(b+=1),h(t)?(t.year=g,t.month=p,t.day=d,t.hour=y,t.minute=E,t.second=b,t.millisecond=D,t.isLeapSecond=n,t):new Za(g,p,d,y,E,b,D,n)},$.toDate=function(e){if(!h(e))throw new C("julianDate is required.");const t=$.toGregorianDate(e,Mh);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))},$.toIso8601=function(e,t){if(!h(e))throw new C("julianDate is required.");const n=$.toGregorianDate(e,Mh);let i=n.year,o=n.month,s=n.day,a=n.hour;const c=n.minute,l=n.second,u=n.millisecond;i===1e4&&o===1&&s===1&&a===0&&c===0&&l===0&&u===0&&(i=9999,o=12,s=31,a=24);let d;return!h(t)&&u!==0?(d=(u*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${d}Z`):!h(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(d=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${d}Z`)},$.clone=function(e,t){if(h(e))return h(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new $(e.dayNumber,e.secondsOfDay,ve.TAI)},$.compare=function(e,t){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay},$.equals=function(e,t){return e===t||h(e)&&h(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},$.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(t)&&Math.abs($.secondsDifference(e,t))<=n},$.totalDays=function(e){if(!h(e))throw new C("julianDate is required.");return e.dayNumber+e.secondsOfDay/nt.SECONDS_PER_DAY},$.secondsDifference=function(e,t){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");return(e.dayNumber-t.dayNumber)*nt.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},$.daysDifference=function(e,t){if(!h(e))throw new C("left is required.");if(!h(t))throw new C("right is required.");const n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/nt.SECONDS_PER_DAY;return n+i},$.computeTaiMinusUtc=function(e){Eo.julianDate=e;const t=$.leapSeconds;let n=Ko(t,Eo,Ka);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset},$.addSeconds=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("seconds is required.");if(!h(n))throw new C("result is required.");return vi(e.dayNumber,e.secondsOfDay+t,n)},$.addMinutes=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("minutes is required.");if(!h(n))throw new C("result is required.");const i=e.secondsOfDay+t*nt.SECONDS_PER_MINUTE;return vi(e.dayNumber,i,n)},$.addHours=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("hours is required.");if(!h(n))throw new C("result is required.");const i=e.secondsOfDay+t*nt.SECONDS_PER_HOUR;return vi(e.dayNumber,i,n)},$.addDays=function(e,t,n){if(!h(e))throw new C("julianDate is required.");if(!h(t))throw new C("days is required.");if(!h(n))throw new C("result is required.");const i=e.dayNumber+t;return vi(i,e.secondsOfDay,n)},$.lessThan=function(e,t){return $.compare(e,t)<0},$.lessThanOrEquals=function(e,t){return $.compare(e,t)<=0},$.greaterThan=function(e,t){return $.compare(e,t)>0},$.greaterThanOrEquals=function(e,t){return $.compare(e,t)>=0},$.prototype.clone=function(e){return $.clone(this,e)},$.prototype.equals=function(e){return $.equals(this,e)},$.prototype.equalsEpsilon=function(e,t){return $.equalsEpsilon(this,e,t)},$.prototype.toString=function(){return $.toIso8601(this)},$.leapSeconds=[new Ge(new $(2441317,43210,ve.TAI),10),new Ge(new $(2441499,43211,ve.TAI),11),new Ge(new $(2441683,43212,ve.TAI),12),new Ge(new $(2442048,43213,ve.TAI),13),new Ge(new $(2442413,43214,ve.TAI),14),new Ge(new $(2442778,43215,ve.TAI),15),new Ge(new $(2443144,43216,ve.TAI),16),new Ge(new $(2443509,43217,ve.TAI),17),new Ge(new $(2443874,43218,ve.TAI),18),new Ge(new $(2444239,43219,ve.TAI),19),new Ge(new $(2444786,43220,ve.TAI),20),new Ge(new $(2445151,43221,ve.TAI),21),new Ge(new $(2445516,43222,ve.TAI),22),new Ge(new $(2446247,43223,ve.TAI),23),new Ge(new $(2447161,43224,ve.TAI),24),new Ge(new $(2447892,43225,ve.TAI),25),new Ge(new $(2448257,43226,ve.TAI),26),new Ge(new $(2448804,43227,ve.TAI),27),new Ge(new $(2449169,43228,ve.TAI),28),new Ge(new $(2449534,43229,ve.TAI),29),new Ge(new $(2450083,43230,ve.TAI),30),new Ge(new $(2450630,43231,ve.TAI),31),new Ge(new $(2451179,43232,ve.TAI),32),new Ge(new $(2453736,43233,ve.TAI),33),new Ge(new $(2454832,43234,ve.TAI),34),new Ge(new $(2456109,43235,ve.TAI),35),new Ge(new $(2457204,43236,ve.TAI),36),new Ge(new $(2457754,43237,ve.TAI),37)];var kh={exports:{}},Qo={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */Qo.exports;var Vh;function q_(){return Vh||(Vh=1,function(e,t){(function(n){var i=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,s=typeof _o=="object"&&_o;(s.global===s||s.window===s||s.self===s)&&(n=s);var a,c=2147483647,l=36,u=1,d=26,p=38,g=700,y=72,x=128,E="-",b=/^xn--/,D=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=l-u,B=Math.floor,M=String.fromCharCode,q;function P(X){throw new RangeError(O[X])}function V(X,ie){for(var se=X.length,ge=[];se--;)ge[se]=ie(X[se]);return ge}function k(X,ie){var se=X.split("@"),ge="";se.length>1&&(ge=se[0]+"@",X=se[1]),X=X.replace(A,".");var be=X.split("."),xe=V(be,ie).join(".");return ge+xe}function H(X){for(var ie=[],se=0,ge=X.length,be,xe;se<ge;)be=X.charCodeAt(se++),be>=55296&&be<=56319&&se<ge?(xe=X.charCodeAt(se++),(xe&64512)==56320?ie.push(((be&1023)<<10)+(xe&1023)+65536):(ie.push(be),se--)):ie.push(be);return ie}function j(X){return V(X,function(ie){var se="";return ie>65535&&(ie-=65536,se+=M(ie>>>10&1023|55296),ie=56320|ie&1023),se+=M(ie),se}).join("")}function r(X){return X-48<10?X-22:X-65<26?X-65:X-97<26?X-97:l}function w(X,ie){return X+22+75*(X<26)-((ie!=0)<<5)}function v(X,ie,se){var ge=0;for(X=se?B(X/g):X>>1,X+=B(X/ie);X>I*d>>1;ge+=l)X=B(X/I);return B(ge+(I+1)*X/(X+p))}function z(X){var ie=[],se=X.length,ge,be=0,xe=x,ze=y,je,tt,ut,Be,yt,Dt,xt,cn,ln;for(je=X.lastIndexOf(E),je<0&&(je=0),tt=0;tt<je;++tt)X.charCodeAt(tt)>=128&&P("not-basic"),ie.push(X.charCodeAt(tt));for(ut=je>0?je+1:0;ut<se;){for(Be=be,yt=1,Dt=l;ut>=se&&P("invalid-input"),xt=r(X.charCodeAt(ut++)),(xt>=l||xt>B((c-be)/yt))&&P("overflow"),be+=xt*yt,cn=Dt<=ze?u:Dt>=ze+d?d:Dt-ze,!(xt<cn);Dt+=l)ln=l-cn,yt>B(c/ln)&&P("overflow"),yt*=ln;ge=ie.length+1,ze=v(be-Be,ge,Be==0),B(be/ge)>c-xe&&P("overflow"),xe+=B(be/ge),be%=ge,ie.splice(be++,0,xe)}return j(ie)}function G(X){var ie,se,ge,be,xe,ze,je,tt,ut,Be,yt,Dt=[],xt,cn,ln,kn;for(X=H(X),xt=X.length,ie=x,se=0,xe=y,ze=0;ze<xt;++ze)yt=X[ze],yt<128&&Dt.push(M(yt));for(ge=be=Dt.length,be&&Dt.push(E);ge<xt;){for(je=c,ze=0;ze<xt;++ze)yt=X[ze],yt>=ie&&yt<je&&(je=yt);for(cn=ge+1,je-ie>B((c-se)/cn)&&P("overflow"),se+=(je-ie)*cn,ie=je,ze=0;ze<xt;++ze)if(yt=X[ze],yt<ie&&++se>c&&P("overflow"),yt==ie){for(tt=se,ut=l;Be=ut<=xe?u:ut>=xe+d?d:ut-xe,!(tt<Be);ut+=l)kn=tt-Be,ln=l-Be,Dt.push(M(w(Be+kn%ln,0))),tt=B(kn/ln);Dt.push(M(w(tt,0))),xe=v(se,cn,ge==be),se=0,++ge}++se,++ie}return Dt.join("")}function W(X){return k(X,function(ie){return b.test(ie)?z(ie.slice(4).toLowerCase()):ie})}function Z(X){return k(X,function(ie){return D.test(ie)?"xn--"+G(ie):ie})}if(a={version:"1.3.2",ucs2:{decode:H,encode:j},decode:z,encode:G,toASCII:Z,toUnicode:W},i&&o)if(e.exports==i)o.exports=a;else for(q in a)a.hasOwnProperty(q)&&(i[q]=a[q]);else n.punycode=a})(_o)}(Qo,Qo.exports)),Qo.exports}var ec={exports:{}};/*!
9
9
  * URI.js - Mutating URLs
10
10
  * IPv6 Support
11
11
  *
@@ -40,15 +40,15 @@ ${this.stack.toString()}`),e};function N(e,t,n,i,o,s,a,c,l,u,d,p,g,y,x,E){this[0
40
40
  * Licensed under
41
41
  * MIT License http://www.opensource.org/licenses/mit-license
42
42
  *
43
- */(function(e){(function(t,n){e.exports?e.exports=n(q_(),H_(),W_()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(_o,function(t,n,i,o){var s=o&&o.URI;function a(r,w){var v=arguments.length>=1,z=arguments.length>=2;if(!(this instanceof a))return v?z?new a(r,w):new a(r):new a;if(r===void 0){if(v)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?r=location.href+"":r=""}if(r===null&&v)throw new TypeError("null is not a valid argument for URI");return this.href(r),w!==void 0?this.absoluteTo(w):this}function c(r){return/^[0-9]+$/.test(r)}a.version="1.19.11";var l=a.prototype,u=Object.prototype.hasOwnProperty;function d(r){return r.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(r){return r===void 0?"Undefined":String(Object.prototype.toString.call(r)).slice(8,-1)}function g(r){return p(r)==="Array"}function y(r,w){var v={},z,G;if(p(w)==="RegExp")v=null;else if(g(w))for(z=0,G=w.length;z<G;z++)v[w[z]]=!0;else v[w]=!0;for(z=0,G=r.length;z<G;z++){var W=v&&v[r[z]]!==void 0||!v&&w.test(r[z]);W&&(r.splice(z,1),G--,z--)}return r}function x(r,w){var v,z;if(g(w)){for(v=0,z=w.length;v<z;v++)if(!x(r,w[v]))return!1;return!0}var G=p(w);for(v=0,z=r.length;v<z;v++)if(G==="RegExp"){if(typeof r[v]=="string"&&r[v].match(w))return!0}else if(r[v]===w)return!0;return!1}function E(r,w){if(!g(r)||!g(w)||r.length!==w.length)return!1;r.sort(),w.sort();for(var v=0,z=r.length;v<z;v++)if(r[v]!==w[v])return!1;return!0}function b(r){var w=/^\/+|\/+$/g;return r.replace(w,"")}a._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:a.preventInvalidHostname,duplicateQueryParameters:a.duplicateQueryParameters,escapeQuerySpace:a.escapeQuerySpace}},a.preventInvalidHostname=!1,a.duplicateQueryParameters=!1,a.escapeQuerySpace=!0,a.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,a.idn_expression=/[^a-z0-9\._-]/i,a.punycode_expression=/(xn--)/i,a.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,a.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,a.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,a.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},a.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,a.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},a.hostProtocols=["http","https"],a.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,a.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},a.getDomAttribute=function(r){if(!(!r||!r.nodeName)){var w=r.nodeName.toLowerCase();if(!(w==="input"&&r.type!=="image"))return a.domAttributes[w]}};function D(r){return escape(r)}function A(r){return encodeURIComponent(r).replace(/[!'()*]/g,D).replace(/\*/g,"%2A")}a.encode=A,a.decode=decodeURIComponent,a.iso8859=function(){a.encode=escape,a.decode=unescape},a.unicode=function(){a.encode=A,a.decode=decodeURIComponent},a.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},a.encodeQuery=function(r,w){var v=a.encode(r+"");return w===void 0&&(w=a.escapeQuerySpace),w?v.replace(/%20/g,"+"):v},a.decodeQuery=function(r,w){r+="",w===void 0&&(w=a.escapeQuerySpace);try{return a.decode(w?r.replace(/\+/g,"%20"):r)}catch{return r}};var O={encode:"encode",decode:"decode"},I,B=function(r,w){return function(v){try{return a[w](v+"").replace(a.characters[r][w].expression,function(z){return a.characters[r][w].map[z]})}catch{return v}}};for(I in O)a[I+"PathSegment"]=B("pathname",O[I]),a[I+"UrnPathSegment"]=B("urnpath",O[I]);var M=function(r,w,v){return function(z){var G;v?G=function(ie){return a[w](a[v](ie))}:G=a[w];for(var W=(z+"").split(r),Z=0,X=W.length;Z<X;Z++)W[Z]=G(W[Z]);return W.join(r)}};a.decodePath=M("/","decodePathSegment"),a.decodeUrnPath=M(":","decodeUrnPathSegment"),a.recodePath=M("/","encodePathSegment","decode"),a.recodeUrnPath=M(":","encodeUrnPathSegment","decode"),a.encodeReserved=B("reserved","encode"),a.parse=function(r,w){var v;return w||(w={preventInvalidHostname:a.preventInvalidHostname}),r=r.replace(a.leading_whitespace_expression,""),r=r.replace(a.ascii_tab_whitespace,""),v=r.indexOf("#"),v>-1&&(w.fragment=r.substring(v+1)||null,r=r.substring(0,v)),v=r.indexOf("?"),v>-1&&(w.query=r.substring(v+1)||null,r=r.substring(0,v)),r=r.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),r=r.replace(/^[/\\]{2,}/i,"//"),r.substring(0,2)==="//"?(w.protocol=null,r=r.substring(2),r=a.parseAuthority(r,w)):(v=r.indexOf(":"),v>-1&&(w.protocol=r.substring(0,v)||null,w.protocol&&!w.protocol.match(a.protocol_expression)?w.protocol=void 0:r.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(r=r.substring(v+3),r=a.parseAuthority(r,w)):(r=r.substring(v+1),w.urn=!0))),w.path=r,w},a.parseHost=function(r,w){r||(r=""),r=r.replace(/\\/g,"/");var v=r.indexOf("/"),z,G;if(v===-1&&(v=r.length),r.charAt(0)==="[")z=r.indexOf("]"),w.hostname=r.substring(1,z)||null,w.port=r.substring(z+2,v)||null,w.port==="/"&&(w.port=null);else{var W=r.indexOf(":"),Z=r.indexOf("/"),X=r.indexOf(":",W+1);X!==-1&&(Z===-1||X<Z)?(w.hostname=r.substring(0,v)||null,w.port=null):(G=r.substring(0,v).split(":"),w.hostname=G[0]||null,w.port=G[1]||null)}return w.hostname&&r.substring(v).charAt(0)!=="/"&&(v++,r="/"+r),w.preventInvalidHostname&&a.ensureValidHostname(w.hostname,w.protocol),w.port&&a.ensureValidPort(w.port),r.substring(v)||"/"},a.parseAuthority=function(r,w){return r=a.parseUserinfo(r,w),a.parseHost(r,w)},a.parseUserinfo=function(r,w){var v=r,z=r.indexOf("\\");z!==-1&&(r=r.replace(/\\/g,"/"));var G=r.indexOf("/"),W=r.lastIndexOf("@",G>-1?G:r.length-1),Z;return W>-1&&(G===-1||W<G)?(Z=r.substring(0,W).split(":"),w.username=Z[0]?a.decode(Z[0]):null,Z.shift(),w.password=Z[0]?a.decode(Z.join(":")):null,r=v.substring(W+1)):(w.username=null,w.password=null),r},a.parseQuery=function(r,w){if(!r)return{};if(r=r.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!r)return{};for(var v={},z=r.split("&"),G=z.length,W,Z,X,ie=0;ie<G;ie++)W=z[ie].split("="),Z=a.decodeQuery(W.shift(),w),X=W.length?a.decodeQuery(W.join("="),w):null,Z!=="__proto__"&&(u.call(v,Z)?((typeof v[Z]=="string"||v[Z]===null)&&(v[Z]=[v[Z]]),v[Z].push(X)):v[Z]=X);return v},a.build=function(r){var w="",v=!1;return r.protocol&&(w+=r.protocol+":"),!r.urn&&(w||r.hostname)&&(w+="//",v=!0),w+=a.buildAuthority(r)||"",typeof r.path=="string"&&(r.path.charAt(0)!=="/"&&v&&(w+="/"),w+=r.path),typeof r.query=="string"&&r.query&&(w+="?"+r.query),typeof r.fragment=="string"&&r.fragment&&(w+="#"+r.fragment),w},a.buildHost=function(r){var w="";if(r.hostname)a.ip6_expression.test(r.hostname)?w+="["+r.hostname+"]":w+=r.hostname;else return"";return r.port&&(w+=":"+r.port),w},a.buildAuthority=function(r){return a.buildUserinfo(r)+a.buildHost(r)},a.buildUserinfo=function(r){var w="";return r.username&&(w+=a.encode(r.username)),r.password&&(w+=":"+a.encode(r.password)),w&&(w+="@"),w},a.buildQuery=function(r,w,v){var z="",G,W,Z,X;for(W in r)if(W!=="__proto__"&&u.call(r,W))if(g(r[W]))for(G={},Z=0,X=r[W].length;Z<X;Z++)r[W][Z]!==void 0&&G[r[W][Z]+""]===void 0&&(z+="&"+a.buildQueryParameter(W,r[W][Z],v),w!==!0&&(G[r[W][Z]+""]=!0));else r[W]!==void 0&&(z+="&"+a.buildQueryParameter(W,r[W],v));return z.substring(1)},a.buildQueryParameter=function(r,w,v){return a.encodeQuery(r,v)+(w!==null?"="+a.encodeQuery(w,v):"")},a.addQuery=function(r,w,v){if(typeof w=="object")for(var z in w)u.call(w,z)&&a.addQuery(r,z,w[z]);else if(typeof w=="string"){if(r[w]===void 0){r[w]=v;return}else typeof r[w]=="string"&&(r[w]=[r[w]]);g(v)||(v=[v]),r[w]=(r[w]||[]).concat(v)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(r,w,v){if(typeof w=="object")for(var z in w)u.call(w,z)&&a.setQuery(r,z,w[z]);else if(typeof w=="string")r[w]=v===void 0?null:v;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(r,w,v){var z,G,W;if(g(w))for(z=0,G=w.length;z<G;z++)r[w[z]]=void 0;else if(p(w)==="RegExp")for(W in r)w.test(W)&&(r[W]=void 0);else if(typeof w=="object")for(W in w)u.call(w,W)&&a.removeQuery(r,W,w[W]);else if(typeof w=="string")v!==void 0?p(v)==="RegExp"?!g(r[w])&&v.test(r[w])?r[w]=void 0:r[w]=y(r[w],v):r[w]===String(v)&&(!g(v)||v.length===1)?r[w]=void 0:g(r[w])&&(r[w]=y(r[w],v)):r[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(r,w,v,z){switch(p(w)){case"String":break;case"RegExp":for(var G in r)if(u.call(r,G)&&w.test(G)&&(v===void 0||a.hasQuery(r,G,v)))return!0;return!1;case"Object":for(var W in w)if(u.call(w,W)&&!a.hasQuery(r,W,w[W]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(v)){case"Undefined":return w in r;case"Boolean":var Z=!!(g(r[w])?r[w].length:r[w]);return v===Z;case"Function":return!!v(r[w],w,r);case"Array":if(!g(r[w]))return!1;var X=z?x:E;return X(r[w],v);case"RegExp":return g(r[w])?z?x(r[w],v):!1:!!(r[w]&&r[w].match(v));case"Number":v=String(v);case"String":return g(r[w])?z?x(r[w],v):!1:r[w]===v;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var r=[],w=[],v=0,z=0;z<arguments.length;z++){var G=new a(arguments[z]);r.push(G);for(var W=G.segment(),Z=0;Z<W.length;Z++)typeof W[Z]=="string"&&w.push(W[Z]),W[Z]&&v++}if(!w.length||!v)return new a("");var X=new a("").segment(w);return(r[0].path()===""||r[0].path().slice(0,1)==="/")&&X.path("/"+X.path()),X.normalize()},a.commonPath=function(r,w){var v=Math.min(r.length,w.length),z;for(z=0;z<v;z++)if(r.charAt(z)!==w.charAt(z)){z--;break}return z<1?r.charAt(0)===w.charAt(0)&&r.charAt(0)==="/"?"/":"":((r.charAt(z)!=="/"||w.charAt(z)!=="/")&&(z=r.substring(0,z).lastIndexOf("/")),r.substring(0,z+1))},a.withinString=function(r,w,v){v||(v={});var z=v.start||a.findUri.start,G=v.end||a.findUri.end,W=v.trim||a.findUri.trim,Z=v.parens||a.findUri.parens,X=/[a-z0-9-]=["']?$/i;for(z.lastIndex=0;;){var ie=z.exec(r);if(!ie)break;var se=ie.index;if(v.ignoreHtml){var ge=r.slice(Math.max(se-3,0),se);if(ge&&X.test(ge))continue}for(var be=se+r.slice(se).search(G),xe=r.slice(se,be),ze=-1;;){var je=Z.exec(xe);if(!je)break;var tt=je.index+je[0].length;ze=Math.max(ze,tt)}if(ze>-1?xe=xe.slice(0,ze)+xe.slice(ze).replace(W,""):xe=xe.replace(W,""),!(xe.length<=ie[0].length)&&!(v.ignore&&v.ignore.test(xe))){be=se+xe.length;var ut=w(xe,se,be,r);if(ut===void 0){z.lastIndex=be;continue}ut=String(ut),r=r.slice(0,se)+ut+r.slice(be),z.lastIndex=se+ut.length}}return z.lastIndex=0,r},a.ensureValidHostname=function(r,w){var v=!!r,z=!!w,G=!1;if(z&&(G=x(a.hostProtocols,w)),G&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(r&&r.match(a.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(r).match(a.invalid_hostname_characters))throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-:_]')}},a.ensureValidPort=function(r){if(r){var w=Number(r);if(!(c(w)&&w>0&&w<65536))throw new TypeError('Port "'+r+'" is not a valid port')}},a.noConflict=function(r){if(r){var w={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(w.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(w.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=o.SecondLevelDomains.noConflict()),w}else o.URI===this&&(o.URI=s);return this},l.build=function(r){return r===!0?this._deferred_build=!0:(r===void 0||this._deferred_build)&&(this._string=a.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new a(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function q(r){return function(w,v){return w===void 0?this._parts[r]||"":(this._parts[r]=w||null,this.build(!v),this)}}function P(r,w){return function(v,z){return v===void 0?this._parts[r]||"":(v!==null&&(v=v+"",v.charAt(0)===w&&(v=v.substring(1))),this._parts[r]=v,this.build(!z),this)}}l.protocol=q("protocol"),l.username=q("username"),l.password=q("password"),l.hostname=q("hostname"),l.port=q("port"),l.query=P("query","?"),l.fragment=P("fragment","#"),l.search=function(r,w){var v=this.query(r,w);return typeof v=="string"&&v.length?"?"+v:v},l.hash=function(r,w){var v=this.fragment(r,w);return typeof v=="string"&&v.length?"#"+v:v},l.pathname=function(r,w){if(r===void 0||r===!0){var v=this._parts.path||(this._parts.hostname?"/":"");return r?(this._parts.urn?a.decodeUrnPath:a.decodePath)(v):v}else return this._parts.urn?this._parts.path=r?a.recodeUrnPath(r):"":this._parts.path=r?a.recodePath(r):"/",this.build(!w),this},l.path=l.pathname,l.href=function(r,w){var v;if(r===void 0)return this.toString();this._string="",this._parts=a._parts();var z=r instanceof a,G=typeof r=="object"&&(r.hostname||r.path||r.pathname);if(r.nodeName){var W=a.getDomAttribute(r);r=r[W]||"",G=!1}if(!z&&G&&r.pathname!==void 0&&(r=r.toString()),typeof r=="string"||r instanceof String)this._parts=a.parse(String(r),this._parts);else if(z||G){var Z=z?r._parts:r;for(v in Z)v!=="query"&&u.call(this._parts,v)&&(this._parts[v]=Z[v]);Z.query&&this.query(Z.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},l.is=function(r){var w=!1,v=!1,z=!1,G=!1,W=!1,Z=!1,X=!1,ie=!this._parts.urn;switch(this._parts.hostname&&(ie=!1,v=a.ip4_expression.test(this._parts.hostname),z=a.ip6_expression.test(this._parts.hostname),w=v||z,G=!w,W=G&&i&&i.has(this._parts.hostname),Z=G&&a.idn_expression.test(this._parts.hostname),X=G&&a.punycode_expression.test(this._parts.hostname)),r.toLowerCase()){case"relative":return ie;case"absolute":return!ie;case"domain":case"name":return G;case"sld":return W;case"ip":return w;case"ip4":case"ipv4":case"inet4":return v;case"ip6":case"ipv6":case"inet6":return z;case"idn":return Z;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return X}return null};var V=l.protocol,k=l.port,H=l.hostname;l.protocol=function(r,w){if(r&&(r=r.replace(/:(\/\/)?$/,""),!r.match(a.protocol_expression)))throw new TypeError('Protocol "'+r+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return V.call(this,r,w)},l.scheme=l.protocol,l.port=function(r,w){return this._parts.urn?r===void 0?"":this:(r!==void 0&&(r===0&&(r=null),r&&(r+="",r.charAt(0)===":"&&(r=r.substring(1)),a.ensureValidPort(r))),k.call(this,r,w))},l.hostname=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r!==void 0){var v={preventInvalidHostname:this._parts.preventInvalidHostname},z=a.parseHost(r,v);if(z!=="/")throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-]');r=v.hostname,this._parts.preventInvalidHostname&&a.ensureValidHostname(r,this._parts.protocol)}return H.call(this,r,w)},l.origin=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0){var v=this.protocol(),z=this.authority();return z?(v?v+"://":"")+this.authority():""}else{var G=a(r);return this.protocol(G.protocol()).authority(G.authority()).build(!w),this}},l.host=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0)return this._parts.hostname?a.buildHost(this._parts):"";var v=a.parseHost(r,this._parts);if(v!=="/")throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},l.authority=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0)return this._parts.hostname?a.buildAuthority(this._parts):"";var v=a.parseAuthority(r,this._parts);if(v!=="/")throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},l.userinfo=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0){var v=a.buildUserinfo(this._parts);return v&&v.substring(0,v.length-1)}else return r[r.length-1]!=="@"&&(r+="@"),a.parseUserinfo(r,this._parts),this.build(!w),this},l.resource=function(r,w){var v;return r===void 0?this.path()+this.search()+this.hash():(v=a.parse(r),this._parts.path=v.path,this._parts.query=v.query,this._parts.fragment=v.fragment,this.build(!w),this)},l.subdomain=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,v)||""}else{var z=this._parts.hostname.length-this.domain().length,G=this._parts.hostname.substring(0,z),W=new RegExp("^"+d(G));if(r&&r.charAt(r.length-1)!=="."&&(r+="."),r.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return r&&a.ensureValidHostname(r,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(W,r),this.build(!w),this}},l.domain=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(w=r,r=void 0),r===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.match(/\./g);if(v&&v.length<2)return this._parts.hostname;var z=this._parts.hostname.length-this.tld(w).length-1;return z=this._parts.hostname.lastIndexOf(".",z-1)+1,this._parts.hostname.substring(z)||""}else{if(!r)throw new TypeError("cannot set domain empty");if(r.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(a.ensureValidHostname(r,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=r;else{var G=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(G,r)}return this.build(!w),this}},l.tld=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(w=r,r=void 0),r===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.lastIndexOf("."),z=this._parts.hostname.substring(v+1);return w!==!0&&i&&i.list[z.toLowerCase()]&&i.get(this._parts.hostname)||z}else{var G;if(r)if(r.match(/[^a-zA-Z0-9-]/))if(i&&i.is(r))G=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,r);else throw new TypeError('TLD "'+r+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");G=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,r)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},l.directory=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0||r===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var v=this._parts.path.length-this.filename().length-1,z=this._parts.path.substring(0,v)||(this._parts.hostname?"/":"");return r?a.decodePath(z):z}else{var G=this._parts.path.length-this.filename().length,W=this._parts.path.substring(0,G),Z=new RegExp("^"+d(W));return this.is("relative")||(r||(r="/"),r.charAt(0)!=="/"&&(r="/"+r)),r&&r.charAt(r.length-1)!=="/"&&(r+="/"),r=a.recodePath(r),this._parts.path=this._parts.path.replace(Z,r),this.build(!w),this}},l.filename=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(typeof r!="string"){if(!this._parts.path||this._parts.path==="/")return"";var v=this._parts.path.lastIndexOf("/"),z=this._parts.path.substring(v+1);return r?a.decodePathSegment(z):z}else{var G=!1;r.charAt(0)==="/"&&(r=r.substring(1)),r.match(/\.?\//)&&(G=!0);var W=new RegExp(d(this.filename())+"$");return r=a.recodePath(r),this._parts.path=this._parts.path.replace(W,r),G?this.normalizePath(w):this.build(!w),this}},l.suffix=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0||r===!0){if(!this._parts.path||this._parts.path==="/")return"";var v=this.filename(),z=v.lastIndexOf("."),G,W;return z===-1?"":(G=v.substring(z+1),W=/^[a-z0-9%]+$/i.test(G)?G:"",r?a.decodePathSegment(W):W)}else{r.charAt(0)==="."&&(r=r.substring(1));var Z=this.suffix(),X;if(Z)r?X=new RegExp(d(Z)+"$"):X=new RegExp(d("."+Z)+"$");else{if(!r)return this;this._parts.path+="."+a.recodePath(r)}return X&&(r=a.recodePath(r),this._parts.path=this._parts.path.replace(X,r)),this.build(!w),this}},l.segment=function(r,w,v){var z=this._parts.urn?":":"/",G=this.path(),W=G.substring(0,1)==="/",Z=G.split(z);if(r!==void 0&&typeof r!="number"&&(v=w,w=r,r=void 0),r!==void 0&&typeof r!="number")throw new Error('Bad segment "'+r+'", must be 0-based integer');if(W&&Z.shift(),r<0&&(r=Math.max(Z.length+r,0)),w===void 0)return r===void 0?Z:Z[r];if(r===null||Z[r]===void 0)if(g(w)){Z=[];for(var X=0,ie=w.length;X<ie;X++)!w[X].length&&(!Z.length||!Z[Z.length-1].length)||(Z.length&&!Z[Z.length-1].length&&Z.pop(),Z.push(b(w[X])))}else(w||typeof w=="string")&&(w=b(w),Z[Z.length-1]===""?Z[Z.length-1]=w:Z.push(w));else w?Z[r]=b(w):Z.splice(r,1);return W&&Z.unshift(""),this.path(Z.join(z),v)},l.segmentCoded=function(r,w,v){var z,G,W;if(typeof r!="number"&&(v=w,w=r,r=void 0),w===void 0){if(z=this.segment(r,w,v),!g(z))z=z!==void 0?a.decode(z):void 0;else for(G=0,W=z.length;G<W;G++)z[G]=a.decode(z[G]);return z}if(!g(w))w=typeof w=="string"||w instanceof String?a.encode(w):w;else for(G=0,W=w.length;G<W;G++)w[G]=a.encode(w[G]);return this.segment(r,w,v)};var j=l.query;return l.query=function(r,w){if(r===!0)return a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof r=="function"){var v=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace),z=r.call(this,v);return this._parts.query=a.buildQuery(z||v,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return r!==void 0&&typeof r!="string"?(this._parts.query=a.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):j.call(this,r,w)},l.setQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof r=="string"||r instanceof String)z[r]=w!==void 0?w:null;else if(typeof r=="object")for(var G in r)u.call(r,G)&&(z[G]=r[G]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=w),this.build(!v),this},l.addQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(z,r,w===void 0?null:w),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=w),this.build(!v),this},l.removeQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(z,r,w),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=w),this.build(!v),this},l.hasQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(z,r,w,v)},l.setSearch=l.setQuery,l.addSearch=l.addQuery,l.removeSearch=l.removeQuery,l.hasSearch=l.hasQuery,l.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},l.normalizeProtocol=function(r){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!r)),this},l.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},l.normalizePort=function(r){return typeof this._parts.protocol=="string"&&this._parts.port===a.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!r)),this},l.normalizePath=function(r){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=a.recodeUrnPath(this._parts.path),this.build(!r),this;if(this._parts.path==="/")return this;w=a.recodePath(w);var v,z="",G,W;for(w.charAt(0)!=="/"&&(v=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),v&&(z=w.substring(1).match(/^(\.\.\/)+/)||"",z&&(z=z[0]));G=w.search(/\/\.\.(\/|$)/),G!==-1;){if(G===0){w=w.substring(3);continue}W=w.substring(0,G).lastIndexOf("/"),W===-1&&(W=G),w=w.substring(0,W)+w.substring(G+3)}return v&&this.is("relative")&&(w=z+w.substring(1)),this._parts.path=w,this.build(!r),this},l.normalizePathname=l.normalizePath,l.normalizeQuery=function(r){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(a.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!r)),this},l.normalizeFragment=function(r){return this._parts.fragment||(this._parts.fragment=null,this.build(!r)),this},l.normalizeSearch=l.normalizeQuery,l.normalizeHash=l.normalizeFragment,l.iso8859=function(){var r=a.encode,w=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=r,a.decode=w}return this},l.unicode=function(){var r=a.encode,w=a.decode;a.encode=A,a.decode=unescape;try{this.normalize()}finally{a.encode=r,a.decode=w}return this},l.readable=function(){var r=this.clone();r.username("").password("").normalize();var w="";if(r._parts.protocol&&(w+=r._parts.protocol+"://"),r._parts.hostname&&(r.is("punycode")&&t?(w+=t.toUnicode(r._parts.hostname),r._parts.port&&(w+=":"+r._parts.port)):w+=r.host()),r._parts.hostname&&r._parts.path&&r._parts.path.charAt(0)!=="/"&&(w+="/"),w+=r.path(!0),r._parts.query){for(var v="",z=0,G=r._parts.query.split("&"),W=G.length;z<W;z++){var Z=(G[z]||"").split("=");v+="&"+a.decodeQuery(Z[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),Z[1]!==void 0&&(v+="="+a.decodeQuery(Z[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+v.substring(1)}return w+=a.decodeQuery(r.hash(),!0),w},l.absoluteTo=function(r){var w=this.clone(),v=["protocol","username","password","hostname","port"],z,G,W;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(r instanceof a||(r=new a(r)),w._parts.protocol||(w._parts.protocol=r._parts.protocol,this._parts.hostname))return w;for(G=0;W=v[G];G++)w._parts[W]=r._parts[W];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(z=r.directory(),z=z||(r.path().indexOf("/")===0?"/":""),w._parts.path=(z?z+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=r._parts.path,w._parts.query||(w._parts.query=r._parts.query)),w.build(),w},l.relativeTo=function(r){var w=this.clone().normalize(),v,z,G,W,Z;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(r=new a(r).normalize(),v=w._parts,z=r._parts,W=w.path(),Z=r.path(),W.charAt(0)!=="/")throw new Error("URI is already relative");if(Z.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(v.protocol===z.protocol&&(v.protocol=null),v.username!==z.username||v.password!==z.password||v.protocol!==null||v.username!==null||v.password!==null)return w.build();if(v.hostname===z.hostname&&v.port===z.port)v.hostname=null,v.port=null;else return w.build();if(W===Z)return v.path="",w.build();if(G=a.commonPath(W,Z),!G)return w.build();var X=z.path.substring(G.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return v.path=X+v.path.substring(G.length)||"./",w.build()},l.equals=function(r){var w=this.clone(),v=new a(r),z={},G={},W={},Z,X,ie;if(w.normalize(),v.normalize(),w.toString()===v.toString())return!0;if(Z=w.query(),X=v.query(),w.query(""),v.query(""),w.toString()!==v.toString()||Z.length!==X.length)return!1;z=a.parseQuery(Z,this._parts.escapeQuerySpace),G=a.parseQuery(X,this._parts.escapeQuerySpace);for(ie in z)if(u.call(z,ie)){if(g(z[ie])){if(!E(z[ie],G[ie]))return!1}else if(z[ie]!==G[ie])return!1;W[ie]=!0}for(ie in G)if(u.call(G,ie)&&!W[ie])return!1;return!0},l.preventInvalidHostname=function(r){return this._parts.preventInvalidHostname=!!r,this},l.duplicateQueryParameters=function(r){return this._parts.duplicateQueryParameters=!!r,this},l.escapeQuerySpace=function(r){return this._parts.escapeQuerySpace=!!r,this},a})})(kh);var j_=kh.exports;const ai=rs(j_);function Y_(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}function tn(e,t){if(e===null||typeof e!="object")return e;t=_(t,!1);const n=new e.constructor;for(const i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=tn(o,t)),n[i]=o}return n}function nn(e,t,n){n=_(n,!1);const i={},o=h(e),s=h(t);let a,c,l;if(o)for(a in e)e.hasOwnProperty(a)&&(c=e[a],s&&n&&typeof c=="object"&&t.hasOwnProperty(a)?(l=t[a],typeof l=="object"?i[a]=nn(c,l,n):i[a]=c):i[a]=c);if(s)for(a in t)t.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(l=t[a],i[a]=l);return i}function Jo(){let e,t;const n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}function er(e,t){let n;return typeof document<"u"&&(n=document),er._implementation(e,t,n)}er._implementation=function(e,t,n){if(!h(e))throw new C("relative uri is required.");if(!h(t)){if(typeof n>"u")return e;t=_(n.baseURI,n.location.href)}const i=new ai(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};function X_(e,t){if(!h(e))throw new C("uri is required.");let n="";const i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new ai(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}function $_(e){if(!h(e))throw new C("uri is required.");const t=new ai(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}const Hh={};function Wh(e,t,n){h(t)||(t=e.width),h(n)||(n=e.height);let i=Hh[t];h(i)||(i={},Hh[t]=i);let o=i[n];if(!h(o)){const s=document.createElement("canvas");s.width=t,s.height=n,o=s.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}const Z_=/^blob:/i;function jh(e){return m.typeOf.string("uri",e),Z_.test(e)}let Gn;function nc(e){h(Gn)||(Gn=document.createElement("a")),Gn.href=window.location.href;const t=Gn.host,n=Gn.protocol;return Gn.href=e,Gn.href=Gn.href,n!==Gn.protocol||t!==Gn.host}const K_=/^data:/i;function Yh(e){return m.typeOf.string("uri",e),K_.test(e)}function Q_(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(s){i(s)},o.appendChild(t)})}function J_(e){if(!h(e))throw new C("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let s=0,a=i.length;s<a;++s)t+=`${o+encodeURIComponent(i[s])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}function eg(e){if(!h(e))throw new C("queryString is required.");const t={};if(e==="")return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){const s=n[i].split("="),a=decodeURIComponent(s[0]);let c=s[1];h(c)?c=decodeURIComponent(c):c="";const l=t[a];typeof l=="string"?t[a]=[l,c]:Array.isArray(l)?l.push(c):t[a]=c}return t}const mt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),tg=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function As(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.throttleByServer,!1),n=_(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=_(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=_(e.type,tg.OTHER),this.serverKey=e.serverKey,this.state=mt.UNISSUED,this.deferred=void 0,this.cancelled=!1}As.prototype.cancel=function(){this.cancelled=!0},As.prototype.clone=function(e){return h(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=mt.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new As(this)};function ng(e){const t={};if(!e)return t;const n=e.split(`\r
44
- `);for(let i=0;i<n.length;++i){const o=n[i],s=o.indexOf(": ");if(s>0){const a=o.substring(0,s),c=o.substring(s+2);t[a]=c}}return t}function tr(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=ng(this.responseHeaders))}tr.prototype.toString=function(){let e="Request has failed.";return h(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function Pe(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Pe.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Pe.prototype.addEventListener=function(e,t){m.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},Pe.prototype.removeEventListener=function(e,t){m.typeOf.func("listener",e);const n=this._listeners,i=this._scopes;let o=-1;for(let s=0;s<n.length;s++)if(n[s]===e&&i[s]===t){o=s;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function ig(e,t){return t-e}Pe.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e;const t=this._listeners,n=this._scopes;let i=t.length;for(e=0;e<i;e++){const s=t[e];h(s)&&t[e].apply(n[e],arguments)}const o=this._toRemove;if(i=o.length,i>0){for(o.sort(ig),e=0;e<i;e++){const s=o[e];t.splice(s,1),n.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function Xi(e){m.typeOf.object("options",e),m.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Xi.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){m.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function ic(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}Xi.prototype.reserve=function(e){e=_(e,this._length),this._array.length=e},Xi.prototype.heapify=function(e){e=_(e,0);const t=this._length,n=this._comparator,i=this._array;let o=-1,s=!0;for(;s;){const a=2*(e+1),c=a-1;c<t&&n(i[c],i[e])<0?o=c:o=e,a<t&&n(i[a],i[o])<0&&(o=a),o!==e?(ic(i,o,e),e=o):s=!1}},Xi.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},Xi.prototype.insert=function(e){m.defined("element",e);const t=this._array,n=this._comparator,i=this._maximumLength;let o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){const a=Math.floor((o-1)/2);if(n(t[o],t[a])<0)ic(t,o,a),o=a;else break}let s;return h(i)&&this._length>i&&(s=t[i],this._length=i),s},Xi.prototype.pop=function(e){if(e=_(e,0),this._length===0)return;m.typeOf.number.lessThan("index",e,this._length);const t=this._array,n=t[e];return ic(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function og(e,t){return e.priority-t.priority}const Le={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let bo=20;const Ht=new Xi({comparator:og});Ht.maximumLength=bo,Ht.reserve(bo);const qn=[];let ci={};const rg=typeof document<"u"?new ai(document.location.href):new ai,Ds=new Pe;function Xe(){}Xe.maximumRequests=50,Xe.maximumRequestsPerServer=18,Xe.requestsByServer={},Xe.throttleRequests=!0,Xe.debugShowStatistics=!1,Xe.requestCompletedEvent=Ds,Object.defineProperties(Xe,{statistics:{get:function(){return Le}},priorityHeapLength:{get:function(){return bo},set:function(e){if(e<bo)for(;Ht.length>e;){const t=Ht.pop();$i(t)}bo=e,Ht.maximumLength=e,Ht.reserve(e)}}});function Xh(e){h(e.priorityFunction)&&(e.priority=e.priorityFunction())}Xe.serverHasOpenSlots=function(e,t){t=_(t,1);const n=_(Xe.requestsByServer[e],Xe.maximumRequestsPerServer);return ci[e]+t<=n},Xe.heapHasOpenSlots=function(e){return Ht.length+e<=bo};function $h(e){return e.state===mt.UNISSUED&&(e.state=mt.ISSUED,e.deferred=Jo()),e.deferred.promise}function sg(e){return function(t){if(e.state===mt.CANCELLED)return;const n=e.deferred;--Le.numberOfActiveRequests,--ci[e.serverKey],Ds.raiseEvent(),e.state=mt.RECEIVED,e.deferred=void 0,n.resolve(t)}}function ag(e){return function(t){e.state!==mt.CANCELLED&&(++Le.numberOfFailedRequests,--Le.numberOfActiveRequests,--ci[e.serverKey],Ds.raiseEvent(t),e.state=mt.FAILED,e.deferred.reject(t))}}function Zh(e){const t=$h(e);return e.state=mt.ACTIVE,qn.push(e),++Le.numberOfActiveRequests,++Le.numberOfActiveRequestsEver,++ci[e.serverKey],e.requestFunction().then(sg(e)).catch(ag(e)),t}function $i(e){const t=e.state===mt.ACTIVE;if(e.state=mt.CANCELLED,++Le.numberOfCancelledRequests,h(e.deferred)){const n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Le.numberOfActiveRequests,--ci[e.serverKey],++Le.numberOfCancelledActiveRequests),h(e.cancelFunction)&&e.cancelFunction()}Xe.update=function(){let e,t,n=0;const i=qn.length;for(e=0;e<i;++e){if(t=qn[e],t.cancelled&&$i(t),t.state!==mt.ACTIVE){++n;continue}n>0&&(qn[e-n]=t)}qn.length-=n;const o=Ht.internalArray,s=Ht.length;for(e=0;e<s;++e)Xh(o[e]);Ht.resort();const a=Math.max(Xe.maximumRequests-qn.length,0);let c=0;for(;c<a&&Ht.length>0;){if(t=Ht.pop(),t.cancelled){$i(t);continue}if(t.throttleByServer&&!Xe.serverHasOpenSlots(t.serverKey)){$i(t);continue}Zh(t),++c}cg()},Xe.getServerKey=function(e){m.typeOf.string("url",e);let t=new ai(e);t.scheme()===""&&(t=t.absoluteTo(rg),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);const i=ci[n];return h(i)||(ci[n]=0),n},Xe.request=function(e){if(m.typeOf.object("request",e),m.typeOf.string("request.url",e.url),m.typeOf.func("request.requestFunction",e.requestFunction),Yh(e.url)||jh(e.url))return Ds.raiseEvent(),e.state=mt.RECEIVED,e.requestFunction();if(++Le.numberOfAttemptedRequests,h(e.serverKey)||(e.serverKey=Xe.getServerKey(e.url)),Xe.throttleRequests&&e.throttleByServer&&!Xe.serverHasOpenSlots(e.serverKey))return;if(!Xe.throttleRequests||!e.throttle)return Zh(e);if(qn.length>=Xe.maximumRequests)return;Xh(e);const t=Ht.insert(e);if(h(t)){if(t===e)return;$i(t)}return $h(e)};function cg(){Xe.debugShowStatistics&&(Le.numberOfActiveRequests===0&&Le.lastNumberOfActiveRequests>0&&(Le.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Le.numberOfAttemptedRequests}`),Le.numberOfAttemptedRequests=0),Le.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Le.numberOfCancelledRequests}`),Le.numberOfCancelledRequests=0),Le.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Le.numberOfCancelledActiveRequests}`),Le.numberOfCancelledActiveRequests=0),Le.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Le.numberOfFailedRequests}`),Le.numberOfFailedRequests=0)),Le.lastNumberOfActiveRequests=Le.numberOfActiveRequests)}Xe.clearForSpecs=function(){for(;Ht.length>0;){const t=Ht.pop();$i(t)}const e=qn.length;for(let t=0;t<e;++t)$i(qn[t]);qn.length=0,ci={},Le.numberOfAttemptedRequests=0,Le.numberOfActiveRequests=0,Le.numberOfCancelledRequests=0,Le.numberOfCancelledActiveRequests=0,Le.numberOfFailedRequests=0,Le.numberOfActiveRequestsEver=0,Le.lastNumberOfActiveRequests=0},Xe.numberOfActiveRequestsByServer=function(e){return ci[e]},Xe.requestHeap=Ht;const wo={};let To={};wo.add=function(e,t){if(!h(e))throw new C("host is required.");if(!h(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;h(To[n])||(To[n]=!0)},wo.remove=function(e,t){if(!h(e))throw new C("host is required.");if(!h(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;h(To[n])&&delete To[n]};function lg(e){const t=new ai(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}wo.contains=function(e){if(!h(e))throw new C("url is required.");const t=lg(e);return!!(h(t)&&h(To[t]))},wo.clear=function(){To={}};const Kh=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function ne(e){e=_(e,_.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),m.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Hn(e.templateValues,{}),this._queryParameters=Hn(e.queryParameters,{}),this.headers=Hn(e.headers,{}),this.request=_(e.request,new As),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=_(e.retryAttempts,0),this._retryCount=0,_(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Hn(e,t){return h(e)?tn(e):t}ne.createIfNeeded=function(e){return e instanceof ne?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new ne({url:e})};let So;ne.supportsImageBitmapOptions=function(){return h(So)?So:typeof createImageBitmap!="function"?(So=Promise.resolve(!1),So):(So=ne.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){const n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){const n=Wh(t[0]),i=Wh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),So)},Object.defineProperties(ne,{isBlobSupported:{get:function(){return Kh}}}),Object.defineProperties(ne.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return $_(this._url)}},isDataUri:{get:function(){return Yh(this._url)}},isBlobUri:{get:function(){return jh(this._url)}},isCrossOriginUrl:{get:function(){return nc(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),ne.prototype.toString=function(){return this.getUrlComponent(!0,!0)},ne.prototype.parseUrl=function(e,t,n,i){let o=new ai(e);const s=hg(o.query());this._queryParameters=t?Os(s,this.queryParameters,n):s,o.search(""),o.fragment(""),h(i)&&o.scheme()===""&&(o=o.absoluteTo(er(i))),this._url=o.toString()};function hg(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:eg(e)}function Os(e,t,n){if(!n)return nn(e,t);const i=tn(e,!0);for(const o in t)if(t.hasOwnProperty(o)){let s=i[o];const a=t[o];h(s)?(Array.isArray(s)||(s=i[o]=[s]),i[o]=s.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}ne.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${fg(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,s){const a=i[s];return h(a)?encodeURIComponent(a):o})),t&&h(this.proxy)&&(n=this.proxy.getURL(n)),n};function fg(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!h(e[t[0]])?`?${t[0]}`:`?${J_(e)}`}ne.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Os(this._queryParameters,e,!1):this._queryParameters=Os(e,this._queryParameters,!1)},ne.prototype.appendQueryParameters=function(e){this._queryParameters=Os(e,this._queryParameters,!0)},ne.prototype.setTemplateValues=function(e,t){t?this._templateValues=nn(this._templateValues,e):this._templateValues=nn(e,this._templateValues)},ne.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,h(e.url)){const n=_(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return h(e.queryParameters)&&(t._queryParameters=nn(e.queryParameters,t.queryParameters)),h(e.templateValues)&&(t._templateValues=nn(e.templateValues,t.templateValues)),h(e.headers)&&(t.headers=nn(e.headers,t.headers)),h(e.proxy)&&(t.proxy=e.proxy),h(e.request)&&(t.request=e.request),h(e.retryCallback)&&(t.retryCallback=e.retryCallback),h(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},ne.prototype.retryOnError=function(e){const t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})},ne.prototype.clone=function(e){return h(e)?(e._url=this._url,e._queryParameters=tn(this._queryParameters),e._templateValues=tn(this._templateValues),e.headers=tn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new ne({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:h(this.credits)?this.credits.slice():void 0})},ne.prototype.getBaseUri=function(e){return X_(this.getUrlComponent(e),e)},ne.prototype.appendForwardSlash=function(){this._url=Y_(this._url)},ne.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},ne.fetchArrayBuffer=function(e){return new ne(e).fetchArrayBuffer()},ne.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},ne.fetchBlob=function(e){return new ne(e).fetchBlob()},ne.prototype.fetchImage=function(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.preferImageBitmap,!1),n=_(e.preferBlob,!1),i=_(e.flipY,!1),o=_(e.skipColorSpaceConversion,!1);if(rc(this.request),!Kh||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return oc({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});const s=this.fetchBlob();if(!h(s))return;let a,c,l,u;return ne.supportsImageBitmapOptions().then(function(d){return a=d,c=a&&t,s}).then(function(d){if(!h(d))return;if(u=d,c)return ne.createImageBitmapFromBlob(d,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return l=new ne({url:p}),oc({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(h(d))return d.blob=u,c||window.URL.revokeObjectURL(l.url),d}).catch(function(d){return h(l)&&window.URL.revokeObjectURL(l.url),d.blob=u,Promise.reject(d)})};function oc(e){const t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let c=!1;!t.isDataUri&&!t.isBlobUri&&(c=t.isCrossOriginUrl);const l=Jo();return ne._Implementations.createImage(s,c,l,n,i,o),l.promise};const a=Xe.request(s);if(h(a))return a.catch(function(c){return s.state!==mt.FAILED?Promise.reject(c):t.retryOnError(c).then(function(l){return l?(s.state=mt.UNISSUED,s.deferred=void 0,oc({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(c)})})}ne.fetchImage=function(e){return new ne(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},ne.prototype.fetchText=function(){return this.fetch({responseType:"text"})},ne.fetchText=function(e){return new ne(e).fetchText()},ne.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(h(e))return e.then(function(t){if(h(t))return JSON.parse(t)})},ne.fetchJson=function(e){return new ne(e).fetchJson()},ne.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},ne.fetchXML=function(e){return new ne(e).fetchXML()},ne.prototype.fetchJsonp=function(e){e=_(e,"callback"),rc(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(h(window[t]));return Qh(this,e,t)};function Qh(e,t,n){const i={};i[t]=n,e.setQueryParameters(i);const o=e.request,s=e.url;o.url=s,o.requestFunction=function(){const c=Jo();return window[n]=function(l){c.resolve(l);try{delete window[n]}catch{window[n]=void 0}},ne._Implementations.loadAndExecuteScript(s,n,c),c.promise};const a=Xe.request(o);if(h(a))return a.catch(function(c){return o.state!==mt.FAILED?Promise.reject(c):e.retryOnError(c).then(function(l){return l?(o.state=mt.UNISSUED,o.deferred=void 0,Qh(e,t,n)):Promise.reject(c)})})}ne.fetchJsonp=function(e){return new ne(e).fetchJsonp(e.callbackParameterName)},ne.prototype._makeRequest=function(e){const t=this;rc(t.request);const n=t.request,i=t.url;n.url=i,n.requestFunction=function(){const s=e.responseType,a=nn(e.headers,t.headers),c=e.overrideMimeType,l=e.method,u=e.data,d=Jo(),p=ne._Implementations.loadWithXhr(i,s,l,u,a,d,c);return h(p)&&h(p.abort)&&(n.cancelFunction=function(){p.abort()}),d.promise};const o=Xe.request(n);if(h(o))return o.then(function(s){return n.cancelFunction=void 0,s}).catch(function(s){return n.cancelFunction=void 0,n.state!==mt.FAILED?Promise.reject(s):t.retryOnError(s).then(function(a){return a?(n.state=mt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})};function rc(e){if(e.state===mt.ISSUED||e.state===mt.ACTIVE)throw new at("The Resource is already being fetched.");e.state=mt.UNISSUED,e.deferred=void 0}const ug=/^data:(.*?)(;base64)?,(.*)$/;function vs(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Jh(e,t){const n=vs(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let s=0;s<n.length;s++)o[s]=n.charCodeAt(s);return i}function dg(e,t){t=_(t,"");const n=e[1],i=!!e[2],o=e[3];let s,a;switch(t){case"":case"text":return vs(i,o);case"arraybuffer":return Jh(i,o);case"blob":return s=Jh(i,o),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(vs(i,o),n);case"json":return JSON.parse(vs(i,o));default:throw new C(`Unhandled responseType: ${t}`)}}ne.prototype.fetch=function(e){return e=Hn(e,{}),e.method="GET",this._makeRequest(e)},ne.fetch=function(e){return new ne(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.delete=function(e){return e=Hn(e,{}),e.method="DELETE",this._makeRequest(e)},ne.delete=function(e){return new ne(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},ne.prototype.head=function(e){return e=Hn(e,{}),e.method="HEAD",this._makeRequest(e)},ne.head=function(e){return new ne(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.options=function(e){return e=Hn(e,{}),e.method="OPTIONS",this._makeRequest(e)},ne.options=function(e){return new ne(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.post=function(e,t){return m.defined("data",e),t=Hn(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},ne.post=function(e){return new ne(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.put=function(e,t){return m.defined("data",e),t=Hn(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},ne.put=function(e){return new ne(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.patch=function(e,t){return m.defined("data",e),t=Hn(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},ne.patch=function(e){return new ne(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne._Implementations={},ne._Implementations.loadImageElement=function(e,t,n){const i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(wo.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},ne._Implementations.createImage=function(e,t,n,i,o,s){const a=e.url;ne.supportsImageBitmapOptions().then(function(c){if(!(c&&s)){ne._Implementations.loadImageElement(a,t,n);return}const l="blob",u="GET",d=Jo(),p=ne._Implementations.loadWithXhr(a,l,u,void 0,void 0,d,void 0,void 0,void 0);return h(p)&&h(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!h(g)){n.reject(new at(`Successfully retrieved ${a} but it contained no content.`));return}return ne.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})},ne.createImageBitmapFromBlob=function(e,t){return m.defined("options",t),m.typeOf.bool("options.flipY",t.flipY),m.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),m.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function pg(e,t,n,i,o,s,a){fetch(e,{method:n,headers:o}).then(async c=>{if(!c.ok){const l={};c.headers.forEach((u,d)=>{l[d]=u}),s.reject(new tr(c.status,c,l));return}switch(t){case"text":s.resolve(c.text());break;case"json":s.resolve(c.json());break;default:s.resolve(new Uint8Array(await c.arrayBuffer()).buffer);break}}).catch(()=>{s.reject(new tr)})}const mg=typeof XMLHttpRequest>"u";ne._Implementations.loadWithXhr=function(e,t,n,i,o,s,a){const c=ug.exec(e);if(c!==null){s.resolve(dg(c,t));return}if(mg){pg(e,t,n,i,o,s);return}const l=new XMLHttpRequest;if(wo.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),h(a)&&h(l.overrideMimeType)&&l.overrideMimeType(a),h(o))for(const d in o)o.hasOwnProperty(d)&&l.setRequestHeader(d,o[d]);h(t)&&(l.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){s.reject(new tr(l.status,l.response,l.getAllResponseHeaders()));return}const d=l.response,p=l.responseType;if(n==="HEAD"||n==="OPTIONS"){const y=l.getAllResponseHeaders().trim().split(/[\r\n]+/),x={};y.forEach(function(E){const b=E.split(": "),D=b.shift();x[D]=b.join(": ")}),s.resolve(x);return}if(l.status===204)s.resolve(void 0);else if(h(d)&&(!h(t)||p===t))s.resolve(d);else if(t==="json"&&typeof d=="string")try{s.resolve(JSON.parse(d))}catch(g){s.reject(g)}else(p===""||p==="document")&&h(l.responseXML)&&l.responseXML.hasChildNodes()?s.resolve(l.responseXML):(p===""||p==="text")&&h(l.responseText)?s.resolve(l.responseText):s.reject(new at("Invalid XMLHttpRequest response type."))},l.onerror=function(d){s.reject(new tr)},l.send(i),l},ne._Implementations.loadAndExecuteScript=function(e,t,n){return Q_(e).catch(function(i){n.reject(i)})},ne._DefaultImplementations={},ne._DefaultImplementations.createImage=ne._Implementations.createImage,ne._DefaultImplementations.loadWithXhr=ne._Implementations.loadWithXhr,ne._DefaultImplementations.loadAndExecuteScript=ne._Implementations.loadAndExecuteScript,ne.DEFAULT=Object.freeze(new ne({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function nr(e){e=_(e,_.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._addNewLeapSeconds=_(e.addNewLeapSeconds,!0),h(e.data)?ef(this,e.data):ef(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}nr.fromUrl=async function(e,t){m.defined("url",e),t=_(t,_.EMPTY_OBJECT);const n=ne.createIfNeeded(e);let i;try{i=await n.fetchJson()}catch{throw new at(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new nr({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},nr.NONE=Object.freeze({compute:function(e,t){return h(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Xa(0,0,0,0,0),t}}),nr.prototype.compute=function(e,t){if(!h(this._samples))return;if(h(t)||(t=new Xa(0,0,0,0,0)),this._samples.length===0)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 o=0,s=0;if(h(i)){const c=n[i],l=n[i+1],u=$.lessThanOrEquals(c,e),d=!h(l),p=d||$.greaterThanOrEquals(l,e);if(u&&p)return o=i,!d&&l.equals(e)&&++o,s=o+1,nf(this,n,this._samples,e,o,s,t),t}let a=Ko(n,e,$.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,o=a,s=a):(s=~a,o=s-1,o<0&&(o=0)),this._lastIndex=o,nf(this,n,this._samples,e,o,s,t),t};function _g(e,t){return $.compare(e.julianDate,t)}function ef(e,t){if(!h(t.columnNames))throw new at("Error in loaded EOP data: The columnNames property is required.");if(!h(t.samples))throw new at("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||s<0||a<0||c<0||l<0)throw new at("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,d=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=c,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let p;const g=e._addNewLeapSeconds;for(let y=0,x=u.length;y<x;y+=e._columnCount){const E=u[y+n],b=u[y+l],D=E+nt.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new $(D,b,ve.TAI);if(d.push(A),g){if(b!==p&&h(p)){const O=$.leapSeconds,I=Ko(O,A,_g);if(I<0){const B=new Ge(A,b);O.splice(~I,0,B)}}p=b}}}function tf(e,t,n,i,o){const s=n*i;o.xPoleWander=t[s+e._xPoleWanderRadiansColumn],o.yPoleWander=t[s+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[s+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[s+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[s+e._ut1MinusUtcSecondsColumn]}function ir(e,t,n){return t+e*(n-t)}function nf(e,t,n,i,o,s,a){const c=e._columnCount;if(s>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;const l=t[o],u=t[s];if(l.equals(u)||i.equals(l))return tf(e,n,o,c,a),a;if(i.equals(u))return tf(e,n,s,c,a),a;const d=$.secondsDifference(i,l)/$.secondsDifference(u,l),p=o*c,g=s*c;let y=n[p+e._ut1MinusUtcSecondsColumn],x=n[g+e._ut1MinusUtcSecondsColumn];const E=x-y;if(E>.5||E<-.5){const b=n[p+e._taiMinusUtcSecondsColumn],D=n[g+e._taiMinusUtcSecondsColumn];b!==D&&(u.equals(i)?y=x:x-=D-b)}return a.xPoleWander=ir(d,n[p+e._xPoleWanderRadiansColumn],n[g+e._xPoleWanderRadiansColumn]),a.yPoleWander=ir(d,n[p+e._yPoleWanderRadiansColumn],n[g+e._yPoleWanderRadiansColumn]),a.xPoleOffset=ir(d,n[p+e._xCelestialPoleOffsetRadiansColumn],n[g+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=ir(d,n[p+e._yCelestialPoleOffsetRadiansColumn],n[g+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=ir(d,y,x),a}function lt(e,t,n){this.heading=_(e,0),this.pitch=_(t,0),this.roll=_(n,0)}lt.fromQuaternion=function(e,t){if(!h(e))throw new C("quaternion is required");h(t)||(t=new lt);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),s=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,s),t.roll=Math.atan2(o,i),t.pitch=-S.asinClamped(n),t},lt.fromDegrees=function(e,t,n,i){if(!h(e))throw new C("heading is required");if(!h(t))throw new C("pitch is required");if(!h(n))throw new C("roll is required");return h(i)||(i=new lt),i.heading=e*S.RADIANS_PER_DEGREE,i.pitch=t*S.RADIANS_PER_DEGREE,i.roll=n*S.RADIANS_PER_DEGREE,i},lt.clone=function(e,t){if(h(e))return h(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new lt(e.heading,e.pitch,e.roll)},lt.equals=function(e,t){return e===t||h(e)&&h(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},lt.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.heading,t.heading,n,i)&&S.equalsEpsilon(e.pitch,t.pitch,n,i)&&S.equalsEpsilon(e.roll,t.roll,n,i)},lt.prototype.clone=function(e){return lt.clone(this,e)},lt.prototype.equals=function(e){return lt.equals(this,e)},lt.prototype.equalsEpsilon=function(e,t,n){return lt.equalsEpsilon(this,e,t,n)},lt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const of=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function gg(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const i=e[t].getAttribute("src"),o=of.exec(i);if(o!==null)return o[1]}}let Is;function rf(e){return typeof document>"u"?e:(h(Is)||(Is=document.createElement("a")),Is.href=e,Is.href)}let Zi;function sf(){if(h(Zi))return Zi;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:h(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Rt&&Rt.tagName.toUpperCase()==="SCRIPT"&&Rt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href)?e=er(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Rt&&Rt.tagName.toUpperCase()==="SCRIPT"&&Rt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href):typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?e=er("..",hn("Core/buildModuleUrl.js")):e=gg(),!h(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Zi=new ne({url:rf(e)}),Zi.appendForwardSlash(),Zi}function yg(e){return rf(require.toUrl(`../${e}`))}function af(e){return sf().getDerivedResource({url:e}).url}let Rs;function hn(e){return h(Rs)||(typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?Rs=yg:Rs=af),Rs(e)}hn._cesiumScriptRegex=of,hn._buildModuleUrlFromBaseUrl=af,hn._clearBaseResource=function(){Zi=void 0},hn.setBaseUrl=function(e){Zi=ne.DEFAULT.getDerivedResource({url:e})},hn.getCesiumBaseUrl=sf;function cf(e,t,n){this.x=e,this.y=t,this.s=n}function sc(e){e=_(e,_.EMPTY_OBJECT),this._xysFileUrlTemplate=ne.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=_(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=_(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new $(this._sampleZeroJulianEphemerisDate,0,ve.TAI),this._stepSizeDays=_(e.stepSizeDays,1),this._samplesPerXysFile=_(e.samplesPerXysFile,1e3),this._totalSamples=_(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let s=0;s<=t;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(let a=0;a<=t;++a)a!==s&&(n[s]*=s-a);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}const xg=new $(0,0,ve.TAI);function ac(e,t,n){const i=xg;return i.dayNumber=t,i.secondsOfDay=n,$.daysDifference(i,e._sampleZeroDateTT)}sc.prototype.preload=function(e,t,n,i){const o=ac(this,e,t),s=ac(this,n,i);let a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let c=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);const l=a/this._samplesPerXysFile|0,u=c/this._samplesPerXysFile|0,d=[];for(let p=l;p<=u;++p)d.push(cc(this,p));return Promise.all(d)},sc.prototype.computeXysRadians=function(e,t,n){const i=ac(this,e,t);if(i<0)return;const o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;const s=this._interpolationOrder;let a=o-(s/2|0);a<0&&(a=0);let c=a+s;c>=this._totalSamples&&(c=this._totalSamples-1,a=c-s,a<0&&(a=0));let l=!1;const u=this._samples;if(h(u[a*3])||(cc(this,a/this._samplesPerXysFile|0),l=!0),h(u[c*3])||(cc(this,c/this._samplesPerXysFile|0),l=!0),l)return;h(n)?(n.x=0,n.y=0,n.s=0):n=new cf(0,0,0);const d=i-a*this._stepSizeDays,p=this._work,g=this._denominators,y=this._coef,x=this._xTable;let E,b;for(E=0;E<=s;++E)p[E]=d-x[E];for(E=0;E<=s;++E){for(y[E]=1,b=0;b<=s;++b)b!==E&&(y[E]*=p[b]);y[E]*=g[E];let D=(a+E)*3;n.x+=y[E]*u[D++],n.y+=y[E]*u[D++],n.s+=y[E]*u[D]}return n};function cc(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const i=e._xysFileUrlTemplate;h(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ne({url:hn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const o=n.fetchJson().then(function(s){e._chunkDownloadsInProgress[t]=!1;const a=e._samples,c=s.samples,l=t*e._samplesPerXysFile*3;for(let u=0,d=c.length;u<d;++u)a[l+u]=c[u]});return e._chunkDownloadsInProgress[t]=o,o}function J(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.z=_(n,0),this.w=_(i,0)}let or=new f;J.fromAxisAngle=function(e,t,n){m.typeOf.object("axis",e),m.typeOf.number("angle",t);const i=t/2,o=Math.sin(i);or=f.normalize(e,or);const s=or.x*o,a=or.y*o,c=or.z*o,l=Math.cos(i);return h(n)?(n.x=s,n.y=a,n.z=c,n.w=l,n):new J(s,a,c,l)};const Cg=[1,2,0],Eg=new Array(3);J.fromRotationMatrix=function(e,t){m.typeOf.object("matrix",e);let n,i,o,s,a;const c=e[L.COLUMN0ROW0],l=e[L.COLUMN1ROW1],u=e[L.COLUMN2ROW2],d=c+l+u;if(d>0)n=Math.sqrt(d+1),a=.5*n,n=.5/n,i=(e[L.COLUMN1ROW2]-e[L.COLUMN2ROW1])*n,o=(e[L.COLUMN2ROW0]-e[L.COLUMN0ROW2])*n,s=(e[L.COLUMN0ROW1]-e[L.COLUMN1ROW0])*n;else{const p=Cg;let g=0;l>c&&(g=1),u>c&&u>l&&(g=2);const y=p[g],x=p[y];n=Math.sqrt(e[L.getElementIndex(g,g)]-e[L.getElementIndex(y,y)]-e[L.getElementIndex(x,x)]+1);const E=Eg;E[g]=.5*n,n=.5/n,a=(e[L.getElementIndex(x,y)]-e[L.getElementIndex(y,x)])*n,E[y]=(e[L.getElementIndex(y,g)]+e[L.getElementIndex(g,y)])*n,E[x]=(e[L.getElementIndex(x,g)]+e[L.getElementIndex(g,x)])*n,i=-E[0],o=-E[1],s=-E[2]}return h(t)?(t.x=i,t.y=o,t.z=s,t.w=a,t):new J(i,o,s,a)};const lf=new J;let hf=new J,lc=new J,ff=new J;J.fromHeadingPitchRoll=function(e,t){return m.typeOf.object("headingPitchRoll",e),ff=J.fromAxisAngle(f.UNIT_X,e.roll,lf),lc=J.fromAxisAngle(f.UNIT_Y,-e.pitch,t),t=J.multiply(lc,ff,lc),hf=J.fromAxisAngle(f.UNIT_Z,-e.heading,lf),J.multiply(hf,t,t)};const zs=new f,hc=new f,Dn=new J,uf=new J,Ps=new J;J.packedLength=4,J.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},J.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new J),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},J.packedInterpolationLength=3,J.convertPackedArrayForInterpolation=function(e,t,n,i){J.unpack(e,n*4,Ps),J.conjugate(Ps,Ps);for(let o=0,s=n-t+1;o<s;o++){const a=o*3;J.unpack(e,(t+o)*4,Dn),J.multiply(Dn,Ps,Dn),Dn.w<0&&J.negate(Dn,Dn),J.computeAxis(Dn,zs);const c=J.computeAngle(Dn);h(i)||(i=[]),i[a]=zs.x*c,i[a+1]=zs.y*c,i[a+2]=zs.z*c}},J.unpackInterpolationResult=function(e,t,n,i,o){h(o)||(o=new J),f.fromArray(e,0,hc);const s=f.magnitude(hc);return J.unpack(t,i*4,uf),s===0?J.clone(J.IDENTITY,Dn):J.fromAxisAngle(hc,s,Dn),J.multiply(Dn,uf,o)},J.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new J(e.x,e.y,e.z,e.w)},J.conjugate=function(e,t){return m.typeOf.object("quaternion",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},J.magnitudeSquared=function(e){return m.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},J.magnitude=function(e){return Math.sqrt(J.magnitudeSquared(e))},J.normalize=function(e,t){m.typeOf.object("result",t);const n=1/J.magnitude(e),i=e.x*n,o=e.y*n,s=e.z*n,a=e.w*n;return t.x=i,t.y=o,t.z=s,t.w=a,t},J.inverse=function(e,t){m.typeOf.object("result",t);const n=J.magnitudeSquared(e);return t=J.conjugate(e,t),J.multiplyByScalar(t,1/n,t)},J.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},J.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},J.negate=function(e,t){return m.typeOf.object("quaternion",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},J.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},J.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e.x,o=e.y,s=e.z,a=e.w,c=t.x,l=t.y,u=t.z,d=t.w,p=a*c+i*d+o*u-s*l,g=a*l-i*u+o*d+s*c,y=a*u+i*l-o*c+s*d,x=a*d-i*c-o*l-s*u;return n.x=p,n.y=g,n.z=y,n.w=x,n},J.multiplyByScalar=function(e,t,n){return m.typeOf.object("quaternion",e),m.typeOf.number("scalar",t),m.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},J.divideByScalar=function(e,t,n){return m.typeOf.object("quaternion",e),m.typeOf.number("scalar",t),m.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},J.computeAxis=function(e,t){m.typeOf.object("quaternion",e),m.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<S.EPSILON6||Math.abs(n+1)<S.EPSILON6)return t.x=1,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},J.computeAngle=function(e){return m.typeOf.object("quaternion",e),Math.abs(e.w-1)<S.EPSILON6?0:2*Math.acos(e.w)};let fc=new J;J.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),fc=J.multiplyByScalar(t,n,fc),i=J.multiplyByScalar(e,1-n,i),J.add(fc,i,i)};let df=new J,uc=new J,dc=new J;J.slerp=function(e,t,n,i){m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i);let o=J.dot(e,t),s=t;if(o<0&&(o=-o,s=df=J.negate(t,df)),1-o<S.EPSILON6)return J.lerp(e,s,n,i);const a=Math.acos(o);return uc=J.multiplyByScalar(e,Math.sin((1-n)*a),uc),dc=J.multiplyByScalar(s,Math.sin(n*a),dc),i=J.add(uc,dc,i),J.multiplyByScalar(i,1/Math.sin(a),i)},J.log=function(e,t){m.typeOf.object("quaternion",e),m.typeOf.object("result",t);const n=S.acosClamped(e.w);let i=0;return n!==0&&(i=n/Math.sin(n)),f.multiplyByScalar(e,i,t)},J.exp=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.magnitude(e);let i=0;return n!==0&&(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 bg=new f,wg=new f,rr=new J,Ao=new J;J.computeInnerQuadrangle=function(e,t,n,i){m.typeOf.object("q0",e),m.typeOf.object("q1",t),m.typeOf.object("q2",n),m.typeOf.object("result",i);const o=J.conjugate(t,rr);J.multiply(o,n,Ao);const s=J.log(Ao,bg);J.multiply(o,e,Ao);const a=J.log(Ao,wg);return f.add(s,a,s),f.multiplyByScalar(s,.25,s),f.negate(s,s),J.exp(s,rr),J.multiply(t,rr,i)},J.squad=function(e,t,n,i,o,s){m.typeOf.object("q0",e),m.typeOf.object("q1",t),m.typeOf.object("s0",n),m.typeOf.object("s1",i),m.typeOf.number("t",o),m.typeOf.object("result",s);const a=J.slerp(e,t,o,rr),c=J.slerp(n,i,o,Ao);return J.slerp(a,c,2*o*(1-o),s)};const Tg=new J,pf=1.9011074535173003,Bs=_t.supportsTypedArrays()?new Float32Array(8):[],Ns=_t.supportsTypedArrays()?new Float32Array(8):[],li=_t.supportsTypedArrays()?new Float32Array(8):[],hi=_t.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Bs[e]=1/(t*n),Ns[e]=t/n}Bs[7]=pf/(8*17),Ns[7]=pf*8/17,J.fastSlerp=function(e,t,n,i){m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i);let o=J.dot(e,t),s;o>=0?s=1:(s=-1,o=-o);const a=o-1,c=1-n,l=n*n,u=c*c;for(let y=7;y>=0;--y)li[y]=(Bs[y]*l-Ns[y])*a,hi[y]=(Bs[y]*u-Ns[y])*a;const d=s*n*(1+li[0]*(1+li[1]*(1+li[2]*(1+li[3]*(1+li[4]*(1+li[5]*(1+li[6]*(1+li[7])))))))),p=c*(1+hi[0]*(1+hi[1]*(1+hi[2]*(1+hi[3]*(1+hi[4]*(1+hi[5]*(1+hi[6]*(1+hi[7])))))))),g=J.multiplyByScalar(e,p,Tg);return J.multiplyByScalar(t,d,i),J.add(g,i,i)},J.fastSquad=function(e,t,n,i,o,s){m.typeOf.object("q0",e),m.typeOf.object("q1",t),m.typeOf.object("s0",n),m.typeOf.object("s1",i),m.typeOf.number("t",o),m.typeOf.object("result",s);const a=J.fastSlerp(e,t,o,rr),c=J.fastSlerp(n,i,o,Ao);return J.fastSlerp(a,c,2*o*(1-o),s)},J.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},J.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},J.ZERO=Object.freeze(new J(0,0,0,0)),J.IDENTITY=Object.freeze(new J(0,0,0,1)),J.prototype.clone=function(e){return J.clone(this,e)},J.prototype.equals=function(e){return J.equals(this,e)},J.prototype.equalsEpsilon=function(e,t){return J.equalsEpsilon(this,e,t)},J.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const _e={},pc={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"}},Do={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},mc={},on={east:new f,north:new f,up:new f,west:new f,south:new f,down:new f};let vi=new f,Ii=new f,Ri=new f;_e.localFrameToFixedFrameGenerator=function(e,t){if(!pc.hasOwnProperty(e)||!pc[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=pc[e][t];let i;const o=e+t;return h(mc[o])?i=mc[o]:(i=function(s,a,c){if(!h(s))throw new C("origin is required.");if(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))throw new C("origin has a NaN component");if(h(c)||(c=new N),f.equalsEpsilon(s,f.ZERO,S.EPSILON14))f.unpack(Do[e],0,vi),f.unpack(Do[t],0,Ii),f.unpack(Do[n],0,Ri);else if(S.equalsEpsilon(s.x,0,S.EPSILON14)&&S.equalsEpsilon(s.y,0,S.EPSILON14)){const l=S.sign(s.z);f.unpack(Do[e],0,vi),e!=="east"&&e!=="west"&&f.multiplyByScalar(vi,l,vi),f.unpack(Do[t],0,Ii),t!=="east"&&t!=="west"&&f.multiplyByScalar(Ii,l,Ii),f.unpack(Do[n],0,Ri),n!=="east"&&n!=="west"&&f.multiplyByScalar(Ri,l,Ri)}else{a=_(a,le.default),a.geodeticSurfaceNormal(s,on.up);const l=on.up,u=on.east;u.x=-s.y,u.y=s.x,u.z=0,f.normalize(u,on.east),f.cross(l,u,on.north),f.multiplyByScalar(on.up,-1,on.down),f.multiplyByScalar(on.east,-1,on.west),f.multiplyByScalar(on.north,-1,on.south),vi=on[e],Ii=on[t],Ri=on[n]}return c[0]=vi.x,c[1]=vi.y,c[2]=vi.z,c[3]=0,c[4]=Ii.x,c[5]=Ii.y,c[6]=Ii.z,c[7]=0,c[8]=Ri.x,c[9]=Ri.y,c[10]=Ri.z,c[11]=0,c[12]=s.x,c[13]=s.y,c[14]=s.z,c[15]=1,c},mc[o]=i),i},_e.eastNorthUpToFixedFrame=_e.localFrameToFixedFrameGenerator("east","north"),_e.northEastDownToFixedFrame=_e.localFrameToFixedFrameGenerator("north","east"),_e.northUpEastToFixedFrame=_e.localFrameToFixedFrameGenerator("north","up"),_e.northWestUpToFixedFrame=_e.localFrameToFixedFrameGenerator("north","west");const Sg=new J,Ag=new f(1,1,1),Dg=new N;_e.headingPitchRollToFixedFrame=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t),i=_(i,_e.eastNorthUpToFixedFrame);const s=J.fromHeadingPitchRoll(t,Sg),a=N.fromTranslationQuaternionRotationScale(f.ZERO,s,Ag,Dg);return o=i(e,n,o),N.multiply(o,a,o)};const Og=new N,vg=new L;_e.headingPitchRollQuaternion=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t);const s=_e.headingPitchRollToFixedFrame(e,t,n,i,Og),a=N.getMatrix3(s,vg);return J.fromRotationMatrix(a,o)};const Ig=new f(1,1,1),Rg=new f,mf=new N,zg=new N,Pg=new L,Bg=new J;_e.fixedFrameToHeadingPitchRoll=function(e,t,n,i){m.defined("transform",e),t=_(t,le.default),n=_(n,_e.eastNorthUpToFixedFrame),h(i)||(i=new lt);const o=N.getTranslation(e,Rg);if(f.equals(o,f.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let s=N.inverseTransformation(n(o,t,mf),mf),a=N.setScale(e,Ig,zg);a=N.setTranslation(a,f.ZERO,a),s=N.multiply(s,a,s);let c=J.fromRotationMatrix(N.getMatrix3(s,Pg),Bg);return c=J.normalize(c,c),lt.fromQuaternion(c,i)};const Ng=6*3600+41*60+50.54841,Fg=8640184812866e-6,Lg=.093104,Mg=-62e-7,Ug=11772758384668e-32,kg=72921158553e-15,Vg=S.TWO_PI/86400;let Fs=new $;_e.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=_e.computeIcrfToFixedMatrix(e,t);return h(n)||(n=_e.computeTemeToPseudoFixedMatrix(e,t)),n},_e.computeTemeToPseudoFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");Fs=$.addSeconds(e,-$.computeTaiMinusUtc(e),Fs);const n=Fs.dayNumber,i=Fs.secondsOfDay;let o;const s=n-2451545;i>=43200?o=(s+.5)/nt.DAYS_PER_JULIAN_CENTURY:o=(s-.5)/nt.DAYS_PER_JULIAN_CENTURY;const c=(Ng+o*(Fg+o*(Lg+o*Mg)))*Vg%S.TWO_PI,l=kg+Ug*(n-24515455e-1),u=(i+nt.SECONDS_PER_DAY*.5)%nt.SECONDS_PER_DAY,d=c+l*u,p=Math.cos(d),g=Math.sin(d);return h(t)?(t[0]=p,t[1]=-g,t[2]=0,t[3]=g,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new L(p,g,0,-g,p,0,0,0,1)},_e.iau2006XysData=new sc,_e.earthOrientationParameters=nr.NONE;const _c=32.184,Gg=2451545;_e.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+_c,i=e.stop.dayNumber,o=e.stop.secondsOfDay+_c;return _e.iau2006XysData.preload(t,n,i,o)},_e.computeIcrfToFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new L);const n=_e.computeFixedToIcrfMatrix(e,t);if(h(n))return L.transpose(n,t)};const qg=32.184,Hg=2451545,Ls=new lt,Wg=new L,jg=new $;_e.computeMoonFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");const n=$.addSeconds(e,qg,jg),i=$.totalDays(n)-Hg,o=S.toRadians(12.112)-S.toRadians(.052992)*i,s=S.toRadians(24.224)-S.toRadians(.105984)*i,a=S.toRadians(227.645)+S.toRadians(13.012)*i,c=S.toRadians(261.105)+S.toRadians(13.340716)*i,l=S.toRadians(358)+S.toRadians(.9856)*i;return Ls.pitch=S.toRadians(180)-S.toRadians(3.878)*Math.sin(o)-S.toRadians(.12)*Math.sin(s)+S.toRadians(.07)*Math.sin(a)-S.toRadians(.017)*Math.sin(c),Ls.roll=S.toRadians(66.53-90)+S.toRadians(1.543)*Math.cos(o)+S.toRadians(.24)*Math.cos(s)-S.toRadians(.028)*Math.cos(a)+S.toRadians(.007)*Math.cos(c),Ls.heading=S.toRadians(244.375-90)+S.toRadians(13.17635831)*i+S.toRadians(3.558)*Math.sin(o)+S.toRadians(.121)*Math.sin(s)-S.toRadians(.064)*Math.sin(a)+S.toRadians(.016)*Math.sin(c)+S.toRadians(.025)*Math.sin(l),L.fromHeadingPitchRoll(Ls,Wg)},_e.computeIcrfToMoonFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new L);const n=_e.computeMoonFixedToIcrfMatrix(e,t);if(h(n))return L.transpose(n,t)};const Yg=new cf(0,0,0),Xg=new Xa(0,0,0,0,0),gc=new L,yc=new L;_e.computeFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new L);const n=_e.earthOrientationParameters.compute(e,Xg);if(!h(n))return;const i=e.dayNumber,o=e.secondsOfDay+_c,s=_e.iau2006XysData.computeXysRadians(i,o,Yg);if(!h(s))return;const a=s.x+n.xPoleOffset,c=s.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-c*c)),u=gc;u[0]=1-l*a*a,u[3]=-l*a*c,u[6]=a,u[1]=-l*a*c,u[4]=1-l*c*c,u[7]=c,u[2]=-a,u[5]=-c,u[8]=1-l*(a*a+c*c);const d=L.fromRotationZ(-s.s,yc),p=L.multiply(u,d,gc),g=e.dayNumber,y=e.secondsOfDay-$.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=y/nt.SECONDS_PER_DAY;let b=.779057273264+E+.00273781191135448*(x+E);b=b%1*S.TWO_PI;const D=L.fromRotationZ(b,yc),A=L.multiply(p,D,gc),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),B=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander);let q=i-Gg+o/nt.SECONDS_PER_DAY;q/=36525;const P=-47e-6*q*S.RADIANS_PER_DEGREE/3600,V=Math.cos(P),k=Math.sin(P),H=yc;return H[0]=O*V,H[1]=O*k,H[2]=B,H[3]=-I*k+M*B*V,H[4]=I*V+M*B*k,H[5]=-M*O,H[6]=-M*k-I*B*V,H[7]=M*V-I*B*k,H[8]=I*O,L.multiply(A,H,t)};const $g=new Y;_e.pointToWindowCoordinates=function(e,t,n,i){return i=_e.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i},_e.pointToGLWindowCoordinates=function(e,t,n,i){if(!h(e))throw new C("modelViewProjectionMatrix is required.");if(!h(t))throw new C("viewportTransformation is required.");if(!h(n))throw new C("point is required.");h(i)||(i=new U);const o=$g;return N.multiplyByVector(e,Y.fromElements(n.x,n.y,n.z,1,o),o),Y.multiplyByScalar(o,1/o.w,o),N.multiplyByVector(t,o,o),U.fromCartesian4(o,i)};const Zg=new f,Kg=new f,Qg=new f;_e.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!h(e))throw new C("position is required.");if(!h(t))throw new C("velocity is required.");const o=_(n,le.default).geodeticSurfaceNormal(e,Zg);let s=f.cross(t,o,Kg);f.equalsEpsilon(s,f.ZERO,S.EPSILON6)&&(s=f.clone(f.UNIT_X,s));const a=f.cross(s,t,Qg);return f.normalize(a,a),f.cross(t,a,s),f.negate(s,s),f.normalize(s,s),h(i)||(i=new L),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i};const _f=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),gf=new ee,xc=new f,Jg=new f,ey=new L,Cc=new N,yf=new N;_e.basisTo2D=function(e,t,n){if(!h(e))throw new C("projection is required.");if(!h(t))throw new C("matrix is required.");if(!h(n))throw new C("result is required.");const i=N.getTranslation(t,Jg),o=e.ellipsoid;let s;if(f.equals(i,f.ZERO))s=f.clone(f.ZERO,xc);else{const d=o.cartesianToCartographic(i,gf);s=e.project(d,xc),f.fromElements(s.z,s.x,s.y,s)}const a=_e.eastNorthUpToFixedFrame(i,o,Cc),c=N.inverseTransformation(a,yf),l=N.getMatrix3(t,ey),u=N.multiplyByMatrix3(c,l,n);return N.multiply(_f,u,n),N.setTranslation(n,s,n),n},_e.ellipsoidTo2DModelMatrix=function(e,t,n){if(!h(e))throw new C("projection is required.");if(!h(t))throw new C("center is required.");if(!h(n))throw new C("result is required.");const i=e.ellipsoid,o=_e.eastNorthUpToFixedFrame(t,i,Cc),s=N.inverseTransformation(o,yf),a=i.cartesianToCartographic(t,gf),c=e.project(a,xc);f.fromElements(c.z,c.x,c.y,c);const l=N.fromTranslation(c,Cc);return N.multiply(_f,s,n),N.multiply(l,n,n),n};const xf={};function sr(e,t){if(!h(e))throw new C("identifier is required.");h(xf[e])||(xf[e]=!0,console.warn(_(t,e)))}sr.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.",sr.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",sr.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",sr.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function ty(e,t){if(!h(e)||!h(t))throw new C("identifier and message are required.");sr(e,t)}function ce(e,t,n,i){this.west=_(e,0),this.south=_(t,0),this.east=_(n,0),this.north=_(i,0)}Object.defineProperties(ce.prototype,{width:{get:function(){return ce.computeWidth(this)}},height:{get:function(){return ce.computeHeight(this)}}}),ce.packedLength=4,ce.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},ce.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new ce),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},ce.computeWidth=function(e){m.typeOf.object("rectangle",e);let t=e.east;const n=e.west;return t<n&&(t+=S.TWO_PI),t-n},ce.computeHeight=function(e){return m.typeOf.object("rectangle",e),e.north-e.south},ce.fromDegrees=function(e,t,n,i,o){return e=S.toRadians(_(e,0)),t=S.toRadians(_(t,0)),n=S.toRadians(_(n,0)),i=S.toRadians(_(i,0)),h(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new ce(e,t,n,i)},ce.fromRadians=function(e,t,n,i,o){return h(o)?(o.west=_(e,0),o.south=_(t,0),o.east=_(n,0),o.north=_(i,0),o):new ce(e,t,n,i)},ce.fromCartographicArray=function(e,t){m.defined("cartographics",e);let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let l=0,u=e.length;l<u;l++){const d=e[l];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+S.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return i-n>s-o&&(n=o,i=s,i>S.PI&&(i=i-S.TWO_PI),n>S.PI&&(n=n-S.TWO_PI)),h(t)?(t.west=n,t.south=a,t.east=i,t.north=c,t):new ce(n,a,i,c)},ce.fromCartesianArray=function(e,t,n){m.defined("cartesians",e),t=_(t,le.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,d=e.length;u<d;u++){const p=t.cartesianToCartographic(e[u]);i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),l=Math.max(l,p.latitude);const g=p.longitude>=0?p.longitude:p.longitude+S.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-i>a-s&&(i=s,o=a,o>S.PI&&(o=o-S.TWO_PI),i>S.PI&&(i=i-S.TWO_PI)),h(n)?(n.west=i,n.south=c,n.east=o,n.north=l,n):new ce(i,c,o,l)};const ny=new f,iy=new f,oy=new f,ry=new f,sy=new f,Ec=new Array(5);for(let e=0;e<Ec.length;++e)Ec[e]=new f;ce.fromBoundingSphere=function(e,t,n){m.typeOf.object("boundingSphere",e);const i=e.center,o=e.radius;if(h(t)||(t=le.default),h(n)||(n=new ce),f.equals(i,f.ZERO))return ce.clone(ce.MAX_VALUE,n),n;const s=_e.eastNorthUpToFixedFrame(i,t,ny),a=N.multiplyByPointAsVector(s,f.UNIT_X,iy);f.normalize(a,a);const c=N.multiplyByPointAsVector(s,f.UNIT_Y,oy);f.normalize(c,c),f.multiplyByScalar(c,o,c),f.multiplyByScalar(a,o,a);const l=f.negate(c,sy),u=f.negate(a,ry),d=Ec;let p=d[0];return f.add(i,c,p),p=d[1],f.add(i,u,p),p=d[2],f.add(i,l,p),p=d[3],f.add(i,a,p),d[4]=i,ce.fromCartesianArray(d,t,n)},ce.clone=function(e,t){if(h(e))return h(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new ce(e.west,e.south,e.east,e.north)},ce.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},ce.prototype.clone=function(e){return ce.clone(this,e)},ce.prototype.equals=function(e){return ce.equals(this,e)},ce.equals=function(e,t){return e===t||h(e)&&h(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},ce.prototype.equalsEpsilon=function(e,t){return ce.equalsEpsilon(this,e,t)},ce.validate=function(e){return ty("Rectangle.validate","Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124."),ce._validate(e)},ce._validate=function(e){m.typeOf.object("rectangle",e);const t=e.north;m.typeOf.number.greaterThanOrEquals("north",t,-S.PI_OVER_TWO),m.typeOf.number.lessThanOrEquals("north",t,S.PI_OVER_TWO);const n=e.south;m.typeOf.number.greaterThanOrEquals("south",n,-S.PI_OVER_TWO),m.typeOf.number.lessThanOrEquals("south",n,S.PI_OVER_TWO);const i=e.west;m.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),m.typeOf.number.lessThanOrEquals("west",i,Math.PI);const o=e.east;m.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),m.typeOf.number.lessThanOrEquals("east",o,Math.PI)},ce.southwest=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new ee(e.west,e.south)},ce.northwest=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new ee(e.west,e.north)},ce.northeast=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new ee(e.east,e.north)},ce.southeast=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new ee(e.east,e.south)},ce.center=function(e,t){m.typeOf.object("rectangle",e);let n=e.east;const i=e.west;n<i&&(n+=S.TWO_PI);const o=S.negativePiToPi((i+n)*.5),s=(e.south+e.north)*.5;return h(t)?(t.longitude=o,t.latitude=s,t.height=0,t):new ee(o,s)},ce.intersection=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,s=t.east,a=t.west;i<o&&s>0?i+=S.TWO_PI:s<a&&i>0&&(s+=S.TWO_PI),i<o&&a<0?a+=S.TWO_PI:s<a&&o<0&&(o+=S.TWO_PI);const c=S.negativePiToPi(Math.max(o,a)),l=S.negativePiToPi(Math.min(i,s));if((e.west<e.east||t.west<t.east)&&l<=c)return;const u=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(u>=d))return h(n)?(n.west=c,n.south=u,n.east=l,n.north=d,n):new ce(c,u,l,d)},ce.simpleIntersection=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("otherRectangle",t);const i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),s=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(o>=a||i>=s))return h(n)?(n.west=i,n.south=o,n.east=s,n.north=a,n):new ce(i,o,s,a)},ce.union=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("otherRectangle",t),h(n)||(n=new ce);let i=e.east,o=e.west,s=t.east,a=t.west;i<o&&s>0?i+=S.TWO_PI:s<a&&i>0&&(s+=S.TWO_PI),i<o&&a<0?a+=S.TWO_PI:s<a&&o<0&&(o+=S.TWO_PI);const c=S.negativePiToPi(Math.min(o,a)),l=S.negativePiToPi(Math.max(i,s));return n.west=c,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n},ce.expand=function(e,t,n){return m.typeOf.object("rectangle",e),m.typeOf.object("cartographic",t),h(n)||(n=new ce),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},ce.contains=function(e,t){m.typeOf.object("rectangle",e),m.typeOf.object("cartographic",t);let n=t.longitude;const i=t.latitude,o=e.west;let s=e.east;return s<o&&(s+=S.TWO_PI,n<0&&(n+=S.TWO_PI)),(n>o||S.equalsEpsilon(n,o,S.EPSILON14))&&(n<s||S.equalsEpsilon(n,s,S.EPSILON14))&&i>=e.south&&i<=e.north};const ay=new ee;ce.subsample=function(e,t,n,i){m.typeOf.object("rectangle",e),t=_(t,le.default),n=_(n,0),h(i)||(i=[]);let o=0;const s=e.north,a=e.south,c=e.east,l=e.west,u=ay;u.height=n,u.longitude=l,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,s<0?u.latitude=s:a>0?u.latitude=a:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*S.PI_OVER_TWO,ce.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i},ce.subsection=function(e,t,n,i,o,s){if(m.typeOf.object("rectangle",e),m.typeOf.number.greaterThanOrEquals("westLerp",t,0),m.typeOf.number.lessThanOrEquals("westLerp",t,1),m.typeOf.number.greaterThanOrEquals("southLerp",n,0),m.typeOf.number.lessThanOrEquals("southLerp",n,1),m.typeOf.number.greaterThanOrEquals("eastLerp",i,0),m.typeOf.number.lessThanOrEquals("eastLerp",i,1),m.typeOf.number.greaterThanOrEquals("northLerp",o,0),m.typeOf.number.lessThanOrEquals("northLerp",o,1),m.typeOf.number.lessThanOrEquals("westLerp",t,i),m.typeOf.number.lessThanOrEquals("southLerp",n,o),h(s)||(s=new ce),e.west<=e.east){const c=e.east-e.west;s.west=e.west+t*c,s.east=e.west+i*c}else{const c=S.TWO_PI+e.east-e.west;s.west=S.negativePiToPi(e.west+t*c),s.east=S.negativePiToPi(e.west+i*c)}const a=e.north-e.south;return s.south=e.south+n*a,s.north=e.south+o*a,t===1&&(s.west=e.east),i===1&&(s.east=e.east),n===1&&(s.south=e.north),o===1&&(s.north=e.north),s},ce.MAX_VALUE=Object.freeze(new ce(-Math.PI,-S.PI_OVER_TWO,Math.PI,S.PI_OVER_TWO));function Ce(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.width=_(n,0),this.height=_(i,0)}Ce.packedLength=4,Ce.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},Ce.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Ce),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},Ce.fromPoints=function(e,t){if(h(t)||(t=new Ce),!h(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;const n=e.length;let i=e[0].x,o=e[0].y,s=e[0].x,a=e[0].y;for(let c=1;c<n;c++){const l=e[c],u=l.x,d=l.y;i=Math.min(u,i),s=Math.max(u,s),o=Math.min(d,o),a=Math.max(d,a)}return t.x=i,t.y=o,t.width=s-i,t.height=a-o,t};const Cf=new Sn,cy=new ee,ly=new ee;Ce.fromRectangle=function(e,t,n){if(h(n)||(n=new Ce),!h(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;Cf._ellipsoid=le.default,t=_(t,Cf);const i=t.project(ce.southwest(e,cy)),o=t.project(ce.northeast(e,ly));return U.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n},Ce.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Ce(e.x,e.y,e.width,e.height)},Ce.union=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),h(n)||(n=new Ce);const i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),s=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=o,n.width=s-i,n.height=a-o,n},Ce.expand=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("point",t),n=Ce.clone(e,n);const i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n},Ce.intersect=function(e,t){m.typeOf.object("left",e),m.typeOf.object("right",t);const n=e.x,i=e.y,o=t.x,s=t.y;return n>o+t.width||n+e.width<o||i+e.height<s||i>s+t.height?Et.OUTSIDE:Et.INTERSECTING},Ce.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},Ce.prototype.clone=function(e){return Ce.clone(this,e)},Ce.prototype.intersect=function(e){return Ce.intersect(this,e)},Ce.prototype.equals=function(e){return Ce.equals(this,e)};const Lt={POINTS:R.POINTS,LINES:R.LINES,LINE_LOOP:R.LINE_LOOP,LINE_STRIP:R.LINE_STRIP,TRIANGLES:R.TRIANGLES,TRIANGLE_STRIP:R.TRIANGLE_STRIP,TRIANGLE_FAN:R.TRIANGLE_FAN};Lt.isLines=function(e){return e===Lt.LINES||e===Lt.LINE_LOOP||e===Lt.LINE_STRIP},Lt.isTriangles=function(e){return e===Lt.TRIANGLES||e===Lt.TRIANGLE_STRIP||e===Lt.TRIANGLE_FAN},Lt.validate=function(e){return e===Lt.POINTS||e===Lt.LINES||e===Lt.LINE_LOOP||e===Lt.LINE_STRIP||e===Lt.TRIANGLES||e===Lt.TRIANGLE_STRIP||e===Lt.TRIANGLE_FAN};const qe=Object.freeze(Lt),it={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function $e(e){e=_(e,_.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=_(e.primitiveType,qe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=_(e.offset,0),this._instanceCount=_(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._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=_(e.cull,!0),this.occlude=_(e.occlude,!0),this.executeInClosestFrustum=_(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.castShadows=_(e.castShadows,!1),this.receiveShadows=_(e.receiveShadows,!1),this.pickOnly=_(e.pickOnly,!1),this.depthForTranslucentClassification=_(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Wt(e,t){return(e._flags&t)===t}function zi(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties($e.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 Wt(this,it.CULL)},set:function(e){Wt(this,it.CULL)!==e&&(zi(this,it.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Wt(this,it.OCCLUDE)},set:function(e){Wt(this,it.OCCLUDE)!==e&&(zi(this,it.OCCLUDE,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 Wt(this,it.CAST_SHADOWS)},set:function(e){Wt(this,it.CAST_SHADOWS)!==e&&(zi(this,it.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Wt(this,it.RECEIVE_SHADOWS)},set:function(e){Wt(this,it.RECEIVE_SHADOWS)!==e&&(zi(this,it.RECEIVE_SHADOWS,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 Wt(this,it.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Wt(this,it.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(zi(this,it.EXECUTE_IN_CLOSEST_FRUSTUM,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 Wt(this,it.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Wt(this,it.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(zi(this,it.DEBUG_SHOW_BOUNDING_VOLUME,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)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Wt(this,it.PICK_ONLY)},set:function(e){Wt(this,it.PICK_ONLY)!==e&&(zi(this,it.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Wt(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Wt(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(zi(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}}),$e.shallowClone=function(e,t){if(h(e))return h(t)||(t=new $e),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._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t},$e.prototype.execute=function(e,t){e.draw(this,t)};const Se={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,HALF_FLOAT:R.HALF_FLOAT_OES,UNSIGNED_INT_24_8:R.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:R.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:R.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:R.UNSIGNED_SHORT_5_6_5};Se.toWebGLConstant=function(e,t){switch(e){case Se.UNSIGNED_BYTE:return R.UNSIGNED_BYTE;case Se.UNSIGNED_SHORT:return R.UNSIGNED_SHORT;case Se.UNSIGNED_INT:return R.UNSIGNED_INT;case Se.FLOAT:return R.FLOAT;case Se.HALF_FLOAT:return t.webgl2?R.HALF_FLOAT:R.HALF_FLOAT_OES;case Se.UNSIGNED_INT_24_8:return R.UNSIGNED_INT_24_8;case Se.UNSIGNED_SHORT_4_4_4_4:return R.UNSIGNED_SHORT_4_4_4_4;case Se.UNSIGNED_SHORT_5_5_5_1:return R.UNSIGNED_SHORT_5_5_5_1;case Se.UNSIGNED_SHORT_5_6_5:return Se.UNSIGNED_SHORT_5_6_5}},Se.isPacked=function(e){return e===Se.UNSIGNED_INT_24_8||e===Se.UNSIGNED_SHORT_4_4_4_4||e===Se.UNSIGNED_SHORT_5_5_5_1||e===Se.UNSIGNED_SHORT_5_6_5},Se.sizeInBytes=function(e){switch(e){case Se.UNSIGNED_BYTE:return 1;case Se.UNSIGNED_SHORT:case Se.UNSIGNED_SHORT_4_4_4_4:case Se.UNSIGNED_SHORT_5_5_5_1:case Se.UNSIGNED_SHORT_5_6_5:case Se.HALF_FLOAT:return 2;case Se.UNSIGNED_INT:case Se.FLOAT:case Se.UNSIGNED_INT_24_8:return 4}},Se.validate=function(e){return e===Se.UNSIGNED_BYTE||e===Se.UNSIGNED_SHORT||e===Se.UNSIGNED_INT||e===Se.FLOAT||e===Se.HALF_FLOAT||e===Se.UNSIGNED_INT_24_8||e===Se.UNSIGNED_SHORT_4_4_4_4||e===Se.UNSIGNED_SHORT_5_5_5_1||e===Se.UNSIGNED_SHORT_5_6_5},Se.getTypedArrayConstructor=function(e){const t=Se.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Se.FLOAT?Float32Array:Uint32Array};const pe=Object.freeze(Se),te={DEPTH_COMPONENT:R.DEPTH_COMPONENT,DEPTH_STENCIL:R.DEPTH_STENCIL,ALPHA:R.ALPHA,RED:R.RED,RG:R.RG,RGB:R.RGB,RGBA:R.RGBA,LUMINANCE:R.LUMINANCE,LUMINANCE_ALPHA:R.LUMINANCE_ALPHA,RGB_DXT1:R.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:R.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:R.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:R.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:R.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:R.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:R.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:R.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:R.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:R.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:R.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:R.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:R.COMPRESSED_RGBA_BPTC_UNORM};te.componentsLength=function(e){switch(e){case te.RGB:return 3;case te.RGBA:return 4;case te.LUMINANCE_ALPHA:case te.RG:return 2;case te.ALPHA:case te.RED:case te.LUMINANCE:return 1;default:return 1}},te.validate=function(e){return e===te.DEPTH_COMPONENT||e===te.DEPTH_STENCIL||e===te.ALPHA||e===te.RED||e===te.RG||e===te.RGB||e===te.RGBA||e===te.LUMINANCE||e===te.LUMINANCE_ALPHA||e===te.RGB_DXT1||e===te.RGBA_DXT1||e===te.RGBA_DXT3||e===te.RGBA_DXT5||e===te.RGB_PVRTC_4BPPV1||e===te.RGB_PVRTC_2BPPV1||e===te.RGBA_PVRTC_4BPPV1||e===te.RGBA_PVRTC_2BPPV1||e===te.RGBA_ASTC||e===te.RGB_ETC1||e===te.RGB8_ETC2||e===te.RGBA8_ETC2_EAC||e===te.RGBA_BC7},te.isColorFormat=function(e){return e===te.RED||e===te.ALPHA||e===te.RGB||e===te.RGBA||e===te.LUMINANCE||e===te.LUMINANCE_ALPHA},te.isDepthFormat=function(e){return e===te.DEPTH_COMPONENT||e===te.DEPTH_STENCIL},te.isCompressedFormat=function(e){return e===te.RGB_DXT1||e===te.RGBA_DXT1||e===te.RGBA_DXT3||e===te.RGBA_DXT5||e===te.RGB_PVRTC_4BPPV1||e===te.RGB_PVRTC_2BPPV1||e===te.RGBA_PVRTC_4BPPV1||e===te.RGBA_PVRTC_2BPPV1||e===te.RGBA_ASTC||e===te.RGB_ETC1||e===te.RGB8_ETC2||e===te.RGBA8_ETC2_EAC||e===te.RGBA_BC7},te.isDXTFormat=function(e){return e===te.RGB_DXT1||e===te.RGBA_DXT1||e===te.RGBA_DXT3||e===te.RGBA_DXT5},te.isPVRTCFormat=function(e){return e===te.RGB_PVRTC_4BPPV1||e===te.RGB_PVRTC_2BPPV1||e===te.RGBA_PVRTC_4BPPV1||e===te.RGBA_PVRTC_2BPPV1},te.isASTCFormat=function(e){return e===te.RGBA_ASTC},te.isETC1Format=function(e){return e===te.RGB_ETC1},te.isETC2Format=function(e){return e===te.RGB8_ETC2||e===te.RGBA8_ETC2_EAC},te.isBC7Format=function(e){return e===te.RGBA_BC7},te.compressedTextureSizeInBytes=function(e,t,n){switch(e){case te.RGB_DXT1:case te.RGBA_DXT1:case te.RGB_ETC1:case te.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case te.RGBA_DXT3:case te.RGBA_DXT5:case te.RGBA_ASTC:case te.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case te.RGB_PVRTC_4BPPV1:case te.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case te.RGB_PVRTC_2BPPV1:case te.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case te.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}},te.textureSizeInBytes=function(e,t,n,i){let o=te.componentsLength(e);return pe.isPacked(t)&&(o=1),o*pe.sizeInBytes(t)*n*i},te.alignmentInBytes=function(e,t,n){const i=te.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1},te.createTypedArray=function(e,t,n,i){const o=pe.getTypedArrayConstructor(t),s=te.componentsLength(e)*n*i;return new o(s)},te.flipY=function(e,t,n,i,o){if(o===1)return e;const s=te.createTypedArray(t,n,i,o),a=te.componentsLength(t),c=i*a;for(let l=0;l<o;++l){const u=l*i*a,d=(o-l-1)*i*a;for(let p=0;p<c;++p)s[d+p]=e[u+p]}return s},te.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===te.DEPTH_STENCIL)return R.DEPTH24_STENCIL8;if(e===te.DEPTH_COMPONENT){if(t===pe.UNSIGNED_SHORT)return R.DEPTH_COMPONENT16;if(t===pe.UNSIGNED_INT)return R.DEPTH_COMPONENT24}if(t===pe.FLOAT)switch(e){case te.RGBA:return R.RGBA32F;case te.RGB:return R.RGB32F;case te.RG:return R.RG32F;case te.RED:return R.R32F}if(t===pe.HALF_FLOAT)switch(e){case te.RGBA:return R.RGBA16F;case te.RGB:return R.RGB16F;case te.RG:return R.RG16F;case te.RED:return R.R16F}return e};const de=Object.freeze(te),Ee={_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(Ee,{maximumCombinedTextureImageUnits:{get:function(){return Ee._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Ee._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Ee._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Ee._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Ee._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Ee._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Ee._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Ee._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Ee._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Ee._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Ee._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Ee._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Ee._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Ee._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Ee._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Ee._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Ee._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Ee._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Ee._maximumColorAttachments}},maximumSamples:{get:function(){return Ee._maximumSamples}},highpFloatSupported:{get:function(){return Ee._highpFloatSupported}},highpIntSupported:{get:function(){return Ee._highpIntSupported}}});function bc(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Ms(e,t,n){const i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function On(e){e=_(e,_.EMPTY_OBJECT);const t=e.context;m.defined("options.context",t);const n=t._gl,i=Ee.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=_(e.destroyAttachments,!0),h(e.colorTextures)&&h(e.colorRenderbuffers))throw new C("Cannot have both color texture and color renderbuffer attachments.");if(h(e.depthTexture)&&h(e.depthRenderbuffer))throw new C("Cannot have both a depth texture and depth renderbuffer attachment.");if(h(e.depthStencilTexture)&&h(e.depthStencilRenderbuffer))throw new C("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");const o=h(e.depthTexture)||h(e.depthRenderbuffer),s=h(e.depthStencilTexture)||h(e.depthStencilRenderbuffer);if(o&&s)throw new C("Cannot have both a depth and depth-stencil attachment.");if(h(e.stencilRenderbuffer)&&s)throw new C("Cannot have both a stencil and depth-stencil attachment.");if(o&&h(e.stencilRenderbuffer))throw new C("Cannot have both a depth and stencil attachment.");if(this._bind(),h(e.colorTextures)){const a=e.colorTextures,c=this._colorTextures.length=this._activeColorAttachments.length=a.length;if(c>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<c;++l){const u=a[l];if(!de.isColorFormat(u.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(u.pixelDatatype===pe.FLOAT&&!t.colorBufferFloat)throw new C("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(u.pixelDatatype===pe.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new C("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.");const d=this._gl.COLOR_ATTACHMENT0+l;bc(this,d,u),this._activeColorAttachments[l]=d,this._colorTextures[l]=u}}if(h(e.colorRenderbuffers)){const a=e.colorRenderbuffers,c=this._colorRenderbuffers.length=this._activeColorAttachments.length=a.length;if(c>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<c;++l){const u=a[l],d=this._gl.COLOR_ATTACHMENT0+l;Ms(this,d,u),this._activeColorAttachments[l]=d,this._colorRenderbuffers[l]=u}}if(h(e.depthTexture)){const a=e.depthTexture;if(a.pixelFormat!==de.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");bc(this,this._gl.DEPTH_ATTACHMENT,a),this._depthTexture=a}if(h(e.depthRenderbuffer)){const a=e.depthRenderbuffer;Ms(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a}if(h(e.stencilRenderbuffer)){const a=e.stencilRenderbuffer;Ms(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a}if(h(e.depthStencilTexture)){const a=e.depthStencilTexture;if(a.pixelFormat!==de.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");bc(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilTexture=a}if(h(e.depthStencilRenderbuffer)){const a=e.depthStencilRenderbuffer;Ms(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a}this._unBind()}Object.defineProperties(On.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)}}}),On.prototype._bind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},On.prototype._unBind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},On.prototype.bindDraw=function(){const e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)},On.prototype.bindRead=function(){const e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)},On.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},On.prototype.getColorTexture=function(e){if(!h(e)||e<0||e>=this._colorTextures.length)throw new C("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]},On.prototype.getColorRenderbuffer=function(e){if(!h(e)||e<0||e>=this._colorRenderbuffers.length)throw new C("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]},On.prototype.isDestroyed=function(){return!1},On.prototype.destroy=function(){if(this.destroyAttachments){const e=this._colorTextures;for(let n=0;n<e.length;++n){const i=e[n];h(i)&&i.destroy()}const t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){const i=t[n];h(i)&&i.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),Qe(this)};const Us={CLOCKWISE:R.CW,COUNTER_CLOCKWISE:R.CCW};Us.validate=function(e){return e===Us.CLOCKWISE||e===Us.COUNTER_CLOCKWISE};const Ef=Object.freeze(Us);function bf(e){if(typeof e!="object"||e===null)return e;let t;const n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=bf(e[t]));return Object.freeze(e)}function wf(e){return e===R.FUNC_ADD||e===R.FUNC_SUBTRACT||e===R.FUNC_REVERSE_SUBTRACT||e===R.MIN||e===R.MAX}function ks(e){return e===R.ZERO||e===R.ONE||e===R.SRC_COLOR||e===R.ONE_MINUS_SRC_COLOR||e===R.DST_COLOR||e===R.ONE_MINUS_DST_COLOR||e===R.SRC_ALPHA||e===R.ONE_MINUS_SRC_ALPHA||e===R.DST_ALPHA||e===R.ONE_MINUS_DST_ALPHA||e===R.CONSTANT_COLOR||e===R.ONE_MINUS_CONSTANT_COLOR||e===R.CONSTANT_ALPHA||e===R.ONE_MINUS_CONSTANT_ALPHA||e===R.SRC_ALPHA_SATURATE}function hy(e){return e===R.FRONT||e===R.BACK||e===R.FRONT_AND_BACK}function fy(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Tf(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Oo(e){return e===R.ZERO||e===R.KEEP||e===R.REPLACE||e===R.INCR||e===R.DECR||e===R.INVERT||e===R.INCR_WRAP||e===R.DECR_WRAP}function Ve(e){const t=_(e,_.EMPTY_OBJECT),n=_(t.cull,_.EMPTY_OBJECT),i=_(t.polygonOffset,_.EMPTY_OBJECT),o=_(t.scissorTest,_.EMPTY_OBJECT),s=_(o.rectangle,_.EMPTY_OBJECT),a=_(t.depthRange,_.EMPTY_OBJECT),c=_(t.depthTest,_.EMPTY_OBJECT),l=_(t.colorMask,_.EMPTY_OBJECT),u=_(t.blending,_.EMPTY_OBJECT),d=_(u.color,_.EMPTY_OBJECT),p=_(t.stencilTest,_.EMPTY_OBJECT),g=_(p.frontOperation,_.EMPTY_OBJECT),y=_(p.backOperation,_.EMPTY_OBJECT),x=_(t.sampleCoverage,_.EMPTY_OBJECT),E=t.viewport;if(this.frontFace=_(t.frontFace,Ef.COUNTER_CLOCKWISE),this.cull={enabled:_(n.enabled,!1),face:_(n.face,R.BACK)},this.lineWidth=_(t.lineWidth,1),this.polygonOffset={enabled:_(i.enabled,!1),factor:_(i.factor,0),units:_(i.units,0)},this.scissorTest={enabled:_(o.enabled,!1),rectangle:Ce.clone(s)},this.depthRange={near:_(a.near,0),far:_(a.far,1)},this.depthTest={enabled:_(c.enabled,!1),func:_(c.func,R.LESS)},this.colorMask={red:_(l.red,!0),green:_(l.green,!0),blue:_(l.blue,!0),alpha:_(l.alpha,!0)},this.depthMask=_(t.depthMask,!0),this.stencilMask=_(t.stencilMask,-1),this.blending={enabled:_(u.enabled,!1),color:new T(_(d.red,0),_(d.green,0),_(d.blue,0),_(d.alpha,0)),equationRgb:_(u.equationRgb,R.FUNC_ADD),equationAlpha:_(u.equationAlpha,R.FUNC_ADD),functionSourceRgb:_(u.functionSourceRgb,R.ONE),functionSourceAlpha:_(u.functionSourceAlpha,R.ONE),functionDestinationRgb:_(u.functionDestinationRgb,R.ZERO),functionDestinationAlpha:_(u.functionDestinationAlpha,R.ZERO)},this.stencilTest={enabled:_(p.enabled,!1),frontFunction:_(p.frontFunction,R.ALWAYS),backFunction:_(p.backFunction,R.ALWAYS),reference:_(p.reference,0),mask:_(p.mask,-1),frontOperation:{fail:_(g.fail,R.KEEP),zFail:_(g.zFail,R.KEEP),zPass:_(g.zPass,R.KEEP)},backOperation:{fail:_(y.fail,R.KEEP),zFail:_(y.zFail,R.KEEP),zPass:_(y.zPass,R.KEEP)}},this.sampleCoverage={enabled:_(x.enabled,!1),value:_(x.value,1),invert:_(x.invert,!1)},this.viewport=h(E)?new Ce(E.x,E.y,E.width,E.height):void 0,this.lineWidth<Ee.minimumAliasedLineWidth||this.lineWidth>Ee.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!Ef.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!hy(this.cull.face))throw new C("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new C("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 C("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new C("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new C("renderState.depthRange.far must be less than or equal to one.");if(!fy(this.depthTest.func))throw new C("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 C("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!wf(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!wf(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!ks(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!ks(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!ks(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!ks(this.blending.functionDestinationAlpha))throw new C("Invalid renderState.blending.functionDestinationAlpha.");if(!Tf(this.stencilTest.frontFunction))throw new C("Invalid renderState.stencilTest.frontFunction.");if(!Tf(this.stencilTest.backFunction))throw new C("Invalid renderState.stencilTest.backFunction.");if(!Oo(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!Oo(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!Oo(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!Oo(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!Oo(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!Oo(this.stencilTest.backOperation.zPass))throw new C("Invalid renderState.stencilTest.backOperation.zPass.");if(h(this.viewport)){if(this.viewport.width<0)throw new C("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new C("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>Ee.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${Ee.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>Ee.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${Ee.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let uy=0,Wn={};Ve.fromCache=function(e){const t=JSON.stringify(e);let n=Wn[t];if(h(n))return++n.referenceCount,n.state;let i=new Ve(e);const o=JSON.stringify(i);return n=Wn[o],h(n)||(i.id=uy++,i=bf(i),n={referenceCount:0,state:i},Wn[o]=n),++n.referenceCount,Wn[t]={referenceCount:1,state:n.state},n.state},Ve.removeFromCache=function(e){const t=new Ve(e),n=JSON.stringify(t),i=Wn[n],o=JSON.stringify(e),s=Wn[o];h(s)&&(--s.referenceCount,s.referenceCount===0&&(delete Wn[o],h(i)&&--i.referenceCount)),h(i)&&i.referenceCount===0&&delete Wn[n]},Ve.getCache=function(){return Wn},Ve.clearCache=function(){Wn={}};function Ki(e,t,n){n?e.enable(t):e.disable(t)}function Sf(e,t){e.frontFace(t.frontFace)}function Af(e,t){const n=t.cull,i=n.enabled;Ki(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Df(e,t){e.lineWidth(t.lineWidth)}function Of(e,t){const n=t.polygonOffset,i=n.enabled;Ki(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function vf(e,t,n){const i=t.scissorTest,o=h(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Ki(e,e.SCISSOR_TEST,o),o){const s=h(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(s.x,s.y,s.width,s.height)}}function If(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function Rf(e,t){const n=t.depthTest,i=n.enabled;Ki(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function zf(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Pf(e,t){e.depthMask(t.depthMask)}function Bf(e,t){e.stencilMask(t.stencilMask)}function dy(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Nf(e,t,n){const i=t.blending,o=h(n.blendingEnabled)?n.blendingEnabled:i.enabled;Ki(e,e.BLEND,o),o&&(dy(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Ff(e,t){const n=t.stencilTest,i=n.enabled;if(Ki(e,e.STENCIL_TEST,i),i){const o=n.frontFunction,s=n.backFunction,a=n.reference,c=n.mask;e.stencilFunc(o,a,c),e.stencilFuncSeparate(e.BACK,s,a,c),e.stencilFuncSeparate(e.FRONT,o,a,c);const l=n.frontOperation,u=l.fail,d=l.zFail,p=l.zPass;e.stencilOpSeparate(e.FRONT,u,d,p);const g=n.backOperation,y=g.fail,x=g.zFail,E=g.zPass;e.stencilOpSeparate(e.BACK,y,x,E)}}function Lf(e,t){const n=t.sampleCoverage,i=n.enabled;Ki(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}const py=new Ce;function Mf(e,t,n){let i=_(t.viewport,n.viewport);h(i)||(i=py,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)}Ve.apply=function(e,t,n){Sf(e,t),Af(e,t),Df(e,t),Of(e,t),If(e,t),Rf(e,t),zf(e,t),Pf(e,t),Bf(e,t),Ff(e,t),Lf(e,t),vf(e,t,n),Nf(e,t,n),Mf(e,t,n)};function my(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(Sf),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Af),e.lineWidth!==t.lineWidth&&n.push(Df),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Of),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(If),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Rf),(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(zf),e.depthMask!==t.depthMask&&n.push(Pf),e.stencilMask!==t.stencilMask&&n.push(Bf),(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(Ff),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Lf),n}Ve.partialApply=function(e,t,n,i,o,s){if(t!==n){let d=n._applyFunctions[t.id];h(d)||(d=my(t,n),n._applyFunctions[t.id]=d);const p=d.length;for(let g=0;g<p;++g)d[g](e,n)}const a=h(i.scissorTest)?i.scissorTest:t.scissorTest,c=h(o.scissorTest)?o.scissorTest:n.scissorTest;(a!==c||s)&&vf(e,n,o);const l=h(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=h(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(l!==u||u&&t.blending!==n.blending)&&Nf(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Mf(e,n,o)},Ve.getState=function(e){if(!h(e))throw new C("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:Ce.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:T.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:h(e.viewport)?Ce.clone(e.viewport):void 0}};function ae(e,t,n,i){this[0]=_(e,0),this[1]=_(n,0),this[2]=_(t,0),this[3]=_(i,0)}ae.packedLength=4,ae.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},ae.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new ae),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},ae.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*4;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)ae.pack(e[o],t,o*4);return t},ae.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;h(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=ae.unpack(e,i,t[o])}return t},ae.clone=function(e,t){if(h(e))return h(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new ae(e[0],e[2],e[1],e[3])},ae.fromArray=ae.unpack,ae.fromColumnMajorArray=function(e,t){return m.defined("values",e),ae.clone(e,t)},ae.fromRowMajorArray=function(e,t){return m.defined("values",e),h(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new ae(e[0],e[1],e[2],e[3])},ae.fromScale=function(e,t){return m.typeOf.object("scale",e),h(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new ae(e.x,0,0,e.y)},ae.fromUniformScale=function(e,t){return m.typeOf.number("scale",e),h(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new ae(e,0,0,e)},ae.fromRotation=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new ae(n,-i,i,n)},ae.toArray=function(e,t){return m.typeOf.object("matrix",e),h(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]]},ae.getElementIndex=function(e,t){return m.typeOf.number.greaterThanOrEquals("row",t,0),m.typeOf.number.lessThanOrEquals("row",t,1),m.typeOf.number.greaterThanOrEquals("column",e,0),m.typeOf.number.lessThanOrEquals("column",e,1),e*2+t},ae.getColumn=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("result",n);const i=t*2,o=e[i],s=e[i+1];return n.x=o,n.y=s,n},ae.setColumn=function(e,t,n,i){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=ae.clone(e,i);const o=t*2;return i[o]=n.x,i[o+1]=n.y,i},ae.getRow=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("result",n);const i=e[t],o=e[t+2];return n.x=i,n.y=o,n},ae.setRow=function(e,t,n,i){return m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=ae.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};const _y=new U;ae.setScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=ae.getScale(e,_y),o=t.x/i.x,s=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*s,n[3]=e[3]*s,n};const gy=new U;ae.setUniformScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.typeOf.object("result",n);const i=ae.getScale(e,gy),o=t/i.x,s=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*s,n[3]=e[3]*s,n};const Uf=new U;ae.getScale=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t.x=U.magnitude(U.fromElements(e[0],e[1],Uf)),t.y=U.magnitude(U.fromElements(e[2],e[3],Uf)),t};const kf=new U;ae.getMaximumScale=function(e){return ae.getScale(e,kf),U.maximumComponent(kf)};const yy=new U;ae.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=ae.getScale(e,yy);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 xy=new U;ae.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=ae.getScale(e,xy);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},ae.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],s=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=s,n[2]=o,n[3]=a,n},ae.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},ae.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},ae.multiplyByVector=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n},ae.multiplyByScalar=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scalar",t),m.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},ae.multiplyByScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.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},ae.multiplyByUniformScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.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},ae.negate=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},ae.transpose=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[2],o=e[1],s=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t},ae.abs=function(e,t){return m.typeOf.object("matrix",e),m.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},ae.equals=function(e,t){return e===t||h(e)&&h(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ae.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]},ae.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},ae.IDENTITY=Object.freeze(new ae(1,0,0,1)),ae.ZERO=Object.freeze(new ae(0,0,0,0)),ae.COLUMN0ROW0=0,ae.COLUMN0ROW1=1,ae.COLUMN1ROW0=2,ae.COLUMN1ROW1=3,Object.defineProperties(ae.prototype,{length:{get:function(){return ae.packedLength}}}),ae.prototype.clone=function(e){return ae.clone(this,e)},ae.prototype.equals=function(e){return ae.equals(this,e)},ae.prototype.equalsEpsilon=function(e,t){return ae.equalsEpsilon(this,e,t)},ae.prototype.toString=function(){return`(${this[0]}, ${this[2]})
43
+ */(function(e){(function(t,n){e.exports?e.exports=n(q_(),H_(),W_()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(_o,function(t,n,i,o){var s=o&&o.URI;function a(r,w){var v=arguments.length>=1,z=arguments.length>=2;if(!(this instanceof a))return v?z?new a(r,w):new a(r):new a;if(r===void 0){if(v)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?r=location.href+"":r=""}if(r===null&&v)throw new TypeError("null is not a valid argument for URI");return this.href(r),w!==void 0?this.absoluteTo(w):this}function c(r){return/^[0-9]+$/.test(r)}a.version="1.19.11";var l=a.prototype,u=Object.prototype.hasOwnProperty;function d(r){return r.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(r){return r===void 0?"Undefined":String(Object.prototype.toString.call(r)).slice(8,-1)}function g(r){return p(r)==="Array"}function y(r,w){var v={},z,G;if(p(w)==="RegExp")v=null;else if(g(w))for(z=0,G=w.length;z<G;z++)v[w[z]]=!0;else v[w]=!0;for(z=0,G=r.length;z<G;z++){var W=v&&v[r[z]]!==void 0||!v&&w.test(r[z]);W&&(r.splice(z,1),G--,z--)}return r}function x(r,w){var v,z;if(g(w)){for(v=0,z=w.length;v<z;v++)if(!x(r,w[v]))return!1;return!0}var G=p(w);for(v=0,z=r.length;v<z;v++)if(G==="RegExp"){if(typeof r[v]=="string"&&r[v].match(w))return!0}else if(r[v]===w)return!0;return!1}function E(r,w){if(!g(r)||!g(w)||r.length!==w.length)return!1;r.sort(),w.sort();for(var v=0,z=r.length;v<z;v++)if(r[v]!==w[v])return!1;return!0}function b(r){var w=/^\/+|\/+$/g;return r.replace(w,"")}a._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:a.preventInvalidHostname,duplicateQueryParameters:a.duplicateQueryParameters,escapeQuerySpace:a.escapeQuerySpace}},a.preventInvalidHostname=!1,a.duplicateQueryParameters=!1,a.escapeQuerySpace=!0,a.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,a.idn_expression=/[^a-z0-9\._-]/i,a.punycode_expression=/(xn--)/i,a.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,a.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,a.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,a.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},a.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,a.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,a.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},a.hostProtocols=["http","https"],a.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,a.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},a.getDomAttribute=function(r){if(!(!r||!r.nodeName)){var w=r.nodeName.toLowerCase();if(!(w==="input"&&r.type!=="image"))return a.domAttributes[w]}};function D(r){return escape(r)}function A(r){return encodeURIComponent(r).replace(/[!'()*]/g,D).replace(/\*/g,"%2A")}a.encode=A,a.decode=decodeURIComponent,a.iso8859=function(){a.encode=escape,a.decode=unescape},a.unicode=function(){a.encode=A,a.decode=decodeURIComponent},a.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},a.encodeQuery=function(r,w){var v=a.encode(r+"");return w===void 0&&(w=a.escapeQuerySpace),w?v.replace(/%20/g,"+"):v},a.decodeQuery=function(r,w){r+="",w===void 0&&(w=a.escapeQuerySpace);try{return a.decode(w?r.replace(/\+/g,"%20"):r)}catch{return r}};var O={encode:"encode",decode:"decode"},I,B=function(r,w){return function(v){try{return a[w](v+"").replace(a.characters[r][w].expression,function(z){return a.characters[r][w].map[z]})}catch{return v}}};for(I in O)a[I+"PathSegment"]=B("pathname",O[I]),a[I+"UrnPathSegment"]=B("urnpath",O[I]);var M=function(r,w,v){return function(z){var G;v?G=function(ie){return a[w](a[v](ie))}:G=a[w];for(var W=(z+"").split(r),Z=0,X=W.length;Z<X;Z++)W[Z]=G(W[Z]);return W.join(r)}};a.decodePath=M("/","decodePathSegment"),a.decodeUrnPath=M(":","decodeUrnPathSegment"),a.recodePath=M("/","encodePathSegment","decode"),a.recodeUrnPath=M(":","encodeUrnPathSegment","decode"),a.encodeReserved=B("reserved","encode"),a.parse=function(r,w){var v;return w||(w={preventInvalidHostname:a.preventInvalidHostname}),r=r.replace(a.leading_whitespace_expression,""),r=r.replace(a.ascii_tab_whitespace,""),v=r.indexOf("#"),v>-1&&(w.fragment=r.substring(v+1)||null,r=r.substring(0,v)),v=r.indexOf("?"),v>-1&&(w.query=r.substring(v+1)||null,r=r.substring(0,v)),r=r.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),r=r.replace(/^[/\\]{2,}/i,"//"),r.substring(0,2)==="//"?(w.protocol=null,r=r.substring(2),r=a.parseAuthority(r,w)):(v=r.indexOf(":"),v>-1&&(w.protocol=r.substring(0,v)||null,w.protocol&&!w.protocol.match(a.protocol_expression)?w.protocol=void 0:r.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(r=r.substring(v+3),r=a.parseAuthority(r,w)):(r=r.substring(v+1),w.urn=!0))),w.path=r,w},a.parseHost=function(r,w){r||(r=""),r=r.replace(/\\/g,"/");var v=r.indexOf("/"),z,G;if(v===-1&&(v=r.length),r.charAt(0)==="[")z=r.indexOf("]"),w.hostname=r.substring(1,z)||null,w.port=r.substring(z+2,v)||null,w.port==="/"&&(w.port=null);else{var W=r.indexOf(":"),Z=r.indexOf("/"),X=r.indexOf(":",W+1);X!==-1&&(Z===-1||X<Z)?(w.hostname=r.substring(0,v)||null,w.port=null):(G=r.substring(0,v).split(":"),w.hostname=G[0]||null,w.port=G[1]||null)}return w.hostname&&r.substring(v).charAt(0)!=="/"&&(v++,r="/"+r),w.preventInvalidHostname&&a.ensureValidHostname(w.hostname,w.protocol),w.port&&a.ensureValidPort(w.port),r.substring(v)||"/"},a.parseAuthority=function(r,w){return r=a.parseUserinfo(r,w),a.parseHost(r,w)},a.parseUserinfo=function(r,w){var v=r,z=r.indexOf("\\");z!==-1&&(r=r.replace(/\\/g,"/"));var G=r.indexOf("/"),W=r.lastIndexOf("@",G>-1?G:r.length-1),Z;return W>-1&&(G===-1||W<G)?(Z=r.substring(0,W).split(":"),w.username=Z[0]?a.decode(Z[0]):null,Z.shift(),w.password=Z[0]?a.decode(Z.join(":")):null,r=v.substring(W+1)):(w.username=null,w.password=null),r},a.parseQuery=function(r,w){if(!r)return{};if(r=r.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!r)return{};for(var v={},z=r.split("&"),G=z.length,W,Z,X,ie=0;ie<G;ie++)W=z[ie].split("="),Z=a.decodeQuery(W.shift(),w),X=W.length?a.decodeQuery(W.join("="),w):null,Z!=="__proto__"&&(u.call(v,Z)?((typeof v[Z]=="string"||v[Z]===null)&&(v[Z]=[v[Z]]),v[Z].push(X)):v[Z]=X);return v},a.build=function(r){var w="",v=!1;return r.protocol&&(w+=r.protocol+":"),!r.urn&&(w||r.hostname)&&(w+="//",v=!0),w+=a.buildAuthority(r)||"",typeof r.path=="string"&&(r.path.charAt(0)!=="/"&&v&&(w+="/"),w+=r.path),typeof r.query=="string"&&r.query&&(w+="?"+r.query),typeof r.fragment=="string"&&r.fragment&&(w+="#"+r.fragment),w},a.buildHost=function(r){var w="";if(r.hostname)a.ip6_expression.test(r.hostname)?w+="["+r.hostname+"]":w+=r.hostname;else return"";return r.port&&(w+=":"+r.port),w},a.buildAuthority=function(r){return a.buildUserinfo(r)+a.buildHost(r)},a.buildUserinfo=function(r){var w="";return r.username&&(w+=a.encode(r.username)),r.password&&(w+=":"+a.encode(r.password)),w&&(w+="@"),w},a.buildQuery=function(r,w,v){var z="",G,W,Z,X;for(W in r)if(W!=="__proto__"&&u.call(r,W))if(g(r[W]))for(G={},Z=0,X=r[W].length;Z<X;Z++)r[W][Z]!==void 0&&G[r[W][Z]+""]===void 0&&(z+="&"+a.buildQueryParameter(W,r[W][Z],v),w!==!0&&(G[r[W][Z]+""]=!0));else r[W]!==void 0&&(z+="&"+a.buildQueryParameter(W,r[W],v));return z.substring(1)},a.buildQueryParameter=function(r,w,v){return a.encodeQuery(r,v)+(w!==null?"="+a.encodeQuery(w,v):"")},a.addQuery=function(r,w,v){if(typeof w=="object")for(var z in w)u.call(w,z)&&a.addQuery(r,z,w[z]);else if(typeof w=="string"){if(r[w]===void 0){r[w]=v;return}else typeof r[w]=="string"&&(r[w]=[r[w]]);g(v)||(v=[v]),r[w]=(r[w]||[]).concat(v)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(r,w,v){if(typeof w=="object")for(var z in w)u.call(w,z)&&a.setQuery(r,z,w[z]);else if(typeof w=="string")r[w]=v===void 0?null:v;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(r,w,v){var z,G,W;if(g(w))for(z=0,G=w.length;z<G;z++)r[w[z]]=void 0;else if(p(w)==="RegExp")for(W in r)w.test(W)&&(r[W]=void 0);else if(typeof w=="object")for(W in w)u.call(w,W)&&a.removeQuery(r,W,w[W]);else if(typeof w=="string")v!==void 0?p(v)==="RegExp"?!g(r[w])&&v.test(r[w])?r[w]=void 0:r[w]=y(r[w],v):r[w]===String(v)&&(!g(v)||v.length===1)?r[w]=void 0:g(r[w])&&(r[w]=y(r[w],v)):r[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(r,w,v,z){switch(p(w)){case"String":break;case"RegExp":for(var G in r)if(u.call(r,G)&&w.test(G)&&(v===void 0||a.hasQuery(r,G,v)))return!0;return!1;case"Object":for(var W in w)if(u.call(w,W)&&!a.hasQuery(r,W,w[W]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(v)){case"Undefined":return w in r;case"Boolean":var Z=!!(g(r[w])?r[w].length:r[w]);return v===Z;case"Function":return!!v(r[w],w,r);case"Array":if(!g(r[w]))return!1;var X=z?x:E;return X(r[w],v);case"RegExp":return g(r[w])?z?x(r[w],v):!1:!!(r[w]&&r[w].match(v));case"Number":v=String(v);case"String":return g(r[w])?z?x(r[w],v):!1:r[w]===v;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var r=[],w=[],v=0,z=0;z<arguments.length;z++){var G=new a(arguments[z]);r.push(G);for(var W=G.segment(),Z=0;Z<W.length;Z++)typeof W[Z]=="string"&&w.push(W[Z]),W[Z]&&v++}if(!w.length||!v)return new a("");var X=new a("").segment(w);return(r[0].path()===""||r[0].path().slice(0,1)==="/")&&X.path("/"+X.path()),X.normalize()},a.commonPath=function(r,w){var v=Math.min(r.length,w.length),z;for(z=0;z<v;z++)if(r.charAt(z)!==w.charAt(z)){z--;break}return z<1?r.charAt(0)===w.charAt(0)&&r.charAt(0)==="/"?"/":"":((r.charAt(z)!=="/"||w.charAt(z)!=="/")&&(z=r.substring(0,z).lastIndexOf("/")),r.substring(0,z+1))},a.withinString=function(r,w,v){v||(v={});var z=v.start||a.findUri.start,G=v.end||a.findUri.end,W=v.trim||a.findUri.trim,Z=v.parens||a.findUri.parens,X=/[a-z0-9-]=["']?$/i;for(z.lastIndex=0;;){var ie=z.exec(r);if(!ie)break;var se=ie.index;if(v.ignoreHtml){var ge=r.slice(Math.max(se-3,0),se);if(ge&&X.test(ge))continue}for(var be=se+r.slice(se).search(G),xe=r.slice(se,be),ze=-1;;){var je=Z.exec(xe);if(!je)break;var tt=je.index+je[0].length;ze=Math.max(ze,tt)}if(ze>-1?xe=xe.slice(0,ze)+xe.slice(ze).replace(W,""):xe=xe.replace(W,""),!(xe.length<=ie[0].length)&&!(v.ignore&&v.ignore.test(xe))){be=se+xe.length;var ut=w(xe,se,be,r);if(ut===void 0){z.lastIndex=be;continue}ut=String(ut),r=r.slice(0,se)+ut+r.slice(be),z.lastIndex=se+ut.length}}return z.lastIndex=0,r},a.ensureValidHostname=function(r,w){var v=!!r,z=!!w,G=!1;if(z&&(G=x(a.hostProtocols,w)),G&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(r&&r.match(a.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(r).match(a.invalid_hostname_characters))throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-:_]')}},a.ensureValidPort=function(r){if(r){var w=Number(r);if(!(c(w)&&w>0&&w<65536))throw new TypeError('Port "'+r+'" is not a valid port')}},a.noConflict=function(r){if(r){var w={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(w.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(w.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=o.SecondLevelDomains.noConflict()),w}else o.URI===this&&(o.URI=s);return this},l.build=function(r){return r===!0?this._deferred_build=!0:(r===void 0||this._deferred_build)&&(this._string=a.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new a(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function q(r){return function(w,v){return w===void 0?this._parts[r]||"":(this._parts[r]=w||null,this.build(!v),this)}}function P(r,w){return function(v,z){return v===void 0?this._parts[r]||"":(v!==null&&(v=v+"",v.charAt(0)===w&&(v=v.substring(1))),this._parts[r]=v,this.build(!z),this)}}l.protocol=q("protocol"),l.username=q("username"),l.password=q("password"),l.hostname=q("hostname"),l.port=q("port"),l.query=P("query","?"),l.fragment=P("fragment","#"),l.search=function(r,w){var v=this.query(r,w);return typeof v=="string"&&v.length?"?"+v:v},l.hash=function(r,w){var v=this.fragment(r,w);return typeof v=="string"&&v.length?"#"+v:v},l.pathname=function(r,w){if(r===void 0||r===!0){var v=this._parts.path||(this._parts.hostname?"/":"");return r?(this._parts.urn?a.decodeUrnPath:a.decodePath)(v):v}else return this._parts.urn?this._parts.path=r?a.recodeUrnPath(r):"":this._parts.path=r?a.recodePath(r):"/",this.build(!w),this},l.path=l.pathname,l.href=function(r,w){var v;if(r===void 0)return this.toString();this._string="",this._parts=a._parts();var z=r instanceof a,G=typeof r=="object"&&(r.hostname||r.path||r.pathname);if(r.nodeName){var W=a.getDomAttribute(r);r=r[W]||"",G=!1}if(!z&&G&&r.pathname!==void 0&&(r=r.toString()),typeof r=="string"||r instanceof String)this._parts=a.parse(String(r),this._parts);else if(z||G){var Z=z?r._parts:r;for(v in Z)v!=="query"&&u.call(this._parts,v)&&(this._parts[v]=Z[v]);Z.query&&this.query(Z.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},l.is=function(r){var w=!1,v=!1,z=!1,G=!1,W=!1,Z=!1,X=!1,ie=!this._parts.urn;switch(this._parts.hostname&&(ie=!1,v=a.ip4_expression.test(this._parts.hostname),z=a.ip6_expression.test(this._parts.hostname),w=v||z,G=!w,W=G&&i&&i.has(this._parts.hostname),Z=G&&a.idn_expression.test(this._parts.hostname),X=G&&a.punycode_expression.test(this._parts.hostname)),r.toLowerCase()){case"relative":return ie;case"absolute":return!ie;case"domain":case"name":return G;case"sld":return W;case"ip":return w;case"ip4":case"ipv4":case"inet4":return v;case"ip6":case"ipv6":case"inet6":return z;case"idn":return Z;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return X}return null};var V=l.protocol,k=l.port,H=l.hostname;l.protocol=function(r,w){if(r&&(r=r.replace(/:(\/\/)?$/,""),!r.match(a.protocol_expression)))throw new TypeError('Protocol "'+r+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return V.call(this,r,w)},l.scheme=l.protocol,l.port=function(r,w){return this._parts.urn?r===void 0?"":this:(r!==void 0&&(r===0&&(r=null),r&&(r+="",r.charAt(0)===":"&&(r=r.substring(1)),a.ensureValidPort(r))),k.call(this,r,w))},l.hostname=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r!==void 0){var v={preventInvalidHostname:this._parts.preventInvalidHostname},z=a.parseHost(r,v);if(z!=="/")throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-]');r=v.hostname,this._parts.preventInvalidHostname&&a.ensureValidHostname(r,this._parts.protocol)}return H.call(this,r,w)},l.origin=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0){var v=this.protocol(),z=this.authority();return z?(v?v+"://":"")+this.authority():""}else{var G=a(r);return this.protocol(G.protocol()).authority(G.authority()).build(!w),this}},l.host=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0)return this._parts.hostname?a.buildHost(this._parts):"";var v=a.parseHost(r,this._parts);if(v!=="/")throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},l.authority=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0)return this._parts.hostname?a.buildAuthority(this._parts):"";var v=a.parseAuthority(r,this._parts);if(v!=="/")throw new TypeError('Hostname "'+r+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},l.userinfo=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0){var v=a.buildUserinfo(this._parts);return v&&v.substring(0,v.length-1)}else return r[r.length-1]!=="@"&&(r+="@"),a.parseUserinfo(r,this._parts),this.build(!w),this},l.resource=function(r,w){var v;return r===void 0?this.path()+this.search()+this.hash():(v=a.parse(r),this._parts.path=v.path,this._parts.query=v.query,this._parts.fragment=v.fragment,this.build(!w),this)},l.subdomain=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,v)||""}else{var z=this._parts.hostname.length-this.domain().length,G=this._parts.hostname.substring(0,z),W=new RegExp("^"+d(G));if(r&&r.charAt(r.length-1)!=="."&&(r+="."),r.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return r&&a.ensureValidHostname(r,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(W,r),this.build(!w),this}},l.domain=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(w=r,r=void 0),r===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.match(/\./g);if(v&&v.length<2)return this._parts.hostname;var z=this._parts.hostname.length-this.tld(w).length-1;return z=this._parts.hostname.lastIndexOf(".",z-1)+1,this._parts.hostname.substring(z)||""}else{if(!r)throw new TypeError("cannot set domain empty");if(r.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(a.ensureValidHostname(r,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=r;else{var G=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(G,r)}return this.build(!w),this}},l.tld=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(w=r,r=void 0),r===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.lastIndexOf("."),z=this._parts.hostname.substring(v+1);return w!==!0&&i&&i.list[z.toLowerCase()]&&i.get(this._parts.hostname)||z}else{var G;if(r)if(r.match(/[^a-zA-Z0-9-]/))if(i&&i.is(r))G=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,r);else throw new TypeError('TLD "'+r+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");G=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,r)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},l.directory=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0||r===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var v=this._parts.path.length-this.filename().length-1,z=this._parts.path.substring(0,v)||(this._parts.hostname?"/":"");return r?a.decodePath(z):z}else{var G=this._parts.path.length-this.filename().length,W=this._parts.path.substring(0,G),Z=new RegExp("^"+d(W));return this.is("relative")||(r||(r="/"),r.charAt(0)!=="/"&&(r="/"+r)),r&&r.charAt(r.length-1)!=="/"&&(r+="/"),r=a.recodePath(r),this._parts.path=this._parts.path.replace(Z,r),this.build(!w),this}},l.filename=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(typeof r!="string"){if(!this._parts.path||this._parts.path==="/")return"";var v=this._parts.path.lastIndexOf("/"),z=this._parts.path.substring(v+1);return r?a.decodePathSegment(z):z}else{var G=!1;r.charAt(0)==="/"&&(r=r.substring(1)),r.match(/\.?\//)&&(G=!0);var W=new RegExp(d(this.filename())+"$");return r=a.recodePath(r),this._parts.path=this._parts.path.replace(W,r),G?this.normalizePath(w):this.build(!w),this}},l.suffix=function(r,w){if(this._parts.urn)return r===void 0?"":this;if(r===void 0||r===!0){if(!this._parts.path||this._parts.path==="/")return"";var v=this.filename(),z=v.lastIndexOf("."),G,W;return z===-1?"":(G=v.substring(z+1),W=/^[a-z0-9%]+$/i.test(G)?G:"",r?a.decodePathSegment(W):W)}else{r.charAt(0)==="."&&(r=r.substring(1));var Z=this.suffix(),X;if(Z)r?X=new RegExp(d(Z)+"$"):X=new RegExp(d("."+Z)+"$");else{if(!r)return this;this._parts.path+="."+a.recodePath(r)}return X&&(r=a.recodePath(r),this._parts.path=this._parts.path.replace(X,r)),this.build(!w),this}},l.segment=function(r,w,v){var z=this._parts.urn?":":"/",G=this.path(),W=G.substring(0,1)==="/",Z=G.split(z);if(r!==void 0&&typeof r!="number"&&(v=w,w=r,r=void 0),r!==void 0&&typeof r!="number")throw new Error('Bad segment "'+r+'", must be 0-based integer');if(W&&Z.shift(),r<0&&(r=Math.max(Z.length+r,0)),w===void 0)return r===void 0?Z:Z[r];if(r===null||Z[r]===void 0)if(g(w)){Z=[];for(var X=0,ie=w.length;X<ie;X++)!w[X].length&&(!Z.length||!Z[Z.length-1].length)||(Z.length&&!Z[Z.length-1].length&&Z.pop(),Z.push(b(w[X])))}else(w||typeof w=="string")&&(w=b(w),Z[Z.length-1]===""?Z[Z.length-1]=w:Z.push(w));else w?Z[r]=b(w):Z.splice(r,1);return W&&Z.unshift(""),this.path(Z.join(z),v)},l.segmentCoded=function(r,w,v){var z,G,W;if(typeof r!="number"&&(v=w,w=r,r=void 0),w===void 0){if(z=this.segment(r,w,v),!g(z))z=z!==void 0?a.decode(z):void 0;else for(G=0,W=z.length;G<W;G++)z[G]=a.decode(z[G]);return z}if(!g(w))w=typeof w=="string"||w instanceof String?a.encode(w):w;else for(G=0,W=w.length;G<W;G++)w[G]=a.encode(w[G]);return this.segment(r,w,v)};var j=l.query;return l.query=function(r,w){if(r===!0)return a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof r=="function"){var v=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace),z=r.call(this,v);return this._parts.query=a.buildQuery(z||v,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return r!==void 0&&typeof r!="string"?(this._parts.query=a.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):j.call(this,r,w)},l.setQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof r=="string"||r instanceof String)z[r]=w!==void 0?w:null;else if(typeof r=="object")for(var G in r)u.call(r,G)&&(z[G]=r[G]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=w),this.build(!v),this},l.addQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(z,r,w===void 0?null:w),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=w),this.build(!v),this},l.removeQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(z,r,w),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=w),this.build(!v),this},l.hasQuery=function(r,w,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(z,r,w,v)},l.setSearch=l.setQuery,l.addSearch=l.addQuery,l.removeSearch=l.removeQuery,l.hasSearch=l.hasQuery,l.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},l.normalizeProtocol=function(r){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!r)),this},l.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&n&&(this._parts.hostname=n.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},l.normalizePort=function(r){return typeof this._parts.protocol=="string"&&this._parts.port===a.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!r)),this},l.normalizePath=function(r){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=a.recodeUrnPath(this._parts.path),this.build(!r),this;if(this._parts.path==="/")return this;w=a.recodePath(w);var v,z="",G,W;for(w.charAt(0)!=="/"&&(v=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),v&&(z=w.substring(1).match(/^(\.\.\/)+/)||"",z&&(z=z[0]));G=w.search(/\/\.\.(\/|$)/),G!==-1;){if(G===0){w=w.substring(3);continue}W=w.substring(0,G).lastIndexOf("/"),W===-1&&(W=G),w=w.substring(0,W)+w.substring(G+3)}return v&&this.is("relative")&&(w=z+w.substring(1)),this._parts.path=w,this.build(!r),this},l.normalizePathname=l.normalizePath,l.normalizeQuery=function(r){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(a.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!r)),this},l.normalizeFragment=function(r){return this._parts.fragment||(this._parts.fragment=null,this.build(!r)),this},l.normalizeSearch=l.normalizeQuery,l.normalizeHash=l.normalizeFragment,l.iso8859=function(){var r=a.encode,w=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=r,a.decode=w}return this},l.unicode=function(){var r=a.encode,w=a.decode;a.encode=A,a.decode=unescape;try{this.normalize()}finally{a.encode=r,a.decode=w}return this},l.readable=function(){var r=this.clone();r.username("").password("").normalize();var w="";if(r._parts.protocol&&(w+=r._parts.protocol+"://"),r._parts.hostname&&(r.is("punycode")&&t?(w+=t.toUnicode(r._parts.hostname),r._parts.port&&(w+=":"+r._parts.port)):w+=r.host()),r._parts.hostname&&r._parts.path&&r._parts.path.charAt(0)!=="/"&&(w+="/"),w+=r.path(!0),r._parts.query){for(var v="",z=0,G=r._parts.query.split("&"),W=G.length;z<W;z++){var Z=(G[z]||"").split("=");v+="&"+a.decodeQuery(Z[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),Z[1]!==void 0&&(v+="="+a.decodeQuery(Z[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+v.substring(1)}return w+=a.decodeQuery(r.hash(),!0),w},l.absoluteTo=function(r){var w=this.clone(),v=["protocol","username","password","hostname","port"],z,G,W;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(r instanceof a||(r=new a(r)),w._parts.protocol||(w._parts.protocol=r._parts.protocol,this._parts.hostname))return w;for(G=0;W=v[G];G++)w._parts[W]=r._parts[W];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(z=r.directory(),z=z||(r.path().indexOf("/")===0?"/":""),w._parts.path=(z?z+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=r._parts.path,w._parts.query||(w._parts.query=r._parts.query)),w.build(),w},l.relativeTo=function(r){var w=this.clone().normalize(),v,z,G,W,Z;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(r=new a(r).normalize(),v=w._parts,z=r._parts,W=w.path(),Z=r.path(),W.charAt(0)!=="/")throw new Error("URI is already relative");if(Z.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(v.protocol===z.protocol&&(v.protocol=null),v.username!==z.username||v.password!==z.password||v.protocol!==null||v.username!==null||v.password!==null)return w.build();if(v.hostname===z.hostname&&v.port===z.port)v.hostname=null,v.port=null;else return w.build();if(W===Z)return v.path="",w.build();if(G=a.commonPath(W,Z),!G)return w.build();var X=z.path.substring(G.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return v.path=X+v.path.substring(G.length)||"./",w.build()},l.equals=function(r){var w=this.clone(),v=new a(r),z={},G={},W={},Z,X,ie;if(w.normalize(),v.normalize(),w.toString()===v.toString())return!0;if(Z=w.query(),X=v.query(),w.query(""),v.query(""),w.toString()!==v.toString()||Z.length!==X.length)return!1;z=a.parseQuery(Z,this._parts.escapeQuerySpace),G=a.parseQuery(X,this._parts.escapeQuerySpace);for(ie in z)if(u.call(z,ie)){if(g(z[ie])){if(!E(z[ie],G[ie]))return!1}else if(z[ie]!==G[ie])return!1;W[ie]=!0}for(ie in G)if(u.call(G,ie)&&!W[ie])return!1;return!0},l.preventInvalidHostname=function(r){return this._parts.preventInvalidHostname=!!r,this},l.duplicateQueryParameters=function(r){return this._parts.duplicateQueryParameters=!!r,this},l.escapeQuerySpace=function(r){return this._parts.escapeQuerySpace=!!r,this},a})})(kh);var j_=kh.exports;const ci=rs(j_);function Y_(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}function tn(e,t){if(e===null||typeof e!="object")return e;t=_(t,!1);const n=new e.constructor;for(const i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=tn(o,t)),n[i]=o}return n}function nn(e,t,n){n=_(n,!1);const i={},o=h(e),s=h(t);let a,c,l;if(o)for(a in e)e.hasOwnProperty(a)&&(c=e[a],s&&n&&typeof c=="object"&&t.hasOwnProperty(a)?(l=t[a],typeof l=="object"?i[a]=nn(c,l,n):i[a]=c):i[a]=c);if(s)for(a in t)t.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(l=t[a],i[a]=l);return i}function Jo(){let e,t;const n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}function er(e,t){let n;return typeof document<"u"&&(n=document),er._implementation(e,t,n)}er._implementation=function(e,t,n){if(!h(e))throw new C("relative uri is required.");if(!h(t)){if(typeof n>"u")return e;t=_(n.baseURI,n.location.href)}const i=new ci(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};function X_(e,t){if(!h(e))throw new C("uri is required.");let n="";const i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new ci(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}function $_(e){if(!h(e))throw new C("uri is required.");const t=new ci(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}const Hh={};function Wh(e,t,n){h(t)||(t=e.width),h(n)||(n=e.height);let i=Hh[t];h(i)||(i={},Hh[t]=i);let o=i[n];if(!h(o)){const s=document.createElement("canvas");s.width=t,s.height=n,o=s.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}const Z_=/^blob:/i;function jh(e){return m.typeOf.string("uri",e),Z_.test(e)}let Gn;function nc(e){h(Gn)||(Gn=document.createElement("a")),Gn.href=window.location.href;const t=Gn.host,n=Gn.protocol;return Gn.href=e,Gn.href=Gn.href,n!==Gn.protocol||t!==Gn.host}const K_=/^data:/i;function Yh(e){return m.typeOf.string("uri",e),K_.test(e)}function Q_(e){const t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(s){i(s)},o.appendChild(t)})}function J_(e){if(!h(e))throw new C("obj is required.");let t="";for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let s=0,a=i.length;s<a;++s)t+=`${o+encodeURIComponent(i[s])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}function eg(e){if(!h(e))throw new C("queryString is required.");const t={};if(e==="")return t;const n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){const s=n[i].split("="),a=decodeURIComponent(s[0]);let c=s[1];h(c)?c=decodeURIComponent(c):c="";const l=t[a];typeof l=="string"?t[a]=[l,c]:Array.isArray(l)?l.push(c):t[a]=c}return t}const mt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),tg=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function As(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.throttleByServer,!1),n=_(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=_(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=_(e.type,tg.OTHER),this.serverKey=e.serverKey,this.state=mt.UNISSUED,this.deferred=void 0,this.cancelled=!1}As.prototype.cancel=function(){this.cancelled=!0},As.prototype.clone=function(e){return h(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=mt.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new As(this)};function ng(e){const t={};if(!e)return t;const n=e.split(`\r
44
+ `);for(let i=0;i<n.length;++i){const o=n[i],s=o.indexOf(": ");if(s>0){const a=o.substring(0,s),c=o.substring(s+2);t[a]=c}}return t}function tr(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=ng(this.responseHeaders))}tr.prototype.toString=function(){let e="Request has failed.";return h(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function Pe(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Pe.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Pe.prototype.addEventListener=function(e,t){m.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);const n=this;return function(){n.removeEventListener(e,t)}},Pe.prototype.removeEventListener=function(e,t){m.typeOf.func("listener",e);const n=this._listeners,i=this._scopes;let o=-1;for(let s=0;s<n.length;s++)if(n[s]===e&&i[s]===t){o=s;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function ig(e,t){return t-e}Pe.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e;const t=this._listeners,n=this._scopes;let i=t.length;for(e=0;e<i;e++){const s=t[e];h(s)&&t[e].apply(n[e],arguments)}const o=this._toRemove;if(i=o.length,i>0){for(o.sort(ig),e=0;e<i;e++){const s=o[e];t.splice(s,1),n.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function $i(e){m.typeOf.object("options",e),m.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties($i.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){m.typeOf.number.greaterThanOrEquals("maximumLength",e,0);const t=this._length;if(e<t){const n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function ic(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}$i.prototype.reserve=function(e){e=_(e,this._length),this._array.length=e},$i.prototype.heapify=function(e){e=_(e,0);const t=this._length,n=this._comparator,i=this._array;let o=-1,s=!0;for(;s;){const a=2*(e+1),c=a-1;c<t&&n(i[c],i[e])<0?o=c:o=e,a<t&&n(i[a],i[o])<0&&(o=a),o!==e?(ic(i,o,e),e=o):s=!1}},$i.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},$i.prototype.insert=function(e){m.defined("element",e);const t=this._array,n=this._comparator,i=this._maximumLength;let o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){const a=Math.floor((o-1)/2);if(n(t[o],t[a])<0)ic(t,o,a),o=a;else break}let s;return h(i)&&this._length>i&&(s=t[i],this._length=i),s},$i.prototype.pop=function(e){if(e=_(e,0),this._length===0)return;m.typeOf.number.lessThan("index",e,this._length);const t=this._array,n=t[e];return ic(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function og(e,t){return e.priority-t.priority}const Le={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let bo=20;const Ht=new $i({comparator:og});Ht.maximumLength=bo,Ht.reserve(bo);const qn=[];let li={};const rg=typeof document<"u"?new ci(document.location.href):new ci,Ds=new Pe;function Xe(){}Xe.maximumRequests=50,Xe.maximumRequestsPerServer=18,Xe.requestsByServer={},Xe.throttleRequests=!0,Xe.debugShowStatistics=!1,Xe.requestCompletedEvent=Ds,Object.defineProperties(Xe,{statistics:{get:function(){return Le}},priorityHeapLength:{get:function(){return bo},set:function(e){if(e<bo)for(;Ht.length>e;){const t=Ht.pop();Zi(t)}bo=e,Ht.maximumLength=e,Ht.reserve(e)}}});function Xh(e){h(e.priorityFunction)&&(e.priority=e.priorityFunction())}Xe.serverHasOpenSlots=function(e,t){t=_(t,1);const n=_(Xe.requestsByServer[e],Xe.maximumRequestsPerServer);return li[e]+t<=n},Xe.heapHasOpenSlots=function(e){return Ht.length+e<=bo};function $h(e){return e.state===mt.UNISSUED&&(e.state=mt.ISSUED,e.deferred=Jo()),e.deferred.promise}function sg(e){return function(t){if(e.state===mt.CANCELLED)return;const n=e.deferred;--Le.numberOfActiveRequests,--li[e.serverKey],Ds.raiseEvent(),e.state=mt.RECEIVED,e.deferred=void 0,n.resolve(t)}}function ag(e){return function(t){e.state!==mt.CANCELLED&&(++Le.numberOfFailedRequests,--Le.numberOfActiveRequests,--li[e.serverKey],Ds.raiseEvent(t),e.state=mt.FAILED,e.deferred.reject(t))}}function Zh(e){const t=$h(e);return e.state=mt.ACTIVE,qn.push(e),++Le.numberOfActiveRequests,++Le.numberOfActiveRequestsEver,++li[e.serverKey],e.requestFunction().then(sg(e)).catch(ag(e)),t}function Zi(e){const t=e.state===mt.ACTIVE;if(e.state=mt.CANCELLED,++Le.numberOfCancelledRequests,h(e.deferred)){const n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Le.numberOfActiveRequests,--li[e.serverKey],++Le.numberOfCancelledActiveRequests),h(e.cancelFunction)&&e.cancelFunction()}Xe.update=function(){let e,t,n=0;const i=qn.length;for(e=0;e<i;++e){if(t=qn[e],t.cancelled&&Zi(t),t.state!==mt.ACTIVE){++n;continue}n>0&&(qn[e-n]=t)}qn.length-=n;const o=Ht.internalArray,s=Ht.length;for(e=0;e<s;++e)Xh(o[e]);Ht.resort();const a=Math.max(Xe.maximumRequests-qn.length,0);let c=0;for(;c<a&&Ht.length>0;){if(t=Ht.pop(),t.cancelled){Zi(t);continue}if(t.throttleByServer&&!Xe.serverHasOpenSlots(t.serverKey)){Zi(t);continue}Zh(t),++c}cg()},Xe.getServerKey=function(e){m.typeOf.string("url",e);let t=new ci(e);t.scheme()===""&&(t=t.absoluteTo(rg),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);const i=li[n];return h(i)||(li[n]=0),n},Xe.request=function(e){if(m.typeOf.object("request",e),m.typeOf.string("request.url",e.url),m.typeOf.func("request.requestFunction",e.requestFunction),Yh(e.url)||jh(e.url))return Ds.raiseEvent(),e.state=mt.RECEIVED,e.requestFunction();if(++Le.numberOfAttemptedRequests,h(e.serverKey)||(e.serverKey=Xe.getServerKey(e.url)),Xe.throttleRequests&&e.throttleByServer&&!Xe.serverHasOpenSlots(e.serverKey))return;if(!Xe.throttleRequests||!e.throttle)return Zh(e);if(qn.length>=Xe.maximumRequests)return;Xh(e);const t=Ht.insert(e);if(h(t)){if(t===e)return;Zi(t)}return $h(e)};function cg(){Xe.debugShowStatistics&&(Le.numberOfActiveRequests===0&&Le.lastNumberOfActiveRequests>0&&(Le.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Le.numberOfAttemptedRequests}`),Le.numberOfAttemptedRequests=0),Le.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Le.numberOfCancelledRequests}`),Le.numberOfCancelledRequests=0),Le.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Le.numberOfCancelledActiveRequests}`),Le.numberOfCancelledActiveRequests=0),Le.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Le.numberOfFailedRequests}`),Le.numberOfFailedRequests=0)),Le.lastNumberOfActiveRequests=Le.numberOfActiveRequests)}Xe.clearForSpecs=function(){for(;Ht.length>0;){const t=Ht.pop();Zi(t)}const e=qn.length;for(let t=0;t<e;++t)Zi(qn[t]);qn.length=0,li={},Le.numberOfAttemptedRequests=0,Le.numberOfActiveRequests=0,Le.numberOfCancelledRequests=0,Le.numberOfCancelledActiveRequests=0,Le.numberOfFailedRequests=0,Le.numberOfActiveRequestsEver=0,Le.lastNumberOfActiveRequests=0},Xe.numberOfActiveRequestsByServer=function(e){return li[e]},Xe.requestHeap=Ht;const wo={};let To={};wo.add=function(e,t){if(!h(e))throw new C("host is required.");if(!h(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;h(To[n])||(To[n]=!0)},wo.remove=function(e,t){if(!h(e))throw new C("host is required.");if(!h(t)||t<=0)throw new C("port is required to be greater than 0.");const n=`${e.toLowerCase()}:${t}`;h(To[n])&&delete To[n]};function lg(e){const t=new ci(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}wo.contains=function(e){if(!h(e))throw new C("url is required.");const t=lg(e);return!!(h(t)&&h(To[t]))},wo.clear=function(){To={}};const Kh=function(){try{const e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function ne(e){e=_(e,_.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),m.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Hn(e.templateValues,{}),this._queryParameters=Hn(e.queryParameters,{}),this.headers=Hn(e.headers,{}),this.request=_(e.request,new As),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=_(e.retryAttempts,0),this._retryCount=0,_(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Hn(e,t){return h(e)?tn(e):t}ne.createIfNeeded=function(e){return e instanceof ne?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new ne({url:e})};let So;ne.supportsImageBitmapOptions=function(){return h(So)?So:typeof createImageBitmap!="function"?(So=Promise.resolve(!1),So):(So=ne.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){const n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){const n=Wh(t[0]),i=Wh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),So)},Object.defineProperties(ne,{isBlobSupported:{get:function(){return Kh}}}),Object.defineProperties(ne.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return $_(this._url)}},isDataUri:{get:function(){return Yh(this._url)}},isBlobUri:{get:function(){return jh(this._url)}},isCrossOriginUrl:{get:function(){return nc(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),ne.prototype.toString=function(){return this.getUrlComponent(!0,!0)},ne.prototype.parseUrl=function(e,t,n,i){let o=new ci(e);const s=hg(o.query());this._queryParameters=t?Os(s,this.queryParameters,n):s,o.search(""),o.fragment(""),h(i)&&o.scheme()===""&&(o=o.absoluteTo(er(i))),this._url=o.toString()};function hg(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:eg(e)}function Os(e,t,n){if(!n)return nn(e,t);const i=tn(e,!0);for(const o in t)if(t.hasOwnProperty(o)){let s=i[o];const a=t[o];h(s)?(Array.isArray(s)||(s=i[o]=[s]),i[o]=s.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}ne.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${fg(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");const i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,s){const a=i[s];return h(a)?encodeURIComponent(a):o})),t&&h(this.proxy)&&(n=this.proxy.getURL(n)),n};function fg(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!h(e[t[0]])?`?${t[0]}`:`?${J_(e)}`}ne.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Os(this._queryParameters,e,!1):this._queryParameters=Os(e,this._queryParameters,!1)},ne.prototype.appendQueryParameters=function(e){this._queryParameters=Os(e,this._queryParameters,!0)},ne.prototype.setTemplateValues=function(e,t){t?this._templateValues=nn(this._templateValues,e):this._templateValues=nn(e,this._templateValues)},ne.prototype.getDerivedResource=function(e){const t=this.clone();if(t._retryCount=0,h(e.url)){const n=_(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return h(e.queryParameters)&&(t._queryParameters=nn(e.queryParameters,t.queryParameters)),h(e.templateValues)&&(t._templateValues=nn(e.templateValues,t.templateValues)),h(e.headers)&&(t.headers=nn(e.headers,t.headers)),h(e.proxy)&&(t.proxy=e.proxy),h(e.request)&&(t.request=e.request),h(e.retryCallback)&&(t.retryCallback=e.retryCallback),h(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},ne.prototype.retryOnError=function(e){const t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})},ne.prototype.clone=function(e){return h(e)?(e._url=this._url,e._queryParameters=tn(this._queryParameters),e._templateValues=tn(this._templateValues),e.headers=tn(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new ne({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:h(this.credits)?this.credits.slice():void 0})},ne.prototype.getBaseUri=function(e){return X_(this.getUrlComponent(e),e)},ne.prototype.appendForwardSlash=function(){this._url=Y_(this._url)},ne.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},ne.fetchArrayBuffer=function(e){return new ne(e).fetchArrayBuffer()},ne.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},ne.fetchBlob=function(e){return new ne(e).fetchBlob()},ne.prototype.fetchImage=function(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.preferImageBitmap,!1),n=_(e.preferBlob,!1),i=_(e.flipY,!1),o=_(e.skipColorSpaceConversion,!1);if(rc(this.request),!Kh||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return oc({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});const s=this.fetchBlob();if(!h(s))return;let a,c,l,u;return ne.supportsImageBitmapOptions().then(function(d){return a=d,c=a&&t,s}).then(function(d){if(!h(d))return;if(u=d,c)return ne.createImageBitmapFromBlob(d,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return l=new ne({url:p}),oc({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(h(d))return d.blob=u,c||window.URL.revokeObjectURL(l.url),d}).catch(function(d){return h(l)&&window.URL.revokeObjectURL(l.url),d.blob=u,Promise.reject(d)})};function oc(e){const t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let c=!1;!t.isDataUri&&!t.isBlobUri&&(c=t.isCrossOriginUrl);const l=Jo();return ne._Implementations.createImage(s,c,l,n,i,o),l.promise};const a=Xe.request(s);if(h(a))return a.catch(function(c){return s.state!==mt.FAILED?Promise.reject(c):t.retryOnError(c).then(function(l){return l?(s.state=mt.UNISSUED,s.deferred=void 0,oc({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(c)})})}ne.fetchImage=function(e){return new ne(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},ne.prototype.fetchText=function(){return this.fetch({responseType:"text"})},ne.fetchText=function(e){return new ne(e).fetchText()},ne.prototype.fetchJson=function(){const e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(h(e))return e.then(function(t){if(h(t))return JSON.parse(t)})},ne.fetchJson=function(e){return new ne(e).fetchJson()},ne.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},ne.fetchXML=function(e){return new ne(e).fetchXML()},ne.prototype.fetchJsonp=function(e){e=_(e,"callback"),rc(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(h(window[t]));return Qh(this,e,t)};function Qh(e,t,n){const i={};i[t]=n,e.setQueryParameters(i);const o=e.request,s=e.url;o.url=s,o.requestFunction=function(){const c=Jo();return window[n]=function(l){c.resolve(l);try{delete window[n]}catch{window[n]=void 0}},ne._Implementations.loadAndExecuteScript(s,n,c),c.promise};const a=Xe.request(o);if(h(a))return a.catch(function(c){return o.state!==mt.FAILED?Promise.reject(c):e.retryOnError(c).then(function(l){return l?(o.state=mt.UNISSUED,o.deferred=void 0,Qh(e,t,n)):Promise.reject(c)})})}ne.fetchJsonp=function(e){return new ne(e).fetchJsonp(e.callbackParameterName)},ne.prototype._makeRequest=function(e){const t=this;rc(t.request);const n=t.request,i=t.url;n.url=i,n.requestFunction=function(){const s=e.responseType,a=nn(e.headers,t.headers),c=e.overrideMimeType,l=e.method,u=e.data,d=Jo(),p=ne._Implementations.loadWithXhr(i,s,l,u,a,d,c);return h(p)&&h(p.abort)&&(n.cancelFunction=function(){p.abort()}),d.promise};const o=Xe.request(n);if(h(o))return o.then(function(s){return n.cancelFunction=void 0,s}).catch(function(s){return n.cancelFunction=void 0,n.state!==mt.FAILED?Promise.reject(s):t.retryOnError(s).then(function(a){return a?(n.state=mt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})};function rc(e){if(e.state===mt.ISSUED||e.state===mt.ACTIVE)throw new at("The Resource is already being fetched.");e.state=mt.UNISSUED,e.deferred=void 0}const ug=/^data:(.*?)(;base64)?,(.*)$/;function vs(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Jh(e,t){const n=vs(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let s=0;s<n.length;s++)o[s]=n.charCodeAt(s);return i}function dg(e,t){t=_(t,"");const n=e[1],i=!!e[2],o=e[3];let s,a;switch(t){case"":case"text":return vs(i,o);case"arraybuffer":return Jh(i,o);case"blob":return s=Jh(i,o),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(vs(i,o),n);case"json":return JSON.parse(vs(i,o));default:throw new C(`Unhandled responseType: ${t}`)}}ne.prototype.fetch=function(e){return e=Hn(e,{}),e.method="GET",this._makeRequest(e)},ne.fetch=function(e){return new ne(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.delete=function(e){return e=Hn(e,{}),e.method="DELETE",this._makeRequest(e)},ne.delete=function(e){return new ne(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},ne.prototype.head=function(e){return e=Hn(e,{}),e.method="HEAD",this._makeRequest(e)},ne.head=function(e){return new ne(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.options=function(e){return e=Hn(e,{}),e.method="OPTIONS",this._makeRequest(e)},ne.options=function(e){return new ne(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.post=function(e,t){return m.defined("data",e),t=Hn(t,{}),t.method="POST",t.data=e,this._makeRequest(t)},ne.post=function(e){return new ne(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.put=function(e,t){return m.defined("data",e),t=Hn(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)},ne.put=function(e){return new ne(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne.prototype.patch=function(e,t){return m.defined("data",e),t=Hn(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)},ne.patch=function(e){return new ne(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},ne._Implementations={},ne._Implementations.loadImageElement=function(e,t,n){const i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(wo.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},ne._Implementations.createImage=function(e,t,n,i,o,s){const a=e.url;ne.supportsImageBitmapOptions().then(function(c){if(!(c&&s)){ne._Implementations.loadImageElement(a,t,n);return}const l="blob",u="GET",d=Jo(),p=ne._Implementations.loadWithXhr(a,l,u,void 0,void 0,d,void 0,void 0,void 0);return h(p)&&h(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!h(g)){n.reject(new at(`Successfully retrieved ${a} but it contained no content.`));return}return ne.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})},ne.createImageBitmapFromBlob=function(e,t){return m.defined("options",t),m.typeOf.bool("options.flipY",t.flipY),m.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),m.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function pg(e,t,n,i,o,s,a){fetch(e,{method:n,headers:o}).then(async c=>{if(!c.ok){const l={};c.headers.forEach((u,d)=>{l[d]=u}),s.reject(new tr(c.status,c,l));return}switch(t){case"text":s.resolve(c.text());break;case"json":s.resolve(c.json());break;default:s.resolve(new Uint8Array(await c.arrayBuffer()).buffer);break}}).catch(()=>{s.reject(new tr)})}const mg=typeof XMLHttpRequest>"u";ne._Implementations.loadWithXhr=function(e,t,n,i,o,s,a){const c=ug.exec(e);if(c!==null){s.resolve(dg(c,t));return}if(mg){pg(e,t,n,i,o,s);return}const l=new XMLHttpRequest;if(wo.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),h(a)&&h(l.overrideMimeType)&&l.overrideMimeType(a),h(o))for(const d in o)o.hasOwnProperty(d)&&l.setRequestHeader(d,o[d]);h(t)&&(l.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){s.reject(new tr(l.status,l.response,l.getAllResponseHeaders()));return}const d=l.response,p=l.responseType;if(n==="HEAD"||n==="OPTIONS"){const y=l.getAllResponseHeaders().trim().split(/[\r\n]+/),x={};y.forEach(function(E){const b=E.split(": "),D=b.shift();x[D]=b.join(": ")}),s.resolve(x);return}if(l.status===204)s.resolve(void 0);else if(h(d)&&(!h(t)||p===t))s.resolve(d);else if(t==="json"&&typeof d=="string")try{s.resolve(JSON.parse(d))}catch(g){s.reject(g)}else(p===""||p==="document")&&h(l.responseXML)&&l.responseXML.hasChildNodes()?s.resolve(l.responseXML):(p===""||p==="text")&&h(l.responseText)?s.resolve(l.responseText):s.reject(new at("Invalid XMLHttpRequest response type."))},l.onerror=function(d){s.reject(new tr)},l.send(i),l},ne._Implementations.loadAndExecuteScript=function(e,t,n){return Q_(e).catch(function(i){n.reject(i)})},ne._DefaultImplementations={},ne._DefaultImplementations.createImage=ne._Implementations.createImage,ne._DefaultImplementations.loadWithXhr=ne._Implementations.loadWithXhr,ne._DefaultImplementations.loadAndExecuteScript=ne._Implementations.loadAndExecuteScript,ne.DEFAULT=Object.freeze(new ne({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function nr(e){e=_(e,_.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._addNewLeapSeconds=_(e.addNewLeapSeconds,!0),h(e.data)?ef(this,e.data):ef(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}nr.fromUrl=async function(e,t){m.defined("url",e),t=_(t,_.EMPTY_OBJECT);const n=ne.createIfNeeded(e);let i;try{i=await n.fetchJson()}catch{throw new at(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new nr({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},nr.NONE=Object.freeze({compute:function(e,t){return h(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Xa(0,0,0,0,0),t}}),nr.prototype.compute=function(e,t){if(!h(this._samples))return;if(h(t)||(t=new Xa(0,0,0,0,0)),this._samples.length===0)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 o=0,s=0;if(h(i)){const c=n[i],l=n[i+1],u=$.lessThanOrEquals(c,e),d=!h(l),p=d||$.greaterThanOrEquals(l,e);if(u&&p)return o=i,!d&&l.equals(e)&&++o,s=o+1,nf(this,n,this._samples,e,o,s,t),t}let a=Ko(n,e,$.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,o=a,s=a):(s=~a,o=s-1,o<0&&(o=0)),this._lastIndex=o,nf(this,n,this._samples,e,o,s,t),t};function _g(e,t){return $.compare(e.julianDate,t)}function ef(e,t){if(!h(t.columnNames))throw new at("Error in loaded EOP data: The columnNames property is required.");if(!h(t.samples))throw new at("Error in loaded EOP data: The samples property is required.");const n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||s<0||a<0||c<0||l<0)throw new at("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,d=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=c,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let p;const g=e._addNewLeapSeconds;for(let y=0,x=u.length;y<x;y+=e._columnCount){const E=u[y+n],b=u[y+l],D=E+nt.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new $(D,b,ve.TAI);if(d.push(A),g){if(b!==p&&h(p)){const O=$.leapSeconds,I=Ko(O,A,_g);if(I<0){const B=new Ge(A,b);O.splice(~I,0,B)}}p=b}}}function tf(e,t,n,i,o){const s=n*i;o.xPoleWander=t[s+e._xPoleWanderRadiansColumn],o.yPoleWander=t[s+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[s+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[s+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[s+e._ut1MinusUtcSecondsColumn]}function ir(e,t,n){return t+e*(n-t)}function nf(e,t,n,i,o,s,a){const c=e._columnCount;if(s>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;const l=t[o],u=t[s];if(l.equals(u)||i.equals(l))return tf(e,n,o,c,a),a;if(i.equals(u))return tf(e,n,s,c,a),a;const d=$.secondsDifference(i,l)/$.secondsDifference(u,l),p=o*c,g=s*c;let y=n[p+e._ut1MinusUtcSecondsColumn],x=n[g+e._ut1MinusUtcSecondsColumn];const E=x-y;if(E>.5||E<-.5){const b=n[p+e._taiMinusUtcSecondsColumn],D=n[g+e._taiMinusUtcSecondsColumn];b!==D&&(u.equals(i)?y=x:x-=D-b)}return a.xPoleWander=ir(d,n[p+e._xPoleWanderRadiansColumn],n[g+e._xPoleWanderRadiansColumn]),a.yPoleWander=ir(d,n[p+e._yPoleWanderRadiansColumn],n[g+e._yPoleWanderRadiansColumn]),a.xPoleOffset=ir(d,n[p+e._xCelestialPoleOffsetRadiansColumn],n[g+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=ir(d,n[p+e._yCelestialPoleOffsetRadiansColumn],n[g+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=ir(d,y,x),a}function lt(e,t,n){this.heading=_(e,0),this.pitch=_(t,0),this.roll=_(n,0)}lt.fromQuaternion=function(e,t){if(!h(e))throw new C("quaternion is required");h(t)||(t=new lt);const n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),s=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,s),t.roll=Math.atan2(o,i),t.pitch=-S.asinClamped(n),t},lt.fromDegrees=function(e,t,n,i){if(!h(e))throw new C("heading is required");if(!h(t))throw new C("pitch is required");if(!h(n))throw new C("roll is required");return h(i)||(i=new lt),i.heading=e*S.RADIANS_PER_DEGREE,i.pitch=t*S.RADIANS_PER_DEGREE,i.roll=n*S.RADIANS_PER_DEGREE,i},lt.clone=function(e,t){if(h(e))return h(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new lt(e.heading,e.pitch,e.roll)},lt.equals=function(e,t){return e===t||h(e)&&h(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},lt.equalsEpsilon=function(e,t,n,i){return e===t||h(e)&&h(t)&&S.equalsEpsilon(e.heading,t.heading,n,i)&&S.equalsEpsilon(e.pitch,t.pitch,n,i)&&S.equalsEpsilon(e.roll,t.roll,n,i)},lt.prototype.clone=function(e){return lt.clone(this,e)},lt.prototype.equals=function(e){return lt.equals(this,e)},lt.prototype.equalsEpsilon=function(e,t,n){return lt.equalsEpsilon(this,e,t,n)},lt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const of=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function gg(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const i=e[t].getAttribute("src"),o=of.exec(i);if(o!==null)return o[1]}}let Is;function rf(e){return typeof document>"u"?e:(h(Is)||(Is=document.createElement("a")),Is.href=e,Is.href)}let Ki;function sf(){if(h(Ki))return Ki;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:h(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Rt&&Rt.tagName.toUpperCase()==="SCRIPT"&&Rt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href)?e=er(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Rt&&Rt.tagName.toUpperCase()==="SCRIPT"&&Rt.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href):typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?e=er("..",hn("Core/buildModuleUrl.js")):e=gg(),!h(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Ki=new ne({url:rf(e)}),Ki.appendForwardSlash(),Ki}function yg(e){return rf(require.toUrl(`../${e}`))}function af(e){return sf().getDerivedResource({url:e}).url}let Rs;function hn(e){return h(Rs)||(typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?Rs=yg:Rs=af),Rs(e)}hn._cesiumScriptRegex=of,hn._buildModuleUrlFromBaseUrl=af,hn._clearBaseResource=function(){Ki=void 0},hn.setBaseUrl=function(e){Ki=ne.DEFAULT.getDerivedResource({url:e})},hn.getCesiumBaseUrl=sf;function cf(e,t,n){this.x=e,this.y=t,this.s=n}function sc(e){e=_(e,_.EMPTY_OBJECT),this._xysFileUrlTemplate=ne.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=_(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=_(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new $(this._sampleZeroJulianEphemerisDate,0,ve.TAI),this._stepSizeDays=_(e.stepSizeDays,1),this._samplesPerXysFile=_(e.samplesPerXysFile,1e3),this._totalSamples=_(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let s=0;s<=t;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(let a=0;a<=t;++a)a!==s&&(n[s]*=s-a);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}const xg=new $(0,0,ve.TAI);function ac(e,t,n){const i=xg;return i.dayNumber=t,i.secondsOfDay=n,$.daysDifference(i,e._sampleZeroDateTT)}sc.prototype.preload=function(e,t,n,i){const o=ac(this,e,t),s=ac(this,n,i);let a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let c=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;c>=this._totalSamples&&(c=this._totalSamples-1);const l=a/this._samplesPerXysFile|0,u=c/this._samplesPerXysFile|0,d=[];for(let p=l;p<=u;++p)d.push(cc(this,p));return Promise.all(d)},sc.prototype.computeXysRadians=function(e,t,n){const i=ac(this,e,t);if(i<0)return;const o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;const s=this._interpolationOrder;let a=o-(s/2|0);a<0&&(a=0);let c=a+s;c>=this._totalSamples&&(c=this._totalSamples-1,a=c-s,a<0&&(a=0));let l=!1;const u=this._samples;if(h(u[a*3])||(cc(this,a/this._samplesPerXysFile|0),l=!0),h(u[c*3])||(cc(this,c/this._samplesPerXysFile|0),l=!0),l)return;h(n)?(n.x=0,n.y=0,n.s=0):n=new cf(0,0,0);const d=i-a*this._stepSizeDays,p=this._work,g=this._denominators,y=this._coef,x=this._xTable;let E,b;for(E=0;E<=s;++E)p[E]=d-x[E];for(E=0;E<=s;++E){for(y[E]=1,b=0;b<=s;++b)b!==E&&(y[E]*=p[b]);y[E]*=g[E];let D=(a+E)*3;n.x+=y[E]*u[D++],n.y+=y[E]*u[D++],n.s+=y[E]*u[D]}return n};function cc(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n;const i=e._xysFileUrlTemplate;h(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new ne({url:hn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});const o=n.fetchJson().then(function(s){e._chunkDownloadsInProgress[t]=!1;const a=e._samples,c=s.samples,l=t*e._samplesPerXysFile*3;for(let u=0,d=c.length;u<d;++u)a[l+u]=c[u]});return e._chunkDownloadsInProgress[t]=o,o}function J(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.z=_(n,0),this.w=_(i,0)}let or=new f;J.fromAxisAngle=function(e,t,n){m.typeOf.object("axis",e),m.typeOf.number("angle",t);const i=t/2,o=Math.sin(i);or=f.normalize(e,or);const s=or.x*o,a=or.y*o,c=or.z*o,l=Math.cos(i);return h(n)?(n.x=s,n.y=a,n.z=c,n.w=l,n):new J(s,a,c,l)};const Cg=[1,2,0],Eg=new Array(3);J.fromRotationMatrix=function(e,t){m.typeOf.object("matrix",e);let n,i,o,s,a;const c=e[L.COLUMN0ROW0],l=e[L.COLUMN1ROW1],u=e[L.COLUMN2ROW2],d=c+l+u;if(d>0)n=Math.sqrt(d+1),a=.5*n,n=.5/n,i=(e[L.COLUMN1ROW2]-e[L.COLUMN2ROW1])*n,o=(e[L.COLUMN2ROW0]-e[L.COLUMN0ROW2])*n,s=(e[L.COLUMN0ROW1]-e[L.COLUMN1ROW0])*n;else{const p=Cg;let g=0;l>c&&(g=1),u>c&&u>l&&(g=2);const y=p[g],x=p[y];n=Math.sqrt(e[L.getElementIndex(g,g)]-e[L.getElementIndex(y,y)]-e[L.getElementIndex(x,x)]+1);const E=Eg;E[g]=.5*n,n=.5/n,a=(e[L.getElementIndex(x,y)]-e[L.getElementIndex(y,x)])*n,E[y]=(e[L.getElementIndex(y,g)]+e[L.getElementIndex(g,y)])*n,E[x]=(e[L.getElementIndex(x,g)]+e[L.getElementIndex(g,x)])*n,i=-E[0],o=-E[1],s=-E[2]}return h(t)?(t.x=i,t.y=o,t.z=s,t.w=a,t):new J(i,o,s,a)};const lf=new J;let hf=new J,lc=new J,ff=new J;J.fromHeadingPitchRoll=function(e,t){return m.typeOf.object("headingPitchRoll",e),ff=J.fromAxisAngle(f.UNIT_X,e.roll,lf),lc=J.fromAxisAngle(f.UNIT_Y,-e.pitch,t),t=J.multiply(lc,ff,lc),hf=J.fromAxisAngle(f.UNIT_Z,-e.heading,lf),J.multiply(hf,t,t)};const zs=new f,hc=new f,Dn=new J,uf=new J,Ps=new J;J.packedLength=4,J.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},J.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new J),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},J.packedInterpolationLength=3,J.convertPackedArrayForInterpolation=function(e,t,n,i){J.unpack(e,n*4,Ps),J.conjugate(Ps,Ps);for(let o=0,s=n-t+1;o<s;o++){const a=o*3;J.unpack(e,(t+o)*4,Dn),J.multiply(Dn,Ps,Dn),Dn.w<0&&J.negate(Dn,Dn),J.computeAxis(Dn,zs);const c=J.computeAngle(Dn);h(i)||(i=[]),i[a]=zs.x*c,i[a+1]=zs.y*c,i[a+2]=zs.z*c}},J.unpackInterpolationResult=function(e,t,n,i,o){h(o)||(o=new J),f.fromArray(e,0,hc);const s=f.magnitude(hc);return J.unpack(t,i*4,uf),s===0?J.clone(J.IDENTITY,Dn):J.fromAxisAngle(hc,s,Dn),J.multiply(Dn,uf,o)},J.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new J(e.x,e.y,e.z,e.w)},J.conjugate=function(e,t){return m.typeOf.object("quaternion",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},J.magnitudeSquared=function(e){return m.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},J.magnitude=function(e){return Math.sqrt(J.magnitudeSquared(e))},J.normalize=function(e,t){m.typeOf.object("result",t);const n=1/J.magnitude(e),i=e.x*n,o=e.y*n,s=e.z*n,a=e.w*n;return t.x=i,t.y=o,t.z=s,t.w=a,t},J.inverse=function(e,t){m.typeOf.object("result",t);const n=J.magnitudeSquared(e);return t=J.conjugate(e,t),J.multiplyByScalar(t,1/n,t)},J.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},J.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},J.negate=function(e,t){return m.typeOf.object("quaternion",e),m.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},J.dot=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},J.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e.x,o=e.y,s=e.z,a=e.w,c=t.x,l=t.y,u=t.z,d=t.w,p=a*c+i*d+o*u-s*l,g=a*l-i*u+o*d+s*c,y=a*u+i*l-o*c+s*d,x=a*d-i*c-o*l-s*u;return n.x=p,n.y=g,n.z=y,n.w=x,n},J.multiplyByScalar=function(e,t,n){return m.typeOf.object("quaternion",e),m.typeOf.number("scalar",t),m.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},J.divideByScalar=function(e,t,n){return m.typeOf.object("quaternion",e),m.typeOf.number("scalar",t),m.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},J.computeAxis=function(e,t){m.typeOf.object("quaternion",e),m.typeOf.object("result",t);const n=e.w;if(Math.abs(n-1)<S.EPSILON6||Math.abs(n+1)<S.EPSILON6)return t.x=1,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},J.computeAngle=function(e){return m.typeOf.object("quaternion",e),Math.abs(e.w-1)<S.EPSILON6?0:2*Math.acos(e.w)};let fc=new J;J.lerp=function(e,t,n,i){return m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i),fc=J.multiplyByScalar(t,n,fc),i=J.multiplyByScalar(e,1-n,i),J.add(fc,i,i)};let df=new J,uc=new J,dc=new J;J.slerp=function(e,t,n,i){m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i);let o=J.dot(e,t),s=t;if(o<0&&(o=-o,s=df=J.negate(t,df)),1-o<S.EPSILON6)return J.lerp(e,s,n,i);const a=Math.acos(o);return uc=J.multiplyByScalar(e,Math.sin((1-n)*a),uc),dc=J.multiplyByScalar(s,Math.sin(n*a),dc),i=J.add(uc,dc,i),J.multiplyByScalar(i,1/Math.sin(a),i)},J.log=function(e,t){m.typeOf.object("quaternion",e),m.typeOf.object("result",t);const n=S.acosClamped(e.w);let i=0;return n!==0&&(i=n/Math.sin(n)),f.multiplyByScalar(e,i,t)},J.exp=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.magnitude(e);let i=0;return n!==0&&(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 bg=new f,wg=new f,rr=new J,Ao=new J;J.computeInnerQuadrangle=function(e,t,n,i){m.typeOf.object("q0",e),m.typeOf.object("q1",t),m.typeOf.object("q2",n),m.typeOf.object("result",i);const o=J.conjugate(t,rr);J.multiply(o,n,Ao);const s=J.log(Ao,bg);J.multiply(o,e,Ao);const a=J.log(Ao,wg);return f.add(s,a,s),f.multiplyByScalar(s,.25,s),f.negate(s,s),J.exp(s,rr),J.multiply(t,rr,i)},J.squad=function(e,t,n,i,o,s){m.typeOf.object("q0",e),m.typeOf.object("q1",t),m.typeOf.object("s0",n),m.typeOf.object("s1",i),m.typeOf.number("t",o),m.typeOf.object("result",s);const a=J.slerp(e,t,o,rr),c=J.slerp(n,i,o,Ao);return J.slerp(a,c,2*o*(1-o),s)};const Tg=new J,pf=1.9011074535173003,Bs=_t.supportsTypedArrays()?new Float32Array(8):[],Ns=_t.supportsTypedArrays()?new Float32Array(8):[],hi=_t.supportsTypedArrays()?new Float32Array(8):[],fi=_t.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Bs[e]=1/(t*n),Ns[e]=t/n}Bs[7]=pf/(8*17),Ns[7]=pf*8/17,J.fastSlerp=function(e,t,n,i){m.typeOf.object("start",e),m.typeOf.object("end",t),m.typeOf.number("t",n),m.typeOf.object("result",i);let o=J.dot(e,t),s;o>=0?s=1:(s=-1,o=-o);const a=o-1,c=1-n,l=n*n,u=c*c;for(let y=7;y>=0;--y)hi[y]=(Bs[y]*l-Ns[y])*a,fi[y]=(Bs[y]*u-Ns[y])*a;const d=s*n*(1+hi[0]*(1+hi[1]*(1+hi[2]*(1+hi[3]*(1+hi[4]*(1+hi[5]*(1+hi[6]*(1+hi[7])))))))),p=c*(1+fi[0]*(1+fi[1]*(1+fi[2]*(1+fi[3]*(1+fi[4]*(1+fi[5]*(1+fi[6]*(1+fi[7])))))))),g=J.multiplyByScalar(e,p,Tg);return J.multiplyByScalar(t,d,i),J.add(g,i,i)},J.fastSquad=function(e,t,n,i,o,s){m.typeOf.object("q0",e),m.typeOf.object("q1",t),m.typeOf.object("s0",n),m.typeOf.object("s1",i),m.typeOf.number("t",o),m.typeOf.object("result",s);const a=J.fastSlerp(e,t,o,rr),c=J.fastSlerp(n,i,o,Ao);return J.fastSlerp(a,c,2*o*(1-o),s)},J.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},J.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},J.ZERO=Object.freeze(new J(0,0,0,0)),J.IDENTITY=Object.freeze(new J(0,0,0,1)),J.prototype.clone=function(e){return J.clone(this,e)},J.prototype.equals=function(e){return J.equals(this,e)},J.prototype.equalsEpsilon=function(e,t){return J.equalsEpsilon(this,e,t)},J.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const _e={},pc={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"}},Do={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},mc={},on={east:new f,north:new f,up:new f,west:new f,south:new f,down:new f};let Ii=new f,Ri=new f,zi=new f;_e.localFrameToFixedFrameGenerator=function(e,t){if(!pc.hasOwnProperty(e)||!pc[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=pc[e][t];let i;const o=e+t;return h(mc[o])?i=mc[o]:(i=function(s,a,c){if(!h(s))throw new C("origin is required.");if(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))throw new C("origin has a NaN component");if(h(c)||(c=new N),f.equalsEpsilon(s,f.ZERO,S.EPSILON14))f.unpack(Do[e],0,Ii),f.unpack(Do[t],0,Ri),f.unpack(Do[n],0,zi);else if(S.equalsEpsilon(s.x,0,S.EPSILON14)&&S.equalsEpsilon(s.y,0,S.EPSILON14)){const l=S.sign(s.z);f.unpack(Do[e],0,Ii),e!=="east"&&e!=="west"&&f.multiplyByScalar(Ii,l,Ii),f.unpack(Do[t],0,Ri),t!=="east"&&t!=="west"&&f.multiplyByScalar(Ri,l,Ri),f.unpack(Do[n],0,zi),n!=="east"&&n!=="west"&&f.multiplyByScalar(zi,l,zi)}else{a=_(a,le.default),a.geodeticSurfaceNormal(s,on.up);const l=on.up,u=on.east;u.x=-s.y,u.y=s.x,u.z=0,f.normalize(u,on.east),f.cross(l,u,on.north),f.multiplyByScalar(on.up,-1,on.down),f.multiplyByScalar(on.east,-1,on.west),f.multiplyByScalar(on.north,-1,on.south),Ii=on[e],Ri=on[t],zi=on[n]}return c[0]=Ii.x,c[1]=Ii.y,c[2]=Ii.z,c[3]=0,c[4]=Ri.x,c[5]=Ri.y,c[6]=Ri.z,c[7]=0,c[8]=zi.x,c[9]=zi.y,c[10]=zi.z,c[11]=0,c[12]=s.x,c[13]=s.y,c[14]=s.z,c[15]=1,c},mc[o]=i),i},_e.eastNorthUpToFixedFrame=_e.localFrameToFixedFrameGenerator("east","north"),_e.northEastDownToFixedFrame=_e.localFrameToFixedFrameGenerator("north","east"),_e.northUpEastToFixedFrame=_e.localFrameToFixedFrameGenerator("north","up"),_e.northWestUpToFixedFrame=_e.localFrameToFixedFrameGenerator("north","west");const Sg=new J,Ag=new f(1,1,1),Dg=new N;_e.headingPitchRollToFixedFrame=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t),i=_(i,_e.eastNorthUpToFixedFrame);const s=J.fromHeadingPitchRoll(t,Sg),a=N.fromTranslationQuaternionRotationScale(f.ZERO,s,Ag,Dg);return o=i(e,n,o),N.multiply(o,a,o)};const Og=new N,vg=new L;_e.headingPitchRollQuaternion=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t);const s=_e.headingPitchRollToFixedFrame(e,t,n,i,Og),a=N.getMatrix3(s,vg);return J.fromRotationMatrix(a,o)};const Ig=new f(1,1,1),Rg=new f,mf=new N,zg=new N,Pg=new L,Bg=new J;_e.fixedFrameToHeadingPitchRoll=function(e,t,n,i){m.defined("transform",e),t=_(t,le.default),n=_(n,_e.eastNorthUpToFixedFrame),h(i)||(i=new lt);const o=N.getTranslation(e,Rg);if(f.equals(o,f.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let s=N.inverseTransformation(n(o,t,mf),mf),a=N.setScale(e,Ig,zg);a=N.setTranslation(a,f.ZERO,a),s=N.multiply(s,a,s);let c=J.fromRotationMatrix(N.getMatrix3(s,Pg),Bg);return c=J.normalize(c,c),lt.fromQuaternion(c,i)};const Ng=6*3600+41*60+50.54841,Fg=8640184812866e-6,Lg=.093104,Mg=-62e-7,Ug=11772758384668e-32,kg=72921158553e-15,Vg=S.TWO_PI/86400;let Fs=new $;_e.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=_e.computeIcrfToFixedMatrix(e,t);return h(n)||(n=_e.computeTemeToPseudoFixedMatrix(e,t)),n},_e.computeTemeToPseudoFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");Fs=$.addSeconds(e,-$.computeTaiMinusUtc(e),Fs);const n=Fs.dayNumber,i=Fs.secondsOfDay;let o;const s=n-2451545;i>=43200?o=(s+.5)/nt.DAYS_PER_JULIAN_CENTURY:o=(s-.5)/nt.DAYS_PER_JULIAN_CENTURY;const c=(Ng+o*(Fg+o*(Lg+o*Mg)))*Vg%S.TWO_PI,l=kg+Ug*(n-24515455e-1),u=(i+nt.SECONDS_PER_DAY*.5)%nt.SECONDS_PER_DAY,d=c+l*u,p=Math.cos(d),g=Math.sin(d);return h(t)?(t[0]=p,t[1]=-g,t[2]=0,t[3]=g,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new L(p,g,0,-g,p,0,0,0,1)},_e.iau2006XysData=new sc,_e.earthOrientationParameters=nr.NONE;const _c=32.184,Gg=2451545;_e.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+_c,i=e.stop.dayNumber,o=e.stop.secondsOfDay+_c;return _e.iau2006XysData.preload(t,n,i,o)},_e.computeIcrfToFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new L);const n=_e.computeFixedToIcrfMatrix(e,t);if(h(n))return L.transpose(n,t)};const qg=32.184,Hg=2451545,Ls=new lt,Wg=new L,jg=new $;_e.computeMoonFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");const n=$.addSeconds(e,qg,jg),i=$.totalDays(n)-Hg,o=S.toRadians(12.112)-S.toRadians(.052992)*i,s=S.toRadians(24.224)-S.toRadians(.105984)*i,a=S.toRadians(227.645)+S.toRadians(13.012)*i,c=S.toRadians(261.105)+S.toRadians(13.340716)*i,l=S.toRadians(358)+S.toRadians(.9856)*i;return Ls.pitch=S.toRadians(180)-S.toRadians(3.878)*Math.sin(o)-S.toRadians(.12)*Math.sin(s)+S.toRadians(.07)*Math.sin(a)-S.toRadians(.017)*Math.sin(c),Ls.roll=S.toRadians(66.53-90)+S.toRadians(1.543)*Math.cos(o)+S.toRadians(.24)*Math.cos(s)-S.toRadians(.028)*Math.cos(a)+S.toRadians(.007)*Math.cos(c),Ls.heading=S.toRadians(244.375-90)+S.toRadians(13.17635831)*i+S.toRadians(3.558)*Math.sin(o)+S.toRadians(.121)*Math.sin(s)-S.toRadians(.064)*Math.sin(a)+S.toRadians(.016)*Math.sin(c)+S.toRadians(.025)*Math.sin(l),L.fromHeadingPitchRoll(Ls,Wg)},_e.computeIcrfToMoonFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new L);const n=_e.computeMoonFixedToIcrfMatrix(e,t);if(h(n))return L.transpose(n,t)};const Yg=new cf(0,0,0),Xg=new Xa(0,0,0,0,0),gc=new L,yc=new L;_e.computeFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new L);const n=_e.earthOrientationParameters.compute(e,Xg);if(!h(n))return;const i=e.dayNumber,o=e.secondsOfDay+_c,s=_e.iau2006XysData.computeXysRadians(i,o,Yg);if(!h(s))return;const a=s.x+n.xPoleOffset,c=s.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-c*c)),u=gc;u[0]=1-l*a*a,u[3]=-l*a*c,u[6]=a,u[1]=-l*a*c,u[4]=1-l*c*c,u[7]=c,u[2]=-a,u[5]=-c,u[8]=1-l*(a*a+c*c);const d=L.fromRotationZ(-s.s,yc),p=L.multiply(u,d,gc),g=e.dayNumber,y=e.secondsOfDay-$.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=y/nt.SECONDS_PER_DAY;let b=.779057273264+E+.00273781191135448*(x+E);b=b%1*S.TWO_PI;const D=L.fromRotationZ(b,yc),A=L.multiply(p,D,gc),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),B=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander);let q=i-Gg+o/nt.SECONDS_PER_DAY;q/=36525;const P=-47e-6*q*S.RADIANS_PER_DEGREE/3600,V=Math.cos(P),k=Math.sin(P),H=yc;return H[0]=O*V,H[1]=O*k,H[2]=B,H[3]=-I*k+M*B*V,H[4]=I*V+M*B*k,H[5]=-M*O,H[6]=-M*k-I*B*V,H[7]=M*V-I*B*k,H[8]=I*O,L.multiply(A,H,t)};const $g=new Y;_e.pointToWindowCoordinates=function(e,t,n,i){return i=_e.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i},_e.pointToGLWindowCoordinates=function(e,t,n,i){if(!h(e))throw new C("modelViewProjectionMatrix is required.");if(!h(t))throw new C("viewportTransformation is required.");if(!h(n))throw new C("point is required.");h(i)||(i=new U);const o=$g;return N.multiplyByVector(e,Y.fromElements(n.x,n.y,n.z,1,o),o),Y.multiplyByScalar(o,1/o.w,o),N.multiplyByVector(t,o,o),U.fromCartesian4(o,i)};const Zg=new f,Kg=new f,Qg=new f;_e.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!h(e))throw new C("position is required.");if(!h(t))throw new C("velocity is required.");const o=_(n,le.default).geodeticSurfaceNormal(e,Zg);let s=f.cross(t,o,Kg);f.equalsEpsilon(s,f.ZERO,S.EPSILON6)&&(s=f.clone(f.UNIT_X,s));const a=f.cross(s,t,Qg);return f.normalize(a,a),f.cross(t,a,s),f.negate(s,s),f.normalize(s,s),h(i)||(i=new L),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=a.x,i[7]=a.y,i[8]=a.z,i};const _f=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),gf=new ee,xc=new f,Jg=new f,ey=new L,Cc=new N,yf=new N;_e.basisTo2D=function(e,t,n){if(!h(e))throw new C("projection is required.");if(!h(t))throw new C("matrix is required.");if(!h(n))throw new C("result is required.");const i=N.getTranslation(t,Jg),o=e.ellipsoid;let s;if(f.equals(i,f.ZERO))s=f.clone(f.ZERO,xc);else{const d=o.cartesianToCartographic(i,gf);s=e.project(d,xc),f.fromElements(s.z,s.x,s.y,s)}const a=_e.eastNorthUpToFixedFrame(i,o,Cc),c=N.inverseTransformation(a,yf),l=N.getMatrix3(t,ey),u=N.multiplyByMatrix3(c,l,n);return N.multiply(_f,u,n),N.setTranslation(n,s,n),n},_e.ellipsoidTo2DModelMatrix=function(e,t,n){if(!h(e))throw new C("projection is required.");if(!h(t))throw new C("center is required.");if(!h(n))throw new C("result is required.");const i=e.ellipsoid,o=_e.eastNorthUpToFixedFrame(t,i,Cc),s=N.inverseTransformation(o,yf),a=i.cartesianToCartographic(t,gf),c=e.project(a,xc);f.fromElements(c.z,c.x,c.y,c);const l=N.fromTranslation(c,Cc);return N.multiply(_f,s,n),N.multiply(l,n,n),n};const xf={};function sr(e,t){if(!h(e))throw new C("identifier is required.");h(xf[e])||(xf[e]=!0,console.warn(_(t,e)))}sr.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.",sr.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",sr.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",sr.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function ty(e,t){if(!h(e)||!h(t))throw new C("identifier and message are required.");sr(e,t)}function ce(e,t,n,i){this.west=_(e,0),this.south=_(t,0),this.east=_(n,0),this.north=_(i,0)}Object.defineProperties(ce.prototype,{width:{get:function(){return ce.computeWidth(this)}},height:{get:function(){return ce.computeHeight(this)}}}),ce.packedLength=4,ce.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},ce.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new ce),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},ce.computeWidth=function(e){m.typeOf.object("rectangle",e);let t=e.east;const n=e.west;return t<n&&(t+=S.TWO_PI),t-n},ce.computeHeight=function(e){return m.typeOf.object("rectangle",e),e.north-e.south},ce.fromDegrees=function(e,t,n,i,o){return e=S.toRadians(_(e,0)),t=S.toRadians(_(t,0)),n=S.toRadians(_(n,0)),i=S.toRadians(_(i,0)),h(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new ce(e,t,n,i)},ce.fromRadians=function(e,t,n,i,o){return h(o)?(o.west=_(e,0),o.south=_(t,0),o.east=_(n,0),o.north=_(i,0),o):new ce(e,t,n,i)},ce.fromCartographicArray=function(e,t){m.defined("cartographics",e);let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let l=0,u=e.length;l<u;l++){const d=e[l];n=Math.min(n,d.longitude),i=Math.max(i,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+S.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return i-n>s-o&&(n=o,i=s,i>S.PI&&(i=i-S.TWO_PI),n>S.PI&&(n=n-S.TWO_PI)),h(t)?(t.west=n,t.south=a,t.east=i,t.north=c,t):new ce(n,a,i,c)},ce.fromCartesianArray=function(e,t,n){m.defined("cartesians",e),t=_(t,le.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,d=e.length;u<d;u++){const p=t.cartesianToCartographic(e[u]);i=Math.min(i,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),l=Math.max(l,p.latitude);const g=p.longitude>=0?p.longitude:p.longitude+S.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-i>a-s&&(i=s,o=a,o>S.PI&&(o=o-S.TWO_PI),i>S.PI&&(i=i-S.TWO_PI)),h(n)?(n.west=i,n.south=c,n.east=o,n.north=l,n):new ce(i,c,o,l)};const ny=new f,iy=new f,oy=new f,ry=new f,sy=new f,Ec=new Array(5);for(let e=0;e<Ec.length;++e)Ec[e]=new f;ce.fromBoundingSphere=function(e,t,n){m.typeOf.object("boundingSphere",e);const i=e.center,o=e.radius;if(h(t)||(t=le.default),h(n)||(n=new ce),f.equals(i,f.ZERO))return ce.clone(ce.MAX_VALUE,n),n;const s=_e.eastNorthUpToFixedFrame(i,t,ny),a=N.multiplyByPointAsVector(s,f.UNIT_X,iy);f.normalize(a,a);const c=N.multiplyByPointAsVector(s,f.UNIT_Y,oy);f.normalize(c,c),f.multiplyByScalar(c,o,c),f.multiplyByScalar(a,o,a);const l=f.negate(c,sy),u=f.negate(a,ry),d=Ec;let p=d[0];return f.add(i,c,p),p=d[1],f.add(i,u,p),p=d[2],f.add(i,l,p),p=d[3],f.add(i,a,p),d[4]=i,ce.fromCartesianArray(d,t,n)},ce.clone=function(e,t){if(h(e))return h(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new ce(e.west,e.south,e.east,e.north)},ce.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},ce.prototype.clone=function(e){return ce.clone(this,e)},ce.prototype.equals=function(e){return ce.equals(this,e)},ce.equals=function(e,t){return e===t||h(e)&&h(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},ce.prototype.equalsEpsilon=function(e,t){return ce.equalsEpsilon(this,e,t)},ce.validate=function(e){return ty("Rectangle.validate","Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124."),ce._validate(e)},ce._validate=function(e){m.typeOf.object("rectangle",e);const t=e.north;m.typeOf.number.greaterThanOrEquals("north",t,-S.PI_OVER_TWO),m.typeOf.number.lessThanOrEquals("north",t,S.PI_OVER_TWO);const n=e.south;m.typeOf.number.greaterThanOrEquals("south",n,-S.PI_OVER_TWO),m.typeOf.number.lessThanOrEquals("south",n,S.PI_OVER_TWO);const i=e.west;m.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),m.typeOf.number.lessThanOrEquals("west",i,Math.PI);const o=e.east;m.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),m.typeOf.number.lessThanOrEquals("east",o,Math.PI)},ce.southwest=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new ee(e.west,e.south)},ce.northwest=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new ee(e.west,e.north)},ce.northeast=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new ee(e.east,e.north)},ce.southeast=function(e,t){return m.typeOf.object("rectangle",e),h(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new ee(e.east,e.south)},ce.center=function(e,t){m.typeOf.object("rectangle",e);let n=e.east;const i=e.west;n<i&&(n+=S.TWO_PI);const o=S.negativePiToPi((i+n)*.5),s=(e.south+e.north)*.5;return h(t)?(t.longitude=o,t.latitude=s,t.height=0,t):new ee(o,s)},ce.intersection=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,s=t.east,a=t.west;i<o&&s>0?i+=S.TWO_PI:s<a&&i>0&&(s+=S.TWO_PI),i<o&&a<0?a+=S.TWO_PI:s<a&&o<0&&(o+=S.TWO_PI);const c=S.negativePiToPi(Math.max(o,a)),l=S.negativePiToPi(Math.min(i,s));if((e.west<e.east||t.west<t.east)&&l<=c)return;const u=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(u>=d))return h(n)?(n.west=c,n.south=u,n.east=l,n.north=d,n):new ce(c,u,l,d)},ce.simpleIntersection=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("otherRectangle",t);const i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),s=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(o>=a||i>=s))return h(n)?(n.west=i,n.south=o,n.east=s,n.north=a,n):new ce(i,o,s,a)},ce.union=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("otherRectangle",t),h(n)||(n=new ce);let i=e.east,o=e.west,s=t.east,a=t.west;i<o&&s>0?i+=S.TWO_PI:s<a&&i>0&&(s+=S.TWO_PI),i<o&&a<0?a+=S.TWO_PI:s<a&&o<0&&(o+=S.TWO_PI);const c=S.negativePiToPi(Math.min(o,a)),l=S.negativePiToPi(Math.max(i,s));return n.west=c,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n},ce.expand=function(e,t,n){return m.typeOf.object("rectangle",e),m.typeOf.object("cartographic",t),h(n)||(n=new ce),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},ce.contains=function(e,t){m.typeOf.object("rectangle",e),m.typeOf.object("cartographic",t);let n=t.longitude;const i=t.latitude,o=e.west;let s=e.east;return s<o&&(s+=S.TWO_PI,n<0&&(n+=S.TWO_PI)),(n>o||S.equalsEpsilon(n,o,S.EPSILON14))&&(n<s||S.equalsEpsilon(n,s,S.EPSILON14))&&i>=e.south&&i<=e.north};const ay=new ee;ce.subsample=function(e,t,n,i){m.typeOf.object("rectangle",e),t=_(t,le.default),n=_(n,0),h(i)||(i=[]);let o=0;const s=e.north,a=e.south,c=e.east,l=e.west,u=ay;u.height=n,u.longitude=l,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,s<0?u.latitude=s:a>0?u.latitude=a:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*S.PI_OVER_TWO,ce.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i},ce.subsection=function(e,t,n,i,o,s){if(m.typeOf.object("rectangle",e),m.typeOf.number.greaterThanOrEquals("westLerp",t,0),m.typeOf.number.lessThanOrEquals("westLerp",t,1),m.typeOf.number.greaterThanOrEquals("southLerp",n,0),m.typeOf.number.lessThanOrEquals("southLerp",n,1),m.typeOf.number.greaterThanOrEquals("eastLerp",i,0),m.typeOf.number.lessThanOrEquals("eastLerp",i,1),m.typeOf.number.greaterThanOrEquals("northLerp",o,0),m.typeOf.number.lessThanOrEquals("northLerp",o,1),m.typeOf.number.lessThanOrEquals("westLerp",t,i),m.typeOf.number.lessThanOrEquals("southLerp",n,o),h(s)||(s=new ce),e.west<=e.east){const c=e.east-e.west;s.west=e.west+t*c,s.east=e.west+i*c}else{const c=S.TWO_PI+e.east-e.west;s.west=S.negativePiToPi(e.west+t*c),s.east=S.negativePiToPi(e.west+i*c)}const a=e.north-e.south;return s.south=e.south+n*a,s.north=e.south+o*a,t===1&&(s.west=e.east),i===1&&(s.east=e.east),n===1&&(s.south=e.north),o===1&&(s.north=e.north),s},ce.MAX_VALUE=Object.freeze(new ce(-Math.PI,-S.PI_OVER_TWO,Math.PI,S.PI_OVER_TWO));function Ce(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.width=_(n,0),this.height=_(i,0)}Ce.packedLength=4,Ce.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},Ce.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Ce),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},Ce.fromPoints=function(e,t){if(h(t)||(t=new Ce),!h(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;const n=e.length;let i=e[0].x,o=e[0].y,s=e[0].x,a=e[0].y;for(let c=1;c<n;c++){const l=e[c],u=l.x,d=l.y;i=Math.min(u,i),s=Math.max(u,s),o=Math.min(d,o),a=Math.max(d,a)}return t.x=i,t.y=o,t.width=s-i,t.height=a-o,t};const Cf=new Sn,cy=new ee,ly=new ee;Ce.fromRectangle=function(e,t,n){if(h(n)||(n=new Ce),!h(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;Cf._ellipsoid=le.default,t=_(t,Cf);const i=t.project(ce.southwest(e,cy)),o=t.project(ce.northeast(e,ly));return U.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n},Ce.clone=function(e,t){if(h(e))return h(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Ce(e.x,e.y,e.width,e.height)},Ce.union=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),h(n)||(n=new Ce);const i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),s=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=o,n.width=s-i,n.height=a-o,n},Ce.expand=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("point",t),n=Ce.clone(e,n);const i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n},Ce.intersect=function(e,t){m.typeOf.object("left",e),m.typeOf.object("right",t);const n=e.x,i=e.y,o=t.x,s=t.y;return n>o+t.width||n+e.width<o||i+e.height<s||i>s+t.height?Et.OUTSIDE:Et.INTERSECTING},Ce.equals=function(e,t){return e===t||h(e)&&h(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},Ce.prototype.clone=function(e){return Ce.clone(this,e)},Ce.prototype.intersect=function(e){return Ce.intersect(this,e)},Ce.prototype.equals=function(e){return Ce.equals(this,e)};const Lt={POINTS:R.POINTS,LINES:R.LINES,LINE_LOOP:R.LINE_LOOP,LINE_STRIP:R.LINE_STRIP,TRIANGLES:R.TRIANGLES,TRIANGLE_STRIP:R.TRIANGLE_STRIP,TRIANGLE_FAN:R.TRIANGLE_FAN};Lt.isLines=function(e){return e===Lt.LINES||e===Lt.LINE_LOOP||e===Lt.LINE_STRIP},Lt.isTriangles=function(e){return e===Lt.TRIANGLES||e===Lt.TRIANGLE_STRIP||e===Lt.TRIANGLE_FAN},Lt.validate=function(e){return e===Lt.POINTS||e===Lt.LINES||e===Lt.LINE_LOOP||e===Lt.LINE_STRIP||e===Lt.TRIANGLES||e===Lt.TRIANGLE_STRIP||e===Lt.TRIANGLE_FAN};const qe=Object.freeze(Lt),it={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function $e(e){e=_(e,_.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=_(e.primitiveType,qe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=_(e.offset,0),this._instanceCount=_(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._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=_(e.cull,!0),this.occlude=_(e.occlude,!0),this.executeInClosestFrustum=_(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.castShadows=_(e.castShadows,!1),this.receiveShadows=_(e.receiveShadows,!1),this.pickOnly=_(e.pickOnly,!1),this.depthForTranslucentClassification=_(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Wt(e,t){return(e._flags&t)===t}function Pi(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties($e.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 Wt(this,it.CULL)},set:function(e){Wt(this,it.CULL)!==e&&(Pi(this,it.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Wt(this,it.OCCLUDE)},set:function(e){Wt(this,it.OCCLUDE)!==e&&(Pi(this,it.OCCLUDE,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 Wt(this,it.CAST_SHADOWS)},set:function(e){Wt(this,it.CAST_SHADOWS)!==e&&(Pi(this,it.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Wt(this,it.RECEIVE_SHADOWS)},set:function(e){Wt(this,it.RECEIVE_SHADOWS)!==e&&(Pi(this,it.RECEIVE_SHADOWS,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 Wt(this,it.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Wt(this,it.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Pi(this,it.EXECUTE_IN_CLOSEST_FRUSTUM,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 Wt(this,it.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Wt(this,it.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Pi(this,it.DEBUG_SHOW_BOUNDING_VOLUME,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)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Wt(this,it.PICK_ONLY)},set:function(e){Wt(this,it.PICK_ONLY)!==e&&(Pi(this,it.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Wt(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Wt(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Pi(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}}),$e.shallowClone=function(e,t){if(h(e))return h(t)||(t=new $e),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._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t},$e.prototype.execute=function(e,t){e.draw(this,t)};const Se={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,HALF_FLOAT:R.HALF_FLOAT_OES,UNSIGNED_INT_24_8:R.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:R.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:R.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:R.UNSIGNED_SHORT_5_6_5};Se.toWebGLConstant=function(e,t){switch(e){case Se.UNSIGNED_BYTE:return R.UNSIGNED_BYTE;case Se.UNSIGNED_SHORT:return R.UNSIGNED_SHORT;case Se.UNSIGNED_INT:return R.UNSIGNED_INT;case Se.FLOAT:return R.FLOAT;case Se.HALF_FLOAT:return t.webgl2?R.HALF_FLOAT:R.HALF_FLOAT_OES;case Se.UNSIGNED_INT_24_8:return R.UNSIGNED_INT_24_8;case Se.UNSIGNED_SHORT_4_4_4_4:return R.UNSIGNED_SHORT_4_4_4_4;case Se.UNSIGNED_SHORT_5_5_5_1:return R.UNSIGNED_SHORT_5_5_5_1;case Se.UNSIGNED_SHORT_5_6_5:return Se.UNSIGNED_SHORT_5_6_5}},Se.isPacked=function(e){return e===Se.UNSIGNED_INT_24_8||e===Se.UNSIGNED_SHORT_4_4_4_4||e===Se.UNSIGNED_SHORT_5_5_5_1||e===Se.UNSIGNED_SHORT_5_6_5},Se.sizeInBytes=function(e){switch(e){case Se.UNSIGNED_BYTE:return 1;case Se.UNSIGNED_SHORT:case Se.UNSIGNED_SHORT_4_4_4_4:case Se.UNSIGNED_SHORT_5_5_5_1:case Se.UNSIGNED_SHORT_5_6_5:case Se.HALF_FLOAT:return 2;case Se.UNSIGNED_INT:case Se.FLOAT:case Se.UNSIGNED_INT_24_8:return 4}},Se.validate=function(e){return e===Se.UNSIGNED_BYTE||e===Se.UNSIGNED_SHORT||e===Se.UNSIGNED_INT||e===Se.FLOAT||e===Se.HALF_FLOAT||e===Se.UNSIGNED_INT_24_8||e===Se.UNSIGNED_SHORT_4_4_4_4||e===Se.UNSIGNED_SHORT_5_5_5_1||e===Se.UNSIGNED_SHORT_5_6_5},Se.getTypedArrayConstructor=function(e){const t=Se.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Se.FLOAT?Float32Array:Uint32Array};const pe=Object.freeze(Se),te={DEPTH_COMPONENT:R.DEPTH_COMPONENT,DEPTH_STENCIL:R.DEPTH_STENCIL,ALPHA:R.ALPHA,RED:R.RED,RG:R.RG,RGB:R.RGB,RGBA:R.RGBA,LUMINANCE:R.LUMINANCE,LUMINANCE_ALPHA:R.LUMINANCE_ALPHA,RGB_DXT1:R.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:R.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:R.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:R.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:R.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:R.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:R.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:R.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:R.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:R.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:R.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:R.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:R.COMPRESSED_RGBA_BPTC_UNORM};te.componentsLength=function(e){switch(e){case te.RGB:return 3;case te.RGBA:return 4;case te.LUMINANCE_ALPHA:case te.RG:return 2;case te.ALPHA:case te.RED:case te.LUMINANCE:return 1;default:return 1}},te.validate=function(e){return e===te.DEPTH_COMPONENT||e===te.DEPTH_STENCIL||e===te.ALPHA||e===te.RED||e===te.RG||e===te.RGB||e===te.RGBA||e===te.LUMINANCE||e===te.LUMINANCE_ALPHA||e===te.RGB_DXT1||e===te.RGBA_DXT1||e===te.RGBA_DXT3||e===te.RGBA_DXT5||e===te.RGB_PVRTC_4BPPV1||e===te.RGB_PVRTC_2BPPV1||e===te.RGBA_PVRTC_4BPPV1||e===te.RGBA_PVRTC_2BPPV1||e===te.RGBA_ASTC||e===te.RGB_ETC1||e===te.RGB8_ETC2||e===te.RGBA8_ETC2_EAC||e===te.RGBA_BC7},te.isColorFormat=function(e){return e===te.RED||e===te.ALPHA||e===te.RGB||e===te.RGBA||e===te.LUMINANCE||e===te.LUMINANCE_ALPHA},te.isDepthFormat=function(e){return e===te.DEPTH_COMPONENT||e===te.DEPTH_STENCIL},te.isCompressedFormat=function(e){return e===te.RGB_DXT1||e===te.RGBA_DXT1||e===te.RGBA_DXT3||e===te.RGBA_DXT5||e===te.RGB_PVRTC_4BPPV1||e===te.RGB_PVRTC_2BPPV1||e===te.RGBA_PVRTC_4BPPV1||e===te.RGBA_PVRTC_2BPPV1||e===te.RGBA_ASTC||e===te.RGB_ETC1||e===te.RGB8_ETC2||e===te.RGBA8_ETC2_EAC||e===te.RGBA_BC7},te.isDXTFormat=function(e){return e===te.RGB_DXT1||e===te.RGBA_DXT1||e===te.RGBA_DXT3||e===te.RGBA_DXT5},te.isPVRTCFormat=function(e){return e===te.RGB_PVRTC_4BPPV1||e===te.RGB_PVRTC_2BPPV1||e===te.RGBA_PVRTC_4BPPV1||e===te.RGBA_PVRTC_2BPPV1},te.isASTCFormat=function(e){return e===te.RGBA_ASTC},te.isETC1Format=function(e){return e===te.RGB_ETC1},te.isETC2Format=function(e){return e===te.RGB8_ETC2||e===te.RGBA8_ETC2_EAC},te.isBC7Format=function(e){return e===te.RGBA_BC7},te.compressedTextureSizeInBytes=function(e,t,n){switch(e){case te.RGB_DXT1:case te.RGBA_DXT1:case te.RGB_ETC1:case te.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case te.RGBA_DXT3:case te.RGBA_DXT5:case te.RGBA_ASTC:case te.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case te.RGB_PVRTC_4BPPV1:case te.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case te.RGB_PVRTC_2BPPV1:case te.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case te.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}},te.textureSizeInBytes=function(e,t,n,i){let o=te.componentsLength(e);return pe.isPacked(t)&&(o=1),o*pe.sizeInBytes(t)*n*i},te.alignmentInBytes=function(e,t,n){const i=te.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1},te.createTypedArray=function(e,t,n,i){const o=pe.getTypedArrayConstructor(t),s=te.componentsLength(e)*n*i;return new o(s)},te.flipY=function(e,t,n,i,o){if(o===1)return e;const s=te.createTypedArray(t,n,i,o),a=te.componentsLength(t),c=i*a;for(let l=0;l<o;++l){const u=l*i*a,d=(o-l-1)*i*a;for(let p=0;p<c;++p)s[d+p]=e[u+p]}return s},te.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===te.DEPTH_STENCIL)return R.DEPTH24_STENCIL8;if(e===te.DEPTH_COMPONENT){if(t===pe.UNSIGNED_SHORT)return R.DEPTH_COMPONENT16;if(t===pe.UNSIGNED_INT)return R.DEPTH_COMPONENT24}if(t===pe.FLOAT)switch(e){case te.RGBA:return R.RGBA32F;case te.RGB:return R.RGB32F;case te.RG:return R.RG32F;case te.RED:return R.R32F}if(t===pe.HALF_FLOAT)switch(e){case te.RGBA:return R.RGBA16F;case te.RGB:return R.RGB16F;case te.RG:return R.RG16F;case te.RED:return R.R16F}return e};const de=Object.freeze(te),Ee={_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(Ee,{maximumCombinedTextureImageUnits:{get:function(){return Ee._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Ee._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Ee._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Ee._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Ee._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Ee._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Ee._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Ee._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Ee._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Ee._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Ee._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Ee._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Ee._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Ee._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Ee._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Ee._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Ee._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Ee._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Ee._maximumColorAttachments}},maximumSamples:{get:function(){return Ee._maximumSamples}},highpFloatSupported:{get:function(){return Ee._highpFloatSupported}},highpIntSupported:{get:function(){return Ee._highpIntSupported}}});function bc(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Ms(e,t,n){const i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function On(e){e=_(e,_.EMPTY_OBJECT);const t=e.context;m.defined("options.context",t);const n=t._gl,i=Ee.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=_(e.destroyAttachments,!0),h(e.colorTextures)&&h(e.colorRenderbuffers))throw new C("Cannot have both color texture and color renderbuffer attachments.");if(h(e.depthTexture)&&h(e.depthRenderbuffer))throw new C("Cannot have both a depth texture and depth renderbuffer attachment.");if(h(e.depthStencilTexture)&&h(e.depthStencilRenderbuffer))throw new C("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");const o=h(e.depthTexture)||h(e.depthRenderbuffer),s=h(e.depthStencilTexture)||h(e.depthStencilRenderbuffer);if(o&&s)throw new C("Cannot have both a depth and depth-stencil attachment.");if(h(e.stencilRenderbuffer)&&s)throw new C("Cannot have both a stencil and depth-stencil attachment.");if(o&&h(e.stencilRenderbuffer))throw new C("Cannot have both a depth and stencil attachment.");if(this._bind(),h(e.colorTextures)){const a=e.colorTextures,c=this._colorTextures.length=this._activeColorAttachments.length=a.length;if(c>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<c;++l){const u=a[l];if(!de.isColorFormat(u.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(u.pixelDatatype===pe.FLOAT&&!t.colorBufferFloat)throw new C("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(u.pixelDatatype===pe.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new C("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.");const d=this._gl.COLOR_ATTACHMENT0+l;bc(this,d,u),this._activeColorAttachments[l]=d,this._colorTextures[l]=u}}if(h(e.colorRenderbuffers)){const a=e.colorRenderbuffers,c=this._colorRenderbuffers.length=this._activeColorAttachments.length=a.length;if(c>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<c;++l){const u=a[l],d=this._gl.COLOR_ATTACHMENT0+l;Ms(this,d,u),this._activeColorAttachments[l]=d,this._colorRenderbuffers[l]=u}}if(h(e.depthTexture)){const a=e.depthTexture;if(a.pixelFormat!==de.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");bc(this,this._gl.DEPTH_ATTACHMENT,a),this._depthTexture=a}if(h(e.depthRenderbuffer)){const a=e.depthRenderbuffer;Ms(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a}if(h(e.stencilRenderbuffer)){const a=e.stencilRenderbuffer;Ms(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a}if(h(e.depthStencilTexture)){const a=e.depthStencilTexture;if(a.pixelFormat!==de.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");bc(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilTexture=a}if(h(e.depthStencilRenderbuffer)){const a=e.depthStencilRenderbuffer;Ms(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilRenderbuffer=a}this._unBind()}Object.defineProperties(On.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)}}}),On.prototype._bind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},On.prototype._unBind=function(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},On.prototype.bindDraw=function(){const e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)},On.prototype.bindRead=function(){const e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)},On.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},On.prototype.getColorTexture=function(e){if(!h(e)||e<0||e>=this._colorTextures.length)throw new C("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]},On.prototype.getColorRenderbuffer=function(e){if(!h(e)||e<0||e>=this._colorRenderbuffers.length)throw new C("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]},On.prototype.isDestroyed=function(){return!1},On.prototype.destroy=function(){if(this.destroyAttachments){const e=this._colorTextures;for(let n=0;n<e.length;++n){const i=e[n];h(i)&&i.destroy()}const t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){const i=t[n];h(i)&&i.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),Qe(this)};const Us={CLOCKWISE:R.CW,COUNTER_CLOCKWISE:R.CCW};Us.validate=function(e){return e===Us.CLOCKWISE||e===Us.COUNTER_CLOCKWISE};const Ef=Object.freeze(Us);function bf(e){if(typeof e!="object"||e===null)return e;let t;const n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=bf(e[t]));return Object.freeze(e)}function wf(e){return e===R.FUNC_ADD||e===R.FUNC_SUBTRACT||e===R.FUNC_REVERSE_SUBTRACT||e===R.MIN||e===R.MAX}function ks(e){return e===R.ZERO||e===R.ONE||e===R.SRC_COLOR||e===R.ONE_MINUS_SRC_COLOR||e===R.DST_COLOR||e===R.ONE_MINUS_DST_COLOR||e===R.SRC_ALPHA||e===R.ONE_MINUS_SRC_ALPHA||e===R.DST_ALPHA||e===R.ONE_MINUS_DST_ALPHA||e===R.CONSTANT_COLOR||e===R.ONE_MINUS_CONSTANT_COLOR||e===R.CONSTANT_ALPHA||e===R.ONE_MINUS_CONSTANT_ALPHA||e===R.SRC_ALPHA_SATURATE}function hy(e){return e===R.FRONT||e===R.BACK||e===R.FRONT_AND_BACK}function fy(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Tf(e){return e===R.NEVER||e===R.LESS||e===R.EQUAL||e===R.LEQUAL||e===R.GREATER||e===R.NOTEQUAL||e===R.GEQUAL||e===R.ALWAYS}function Oo(e){return e===R.ZERO||e===R.KEEP||e===R.REPLACE||e===R.INCR||e===R.DECR||e===R.INVERT||e===R.INCR_WRAP||e===R.DECR_WRAP}function Ve(e){const t=_(e,_.EMPTY_OBJECT),n=_(t.cull,_.EMPTY_OBJECT),i=_(t.polygonOffset,_.EMPTY_OBJECT),o=_(t.scissorTest,_.EMPTY_OBJECT),s=_(o.rectangle,_.EMPTY_OBJECT),a=_(t.depthRange,_.EMPTY_OBJECT),c=_(t.depthTest,_.EMPTY_OBJECT),l=_(t.colorMask,_.EMPTY_OBJECT),u=_(t.blending,_.EMPTY_OBJECT),d=_(u.color,_.EMPTY_OBJECT),p=_(t.stencilTest,_.EMPTY_OBJECT),g=_(p.frontOperation,_.EMPTY_OBJECT),y=_(p.backOperation,_.EMPTY_OBJECT),x=_(t.sampleCoverage,_.EMPTY_OBJECT),E=t.viewport;if(this.frontFace=_(t.frontFace,Ef.COUNTER_CLOCKWISE),this.cull={enabled:_(n.enabled,!1),face:_(n.face,R.BACK)},this.lineWidth=_(t.lineWidth,1),this.polygonOffset={enabled:_(i.enabled,!1),factor:_(i.factor,0),units:_(i.units,0)},this.scissorTest={enabled:_(o.enabled,!1),rectangle:Ce.clone(s)},this.depthRange={near:_(a.near,0),far:_(a.far,1)},this.depthTest={enabled:_(c.enabled,!1),func:_(c.func,R.LESS)},this.colorMask={red:_(l.red,!0),green:_(l.green,!0),blue:_(l.blue,!0),alpha:_(l.alpha,!0)},this.depthMask=_(t.depthMask,!0),this.stencilMask=_(t.stencilMask,-1),this.blending={enabled:_(u.enabled,!1),color:new T(_(d.red,0),_(d.green,0),_(d.blue,0),_(d.alpha,0)),equationRgb:_(u.equationRgb,R.FUNC_ADD),equationAlpha:_(u.equationAlpha,R.FUNC_ADD),functionSourceRgb:_(u.functionSourceRgb,R.ONE),functionSourceAlpha:_(u.functionSourceAlpha,R.ONE),functionDestinationRgb:_(u.functionDestinationRgb,R.ZERO),functionDestinationAlpha:_(u.functionDestinationAlpha,R.ZERO)},this.stencilTest={enabled:_(p.enabled,!1),frontFunction:_(p.frontFunction,R.ALWAYS),backFunction:_(p.backFunction,R.ALWAYS),reference:_(p.reference,0),mask:_(p.mask,-1),frontOperation:{fail:_(g.fail,R.KEEP),zFail:_(g.zFail,R.KEEP),zPass:_(g.zPass,R.KEEP)},backOperation:{fail:_(y.fail,R.KEEP),zFail:_(y.zFail,R.KEEP),zPass:_(y.zPass,R.KEEP)}},this.sampleCoverage={enabled:_(x.enabled,!1),value:_(x.value,1),invert:_(x.invert,!1)},this.viewport=h(E)?new Ce(E.x,E.y,E.width,E.height):void 0,this.lineWidth<Ee.minimumAliasedLineWidth||this.lineWidth>Ee.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!Ef.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!hy(this.cull.face))throw new C("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new C("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 C("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new C("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new C("renderState.depthRange.far must be less than or equal to one.");if(!fy(this.depthTest.func))throw new C("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 C("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!wf(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!wf(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!ks(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!ks(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!ks(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!ks(this.blending.functionDestinationAlpha))throw new C("Invalid renderState.blending.functionDestinationAlpha.");if(!Tf(this.stencilTest.frontFunction))throw new C("Invalid renderState.stencilTest.frontFunction.");if(!Tf(this.stencilTest.backFunction))throw new C("Invalid renderState.stencilTest.backFunction.");if(!Oo(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!Oo(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!Oo(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!Oo(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!Oo(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!Oo(this.stencilTest.backOperation.zPass))throw new C("Invalid renderState.stencilTest.backOperation.zPass.");if(h(this.viewport)){if(this.viewport.width<0)throw new C("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new C("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>Ee.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${Ee.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>Ee.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${Ee.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let uy=0,Wn={};Ve.fromCache=function(e){const t=JSON.stringify(e);let n=Wn[t];if(h(n))return++n.referenceCount,n.state;let i=new Ve(e);const o=JSON.stringify(i);return n=Wn[o],h(n)||(i.id=uy++,i=bf(i),n={referenceCount:0,state:i},Wn[o]=n),++n.referenceCount,Wn[t]={referenceCount:1,state:n.state},n.state},Ve.removeFromCache=function(e){const t=new Ve(e),n=JSON.stringify(t),i=Wn[n],o=JSON.stringify(e),s=Wn[o];h(s)&&(--s.referenceCount,s.referenceCount===0&&(delete Wn[o],h(i)&&--i.referenceCount)),h(i)&&i.referenceCount===0&&delete Wn[n]},Ve.getCache=function(){return Wn},Ve.clearCache=function(){Wn={}};function Qi(e,t,n){n?e.enable(t):e.disable(t)}function Sf(e,t){e.frontFace(t.frontFace)}function Af(e,t){const n=t.cull,i=n.enabled;Qi(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Df(e,t){e.lineWidth(t.lineWidth)}function Of(e,t){const n=t.polygonOffset,i=n.enabled;Qi(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function vf(e,t,n){const i=t.scissorTest,o=h(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Qi(e,e.SCISSOR_TEST,o),o){const s=h(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(s.x,s.y,s.width,s.height)}}function If(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function Rf(e,t){const n=t.depthTest,i=n.enabled;Qi(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function zf(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Pf(e,t){e.depthMask(t.depthMask)}function Bf(e,t){e.stencilMask(t.stencilMask)}function dy(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Nf(e,t,n){const i=t.blending,o=h(n.blendingEnabled)?n.blendingEnabled:i.enabled;Qi(e,e.BLEND,o),o&&(dy(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Ff(e,t){const n=t.stencilTest,i=n.enabled;if(Qi(e,e.STENCIL_TEST,i),i){const o=n.frontFunction,s=n.backFunction,a=n.reference,c=n.mask;e.stencilFunc(o,a,c),e.stencilFuncSeparate(e.BACK,s,a,c),e.stencilFuncSeparate(e.FRONT,o,a,c);const l=n.frontOperation,u=l.fail,d=l.zFail,p=l.zPass;e.stencilOpSeparate(e.FRONT,u,d,p);const g=n.backOperation,y=g.fail,x=g.zFail,E=g.zPass;e.stencilOpSeparate(e.BACK,y,x,E)}}function Lf(e,t){const n=t.sampleCoverage,i=n.enabled;Qi(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}const py=new Ce;function Mf(e,t,n){let i=_(t.viewport,n.viewport);h(i)||(i=py,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)}Ve.apply=function(e,t,n){Sf(e,t),Af(e,t),Df(e,t),Of(e,t),If(e,t),Rf(e,t),zf(e,t),Pf(e,t),Bf(e,t),Ff(e,t),Lf(e,t),vf(e,t,n),Nf(e,t,n),Mf(e,t,n)};function my(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(Sf),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Af),e.lineWidth!==t.lineWidth&&n.push(Df),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Of),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(If),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Rf),(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(zf),e.depthMask!==t.depthMask&&n.push(Pf),e.stencilMask!==t.stencilMask&&n.push(Bf),(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(Ff),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Lf),n}Ve.partialApply=function(e,t,n,i,o,s){if(t!==n){let d=n._applyFunctions[t.id];h(d)||(d=my(t,n),n._applyFunctions[t.id]=d);const p=d.length;for(let g=0;g<p;++g)d[g](e,n)}const a=h(i.scissorTest)?i.scissorTest:t.scissorTest,c=h(o.scissorTest)?o.scissorTest:n.scissorTest;(a!==c||s)&&vf(e,n,o);const l=h(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=h(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(l!==u||u&&t.blending!==n.blending)&&Nf(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Mf(e,n,o)},Ve.getState=function(e){if(!h(e))throw new C("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:Ce.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:T.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:h(e.viewport)?Ce.clone(e.viewport):void 0}};function ae(e,t,n,i){this[0]=_(e,0),this[1]=_(n,0),this[2]=_(t,0),this[3]=_(i,0)}ae.packedLength=4,ae.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t},ae.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new ae),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},ae.packArray=function(e,t){m.defined("array",e);const n=e.length,i=n*4;if(!h(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)ae.pack(e[o],t,o*4);return t},ae.unpackArray=function(e,t){if(m.defined("array",e),m.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");const n=e.length;h(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){const o=i/4;t[o]=ae.unpack(e,i,t[o])}return t},ae.clone=function(e,t){if(h(e))return h(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new ae(e[0],e[2],e[1],e[3])},ae.fromArray=ae.unpack,ae.fromColumnMajorArray=function(e,t){return m.defined("values",e),ae.clone(e,t)},ae.fromRowMajorArray=function(e,t){return m.defined("values",e),h(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new ae(e[0],e[1],e[2],e[3])},ae.fromScale=function(e,t){return m.typeOf.object("scale",e),h(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new ae(e.x,0,0,e.y)},ae.fromUniformScale=function(e,t){return m.typeOf.number("scale",e),h(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new ae(e,0,0,e)},ae.fromRotation=function(e,t){m.typeOf.number("angle",e);const n=Math.cos(e),i=Math.sin(e);return h(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new ae(n,-i,i,n)},ae.toArray=function(e,t){return m.typeOf.object("matrix",e),h(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]]},ae.getElementIndex=function(e,t){return m.typeOf.number.greaterThanOrEquals("row",t,0),m.typeOf.number.lessThanOrEquals("row",t,1),m.typeOf.number.greaterThanOrEquals("column",e,0),m.typeOf.number.lessThanOrEquals("column",e,1),e*2+t},ae.getColumn=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("result",n);const i=t*2,o=e[i],s=e[i+1];return n.x=o,n.y=s,n},ae.setColumn=function(e,t,n,i){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=ae.clone(e,i);const o=t*2;return i[o]=n.x,i[o+1]=n.y,i},ae.getRow=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("result",n);const i=e[t],o=e[t+2];return n.x=i,n.y=o,n},ae.setRow=function(e,t,n,i){return m.typeOf.object("matrix",e),m.typeOf.number.greaterThanOrEquals("index",t,0),m.typeOf.number.lessThanOrEquals("index",t,1),m.typeOf.object("cartesian",n),m.typeOf.object("result",i),i=ae.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};const _y=new U;ae.setScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=ae.getScale(e,_y),o=t.x/i.x,s=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*s,n[3]=e[3]*s,n};const gy=new U;ae.setUniformScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.typeOf.object("result",n);const i=ae.getScale(e,gy),o=t/i.x,s=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*s,n[3]=e[3]*s,n};const Uf=new U;ae.getScale=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t.x=U.magnitude(U.fromElements(e[0],e[1],Uf)),t.y=U.magnitude(U.fromElements(e[2],e[3],Uf)),t};const kf=new U;ae.getMaximumScale=function(e){return ae.getScale(e,kf),U.maximumComponent(kf)};const yy=new U;ae.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=ae.getScale(e,yy);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 xy=new U;ae.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=ae.getScale(e,xy);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},ae.multiply=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),m.typeOf.object("result",n);const i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],s=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=s,n[2]=o,n[3]=a,n},ae.add=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},ae.subtract=function(e,t,n){return m.typeOf.object("left",e),m.typeOf.object("right",t),m.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},ae.multiplyByVector=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("cartesian",t),m.typeOf.object("result",n);const i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n},ae.multiplyByScalar=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scalar",t),m.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},ae.multiplyByScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.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},ae.multiplyByUniformScale=function(e,t,n){return m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.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},ae.negate=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},ae.transpose=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=e[0],i=e[2],o=e[1],s=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=s,t},ae.abs=function(e,t){return m.typeOf.object("matrix",e),m.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},ae.equals=function(e,t){return e===t||h(e)&&h(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},ae.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]},ae.equalsEpsilon=function(e,t,n){return n=_(n,0),e===t||h(e)&&h(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},ae.IDENTITY=Object.freeze(new ae(1,0,0,1)),ae.ZERO=Object.freeze(new ae(0,0,0,0)),ae.COLUMN0ROW0=0,ae.COLUMN0ROW1=1,ae.COLUMN1ROW0=2,ae.COLUMN1ROW1=3,Object.defineProperties(ae.prototype,{length:{get:function(){return ae.packedLength}}}),ae.prototype.clone=function(e){return ae.clone(this,e)},ae.prototype.equals=function(e){return ae.equals(this,e)},ae.prototype.equalsEpsilon=function(e,t){return ae.equalsEpsilon(this,e,t)},ae.prototype.toString=function(){return`(${this[0]}, ${this[2]})
45
45
  (${this[1]}, ${this[3]})`};function Cy(e,t,n,i){switch(t.type){case e.FLOAT:return new Vf(e,t,n,i);case e.FLOAT_VEC2:return new Gf(e,t,n,i);case e.FLOAT_VEC3:return new qf(e,t,n,i);case e.FLOAT_VEC4:return new Hf(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new wc(e,t,n,i);case e.INT:case e.BOOL:return new Wf(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new jf(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Yf(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Xf(e,t,n,i);case e.FLOAT_MAT2:return new $f(e,t,n,i);case e.FLOAT_MAT3:return new Zf(e,t,n,i);case e.FLOAT_MAT4:return new Kf(e,t,n,i);default:throw new at(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Vf(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Vf.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Gf(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}Gf.prototype.set=function(){const e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function qf(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}qf.prototype.set=function(){const e=this.value;if(h(e.red))T.equals(e,this._value)||(this._value=T.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(h(e.x))f.equals(e,this._value)||(this._value=f.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new C(`Invalid vec3 value for uniform "${this.name}".`)};function Hf(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Hf.prototype.set=function(){const e=this.value;if(h(e.red))T.equals(e,this._value)||(this._value=T.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(h(e.x))Y.equals(e,this._value)||(this._value=Y.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w));else throw new C(`Invalid vec4 value for uniform "${this.name}".`)};function wc(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}wc.prototype.set=function(){const e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);const t=this.value;e.bindTexture(t._target,t._texture)},wc.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Wf(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Wf.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function jf(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}jf.prototype.set=function(){const e=this.value;U.equals(e,this._value)||(U.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function Yf(e,t,n,i){this.name=n,this.value=void 0,this._value=new f,this._gl=e,this._location=i}Yf.prototype.set=function(){const e=this.value;f.equals(e,this._value)||(f.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Xf(e,t,n,i){this.name=n,this.value=void 0,this._value=new Y,this._gl=e,this._location=i}Xf.prototype.set=function(){const e=this.value;Y.equals(e,this._value)||(Y.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};const Ey=new Float32Array(4);function $f(e,t,n,i){this.name=n,this.value=void 0,this._value=new ae,this._gl=e,this._location=i}$f.prototype.set=function(){if(!ae.equalsArray(this.value,this._value,0)){ae.clone(this.value,this._value);const e=ae.toArray(this.value,Ey);this._gl.uniformMatrix2fv(this._location,!1,e)}};const by=new Float32Array(9);function Zf(e,t,n,i){this.name=n,this.value=void 0,this._value=new L,this._gl=e,this._location=i}Zf.prototype.set=function(){if(!L.equalsArray(this.value,this._value,0)){L.clone(this.value,this._value);const e=L.toArray(this.value,by);this._gl.uniformMatrix3fv(this._location,!1,e)}};const wy=new Float32Array(16);function Kf(e,t,n,i){this.name=n,this.value=void 0,this._value=new N,this._gl=e,this._location=i}Kf.prototype.set=function(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);const e=N.toArray(this.value,wy);this._gl.uniformMatrix4fv(this._location,!1,e)}};function Ty(e,t,n,i){switch(t.type){case e.FLOAT:return new Qf(e,t,n,i);case e.FLOAT_VEC2:return new Jf(e,t,n,i);case e.FLOAT_VEC3:return new eu(e,t,n,i);case e.FLOAT_VEC4:return new tu(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new Tc(e,t,n,i);case e.INT:case e.BOOL:return new nu(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new iu(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new ou(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new ru(e,t,n,i);case e.FLOAT_MAT2:return new su(e,t,n,i);case e.FLOAT_MAT3:return new au(e,t,n,i);case e.FLOAT_MAT4:return new cu(e,t,n,i);default:throw new at(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Qf(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}Qf.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let o=0;o<t;++o){const s=e[o];s!==n[o]&&(n[o]=s,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function Jf(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}Jf.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];U.equalsArray(a,n,o)||(U.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function eu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}eu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];if(h(a.red))(a.red!==n[o]||a.green!==n[o+1]||a.blue!==n[o+2])&&(n[o]=a.red,n[o+1]=a.green,n[o+2]=a.blue,i=!0);else if(h(a.x))f.equalsArray(a,n,o)||(f.pack(a,n,o),i=!0);else throw new C("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function tu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}tu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];if(h(a.red))T.equalsArray(a,n,o)||(T.pack(a,n,o),i=!0);else if(h(a.x))Y.equalsArray(a,n,o)||(Y.pack(a,n,o),i=!0);else throw new C("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function Tc(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}Tc.prototype.set=function(){const e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){const s=n[o];e.activeTexture(t+o),e.bindTexture(s._target,s._texture)}},Tc.prototype._setSampler=function(e){this.textureUnitIndex=e;const t=this._locations,n=t.length;for(let i=0;i<n;++i){const o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function nu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}nu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1;for(let o=0;o<t;++o){const s=e[o];s!==n[o]&&(n[o]=s,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function iu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}iu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];U.equalsArray(a,n,o)||(U.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function ou(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}ou.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];f.equalsArray(a,n,o)||(f.pack(a,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function ru(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}ru.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];Y.equalsArray(a,n,o)||(Y.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function su(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}su.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];ae.equalsArray(a,n,o)||(ae.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function au(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}au.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];L.equalsArray(a,n,o)||(L.pack(a,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function cu(e,t,n,i){const o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}cu.prototype.set=function(){const e=this.value,t=e.length,n=this._value;let i=!1,o=0;for(let s=0;s<t;++s){const a=e[s];N.equalsArray(a,n,o)||(N.pack(a,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};let Sy=0;function ot(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));const i=Ay(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=Sy++}ot.fromCache=function(e){return e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},ot.replaceCache=function(e){return e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(ot.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return Vs(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return Vs(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return Vs(this),this._uniformsByName}}});function lu(e){const t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(h(n)){const i=n.length;for(let o=0;o<i;o++){const s=n[o].trim(),a=s.slice(s.lastIndexOf(" ")+1);t.push(a)}}return t}function Ay(e,t){const n={};if(!Ee.highpFloatSupported||!Ee.highpIntSupported){let i,o,s,a;const c=lu(e),l=lu(t),u=c.length,d=l.length;for(i=0;i<u;i++)for(o=0;o<d;o++)if(c[i]===l[o]){s=c[i],a=`czm_mediump_${s}`;const p=new RegExp(`${s}\\b`,"g");t=t.replace(p,a),n[a]=s}}return{fragmentShaderText:t,duplicateUniformNames:n}}const jn="[Cesium WebGL] ";function Dy(e,t){const n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);const s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,i),e.compileShader(s);const a=e.createProgram();e.attachShader(a,o),e.attachShader(a,s);const c=t._attributeLocations;if(h(c))for(const g in c)c.hasOwnProperty(g)&&e.bindAttribLocation(a,c[g],g);e.linkProgram(a);let l;if(e.getProgramParameter(a,e.LINK_STATUS))return t._logShaderCompilation&&(l=e.getShaderInfoLog(o),h(l)&&l.length>0&&console.log(`${jn}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(s),h(l)&&l.length>0&&console.log(`${jn}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(a),h(l)&&l.length>0&&console.log(`${jn}Shader program link log: ${l}`)),e.deleteShader(o),e.deleteShader(s),a;let u;const d=t._debugShaders;throw e.getShaderParameter(s,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(l=e.getProgramInfoLog(a),console.error(`${jn}Shader program link log: ${l}`),p(o,"vertex"),p(s,"fragment"),u=`Program failed to link. Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${jn}Vertex shader compile log: ${l}`),console.error(`${jn} Vertex shader source:
46
46
  ${n}`),u=`Vertex shader failed to compile. Compile log: ${l}`):(l=e.getShaderInfoLog(s),console.error(`${jn}Fragment shader compile log: ${l}`),console.error(`${jn} Fragment shader source:
47
47
  ${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(s),e.deleteProgram(a),new at(u);function p(g,y){if(!h(d))return;const x=d.getTranslatedShaderSource(g);if(x===""){console.error(`${jn}${y} shader translation failed.`);return}console.error(`${jn}Translated ${y} shaderSource:
48
- ${x}`)}}function Oy(e,t,n){const i={};for(let o=0;o<n;++o){const s=e.getActiveAttrib(t,o),a=e.getAttribLocation(t,s.name);i[s.name]={name:s.name,type:s.type,index:a}}return i}function vy(e,t){const n={},i=[],o=[],s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<s;++a){const c=e.getActiveUniform(t,a),l="[0]",u=c.name.indexOf(l,c.name.length-l.length)!==-1?c.name.slice(0,c.name.length-3):c.name;if(u.indexOf("gl_")!==0)if(c.name.indexOf("[")<0){const d=e.getUniformLocation(t,u);if(d!==null){const p=Cy(e,c,u,d);n[u]=p,i.push(p),p._setSampler&&o.push(p)}}else{let d,p,g,y;const x=u.indexOf("[");if(x>=0){if(d=n[u.slice(0,x)],!h(d))continue;p=d._locations,p.length<=1&&(g=d.value,y=e.getUniformLocation(t,u),y!==null&&(p.push(y),g.push(e.getUniform(t,y))))}else{p=[];for(let E=0;E<c.size;++E)y=e.getUniformLocation(t,`${u}[${E}]`),y!==null&&p.push(y);d=Ty(e,c,u,p),n[u]=d,i.push(d),d._setSampler&&o.push(d)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Iy(e,t){const n=[],i=[];for(const o in t)if(t.hasOwnProperty(o)){const s=t[o];let a=o;const c=e._duplicateUniformNames[a];h(c)&&(s.name=c,a=c);const l=fs[a];h(l)?n.push({uniform:s,automaticUniform:l}):i.push(s)}return{automaticUniforms:n,manualUniforms:i}}function Ry(e,t,n){e.useProgram(t);let i=0;const o=n.length;for(let s=0;s<o;++s)i=n[s]._setSampler(i);return e.useProgram(null),i}function Vs(e){h(e._program)||hu(e)}function hu(e){const t=e._program,n=e._gl,i=Dy(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),s=vy(n,i),a=Iy(e,s.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Oy(n,i,o),e._uniformsByName=s.uniformsByName,e._uniforms=s.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=Ry(n,i,s.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(c,l,u,d){const p=e._vertexShaderText,g=e._fragmentShaderText,y=/ ! = /g;e._vertexShaderText=c.replace(y," != "),e._fragmentShaderText=l.replace(y," != ");try{hu(e),u(e._program)}catch(x){e._vertexShaderText=p,e._fragmentShaderText=g;const b=/(?:Compile|Link) error: ([^]*)/.exec(x.message);d(b?b[1]:x.message)}})}ot.prototype._bind=function(){Vs(this),this._gl.useProgram(this._program)},ot.prototype._setUniforms=function(e,t,n){let i,o;if(h(e)){const c=this._manualUniforms;for(i=c.length,o=0;o<i;++o){const l=c[o];if(!h(e[l.name]))throw new C(`Unknown uniform: ${l.name}`);l.value=e[l.name]()}}const s=this._automaticUniforms;for(i=s.length,o=0;o<i;++o){const c=s[o];c.uniform.value=c.automaticUniform.getValue(t)}const a=this._uniforms;for(i=a.length,o=0;o<i;++o)a[o].set();if(n){const c=this._gl,l=this._program;if(c.validateProgram(l),!c.getProgramParameter(l,c.VALIDATE_STATUS))throw new C(`Program validation failed. Program info log: ${c.getProgramInfoLog(l)}`)}},ot.prototype.isDestroyed=function(){return!1},ot.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},ot.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),Qe(this)};const ue={BYTE:R.BYTE,UNSIGNED_BYTE:R.UNSIGNED_BYTE,SHORT:R.SHORT,UNSIGNED_SHORT:R.UNSIGNED_SHORT,INT:R.INT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,DOUBLE:R.DOUBLE};ue.getSizeInBytes=function(e){if(!h(e))throw new C("value is required.");switch(e){case ue.BYTE:return Int8Array.BYTES_PER_ELEMENT;case ue.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ue.SHORT:return Int16Array.BYTES_PER_ELEMENT;case ue.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ue.INT:return Int32Array.BYTES_PER_ELEMENT;case ue.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case ue.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case ue.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}},ue.fromTypedArray=function(e){if(e instanceof Int8Array)return ue.BYTE;if(e instanceof Uint8Array)return ue.UNSIGNED_BYTE;if(e instanceof Int16Array)return ue.SHORT;if(e instanceof Uint16Array)return ue.UNSIGNED_SHORT;if(e instanceof Int32Array)return ue.INT;if(e instanceof Uint32Array)return ue.UNSIGNED_INT;if(e instanceof Float32Array)return ue.FLOAT;if(e instanceof Float64Array)return ue.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},ue.validate=function(e){return h(e)&&(e===ue.BYTE||e===ue.UNSIGNED_BYTE||e===ue.SHORT||e===ue.UNSIGNED_SHORT||e===ue.INT||e===ue.UNSIGNED_INT||e===ue.FLOAT||e===ue.DOUBLE)},ue.createTypedArray=function(e,t){if(!h(e))throw new C("componentDatatype is required.");if(!h(t))throw new C("valuesOrLength is required.");switch(e){case ue.BYTE:return new Int8Array(t);case ue.UNSIGNED_BYTE:return new Uint8Array(t);case ue.SHORT:return new Int16Array(t);case ue.UNSIGNED_SHORT:return new Uint16Array(t);case ue.INT:return new Int32Array(t);case ue.UNSIGNED_INT:return new Uint32Array(t);case ue.FLOAT:return new Float32Array(t);case ue.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}},ue.createArrayBufferView=function(e,t,n,i){if(!h(e))throw new C("componentDatatype is required.");if(!h(t))throw new C("buffer is required.");switch(n=_(n,0),i=_(i,(t.byteLength-n)/ue.getSizeInBytes(e)),e){case ue.BYTE:return new Int8Array(t,n,i);case ue.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case ue.SHORT:return new Int16Array(t,n,i);case ue.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case ue.INT:return new Int32Array(t,n,i);case ue.UNSIGNED_INT:return new Uint32Array(t,n,i);case ue.FLOAT:return new Float32Array(t,n,i);case ue.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}},ue.fromName=function(e){switch(e){case"BYTE":return ue.BYTE;case"UNSIGNED_BYTE":return ue.UNSIGNED_BYTE;case"SHORT":return ue.SHORT;case"UNSIGNED_SHORT":return ue.UNSIGNED_SHORT;case"INT":return ue.INT;case"UNSIGNED_INT":return ue.UNSIGNED_INT;case"FLOAT":return ue.FLOAT;case"DOUBLE":return ue.DOUBLE;default:throw new C("name is not a valid value.")}};const oe=Object.freeze(ue),ar=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function ht(e){e=_(e,_.EMPTY_OBJECT),m.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=_(e.primitiveType,qe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=_(e.geometryType,ar.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}ht.computeNumberOfVertices=function(e){m.typeOf.object("geometry",e);let t=-1;for(const n in e.attributes)if(e.attributes.hasOwnProperty(n)&&h(e.attributes[n])&&h(e.attributes[n].values)){const i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new C("All attribute lists must have the same number of attributes.");t=o}return t};const zy=new ee,Py=new f,fu=new N,By=[new ee,new ee,new ee],Ny=[new U,new U,new U],Fy=[new U,new U,new U],Ly=new f,My=new J,Uy=new N,ky=new ae;ht._textureCoordinateRotationPoints=function(e,t,n,i){let o;const s=ce.center(i,zy),a=ee.toCartesian(s,n,Py),c=_e.eastNorthUpToFixedFrame(a,n,fu),l=N.inverse(c,fu),u=Ny,d=By;d[0].longitude=i.west,d[0].latitude=i.south,d[1].longitude=i.west,d[1].latitude=i.north,d[2].longitude=i.east,d[2].latitude=i.south;let p=Ly;for(o=0;o<3;o++)ee.toCartesian(d[o],n,p),p=N.multiplyByPointAsVector(l,p,p),u[o].x=p.x,u[o].y=p.y;const g=J.fromAxisAngle(f.UNIT_Z,-t,My),y=L.fromQuaternion(g,Uy),x=e.length;let E=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,D=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(o=0;o<x;o++)p=N.multiplyByPointAsVector(l,e[o],p),p=L.multiplyByVector(y,p,p),E=Math.min(E,p.x),b=Math.min(b,p.y),D=Math.max(D,p.x),A=Math.max(A,p.y);const O=ae.fromRotation(t,ky),I=Fy;I[0].x=E,I[0].y=b,I[1].x=E,I[1].y=A,I[2].x=D,I[2].y=b;const B=u[0],M=u[2].x-B.x,q=u[1].y-B.y;for(o=0;o<3;o++){const j=I[o];ae.multiplyByVector(O,j,j),j.x=(j.x-B.x)/M,j.y=(j.y-B.y)/q}const P=I[0],V=I[1],k=I[2],H=new Array(6);return U.pack(P,H),U.pack(V,H,2),U.pack(k,H,4),H};function Bt(e){if(e=_(e,_.EMPTY_OBJECT),!h(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!h(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!h(e.values))throw new C("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=_(e.normalize,!1),this.values=e.values}function vo(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(vo.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}},arrayBufferView:{get:function(){return this._buffer}}}),vo.clone=function(e){if(h(e))return new vo(e._format,e._datatype,e._width,e._height,e._buffer)},vo.prototype.clone=function(){return vo.clone(this)};function uu(){if(!h(bt._canTransferArrayBuffer)){const e=Dc("transferTypedArrayTest");e.postMessage=_(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return bt._canTransferArrayBuffer=!1,bt._canTransferArrayBuffer}bt._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){const s=o.data.array,a=h(s)&&s[0]===t;i(a),e.terminate(),bt._canTransferArrayBuffer=a}})}return bt._canTransferArrayBuffer}const Sc=new Pe;function Ac(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new o;s.append(e),t=s.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function Dc(e){const t=new ai(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={};let s,a;if(nc(e))a=e;else if(!n){const c=hn(`${bt._workerModulePrefix}/${i}.js`);nc(c)&&(a=c)}if(a){const c=`import "${a}";`;return s=Ac(c),o.type="module",new Worker(s,o)}if(!n&&typeof CESIUM_WORKERS<"u"){const c=`
48
+ ${x}`)}}function Oy(e,t,n){const i={};for(let o=0;o<n;++o){const s=e.getActiveAttrib(t,o),a=e.getAttribLocation(t,s.name);i[s.name]={name:s.name,type:s.type,index:a}}return i}function vy(e,t){const n={},i=[],o=[],s=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<s;++a){const c=e.getActiveUniform(t,a),l="[0]",u=c.name.indexOf(l,c.name.length-l.length)!==-1?c.name.slice(0,c.name.length-3):c.name;if(u.indexOf("gl_")!==0)if(c.name.indexOf("[")<0){const d=e.getUniformLocation(t,u);if(d!==null){const p=Cy(e,c,u,d);n[u]=p,i.push(p),p._setSampler&&o.push(p)}}else{let d,p,g,y;const x=u.indexOf("[");if(x>=0){if(d=n[u.slice(0,x)],!h(d))continue;p=d._locations,p.length<=1&&(g=d.value,y=e.getUniformLocation(t,u),y!==null&&(p.push(y),g.push(e.getUniform(t,y))))}else{p=[];for(let E=0;E<c.size;++E)y=e.getUniformLocation(t,`${u}[${E}]`),y!==null&&p.push(y);d=Ty(e,c,u,p),n[u]=d,i.push(d),d._setSampler&&o.push(d)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Iy(e,t){const n=[],i=[];for(const o in t)if(t.hasOwnProperty(o)){const s=t[o];let a=o;const c=e._duplicateUniformNames[a];h(c)&&(s.name=c,a=c);const l=fs[a];h(l)?n.push({uniform:s,automaticUniform:l}):i.push(s)}return{automaticUniforms:n,manualUniforms:i}}function Ry(e,t,n){e.useProgram(t);let i=0;const o=n.length;for(let s=0;s<o;++s)i=n[s]._setSampler(i);return e.useProgram(null),i}function Vs(e){h(e._program)||hu(e)}function hu(e){const t=e._program,n=e._gl,i=Dy(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),s=vy(n,i),a=Iy(e,s.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Oy(n,i,o),e._uniformsByName=s.uniformsByName,e._uniforms=s.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=Ry(n,i,s.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(c,l,u,d){const p=e._vertexShaderText,g=e._fragmentShaderText,y=/ ! = /g;e._vertexShaderText=c.replace(y," != "),e._fragmentShaderText=l.replace(y," != ");try{hu(e),u(e._program)}catch(x){e._vertexShaderText=p,e._fragmentShaderText=g;const b=/(?:Compile|Link) error: ([^]*)/.exec(x.message);d(b?b[1]:x.message)}})}ot.prototype._bind=function(){Vs(this),this._gl.useProgram(this._program)},ot.prototype._setUniforms=function(e,t,n){let i,o;if(h(e)){const c=this._manualUniforms;for(i=c.length,o=0;o<i;++o){const l=c[o];if(!h(e[l.name]))throw new C(`Unknown uniform: ${l.name}`);l.value=e[l.name]()}}const s=this._automaticUniforms;for(i=s.length,o=0;o<i;++o){const c=s[o];c.uniform.value=c.automaticUniform.getValue(t)}const a=this._uniforms;for(i=a.length,o=0;o<i;++o)a[o].set();if(n){const c=this._gl,l=this._program;if(c.validateProgram(l),!c.getProgramParameter(l,c.VALIDATE_STATUS))throw new C(`Program validation failed. Program info log: ${c.getProgramInfoLog(l)}`)}},ot.prototype.isDestroyed=function(){return!1},ot.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},ot.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),Qe(this)};const ue={BYTE:R.BYTE,UNSIGNED_BYTE:R.UNSIGNED_BYTE,SHORT:R.SHORT,UNSIGNED_SHORT:R.UNSIGNED_SHORT,INT:R.INT,UNSIGNED_INT:R.UNSIGNED_INT,FLOAT:R.FLOAT,DOUBLE:R.DOUBLE};ue.getSizeInBytes=function(e){if(!h(e))throw new C("value is required.");switch(e){case ue.BYTE:return Int8Array.BYTES_PER_ELEMENT;case ue.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ue.SHORT:return Int16Array.BYTES_PER_ELEMENT;case ue.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ue.INT:return Int32Array.BYTES_PER_ELEMENT;case ue.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case ue.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case ue.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}},ue.fromTypedArray=function(e){if(e instanceof Int8Array)return ue.BYTE;if(e instanceof Uint8Array)return ue.UNSIGNED_BYTE;if(e instanceof Int16Array)return ue.SHORT;if(e instanceof Uint16Array)return ue.UNSIGNED_SHORT;if(e instanceof Int32Array)return ue.INT;if(e instanceof Uint32Array)return ue.UNSIGNED_INT;if(e instanceof Float32Array)return ue.FLOAT;if(e instanceof Float64Array)return ue.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},ue.validate=function(e){return h(e)&&(e===ue.BYTE||e===ue.UNSIGNED_BYTE||e===ue.SHORT||e===ue.UNSIGNED_SHORT||e===ue.INT||e===ue.UNSIGNED_INT||e===ue.FLOAT||e===ue.DOUBLE)},ue.createTypedArray=function(e,t){if(!h(e))throw new C("componentDatatype is required.");if(!h(t))throw new C("valuesOrLength is required.");switch(e){case ue.BYTE:return new Int8Array(t);case ue.UNSIGNED_BYTE:return new Uint8Array(t);case ue.SHORT:return new Int16Array(t);case ue.UNSIGNED_SHORT:return new Uint16Array(t);case ue.INT:return new Int32Array(t);case ue.UNSIGNED_INT:return new Uint32Array(t);case ue.FLOAT:return new Float32Array(t);case ue.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}},ue.createArrayBufferView=function(e,t,n,i){if(!h(e))throw new C("componentDatatype is required.");if(!h(t))throw new C("buffer is required.");switch(n=_(n,0),i=_(i,(t.byteLength-n)/ue.getSizeInBytes(e)),e){case ue.BYTE:return new Int8Array(t,n,i);case ue.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case ue.SHORT:return new Int16Array(t,n,i);case ue.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case ue.INT:return new Int32Array(t,n,i);case ue.UNSIGNED_INT:return new Uint32Array(t,n,i);case ue.FLOAT:return new Float32Array(t,n,i);case ue.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}},ue.fromName=function(e){switch(e){case"BYTE":return ue.BYTE;case"UNSIGNED_BYTE":return ue.UNSIGNED_BYTE;case"SHORT":return ue.SHORT;case"UNSIGNED_SHORT":return ue.UNSIGNED_SHORT;case"INT":return ue.INT;case"UNSIGNED_INT":return ue.UNSIGNED_INT;case"FLOAT":return ue.FLOAT;case"DOUBLE":return ue.DOUBLE;default:throw new C("name is not a valid value.")}};const oe=Object.freeze(ue),ar=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function ht(e){e=_(e,_.EMPTY_OBJECT),m.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=_(e.primitiveType,qe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=_(e.geometryType,ar.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}ht.computeNumberOfVertices=function(e){m.typeOf.object("geometry",e);let t=-1;for(const n in e.attributes)if(e.attributes.hasOwnProperty(n)&&h(e.attributes[n])&&h(e.attributes[n].values)){const i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new C("All attribute lists must have the same number of attributes.");t=o}return t};const zy=new ee,Py=new f,fu=new N,By=[new ee,new ee,new ee],Ny=[new U,new U,new U],Fy=[new U,new U,new U],Ly=new f,My=new J,Uy=new N,ky=new ae;ht._textureCoordinateRotationPoints=function(e,t,n,i){let o;const s=ce.center(i,zy),a=ee.toCartesian(s,n,Py),c=_e.eastNorthUpToFixedFrame(a,n,fu),l=N.inverse(c,fu),u=Ny,d=By;d[0].longitude=i.west,d[0].latitude=i.south,d[1].longitude=i.west,d[1].latitude=i.north,d[2].longitude=i.east,d[2].latitude=i.south;let p=Ly;for(o=0;o<3;o++)ee.toCartesian(d[o],n,p),p=N.multiplyByPointAsVector(l,p,p),u[o].x=p.x,u[o].y=p.y;const g=J.fromAxisAngle(f.UNIT_Z,-t,My),y=L.fromQuaternion(g,Uy),x=e.length;let E=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,D=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(o=0;o<x;o++)p=N.multiplyByPointAsVector(l,e[o],p),p=L.multiplyByVector(y,p,p),E=Math.min(E,p.x),b=Math.min(b,p.y),D=Math.max(D,p.x),A=Math.max(A,p.y);const O=ae.fromRotation(t,ky),I=Fy;I[0].x=E,I[0].y=b,I[1].x=E,I[1].y=A,I[2].x=D,I[2].y=b;const B=u[0],M=u[2].x-B.x,q=u[1].y-B.y;for(o=0;o<3;o++){const j=I[o];ae.multiplyByVector(O,j,j),j.x=(j.x-B.x)/M,j.y=(j.y-B.y)/q}const P=I[0],V=I[1],k=I[2],H=new Array(6);return U.pack(P,H),U.pack(V,H,2),U.pack(k,H,4),H};function Bt(e){if(e=_(e,_.EMPTY_OBJECT),!h(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!h(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!h(e.values))throw new C("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=_(e.normalize,!1),this.values=e.values}function vo(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(vo.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}},arrayBufferView:{get:function(){return this._buffer}}}),vo.clone=function(e){if(h(e))return new vo(e._format,e._datatype,e._width,e._height,e._buffer)},vo.prototype.clone=function(){return vo.clone(this)};function uu(){if(!h(bt._canTransferArrayBuffer)){const e=Dc("transferTypedArrayTest");e.postMessage=_(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return bt._canTransferArrayBuffer=!1,bt._canTransferArrayBuffer}bt._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){const s=o.data.array,a=h(s)&&s[0]===t;i(a),e.terminate(),bt._canTransferArrayBuffer=a}})}return bt._canTransferArrayBuffer}const Sc=new Pe;function Ac(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new o;s.append(e),t=s.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function Dc(e){const t=new ci(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={};let s,a;if(nc(e))a=e;else if(!n){const c=hn(`${bt._workerModulePrefix}/${i}.js`);nc(c)&&(a=c)}if(a){const c=`import "${a}";`;return s=Ac(c),o.type="module",new Worker(s,o)}if(!n&&typeof CESIUM_WORKERS<"u"){const c=`
49
49
  importScripts("${Ac(CESIUM_WORKERS)}");
50
50
  CesiumWorkers["${i}"]();
51
- `;return s=Ac(c),new Worker(s,o)}if(s=e,n||(s=hn(`${bt._workerModulePrefix+i}.js`)),!_t.supportsEsmWebWorkers())throw new at("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function Vy(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!_t.supportsWebAssembly()){if(!h(t.fallbackModulePath))throw new at(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=hn(t.fallbackModulePath),n}n.wasmBinaryFile=hn(t.wasmBinaryFile);const i=await ne.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function bt(e,t){this._workerPath=e,this._maximumActiveTasks=_(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Gy=(e,t,n,i)=>{const o=({data:s})=>{if(s.id===t){if(h(s.error)){let a=s.error;a.name==="RuntimeError"?(a=new at(s.error.message),a.stack=s.error.stack):a.name==="DeveloperError"?(a=new C(s.error.message),a.stack=s.error.stack):a.name==="Error"&&(a=new Error(s.error.message),a.stack=s.error.stack),Sc.raiseEvent(a),i(a)}else Sc.raiseEvent(),n(s.result);e.removeEventListener("message",o)}};return o},qy=[];async function Hy(e,t,n){const i=await Promise.resolve(uu());h(n)?i||(n.length=0):n=qy;const o=e._nextID++,s=new Promise((a,c)=>{e._worker.addEventListener("message",Gy(e._worker,o,a,c))});return e._worker.postMessage({id:o,baseUrl:hn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),s}async function Wy(e,t,n){++e._activeTasks;try{const i=await Hy(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}bt.prototype.scheduleTask=function(e,t){if(h(this._worker)||(this._worker=Dc(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Wy(this,e,t)},bt.prototype.initWebAssemblyModule=async function(e){if(h(this._webAssemblyPromise))return this._webAssemblyPromise;const t=async()=>{const n=this._worker=Dc(this._workerPath),i=await Vy(this,e),o=await Promise.resolve(uu());let s;const a=i.wasmBinary;h(a)&&o&&(s=[a]);const c=new Promise((l,u)=>{n.onmessage=function({data:d}){h(d)?l(d.result):u(new at("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},s),c};return this._webAssemblyPromise=t(),this._webAssemblyPromise},bt.prototype.isDestroyed=function(){return!1},bt.prototype.destroy=function(){return h(this._worker)&&this._worker.terminate(),Qe(this)},bt.taskCompletedEvent=Sc,bt._defaultWorkerModulePrefix="Workers/",bt._workerModulePrefix=bt._defaultWorkerModulePrefix,bt._canTransferArrayBuffer=void 0;function fi(){}fi._transcodeTaskProcessor=new bt("transcodeKTX2",Number.POSITIVE_INFINITY),fi._readyPromise=void 0;function jy(){const e=fi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return fi._transcodeTaskProcessor;throw new at("KTX2 transcoder could not be initialized.")});fi._readyPromise=e}fi.transcode=function(e,t){return m.defined("supportedTargetFormats",t),h(fi._readyPromise)||jy(),fi._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));const o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){const i=n.length,o=Object.keys(n[0]);for(let s=0;s<i;s++){const a=n[s];for(let c=0;c<o.length;c++){const l=a[o[c]];a[o[c]]=new vo(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(o.length===1){for(let s=0;s<i;++s)n[s]=n[s][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};let du;pu.setKTX2SupportedFormats=function(e,t,n,i,o,s){du={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:s}};function pu(e){m.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=ne.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return fi.transcode(n,du)})}function Gs(e,t,n,i,o,s,a,c,l,u,d){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=o,this._pixelFormat=s,this._size=c,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=d}Object.defineProperties(Gs.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),Gs.prototype.copyFrom=function(e){m.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(m.defined("options.source",i),m.typeOf.number.greaterThanOrEquals("xOffset",t,0),m.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new C("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new C("yOffset + options.source.height must be less than or equal to height.");const{width:s,height:a}=i,c=this._context._gl,l=this._textureTarget,u=this._targetFace;c.activeTexture(c.TEXTURE0),c.bindTexture(l,this._texture);let d=i.arrayBufferView;const p=this._size,g=this._pixelFormat,y=this._internalFormat,x=this._pixelDatatype,E=this._preMultiplyAlpha,b=this._flipY;let D=4;h(d)&&(D=de.alignmentInBytes(g,x,s)),c.pixelStorei(c.UNPACK_ALIGNMENT,D),o?c.pixelStorei(c.UNPACK_COLORSPACE_CONVERSION_WEBGL,c.NONE):c.pixelStorei(c.UNPACK_COLORSPACE_CONVERSION_WEBGL,c.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){let O;t===0&&n===0&&s===p&&a===p?(h(d)?(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),b&&(d=de.flipY(d,g,x,p,p)),O=d):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,b),O=i),A=!0):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),O=de.createTypedArray(g,x,p,p)),c.texImage2D(u,0,y,p,p,0,g,pe.toWebGLConstant(x,this._context),O),this._initialized=!0}A||(h(d)?(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),b&&(d=de.flipY(d,g,x,s,a)),c.texSubImage2D(u,0,t,n,s,a,g,pe.toWebGLConstant(x,this._context),d)):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,b),c.texSubImage2D(u,0,t,n,g,pe.toWebGLConstant(x,this._context),i))),c.bindTexture(l,null)},Gs.prototype.copyFromFramebuffer=function(e,t,n,i,o,s){if(e=_(e,0),t=_(t,0),n=_(n,0),i=_(i,0),o=_(o,this._size),s=_(s,this._size),m.typeOf.number.greaterThanOrEquals("xOffset",e,0),m.typeOf.number.greaterThanOrEquals("yOffset",t,0),m.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),m.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+s>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===pe.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===pe.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");const a=this._context._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,s),a.bindTexture(c,null),this._initialized=!0};const qs={DONT_CARE:R.DONT_CARE,FASTEST:R.FASTEST,NICEST:R.NICEST,validate:function(e){return e===qs.DONT_CARE||e===qs.FASTEST||e===qs.NICEST}},Hs=Object.freeze(qs),Ws={NEAREST:R.NEAREST,LINEAR:R.LINEAR};Ws.validate=function(e){return e===Ws.NEAREST||e===Ws.LINEAR};const Qi=Object.freeze(Ws),Pi={NEAREST:R.NEAREST,LINEAR:R.LINEAR,NEAREST_MIPMAP_NEAREST:R.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:R.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:R.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:R.LINEAR_MIPMAP_LINEAR};Pi.validate=function(e){return e===Pi.NEAREST||e===Pi.LINEAR||e===Pi.NEAREST_MIPMAP_NEAREST||e===Pi.LINEAR_MIPMAP_NEAREST||e===Pi.NEAREST_MIPMAP_LINEAR||e===Pi.LINEAR_MIPMAP_LINEAR};const Mt=Object.freeze(Pi),js={CLAMP_TO_EDGE:R.CLAMP_TO_EDGE,REPEAT:R.REPEAT,MIRRORED_REPEAT:R.MIRRORED_REPEAT,validate:function(e){return e===js.CLAMP_TO_EDGE||e===js.REPEAT||e===js.MIRRORED_REPEAT}},Io=Object.freeze(js);function Yn(e){e=_(e,_.EMPTY_OBJECT);const{wrapS:t=Io.CLAMP_TO_EDGE,wrapT:n=Io.CLAMP_TO_EDGE,minificationFilter:i=Mt.LINEAR,magnificationFilter:o=Qi.LINEAR,maximumAnisotropy:s=1}=e;if(!Io.validate(t))throw new C("Invalid sampler.wrapS.");if(!Io.validate(n))throw new C("Invalid sampler.wrapT.");if(!Mt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!Qi.validate(o))throw new C("Invalid sampler.magnificationFilter.");m.typeOf.number.greaterThanOrEquals("maximumAnisotropy",s,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(Yn.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}}}),Yn.equals=function(e,t){return e===t||h(e)&&h(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},Yn.NEAREST=Object.freeze(new Yn({wrapS:Io.CLAMP_TO_EDGE,wrapT:Io.CLAMP_TO_EDGE,minificationFilter:Mt.NEAREST,magnificationFilter:Qi.NEAREST}));function wt(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=de.RGBA,pixelDatatype:o=pe.UNSIGNED_BYTE,flipY:s=!0,skipColorSpaceConversion:a=!1,sampler:c=new Yn}=e,l=e.preMultiplyAlpha||i===de.RGB||i===de.LUMINANCE;let{width:u,height:d}=e;if(h(n)){if(!Object.values(wt.FaceName).every(O=>h(n[O])))throw new C(`options.source requires faces ${Object.values(wt.FaceName).join(", ")}.`);({width:u,height:d}=n.positiveX);for(const O of wt.getFaceNames()){const I=n[O];if(Number(I.width)!==u||Number(I.height)!==d)throw new C("Each face in options.source must have the same width and height.")}}const p=u;if(!h(u)||!h(d))throw new C("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(u!==d)throw new C("Width must equal height.");if(p<=0)throw new C("Width and height must be greater than zero.");if(p>Ee.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${Ee.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!de.validate(i))throw new C("Invalid options.pixelFormat.");if(de.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!pe.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===pe.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===pe.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");const g=de.textureSizeInBytes(i,o,p,p)*6,y=de.toInternalFormat(i,o,t),x=t._gl,E=x.TEXTURE_CUBE_MAP,b=x.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=E,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=p,this._hasMipmap=!1,this._sizeInBytes=g,this._preMultiplyAlpha=l,this._flipY=s;const D=h(n);function A(O){return new Gs(t,b,E,O,y,i,o,p,l,s,D)}this._positiveX=A(x.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=A(x.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=A(x.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=A(x.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=A(x.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=A(x.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=c,_u(this,c),x.activeTexture(x.TEXTURE0),x.bindTexture(E,b),a?x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.NONE):x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.BROWSER_DEFAULT_WEBGL);for(const O of wt.getFaceNames())mu(this[O],n==null?void 0:n[O],0);x.bindTexture(E,null)}wt.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Yy(){yield wt.FaceName.POSITIVEX,yield wt.FaceName.NEGATIVEX,yield wt.FaceName.POSITIVEY,yield wt.FaceName.NEGATIVEY,yield wt.FaceName.POSITIVEZ,yield wt.FaceName.NEGATIVEZ}wt.getFaceNames=function(){return Yy()};function mu(e,t,n){n=_(n,0);const i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),s=e._pixelFormat,a=e._pixelDatatype,c=e._internalFormat,l=e._flipY,u=e._preMultiplyAlpha,d=e._context,p=d._gl;if(!h(t)){p.texImage2D(i,n,c,o,o,0,s,pe.toWebGLConstant(a,d),null);return}let{arrayBufferView:g}=t,y=4;h(g)&&(y=de.alignmentInBytes(s,a,o)),p.pixelStorei(p.UNPACK_ALIGNMENT,y),h(g)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!1),l&&(g=de.flipY(g,s,a,o,o)),p.texImage2D(i,n,c,o,o,0,s,pe.toWebGLConstant(a,d),g)):(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,l),p.texImage2D(i,n,c,s,pe.toWebGLConstant(a,d),t))}Object.defineProperties(wt.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){_u(this,e),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(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});function _u(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Mt.NEAREST_MIPMAP_NEAREST,Mt.NEAREST_MIPMAP_LINEAR,Mt.LINEAR_MIPMAP_NEAREST,Mt.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelDatatype;(a===pe.FLOAT&&!s.textureFloatLinear||a===pe.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Mt.NEAREST_MIPMAP_NEAREST:Mt.NEAREST,i=Qi.NEAREST);const c=s._gl,l=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(l,e._texture),c.texParameteri(l,c.TEXTURE_MIN_FILTER,n),c.texParameteri(l,c.TEXTURE_MAG_FILTER,i),c.texParameteri(l,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(l,c.TEXTURE_WRAP_T,t.wrapT),h(e._textureFilterAnisotropic)&&c.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(l,null)}wt.prototype.loadMipmaps=function(e,t){if(m.defined("source",e),!Array.isArray(e))throw new C("source must be an array");const n=Math.log2(this._size);if(e.length!==n)throw new C("all mip levels must be defined");t=_(t,!1);const i=this._context._gl,o=this._texture,s=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(s,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let a=0;a<e.length;a++){const c=e[a],l=a+1;for(const u of wt.getFaceNames())mu(this[u],c[u],l)}i.bindTexture(s,null),this._hasMipmap=!0},wt.prototype.generateMipmap=function(e){if(e=_(e,Hs.DONT_CARE),this._size>1&&!S.isPowerOfTwo(this._size))throw new C("width and height must be a power of two to call generateMipmap().");if(!Hs.validate(e))throw new C("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)},wt.prototype.isDestroyed=function(){return!1},wt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=Qe(this._positiveX),this._negativeX=Qe(this._negativeX),this._positiveY=Qe(this._positiveY),this._negativeY=Qe(this._negativeY),this._positiveZ=Qe(this._positiveZ),this._negativeZ=Qe(this._negativeZ),Qe(this)};const Oc={czm_degreesPerRadian:`/**
51
+ `;return s=Ac(c),new Worker(s,o)}if(s=e,n||(s=hn(`${bt._workerModulePrefix+i}.js`)),!_t.supportsEsmWebWorkers())throw new at("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function Vy(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!_t.supportsWebAssembly()){if(!h(t.fallbackModulePath))throw new at(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=hn(t.fallbackModulePath),n}n.wasmBinaryFile=hn(t.wasmBinaryFile);const i=await ne.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function bt(e,t){this._workerPath=e,this._maximumActiveTasks=_(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Gy=(e,t,n,i)=>{const o=({data:s})=>{if(s.id===t){if(h(s.error)){let a=s.error;a.name==="RuntimeError"?(a=new at(s.error.message),a.stack=s.error.stack):a.name==="DeveloperError"?(a=new C(s.error.message),a.stack=s.error.stack):a.name==="Error"&&(a=new Error(s.error.message),a.stack=s.error.stack),Sc.raiseEvent(a),i(a)}else Sc.raiseEvent(),n(s.result);e.removeEventListener("message",o)}};return o},qy=[];async function Hy(e,t,n){const i=await Promise.resolve(uu());h(n)?i||(n.length=0):n=qy;const o=e._nextID++,s=new Promise((a,c)=>{e._worker.addEventListener("message",Gy(e._worker,o,a,c))});return e._worker.postMessage({id:o,baseUrl:hn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),s}async function Wy(e,t,n){++e._activeTasks;try{const i=await Hy(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}bt.prototype.scheduleTask=function(e,t){if(h(this._worker)||(this._worker=Dc(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Wy(this,e,t)},bt.prototype.initWebAssemblyModule=async function(e){if(h(this._webAssemblyPromise))return this._webAssemblyPromise;const t=async()=>{const n=this._worker=Dc(this._workerPath),i=await Vy(this,e),o=await Promise.resolve(uu());let s;const a=i.wasmBinary;h(a)&&o&&(s=[a]);const c=new Promise((l,u)=>{n.onmessage=function({data:d}){h(d)?l(d.result):u(new at("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},s),c};return this._webAssemblyPromise=t(),this._webAssemblyPromise},bt.prototype.isDestroyed=function(){return!1},bt.prototype.destroy=function(){return h(this._worker)&&this._worker.terminate(),Qe(this)},bt.taskCompletedEvent=Sc,bt._defaultWorkerModulePrefix="Workers/",bt._workerModulePrefix=bt._defaultWorkerModulePrefix,bt._canTransferArrayBuffer=void 0;function ui(){}ui._transcodeTaskProcessor=new bt("transcodeKTX2",Number.POSITIVE_INFINITY),ui._readyPromise=void 0;function jy(){const e=ui._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return ui._transcodeTaskProcessor;throw new at("KTX2 transcoder could not be initialized.")});ui._readyPromise=e}ui.transcode=function(e,t){return m.defined("supportedTargetFormats",t),h(ui._readyPromise)||jy(),ui._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));const o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){const i=n.length,o=Object.keys(n[0]);for(let s=0;s<i;s++){const a=n[s];for(let c=0;c<o.length;c++){const l=a[o[c]];a[o[c]]=new vo(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(o.length===1){for(let s=0;s<i;++s)n[s]=n[s][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};let du;pu.setKTX2SupportedFormats=function(e,t,n,i,o,s){du={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:s}};function pu(e){m.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=ne.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return ui.transcode(n,du)})}function Gs(e,t,n,i,o,s,a,c,l,u,d){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=o,this._pixelFormat=s,this._size=c,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=d}Object.defineProperties(Gs.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),Gs.prototype.copyFrom=function(e){m.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(m.defined("options.source",i),m.typeOf.number.greaterThanOrEquals("xOffset",t,0),m.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new C("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new C("yOffset + options.source.height must be less than or equal to height.");const{width:s,height:a}=i,c=this._context._gl,l=this._textureTarget,u=this._targetFace;c.activeTexture(c.TEXTURE0),c.bindTexture(l,this._texture);let d=i.arrayBufferView;const p=this._size,g=this._pixelFormat,y=this._internalFormat,x=this._pixelDatatype,E=this._preMultiplyAlpha,b=this._flipY;let D=4;h(d)&&(D=de.alignmentInBytes(g,x,s)),c.pixelStorei(c.UNPACK_ALIGNMENT,D),o?c.pixelStorei(c.UNPACK_COLORSPACE_CONVERSION_WEBGL,c.NONE):c.pixelStorei(c.UNPACK_COLORSPACE_CONVERSION_WEBGL,c.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){let O;t===0&&n===0&&s===p&&a===p?(h(d)?(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),b&&(d=de.flipY(d,g,x,p,p)),O=d):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,b),O=i),A=!0):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),O=de.createTypedArray(g,x,p,p)),c.texImage2D(u,0,y,p,p,0,g,pe.toWebGLConstant(x,this._context),O),this._initialized=!0}A||(h(d)?(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),b&&(d=de.flipY(d,g,x,s,a)),c.texSubImage2D(u,0,t,n,s,a,g,pe.toWebGLConstant(x,this._context),d)):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,b),c.texSubImage2D(u,0,t,n,g,pe.toWebGLConstant(x,this._context),i))),c.bindTexture(l,null)},Gs.prototype.copyFromFramebuffer=function(e,t,n,i,o,s){if(e=_(e,0),t=_(t,0),n=_(n,0),i=_(i,0),o=_(o,this._size),s=_(s,this._size),m.typeOf.number.greaterThanOrEquals("xOffset",e,0),m.typeOf.number.greaterThanOrEquals("yOffset",t,0),m.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),m.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+s>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===pe.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===pe.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");const a=this._context._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,s),a.bindTexture(c,null),this._initialized=!0};const qs={DONT_CARE:R.DONT_CARE,FASTEST:R.FASTEST,NICEST:R.NICEST,validate:function(e){return e===qs.DONT_CARE||e===qs.FASTEST||e===qs.NICEST}},Hs=Object.freeze(qs),Ws={NEAREST:R.NEAREST,LINEAR:R.LINEAR};Ws.validate=function(e){return e===Ws.NEAREST||e===Ws.LINEAR};const Ji=Object.freeze(Ws),Bi={NEAREST:R.NEAREST,LINEAR:R.LINEAR,NEAREST_MIPMAP_NEAREST:R.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:R.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:R.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:R.LINEAR_MIPMAP_LINEAR};Bi.validate=function(e){return e===Bi.NEAREST||e===Bi.LINEAR||e===Bi.NEAREST_MIPMAP_NEAREST||e===Bi.LINEAR_MIPMAP_NEAREST||e===Bi.NEAREST_MIPMAP_LINEAR||e===Bi.LINEAR_MIPMAP_LINEAR};const Mt=Object.freeze(Bi),js={CLAMP_TO_EDGE:R.CLAMP_TO_EDGE,REPEAT:R.REPEAT,MIRRORED_REPEAT:R.MIRRORED_REPEAT,validate:function(e){return e===js.CLAMP_TO_EDGE||e===js.REPEAT||e===js.MIRRORED_REPEAT}},Io=Object.freeze(js);function Yn(e){e=_(e,_.EMPTY_OBJECT);const{wrapS:t=Io.CLAMP_TO_EDGE,wrapT:n=Io.CLAMP_TO_EDGE,minificationFilter:i=Mt.LINEAR,magnificationFilter:o=Ji.LINEAR,maximumAnisotropy:s=1}=e;if(!Io.validate(t))throw new C("Invalid sampler.wrapS.");if(!Io.validate(n))throw new C("Invalid sampler.wrapT.");if(!Mt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!Ji.validate(o))throw new C("Invalid sampler.magnificationFilter.");m.typeOf.number.greaterThanOrEquals("maximumAnisotropy",s,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(Yn.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}}}),Yn.equals=function(e,t){return e===t||h(e)&&h(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},Yn.NEAREST=Object.freeze(new Yn({wrapS:Io.CLAMP_TO_EDGE,wrapT:Io.CLAMP_TO_EDGE,minificationFilter:Mt.NEAREST,magnificationFilter:Ji.NEAREST}));function wt(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=de.RGBA,pixelDatatype:o=pe.UNSIGNED_BYTE,flipY:s=!0,skipColorSpaceConversion:a=!1,sampler:c=new Yn}=e,l=e.preMultiplyAlpha||i===de.RGB||i===de.LUMINANCE;let{width:u,height:d}=e;if(h(n)){if(!Object.values(wt.FaceName).every(O=>h(n[O])))throw new C(`options.source requires faces ${Object.values(wt.FaceName).join(", ")}.`);({width:u,height:d}=n.positiveX);for(const O of wt.getFaceNames()){const I=n[O];if(Number(I.width)!==u||Number(I.height)!==d)throw new C("Each face in options.source must have the same width and height.")}}const p=u;if(!h(u)||!h(d))throw new C("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(u!==d)throw new C("Width must equal height.");if(p<=0)throw new C("Width and height must be greater than zero.");if(p>Ee.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${Ee.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!de.validate(i))throw new C("Invalid options.pixelFormat.");if(de.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!pe.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===pe.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===pe.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");const g=de.textureSizeInBytes(i,o,p,p)*6,y=de.toInternalFormat(i,o,t),x=t._gl,E=x.TEXTURE_CUBE_MAP,b=x.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=E,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=p,this._hasMipmap=!1,this._sizeInBytes=g,this._preMultiplyAlpha=l,this._flipY=s;const D=h(n);function A(O){return new Gs(t,b,E,O,y,i,o,p,l,s,D)}this._positiveX=A(x.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=A(x.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=A(x.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=A(x.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=A(x.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=A(x.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=c,_u(this,c),x.activeTexture(x.TEXTURE0),x.bindTexture(E,b),a?x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.NONE):x.pixelStorei(x.UNPACK_COLORSPACE_CONVERSION_WEBGL,x.BROWSER_DEFAULT_WEBGL);for(const O of wt.getFaceNames())mu(this[O],n==null?void 0:n[O],0);x.bindTexture(E,null)}wt.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Yy(){yield wt.FaceName.POSITIVEX,yield wt.FaceName.NEGATIVEX,yield wt.FaceName.POSITIVEY,yield wt.FaceName.NEGATIVEY,yield wt.FaceName.POSITIVEZ,yield wt.FaceName.NEGATIVEZ}wt.getFaceNames=function(){return Yy()};function mu(e,t,n){n=_(n,0);const i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),s=e._pixelFormat,a=e._pixelDatatype,c=e._internalFormat,l=e._flipY,u=e._preMultiplyAlpha,d=e._context,p=d._gl;if(!h(t)){p.texImage2D(i,n,c,o,o,0,s,pe.toWebGLConstant(a,d),null);return}let{arrayBufferView:g}=t,y=4;h(g)&&(y=de.alignmentInBytes(s,a,o)),p.pixelStorei(p.UNPACK_ALIGNMENT,y),h(g)?(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,!1),l&&(g=de.flipY(g,s,a,o,o)),p.texImage2D(i,n,c,o,o,0,s,pe.toWebGLConstant(a,d),g)):(p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,l),p.texImage2D(i,n,c,s,pe.toWebGLConstant(a,d),t))}Object.defineProperties(wt.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){_u(this,e),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(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});function _u(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Mt.NEAREST_MIPMAP_NEAREST,Mt.NEAREST_MIPMAP_LINEAR,Mt.LINEAR_MIPMAP_NEAREST,Mt.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelDatatype;(a===pe.FLOAT&&!s.textureFloatLinear||a===pe.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Mt.NEAREST_MIPMAP_NEAREST:Mt.NEAREST,i=Ji.NEAREST);const c=s._gl,l=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(l,e._texture),c.texParameteri(l,c.TEXTURE_MIN_FILTER,n),c.texParameteri(l,c.TEXTURE_MAG_FILTER,i),c.texParameteri(l,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(l,c.TEXTURE_WRAP_T,t.wrapT),h(e._textureFilterAnisotropic)&&c.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(l,null)}wt.prototype.loadMipmaps=function(e,t){if(m.defined("source",e),!Array.isArray(e))throw new C("source must be an array");const n=Math.log2(this._size);if(e.length!==n)throw new C("all mip levels must be defined");t=_(t,!1);const i=this._context._gl,o=this._texture,s=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(s,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let a=0;a<e.length;a++){const c=e[a],l=a+1;for(const u of wt.getFaceNames())mu(this[u],c[u],l)}i.bindTexture(s,null),this._hasMipmap=!0},wt.prototype.generateMipmap=function(e){if(e=_(e,Hs.DONT_CARE),this._size>1&&!S.isPowerOfTwo(this._size))throw new C("width and height must be a power of two to call generateMipmap().");if(!Hs.validate(e))throw new C("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)},wt.prototype.isDestroyed=function(){return!1},wt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=Qe(this._positiveX),this._negativeX=Qe(this._negativeX),this._positiveY=Qe(this._positiveY),this._negativeY=Qe(this._negativeY),this._positiveZ=Qe(this._positiveZ),this._negativeZ=Qe(this._negativeZ),Qe(this)};const Oc={czm_degreesPerRadian:`/**
52
52
  * A built-in GLSL floating-point constant for converting radians to degrees.
53
53
  *
54
54
  * @alias czm_degreesPerRadian
@@ -3828,8 +3828,8 @@ void main()
3828
3828
  }
3829
3829
  out_FragColor = czm_pickColor;
3830
3830
  }`;return`${n}
3831
- ${i}`};function Ky(e,t){const n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function Eu(e,t){const n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function bu(e,t){const n=t.length;for(let i=0;i<n;++i){const o=t[i];if(Eu(e,o))return o}}const Qy=["v_normalEC","v_normal"];ye.findNormalVarying=function(e){return Eu(e,"#ifdef HAS_NORMALS")?Ky(e,"HAS_NORMALS")?"v_normalEC":void 0:bu(e,Qy)};const Jy=["v_positionEC"];ye.findPositionVarying=function(e){return bu(e,Jy)};function Nt(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=de.RGBA,pixelDatatype:o=pe.UNSIGNED_BYTE,flipY:s=!0,skipColorSpaceConversion:a=!1,sampler:c=new Yn}=e;let{width:l,height:u}=e;h(n)&&(h(l)||(l=n.videoWidth??n.naturalWidth??n.width),h(u)||(u=n.videoHeight??n.naturalHeight??n.height));const d=e.preMultiplyAlpha||i===de.RGB||i===de.LUMINANCE,p=de.toInternalFormat(i,o,t),g=de.isCompressedFormat(p);if(!h(l)||!h(u))throw new C("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(m.typeOf.number.greaterThan("width",l,0),l>Ee.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${Ee.maximumTextureSize}). Check maximumTextureSize.`);if(m.typeOf.number.greaterThan("height",u,0),u>Ee.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${Ee.maximumTextureSize}). Check maximumTextureSize.`);if(!de.validate(i))throw new C("Invalid options.pixelFormat.");if(!g&&!pe.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===de.DEPTH_COMPONENT&&o!==pe.UNSIGNED_SHORT&&o!==pe.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===de.DEPTH_STENCIL&&o!==pe.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===pe.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===pe.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(de.isDepthFormat(i)){if(h(n))throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(g){if(!h(n)||!h(n.arrayBufferView))throw new C("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(de.isDXTFormat(p)&&!t.s3tc)throw new C("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(de.isPVRTCFormat(p)&&!t.pvrtc)throw new C("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(de.isASTCFormat(p)&&!t.astc)throw new C("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(de.isETC2Format(p)&&!t.etc)throw new C("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(de.isETC1Format(p)&&!t.etc1)throw new C("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(de.isBC7Format(p)&&!t.bc7)throw new C("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(de.compressedTextureSizeInBytes(p,l,u)!==n.arrayBufferView.byteLength)throw new C("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const y=t._gl,x=g?de.compressedTextureSizeInBytes(i,l,u):de.textureSizeInBytes(i,o,l,u);this._id=Vn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y.TEXTURE_2D,this._texture=y.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=l,this._height=u,this._dimensions=new U(l,u),this._hasMipmap=!1,this._sizeInBytes=x,this._preMultiplyAlpha=d,this._flipY=s,this._initialized=!1,this._sampler=void 0,this._sampler=c,wu(this,c),y.activeTexture(y.TEXTURE0),y.bindTexture(this._textureTarget,this._texture),h(n)?(a?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),h(n.arrayBufferView)?de.isCompressedFormat(p)?ex(this,n):tx(this,n):h(n.framebuffer)?nx(this,n):ix(this,n),this._initialized=!0):ox(this),y.bindTexture(this._textureTarget,null)}function ex(e,t){const i=e._context._gl,o=e._textureTarget,s=e._internalFormat,{width:a,height:c}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,s,a,c,0,t.arrayBufferView),h(t.mipLevels)){let l=a,u=c;for(let d=0;d<t.mipLevels.length;++d)l=Ys(l),u=Ys(u),i.compressedTexImage2D(o,d+1,s,l,u,0,t.mipLevels[d])}}function tx(e,t){const n=e._context,i=n._gl,o=e._textureTarget,s=e._internalFormat,{width:a,height:c,pixelFormat:l,pixelDatatype:u,flipY:d}=e,p=de.alignmentInBytes(l,u,a);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let g=t.arrayBufferView;if(d&&(g=de.flipY(g,l,u,a,c)),i.texImage2D(o,0,s,a,c,0,l,pe.toWebGLConstant(u,n),g),h(t.mipLevels)){let y=a,x=c;for(let E=0;E<t.mipLevels.length;++E)y=Ys(y),x=Ys(x),i.texImage2D(o,E+1,s,y,x,0,l,pe.toWebGLConstant(u,n),t.mipLevels[E])}}function nx(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function ix(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,pe.toWebGLConstant(e.pixelDatatype,n),t)}function Ys(e){const t=Math.floor(e/2)|0;return Math.max(t,1)}function ox(e){const t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,pe.toWebGLConstant(e._pixelDatatype,t),null)}Nt.create=function(e){return new Nt(e)},Nt.fromFramebuffer=function(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const t=e.context,n=t._gl,{pixelFormat:i=de.RGB,framebufferXOffset:o=0,framebufferYOffset:s=0,width:a=n.drawingBufferWidth,height:c=n.drawingBufferHeight,framebuffer:l}=e;if(!de.validate(i))throw new C("Invalid pixelFormat.");if(de.isDepthFormat(i)||de.isCompressedFormat(i))throw new C("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(m.defined("options.context",t),m.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),m.typeOf.number.greaterThanOrEquals("framebufferYOffset",s,0),o+a>n.drawingBufferWidth)throw new C("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(s+c>n.drawingBufferHeight)throw new C("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Nt({context:t,width:a,height:c,pixelFormat:i,source:{framebuffer:h(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:s,width:a,height:c}})},Object.defineProperties(Nt.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){wu(this,e),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(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function wu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Mt.NEAREST_MIPMAP_NEAREST,Mt.NEAREST_MIPMAP_LINEAR,Mt.LINEAR_MIPMAP_NEAREST,Mt.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelFormat,c=e._pixelDatatype;(c===pe.FLOAT&&!s.textureFloatLinear||c===pe.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Mt.NEAREST_MIPMAP_NEAREST:Mt.NEAREST,i=Qi.NEAREST),s.webgl2&&de.isDepthFormat(a)&&(n=Mt.NEAREST,i=Qi.NEAREST);const l=s._gl,u=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,e._texture),l.texParameteri(u,l.TEXTURE_MIN_FILTER,n),l.texParameteri(u,l.TEXTURE_MAG_FILTER,i),l.texParameteri(u,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(u,l.TEXTURE_WRAP_T,t.wrapT),h(e._textureFilterAnisotropic)&&l.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(u,null)}Nt.prototype.copyFrom=function(e){m.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(m.defined("options.source",i),de.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(de.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");m.typeOf.number.greaterThanOrEquals("xOffset",t,0),m.typeOf.number.greaterThanOrEquals("yOffset",n,0),m.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),m.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);const s=this._context,a=s._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let{width:l,height:u}=i;const d=i.arrayBufferView;h(i.videoWidth)&&h(i.videoHeight)?(l=i.videoWidth,u=i.videoHeight):h(i.naturalWidth)&&h(i.naturalHeight)&&(l=i.naturalWidth,u=i.naturalHeight);const p=this._width,g=this._height,y=this._internalFormat,x=this._pixelFormat,E=this._pixelDatatype,b=this._preMultiplyAlpha,D=this._flipY;let A=4;h(d)&&(A=de.alignmentInBytes(x,E,l)),a.pixelStorei(a.UNPACK_ALIGNMENT,A),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let O=!1;if(!this._initialized){let I;t===0&&n===0&&l===p&&u===g?(h(d)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),D?I=de.flipY(d,x,E,p,g):I=d):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,D),I=i),O=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),I=de.createTypedArray(x,E,p,g)),a.texImage2D(c,0,y,p,g,0,x,pe.toWebGLConstant(E,s),I),this._initialized=!0}if(!O){let I;h(d)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),D?I=de.flipY(d,x,E,l,u):I=d):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,D),I=i),a.texSubImage2D(c,0,t,n,l,u,x,pe.toWebGLConstant(E,s),I)}a.bindTexture(c,null)},Nt.prototype.copyFromFramebuffer=function(e,t,n,i,o,s){if(e=_(e,0),t=_(t,0),n=_(n,0),i=_(i,0),o=_(o,this._width),s=_(s,this._height),de.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===pe.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===pe.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(de.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");m.typeOf.number.greaterThanOrEquals("xOffset",e,0),m.typeOf.number.greaterThanOrEquals("yOffset",t,0),m.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),m.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),m.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),m.typeOf.number.lessThanOrEquals("yOffset + height",t+s,this._height);const a=this._context._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.copyTexSubImage2D(c,0,e,t,n,i,o,s),a.bindTexture(c,null),this._initialized=!0},Nt.prototype.generateMipmap=function(e){if(e=_(e,Hs.DONT_CARE),de.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(de.isCompressedFormat(this._pixelFormat))throw new C("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!S.isPowerOfTwo(this._width))throw new C("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!S.isPowerOfTwo(this._height))throw new C("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!Hs.validate(e))throw new C("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)},Nt.prototype.isDestroyed=function(){return!1},Nt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),Qe(this)};function Ye(){this.high=f.clone(f.ZERO),this.low=f.clone(f.ZERO)}Ye.encode=function(e,t){m.typeOf.number("value",e),h(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};const ui={high:0,low:0};Ye.fromCartesian=function(e,t){m.typeOf.object("cartesian",e),h(t)||(t=new Ye);const n=t.high,i=t.low;return Ye.encode(e.x,ui),n.x=ui.high,i.x=ui.low,Ye.encode(e.y,ui),n.y=ui.high,i.y=ui.low,Ye.encode(e.z,ui),n.z=ui.high,i.z=ui.low,t};const vc=new Ye;Ye.writeElements=function(e,t,n){m.defined("cartesianArray",t),m.typeOf.number("index",n),m.typeOf.number.greaterThanOrEquals("index",n,0),Ye.fromCartesian(e,vc);const i=vc.high,o=vc.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};function Ne(e,t){if(m.typeOf.object("normal",e),!S.equalsEpsilon(f.magnitude(e),1,S.EPSILON6))throw new C("normal must be normalized.");m.typeOf.number("distance",t),this.normal=f.clone(e),this.distance=t}Ne.fromPointNormal=function(e,t,n){if(m.typeOf.object("point",e),m.typeOf.object("normal",t),!S.equalsEpsilon(f.magnitude(t),1,S.EPSILON6))throw new C("normal must be normalized.");const i=-f.dot(t,e);return h(n)?(f.clone(t,n.normal),n.distance=i,n):new Ne(t,i)};const rx=new f;Ne.fromCartesian4=function(e,t){m.typeOf.object("coefficients",e);const n=f.fromCartesian4(e,rx),i=e.w;if(!S.equalsEpsilon(f.magnitude(n),1,S.EPSILON6))throw new C("normal must be normalized.");return h(t)?(f.clone(n,t.normal),t.distance=i,t):new Ne(n,i)},Ne.getPointDistance=function(e,t){return m.typeOf.object("plane",e),m.typeOf.object("point",t),f.dot(e.normal,t)+e.distance};const sx=new f;Ne.projectPointOntoPlane=function(e,t,n){m.typeOf.object("plane",e),m.typeOf.object("point",t),h(n)||(n=new f);const i=Ne.getPointDistance(e,t),o=f.multiplyByScalar(e.normal,i,sx);return f.subtract(t,o,n)};const ax=new N,cx=new Y,lx=new f;Ne.transform=function(e,t,n){m.typeOf.object("plane",e),m.typeOf.object("transform",t);const i=e.normal,o=e.distance,s=N.inverseTranspose(t,ax);let a=Y.fromElements(i.x,i.y,i.z,o,cx);a=N.multiplyByVector(s,a,a);const c=f.fromCartesian4(a,lx);return a=Y.divideByScalar(a,f.magnitude(c),a),Ne.fromCartesian4(a,n)},Ne.clone=function(e,t){return m.typeOf.object("plane",e),h(t)?(f.clone(e.normal,t.normal),t.distance=e.distance,t):new Ne(e.normal,e.distance)},Ne.equals=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.distance===t.distance&&f.equals(e.normal,t.normal)},Ne.ORIGIN_XY_PLANE=Object.freeze(new Ne(f.UNIT_Z,0)),Ne.ORIGIN_YZ_PLANE=Object.freeze(new Ne(f.UNIT_X,0)),Ne.ORIGIN_ZX_PLANE=Object.freeze(new Ne(f.UNIT_Y,0));function yn(e){this.planes=_(e,[])}const cr=[new f,new f,new f];f.clone(f.UNIT_X,cr[0]),f.clone(f.UNIT_Y,cr[1]),f.clone(f.UNIT_Z,cr[2]);const Bi=new f,hx=new f,Tu=new Ne(new f(1,0,0),0);yn.fromBoundingSphere=function(e,t){if(!h(e))throw new C("boundingSphere is required.");h(t)||(t=new yn);const n=cr.length,i=t.planes;i.length=2*n;const o=e.center,s=e.radius;let a=0;for(let c=0;c<n;++c){const l=cr[c];let u=i[a],d=i[a+1];h(u)||(u=i[a]=new Y),h(d)||(d=i[a+1]=new Y),f.multiplyByScalar(l,-s,Bi),f.add(o,Bi,Bi),u.x=l.x,u.y=l.y,u.z=l.z,u.w=-f.dot(l,Bi),f.multiplyByScalar(l,s,Bi),f.add(o,Bi,Bi),d.x=-l.x,d.y=-l.y,d.z=-l.z,d.w=-f.dot(f.negate(l,hx),Bi),a+=2}return t},yn.prototype.computeVisibility=function(e){if(!h(e))throw new C("boundingVolume is required.");const t=this.planes;let n=!1;for(let i=0,o=t.length;i<o;++i){const s=e.intersectPlane(Ne.fromCartesian4(t[i],Tu));if(s===Et.OUTSIDE)return Et.OUTSIDE;s===Et.INTERSECTING&&(n=!0)}return n?Et.INTERSECTING:Et.INSIDE},yn.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!h(e))throw new C("boundingVolume is required.");if(!h(t))throw new C("parentPlaneMask is required.");if(t===yn.MASK_OUTSIDE||t===yn.MASK_INSIDE)return t;let n=yn.MASK_INSIDE;const i=this.planes;for(let o=0,s=i.length;o<s;++o){const a=o<31?1<<o:0;if(o<31&&!(t&a))continue;const c=e.intersectPlane(Ne.fromCartesian4(i[o],Tu));if(c===Et.OUTSIDE)return yn.MASK_OUTSIDE;c===Et.INTERSECTING&&(n|=a)}return n},yn.MASK_OUTSIDE=4294967295,yn.MASK_INSIDE=0,yn.MASK_INDETERMINATE=2147483647;function vn(e){e=_(e,_.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=_(e.near,1),this._near=this.near,this.far=_(e.far,5e8),this._far=this.far,this._cullingVolume=new yn,this._orthographicMatrix=new N}function Su(e){if(!h(e.right)||!h(e.left)||!h(e.top)||!h(e.bottom)||!h(e.near)||!h(e.far))throw new C("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 C("right must be greater than left.");if(e.bottom>e.top)throw new C("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new C("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=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(vn.prototype,{projectionMatrix:{get:function(){return Su(this),this._orthographicMatrix}}});const fx=new f,ux=new f,dx=new f,Ic=new f;vn.prototype.computeCullingVolume=function(e,t,n){if(!h(e))throw new C("position is required.");if(!h(t))throw new C("direction is required.");if(!h(n))throw new C("up is required.");const i=this._cullingVolume.planes,o=this.top,s=this.bottom,a=this.right,c=this.left,l=this.near,u=this.far,d=f.cross(t,n,fx);f.normalize(d,d);const p=ux;f.multiplyByScalar(t,l,p),f.add(e,p,p);const g=dx;f.multiplyByScalar(d,c,g),f.add(p,g,g);let y=i[0];return h(y)||(y=i[0]=new Y),y.x=d.x,y.y=d.y,y.z=d.z,y.w=-f.dot(d,g),f.multiplyByScalar(d,a,g),f.add(p,g,g),y=i[1],h(y)||(y=i[1]=new Y),y.x=-d.x,y.y=-d.y,y.z=-d.z,y.w=-f.dot(f.negate(d,Ic),g),f.multiplyByScalar(n,s,g),f.add(p,g,g),y=i[2],h(y)||(y=i[2]=new Y),y.x=n.x,y.y=n.y,y.z=n.z,y.w=-f.dot(n,g),f.multiplyByScalar(n,o,g),f.add(p,g,g),y=i[3],h(y)||(y=i[3]=new Y),y.x=-n.x,y.y=-n.y,y.z=-n.z,y.w=-f.dot(f.negate(n,Ic),g),y=i[4],h(y)||(y=i[4]=new Y),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-f.dot(t,p),f.multiplyByScalar(t,u,g),f.add(e,g,g),y=i[5],h(y)||(y=i[5]=new Y),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-f.dot(f.negate(t,Ic),g),this._cullingVolume},vn.prototype.getPixelDimensions=function(e,t,n,i,o){if(Su(this),!h(e)||!h(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!h(n))throw new C("distance is required.");if(!h(i))throw new C("pixelRatio is required.");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!h(o))throw new C("A result object is required.");const s=this.right-this.left,a=this.top-this.bottom,c=i*s/e,l=i*a/t;return o.x=c,o.y=l,o},vn.prototype.clone=function(e){return h(e)||(e=new vn),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},vn.prototype.equals=function(e){return h(e)&&e instanceof vn&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},vn.prototype.equalsEpsilon=function(e,t,n){return e===this||h(e)&&e instanceof vn&&S.equalsEpsilon(this.right,e.right,t,n)&&S.equalsEpsilon(this.left,e.left,t,n)&&S.equalsEpsilon(this.top,e.top,t,n)&&S.equalsEpsilon(this.bottom,e.bottom,t,n)&&S.equalsEpsilon(this.near,e.near,t,n)&&S.equalsEpsilon(this.far,e.far,t,n)};function rn(e){e=_(e,_.EMPTY_OBJECT),this._offCenterFrustum=new vn,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=_(e.near,1),this._near=this.near,this.far=_(e.far,5e8),this._far=this.far}rn.packedLength=4,rn.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t},rn.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new rn),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Ni(e){if(!h(e.width)||!h(e.aspectRatio)||!h(e.near)||!h(e.far))throw new C("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 C("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new C("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=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(rn.prototype,{projectionMatrix:{get:function(){return Ni(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Ni(this),this._offCenterFrustum}}}),rn.prototype.computeCullingVolume=function(e,t,n){return Ni(this),this._offCenterFrustum.computeCullingVolume(e,t,n)},rn.prototype.getPixelDimensions=function(e,t,n,i,o){return Ni(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)},rn.prototype.clone=function(e){return h(e)||(e=new rn),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},rn.prototype.equals=function(e){return!h(e)||!(e instanceof rn)?!1:(Ni(this),Ni(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},rn.prototype.equalsEpsilon=function(e,t,n){return!h(e)||!(e instanceof rn)?!1:(Ni(this),Ni(e),S.equalsEpsilon(this.width,e.width,t,n)&&S.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};const Xs={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Xs.getMorphTime=function(e){return e===Xs.SCENE3D?1:e===Xs.MORPHING?void 0:0};const me=Object.freeze(Xs);function px(e,t,n,i){const o=h(t.vertexBuffer),s=h(t.value),a=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!s)throw new C("attribute must have a vertexBuffer or a value.");if(o&&s)throw new C("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(a!==1&&a!==2&&a!==3&&a!==4)throw s?new C("attribute.value.length must be in the range [1, 4]."):new C("attribute.componentsPerAttribute must be in the range [1, 4].");if(h(t.componentDatatype)&&!oe.validate(t.componentDatatype))throw new C("attribute must have a valid componentDatatype or not specify it.");if(h(t.strideInBytes)&&t.strideInBytes>255)throw new C("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(h(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new C("instanced arrays is not supported");if(h(t.instanceDivisor)&&t.instanceDivisor<0)throw new C("attribute must have an instanceDivisor greater than or equal to zero");if(h(t.instanceDivisor)&&s)throw new C("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(h(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new C("attribute zero cannot have an instanceDivisor greater than 0");const c={index:_(t.index,n),enabled:_(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:s?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:_(t.componentDatatype,oe.FLOAT),normalize:_(t.normalize,!1),offsetInBytes:_(t.offsetInBytes,0),strideInBytes:_(t.strideInBytes,0),instanceDivisor:_(t.instanceDivisor,0)};if(o)c.vertexAttrib=function(l){const u=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}c.disableVertexAttribArray=function(l){}}e.push(c)}function Au(e,t,n){for(let i=0;i<t.length;++i){const o=t[i];o.enabled&&o.vertexAttrib(e)}h(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Xn(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),m.defined("options.attributes",e.attributes);const t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer;let s;const a=[];let c=1,l=!1,u=!1,d=i.length;for(s=0;s<d;++s)px(a,i[s],s,t);for(d=a.length,s=0;s<d;++s){const y=a[s];if(h(y.vertexBuffer)&&y.instanceDivisor===0){const x=y.strideInBytes||y.componentsPerAttribute*oe.getSizeInBytes(y.componentDatatype);c=y.vertexBuffer.sizeInBytes/x;break}}for(s=0;s<d;++s)a[s].instanceDivisor>0&&(l=!0),h(a[s].value)&&(u=!0);const p={};for(s=0;s<d;++s){const y=a[s].index;if(p[y])throw new C(`Index ${y} is used by more than one attribute.`);p[y]=!0}let g;t.vertexArrayObject&&(g=t.glCreateVertexArray(),t.glBindVertexArray(g),Au(n,a,o),t.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=l,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=g,this._attributes=a,this._indexBuffer=o}function Du(e){return e.values.length/e.componentsPerAttribute}function mx(e){return oe.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function _x(e){let t,n,i;const o=[];for(n in e)e.hasOwnProperty(n)&&h(e[n])&&h(e[n].values)&&(o.push(n),e[n].componentDatatype===oe.DOUBLE&&(e[n].componentDatatype=oe.FLOAT,e[n].values=oe.createTypedArray(oe.FLOAT,e[n].values)));let s;const a=o.length;if(a>0)for(s=Du(e[o[0]]),t=1;t<a;++t){const u=Du(e[o[t]]);if(u!==s)throw new at(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${s.toString()}).`)}o.sort(function(u,d){return oe.getSizeInBytes(e[d].componentDatatype)-oe.getSizeInBytes(e[u].componentDatatype)});let c=0;const l={};for(t=0;t<a;++t)n=o[t],i=e[n],l[n]=c,c+=mx(i);if(c>0){const u=oe.getSizeInBytes(e[o[0]].componentDatatype),d=c%u;d!==0&&(c+=u-d);const p=s*c,g=new ArrayBuffer(p),y={};for(t=0;t<a;++t){n=o[t];const x=oe.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:oe.createTypedArray(e[n].componentDatatype,g),index:l[n]/x,strideInComponentType:c/x}}for(t=0;t<s;++t)for(let x=0;x<a;++x){n=o[x],i=e[n];const E=i.values,b=y[n],D=b.pointer,A=i.componentsPerAttribute;for(let O=0;O<A;++O)D[b.index+O]=E[t*A+O];b.index+=b.strideInComponentType}return{buffer:g,offsetsInBytes:l,vertexSizeInBytes:c}}}Xn.fromGeometry=function(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const t=e.context,n=_(e.geometry,_.EMPTY_OBJECT),i=_(e.bufferUsage,De.DYNAMIC_DRAW),o=_(e.attributeLocations,_.EMPTY_OBJECT),s=_(e.interleave,!1),a=e.vertexArrayAttributes;let c,l,u;const d=h(a)?a:[],p=n.attributes;if(s){const x=_x(p);if(h(x)){u=vt.createVertexBuffer({context:t,typedArray:x.buffer,usage:i});const E=x.offsetsInBytes,b=x.vertexSizeInBytes;for(c in p)p.hasOwnProperty(c)&&h(p[c])&&(l=p[c],h(l.values)?d.push({index:o[c],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:E[c],strideInBytes:b}):d.push({index:o[c],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(c in p)if(p.hasOwnProperty(c)&&h(p[c])){l=p[c];let x=l.componentDatatype;x===oe.DOUBLE&&(x=oe.FLOAT),u=void 0,h(l.values)&&(u=vt.createVertexBuffer({context:t,typedArray:oe.createTypedArray(x,l.values),usage:i})),d.push({index:o[c],vertexBuffer:u,value:l.value,componentDatatype:x,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize})}let g;const y=n.indices;return h(y)&&(ht.computeNumberOfVertices(n)>=S.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?g=vt.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:Ct.UNSIGNED_INT}):g=vt.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:Ct.UNSIGNED_SHORT})),new Xn({context:t,attributes:d,indexBuffer:g})},Object.defineProperties(Xn.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),Xn.prototype.getAttribute=function(e){return m.defined("index",e),this._attributes[e]};function gx(e){const t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;const i=t._vertexAttribDivisors,o=e._attributes,s=Ee.maximumVertexAttributes;let a;if(n){const c=o.length;for(a=0;a<c;++a){const l=o[a];if(l.enabled){const u=l.instanceDivisor,d=l.index;u!==i[d]&&(t.glVertexAttribDivisor(d,u),i[d]=u)}}}else for(a=0;a<s;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}function yx(e,t){const n=e._attributes,i=n.length;for(let o=0;o<i;++o){const s=n[o];s.enabled&&h(s.value)&&s.vertexAttrib(t)}}Xn.prototype._bind=function(){h(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&gx(this),this._hasConstantAttributes&&yx(this,this._gl)):Au(this._gl,this._attributes,this._indexBuffer)},Xn.prototype._unBind=function(){if(h(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)}},Xn.prototype.isDestroyed=function(){return!1},Xn.prototype.destroy=function(){const e=this._attributes;for(let n=0;n<e.length;++n){const i=e[n].vertexBuffer;h(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}const t=this._indexBuffer;return h(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),h(this._vao)&&this._context.glDeleteVertexArray(this._vao),Qe(this)};function Tt(e,t,n,i){if(m.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");const o=Tt._verifyAttributes(t);n=_(n,0);const s=[],a={};let c,l;const u=o.length;for(let p=0;p<u;++p){const g=o[p];if(g.vertexBuffer){s.push(g);continue}l=g.usage,c=a[l],h(c)||(c=a[l]=[]),c.push(g)}function d(p,g){return oe.getSizeInBytes(g.componentDatatype)-oe.getSizeInBytes(p.componentDatatype)}this._allBuffers=[];for(l in a)if(a.hasOwnProperty(l)){c=a[l],c.sort(d);const p=Tt._vertexSizeInBytes(c),g=c[0].usage,y={vertexSizeInBytes:p,vertexBuffer:void 0,usage:g,needsCommit:!1,arrayBuffer:void 0,arrayViews:Tt._createArrayViews(c,p)};this._allBuffers.push(y)}this._size=0,this._instanced=_(i,!1),this._precreated=s,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Tt._verifyAttributes=function(e){const t=[];for(let i=0;i<e.length;++i){const o=e[i],s={index:_(o.index,i),enabled:_(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:_(o.componentDatatype,oe.FLOAT),normalize:_(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:_(o.usage,De.STATIC_DRAW)};if(t.push(s),s.componentsPerAttribute!==1&&s.componentsPerAttribute!==2&&s.componentsPerAttribute!==3&&s.componentsPerAttribute!==4)throw new C("attribute.componentsPerAttribute must be in the range [1, 4].");const a=s.componentDatatype;if(!oe.validate(a))throw new C("Attribute must have a valid componentDatatype or not specify it.");if(!De.validate(s.usage))throw new C("Attribute must have a valid usage or not specify it.")}const n=new Array(t.length);for(let i=0;i<t.length;++i){const s=t[i].index;if(n[s])throw new C(`Index ${s} is used by more than one attribute.`);n[s]=!0}return t},Tt._vertexSizeInBytes=function(e){let t=0;const n=e.length;for(let a=0;a<n;++a){const c=e[a];t+=c.componentsPerAttribute*oe.getSizeInBytes(c.componentDatatype)}const i=n>0?oe.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,s=o===0?0:i-o;return t+=s,t},Tt._createArrayViews=function(e,t){const n=[];let i=0;const o=e.length;for(let s=0;s<o;++s){const a=e[s],c=a.componentDatatype;n.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:c,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/oe.getSizeInBytes(c),view:void 0}),i+=a.componentsPerAttribute*oe.getSizeInBytes(c)}return n},Tt.prototype.resize=function(e){this._size=e;const t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){const o=t[n];Tt._resize(o,this._size),Tt._appendWriters(this.writers,o)}Rc(this)},Tt._resize=function(e,t){if(e.vertexSizeInBytes>0){const n=new ArrayBuffer(t*e.vertexSizeInBytes);if(h(e.arrayBuffer)){const s=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),c=a.length;for(let l=0;l<c;++l)s[l]=a[l]}const i=e.arrayViews,o=i.length;for(let s=0;s<o;++s){const a=i[s];a.view=oe.createArrayBufferView(a.componentDatatype,n,a.offsetInBytes)}e.arrayBuffer=n}};const xx=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,s){const a=i*n;t[a]=o,t[a+1]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,s,a){const c=i*n;t[c]=o,t[c+1]=s,t[c+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,s,a,c){const l=i*n;t[l]=o,t[l+1]=s,t[l+2]=a,t[l+3]=c,e.needsCommit=!0}}];Tt._appendWriters=function(e,t){const n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){const s=n[o];e[s.index]=xx[s.componentsPerAttribute-1](t,s.view,s.vertexSizeInComponentType)}},Tt.prototype.commit=function(e){let t=!1;const n=this._allBuffers;let i,o,s;for(o=0,s=n.length;o<s;++o)i=n[o],t=Cx(this,i)||t;if(t||!h(this.va)){Rc(this);const a=this.va=[],c=S.SIXTY_FOUR_KILOBYTES-4,l=h(e)&&!this._instanced?Math.ceil(this._size/c):1;for(let u=0;u<l;++u){let d=[];for(o=0,s=n.length;o<s;++o){i=n[o];const p=u*(i.vertexSizeInBytes*c);Tt._appendAttributes(d,i,p,this._instanced)}d=d.concat(this._precreated),a.push({va:new Xn({context:this._context,attributes:d,indexBuffer:e}),indicesCount:1.5*(u!==l-1?c:this._size%c)})}}};function Cx(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;const n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=h(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=vt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Tt._appendAttributes=function(e,t,n,i){const o=t.arrayViews,s=o.length;for(let a=0;a<s;++a){const c=o[a];e.push({index:c.index,enabled:c.enabled,componentsPerAttribute:c.componentsPerAttribute,componentDatatype:c.componentDatatype,normalize:c.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+c.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},Tt.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new C("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new C("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");const n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)Ex(n[i],e,t)};function Ex(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){const i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Tt.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Rc(e){const t=e.va;if(!h(t))return;const n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Tt.prototype.isDestroyed=function(){return!1},Tt.prototype.destroy=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){const i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return Rc(this),Qe(this)};function $n(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Pe,this.setValue(e)}Object.defineProperties($n.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),$n.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},$n.prototype.setValue=function(e){const t=this._value;if(t!==e){const n=h(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},$n.prototype.equals=function(e){return this===e||e instanceof $n&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},$n.prototype.valueOf=function(){return this._value},$n.prototype.toString=function(){return String(this._value)};function bx(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(s){const a=this[t],c=this[n];h(c)&&(c(),this[n]=void 0),s!==void 0&&(!h(s)||!h(s.getValue))&&h(o)&&(s=o(s)),a!==s&&(this[t]=s,this._definitionChanged.raiseEvent(this,e,s,a)),h(s)&&h(s.definitionChanged)&&(this[n]=s.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,s,s)},this))}}}function wx(e){return new $n(e)}function F(e,t,n){return bx(e,`_${e.toString()}`,`_${e.toString()}Subscription`,_(t,!1),_(n,wx))}function lr(e){this._definitionChanged=new Pe,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(_(e,_.EMPTY_OBJECT))}Object.defineProperties(lr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),image:F("image"),scale:F("scale"),pixelOffset:F("pixelOffset"),eyeOffset:F("eyeOffset"),horizontalOrigin:F("horizontalOrigin"),verticalOrigin:F("verticalOrigin"),heightReference:F("heightReference"),color:F("color"),rotation:F("rotation"),alignedAxis:F("alignedAxis"),sizeInMeters:F("sizeInMeters"),width:F("width"),height:F("height"),scaleByDistance:F("scaleByDistance"),translucencyByDistance:F("translucencyByDistance"),pixelOffsetScaleByDistance:F("pixelOffsetScaleByDistance"),imageSubRegion:F("imageSubRegion"),distanceDisplayCondition:F("distanceDisplayCondition"),disableDepthTestDistance:F("disableDepthTestDistance"),splitDirection:F("splitDirection")}),lr.prototype.clone=function(e){return h(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.splitDirection=this._splitDirection,e):new lr(this)},lr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this._show,e.show),this.image=_(this._image,e.image),this.scale=_(this._scale,e.scale),this.pixelOffset=_(this._pixelOffset,e.pixelOffset),this.eyeOffset=_(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=_(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=_(this._verticalOrigin,e.verticalOrigin),this.heightReference=_(this._heightReference,e.heightReference),this.color=_(this._color,e.color),this.rotation=_(this._rotation,e.rotation),this.alignedAxis=_(this._alignedAxis,e.alignedAxis),this.sizeInMeters=_(this._sizeInMeters,e.sizeInMeters),this.width=_(this._width,e.width),this.height=_(this._height,e.height),this.scaleByDistance=_(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=_(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=_(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=_(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=_(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=_(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=_(this.splitDirection,e.splitDirection)};function Zn(){this._array=[],this._hash={}}Object.defineProperties(Zn.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),Zn.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return h(this._hash[e])},Zn.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))},Zn.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return this._hash[e]},Zn.prototype.remove=function(e){if(h(e)&&typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const t=this._hash[e],n=h(t);if(n){const i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n},Zn.prototype.removeAll=function(){const e=this._array;e.length>0&&(this._hash={},e.length=0)};function rt(e,t){e=_(e,0),this._near=e,t=_(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(rt.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}}}),rt.packedLength=2,rt.pack=function(e,t,n){if(!h(e))throw new C("value is required");if(!h(t))throw new C("array is required");return n=_(n,0),t[n++]=e.near,t[n]=e.far,t},rt.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new rt),n.near=e[t++],n.far=e[t],n},rt.equals=function(e,t){return e===t||h(e)&&h(t)&&e.near===t.near&&e.far===t.far},rt.clone=function(e,t){if(h(e))return h(t)||(t=new rt),t.near=e.near,t.far=e.far,t},rt.prototype.clone=function(e){return rt.clone(this,e)},rt.prototype.equals=function(e){return rt.equals(this,e)};function we(e,t,n,i){this.near=_(e,0),this.nearValue=_(t,0),this.far=_(n,1),this.farValue=_(i,0)}we.clone=function(e,t){if(h(e))return h(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new we(e.near,e.nearValue,e.far,e.farValue)},we.packedLength=4,we.pack=function(e,t,n){if(!h(e))throw new C("value is required");if(!h(t))throw new C("array is required");return n=_(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t},we.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new we),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},we.equals=function(e,t){return e===t||h(e)&&h(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},we.prototype.clone=function(e){return we.clone(this,e)},we.prototype.equals=function(e){return we.equals(this,e)};const Ji={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},di=Object.freeze(Ji);function $s(e){return e===Ji.CLAMP_TO_GROUND||e===Ji.CLAMP_TO_3D_TILE||e===Ji.CLAMP_TO_TERRAIN}function Tx(e){return e===Ji.RELATIVE_TO_GROUND||e===Ji.RELATIVE_TO_3D_TILE||e===Ji.RELATIVE_TO_TERRAIN}const In=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),Je=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});function Ae(){C.throwInstantiationError()}Object.defineProperties(Ae.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}}),Ae.prototype.getValue=C.throwInstantiationError,Ae.prototype.equals=C.throwInstantiationError,Ae.equals=function(e,t){return e===t||h(e)&&e.equals(t)},Ae.arrayEquals=function(e,t){if(e===t)return!0;if(!h(e)||!h(t)||e.length!==t.length)return!1;const n=e.length;for(let i=0;i<n;i++)if(!Ae.equals(e[i],t[i]))return!1;return!0},Ae.isConstant=function(e){return!h(e)||e.isConstant},Ae.getValueOrUndefined=function(e,t,n){return h(e)?e.getValue(t,n):void 0},Ae.getValueOrDefault=function(e,t,n,i){return h(e)?_(e.getValue(t,i),n):n},Ae.getValueOrClonedDefault=function(e,t,n,i){let o;return h(e)&&(o=e.getValue(t,i)),h(o)||(o=n.clone(o)),o};const Ou=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});function eo(e,t){this.start=_(e,0),this.stop=_(t,0)}function K(e,t){this.center=f.clone(_(e,f.ZERO)),this.radius=_(t,0)}const zc=new f,Pc=new f,Bc=new f,Nc=new f,Fc=new f,Lc=new f,Mc=new f,Ft=new f,Uc=new f,kc=new f,Vc=new f,Gc=new f,Sx=4/3*S.PI;K.fromPoints=function(e,t){if(h(t)||(t=new K),!h(e)||e.length===0)return t.center=f.clone(f.ZERO,t.center),t.radius=0,t;const n=f.clone(e[0],Mc),i=f.clone(n,zc),o=f.clone(n,Pc),s=f.clone(n,Bc),a=f.clone(n,Nc),c=f.clone(n,Fc),l=f.clone(n,Lc),u=e.length;let d;for(d=1;d<u;d++){f.clone(e[d],n);const P=n.x,V=n.y,k=n.z;P<i.x&&f.clone(n,i),P>a.x&&f.clone(n,a),V<o.y&&f.clone(n,o),V>c.y&&f.clone(n,c),k<s.z&&f.clone(n,s),k>l.z&&f.clone(n,l)}const p=f.magnitudeSquared(f.subtract(a,i,Ft)),g=f.magnitudeSquared(f.subtract(c,o,Ft)),y=f.magnitudeSquared(f.subtract(l,s,Ft));let x=i,E=a,b=p;g>b&&(b=g,x=o,E=c),y>b&&(b=y,x=s,E=l);const D=Uc;D.x=(x.x+E.x)*.5,D.y=(x.y+E.y)*.5,D.z=(x.z+E.z)*.5;let A=f.magnitudeSquared(f.subtract(E,D,Ft)),O=Math.sqrt(A);const I=kc;I.x=i.x,I.y=o.y,I.z=s.z;const B=Vc;B.x=a.x,B.y=c.y,B.z=l.z;const M=f.midpoint(I,B,Gc);let q=0;for(d=0;d<u;d++){f.clone(e[d],n);const P=f.magnitude(f.subtract(n,M,Ft));P>q&&(q=P);const V=f.magnitudeSquared(f.subtract(n,D,Ft));if(V>A){const k=Math.sqrt(V);O=(O+k)*.5,A=O*O;const H=k-O;D.x=(O*D.x+H*n.x)/k,D.y=(O*D.y+H*n.y)/k,D.z=(O*D.z+H*n.z)/k}}return O<q?(f.clone(D,t.center),t.radius=O):(f.clone(M,t.center),t.radius=q),t};const vu=new Sn,Ax=new f,Dx=new f,qc=new ee,Hc=new ee;K.fromRectangle2D=function(e,t,n){return K.fromRectangleWithHeights2D(e,t,0,0,n)},K.fromRectangleWithHeights2D=function(e,t,n,i,o){if(h(o)||(o=new K),!h(e))return o.center=f.clone(f.ZERO,o.center),o.radius=0,o;vu._ellipsoid=le.default,t=_(t,vu),ce.southwest(e,qc),qc.height=n,ce.northeast(e,Hc),Hc.height=i;const s=t.project(qc,Ax),a=t.project(Hc,Dx),c=a.x-s.x,l=a.y-s.y,u=a.z-s.z;o.radius=Math.sqrt(c*c+l*l+u*u)*.5;const d=o.center;return d.x=s.x+c*.5,d.y=s.y+l*.5,d.z=s.z+u*.5,o};const Ox=[];K.fromRectangle3D=function(e,t,n,i){if(t=_(t,le.default),n=_(n,0),h(i)||(i=new K),!h(e))return i.center=f.clone(f.ZERO,i.center),i.radius=0,i;const o=ce.subsample(e,t,n,Ox);return K.fromPoints(o,i)},K.fromVertices=function(e,t,n,i){if(h(i)||(i=new K),!h(e)||e.length===0)return i.center=f.clone(f.ZERO,i.center),i.radius=0,i;t=_(t,f.ZERO),n=_(n,3),m.typeOf.number.greaterThanOrEquals("stride",n,3);const o=Mc;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;const s=f.clone(o,zc),a=f.clone(o,Pc),c=f.clone(o,Bc),l=f.clone(o,Nc),u=f.clone(o,Fc),d=f.clone(o,Lc),p=e.length;let g;for(g=0;g<p;g+=n){const k=e[g]+t.x,H=e[g+1]+t.y,j=e[g+2]+t.z;o.x=k,o.y=H,o.z=j,k<s.x&&f.clone(o,s),k>l.x&&f.clone(o,l),H<a.y&&f.clone(o,a),H>u.y&&f.clone(o,u),j<c.z&&f.clone(o,c),j>d.z&&f.clone(o,d)}const y=f.magnitudeSquared(f.subtract(l,s,Ft)),x=f.magnitudeSquared(f.subtract(u,a,Ft)),E=f.magnitudeSquared(f.subtract(d,c,Ft));let b=s,D=l,A=y;x>A&&(A=x,b=a,D=u),E>A&&(A=E,b=c,D=d);const O=Uc;O.x=(b.x+D.x)*.5,O.y=(b.y+D.y)*.5,O.z=(b.z+D.z)*.5;let I=f.magnitudeSquared(f.subtract(D,O,Ft)),B=Math.sqrt(I);const M=kc;M.x=s.x,M.y=a.y,M.z=c.z;const q=Vc;q.x=l.x,q.y=u.y,q.z=d.z;const P=f.midpoint(M,q,Gc);let V=0;for(g=0;g<p;g+=n){o.x=e[g]+t.x,o.y=e[g+1]+t.y,o.z=e[g+2]+t.z;const k=f.magnitude(f.subtract(o,P,Ft));k>V&&(V=k);const H=f.magnitudeSquared(f.subtract(o,O,Ft));if(H>I){const j=Math.sqrt(H);B=(B+j)*.5,I=B*B;const r=j-B;O.x=(B*O.x+r*o.x)/j,O.y=(B*O.y+r*o.y)/j,O.z=(B*O.z+r*o.z)/j}}return B<V?(f.clone(O,i.center),i.radius=B):(f.clone(P,i.center),i.radius=V),i},K.fromEncodedCartesianVertices=function(e,t,n){if(h(n)||(n=new K),!h(e)||!h(t)||e.length!==t.length||e.length===0)return n.center=f.clone(f.ZERO,n.center),n.radius=0,n;const i=Mc;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const o=f.clone(i,zc),s=f.clone(i,Pc),a=f.clone(i,Bc),c=f.clone(i,Nc),l=f.clone(i,Fc),u=f.clone(i,Lc),d=e.length;let p;for(p=0;p<d;p+=3){const V=e[p]+t[p],k=e[p+1]+t[p+1],H=e[p+2]+t[p+2];i.x=V,i.y=k,i.z=H,V<o.x&&f.clone(i,o),V>c.x&&f.clone(i,c),k<s.y&&f.clone(i,s),k>l.y&&f.clone(i,l),H<a.z&&f.clone(i,a),H>u.z&&f.clone(i,u)}const g=f.magnitudeSquared(f.subtract(c,o,Ft)),y=f.magnitudeSquared(f.subtract(l,s,Ft)),x=f.magnitudeSquared(f.subtract(u,a,Ft));let E=o,b=c,D=g;y>D&&(D=y,E=s,b=l),x>D&&(D=x,E=a,b=u);const A=Uc;A.x=(E.x+b.x)*.5,A.y=(E.y+b.y)*.5,A.z=(E.z+b.z)*.5;let O=f.magnitudeSquared(f.subtract(b,A,Ft)),I=Math.sqrt(O);const B=kc;B.x=o.x,B.y=s.y,B.z=a.z;const M=Vc;M.x=c.x,M.y=l.y,M.z=u.z;const q=f.midpoint(B,M,Gc);let P=0;for(p=0;p<d;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const V=f.magnitude(f.subtract(i,q,Ft));V>P&&(P=V);const k=f.magnitudeSquared(f.subtract(i,A,Ft));if(k>O){const H=Math.sqrt(k);I=(I+H)*.5,O=I*I;const j=H-I;A.x=(I*A.x+j*i.x)/H,A.y=(I*A.y+j*i.y)/H,A.z=(I*A.z+j*i.z)/H}}return I<P?(f.clone(A,n.center),n.radius=I):(f.clone(q,n.center),n.radius=P),n},K.fromCornerPoints=function(e,t,n){m.typeOf.object("corner",e),m.typeOf.object("oppositeCorner",t),h(n)||(n=new K);const i=f.midpoint(e,t,n.center);return n.radius=f.distance(i,t),n},K.fromEllipsoid=function(e,t){return m.typeOf.object("ellipsoid",e),h(t)||(t=new K),f.clone(f.ZERO,t.center),t.radius=e.maximumRadius,t};const vx=new f;K.fromBoundingSpheres=function(e,t){if(h(t)||(t=new K),!h(e)||e.length===0)return t.center=f.clone(f.ZERO,t.center),t.radius=0,t;const n=e.length;if(n===1)return K.clone(e[0],t);if(n===2)return K.union(e[0],e[1],t);const i=[];let o;for(o=0;o<n;o++)i.push(e[o].center);t=K.fromPoints(i,t);const s=t.center;let a=t.radius;for(o=0;o<n;o++){const c=e[o];a=Math.max(a,f.distance(s,c.center,vx)+c.radius)}return t.radius=a,t};const Ix=new f,Rx=new f,zx=new f;K.fromOrientedBoundingBox=function(e,t){m.defined("orientedBoundingBox",e),h(t)||(t=new K);const n=e.halfAxes,i=L.getColumn(n,0,Ix),o=L.getColumn(n,1,Rx),s=L.getColumn(n,2,zx);return f.add(i,o,i),f.add(i,s,i),t.center=f.clone(e.center,t.center),t.radius=f.magnitude(i),t};const Px=new f,Bx=new f;K.fromTransformation=function(e,t){m.typeOf.object("transformation",e),h(t)||(t=new K);const n=N.getTranslation(e,Px),i=N.getScale(e,Bx),o=.5*f.magnitude(i);return t.center=f.clone(n,t.center),t.radius=o,t},K.clone=function(e,t){if(h(e))return h(t)?(t.center=f.clone(e.center,t.center),t.radius=e.radius,t):new K(e.center,e.radius)},K.packedLength=4,K.pack=function(e,t,n){m.typeOf.object("value",e),m.defined("array",t),n=_(n,0);const i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},K.unpack=function(e,t,n){m.defined("array",e),t=_(t,0),h(n)||(n=new K);const i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};const Nx=new f,Fx=new f;K.union=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),h(n)||(n=new K);const i=e.center,o=e.radius,s=t.center,a=t.radius,c=f.subtract(s,i,Nx),l=f.magnitude(c);if(o>=l+a)return e.clone(n),n;if(a>=l+o)return t.clone(n),n;const u=(o+l+a)*.5,d=f.multiplyByScalar(c,(-o+u)/l,Fx);return f.add(d,i,d),f.clone(d,n.center),n.radius=u,n};const Lx=new f;K.expand=function(e,t,n){m.typeOf.object("sphere",e),m.typeOf.object("point",t),n=K.clone(e,n);const i=f.magnitude(f.subtract(t,n.center,Lx));return i>n.radius&&(n.radius=i),n},K.intersectPlane=function(e,t){m.typeOf.object("sphere",e),m.typeOf.object("plane",t);const n=e.center,i=e.radius,o=t.normal,s=f.dot(o,n)+t.distance;return s<-i?Et.OUTSIDE:s<i?Et.INTERSECTING:Et.INSIDE},K.transform=function(e,t,n){return m.typeOf.object("sphere",e),m.typeOf.object("transform",t),h(n)||(n=new K),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=N.getMaximumScale(t)*e.radius,n};const Mx=new f;K.distanceSquaredTo=function(e,t){m.typeOf.object("sphere",e),m.typeOf.object("cartesian",t);const n=f.subtract(e.center,t,Mx),i=f.magnitude(n)-e.radius;return i<=0?0:i*i},K.transformWithoutScale=function(e,t,n){return m.typeOf.object("sphere",e),m.typeOf.object("transform",t),h(n)||(n=new K),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const Ux=new f;K.computePlaneDistances=function(e,t,n,i){m.typeOf.object("sphere",e),m.typeOf.object("position",t),m.typeOf.object("direction",n),h(i)||(i=new eo);const o=f.subtract(e.center,t,Ux),s=f.dot(n,o);return i.start=s-e.radius,i.stop=s+e.radius,i};const Iu=new f,kx=new f,Vx=new f,Gx=new f,qx=new f,Hx=new ee,Ru=new Array(8);for(let e=0;e<8;++e)Ru[e]=new f;const zu=new Sn;K.projectTo2D=function(e,t,n){m.typeOf.object("sphere",e),zu._ellipsoid=le.default,t=_(t,zu);const i=t.ellipsoid;let o=e.center;const s=e.radius;let a;f.equals(o,f.ZERO)?a=f.clone(f.UNIT_X,Iu):a=i.geodeticSurfaceNormal(o,Iu);const c=f.cross(f.UNIT_Z,a,kx);f.normalize(c,c);const l=f.cross(a,c,Vx);f.normalize(l,l),f.multiplyByScalar(a,s,a),f.multiplyByScalar(l,s,l),f.multiplyByScalar(c,s,c);const u=f.negate(l,qx),d=f.negate(c,Gx),p=Ru;let g=p[0];f.add(a,l,g),f.add(g,c,g),g=p[1],f.add(a,l,g),f.add(g,d,g),g=p[2],f.add(a,u,g),f.add(g,d,g),g=p[3],f.add(a,u,g),f.add(g,c,g),f.negate(a,a),g=p[4],f.add(a,l,g),f.add(g,c,g),g=p[5],f.add(a,l,g),f.add(g,d,g),g=p[6],f.add(a,u,g),f.add(g,d,g),g=p[7],f.add(a,u,g),f.add(g,c,g);const y=p.length;for(let D=0;D<y;++D){const A=p[D];f.add(o,A,A);const O=i.cartesianToCartographic(A,Hx);t.project(O,A)}n=K.fromPoints(p,n),o=n.center;const x=o.x,E=o.y,b=o.z;return o.x=b,o.y=x,o.z=E,n},K.isOccluded=function(e,t){return m.typeOf.object("sphere",e),m.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},K.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&e.radius===t.radius},K.prototype.intersectPlane=function(e){return K.intersectPlane(this,e)},K.prototype.distanceSquaredTo=function(e){return K.distanceSquaredTo(this,e)},K.prototype.computePlaneDistances=function(e,t,n){return K.computePlaneDistances(this,e,t,n)},K.prototype.isOccluded=function(e){return K.isOccluded(this,e)},K.prototype.equals=function(e){return K.equals(this,e)},K.prototype.clone=function(e){return K.clone(this,e)},K.prototype.volume=function(){const e=this.radius;return Sx*e*e*e};function Pu(e){e=_(e,_.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}const Bu=Object.freeze({NONE:0,TOP:1,ALL:2});function st(e){e=_(e,_.EMPTY_OBJECT),this.position=_(e.position,!1),this.normal=_(e.normal,!1),this.st=_(e.st,!1),this.bitangent=_(e.bitangent,!1),this.tangent=_(e.tangent,!1),this.color=_(e.color,!1)}st.POSITION_ONLY=Object.freeze(new st({position:!0})),st.POSITION_AND_NORMAL=Object.freeze(new st({position:!0,normal:!0})),st.POSITION_NORMAL_AND_ST=Object.freeze(new st({position:!0,normal:!0,st:!0})),st.POSITION_AND_ST=Object.freeze(new st({position:!0,st:!0})),st.POSITION_AND_COLOR=Object.freeze(new st({position:!0,color:!0})),st.ALL=Object.freeze(new st({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),st.DEFAULT=st.POSITION_NORMAL_AND_ST,st.packedLength=6,st.pack=function(e,t,n){if(!h(e))throw new C("value is required");if(!h(t))throw new C("array is required");return n=_(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},st.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new st),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n},st.clone=function(e,t){if(h(e))return h(t)||(t=new st),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};function Ro(e,t,n,i){e=_(e,1),t=_(t,1),n=_(n,1),i=_(i,1),this.value=new Uint8Array([T.floatToByte(e),T.floatToByte(t),T.floatToByte(n),T.floatToByte(i)])}Object.defineProperties(Ro.prototype,{componentDatatype:{get:function(){return oe.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),Ro.fromColor=function(e){if(!h(e))throw new C("color is required.");return new Ro(e.red,e.green,e.blue,e.alpha)},Ro.toValue=function(e,t){if(!h(e))throw new C("color is required.");return h(t)?e.toBytes(t):new Uint8Array(e.toBytes())},Ro.equals=function(e,t){return e===t||h(e)&&h(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]};function Zs(e){if(e=_(e,_.EMPTY_OBJECT),!h(e.geometry))throw new C("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=_(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}function Ke(e){e=_(e,_.EMPTY_OBJECT),this.start=h(e.start)?$.clone(e.start):new $,this.stop=h(e.stop)?$.clone(e.stop):new $,this.data=e.data,this.isStartIncluded=_(e.isStartIncluded,!0),this.isStopIncluded=_(e.isStopIncluded,!0)}Object.defineProperties(Ke.prototype,{isEmpty:{get:function(){const e=$.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});const zo={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Ke.fromIso8601=function(e,t){m.typeOf.object("options",e),m.typeOf.string("options.iso8601",e.iso8601);const n=e.iso8601.split("/");if(n.length!==2)throw new C("options.iso8601 is an invalid ISO 8601 interval.");const i=$.fromIso8601(n[0]),o=$.fromIso8601(n[1]),s=_(e.isStartIncluded,!0),a=_(e.isStopIncluded,!0),c=e.data;return h(t)?(t.start=i,t.stop=o,t.isStartIncluded=s,t.isStopIncluded=a,t.data=c,t):(zo.start=i,zo.stop=o,zo.isStartIncluded=s,zo.isStopIncluded=a,zo.data=c,new Ke(zo))},Ke.toIso8601=function(e,t){return m.typeOf.object("timeInterval",e),`${$.toIso8601(e.start,t)}/${$.toIso8601(e.stop,t)}`},Ke.clone=function(e,t){if(h(e))return h(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Ke(e)},Ke.equals=function(e,t,n){return e===t||h(e)&&h(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&$.equals(e.start,t.start)&&$.equals(e.stop,t.stop)&&(e.data===t.data||h(n)&&n(e.data,t.data)))},Ke.equalsEpsilon=function(e,t,n,i){return n=_(n,0),e===t||h(e)&&h(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&$.equalsEpsilon(e.start,t.start,n)&&$.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||h(i)&&i(e.data,t.data)))},Ke.intersect=function(e,t,n,i){if(m.typeOf.object("left",e),!h(t))return Ke.clone(Ke.EMPTY,n);const o=e.start,s=e.stop,a=t.start,c=t.stop,l=$.greaterThanOrEquals(a,o)&&$.greaterThanOrEquals(s,a),u=!l&&$.lessThanOrEquals(a,o)&&$.lessThanOrEquals(o,c);if(!l&&!u)return Ke.clone(Ke.EMPTY,n);const d=e.isStartIncluded,p=e.isStopIncluded,g=t.isStartIncluded,y=t.isStopIncluded,x=$.lessThan(s,c);return h(n)||(n=new Ke),n.start=l?a:o,n.isStartIncluded=d&&g||!$.equals(a,o)&&(l&&g||u&&d),n.stop=x?s:c,n.isStopIncluded=x?p:p&&y||!$.equals(c,s)&&y,n.data=h(i)?i(e.data,t.data):e.data,n},Ke.contains=function(e,t){if(m.typeOf.object("timeInterval",e),m.typeOf.object("julianDate",t),e.isEmpty)return!1;const n=$.compare(e.start,t);if(n===0)return e.isStartIncluded;const i=$.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0},Ke.prototype.clone=function(e){return Ke.clone(this,e)},Ke.prototype.equals=function(e,t){return Ke.equals(this,e,t)},Ke.prototype.equalsEpsilon=function(e,t,n){return Ke.equalsEpsilon(this,e,t,n)},Ke.prototype.toString=function(){return Ke.toIso8601(this)},Ke.EMPTY=Object.freeze(new Ke({start:new $,stop:new $,isStartIncluded:!1,isStopIncluded:!1}));const Nu=Object.freeze($.fromIso8601("0000-01-01T00:00:00Z")),Fu=Object.freeze($.fromIso8601("9999-12-31T24:00:00Z")),Wx=Object.freeze(new Ke({start:Nu,stop:Fu})),Fi={MINIMUM_VALUE:Nu,MAXIMUM_VALUE:Fu,MAXIMUM_INTERVAL:Wx};function hr(e,t,n){e=_(e,0),t=_(t,0),n=_(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(hr.prototype,{componentDatatype:{get:function(){return oe.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),hr.fromCartesian3=function(e){return m.defined("offset",e),new hr(e.x,e.y,e.z)},hr.toValue=function(e,t){return m.defined("offset",e),h(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const jx={ADD:R.FUNC_ADD,SUBTRACT:R.FUNC_SUBTRACT,REVERSE_SUBTRACT:R.FUNC_REVERSE_SUBTRACT,MIN:R.MIN,MAX:R.MAX},Po=Object.freeze(jx),Yx={ZERO:R.ZERO,ONE:R.ONE,SOURCE_COLOR:R.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:R.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:R.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:R.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:R.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:R.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:R.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:R.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:R.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:R.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:R.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:R.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:R.SRC_ALPHA_SATURATE},xn=Object.freeze(Yx),Xx={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Po.ADD,equationAlpha:Po.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Po.ADD,equationAlpha:Po.ADD,functionSourceRgb:xn.ONE,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Po.ADD,equationAlpha:Po.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE,functionDestinationAlpha:xn.ONE})},to=Object.freeze(Xx),$x={FRONT:R.FRONT,BACK:R.BACK,FRONT_AND_BACK:R.FRONT_AND_BACK},Bo=Object.freeze($x);function Ut(e){e=_(e,_.EMPTY_OBJECT),this.material=e.material,this.translucent=_(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=_(e.closed,!1)}Object.defineProperties(Ut.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}}}),Ut.prototype.getFragmentShaderSource=function(){const e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),h(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
3832
- `)},Ut.prototype.isTranslucent=function(){return h(this.material)&&this.material.isTranslucent()||!h(this.material)&&this.translucent},Ut.prototype.getRenderState=function(){const e=this.isTranslucent(),t=tn(this.renderState,!1);return e?(t.depthMask=!1,t.blending=to.ALPHA_BLEND):t.depthMask=!0,t},Ut.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=to.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Bo.BACK}),h(n)&&(i=nn(n,i,!0)),i};const Zx=`uniform sampler2D image;
3831
+ ${i}`};function Ky(e,t){const n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function Eu(e,t){const n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function bu(e,t){const n=t.length;for(let i=0;i<n;++i){const o=t[i];if(Eu(e,o))return o}}const Qy=["v_normalEC","v_normal"];ye.findNormalVarying=function(e){return Eu(e,"#ifdef HAS_NORMALS")?Ky(e,"HAS_NORMALS")?"v_normalEC":void 0:bu(e,Qy)};const Jy=["v_positionEC"];ye.findPositionVarying=function(e){return bu(e,Jy)};function Nt(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=de.RGBA,pixelDatatype:o=pe.UNSIGNED_BYTE,flipY:s=!0,skipColorSpaceConversion:a=!1,sampler:c=new Yn}=e;let{width:l,height:u}=e;h(n)&&(h(l)||(l=n.videoWidth??n.naturalWidth??n.width),h(u)||(u=n.videoHeight??n.naturalHeight??n.height));const d=e.preMultiplyAlpha||i===de.RGB||i===de.LUMINANCE,p=de.toInternalFormat(i,o,t),g=de.isCompressedFormat(p);if(!h(l)||!h(u))throw new C("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(m.typeOf.number.greaterThan("width",l,0),l>Ee.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${Ee.maximumTextureSize}). Check maximumTextureSize.`);if(m.typeOf.number.greaterThan("height",u,0),u>Ee.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${Ee.maximumTextureSize}). Check maximumTextureSize.`);if(!de.validate(i))throw new C("Invalid options.pixelFormat.");if(!g&&!pe.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===de.DEPTH_COMPONENT&&o!==pe.UNSIGNED_SHORT&&o!==pe.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===de.DEPTH_STENCIL&&o!==pe.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===pe.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===pe.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(de.isDepthFormat(i)){if(h(n))throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(g){if(!h(n)||!h(n.arrayBufferView))throw new C("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(de.isDXTFormat(p)&&!t.s3tc)throw new C("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(de.isPVRTCFormat(p)&&!t.pvrtc)throw new C("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(de.isASTCFormat(p)&&!t.astc)throw new C("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(de.isETC2Format(p)&&!t.etc)throw new C("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(de.isETC1Format(p)&&!t.etc1)throw new C("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(de.isBC7Format(p)&&!t.bc7)throw new C("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(de.compressedTextureSizeInBytes(p,l,u)!==n.arrayBufferView.byteLength)throw new C("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const y=t._gl,x=g?de.compressedTextureSizeInBytes(i,l,u):de.textureSizeInBytes(i,o,l,u);this._id=Vn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y.TEXTURE_2D,this._texture=y.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=l,this._height=u,this._dimensions=new U(l,u),this._hasMipmap=!1,this._sizeInBytes=x,this._preMultiplyAlpha=d,this._flipY=s,this._initialized=!1,this._sampler=void 0,this._sampler=c,wu(this,c),y.activeTexture(y.TEXTURE0),y.bindTexture(this._textureTarget,this._texture),h(n)?(a?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),h(n.arrayBufferView)?de.isCompressedFormat(p)?ex(this,n):tx(this,n):h(n.framebuffer)?nx(this,n):ix(this,n),this._initialized=!0):ox(this),y.bindTexture(this._textureTarget,null)}function ex(e,t){const i=e._context._gl,o=e._textureTarget,s=e._internalFormat,{width:a,height:c}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,s,a,c,0,t.arrayBufferView),h(t.mipLevels)){let l=a,u=c;for(let d=0;d<t.mipLevels.length;++d)l=Ys(l),u=Ys(u),i.compressedTexImage2D(o,d+1,s,l,u,0,t.mipLevels[d])}}function tx(e,t){const n=e._context,i=n._gl,o=e._textureTarget,s=e._internalFormat,{width:a,height:c,pixelFormat:l,pixelDatatype:u,flipY:d}=e,p=de.alignmentInBytes(l,u,a);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let g=t.arrayBufferView;if(d&&(g=de.flipY(g,l,u,a,c)),i.texImage2D(o,0,s,a,c,0,l,pe.toWebGLConstant(u,n),g),h(t.mipLevels)){let y=a,x=c;for(let E=0;E<t.mipLevels.length;++E)y=Ys(y),x=Ys(x),i.texImage2D(o,E+1,s,y,x,0,l,pe.toWebGLConstant(u,n),t.mipLevels[E])}}function nx(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function ix(e,t){const n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,pe.toWebGLConstant(e.pixelDatatype,n),t)}function Ys(e){const t=Math.floor(e/2)|0;return Math.max(t,1)}function ox(e){const t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,pe.toWebGLConstant(e._pixelDatatype,t),null)}Nt.create=function(e){return new Nt(e)},Nt.fromFramebuffer=function(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const t=e.context,n=t._gl,{pixelFormat:i=de.RGB,framebufferXOffset:o=0,framebufferYOffset:s=0,width:a=n.drawingBufferWidth,height:c=n.drawingBufferHeight,framebuffer:l}=e;if(!de.validate(i))throw new C("Invalid pixelFormat.");if(de.isDepthFormat(i)||de.isCompressedFormat(i))throw new C("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(m.defined("options.context",t),m.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),m.typeOf.number.greaterThanOrEquals("framebufferYOffset",s,0),o+a>n.drawingBufferWidth)throw new C("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(s+c>n.drawingBufferHeight)throw new C("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Nt({context:t,width:a,height:c,pixelFormat:i,source:{framebuffer:h(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:s,width:a,height:c}})},Object.defineProperties(Nt.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){wu(this,e),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(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function wu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Mt.NEAREST_MIPMAP_NEAREST,Mt.NEAREST_MIPMAP_LINEAR,Mt.LINEAR_MIPMAP_NEAREST,Mt.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelFormat,c=e._pixelDatatype;(c===pe.FLOAT&&!s.textureFloatLinear||c===pe.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Mt.NEAREST_MIPMAP_NEAREST:Mt.NEAREST,i=Ji.NEAREST),s.webgl2&&de.isDepthFormat(a)&&(n=Mt.NEAREST,i=Ji.NEAREST);const l=s._gl,u=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,e._texture),l.texParameteri(u,l.TEXTURE_MIN_FILTER,n),l.texParameteri(u,l.TEXTURE_MAG_FILTER,i),l.texParameteri(u,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(u,l.TEXTURE_WRAP_T,t.wrapT),h(e._textureFilterAnisotropic)&&l.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(u,null)}Nt.prototype.copyFrom=function(e){m.defined("options",e);const{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(m.defined("options.source",i),de.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(de.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");m.typeOf.number.greaterThanOrEquals("xOffset",t,0),m.typeOf.number.greaterThanOrEquals("yOffset",n,0),m.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),m.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);const s=this._context,a=s._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let{width:l,height:u}=i;const d=i.arrayBufferView;h(i.videoWidth)&&h(i.videoHeight)?(l=i.videoWidth,u=i.videoHeight):h(i.naturalWidth)&&h(i.naturalHeight)&&(l=i.naturalWidth,u=i.naturalHeight);const p=this._width,g=this._height,y=this._internalFormat,x=this._pixelFormat,E=this._pixelDatatype,b=this._preMultiplyAlpha,D=this._flipY;let A=4;h(d)&&(A=de.alignmentInBytes(x,E,l)),a.pixelStorei(a.UNPACK_ALIGNMENT,A),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let O=!1;if(!this._initialized){let I;t===0&&n===0&&l===p&&u===g?(h(d)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),D?I=de.flipY(d,x,E,p,g):I=d):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,D),I=i),O=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),I=de.createTypedArray(x,E,p,g)),a.texImage2D(c,0,y,p,g,0,x,pe.toWebGLConstant(E,s),I),this._initialized=!0}if(!O){let I;h(d)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),D?I=de.flipY(d,x,E,l,u):I=d):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,D),I=i),a.texSubImage2D(c,0,t,n,l,u,x,pe.toWebGLConstant(E,s),I)}a.bindTexture(c,null)},Nt.prototype.copyFromFramebuffer=function(e,t,n,i,o,s){if(e=_(e,0),t=_(t,0),n=_(n,0),i=_(i,0),o=_(o,this._width),s=_(s,this._height),de.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===pe.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===pe.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(de.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");m.typeOf.number.greaterThanOrEquals("xOffset",e,0),m.typeOf.number.greaterThanOrEquals("yOffset",t,0),m.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),m.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),m.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),m.typeOf.number.lessThanOrEquals("yOffset + height",t+s,this._height);const a=this._context._gl,c=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture),a.copyTexSubImage2D(c,0,e,t,n,i,o,s),a.bindTexture(c,null),this._initialized=!0},Nt.prototype.generateMipmap=function(e){if(e=_(e,Hs.DONT_CARE),de.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(de.isCompressedFormat(this._pixelFormat))throw new C("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!S.isPowerOfTwo(this._width))throw new C("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!S.isPowerOfTwo(this._height))throw new C("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!Hs.validate(e))throw new C("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)},Nt.prototype.isDestroyed=function(){return!1},Nt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),Qe(this)};function Ye(){this.high=f.clone(f.ZERO),this.low=f.clone(f.ZERO)}Ye.encode=function(e,t){m.typeOf.number("value",e),h(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};const di={high:0,low:0};Ye.fromCartesian=function(e,t){m.typeOf.object("cartesian",e),h(t)||(t=new Ye);const n=t.high,i=t.low;return Ye.encode(e.x,di),n.x=di.high,i.x=di.low,Ye.encode(e.y,di),n.y=di.high,i.y=di.low,Ye.encode(e.z,di),n.z=di.high,i.z=di.low,t};const vc=new Ye;Ye.writeElements=function(e,t,n){m.defined("cartesianArray",t),m.typeOf.number("index",n),m.typeOf.number.greaterThanOrEquals("index",n,0),Ye.fromCartesian(e,vc);const i=vc.high,o=vc.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};function Ne(e,t){if(m.typeOf.object("normal",e),!S.equalsEpsilon(f.magnitude(e),1,S.EPSILON6))throw new C("normal must be normalized.");m.typeOf.number("distance",t),this.normal=f.clone(e),this.distance=t}Ne.fromPointNormal=function(e,t,n){if(m.typeOf.object("point",e),m.typeOf.object("normal",t),!S.equalsEpsilon(f.magnitude(t),1,S.EPSILON6))throw new C("normal must be normalized.");const i=-f.dot(t,e);return h(n)?(f.clone(t,n.normal),n.distance=i,n):new Ne(t,i)};const rx=new f;Ne.fromCartesian4=function(e,t){m.typeOf.object("coefficients",e);const n=f.fromCartesian4(e,rx),i=e.w;if(!S.equalsEpsilon(f.magnitude(n),1,S.EPSILON6))throw new C("normal must be normalized.");return h(t)?(f.clone(n,t.normal),t.distance=i,t):new Ne(n,i)},Ne.getPointDistance=function(e,t){return m.typeOf.object("plane",e),m.typeOf.object("point",t),f.dot(e.normal,t)+e.distance};const sx=new f;Ne.projectPointOntoPlane=function(e,t,n){m.typeOf.object("plane",e),m.typeOf.object("point",t),h(n)||(n=new f);const i=Ne.getPointDistance(e,t),o=f.multiplyByScalar(e.normal,i,sx);return f.subtract(t,o,n)};const ax=new N,cx=new Y,lx=new f;Ne.transform=function(e,t,n){m.typeOf.object("plane",e),m.typeOf.object("transform",t);const i=e.normal,o=e.distance,s=N.inverseTranspose(t,ax);let a=Y.fromElements(i.x,i.y,i.z,o,cx);a=N.multiplyByVector(s,a,a);const c=f.fromCartesian4(a,lx);return a=Y.divideByScalar(a,f.magnitude(c),a),Ne.fromCartesian4(a,n)},Ne.clone=function(e,t){return m.typeOf.object("plane",e),h(t)?(f.clone(e.normal,t.normal),t.distance=e.distance,t):new Ne(e.normal,e.distance)},Ne.equals=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),e.distance===t.distance&&f.equals(e.normal,t.normal)},Ne.ORIGIN_XY_PLANE=Object.freeze(new Ne(f.UNIT_Z,0)),Ne.ORIGIN_YZ_PLANE=Object.freeze(new Ne(f.UNIT_X,0)),Ne.ORIGIN_ZX_PLANE=Object.freeze(new Ne(f.UNIT_Y,0));function yn(e){this.planes=_(e,[])}const cr=[new f,new f,new f];f.clone(f.UNIT_X,cr[0]),f.clone(f.UNIT_Y,cr[1]),f.clone(f.UNIT_Z,cr[2]);const Ni=new f,hx=new f,Tu=new Ne(new f(1,0,0),0);yn.fromBoundingSphere=function(e,t){if(!h(e))throw new C("boundingSphere is required.");h(t)||(t=new yn);const n=cr.length,i=t.planes;i.length=2*n;const o=e.center,s=e.radius;let a=0;for(let c=0;c<n;++c){const l=cr[c];let u=i[a],d=i[a+1];h(u)||(u=i[a]=new Y),h(d)||(d=i[a+1]=new Y),f.multiplyByScalar(l,-s,Ni),f.add(o,Ni,Ni),u.x=l.x,u.y=l.y,u.z=l.z,u.w=-f.dot(l,Ni),f.multiplyByScalar(l,s,Ni),f.add(o,Ni,Ni),d.x=-l.x,d.y=-l.y,d.z=-l.z,d.w=-f.dot(f.negate(l,hx),Ni),a+=2}return t},yn.prototype.computeVisibility=function(e){if(!h(e))throw new C("boundingVolume is required.");const t=this.planes;let n=!1;for(let i=0,o=t.length;i<o;++i){const s=e.intersectPlane(Ne.fromCartesian4(t[i],Tu));if(s===Et.OUTSIDE)return Et.OUTSIDE;s===Et.INTERSECTING&&(n=!0)}return n?Et.INTERSECTING:Et.INSIDE},yn.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!h(e))throw new C("boundingVolume is required.");if(!h(t))throw new C("parentPlaneMask is required.");if(t===yn.MASK_OUTSIDE||t===yn.MASK_INSIDE)return t;let n=yn.MASK_INSIDE;const i=this.planes;for(let o=0,s=i.length;o<s;++o){const a=o<31?1<<o:0;if(o<31&&!(t&a))continue;const c=e.intersectPlane(Ne.fromCartesian4(i[o],Tu));if(c===Et.OUTSIDE)return yn.MASK_OUTSIDE;c===Et.INTERSECTING&&(n|=a)}return n},yn.MASK_OUTSIDE=4294967295,yn.MASK_INSIDE=0,yn.MASK_INDETERMINATE=2147483647;function vn(e){e=_(e,_.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=_(e.near,1),this._near=this.near,this.far=_(e.far,5e8),this._far=this.far,this._cullingVolume=new yn,this._orthographicMatrix=new N}function Su(e){if(!h(e.right)||!h(e.left)||!h(e.top)||!h(e.bottom)||!h(e.near)||!h(e.far))throw new C("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 C("right must be greater than left.");if(e.bottom>e.top)throw new C("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new C("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=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(vn.prototype,{projectionMatrix:{get:function(){return Su(this),this._orthographicMatrix}}});const fx=new f,ux=new f,dx=new f,Ic=new f;vn.prototype.computeCullingVolume=function(e,t,n){if(!h(e))throw new C("position is required.");if(!h(t))throw new C("direction is required.");if(!h(n))throw new C("up is required.");const i=this._cullingVolume.planes,o=this.top,s=this.bottom,a=this.right,c=this.left,l=this.near,u=this.far,d=f.cross(t,n,fx);f.normalize(d,d);const p=ux;f.multiplyByScalar(t,l,p),f.add(e,p,p);const g=dx;f.multiplyByScalar(d,c,g),f.add(p,g,g);let y=i[0];return h(y)||(y=i[0]=new Y),y.x=d.x,y.y=d.y,y.z=d.z,y.w=-f.dot(d,g),f.multiplyByScalar(d,a,g),f.add(p,g,g),y=i[1],h(y)||(y=i[1]=new Y),y.x=-d.x,y.y=-d.y,y.z=-d.z,y.w=-f.dot(f.negate(d,Ic),g),f.multiplyByScalar(n,s,g),f.add(p,g,g),y=i[2],h(y)||(y=i[2]=new Y),y.x=n.x,y.y=n.y,y.z=n.z,y.w=-f.dot(n,g),f.multiplyByScalar(n,o,g),f.add(p,g,g),y=i[3],h(y)||(y=i[3]=new Y),y.x=-n.x,y.y=-n.y,y.z=-n.z,y.w=-f.dot(f.negate(n,Ic),g),y=i[4],h(y)||(y=i[4]=new Y),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-f.dot(t,p),f.multiplyByScalar(t,u,g),f.add(e,g,g),y=i[5],h(y)||(y=i[5]=new Y),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-f.dot(f.negate(t,Ic),g),this._cullingVolume},vn.prototype.getPixelDimensions=function(e,t,n,i,o){if(Su(this),!h(e)||!h(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!h(n))throw new C("distance is required.");if(!h(i))throw new C("pixelRatio is required.");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!h(o))throw new C("A result object is required.");const s=this.right-this.left,a=this.top-this.bottom,c=i*s/e,l=i*a/t;return o.x=c,o.y=l,o},vn.prototype.clone=function(e){return h(e)||(e=new vn),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},vn.prototype.equals=function(e){return h(e)&&e instanceof vn&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},vn.prototype.equalsEpsilon=function(e,t,n){return e===this||h(e)&&e instanceof vn&&S.equalsEpsilon(this.right,e.right,t,n)&&S.equalsEpsilon(this.left,e.left,t,n)&&S.equalsEpsilon(this.top,e.top,t,n)&&S.equalsEpsilon(this.bottom,e.bottom,t,n)&&S.equalsEpsilon(this.near,e.near,t,n)&&S.equalsEpsilon(this.far,e.far,t,n)};function rn(e){e=_(e,_.EMPTY_OBJECT),this._offCenterFrustum=new vn,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=_(e.near,1),this._near=this.near,this.far=_(e.far,5e8),this._far=this.far}rn.packedLength=4,rn.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t},rn.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new rn),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function Fi(e){if(!h(e.width)||!h(e.aspectRatio)||!h(e.near)||!h(e.far))throw new C("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 C("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new C("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=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(rn.prototype,{projectionMatrix:{get:function(){return Fi(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return Fi(this),this._offCenterFrustum}}}),rn.prototype.computeCullingVolume=function(e,t,n){return Fi(this),this._offCenterFrustum.computeCullingVolume(e,t,n)},rn.prototype.getPixelDimensions=function(e,t,n,i,o){return Fi(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)},rn.prototype.clone=function(e){return h(e)||(e=new rn),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},rn.prototype.equals=function(e){return!h(e)||!(e instanceof rn)?!1:(Fi(this),Fi(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},rn.prototype.equalsEpsilon=function(e,t,n){return!h(e)||!(e instanceof rn)?!1:(Fi(this),Fi(e),S.equalsEpsilon(this.width,e.width,t,n)&&S.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};const Xs={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Xs.getMorphTime=function(e){return e===Xs.SCENE3D?1:e===Xs.MORPHING?void 0:0};const me=Object.freeze(Xs);function px(e,t,n,i){const o=h(t.vertexBuffer),s=h(t.value),a=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!s)throw new C("attribute must have a vertexBuffer or a value.");if(o&&s)throw new C("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(a!==1&&a!==2&&a!==3&&a!==4)throw s?new C("attribute.value.length must be in the range [1, 4]."):new C("attribute.componentsPerAttribute must be in the range [1, 4].");if(h(t.componentDatatype)&&!oe.validate(t.componentDatatype))throw new C("attribute must have a valid componentDatatype or not specify it.");if(h(t.strideInBytes)&&t.strideInBytes>255)throw new C("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(h(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new C("instanced arrays is not supported");if(h(t.instanceDivisor)&&t.instanceDivisor<0)throw new C("attribute must have an instanceDivisor greater than or equal to zero");if(h(t.instanceDivisor)&&s)throw new C("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(h(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new C("attribute zero cannot have an instanceDivisor greater than 0");const c={index:_(t.index,n),enabled:_(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:s?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:_(t.componentDatatype,oe.FLOAT),normalize:_(t.normalize,!1),offsetInBytes:_(t.offsetInBytes,0),strideInBytes:_(t.strideInBytes,0),instanceDivisor:_(t.instanceDivisor,0)};if(o)c.vertexAttrib=function(l){const u=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}c.disableVertexAttribArray=function(l){}}e.push(c)}function Au(e,t,n){for(let i=0;i<t.length;++i){const o=t[i];o.enabled&&o.vertexAttrib(e)}h(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Xn(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),m.defined("options.attributes",e.attributes);const t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer;let s;const a=[];let c=1,l=!1,u=!1,d=i.length;for(s=0;s<d;++s)px(a,i[s],s,t);for(d=a.length,s=0;s<d;++s){const y=a[s];if(h(y.vertexBuffer)&&y.instanceDivisor===0){const x=y.strideInBytes||y.componentsPerAttribute*oe.getSizeInBytes(y.componentDatatype);c=y.vertexBuffer.sizeInBytes/x;break}}for(s=0;s<d;++s)a[s].instanceDivisor>0&&(l=!0),h(a[s].value)&&(u=!0);const p={};for(s=0;s<d;++s){const y=a[s].index;if(p[y])throw new C(`Index ${y} is used by more than one attribute.`);p[y]=!0}let g;t.vertexArrayObject&&(g=t.glCreateVertexArray(),t.glBindVertexArray(g),Au(n,a,o),t.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=l,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=g,this._attributes=a,this._indexBuffer=o}function Du(e){return e.values.length/e.componentsPerAttribute}function mx(e){return oe.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function _x(e){let t,n,i;const o=[];for(n in e)e.hasOwnProperty(n)&&h(e[n])&&h(e[n].values)&&(o.push(n),e[n].componentDatatype===oe.DOUBLE&&(e[n].componentDatatype=oe.FLOAT,e[n].values=oe.createTypedArray(oe.FLOAT,e[n].values)));let s;const a=o.length;if(a>0)for(s=Du(e[o[0]]),t=1;t<a;++t){const u=Du(e[o[t]]);if(u!==s)throw new at(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${s.toString()}).`)}o.sort(function(u,d){return oe.getSizeInBytes(e[d].componentDatatype)-oe.getSizeInBytes(e[u].componentDatatype)});let c=0;const l={};for(t=0;t<a;++t)n=o[t],i=e[n],l[n]=c,c+=mx(i);if(c>0){const u=oe.getSizeInBytes(e[o[0]].componentDatatype),d=c%u;d!==0&&(c+=u-d);const p=s*c,g=new ArrayBuffer(p),y={};for(t=0;t<a;++t){n=o[t];const x=oe.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:oe.createTypedArray(e[n].componentDatatype,g),index:l[n]/x,strideInComponentType:c/x}}for(t=0;t<s;++t)for(let x=0;x<a;++x){n=o[x],i=e[n];const E=i.values,b=y[n],D=b.pointer,A=i.componentsPerAttribute;for(let O=0;O<A;++O)D[b.index+O]=E[t*A+O];b.index+=b.strideInComponentType}return{buffer:g,offsetsInBytes:l,vertexSizeInBytes:c}}}Xn.fromGeometry=function(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const t=e.context,n=_(e.geometry,_.EMPTY_OBJECT),i=_(e.bufferUsage,De.DYNAMIC_DRAW),o=_(e.attributeLocations,_.EMPTY_OBJECT),s=_(e.interleave,!1),a=e.vertexArrayAttributes;let c,l,u;const d=h(a)?a:[],p=n.attributes;if(s){const x=_x(p);if(h(x)){u=vt.createVertexBuffer({context:t,typedArray:x.buffer,usage:i});const E=x.offsetsInBytes,b=x.vertexSizeInBytes;for(c in p)p.hasOwnProperty(c)&&h(p[c])&&(l=p[c],h(l.values)?d.push({index:o[c],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:E[c],strideInBytes:b}):d.push({index:o[c],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(c in p)if(p.hasOwnProperty(c)&&h(p[c])){l=p[c];let x=l.componentDatatype;x===oe.DOUBLE&&(x=oe.FLOAT),u=void 0,h(l.values)&&(u=vt.createVertexBuffer({context:t,typedArray:oe.createTypedArray(x,l.values),usage:i})),d.push({index:o[c],vertexBuffer:u,value:l.value,componentDatatype:x,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize})}let g;const y=n.indices;return h(y)&&(ht.computeNumberOfVertices(n)>=S.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?g=vt.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:Ct.UNSIGNED_INT}):g=vt.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:Ct.UNSIGNED_SHORT})),new Xn({context:t,attributes:d,indexBuffer:g})},Object.defineProperties(Xn.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),Xn.prototype.getAttribute=function(e){return m.defined("index",e),this._attributes[e]};function gx(e){const t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;const i=t._vertexAttribDivisors,o=e._attributes,s=Ee.maximumVertexAttributes;let a;if(n){const c=o.length;for(a=0;a<c;++a){const l=o[a];if(l.enabled){const u=l.instanceDivisor,d=l.index;u!==i[d]&&(t.glVertexAttribDivisor(d,u),i[d]=u)}}}else for(a=0;a<s;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}function yx(e,t){const n=e._attributes,i=n.length;for(let o=0;o<i;++o){const s=n[o];s.enabled&&h(s.value)&&s.vertexAttrib(t)}}Xn.prototype._bind=function(){h(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&gx(this),this._hasConstantAttributes&&yx(this,this._gl)):Au(this._gl,this._attributes,this._indexBuffer)},Xn.prototype._unBind=function(){if(h(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)}},Xn.prototype.isDestroyed=function(){return!1},Xn.prototype.destroy=function(){const e=this._attributes;for(let n=0;n<e.length;++n){const i=e[n].vertexBuffer;h(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}const t=this._indexBuffer;return h(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),h(this._vao)&&this._context.glDeleteVertexArray(this._vao),Qe(this)};function Tt(e,t,n,i){if(m.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");const o=Tt._verifyAttributes(t);n=_(n,0);const s=[],a={};let c,l;const u=o.length;for(let p=0;p<u;++p){const g=o[p];if(g.vertexBuffer){s.push(g);continue}l=g.usage,c=a[l],h(c)||(c=a[l]=[]),c.push(g)}function d(p,g){return oe.getSizeInBytes(g.componentDatatype)-oe.getSizeInBytes(p.componentDatatype)}this._allBuffers=[];for(l in a)if(a.hasOwnProperty(l)){c=a[l],c.sort(d);const p=Tt._vertexSizeInBytes(c),g=c[0].usage,y={vertexSizeInBytes:p,vertexBuffer:void 0,usage:g,needsCommit:!1,arrayBuffer:void 0,arrayViews:Tt._createArrayViews(c,p)};this._allBuffers.push(y)}this._size=0,this._instanced=_(i,!1),this._precreated=s,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Tt._verifyAttributes=function(e){const t=[];for(let i=0;i<e.length;++i){const o=e[i],s={index:_(o.index,i),enabled:_(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:_(o.componentDatatype,oe.FLOAT),normalize:_(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:_(o.usage,De.STATIC_DRAW)};if(t.push(s),s.componentsPerAttribute!==1&&s.componentsPerAttribute!==2&&s.componentsPerAttribute!==3&&s.componentsPerAttribute!==4)throw new C("attribute.componentsPerAttribute must be in the range [1, 4].");const a=s.componentDatatype;if(!oe.validate(a))throw new C("Attribute must have a valid componentDatatype or not specify it.");if(!De.validate(s.usage))throw new C("Attribute must have a valid usage or not specify it.")}const n=new Array(t.length);for(let i=0;i<t.length;++i){const s=t[i].index;if(n[s])throw new C(`Index ${s} is used by more than one attribute.`);n[s]=!0}return t},Tt._vertexSizeInBytes=function(e){let t=0;const n=e.length;for(let a=0;a<n;++a){const c=e[a];t+=c.componentsPerAttribute*oe.getSizeInBytes(c.componentDatatype)}const i=n>0?oe.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,s=o===0?0:i-o;return t+=s,t},Tt._createArrayViews=function(e,t){const n=[];let i=0;const o=e.length;for(let s=0;s<o;++s){const a=e[s],c=a.componentDatatype;n.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:c,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/oe.getSizeInBytes(c),view:void 0}),i+=a.componentsPerAttribute*oe.getSizeInBytes(c)}return n},Tt.prototype.resize=function(e){this._size=e;const t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){const o=t[n];Tt._resize(o,this._size),Tt._appendWriters(this.writers,o)}Rc(this)},Tt._resize=function(e,t){if(e.vertexSizeInBytes>0){const n=new ArrayBuffer(t*e.vertexSizeInBytes);if(h(e.arrayBuffer)){const s=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),c=a.length;for(let l=0;l<c;++l)s[l]=a[l]}const i=e.arrayViews,o=i.length;for(let s=0;s<o;++s){const a=i[s];a.view=oe.createArrayBufferView(a.componentDatatype,n,a.offsetInBytes)}e.arrayBuffer=n}};const xx=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,s){const a=i*n;t[a]=o,t[a+1]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,s,a){const c=i*n;t[c]=o,t[c+1]=s,t[c+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,s,a,c){const l=i*n;t[l]=o,t[l+1]=s,t[l+2]=a,t[l+3]=c,e.needsCommit=!0}}];Tt._appendWriters=function(e,t){const n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){const s=n[o];e[s.index]=xx[s.componentsPerAttribute-1](t,s.view,s.vertexSizeInComponentType)}},Tt.prototype.commit=function(e){let t=!1;const n=this._allBuffers;let i,o,s;for(o=0,s=n.length;o<s;++o)i=n[o],t=Cx(this,i)||t;if(t||!h(this.va)){Rc(this);const a=this.va=[],c=S.SIXTY_FOUR_KILOBYTES-4,l=h(e)&&!this._instanced?Math.ceil(this._size/c):1;for(let u=0;u<l;++u){let d=[];for(o=0,s=n.length;o<s;++o){i=n[o];const p=u*(i.vertexSizeInBytes*c);Tt._appendAttributes(d,i,p,this._instanced)}d=d.concat(this._precreated),a.push({va:new Xn({context:this._context,attributes:d,indexBuffer:e}),indicesCount:1.5*(u!==l-1?c:this._size%c)})}}};function Cx(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;const n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=h(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=vt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Tt._appendAttributes=function(e,t,n,i){const o=t.arrayViews,s=o.length;for(let a=0;a<s;++a){const c=o[a];e.push({index:c.index,enabled:c.enabled,componentsPerAttribute:c.componentsPerAttribute,componentDatatype:c.componentDatatype,normalize:c.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+c.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},Tt.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new C("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new C("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");const n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)Ex(n[i],e,t)};function Ex(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){const i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Tt.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Rc(e){const t=e.va;if(!h(t))return;const n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Tt.prototype.isDestroyed=function(){return!1},Tt.prototype.destroy=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){const i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return Rc(this),Qe(this)};function $n(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Pe,this.setValue(e)}Object.defineProperties($n.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),$n.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},$n.prototype.setValue=function(e){const t=this._value;if(t!==e){const n=h(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},$n.prototype.equals=function(e){return this===e||e instanceof $n&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},$n.prototype.valueOf=function(){return this._value},$n.prototype.toString=function(){return String(this._value)};function bx(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(s){const a=this[t],c=this[n];h(c)&&(c(),this[n]=void 0),s!==void 0&&(!h(s)||!h(s.getValue))&&h(o)&&(s=o(s)),a!==s&&(this[t]=s,this._definitionChanged.raiseEvent(this,e,s,a)),h(s)&&h(s.definitionChanged)&&(this[n]=s.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,s,s)},this))}}}function wx(e){return new $n(e)}function F(e,t,n){return bx(e,`_${e.toString()}`,`_${e.toString()}Subscription`,_(t,!1),_(n,wx))}function lr(e){this._definitionChanged=new Pe,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(_(e,_.EMPTY_OBJECT))}Object.defineProperties(lr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),image:F("image"),scale:F("scale"),pixelOffset:F("pixelOffset"),eyeOffset:F("eyeOffset"),horizontalOrigin:F("horizontalOrigin"),verticalOrigin:F("verticalOrigin"),heightReference:F("heightReference"),color:F("color"),rotation:F("rotation"),alignedAxis:F("alignedAxis"),sizeInMeters:F("sizeInMeters"),width:F("width"),height:F("height"),scaleByDistance:F("scaleByDistance"),translucencyByDistance:F("translucencyByDistance"),pixelOffsetScaleByDistance:F("pixelOffsetScaleByDistance"),imageSubRegion:F("imageSubRegion"),distanceDisplayCondition:F("distanceDisplayCondition"),disableDepthTestDistance:F("disableDepthTestDistance"),splitDirection:F("splitDirection")}),lr.prototype.clone=function(e){return h(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.splitDirection=this._splitDirection,e):new lr(this)},lr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this._show,e.show),this.image=_(this._image,e.image),this.scale=_(this._scale,e.scale),this.pixelOffset=_(this._pixelOffset,e.pixelOffset),this.eyeOffset=_(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=_(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=_(this._verticalOrigin,e.verticalOrigin),this.heightReference=_(this._heightReference,e.heightReference),this.color=_(this._color,e.color),this.rotation=_(this._rotation,e.rotation),this.alignedAxis=_(this._alignedAxis,e.alignedAxis),this.sizeInMeters=_(this._sizeInMeters,e.sizeInMeters),this.width=_(this._width,e.width),this.height=_(this._height,e.height),this.scaleByDistance=_(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=_(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=_(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=_(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=_(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=_(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=_(this.splitDirection,e.splitDirection)};function Zn(){this._array=[],this._hash={}}Object.defineProperties(Zn.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),Zn.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return h(this._hash[e])},Zn.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))},Zn.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return this._hash[e]},Zn.prototype.remove=function(e){if(h(e)&&typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");const t=this._hash[e],n=h(t);if(n){const i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n},Zn.prototype.removeAll=function(){const e=this._array;e.length>0&&(this._hash={},e.length=0)};function rt(e,t){e=_(e,0),this._near=e,t=_(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(rt.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}}}),rt.packedLength=2,rt.pack=function(e,t,n){if(!h(e))throw new C("value is required");if(!h(t))throw new C("array is required");return n=_(n,0),t[n++]=e.near,t[n]=e.far,t},rt.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new rt),n.near=e[t++],n.far=e[t],n},rt.equals=function(e,t){return e===t||h(e)&&h(t)&&e.near===t.near&&e.far===t.far},rt.clone=function(e,t){if(h(e))return h(t)||(t=new rt),t.near=e.near,t.far=e.far,t},rt.prototype.clone=function(e){return rt.clone(this,e)},rt.prototype.equals=function(e){return rt.equals(this,e)};function we(e,t,n,i){this.near=_(e,0),this.nearValue=_(t,0),this.far=_(n,1),this.farValue=_(i,0)}we.clone=function(e,t){if(h(e))return h(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new we(e.near,e.nearValue,e.far,e.farValue)},we.packedLength=4,we.pack=function(e,t,n){if(!h(e))throw new C("value is required");if(!h(t))throw new C("array is required");return n=_(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t},we.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new we),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},we.equals=function(e,t){return e===t||h(e)&&h(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},we.prototype.clone=function(e){return we.clone(this,e)},we.prototype.equals=function(e){return we.equals(this,e)};const eo={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},pi=Object.freeze(eo);function $s(e){return e===eo.CLAMP_TO_GROUND||e===eo.CLAMP_TO_3D_TILE||e===eo.CLAMP_TO_TERRAIN}function Tx(e){return e===eo.RELATIVE_TO_GROUND||e===eo.RELATIVE_TO_3D_TILE||e===eo.RELATIVE_TO_TERRAIN}const In=Object.freeze({CENTER:0,LEFT:1,RIGHT:-1}),Je=Object.freeze({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1});function Ae(){C.throwInstantiationError()}Object.defineProperties(Ae.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}}),Ae.prototype.getValue=C.throwInstantiationError,Ae.prototype.equals=C.throwInstantiationError,Ae.equals=function(e,t){return e===t||h(e)&&e.equals(t)},Ae.arrayEquals=function(e,t){if(e===t)return!0;if(!h(e)||!h(t)||e.length!==t.length)return!1;const n=e.length;for(let i=0;i<n;i++)if(!Ae.equals(e[i],t[i]))return!1;return!0},Ae.isConstant=function(e){return!h(e)||e.isConstant},Ae.getValueOrUndefined=function(e,t,n){return h(e)?e.getValue(t,n):void 0},Ae.getValueOrDefault=function(e,t,n,i){return h(e)?_(e.getValue(t,i),n):n},Ae.getValueOrClonedDefault=function(e,t,n,i){let o;return h(e)&&(o=e.getValue(t,i)),h(o)||(o=n.clone(o)),o};const Ou=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});function to(e,t){this.start=_(e,0),this.stop=_(t,0)}function K(e,t){this.center=f.clone(_(e,f.ZERO)),this.radius=_(t,0)}const zc=new f,Pc=new f,Bc=new f,Nc=new f,Fc=new f,Lc=new f,Mc=new f,Ft=new f,Uc=new f,kc=new f,Vc=new f,Gc=new f,Sx=4/3*S.PI;K.fromPoints=function(e,t){if(h(t)||(t=new K),!h(e)||e.length===0)return t.center=f.clone(f.ZERO,t.center),t.radius=0,t;const n=f.clone(e[0],Mc),i=f.clone(n,zc),o=f.clone(n,Pc),s=f.clone(n,Bc),a=f.clone(n,Nc),c=f.clone(n,Fc),l=f.clone(n,Lc),u=e.length;let d;for(d=1;d<u;d++){f.clone(e[d],n);const P=n.x,V=n.y,k=n.z;P<i.x&&f.clone(n,i),P>a.x&&f.clone(n,a),V<o.y&&f.clone(n,o),V>c.y&&f.clone(n,c),k<s.z&&f.clone(n,s),k>l.z&&f.clone(n,l)}const p=f.magnitudeSquared(f.subtract(a,i,Ft)),g=f.magnitudeSquared(f.subtract(c,o,Ft)),y=f.magnitudeSquared(f.subtract(l,s,Ft));let x=i,E=a,b=p;g>b&&(b=g,x=o,E=c),y>b&&(b=y,x=s,E=l);const D=Uc;D.x=(x.x+E.x)*.5,D.y=(x.y+E.y)*.5,D.z=(x.z+E.z)*.5;let A=f.magnitudeSquared(f.subtract(E,D,Ft)),O=Math.sqrt(A);const I=kc;I.x=i.x,I.y=o.y,I.z=s.z;const B=Vc;B.x=a.x,B.y=c.y,B.z=l.z;const M=f.midpoint(I,B,Gc);let q=0;for(d=0;d<u;d++){f.clone(e[d],n);const P=f.magnitude(f.subtract(n,M,Ft));P>q&&(q=P);const V=f.magnitudeSquared(f.subtract(n,D,Ft));if(V>A){const k=Math.sqrt(V);O=(O+k)*.5,A=O*O;const H=k-O;D.x=(O*D.x+H*n.x)/k,D.y=(O*D.y+H*n.y)/k,D.z=(O*D.z+H*n.z)/k}}return O<q?(f.clone(D,t.center),t.radius=O):(f.clone(M,t.center),t.radius=q),t};const vu=new Sn,Ax=new f,Dx=new f,qc=new ee,Hc=new ee;K.fromRectangle2D=function(e,t,n){return K.fromRectangleWithHeights2D(e,t,0,0,n)},K.fromRectangleWithHeights2D=function(e,t,n,i,o){if(h(o)||(o=new K),!h(e))return o.center=f.clone(f.ZERO,o.center),o.radius=0,o;vu._ellipsoid=le.default,t=_(t,vu),ce.southwest(e,qc),qc.height=n,ce.northeast(e,Hc),Hc.height=i;const s=t.project(qc,Ax),a=t.project(Hc,Dx),c=a.x-s.x,l=a.y-s.y,u=a.z-s.z;o.radius=Math.sqrt(c*c+l*l+u*u)*.5;const d=o.center;return d.x=s.x+c*.5,d.y=s.y+l*.5,d.z=s.z+u*.5,o};const Ox=[];K.fromRectangle3D=function(e,t,n,i){if(t=_(t,le.default),n=_(n,0),h(i)||(i=new K),!h(e))return i.center=f.clone(f.ZERO,i.center),i.radius=0,i;const o=ce.subsample(e,t,n,Ox);return K.fromPoints(o,i)},K.fromVertices=function(e,t,n,i){if(h(i)||(i=new K),!h(e)||e.length===0)return i.center=f.clone(f.ZERO,i.center),i.radius=0,i;t=_(t,f.ZERO),n=_(n,3),m.typeOf.number.greaterThanOrEquals("stride",n,3);const o=Mc;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;const s=f.clone(o,zc),a=f.clone(o,Pc),c=f.clone(o,Bc),l=f.clone(o,Nc),u=f.clone(o,Fc),d=f.clone(o,Lc),p=e.length;let g;for(g=0;g<p;g+=n){const k=e[g]+t.x,H=e[g+1]+t.y,j=e[g+2]+t.z;o.x=k,o.y=H,o.z=j,k<s.x&&f.clone(o,s),k>l.x&&f.clone(o,l),H<a.y&&f.clone(o,a),H>u.y&&f.clone(o,u),j<c.z&&f.clone(o,c),j>d.z&&f.clone(o,d)}const y=f.magnitudeSquared(f.subtract(l,s,Ft)),x=f.magnitudeSquared(f.subtract(u,a,Ft)),E=f.magnitudeSquared(f.subtract(d,c,Ft));let b=s,D=l,A=y;x>A&&(A=x,b=a,D=u),E>A&&(A=E,b=c,D=d);const O=Uc;O.x=(b.x+D.x)*.5,O.y=(b.y+D.y)*.5,O.z=(b.z+D.z)*.5;let I=f.magnitudeSquared(f.subtract(D,O,Ft)),B=Math.sqrt(I);const M=kc;M.x=s.x,M.y=a.y,M.z=c.z;const q=Vc;q.x=l.x,q.y=u.y,q.z=d.z;const P=f.midpoint(M,q,Gc);let V=0;for(g=0;g<p;g+=n){o.x=e[g]+t.x,o.y=e[g+1]+t.y,o.z=e[g+2]+t.z;const k=f.magnitude(f.subtract(o,P,Ft));k>V&&(V=k);const H=f.magnitudeSquared(f.subtract(o,O,Ft));if(H>I){const j=Math.sqrt(H);B=(B+j)*.5,I=B*B;const r=j-B;O.x=(B*O.x+r*o.x)/j,O.y=(B*O.y+r*o.y)/j,O.z=(B*O.z+r*o.z)/j}}return B<V?(f.clone(O,i.center),i.radius=B):(f.clone(P,i.center),i.radius=V),i},K.fromEncodedCartesianVertices=function(e,t,n){if(h(n)||(n=new K),!h(e)||!h(t)||e.length!==t.length||e.length===0)return n.center=f.clone(f.ZERO,n.center),n.radius=0,n;const i=Mc;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const o=f.clone(i,zc),s=f.clone(i,Pc),a=f.clone(i,Bc),c=f.clone(i,Nc),l=f.clone(i,Fc),u=f.clone(i,Lc),d=e.length;let p;for(p=0;p<d;p+=3){const V=e[p]+t[p],k=e[p+1]+t[p+1],H=e[p+2]+t[p+2];i.x=V,i.y=k,i.z=H,V<o.x&&f.clone(i,o),V>c.x&&f.clone(i,c),k<s.y&&f.clone(i,s),k>l.y&&f.clone(i,l),H<a.z&&f.clone(i,a),H>u.z&&f.clone(i,u)}const g=f.magnitudeSquared(f.subtract(c,o,Ft)),y=f.magnitudeSquared(f.subtract(l,s,Ft)),x=f.magnitudeSquared(f.subtract(u,a,Ft));let E=o,b=c,D=g;y>D&&(D=y,E=s,b=l),x>D&&(D=x,E=a,b=u);const A=Uc;A.x=(E.x+b.x)*.5,A.y=(E.y+b.y)*.5,A.z=(E.z+b.z)*.5;let O=f.magnitudeSquared(f.subtract(b,A,Ft)),I=Math.sqrt(O);const B=kc;B.x=o.x,B.y=s.y,B.z=a.z;const M=Vc;M.x=c.x,M.y=l.y,M.z=u.z;const q=f.midpoint(B,M,Gc);let P=0;for(p=0;p<d;p+=3){i.x=e[p]+t[p],i.y=e[p+1]+t[p+1],i.z=e[p+2]+t[p+2];const V=f.magnitude(f.subtract(i,q,Ft));V>P&&(P=V);const k=f.magnitudeSquared(f.subtract(i,A,Ft));if(k>O){const H=Math.sqrt(k);I=(I+H)*.5,O=I*I;const j=H-I;A.x=(I*A.x+j*i.x)/H,A.y=(I*A.y+j*i.y)/H,A.z=(I*A.z+j*i.z)/H}}return I<P?(f.clone(A,n.center),n.radius=I):(f.clone(q,n.center),n.radius=P),n},K.fromCornerPoints=function(e,t,n){m.typeOf.object("corner",e),m.typeOf.object("oppositeCorner",t),h(n)||(n=new K);const i=f.midpoint(e,t,n.center);return n.radius=f.distance(i,t),n},K.fromEllipsoid=function(e,t){return m.typeOf.object("ellipsoid",e),h(t)||(t=new K),f.clone(f.ZERO,t.center),t.radius=e.maximumRadius,t};const vx=new f;K.fromBoundingSpheres=function(e,t){if(h(t)||(t=new K),!h(e)||e.length===0)return t.center=f.clone(f.ZERO,t.center),t.radius=0,t;const n=e.length;if(n===1)return K.clone(e[0],t);if(n===2)return K.union(e[0],e[1],t);const i=[];let o;for(o=0;o<n;o++)i.push(e[o].center);t=K.fromPoints(i,t);const s=t.center;let a=t.radius;for(o=0;o<n;o++){const c=e[o];a=Math.max(a,f.distance(s,c.center,vx)+c.radius)}return t.radius=a,t};const Ix=new f,Rx=new f,zx=new f;K.fromOrientedBoundingBox=function(e,t){m.defined("orientedBoundingBox",e),h(t)||(t=new K);const n=e.halfAxes,i=L.getColumn(n,0,Ix),o=L.getColumn(n,1,Rx),s=L.getColumn(n,2,zx);return f.add(i,o,i),f.add(i,s,i),t.center=f.clone(e.center,t.center),t.radius=f.magnitude(i),t};const Px=new f,Bx=new f;K.fromTransformation=function(e,t){m.typeOf.object("transformation",e),h(t)||(t=new K);const n=N.getTranslation(e,Px),i=N.getScale(e,Bx),o=.5*f.magnitude(i);return t.center=f.clone(n,t.center),t.radius=o,t},K.clone=function(e,t){if(h(e))return h(t)?(t.center=f.clone(e.center,t.center),t.radius=e.radius,t):new K(e.center,e.radius)},K.packedLength=4,K.pack=function(e,t,n){m.typeOf.object("value",e),m.defined("array",t),n=_(n,0);const i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},K.unpack=function(e,t,n){m.defined("array",e),t=_(t,0),h(n)||(n=new K);const i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};const Nx=new f,Fx=new f;K.union=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),h(n)||(n=new K);const i=e.center,o=e.radius,s=t.center,a=t.radius,c=f.subtract(s,i,Nx),l=f.magnitude(c);if(o>=l+a)return e.clone(n),n;if(a>=l+o)return t.clone(n),n;const u=(o+l+a)*.5,d=f.multiplyByScalar(c,(-o+u)/l,Fx);return f.add(d,i,d),f.clone(d,n.center),n.radius=u,n};const Lx=new f;K.expand=function(e,t,n){m.typeOf.object("sphere",e),m.typeOf.object("point",t),n=K.clone(e,n);const i=f.magnitude(f.subtract(t,n.center,Lx));return i>n.radius&&(n.radius=i),n},K.intersectPlane=function(e,t){m.typeOf.object("sphere",e),m.typeOf.object("plane",t);const n=e.center,i=e.radius,o=t.normal,s=f.dot(o,n)+t.distance;return s<-i?Et.OUTSIDE:s<i?Et.INTERSECTING:Et.INSIDE},K.transform=function(e,t,n){return m.typeOf.object("sphere",e),m.typeOf.object("transform",t),h(n)||(n=new K),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=N.getMaximumScale(t)*e.radius,n};const Mx=new f;K.distanceSquaredTo=function(e,t){m.typeOf.object("sphere",e),m.typeOf.object("cartesian",t);const n=f.subtract(e.center,t,Mx),i=f.magnitude(n)-e.radius;return i<=0?0:i*i},K.transformWithoutScale=function(e,t,n){return m.typeOf.object("sphere",e),m.typeOf.object("transform",t),h(n)||(n=new K),n.center=N.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};const Ux=new f;K.computePlaneDistances=function(e,t,n,i){m.typeOf.object("sphere",e),m.typeOf.object("position",t),m.typeOf.object("direction",n),h(i)||(i=new to);const o=f.subtract(e.center,t,Ux),s=f.dot(n,o);return i.start=s-e.radius,i.stop=s+e.radius,i};const Iu=new f,kx=new f,Vx=new f,Gx=new f,qx=new f,Hx=new ee,Ru=new Array(8);for(let e=0;e<8;++e)Ru[e]=new f;const zu=new Sn;K.projectTo2D=function(e,t,n){m.typeOf.object("sphere",e),zu._ellipsoid=le.default,t=_(t,zu);const i=t.ellipsoid;let o=e.center;const s=e.radius;let a;f.equals(o,f.ZERO)?a=f.clone(f.UNIT_X,Iu):a=i.geodeticSurfaceNormal(o,Iu);const c=f.cross(f.UNIT_Z,a,kx);f.normalize(c,c);const l=f.cross(a,c,Vx);f.normalize(l,l),f.multiplyByScalar(a,s,a),f.multiplyByScalar(l,s,l),f.multiplyByScalar(c,s,c);const u=f.negate(l,qx),d=f.negate(c,Gx),p=Ru;let g=p[0];f.add(a,l,g),f.add(g,c,g),g=p[1],f.add(a,l,g),f.add(g,d,g),g=p[2],f.add(a,u,g),f.add(g,d,g),g=p[3],f.add(a,u,g),f.add(g,c,g),f.negate(a,a),g=p[4],f.add(a,l,g),f.add(g,c,g),g=p[5],f.add(a,l,g),f.add(g,d,g),g=p[6],f.add(a,u,g),f.add(g,d,g),g=p[7],f.add(a,u,g),f.add(g,c,g);const y=p.length;for(let D=0;D<y;++D){const A=p[D];f.add(o,A,A);const O=i.cartesianToCartographic(A,Hx);t.project(O,A)}n=K.fromPoints(p,n),o=n.center;const x=o.x,E=o.y,b=o.z;return o.x=b,o.y=x,o.z=E,n},K.isOccluded=function(e,t){return m.typeOf.object("sphere",e),m.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},K.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&e.radius===t.radius},K.prototype.intersectPlane=function(e){return K.intersectPlane(this,e)},K.prototype.distanceSquaredTo=function(e){return K.distanceSquaredTo(this,e)},K.prototype.computePlaneDistances=function(e,t,n){return K.computePlaneDistances(this,e,t,n)},K.prototype.isOccluded=function(e){return K.isOccluded(this,e)},K.prototype.equals=function(e){return K.equals(this,e)},K.prototype.clone=function(e){return K.clone(this,e)},K.prototype.volume=function(){const e=this.radius;return Sx*e*e*e};function Pu(e){e=_(e,_.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}const Bu=Object.freeze({NONE:0,TOP:1,ALL:2});function st(e){e=_(e,_.EMPTY_OBJECT),this.position=_(e.position,!1),this.normal=_(e.normal,!1),this.st=_(e.st,!1),this.bitangent=_(e.bitangent,!1),this.tangent=_(e.tangent,!1),this.color=_(e.color,!1)}st.POSITION_ONLY=Object.freeze(new st({position:!0})),st.POSITION_AND_NORMAL=Object.freeze(new st({position:!0,normal:!0})),st.POSITION_NORMAL_AND_ST=Object.freeze(new st({position:!0,normal:!0,st:!0})),st.POSITION_AND_ST=Object.freeze(new st({position:!0,st:!0})),st.POSITION_AND_COLOR=Object.freeze(new st({position:!0,color:!0})),st.ALL=Object.freeze(new st({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),st.DEFAULT=st.POSITION_NORMAL_AND_ST,st.packedLength=6,st.pack=function(e,t,n){if(!h(e))throw new C("value is required");if(!h(t))throw new C("array is required");return n=_(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},st.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new st),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n},st.clone=function(e,t){if(h(e))return h(t)||(t=new st),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};function Ro(e,t,n,i){e=_(e,1),t=_(t,1),n=_(n,1),i=_(i,1),this.value=new Uint8Array([T.floatToByte(e),T.floatToByte(t),T.floatToByte(n),T.floatToByte(i)])}Object.defineProperties(Ro.prototype,{componentDatatype:{get:function(){return oe.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),Ro.fromColor=function(e){if(!h(e))throw new C("color is required.");return new Ro(e.red,e.green,e.blue,e.alpha)},Ro.toValue=function(e,t){if(!h(e))throw new C("color is required.");return h(t)?e.toBytes(t):new Uint8Array(e.toBytes())},Ro.equals=function(e,t){return e===t||h(e)&&h(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]};function Zs(e){if(e=_(e,_.EMPTY_OBJECT),!h(e.geometry))throw new C("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=_(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}function Ke(e){e=_(e,_.EMPTY_OBJECT),this.start=h(e.start)?$.clone(e.start):new $,this.stop=h(e.stop)?$.clone(e.stop):new $,this.data=e.data,this.isStartIncluded=_(e.isStartIncluded,!0),this.isStopIncluded=_(e.isStopIncluded,!0)}Object.defineProperties(Ke.prototype,{isEmpty:{get:function(){const e=$.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});const zo={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Ke.fromIso8601=function(e,t){m.typeOf.object("options",e),m.typeOf.string("options.iso8601",e.iso8601);const n=e.iso8601.split("/");if(n.length!==2)throw new C("options.iso8601 is an invalid ISO 8601 interval.");const i=$.fromIso8601(n[0]),o=$.fromIso8601(n[1]),s=_(e.isStartIncluded,!0),a=_(e.isStopIncluded,!0),c=e.data;return h(t)?(t.start=i,t.stop=o,t.isStartIncluded=s,t.isStopIncluded=a,t.data=c,t):(zo.start=i,zo.stop=o,zo.isStartIncluded=s,zo.isStopIncluded=a,zo.data=c,new Ke(zo))},Ke.toIso8601=function(e,t){return m.typeOf.object("timeInterval",e),`${$.toIso8601(e.start,t)}/${$.toIso8601(e.stop,t)}`},Ke.clone=function(e,t){if(h(e))return h(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Ke(e)},Ke.equals=function(e,t,n){return e===t||h(e)&&h(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&$.equals(e.start,t.start)&&$.equals(e.stop,t.stop)&&(e.data===t.data||h(n)&&n(e.data,t.data)))},Ke.equalsEpsilon=function(e,t,n,i){return n=_(n,0),e===t||h(e)&&h(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&$.equalsEpsilon(e.start,t.start,n)&&$.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||h(i)&&i(e.data,t.data)))},Ke.intersect=function(e,t,n,i){if(m.typeOf.object("left",e),!h(t))return Ke.clone(Ke.EMPTY,n);const o=e.start,s=e.stop,a=t.start,c=t.stop,l=$.greaterThanOrEquals(a,o)&&$.greaterThanOrEquals(s,a),u=!l&&$.lessThanOrEquals(a,o)&&$.lessThanOrEquals(o,c);if(!l&&!u)return Ke.clone(Ke.EMPTY,n);const d=e.isStartIncluded,p=e.isStopIncluded,g=t.isStartIncluded,y=t.isStopIncluded,x=$.lessThan(s,c);return h(n)||(n=new Ke),n.start=l?a:o,n.isStartIncluded=d&&g||!$.equals(a,o)&&(l&&g||u&&d),n.stop=x?s:c,n.isStopIncluded=x?p:p&&y||!$.equals(c,s)&&y,n.data=h(i)?i(e.data,t.data):e.data,n},Ke.contains=function(e,t){if(m.typeOf.object("timeInterval",e),m.typeOf.object("julianDate",t),e.isEmpty)return!1;const n=$.compare(e.start,t);if(n===0)return e.isStartIncluded;const i=$.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0},Ke.prototype.clone=function(e){return Ke.clone(this,e)},Ke.prototype.equals=function(e,t){return Ke.equals(this,e,t)},Ke.prototype.equalsEpsilon=function(e,t,n){return Ke.equalsEpsilon(this,e,t,n)},Ke.prototype.toString=function(){return Ke.toIso8601(this)},Ke.EMPTY=Object.freeze(new Ke({start:new $,stop:new $,isStartIncluded:!1,isStopIncluded:!1}));const Nu=Object.freeze($.fromIso8601("0000-01-01T00:00:00Z")),Fu=Object.freeze($.fromIso8601("9999-12-31T24:00:00Z")),Wx=Object.freeze(new Ke({start:Nu,stop:Fu})),Li={MINIMUM_VALUE:Nu,MAXIMUM_VALUE:Fu,MAXIMUM_INTERVAL:Wx};function hr(e,t,n){e=_(e,0),t=_(t,0),n=_(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(hr.prototype,{componentDatatype:{get:function(){return oe.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),hr.fromCartesian3=function(e){return m.defined("offset",e),new hr(e.x,e.y,e.z)},hr.toValue=function(e,t){return m.defined("offset",e),h(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};const jx={ADD:R.FUNC_ADD,SUBTRACT:R.FUNC_SUBTRACT,REVERSE_SUBTRACT:R.FUNC_REVERSE_SUBTRACT,MIN:R.MIN,MAX:R.MAX},Po=Object.freeze(jx),Yx={ZERO:R.ZERO,ONE:R.ONE,SOURCE_COLOR:R.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:R.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:R.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:R.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:R.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:R.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:R.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:R.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:R.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:R.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:R.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:R.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:R.SRC_ALPHA_SATURATE},xn=Object.freeze(Yx),Xx={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Po.ADD,equationAlpha:Po.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Po.ADD,equationAlpha:Po.ADD,functionSourceRgb:xn.ONE,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:xn.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Po.ADD,equationAlpha:Po.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE,functionDestinationAlpha:xn.ONE})},no=Object.freeze(Xx),$x={FRONT:R.FRONT,BACK:R.BACK,FRONT_AND_BACK:R.FRONT_AND_BACK},Bo=Object.freeze($x);function Ut(e){e=_(e,_.EMPTY_OBJECT),this.material=e.material,this.translucent=_(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=_(e.closed,!1)}Object.defineProperties(Ut.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}}}),Ut.prototype.getFragmentShaderSource=function(){const e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),h(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
3832
+ `)},Ut.prototype.isTranslucent=function(){return h(this.material)&&this.material.isTranslucent()||!h(this.material)&&this.translucent},Ut.prototype.getRenderState=function(){const e=this.isTranslucent(),t=tn(this.renderState,!1);return e?(t.depthMask=!1,t.blending=no.ALPHA_BLEND):t.depthMask=!0,t},Ut.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=no.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Bo.BACK}),h(n)&&(i=nn(n,i,!0)),i};const Zx=`uniform sampler2D image;
3833
3833
 
3834
3834
  czm_material czm_getMaterial(czm_materialInput materialInput)
3835
3835
  {
@@ -4428,7 +4428,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
4428
4428
 
4429
4429
  return material;
4430
4430
  }
4431
- `;function Q(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=_(e.minificationFilter,Mt.LINEAR),this._magnificationFilter=_(e.magnificationFilter,Qi.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,mC(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),h(Q._uniformList[this.type])||(Q._uniformList[this.type]=Object.keys(this._uniforms))}Q._uniformList={},Q.fromType=function(e,t){if(!h(Q._materialCache.getMaterial(e)))throw new C(`material with type '${e}' does not exist.`);const n=new Q({fabric:{type:e}});if(h(t))for(const i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n},Q.prototype.isTranslucent=function(){if(h(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0;const t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){const o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e},Q.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n;const i=this._loadedImages;let o=i.length;for(t=0;t<o;++t){const l=i[t];n=l.id;let u=l.image,d;Array.isArray(u)&&(d=u.slice(1,u.length).map(function(E){return E.bufferView}),u=u[0]);const p=new Yn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter});let g;h(u.internalFormat)?g=new Nt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:d},sampler:p}):g=new Nt({context:e,source:u,sampler:p});const y=this._textures[n];h(y)&&y!==this._defaultTexture&&y.destroy(),this._textures[n]=g;const x=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(x)){const E=this.uniforms[x];E.x=g._width,E.y=g._height}}i.length=0;const s=this._loadedCubeMaps;for(o=s.length,t=0;t<o;++t){const l=s[t];n=l.id;const u=l.images,d=new wt({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Yn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=d}s.length=0;const a=this._updateFunctions;for(o=a.length,t=0;t<o;++t)a[t](this,e);const c=this.materials;for(const l in c)c.hasOwnProperty(l)&&c[l].update(e)},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){const e=this._textures;for(const n in e)if(e.hasOwnProperty(n)){const i=e[n];i!==this._defaultTexture&&i.destroy()}const t=this.materials;for(const n in t)t.hasOwnProperty(n)&&t[n].destroy();return Qe(this)};function mC(e,t){e=_(e,_.EMPTY_OBJECT),t._strict=_(e.strict,!1),t._count=_(e.count,0),t._template=tn(_(e.fabric,_.EMPTY_OBJECT)),t._template.uniforms=tn(_(t._template.uniforms,_.EMPTY_OBJECT)),t._template.materials=tn(_(t._template.materials,_.EMPTY_OBJECT)),t.type=h(t._template.type)?t._template.type:Vn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n;const i=Q._materialCache.getMaterial(t.type);if(h(i)){const s=tn(i.fabric,!0);t._template=nn(t._template,s,!0),n=i.translucent}xC(t),h(i)||Q._materialCache.addMaterial(t.type,t),EC(t),SC(t),DC(t);const o=t._translucentFunctions.length===0?!0:void 0;if(n=_(n,o),n=_(e.translucent,n),h(n))if(typeof n=="function"){const s=function(){return n(t)};t._translucentFunctions.push(s)}else t._translucentFunctions.push(n)}function Wc(e,t,n,i){if(h(e)){for(const o in e)if(e.hasOwnProperty(o)){const s=t.indexOf(o)!==-1;(i&&!s||!i&&s)&&n(o,t)}}}function Lu(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){const o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new C(n)}function _C(e,t){const n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}const gC=["type","materials","uniforms","components","source"],yC=["diffuse","specular","shininess","normal","emission","alpha"];function xC(e){const t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(h(o)&&h(t.source))throw new C("fabric: cannot have source and components in the same template.");Wc(t,gC,Lu,!0),Wc(o,yC,Lu,!0);const s=[];for(const a in i)i.hasOwnProperty(a)&&s.push(a);Wc(n,s,_C,!1)}function CC(e,t){const n=t._template.materials;for(const i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function EC(e){const t=e._template.components,n=e._template.source;if(h(n))e.shaderSource+=`${n}
4431
+ `;function Q(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=_(e.minificationFilter,Mt.LINEAR),this._magnificationFilter=_(e.magnificationFilter,Ji.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,mC(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),h(Q._uniformList[this.type])||(Q._uniformList[this.type]=Object.keys(this._uniforms))}Q._uniformList={},Q.fromType=function(e,t){if(!h(Q._materialCache.getMaterial(e)))throw new C(`material with type '${e}' does not exist.`);const n=new Q({fabric:{type:e}});if(h(t))for(const i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n},Q.prototype.isTranslucent=function(){if(h(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0;const t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){const o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e},Q.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n;const i=this._loadedImages;let o=i.length;for(t=0;t<o;++t){const l=i[t];n=l.id;let u=l.image,d;Array.isArray(u)&&(d=u.slice(1,u.length).map(function(E){return E.bufferView}),u=u[0]);const p=new Yn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter});let g;h(u.internalFormat)?g=new Nt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:d},sampler:p}):g=new Nt({context:e,source:u,sampler:p});const y=this._textures[n];h(y)&&y!==this._defaultTexture&&y.destroy(),this._textures[n]=g;const x=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(x)){const E=this.uniforms[x];E.x=g._width,E.y=g._height}}i.length=0;const s=this._loadedCubeMaps;for(o=s.length,t=0;t<o;++t){const l=s[t];n=l.id;const u=l.images,d=new wt({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Yn({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=d}s.length=0;const a=this._updateFunctions;for(o=a.length,t=0;t<o;++t)a[t](this,e);const c=this.materials;for(const l in c)c.hasOwnProperty(l)&&c[l].update(e)},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){const e=this._textures;for(const n in e)if(e.hasOwnProperty(n)){const i=e[n];i!==this._defaultTexture&&i.destroy()}const t=this.materials;for(const n in t)t.hasOwnProperty(n)&&t[n].destroy();return Qe(this)};function mC(e,t){e=_(e,_.EMPTY_OBJECT),t._strict=_(e.strict,!1),t._count=_(e.count,0),t._template=tn(_(e.fabric,_.EMPTY_OBJECT)),t._template.uniforms=tn(_(t._template.uniforms,_.EMPTY_OBJECT)),t._template.materials=tn(_(t._template.materials,_.EMPTY_OBJECT)),t.type=h(t._template.type)?t._template.type:Vn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n;const i=Q._materialCache.getMaterial(t.type);if(h(i)){const s=tn(i.fabric,!0);t._template=nn(t._template,s,!0),n=i.translucent}xC(t),h(i)||Q._materialCache.addMaterial(t.type,t),EC(t),SC(t),DC(t);const o=t._translucentFunctions.length===0?!0:void 0;if(n=_(n,o),n=_(e.translucent,n),h(n))if(typeof n=="function"){const s=function(){return n(t)};t._translucentFunctions.push(s)}else t._translucentFunctions.push(n)}function Wc(e,t,n,i){if(h(e)){for(const o in e)if(e.hasOwnProperty(o)){const s=t.indexOf(o)!==-1;(i&&!s||!i&&s)&&n(o,t)}}}function Lu(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){const o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new C(n)}function _C(e,t){const n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}const gC=["type","materials","uniforms","components","source"],yC=["diffuse","specular","shininess","normal","emission","alpha"];function xC(e){const t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(h(o)&&h(t.source))throw new C("fabric: cannot have source and components in the same template.");Wc(t,gC,Lu,!0),Wc(o,yC,Lu,!0);const s=[];for(const a in i)i.hasOwnProperty(a)&&s.push(a);Wc(n,s,_C,!1)}function CC(e,t){const n=t._template.materials;for(const i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function EC(e){const t=e._template.components,n=e._template.source;if(h(n))e.shaderSource+=`${n}
4432
4432
  `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
4433
4433
  {
4434
4434
  `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
@@ -4502,7 +4502,7 @@ void main()
4502
4502
 
4503
4503
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
4504
4504
  }
4505
- `;function jt(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=_(e.closed,!1),i=_(e.flat,!1),o=i?RC:IC,s=i?ku:vC,a=i?jt.FLAT_VERTEX_FORMAT:jt.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,o),this._fragmentShaderSource=_(e.fragmentShaderSource,s),this._renderState=Ut.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=_(e.faceForward,!n)}Object.defineProperties(jt.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}}}),jt.VERTEX_FORMAT=st.POSITION_AND_NORMAL,jt.FLAT_VERTEX_FORMAT=st.POSITION_ONLY,jt.prototype.getFragmentShaderSource=Ut.prototype.getFragmentShaderSource,jt.prototype.isTranslucent=Ut.prototype.isTranslucent,jt.prototype.getRenderState=Ut.prototype.getRenderState;function No(e){this._definitionChanged=new Pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(No.prototype,{isConstant:{get:function(){return Ae.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:F("color")}),No.prototype.getType=function(e){return"Color"};const zC=new $;No.prototype.getValue=function(e,t){return h(e)||(e=$.now(zC)),h(t)||(t={}),t.color=Ae.getValueOrClonedDefault(this._color,e,T.WHITE,t.color),t},No.prototype.equals=function(e){return this===e||e instanceof No&&Ae.equals(this._color,e._color)};function Li(e){e=_(e,_.EMPTY_OBJECT),this._ellipsoid=_(e.ellipsoid,le.default),this._rectangle=_(e.rectangle,ce.MAX_VALUE),this._projection=new Sn(this._ellipsoid),this._numberOfLevelZeroTilesX=_(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=_(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Li.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Li.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},Li.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},Li.prototype.rectangleToNativeRectangle=function(e,t){m.defined("rectangle",e);const n=S.toDegrees(e.west),i=S.toDegrees(e.south),o=S.toDegrees(e.east),s=S.toDegrees(e.north);return h(t)?(t.west=n,t.south=i,t.east=o,t.north=s,t):new ce(n,i,o,s)},Li.prototype.tileXYToNativeRectangle=function(e,t,n,i){const o=this.tileXYToRectangle(e,t,n,i);return o.west=S.toDegrees(o.west),o.south=S.toDegrees(o.south),o.east=S.toDegrees(o.east),o.north=S.toDegrees(o.north),o},Li.prototype.tileXYToRectangle=function(e,t,n,i){const o=this._rectangle,s=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),c=o.width/s,l=e*c+o.west,u=(e+1)*c+o.west,d=o.height/a,p=o.north-t*d,g=o.north-(t+1)*d;return h(i)||(i=new ce(l,g,u,p)),i.west=l,i.south=g,i.east=u,i.north=p,i},Li.prototype.positionToTileXY=function(e,t,n){const i=this._rectangle;if(!ce.contains(i,e))return;const o=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),a=i.width/o,c=i.height/s;let l=e.longitude;i.east<i.west&&(l+=S.TWO_PI);let u=(l-i.west)/a|0;u>=o&&(u=o-1);let d=(i.north-e.latitude)/c|0;return d>=s&&(d=s-1),h(n)?(n.x=u,n.y=d,n):new U(u,d)};const Vu=new f,Gu=new f,qu=new ee,jc=new f,PC=new f,Hu=new K,BC=new Li,ur=[new ee,new ee,new ee,new ee],dr=new U,Me={};Me.initialize=function(){let e=Me._initPromise;return h(e)||(e=ne.fetchJson(hn("Assets/approximateTerrainHeights.json")).then(function(t){Me._terrainHeights=t}),Me._initPromise=e),e},Me.getMinimumMaximumHeights=function(e,t){if(m.defined("rectangle",e),!h(Me._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=_(t,le.default);const n=Wu(e);let i=Me._defaultMinTerrainHeight,o=Me._defaultMaxTerrainHeight;if(h(n)){const s=`${n.level}-${n.x}-${n.y}`,a=Me._terrainHeights[s];h(a)&&(i=a[0],o=a[1]),t.cartographicToCartesian(ce.northeast(e,qu),Vu),t.cartographicToCartesian(ce.southwest(e,qu),Gu),f.midpoint(Gu,Vu,jc);const c=t.scaleToGeodeticSurface(jc,PC);if(h(c)){const l=f.distance(jc,c);i=Math.min(i,-l)}else i=Me._defaultMinTerrainHeight}return i=Math.max(Me._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}},Me.getBoundingSphere=function(e,t){if(m.defined("rectangle",e),!h(Me._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=_(t,le.default);const n=Wu(e);let i=Me._defaultMaxTerrainHeight;if(h(n)){const s=`${n.level}-${n.x}-${n.y}`,a=Me._terrainHeights[s];h(a)&&(i=a[1])}const o=K.fromRectangle3D(e,t,0);return K.fromRectangle3D(e,t,i,Hu),K.union(o,Hu,o)};function Wu(e){ee.fromRadians(e.east,e.north,0,ur[0]),ee.fromRadians(e.west,e.north,0,ur[1]),ee.fromRadians(e.east,e.south,0,ur[2]),ee.fromRadians(e.west,e.south,0,ur[3]);let t=0,n=0,i=0,o=0;const s=Me._terrainHeightsMaxLevel;let a;for(a=0;a<=s;++a){let c=!1;for(let l=0;l<4;++l){const u=ur[l];if(BC.positionToTileXY(u,a,dr),l===0)i=dr.x,o=dr.y;else if(i!==dr.x||o!==dr.y){c=!0;break}}if(c)break;t=i,n=o}if(a!==0)return{x:t,y:n,level:a>s?s:a-1}}Me._terrainHeightsMaxLevel=6,Me._defaultMaxTerrainHeight=9e3,Me._defaultMinTerrainHeight=-1e5,Me._terrainHeights=void 0,Me._initPromise=void 0,Object.defineProperties(Me,{initialized:{get:function(){return h(Me._terrainHeights)}}});function Yt(e,t,n){this.minimum=f.clone(_(e,f.ZERO)),this.maximum=f.clone(_(t,f.ZERO)),h(n)?n=f.clone(n):n=f.midpoint(this.minimum,this.maximum,new f),this.center=n}Yt.fromCorners=function(e,t,n){return m.defined("minimum",e),m.defined("maximum",t),h(n)||(n=new Yt),n.minimum=f.clone(e,n.minimum),n.maximum=f.clone(t,n.maximum),n.center=f.midpoint(e,t,n.center),n},Yt.fromPoints=function(e,t){if(h(t)||(t=new Yt),!h(e)||e.length===0)return t.minimum=f.clone(f.ZERO,t.minimum),t.maximum=f.clone(f.ZERO,t.maximum),t.center=f.clone(f.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,s=e[0].x,a=e[0].y,c=e[0].z;const l=e.length;for(let p=1;p<l;p++){const g=e[p],y=g.x,x=g.y,E=g.z;n=Math.min(y,n),s=Math.max(y,s),i=Math.min(x,i),a=Math.max(x,a),o=Math.min(E,o),c=Math.max(E,c)}const u=t.minimum;u.x=n,u.y=i,u.z=o;const d=t.maximum;return d.x=s,d.y=a,d.z=c,t.center=f.midpoint(u,d,t.center),t},Yt.clone=function(e,t){if(h(e))return h(t)?(t.minimum=f.clone(e.minimum,t.minimum),t.maximum=f.clone(e.maximum,t.maximum),t.center=f.clone(e.center,t.center),t):new Yt(e.minimum,e.maximum,e.center)},Yt.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&f.equals(e.minimum,t.minimum)&&f.equals(e.maximum,t.maximum)};let Ks=new f;Yt.intersectPlane=function(e,t){m.defined("box",e),m.defined("plane",t),Ks=f.subtract(e.maximum,e.minimum,Ks);const n=f.multiplyByScalar(Ks,.5,Ks),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),s=f.dot(e.center,i)+t.distance;return s-o>0?Et.INSIDE:s+o<0?Et.OUTSIDE:Et.INTERSECTING},Yt.prototype.clone=function(e){return Yt.clone(this,e)},Yt.prototype.intersectPlane=function(e){return Yt.intersectPlane(this,e)},Yt.prototype.equals=function(e){return Yt.equals(this,e)};const Rn={};Rn.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");return t*t-4*e*n};function ju(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Rn.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];const l=Math.abs(n),u=Math.abs(e);if(l<u&&l/u<S.EPSILON14)return[0,0];if(l>u&&u/l<S.EPSILON14)return[];if(i=-n/e,i<0)return[];const d=Math.sqrt(i);return[-d,d]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];const o=t*t,s=4*e*n,a=ju(o,-s,S.EPSILON14);if(a<0)return[];const c=-.5*ju(t,S.sign(t)*Math.sqrt(a),S.EPSILON14);return t>0?[c/e,n/c]:[n/c,c/e]};const pr={};pr.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");const o=e*e,s=t*t,a=n*n,c=i*i;return 18*e*t*n*i+s*a-27*o*c-4*(e*a*n+s*t*i)};function Yc(e,t,n,i){const o=e,s=t/3,a=n/3,c=i,l=o*a,u=s*c,d=s*s,p=a*a,g=o*a-d,y=o*c-s*a,x=s*c-p,E=4*g*x-y*y;let b,D;if(E<0){let ie,se,ge;d*u>=l*p?(ie=o,se=g,ge=-2*s*g+o*y):(ie=c,se=x,ge=-c*y+2*a*x);const xe=-(ge<0?-1:1)*Math.abs(ie)*Math.sqrt(-E);D=-ge+xe;const ze=D/2,je=ze<0?-Math.pow(-ze,1/3):Math.pow(ze,1/3),tt=D===xe?-je:-se/je;return b=se<=0?je+tt:-ge/(je*je+tt*tt+se),d*u>=l*p?[(b-s)/o]:[-c/(b+a)]}const A=g,O=-2*s*g+o*y,I=x,B=-c*y+2*a*x,M=Math.sqrt(E),q=Math.sqrt(3)/2;let P=Math.abs(Math.atan2(o*M,-O)/3);b=2*Math.sqrt(-A);let V=Math.cos(P);D=b*V;let k=b*(-V/2-q*Math.sin(P));const H=D+k>2*s?D-s:k-s,j=o,r=H/j;P=Math.abs(Math.atan2(c*M,-B)/3),b=2*Math.sqrt(-I),V=Math.cos(P),D=b*V,k=b*(-V/2-q*Math.sin(P));const w=-c,v=D+k<2*a?D+a:k+a,z=w/v,G=j*v,W=-H*v-j*w,Z=H*w,X=(a*W-s*Z)/(-s*W+a*G);return r<=X?r<=z?X<=z?[r,X,z]:[r,z,X]:[z,r,X]:r<=z?[X,r,z]:X<=z?[X,z,r]:[z,X,r]}pr.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o,s;if(e===0)return Rn.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];s=-i/e;const a=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[a,a,a]}else if(i===0)return o=Rn.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Yc(e,0,n,i)}else{if(n===0)return i===0?(s=-t/e,s<0?[s,0,0]:[0,0,s]):Yc(e,t,0,i);if(i===0)return o=Rn.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Yc(e,t,n,i)};const Xc={};Xc.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");const s=e*e,a=s*e,c=t*t,l=c*t,u=n*n,d=u*n,p=i*i,g=p*i,y=o*o,x=y*o;return c*u*p-4*l*g-4*e*d*p+18*e*t*n*g-27*s*p*p+256*a*x+o*(18*l*n*i-4*c*d+16*e*u*u-80*e*t*u*i-6*e*c*p+144*s*n*p)+y*(144*e*c*n-27*c*c-128*s*u-192*s*t*i)};function zn(e,t,n,i){const o=e*e,s=t-3*o/8,a=n-t*e/2+o*e/8,c=i-n*e/4+t*o/16-3*o*o/256,l=pr.computeRealRoots(1,2*s,s*s-4*c,-a*a);if(l.length>0){const u=-e/4,d=l[l.length-1];if(Math.abs(d)<S.EPSILON14){const p=Rn.computeRealRoots(1,s,c);if(p.length===2){const g=p[0],y=p[1];let x;if(g>=0&&y>=0){const E=Math.sqrt(g),b=Math.sqrt(y);return[u-b,u-E,u+E,u+b]}else{if(g>=0&&y<0)return x=Math.sqrt(g),[u-x,u+x];if(g<0&&y>=0)return x=Math.sqrt(y),[u-x,u+x]}}return[]}else if(d>0){const p=Math.sqrt(d),g=(s+d-a/p)/2,y=(s+d+a/p)/2,x=Rn.computeRealRoots(1,p,g),E=Rn.computeRealRoots(1,-p,y);return x.length!==0?(x[0]+=u,x[1]+=u,E.length!==0?(E[0]+=u,E[1]+=u,x[1]<=E[0]?[x[0],x[1],E[0],E[1]]:E[1]<=x[0]?[E[0],E[1],x[0],x[1]]:x[0]>=E[0]&&x[1]<=E[1]?[E[0],x[0],x[1],E[1]]:E[0]>=x[0]&&E[1]<=x[1]?[x[0],E[0],E[1],x[1]]:x[0]>E[0]&&x[0]<E[1]?[E[0],x[0],E[1],x[1]]:[x[0],E[0],x[1],E[1]]):x):E.length!==0?(E[0]+=u,E[1]+=u,E):[]}}return[]}function mr(e,t,n,i){const o=n*n,s=t*t,a=e*e,c=-2*t,l=n*e+s-4*i,u=a*i-n*t*e+o,d=pr.computeRealRoots(1,c,l,u);if(d.length>0){const p=d[0],g=t-p,y=g*g,x=e/2,E=g/2,b=y-4*i,D=y+4*Math.abs(i),A=a-4*p,O=a+4*Math.abs(p);let I,B;if(p<0||b*O<A*D){const j=Math.sqrt(A);I=j/2,B=j===0?0:(e*E-n)/j}else{const j=Math.sqrt(b);I=j===0?0:(e*E-n)/j,B=j/2}let M,q;x===0&&I===0?(M=0,q=0):S.sign(x)===S.sign(I)?(M=x+I,q=p/M):(q=x-I,M=p/q);let P,V;E===0&&B===0?(P=0,V=0):S.sign(E)===S.sign(B)?(P=E+B,V=i/P):(V=E-B,P=i/V);const k=Rn.computeRealRoots(1,M,P),H=Rn.computeRealRoots(1,q,V);if(k.length!==0)return H.length!==0?k[1]<=H[0]?[k[0],k[1],H[0],H[1]]:H[1]<=k[0]?[H[0],H[1],k[0],k[1]]:k[0]>=H[0]&&k[1]<=H[1]?[H[0],k[0],k[1],H[1]]:H[0]>=k[0]&&H[1]<=k[1]?[k[0],H[0],H[1],k[1]]:k[0]>H[0]&&k[0]<H[1]?[H[0],k[0],H[1],k[1]]:[k[0],H[0],k[1],H[1]]:k;if(H.length!==0)return H}return[]}Xc.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");if(Math.abs(e)<S.EPSILON15)return pr.computeRealRoots(t,n,i,o);const s=t/e,a=n/e,c=i/e,l=o/e;let u=s<0?1:0;switch(u+=a<0?u+1:u,u+=c<0?u+1:u,u+=l<0?u+1:u,u){case 0:return zn(s,a,c,l);case 1:return mr(s,a,c,l);case 2:return mr(s,a,c,l);case 3:return zn(s,a,c,l);case 4:return zn(s,a,c,l);case 5:return mr(s,a,c,l);case 6:return zn(s,a,c,l);case 7:return zn(s,a,c,l);case 8:return mr(s,a,c,l);case 9:return zn(s,a,c,l);case 10:return zn(s,a,c,l);case 11:return mr(s,a,c,l);case 12:return zn(s,a,c,l);case 13:return zn(s,a,c,l);case 14:return zn(s,a,c,l);case 15:return zn(s,a,c,l);default:return}};function Fo(e,t){t=f.clone(_(t,f.ZERO)),f.equals(t,f.ZERO)||f.normalize(t,t),this.origin=f.clone(_(e,f.ZERO)),this.direction=t}Fo.clone=function(e,t){if(h(e))return h(t)?(t.origin=f.clone(e.origin),t.direction=f.clone(e.direction),t):new Fo(e.origin,e.direction)},Fo.getPoint=function(e,t,n){return m.typeOf.object("ray",e),m.typeOf.number("t",t),h(n)||(n=new f),n=f.multiplyByScalar(e.direction,t,n),f.add(e.origin,n,n)};const Fe={};Fe.rayPlane=function(e,t,n){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("plane is required.");h(n)||(n=new f);const i=e.origin,o=e.direction,s=t.normal,a=f.dot(s,o);if(Math.abs(a)<S.EPSILON15)return;const c=(-t.distance-f.dot(s,i))/a;if(!(c<0))return n=f.multiplyByScalar(o,c,n),f.add(i,n,n)};const NC=new f,FC=new f,Yu=new f,Xu=new f,$u=new f;Fe.rayTriangleParametric=function(e,t,n,i,o){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("p0 is required.");if(!h(n))throw new C("p1 is required.");if(!h(i))throw new C("p2 is required.");o=_(o,!1);const s=e.origin,a=e.direction,c=f.subtract(n,t,NC),l=f.subtract(i,t,FC),u=f.cross(a,l,Yu),d=f.dot(c,u);let p,g,y,x,E;if(o){if(d<S.EPSILON6||(p=f.subtract(s,t,Xu),y=f.dot(p,u),y<0||y>d)||(g=f.cross(p,c,$u),x=f.dot(a,g),x<0||y+x>d))return;E=f.dot(l,g)/d}else{if(Math.abs(d)<S.EPSILON6)return;const b=1/d;if(p=f.subtract(s,t,Xu),y=f.dot(p,u)*b,y<0||y>1||(g=f.cross(p,c,$u),x=f.dot(a,g)*b,x<0||y+x>1))return;E=f.dot(l,g)*b}return E},Fe.rayTriangle=function(e,t,n,i,o,s){const a=Fe.rayTriangleParametric(e,t,n,i,o);if(!(!h(a)||a<0))return h(s)||(s=new f),f.multiplyByScalar(e.direction,a,s),f.add(e.origin,s,s)};const LC=new Fo;Fe.lineSegmentTriangle=function(e,t,n,i,o,s,a){if(!h(e))throw new C("v0 is required.");if(!h(t))throw new C("v1 is required.");if(!h(n))throw new C("p0 is required.");if(!h(i))throw new C("p1 is required.");if(!h(o))throw new C("p2 is required.");const c=LC;f.clone(e,c.origin),f.subtract(t,e,c.direction),f.normalize(c.direction,c.direction);const l=Fe.rayTriangleParametric(c,n,i,o,s);if(!(!h(l)||l<0||l>f.distance(e,t)))return h(a)||(a=new f),f.multiplyByScalar(c.direction,l,a),f.add(c.origin,a,a)};function MC(e,t,n,i){const o=t*t-4*e*n;if(o<0)return;if(o>0){const a=1/(2*e),c=Math.sqrt(o),l=(-t+c)*a,u=(-t-c)*a;return l<u?(i.root0=l,i.root1=u):(i.root0=u,i.root1=l),i}const s=-t/(2*e);if(s!==0)return i.root0=i.root1=s,i}const UC={root0:0,root1:0};function Zu(e,t,n){h(n)||(n=new eo);const i=e.origin,o=e.direction,s=t.center,a=t.radius*t.radius,c=f.subtract(i,s,Yu),l=f.dot(o,o),u=2*f.dot(o,c),d=f.magnitudeSquared(c)-a,p=MC(l,u,d,UC);if(h(p))return n.start=p.root0,n.stop=p.root1,n}Fe.raySphere=function(e,t,n){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("sphere is required.");if(n=Zu(e,t,n),!(!h(n)||n.stop<0))return n.start=Math.max(n.start,0),n};const kC=new Fo;Fe.lineSegmentSphere=function(e,t,n,i){if(!h(e))throw new C("p0 is required.");if(!h(t))throw new C("p1 is required.");if(!h(n))throw new C("sphere is required.");const o=kC;f.clone(e,o.origin);const s=f.subtract(t,e,o.direction),a=f.magnitude(s);if(f.normalize(s,s),i=Zu(o,n,i),!(!h(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};const VC=new f,GC=new f;Fe.rayEllipsoid=function(e,t){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("ellipsoid is required.");const n=t.oneOverRadii,i=f.multiplyComponents(n,e.origin,VC),o=f.multiplyComponents(n,e.direction,GC),s=f.magnitudeSquared(i),a=f.dot(i,o);let c,l,u,d,p;if(s>1){if(a>=0)return;const g=a*a;if(c=s-1,l=f.magnitudeSquared(o),u=l*c,g<u)return;if(g>u){d=a*a-u,p=-a+Math.sqrt(d);const x=p/l,E=c/p;return x<E?new eo(x,E):{start:E,stop:x}}const y=Math.sqrt(c/l);return new eo(y,y)}else if(s<1)return c=s-1,l=f.magnitudeSquared(o),u=l*c,d=a*a-u,p=-a+Math.sqrt(d),new eo(0,p/l);if(a<0)return l=f.magnitudeSquared(o),new eo(0,-a/l)};function no(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Fe.quadraticVectorExpression=function(e,t,n,i,o){const s=i*i,a=o*o,c=(e[L.COLUMN1ROW1]-e[L.COLUMN2ROW2])*a,l=o*(i*no(e[L.COLUMN1ROW0],e[L.COLUMN0ROW1],S.EPSILON15)+t.y),u=e[L.COLUMN0ROW0]*s+e[L.COLUMN2ROW2]*a+i*t.x+n,d=a*no(e[L.COLUMN2ROW1],e[L.COLUMN1ROW2],S.EPSILON15),p=o*(i*no(e[L.COLUMN2ROW0],e[L.COLUMN0ROW2])+t.z);let g;const y=[];if(p===0&&d===0){if(g=Rn.computeRealRoots(c,l,u),g.length===0)return y;const P=g[0],V=Math.sqrt(Math.max(1-P*P,0));if(y.push(new f(i,o*P,o*-V)),y.push(new f(i,o*P,o*V)),g.length===2){const k=g[1],H=Math.sqrt(Math.max(1-k*k,0));y.push(new f(i,o*k,o*-H)),y.push(new f(i,o*k,o*H))}return y}const x=p*p,E=d*d,b=c*c,D=p*d,A=b+E,O=2*(l*c+D),I=2*u*c+l*l-E+x,B=2*(u*l-D),M=u*u-x;if(A===0&&O===0&&I===0&&B===0)return y;g=Xc.computeRealRoots(A,O,I,B,M);const q=g.length;if(q===0)return y;for(let P=0;P<q;++P){const V=g[P],k=V*V,H=Math.max(1-k,0),j=Math.sqrt(H);let r;S.sign(c)===S.sign(u)?r=no(c*k+u,l*V,S.EPSILON12):S.sign(u)===S.sign(l*V)?r=no(c*k,l*V+u,S.EPSILON12):r=no(c*k+l*V,u,S.EPSILON12);const w=no(d*V,p,S.EPSILON15),v=r*w;v<0?y.push(new f(i,o*V,o*j)):v>0?y.push(new f(i,o*V,o*-j)):j!==0?(y.push(new f(i,o*V,o*-j)),y.push(new f(i,o*V,o*j)),++P):y.push(new f(i,o*V,o*j))}return y};const $c=new f,Ku=new f,Qu=new f,Qs=new f,qC=new f,HC=new L,WC=new L,jC=new L,YC=new L,XC=new L,Ju=new L,ed=new L,td=new f,$C=new f,ZC=new ee;Fe.grazingAltitudeLocation=function(e,t){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("ellipsoid is required.");const n=e.origin,i=e.direction;if(!f.equals(n,f.ZERO)){const M=t.geodeticSurfaceNormal(n,$c);if(f.dot(i,M)>=0)return n}const o=h(this.rayEllipsoid(e,t)),s=t.transformPositionToScaledSpace(i,$c),a=f.normalize(s,s),c=f.mostOrthogonalAxis(s,Qs),l=f.normalize(f.cross(c,a,Ku),Ku),u=f.normalize(f.cross(a,l,Qu),Qu),d=HC;d[0]=a.x,d[1]=a.y,d[2]=a.z,d[3]=l.x,d[4]=l.y,d[5]=l.z,d[6]=u.x,d[7]=u.y,d[8]=u.z;const p=L.transpose(d,WC),g=L.fromScale(t.radii,jC),y=L.fromScale(t.oneOverRadii,YC),x=XC;x[0]=0,x[1]=-i.z,x[2]=i.y,x[3]=i.z,x[4]=0,x[5]=-i.x,x[6]=-i.y,x[7]=i.x,x[8]=0;const E=L.multiply(L.multiply(p,y,Ju),x,Ju),b=L.multiply(L.multiply(E,g,ed),d,ed),D=L.multiplyByVector(E,n,qC),A=Fe.quadraticVectorExpression(b,f.negate(D,$c),0,0,1);let O,I;const B=A.length;if(B>0){let M=f.clone(f.ZERO,$C),q=Number.NEGATIVE_INFINITY;for(let V=0;V<B;++V){O=L.multiplyByVector(g,L.multiplyByVector(d,A[V],td),td);const k=f.normalize(f.subtract(O,n,Qs),Qs),H=f.dot(k,i);H>q&&(q=H,M=f.clone(O,M))}const P=t.cartesianToCartographic(M,ZC);return q=S.clamp(q,0,1),I=f.magnitude(f.subtract(M,n,Qs))*Math.sqrt(1-q*q),I=o?-I:I,P.height=I,t.cartographicToCartesian(P,new f)}};const KC=new f;Fe.lineSegmentPlane=function(e,t,n,i){if(!h(e))throw new C("endPoint0 is required.");if(!h(t))throw new C("endPoint1 is required.");if(!h(n))throw new C("plane is required.");h(i)||(i=new f);const o=f.subtract(t,e,KC),s=n.normal,a=f.dot(s,o);if(Math.abs(a)<S.EPSILON6)return;const c=f.dot(s,e),l=-(n.distance+c)/a;if(!(l<0||l>1))return f.multiplyByScalar(o,l,i),f.add(e,i,i),i},Fe.trianglePlaneIntersection=function(e,t,n,i){if(!h(e)||!h(t)||!h(n)||!h(i))throw new C("p0, p1, p2, and plane are required.");const o=i.normal,s=i.distance,a=f.dot(o,e)+s<0,c=f.dot(o,t)+s<0,l=f.dot(o,n)+s<0;let u=0;u+=a?1:0,u+=c?1:0,u+=l?1:0;let d,p;if((u===1||u===2)&&(d=new f,p=new f),u===1){if(a)return Fe.lineSegmentPlane(e,t,i,d),Fe.lineSegmentPlane(e,n,i,p),{positions:[e,t,n,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(c)return Fe.lineSegmentPlane(t,n,i,d),Fe.lineSegmentPlane(t,e,i,p),{positions:[e,t,n,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Fe.lineSegmentPlane(n,e,i,d),Fe.lineSegmentPlane(n,t,i,p),{positions:[e,t,n,d,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(a)if(c){if(!l)return Fe.lineSegmentPlane(e,n,i,d),Fe.lineSegmentPlane(t,n,i,p),{positions:[e,t,n,d,p],indices:[0,1,4,0,4,3,2,3,4]}}else return Fe.lineSegmentPlane(n,t,i,d),Fe.lineSegmentPlane(e,t,i,p),{positions:[e,t,n,d,p],indices:[2,0,4,2,4,3,1,3,4]};else return Fe.lineSegmentPlane(t,e,i,d),Fe.lineSegmentPlane(n,e,i,p),{positions:[e,t,n,d,p],indices:[1,2,4,1,4,3,0,3,4]}};const Zc=new Y;function Kn(e,t){if(m.defined("origin",e),t=_(t,le.default),e=t.scaleToGeodeticSurface(e),!h(e))throw new C("origin must not be at the center of the ellipsoid.");const n=_e.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=f.fromCartesian4(N.getColumn(n,0,Zc)),this._yAxis=f.fromCartesian4(N.getColumn(n,1,Zc));const i=f.fromCartesian4(N.getColumn(n,2,Zc));this._plane=Ne.fromPointNormal(e,i)}Object.defineProperties(Kn.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 QC=new Yt;Kn.fromPoints=function(e,t){m.defined("cartesians",e);const n=Yt.fromPoints(e,QC);return new Kn(n.center,t)};const nd=new Fo,Js=new f;Kn.prototype.projectPointOntoPlane=function(e,t){m.defined("cartesian",e);const n=nd;n.origin=e,f.normalize(e,n.direction);let i=Fe.rayPlane(n,this._plane,Js);if(h(i)||(f.negate(n.direction,n.direction),i=Fe.rayPlane(n,this._plane,Js)),h(i)){const o=f.subtract(i,this._origin,i),s=f.dot(this._xAxis,o),a=f.dot(this._yAxis,o);return h(t)?(t.x=s,t.y=a,t):new U(s,a)}},Kn.prototype.projectPointsOntoPlane=function(e,t){m.defined("cartesians",e),h(t)||(t=[]);let n=0;const i=e.length;for(let o=0;o<i;o++){const s=this.projectPointOntoPlane(e[o],t[n]);h(s)&&(t[n]=s,n++)}return t.length=n,t},Kn.prototype.projectPointToNearestOnPlane=function(e,t){m.defined("cartesian",e),h(t)||(t=new U);const n=nd;n.origin=e,f.clone(this._plane.normal,n.direction);let i=Fe.rayPlane(n,this._plane,Js);h(i)||(f.negate(n.direction,n.direction),i=Fe.rayPlane(n,this._plane,Js));const o=f.subtract(i,this._origin,i),s=f.dot(this._xAxis,o),a=f.dot(this._yAxis,o);return t.x=s,t.y=a,t},Kn.prototype.projectPointsToNearestOnPlane=function(e,t){m.defined("cartesians",e),h(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 JC=new f;Kn.prototype.projectPointOntoEllipsoid=function(e,t){m.defined("cartesian",e),h(t)||(t=new f);const n=this._ellipsoid,i=this._origin,o=this._xAxis,s=this._yAxis,a=JC;return f.multiplyByScalar(o,e.x,a),t=f.add(i,a,t),f.multiplyByScalar(s,e.y,a),f.add(t,a,t),n.scaleToGeocentricSurface(t,t),t},Kn.prototype.projectPointsOntoEllipsoid=function(e,t){m.defined("cartesians",e);const n=e.length;h(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};function Re(e,t){this.center=f.clone(_(e,f.ZERO)),this.halfAxes=L.clone(_(t,L.ZERO))}Re.packedLength=f.packedLength+L.packedLength,Re.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),f.pack(e.center,t,n),L.pack(e.halfAxes,t,n+f.packedLength),t},Re.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Re),f.unpack(e,t,n.center),L.unpack(e,t+f.packedLength,n.halfAxes),n};const eE=new f,tE=new f,nE=new f,iE=new f,oE=new f,rE=new f,sE=new L,aE={unitary:new L,diagonal:new L};Re.fromPoints=function(e,t){if(h(t)||(t=new Re),!h(e)||e.length===0)return t.halfAxes=L.ZERO,t.center=f.ZERO,t;let n;const i=e.length,o=f.clone(e[0],eE);for(n=1;n<i;n++)f.add(o,e[n],o);const s=1/i;f.multiplyByScalar(o,s,o);let a=0,c=0,l=0,u=0,d=0,p=0,g;for(n=0;n<i;n++)g=f.subtract(e[n],o,tE),a+=g.x*g.x,c+=g.x*g.y,l+=g.x*g.z,u+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z;a*=s,c*=s,l*=s,u*=s,d*=s,p*=s;const y=sE;y[0]=a,y[1]=c,y[2]=l,y[3]=c,y[4]=u,y[5]=d,y[6]=l,y[7]=d,y[8]=p;const x=L.computeEigenDecomposition(y,aE),E=L.clone(x.unitary,t.halfAxes);let b=L.getColumn(E,0,iE),D=L.getColumn(E,1,oE),A=L.getColumn(E,2,rE),O=-Number.MAX_VALUE,I=-Number.MAX_VALUE,B=-Number.MAX_VALUE,M=Number.MAX_VALUE,q=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)g=e[n],O=Math.max(f.dot(b,g),O),I=Math.max(f.dot(D,g),I),B=Math.max(f.dot(A,g),B),M=Math.min(f.dot(b,g),M),q=Math.min(f.dot(D,g),q),P=Math.min(f.dot(A,g),P);b=f.multiplyByScalar(b,.5*(M+O),b),D=f.multiplyByScalar(D,.5*(q+I),D),A=f.multiplyByScalar(A,.5*(P+B),A);const V=f.add(b,D,t.center);f.add(V,A,V);const k=nE;return k.x=O-M,k.y=I-q,k.z=B-P,f.multiplyByScalar(k,.5,k),L.multiplyByScale(t.halfAxes,k,t.halfAxes),t};const id=new f,cE=new f;function od(e,t,n,i,o,s,a,c,l,u,d){if(!h(o)||!h(s)||!h(a)||!h(c)||!h(l)||!h(u))throw new C("all extents (minimum/maximum X/Y/Z) are required.");h(d)||(d=new Re);const p=d.halfAxes;L.setColumn(p,0,t,p),L.setColumn(p,1,n,p),L.setColumn(p,2,i,p);let g=id;g.x=(o+s)/2,g.y=(a+c)/2,g.z=(l+u)/2;const y=cE;y.x=(s-o)/2,y.y=(c-a)/2,y.z=(u-l)/2;const x=d.center;return g=L.multiplyByVector(p,g,g),f.add(e,g,x),L.multiplyByScale(p,y,p),d}const rd=new ee,lE=new f,hE=new ee,fE=new ee,uE=new ee,dE=new ee,pE=new ee,mE=new f,sd=new f,_E=new f,ad=new f,gE=new f,yE=new U,xE=new U,CE=new U,EE=new U,bE=new U,wE=new f,TE=new f,SE=new f,AE=new f,DE=new U,OE=new f,vE=new f,IE=new f,RE=new Ne(f.UNIT_X,0);Re.fromRectangle=function(e,t,n,i,o){if(!h(e))throw new C("rectangle is required");if(e.width<0||e.width>S.TWO_PI)throw new C("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>S.PI)throw new C("Rectangle height must be between 0 and pi");if(h(i)&&!S.equalsEpsilon(i.radii.x,i.radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=_(t,0),n=_(n,0),i=_(i,le.default);let s,a,c,l,u,d,p;if(e.width<=S.PI){const q=ce.center(e,rd),P=i.cartographicToCartesian(q,lE),V=new Kn(P,i);p=V.plane;const k=q.longitude,H=e.south<0&&e.north>0?0:q.latitude,j=ee.fromRadians(k,e.north,n,hE),r=ee.fromRadians(e.west,e.north,n,fE),w=ee.fromRadians(e.west,H,n,uE),v=ee.fromRadians(e.west,e.south,n,dE),z=ee.fromRadians(k,e.south,n,pE),G=i.cartographicToCartesian(j,mE);let W=i.cartographicToCartesian(r,sd);const Z=i.cartographicToCartesian(w,_E);let X=i.cartographicToCartesian(v,ad);const ie=i.cartographicToCartesian(z,gE),se=V.projectPointToNearestOnPlane(G,yE),ge=V.projectPointToNearestOnPlane(W,xE),be=V.projectPointToNearestOnPlane(Z,CE),xe=V.projectPointToNearestOnPlane(X,EE),ze=V.projectPointToNearestOnPlane(ie,bE);return s=Math.min(ge.x,be.x,xe.x),a=-s,l=Math.max(ge.y,se.y),c=Math.min(xe.y,ze.y),r.height=v.height=t,W=i.cartographicToCartesian(r,sd),X=i.cartographicToCartesian(v,ad),u=Math.min(Ne.getPointDistance(p,W),Ne.getPointDistance(p,X)),d=n,od(V.origin,V.xAxis,V.yAxis,V.zAxis,s,a,c,l,u,d,o)}const g=e.south>0,y=e.north<0,x=g?e.south:y?e.north:0,E=ce.center(e,rd).longitude,b=f.fromRadians(E,x,n,i,wE);b.z=0;const A=Math.abs(b.x)<S.EPSILON10&&Math.abs(b.y)<S.EPSILON10?f.UNIT_X:f.normalize(b,TE),O=f.UNIT_Z,I=f.cross(A,O,SE);p=Ne.fromPointNormal(b,A,RE);const B=f.fromRadians(E+S.PI_OVER_TWO,x,n,i,AE);a=f.dot(Ne.projectPointOntoPlane(p,B,DE),I),s=-a,l=f.fromRadians(0,e.north,y?t:n,i,OE).z,c=f.fromRadians(0,e.south,g?t:n,i,vE).z;const M=f.fromRadians(e.east,x,n,i,IE);return u=Ne.getPointDistance(p,M),d=0,od(b,I,O,A,s,a,c,l,u,d,o)},Re.fromTransformation=function(e,t){return m.typeOf.object("transformation",e),h(t)||(t=new Re),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=L.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},Re.clone=function(e,t){if(h(e))return h(t)?(f.clone(e.center,t.center),L.clone(e.halfAxes,t.halfAxes),t):new Re(e.center,e.halfAxes)},Re.intersectPlane=function(e,t){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("plane is required.");const n=e.center,i=t.normal,o=e.halfAxes,s=i.x,a=i.y,c=i.z,l=Math.abs(s*o[L.COLUMN0ROW0]+a*o[L.COLUMN0ROW1]+c*o[L.COLUMN0ROW2])+Math.abs(s*o[L.COLUMN1ROW0]+a*o[L.COLUMN1ROW1]+c*o[L.COLUMN1ROW2])+Math.abs(s*o[L.COLUMN2ROW0]+a*o[L.COLUMN2ROW1]+c*o[L.COLUMN2ROW2]),u=f.dot(i,n)+t.distance;return u<=-l?Et.OUTSIDE:u>=l?Et.INSIDE:Et.INTERSECTING};const cd=new f,ld=new f,hd=new f,zE=new f,fd=new f,PE=new f;Re.distanceSquaredTo=function(e,t){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("cartesian is required.");const n=f.subtract(t,e.center,id),i=e.halfAxes;let o=L.getColumn(i,0,cd),s=L.getColumn(i,1,ld),a=L.getColumn(i,2,hd);const c=f.magnitude(o),l=f.magnitude(s),u=f.magnitude(a);let d=!0,p=!0,g=!0;c>0?f.divideByScalar(o,c,o):d=!1,l>0?f.divideByScalar(s,l,s):p=!1,u>0?f.divideByScalar(a,u,a):g=!1;const y=!d+!p+!g;let x,E,b;if(y===1){let I=o;x=s,E=a,p?g||(I=a,E=o):(I=s,x=o),b=f.cross(x,E,fd),I===o?o=b:I===s?s=b:I===a&&(a=b)}else if(y===2){x=o,p?x=s:g&&(x=a);let I=f.UNIT_Y;I.equalsEpsilon(x,S.EPSILON3)&&(I=f.UNIT_X),E=f.cross(x,I,zE),f.normalize(E,E),b=f.cross(x,E,fd),f.normalize(b,b),x===o?(s=E,a=b):x===s?(a=E,o=b):x===a&&(o=E,s=b)}else y===3&&(o=f.UNIT_X,s=f.UNIT_Y,a=f.UNIT_Z);const D=PE;D.x=f.dot(n,o),D.y=f.dot(n,s),D.z=f.dot(n,a);let A=0,O;return D.x<-c?(O=D.x+c,A+=O*O):D.x>c&&(O=D.x-c,A+=O*O),D.y<-l?(O=D.y+l,A+=O*O):D.y>l&&(O=D.y-l,A+=O*O),D.z<-u?(O=D.z+u,A+=O*O):D.z>u&&(O=D.z-u,A+=O*O),A};const BE=new f,NE=new f;Re.computePlaneDistances=function(e,t,n,i){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("position is required.");if(!h(n))throw new C("direction is required.");h(i)||(i=new eo);let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const a=e.center,c=e.halfAxes,l=L.getColumn(c,0,cd),u=L.getColumn(c,1,ld),d=L.getColumn(c,2,hd),p=f.add(l,u,BE);f.add(p,d,p),f.add(p,a,p);const g=f.subtract(p,t,NE);let y=f.dot(n,g);return o=Math.min(y,o),s=Math.max(y,s),f.add(a,l,p),f.add(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.add(a,l,p),f.subtract(p,u,p),f.add(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.add(a,l,p),f.subtract(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.add(p,u,p),f.add(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.add(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.subtract(p,u,p),f.add(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.subtract(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),i.start=o,i.stop=s,i};const FE=new f,LE=new f,ME=new f;Re.computeCorners=function(e,t){m.typeOf.object("box",e),h(t)||(t=[new f,new f,new f,new f,new f,new f,new f,new f]);const n=e.center,i=e.halfAxes,o=L.getColumn(i,0,FE),s=L.getColumn(i,1,LE),a=L.getColumn(i,2,ME);return f.clone(n,t[0]),f.subtract(t[0],o,t[0]),f.subtract(t[0],s,t[0]),f.subtract(t[0],a,t[0]),f.clone(n,t[1]),f.subtract(t[1],o,t[1]),f.subtract(t[1],s,t[1]),f.add(t[1],a,t[1]),f.clone(n,t[2]),f.subtract(t[2],o,t[2]),f.add(t[2],s,t[2]),f.subtract(t[2],a,t[2]),f.clone(n,t[3]),f.subtract(t[3],o,t[3]),f.add(t[3],s,t[3]),f.add(t[3],a,t[3]),f.clone(n,t[4]),f.add(t[4],o,t[4]),f.subtract(t[4],s,t[4]),f.subtract(t[4],a,t[4]),f.clone(n,t[5]),f.add(t[5],o,t[5]),f.subtract(t[5],s,t[5]),f.add(t[5],a,t[5]),f.clone(n,t[6]),f.add(t[6],o,t[6]),f.add(t[6],s,t[6]),f.subtract(t[6],a,t[6]),f.clone(n,t[7]),f.add(t[7],o,t[7]),f.add(t[7],s,t[7]),f.add(t[7],a,t[7]),t};const UE=new L;Re.computeTransformation=function(e,t){m.typeOf.object("box",e),h(t)||(t=new N);const n=e.center,i=L.multiplyByUniformScale(e.halfAxes,2,UE);return N.fromRotationTranslation(i,n,t)};const kE=new K;Re.isOccluded=function(e,t){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("occluder is required.");const n=K.fromOrientedBoundingBox(e,kE);return!t.isBoundingSphereVisible(n)},Re.prototype.intersectPlane=function(e){return Re.intersectPlane(this,e)},Re.prototype.distanceSquaredTo=function(e){return Re.distanceSquaredTo(this,e)},Re.prototype.computePlaneDistances=function(e,t,n){return Re.computePlaneDistances(this,e,t,n)},Re.prototype.computeCorners=function(e){return Re.computeCorners(this,e)},Re.prototype.computeTransformation=function(e){return Re.computeTransformation(this,e)},Re.prototype.isOccluded=function(e){return Re.isOccluded(this,e)},Re.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&L.equals(e.halfAxes,t.halfAxes)},Re.prototype.clone=function(e){return Re.clone(this,e)},Re.prototype.equals=function(e){return Re.equals(this,e)};const _r={};_r.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new C("scale must be a finite number.");if(!Number.isFinite(n))throw new C("relativeHeight must be a finite number.");return(e-n)*t+n};const VE=new ee;_r.getPosition=function(e,t,n,i,o){const s=t.cartesianToCartographic(e,VE);if(!h(s))return f.clone(e,o);const a=_r.getHeight(s.height,n,i);return f.fromRadians(s.longitude,s.latitude,a,t,o)};const GE=`in vec3 position3DHigh;
4505
+ `;function jt(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=_(e.closed,!1),i=_(e.flat,!1),o=i?RC:IC,s=i?ku:vC,a=i?jt.FLAT_VERTEX_FORMAT:jt.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,o),this._fragmentShaderSource=_(e.fragmentShaderSource,s),this._renderState=Ut.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=_(e.faceForward,!n)}Object.defineProperties(jt.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}}}),jt.VERTEX_FORMAT=st.POSITION_AND_NORMAL,jt.FLAT_VERTEX_FORMAT=st.POSITION_ONLY,jt.prototype.getFragmentShaderSource=Ut.prototype.getFragmentShaderSource,jt.prototype.isTranslucent=Ut.prototype.isTranslucent,jt.prototype.getRenderState=Ut.prototype.getRenderState;function No(e){this._definitionChanged=new Pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(No.prototype,{isConstant:{get:function(){return Ae.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:F("color")}),No.prototype.getType=function(e){return"Color"};const zC=new $;No.prototype.getValue=function(e,t){return h(e)||(e=$.now(zC)),h(t)||(t={}),t.color=Ae.getValueOrClonedDefault(this._color,e,T.WHITE,t.color),t},No.prototype.equals=function(e){return this===e||e instanceof No&&Ae.equals(this._color,e._color)};function Mi(e){e=_(e,_.EMPTY_OBJECT),this._ellipsoid=_(e.ellipsoid,le.default),this._rectangle=_(e.rectangle,ce.MAX_VALUE),this._projection=new Sn(this._ellipsoid),this._numberOfLevelZeroTilesX=_(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=_(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(Mi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Mi.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},Mi.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},Mi.prototype.rectangleToNativeRectangle=function(e,t){m.defined("rectangle",e);const n=S.toDegrees(e.west),i=S.toDegrees(e.south),o=S.toDegrees(e.east),s=S.toDegrees(e.north);return h(t)?(t.west=n,t.south=i,t.east=o,t.north=s,t):new ce(n,i,o,s)},Mi.prototype.tileXYToNativeRectangle=function(e,t,n,i){const o=this.tileXYToRectangle(e,t,n,i);return o.west=S.toDegrees(o.west),o.south=S.toDegrees(o.south),o.east=S.toDegrees(o.east),o.north=S.toDegrees(o.north),o},Mi.prototype.tileXYToRectangle=function(e,t,n,i){const o=this._rectangle,s=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),c=o.width/s,l=e*c+o.west,u=(e+1)*c+o.west,d=o.height/a,p=o.north-t*d,g=o.north-(t+1)*d;return h(i)||(i=new ce(l,g,u,p)),i.west=l,i.south=g,i.east=u,i.north=p,i},Mi.prototype.positionToTileXY=function(e,t,n){const i=this._rectangle;if(!ce.contains(i,e))return;const o=this.getNumberOfXTilesAtLevel(t),s=this.getNumberOfYTilesAtLevel(t),a=i.width/o,c=i.height/s;let l=e.longitude;i.east<i.west&&(l+=S.TWO_PI);let u=(l-i.west)/a|0;u>=o&&(u=o-1);let d=(i.north-e.latitude)/c|0;return d>=s&&(d=s-1),h(n)?(n.x=u,n.y=d,n):new U(u,d)};const Vu=new f,Gu=new f,qu=new ee,jc=new f,PC=new f,Hu=new K,BC=new Mi,ur=[new ee,new ee,new ee,new ee],dr=new U,Me={};Me.initialize=function(){let e=Me._initPromise;return h(e)||(e=ne.fetchJson(hn("Assets/approximateTerrainHeights.json")).then(function(t){Me._terrainHeights=t}),Me._initPromise=e),e},Me.getMinimumMaximumHeights=function(e,t){if(m.defined("rectangle",e),!h(Me._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=_(t,le.default);const n=Wu(e);let i=Me._defaultMinTerrainHeight,o=Me._defaultMaxTerrainHeight;if(h(n)){const s=`${n.level}-${n.x}-${n.y}`,a=Me._terrainHeights[s];h(a)&&(i=a[0],o=a[1]),t.cartographicToCartesian(ce.northeast(e,qu),Vu),t.cartographicToCartesian(ce.southwest(e,qu),Gu),f.midpoint(Gu,Vu,jc);const c=t.scaleToGeodeticSurface(jc,PC);if(h(c)){const l=f.distance(jc,c);i=Math.min(i,-l)}else i=Me._defaultMinTerrainHeight}return i=Math.max(Me._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}},Me.getBoundingSphere=function(e,t){if(m.defined("rectangle",e),!h(Me._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=_(t,le.default);const n=Wu(e);let i=Me._defaultMaxTerrainHeight;if(h(n)){const s=`${n.level}-${n.x}-${n.y}`,a=Me._terrainHeights[s];h(a)&&(i=a[1])}const o=K.fromRectangle3D(e,t,0);return K.fromRectangle3D(e,t,i,Hu),K.union(o,Hu,o)};function Wu(e){ee.fromRadians(e.east,e.north,0,ur[0]),ee.fromRadians(e.west,e.north,0,ur[1]),ee.fromRadians(e.east,e.south,0,ur[2]),ee.fromRadians(e.west,e.south,0,ur[3]);let t=0,n=0,i=0,o=0;const s=Me._terrainHeightsMaxLevel;let a;for(a=0;a<=s;++a){let c=!1;for(let l=0;l<4;++l){const u=ur[l];if(BC.positionToTileXY(u,a,dr),l===0)i=dr.x,o=dr.y;else if(i!==dr.x||o!==dr.y){c=!0;break}}if(c)break;t=i,n=o}if(a!==0)return{x:t,y:n,level:a>s?s:a-1}}Me._terrainHeightsMaxLevel=6,Me._defaultMaxTerrainHeight=9e3,Me._defaultMinTerrainHeight=-1e5,Me._terrainHeights=void 0,Me._initPromise=void 0,Object.defineProperties(Me,{initialized:{get:function(){return h(Me._terrainHeights)}}});function Yt(e,t,n){this.minimum=f.clone(_(e,f.ZERO)),this.maximum=f.clone(_(t,f.ZERO)),h(n)?n=f.clone(n):n=f.midpoint(this.minimum,this.maximum,new f),this.center=n}Yt.fromCorners=function(e,t,n){return m.defined("minimum",e),m.defined("maximum",t),h(n)||(n=new Yt),n.minimum=f.clone(e,n.minimum),n.maximum=f.clone(t,n.maximum),n.center=f.midpoint(e,t,n.center),n},Yt.fromPoints=function(e,t){if(h(t)||(t=new Yt),!h(e)||e.length===0)return t.minimum=f.clone(f.ZERO,t.minimum),t.maximum=f.clone(f.ZERO,t.maximum),t.center=f.clone(f.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,s=e[0].x,a=e[0].y,c=e[0].z;const l=e.length;for(let p=1;p<l;p++){const g=e[p],y=g.x,x=g.y,E=g.z;n=Math.min(y,n),s=Math.max(y,s),i=Math.min(x,i),a=Math.max(x,a),o=Math.min(E,o),c=Math.max(E,c)}const u=t.minimum;u.x=n,u.y=i,u.z=o;const d=t.maximum;return d.x=s,d.y=a,d.z=c,t.center=f.midpoint(u,d,t.center),t},Yt.clone=function(e,t){if(h(e))return h(t)?(t.minimum=f.clone(e.minimum,t.minimum),t.maximum=f.clone(e.maximum,t.maximum),t.center=f.clone(e.center,t.center),t):new Yt(e.minimum,e.maximum,e.center)},Yt.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&f.equals(e.minimum,t.minimum)&&f.equals(e.maximum,t.maximum)};let Ks=new f;Yt.intersectPlane=function(e,t){m.defined("box",e),m.defined("plane",t),Ks=f.subtract(e.maximum,e.minimum,Ks);const n=f.multiplyByScalar(Ks,.5,Ks),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),s=f.dot(e.center,i)+t.distance;return s-o>0?Et.INSIDE:s+o<0?Et.OUTSIDE:Et.INTERSECTING},Yt.prototype.clone=function(e){return Yt.clone(this,e)},Yt.prototype.intersectPlane=function(e){return Yt.intersectPlane(this,e)},Yt.prototype.equals=function(e){return Yt.equals(this,e)};const Rn={};Rn.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");return t*t-4*e*n};function ju(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Rn.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];const l=Math.abs(n),u=Math.abs(e);if(l<u&&l/u<S.EPSILON14)return[0,0];if(l>u&&u/l<S.EPSILON14)return[];if(i=-n/e,i<0)return[];const d=Math.sqrt(i);return[-d,d]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];const o=t*t,s=4*e*n,a=ju(o,-s,S.EPSILON14);if(a<0)return[];const c=-.5*ju(t,S.sign(t)*Math.sqrt(a),S.EPSILON14);return t>0?[c/e,n/c]:[n/c,c/e]};const pr={};pr.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");const o=e*e,s=t*t,a=n*n,c=i*i;return 18*e*t*n*i+s*a-27*o*c-4*(e*a*n+s*t*i)};function Yc(e,t,n,i){const o=e,s=t/3,a=n/3,c=i,l=o*a,u=s*c,d=s*s,p=a*a,g=o*a-d,y=o*c-s*a,x=s*c-p,E=4*g*x-y*y;let b,D;if(E<0){let ie,se,ge;d*u>=l*p?(ie=o,se=g,ge=-2*s*g+o*y):(ie=c,se=x,ge=-c*y+2*a*x);const xe=-(ge<0?-1:1)*Math.abs(ie)*Math.sqrt(-E);D=-ge+xe;const ze=D/2,je=ze<0?-Math.pow(-ze,1/3):Math.pow(ze,1/3),tt=D===xe?-je:-se/je;return b=se<=0?je+tt:-ge/(je*je+tt*tt+se),d*u>=l*p?[(b-s)/o]:[-c/(b+a)]}const A=g,O=-2*s*g+o*y,I=x,B=-c*y+2*a*x,M=Math.sqrt(E),q=Math.sqrt(3)/2;let P=Math.abs(Math.atan2(o*M,-O)/3);b=2*Math.sqrt(-A);let V=Math.cos(P);D=b*V;let k=b*(-V/2-q*Math.sin(P));const H=D+k>2*s?D-s:k-s,j=o,r=H/j;P=Math.abs(Math.atan2(c*M,-B)/3),b=2*Math.sqrt(-I),V=Math.cos(P),D=b*V,k=b*(-V/2-q*Math.sin(P));const w=-c,v=D+k<2*a?D+a:k+a,z=w/v,G=j*v,W=-H*v-j*w,Z=H*w,X=(a*W-s*Z)/(-s*W+a*G);return r<=X?r<=z?X<=z?[r,X,z]:[r,z,X]:[z,r,X]:r<=z?[X,r,z]:X<=z?[X,z,r]:[z,X,r]}pr.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o,s;if(e===0)return Rn.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];s=-i/e;const a=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[a,a,a]}else if(i===0)return o=Rn.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return Yc(e,0,n,i)}else{if(n===0)return i===0?(s=-t/e,s<0?[s,0,0]:[0,0,s]):Yc(e,t,0,i);if(i===0)return o=Rn.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return Yc(e,t,n,i)};const Xc={};Xc.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");const s=e*e,a=s*e,c=t*t,l=c*t,u=n*n,d=u*n,p=i*i,g=p*i,y=o*o,x=y*o;return c*u*p-4*l*g-4*e*d*p+18*e*t*n*g-27*s*p*p+256*a*x+o*(18*l*n*i-4*c*d+16*e*u*u-80*e*t*u*i-6*e*c*p+144*s*n*p)+y*(144*e*c*n-27*c*c-128*s*u-192*s*t*i)};function zn(e,t,n,i){const o=e*e,s=t-3*o/8,a=n-t*e/2+o*e/8,c=i-n*e/4+t*o/16-3*o*o/256,l=pr.computeRealRoots(1,2*s,s*s-4*c,-a*a);if(l.length>0){const u=-e/4,d=l[l.length-1];if(Math.abs(d)<S.EPSILON14){const p=Rn.computeRealRoots(1,s,c);if(p.length===2){const g=p[0],y=p[1];let x;if(g>=0&&y>=0){const E=Math.sqrt(g),b=Math.sqrt(y);return[u-b,u-E,u+E,u+b]}else{if(g>=0&&y<0)return x=Math.sqrt(g),[u-x,u+x];if(g<0&&y>=0)return x=Math.sqrt(y),[u-x,u+x]}}return[]}else if(d>0){const p=Math.sqrt(d),g=(s+d-a/p)/2,y=(s+d+a/p)/2,x=Rn.computeRealRoots(1,p,g),E=Rn.computeRealRoots(1,-p,y);return x.length!==0?(x[0]+=u,x[1]+=u,E.length!==0?(E[0]+=u,E[1]+=u,x[1]<=E[0]?[x[0],x[1],E[0],E[1]]:E[1]<=x[0]?[E[0],E[1],x[0],x[1]]:x[0]>=E[0]&&x[1]<=E[1]?[E[0],x[0],x[1],E[1]]:E[0]>=x[0]&&E[1]<=x[1]?[x[0],E[0],E[1],x[1]]:x[0]>E[0]&&x[0]<E[1]?[E[0],x[0],E[1],x[1]]:[x[0],E[0],x[1],E[1]]):x):E.length!==0?(E[0]+=u,E[1]+=u,E):[]}}return[]}function mr(e,t,n,i){const o=n*n,s=t*t,a=e*e,c=-2*t,l=n*e+s-4*i,u=a*i-n*t*e+o,d=pr.computeRealRoots(1,c,l,u);if(d.length>0){const p=d[0],g=t-p,y=g*g,x=e/2,E=g/2,b=y-4*i,D=y+4*Math.abs(i),A=a-4*p,O=a+4*Math.abs(p);let I,B;if(p<0||b*O<A*D){const j=Math.sqrt(A);I=j/2,B=j===0?0:(e*E-n)/j}else{const j=Math.sqrt(b);I=j===0?0:(e*E-n)/j,B=j/2}let M,q;x===0&&I===0?(M=0,q=0):S.sign(x)===S.sign(I)?(M=x+I,q=p/M):(q=x-I,M=p/q);let P,V;E===0&&B===0?(P=0,V=0):S.sign(E)===S.sign(B)?(P=E+B,V=i/P):(V=E-B,P=i/V);const k=Rn.computeRealRoots(1,M,P),H=Rn.computeRealRoots(1,q,V);if(k.length!==0)return H.length!==0?k[1]<=H[0]?[k[0],k[1],H[0],H[1]]:H[1]<=k[0]?[H[0],H[1],k[0],k[1]]:k[0]>=H[0]&&k[1]<=H[1]?[H[0],k[0],k[1],H[1]]:H[0]>=k[0]&&H[1]<=k[1]?[k[0],H[0],H[1],k[1]]:k[0]>H[0]&&k[0]<H[1]?[H[0],k[0],H[1],k[1]]:[k[0],H[0],k[1],H[1]]:k;if(H.length!==0)return H}return[]}Xc.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");if(Math.abs(e)<S.EPSILON15)return pr.computeRealRoots(t,n,i,o);const s=t/e,a=n/e,c=i/e,l=o/e;let u=s<0?1:0;switch(u+=a<0?u+1:u,u+=c<0?u+1:u,u+=l<0?u+1:u,u){case 0:return zn(s,a,c,l);case 1:return mr(s,a,c,l);case 2:return mr(s,a,c,l);case 3:return zn(s,a,c,l);case 4:return zn(s,a,c,l);case 5:return mr(s,a,c,l);case 6:return zn(s,a,c,l);case 7:return zn(s,a,c,l);case 8:return mr(s,a,c,l);case 9:return zn(s,a,c,l);case 10:return zn(s,a,c,l);case 11:return mr(s,a,c,l);case 12:return zn(s,a,c,l);case 13:return zn(s,a,c,l);case 14:return zn(s,a,c,l);case 15:return zn(s,a,c,l);default:return}};function Fo(e,t){t=f.clone(_(t,f.ZERO)),f.equals(t,f.ZERO)||f.normalize(t,t),this.origin=f.clone(_(e,f.ZERO)),this.direction=t}Fo.clone=function(e,t){if(h(e))return h(t)?(t.origin=f.clone(e.origin),t.direction=f.clone(e.direction),t):new Fo(e.origin,e.direction)},Fo.getPoint=function(e,t,n){return m.typeOf.object("ray",e),m.typeOf.number("t",t),h(n)||(n=new f),n=f.multiplyByScalar(e.direction,t,n),f.add(e.origin,n,n)};const Fe={};Fe.rayPlane=function(e,t,n){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("plane is required.");h(n)||(n=new f);const i=e.origin,o=e.direction,s=t.normal,a=f.dot(s,o);if(Math.abs(a)<S.EPSILON15)return;const c=(-t.distance-f.dot(s,i))/a;if(!(c<0))return n=f.multiplyByScalar(o,c,n),f.add(i,n,n)};const NC=new f,FC=new f,Yu=new f,Xu=new f,$u=new f;Fe.rayTriangleParametric=function(e,t,n,i,o){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("p0 is required.");if(!h(n))throw new C("p1 is required.");if(!h(i))throw new C("p2 is required.");o=_(o,!1);const s=e.origin,a=e.direction,c=f.subtract(n,t,NC),l=f.subtract(i,t,FC),u=f.cross(a,l,Yu),d=f.dot(c,u);let p,g,y,x,E;if(o){if(d<S.EPSILON6||(p=f.subtract(s,t,Xu),y=f.dot(p,u),y<0||y>d)||(g=f.cross(p,c,$u),x=f.dot(a,g),x<0||y+x>d))return;E=f.dot(l,g)/d}else{if(Math.abs(d)<S.EPSILON6)return;const b=1/d;if(p=f.subtract(s,t,Xu),y=f.dot(p,u)*b,y<0||y>1||(g=f.cross(p,c,$u),x=f.dot(a,g)*b,x<0||y+x>1))return;E=f.dot(l,g)*b}return E},Fe.rayTriangle=function(e,t,n,i,o,s){const a=Fe.rayTriangleParametric(e,t,n,i,o);if(!(!h(a)||a<0))return h(s)||(s=new f),f.multiplyByScalar(e.direction,a,s),f.add(e.origin,s,s)};const LC=new Fo;Fe.lineSegmentTriangle=function(e,t,n,i,o,s,a){if(!h(e))throw new C("v0 is required.");if(!h(t))throw new C("v1 is required.");if(!h(n))throw new C("p0 is required.");if(!h(i))throw new C("p1 is required.");if(!h(o))throw new C("p2 is required.");const c=LC;f.clone(e,c.origin),f.subtract(t,e,c.direction),f.normalize(c.direction,c.direction);const l=Fe.rayTriangleParametric(c,n,i,o,s);if(!(!h(l)||l<0||l>f.distance(e,t)))return h(a)||(a=new f),f.multiplyByScalar(c.direction,l,a),f.add(c.origin,a,a)};function MC(e,t,n,i){const o=t*t-4*e*n;if(o<0)return;if(o>0){const a=1/(2*e),c=Math.sqrt(o),l=(-t+c)*a,u=(-t-c)*a;return l<u?(i.root0=l,i.root1=u):(i.root0=u,i.root1=l),i}const s=-t/(2*e);if(s!==0)return i.root0=i.root1=s,i}const UC={root0:0,root1:0};function Zu(e,t,n){h(n)||(n=new to);const i=e.origin,o=e.direction,s=t.center,a=t.radius*t.radius,c=f.subtract(i,s,Yu),l=f.dot(o,o),u=2*f.dot(o,c),d=f.magnitudeSquared(c)-a,p=MC(l,u,d,UC);if(h(p))return n.start=p.root0,n.stop=p.root1,n}Fe.raySphere=function(e,t,n){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("sphere is required.");if(n=Zu(e,t,n),!(!h(n)||n.stop<0))return n.start=Math.max(n.start,0),n};const kC=new Fo;Fe.lineSegmentSphere=function(e,t,n,i){if(!h(e))throw new C("p0 is required.");if(!h(t))throw new C("p1 is required.");if(!h(n))throw new C("sphere is required.");const o=kC;f.clone(e,o.origin);const s=f.subtract(t,e,o.direction),a=f.magnitude(s);if(f.normalize(s,s),i=Zu(o,n,i),!(!h(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};const VC=new f,GC=new f;Fe.rayEllipsoid=function(e,t){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("ellipsoid is required.");const n=t.oneOverRadii,i=f.multiplyComponents(n,e.origin,VC),o=f.multiplyComponents(n,e.direction,GC),s=f.magnitudeSquared(i),a=f.dot(i,o);let c,l,u,d,p;if(s>1){if(a>=0)return;const g=a*a;if(c=s-1,l=f.magnitudeSquared(o),u=l*c,g<u)return;if(g>u){d=a*a-u,p=-a+Math.sqrt(d);const x=p/l,E=c/p;return x<E?new to(x,E):{start:E,stop:x}}const y=Math.sqrt(c/l);return new to(y,y)}else if(s<1)return c=s-1,l=f.magnitudeSquared(o),u=l*c,d=a*a-u,p=-a+Math.sqrt(d),new to(0,p/l);if(a<0)return l=f.magnitudeSquared(o),new to(0,-a/l)};function io(e,t,n){const i=e+t;return S.sign(e)!==S.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Fe.quadraticVectorExpression=function(e,t,n,i,o){const s=i*i,a=o*o,c=(e[L.COLUMN1ROW1]-e[L.COLUMN2ROW2])*a,l=o*(i*io(e[L.COLUMN1ROW0],e[L.COLUMN0ROW1],S.EPSILON15)+t.y),u=e[L.COLUMN0ROW0]*s+e[L.COLUMN2ROW2]*a+i*t.x+n,d=a*io(e[L.COLUMN2ROW1],e[L.COLUMN1ROW2],S.EPSILON15),p=o*(i*io(e[L.COLUMN2ROW0],e[L.COLUMN0ROW2])+t.z);let g;const y=[];if(p===0&&d===0){if(g=Rn.computeRealRoots(c,l,u),g.length===0)return y;const P=g[0],V=Math.sqrt(Math.max(1-P*P,0));if(y.push(new f(i,o*P,o*-V)),y.push(new f(i,o*P,o*V)),g.length===2){const k=g[1],H=Math.sqrt(Math.max(1-k*k,0));y.push(new f(i,o*k,o*-H)),y.push(new f(i,o*k,o*H))}return y}const x=p*p,E=d*d,b=c*c,D=p*d,A=b+E,O=2*(l*c+D),I=2*u*c+l*l-E+x,B=2*(u*l-D),M=u*u-x;if(A===0&&O===0&&I===0&&B===0)return y;g=Xc.computeRealRoots(A,O,I,B,M);const q=g.length;if(q===0)return y;for(let P=0;P<q;++P){const V=g[P],k=V*V,H=Math.max(1-k,0),j=Math.sqrt(H);let r;S.sign(c)===S.sign(u)?r=io(c*k+u,l*V,S.EPSILON12):S.sign(u)===S.sign(l*V)?r=io(c*k,l*V+u,S.EPSILON12):r=io(c*k+l*V,u,S.EPSILON12);const w=io(d*V,p,S.EPSILON15),v=r*w;v<0?y.push(new f(i,o*V,o*j)):v>0?y.push(new f(i,o*V,o*-j)):j!==0?(y.push(new f(i,o*V,o*-j)),y.push(new f(i,o*V,o*j)),++P):y.push(new f(i,o*V,o*j))}return y};const $c=new f,Ku=new f,Qu=new f,Qs=new f,qC=new f,HC=new L,WC=new L,jC=new L,YC=new L,XC=new L,Ju=new L,ed=new L,td=new f,$C=new f,ZC=new ee;Fe.grazingAltitudeLocation=function(e,t){if(!h(e))throw new C("ray is required.");if(!h(t))throw new C("ellipsoid is required.");const n=e.origin,i=e.direction;if(!f.equals(n,f.ZERO)){const M=t.geodeticSurfaceNormal(n,$c);if(f.dot(i,M)>=0)return n}const o=h(this.rayEllipsoid(e,t)),s=t.transformPositionToScaledSpace(i,$c),a=f.normalize(s,s),c=f.mostOrthogonalAxis(s,Qs),l=f.normalize(f.cross(c,a,Ku),Ku),u=f.normalize(f.cross(a,l,Qu),Qu),d=HC;d[0]=a.x,d[1]=a.y,d[2]=a.z,d[3]=l.x,d[4]=l.y,d[5]=l.z,d[6]=u.x,d[7]=u.y,d[8]=u.z;const p=L.transpose(d,WC),g=L.fromScale(t.radii,jC),y=L.fromScale(t.oneOverRadii,YC),x=XC;x[0]=0,x[1]=-i.z,x[2]=i.y,x[3]=i.z,x[4]=0,x[5]=-i.x,x[6]=-i.y,x[7]=i.x,x[8]=0;const E=L.multiply(L.multiply(p,y,Ju),x,Ju),b=L.multiply(L.multiply(E,g,ed),d,ed),D=L.multiplyByVector(E,n,qC),A=Fe.quadraticVectorExpression(b,f.negate(D,$c),0,0,1);let O,I;const B=A.length;if(B>0){let M=f.clone(f.ZERO,$C),q=Number.NEGATIVE_INFINITY;for(let V=0;V<B;++V){O=L.multiplyByVector(g,L.multiplyByVector(d,A[V],td),td);const k=f.normalize(f.subtract(O,n,Qs),Qs),H=f.dot(k,i);H>q&&(q=H,M=f.clone(O,M))}const P=t.cartesianToCartographic(M,ZC);return q=S.clamp(q,0,1),I=f.magnitude(f.subtract(M,n,Qs))*Math.sqrt(1-q*q),I=o?-I:I,P.height=I,t.cartographicToCartesian(P,new f)}};const KC=new f;Fe.lineSegmentPlane=function(e,t,n,i){if(!h(e))throw new C("endPoint0 is required.");if(!h(t))throw new C("endPoint1 is required.");if(!h(n))throw new C("plane is required.");h(i)||(i=new f);const o=f.subtract(t,e,KC),s=n.normal,a=f.dot(s,o);if(Math.abs(a)<S.EPSILON6)return;const c=f.dot(s,e),l=-(n.distance+c)/a;if(!(l<0||l>1))return f.multiplyByScalar(o,l,i),f.add(e,i,i),i},Fe.trianglePlaneIntersection=function(e,t,n,i){if(!h(e)||!h(t)||!h(n)||!h(i))throw new C("p0, p1, p2, and plane are required.");const o=i.normal,s=i.distance,a=f.dot(o,e)+s<0,c=f.dot(o,t)+s<0,l=f.dot(o,n)+s<0;let u=0;u+=a?1:0,u+=c?1:0,u+=l?1:0;let d,p;if((u===1||u===2)&&(d=new f,p=new f),u===1){if(a)return Fe.lineSegmentPlane(e,t,i,d),Fe.lineSegmentPlane(e,n,i,p),{positions:[e,t,n,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(c)return Fe.lineSegmentPlane(t,n,i,d),Fe.lineSegmentPlane(t,e,i,p),{positions:[e,t,n,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Fe.lineSegmentPlane(n,e,i,d),Fe.lineSegmentPlane(n,t,i,p),{positions:[e,t,n,d,p],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(a)if(c){if(!l)return Fe.lineSegmentPlane(e,n,i,d),Fe.lineSegmentPlane(t,n,i,p),{positions:[e,t,n,d,p],indices:[0,1,4,0,4,3,2,3,4]}}else return Fe.lineSegmentPlane(n,t,i,d),Fe.lineSegmentPlane(e,t,i,p),{positions:[e,t,n,d,p],indices:[2,0,4,2,4,3,1,3,4]};else return Fe.lineSegmentPlane(t,e,i,d),Fe.lineSegmentPlane(n,e,i,p),{positions:[e,t,n,d,p],indices:[1,2,4,1,4,3,0,3,4]}};const Zc=new Y;function Kn(e,t){if(m.defined("origin",e),t=_(t,le.default),e=t.scaleToGeodeticSurface(e),!h(e))throw new C("origin must not be at the center of the ellipsoid.");const n=_e.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=f.fromCartesian4(N.getColumn(n,0,Zc)),this._yAxis=f.fromCartesian4(N.getColumn(n,1,Zc));const i=f.fromCartesian4(N.getColumn(n,2,Zc));this._plane=Ne.fromPointNormal(e,i)}Object.defineProperties(Kn.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 QC=new Yt;Kn.fromPoints=function(e,t){m.defined("cartesians",e);const n=Yt.fromPoints(e,QC);return new Kn(n.center,t)};const nd=new Fo,Js=new f;Kn.prototype.projectPointOntoPlane=function(e,t){m.defined("cartesian",e);const n=nd;n.origin=e,f.normalize(e,n.direction);let i=Fe.rayPlane(n,this._plane,Js);if(h(i)||(f.negate(n.direction,n.direction),i=Fe.rayPlane(n,this._plane,Js)),h(i)){const o=f.subtract(i,this._origin,i),s=f.dot(this._xAxis,o),a=f.dot(this._yAxis,o);return h(t)?(t.x=s,t.y=a,t):new U(s,a)}},Kn.prototype.projectPointsOntoPlane=function(e,t){m.defined("cartesians",e),h(t)||(t=[]);let n=0;const i=e.length;for(let o=0;o<i;o++){const s=this.projectPointOntoPlane(e[o],t[n]);h(s)&&(t[n]=s,n++)}return t.length=n,t},Kn.prototype.projectPointToNearestOnPlane=function(e,t){m.defined("cartesian",e),h(t)||(t=new U);const n=nd;n.origin=e,f.clone(this._plane.normal,n.direction);let i=Fe.rayPlane(n,this._plane,Js);h(i)||(f.negate(n.direction,n.direction),i=Fe.rayPlane(n,this._plane,Js));const o=f.subtract(i,this._origin,i),s=f.dot(this._xAxis,o),a=f.dot(this._yAxis,o);return t.x=s,t.y=a,t},Kn.prototype.projectPointsToNearestOnPlane=function(e,t){m.defined("cartesians",e),h(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 JC=new f;Kn.prototype.projectPointOntoEllipsoid=function(e,t){m.defined("cartesian",e),h(t)||(t=new f);const n=this._ellipsoid,i=this._origin,o=this._xAxis,s=this._yAxis,a=JC;return f.multiplyByScalar(o,e.x,a),t=f.add(i,a,t),f.multiplyByScalar(s,e.y,a),f.add(t,a,t),n.scaleToGeocentricSurface(t,t),t},Kn.prototype.projectPointsOntoEllipsoid=function(e,t){m.defined("cartesians",e);const n=e.length;h(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};function Re(e,t){this.center=f.clone(_(e,f.ZERO)),this.halfAxes=L.clone(_(t,L.ZERO))}Re.packedLength=f.packedLength+L.packedLength,Re.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),f.pack(e.center,t,n),L.pack(e.halfAxes,t,n+f.packedLength),t},Re.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Re),f.unpack(e,t,n.center),L.unpack(e,t+f.packedLength,n.halfAxes),n};const eE=new f,tE=new f,nE=new f,iE=new f,oE=new f,rE=new f,sE=new L,aE={unitary:new L,diagonal:new L};Re.fromPoints=function(e,t){if(h(t)||(t=new Re),!h(e)||e.length===0)return t.halfAxes=L.ZERO,t.center=f.ZERO,t;let n;const i=e.length,o=f.clone(e[0],eE);for(n=1;n<i;n++)f.add(o,e[n],o);const s=1/i;f.multiplyByScalar(o,s,o);let a=0,c=0,l=0,u=0,d=0,p=0,g;for(n=0;n<i;n++)g=f.subtract(e[n],o,tE),a+=g.x*g.x,c+=g.x*g.y,l+=g.x*g.z,u+=g.y*g.y,d+=g.y*g.z,p+=g.z*g.z;a*=s,c*=s,l*=s,u*=s,d*=s,p*=s;const y=sE;y[0]=a,y[1]=c,y[2]=l,y[3]=c,y[4]=u,y[5]=d,y[6]=l,y[7]=d,y[8]=p;const x=L.computeEigenDecomposition(y,aE),E=L.clone(x.unitary,t.halfAxes);let b=L.getColumn(E,0,iE),D=L.getColumn(E,1,oE),A=L.getColumn(E,2,rE),O=-Number.MAX_VALUE,I=-Number.MAX_VALUE,B=-Number.MAX_VALUE,M=Number.MAX_VALUE,q=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)g=e[n],O=Math.max(f.dot(b,g),O),I=Math.max(f.dot(D,g),I),B=Math.max(f.dot(A,g),B),M=Math.min(f.dot(b,g),M),q=Math.min(f.dot(D,g),q),P=Math.min(f.dot(A,g),P);b=f.multiplyByScalar(b,.5*(M+O),b),D=f.multiplyByScalar(D,.5*(q+I),D),A=f.multiplyByScalar(A,.5*(P+B),A);const V=f.add(b,D,t.center);f.add(V,A,V);const k=nE;return k.x=O-M,k.y=I-q,k.z=B-P,f.multiplyByScalar(k,.5,k),L.multiplyByScale(t.halfAxes,k,t.halfAxes),t};const id=new f,cE=new f;function od(e,t,n,i,o,s,a,c,l,u,d){if(!h(o)||!h(s)||!h(a)||!h(c)||!h(l)||!h(u))throw new C("all extents (minimum/maximum X/Y/Z) are required.");h(d)||(d=new Re);const p=d.halfAxes;L.setColumn(p,0,t,p),L.setColumn(p,1,n,p),L.setColumn(p,2,i,p);let g=id;g.x=(o+s)/2,g.y=(a+c)/2,g.z=(l+u)/2;const y=cE;y.x=(s-o)/2,y.y=(c-a)/2,y.z=(u-l)/2;const x=d.center;return g=L.multiplyByVector(p,g,g),f.add(e,g,x),L.multiplyByScale(p,y,p),d}const rd=new ee,lE=new f,hE=new ee,fE=new ee,uE=new ee,dE=new ee,pE=new ee,mE=new f,sd=new f,_E=new f,ad=new f,gE=new f,yE=new U,xE=new U,CE=new U,EE=new U,bE=new U,wE=new f,TE=new f,SE=new f,AE=new f,DE=new U,OE=new f,vE=new f,IE=new f,RE=new Ne(f.UNIT_X,0);Re.fromRectangle=function(e,t,n,i,o){if(!h(e))throw new C("rectangle is required");if(e.width<0||e.width>S.TWO_PI)throw new C("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>S.PI)throw new C("Rectangle height must be between 0 and pi");if(h(i)&&!S.equalsEpsilon(i.radii.x,i.radii.y,S.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=_(t,0),n=_(n,0),i=_(i,le.default);let s,a,c,l,u,d,p;if(e.width<=S.PI){const q=ce.center(e,rd),P=i.cartographicToCartesian(q,lE),V=new Kn(P,i);p=V.plane;const k=q.longitude,H=e.south<0&&e.north>0?0:q.latitude,j=ee.fromRadians(k,e.north,n,hE),r=ee.fromRadians(e.west,e.north,n,fE),w=ee.fromRadians(e.west,H,n,uE),v=ee.fromRadians(e.west,e.south,n,dE),z=ee.fromRadians(k,e.south,n,pE),G=i.cartographicToCartesian(j,mE);let W=i.cartographicToCartesian(r,sd);const Z=i.cartographicToCartesian(w,_E);let X=i.cartographicToCartesian(v,ad);const ie=i.cartographicToCartesian(z,gE),se=V.projectPointToNearestOnPlane(G,yE),ge=V.projectPointToNearestOnPlane(W,xE),be=V.projectPointToNearestOnPlane(Z,CE),xe=V.projectPointToNearestOnPlane(X,EE),ze=V.projectPointToNearestOnPlane(ie,bE);return s=Math.min(ge.x,be.x,xe.x),a=-s,l=Math.max(ge.y,se.y),c=Math.min(xe.y,ze.y),r.height=v.height=t,W=i.cartographicToCartesian(r,sd),X=i.cartographicToCartesian(v,ad),u=Math.min(Ne.getPointDistance(p,W),Ne.getPointDistance(p,X)),d=n,od(V.origin,V.xAxis,V.yAxis,V.zAxis,s,a,c,l,u,d,o)}const g=e.south>0,y=e.north<0,x=g?e.south:y?e.north:0,E=ce.center(e,rd).longitude,b=f.fromRadians(E,x,n,i,wE);b.z=0;const A=Math.abs(b.x)<S.EPSILON10&&Math.abs(b.y)<S.EPSILON10?f.UNIT_X:f.normalize(b,TE),O=f.UNIT_Z,I=f.cross(A,O,SE);p=Ne.fromPointNormal(b,A,RE);const B=f.fromRadians(E+S.PI_OVER_TWO,x,n,i,AE);a=f.dot(Ne.projectPointOntoPlane(p,B,DE),I),s=-a,l=f.fromRadians(0,e.north,y?t:n,i,OE).z,c=f.fromRadians(0,e.south,g?t:n,i,vE).z;const M=f.fromRadians(e.east,x,n,i,IE);return u=Ne.getPointDistance(p,M),d=0,od(b,I,O,A,s,a,c,l,u,d,o)},Re.fromTransformation=function(e,t){return m.typeOf.object("transformation",e),h(t)||(t=new Re),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=L.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},Re.clone=function(e,t){if(h(e))return h(t)?(f.clone(e.center,t.center),L.clone(e.halfAxes,t.halfAxes),t):new Re(e.center,e.halfAxes)},Re.intersectPlane=function(e,t){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("plane is required.");const n=e.center,i=t.normal,o=e.halfAxes,s=i.x,a=i.y,c=i.z,l=Math.abs(s*o[L.COLUMN0ROW0]+a*o[L.COLUMN0ROW1]+c*o[L.COLUMN0ROW2])+Math.abs(s*o[L.COLUMN1ROW0]+a*o[L.COLUMN1ROW1]+c*o[L.COLUMN1ROW2])+Math.abs(s*o[L.COLUMN2ROW0]+a*o[L.COLUMN2ROW1]+c*o[L.COLUMN2ROW2]),u=f.dot(i,n)+t.distance;return u<=-l?Et.OUTSIDE:u>=l?Et.INSIDE:Et.INTERSECTING};const cd=new f,ld=new f,hd=new f,zE=new f,fd=new f,PE=new f;Re.distanceSquaredTo=function(e,t){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("cartesian is required.");const n=f.subtract(t,e.center,id),i=e.halfAxes;let o=L.getColumn(i,0,cd),s=L.getColumn(i,1,ld),a=L.getColumn(i,2,hd);const c=f.magnitude(o),l=f.magnitude(s),u=f.magnitude(a);let d=!0,p=!0,g=!0;c>0?f.divideByScalar(o,c,o):d=!1,l>0?f.divideByScalar(s,l,s):p=!1,u>0?f.divideByScalar(a,u,a):g=!1;const y=!d+!p+!g;let x,E,b;if(y===1){let I=o;x=s,E=a,p?g||(I=a,E=o):(I=s,x=o),b=f.cross(x,E,fd),I===o?o=b:I===s?s=b:I===a&&(a=b)}else if(y===2){x=o,p?x=s:g&&(x=a);let I=f.UNIT_Y;I.equalsEpsilon(x,S.EPSILON3)&&(I=f.UNIT_X),E=f.cross(x,I,zE),f.normalize(E,E),b=f.cross(x,E,fd),f.normalize(b,b),x===o?(s=E,a=b):x===s?(a=E,o=b):x===a&&(o=E,s=b)}else y===3&&(o=f.UNIT_X,s=f.UNIT_Y,a=f.UNIT_Z);const D=PE;D.x=f.dot(n,o),D.y=f.dot(n,s),D.z=f.dot(n,a);let A=0,O;return D.x<-c?(O=D.x+c,A+=O*O):D.x>c&&(O=D.x-c,A+=O*O),D.y<-l?(O=D.y+l,A+=O*O):D.y>l&&(O=D.y-l,A+=O*O),D.z<-u?(O=D.z+u,A+=O*O):D.z>u&&(O=D.z-u,A+=O*O),A};const BE=new f,NE=new f;Re.computePlaneDistances=function(e,t,n,i){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("position is required.");if(!h(n))throw new C("direction is required.");h(i)||(i=new to);let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const a=e.center,c=e.halfAxes,l=L.getColumn(c,0,cd),u=L.getColumn(c,1,ld),d=L.getColumn(c,2,hd),p=f.add(l,u,BE);f.add(p,d,p),f.add(p,a,p);const g=f.subtract(p,t,NE);let y=f.dot(n,g);return o=Math.min(y,o),s=Math.max(y,s),f.add(a,l,p),f.add(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.add(a,l,p),f.subtract(p,u,p),f.add(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.add(a,l,p),f.subtract(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.add(p,u,p),f.add(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.add(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.subtract(p,u,p),f.add(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),f.subtract(a,l,p),f.subtract(p,u,p),f.subtract(p,d,p),f.subtract(p,t,g),y=f.dot(n,g),o=Math.min(y,o),s=Math.max(y,s),i.start=o,i.stop=s,i};const FE=new f,LE=new f,ME=new f;Re.computeCorners=function(e,t){m.typeOf.object("box",e),h(t)||(t=[new f,new f,new f,new f,new f,new f,new f,new f]);const n=e.center,i=e.halfAxes,o=L.getColumn(i,0,FE),s=L.getColumn(i,1,LE),a=L.getColumn(i,2,ME);return f.clone(n,t[0]),f.subtract(t[0],o,t[0]),f.subtract(t[0],s,t[0]),f.subtract(t[0],a,t[0]),f.clone(n,t[1]),f.subtract(t[1],o,t[1]),f.subtract(t[1],s,t[1]),f.add(t[1],a,t[1]),f.clone(n,t[2]),f.subtract(t[2],o,t[2]),f.add(t[2],s,t[2]),f.subtract(t[2],a,t[2]),f.clone(n,t[3]),f.subtract(t[3],o,t[3]),f.add(t[3],s,t[3]),f.add(t[3],a,t[3]),f.clone(n,t[4]),f.add(t[4],o,t[4]),f.subtract(t[4],s,t[4]),f.subtract(t[4],a,t[4]),f.clone(n,t[5]),f.add(t[5],o,t[5]),f.subtract(t[5],s,t[5]),f.add(t[5],a,t[5]),f.clone(n,t[6]),f.add(t[6],o,t[6]),f.add(t[6],s,t[6]),f.subtract(t[6],a,t[6]),f.clone(n,t[7]),f.add(t[7],o,t[7]),f.add(t[7],s,t[7]),f.add(t[7],a,t[7]),t};const UE=new L;Re.computeTransformation=function(e,t){m.typeOf.object("box",e),h(t)||(t=new N);const n=e.center,i=L.multiplyByUniformScale(e.halfAxes,2,UE);return N.fromRotationTranslation(i,n,t)};const kE=new K;Re.isOccluded=function(e,t){if(!h(e))throw new C("box is required.");if(!h(t))throw new C("occluder is required.");const n=K.fromOrientedBoundingBox(e,kE);return!t.isBoundingSphereVisible(n)},Re.prototype.intersectPlane=function(e){return Re.intersectPlane(this,e)},Re.prototype.distanceSquaredTo=function(e){return Re.distanceSquaredTo(this,e)},Re.prototype.computePlaneDistances=function(e,t,n){return Re.computePlaneDistances(this,e,t,n)},Re.prototype.computeCorners=function(e){return Re.computeCorners(this,e)},Re.prototype.computeTransformation=function(e){return Re.computeTransformation(this,e)},Re.prototype.isOccluded=function(e){return Re.isOccluded(this,e)},Re.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&L.equals(e.halfAxes,t.halfAxes)},Re.prototype.clone=function(e){return Re.clone(this,e)},Re.prototype.equals=function(e){return Re.equals(this,e)};const _r={};_r.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new C("scale must be a finite number.");if(!Number.isFinite(n))throw new C("relativeHeight must be a finite number.");return(e-n)*t+n};const VE=new ee;_r.getPosition=function(e,t,n,i,o){const s=t.cartesianToCartographic(e,VE);if(!h(s))return f.clone(e,o);const a=_r.getHeight(s.height,n,i);return f.fromRadians(s.longitude,s.latitude,a,t,o)};const GE=`in vec3 position3DHigh;
4506
4506
  in vec3 position3DLow;
4507
4507
  in float batchId;
4508
4508
 
@@ -4616,7 +4616,7 @@ void main(void)
4616
4616
  #endif
4617
4617
  czm_writeDepthClamp();
4618
4618
  }
4619
- `,ud={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};ud.NUMBER_OF_CLASSIFICATION_TYPES=3;const pi=Object.freeze(ud),HE={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},dd=Object.freeze(HE);function WE(e,t){if(!h(e))throw new C("array is required.");if(!h(t)||t<1)throw new C("numberOfArrays must be greater than 0.");const n=[],i=e.length;let o=0;for(;o<i;){const s=Math.ceil((i-o)/t--);n.push(e.slice(o,o+s)),o+=s}return n}function mi(e,t,n){if(!h(e))throw new C("context is required");if(!h(t))throw new C("attributes is required");if(!h(n))throw new C("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;const i=jE(t),o=e.floatingPointTexture,s=i===pe.FLOAT&&!o,a=YE(t,s),c=XE(a,t,s),l=Math.floor(Ee.maximumTextureSize/c),u=Math.min(n,l),d=c*u,p=Math.ceil(n/u),g=1/d,y=g*.5,x=1/p,E=x*.5;this._textureDimensions=new U(d,p),this._textureStep=new Y(g,y,x,E),this._pixelDatatype=s?pe.UNSIGNED_BYTE:i,this._packFloats=s,this._offsets=a,this._stride=c,this._texture=void 0;const b=4*d*p;this._batchValues=i===pe.FLOAT&&!s?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(mi.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function jE(e){let t=!1;const n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==oe.UNSIGNED_BYTE){t=!0;break}return t?pe.FLOAT:pe.UNSIGNED_BYTE}function pd(e,t){const n=e[t].componentsPerAttribute;return n===2?U:n===3?f:n===4?Y:Number}function YE(e,t){const n=new Array(e.length);let i=0;const o=e.length;for(let s=0;s<o;++s){const c=e[s].componentDatatype;n[s]=i,c!==oe.UNSIGNED_BYTE&&t?i+=4:++i}return n}function XE(e,t,n){const i=e.length,o=e[i-1];return t[i-1].componentDatatype!==oe.UNSIGNED_BYTE&&n?o+4:o+1}const gr=new Y;function $E(e,t,n){let i=Y.unpack(e,t,gr);const o=Y.unpackFloat(i);i=Y.unpack(e,t+4,gr);const s=Y.unpackFloat(i);i=Y.unpack(e,t+8,gr);const a=Y.unpackFloat(i);i=Y.unpack(e,t+12,gr);const c=Y.unpackFloat(i);return Y.fromElements(o,s,a,c,n)}function ZE(e,t,n){let i=Y.packFloat(e.x,gr);Y.pack(i,t,n),i=Y.packFloat(e.y,i),Y.pack(i,t,n+4),i=Y.packFloat(e.z,i),Y.pack(i,t,n+8),i=Y.packFloat(e.w,i),Y.pack(i,t,n+12)}const md=new Y;mi.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");const i=this._attributes,o=this._offsets[t],a=4*this._stride*e+4*o;let c;this._packFloats&&i[t].componentDatatype!==pe.UNSIGNED_BYTE?c=$E(this._batchValues,a,md):c=Y.unpack(this._batchValues,a,md);const l=pd(i,t);return h(l.fromCartesian4)?l.fromCartesian4(c,n):h(l.clone)?l.clone(c,n):c.x};const KE=[void 0,void 0,new U,new f,new Y],QE=new Y;mi.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");if(!h(n))throw new C("value is required.");const i=this._attributes,o=KE[i[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,o),a=pd(this._attributes,t);if(h(a.equals)?a.equals(s,n):s===n)return;const l=QE;l.x=h(n.x)?n.x:n,l.y=h(n.y)?n.y:0,l.z=h(n.z)?n.z:0,l.w=h(n.w)?n.w:0;const u=this._offsets[t],p=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==pe.UNSIGNED_BYTE?ZE(l,this._batchValues,p):Y.pack(l,this._batchValues,p),this._batchValuesDirty=!0};function JE(e,t){const n=e._textureDimensions;e._texture=new Nt({context:t,pixelFormat:de.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Yn.NEAREST,flipY:!1})}function eb(e){const t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}mi.prototype.update=function(e){h(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,h(this._texture)||JE(this,e.context),eb(this))},mi.prototype.getUniformMapCallback=function(){const e=this;return function(t){return e._attributes.length===0?t:nn(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function tb(e){const t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
4619
+ `,ud={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};ud.NUMBER_OF_CLASSIFICATION_TYPES=3;const mi=Object.freeze(ud),HE={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},dd=Object.freeze(HE);function WE(e,t){if(!h(e))throw new C("array is required.");if(!h(t)||t<1)throw new C("numberOfArrays must be greater than 0.");const n=[],i=e.length;let o=0;for(;o<i;){const s=Math.ceil((i-o)/t--);n.push(e.slice(o,o+s)),o+=s}return n}function _i(e,t,n){if(!h(e))throw new C("context is required");if(!h(t))throw new C("attributes is required");if(!h(n))throw new C("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;const i=jE(t),o=e.floatingPointTexture,s=i===pe.FLOAT&&!o,a=YE(t,s),c=XE(a,t,s),l=Math.floor(Ee.maximumTextureSize/c),u=Math.min(n,l),d=c*u,p=Math.ceil(n/u),g=1/d,y=g*.5,x=1/p,E=x*.5;this._textureDimensions=new U(d,p),this._textureStep=new Y(g,y,x,E),this._pixelDatatype=s?pe.UNSIGNED_BYTE:i,this._packFloats=s,this._offsets=a,this._stride=c,this._texture=void 0;const b=4*d*p;this._batchValues=i===pe.FLOAT&&!s?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(_i.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function jE(e){let t=!1;const n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==oe.UNSIGNED_BYTE){t=!0;break}return t?pe.FLOAT:pe.UNSIGNED_BYTE}function pd(e,t){const n=e[t].componentsPerAttribute;return n===2?U:n===3?f:n===4?Y:Number}function YE(e,t){const n=new Array(e.length);let i=0;const o=e.length;for(let s=0;s<o;++s){const c=e[s].componentDatatype;n[s]=i,c!==oe.UNSIGNED_BYTE&&t?i+=4:++i}return n}function XE(e,t,n){const i=e.length,o=e[i-1];return t[i-1].componentDatatype!==oe.UNSIGNED_BYTE&&n?o+4:o+1}const gr=new Y;function $E(e,t,n){let i=Y.unpack(e,t,gr);const o=Y.unpackFloat(i);i=Y.unpack(e,t+4,gr);const s=Y.unpackFloat(i);i=Y.unpack(e,t+8,gr);const a=Y.unpackFloat(i);i=Y.unpack(e,t+12,gr);const c=Y.unpackFloat(i);return Y.fromElements(o,s,a,c,n)}function ZE(e,t,n){let i=Y.packFloat(e.x,gr);Y.pack(i,t,n),i=Y.packFloat(e.y,i),Y.pack(i,t,n+4),i=Y.packFloat(e.z,i),Y.pack(i,t,n+8),i=Y.packFloat(e.w,i),Y.pack(i,t,n+12)}const md=new Y;_i.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");const i=this._attributes,o=this._offsets[t],a=4*this._stride*e+4*o;let c;this._packFloats&&i[t].componentDatatype!==pe.UNSIGNED_BYTE?c=$E(this._batchValues,a,md):c=Y.unpack(this._batchValues,a,md);const l=pd(i,t);return h(l.fromCartesian4)?l.fromCartesian4(c,n):h(l.clone)?l.clone(c,n):c.x};const KE=[void 0,void 0,new U,new f,new Y],QE=new Y;_i.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");if(!h(n))throw new C("value is required.");const i=this._attributes,o=KE[i[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,o),a=pd(this._attributes,t);if(h(a.equals)?a.equals(s,n):s===n)return;const l=QE;l.x=h(n.x)?n.x:n,l.y=h(n.y)?n.y:0,l.z=h(n.z)?n.z:0,l.w=h(n.w)?n.w:0;const u=this._offsets[t],p=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==pe.UNSIGNED_BYTE?ZE(l,this._batchValues,p):Y.pack(l,this._batchValues,p),this._batchValuesDirty=!0};function JE(e,t){const n=e._textureDimensions;e._texture=new Nt({context:t,pixelFormat:de.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Yn.NEAREST,flipY:!1})}function eb(e){const t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}_i.prototype.update=function(e){h(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,h(this._texture)||JE(this,e.context),eb(this))},_i.prototype.getUniformMapCallback=function(){const e=this;return function(t){return e._attributes.length===0?t:nn(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function tb(e){const t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
4620
4620
  vec2 computeSt(float batchId)
4621
4621
  {
4622
4622
  float stepX = batchTextureStep.x;
@@ -4652,11 +4652,11 @@ textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureSte
4652
4652
  `:e._pixelDatatype===pe.FLOAT&&i.componentDatatype===oe.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
4653
4653
  `),u+=` return value;
4654
4654
  }
4655
- `,u}mi.prototype.getVertexShaderCallback=function(){const e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
4655
+ `,u}_i.prototype.getVertexShaderCallback=function(){const e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
4656
4656
  `;t+=`${tb(this)}
4657
4657
  `;const n=e.length;for(let i=0;i<n;++i)t+=ob(this,i);return function(i){const o=i.indexOf("void main"),s=i.substring(0,o),a=i.substring(o);return`${s}
4658
4658
  ${t}
4659
- ${a}`}},mi.prototype.isDestroyed=function(){return!1},mi.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),Qe(this)};const Ue={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ue.getMathType=function(e){switch(e){case Ue.SCALAR:return Number;case Ue.VEC2:return U;case Ue.VEC3:return f;case Ue.VEC4:return Y;case Ue.MAT2:return ae;case Ue.MAT3:return L;case Ue.MAT4:return N;default:throw new C("attributeType is not a valid value.")}},Ue.getNumberOfComponents=function(e){switch(e){case Ue.SCALAR:return 1;case Ue.VEC2:return 2;case Ue.VEC3:return 3;case Ue.VEC4:case Ue.MAT2:return 4;case Ue.MAT3:return 9;case Ue.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}},Ue.getAttributeLocationCount=function(e){switch(e){case Ue.SCALAR:case Ue.VEC2:case Ue.VEC3:case Ue.VEC4:return 1;case Ue.MAT2:return 2;case Ue.MAT3:return 3;case Ue.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}},Ue.getGlslType=function(e){switch(m.typeOf.string("attributeType",e),e){case Ue.SCALAR:return"float";case Ue.VEC2:return"vec2";case Ue.VEC3:return"vec3";case Ue.VEC4:return"vec4";case Ue.MAT2:return"mat2";case Ue.MAT3:return"mat3";case Ue.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};const rb=Object.freeze(Ue),_d=1/256,gd=256,Te={};Te.octEncodeInRange=function(e,t,n){m.defined("vector",e),m.defined("result",n);const i=f.magnitudeSquared(e);if(Math.abs(i-1)>S.EPSILON6)throw new C("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 o=n.x,s=n.y;n.x=(1-Math.abs(s))*S.signNotZero(o),n.y=(1-Math.abs(o))*S.signNotZero(s)}return n.x=S.toSNorm(n.x,t),n.y=S.toSNorm(n.y,t),n},Te.octEncode=function(e,t){return Te.octEncodeInRange(e,255,t)};const yr=new U,yd=new Uint8Array(1);function ea(e){return yd[0]=e,yd[0]}Te.octEncodeToCartesian4=function(e,t){return Te.octEncodeInRange(e,65535,yr),t.x=ea(yr.x*_d),t.y=ea(yr.x),t.z=ea(yr.y*_d),t.w=ea(yr.y),t},Te.octDecodeInRange=function(e,t,n,i){if(m.defined("result",i),e<0||e>n||t<0||t>n)throw new C(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=S.fromSNorm(e,n),i.y=S.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const o=i.x;i.x=(1-Math.abs(i.y))*S.signNotZero(o),i.y=(1-Math.abs(o))*S.signNotZero(i.y)}return f.normalize(i,i)},Te.octDecode=function(e,t,n){return Te.octDecodeInRange(e,t,255,n)},Te.octDecodeFromCartesian4=function(e,t){m.typeOf.object("encoded",e),m.typeOf.object("result",t);const n=e.x,i=e.y,o=e.z,s=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||s<0||s>255)throw new C("x, y, z, and w must be unsigned normalized integers between 0 and 255");const a=n*gd+i,c=o*gd+s;return Te.octDecodeInRange(a,c,65535,t)},Te.octPackFloat=function(e){return m.defined("encoded",e),256*e.x+e.y};const Kc=new U;Te.octEncodeFloat=function(e){return Te.octEncode(e,Kc),Te.octPackFloat(Kc)},Te.octDecodeFloat=function(e,t){m.defined("value",e);const n=e/256,i=Math.floor(n),o=(n-i)*256;return Te.octDecode(i,o,t)},Te.octPack=function(e,t,n,i){m.defined("v1",e),m.defined("v2",t),m.defined("v3",n),m.defined("result",i);const o=Te.octEncodeFloat(e),s=Te.octEncodeFloat(t),a=Te.octEncode(n,Kc);return i.x=65536*a.x+o,i.y=65536*a.y+s,i},Te.octUnpack=function(e,t,n,i){m.defined("packed",e),m.defined("v1",t),m.defined("v2",n),m.defined("v3",i);let o=e.x/65536;const s=Math.floor(o),a=(o-s)*65536;o=e.y/65536;const c=Math.floor(o),l=(o-c)*65536;Te.octDecodeFloat(a,t),Te.octDecodeFloat(l,n),Te.octDecode(s,c,i)},Te.compressTextureCoordinates=function(e){m.defined("textureCoordinates",e);const t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n},Te.decompressTextureCoordinates=function(e,t){m.defined("compressed",e),m.defined("result",t);const n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function Qc(e){return e>>1^-(e&1)}Te.zigZagDeltaDecode=function(e,t,n){m.defined("uBuffer",e),m.defined("vBuffer",t),m.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),h(n)&&m.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);const i=e.length;let o=0,s=0,a=0;for(let c=0;c<i;++c)o+=Qc(e[c]),s+=Qc(t[c]),e[c]=o,t[c]=s,h(n)&&(a+=Qc(n[c]),n[c]=a)},Te.dequantize=function(e,t,n,i){m.defined("typedArray",e),m.defined("componentDatatype",t),m.defined("type",n),m.defined("count",i);const o=rb.getNumberOfComponents(n);let s;switch(t){case oe.BYTE:s=127;break;case oe.UNSIGNED_BYTE:s=255;break;case oe.SHORT:s=32767;break;case oe.UNSIGNED_SHORT:s=65535;break;case oe.INT:s=2147483647;break;case oe.UNSIGNED_INT:s=4294967295;break;default:throw new C(`Cannot dequantize component datatype: ${t}`)}const a=new Float32Array(i*o);for(let c=0;c<i;c++)for(let l=0;l<o;l++){const u=c*o+l;a[u]=Math.max(e[u]/s,-1)}return a},Te.decodeRGB565=function(e,t){m.defined("typedArray",e);const n=e.length*3;h(t)&&m.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);const i=e.length;h(t)||(t=new Float32Array(i*3));const o=31,s=63,a=1/31,c=1/63;for(let l=0;l<i;l++){const u=e[l],d=u>>11,p=u>>5&s,g=u&o,y=3*l;t[y]=d*a,t[y+1]=p*c,t[y+2]=g*a}return t};const xd=new f,Cd=new f,Ed=new f;function sb(e,t,n,i,o){m.defined("point",e),m.defined("p0",t),m.defined("p1",n),m.defined("p2",i),h(o)||(o=new f);let s,a,c,l,u,d,p,g;if(h(t.z)){if(f.equalsEpsilon(e,t,S.EPSILON14))return f.clone(f.UNIT_X,o);if(f.equalsEpsilon(e,n,S.EPSILON14))return f.clone(f.UNIT_Y,o);if(f.equalsEpsilon(e,i,S.EPSILON14))return f.clone(f.UNIT_Z,o);s=f.subtract(n,t,xd),a=f.subtract(i,t,Cd),c=f.subtract(e,t,Ed),l=f.dot(s,s),u=f.dot(s,a),d=f.dot(s,c),p=f.dot(a,a),g=f.dot(a,c)}else{if(U.equalsEpsilon(e,t,S.EPSILON14))return f.clone(f.UNIT_X,o);if(U.equalsEpsilon(e,n,S.EPSILON14))return f.clone(f.UNIT_Y,o);if(U.equalsEpsilon(e,i,S.EPSILON14))return f.clone(f.UNIT_Z,o);s=U.subtract(n,t,xd),a=U.subtract(i,t,Cd),c=U.subtract(e,t,Ed),l=U.dot(s,s),u=U.dot(s,a),d=U.dot(s,c),p=U.dot(a,a),g=U.dot(a,c)}o.y=p*d-u*g,o.z=l*g-u*d;const y=l*p-u*u;if(y!==0)return o.y/=y,o.z/=y,o.x=1-o.y-o.z,o}const Jc={};Jc.calculateACMR=function(e){e=_(e,_.EMPTY_OBJECT);const t=e.indices;let n=e.maximumIndex;const i=_(e.cacheSize,24);if(!h(t))throw new C("indices is required.");const o=t.length;if(o<3||o%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");if(!h(n)){n=0;let c=0,l=t[c];for(;c<o;)l>n&&(n=l),++c,l=t[c]}const s=[];for(let c=0;c<n+1;c++)s[c]=0;let a=i+1;for(let c=0;c<o;++c)a-s[t[c]]>i&&(s[t[c]]=a,++a);return(a-i+1)/(o/3)},Jc.tipsify=function(e){e=_(e,_.EMPTY_OBJECT);const t=e.indices,n=e.maximumIndex,i=_(e.cacheSize,24);let o;function s(H,j,r,w){for(;j.length>=1;){const v=j[j.length-1];if(j.splice(j.length-1,1),H[v].numLiveTriangles>0)return v}for(;o<w;){if(H[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(H,j,r,w,v,z,G){let W=-1,Z,X=-1,ie=0;for(;ie<r.length;){const se=r[ie];w[se].numLiveTriangles&&(Z=0,v-w[se].timeStamp+2*w[se].numLiveTriangles<=j&&(Z=v-w[se].timeStamp),(Z>X||X===-1)&&(X=Z,W=se)),++ie}return W===-1?s(w,z,H,G):W}if(!h(t))throw new C("indices is required.");const c=t.length;if(c<3||c%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");let l=0,u=0,d=t[u];const p=c;if(h(n))l=n+1;else{for(;u<p;)d>l&&(l=d),++u,d=t[u];if(l===-1)return 0;++l}const g=[];let y;for(y=0;y<l;y++)g[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let x=0;for(;u<p;)g[t[u]].vertexTriangles.push(x),++g[t[u]].numLiveTriangles,g[t[u+1]].vertexTriangles.push(x),++g[t[u+1]].numLiveTriangles,g[t[u+2]].vertexTriangles.push(x),++g[t[u+2]].numLiveTriangles,++x,u+=3;let E=0,b=i+1;o=1;let D=[];const A=[];let O,I,B=0;const M=[],q=c/3,P=[];for(y=0;y<q;y++)P[y]=!1;let V,k;for(;E!==-1;){D=[],I=g[E],k=I.vertexTriangles.length;for(let H=0;H<k;++H)if(x=I.vertexTriangles[H],!P[x]){P[x]=!0,u=x+x+x;for(let j=0;j<3;++j)V=t[u],D.push(V),A.push(V),M[B]=V,++B,O=g[V],--O.numLiveTriangles,b-O.timeStamp>i&&(O.timeStamp=b,++b),++u}E=a(t,i,D,g,b,A,l)}return M};const He={};function ta(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function ab(e){const t=e.length,n=t/3*6,i=Ct.createTypedArray(t,n);let o=0;for(let s=0;s<t;s+=3,o+=6)ta(i,o,e[s],e[s+1],e[s+2]);return i}function cb(e){const t=e.length;if(t>=3){const n=(t-2)*6,i=Ct.createTypedArray(t,n);ta(i,0,e[0],e[1],e[2]);let o=6;for(let s=3;s<t;++s,o+=6)ta(i,o,e[s-1],e[s],e[s-2]);return i}return new Uint16Array}function lb(e){if(e.length>0){const t=e.length-1,n=(t-1)*6,i=Ct.createTypedArray(t,n),o=e[0];let s=0;for(let a=1;a<t;++a,s+=6)ta(i,s,o,e[a],e[a+1]);return i}return new Uint16Array}He.toWireframe=function(e){if(!h(e))throw new C("geometry is required.");const t=e.indices;if(h(t)){switch(e.primitiveType){case qe.TRIANGLES:e.indices=ab(t);break;case qe.TRIANGLE_STRIP:e.indices=cb(t);break;case qe.TRIANGLE_FAN:e.indices=lb(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=qe.LINES}return e},He.createLineSegmentsForVectors=function(e,t,n){if(t=_(t,"normal"),!h(e))throw new C("geometry is required.");if(!h(e.attributes.position))throw new C("geometry.attributes.position is required.");if(!h(e.attributes[t]))throw new C(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=_(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,s=i.length,a=new Float64Array(2*s);let c=0;for(let d=0;d<s;d+=3)a[c++]=i[d],a[c++]=i[d+1],a[c++]=i[d+2],a[c++]=i[d]+o[d]*n,a[c++]=i[d+1]+o[d+1]*n,a[c++]=i[d+2]+o[d+2]*n;let l;const u=e.boundingSphere;return h(u)&&(l=new K(u.center,u.radius+n)),new ht({attributes:{position:new Bt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:qe.LINES,boundingSphere:l})},He.createAttributeLocations=function(e){if(!h(e))throw new C("geometry is required.");const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let o=0,s;const a=t.length;for(s=0;s<a;++s){const c=t[s];h(n[c])&&(i[c]=o++)}for(const c in n)n.hasOwnProperty(c)&&!h(i[c])&&(i[c]=o++);return i},He.reorderForPreVertexCache=function(e){if(!h(e))throw new C("geometry is required.");const t=ht.computeNumberOfVertices(e),n=e.indices;if(h(n)){const i=new Int32Array(t);for(let g=0;g<t;g++)i[g]=-1;const o=n,s=o.length,a=Ct.createTypedArray(t,s);let c=0,l=0,u=0,d;for(;c<s;)d=i[o[c]],d!==-1?a[l]=d:(d=o[c],i[d]=u,a[l]=u,++u),++c,++l;e.indices=a;const p=e.attributes;for(const g in p)if(p.hasOwnProperty(g)&&h(p[g])&&h(p[g].values)){const y=p[g],x=y.values;let E=0;const b=y.componentsPerAttribute,D=oe.createTypedArray(y.componentDatatype,u*b);for(;E<t;){const A=i[E];if(A!==-1)for(let O=0;O<b;O++)D[b*A+O]=x[b*E+O];++E}y.values=D}}return e},He.reorderForPostVertexCache=function(e,t){if(!h(e))throw new C("geometry is required.");const n=e.indices;if(e.primitiveType===qe.TRIANGLES&&h(n)){const i=n.length;let o=0;for(let s=0;s<i;s++)n[s]>o&&(o=n[s]);e.indices=Jc.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function bd(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&h(e[n])&&h(e[n].values)){const i=e[n];t[n]=new Bt({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function hb(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&h(t[i])&&h(t[i].values)){const o=t[i];for(let s=0;s<o.componentsPerAttribute;++s)e[i].values.push(o.values[n*o.componentsPerAttribute+s])}}He.fitToUnsignedShortIndices=function(e){if(!h(e))throw new C("geometry is required.");if(h(e.indices)&&e.primitiveType!==qe.TRIANGLES&&e.primitiveType!==qe.LINES&&e.primitiveType!==qe.POINTS)throw new C("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");const t=[],n=ht.computeNumberOfVertices(e);if(h(e.indices)&&n>=S.SIXTY_FOUR_KILOBYTES){let i=[],o=[],s=0,a=bd(e.attributes);const c=e.indices,l=c.length;let u;e.primitiveType===qe.TRIANGLES?u=3:e.primitiveType===qe.LINES?u=2:e.primitiveType===qe.POINTS&&(u=1);for(let d=0;d<l;d+=u){for(let p=0;p<u;++p){const g=c[d+p];let y=i[g];h(y)||(y=s++,i[g]=y,hb(a,e.attributes,g)),o.push(y)}s+u>=S.SIXTY_FOUR_KILOBYTES&&(t.push(new ht({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],s=0,a=bd(e.attributes))}o.length!==0&&t.push(new ht({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const wd=new f,fb=new ee;He.projectTo2D=function(e,t,n,i,o){if(!h(e))throw new C("geometry is required.");if(!h(t))throw new C("attributeName is required.");if(!h(n))throw new C("attributeName3D is required.");if(!h(i))throw new C("attributeName2D is required.");if(!h(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==oe.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const s=e.attributes[t];o=h(o)?o:new Sn;const a=o.ellipsoid,c=s.values,l=new Float64Array(c.length);let u=0;for(let d=0;d<c.length;d+=3){const p=f.fromArray(c,d,wd),g=a.cartesianToCartographic(p,fb);if(!h(g))throw new C(`Could not project point (${p.x}, ${p.y}, ${p.z}) to 2D.`);const y=o.project(g,wd);l[u++]=y.x,l[u++]=y.y,l[u++]=y.z}return e.attributes[n]=s,e.attributes[i]=new Bt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};const el={high:0,low:0};He.encodeAttribute=function(e,t,n,i){if(!h(e))throw new C("geometry is required.");if(!h(t))throw new C("attributeName is required.");if(!h(n))throw new C("attributeHighName is required.");if(!h(i))throw new C("attributeLowName is required.");if(!h(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==oe.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const o=e.attributes[t],s=o.values,a=s.length,c=new Float32Array(a),l=new Float32Array(a);for(let d=0;d<a;++d)Ye.encode(s[d],el),c[d]=el.high,l[d]=el.low;const u=o.componentsPerAttribute;return e.attributes[n]=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:c}),e.attributes[i]=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};let Pn=new f;function tl(e,t){if(h(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)f.unpack(n,o,Pn),N.multiplyByPoint(e,Pn,Pn),f.pack(Pn,n,o)}}function nl(e,t){if(h(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)f.unpack(n,o,Pn),L.multiplyByVector(e,Pn,Pn),Pn=f.normalize(Pn,Pn),f.pack(Pn,n,o)}}const na=new N,ia=new L;He.transformToWorldCoordinates=function(e){if(!h(e))throw new C("instance is required.");const t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;const n=e.geometry.attributes;tl(t,n.position),tl(t,n.prevPosition),tl(t,n.nextPosition),(h(n.normal)||h(n.tangent)||h(n.bitangent))&&(N.inverse(t,na),N.transpose(na,na),N.getMatrix3(na,ia),nl(ia,n.normal),nl(ia,n.tangent),nl(ia,n.bitangent));const i=e.geometry.boundingSphere;return h(i)&&(e.geometry.boundingSphere=K.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function ub(e,t){const n=e.length,i={},o=e[0][t].attributes;let s;for(s in o)if(o.hasOwnProperty(s)&&h(o[s])&&h(o[s].values)){const a=o[s];let c=a.values.length,l=!0;for(let u=1;u<n;++u){const d=e[u][t].attributes[s];if(!h(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){l=!1;break}c+=d.values.length}l&&(i[s]=new Bt({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:oe.createTypedArray(a.componentDatatype,c)}))}return i}const db=new f;function il(e,t){const n=e.length;let i,o,s,a;const c=e[0].modelMatrix,l=h(e[0][t].indices),u=e[0][t].primitiveType;for(o=1;o<n;++o){if(!N.equals(e[o].modelMatrix,c))throw new C("All instances must have the same modelMatrix.");if(h(e[o][t].indices)!==l)throw new C("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==u)throw new C("All instance geometries must have the same primitiveType.")}const d=ub(e,t);let p,g,y;for(i in d)if(d.hasOwnProperty(i))for(p=d[i].values,a=0,o=0;o<n;++o)for(g=e[o][t].attributes[i].values,y=g.length,s=0;s<y;++s)p[a++]=g[s];let x;if(l){let A=0;for(o=0;o<n;++o)A+=e[o][t].indices.length;const O=ht.computeNumberOfVertices(new ht({attributes:d,primitiveType:qe.POINTS})),I=Ct.createTypedArray(O,A);let B=0,M=0;for(o=0;o<n;++o){const q=e[o][t].indices,P=q.length;for(a=0;a<P;++a)I[B++]=M+q[a];M+=ht.computeNumberOfVertices(e[o][t])}x=I}let E=new f,b=0,D;for(o=0;o<n;++o){if(D=e[o][t].boundingSphere,!h(D)){E=void 0;break}f.add(D.center,E,E)}if(h(E))for(f.divideByScalar(E,n,E),o=0;o<n;++o){D=e[o][t].boundingSphere;const A=f.magnitude(f.subtract(D.center,E,db))+D.radius;A>b&&(b=A)}return new ht({attributes:d,indices:x,primitiveType:u,boundingSphere:h(E)?new K(E,b):void 0})}He.combineInstances=function(e){if(!h(e)||e.length<1)throw new C("instances is required and must have length greater than zero.");const t=[],n=[],i=e.length;for(let s=0;s<i;++s){const a=e[s];h(a.geometry)?t.push(a):h(a.westHemisphereGeometry)&&h(a.eastHemisphereGeometry)&&n.push(a)}const o=[];return t.length>0&&o.push(il(t,"geometry")),n.length>0&&(o.push(il(n,"westHemisphereGeometry")),o.push(il(n,"eastHemisphereGeometry"))),o};const Cn=new f,xr=new f,Lo=new f,Mo=new f;He.computeNormal=function(e){if(!h(e))throw new C("geometry is required.");if(!h(e.attributes.position)||!h(e.attributes.position.values))throw new C("geometry.attributes.position.values is required.");if(!h(e.indices))throw new C("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==qe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,s=t.length,a=new Array(o),c=new Array(s/3),l=new Array(s);let u;for(u=0;u<o;u++)a[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<s;u+=3){const x=t[u],E=t[u+1],b=t[u+2],D=x*3,A=E*3,O=b*3;xr.x=i[D],xr.y=i[D+1],xr.z=i[D+2],Lo.x=i[A],Lo.y=i[A+1],Lo.z=i[A+2],Mo.x=i[O],Mo.y=i[O+1],Mo.z=i[O+2],a[x].count++,a[E].count++,a[b].count++,f.subtract(Lo,xr,Lo),f.subtract(Mo,xr,Mo),c[d]=f.cross(Lo,Mo,new f),d++}let p=0;for(u=0;u<o;u++)a[u].indexOffset+=p,p+=a[u].count;d=0;let g;for(u=0;u<s;u+=3){g=a[t[u]];let x=g.indexOffset+g.currentCount;l[x]=d,g.currentCount++,g=a[t[u+1]],x=g.indexOffset+g.currentCount,l[x]=d,g.currentCount++,g=a[t[u+2]],x=g.indexOffset+g.currentCount,l[x]=d,g.currentCount++,d++}const y=new Float32Array(o*3);for(u=0;u<o;u++){const x=u*3;if(g=a[u],f.clone(f.ZERO,Cn),g.count>0){for(d=0;d<g.count;d++)f.add(Cn,c[l[g.indexOffset+d]],Cn);f.equalsEpsilon(f.ZERO,Cn,S.EPSILON10)&&f.clone(c[l[g.indexOffset]],Cn)}f.equalsEpsilon(f.ZERO,Cn,S.EPSILON10)&&(Cn.z=1),f.normalize(Cn,Cn),y[x]=Cn.x,y[x+1]=Cn.y,y[x+2]=Cn.z}return e.attributes.normal=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e};const pb=new f,Td=new f,mb=new f;He.computeTangentAndBitangent=function(e){if(!h(e))throw new C("geometry is required.");const t=e.attributes,n=e.indices;if(!h(t.position)||!h(t.position.values))throw new C("geometry.attributes.position.values is required.");if(!h(t.normal)||!h(t.normal.values))throw new C("geometry.attributes.normal.values is required.");if(!h(t.st)||!h(t.st.values))throw new C("geometry.attributes.st.values is required.");if(!h(n))throw new C("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==qe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const i=e.attributes.position.values,o=e.attributes.normal.values,s=e.attributes.st.values,a=e.attributes.position.values.length/3,c=n.length,l=new Array(a*3);let u;for(u=0;u<l.length;u++)l[u]=0;let d,p,g;for(u=0;u<c;u+=3){const E=n[u],b=n[u+1],D=n[u+2];d=E*3,p=b*3,g=D*3;const A=E*2,O=b*2,I=D*2,B=i[d],M=i[d+1],q=i[d+2],P=s[A],V=s[A+1],k=s[O+1]-V,H=s[I+1]-V,j=1/((s[O]-P)*H-(s[I]-P)*k),r=(H*(i[p]-B)-k*(i[g]-B))*j,w=(H*(i[p+1]-M)-k*(i[g+1]-M))*j,v=(H*(i[p+2]-q)-k*(i[g+2]-q))*j;l[d]+=r,l[d+1]+=w,l[d+2]+=v,l[p]+=r,l[p+1]+=w,l[p+2]+=v,l[g]+=r,l[g+1]+=w,l[g+2]+=v}const y=new Float32Array(a*3),x=new Float32Array(a*3);for(u=0;u<a;u++){d=u*3,p=d+1,g=d+2;const E=f.fromArray(o,d,pb),b=f.fromArray(l,d,mb),D=f.dot(E,b);f.multiplyByScalar(E,D,Td),f.normalize(f.subtract(b,Td,b),b),y[d]=b.x,y[p]=b.y,y[g]=b.z,f.normalize(f.cross(E,b,b),b),x[d]=b.x,x[p]=b.y,x[g]=b.z}return e.attributes.tangent=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:x}),e};const Cr=new U,Bn=new f,Sd=new f,Ad=new f;let oa=new U;He.compressVertices=function(e){if(!h(e))throw new C("geometry is required.");const t=e.attributes.extrudeDirection;let n,i;if(h(t)){const M=t.values;i=M.length/3;const q=new Float32Array(i*2);let P=0;for(n=0;n<i;++n){if(f.fromArray(M,n*3,Bn),f.equals(Bn,f.ZERO)){P+=2;continue}oa=Te.octEncodeInRange(Bn,65535,oa),q[P++]=oa.x,q[P++]=oa.y}return e.attributes.compressedAttributes=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,values:q}),delete e.attributes.extrudeDirection,e}const o=e.attributes.normal,s=e.attributes.st,a=h(o),c=h(s);if(!a&&!c)return e;const l=e.attributes.tangent,u=e.attributes.bitangent,d=h(l),p=h(u);let g,y,x,E;a&&(g=o.values),c&&(y=s.values),d&&(x=l.values),p&&(E=u.values),i=(a?g.length:y.length)/(a?3:2);let A=i,O=c&&a?2:1;O+=d||p?1:0,A*=O;const I=new Float32Array(A);let B=0;for(n=0;n<i;++n){c&&(U.fromArray(y,n*2,Cr),I[B++]=Te.compressTextureCoordinates(Cr));const M=n*3;a&&h(x)&&h(E)?(f.fromArray(g,M,Bn),f.fromArray(x,M,Sd),f.fromArray(E,M,Ad),Te.octPack(Bn,Sd,Ad,Cr),I[B++]=Cr.x,I[B++]=Cr.y):(a&&(f.fromArray(g,M,Bn),I[B++]=Te.octEncodeFloat(Bn)),d&&(f.fromArray(x,M,Bn),I[B++]=Te.octEncodeFloat(Bn)),p&&(f.fromArray(E,M,Bn),I[B++]=Te.octEncodeFloat(Bn)))}return e.attributes.compressedAttributes=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:O,values:I}),a&&delete e.attributes.normal,c&&delete e.attributes.st,p&&delete e.attributes.bitangent,d&&delete e.attributes.tangent,e};function _b(e){if(h(e.indices))return e;const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");if(t%3!==0)throw new C("The number of vertices must be a multiple of three.");const n=Ct.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function gb(e){const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");const n=Ct.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=qe.TRIANGLES,e}function yb(e){const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");const n=Ct.createTypedArray(t,(t-2)*3);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 o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=qe.TRIANGLES,e}function xb(e){if(h(e.indices))return e;const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");if(t%2!==0)throw new C("The number of vertices must be a multiple of 2.");const n=Ct.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Cb(e){const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=Ct.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=qe.LINES,e}function Eb(e){const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=Ct.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=qe.LINES,e}function bb(e){switch(e.primitiveType){case qe.TRIANGLE_FAN:return gb(e);case qe.TRIANGLE_STRIP:return yb(e);case qe.TRIANGLES:return _b(e);case qe.LINE_STRIP:return Cb(e);case qe.LINE_LOOP:return Eb(e);case qe.LINES:return xb(e)}return e}function Mi(e,t){Math.abs(e.y)<S.EPSILON6&&(t?e.y=-S.EPSILON6:e.y=S.EPSILON6)}function wb(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Mi(e,e.y<0),Mi(t,t.y<0),Mi(n,n.y<0);return}const i=Math.abs(e.y),o=Math.abs(t.y),s=Math.abs(n.y);let a;i>o?i>s?a=S.sign(e.y):a=S.sign(n.y):o>s?a=S.sign(t.y):a=S.sign(n.y);const c=a<0;Mi(e,c),Mi(t,c),Mi(n,c)}const Dd=new f;function En(e,t,n,i){f.add(e,f.multiplyByScalar(f.subtract(t,e,Dd),e.y/(e.y-t.y),Dd),n),f.clone(n,i),Mi(n,!0),Mi(i,!1)}const io=new f,oo=new f,ro=new f,so=new f,ol={positions:new Array(7),indices:new Array(3*3)};function Tb(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;wb(e,t,n);const i=e.y<0,o=t.y<0,s=n.y<0;let a=0;a+=i?1:0,a+=o?1:0,a+=s?1:0;const c=ol.indices;a===1?(c[1]=3,c[2]=4,c[5]=6,c[7]=6,c[8]=5,i?(En(e,t,io,ro),En(e,n,oo,so),c[0]=0,c[3]=1,c[4]=2,c[6]=1):o?(En(t,n,io,ro),En(t,e,oo,so),c[0]=1,c[3]=2,c[4]=0,c[6]=2):s&&(En(n,e,io,ro),En(n,t,oo,so),c[0]=2,c[3]=0,c[4]=1,c[6]=0)):a===2&&(c[2]=4,c[4]=4,c[5]=3,c[7]=5,c[8]=6,i?o?s||(En(n,e,io,ro),En(n,t,oo,so),c[0]=0,c[1]=1,c[3]=0,c[6]=2):(En(t,n,io,ro),En(t,e,oo,so),c[0]=2,c[1]=0,c[3]=2,c[6]=1):(En(e,t,io,ro),En(e,n,oo,so),c[0]=1,c[1]=2,c[3]=1,c[6]=0));const l=ol.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(a===1||a===2)&&(l[3]=io,l[4]=oo,l[5]=ro,l[6]=so,l.length=7),ol}function Od(e,t){const n=e.attributes;if(n.position.values.length===0)return;for(const o in n)if(n.hasOwnProperty(o)&&h(n[o])&&h(n[o].values)){const s=n[o];s.values=oe.createTypedArray(s.componentDatatype,s.values)}const i=ht.computeNumberOfVertices(e);return e.indices=Ct.createTypedArray(i,e.indices),t&&(e.boundingSphere=K.fromVertices(n.position.values)),e}function Uo(e){const t=e.attributes,n={};for(const i in t)if(t.hasOwnProperty(i)&&h(t[i])&&h(t[i].values)){const o=t[i];n[i]=new Bt({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function rl(e,t,n){const i=h(e.geometry.boundingSphere);t=Od(t,i),n=Od(n,i),h(n)&&!h(t)?e.geometry=n:!h(n)&&h(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function sl(e,t){const n=new e,i=new e,o=new e;return function(s,a,c,l,u,d,p,g){const y=e.fromArray(u,s*t,n),x=e.fromArray(u,a*t,i),E=e.fromArray(u,c*t,o);e.multiplyByScalar(y,l.x,y),e.multiplyByScalar(x,l.y,x),e.multiplyByScalar(E,l.z,E);const b=e.add(y,x,y);e.add(b,E,b),g&&e.normalize(b,b),e.pack(b,d,p*t)}}const Sb=sl(Y,4),ra=sl(f,3),vd=sl(U,2),Ab=function(e,t,n,i,o,s,a){const c=o[e]*i.x,l=o[t]*i.y,u=o[n]*i.z;s[a]=c+l+u>S.EPSILON6?1:0},Er=new f,al=new f,cl=new f,Db=new f;function sa(e,t,n,i,o,s,a,c,l,u,d,p,g,y,x,E){if(!h(s)&&!h(a)&&!h(c)&&!h(l)&&!h(u)&&y===0)return;const b=f.fromArray(o,e*3,Er),D=f.fromArray(o,t*3,al),A=f.fromArray(o,n*3,cl),O=sb(i,b,D,A,Db);if(h(O)){if(h(s)&&ra(e,t,n,O,s,p.normal.values,E,!0),h(u)){const I=f.fromArray(u,e*3,Er),B=f.fromArray(u,t*3,al),M=f.fromArray(u,n*3,cl);f.multiplyByScalar(I,O.x,I),f.multiplyByScalar(B,O.y,B),f.multiplyByScalar(M,O.z,M);let q;!f.equals(I,f.ZERO)||!f.equals(B,f.ZERO)||!f.equals(M,f.ZERO)?(q=f.add(I,B,I),f.add(q,M,q),f.normalize(q,q)):(q=Er,q.x=0,q.y=0,q.z=0),f.pack(q,p.extrudeDirection.values,E*3)}if(h(d)&&Ab(e,t,n,O,d,p.applyOffset.values,E),h(a)&&ra(e,t,n,O,a,p.tangent.values,E,!0),h(c)&&ra(e,t,n,O,c,p.bitangent.values,E,!0),h(l)&&vd(e,t,n,O,l,p.st.values,E),y>0)for(let I=0;I<y;I++){const B=g[I];Ob(e,t,n,O,E,x[B],p[B])}}}function Ob(e,t,n,i,o,s,a){const c=s.componentsPerAttribute,l=s.values,u=a.values;switch(c){case 4:Sb(e,t,n,i,l,u,o,!1);break;case 3:ra(e,t,n,i,l,u,o,!1);break;case 2:vd(e,t,n,i,l,u,o,!1);break;default:u[o]=l[e]*i.x+l[t]*i.y+l[n]*i.z}}function Qn(e,t,n,i,o,s){const a=e.position.values.length/3;if(o!==-1){const c=i[o],l=n[c];return l===-1?(n[c]=a,e.position.values.push(s.x,s.y,s.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(s.x,s.y,s.z),t.push(a),a}const vb={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Id(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=h(n.normal)?n.normal.values:void 0,s=h(n.bitangent)?n.bitangent.values:void 0,a=h(n.tangent)?n.tangent.values:void 0,c=h(n.st)?n.st.values:void 0,l=h(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=h(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,p=[];for(const q in n)n.hasOwnProperty(q)&&!vb[q]&&h(n[q])&&p.push(q);const g=p.length,y=Uo(t),x=Uo(t);let E,b,D,A,O;const I=[];I.length=i.length/3;const B=[];for(B.length=i.length/3,O=0;O<I.length;++O)I[O]=-1,B[O]=-1;const M=d.length;for(O=0;O<M;O+=3){const q=d[O],P=d[O+1],V=d[O+2];let k=f.fromArray(i,q*3),H=f.fromArray(i,P*3),j=f.fromArray(i,V*3);const r=Tb(k,H,j);if(h(r)&&r.positions.length>3){const w=r.positions,v=r.indices,z=v.length;for(let G=0;G<z;++G){const W=v[G],Z=w[W];Z.y<0?(E=x.attributes,b=x.indices,D=I):(E=y.attributes,b=y.indices,D=B),A=Qn(E,b,D,d,W<3?O+W:-1,Z),sa(q,P,V,Z,i,o,a,s,c,l,u,E,p,g,n,A)}}else h(r)&&(k=r.positions[0],H=r.positions[1],j=r.positions[2]),k.y<0?(E=x.attributes,b=x.indices,D=I):(E=y.attributes,b=y.indices,D=B),A=Qn(E,b,D,d,O,k),sa(q,P,V,k,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,b,D,d,O+1,H),sa(q,P,V,H,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,b,D,d,O+2,j),sa(q,P,V,j,i,o,a,s,c,l,u,E,p,g,n,A)}rl(e,x,y)}const Rd=Ne.fromPointNormal(f.ZERO,f.UNIT_Y),Ib=new f,Rb=new f;function ko(e,t,n,i,o,s,a){if(!h(a))return;const c=f.fromArray(i,e*3,Er);f.equalsEpsilon(c,n,S.EPSILON10)?s.applyOffset.values[o]=a[e]:s.applyOffset.values[o]=a[t]}function zd(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=h(n.applyOffset)?n.applyOffset.values:void 0,s=t.indices,a=Uo(t),c=Uo(t);let l;const u=s.length,d=[];d.length=i.length/3;const p=[];for(p.length=i.length/3,l=0;l<d.length;++l)d[l]=-1,p[l]=-1;for(l=0;l<u;l+=2){const g=s[l],y=s[l+1],x=f.fromArray(i,g*3,Er),E=f.fromArray(i,y*3,al);let b;Math.abs(x.y)<S.EPSILON6&&(x.y<0?x.y=-S.EPSILON6:x.y=S.EPSILON6),Math.abs(E.y)<S.EPSILON6&&(E.y<0?E.y=-S.EPSILON6:E.y=S.EPSILON6);let D=a.attributes,A=a.indices,O=p,I=c.attributes,B=c.indices,M=d;const q=Fe.lineSegmentPlane(x,E,Rd,cl);if(h(q)){const P=f.multiplyByScalar(f.UNIT_Y,5*S.EPSILON9,Ib);x.y<0&&(f.negate(P,P),D=c.attributes,A=c.indices,O=d,I=a.attributes,B=a.indices,M=p);const V=f.add(q,P,Rb);b=Qn(D,A,O,s,l,x),ko(g,y,x,i,b,D,o),b=Qn(D,A,O,s,-1,V),ko(g,y,V,i,b,D,o),f.negate(P,P),f.add(q,P,V),b=Qn(I,B,M,s,-1,V),ko(g,y,V,i,b,I,o),b=Qn(I,B,M,s,l+1,E),ko(g,y,E,i,b,I,o)}else{let P,V,k;x.y<0?(P=c.attributes,V=c.indices,k=d):(P=a.attributes,V=a.indices,k=p),b=Qn(P,V,k,s,l,x),ko(g,y,x,i,b,P,o),b=Qn(P,V,k,s,l+1,E),ko(g,y,E,i,b,P,o)}}rl(e,c,a)}const Pd=new U,zb=new U,Bd=new f,Nd=new f,ll=new f,Pb=new f,Bb=new f,Nb=new f,Fd=new Y;function Ld(e){const t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,s=n.length;for(let a=0;a<s;a+=3){const c=f.unpack(n,a,Bd);if(c.x>0)continue;const l=f.unpack(i,a,Nd);(c.y<0&&l.y>0||c.y>0&&l.y<0)&&(a-3>0?(i[a]=n[a-3],i[a+1]=n[a-2],i[a+2]=n[a-1]):f.pack(c,i,a));const u=f.unpack(o,a,ll);(c.y<0&&u.y>0||c.y>0&&u.y<0)&&(a+3<s?(o[a]=n[a+3],o[a+1]=n[a+4],o[a+2]=n[a+5]):f.pack(c,o,a))}}const Fb=5*S.EPSILON9,aa=S.EPSILON6;function Lb(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,s=n.nextPosition.values,a=n.expandAndWidth.values,c=h(n.st)?n.st.values:void 0,l=h(n.color)?n.color.values:void 0,u=Uo(t),d=Uo(t);let p,g,y,x=!1;const E=i.length/3;for(p=0;p<E;p+=4){const b=p,D=p+2,A=f.fromArray(i,b*3,Bd),O=f.fromArray(i,D*3,Nd);if(Math.abs(A.y)<aa)for(A.y=aa*(O.y<0?-1:1),i[p*3+1]=A.y,i[(p+1)*3+1]=A.y,g=b*3;g<b*3+4*3;g+=3)o[g]=i[p*3],o[g+1]=i[p*3+1],o[g+2]=i[p*3+2];if(Math.abs(O.y)<aa)for(O.y=aa*(A.y<0?-1:1),i[(p+2)*3+1]=O.y,i[(p+3)*3+1]=O.y,g=b*3;g<b*3+4*3;g+=3)s[g]=i[(p+2)*3],s[g+1]=i[(p+2)*3+1],s[g+2]=i[(p+2)*3+2];let I=u.attributes,B=u.indices,M=d.attributes,q=d.indices;const P=Fe.lineSegmentPlane(A,O,Rd,Pb);if(h(P)){x=!0;const V=f.multiplyByScalar(f.UNIT_Y,Fb,Bb);A.y<0&&(f.negate(V,V),I=d.attributes,B=d.indices,M=u.attributes,q=u.indices);const k=f.add(P,V,Nb);I.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.position.values.push(k.x,k.y,k.z),I.position.values.push(k.x,k.y,k.z),I.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),I.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),I.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.nextPosition.values.push(k.x,k.y,k.z),I.nextPosition.values.push(k.x,k.y,k.z),I.nextPosition.values.push(k.x,k.y,k.z),I.nextPosition.values.push(k.x,k.y,k.z),f.negate(V,V),f.add(P,V,k),M.position.values.push(k.x,k.y,k.z),M.position.values.push(k.x,k.y,k.z),M.position.values.push(O.x,O.y,O.z,O.x,O.y,O.z),M.prevPosition.values.push(k.x,k.y,k.z),M.prevPosition.values.push(k.x,k.y,k.z),M.prevPosition.values.push(k.x,k.y,k.z),M.prevPosition.values.push(k.x,k.y,k.z),M.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),M.nextPosition.values.push(s[D*3],s[D*3+1],s[D*3+2]),M.nextPosition.values.push(s[D*3+3],s[D*3+4],s[D*3+5]);const H=U.fromArray(a,b*2,Pd),j=Math.abs(H.y);I.expandAndWidth.values.push(-1,j,1,j),I.expandAndWidth.values.push(-1,-j,1,-j),M.expandAndWidth.values.push(-1,j,1,j),M.expandAndWidth.values.push(-1,-j,1,-j);let r=f.magnitudeSquared(f.subtract(P,A,ll));if(r/=f.magnitudeSquared(f.subtract(O,A,ll)),h(l)){const w=Y.fromArray(l,b*4,Fd),v=Y.fromArray(l,D*4,Fd),z=S.lerp(w.x,v.x,r),G=S.lerp(w.y,v.y,r),W=S.lerp(w.z,v.z,r),Z=S.lerp(w.w,v.w,r);for(g=b*4;g<b*4+2*4;++g)I.color.values.push(l[g]);for(I.color.values.push(z,G,W,Z),I.color.values.push(z,G,W,Z),M.color.values.push(z,G,W,Z),M.color.values.push(z,G,W,Z),g=D*4;g<D*4+2*4;++g)M.color.values.push(l[g])}if(h(c)){const w=U.fromArray(c,b*2,Pd),v=U.fromArray(c,(p+3)*2,zb),z=S.lerp(w.x,v.x,r);for(g=b*2;g<b*2+2*2;++g)I.st.values.push(c[g]);for(I.st.values.push(z,w.y),I.st.values.push(z,v.y),M.st.values.push(z,w.y),M.st.values.push(z,v.y),g=D*2;g<D*2+2*2;++g)M.st.values.push(c[g])}y=I.position.values.length/3-4,B.push(y,y+2,y+1),B.push(y+1,y+2,y+3),y=M.position.values.length/3-4,q.push(y,y+2,y+1),q.push(y+1,y+2,y+3)}else{let V,k;for(A.y<0?(V=d.attributes,k=d.indices):(V=u.attributes,k=u.indices),V.position.values.push(A.x,A.y,A.z),V.position.values.push(A.x,A.y,A.z),V.position.values.push(O.x,O.y,O.z),V.position.values.push(O.x,O.y,O.z),g=p*3;g<p*3+4*3;++g)V.prevPosition.values.push(o[g]),V.nextPosition.values.push(s[g]);for(g=p*2;g<p*2+4*2;++g)V.expandAndWidth.values.push(a[g]),h(c)&&V.st.values.push(c[g]);if(h(l))for(g=p*4;g<p*4+4*4;++g)V.color.values.push(l[g]);y=V.position.values.length/3-4,k.push(y,y+2,y+1),k.push(y+1,y+2,y+3)}}x&&(Ld(d),Ld(u)),rl(e,d,u)}He.splitLongitude=function(e){if(!h(e))throw new C("instance is required.");const t=e.geometry,n=t.boundingSphere;if(h(n)&&(n.center.x-n.radius>0||K.intersectPlane(n,Ne.ORIGIN_ZX_PLANE)!==Et.INTERSECTING))return e;if(t.geometryType!==ar.NONE)switch(t.geometryType){case ar.POLYLINES:Lb(e);break;case ar.TRIANGLES:Id(e);break;case ar.LINES:zd(e);break}else bb(t),t.primitiveType===qe.TRIANGLES?Id(e):t.primitiveType===qe.LINES&&zd(e);return e};function Kt(e){this._ellipsoid=_(e,le.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Kt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Kt.mercatorAngleToGeodeticLatitude=function(e){return S.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},Kt.geodeticLatitudeToMercatorAngle=function(e){e>Kt.MaximumLatitude?e=Kt.MaximumLatitude:e<-Kt.MaximumLatitude&&(e=-Kt.MaximumLatitude);const t=Math.sin(e);return .5*Math.log((1+t)/(1-t))},Kt.MaximumLatitude=Kt.mercatorAngleToGeodeticLatitude(Math.PI),Kt.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=Kt.geodeticLatitudeToMercatorAngle(e.latitude)*n,s=e.height;return h(t)?(t.x=i,t.y=o,t.z=s,t):new f(i,o,s)},Kt.prototype.unproject=function(e,t){if(!h(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=Kt.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return h(t)?(t.longitude=i,t.latitude=o,t.height=s,t):new ee(i,o,s)};function Mb(e,t,n){let i=!n;const o=e.length;let s;if(!i&&o>1){const a=e[0].modelMatrix;for(s=1;s<o;++s)if(!N.equals(a,e[s].modelMatrix)){i=!0;break}}if(i)for(s=0;s<o;++s)h(e[s].geometry)&&He.transformToWorldCoordinates(e[s]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function hl(e,t){const n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});const s=n.batchId.values;for(let a=0;a<o;++a)s[a]=t}function Ub(e){const t=e.length;for(let n=0;n<t;++n){const i=e[n];h(i.geometry)?hl(i.geometry,n):h(i.westHemisphereGeometry)&&h(i.eastHemisphereGeometry)&&(hl(i.westHemisphereGeometry,n),hl(i.eastHemisphereGeometry,n))}}function kb(e){const t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,s=e.vertexCacheOptimize,a=e.compressVertices,c=e.modelMatrix;let l,u,d,p=t.length;for(l=0;l<p;++l)if(h(t[l].geometry)){d=t[l].geometry.primitiveType;break}for(l=1;l<p;++l)if(h(t[l].geometry)&&t[l].geometry.primitiveType!==d)throw new C("All instance geometries must have the same primitiveType.");if(Mb(t,c,o),!o)for(l=0;l<p;++l)h(t[l].geometry)&&He.splitLongitude(t[l]);if(Ub(t),s)for(l=0;l<p;++l){const y=t[l];h(y.geometry)?(He.reorderForPostVertexCache(y.geometry),He.reorderForPreVertexCache(y.geometry)):h(y.westHemisphereGeometry)&&h(y.eastHemisphereGeometry)&&(He.reorderForPostVertexCache(y.westHemisphereGeometry),He.reorderForPreVertexCache(y.westHemisphereGeometry),He.reorderForPostVertexCache(y.eastHemisphereGeometry),He.reorderForPreVertexCache(y.eastHemisphereGeometry))}let g=He.combineInstances(t);for(p=g.length,l=0;l<p;++l){u=g[l];const y=u.attributes;if(o)for(const x in y)y.hasOwnProperty(x)&&y[x].componentDatatype===oe.DOUBLE&&He.encodeAttribute(u,x,`${x}3DHigh`,`${x}3DLow`);else for(const x in y)if(y.hasOwnProperty(x)&&y[x].componentDatatype===oe.DOUBLE){const E=`${x}3D`,b=`${x}2D`;He.projectTo2D(u,x,E,b,n),h(u.boundingSphere)&&x==="position"&&(u.boundingSphereCV=K.fromVertices(u.attributes.position2D.values)),He.encodeAttribute(u,E,`${E}High`,`${E}Low`),He.encodeAttribute(u,b,`${b}High`,`${b}Low`)}a&&He.compressVertices(u)}if(!i){let y=[];for(p=g.length,l=0;l<p;++l)u=g[l],y=y.concat(He.fitToUnsignedShortIndices(u));g=y}return g}function fl(e,t,n,i){let o,s,a;const c=i.length-1;if(c>=0){const u=i[c];o=u.offset+u.count,a=u.index,s=n[a].indices.length}else o=0,a=0,s=n[a].indices.length;const l=e.length;for(let u=0;u<l;++u){const p=e[u][t];if(!h(p))continue;const g=p.indices.length;o+g>s&&(o=0,s=n[++a].indices.length),i.push({index:a,offset:o,count:g}),o+=g}}function Vb(e,t){const n=[];return fl(e,"geometry",t,n),fl(e,"westHemisphereGeometry",t,n),fl(e,"eastHemisphereGeometry",t,n),n}const Nn={};Nn.combineGeometry=function(e){let t,n;const i=e.instances,o=i.length;let s,a,c=!1;o>0&&(t=kb(e),t.length>0&&(n=He.createAttributeLocations(t[0]),e.createPickOffsets&&(s=Vb(i,t))),h(i[0].attributes)&&h(i[0].attributes.offset)&&(a=new Array(o),c=!0));const l=new Array(o),u=new Array(o);for(let d=0;d<o;++d){const p=i[d],g=p.geometry;h(g)&&(l[d]=g.boundingSphere,u[d]=g.boundingSphereCV,c&&(a[d]=p.geometry.offsetAttribute));const y=p.eastHemisphereGeometry,x=p.westHemisphereGeometry;h(y)&&h(x)&&(h(y.boundingSphere)&&h(x.boundingSphere)&&(l[d]=K.union(y.boundingSphere,x.boundingSphere)),h(y.boundingSphereCV)&&h(x.boundingSphereCV)&&(u[d]=K.union(y.boundingSphereCV,x.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:s,offsetInstanceExtend:a,boundingSpheres:l,boundingSpheresCV:u}};function Gb(e,t){const n=e.attributes;for(const i in n)if(n.hasOwnProperty(i)){const o=n[i];h(o)&&h(o.values)&&t.push(o.values.buffer)}h(e.indices)&&t.push(e.indices.buffer)}function qb(e,t){const n=e.length;for(let i=0;i<n;++i)Gb(e[i],t)}function Hb(e){let t=1;const n=e.length;for(let i=0;i<n;i++){const o=e[i];if(++t,!h(o))continue;const s=o.attributes;t+=7+2*K.packedLength+(h(o.indices)?o.indices.length:0);for(const a in s)if(s.hasOwnProperty(a)&&h(s[a])){const c=s[a];t+=5+c.values.length}}return t}Nn.packCreateGeometryResults=function(e,t){const n=new Float64Array(Hb(e)),i=[],o={},s=e.length;let a=0;n[a++]=s;for(let c=0;c<s;c++){const l=e[c],u=h(l);if(n[a++]=u?1:0,!u)continue;n[a++]=l.primitiveType,n[a++]=l.geometryType,n[a++]=_(l.offsetAttribute,-1);const d=h(l.boundingSphere)?1:0;n[a++]=d,d&&K.pack(l.boundingSphere,n,a),a+=K.packedLength;const p=h(l.boundingSphereCV)?1:0;n[a++]=p,p&&K.pack(l.boundingSphereCV,n,a),a+=K.packedLength;const g=l.attributes,y=[];for(const E in g)g.hasOwnProperty(E)&&h(g[E])&&(y.push(E),h(o[E])||(o[E]=i.length,i.push(E)));n[a++]=y.length;for(let E=0;E<y.length;E++){const b=y[E],D=g[b];n[a++]=o[b],n[a++]=D.componentDatatype,n[a++]=D.componentsPerAttribute,n[a++]=D.normalize?1:0,n[a++]=D.values.length,n.set(D.values,a),a+=D.values.length}const x=h(l.indices)?l.indices.length:0;n[a++]=x,x>0&&(n.set(l.indices,a),a+=x)}return t.push(n.buffer),{stringTable:i,packedData:n}},Nn.unpackCreateGeometryResults=function(e){const t=e.stringTable,n=e.packedData;let i;const o=new Array(n[0]);let s=0,a=1;for(;a<n.length;){if(!(n[a++]===1)){o[s++]=void 0;continue}const l=n[a++],u=n[a++];let d=n[a++];d===-1&&(d=void 0);let p,g;n[a++]===1&&(p=K.unpack(n,a)),a+=K.packedLength,n[a++]===1&&(g=K.unpack(n,a)),a+=K.packedLength;let E,b,D;const A=new Pu,O=n[a++];for(i=0;i<O;i++){const B=t[n[a++]],M=n[a++];D=n[a++];const q=n[a++]!==0;E=n[a++],b=oe.createTypedArray(M,E);for(let P=0;P<E;P++)b[P]=n[a++];A[B]=new Bt({componentDatatype:M,componentsPerAttribute:D,normalize:q,values:b})}let I;if(E=n[a++],E>0){const B=b.length/D;for(I=Ct.createTypedArray(B,E),i=0;i<E;i++)I[i]=n[a++]}o[s++]=new ht({primitiveType:l,geometryType:u,boundingSphere:p,boundingSphereCV:g,indices:I,attributes:A,offsetAttribute:d})}return o};function Wb(e,t){const n=e.length,i=new Float64Array(1+n*19);let o=0;i[o++]=n;for(let s=0;s<n;s++){const a=e[s];if(N.pack(a.modelMatrix,i,o),o+=N.packedLength,h(a.attributes)&&h(a.attributes.offset)){const c=a.attributes.offset.value;i[o]=c[0],i[o+1]=c[1],i[o+2]=c[2]}o+=3}return t.push(i.buffer),i}function jb(e){const t=e,n=new Array(t[0]);let i=0,o=1;for(;o<t.length;){const s=N.unpack(t,o);let a;o+=N.packedLength,h(t[o])&&(a={offset:new hr(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:s,attributes:a}}return n}Nn.packCombineGeometryParameters=function(e,t){const n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:Wb(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Sn,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},Nn.unpackCombineGeometryParameters=function(e){const t=jb(e.packedInstances),n=e.createGeometryResults,i=n.length;let o=0;for(let c=0;c<i;c++){const l=Nn.unpackCreateGeometryResults(n[c]),u=l.length;for(let d=0;d<u;d++){const p=l[d],g=t[o];g.geometry=p,++o}}const s=le.clone(e.ellipsoid),a=e.isGeographic?new Sn(s):new Kt(s);return{instances:t,ellipsoid:s,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Md(e){const t=e.length,n=1+(K.packedLength+1)*t,i=new Float32Array(n);let o=0;i[o++]=t;for(let s=0;s<t;++s){const a=e[s];h(a)?(i[o++]=1,K.pack(e[s],i,o)):i[o++]=0,o+=K.packedLength}return i}function Ud(e){const t=new Array(e[0]);let n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=K.unpack(e,i)),++n,i+=K.packedLength;return t}Nn.packCombineGeometryResults=function(e,t){h(e.geometries)&&qb(e.geometries,t);const n=Md(e.boundingSpheres),i=Md(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}},Nn.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Ud(e.boundingSpheres),boundingSpheresCV:Ud(e.boundingSpheresCV)}};const St=Object.freeze({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6}),fn={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};fn.NUMBER_OF_SHADOW_MODES=4,fn.castShadows=function(e){return e===fn.ENABLED||e===fn.CAST_ONLY},fn.receiveShadows=function(e){return e===fn.ENABLED||e===fn.RECEIVE_ONLY},fn.fromCastReceive=function(e,t){return e&&t?fn.ENABLED:e?fn.CAST_ONLY:t?fn.RECEIVE_ONLY:fn.DISABLED};const ca=Object.freeze(fn);function Oe(e){if(e=_(e,_.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=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this.show=_(e.show,!0),this._vertexCacheOptimize=_(e.vertexCacheOptimize,!1),this._interleave=_(e.interleave,!1),this._releaseGeometryInstances=_(e.releaseGeometryInstances,!0),this._allowPicking=_(e.allowPicking,!0),this._asynchronous=_(e.asynchronous,!0),this._compressVertices=_(e.compressVertices,!0),this.cull=_(e.cull,!0),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,h(this.rtcCenter)&&(!h(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new C("Relative-to-center rendering only supports one geometry instance.");this.shadows=_(e.shadows,ca.DISABLED),this._translucent=void 0,this._state=St.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,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,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(Oe.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}}});function Yb(e){const t=e.length,n=[],i=e[0].attributes;let o;for(o in i)if(i.hasOwnProperty(o)&&h(i[o])){const s=i[o];let a=!0;for(let c=1;c<t;++c){const l=e[c].attributes[o];if(!h(l)||s.componentDatatype!==l.componentDatatype||s.componentsPerAttribute!==l.componentsPerAttribute||s.normalize!==l.normalize){a=!1;break}}a&&n.push(o)}return n}const Xb=new U,$b=new f,kd=new Y;function Vd(e){const t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,Xb);if(t===3)return f.unpack(e,0,$b);if(t===4)return Y.unpack(e,0,kd)}function Zb(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;const s=Yb(i),a=s.length,c=[],l={},u={};let d,g=i[0].attributes,y,x,E;for(y=0;y<a;++y)x=s[y],E=g[x],l[x]=y,c.push({functionName:`czm_batchTable_${x}`,componentDatatype:E.componentDatatype,componentsPerAttribute:E.componentsPerAttribute,normalize:E.normalize});s.indexOf("distanceDisplayCondition")!==-1&&(c.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:oe.FLOAT,componentsPerAttribute:1}),u.center3DHigh=c.length-5,u.center3DLow=c.length-4,u.center2DHigh=c.length-3,u.center2DLow=c.length-2,u.radius=c.length-1),s.indexOf("offset")!==-1&&(c.push({functionName:"czm_batchTable_offset2D",componentDatatype:oe.FLOAT,componentsPerAttribute:3}),d=c.length-1),c.push({functionName:"czm_batchTable_pickColor",componentDatatype:oe.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});const b=c.length,D=new mi(t,c,o);for(y=0;y<o;++y){const A=i[y];g=A.attributes;for(let q=0;q<a;++q){x=s[q],E=g[x];const P=Vd(E.value),V=l[x];D.setBatchedAttribute(y,V,P)}const O={primitive:_(A.pickPrimitive,e)};h(A.id)&&(O.id=A.id);const I=t.createPickId(O);e._pickIds.push(I);const B=I.color,M=kd;M.x=T.floatToByte(B.red),M.y=T.floatToByte(B.green),M.z=T.floatToByte(B.blue),M.w=T.floatToByte(B.alpha),D.setBatchedAttribute(y,b-1,M)}e._batchTable=D,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=d}function Kb(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Bt({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function Qb(e){const t=e.attributes,n=new Pu;for(const o in t)t.hasOwnProperty(o)&&h(t[o])&&(n[o]=Kb(t[o]));let i;if(h(e.indices)){const o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ht({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:K.clone(e.boundingSphere)})}function Jb(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const ew=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Oe._modifyShaderPosition=function(e,t,n){let i,o="",s="",a="";for(;(i=ew.exec(t))!==null;){const c=i[1],l=`vec4 czm_compute${c[0].toUpperCase()}${c.substr(1)}()`;l!=="vec4 czm_computePosition()"&&(o+=`${l};
4659
+ ${a}`}},_i.prototype.isDestroyed=function(){return!1},_i.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),Qe(this)};const Ue={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ue.getMathType=function(e){switch(e){case Ue.SCALAR:return Number;case Ue.VEC2:return U;case Ue.VEC3:return f;case Ue.VEC4:return Y;case Ue.MAT2:return ae;case Ue.MAT3:return L;case Ue.MAT4:return N;default:throw new C("attributeType is not a valid value.")}},Ue.getNumberOfComponents=function(e){switch(e){case Ue.SCALAR:return 1;case Ue.VEC2:return 2;case Ue.VEC3:return 3;case Ue.VEC4:case Ue.MAT2:return 4;case Ue.MAT3:return 9;case Ue.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}},Ue.getAttributeLocationCount=function(e){switch(e){case Ue.SCALAR:case Ue.VEC2:case Ue.VEC3:case Ue.VEC4:return 1;case Ue.MAT2:return 2;case Ue.MAT3:return 3;case Ue.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}},Ue.getGlslType=function(e){switch(m.typeOf.string("attributeType",e),e){case Ue.SCALAR:return"float";case Ue.VEC2:return"vec2";case Ue.VEC3:return"vec3";case Ue.VEC4:return"vec4";case Ue.MAT2:return"mat2";case Ue.MAT3:return"mat3";case Ue.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};const rb=Object.freeze(Ue),_d=1/256,gd=256,Te={};Te.octEncodeInRange=function(e,t,n){m.defined("vector",e),m.defined("result",n);const i=f.magnitudeSquared(e);if(Math.abs(i-1)>S.EPSILON6)throw new C("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 o=n.x,s=n.y;n.x=(1-Math.abs(s))*S.signNotZero(o),n.y=(1-Math.abs(o))*S.signNotZero(s)}return n.x=S.toSNorm(n.x,t),n.y=S.toSNorm(n.y,t),n},Te.octEncode=function(e,t){return Te.octEncodeInRange(e,255,t)};const yr=new U,yd=new Uint8Array(1);function ea(e){return yd[0]=e,yd[0]}Te.octEncodeToCartesian4=function(e,t){return Te.octEncodeInRange(e,65535,yr),t.x=ea(yr.x*_d),t.y=ea(yr.x),t.z=ea(yr.y*_d),t.w=ea(yr.y),t},Te.octDecodeInRange=function(e,t,n,i){if(m.defined("result",i),e<0||e>n||t<0||t>n)throw new C(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=S.fromSNorm(e,n),i.y=S.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){const o=i.x;i.x=(1-Math.abs(i.y))*S.signNotZero(o),i.y=(1-Math.abs(o))*S.signNotZero(i.y)}return f.normalize(i,i)},Te.octDecode=function(e,t,n){return Te.octDecodeInRange(e,t,255,n)},Te.octDecodeFromCartesian4=function(e,t){m.typeOf.object("encoded",e),m.typeOf.object("result",t);const n=e.x,i=e.y,o=e.z,s=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||s<0||s>255)throw new C("x, y, z, and w must be unsigned normalized integers between 0 and 255");const a=n*gd+i,c=o*gd+s;return Te.octDecodeInRange(a,c,65535,t)},Te.octPackFloat=function(e){return m.defined("encoded",e),256*e.x+e.y};const Kc=new U;Te.octEncodeFloat=function(e){return Te.octEncode(e,Kc),Te.octPackFloat(Kc)},Te.octDecodeFloat=function(e,t){m.defined("value",e);const n=e/256,i=Math.floor(n),o=(n-i)*256;return Te.octDecode(i,o,t)},Te.octPack=function(e,t,n,i){m.defined("v1",e),m.defined("v2",t),m.defined("v3",n),m.defined("result",i);const o=Te.octEncodeFloat(e),s=Te.octEncodeFloat(t),a=Te.octEncode(n,Kc);return i.x=65536*a.x+o,i.y=65536*a.y+s,i},Te.octUnpack=function(e,t,n,i){m.defined("packed",e),m.defined("v1",t),m.defined("v2",n),m.defined("v3",i);let o=e.x/65536;const s=Math.floor(o),a=(o-s)*65536;o=e.y/65536;const c=Math.floor(o),l=(o-c)*65536;Te.octDecodeFloat(a,t),Te.octDecodeFloat(l,n),Te.octDecode(s,c,i)},Te.compressTextureCoordinates=function(e){m.defined("textureCoordinates",e);const t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n},Te.decompressTextureCoordinates=function(e,t){m.defined("compressed",e),m.defined("result",t);const n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function Qc(e){return e>>1^-(e&1)}Te.zigZagDeltaDecode=function(e,t,n){m.defined("uBuffer",e),m.defined("vBuffer",t),m.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),h(n)&&m.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);const i=e.length;let o=0,s=0,a=0;for(let c=0;c<i;++c)o+=Qc(e[c]),s+=Qc(t[c]),e[c]=o,t[c]=s,h(n)&&(a+=Qc(n[c]),n[c]=a)},Te.dequantize=function(e,t,n,i){m.defined("typedArray",e),m.defined("componentDatatype",t),m.defined("type",n),m.defined("count",i);const o=rb.getNumberOfComponents(n);let s;switch(t){case oe.BYTE:s=127;break;case oe.UNSIGNED_BYTE:s=255;break;case oe.SHORT:s=32767;break;case oe.UNSIGNED_SHORT:s=65535;break;case oe.INT:s=2147483647;break;case oe.UNSIGNED_INT:s=4294967295;break;default:throw new C(`Cannot dequantize component datatype: ${t}`)}const a=new Float32Array(i*o);for(let c=0;c<i;c++)for(let l=0;l<o;l++){const u=c*o+l;a[u]=Math.max(e[u]/s,-1)}return a},Te.decodeRGB565=function(e,t){m.defined("typedArray",e);const n=e.length*3;h(t)&&m.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);const i=e.length;h(t)||(t=new Float32Array(i*3));const o=31,s=63,a=1/31,c=1/63;for(let l=0;l<i;l++){const u=e[l],d=u>>11,p=u>>5&s,g=u&o,y=3*l;t[y]=d*a,t[y+1]=p*c,t[y+2]=g*a}return t};const xd=new f,Cd=new f,Ed=new f;function sb(e,t,n,i,o){m.defined("point",e),m.defined("p0",t),m.defined("p1",n),m.defined("p2",i),h(o)||(o=new f);let s,a,c,l,u,d,p,g;if(h(t.z)){if(f.equalsEpsilon(e,t,S.EPSILON14))return f.clone(f.UNIT_X,o);if(f.equalsEpsilon(e,n,S.EPSILON14))return f.clone(f.UNIT_Y,o);if(f.equalsEpsilon(e,i,S.EPSILON14))return f.clone(f.UNIT_Z,o);s=f.subtract(n,t,xd),a=f.subtract(i,t,Cd),c=f.subtract(e,t,Ed),l=f.dot(s,s),u=f.dot(s,a),d=f.dot(s,c),p=f.dot(a,a),g=f.dot(a,c)}else{if(U.equalsEpsilon(e,t,S.EPSILON14))return f.clone(f.UNIT_X,o);if(U.equalsEpsilon(e,n,S.EPSILON14))return f.clone(f.UNIT_Y,o);if(U.equalsEpsilon(e,i,S.EPSILON14))return f.clone(f.UNIT_Z,o);s=U.subtract(n,t,xd),a=U.subtract(i,t,Cd),c=U.subtract(e,t,Ed),l=U.dot(s,s),u=U.dot(s,a),d=U.dot(s,c),p=U.dot(a,a),g=U.dot(a,c)}o.y=p*d-u*g,o.z=l*g-u*d;const y=l*p-u*u;if(y!==0)return o.y/=y,o.z/=y,o.x=1-o.y-o.z,o}const Jc={};Jc.calculateACMR=function(e){e=_(e,_.EMPTY_OBJECT);const t=e.indices;let n=e.maximumIndex;const i=_(e.cacheSize,24);if(!h(t))throw new C("indices is required.");const o=t.length;if(o<3||o%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");if(!h(n)){n=0;let c=0,l=t[c];for(;c<o;)l>n&&(n=l),++c,l=t[c]}const s=[];for(let c=0;c<n+1;c++)s[c]=0;let a=i+1;for(let c=0;c<o;++c)a-s[t[c]]>i&&(s[t[c]]=a,++a);return(a-i+1)/(o/3)},Jc.tipsify=function(e){e=_(e,_.EMPTY_OBJECT);const t=e.indices,n=e.maximumIndex,i=_(e.cacheSize,24);let o;function s(H,j,r,w){for(;j.length>=1;){const v=j[j.length-1];if(j.splice(j.length-1,1),H[v].numLiveTriangles>0)return v}for(;o<w;){if(H[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(H,j,r,w,v,z,G){let W=-1,Z,X=-1,ie=0;for(;ie<r.length;){const se=r[ie];w[se].numLiveTriangles&&(Z=0,v-w[se].timeStamp+2*w[se].numLiveTriangles<=j&&(Z=v-w[se].timeStamp),(Z>X||X===-1)&&(X=Z,W=se)),++ie}return W===-1?s(w,z,H,G):W}if(!h(t))throw new C("indices is required.");const c=t.length;if(c<3||c%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");let l=0,u=0,d=t[u];const p=c;if(h(n))l=n+1;else{for(;u<p;)d>l&&(l=d),++u,d=t[u];if(l===-1)return 0;++l}const g=[];let y;for(y=0;y<l;y++)g[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let x=0;for(;u<p;)g[t[u]].vertexTriangles.push(x),++g[t[u]].numLiveTriangles,g[t[u+1]].vertexTriangles.push(x),++g[t[u+1]].numLiveTriangles,g[t[u+2]].vertexTriangles.push(x),++g[t[u+2]].numLiveTriangles,++x,u+=3;let E=0,b=i+1;o=1;let D=[];const A=[];let O,I,B=0;const M=[],q=c/3,P=[];for(y=0;y<q;y++)P[y]=!1;let V,k;for(;E!==-1;){D=[],I=g[E],k=I.vertexTriangles.length;for(let H=0;H<k;++H)if(x=I.vertexTriangles[H],!P[x]){P[x]=!0,u=x+x+x;for(let j=0;j<3;++j)V=t[u],D.push(V),A.push(V),M[B]=V,++B,O=g[V],--O.numLiveTriangles,b-O.timeStamp>i&&(O.timeStamp=b,++b),++u}E=a(t,i,D,g,b,A,l)}return M};const He={};function ta(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function ab(e){const t=e.length,n=t/3*6,i=Ct.createTypedArray(t,n);let o=0;for(let s=0;s<t;s+=3,o+=6)ta(i,o,e[s],e[s+1],e[s+2]);return i}function cb(e){const t=e.length;if(t>=3){const n=(t-2)*6,i=Ct.createTypedArray(t,n);ta(i,0,e[0],e[1],e[2]);let o=6;for(let s=3;s<t;++s,o+=6)ta(i,o,e[s-1],e[s],e[s-2]);return i}return new Uint16Array}function lb(e){if(e.length>0){const t=e.length-1,n=(t-1)*6,i=Ct.createTypedArray(t,n),o=e[0];let s=0;for(let a=1;a<t;++a,s+=6)ta(i,s,o,e[a],e[a+1]);return i}return new Uint16Array}He.toWireframe=function(e){if(!h(e))throw new C("geometry is required.");const t=e.indices;if(h(t)){switch(e.primitiveType){case qe.TRIANGLES:e.indices=ab(t);break;case qe.TRIANGLE_STRIP:e.indices=cb(t);break;case qe.TRIANGLE_FAN:e.indices=lb(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=qe.LINES}return e},He.createLineSegmentsForVectors=function(e,t,n){if(t=_(t,"normal"),!h(e))throw new C("geometry is required.");if(!h(e.attributes.position))throw new C("geometry.attributes.position is required.");if(!h(e.attributes[t]))throw new C(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=_(n,1e4);const i=e.attributes.position.values,o=e.attributes[t].values,s=i.length,a=new Float64Array(2*s);let c=0;for(let d=0;d<s;d+=3)a[c++]=i[d],a[c++]=i[d+1],a[c++]=i[d+2],a[c++]=i[d]+o[d]*n,a[c++]=i[d+1]+o[d+1]*n,a[c++]=i[d+2]+o[d+2]*n;let l;const u=e.boundingSphere;return h(u)&&(l=new K(u.center,u.radius+n)),new ht({attributes:{position:new Bt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:qe.LINES,boundingSphere:l})},He.createAttributeLocations=function(e){if(!h(e))throw new C("geometry is required.");const t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={};let o=0,s;const a=t.length;for(s=0;s<a;++s){const c=t[s];h(n[c])&&(i[c]=o++)}for(const c in n)n.hasOwnProperty(c)&&!h(i[c])&&(i[c]=o++);return i},He.reorderForPreVertexCache=function(e){if(!h(e))throw new C("geometry is required.");const t=ht.computeNumberOfVertices(e),n=e.indices;if(h(n)){const i=new Int32Array(t);for(let g=0;g<t;g++)i[g]=-1;const o=n,s=o.length,a=Ct.createTypedArray(t,s);let c=0,l=0,u=0,d;for(;c<s;)d=i[o[c]],d!==-1?a[l]=d:(d=o[c],i[d]=u,a[l]=u,++u),++c,++l;e.indices=a;const p=e.attributes;for(const g in p)if(p.hasOwnProperty(g)&&h(p[g])&&h(p[g].values)){const y=p[g],x=y.values;let E=0;const b=y.componentsPerAttribute,D=oe.createTypedArray(y.componentDatatype,u*b);for(;E<t;){const A=i[E];if(A!==-1)for(let O=0;O<b;O++)D[b*A+O]=x[b*E+O];++E}y.values=D}}return e},He.reorderForPostVertexCache=function(e,t){if(!h(e))throw new C("geometry is required.");const n=e.indices;if(e.primitiveType===qe.TRIANGLES&&h(n)){const i=n.length;let o=0;for(let s=0;s<i;s++)n[s]>o&&(o=n[s]);e.indices=Jc.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function bd(e){const t={};for(const n in e)if(e.hasOwnProperty(n)&&h(e[n])&&h(e[n].values)){const i=e[n];t[n]=new Bt({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function hb(e,t,n){for(const i in t)if(t.hasOwnProperty(i)&&h(t[i])&&h(t[i].values)){const o=t[i];for(let s=0;s<o.componentsPerAttribute;++s)e[i].values.push(o.values[n*o.componentsPerAttribute+s])}}He.fitToUnsignedShortIndices=function(e){if(!h(e))throw new C("geometry is required.");if(h(e.indices)&&e.primitiveType!==qe.TRIANGLES&&e.primitiveType!==qe.LINES&&e.primitiveType!==qe.POINTS)throw new C("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");const t=[],n=ht.computeNumberOfVertices(e);if(h(e.indices)&&n>=S.SIXTY_FOUR_KILOBYTES){let i=[],o=[],s=0,a=bd(e.attributes);const c=e.indices,l=c.length;let u;e.primitiveType===qe.TRIANGLES?u=3:e.primitiveType===qe.LINES?u=2:e.primitiveType===qe.POINTS&&(u=1);for(let d=0;d<l;d+=u){for(let p=0;p<u;++p){const g=c[d+p];let y=i[g];h(y)||(y=s++,i[g]=y,hb(a,e.attributes,g)),o.push(y)}s+u>=S.SIXTY_FOUR_KILOBYTES&&(t.push(new ht({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],s=0,a=bd(e.attributes))}o.length!==0&&t.push(new ht({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const wd=new f,fb=new ee;He.projectTo2D=function(e,t,n,i,o){if(!h(e))throw new C("geometry is required.");if(!h(t))throw new C("attributeName is required.");if(!h(n))throw new C("attributeName3D is required.");if(!h(i))throw new C("attributeName2D is required.");if(!h(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==oe.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const s=e.attributes[t];o=h(o)?o:new Sn;const a=o.ellipsoid,c=s.values,l=new Float64Array(c.length);let u=0;for(let d=0;d<c.length;d+=3){const p=f.fromArray(c,d,wd),g=a.cartesianToCartographic(p,fb);if(!h(g))throw new C(`Could not project point (${p.x}, ${p.y}, ${p.z}) to 2D.`);const y=o.project(g,wd);l[u++]=y.x,l[u++]=y.y,l[u++]=y.z}return e.attributes[n]=s,e.attributes[i]=new Bt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};const el={high:0,low:0};He.encodeAttribute=function(e,t,n,i){if(!h(e))throw new C("geometry is required.");if(!h(t))throw new C("attributeName is required.");if(!h(n))throw new C("attributeHighName is required.");if(!h(i))throw new C("attributeLowName is required.");if(!h(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==oe.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");const o=e.attributes[t],s=o.values,a=s.length,c=new Float32Array(a),l=new Float32Array(a);for(let d=0;d<a;++d)Ye.encode(s[d],el),c[d]=el.high,l[d]=el.low;const u=o.componentsPerAttribute;return e.attributes[n]=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:c}),e.attributes[i]=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};let Pn=new f;function tl(e,t){if(h(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)f.unpack(n,o,Pn),N.multiplyByPoint(e,Pn,Pn),f.pack(Pn,n,o)}}function nl(e,t){if(h(t)){const n=t.values,i=n.length;for(let o=0;o<i;o+=3)f.unpack(n,o,Pn),L.multiplyByVector(e,Pn,Pn),Pn=f.normalize(Pn,Pn),f.pack(Pn,n,o)}}const na=new N,ia=new L;He.transformToWorldCoordinates=function(e){if(!h(e))throw new C("instance is required.");const t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;const n=e.geometry.attributes;tl(t,n.position),tl(t,n.prevPosition),tl(t,n.nextPosition),(h(n.normal)||h(n.tangent)||h(n.bitangent))&&(N.inverse(t,na),N.transpose(na,na),N.getMatrix3(na,ia),nl(ia,n.normal),nl(ia,n.tangent),nl(ia,n.bitangent));const i=e.geometry.boundingSphere;return h(i)&&(e.geometry.boundingSphere=K.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function ub(e,t){const n=e.length,i={},o=e[0][t].attributes;let s;for(s in o)if(o.hasOwnProperty(s)&&h(o[s])&&h(o[s].values)){const a=o[s];let c=a.values.length,l=!0;for(let u=1;u<n;++u){const d=e[u][t].attributes[s];if(!h(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){l=!1;break}c+=d.values.length}l&&(i[s]=new Bt({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:oe.createTypedArray(a.componentDatatype,c)}))}return i}const db=new f;function il(e,t){const n=e.length;let i,o,s,a;const c=e[0].modelMatrix,l=h(e[0][t].indices),u=e[0][t].primitiveType;for(o=1;o<n;++o){if(!N.equals(e[o].modelMatrix,c))throw new C("All instances must have the same modelMatrix.");if(h(e[o][t].indices)!==l)throw new C("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==u)throw new C("All instance geometries must have the same primitiveType.")}const d=ub(e,t);let p,g,y;for(i in d)if(d.hasOwnProperty(i))for(p=d[i].values,a=0,o=0;o<n;++o)for(g=e[o][t].attributes[i].values,y=g.length,s=0;s<y;++s)p[a++]=g[s];let x;if(l){let A=0;for(o=0;o<n;++o)A+=e[o][t].indices.length;const O=ht.computeNumberOfVertices(new ht({attributes:d,primitiveType:qe.POINTS})),I=Ct.createTypedArray(O,A);let B=0,M=0;for(o=0;o<n;++o){const q=e[o][t].indices,P=q.length;for(a=0;a<P;++a)I[B++]=M+q[a];M+=ht.computeNumberOfVertices(e[o][t])}x=I}let E=new f,b=0,D;for(o=0;o<n;++o){if(D=e[o][t].boundingSphere,!h(D)){E=void 0;break}f.add(D.center,E,E)}if(h(E))for(f.divideByScalar(E,n,E),o=0;o<n;++o){D=e[o][t].boundingSphere;const A=f.magnitude(f.subtract(D.center,E,db))+D.radius;A>b&&(b=A)}return new ht({attributes:d,indices:x,primitiveType:u,boundingSphere:h(E)?new K(E,b):void 0})}He.combineInstances=function(e){if(!h(e)||e.length<1)throw new C("instances is required and must have length greater than zero.");const t=[],n=[],i=e.length;for(let s=0;s<i;++s){const a=e[s];h(a.geometry)?t.push(a):h(a.westHemisphereGeometry)&&h(a.eastHemisphereGeometry)&&n.push(a)}const o=[];return t.length>0&&o.push(il(t,"geometry")),n.length>0&&(o.push(il(n,"westHemisphereGeometry")),o.push(il(n,"eastHemisphereGeometry"))),o};const Cn=new f,xr=new f,Lo=new f,Mo=new f;He.computeNormal=function(e){if(!h(e))throw new C("geometry is required.");if(!h(e.attributes.position)||!h(e.attributes.position.values))throw new C("geometry.attributes.position.values is required.");if(!h(e.indices))throw new C("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==qe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,s=t.length,a=new Array(o),c=new Array(s/3),l=new Array(s);let u;for(u=0;u<o;u++)a[u]={indexOffset:0,count:0,currentCount:0};let d=0;for(u=0;u<s;u+=3){const x=t[u],E=t[u+1],b=t[u+2],D=x*3,A=E*3,O=b*3;xr.x=i[D],xr.y=i[D+1],xr.z=i[D+2],Lo.x=i[A],Lo.y=i[A+1],Lo.z=i[A+2],Mo.x=i[O],Mo.y=i[O+1],Mo.z=i[O+2],a[x].count++,a[E].count++,a[b].count++,f.subtract(Lo,xr,Lo),f.subtract(Mo,xr,Mo),c[d]=f.cross(Lo,Mo,new f),d++}let p=0;for(u=0;u<o;u++)a[u].indexOffset+=p,p+=a[u].count;d=0;let g;for(u=0;u<s;u+=3){g=a[t[u]];let x=g.indexOffset+g.currentCount;l[x]=d,g.currentCount++,g=a[t[u+1]],x=g.indexOffset+g.currentCount,l[x]=d,g.currentCount++,g=a[t[u+2]],x=g.indexOffset+g.currentCount,l[x]=d,g.currentCount++,d++}const y=new Float32Array(o*3);for(u=0;u<o;u++){const x=u*3;if(g=a[u],f.clone(f.ZERO,Cn),g.count>0){for(d=0;d<g.count;d++)f.add(Cn,c[l[g.indexOffset+d]],Cn);f.equalsEpsilon(f.ZERO,Cn,S.EPSILON10)&&f.clone(c[l[g.indexOffset]],Cn)}f.equalsEpsilon(f.ZERO,Cn,S.EPSILON10)&&(Cn.z=1),f.normalize(Cn,Cn),y[x]=Cn.x,y[x+1]=Cn.y,y[x+2]=Cn.z}return e.attributes.normal=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e};const pb=new f,Td=new f,mb=new f;He.computeTangentAndBitangent=function(e){if(!h(e))throw new C("geometry is required.");const t=e.attributes,n=e.indices;if(!h(t.position)||!h(t.position.values))throw new C("geometry.attributes.position.values is required.");if(!h(t.normal)||!h(t.normal.values))throw new C("geometry.attributes.normal.values is required.");if(!h(t.st)||!h(t.st.values))throw new C("geometry.attributes.st.values is required.");if(!h(n))throw new C("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==qe.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");const i=e.attributes.position.values,o=e.attributes.normal.values,s=e.attributes.st.values,a=e.attributes.position.values.length/3,c=n.length,l=new Array(a*3);let u;for(u=0;u<l.length;u++)l[u]=0;let d,p,g;for(u=0;u<c;u+=3){const E=n[u],b=n[u+1],D=n[u+2];d=E*3,p=b*3,g=D*3;const A=E*2,O=b*2,I=D*2,B=i[d],M=i[d+1],q=i[d+2],P=s[A],V=s[A+1],k=s[O+1]-V,H=s[I+1]-V,j=1/((s[O]-P)*H-(s[I]-P)*k),r=(H*(i[p]-B)-k*(i[g]-B))*j,w=(H*(i[p+1]-M)-k*(i[g+1]-M))*j,v=(H*(i[p+2]-q)-k*(i[g+2]-q))*j;l[d]+=r,l[d+1]+=w,l[d+2]+=v,l[p]+=r,l[p+1]+=w,l[p+2]+=v,l[g]+=r,l[g+1]+=w,l[g+2]+=v}const y=new Float32Array(a*3),x=new Float32Array(a*3);for(u=0;u<a;u++){d=u*3,p=d+1,g=d+2;const E=f.fromArray(o,d,pb),b=f.fromArray(l,d,mb),D=f.dot(E,b);f.multiplyByScalar(E,D,Td),f.normalize(f.subtract(b,Td,b),b),y[d]=b.x,y[p]=b.y,y[g]=b.z,f.normalize(f.cross(E,b,b),b),x[d]=b.x,x[p]=b.y,x[g]=b.z}return e.attributes.tangent=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:x}),e};const Cr=new U,Bn=new f,Sd=new f,Ad=new f;let oa=new U;He.compressVertices=function(e){if(!h(e))throw new C("geometry is required.");const t=e.attributes.extrudeDirection;let n,i;if(h(t)){const M=t.values;i=M.length/3;const q=new Float32Array(i*2);let P=0;for(n=0;n<i;++n){if(f.fromArray(M,n*3,Bn),f.equals(Bn,f.ZERO)){P+=2;continue}oa=Te.octEncodeInRange(Bn,65535,oa),q[P++]=oa.x,q[P++]=oa.y}return e.attributes.compressedAttributes=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,values:q}),delete e.attributes.extrudeDirection,e}const o=e.attributes.normal,s=e.attributes.st,a=h(o),c=h(s);if(!a&&!c)return e;const l=e.attributes.tangent,u=e.attributes.bitangent,d=h(l),p=h(u);let g,y,x,E;a&&(g=o.values),c&&(y=s.values),d&&(x=l.values),p&&(E=u.values),i=(a?g.length:y.length)/(a?3:2);let A=i,O=c&&a?2:1;O+=d||p?1:0,A*=O;const I=new Float32Array(A);let B=0;for(n=0;n<i;++n){c&&(U.fromArray(y,n*2,Cr),I[B++]=Te.compressTextureCoordinates(Cr));const M=n*3;a&&h(x)&&h(E)?(f.fromArray(g,M,Bn),f.fromArray(x,M,Sd),f.fromArray(E,M,Ad),Te.octPack(Bn,Sd,Ad,Cr),I[B++]=Cr.x,I[B++]=Cr.y):(a&&(f.fromArray(g,M,Bn),I[B++]=Te.octEncodeFloat(Bn)),d&&(f.fromArray(x,M,Bn),I[B++]=Te.octEncodeFloat(Bn)),p&&(f.fromArray(E,M,Bn),I[B++]=Te.octEncodeFloat(Bn)))}return e.attributes.compressedAttributes=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:O,values:I}),a&&delete e.attributes.normal,c&&delete e.attributes.st,p&&delete e.attributes.bitangent,d&&delete e.attributes.tangent,e};function _b(e){if(h(e.indices))return e;const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");if(t%3!==0)throw new C("The number of vertices must be a multiple of three.");const n=Ct.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function gb(e){const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");const n=Ct.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=qe.TRIANGLES,e}function yb(e){const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");const n=Ct.createTypedArray(t,(t-2)*3);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 o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=qe.TRIANGLES,e}function xb(e){if(h(e.indices))return e;const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");if(t%2!==0)throw new C("The number of vertices must be a multiple of 2.");const n=Ct.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function Cb(e){const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=Ct.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=qe.LINES,e}function Eb(e){const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=Ct.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=qe.LINES,e}function bb(e){switch(e.primitiveType){case qe.TRIANGLE_FAN:return gb(e);case qe.TRIANGLE_STRIP:return yb(e);case qe.TRIANGLES:return _b(e);case qe.LINE_STRIP:return Cb(e);case qe.LINE_LOOP:return Eb(e);case qe.LINES:return xb(e)}return e}function Ui(e,t){Math.abs(e.y)<S.EPSILON6&&(t?e.y=-S.EPSILON6:e.y=S.EPSILON6)}function wb(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Ui(e,e.y<0),Ui(t,t.y<0),Ui(n,n.y<0);return}const i=Math.abs(e.y),o=Math.abs(t.y),s=Math.abs(n.y);let a;i>o?i>s?a=S.sign(e.y):a=S.sign(n.y):o>s?a=S.sign(t.y):a=S.sign(n.y);const c=a<0;Ui(e,c),Ui(t,c),Ui(n,c)}const Dd=new f;function En(e,t,n,i){f.add(e,f.multiplyByScalar(f.subtract(t,e,Dd),e.y/(e.y-t.y),Dd),n),f.clone(n,i),Ui(n,!0),Ui(i,!1)}const oo=new f,ro=new f,so=new f,ao=new f,ol={positions:new Array(7),indices:new Array(3*3)};function Tb(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;wb(e,t,n);const i=e.y<0,o=t.y<0,s=n.y<0;let a=0;a+=i?1:0,a+=o?1:0,a+=s?1:0;const c=ol.indices;a===1?(c[1]=3,c[2]=4,c[5]=6,c[7]=6,c[8]=5,i?(En(e,t,oo,so),En(e,n,ro,ao),c[0]=0,c[3]=1,c[4]=2,c[6]=1):o?(En(t,n,oo,so),En(t,e,ro,ao),c[0]=1,c[3]=2,c[4]=0,c[6]=2):s&&(En(n,e,oo,so),En(n,t,ro,ao),c[0]=2,c[3]=0,c[4]=1,c[6]=0)):a===2&&(c[2]=4,c[4]=4,c[5]=3,c[7]=5,c[8]=6,i?o?s||(En(n,e,oo,so),En(n,t,ro,ao),c[0]=0,c[1]=1,c[3]=0,c[6]=2):(En(t,n,oo,so),En(t,e,ro,ao),c[0]=2,c[1]=0,c[3]=2,c[6]=1):(En(e,t,oo,so),En(e,n,ro,ao),c[0]=1,c[1]=2,c[3]=1,c[6]=0));const l=ol.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(a===1||a===2)&&(l[3]=oo,l[4]=ro,l[5]=so,l[6]=ao,l.length=7),ol}function Od(e,t){const n=e.attributes;if(n.position.values.length===0)return;for(const o in n)if(n.hasOwnProperty(o)&&h(n[o])&&h(n[o].values)){const s=n[o];s.values=oe.createTypedArray(s.componentDatatype,s.values)}const i=ht.computeNumberOfVertices(e);return e.indices=Ct.createTypedArray(i,e.indices),t&&(e.boundingSphere=K.fromVertices(n.position.values)),e}function Uo(e){const t=e.attributes,n={};for(const i in t)if(t.hasOwnProperty(i)&&h(t[i])&&h(t[i].values)){const o=t[i];n[i]=new Bt({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function rl(e,t,n){const i=h(e.geometry.boundingSphere);t=Od(t,i),n=Od(n,i),h(n)&&!h(t)?e.geometry=n:!h(n)&&h(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function sl(e,t){const n=new e,i=new e,o=new e;return function(s,a,c,l,u,d,p,g){const y=e.fromArray(u,s*t,n),x=e.fromArray(u,a*t,i),E=e.fromArray(u,c*t,o);e.multiplyByScalar(y,l.x,y),e.multiplyByScalar(x,l.y,x),e.multiplyByScalar(E,l.z,E);const b=e.add(y,x,y);e.add(b,E,b),g&&e.normalize(b,b),e.pack(b,d,p*t)}}const Sb=sl(Y,4),ra=sl(f,3),vd=sl(U,2),Ab=function(e,t,n,i,o,s,a){const c=o[e]*i.x,l=o[t]*i.y,u=o[n]*i.z;s[a]=c+l+u>S.EPSILON6?1:0},Er=new f,al=new f,cl=new f,Db=new f;function sa(e,t,n,i,o,s,a,c,l,u,d,p,g,y,x,E){if(!h(s)&&!h(a)&&!h(c)&&!h(l)&&!h(u)&&y===0)return;const b=f.fromArray(o,e*3,Er),D=f.fromArray(o,t*3,al),A=f.fromArray(o,n*3,cl),O=sb(i,b,D,A,Db);if(h(O)){if(h(s)&&ra(e,t,n,O,s,p.normal.values,E,!0),h(u)){const I=f.fromArray(u,e*3,Er),B=f.fromArray(u,t*3,al),M=f.fromArray(u,n*3,cl);f.multiplyByScalar(I,O.x,I),f.multiplyByScalar(B,O.y,B),f.multiplyByScalar(M,O.z,M);let q;!f.equals(I,f.ZERO)||!f.equals(B,f.ZERO)||!f.equals(M,f.ZERO)?(q=f.add(I,B,I),f.add(q,M,q),f.normalize(q,q)):(q=Er,q.x=0,q.y=0,q.z=0),f.pack(q,p.extrudeDirection.values,E*3)}if(h(d)&&Ab(e,t,n,O,d,p.applyOffset.values,E),h(a)&&ra(e,t,n,O,a,p.tangent.values,E,!0),h(c)&&ra(e,t,n,O,c,p.bitangent.values,E,!0),h(l)&&vd(e,t,n,O,l,p.st.values,E),y>0)for(let I=0;I<y;I++){const B=g[I];Ob(e,t,n,O,E,x[B],p[B])}}}function Ob(e,t,n,i,o,s,a){const c=s.componentsPerAttribute,l=s.values,u=a.values;switch(c){case 4:Sb(e,t,n,i,l,u,o,!1);break;case 3:ra(e,t,n,i,l,u,o,!1);break;case 2:vd(e,t,n,i,l,u,o,!1);break;default:u[o]=l[e]*i.x+l[t]*i.y+l[n]*i.z}}function Qn(e,t,n,i,o,s){const a=e.position.values.length/3;if(o!==-1){const c=i[o],l=n[c];return l===-1?(n[c]=a,e.position.values.push(s.x,s.y,s.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(s.x,s.y,s.z),t.push(a),a}const vb={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Id(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=h(n.normal)?n.normal.values:void 0,s=h(n.bitangent)?n.bitangent.values:void 0,a=h(n.tangent)?n.tangent.values:void 0,c=h(n.st)?n.st.values:void 0,l=h(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=h(n.applyOffset)?n.applyOffset.values:void 0,d=t.indices,p=[];for(const q in n)n.hasOwnProperty(q)&&!vb[q]&&h(n[q])&&p.push(q);const g=p.length,y=Uo(t),x=Uo(t);let E,b,D,A,O;const I=[];I.length=i.length/3;const B=[];for(B.length=i.length/3,O=0;O<I.length;++O)I[O]=-1,B[O]=-1;const M=d.length;for(O=0;O<M;O+=3){const q=d[O],P=d[O+1],V=d[O+2];let k=f.fromArray(i,q*3),H=f.fromArray(i,P*3),j=f.fromArray(i,V*3);const r=Tb(k,H,j);if(h(r)&&r.positions.length>3){const w=r.positions,v=r.indices,z=v.length;for(let G=0;G<z;++G){const W=v[G],Z=w[W];Z.y<0?(E=x.attributes,b=x.indices,D=I):(E=y.attributes,b=y.indices,D=B),A=Qn(E,b,D,d,W<3?O+W:-1,Z),sa(q,P,V,Z,i,o,a,s,c,l,u,E,p,g,n,A)}}else h(r)&&(k=r.positions[0],H=r.positions[1],j=r.positions[2]),k.y<0?(E=x.attributes,b=x.indices,D=I):(E=y.attributes,b=y.indices,D=B),A=Qn(E,b,D,d,O,k),sa(q,P,V,k,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,b,D,d,O+1,H),sa(q,P,V,H,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,b,D,d,O+2,j),sa(q,P,V,j,i,o,a,s,c,l,u,E,p,g,n,A)}rl(e,x,y)}const Rd=Ne.fromPointNormal(f.ZERO,f.UNIT_Y),Ib=new f,Rb=new f;function ko(e,t,n,i,o,s,a){if(!h(a))return;const c=f.fromArray(i,e*3,Er);f.equalsEpsilon(c,n,S.EPSILON10)?s.applyOffset.values[o]=a[e]:s.applyOffset.values[o]=a[t]}function zd(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=h(n.applyOffset)?n.applyOffset.values:void 0,s=t.indices,a=Uo(t),c=Uo(t);let l;const u=s.length,d=[];d.length=i.length/3;const p=[];for(p.length=i.length/3,l=0;l<d.length;++l)d[l]=-1,p[l]=-1;for(l=0;l<u;l+=2){const g=s[l],y=s[l+1],x=f.fromArray(i,g*3,Er),E=f.fromArray(i,y*3,al);let b;Math.abs(x.y)<S.EPSILON6&&(x.y<0?x.y=-S.EPSILON6:x.y=S.EPSILON6),Math.abs(E.y)<S.EPSILON6&&(E.y<0?E.y=-S.EPSILON6:E.y=S.EPSILON6);let D=a.attributes,A=a.indices,O=p,I=c.attributes,B=c.indices,M=d;const q=Fe.lineSegmentPlane(x,E,Rd,cl);if(h(q)){const P=f.multiplyByScalar(f.UNIT_Y,5*S.EPSILON9,Ib);x.y<0&&(f.negate(P,P),D=c.attributes,A=c.indices,O=d,I=a.attributes,B=a.indices,M=p);const V=f.add(q,P,Rb);b=Qn(D,A,O,s,l,x),ko(g,y,x,i,b,D,o),b=Qn(D,A,O,s,-1,V),ko(g,y,V,i,b,D,o),f.negate(P,P),f.add(q,P,V),b=Qn(I,B,M,s,-1,V),ko(g,y,V,i,b,I,o),b=Qn(I,B,M,s,l+1,E),ko(g,y,E,i,b,I,o)}else{let P,V,k;x.y<0?(P=c.attributes,V=c.indices,k=d):(P=a.attributes,V=a.indices,k=p),b=Qn(P,V,k,s,l,x),ko(g,y,x,i,b,P,o),b=Qn(P,V,k,s,l+1,E),ko(g,y,E,i,b,P,o)}}rl(e,c,a)}const Pd=new U,zb=new U,Bd=new f,Nd=new f,ll=new f,Pb=new f,Bb=new f,Nb=new f,Fd=new Y;function Ld(e){const t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,s=n.length;for(let a=0;a<s;a+=3){const c=f.unpack(n,a,Bd);if(c.x>0)continue;const l=f.unpack(i,a,Nd);(c.y<0&&l.y>0||c.y>0&&l.y<0)&&(a-3>0?(i[a]=n[a-3],i[a+1]=n[a-2],i[a+2]=n[a-1]):f.pack(c,i,a));const u=f.unpack(o,a,ll);(c.y<0&&u.y>0||c.y>0&&u.y<0)&&(a+3<s?(o[a]=n[a+3],o[a+1]=n[a+4],o[a+2]=n[a+5]):f.pack(c,o,a))}}const Fb=5*S.EPSILON9,aa=S.EPSILON6;function Lb(e){const t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,s=n.nextPosition.values,a=n.expandAndWidth.values,c=h(n.st)?n.st.values:void 0,l=h(n.color)?n.color.values:void 0,u=Uo(t),d=Uo(t);let p,g,y,x=!1;const E=i.length/3;for(p=0;p<E;p+=4){const b=p,D=p+2,A=f.fromArray(i,b*3,Bd),O=f.fromArray(i,D*3,Nd);if(Math.abs(A.y)<aa)for(A.y=aa*(O.y<0?-1:1),i[p*3+1]=A.y,i[(p+1)*3+1]=A.y,g=b*3;g<b*3+4*3;g+=3)o[g]=i[p*3],o[g+1]=i[p*3+1],o[g+2]=i[p*3+2];if(Math.abs(O.y)<aa)for(O.y=aa*(A.y<0?-1:1),i[(p+2)*3+1]=O.y,i[(p+3)*3+1]=O.y,g=b*3;g<b*3+4*3;g+=3)s[g]=i[(p+2)*3],s[g+1]=i[(p+2)*3+1],s[g+2]=i[(p+2)*3+2];let I=u.attributes,B=u.indices,M=d.attributes,q=d.indices;const P=Fe.lineSegmentPlane(A,O,Rd,Pb);if(h(P)){x=!0;const V=f.multiplyByScalar(f.UNIT_Y,Fb,Bb);A.y<0&&(f.negate(V,V),I=d.attributes,B=d.indices,M=u.attributes,q=u.indices);const k=f.add(P,V,Nb);I.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.position.values.push(k.x,k.y,k.z),I.position.values.push(k.x,k.y,k.z),I.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),I.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),I.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.nextPosition.values.push(k.x,k.y,k.z),I.nextPosition.values.push(k.x,k.y,k.z),I.nextPosition.values.push(k.x,k.y,k.z),I.nextPosition.values.push(k.x,k.y,k.z),f.negate(V,V),f.add(P,V,k),M.position.values.push(k.x,k.y,k.z),M.position.values.push(k.x,k.y,k.z),M.position.values.push(O.x,O.y,O.z,O.x,O.y,O.z),M.prevPosition.values.push(k.x,k.y,k.z),M.prevPosition.values.push(k.x,k.y,k.z),M.prevPosition.values.push(k.x,k.y,k.z),M.prevPosition.values.push(k.x,k.y,k.z),M.nextPosition.values.push(O.x,O.y,O.z,O.x,O.y,O.z),M.nextPosition.values.push(s[D*3],s[D*3+1],s[D*3+2]),M.nextPosition.values.push(s[D*3+3],s[D*3+4],s[D*3+5]);const H=U.fromArray(a,b*2,Pd),j=Math.abs(H.y);I.expandAndWidth.values.push(-1,j,1,j),I.expandAndWidth.values.push(-1,-j,1,-j),M.expandAndWidth.values.push(-1,j,1,j),M.expandAndWidth.values.push(-1,-j,1,-j);let r=f.magnitudeSquared(f.subtract(P,A,ll));if(r/=f.magnitudeSquared(f.subtract(O,A,ll)),h(l)){const w=Y.fromArray(l,b*4,Fd),v=Y.fromArray(l,D*4,Fd),z=S.lerp(w.x,v.x,r),G=S.lerp(w.y,v.y,r),W=S.lerp(w.z,v.z,r),Z=S.lerp(w.w,v.w,r);for(g=b*4;g<b*4+2*4;++g)I.color.values.push(l[g]);for(I.color.values.push(z,G,W,Z),I.color.values.push(z,G,W,Z),M.color.values.push(z,G,W,Z),M.color.values.push(z,G,W,Z),g=D*4;g<D*4+2*4;++g)M.color.values.push(l[g])}if(h(c)){const w=U.fromArray(c,b*2,Pd),v=U.fromArray(c,(p+3)*2,zb),z=S.lerp(w.x,v.x,r);for(g=b*2;g<b*2+2*2;++g)I.st.values.push(c[g]);for(I.st.values.push(z,w.y),I.st.values.push(z,v.y),M.st.values.push(z,w.y),M.st.values.push(z,v.y),g=D*2;g<D*2+2*2;++g)M.st.values.push(c[g])}y=I.position.values.length/3-4,B.push(y,y+2,y+1),B.push(y+1,y+2,y+3),y=M.position.values.length/3-4,q.push(y,y+2,y+1),q.push(y+1,y+2,y+3)}else{let V,k;for(A.y<0?(V=d.attributes,k=d.indices):(V=u.attributes,k=u.indices),V.position.values.push(A.x,A.y,A.z),V.position.values.push(A.x,A.y,A.z),V.position.values.push(O.x,O.y,O.z),V.position.values.push(O.x,O.y,O.z),g=p*3;g<p*3+4*3;++g)V.prevPosition.values.push(o[g]),V.nextPosition.values.push(s[g]);for(g=p*2;g<p*2+4*2;++g)V.expandAndWidth.values.push(a[g]),h(c)&&V.st.values.push(c[g]);if(h(l))for(g=p*4;g<p*4+4*4;++g)V.color.values.push(l[g]);y=V.position.values.length/3-4,k.push(y,y+2,y+1),k.push(y+1,y+2,y+3)}}x&&(Ld(d),Ld(u)),rl(e,d,u)}He.splitLongitude=function(e){if(!h(e))throw new C("instance is required.");const t=e.geometry,n=t.boundingSphere;if(h(n)&&(n.center.x-n.radius>0||K.intersectPlane(n,Ne.ORIGIN_ZX_PLANE)!==Et.INTERSECTING))return e;if(t.geometryType!==ar.NONE)switch(t.geometryType){case ar.POLYLINES:Lb(e);break;case ar.TRIANGLES:Id(e);break;case ar.LINES:zd(e);break}else bb(t),t.primitiveType===qe.TRIANGLES?Id(e):t.primitiveType===qe.LINES&&zd(e);return e};function Kt(e){this._ellipsoid=_(e,le.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Kt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Kt.mercatorAngleToGeodeticLatitude=function(e){return S.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},Kt.geodeticLatitudeToMercatorAngle=function(e){e>Kt.MaximumLatitude?e=Kt.MaximumLatitude:e<-Kt.MaximumLatitude&&(e=-Kt.MaximumLatitude);const t=Math.sin(e);return .5*Math.log((1+t)/(1-t))},Kt.MaximumLatitude=Kt.mercatorAngleToGeodeticLatitude(Math.PI),Kt.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=Kt.geodeticLatitudeToMercatorAngle(e.latitude)*n,s=e.height;return h(t)?(t.x=i,t.y=o,t.z=s,t):new f(i,o,s)},Kt.prototype.unproject=function(e,t){if(!h(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=Kt.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return h(t)?(t.longitude=i,t.latitude=o,t.height=s,t):new ee(i,o,s)};function Mb(e,t,n){let i=!n;const o=e.length;let s;if(!i&&o>1){const a=e[0].modelMatrix;for(s=1;s<o;++s)if(!N.equals(a,e[s].modelMatrix)){i=!0;break}}if(i)for(s=0;s<o;++s)h(e[s].geometry)&&He.transformToWorldCoordinates(e[s]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function hl(e,t){const n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});const s=n.batchId.values;for(let a=0;a<o;++a)s[a]=t}function Ub(e){const t=e.length;for(let n=0;n<t;++n){const i=e[n];h(i.geometry)?hl(i.geometry,n):h(i.westHemisphereGeometry)&&h(i.eastHemisphereGeometry)&&(hl(i.westHemisphereGeometry,n),hl(i.eastHemisphereGeometry,n))}}function kb(e){const t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,s=e.vertexCacheOptimize,a=e.compressVertices,c=e.modelMatrix;let l,u,d,p=t.length;for(l=0;l<p;++l)if(h(t[l].geometry)){d=t[l].geometry.primitiveType;break}for(l=1;l<p;++l)if(h(t[l].geometry)&&t[l].geometry.primitiveType!==d)throw new C("All instance geometries must have the same primitiveType.");if(Mb(t,c,o),!o)for(l=0;l<p;++l)h(t[l].geometry)&&He.splitLongitude(t[l]);if(Ub(t),s)for(l=0;l<p;++l){const y=t[l];h(y.geometry)?(He.reorderForPostVertexCache(y.geometry),He.reorderForPreVertexCache(y.geometry)):h(y.westHemisphereGeometry)&&h(y.eastHemisphereGeometry)&&(He.reorderForPostVertexCache(y.westHemisphereGeometry),He.reorderForPreVertexCache(y.westHemisphereGeometry),He.reorderForPostVertexCache(y.eastHemisphereGeometry),He.reorderForPreVertexCache(y.eastHemisphereGeometry))}let g=He.combineInstances(t);for(p=g.length,l=0;l<p;++l){u=g[l];const y=u.attributes;if(o)for(const x in y)y.hasOwnProperty(x)&&y[x].componentDatatype===oe.DOUBLE&&He.encodeAttribute(u,x,`${x}3DHigh`,`${x}3DLow`);else for(const x in y)if(y.hasOwnProperty(x)&&y[x].componentDatatype===oe.DOUBLE){const E=`${x}3D`,b=`${x}2D`;He.projectTo2D(u,x,E,b,n),h(u.boundingSphere)&&x==="position"&&(u.boundingSphereCV=K.fromVertices(u.attributes.position2D.values)),He.encodeAttribute(u,E,`${E}High`,`${E}Low`),He.encodeAttribute(u,b,`${b}High`,`${b}Low`)}a&&He.compressVertices(u)}if(!i){let y=[];for(p=g.length,l=0;l<p;++l)u=g[l],y=y.concat(He.fitToUnsignedShortIndices(u));g=y}return g}function fl(e,t,n,i){let o,s,a;const c=i.length-1;if(c>=0){const u=i[c];o=u.offset+u.count,a=u.index,s=n[a].indices.length}else o=0,a=0,s=n[a].indices.length;const l=e.length;for(let u=0;u<l;++u){const p=e[u][t];if(!h(p))continue;const g=p.indices.length;o+g>s&&(o=0,s=n[++a].indices.length),i.push({index:a,offset:o,count:g}),o+=g}}function Vb(e,t){const n=[];return fl(e,"geometry",t,n),fl(e,"westHemisphereGeometry",t,n),fl(e,"eastHemisphereGeometry",t,n),n}const Nn={};Nn.combineGeometry=function(e){let t,n;const i=e.instances,o=i.length;let s,a,c=!1;o>0&&(t=kb(e),t.length>0&&(n=He.createAttributeLocations(t[0]),e.createPickOffsets&&(s=Vb(i,t))),h(i[0].attributes)&&h(i[0].attributes.offset)&&(a=new Array(o),c=!0));const l=new Array(o),u=new Array(o);for(let d=0;d<o;++d){const p=i[d],g=p.geometry;h(g)&&(l[d]=g.boundingSphere,u[d]=g.boundingSphereCV,c&&(a[d]=p.geometry.offsetAttribute));const y=p.eastHemisphereGeometry,x=p.westHemisphereGeometry;h(y)&&h(x)&&(h(y.boundingSphere)&&h(x.boundingSphere)&&(l[d]=K.union(y.boundingSphere,x.boundingSphere)),h(y.boundingSphereCV)&&h(x.boundingSphereCV)&&(u[d]=K.union(y.boundingSphereCV,x.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:s,offsetInstanceExtend:a,boundingSpheres:l,boundingSpheresCV:u}};function Gb(e,t){const n=e.attributes;for(const i in n)if(n.hasOwnProperty(i)){const o=n[i];h(o)&&h(o.values)&&t.push(o.values.buffer)}h(e.indices)&&t.push(e.indices.buffer)}function qb(e,t){const n=e.length;for(let i=0;i<n;++i)Gb(e[i],t)}function Hb(e){let t=1;const n=e.length;for(let i=0;i<n;i++){const o=e[i];if(++t,!h(o))continue;const s=o.attributes;t+=7+2*K.packedLength+(h(o.indices)?o.indices.length:0);for(const a in s)if(s.hasOwnProperty(a)&&h(s[a])){const c=s[a];t+=5+c.values.length}}return t}Nn.packCreateGeometryResults=function(e,t){const n=new Float64Array(Hb(e)),i=[],o={},s=e.length;let a=0;n[a++]=s;for(let c=0;c<s;c++){const l=e[c],u=h(l);if(n[a++]=u?1:0,!u)continue;n[a++]=l.primitiveType,n[a++]=l.geometryType,n[a++]=_(l.offsetAttribute,-1);const d=h(l.boundingSphere)?1:0;n[a++]=d,d&&K.pack(l.boundingSphere,n,a),a+=K.packedLength;const p=h(l.boundingSphereCV)?1:0;n[a++]=p,p&&K.pack(l.boundingSphereCV,n,a),a+=K.packedLength;const g=l.attributes,y=[];for(const E in g)g.hasOwnProperty(E)&&h(g[E])&&(y.push(E),h(o[E])||(o[E]=i.length,i.push(E)));n[a++]=y.length;for(let E=0;E<y.length;E++){const b=y[E],D=g[b];n[a++]=o[b],n[a++]=D.componentDatatype,n[a++]=D.componentsPerAttribute,n[a++]=D.normalize?1:0,n[a++]=D.values.length,n.set(D.values,a),a+=D.values.length}const x=h(l.indices)?l.indices.length:0;n[a++]=x,x>0&&(n.set(l.indices,a),a+=x)}return t.push(n.buffer),{stringTable:i,packedData:n}},Nn.unpackCreateGeometryResults=function(e){const t=e.stringTable,n=e.packedData;let i;const o=new Array(n[0]);let s=0,a=1;for(;a<n.length;){if(!(n[a++]===1)){o[s++]=void 0;continue}const l=n[a++],u=n[a++];let d=n[a++];d===-1&&(d=void 0);let p,g;n[a++]===1&&(p=K.unpack(n,a)),a+=K.packedLength,n[a++]===1&&(g=K.unpack(n,a)),a+=K.packedLength;let E,b,D;const A=new Pu,O=n[a++];for(i=0;i<O;i++){const B=t[n[a++]],M=n[a++];D=n[a++];const q=n[a++]!==0;E=n[a++],b=oe.createTypedArray(M,E);for(let P=0;P<E;P++)b[P]=n[a++];A[B]=new Bt({componentDatatype:M,componentsPerAttribute:D,normalize:q,values:b})}let I;if(E=n[a++],E>0){const B=b.length/D;for(I=Ct.createTypedArray(B,E),i=0;i<E;i++)I[i]=n[a++]}o[s++]=new ht({primitiveType:l,geometryType:u,boundingSphere:p,boundingSphereCV:g,indices:I,attributes:A,offsetAttribute:d})}return o};function Wb(e,t){const n=e.length,i=new Float64Array(1+n*19);let o=0;i[o++]=n;for(let s=0;s<n;s++){const a=e[s];if(N.pack(a.modelMatrix,i,o),o+=N.packedLength,h(a.attributes)&&h(a.attributes.offset)){const c=a.attributes.offset.value;i[o]=c[0],i[o+1]=c[1],i[o+2]=c[2]}o+=3}return t.push(i.buffer),i}function jb(e){const t=e,n=new Array(t[0]);let i=0,o=1;for(;o<t.length;){const s=N.unpack(t,o);let a;o+=N.packedLength,h(t[o])&&(a={offset:new hr(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:s,attributes:a}}return n}Nn.packCombineGeometryParameters=function(e,t){const n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:Wb(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Sn,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},Nn.unpackCombineGeometryParameters=function(e){const t=jb(e.packedInstances),n=e.createGeometryResults,i=n.length;let o=0;for(let c=0;c<i;c++){const l=Nn.unpackCreateGeometryResults(n[c]),u=l.length;for(let d=0;d<u;d++){const p=l[d],g=t[o];g.geometry=p,++o}}const s=le.clone(e.ellipsoid),a=e.isGeographic?new Sn(s):new Kt(s);return{instances:t,ellipsoid:s,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Md(e){const t=e.length,n=1+(K.packedLength+1)*t,i=new Float32Array(n);let o=0;i[o++]=t;for(let s=0;s<t;++s){const a=e[s];h(a)?(i[o++]=1,K.pack(e[s],i,o)):i[o++]=0,o+=K.packedLength}return i}function Ud(e){const t=new Array(e[0]);let n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=K.unpack(e,i)),++n,i+=K.packedLength;return t}Nn.packCombineGeometryResults=function(e,t){h(e.geometries)&&qb(e.geometries,t);const n=Md(e.boundingSpheres),i=Md(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}},Nn.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Ud(e.boundingSpheres),boundingSpheresCV:Ud(e.boundingSpheresCV)}};const St=Object.freeze({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6}),fn={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};fn.NUMBER_OF_SHADOW_MODES=4,fn.castShadows=function(e){return e===fn.ENABLED||e===fn.CAST_ONLY},fn.receiveShadows=function(e){return e===fn.ENABLED||e===fn.RECEIVE_ONLY},fn.fromCastReceive=function(e,t){return e&&t?fn.ENABLED:e?fn.CAST_ONLY:t?fn.RECEIVE_ONLY:fn.DISABLED};const ca=Object.freeze(fn);function Oe(e){if(e=_(e,_.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=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=new N,this.show=_(e.show,!0),this._vertexCacheOptimize=_(e.vertexCacheOptimize,!1),this._interleave=_(e.interleave,!1),this._releaseGeometryInstances=_(e.releaseGeometryInstances,!0),this._allowPicking=_(e.allowPicking,!0),this._asynchronous=_(e.asynchronous,!0),this._compressVertices=_(e.compressVertices,!0),this.cull=_(e.cull,!0),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,h(this.rtcCenter)&&(!h(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new C("Relative-to-center rendering only supports one geometry instance.");this.shadows=_(e.shadows,ca.DISABLED),this._translucent=void 0,this._state=St.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,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,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(Oe.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}}});function Yb(e){const t=e.length,n=[],i=e[0].attributes;let o;for(o in i)if(i.hasOwnProperty(o)&&h(i[o])){const s=i[o];let a=!0;for(let c=1;c<t;++c){const l=e[c].attributes[o];if(!h(l)||s.componentDatatype!==l.componentDatatype||s.componentsPerAttribute!==l.componentsPerAttribute||s.normalize!==l.normalize){a=!1;break}}a&&n.push(o)}return n}const Xb=new U,$b=new f,kd=new Y;function Vd(e){const t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,Xb);if(t===3)return f.unpack(e,0,$b);if(t===4)return Y.unpack(e,0,kd)}function Zb(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;const s=Yb(i),a=s.length,c=[],l={},u={};let d,g=i[0].attributes,y,x,E;for(y=0;y<a;++y)x=s[y],E=g[x],l[x]=y,c.push({functionName:`czm_batchTable_${x}`,componentDatatype:E.componentDatatype,componentsPerAttribute:E.componentsPerAttribute,normalize:E.normalize});s.indexOf("distanceDisplayCondition")!==-1&&(c.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:oe.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:oe.FLOAT,componentsPerAttribute:1}),u.center3DHigh=c.length-5,u.center3DLow=c.length-4,u.center2DHigh=c.length-3,u.center2DLow=c.length-2,u.radius=c.length-1),s.indexOf("offset")!==-1&&(c.push({functionName:"czm_batchTable_offset2D",componentDatatype:oe.FLOAT,componentsPerAttribute:3}),d=c.length-1),c.push({functionName:"czm_batchTable_pickColor",componentDatatype:oe.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});const b=c.length,D=new _i(t,c,o);for(y=0;y<o;++y){const A=i[y];g=A.attributes;for(let q=0;q<a;++q){x=s[q],E=g[x];const P=Vd(E.value),V=l[x];D.setBatchedAttribute(y,V,P)}const O={primitive:_(A.pickPrimitive,e)};h(A.id)&&(O.id=A.id);const I=t.createPickId(O);e._pickIds.push(I);const B=I.color,M=kd;M.x=T.floatToByte(B.red),M.y=T.floatToByte(B.green),M.z=T.floatToByte(B.blue),M.w=T.floatToByte(B.alpha),D.setBatchedAttribute(y,b-1,M)}e._batchTable=D,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=d}function Kb(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Bt({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function Qb(e){const t=e.attributes,n=new Pu;for(const o in t)t.hasOwnProperty(o)&&h(t[o])&&(n[o]=Kb(t[o]));let i;if(h(e.indices)){const o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ht({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:K.clone(e.boundingSphere)})}function Jb(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const ew=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Oe._modifyShaderPosition=function(e,t,n){let i,o="",s="",a="";for(;(i=ew.exec(t))!==null;){const c=i[1],l=`vec4 czm_compute${c[0].toUpperCase()}${c.substr(1)}()`;l!=="vec4 czm_computePosition()"&&(o+=`${l};
4660
4660
  `),h(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
4661
4661
  `,s+=`in vec4 position;
4662
4662
  `,a+=`${l}
@@ -4944,13 +4944,13 @@ void main(void)
4944
4944
  #endif // PICK
4945
4945
  }
4946
4946
  `;function kt(e,t,n){m.typeOf.bool("extentsCulling",e),m.typeOf.bool("planarExtents",t),m.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};const i=new pl;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;const o=new pl;if(o.requiresTextureCoordinates=e,n instanceof jt)i.requiresNormalEC=!n.flat;else{const s=`${n.material.shaderSource}
4947
- ${n.fragmentShaderSource}`;i.normalEC=s.indexOf("materialInput.normalEC")!==-1||s.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=s.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=s.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=s.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}kt.prototype.createFragmentShader=function(e){m.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 jt&&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 o="";return t instanceof jt||(o=t.material.shaderSource),new ye({defines:i,sources:[o,ep]})},kt.prototype.createPickFragmentShader=function(e){m.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 ye({defines:n,sources:[ep],pickColorQualifier:"in"})},kt.prototype.createVertexShader=function(e,t,n,i){return m.defined("defines",e),m.typeOf.string("vertexShaderSource",t),m.typeOf.bool("columbusView2D",n),m.defined("mapProjection",i),op(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},kt.prototype.createPickVertexShader=function(e,t,n,i){return m.defined("defines",e),m.typeOf.string("vertexShaderSource",t),m.typeOf.bool("columbusView2D",n),m.defined("mapProjection",i),op(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const tp=new f,np=new ee,ip={high:0,low:0};function op(e,t,n,i,o,s,a,c){const l=i.slice();if(c.eastMostYhighDefine===""){const u=np;u.longitude=S.PI,u.latitude=0,u.height=0;const d=a.project(u,tp);let p=Ye.encode(d.x,ip);c.eastMostYhighDefine=`EAST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,c.eastMostYlowDefine=`EAST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`;const g=np;g.longitude=-S.PI,g.latitude=0,g.height=0;const y=a.project(g,tp);p=Ye.encode(y.x,ip),c.westMostYhighDefine=`WEST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,c.westMostYlowDefine=`WEST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`}return n&&(l.push(c.eastMostYhighDefine),l.push(c.eastMostYlowDefine),l.push(c.westMostYhighDefine),l.push(c.westMostYlowDefine)),h(s)&&s instanceof jt&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new ye({defines:l,sources:[o]})}function pl(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(pl.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}}});function rp(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)/U.distance(t,e)}const bw=[new U,new U,new U,new U];function sp(e,t){const n=bw,i=U.unpack(t,0,n[0]),o=U.unpack(t,2,n[1]),s=U.unpack(t,4,n[2]);e.uMaxVmax=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,s.x,s.y]});const a=1/rp(i,o,s),c=1/rp(i,s,o);e.uvMinAndExtents=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,c]})}const ap=new ee,cp=new f,ww=new f,Tw=new f,ha={high:0,low:0};function lp(e,t,n){const i=ap;i.height=0,i.longitude=e.west,i.latitude=e.south;const o=t.project(i,cp);i.latitude=e.north;const s=t.project(i,ww);i.longitude=e.east,i.latitude=e.south;const a=t.project(i,Tw),c=[0,0,0,0],l=[0,0,0,0];let u=Ye.encode(o.x,ha);c[0]=u.high,l[0]=u.low,u=Ye.encode(o.y,ha),c[1]=u.high,l[1]=u.low,u=Ye.encode(s.y,ha),c[2]=u.high,l[2]=u.low,u=Ye.encode(a.x,ha),c[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:c}),n.planes2D_LOW=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}const Sw=new N,Aw=new N,hp=new f,Dw=new ee,Ow=[new ee,new ee,new ee,new ee,new ee,new ee,new ee,new ee];function vw(e,t,n,i,o,s){const a=ce.center(e,Dw);a.height=n;const c=ee.toCartesian(a,t,hp),l=_e.eastNorthUpToFixedFrame(c,t,Sw),u=N.inverse(l,Aw),d=e.west,p=e.east,g=e.north,y=e.south,x=Ow;x[0].latitude=y,x[0].longitude=d,x[1].latitude=g,x[1].longitude=d,x[2].latitude=g,x[2].longitude=p,x[3].latitude=y,x[3].longitude=p;const E=(d+p)*.5,b=(g+y)*.5;x[4].latitude=y,x[4].longitude=E,x[5].latitude=g,x[5].longitude=E,x[6].latitude=b,x[6].longitude=d,x[7].latitude=b,x[7].longitude=p;let D=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,O=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){x[P].height=n;const V=ee.toCartesian(x[P],t,hp);N.multiplyByPoint(u,V,V),V.z=0,D=Math.min(D,V.x),A=Math.max(A,V.x),O=Math.min(O,V.y),I=Math.max(I,V.y)}const B=i;B.x=D,B.y=O,B.z=0,N.multiplyByPoint(l,B,B);const M=o;M.x=A,M.y=O,M.z=0,N.multiplyByPoint(l,M,M),f.subtract(M,B,o);const q=s;q.x=D,q.y=I,q.z=0,N.multiplyByPoint(l,q,q),f.subtract(q,B,s)}const Iw=new f,Rw=new f,zw=new Ye;kt.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){m.typeOf.object("boundingRectangle",e),m.defined("textureCoordinateRotationPoints",t),m.typeOf.object("ellipsoid",n),m.typeOf.object("projection",i);const s=cp,a=Iw,c=Rw;vw(e,n,_(o,0),s,a,c);const l={};sp(l,t);const u=Ye.fromCartesian(s,zw);return l.southWest_HIGH=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.high,[0,0,0])}),l.southWest_LOW=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.low,[0,0,0])}),l.eastward=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(a,[0,0,0])}),l.northward=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(c,[0,0,0])}),lp(e,i,l),l};const Pw=new f;function fp(e,t,n,i){const o=ap;o.latitude=e,o.longitude=t,o.height=0;const s=ee.toCartesian(o,n,Pw),a=Math.sqrt(s.x*s.x+s.y*s.y),c=S.fastApproximateAtan2(a,s.z),l=S.fastApproximateAtan2(s.x,s.y);return i.x=c,i.y=l,i}const up=new U;kt.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){m.typeOf.object("boundingRectangle",e),m.defined("textureCoordinateRotationPoints",t),m.typeOf.object("ellipsoid",n),m.typeOf.object("projection",i);const o=fp(e.south,e.west,n,up);let s=o.x,a=o.y;const c=fp(e.north,e.east,n,up);let l=c.x,u=c.y,d=0;a>u&&(d=S.PI-a,a=-S.PI,u+=d),s-=S.EPSILON5,a-=S.EPSILON5,l+=S.EPSILON5,u+=S.EPSILON5;const p=1/(u-a),g=1/(l-s),y={sphericalExtents:new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[s,a,g,p]}),longitudeRotation:new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return sp(y,t),lp(e,i,y),y},kt.hasAttributesForTextureCoordinatePlanes=function(e){return h(e.southWest_HIGH)&&h(e.southWest_LOW)&&h(e.northward)&&h(e.eastward)&&h(e.planes2D_HIGH)&&h(e.planes2D_LOW)&&h(e.uMaxVmax)&&h(e.uvMinAndExtents)},kt.hasAttributesForSphericalExtents=function(e){return h(e.sphericalExtents)&&h(e.longitudeRotation)&&h(e.planes2D_HIGH)&&h(e.planes2D_LOW)&&h(e.uMaxVmax)&&h(e.uvMinAndExtents)};function Bw(e){return Math.max(e.width,e.height)>kt.MAX_WIDTH_FOR_PLANAR_EXTENTS}kt.shouldUseSphericalCoordinates=function(e){return m.typeOf.object("rectangle",e),Bw(e)},kt.MAX_WIDTH_FOR_PLANAR_EXTENTS=S.toRadians(1);const Nw={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},Jn=Object.freeze(Nw),Fw={ZERO:R.ZERO,KEEP:R.KEEP,REPLACE:R.REPLACE,INCREMENT:R.INCR,DECREMENT:R.DECR,INVERT:R.INVERT,INCREMENT_WRAP:R.INCR_WRAP,DECREMENT_WRAP:R.DECR_WRAP},We=Object.freeze(Fw),fa={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};fa.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Jn.ALWAYS,frontOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.REPLACE},backFunction:Jn.ALWAYS,backOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.REPLACE},reference:fa.CESIUM_3D_TILE_MASK,mask:fa.CESIUM_3D_TILE_MASK}};const _i=Object.freeze(fa);function Ui(e){e=_(e,_.EMPTY_OBJECT);const t=e.geometryInstances;this.geometryInstances=t,this.show=_(e.show,!0),this.classificationType=_(e.classificationType,pi.BOTH),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=_(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=_(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,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:_(e.vertexCacheOptimize,!1),interleave:_(e.interleave,!1),releaseGeometryInstances:_(e.releaseGeometryInstances,!0),allowPicking:_(e.allowPicking,!0),asynchronous:_(e.asynchronous,!0),compressVertices:_(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Ui.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}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),Ui.isSupported=function(e){return e.context.stencilBuffer};function Vo(e,t){const n=t?Jn.EQUAL:Jn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:We.KEEP,zFail:We.DECREMENT_WRAP,zPass:We.KEEP},backFunction:n,backOperation:{fail:We.KEEP,zFail:We.INCREMENT_WRAP,zPass:We.KEEP},reference:_i.CESIUM_3D_TILE_MASK,mask:_i.CESIUM_3D_TILE_MASK},stencilMask:_i.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dd.LESS_OR_EQUAL},depthMask:!1}}function ml(e){return{stencilTest:{enabled:e,frontFunction:Jn.NOT_EQUAL,frontOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},backFunction:Jn.NOT_EQUAL,backOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},reference:0,mask:_i.CLASSIFICATION_MASK},stencilMask:_i.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:to.PRE_MULTIPLIED_ALPHA_BLEND}}const Lw={stencilTest:{enabled:!0,frontFunction:Jn.NOT_EQUAL,frontOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},backFunction:Jn.NOT_EQUAL,backOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},reference:0,mask:_i.CLASSIFICATION_MASK},stencilMask:_i.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Mw(e,t,n,i){if(h(e._rsStencilDepthPass))return;const o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(Vo(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Vo(o,!0)),e._rsColorPass=Ve.fromCache(ml(o)),e._rsPickPass=Ve.fromCache(Lw)}function Uw(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){const n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
4947
+ ${n.fragmentShaderSource}`;i.normalEC=s.indexOf("materialInput.normalEC")!==-1||s.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=s.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=s.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=s.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}kt.prototype.createFragmentShader=function(e){m.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 jt&&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 o="";return t instanceof jt||(o=t.material.shaderSource),new ye({defines:i,sources:[o,ep]})},kt.prototype.createPickFragmentShader=function(e){m.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 ye({defines:n,sources:[ep],pickColorQualifier:"in"})},kt.prototype.createVertexShader=function(e,t,n,i){return m.defined("defines",e),m.typeOf.string("vertexShaderSource",t),m.typeOf.bool("columbusView2D",n),m.defined("mapProjection",i),op(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},kt.prototype.createPickVertexShader=function(e,t,n,i){return m.defined("defines",e),m.typeOf.string("vertexShaderSource",t),m.typeOf.bool("columbusView2D",n),m.defined("mapProjection",i),op(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const tp=new f,np=new ee,ip={high:0,low:0};function op(e,t,n,i,o,s,a,c){const l=i.slice();if(c.eastMostYhighDefine===""){const u=np;u.longitude=S.PI,u.latitude=0,u.height=0;const d=a.project(u,tp);let p=Ye.encode(d.x,ip);c.eastMostYhighDefine=`EAST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,c.eastMostYlowDefine=`EAST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`;const g=np;g.longitude=-S.PI,g.latitude=0,g.height=0;const y=a.project(g,tp);p=Ye.encode(y.x,ip),c.westMostYhighDefine=`WEST_MOST_X_HIGH ${p.high.toFixed(`${p.high}`.length+1)}`,c.westMostYlowDefine=`WEST_MOST_X_LOW ${p.low.toFixed(`${p.low}`.length+1)}`}return n&&(l.push(c.eastMostYhighDefine),l.push(c.eastMostYlowDefine),l.push(c.westMostYhighDefine),l.push(c.westMostYlowDefine)),h(s)&&s instanceof jt&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new ye({defines:l,sources:[o]})}function pl(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(pl.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}}});function rp(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)/U.distance(t,e)}const bw=[new U,new U,new U,new U];function sp(e,t){const n=bw,i=U.unpack(t,0,n[0]),o=U.unpack(t,2,n[1]),s=U.unpack(t,4,n[2]);e.uMaxVmax=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,s.x,s.y]});const a=1/rp(i,o,s),c=1/rp(i,s,o);e.uvMinAndExtents=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,c]})}const ap=new ee,cp=new f,ww=new f,Tw=new f,ha={high:0,low:0};function lp(e,t,n){const i=ap;i.height=0,i.longitude=e.west,i.latitude=e.south;const o=t.project(i,cp);i.latitude=e.north;const s=t.project(i,ww);i.longitude=e.east,i.latitude=e.south;const a=t.project(i,Tw),c=[0,0,0,0],l=[0,0,0,0];let u=Ye.encode(o.x,ha);c[0]=u.high,l[0]=u.low,u=Ye.encode(o.y,ha),c[1]=u.high,l[1]=u.low,u=Ye.encode(s.y,ha),c[2]=u.high,l[2]=u.low,u=Ye.encode(a.x,ha),c[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:c}),n.planes2D_LOW=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}const Sw=new N,Aw=new N,hp=new f,Dw=new ee,Ow=[new ee,new ee,new ee,new ee,new ee,new ee,new ee,new ee];function vw(e,t,n,i,o,s){const a=ce.center(e,Dw);a.height=n;const c=ee.toCartesian(a,t,hp),l=_e.eastNorthUpToFixedFrame(c,t,Sw),u=N.inverse(l,Aw),d=e.west,p=e.east,g=e.north,y=e.south,x=Ow;x[0].latitude=y,x[0].longitude=d,x[1].latitude=g,x[1].longitude=d,x[2].latitude=g,x[2].longitude=p,x[3].latitude=y,x[3].longitude=p;const E=(d+p)*.5,b=(g+y)*.5;x[4].latitude=y,x[4].longitude=E,x[5].latitude=g,x[5].longitude=E,x[6].latitude=b,x[6].longitude=d,x[7].latitude=b,x[7].longitude=p;let D=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,O=Number.POSITIVE_INFINITY,I=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){x[P].height=n;const V=ee.toCartesian(x[P],t,hp);N.multiplyByPoint(u,V,V),V.z=0,D=Math.min(D,V.x),A=Math.max(A,V.x),O=Math.min(O,V.y),I=Math.max(I,V.y)}const B=i;B.x=D,B.y=O,B.z=0,N.multiplyByPoint(l,B,B);const M=o;M.x=A,M.y=O,M.z=0,N.multiplyByPoint(l,M,M),f.subtract(M,B,o);const q=s;q.x=D,q.y=I,q.z=0,N.multiplyByPoint(l,q,q),f.subtract(q,B,s)}const Iw=new f,Rw=new f,zw=new Ye;kt.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){m.typeOf.object("boundingRectangle",e),m.defined("textureCoordinateRotationPoints",t),m.typeOf.object("ellipsoid",n),m.typeOf.object("projection",i);const s=cp,a=Iw,c=Rw;vw(e,n,_(o,0),s,a,c);const l={};sp(l,t);const u=Ye.fromCartesian(s,zw);return l.southWest_HIGH=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.high,[0,0,0])}),l.southWest_LOW=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.low,[0,0,0])}),l.eastward=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(a,[0,0,0])}),l.northward=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(c,[0,0,0])}),lp(e,i,l),l};const Pw=new f;function fp(e,t,n,i){const o=ap;o.latitude=e,o.longitude=t,o.height=0;const s=ee.toCartesian(o,n,Pw),a=Math.sqrt(s.x*s.x+s.y*s.y),c=S.fastApproximateAtan2(a,s.z),l=S.fastApproximateAtan2(s.x,s.y);return i.x=c,i.y=l,i}const up=new U;kt.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){m.typeOf.object("boundingRectangle",e),m.defined("textureCoordinateRotationPoints",t),m.typeOf.object("ellipsoid",n),m.typeOf.object("projection",i);const o=fp(e.south,e.west,n,up);let s=o.x,a=o.y;const c=fp(e.north,e.east,n,up);let l=c.x,u=c.y,d=0;a>u&&(d=S.PI-a,a=-S.PI,u+=d),s-=S.EPSILON5,a-=S.EPSILON5,l+=S.EPSILON5,u+=S.EPSILON5;const p=1/(u-a),g=1/(l-s),y={sphericalExtents:new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[s,a,g,p]}),longitudeRotation:new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return sp(y,t),lp(e,i,y),y},kt.hasAttributesForTextureCoordinatePlanes=function(e){return h(e.southWest_HIGH)&&h(e.southWest_LOW)&&h(e.northward)&&h(e.eastward)&&h(e.planes2D_HIGH)&&h(e.planes2D_LOW)&&h(e.uMaxVmax)&&h(e.uvMinAndExtents)},kt.hasAttributesForSphericalExtents=function(e){return h(e.sphericalExtents)&&h(e.longitudeRotation)&&h(e.planes2D_HIGH)&&h(e.planes2D_LOW)&&h(e.uMaxVmax)&&h(e.uvMinAndExtents)};function Bw(e){return Math.max(e.width,e.height)>kt.MAX_WIDTH_FOR_PLANAR_EXTENTS}kt.shouldUseSphericalCoordinates=function(e){return m.typeOf.object("rectangle",e),Bw(e)},kt.MAX_WIDTH_FOR_PLANAR_EXTENTS=S.toRadians(1);const Nw={NEVER:R.NEVER,LESS:R.LESS,EQUAL:R.EQUAL,LESS_OR_EQUAL:R.LEQUAL,GREATER:R.GREATER,NOT_EQUAL:R.NOTEQUAL,GREATER_OR_EQUAL:R.GEQUAL,ALWAYS:R.ALWAYS},Jn=Object.freeze(Nw),Fw={ZERO:R.ZERO,KEEP:R.KEEP,REPLACE:R.REPLACE,INCREMENT:R.INCR,DECREMENT:R.DECR,INVERT:R.INVERT,INCREMENT_WRAP:R.INCR_WRAP,DECREMENT_WRAP:R.DECR_WRAP},We=Object.freeze(Fw),fa={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};fa.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Jn.ALWAYS,frontOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.REPLACE},backFunction:Jn.ALWAYS,backOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.REPLACE},reference:fa.CESIUM_3D_TILE_MASK,mask:fa.CESIUM_3D_TILE_MASK}};const gi=Object.freeze(fa);function ki(e){e=_(e,_.EMPTY_OBJECT);const t=e.geometryInstances;this.geometryInstances=t,this.show=_(e.show,!0),this.classificationType=_(e.classificationType,mi.BOTH),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=_(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=_(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,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:_(e.vertexCacheOptimize,!1),interleave:_(e.interleave,!1),releaseGeometryInstances:_(e.releaseGeometryInstances,!0),allowPicking:_(e.allowPicking,!0),asynchronous:_(e.asynchronous,!0),compressVertices:_(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(ki.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}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),ki.isSupported=function(e){return e.context.stencilBuffer};function Vo(e,t){const n=t?Jn.EQUAL:Jn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:We.KEEP,zFail:We.DECREMENT_WRAP,zPass:We.KEEP},backFunction:n,backOperation:{fail:We.KEEP,zFail:We.INCREMENT_WRAP,zPass:We.KEEP},reference:gi.CESIUM_3D_TILE_MASK,mask:gi.CESIUM_3D_TILE_MASK},stencilMask:gi.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:dd.LESS_OR_EQUAL},depthMask:!1}}function ml(e){return{stencilTest:{enabled:e,frontFunction:Jn.NOT_EQUAL,frontOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},backFunction:Jn.NOT_EQUAL,backOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},reference:0,mask:gi.CLASSIFICATION_MASK},stencilMask:gi.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:no.PRE_MULTIPLIED_ALPHA_BLEND}}const Lw={stencilTest:{enabled:!0,frontFunction:Jn.NOT_EQUAL,frontOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},backFunction:Jn.NOT_EQUAL,backOperation:{fail:We.ZERO,zFail:We.ZERO,zPass:We.ZERO},reference:0,mask:gi.CLASSIFICATION_MASK},stencilMask:gi.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Mw(e,t,n,i){if(h(e._rsStencilDepthPass))return;const o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(Vo(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(Vo(o,!0)),e._rsColorPass=Ve.fromCache(ml(o)),e._rsPickPass=Ve.fromCache(Lw)}function Uw(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){const n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
4948
4948
  `,s=` extrudeDirection = czm_octDecode(${n}, 65535.0);
4949
4949
  `;let a=t;a=a.replace(/in\s+vec3\s+extrudeDirection;/g,""),a=ye.replaceMain(a,"czm_non_compressed_main");const c=`void main()
4950
4950
  {
4951
4951
  ${s} czm_non_compressed_main();
4952
4952
  }`;return[i,o,a,c].join(`
4953
- `)}}function kw(e,t){const n=t.context,i=e._primitive;let o=GE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Oe._appendDistanceDisplayConditionToShader(i,o),o=Oe._modifyShaderPosition(e,o,t.scene3DOnly),o=Oe._updateColorAttribute(i,o);const s=e._hasPlanarExtentsAttributes,a=s||e._hasSphericalExtentsAttribute;e._extruded&&(o=Uw(i,o));const c=e._extruded?"EXTRUDED_GEOMETRY":"";let l=new ye({defines:[c],sources:[o]});const u=new ye({sources:[qE]}),d=e._primitive._attributeLocations,p=new kt(a,s,e.appearance);if(e._spStencil=ot.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d}),e._primitive.allowPicking){let x=ye.createPickVertexShaderSource(o);x=Oe._appendShowToShader(i,x),x=Oe._updatePickColorAttribute(x);const E=p.createPickFragmentShader(!1),b=p.createPickVertexShader([c],x,!1,t.mapProjection);if(e._spPick=ot.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:E,attributeLocations:d}),a){let D=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!h(D)){const A=p.createPickFragmentShader(!0),O=p.createPickVertexShader([c],x,!0,t.mapProjection);D=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:O,fragmentShaderSource:A,attributeLocations:d})}e._spPick2D=D}}else e._spPick=ot.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d});o=Oe._appendShowToShader(i,o),l=new ye({defines:[c],sources:[o]}),e._sp=ot.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d});const g=p.createFragmentShader(!1),y=p.createVertexShader([c],o,!1,t.mapProjection);if(e._spColor=ot.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:y,fragmentShaderSource:g,attributeLocations:d}),a){let x=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!h(x)){const E=p.createFragmentShader(!0),b=p.createVertexShader([c],o,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:E,attributeLocations:d})}e._spColor2D=x}}function Vw(e,t){const n=e._primitive;let i=n._va.length*2;t.length=i;let o,s,a,c=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap);const u=e._needs2DShader;for(o=0;o<i;o+=2){const y=n._va[c++];s=t[o],h(s)||(s=t[o]=new $e({owner:e,primitiveType:n._primitiveType})),s.vertexArray=y,s.renderState=e._rsStencilDepthPass,s.shaderProgram=e._sp,s.uniformMap=l,s.pass=Pt.TERRAIN_CLASSIFICATION,a=$e.shallowClone(s,s.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=a,s=t[o+1],h(s)||(s=t[o+1]=new $e({owner:e,primitiveType:n._primitiveType})),s.vertexArray=y,s.renderState=e._rsColorPass,s.shaderProgram=e._spColor,s.pass=Pt.TERRAIN_CLASSIFICATION;const E=e.appearance.material;if(h(E)&&(l=nn(l,E._uniforms)),s.uniformMap=l,a=$e.shallowClone(s,s.derivedCommands.tileset),a.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=a,u){let b=$e.shallowClone(s,s.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b,b=$e.shallowClone(a,a.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=b}}const d=e._commandsIgnoreShow,p=e._spStencil;let g=0;i=d.length=i/2;for(let y=0;y<i;++y){const x=d[y]=$e.shallowClone(t[g],d[y]);x.shaderProgram=p,x.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,g+=2}}function Gw(e,t){const n=e._usePickOffsets,i=e._primitive;let o=i._va.length*2,s,a=0,c;n&&(s=i._pickOffsets,o=s.length*2),t.length=o;let l,u,d,p=0;const g=i._batchTable.getUniformMapCallback()(e._uniformMap),y=e._needs2DShader;for(l=0;l<o;l+=2){let x=i._va[p++];if(n&&(c=s[a++],x=i._va[c.index]),u=t[l],h(u)||(u=t[l]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=x,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=g,u.pass=Pt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.renderState=e._rsStencilDepthPass3DTiles,d.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=d,u=t[l+1],h(u)||(u=t[l+1]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=x,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=g,u.pass=Pt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=d,y){let E=$e.shallowClone(u,u.derivedCommands.pick2D);E.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=E,E=$e.shallowClone(d,d.derivedCommands.pick2D),E.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=E}}}function qw(e,t,n,i,o,s,a){Vw(e,s),Gw(e,a)}function dp(e,t){return Math.floor(e%t/2)}function _l(e,t,n,i,o,s){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=s,t.commandList.push(e)}function pp(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function Hw(e,t,n,i,o,s,a,c){const l=e._primitive;Oe._updateBoundingVolumes(l,t,o);let u;t.mode===me.SCENE3D?u=l._boundingSphereWC:t.mode===me.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===me.SCENE2D&&h(l._boundingSphere2D)?u=l._boundingSphere2D:h(l._boundingSphereMorph)&&(u=l._boundingSphereMorph);const d=e.classificationType,p=d!==pi.CESIUM_3D_TILE,g=d!==pi.TERRAIN,y=t.passes;let x,E,b;if(y.render){const D=n.length;for(x=0;x<D;++x)E=u[dp(x,D)],p&&(b=n[x],_l(b,t,o,s,E,a)),g&&(b=n[x].derivedCommands.tileset,_l(b,t,o,s,E,a));if(t.invertClassification){const A=e._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=u[x],b=A[x],_l(b,t,o,s,E,a)}}if(y.pick){const D=i.length,A=l._pickOffsets;for(x=0;x<D;++x){const O=A[dp(x,D)];E=u[O.index],p&&(b=i[x],pp(b,t,o,s,E)),g&&(b=i[x].derivedCommands.tileset,pp(b,t,o,s,E))}}}Ui.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;let t=this.appearance;h(t)&&h(t.material)&&t.material.update(e.context);const n=this,i=this._primitiveOptions;if(!h(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length;let a,c,l,u=!1,d=!0,p,g=!1,y=!1;for(s>0&&(l=o[0].attributes,g=kt.hasAttributesForSphericalExtents(l),y=kt.hasAttributesForTextureCoordinatePlanes(l),p=l.color),a=0;a<s;a++){c=o[a];const E=c.attributes.color;if(h(E))u=!0;else if(u)throw new C("All GeometryInstances must have color attributes to use per-instance color.");d=d&&h(E)&&Ro.equals(p,E)}if(!d&&!g&&!y)throw new C("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(u&&!h(t)&&(t=new jt({flat:!0}),this.appearance=t),!u&&t instanceof jt)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(h(t.material)&&!g&&!y)throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!g&&!y,this._hasSphericalExtentsAttribute=g,this._hasPlanarExtentsAttributes=y,this._hasPerColorAttribute=u;const x=new Array(s);for(a=0;a<s;++a)c=o[a],x[a]=new Zs({geometry:c.geometry,attributes:c.attributes,modelMatrix:c.modelMatrix,id:c.id,pickPrimitive:_(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=x,h(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(E,b){n._createBoundingVolumeFunction(E,b)}),i._createRenderStatesFunction=function(E,b,D,A){Mw(n)},i._createShaderProgramFunction=function(E,b,D){kw(n,b)},i._createCommandsFunction=function(E,b,D,A,O,I,B){qw(n,void 0,void 0,!0,!1,I,B)},h(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(E,b,D,A,O,I,B,M){n._updateAndQueueCommandsFunction(E,b,D,A,O,I,B,M)}:i._updateAndQueueCommandsFunction=function(E,b,D,A,O,I,B,M){Hw(n,b,D,A,O,I,B)},this._primitive=new Oe(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(Vo(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(Vo(!1,!0)),this._rsColorPass=Ve.fromCache(ml(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(Vo(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(Vo(!0,!0)),this._rsColorPass=Ve.fromCache(ml(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&h(t.material))throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof jt)throw new C("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(()=>{h(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},Ui.prototype.getGeometryInstanceAttributes=function(e){if(!h(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},Ui.prototype.isDestroyed=function(){return!1},Ui.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,Qe(this)};const Ww={u_globeMinimumAltitude:function(){return 55e3}};function sn(e){e=_(e,_.EMPTY_OBJECT);let t=e.appearance;const n=e.geometryInstances;if(!h(t)&&h(n)){const o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a<s;a++){const c=o[a].attributes;if(h(c)&&h(c.color)){t=new jt({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=_(e.show,!0),this.classificationType=_(e.classificationType,pi.BOTH),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=_(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Me._defaultMaxTerrainHeight,this._minTerrainHeight=Me._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;const i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:_(e.vertexCacheOptimize,!1),interleave:_(e.interleave,!1),releaseGeometryInstances:_(e.releaseGeometryInstances,!0),allowPicking:_(e.allowPicking,!0),asynchronous:_(e.asynchronous,!0),compressVertices:_(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:Ww}}Object.defineProperties(sn.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}}}),sn.isSupported=Ui.isSupported;function mp(e){return function(t,n){const i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function _p(e){return function(t,n){return e._minHeight}}const jw=new f,Yw=new f,Xw=new f,$w=new ee,Zw=new ce;function ua(e,t){const n=e.mapProjection.ellipsoid;if(!h(t.attributes)||!h(t.attributes.position3DHigh))return h(t.rectangle)?t.rectangle:void 0;const i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,s=i.length;let a=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let p=0;p<s;p+=3){const g=f.unpack(i,p,jw),y=f.unpack(o,p,Yw),x=f.add(g,y,Xw),E=n.cartesianToCartographic(x,$w),b=E.latitude,D=E.longitude;a=Math.min(a,b),c=Math.min(c,D),l=Math.max(l,b),u=Math.max(u,D)}const d=Zw;return d.north=l,d.south=a,d.east=u,d.west=c,d}function Kw(e,t,n){const i=Me.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function Qw(e,t,n){const i=t.mapProjection.ellipsoid,o=ua(t,n),s=Re.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(s),!t.scene3DOnly){const a=t.mapProjection,c=K.fromRectangleWithHeights2D(o,a,e._maxHeight,e._minHeight);f.fromElements(c.center.z,c.center.x,c.center.y,c.center),e._boundingVolumes2D.push(c)}}function gl(e,t){return Math.floor(e%t/2)}function yl(e,t,n,i,o,s,a){const c=e._primitive;n.mode!==me.SCENE3D&&t.shaderProgram===c._spColor&&c._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=s,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function gp(e,t,n,i,o,s){const a=e._primitive;n.mode!==me.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=s,t.cull=o,n.commandList.push(t)}function Jw(e,t,n,i,o,s,a,c){let l;t.mode===me.SCENE3D?l=e._boundingVolumes:l=e._boundingVolumes2D;const u=e.classificationType,d=u!==pi.CESIUM_3D_TILE,p=u!==pi.TERRAIN,g=t.passes,y=e._primitive;let x,E,b;if(g.render){const D=n.length;for(x=0;x<D;++x)E=l[gl(x,D)],d&&(b=n[x],yl(e,b,t,o,s,E,a)),p&&(b=n[x].derivedCommands.tileset,yl(e,b,t,o,s,E,a));if(t.invertClassification){const A=y._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=l[x],b=A[x],yl(e,b,t,o,s,E,a)}}if(g.pick){const D=i.length;let A;for(e._useFragmentCulling||(A=y._primitive._pickOffsets),x=0;x<D;++x){if(E=l[gl(x,D)],!e._useFragmentCulling){const O=A[gl(x,D)];E=l[O.index]}d&&(b=i[x],gp(e,b,t,o,s,E)),p&&(b=i[x].derivedCommands.tileset,gp(e,b,t,o,s,E))}}}sn.initializeTerrainHeights=function(){return Me.initialize()},sn.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;if(!Me.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");sn.initializeTerrainHeights();return}const t=this,n=this._classificationPrimitiveOptions;if(!h(this._primitive)){const i=e.mapProjection.ellipsoid;let o,s,a;const c=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],l=c.length,u=new Array(l);let d,p;for(d=0;d<l;++d){o=c[d],s=o.geometry;const E=ua(e,s);h(p)?h(E)&&ce.union(p,E,p):p=ce.clone(E);const b=o.id;if(h(b)&&h(E)){const D=Me.getBoundingSphere(E,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(D)}if(a=s.constructor,!h(a)||!h(a.createShadowVolume))throw new C("Not all of the geometry instances have GroundPrimitive support.")}Kw(this,p,i);const g=e.verticalExaggeration,y=e.verticalExaggerationRelativeHeight;this._minHeight=_r.getHeight(this._minTerrainHeight,g,y),this._maxHeight=_r.getHeight(this._maxTerrainHeight,g,y);const x=sn._supportsMaterials(e.context);if(this._useFragmentCulling=x,x){let E,b=!0;for(d=0;d<l;++d)if(o=c[d],s=o.geometry,p=ua(e,s),kt.shouldUseSphericalCoordinates(p)){b=!1;break}for(d=0;d<l;++d){o=c[d],s=o.geometry,a=s.constructor;const D=ua(e,s),A=s.textureCoordinateRotationPoints;b?E=kt.getPlanarTextureCoordinateAttributes(D,A,i,e.mapProjection,this._maxHeight):E=kt.getSphericalExtentGeometryInstanceAttributes(D,A,i,e.mapProjection);const O=o.attributes;for(const I in O)O.hasOwnProperty(I)&&(E[I]=O[I]);u[d]=new Zs({geometry:a.createShadowVolume(s,_p(this),mp(this)),attributes:E,id:o.id})}}else for(d=0;d<l;++d)o=c[d],s=o.geometry,a=s.constructor,u[d]=new Zs({geometry:a.createShadowVolume(s,_p(this),mp(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(E,b){Qw(t,E,b)},n._updateAndQueueCommandsFunction=function(E,b,D,A,O,I,B,M){Jw(t,b,D,A,O,I,B)},this._primitive=new Ui(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(()=>{!this._ready&&h(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},sn.prototype.getBoundingSphere=function(e){const t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},sn.prototype.getGeometryInstanceAttributes=function(e){if(!h(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},sn.prototype.isDestroyed=function(){return!1},sn.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),Qe(this)},sn._supportsMaterials=function(e){return e.depthTexture},sn.supportsMaterials=function(e){return m.typeOf.object("scene",e),sn._supportsMaterials(e.frameState.context)};const ei=Object.freeze({NONE:0,GEODESIC:1,RHUMB:2}),yp=S.EPSILON10;function eT(e,t,n,i){if(m.defined("equalsEpsilon",t),!h(e))return;n=_(n,!1);const o=h(i),s=e.length;if(s<2)return e;let a,c=e[0],l,u,d=0,p=-1;for(a=1;a<s;++a)l=e[a],t(c,l,yp)?(h(u)||(u=e.slice(0,a),d=a-1,p=0),o&&i.push(a)):(h(u)&&(u.push(l),d=a,o&&(p=i.length)),c=l);return n&&t(e[0],e[s-1],yp)&&(o&&(h(u)?i.splice(p,0,d):i.push(s-1)),h(u)?u.length-=1:u=e.slice(0,-1)),h(u)?u:e}function tT(e){const t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,s=Math.cos(e._startHeading),a=Math.sin(e._startHeading),c=(1-o)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+c*c),u=l*c,d=Math.atan2(c,s),p=l*a,g=p*p,y=1-g,x=Math.sqrt(y),E=t/4,b=E*E,D=b*E,A=b*b,O=1+E-3*b/4+5*D/4-175*A/64,I=1-E+15*b/8-35*D/8,B=1-3*E+35*b/4,M=1-5*E,q=O*d-I*Math.sin(2*d)*E/2-B*Math.sin(4*d)*b/16-M*Math.sin(6*d)*D/48-Math.sin(8*d)*5*A/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=s,P.sineHeading=a,P.tanU=c,P.cosineU=l,P.sineU=u,P.sigma=d,P.sineAlpha=p,P.sineSquaredAlpha=g,P.cosineSquaredAlpha=y,P.cosineAlpha=x,P.u2Over4=E,P.u4Over16=b,P.u6Over64=D,P.u8Over256=A,P.a0=O,P.a1=I,P.a2=B,P.a3=M,P.distanceRatio=q}function nT(e,t){return e*t*(4+e*(4-3*t))/16}function xp(e,t,n,i,o,s,a){const c=nT(e,n);return(1-c)*e*t*(i+c*o*(a+c*s*(2*a*a-1)))}function iT(e,t,n,i,o,s,a){const c=(t-n)/t,l=s-i,u=Math.atan((1-c)*Math.tan(o)),d=Math.atan((1-c)*Math.tan(a)),p=Math.cos(u),g=Math.sin(u),y=Math.cos(d),x=Math.sin(d),E=p*y,b=p*x,D=g*x,A=g*y;let O=l,I=S.TWO_PI,B=Math.cos(O),M=Math.sin(O),q,P,V,k,H;do{B=Math.cos(O),M=Math.sin(O);const X=b-A*B;V=Math.sqrt(y*y*M*M+X*X),P=D+E*B,q=Math.atan2(V,P);let ie;V===0?(ie=0,k=1):(ie=E*M/V,k=1-ie*ie),I=O,H=P-2*D/k,isFinite(H)||(H=0),O=l+xp(c,ie,k,q,V,P,H)}while(Math.abs(O-I)>S.EPSILON12);const j=k*(t*t-n*n)/(n*n),r=1+j*(4096+j*(j*(320-175*j)-768))/16384,w=j*(256+j*(j*(74-47*j)-128))/1024,v=H*H,z=w*V*(H+w*(P*(2*v-1)-w*H*(4*V*V-3)*(4*v-3)/6)/4),G=n*r*(q-z),W=Math.atan2(y*M,b-A*B),Z=Math.atan2(p*M,b*B-A);e._distance=G,e._startHeading=W,e._endHeading=Z,e._uSquared=j}const oT=new f,xl=new f;function Cp(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,xl),oT),s=f.normalize(i.cartographicToCartesian(n,xl),xl);m.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(f.angleBetween(o,s))-Math.PI),.0125),iT(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=ee.clone(t,e._start),e._end=ee.clone(n,e._end),e._start.height=0,e._end.height=0,tT(e)}function Tr(e,t,n){const i=_(n,le.default);this._ellipsoid=i,this._start=new ee,this._end=new ee,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,h(e)&&h(t)&&Cp(this,e,t,i)}Object.defineProperties(Tr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return m.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return m.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return m.defined("distance",this._distance),this._endHeading}}}),Tr.prototype.setEndPoints=function(e,t){m.defined("start",e),m.defined("end",t),Cp(this,e,t,this._ellipsoid)},Tr.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},Tr.prototype.interpolateUsingSurfaceDistance=function(e,t){m.defined("distance",this._distance);const n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),s=Math.cos(4*i),a=Math.cos(6*i),c=Math.sin(2*i),l=Math.sin(4*i),u=Math.sin(6*i),d=Math.sin(8*i),p=i*i,g=i*p,y=n.u8Over256,x=n.u2Over4,E=n.u6Over64,b=n.u4Over16;let D=2*g*y*o/3+i*(1-x+7*b/4-15*E/4+579*y/64-(b-15*E/4+187*y/16)*o-(5*E/4-115*y/16)*s-29*y*a/16)+(x/2-b+71*E/32-85*y/16)*c+(5*b/16-5*E/4+383*y/96)*l-p*((E-11*y/2)*c+5*y*l/2)+(29*E/96-29*y/16)*u+539*y*d/1536;const A=Math.asin(Math.sin(D)*n.cosineAlpha),O=Math.atan(n.a/n.b*Math.tan(A));D=D-n.sigma;const I=Math.cos(2*n.sigma+D),B=Math.sin(D),M=Math.cos(D),q=n.cosineU*M,P=n.sineU*B,k=Math.atan2(B*n.sineHeading,q-P*n.cosineHeading)-xp(n.f,n.sineAlpha,n.cosineSquaredAlpha,D,B,M,I);return h(t)?(t.longitude=this._start.longitude+k,t.latitude=O,t.height=0,t):new ee(this._start.longitude+k,O,0)};function Cl(e,t,n){if(e===0)return t*n;const i=e*e,o=i*i,s=o*i,a=s*i,c=a*i,l=c*i,u=n,d=Math.sin(2*u),p=Math.sin(4*u),g=Math.sin(6*u),y=Math.sin(8*u),x=Math.sin(10*u),E=Math.sin(12*u);return t*((1-i/4-3*o/64-5*s/256-175*a/16384-441*c/65536-4851*l/1048576)*u-(3*i/8+3*o/32+45*s/1024+105*a/4096+2205*c/131072+6237*l/524288)*d+(15*o/256+45*s/1024+525*a/16384+1575*c/65536+155925*l/8388608)*p-(35*s/3072+175*a/12288+3675*c/262144+13475*l/1048576)*g+(315*a/131072+2205*c/524288+43659*l/8388608)*y-(693*c/1310720+6237*l/5242880)*x+1001*l/8388608*E)}function rT(e,t,n){const i=e/n;if(t===0)return i;const o=i*i,s=o*i,a=s*i,c=t,l=c*c,u=l*l,d=u*l,p=d*l,g=p*l,y=g*l,x=Math.sin(2*i),E=Math.cos(2*i),b=Math.sin(4*i),D=Math.cos(4*i),A=Math.sin(6*i),O=Math.cos(6*i),I=Math.sin(8*i),B=Math.cos(8*i),M=Math.sin(10*i),q=Math.cos(10*i),P=Math.sin(12*i);return i+i*l/4+7*i*u/64+15*i*d/256+579*i*p/16384+1515*i*g/65536+16837*i*y/1048576+(3*i*u/16+45*i*d/256-i*(32*o-561)*p/4096-i*(232*o-1677)*g/16384+i*(399985-90560*o+512*a)*y/5242880)*E+(21*i*d/256+483*i*p/4096-i*(224*o-1969)*g/16384-i*(33152*o-112599)*y/1048576)*D+(151*i*p/4096+4681*i*g/65536+1479*i*y/16384-453*s*y/32768)*O+(1097*i*g/65536+42783*i*y/1048576)*B+8011*i*y/1048576*q+(3*l/8+3*u/16+213*d/2048-3*o*d/64+255*p/4096-33*o*p/512+20861*g/524288-33*o*g/512+a*g/1024+28273*y/1048576-471*o*y/8192+9*a*y/4096)*x+(21*u/256+21*d/256+533*p/8192-21*o*p/512+197*g/4096-315*o*g/4096+584039*y/16777216-12517*o*y/131072+7*a*y/2048)*b+(151*d/6144+151*p/4096+5019*g/131072-453*o*g/16384+26965*y/786432-8607*o*y/131072)*A+(1097*p/131072+1097*g/65536+225797*y/10485760-1097*o*y/65536)*I+(8011*g/2621440+8011*y/1048576)*M+293393*y/251658240*P}function Go(e,t){if(e===0)return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)));const n=e*Math.sin(t);return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function sT(e,t,n,i,o){const s=Go(e._ellipticity,n),a=Go(e._ellipticity,o);return Math.atan2(S.negativePiToPi(i-t),a-s)}function aT(e,t,n,i,o,s,a){const c=e._heading,l=s-i;let u=0;if(S.equalsEpsilon(Math.abs(c),S.PI_OVER_TWO,S.EPSILON8))if(t===n)u=t*Math.cos(o)*S.negativePiToPi(l);else{const d=Math.sin(o);u=t*Math.cos(o)*S.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*d*d)}else{const d=Cl(e._ellipticity,t,o);u=(Cl(e._ellipticity,t,a)-d)/Math.cos(c)}return Math.abs(u)}const cT=new f,El=new f;function Ep(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,El),cT),s=f.normalize(i.cartographicToCartesian(n,El),El);m.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(f.angleBetween(o,s))-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=ee.clone(t,e._start),e._start.height=0,e._end=ee.clone(n,e._end),e._end.height=0,e._heading=sT(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=aT(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function bp(e,t,n,i,o,s){if(n===0)return ee.clone(e,s);const a=o*o;let c,l,u;if(Math.abs(S.PI_OVER_TWO-Math.abs(t))>S.EPSILON8){const d=Cl(o,i,e.latitude),p=n*Math.cos(t),g=d+p;if(l=rT(g,o,i),Math.abs(t)<S.EPSILON10)c=S.negativePiToPi(e.longitude);else{const y=Go(o,e.latitude),x=Go(o,l);u=Math.tan(t)*(x-y),c=S.negativePiToPi(e.longitude+u)}}else{l=e.latitude;let d;if(o===0)d=i*Math.cos(e.latitude);else{const p=Math.sin(e.latitude);d=i*Math.cos(e.latitude)/Math.sqrt(1-a*p*p)}u=n/d,t>0?c=S.negativePiToPi(e.longitude+u):c=S.negativePiToPi(e.longitude-u)}return h(s)?(s.longitude=c,s.latitude=l,s.height=0,s):new ee(c,l,0)}function ti(e,t,n){const i=_(n,le.default);this._ellipsoid=i,this._start=new ee,this._end=new ee,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,h(e)&&h(t)&&Ep(this,e,t,i)}Object.defineProperties(ti.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return m.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return m.defined("distance",this._distance),this._heading}}}),ti.fromStartHeadingDistance=function(e,t,n,i,o){m.defined("start",e),m.defined("heading",t),m.defined("distance",n),m.typeOf.number.greaterThan("distance",n,0);const s=_(i,le.default),a=s.maximumRadius,c=s.minimumRadius,l=a*a,u=c*c,d=Math.sqrt((l-u)/l);t=S.negativePiToPi(t);const p=bp(e,t,n,s.maximumRadius,d);return!h(o)||h(i)&&!i.equals(o.ellipsoid)?new ti(e,p,s):(o.setEndPoints(e,p),o)},ti.prototype.setEndPoints=function(e,t){m.defined("start",e),m.defined("end",t),Ep(this,e,t,this._ellipsoid)},ti.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},ti.prototype.interpolateUsingSurfaceDistance=function(e,t){if(m.typeOf.number("distance",e),!h(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");return bp(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},ti.prototype.findIntersectionWithLongitude=function(e,t){if(m.typeOf.number("intersectionLongitude",e),!h(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=Math.abs(i),s=this._start;if(e=S.negativePiToPi(e),S.equalsEpsilon(Math.abs(e),Math.PI,S.EPSILON14)&&(e=S.sign(s.longitude)*Math.PI),h(t)||(t=new ee),Math.abs(S.PI_OVER_TWO-o)<=S.EPSILON8)return t.longitude=e,t.latitude=s.latitude,t.height=0,t;if(S.equalsEpsilon(Math.abs(S.PI_OVER_TWO-o),S.PI_OVER_TWO,S.EPSILON8))return S.equalsEpsilon(e,s.longitude,S.EPSILON12)?void 0:(t.longitude=e,t.latitude=S.PI_OVER_TWO*S.sign(S.PI_OVER_TWO-i),t.height=0,t);const a=s.latitude,c=n*Math.sin(a),l=Math.tan(.5*(S.PI_OVER_TWO+a))*Math.exp((e-s.longitude)/Math.tan(i)),u=(1+c)/(1-c);let d=s.latitude,p;do{p=d;const g=n*Math.sin(p),y=(1+g)/(1-g);d=2*Math.atan(l*Math.pow(y/u,n/2))-S.PI_OVER_TWO}while(!S.equalsEpsilon(d,p,S.EPSILON12));return t.longitude=e,t.latitude=d,t.height=0,t},ti.prototype.findIntersectionWithLatitude=function(e,t){if(m.typeOf.number("intersectionLatitude",e),!h(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=this._start;if(S.equalsEpsilon(Math.abs(i),S.PI_OVER_TWO,S.EPSILON8))return;const s=Go(n,o.latitude),a=Go(n,e),c=Math.tan(i)*(a-s),l=S.negativePiToPi(o.longitude+c);return h(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new ee(l,e,0)};const bl=[Sn,Kt],lT=bl.length,wp=Math.cos(S.toRadians(30)),Tp=Math.cos(S.toRadians(150)),Sp=0,Ap=1e3;function ki(e){e=_(e,_.EMPTY_OBJECT);const t=e.positions;if(!h(t)||t.length<2)throw new C("At least two positions are required.");if(h(e.arcType)&&e.arcType!==ei.GEODESIC&&e.arcType!==ei.RHUMB)throw new C("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=_(e.width,1),this._positions=t,this.granularity=_(e.granularity,9999),this.loop=_(e.loop,!1),this.arcType=_(e.arcType,ei.GEODESIC),this._ellipsoid=le.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(ki.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+le.packedLength+1+1}}}),ki.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<lT;i++)if(t instanceof bl[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const hT=new f,Dp=new f,Op=new f;function wl(e,t,n,i,o){const s=Qt(i,e,0,hT),a=Qt(i,e,n,Dp),c=Qt(i,t,0,Op),l=gi(a,s,Dp),u=gi(c,s,Op);return f.cross(u,l,o),f.normalize(o,o)}const fT=new ee,uT=new f,dT=new f,pT=new f;function Tl(e,t,n,i,o,s,a,c,l,u,d){if(o===0)return;let p;s===ei.GEODESIC?p=new Tr(e,t,a):s===ei.RHUMB&&(p=new ti(e,t,a));const g=p.surfaceDistance;if(g<o)return;const y=wl(e,t,i,a,pT),x=Math.ceil(g/o),E=g/x;let b=E;const D=x-1;let A=c.length;for(let O=0;O<D;O++){const I=p.interpolateUsingSurfaceDistance(b,fT),B=Qt(a,I,n,uT),M=Qt(a,I,i,dT);f.pack(y,c,A),f.pack(B,l,A),f.pack(M,u,A),d.push(I.latitude),d.push(I.longitude),A+=3,b+=E}}const Sl=new ee;function Qt(e,t,n,i){return ee.clone(t,Sl),Sl.height=n,ee.toCartesian(Sl,e,i)}ki.pack=function(e,t,n){m.typeOf.object("value",e),m.defined("array",t);let i=_(n,0);const o=e._positions,s=o.length;t[i++]=s;for(let a=0;a<s;++a){const c=o[a];f.pack(c,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,le.pack(e._ellipsoid,t,i),i+=le.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t},ki.unpack=function(e,t,n){m.defined("array",e);let i=_(t,0);const o=e[i++],s=new Array(o);for(let g=0;g<o;g++)s[g]=f.unpack(e,i),i+=3;const a=e[i++],c=e[i++]===1,l=e[i++],u=le.unpack(e,i);i+=le.packedLength;const d=e[i++],p=e[i++]===1;return h(n)||(n=new ki({positions:s})),n._positions=s,n.granularity=a,n.loop=c,n.arcType=l,n._ellipsoid=u,n._projectionIndex=d,n._scene3DOnly=p,n};function gi(e,t,n){return f.subtract(e,t,n),f.normalize(n,n),n}function vp(e,t,n,i){return i=gi(e,t,i),i=f.cross(i,n,i),i=f.normalize(i,i),i=f.cross(n,i,i),i}const mT=new f,_T=new f,gT=new f,Ip=new f,yT=0,xT=-1;function Al(e,t,n,i,o){const s=gi(n,t,Ip),a=vp(e,t,s,mT),c=vp(i,t,s,_T);if(S.equalsEpsilon(f.dot(a,c),xT,S.EPSILON5))return o=f.cross(s,a,o),o=f.normalize(o,o),o;o=f.add(c,a,o),o=f.normalize(o,o);const l=f.cross(s,o,gT);return f.dot(c,l)<yT&&(o=f.negate(o,o)),o}const da=Ne.fromPointNormal(f.ZERO,f.UNIT_Y),CT=new f,ET=new f,bT=new f,wT=new f,TT=new f,pa=new f,ma=new ee,Rp=new ee,zp=new ee;ki.createGeometry=function(e){const t=!e._scene3DOnly;let n=e.loop;const i=e._ellipsoid,o=e.granularity,s=e.arcType,a=new bl[e._projectionIndex](i),c=Sp,l=Ap;let u,d;const p=e._positions,g=p.length;g===2&&(n=!1);let y,x,E,b;const D=new ti(void 0,void 0,i);let A,O,I;const B=[p[0]];for(d=0;d<g-1;d++)y=p[d],x=p[d+1],A=Fe.lineSegmentPlane(y,x,da,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&(e.arcType===ei.GEODESIC?B.push(f.clone(A)):e.arcType===ei.RHUMB&&(I=i.cartesianToCartographic(A,ma).longitude,E=i.cartesianToCartographic(y,ma),b=i.cartesianToCartographic(x,Rp),D.setEndPoints(E,b),O=D.findIntersectionWithLongitude(I,zp),A=i.cartographicToCartesian(O,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&B.push(f.clone(A)))),B.push(x);n&&(y=p[g-1],x=p[0],A=Fe.lineSegmentPlane(y,x,da,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&(e.arcType===ei.GEODESIC?B.push(f.clone(A)):e.arcType===ei.RHUMB&&(I=i.cartesianToCartographic(A,ma).longitude,E=i.cartesianToCartographic(y,ma),b=i.cartesianToCartographic(x,Rp),D.setEndPoints(E,b),O=D.findIntersectionWithLongitude(I,zp),A=i.cartographicToCartesian(O,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&B.push(f.clone(A)))));let M=B.length,q=new Array(M);for(d=0;d<M;d++){const se=ee.fromCartesian(B[d],i);se.height=0,q[d]=se}if(q=eT(q,ee.equalsEpsilon),M=q.length,M<2)return;const P=[],V=[],k=[],H=[];let j=CT,r=ET,w=bT,v=wT,z=TT;const G=q[0],W=q[1],Z=q[M-1];for(j=Qt(i,Z,c,j),v=Qt(i,W,c,v),r=Qt(i,G,c,r),w=Qt(i,G,l,w),n?z=Al(j,r,w,v,z):z=wl(G,W,l,i,z),f.pack(z,V,0),f.pack(r,k,0),f.pack(w,H,0),P.push(G.latitude),P.push(G.longitude),Tl(G,W,c,l,o,s,i,V,k,H,P),d=1;d<M-1;++d){j=f.clone(r,j),r=f.clone(v,r);const se=q[d];Qt(i,se,l,w),Qt(i,q[d+1],c,v),Al(j,r,w,v,z),u=V.length,f.pack(z,V,u),f.pack(r,k,u),f.pack(w,H,u),P.push(se.latitude),P.push(se.longitude),Tl(q[d],q[d+1],c,l,o,s,i,V,k,H,P)}const X=q[M-1],ie=q[M-2];if(r=Qt(i,X,c,r),w=Qt(i,X,l,w),n){const se=q[0];j=Qt(i,ie,c,j),v=Qt(i,se,c,v),z=Al(j,r,w,v,z)}else z=wl(ie,X,l,i,z);if(u=V.length,f.pack(z,V,u),f.pack(r,k,u),f.pack(w,H,u),P.push(X.latitude),P.push(X.longitude),n){for(Tl(X,G,c,l,o,s,i,V,k,H,P),u=V.length,d=0;d<3;++d)V[u+d]=V[d],k[u+d]=k[d],H[u+d]=H[d];P.push(G.latitude),P.push(G.longitude)}return ZT(n,a,k,H,V,P,t)};const ST=new f,AT=new L,DT=new J;function Pp(e,t,n,i){const o=gi(n,t,ST),s=f.dot(o,e);if(s>wp||s<Tp){const a=gi(i,n,Ip),c=s<Tp?S.PI_OVER_TWO:-S.PI_OVER_TWO,l=J.fromAxisAngle(a,c,DT),u=L.fromQuaternion(l,AT);return L.multiplyByVector(u,e,e),!0}return!1}const Bp=new ee,OT=new f,Np=new f;function Sr(e,t,n,i,o){const s=ee.toCartesian(t,e._ellipsoid,OT);let a=f.add(s,n,Np),c=!1;const l=e._ellipsoid;let u=l.cartesianToCartographic(a,Bp);Math.abs(t.longitude-u.longitude)>S.PI_OVER_TWO&&(c=!0,a=f.subtract(s,n,Np),u=l.cartesianToCartographic(a,Bp)),u.height=0;const d=e.project(u,o);return o=f.subtract(d,i,o),o.z=0,o=f.normalize(o,o),c&&f.negate(o,o),o}const vT=new f,Fp=new f;function Lp(e,t,n,i,o,s){const a=f.subtract(t,e,vT);f.normalize(a,a);const c=n-Sp;let l=f.multiplyByScalar(a,c,Fp);f.add(e,l,o);const u=i-Ap;l=f.multiplyByScalar(a,u,Fp),f.add(t,l,s)}const IT=new f;function _a(e,t){const n=Ne.getPointDistance(da,e),i=Ne.getPointDistance(da,t);let o=IT;S.equalsEpsilon(n,0,S.EPSILON2)?(o=gi(t,e,o),f.multiplyByScalar(o,S.EPSILON2,o),f.add(e,o,e)):S.equalsEpsilon(i,0,S.EPSILON2)&&(o=gi(e,t,o),f.multiplyByScalar(o,S.EPSILON2,o),f.add(t,o,t))}function RT(e,t){const n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(S.equalsEpsilon(n,S.PI,S.EPSILON11)){const o=S.sign(t.longitude);return e.longitude=o*(n-S.EPSILON11),1}else if(S.equalsEpsilon(i,S.PI,S.EPSILON11)){const o=S.sign(e.longitude);return t.longitude=o*(i-S.EPSILON11),2}return 0}const Mp=new ee,Up=new ee,kp=new f,Dl=new f,Vp=new f,Gp=new f,zT=new f,qp=new f,PT=[Mp,Up],BT=new ce,NT=new f,FT=new f,LT=new f,MT=new f,UT=new f,kT=new f,Ol=new f,vl=new f,VT=new f,GT=new f,qT=new f,Hp=new f,HT=new f,WT=new f,jT=new Ye,YT=new Ye,Wp=new f,XT=new f,jp=new f,$T=[new K,new K],Yp=[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],Xp=Yp.length;function ZT(e,t,n,i,o,s,a){let c,l;const u=t._ellipsoid,d=n.length/3-1,p=d*8,g=p*4,y=d*36,x=p>65535?new Uint32Array(y):new Uint16Array(y),E=new Float64Array(p*3),b=new Float32Array(g),D=new Float32Array(g),A=new Float32Array(g),O=new Float32Array(g),I=new Float32Array(g);let B,M,q,P;a&&(B=new Float32Array(g),M=new Float32Array(g),q=new Float32Array(g),P=new Float32Array(p*2));const V=s.length/2;let k=0;const H=Mp;H.height=0;const j=Up;j.height=0;let r=kp,w=Dl;if(a)for(l=0,c=1;c<V;c++)H.latitude=s[l],H.longitude=s[l+1],j.latitude=s[l+2],j.longitude=s[l+3],r=t.project(H,r),w=t.project(j,w),k+=f.distance(r,w),l+=2;const v=i.length/3;w=f.unpack(i,0,w);let z=0;for(l=3,c=1;c<v;c++)r=f.clone(w,r),w=f.unpack(i,l,w),z+=f.distance(r,w),l+=3;let G;l=3;let W=0,Z=0,X=0,ie=0,se=!1,ge=f.unpack(n,0,Gp),be=f.unpack(i,0,Dl),xe=f.unpack(o,0,qp);if(e){const xt=f.unpack(n,n.length-6,Vp);Pp(xe,xt,ge,be)&&(xe=f.negate(xe,xe))}let ze=0,je=0,tt=0;for(c=0;c<d;c++){const xt=f.clone(ge,Vp),cn=f.clone(be,kp);let ln=f.clone(xe,zT);se&&(ln=f.negate(ln,ln)),ge=f.unpack(n,l,Gp),be=f.unpack(i,l,Dl),xe=f.unpack(o,l,qp),se=Pp(xe,xt,ge,be),H.latitude=s[W],H.longitude=s[W+1],j.latitude=s[W+2],j.longitude=s[W+3];let kn,jo,Wi,ji;if(a){const dt=RT(H,j);kn=t.project(H,UT),jo=t.project(j,kT);const Xo=gi(jo,kn,Wp);Xo.y=Math.abs(Xo.y),Wi=Ol,ji=vl,dt===0||f.dot(Xo,f.UNIT_Y)>wp?(Wi=Sr(t,H,ln,kn,Ol),ji=Sr(t,j,xe,jo,vl)):dt===1?(ji=Sr(t,j,xe,jo,vl),Wi.x=0,Wi.y=S.sign(H.longitude-Math.abs(j.longitude)),Wi.z=0):(Wi=Sr(t,H,ln,kn,Ol),ji.x=0,ji.y=S.sign(H.longitude-j.longitude),ji.z=0)}const R0=f.distance(cn,be),z0=Ye.fromCartesian(xt,jT),Aa=f.subtract(ge,xt,VT),NA=f.normalize(Aa,Hp);let ns=f.subtract(cn,xt,GT);ns=f.normalize(ns,ns);let Yo=f.cross(NA,ns,Hp);Yo=f.normalize(Yo,Yo);let Da=f.cross(ns,ln,HT);Da=f.normalize(Da,Da);let Oa=f.subtract(be,ge,qT);Oa=f.normalize(Oa,Oa);let va=f.cross(xe,Oa,WT);va=f.normalize(va,va);const FA=R0/z,LA=ze/z;let uh=0,is,Ia,uo,P0=0,B0=0;if(a){uh=f.distance(kn,jo),is=Ye.fromCartesian(kn,YT),Ia=f.subtract(jo,kn,Wp),uo=f.normalize(Ia,XT);const dt=uo.x;uo.x=uo.y,uo.y=-dt,P0=uh/k,B0=je/k}for(G=0;G<8;G++){const dt=ie+G*4,Xo=Z+G*2,os=dt+3,F0=G<4?1:-1,Ra=G===2||G===3||G===6||G===7?1:-1;f.pack(z0.high,b,dt),b[os]=Aa.x,f.pack(z0.low,D,dt),D[os]=Aa.y,f.pack(Da,A,dt),A[os]=Aa.z,f.pack(va,O,dt),O[os]=FA*F0,f.pack(Yo,I,dt);let po=LA*Ra;po===0&&Ra<0&&(po=9),I[os]=po,a&&(B[dt]=is.high.x,B[dt+1]=is.high.y,B[dt+2]=is.low.x,B[dt+3]=is.low.y,q[dt]=-Wi.y,q[dt+1]=Wi.x,q[dt+2]=ji.y,q[dt+3]=-ji.x,M[dt]=Ia.x,M[dt+1]=Ia.y,M[dt+2]=uo.x,M[dt+3]=uo.y,P[Xo]=P0*F0,po=B0*Ra,po===0&&Ra<0&&(po=9),P[Xo+1]=po)}const bi=LT,wi=MT,Ti=NT,Si=FT,MA=ce.fromCartographicArray(PT,BT),N0=Me.getMinimumMaximumHeights(MA,u),dh=N0.minimumTerrainHeight,ph=N0.maximumTerrainHeight;tt+=Math.abs(dh),tt+=Math.abs(ph),Lp(xt,cn,dh,ph,bi,Ti),Lp(ge,be,dh,ph,wi,Si);let Ai=f.multiplyByScalar(Yo,S.EPSILON5,jp);f.add(bi,Ai,bi),f.add(wi,Ai,wi),f.add(Ti,Ai,Ti),f.add(Si,Ai,Si),_a(bi,wi),_a(Ti,Si),f.pack(bi,E,X),f.pack(wi,E,X+3),f.pack(Si,E,X+6),f.pack(Ti,E,X+9),Ai=f.multiplyByScalar(Yo,-2*S.EPSILON5,jp),f.add(bi,Ai,bi),f.add(wi,Ai,wi),f.add(Ti,Ai,Ti),f.add(Si,Ai,Si),_a(bi,wi),_a(Ti,Si),f.pack(bi,E,X+12),f.pack(wi,E,X+15),f.pack(Si,E,X+18),f.pack(Ti,E,X+21),W+=2,l+=3,Z+=16,X+=24,ie+=32,ze+=R0,je+=uh}l=0;let ut=0;for(c=0;c<d;c++){for(G=0;G<Xp;G++)x[l+G]=Yp[G]+ut;ut+=8,l+=Xp}const Be=$T;K.fromVertices(n,f.ZERO,3,Be[0]),K.fromVertices(i,f.ZERO,3,Be[1]);const yt=K.fromBoundingSpheres(Be);yt.radius+=tt/(d*2);const Dt={position:new Bt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,normalize:!1,values:E}),startHiAndForwardOffsetX:Vi(b),startLoAndForwardOffsetY:Vi(D),startNormalAndForwardOffsetZ:Vi(A),endNormalAndTextureCoordinateNormalizationX:Vi(O),rightNormalAndTextureCoordinateNormalizationY:Vi(I)};return a&&(Dt.startHiLo2D=Vi(B),Dt.offsetAndRight2D=Vi(M),Dt.startEndNormals2D=Vi(q),Dt.texcoordNormalization2D=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new ht({attributes:Dt,indices:x,boundingSphere:yt})}function Vi(e){return new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ki._projectNormal=Sr;const KT=`in vec4 v_startPlaneNormalEcAndHalfWidth;
4953
+ `)}}function kw(e,t){const n=t.context,i=e._primitive;let o=GE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Oe._appendDistanceDisplayConditionToShader(i,o),o=Oe._modifyShaderPosition(e,o,t.scene3DOnly),o=Oe._updateColorAttribute(i,o);const s=e._hasPlanarExtentsAttributes,a=s||e._hasSphericalExtentsAttribute;e._extruded&&(o=Uw(i,o));const c=e._extruded?"EXTRUDED_GEOMETRY":"";let l=new ye({defines:[c],sources:[o]});const u=new ye({sources:[qE]}),d=e._primitive._attributeLocations,p=new kt(a,s,e.appearance);if(e._spStencil=ot.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d}),e._primitive.allowPicking){let x=ye.createPickVertexShaderSource(o);x=Oe._appendShowToShader(i,x),x=Oe._updatePickColorAttribute(x);const E=p.createPickFragmentShader(!1),b=p.createPickVertexShader([c],x,!1,t.mapProjection);if(e._spPick=ot.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:E,attributeLocations:d}),a){let D=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!h(D)){const A=p.createPickFragmentShader(!0),O=p.createPickVertexShader([c],x,!0,t.mapProjection);D=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:O,fragmentShaderSource:A,attributeLocations:d})}e._spPick2D=D}}else e._spPick=ot.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d});o=Oe._appendShowToShader(i,o),l=new ye({defines:[c],sources:[o]}),e._sp=ot.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d});const g=p.createFragmentShader(!1),y=p.createVertexShader([c],o,!1,t.mapProjection);if(e._spColor=ot.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:y,fragmentShaderSource:g,attributeLocations:d}),a){let x=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!h(x)){const E=p.createFragmentShader(!0),b=p.createVertexShader([c],o,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:E,attributeLocations:d})}e._spColor2D=x}}function Vw(e,t){const n=e._primitive;let i=n._va.length*2;t.length=i;let o,s,a,c=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap);const u=e._needs2DShader;for(o=0;o<i;o+=2){const y=n._va[c++];s=t[o],h(s)||(s=t[o]=new $e({owner:e,primitiveType:n._primitiveType})),s.vertexArray=y,s.renderState=e._rsStencilDepthPass,s.shaderProgram=e._sp,s.uniformMap=l,s.pass=Pt.TERRAIN_CLASSIFICATION,a=$e.shallowClone(s,s.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=a,s=t[o+1],h(s)||(s=t[o+1]=new $e({owner:e,primitiveType:n._primitiveType})),s.vertexArray=y,s.renderState=e._rsColorPass,s.shaderProgram=e._spColor,s.pass=Pt.TERRAIN_CLASSIFICATION;const E=e.appearance.material;if(h(E)&&(l=nn(l,E._uniforms)),s.uniformMap=l,a=$e.shallowClone(s,s.derivedCommands.tileset),a.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=a,u){let b=$e.shallowClone(s,s.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b,b=$e.shallowClone(a,a.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=b}}const d=e._commandsIgnoreShow,p=e._spStencil;let g=0;i=d.length=i/2;for(let y=0;y<i;++y){const x=d[y]=$e.shallowClone(t[g],d[y]);x.shaderProgram=p,x.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,g+=2}}function Gw(e,t){const n=e._usePickOffsets,i=e._primitive;let o=i._va.length*2,s,a=0,c;n&&(s=i._pickOffsets,o=s.length*2),t.length=o;let l,u,d,p=0;const g=i._batchTable.getUniformMapCallback()(e._uniformMap),y=e._needs2DShader;for(l=0;l<o;l+=2){let x=i._va[p++];if(n&&(c=s[a++],x=i._va[c.index]),u=t[l],h(u)||(u=t[l]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=x,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=g,u.pass=Pt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.renderState=e._rsStencilDepthPass3DTiles,d.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=d,u=t[l+1],h(u)||(u=t[l+1]=new $e({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=x,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=g,u.pass=Pt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=d,y){let E=$e.shallowClone(u,u.derivedCommands.pick2D);E.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=E,E=$e.shallowClone(d,d.derivedCommands.pick2D),E.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=E}}}function qw(e,t,n,i,o,s,a){Vw(e,s),Gw(e,a)}function dp(e,t){return Math.floor(e%t/2)}function _l(e,t,n,i,o,s){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=s,t.commandList.push(e)}function pp(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function Hw(e,t,n,i,o,s,a,c){const l=e._primitive;Oe._updateBoundingVolumes(l,t,o);let u;t.mode===me.SCENE3D?u=l._boundingSphereWC:t.mode===me.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===me.SCENE2D&&h(l._boundingSphere2D)?u=l._boundingSphere2D:h(l._boundingSphereMorph)&&(u=l._boundingSphereMorph);const d=e.classificationType,p=d!==mi.CESIUM_3D_TILE,g=d!==mi.TERRAIN,y=t.passes;let x,E,b;if(y.render){const D=n.length;for(x=0;x<D;++x)E=u[dp(x,D)],p&&(b=n[x],_l(b,t,o,s,E,a)),g&&(b=n[x].derivedCommands.tileset,_l(b,t,o,s,E,a));if(t.invertClassification){const A=e._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=u[x],b=A[x],_l(b,t,o,s,E,a)}}if(y.pick){const D=i.length,A=l._pickOffsets;for(x=0;x<D;++x){const O=A[dp(x,D)];E=u[O.index],p&&(b=i[x],pp(b,t,o,s,E)),g&&(b=i[x].derivedCommands.tileset,pp(b,t,o,s,E))}}}ki.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;let t=this.appearance;h(t)&&h(t.material)&&t.material.update(e.context);const n=this,i=this._primitiveOptions;if(!h(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length;let a,c,l,u=!1,d=!0,p,g=!1,y=!1;for(s>0&&(l=o[0].attributes,g=kt.hasAttributesForSphericalExtents(l),y=kt.hasAttributesForTextureCoordinatePlanes(l),p=l.color),a=0;a<s;a++){c=o[a];const E=c.attributes.color;if(h(E))u=!0;else if(u)throw new C("All GeometryInstances must have color attributes to use per-instance color.");d=d&&h(E)&&Ro.equals(p,E)}if(!d&&!g&&!y)throw new C("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(u&&!h(t)&&(t=new jt({flat:!0}),this.appearance=t),!u&&t instanceof jt)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(h(t.material)&&!g&&!y)throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!g&&!y,this._hasSphericalExtentsAttribute=g,this._hasPlanarExtentsAttributes=y,this._hasPerColorAttribute=u;const x=new Array(s);for(a=0;a<s;++a)c=o[a],x[a]=new Zs({geometry:c.geometry,attributes:c.attributes,modelMatrix:c.modelMatrix,id:c.id,pickPrimitive:_(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=x,h(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(E,b){n._createBoundingVolumeFunction(E,b)}),i._createRenderStatesFunction=function(E,b,D,A){Mw(n)},i._createShaderProgramFunction=function(E,b,D){kw(n,b)},i._createCommandsFunction=function(E,b,D,A,O,I,B){qw(n,void 0,void 0,!0,!1,I,B)},h(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(E,b,D,A,O,I,B,M){n._updateAndQueueCommandsFunction(E,b,D,A,O,I,B,M)}:i._updateAndQueueCommandsFunction=function(E,b,D,A,O,I,B,M){Hw(n,b,D,A,O,I,B)},this._primitive=new Oe(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(Vo(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(Vo(!1,!0)),this._rsColorPass=Ve.fromCache(ml(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(Vo(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(Vo(!0,!0)),this._rsColorPass=Ve.fromCache(ml(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&h(t.material))throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof jt)throw new C("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(()=>{h(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},ki.prototype.getGeometryInstanceAttributes=function(e){if(!h(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},ki.prototype.isDestroyed=function(){return!1},ki.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,Qe(this)};const Ww={u_globeMinimumAltitude:function(){return 55e3}};function sn(e){e=_(e,_.EMPTY_OBJECT);let t=e.appearance;const n=e.geometryInstances;if(!h(t)&&h(n)){const o=Array.isArray(n)?n:[n],s=o.length;for(let a=0;a<s;a++){const c=o[a].attributes;if(h(c)&&h(c.color)){t=new jt({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=_(e.show,!0),this.classificationType=_(e.classificationType,mi.BOTH),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=_(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Me._defaultMaxTerrainHeight,this._minTerrainHeight=Me._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;const i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:_(e.vertexCacheOptimize,!1),interleave:_(e.interleave,!1),releaseGeometryInstances:_(e.releaseGeometryInstances,!0),allowPicking:_(e.allowPicking,!0),asynchronous:_(e.asynchronous,!0),compressVertices:_(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:Ww}}Object.defineProperties(sn.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}}}),sn.isSupported=ki.isSupported;function mp(e){return function(t,n){const i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function _p(e){return function(t,n){return e._minHeight}}const jw=new f,Yw=new f,Xw=new f,$w=new ee,Zw=new ce;function ua(e,t){const n=e.mapProjection.ellipsoid;if(!h(t.attributes)||!h(t.attributes.position3DHigh))return h(t.rectangle)?t.rectangle:void 0;const i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,s=i.length;let a=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let p=0;p<s;p+=3){const g=f.unpack(i,p,jw),y=f.unpack(o,p,Yw),x=f.add(g,y,Xw),E=n.cartesianToCartographic(x,$w),b=E.latitude,D=E.longitude;a=Math.min(a,b),c=Math.min(c,D),l=Math.max(l,b),u=Math.max(u,D)}const d=Zw;return d.north=l,d.south=a,d.east=u,d.west=c,d}function Kw(e,t,n){const i=Me.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function Qw(e,t,n){const i=t.mapProjection.ellipsoid,o=ua(t,n),s=Re.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(s),!t.scene3DOnly){const a=t.mapProjection,c=K.fromRectangleWithHeights2D(o,a,e._maxHeight,e._minHeight);f.fromElements(c.center.z,c.center.x,c.center.y,c.center),e._boundingVolumes2D.push(c)}}function gl(e,t){return Math.floor(e%t/2)}function yl(e,t,n,i,o,s,a){const c=e._primitive;n.mode!==me.SCENE3D&&t.shaderProgram===c._spColor&&c._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=s,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function gp(e,t,n,i,o,s){const a=e._primitive;n.mode!==me.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=s,t.cull=o,n.commandList.push(t)}function Jw(e,t,n,i,o,s,a,c){let l;t.mode===me.SCENE3D?l=e._boundingVolumes:l=e._boundingVolumes2D;const u=e.classificationType,d=u!==mi.CESIUM_3D_TILE,p=u!==mi.TERRAIN,g=t.passes,y=e._primitive;let x,E,b;if(g.render){const D=n.length;for(x=0;x<D;++x)E=l[gl(x,D)],d&&(b=n[x],yl(e,b,t,o,s,E,a)),p&&(b=n[x].derivedCommands.tileset,yl(e,b,t,o,s,E,a));if(t.invertClassification){const A=y._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=l[x],b=A[x],yl(e,b,t,o,s,E,a)}}if(g.pick){const D=i.length;let A;for(e._useFragmentCulling||(A=y._primitive._pickOffsets),x=0;x<D;++x){if(E=l[gl(x,D)],!e._useFragmentCulling){const O=A[gl(x,D)];E=l[O.index]}d&&(b=i[x],gp(e,b,t,o,s,E)),p&&(b=i[x].derivedCommands.tileset,gp(e,b,t,o,s,E))}}}sn.initializeTerrainHeights=function(){return Me.initialize()},sn.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;if(!Me.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");sn.initializeTerrainHeights();return}const t=this,n=this._classificationPrimitiveOptions;if(!h(this._primitive)){const i=e.mapProjection.ellipsoid;let o,s,a;const c=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],l=c.length,u=new Array(l);let d,p;for(d=0;d<l;++d){o=c[d],s=o.geometry;const E=ua(e,s);h(p)?h(E)&&ce.union(p,E,p):p=ce.clone(E);const b=o.id;if(h(b)&&h(E)){const D=Me.getBoundingSphere(E,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(D)}if(a=s.constructor,!h(a)||!h(a.createShadowVolume))throw new C("Not all of the geometry instances have GroundPrimitive support.")}Kw(this,p,i);const g=e.verticalExaggeration,y=e.verticalExaggerationRelativeHeight;this._minHeight=_r.getHeight(this._minTerrainHeight,g,y),this._maxHeight=_r.getHeight(this._maxTerrainHeight,g,y);const x=sn._supportsMaterials(e.context);if(this._useFragmentCulling=x,x){let E,b=!0;for(d=0;d<l;++d)if(o=c[d],s=o.geometry,p=ua(e,s),kt.shouldUseSphericalCoordinates(p)){b=!1;break}for(d=0;d<l;++d){o=c[d],s=o.geometry,a=s.constructor;const D=ua(e,s),A=s.textureCoordinateRotationPoints;b?E=kt.getPlanarTextureCoordinateAttributes(D,A,i,e.mapProjection,this._maxHeight):E=kt.getSphericalExtentGeometryInstanceAttributes(D,A,i,e.mapProjection);const O=o.attributes;for(const I in O)O.hasOwnProperty(I)&&(E[I]=O[I]);u[d]=new Zs({geometry:a.createShadowVolume(s,_p(this),mp(this)),attributes:E,id:o.id})}}else for(d=0;d<l;++d)o=c[d],s=o.geometry,a=s.constructor,u[d]=new Zs({geometry:a.createShadowVolume(s,_p(this),mp(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(E,b){Qw(t,E,b)},n._updateAndQueueCommandsFunction=function(E,b,D,A,O,I,B,M){Jw(t,b,D,A,O,I,B)},this._primitive=new ki(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(()=>{!this._ready&&h(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},sn.prototype.getBoundingSphere=function(e){const t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},sn.prototype.getGeometryInstanceAttributes=function(e){if(!h(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},sn.prototype.isDestroyed=function(){return!1},sn.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),Qe(this)},sn._supportsMaterials=function(e){return e.depthTexture},sn.supportsMaterials=function(e){return m.typeOf.object("scene",e),sn._supportsMaterials(e.frameState.context)};const ei=Object.freeze({NONE:0,GEODESIC:1,RHUMB:2}),yp=S.EPSILON10;function eT(e,t,n,i){if(m.defined("equalsEpsilon",t),!h(e))return;n=_(n,!1);const o=h(i),s=e.length;if(s<2)return e;let a,c=e[0],l,u,d=0,p=-1;for(a=1;a<s;++a)l=e[a],t(c,l,yp)?(h(u)||(u=e.slice(0,a),d=a-1,p=0),o&&i.push(a)):(h(u)&&(u.push(l),d=a,o&&(p=i.length)),c=l);return n&&t(e[0],e[s-1],yp)&&(o&&(h(u)?i.splice(p,0,d):i.push(s-1)),h(u)?u.length-=1:u=e.slice(0,-1)),h(u)?u:e}function tT(e){const t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,s=Math.cos(e._startHeading),a=Math.sin(e._startHeading),c=(1-o)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+c*c),u=l*c,d=Math.atan2(c,s),p=l*a,g=p*p,y=1-g,x=Math.sqrt(y),E=t/4,b=E*E,D=b*E,A=b*b,O=1+E-3*b/4+5*D/4-175*A/64,I=1-E+15*b/8-35*D/8,B=1-3*E+35*b/4,M=1-5*E,q=O*d-I*Math.sin(2*d)*E/2-B*Math.sin(4*d)*b/16-M*Math.sin(6*d)*D/48-Math.sin(8*d)*5*A/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=s,P.sineHeading=a,P.tanU=c,P.cosineU=l,P.sineU=u,P.sigma=d,P.sineAlpha=p,P.sineSquaredAlpha=g,P.cosineSquaredAlpha=y,P.cosineAlpha=x,P.u2Over4=E,P.u4Over16=b,P.u6Over64=D,P.u8Over256=A,P.a0=O,P.a1=I,P.a2=B,P.a3=M,P.distanceRatio=q}function nT(e,t){return e*t*(4+e*(4-3*t))/16}function xp(e,t,n,i,o,s,a){const c=nT(e,n);return(1-c)*e*t*(i+c*o*(a+c*s*(2*a*a-1)))}function iT(e,t,n,i,o,s,a){const c=(t-n)/t,l=s-i,u=Math.atan((1-c)*Math.tan(o)),d=Math.atan((1-c)*Math.tan(a)),p=Math.cos(u),g=Math.sin(u),y=Math.cos(d),x=Math.sin(d),E=p*y,b=p*x,D=g*x,A=g*y;let O=l,I=S.TWO_PI,B=Math.cos(O),M=Math.sin(O),q,P,V,k,H;do{B=Math.cos(O),M=Math.sin(O);const X=b-A*B;V=Math.sqrt(y*y*M*M+X*X),P=D+E*B,q=Math.atan2(V,P);let ie;V===0?(ie=0,k=1):(ie=E*M/V,k=1-ie*ie),I=O,H=P-2*D/k,isFinite(H)||(H=0),O=l+xp(c,ie,k,q,V,P,H)}while(Math.abs(O-I)>S.EPSILON12);const j=k*(t*t-n*n)/(n*n),r=1+j*(4096+j*(j*(320-175*j)-768))/16384,w=j*(256+j*(j*(74-47*j)-128))/1024,v=H*H,z=w*V*(H+w*(P*(2*v-1)-w*H*(4*V*V-3)*(4*v-3)/6)/4),G=n*r*(q-z),W=Math.atan2(y*M,b-A*B),Z=Math.atan2(p*M,b*B-A);e._distance=G,e._startHeading=W,e._endHeading=Z,e._uSquared=j}const oT=new f,xl=new f;function Cp(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,xl),oT),s=f.normalize(i.cartographicToCartesian(n,xl),xl);m.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(f.angleBetween(o,s))-Math.PI),.0125),iT(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=ee.clone(t,e._start),e._end=ee.clone(n,e._end),e._start.height=0,e._end.height=0,tT(e)}function Tr(e,t,n){const i=_(n,le.default);this._ellipsoid=i,this._start=new ee,this._end=new ee,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,h(e)&&h(t)&&Cp(this,e,t,i)}Object.defineProperties(Tr.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return m.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return m.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return m.defined("distance",this._distance),this._endHeading}}}),Tr.prototype.setEndPoints=function(e,t){m.defined("start",e),m.defined("end",t),Cp(this,e,t,this._ellipsoid)},Tr.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},Tr.prototype.interpolateUsingSurfaceDistance=function(e,t){m.defined("distance",this._distance);const n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),s=Math.cos(4*i),a=Math.cos(6*i),c=Math.sin(2*i),l=Math.sin(4*i),u=Math.sin(6*i),d=Math.sin(8*i),p=i*i,g=i*p,y=n.u8Over256,x=n.u2Over4,E=n.u6Over64,b=n.u4Over16;let D=2*g*y*o/3+i*(1-x+7*b/4-15*E/4+579*y/64-(b-15*E/4+187*y/16)*o-(5*E/4-115*y/16)*s-29*y*a/16)+(x/2-b+71*E/32-85*y/16)*c+(5*b/16-5*E/4+383*y/96)*l-p*((E-11*y/2)*c+5*y*l/2)+(29*E/96-29*y/16)*u+539*y*d/1536;const A=Math.asin(Math.sin(D)*n.cosineAlpha),O=Math.atan(n.a/n.b*Math.tan(A));D=D-n.sigma;const I=Math.cos(2*n.sigma+D),B=Math.sin(D),M=Math.cos(D),q=n.cosineU*M,P=n.sineU*B,k=Math.atan2(B*n.sineHeading,q-P*n.cosineHeading)-xp(n.f,n.sineAlpha,n.cosineSquaredAlpha,D,B,M,I);return h(t)?(t.longitude=this._start.longitude+k,t.latitude=O,t.height=0,t):new ee(this._start.longitude+k,O,0)};function Cl(e,t,n){if(e===0)return t*n;const i=e*e,o=i*i,s=o*i,a=s*i,c=a*i,l=c*i,u=n,d=Math.sin(2*u),p=Math.sin(4*u),g=Math.sin(6*u),y=Math.sin(8*u),x=Math.sin(10*u),E=Math.sin(12*u);return t*((1-i/4-3*o/64-5*s/256-175*a/16384-441*c/65536-4851*l/1048576)*u-(3*i/8+3*o/32+45*s/1024+105*a/4096+2205*c/131072+6237*l/524288)*d+(15*o/256+45*s/1024+525*a/16384+1575*c/65536+155925*l/8388608)*p-(35*s/3072+175*a/12288+3675*c/262144+13475*l/1048576)*g+(315*a/131072+2205*c/524288+43659*l/8388608)*y-(693*c/1310720+6237*l/5242880)*x+1001*l/8388608*E)}function rT(e,t,n){const i=e/n;if(t===0)return i;const o=i*i,s=o*i,a=s*i,c=t,l=c*c,u=l*l,d=u*l,p=d*l,g=p*l,y=g*l,x=Math.sin(2*i),E=Math.cos(2*i),b=Math.sin(4*i),D=Math.cos(4*i),A=Math.sin(6*i),O=Math.cos(6*i),I=Math.sin(8*i),B=Math.cos(8*i),M=Math.sin(10*i),q=Math.cos(10*i),P=Math.sin(12*i);return i+i*l/4+7*i*u/64+15*i*d/256+579*i*p/16384+1515*i*g/65536+16837*i*y/1048576+(3*i*u/16+45*i*d/256-i*(32*o-561)*p/4096-i*(232*o-1677)*g/16384+i*(399985-90560*o+512*a)*y/5242880)*E+(21*i*d/256+483*i*p/4096-i*(224*o-1969)*g/16384-i*(33152*o-112599)*y/1048576)*D+(151*i*p/4096+4681*i*g/65536+1479*i*y/16384-453*s*y/32768)*O+(1097*i*g/65536+42783*i*y/1048576)*B+8011*i*y/1048576*q+(3*l/8+3*u/16+213*d/2048-3*o*d/64+255*p/4096-33*o*p/512+20861*g/524288-33*o*g/512+a*g/1024+28273*y/1048576-471*o*y/8192+9*a*y/4096)*x+(21*u/256+21*d/256+533*p/8192-21*o*p/512+197*g/4096-315*o*g/4096+584039*y/16777216-12517*o*y/131072+7*a*y/2048)*b+(151*d/6144+151*p/4096+5019*g/131072-453*o*g/16384+26965*y/786432-8607*o*y/131072)*A+(1097*p/131072+1097*g/65536+225797*y/10485760-1097*o*y/65536)*I+(8011*g/2621440+8011*y/1048576)*M+293393*y/251658240*P}function Go(e,t){if(e===0)return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)));const n=e*Math.sin(t);return Math.log(Math.tan(.5*(S.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function sT(e,t,n,i,o){const s=Go(e._ellipticity,n),a=Go(e._ellipticity,o);return Math.atan2(S.negativePiToPi(i-t),a-s)}function aT(e,t,n,i,o,s,a){const c=e._heading,l=s-i;let u=0;if(S.equalsEpsilon(Math.abs(c),S.PI_OVER_TWO,S.EPSILON8))if(t===n)u=t*Math.cos(o)*S.negativePiToPi(l);else{const d=Math.sin(o);u=t*Math.cos(o)*S.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*d*d)}else{const d=Cl(e._ellipticity,t,o);u=(Cl(e._ellipticity,t,a)-d)/Math.cos(c)}return Math.abs(u)}const cT=new f,El=new f;function Ep(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,El),cT),s=f.normalize(i.cartographicToCartesian(n,El),El);m.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(f.angleBetween(o,s))-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=ee.clone(t,e._start),e._start.height=0,e._end=ee.clone(n,e._end),e._end.height=0,e._heading=sT(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=aT(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function bp(e,t,n,i,o,s){if(n===0)return ee.clone(e,s);const a=o*o;let c,l,u;if(Math.abs(S.PI_OVER_TWO-Math.abs(t))>S.EPSILON8){const d=Cl(o,i,e.latitude),p=n*Math.cos(t),g=d+p;if(l=rT(g,o,i),Math.abs(t)<S.EPSILON10)c=S.negativePiToPi(e.longitude);else{const y=Go(o,e.latitude),x=Go(o,l);u=Math.tan(t)*(x-y),c=S.negativePiToPi(e.longitude+u)}}else{l=e.latitude;let d;if(o===0)d=i*Math.cos(e.latitude);else{const p=Math.sin(e.latitude);d=i*Math.cos(e.latitude)/Math.sqrt(1-a*p*p)}u=n/d,t>0?c=S.negativePiToPi(e.longitude+u):c=S.negativePiToPi(e.longitude-u)}return h(s)?(s.longitude=c,s.latitude=l,s.height=0,s):new ee(c,l,0)}function ti(e,t,n){const i=_(n,le.default);this._ellipsoid=i,this._start=new ee,this._end=new ee,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,h(e)&&h(t)&&Ep(this,e,t,i)}Object.defineProperties(ti.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return m.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return m.defined("distance",this._distance),this._heading}}}),ti.fromStartHeadingDistance=function(e,t,n,i,o){m.defined("start",e),m.defined("heading",t),m.defined("distance",n),m.typeOf.number.greaterThan("distance",n,0);const s=_(i,le.default),a=s.maximumRadius,c=s.minimumRadius,l=a*a,u=c*c,d=Math.sqrt((l-u)/l);t=S.negativePiToPi(t);const p=bp(e,t,n,s.maximumRadius,d);return!h(o)||h(i)&&!i.equals(o.ellipsoid)?new ti(e,p,s):(o.setEndPoints(e,p),o)},ti.prototype.setEndPoints=function(e,t){m.defined("start",e),m.defined("end",t),Ep(this,e,t,this._ellipsoid)},ti.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},ti.prototype.interpolateUsingSurfaceDistance=function(e,t){if(m.typeOf.number("distance",e),!h(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");return bp(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},ti.prototype.findIntersectionWithLongitude=function(e,t){if(m.typeOf.number("intersectionLongitude",e),!h(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=Math.abs(i),s=this._start;if(e=S.negativePiToPi(e),S.equalsEpsilon(Math.abs(e),Math.PI,S.EPSILON14)&&(e=S.sign(s.longitude)*Math.PI),h(t)||(t=new ee),Math.abs(S.PI_OVER_TWO-o)<=S.EPSILON8)return t.longitude=e,t.latitude=s.latitude,t.height=0,t;if(S.equalsEpsilon(Math.abs(S.PI_OVER_TWO-o),S.PI_OVER_TWO,S.EPSILON8))return S.equalsEpsilon(e,s.longitude,S.EPSILON12)?void 0:(t.longitude=e,t.latitude=S.PI_OVER_TWO*S.sign(S.PI_OVER_TWO-i),t.height=0,t);const a=s.latitude,c=n*Math.sin(a),l=Math.tan(.5*(S.PI_OVER_TWO+a))*Math.exp((e-s.longitude)/Math.tan(i)),u=(1+c)/(1-c);let d=s.latitude,p;do{p=d;const g=n*Math.sin(p),y=(1+g)/(1-g);d=2*Math.atan(l*Math.pow(y/u,n/2))-S.PI_OVER_TWO}while(!S.equalsEpsilon(d,p,S.EPSILON12));return t.longitude=e,t.latitude=d,t.height=0,t},ti.prototype.findIntersectionWithLatitude=function(e,t){if(m.typeOf.number("intersectionLatitude",e),!h(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");const n=this._ellipticity,i=this._heading,o=this._start;if(S.equalsEpsilon(Math.abs(i),S.PI_OVER_TWO,S.EPSILON8))return;const s=Go(n,o.latitude),a=Go(n,e),c=Math.tan(i)*(a-s),l=S.negativePiToPi(o.longitude+c);return h(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new ee(l,e,0)};const bl=[Sn,Kt],lT=bl.length,wp=Math.cos(S.toRadians(30)),Tp=Math.cos(S.toRadians(150)),Sp=0,Ap=1e3;function Vi(e){e=_(e,_.EMPTY_OBJECT);const t=e.positions;if(!h(t)||t.length<2)throw new C("At least two positions are required.");if(h(e.arcType)&&e.arcType!==ei.GEODESIC&&e.arcType!==ei.RHUMB)throw new C("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=_(e.width,1),this._positions=t,this.granularity=_(e.granularity,9999),this.loop=_(e.loop,!1),this.arcType=_(e.arcType,ei.GEODESIC),this._ellipsoid=le.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Vi.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+le.packedLength+1+1}}}),Vi.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<lT;i++)if(t instanceof bl[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const hT=new f,Dp=new f,Op=new f;function wl(e,t,n,i,o){const s=Qt(i,e,0,hT),a=Qt(i,e,n,Dp),c=Qt(i,t,0,Op),l=yi(a,s,Dp),u=yi(c,s,Op);return f.cross(u,l,o),f.normalize(o,o)}const fT=new ee,uT=new f,dT=new f,pT=new f;function Tl(e,t,n,i,o,s,a,c,l,u,d){if(o===0)return;let p;s===ei.GEODESIC?p=new Tr(e,t,a):s===ei.RHUMB&&(p=new ti(e,t,a));const g=p.surfaceDistance;if(g<o)return;const y=wl(e,t,i,a,pT),x=Math.ceil(g/o),E=g/x;let b=E;const D=x-1;let A=c.length;for(let O=0;O<D;O++){const I=p.interpolateUsingSurfaceDistance(b,fT),B=Qt(a,I,n,uT),M=Qt(a,I,i,dT);f.pack(y,c,A),f.pack(B,l,A),f.pack(M,u,A),d.push(I.latitude),d.push(I.longitude),A+=3,b+=E}}const Sl=new ee;function Qt(e,t,n,i){return ee.clone(t,Sl),Sl.height=n,ee.toCartesian(Sl,e,i)}Vi.pack=function(e,t,n){m.typeOf.object("value",e),m.defined("array",t);let i=_(n,0);const o=e._positions,s=o.length;t[i++]=s;for(let a=0;a<s;++a){const c=o[a];f.pack(c,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,le.pack(e._ellipsoid,t,i),i+=le.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t},Vi.unpack=function(e,t,n){m.defined("array",e);let i=_(t,0);const o=e[i++],s=new Array(o);for(let g=0;g<o;g++)s[g]=f.unpack(e,i),i+=3;const a=e[i++],c=e[i++]===1,l=e[i++],u=le.unpack(e,i);i+=le.packedLength;const d=e[i++],p=e[i++]===1;return h(n)||(n=new Vi({positions:s})),n._positions=s,n.granularity=a,n.loop=c,n.arcType=l,n._ellipsoid=u,n._projectionIndex=d,n._scene3DOnly=p,n};function yi(e,t,n){return f.subtract(e,t,n),f.normalize(n,n),n}function vp(e,t,n,i){return i=yi(e,t,i),i=f.cross(i,n,i),i=f.normalize(i,i),i=f.cross(n,i,i),i}const mT=new f,_T=new f,gT=new f,Ip=new f,yT=0,xT=-1;function Al(e,t,n,i,o){const s=yi(n,t,Ip),a=vp(e,t,s,mT),c=vp(i,t,s,_T);if(S.equalsEpsilon(f.dot(a,c),xT,S.EPSILON5))return o=f.cross(s,a,o),o=f.normalize(o,o),o;o=f.add(c,a,o),o=f.normalize(o,o);const l=f.cross(s,o,gT);return f.dot(c,l)<yT&&(o=f.negate(o,o)),o}const da=Ne.fromPointNormal(f.ZERO,f.UNIT_Y),CT=new f,ET=new f,bT=new f,wT=new f,TT=new f,pa=new f,ma=new ee,Rp=new ee,zp=new ee;Vi.createGeometry=function(e){const t=!e._scene3DOnly;let n=e.loop;const i=e._ellipsoid,o=e.granularity,s=e.arcType,a=new bl[e._projectionIndex](i),c=Sp,l=Ap;let u,d;const p=e._positions,g=p.length;g===2&&(n=!1);let y,x,E,b;const D=new ti(void 0,void 0,i);let A,O,I;const B=[p[0]];for(d=0;d<g-1;d++)y=p[d],x=p[d+1],A=Fe.lineSegmentPlane(y,x,da,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&(e.arcType===ei.GEODESIC?B.push(f.clone(A)):e.arcType===ei.RHUMB&&(I=i.cartesianToCartographic(A,ma).longitude,E=i.cartesianToCartographic(y,ma),b=i.cartesianToCartographic(x,Rp),D.setEndPoints(E,b),O=D.findIntersectionWithLongitude(I,zp),A=i.cartographicToCartesian(O,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&B.push(f.clone(A)))),B.push(x);n&&(y=p[g-1],x=p[0],A=Fe.lineSegmentPlane(y,x,da,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&(e.arcType===ei.GEODESIC?B.push(f.clone(A)):e.arcType===ei.RHUMB&&(I=i.cartesianToCartographic(A,ma).longitude,E=i.cartesianToCartographic(y,ma),b=i.cartesianToCartographic(x,Rp),D.setEndPoints(E,b),O=D.findIntersectionWithLongitude(I,zp),A=i.cartographicToCartesian(O,pa),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&B.push(f.clone(A)))));let M=B.length,q=new Array(M);for(d=0;d<M;d++){const se=ee.fromCartesian(B[d],i);se.height=0,q[d]=se}if(q=eT(q,ee.equalsEpsilon),M=q.length,M<2)return;const P=[],V=[],k=[],H=[];let j=CT,r=ET,w=bT,v=wT,z=TT;const G=q[0],W=q[1],Z=q[M-1];for(j=Qt(i,Z,c,j),v=Qt(i,W,c,v),r=Qt(i,G,c,r),w=Qt(i,G,l,w),n?z=Al(j,r,w,v,z):z=wl(G,W,l,i,z),f.pack(z,V,0),f.pack(r,k,0),f.pack(w,H,0),P.push(G.latitude),P.push(G.longitude),Tl(G,W,c,l,o,s,i,V,k,H,P),d=1;d<M-1;++d){j=f.clone(r,j),r=f.clone(v,r);const se=q[d];Qt(i,se,l,w),Qt(i,q[d+1],c,v),Al(j,r,w,v,z),u=V.length,f.pack(z,V,u),f.pack(r,k,u),f.pack(w,H,u),P.push(se.latitude),P.push(se.longitude),Tl(q[d],q[d+1],c,l,o,s,i,V,k,H,P)}const X=q[M-1],ie=q[M-2];if(r=Qt(i,X,c,r),w=Qt(i,X,l,w),n){const se=q[0];j=Qt(i,ie,c,j),v=Qt(i,se,c,v),z=Al(j,r,w,v,z)}else z=wl(ie,X,l,i,z);if(u=V.length,f.pack(z,V,u),f.pack(r,k,u),f.pack(w,H,u),P.push(X.latitude),P.push(X.longitude),n){for(Tl(X,G,c,l,o,s,i,V,k,H,P),u=V.length,d=0;d<3;++d)V[u+d]=V[d],k[u+d]=k[d],H[u+d]=H[d];P.push(G.latitude),P.push(G.longitude)}return ZT(n,a,k,H,V,P,t)};const ST=new f,AT=new L,DT=new J;function Pp(e,t,n,i){const o=yi(n,t,ST),s=f.dot(o,e);if(s>wp||s<Tp){const a=yi(i,n,Ip),c=s<Tp?S.PI_OVER_TWO:-S.PI_OVER_TWO,l=J.fromAxisAngle(a,c,DT),u=L.fromQuaternion(l,AT);return L.multiplyByVector(u,e,e),!0}return!1}const Bp=new ee,OT=new f,Np=new f;function Sr(e,t,n,i,o){const s=ee.toCartesian(t,e._ellipsoid,OT);let a=f.add(s,n,Np),c=!1;const l=e._ellipsoid;let u=l.cartesianToCartographic(a,Bp);Math.abs(t.longitude-u.longitude)>S.PI_OVER_TWO&&(c=!0,a=f.subtract(s,n,Np),u=l.cartesianToCartographic(a,Bp)),u.height=0;const d=e.project(u,o);return o=f.subtract(d,i,o),o.z=0,o=f.normalize(o,o),c&&f.negate(o,o),o}const vT=new f,Fp=new f;function Lp(e,t,n,i,o,s){const a=f.subtract(t,e,vT);f.normalize(a,a);const c=n-Sp;let l=f.multiplyByScalar(a,c,Fp);f.add(e,l,o);const u=i-Ap;l=f.multiplyByScalar(a,u,Fp),f.add(t,l,s)}const IT=new f;function _a(e,t){const n=Ne.getPointDistance(da,e),i=Ne.getPointDistance(da,t);let o=IT;S.equalsEpsilon(n,0,S.EPSILON2)?(o=yi(t,e,o),f.multiplyByScalar(o,S.EPSILON2,o),f.add(e,o,e)):S.equalsEpsilon(i,0,S.EPSILON2)&&(o=yi(e,t,o),f.multiplyByScalar(o,S.EPSILON2,o),f.add(t,o,t))}function RT(e,t){const n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(S.equalsEpsilon(n,S.PI,S.EPSILON11)){const o=S.sign(t.longitude);return e.longitude=o*(n-S.EPSILON11),1}else if(S.equalsEpsilon(i,S.PI,S.EPSILON11)){const o=S.sign(e.longitude);return t.longitude=o*(i-S.EPSILON11),2}return 0}const Mp=new ee,Up=new ee,kp=new f,Dl=new f,Vp=new f,Gp=new f,zT=new f,qp=new f,PT=[Mp,Up],BT=new ce,NT=new f,FT=new f,LT=new f,MT=new f,UT=new f,kT=new f,Ol=new f,vl=new f,VT=new f,GT=new f,qT=new f,Hp=new f,HT=new f,WT=new f,jT=new Ye,YT=new Ye,Wp=new f,XT=new f,jp=new f,$T=[new K,new K],Yp=[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],Xp=Yp.length;function ZT(e,t,n,i,o,s,a){let c,l;const u=t._ellipsoid,d=n.length/3-1,p=d*8,g=p*4,y=d*36,x=p>65535?new Uint32Array(y):new Uint16Array(y),E=new Float64Array(p*3),b=new Float32Array(g),D=new Float32Array(g),A=new Float32Array(g),O=new Float32Array(g),I=new Float32Array(g);let B,M,q,P;a&&(B=new Float32Array(g),M=new Float32Array(g),q=new Float32Array(g),P=new Float32Array(p*2));const V=s.length/2;let k=0;const H=Mp;H.height=0;const j=Up;j.height=0;let r=kp,w=Dl;if(a)for(l=0,c=1;c<V;c++)H.latitude=s[l],H.longitude=s[l+1],j.latitude=s[l+2],j.longitude=s[l+3],r=t.project(H,r),w=t.project(j,w),k+=f.distance(r,w),l+=2;const v=i.length/3;w=f.unpack(i,0,w);let z=0;for(l=3,c=1;c<v;c++)r=f.clone(w,r),w=f.unpack(i,l,w),z+=f.distance(r,w),l+=3;let G;l=3;let W=0,Z=0,X=0,ie=0,se=!1,ge=f.unpack(n,0,Gp),be=f.unpack(i,0,Dl),xe=f.unpack(o,0,qp);if(e){const xt=f.unpack(n,n.length-6,Vp);Pp(xe,xt,ge,be)&&(xe=f.negate(xe,xe))}let ze=0,je=0,tt=0;for(c=0;c<d;c++){const xt=f.clone(ge,Vp),cn=f.clone(be,kp);let ln=f.clone(xe,zT);se&&(ln=f.negate(ln,ln)),ge=f.unpack(n,l,Gp),be=f.unpack(i,l,Dl),xe=f.unpack(o,l,qp),se=Pp(xe,xt,ge,be),H.latitude=s[W],H.longitude=s[W+1],j.latitude=s[W+2],j.longitude=s[W+3];let kn,jo,ji,Yi;if(a){const dt=RT(H,j);kn=t.project(H,UT),jo=t.project(j,kT);const Xo=yi(jo,kn,Wp);Xo.y=Math.abs(Xo.y),ji=Ol,Yi=vl,dt===0||f.dot(Xo,f.UNIT_Y)>wp?(ji=Sr(t,H,ln,kn,Ol),Yi=Sr(t,j,xe,jo,vl)):dt===1?(Yi=Sr(t,j,xe,jo,vl),ji.x=0,ji.y=S.sign(H.longitude-Math.abs(j.longitude)),ji.z=0):(ji=Sr(t,H,ln,kn,Ol),Yi.x=0,Yi.y=S.sign(H.longitude-j.longitude),Yi.z=0)}const R0=f.distance(cn,be),z0=Ye.fromCartesian(xt,jT),Aa=f.subtract(ge,xt,VT),NA=f.normalize(Aa,Hp);let ns=f.subtract(cn,xt,GT);ns=f.normalize(ns,ns);let Yo=f.cross(NA,ns,Hp);Yo=f.normalize(Yo,Yo);let Da=f.cross(ns,ln,HT);Da=f.normalize(Da,Da);let Oa=f.subtract(be,ge,qT);Oa=f.normalize(Oa,Oa);let va=f.cross(xe,Oa,WT);va=f.normalize(va,va);const FA=R0/z,LA=ze/z;let uh=0,is,Ia,uo,P0=0,B0=0;if(a){uh=f.distance(kn,jo),is=Ye.fromCartesian(kn,YT),Ia=f.subtract(jo,kn,Wp),uo=f.normalize(Ia,XT);const dt=uo.x;uo.x=uo.y,uo.y=-dt,P0=uh/k,B0=je/k}for(G=0;G<8;G++){const dt=ie+G*4,Xo=Z+G*2,os=dt+3,F0=G<4?1:-1,Ra=G===2||G===3||G===6||G===7?1:-1;f.pack(z0.high,b,dt),b[os]=Aa.x,f.pack(z0.low,D,dt),D[os]=Aa.y,f.pack(Da,A,dt),A[os]=Aa.z,f.pack(va,O,dt),O[os]=FA*F0,f.pack(Yo,I,dt);let po=LA*Ra;po===0&&Ra<0&&(po=9),I[os]=po,a&&(B[dt]=is.high.x,B[dt+1]=is.high.y,B[dt+2]=is.low.x,B[dt+3]=is.low.y,q[dt]=-ji.y,q[dt+1]=ji.x,q[dt+2]=Yi.y,q[dt+3]=-Yi.x,M[dt]=Ia.x,M[dt+1]=Ia.y,M[dt+2]=uo.x,M[dt+3]=uo.y,P[Xo]=P0*F0,po=B0*Ra,po===0&&Ra<0&&(po=9),P[Xo+1]=po)}const wi=LT,Ti=MT,Si=NT,Ai=FT,MA=ce.fromCartographicArray(PT,BT),N0=Me.getMinimumMaximumHeights(MA,u),dh=N0.minimumTerrainHeight,ph=N0.maximumTerrainHeight;tt+=Math.abs(dh),tt+=Math.abs(ph),Lp(xt,cn,dh,ph,wi,Si),Lp(ge,be,dh,ph,Ti,Ai);let Di=f.multiplyByScalar(Yo,S.EPSILON5,jp);f.add(wi,Di,wi),f.add(Ti,Di,Ti),f.add(Si,Di,Si),f.add(Ai,Di,Ai),_a(wi,Ti),_a(Si,Ai),f.pack(wi,E,X),f.pack(Ti,E,X+3),f.pack(Ai,E,X+6),f.pack(Si,E,X+9),Di=f.multiplyByScalar(Yo,-2*S.EPSILON5,jp),f.add(wi,Di,wi),f.add(Ti,Di,Ti),f.add(Si,Di,Si),f.add(Ai,Di,Ai),_a(wi,Ti),_a(Si,Ai),f.pack(wi,E,X+12),f.pack(Ti,E,X+15),f.pack(Ai,E,X+18),f.pack(Si,E,X+21),W+=2,l+=3,Z+=16,X+=24,ie+=32,ze+=R0,je+=uh}l=0;let ut=0;for(c=0;c<d;c++){for(G=0;G<Xp;G++)x[l+G]=Yp[G]+ut;ut+=8,l+=Xp}const Be=$T;K.fromVertices(n,f.ZERO,3,Be[0]),K.fromVertices(i,f.ZERO,3,Be[1]);const yt=K.fromBoundingSpheres(Be);yt.radius+=tt/(d*2);const Dt={position:new Bt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,normalize:!1,values:E}),startHiAndForwardOffsetX:Gi(b),startLoAndForwardOffsetY:Gi(D),startNormalAndForwardOffsetZ:Gi(A),endNormalAndTextureCoordinateNormalizationX:Gi(O),rightNormalAndTextureCoordinateNormalizationY:Gi(I)};return a&&(Dt.startHiLo2D=Gi(B),Dt.offsetAndRight2D=Gi(M),Dt.startEndNormals2D=Gi(q),Dt.texcoordNormalization2D=new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new ht({attributes:Dt,indices:x,boundingSphere:yt})}function Gi(e){return new Bt({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Vi._projectNormal=Sr;const KT=`in vec4 v_startPlaneNormalEcAndHalfWidth;
4954
4954
  in vec4 v_endPlaneNormalEcAndBatchId;
4955
4955
  in vec4 v_rightPlaneEC; // Technically can compute distance for this here
4956
4956
  in vec4 v_endEcAndStartEcX;
@@ -5632,7 +5632,7 @@ vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float
5632
5632
  }
5633
5633
  `;let Il=`${$p}
5634
5634
  ${tS}`;const nS=ku;_t.isInternetExplorer()||(Il=`#define CLIP_POLYLINE
5635
- ${Il}`);function Gi(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=!1,i=Gi.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,Il),this._fragmentShaderSource=_(e.fragmentShaderSource,nS),this._renderState=Ut.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Gi.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}}}),Gi.VERTEX_FORMAT=st.POSITION_ONLY,Gi.prototype.getFragmentShaderSource=Ut.prototype.getFragmentShaderSource,Gi.prototype.isTranslucent=Ut.prototype.isTranslucent,Gi.prototype.getRenderState=Ut.prototype.getRenderState;const iS=`in vec3 position3DHigh;
5635
+ ${Il}`);function qi(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=!1,i=qi.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,Il),this._fragmentShaderSource=_(e.fragmentShaderSource,nS),this._renderState=Ut.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(qi.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}}}),qi.VERTEX_FORMAT=st.POSITION_ONLY,qi.prototype.getFragmentShaderSource=Ut.prototype.getFragmentShaderSource,qi.prototype.isTranslucent=Ut.prototype.isTranslucent,qi.prototype.getRenderState=Ut.prototype.getRenderState;const iS=`in vec3 position3DHigh;
5636
5636
  in vec3 position3DLow;
5637
5637
  in vec3 prevPosition3DHigh;
5638
5638
  in vec3 prevPosition3DLow;
@@ -5692,8 +5692,8 @@ void main()
5692
5692
  }
5693
5693
  `;let Rl=`${$p}
5694
5694
  ${iS}`;const rS=oS;_t.isInternetExplorer()||(Rl=`#define CLIP_POLYLINE
5695
- ${Rl}`);function ao(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=!1,i=ao.VERTEX_FORMAT;this.material=h(e.material)?e.material:Q.fromType(Q.ColorType),this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,Rl),this._fragmentShaderSource=_(e.fragmentShaderSource,rS),this._renderState=Ut.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(ao.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
5696
- ${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}}}),ao.VERTEX_FORMAT=st.POSITION_AND_ST,ao.prototype.getFragmentShaderSource=Ut.prototype.getFragmentShaderSource,ao.prototype.isTranslucent=Ut.prototype.isTranslucent,ao.prototype.getRenderState=Ut.prototype.getRenderState;function yi(e){e=_(e,_.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;h(t)||(t=new ao),this.appearance=t,this.show=_(e.show,!0),this.classificationType=_(e.classificationType,pi.BOTH),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=_(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:_(e.interleave,!1),releaseGeometryInstances:_(e.releaseGeometryInstances,!0),allowPicking:_(e.allowPicking,!0),asynchronous:_(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Zp(!1),this._renderState3DTiles=Zp(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:Bo.FRONT},depthTest:{enabled:!0},blending:to.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(yi.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}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),yi.initializeTerrainHeights=function(){return Me.initialize()};function sS(e,t,n){const i=t.context,o=e._primitive,s=o._attributeLocations;let a=o._batchTable.getVertexShaderCallback()(eS);a=Oe._appendShowToShader(o,a),a=Oe._appendDistanceDisplayConditionToShader(o,a),a=Oe._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(JT);c=Oe._appendShowToShader(o,c),c=Oe._appendDistanceDisplayConditionToShader(o,c),c=Oe._modifyShaderPosition(e,c,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(KT);const u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";h(n.material)?(p=h(n.material)?n.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const g=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],y=new ye({defines:u,sources:[a]}),x=new ye({defines:g,sources:[p,l]});e._sp=ot.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:s});let E=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!h(E)){const D=new ye({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});E=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:D,fragmentShaderSource:x,attributeLocations:s})}e._sp2D=E;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!h(b)){const D=new ye({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Me._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[c]});l=o._batchTable.getVertexShaderCallback()(QT);const A=new ye({defines:g,sources:[p,l]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:D,fragmentShaderSource:A,attributeLocations:s})}e._spMorph=b}function Zp(e){return Ve.fromCache({cull:{enabled:!0},blending:to.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Jn.EQUAL,frontOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.KEEP},backFunction:Jn.EQUAL,backOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.KEEP},reference:_i.CESIUM_3D_TILE_MASK,mask:_i.CESIUM_3D_TILE_MASK}})}function aS(e,t,n,i,o,s){const a=e._primitive,c=a._va.length;o.length=c,s.length=c;const u=t instanceof Gi?{}:n._uniforms,d=a._batchTable.getUniformMapCallback()(u);for(let p=0;p<c;p++){const g=a._va[p];let y=o[p];h(y)||(y=o[p]=new $e({owner:e,primitiveType:a._primitiveType})),y.vertexArray=g,y.renderState=e._renderState,y.shaderProgram=e._sp,y.uniformMap=d,y.pass=Pt.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const x=$e.shallowClone(y,y.derivedCommands.tileset);x.renderState=e._renderState3DTiles,x.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=x;const E=$e.shallowClone(y,y.derivedCommands.color2D);E.shaderProgram=e._sp2D,y.derivedCommands.color2D=E;const b=$e.shallowClone(x,x.derivedCommands.color2D);b.shaderProgram=e._sp2D,x.derivedCommands.color2D=b;const D=$e.shallowClone(y,y.derivedCommands.colorMorph);D.renderState=e._renderStateMorph,D.shaderProgram=e._spMorph,D.pickId="czm_batchTable_pickColor(v_batchId)",y.derivedCommands.colorMorph=D}}function Kp(e,t,n,i,o,s,a){n.mode===me.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==me.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=s,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function cS(e,t,n,i,o,s,a){const c=e._primitive;Oe._updateBoundingVolumes(c,t,o);let l;t.mode===me.SCENE3D?l=c._boundingSphereWC:t.mode===me.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===me.SCENE2D&&h(c._boundingSphere2D)?l=c._boundingSphere2D:h(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);const u=t.mode===me.MORPHING,d=e.classificationType,p=d!==pi.CESIUM_3D_TILE,g=d!==pi.TERRAIN&&!u;let y;const x=t.passes;if(x.render||x.pick&&c.allowPicking){const E=n.length;for(let b=0;b<E;++b){const D=l[b];p&&(y=n[b],Kp(e,y,t,o,s,D,a)),g&&(y=n[b].derivedCommands.tileset,Kp(e,y,t,o,s,D,a))}}}yi.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;if(!Me.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");yi.initializeTerrainHeights();return}let t;const n=this,i=this._primitiveOptions;if(!h(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,a=new Array(s);let c;for(t=0;t<s;++t)if(c=o[t].attributes,!h(c)||!h(c.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<s;++t){const l=o[t];c={};const u=l.attributes;for(const d in u)u.hasOwnProperty(d)&&(c[d]=u[d]);h(c.width)||(c.width=new Fn({componentDatatype:oe.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,ki.setProjectionAndEllipsoid(l.geometry,e.mapProjection),a[t]=new Zs({geometry:l.geometry,attributes:c,id:l.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,d){sS(n,u,d)},i._createCommandsFunction=function(l,u,d,p,g,y,x){aS(n,u,d,p,y,x)},i._updateAndQueueCommandsFunction=function(l,u,d,p,g,y,x,E){cS(n,u,d,p,g,y,x)},this._primitive=new Oe(i)}if(this.appearance instanceof Gi&&!this._hasPerInstanceColors)throw new C("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),e.afterRender.push(()=>{!this._ready&&h(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},yi.prototype.getGeometryInstanceAttributes=function(e){if(!h(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},yi.isSupported=function(e){return e.frameState.context.depthTexture},yi.prototype.isDestroyed=function(){return!1},yi.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,Qe(this)};const lS=new U(1,1),hS=!1,fS=T.WHITE;function qo(e){e=_(e,_.EMPTY_OBJECT),this._definitionChanged=new Pe,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(qo.prototype,{isConstant:{get:function(){return Ae.isConstant(this._image)&&Ae.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:F("image"),repeat:F("repeat"),color:F("color"),transparent:F("transparent")}),qo.prototype.getType=function(e){return"Image"};const uS=new $;qo.prototype.getValue=function(e,t){return h(e)||(e=$.now(uS)),h(t)||(t={}),t.image=Ae.getValueOrUndefined(this._image,e),t.repeat=Ae.getValueOrClonedDefault(this._repeat,e,lS,t.repeat),t.color=Ae.getValueOrClonedDefault(this._color,e,fS,t.color),Ae.getValueOrDefault(this._transparent,e,hS)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},qo.prototype.equals=function(e){return this===e||e instanceof qo&&Ae.equals(this._image,e._image)&&Ae.equals(this._repeat,e._repeat)&&Ae.equals(this._color,e._color)&&Ae.equals(this._transparent,e._transparent)};function dS(e){if(e instanceof T)return new No(e);if(typeof e=="string"||e instanceof ne||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new qo;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function un(e,t){return F(e,t,dS)}function Ar(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Ar.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),dimensions:F("dimensions"),heightReference:F("heightReference"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Ar.prototype.clone=function(e){return h(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 Ar(this)},Ar.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.dimensions=_(this.dimensions,e.dimensions),this.heightReference=_(this.heightReference,e.heightReference),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};const Dr=Object.freeze({FIXED:0,INERTIAL:1});function Ho(){C.throwInstantiationError()}Object.defineProperties(Ho.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}}),Ho.prototype.getValue=C.throwInstantiationError,Ho.prototype.getValueInReferenceFrame=C.throwInstantiationError,Ho.prototype.equals=C.throwInstantiationError;const Qp=new L;Ho.convertToReferenceFrame=function(e,t,n,i,o){if(!h(t))return t;if(h(o)||(o=new f),n===i)return f.clone(t,o);const s=_e.computeIcrfToCentralBodyFixedMatrix(e,Qp);if(n===Dr.INERTIAL)return L.multiplyByVector(s,t,o);if(n===Dr.FIXED)return L.multiplyByVector(L.transpose(s,Qp),t,o)};function co(e,t){this._definitionChanged=new Pe,this._value=f.clone(e),this._referenceFrame=_(t,Dr.FIXED)}Object.defineProperties(co.prototype,{isConstant:{get:function(){return!h(this._value)||this._referenceFrame===Dr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});const pS=new $;co.prototype.getValue=function(e,t){return h(e)||(e=$.now(pS)),this.getValueInReferenceFrame(e,Dr.FIXED,t)},co.prototype.setValue=function(e,t){let n=!1;f.equals(this._value,e)||(n=!0,this._value=f.clone(e)),h(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)},co.prototype.getValueInReferenceFrame=function(e,t,n){if(!h(e))throw new C("time is required.");if(!h(t))throw new C("referenceFrame is required.");return Ho.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},co.prototype.equals=function(e){return this===e||e instanceof co&&f.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};function Or(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Or.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),width:F("width"),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),cornerType:F("cornerType"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),Or.prototype.clone=function(e){return h(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 Or(this)},Or.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.width=_(this.width,e.width),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=_(this.cornerType,e.cornerType),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function mS(e){return e}function zl(e,t){return F(e,t,mS)}function vr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(vr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),length:F("length"),topRadius:F("topRadius"),bottomRadius:F("bottomRadius"),heightReference:F("heightReference"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),numberOfVerticalLines:F("numberOfVerticalLines"),slices:F("slices"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),vr.prototype.clone=function(e){return h(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 vr(this)},vr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.length=_(this.length,e.length),this.topRadius=_(this.topRadius,e.topRadius),this.bottomRadius=_(this.bottomRadius,e.bottomRadius),this.heightReference=_(this.heightReference,e.heightReference),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=_(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=_(this.slices,e.slices),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Ir(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Ir.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),semiMajorAxis:F("semiMajorAxis"),semiMinorAxis:F("semiMinorAxis"),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),rotation:F("rotation"),stRotation:F("stRotation"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),numberOfVerticalLines:F("numberOfVerticalLines"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),Ir.prototype.clone=function(e){return h(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 Ir(this)},Ir.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.semiMajorAxis=_(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=_(this.semiMinorAxis,e.semiMinorAxis),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=_(this.rotation,e.rotation),this.stRotation=_(this.stRotation,e.stRotation),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=_(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function Rr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Rr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),radii:F("radii"),innerRadii:F("innerRadii"),minimumClock:F("minimumClock"),maximumClock:F("maximumClock"),minimumCone:F("minimumCone"),maximumCone:F("maximumCone"),heightReference:F("heightReference"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),stackPartitions:F("stackPartitions"),slicePartitions:F("slicePartitions"),subdivisions:F("subdivisions"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Rr.prototype.clone=function(e){return h(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 Rr(this)},Rr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.radii=_(this.radii,e.radii),this.innerRadii=_(this.innerRadii,e.innerRadii),this.minimumClock=_(this.minimumClock,e.minimumClock),this.maximumClock=_(this.maximumClock,e.maximumClock),this.minimumCone=_(this.minimumCone,e.minimumCone),this.maximumCone=_(this.maximumCone,e.maximumCone),this.heightReference=_(this.heightReference,e.heightReference),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.stackPartitions=_(this.stackPartitions,e.stackPartitions),this.slicePartitions=_(this.slicePartitions,e.slicePartitions),this.subdivisions=_(this.subdivisions,e.subdivisions),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function zr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(zr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),text:F("text"),font:F("font"),style:F("style"),scale:F("scale"),showBackground:F("showBackground"),backgroundColor:F("backgroundColor"),backgroundPadding:F("backgroundPadding"),pixelOffset:F("pixelOffset"),eyeOffset:F("eyeOffset"),horizontalOrigin:F("horizontalOrigin"),verticalOrigin:F("verticalOrigin"),heightReference:F("heightReference"),fillColor:F("fillColor"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),translucencyByDistance:F("translucencyByDistance"),pixelOffsetScaleByDistance:F("pixelOffsetScaleByDistance"),scaleByDistance:F("scaleByDistance"),distanceDisplayCondition:F("distanceDisplayCondition"),disableDepthTestDistance:F("disableDepthTestDistance")}),zr.prototype.clone=function(e){return h(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 zr(this)},zr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.text=_(this.text,e.text),this.font=_(this.font,e.font),this.style=_(this.style,e.style),this.scale=_(this.scale,e.scale),this.showBackground=_(this.showBackground,e.showBackground),this.backgroundColor=_(this.backgroundColor,e.backgroundColor),this.backgroundPadding=_(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=_(this.pixelOffset,e.pixelOffset),this.eyeOffset=_(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=_(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=_(this.verticalOrigin,e.verticalOrigin),this.heightReference=_(this.heightReference,e.heightReference),this.fillColor=_(this.fillColor,e.fillColor),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=_(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=_(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=_(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=_(this.disableDepthTestDistance,e.disableDepthTestDistance)};const _S=new f(1,1,1),gS=f.ZERO,yS=J.IDENTITY;function Pl(e,t,n){this.translation=f.clone(_(e,gS)),this.rotation=J.clone(_(t,yS)),this.scale=f.clone(_(n,_S))}Pl.prototype.equals=function(e){return this===e||h(e)&&f.equals(this.translation,e.translation)&&J.equals(this.rotation,e.rotation)&&f.equals(this.scale,e.scale)};const Bl=new Pl;function Pr(e){e=_(e,_.EMPTY_OBJECT),this._definitionChanged=new Pe,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(Pr.prototype,{isConstant:{get:function(){return Ae.isConstant(this._translation)&&Ae.isConstant(this._rotation)&&Ae.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:F("translation"),rotation:F("rotation"),scale:F("scale")});const xS=new $;Pr.prototype.getValue=function(e,t){return h(e)||(e=$.now(xS)),h(t)||(t=new Pl),t.translation=Ae.getValueOrClonedDefault(this._translation,e,Bl.translation,t.translation),t.rotation=Ae.getValueOrClonedDefault(this._rotation,e,Bl.rotation,t.rotation),t.scale=Ae.getValueOrClonedDefault(this._scale,e,Bl.scale,t.scale),t},Pr.prototype.equals=function(e){return this===e||e instanceof Pr&&Ae.equals(this._translation,e._translation)&&Ae.equals(this._rotation,e._rotation)&&Ae.equals(this._scale,e._scale)};function dn(e,t){this._propertyNames=[],this._definitionChanged=new Pe,h(e)&&this.merge(e,t)}Object.defineProperties(dn.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(!Ae.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),dn.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function CS(e){return new $n(e)}dn.prototype.addProperty=function(e,t,n){const i=this._propertyNames;if(!h(e))throw new C("propertyName is required.");if(i.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,F(e,!0,_(n,CS))),h(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},dn.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!h(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};const ES=new $;dn.prototype.getValue=function(e,t){h(e)||(e=$.now(ES)),h(t)||(t={});const n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){const s=n[i];t[s]=Ae.getValueOrUndefined(this[s],e,t[s])}return t},dn.prototype.merge=function(e,t){if(!h(e))throw new C("source is required.");const n=this._propertyNames,i=h(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,s=i.length;o<s;o++){const a=i[o],c=this[a],l=e[a];c===void 0&&n.indexOf(a)===-1&&this.addProperty(a,void 0,t),l!==void 0&&(c!==void 0?h(c)&&h(c.merge)&&c.merge(l):h(l)&&h(l.merge)&&h(l.clone)?this[a]=l.clone():this[a]=l)}};function bS(e,t){const n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let s=0;s<o;++s){const a=n[s];if(i.indexOf(a)===-1||!Ae.equals(e[a],t[a]))return!1}return!0}dn.prototype.equals=function(e){return this===e||e instanceof dn&&bS(this,e)};function Jp(e){return new Pr(e)}function wS(e){return new dn(e,Jp)}function TS(e){return new dn(e)}function Br(e){this._definitionChanged=new Pe,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._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=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._customShader=void 0,this._customShaderSubscription=void 0,this.merge(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Br.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),uri:F("uri"),scale:F("scale"),enableVerticalExaggeration:F("enableVerticalExaggeration"),minimumPixelSize:F("minimumPixelSize"),maximumScale:F("maximumScale"),incrementallyLoadTextures:F("incrementallyLoadTextures"),runAnimations:F("runAnimations"),clampAnimations:F("clampAnimations"),shadows:F("shadows"),heightReference:F("heightReference"),silhouetteColor:F("silhouetteColor"),silhouetteSize:F("silhouetteSize"),color:F("color"),colorBlendMode:F("colorBlendMode"),colorBlendAmount:F("colorBlendAmount"),imageBasedLightingFactor:F("imageBasedLightingFactor"),lightColor:F("lightColor"),distanceDisplayCondition:F("distanceDisplayCondition"),nodeTransformations:F("nodeTransformations",void 0,wS),articulations:F("articulations",void 0,TS),clippingPlanes:F("clippingPlanes"),customShader:F("customShader")}),Br.prototype.clone=function(e){return h(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,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.customShader=this.customShader,e):new Br(this)},Br.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.uri=_(this.uri,e.uri),this.scale=_(this.scale,e.scale),this.enableVerticalExaggeration=_(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=_(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=_(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=_(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=_(this.runAnimations,e.runAnimations),this.clampAnimations=_(this.clampAnimations,e.clampAnimations),this.shadows=_(this.shadows,e.shadows),this.heightReference=_(this.heightReference,e.heightReference),this.silhouetteColor=_(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=_(this.silhouetteSize,e.silhouetteSize),this.color=_(this.color,e.color),this.colorBlendMode=_(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=_(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=_(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=_(this.lightColor,e.lightColor),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=_(this.clippingPlanes,e.clippingPlanes),this.customShader=_(this.customShader,e.customShader);const t=e.nodeTransformations;if(h(t)){const i=this.nodeTransformations;h(i)?i.merge(t):this.nodeTransformations=new dn(t,Jp)}const n=e.articulations;if(h(n)){const i=this.articulations;h(i)?i.merge(n):this.articulations=new dn(n)}};function Nr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Nr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),uri:F("uri"),maximumScreenSpaceError:F("maximumScreenSpaceError")}),Nr.prototype.clone=function(e){return h(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Nr(this)},Nr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.uri=_(this.uri,e.uri),this.maximumScreenSpaceError=_(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};function Fr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Fr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),leadTime:F("leadTime"),trailTime:F("trailTime"),width:F("width"),resolution:F("resolution"),material:un("material"),distanceDisplayCondition:F("distanceDisplayCondition")}),Fr.prototype.clone=function(e){return h(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 Fr(this)},Fr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.leadTime=_(this.leadTime,e.leadTime),this.trailTime=_(this.trailTime,e.trailTime),this.width=_(this.width,e.width),this.resolution=_(this.resolution,e.resolution),this.material=_(this.material,e.material),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Lr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Lr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),plane:F("plane"),dimensions:F("dimensions"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Lr.prototype.clone=function(e){return h(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 Lr(this)},Lr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.plane=_(this.plane,e.plane),this.dimensions=_(this.dimensions,e.dimensions),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Mr(e){this._definitionChanged=new Pe,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Mr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),pixelSize:F("pixelSize"),heightReference:F("heightReference"),color:F("color"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),scaleByDistance:F("scaleByDistance"),translucencyByDistance:F("translucencyByDistance"),distanceDisplayCondition:F("distanceDisplayCondition"),disableDepthTestDistance:F("disableDepthTestDistance"),splitDirection:F("splitDirection")}),Mr.prototype.clone=function(e){return h(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.splitDirection=this.splitDirection,e):new Mr(this)},Mr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.pixelSize=_(this.pixelSize,e.pixelSize),this.heightReference=_(this.heightReference,e.heightReference),this.color=_(this.color,e.color),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.scaleByDistance=_(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=_(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=_(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=_(this.splitDirection,e.splitDirection)};function SS(e,t){this.positions=h(e)?e:[],this.holes=h(t)?t:[]}function AS(e){return Array.isArray(e)&&(e=new SS(e)),new $n(e)}function Ur(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Ur.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),hierarchy:F("hierarchy",void 0,AS),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),stRotation:F("stRotation"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),perPositionHeight:F("perPositionHeight"),closeTop:F("closeTop"),closeBottom:F("closeBottom"),arcType:F("arcType"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex"),textureCoordinates:F("textureCoordinates")}),Ur.prototype.clone=function(e){return h(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 Ur(this)},Ur.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.hierarchy=_(this.hierarchy,e.hierarchy),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=_(this.stRotation,e.stRotation),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.perPositionHeight=_(this.perPositionHeight,e.perPositionHeight),this.closeTop=_(this.closeTop,e.closeTop),this.closeBottom=_(this.closeBottom,e.closeBottom),this.arcType=_(this.arcType,e.arcType),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex),this.textureCoordinates=_(this.textureCoordinates,e.textureCoordinates)};function kr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(kr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),width:F("width"),granularity:F("granularity"),material:un("material"),depthFailMaterial:un("depthFailMaterial"),arcType:F("arcType"),clampToGround:F("clampToGround"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),kr.prototype.clone=function(e){return h(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 kr(this)},kr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.width=_(this.width,e.width),this.granularity=_(this.granularity,e.granularity),this.material=_(this.material,e.material),this.depthFailMaterial=_(this.depthFailMaterial,e.depthFailMaterial),this.arcType=_(this.arcType,e.arcType),this.clampToGround=_(this.clampToGround,e.clampToGround),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function Vr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Vr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),shape:F("shape"),cornerType:F("cornerType"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Vr.prototype.clone=function(e){return h(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 Vr(this)},Vr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.shape=_(this.shape,e.shape),this.cornerType=_(this.cornerType,e.cornerType),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Gr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Gr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),coordinates:F("coordinates"),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),rotation:F("rotation"),stRotation:F("stRotation"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),Gr.prototype.clone=function(e){return h(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 Gr(this)},Gr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.coordinates=_(this.coordinates,e.coordinates),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=_(this.rotation,e.rotation),this.stRotation=_(this.stRotation,e.stRotation),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function qr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(qr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),minimumHeights:F("minimumHeights"),maximumHeights:F("maximumHeights"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),qr.prototype.clone=function(e){return h(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 qr(this)},qr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.minimumHeights=_(this.minimumHeights,e.minimumHeights),this.maximumHeights=_(this.maximumHeights,e.maximumHeights),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};const DS=new ee,Nl=[];function OS(e){return new co(e)}function vS(e){return F(e,void 0,OS)}function It(e,t){return F(e,void 0,function(n){return n instanceof t?n:new t(n)})}function an(e){e=_(e,_.EMPTY_OBJECT);let t=e.id;h(t)||(t=Vn()),this._availability=void 0,this._id=t,this._definitionChanged=new Pe,this._name=e.name,this._show=_(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",...Nl],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 Fl(e,t,n){const i=t.length;for(let o=0;o<i;o++){const s=t[o],a=s._show;(!n&&a)!==(n&&a)&&Fl(s,s._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(an.prototype,{availability:zl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:zl("name"),show:{get:function(){return this._show},set:function(e){if(!h(e))throw new C("value is required.");if(e===this._show)return;const t=this.isShowing;this._show=e;const n=this.isShowing;t!==n&&Fl(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!h(this.entityCollection)||this.entityCollection.show)&&(!h(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(h(t)){const o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,h(e)&&e._children.push(this);const i=this.isShowing;n!==i&&Fl(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:It("billboard",lr),box:It("box",Ar),corridor:It("corridor",Or),cylinder:It("cylinder",vr),description:F("description"),ellipse:It("ellipse",Ir),ellipsoid:It("ellipsoid",Rr),label:It("label",zr),model:It("model",Br),tileset:It("tileset",Nr),orientation:F("orientation"),path:It("path",Fr),plane:It("plane",Lr),point:It("point",Mr),polygon:It("polygon",Ur),polyline:It("polyline",kr),polylineVolume:It("polylineVolume",Vr),properties:It("properties",dn),position:vS("position"),rectangle:It("rectangle",Gr),viewFrom:F("viewFrom"),wall:It("wall",qr)}),an.registerEntityType=function(e,t){Object.defineProperties(an.prototype,{[e]:It(e,t)}),Nl.includes(e)||Nl.push(e)},an.prototype.isAvailable=function(e){if(!h(e))throw new C("time is required.");const t=this._availability;return!h(t)||t.contains(e)},an.prototype.addProperty=function(e){const t=this._propertyNames;if(!h(e))throw new C("propertyName is required.");if(t.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);if(e in this)throw new C(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,zl(e,!0))},an.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!h(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]},an.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.name=_(this.name,e.name),this.availability=_(this.availability,e.availability);const t=this._propertyNames,n=h(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){const s=n[o];if(s==="parent"||s==="name"||s==="availability"||s==="children")continue;const a=this[s],c=e[s];!h(a)&&t.indexOf(s)===-1&&this.addProperty(s),h(c)&&(h(a)?h(a.merge)&&a.merge(c):h(c.merge)&&h(c.clone)?this[s]=c.clone():this[s]=c)}};const em=new L,tm=new f,nm=new J;an.prototype.computeModelMatrix=function(e,t){m.typeOf.object("time",e);const n=Ae.getValueOrUndefined(this._position,e,tm);if(!h(n))return;const i=Ae.getValueOrUndefined(this._orientation,e,nm);return h(i)?t=N.fromRotationTranslation(L.fromQuaternion(i,em),n,t):t=_e.eastNorthUpToFixedFrame(n,void 0,t),t},an.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){m.typeOf.object("time",e);const s=Ae.getValueOrDefault(t,e,di.NONE);let a=Ae.getValueOrUndefined(this._position,e,tm);if(s===di.NONE||!h(a)||f.equalsEpsilon(a,f.ZERO,S.EPSILON8))return this.computeModelMatrix(e,o);const c=i.cartesianToCartographic(a,DS);$s(s)?c.height=n:c.height+=n,a=i.cartographicToCartesian(c,a);const l=Ae.getValueOrUndefined(this._orientation,e,nm);return h(l)?o=N.fromRotationTranslation(L.fromQuaternion(l,em),a,o):o=_e.eastNorthUpToFixedFrame(a,void 0,o),o},an.supportsMaterialsforEntitiesOnTerrain=function(e){return sn.supportsMaterials(e)},an.supportsPolylinesOnTerrain=function(e){return yi.isSupported(e)};const At={},IS=new Y(0,0,0,1);let Xt=new Y;const RS=new Ce,Ll=new U,Ml=new U;At.worldToWindowCoordinates=function(e,t,n){return At.worldWithEyeOffsetToWindowCoordinates(e,t,f.ZERO,n)};const im=new Y,om=new f;function Hr(e,t,n,i){const o=n.viewMatrix,s=N.multiplyByVector(o,Y.fromElements(e.x,e.y,e.z,1,im),im),a=f.multiplyComponents(t,f.normalize(s,om),om);return s.x+=t.x+a.x,s.y+=t.y+a.y,s.z+=a.z,N.multiplyByVector(n.frustum.projectionMatrix,s,i)}const zS=new ee(Math.PI,S.PI_OVER_TWO),PS=new f,BS=new f;At.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!h(e))throw new C("scene is required.");if(!h(t))throw new C("position is required.");const o=e.frameState,s=At.computeActualEllipsoidPosition(o,t,IS);if(!h(s))return;const a=e.canvas,c=RS;c.x=0,c.y=0,c.width=a.clientWidth,c.height=a.clientHeight;const l=e.camera;let u=!1;if(o.mode===me.SCENE2D){const d=e.mapProjection,p=zS,g=d.project(p,PS),y=f.clone(l.position,BS),x=l.frustum.clone(),E=N.computeViewportTransformation(c,0,1,new N),b=l.frustum.projectionMatrix,D=l.positionWC.y,A=f.fromElements(S.sign(D)*g.x-D,0,-l.positionWC.x),O=_e.pointToGLWindowCoordinates(b,E,A);if(D===0||O.x<=0||O.x>=a.clientWidth)u=!0;else{if(O.x>a.clientWidth*.5){c.width=O.x,l.frustum.right=g.x-D,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ll),c.x+=O.x,l.position.x=-l.position.x;const I=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-I,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ml)}else{c.x+=O.x,c.width-=O.x,l.frustum.left=-g.x-D,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ll),c.x=c.x-c.width,l.position.x=-l.position.x;const I=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-I,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ml)}f.clone(y,l.position),l.frustum=x.clone(),i=U.clone(Ll,i),(i.x<0||i.x>a.clientWidth)&&(i.x=Ml.x)}}if(o.mode!==me.SCENE2D||u){if(Xt=Hr(s,n,l,Xt),Xt.z<0&&!(l.frustum instanceof rn)&&!(l.frustum instanceof vn))return;i=At.clipToGLWindowCoordinates(c,Xt,i)}return i.y=a.clientHeight-i.y,i},At.worldToDrawingBufferCoordinates=function(e,t,n){if(n=At.worldToWindowCoordinates(e,t,n),!!h(n))return At.transformWindowToDrawingBuffer(e,n,n)};const xi=new f,NS=new ee;At.computeActualEllipsoidPosition=function(e,t,n){const i=e.mode;if(i===me.SCENE3D)return f.clone(t,n);const o=e.mapProjection,s=o.ellipsoid.cartesianToCartographic(t,NS);if(!h(s))return;if(o.project(s,xi),i===me.COLUMBUS_VIEW)return f.fromElements(xi.z,xi.x,xi.y,n);if(i===me.SCENE2D)return f.fromElements(0,xi.x,xi.y,n);const a=e.morphTime;return f.fromElements(S.lerp(xi.z,t.x,a),S.lerp(xi.x,t.y,a),S.lerp(xi.y,t.z,a),n)};const rm=new f,sm=new f,am=new N;At.clipToGLWindowCoordinates=function(e,t,n){return f.divideByScalar(t,t.w,rm),N.computeViewportTransformation(e,0,1,am),N.multiplyByPoint(am,rm,sm),U.fromCartesian3(sm,n)},At.transformWindowToDrawingBuffer=function(e,t,n){const i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,s=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*o,t.y*s,n)};const FS=new Y,cm=new Y;At.drawingBufferToWorldCoordinates=function(e,t,n,i){const s=e.context.uniformState,a=s.currentFrustum,c=a.x,l=a.y;if(e.frameState.useLogDepth){const y=n*s.log2FarDepthFromNearPlusOne,x=Math.pow(2,y)-1;n=l*(1-c/(x+c))/(l-c)}const u=e.view.passState.viewport,d=Y.clone(Y.UNIT_W,FS);d.x=(t.x-u.x)/u.width*2-1,d.y=(t.y-u.y)/u.height*2-1,d.z=n*2-1,d.w=1;let p,g=e.camera.frustum;if(h(g.fovy)){p=N.multiplyByVector(s.inverseViewProjection,d,cm);const y=1/p.w;f.multiplyByScalar(p,y,p)}else{const y=g.offCenterFrustum;h(y)&&(g=y),p=cm,p.x=(d.x*(g.right-g.left)+g.left+g.right)*.5,p.y=(d.y*(g.top-g.bottom)+g.bottom+g.top)*.5,p.z=(d.z*(c-l)-c-l)*.5,p.w=1,p=N.multiplyByVector(s.inverseView,p,p)}return f.fromCartesian4(p,i)};const LS=`uniform sampler2D u_atlas;
5695
+ ${Rl}`);function co(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=!1,i=co.VERTEX_FORMAT;this.material=h(e.material)?e.material:Q.fromType(Q.ColorType),this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,Rl),this._fragmentShaderSource=_(e.fragmentShaderSource,rS),this._renderState=Ut.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(co.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
5696
+ ${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}}}),co.VERTEX_FORMAT=st.POSITION_AND_ST,co.prototype.getFragmentShaderSource=Ut.prototype.getFragmentShaderSource,co.prototype.isTranslucent=Ut.prototype.isTranslucent,co.prototype.getRenderState=Ut.prototype.getRenderState;function xi(e){e=_(e,_.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;h(t)||(t=new co),this.appearance=t,this.show=_(e.show,!0),this.classificationType=_(e.classificationType,mi.BOTH),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=_(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:_(e.interleave,!1),releaseGeometryInstances:_(e.releaseGeometryInstances,!0),allowPicking:_(e.allowPicking,!0),asynchronous:_(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Zp(!1),this._renderState3DTiles=Zp(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:Bo.FRONT},depthTest:{enabled:!0},blending:no.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(xi.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}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),xi.initializeTerrainHeights=function(){return Me.initialize()};function sS(e,t,n){const i=t.context,o=e._primitive,s=o._attributeLocations;let a=o._batchTable.getVertexShaderCallback()(eS);a=Oe._appendShowToShader(o,a),a=Oe._appendDistanceDisplayConditionToShader(o,a),a=Oe._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(JT);c=Oe._appendShowToShader(o,c),c=Oe._appendDistanceDisplayConditionToShader(o,c),c=Oe._modifyShaderPosition(e,c,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(KT);const u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";h(n.material)?(p=h(n.material)?n.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const g=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],y=new ye({defines:u,sources:[a]}),x=new ye({defines:g,sources:[p,l]});e._sp=ot.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:s});let E=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!h(E)){const D=new ye({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});E=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:D,fragmentShaderSource:x,attributeLocations:s})}e._sp2D=E;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!h(b)){const D=new ye({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Me._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[c]});l=o._batchTable.getVertexShaderCallback()(QT);const A=new ye({defines:g,sources:[p,l]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:D,fragmentShaderSource:A,attributeLocations:s})}e._spMorph=b}function Zp(e){return Ve.fromCache({cull:{enabled:!0},blending:no.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Jn.EQUAL,frontOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.KEEP},backFunction:Jn.EQUAL,backOperation:{fail:We.KEEP,zFail:We.KEEP,zPass:We.KEEP},reference:gi.CESIUM_3D_TILE_MASK,mask:gi.CESIUM_3D_TILE_MASK}})}function aS(e,t,n,i,o,s){const a=e._primitive,c=a._va.length;o.length=c,s.length=c;const u=t instanceof qi?{}:n._uniforms,d=a._batchTable.getUniformMapCallback()(u);for(let p=0;p<c;p++){const g=a._va[p];let y=o[p];h(y)||(y=o[p]=new $e({owner:e,primitiveType:a._primitiveType})),y.vertexArray=g,y.renderState=e._renderState,y.shaderProgram=e._sp,y.uniformMap=d,y.pass=Pt.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const x=$e.shallowClone(y,y.derivedCommands.tileset);x.renderState=e._renderState3DTiles,x.pass=Pt.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=x;const E=$e.shallowClone(y,y.derivedCommands.color2D);E.shaderProgram=e._sp2D,y.derivedCommands.color2D=E;const b=$e.shallowClone(x,x.derivedCommands.color2D);b.shaderProgram=e._sp2D,x.derivedCommands.color2D=b;const D=$e.shallowClone(y,y.derivedCommands.colorMorph);D.renderState=e._renderStateMorph,D.shaderProgram=e._spMorph,D.pickId="czm_batchTable_pickColor(v_batchId)",y.derivedCommands.colorMorph=D}}function Kp(e,t,n,i,o,s,a){n.mode===me.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==me.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=s,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function cS(e,t,n,i,o,s,a){const c=e._primitive;Oe._updateBoundingVolumes(c,t,o);let l;t.mode===me.SCENE3D?l=c._boundingSphereWC:t.mode===me.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===me.SCENE2D&&h(c._boundingSphere2D)?l=c._boundingSphere2D:h(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);const u=t.mode===me.MORPHING,d=e.classificationType,p=d!==mi.CESIUM_3D_TILE,g=d!==mi.TERRAIN&&!u;let y;const x=t.passes;if(x.render||x.pick&&c.allowPicking){const E=n.length;for(let b=0;b<E;++b){const D=l[b];p&&(y=n[b],Kp(e,y,t,o,s,D,a)),g&&(y=n[b].derivedCommands.tileset,Kp(e,y,t,o,s,D,a))}}}xi.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;if(!Me.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");xi.initializeTerrainHeights();return}let t;const n=this,i=this._primitiveOptions;if(!h(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,a=new Array(s);let c;for(t=0;t<s;++t)if(c=o[t].attributes,!h(c)||!h(c.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<s;++t){const l=o[t];c={};const u=l.attributes;for(const d in u)u.hasOwnProperty(d)&&(c[d]=u[d]);h(c.width)||(c.width=new Fn({componentDatatype:oe.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,Vi.setProjectionAndEllipsoid(l.geometry,e.mapProjection),a[t]=new Zs({geometry:l.geometry,attributes:c,id:l.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,d){sS(n,u,d)},i._createCommandsFunction=function(l,u,d,p,g,y,x){aS(n,u,d,p,y,x)},i._updateAndQueueCommandsFunction=function(l,u,d,p,g,y,x,E){cS(n,u,d,p,g,y,x)},this._primitive=new Oe(i)}if(this.appearance instanceof qi&&!this._hasPerInstanceColors)throw new C("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),e.afterRender.push(()=>{!this._ready&&h(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},xi.prototype.getGeometryInstanceAttributes=function(e){if(!h(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},xi.isSupported=function(e){return e.frameState.context.depthTexture},xi.prototype.isDestroyed=function(){return!1},xi.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,Qe(this)};const lS=new U(1,1),hS=!1,fS=T.WHITE;function qo(e){e=_(e,_.EMPTY_OBJECT),this._definitionChanged=new Pe,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(qo.prototype,{isConstant:{get:function(){return Ae.isConstant(this._image)&&Ae.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:F("image"),repeat:F("repeat"),color:F("color"),transparent:F("transparent")}),qo.prototype.getType=function(e){return"Image"};const uS=new $;qo.prototype.getValue=function(e,t){return h(e)||(e=$.now(uS)),h(t)||(t={}),t.image=Ae.getValueOrUndefined(this._image,e),t.repeat=Ae.getValueOrClonedDefault(this._repeat,e,lS,t.repeat),t.color=Ae.getValueOrClonedDefault(this._color,e,fS,t.color),Ae.getValueOrDefault(this._transparent,e,hS)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},qo.prototype.equals=function(e){return this===e||e instanceof qo&&Ae.equals(this._image,e._image)&&Ae.equals(this._repeat,e._repeat)&&Ae.equals(this._color,e._color)&&Ae.equals(this._transparent,e._transparent)};function dS(e){if(e instanceof T)return new No(e);if(typeof e=="string"||e instanceof ne||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new qo;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function un(e,t){return F(e,t,dS)}function Ar(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Ar.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),dimensions:F("dimensions"),heightReference:F("heightReference"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Ar.prototype.clone=function(e){return h(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 Ar(this)},Ar.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.dimensions=_(this.dimensions,e.dimensions),this.heightReference=_(this.heightReference,e.heightReference),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};const Dr=Object.freeze({FIXED:0,INERTIAL:1});function Ho(){C.throwInstantiationError()}Object.defineProperties(Ho.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}}),Ho.prototype.getValue=C.throwInstantiationError,Ho.prototype.getValueInReferenceFrame=C.throwInstantiationError,Ho.prototype.equals=C.throwInstantiationError;const Qp=new L;Ho.convertToReferenceFrame=function(e,t,n,i,o){if(!h(t))return t;if(h(o)||(o=new f),n===i)return f.clone(t,o);const s=_e.computeIcrfToCentralBodyFixedMatrix(e,Qp);if(n===Dr.INERTIAL)return L.multiplyByVector(s,t,o);if(n===Dr.FIXED)return L.multiplyByVector(L.transpose(s,Qp),t,o)};function lo(e,t){this._definitionChanged=new Pe,this._value=f.clone(e),this._referenceFrame=_(t,Dr.FIXED)}Object.defineProperties(lo.prototype,{isConstant:{get:function(){return!h(this._value)||this._referenceFrame===Dr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});const pS=new $;lo.prototype.getValue=function(e,t){return h(e)||(e=$.now(pS)),this.getValueInReferenceFrame(e,Dr.FIXED,t)},lo.prototype.setValue=function(e,t){let n=!1;f.equals(this._value,e)||(n=!0,this._value=f.clone(e)),h(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)},lo.prototype.getValueInReferenceFrame=function(e,t,n){if(!h(e))throw new C("time is required.");if(!h(t))throw new C("referenceFrame is required.");return Ho.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},lo.prototype.equals=function(e){return this===e||e instanceof lo&&f.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};function Or(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Or.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),width:F("width"),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),cornerType:F("cornerType"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),Or.prototype.clone=function(e){return h(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 Or(this)},Or.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.width=_(this.width,e.width),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=_(this.cornerType,e.cornerType),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function mS(e){return e}function zl(e,t){return F(e,t,mS)}function vr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(vr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),length:F("length"),topRadius:F("topRadius"),bottomRadius:F("bottomRadius"),heightReference:F("heightReference"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),numberOfVerticalLines:F("numberOfVerticalLines"),slices:F("slices"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),vr.prototype.clone=function(e){return h(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 vr(this)},vr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.length=_(this.length,e.length),this.topRadius=_(this.topRadius,e.topRadius),this.bottomRadius=_(this.bottomRadius,e.bottomRadius),this.heightReference=_(this.heightReference,e.heightReference),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=_(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=_(this.slices,e.slices),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Ir(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Ir.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),semiMajorAxis:F("semiMajorAxis"),semiMinorAxis:F("semiMinorAxis"),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),rotation:F("rotation"),stRotation:F("stRotation"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),numberOfVerticalLines:F("numberOfVerticalLines"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),Ir.prototype.clone=function(e){return h(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 Ir(this)},Ir.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.semiMajorAxis=_(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=_(this.semiMinorAxis,e.semiMinorAxis),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=_(this.rotation,e.rotation),this.stRotation=_(this.stRotation,e.stRotation),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=_(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function Rr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Rr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),radii:F("radii"),innerRadii:F("innerRadii"),minimumClock:F("minimumClock"),maximumClock:F("maximumClock"),minimumCone:F("minimumCone"),maximumCone:F("maximumCone"),heightReference:F("heightReference"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),stackPartitions:F("stackPartitions"),slicePartitions:F("slicePartitions"),subdivisions:F("subdivisions"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Rr.prototype.clone=function(e){return h(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 Rr(this)},Rr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.radii=_(this.radii,e.radii),this.innerRadii=_(this.innerRadii,e.innerRadii),this.minimumClock=_(this.minimumClock,e.minimumClock),this.maximumClock=_(this.maximumClock,e.maximumClock),this.minimumCone=_(this.minimumCone,e.minimumCone),this.maximumCone=_(this.maximumCone,e.maximumCone),this.heightReference=_(this.heightReference,e.heightReference),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.stackPartitions=_(this.stackPartitions,e.stackPartitions),this.slicePartitions=_(this.slicePartitions,e.slicePartitions),this.subdivisions=_(this.subdivisions,e.subdivisions),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function zr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(zr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),text:F("text"),font:F("font"),style:F("style"),scale:F("scale"),showBackground:F("showBackground"),backgroundColor:F("backgroundColor"),backgroundPadding:F("backgroundPadding"),pixelOffset:F("pixelOffset"),eyeOffset:F("eyeOffset"),horizontalOrigin:F("horizontalOrigin"),verticalOrigin:F("verticalOrigin"),heightReference:F("heightReference"),fillColor:F("fillColor"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),translucencyByDistance:F("translucencyByDistance"),pixelOffsetScaleByDistance:F("pixelOffsetScaleByDistance"),scaleByDistance:F("scaleByDistance"),distanceDisplayCondition:F("distanceDisplayCondition"),disableDepthTestDistance:F("disableDepthTestDistance")}),zr.prototype.clone=function(e){return h(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 zr(this)},zr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.text=_(this.text,e.text),this.font=_(this.font,e.font),this.style=_(this.style,e.style),this.scale=_(this.scale,e.scale),this.showBackground=_(this.showBackground,e.showBackground),this.backgroundColor=_(this.backgroundColor,e.backgroundColor),this.backgroundPadding=_(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=_(this.pixelOffset,e.pixelOffset),this.eyeOffset=_(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=_(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=_(this.verticalOrigin,e.verticalOrigin),this.heightReference=_(this.heightReference,e.heightReference),this.fillColor=_(this.fillColor,e.fillColor),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=_(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=_(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=_(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=_(this.disableDepthTestDistance,e.disableDepthTestDistance)};const _S=new f(1,1,1),gS=f.ZERO,yS=J.IDENTITY;function Pl(e,t,n){this.translation=f.clone(_(e,gS)),this.rotation=J.clone(_(t,yS)),this.scale=f.clone(_(n,_S))}Pl.prototype.equals=function(e){return this===e||h(e)&&f.equals(this.translation,e.translation)&&J.equals(this.rotation,e.rotation)&&f.equals(this.scale,e.scale)};const Bl=new Pl;function Pr(e){e=_(e,_.EMPTY_OBJECT),this._definitionChanged=new Pe,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(Pr.prototype,{isConstant:{get:function(){return Ae.isConstant(this._translation)&&Ae.isConstant(this._rotation)&&Ae.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:F("translation"),rotation:F("rotation"),scale:F("scale")});const xS=new $;Pr.prototype.getValue=function(e,t){return h(e)||(e=$.now(xS)),h(t)||(t=new Pl),t.translation=Ae.getValueOrClonedDefault(this._translation,e,Bl.translation,t.translation),t.rotation=Ae.getValueOrClonedDefault(this._rotation,e,Bl.rotation,t.rotation),t.scale=Ae.getValueOrClonedDefault(this._scale,e,Bl.scale,t.scale),t},Pr.prototype.equals=function(e){return this===e||e instanceof Pr&&Ae.equals(this._translation,e._translation)&&Ae.equals(this._rotation,e._rotation)&&Ae.equals(this._scale,e._scale)};function dn(e,t){this._propertyNames=[],this._definitionChanged=new Pe,h(e)&&this.merge(e,t)}Object.defineProperties(dn.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(!Ae.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),dn.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function CS(e){return new $n(e)}dn.prototype.addProperty=function(e,t,n){const i=this._propertyNames;if(!h(e))throw new C("propertyName is required.");if(i.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,F(e,!0,_(n,CS))),h(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},dn.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!h(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};const ES=new $;dn.prototype.getValue=function(e,t){h(e)||(e=$.now(ES)),h(t)||(t={});const n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){const s=n[i];t[s]=Ae.getValueOrUndefined(this[s],e,t[s])}return t},dn.prototype.merge=function(e,t){if(!h(e))throw new C("source is required.");const n=this._propertyNames,i=h(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,s=i.length;o<s;o++){const a=i[o],c=this[a],l=e[a];c===void 0&&n.indexOf(a)===-1&&this.addProperty(a,void 0,t),l!==void 0&&(c!==void 0?h(c)&&h(c.merge)&&c.merge(l):h(l)&&h(l.merge)&&h(l.clone)?this[a]=l.clone():this[a]=l)}};function bS(e,t){const n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let s=0;s<o;++s){const a=n[s];if(i.indexOf(a)===-1||!Ae.equals(e[a],t[a]))return!1}return!0}dn.prototype.equals=function(e){return this===e||e instanceof dn&&bS(this,e)};function Jp(e){return new Pr(e)}function wS(e){return new dn(e,Jp)}function TS(e){return new dn(e)}function Br(e){this._definitionChanged=new Pe,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._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=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._customShader=void 0,this._customShaderSubscription=void 0,this.merge(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Br.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),uri:F("uri"),scale:F("scale"),enableVerticalExaggeration:F("enableVerticalExaggeration"),minimumPixelSize:F("minimumPixelSize"),maximumScale:F("maximumScale"),incrementallyLoadTextures:F("incrementallyLoadTextures"),runAnimations:F("runAnimations"),clampAnimations:F("clampAnimations"),shadows:F("shadows"),heightReference:F("heightReference"),silhouetteColor:F("silhouetteColor"),silhouetteSize:F("silhouetteSize"),color:F("color"),colorBlendMode:F("colorBlendMode"),colorBlendAmount:F("colorBlendAmount"),imageBasedLightingFactor:F("imageBasedLightingFactor"),lightColor:F("lightColor"),distanceDisplayCondition:F("distanceDisplayCondition"),nodeTransformations:F("nodeTransformations",void 0,wS),articulations:F("articulations",void 0,TS),clippingPlanes:F("clippingPlanes"),customShader:F("customShader")}),Br.prototype.clone=function(e){return h(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,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.customShader=this.customShader,e):new Br(this)},Br.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.uri=_(this.uri,e.uri),this.scale=_(this.scale,e.scale),this.enableVerticalExaggeration=_(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=_(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=_(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=_(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=_(this.runAnimations,e.runAnimations),this.clampAnimations=_(this.clampAnimations,e.clampAnimations),this.shadows=_(this.shadows,e.shadows),this.heightReference=_(this.heightReference,e.heightReference),this.silhouetteColor=_(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=_(this.silhouetteSize,e.silhouetteSize),this.color=_(this.color,e.color),this.colorBlendMode=_(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=_(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=_(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=_(this.lightColor,e.lightColor),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=_(this.clippingPlanes,e.clippingPlanes),this.customShader=_(this.customShader,e.customShader);const t=e.nodeTransformations;if(h(t)){const i=this.nodeTransformations;h(i)?i.merge(t):this.nodeTransformations=new dn(t,Jp)}const n=e.articulations;if(h(n)){const i=this.articulations;h(i)?i.merge(n):this.articulations=new dn(n)}};function Nr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Nr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),uri:F("uri"),maximumScreenSpaceError:F("maximumScreenSpaceError")}),Nr.prototype.clone=function(e){return h(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Nr(this)},Nr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.uri=_(this.uri,e.uri),this.maximumScreenSpaceError=_(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};function Fr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Fr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),leadTime:F("leadTime"),trailTime:F("trailTime"),width:F("width"),resolution:F("resolution"),material:un("material"),distanceDisplayCondition:F("distanceDisplayCondition")}),Fr.prototype.clone=function(e){return h(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 Fr(this)},Fr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.leadTime=_(this.leadTime,e.leadTime),this.trailTime=_(this.trailTime,e.trailTime),this.width=_(this.width,e.width),this.resolution=_(this.resolution,e.resolution),this.material=_(this.material,e.material),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Lr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Lr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),plane:F("plane"),dimensions:F("dimensions"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Lr.prototype.clone=function(e){return h(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 Lr(this)},Lr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.plane=_(this.plane,e.plane),this.dimensions=_(this.dimensions,e.dimensions),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Mr(e){this._definitionChanged=new Pe,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._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Mr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),pixelSize:F("pixelSize"),heightReference:F("heightReference"),color:F("color"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),scaleByDistance:F("scaleByDistance"),translucencyByDistance:F("translucencyByDistance"),distanceDisplayCondition:F("distanceDisplayCondition"),disableDepthTestDistance:F("disableDepthTestDistance"),splitDirection:F("splitDirection")}),Mr.prototype.clone=function(e){return h(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.splitDirection=this.splitDirection,e):new Mr(this)},Mr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.pixelSize=_(this.pixelSize,e.pixelSize),this.heightReference=_(this.heightReference,e.heightReference),this.color=_(this.color,e.color),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.scaleByDistance=_(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=_(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=_(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=_(this.splitDirection,e.splitDirection)};function SS(e,t){this.positions=h(e)?e:[],this.holes=h(t)?t:[]}function AS(e){return Array.isArray(e)&&(e=new SS(e)),new $n(e)}function Ur(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Ur.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),hierarchy:F("hierarchy",void 0,AS),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),stRotation:F("stRotation"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),perPositionHeight:F("perPositionHeight"),closeTop:F("closeTop"),closeBottom:F("closeBottom"),arcType:F("arcType"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex"),textureCoordinates:F("textureCoordinates")}),Ur.prototype.clone=function(e){return h(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 Ur(this)},Ur.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.hierarchy=_(this.hierarchy,e.hierarchy),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=_(this.stRotation,e.stRotation),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.perPositionHeight=_(this.perPositionHeight,e.perPositionHeight),this.closeTop=_(this.closeTop,e.closeTop),this.closeBottom=_(this.closeBottom,e.closeBottom),this.arcType=_(this.arcType,e.arcType),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex),this.textureCoordinates=_(this.textureCoordinates,e.textureCoordinates)};function kr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(kr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),width:F("width"),granularity:F("granularity"),material:un("material"),depthFailMaterial:un("depthFailMaterial"),arcType:F("arcType"),clampToGround:F("clampToGround"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),kr.prototype.clone=function(e){return h(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 kr(this)},kr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.width=_(this.width,e.width),this.granularity=_(this.granularity,e.granularity),this.material=_(this.material,e.material),this.depthFailMaterial=_(this.depthFailMaterial,e.depthFailMaterial),this.arcType=_(this.arcType,e.arcType),this.clampToGround=_(this.clampToGround,e.clampToGround),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function Vr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Vr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),shape:F("shape"),cornerType:F("cornerType"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),Vr.prototype.clone=function(e){return h(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 Vr(this)},Vr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.shape=_(this.shape,e.shape),this.cornerType=_(this.cornerType,e.cornerType),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};function Gr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(Gr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),coordinates:F("coordinates"),height:F("height"),heightReference:F("heightReference"),extrudedHeight:F("extrudedHeight"),extrudedHeightReference:F("extrudedHeightReference"),rotation:F("rotation"),stRotation:F("stRotation"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition"),classificationType:F("classificationType"),zIndex:F("zIndex")}),Gr.prototype.clone=function(e){return h(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 Gr(this)},Gr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.coordinates=_(this.coordinates,e.coordinates),this.height=_(this.height,e.height),this.heightReference=_(this.heightReference,e.heightReference),this.extrudedHeight=_(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=_(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=_(this.rotation,e.rotation),this.stRotation=_(this.stRotation,e.stRotation),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=_(this.classificationType,e.classificationType),this.zIndex=_(this.zIndex,e.zIndex)};function qr(e){this._definitionChanged=new Pe,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(_(e,_.EMPTY_OBJECT))}Object.defineProperties(qr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),positions:F("positions"),minimumHeights:F("minimumHeights"),maximumHeights:F("maximumHeights"),granularity:F("granularity"),fill:F("fill"),material:un("material"),outline:F("outline"),outlineColor:F("outlineColor"),outlineWidth:F("outlineWidth"),shadows:F("shadows"),distanceDisplayCondition:F("distanceDisplayCondition")}),qr.prototype.clone=function(e){return h(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 qr(this)},qr.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.show=_(this.show,e.show),this.positions=_(this.positions,e.positions),this.minimumHeights=_(this.minimumHeights,e.minimumHeights),this.maximumHeights=_(this.maximumHeights,e.maximumHeights),this.granularity=_(this.granularity,e.granularity),this.fill=_(this.fill,e.fill),this.material=_(this.material,e.material),this.outline=_(this.outline,e.outline),this.outlineColor=_(this.outlineColor,e.outlineColor),this.outlineWidth=_(this.outlineWidth,e.outlineWidth),this.shadows=_(this.shadows,e.shadows),this.distanceDisplayCondition=_(this.distanceDisplayCondition,e.distanceDisplayCondition)};const DS=new ee,Nl=[];function OS(e){return new lo(e)}function vS(e){return F(e,void 0,OS)}function It(e,t){return F(e,void 0,function(n){return n instanceof t?n:new t(n)})}function an(e){e=_(e,_.EMPTY_OBJECT);let t=e.id;h(t)||(t=Vn()),this._availability=void 0,this._id=t,this._definitionChanged=new Pe,this._name=e.name,this._show=_(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",...Nl],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 Fl(e,t,n){const i=t.length;for(let o=0;o<i;o++){const s=t[o],a=s._show;(!n&&a)!==(n&&a)&&Fl(s,s._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(an.prototype,{availability:zl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:zl("name"),show:{get:function(){return this._show},set:function(e){if(!h(e))throw new C("value is required.");if(e===this._show)return;const t=this.isShowing;this._show=e;const n=this.isShowing;t!==n&&Fl(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!h(this.entityCollection)||this.entityCollection.show)&&(!h(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(h(t)){const o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,h(e)&&e._children.push(this);const i=this.isShowing;n!==i&&Fl(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:It("billboard",lr),box:It("box",Ar),corridor:It("corridor",Or),cylinder:It("cylinder",vr),description:F("description"),ellipse:It("ellipse",Ir),ellipsoid:It("ellipsoid",Rr),label:It("label",zr),model:It("model",Br),tileset:It("tileset",Nr),orientation:F("orientation"),path:It("path",Fr),plane:It("plane",Lr),point:It("point",Mr),polygon:It("polygon",Ur),polyline:It("polyline",kr),polylineVolume:It("polylineVolume",Vr),properties:It("properties",dn),position:vS("position"),rectangle:It("rectangle",Gr),viewFrom:F("viewFrom"),wall:It("wall",qr)}),an.registerEntityType=function(e,t){Object.defineProperties(an.prototype,{[e]:It(e,t)}),Nl.includes(e)||Nl.push(e)},an.prototype.isAvailable=function(e){if(!h(e))throw new C("time is required.");const t=this._availability;return!h(t)||t.contains(e)},an.prototype.addProperty=function(e){const t=this._propertyNames;if(!h(e))throw new C("propertyName is required.");if(t.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);if(e in this)throw new C(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,zl(e,!0))},an.prototype.removeProperty=function(e){const n=this._propertyNames.indexOf(e);if(!h(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]},an.prototype.merge=function(e){if(!h(e))throw new C("source is required.");this.name=_(this.name,e.name),this.availability=_(this.availability,e.availability);const t=this._propertyNames,n=h(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){const s=n[o];if(s==="parent"||s==="name"||s==="availability"||s==="children")continue;const a=this[s],c=e[s];!h(a)&&t.indexOf(s)===-1&&this.addProperty(s),h(c)&&(h(a)?h(a.merge)&&a.merge(c):h(c.merge)&&h(c.clone)?this[s]=c.clone():this[s]=c)}};const em=new L,tm=new f,nm=new J;an.prototype.computeModelMatrix=function(e,t){m.typeOf.object("time",e);const n=Ae.getValueOrUndefined(this._position,e,tm);if(!h(n))return;const i=Ae.getValueOrUndefined(this._orientation,e,nm);return h(i)?t=N.fromRotationTranslation(L.fromQuaternion(i,em),n,t):t=_e.eastNorthUpToFixedFrame(n,void 0,t),t},an.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){m.typeOf.object("time",e);const s=Ae.getValueOrDefault(t,e,pi.NONE);let a=Ae.getValueOrUndefined(this._position,e,tm);if(s===pi.NONE||!h(a)||f.equalsEpsilon(a,f.ZERO,S.EPSILON8))return this.computeModelMatrix(e,o);const c=i.cartesianToCartographic(a,DS);$s(s)?c.height=n:c.height+=n,a=i.cartographicToCartesian(c,a);const l=Ae.getValueOrUndefined(this._orientation,e,nm);return h(l)?o=N.fromRotationTranslation(L.fromQuaternion(l,em),a,o):o=_e.eastNorthUpToFixedFrame(a,void 0,o),o},an.supportsMaterialsforEntitiesOnTerrain=function(e){return sn.supportsMaterials(e)},an.supportsPolylinesOnTerrain=function(e){return xi.isSupported(e)};const At={},IS=new Y(0,0,0,1);let Xt=new Y;const RS=new Ce,Ll=new U,Ml=new U;At.worldToWindowCoordinates=function(e,t,n){return At.worldWithEyeOffsetToWindowCoordinates(e,t,f.ZERO,n)};const im=new Y,om=new f;function Hr(e,t,n,i){const o=n.viewMatrix,s=N.multiplyByVector(o,Y.fromElements(e.x,e.y,e.z,1,im),im),a=f.multiplyComponents(t,f.normalize(s,om),om);return s.x+=t.x+a.x,s.y+=t.y+a.y,s.z+=a.z,N.multiplyByVector(n.frustum.projectionMatrix,s,i)}const zS=new ee(Math.PI,S.PI_OVER_TWO),PS=new f,BS=new f;At.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!h(e))throw new C("scene is required.");if(!h(t))throw new C("position is required.");const o=e.frameState,s=At.computeActualEllipsoidPosition(o,t,IS);if(!h(s))return;const a=e.canvas,c=RS;c.x=0,c.y=0,c.width=a.clientWidth,c.height=a.clientHeight;const l=e.camera;let u=!1;if(o.mode===me.SCENE2D){const d=e.mapProjection,p=zS,g=d.project(p,PS),y=f.clone(l.position,BS),x=l.frustum.clone(),E=N.computeViewportTransformation(c,0,1,new N),b=l.frustum.projectionMatrix,D=l.positionWC.y,A=f.fromElements(S.sign(D)*g.x-D,0,-l.positionWC.x),O=_e.pointToGLWindowCoordinates(b,E,A);if(D===0||O.x<=0||O.x>=a.clientWidth)u=!0;else{if(O.x>a.clientWidth*.5){c.width=O.x,l.frustum.right=g.x-D,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ll),c.x+=O.x,l.position.x=-l.position.x;const I=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-I,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ml)}else{c.x+=O.x,c.width-=O.x,l.frustum.left=-g.x-D,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ll),c.x=c.x-c.width,l.position.x=-l.position.x;const I=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-I,Xt=Hr(s,n,l,Xt),At.clipToGLWindowCoordinates(c,Xt,Ml)}f.clone(y,l.position),l.frustum=x.clone(),i=U.clone(Ll,i),(i.x<0||i.x>a.clientWidth)&&(i.x=Ml.x)}}if(o.mode!==me.SCENE2D||u){if(Xt=Hr(s,n,l,Xt),Xt.z<0&&!(l.frustum instanceof rn)&&!(l.frustum instanceof vn))return;i=At.clipToGLWindowCoordinates(c,Xt,i)}return i.y=a.clientHeight-i.y,i},At.worldToDrawingBufferCoordinates=function(e,t,n){if(n=At.worldToWindowCoordinates(e,t,n),!!h(n))return At.transformWindowToDrawingBuffer(e,n,n)};const Ci=new f,NS=new ee;At.computeActualEllipsoidPosition=function(e,t,n){const i=e.mode;if(i===me.SCENE3D)return f.clone(t,n);const o=e.mapProjection,s=o.ellipsoid.cartesianToCartographic(t,NS);if(!h(s))return;if(o.project(s,Ci),i===me.COLUMBUS_VIEW)return f.fromElements(Ci.z,Ci.x,Ci.y,n);if(i===me.SCENE2D)return f.fromElements(0,Ci.x,Ci.y,n);const a=e.morphTime;return f.fromElements(S.lerp(Ci.z,t.x,a),S.lerp(Ci.x,t.y,a),S.lerp(Ci.y,t.z,a),n)};const rm=new f,sm=new f,am=new N;At.clipToGLWindowCoordinates=function(e,t,n){return f.divideByScalar(t,t.w,rm),N.computeViewportTransformation(e,0,1,am),N.multiplyByPoint(am,rm,sm),U.fromCartesian3(sm,n)},At.transformWindowToDrawingBuffer=function(e,t,n){const i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,s=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*o,t.y*s,n)};const FS=new Y,cm=new Y;At.drawingBufferToWorldCoordinates=function(e,t,n,i){const s=e.context.uniformState,a=s.currentFrustum,c=a.x,l=a.y;if(e.frameState.useLogDepth){const y=n*s.log2FarDepthFromNearPlusOne,x=Math.pow(2,y)-1;n=l*(1-c/(x+c))/(l-c)}const u=e.view.passState.viewport,d=Y.clone(Y.UNIT_W,FS);d.x=(t.x-u.x)/u.width*2-1,d.y=(t.y-u.y)/u.height*2-1,d.z=n*2-1,d.w=1;let p,g=e.camera.frustum;if(h(g.fovy)){p=N.multiplyByVector(s.inverseViewProjection,d,cm);const y=1/p.w;f.multiplyByScalar(p,y,p)}else{const y=g.offCenterFrustum;h(y)&&(g=y),p=cm,p.x=(d.x*(g.right-g.left)+g.left+g.right)*.5,p.y=(d.y*(g.top-g.bottom)+g.bottom+g.top)*.5,p.z=(d.z*(c-l)-c-l)*.5,p.w=1,p=N.multiplyByVector(s.inverseView,p,p)}return f.fromCartesian4(p,i)};const LS=`uniform sampler2D u_atlas;
5697
5697
 
5698
5698
  #ifdef VECTOR_TILE
5699
5699
  uniform vec4 u_highlightColor;
@@ -6337,19 +6337,19 @@ if (lengthSq < disableDepthTestDistance) {
6337
6337
  v_color.a *= translucency;
6338
6338
  v_splitDirection = splitDirection;
6339
6339
  }
6340
- `;function fe(e,t){if(e=_(e,_.EMPTY_OBJECT),h(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,s=e.distanceDisplayCondition;if(h(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=we.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=we.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=we.clone(o)}if(h(s)){if(s.far<=s.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");s=rt.clone(s)}this._show=_(e.show,!0),this._position=f.clone(_(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._pixelOffset=U.clone(_(e.pixelOffset,U.ZERO)),this._translate=new U(0,0),this._eyeOffset=f.clone(_(e.eyeOffset,f.ZERO)),this._heightReference=_(e.heightReference,di.NONE),this._verticalOrigin=_(e.verticalOrigin,Je.CENTER),this._horizontalOrigin=_(e.horizontalOrigin,In.CENTER),this._scale=_(e.scale,1),this._color=T.clone(_(e.color,T.WHITE)),this._rotation=_(e.rotation,0),this._alignedAxis=f.clone(_(e.alignedAxis,f.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=_(e.sizeInMeters,!1),this._distanceDisplayCondition=s,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=_(e.collection,t),this._pickId=void 0,this._pickPrimitive=_(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 c=e.imageId;h(a)&&(h(c)||(typeof a=="string"?c=a:h(a.src)?c=a.src:c=Vn()),this._imageId=c,this._image=a),h(e.imageSubRegion)&&(this._imageId=c,this._imageSubRegion=e.imageSubRegion),h(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=me.SCENE3D,this._clusterShow=!0,this._outlineColor=T.clone(_(e.outlineColor,T.BLACK)),this._outlineWidth=_(e.outlineWidth,0),this._updateClamping(),this._splitDirection=_(e.splitDirection,Ou.NONE)}const lm=fe.SHOW_INDEX=0,ga=fe.POSITION_INDEX=1,hm=fe.PIXEL_OFFSET_INDEX=2,US=fe.EYE_OFFSET_INDEX=3,kS=fe.HORIZONTAL_ORIGIN_INDEX=4,VS=fe.VERTICAL_ORIGIN_INDEX=5,GS=fe.SCALE_INDEX=6,ya=fe.IMAGE_INDEX_INDEX=7,fm=fe.COLOR_INDEX=8,qS=fe.ROTATION_INDEX=9,HS=fe.ALIGNED_AXIS_INDEX=10,WS=fe.SCALE_BY_DISTANCE_INDEX=11,jS=fe.TRANSLUCENCY_BY_DISTANCE_INDEX=12,YS=fe.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,XS=fe.DISTANCE_DISPLAY_CONDITION=14,$S=fe.DISABLE_DEPTH_DISTANCE=15;fe.TEXTURE_COORDINATE_BOUNDS=16;const um=fe.SDF_INDEX=17,ZS=fe.SPLIT_DIRECTION_INDEX=18;fe.NUMBER_OF_PROPERTIES=19;function Ze(e,t){const n=e._billboardCollection;h(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(fe.prototype,{show:{get:function(){return this._show},set:function(e){m.typeOf.bool("value",e),this._show!==e&&(this._show=e,Ze(this,lm))}},position:{get:function(){return this._position},set:function(e){m.typeOf.object("value",e);const t=this._position;f.equals(t,e)||(f.clone(e,t),f.clone(e,this._actualPosition),this._updateClamping(),Ze(this,ga))}},heightReference:{get:function(){return this._heightReference},set:function(e){m.typeOf.number("value",e);const t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Ze(this,ga))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){m.typeOf.object("value",e);const t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Ze(this,hm))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;we.equals(t,e)||(this._scaleByDistance=we.clone(e,t),Ze(this,WS))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;we.equals(t,e)||(this._translucencyByDistance=we.clone(e,t),Ze(this,jS))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;we.equals(t,e)||(this._pixelOffsetScaleByDistance=we.clone(e,t),Ze(this,YS))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){m.typeOf.object("value",e);const t=this._eyeOffset;f.equals(t,e)||(f.clone(e,t),Ze(this,US))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){m.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Ze(this,kS))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){m.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,Ze(this,VS))}},scale:{get:function(){return this._scale},set:function(e){m.typeOf.number("value",e),this._scale!==e&&(this._scale=e,Ze(this,GS))}},color:{get:function(){return this._color},set:function(e){m.typeOf.object("value",e);const t=this._color;T.equals(t,e)||(T.clone(e,t),Ze(this,fm))}},rotation:{get:function(){return this._rotation},set:function(e){m.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,Ze(this,qS))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){m.typeOf.object("value",e);const t=this._alignedAxis;f.equals(t,e)||(f.clone(e,t),Ze(this,HS))}},width:{get:function(){return _(this._width,this._imageWidth)},set:function(e){h(e)&&m.typeOf.number("value",e),this._width!==e&&(this._width=e,Ze(this,ya))}},height:{get:function(){return _(this._height,this._imageHeight)},set:function(e){h(e)&&m.typeOf.number("value",e),this._height!==e&&(this._height=e,Ze(this,ya))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){m.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,Ze(this,fm))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!rt.equals(e,this._distanceDisplayCondition)){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");this._distanceDisplayCondition=rt.clone(e,this._distanceDisplayCondition),Ze(this,XS)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(h(e)&&(m.typeOf.number("value",e),e<0))throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ze(this,$S))}},id:{get:function(){return this._id},set:function(e){this._id=e,h(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,h(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){h(e)?typeof e=="string"?this.setImage(e,e):e instanceof ne?this.setImage(e.url,e):h(e.src)?this.setImage(e.src,e):this.setImage(Vn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Ze(this,ya))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=f.clone(e,this._actualClampedPosition),Ze(this,ga)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ze(this,lm))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;T.equals(t,e)||(T.clone(e,t),Ze(this,um))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ze(this,um))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ze(this,ZS))}}}),fe.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},fe.prototype._updateClamping=function(){fe._updateClamping(this._billboardCollection,this)};const xa=new ee;fe._updateClamping=function(e,t){const n=e._scene;if(!h(n)){if(t._heightReference!==di.NONE)throw new C("Height reference is not supported without a scene.");return}const i=_(n.ellipsoid,le.default),o=n.frameState.mode,s=o!==t._mode;if(t._mode=o,(t._heightReference===di.NONE||s)&&h(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===di.NONE||!h(t._position))return;h(t._removeCallbackFunc)&&t._removeCallbackFunc();const a=i.cartesianToCartographic(t._position);if(!h(a)){t._actualClampedPosition=void 0;return}function c(u){const d=i.cartographicToCartesian(u,t._clampedPosition);Tx(t._heightReference)&&(t._mode===me.SCENE3D?(u.height+=a.height,i.cartographicToCartesian(u,d)):d.x+=a.height),t._clampedPosition=d}t._removeCallbackFunc=n.updateHeight(a,c,t._heightReference),ee.clone(a,xa);const l=n.getHeight(a,t._heightReference);h(l)&&(xa.height=l),c(xa)},fe.prototype._loadImage=function(){const e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion;let o;const s=this;function a(l){if(s._imageId!==t||s._image!==n||!Ce.equals(s._imageSubRegion,i))return;const u=e.textureCoordinates[l];s._imageWidth=e.texture.width*u.width,s._imageHeight=e.texture.height*u.height,s._imageIndex=l,s._ready=!0,s._image=void 0,s._imageIndexPromise=void 0,Ze(s,ya);const d=s._billboardCollection._scene;h(d)&&d.frameState.afterRender.push(()=>!0)}if(h(n)&&(o=e.addImage(t,n)),h(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!h(o))return;const c=e.getImageIndex(t);if(h(c)&&!h(i)){a(c);return}o.then(a).catch(function(l){console.error(`Error loading image for billboard: ${l}`),s._imageIndexPromise=void 0})},fe.prototype.setImage=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,h(this._billboardCollection._textureAtlas)&&this._loadImage())},fe.prototype.setImageSubRegion=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("subRegion is required.");this._imageId===e&&Ce.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ce.clone(t),h(this._billboardCollection._textureAtlas)&&this._loadImage())},fe.prototype._setTranslate=function(e){if(!h(e))throw new C("value is required.");const t=this._translate;U.equals(t,e)||(U.clone(e,t),Ze(this,hm))},fe.prototype._getActualPosition=function(){return h(this._clampedPosition)?this._clampedPosition:this._actualPosition},fe.prototype._setActualPosition=function(e){h(this._clampedPosition)||f.clone(e,this._actualPosition),Ze(this,ga)};const dm=new Y;fe._computeActualPosition=function(e,t,n,i){return h(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===me.SCENE3D?t:(N.multiplyByPoint(i,t,dm),At.computeActualEllipsoidPosition(n,dm))};const pm=new f;fe._computeScreenSpacePosition=function(e,t,n,i,o,s){const a=N.multiplyByPoint(e,t,pm),c=At.worldWithEyeOffsetToWindowCoordinates(o,a,n,s);if(h(c))return U.add(c,i,c),c};const Ca=new U(0,0);fe.prototype.computeScreenSpacePosition=function(e,t){const n=this._billboardCollection;if(h(t)||(t=new U),!h(n))throw new C("Billboard must be in a collection. Was it removed?");if(!h(e))throw new C("scene is required.");U.clone(this._pixelOffset,Ca),U.add(Ca,this._translate,Ca);let i=n.modelMatrix,o=this._position;if(h(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==me.SCENE3D)){const a=e.mapProjection,c=a.ellipsoid,l=a.unproject(o,xa);o=c.cartographicToCartesian(l,pm),i=N.IDENTITY}return fe._computeScreenSpacePosition(i,o,this._eyeOffset,Ca,e,t)},fe.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height;const s=e.scale;i*=s,o*=s;let a=t.x;e.horizontalOrigin===In.RIGHT?a-=i:e.horizontalOrigin===In.CENTER&&(a-=i*.5);let c=t.y;return e.verticalOrigin===Je.BOTTOM||e.verticalOrigin===Je.BASELINE?c-=o:e.verticalOrigin===Je.CENTER&&(c-=o*.5),h(n)||(n=new Ce),n.x=a,n.y=c,n.width=i,n.height=o,n},fe.prototype.equals=function(e){return this===e||h(e)&&this._id===e._id&&f.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&&Ce.equals(this._imageSubRegion,e._imageSubRegion)&&T.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&f.equals(this._eyeOffset,e._eyeOffset)&&we.equals(this._scaleByDistance,e._scaleByDistance)&&we.equals(this._translucencyByDistance,e._translucencyByDistance)&&we.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},fe.prototype._destroy=function(){h(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),h(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};const ft=Object.freeze({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2}),pn=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25});function Ci(e,t,n,i,o){this.bottomLeft=_(e,U.ZERO),this.topRight=_(t,U.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}const KS=new U(16,16);function ni(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.borderWidthInPixels,1),n=_(e.initialSize,KS);if(!h(e.context))throw new C("context is required.");if(t<0)throw new C("borderWidthInPixels must be greater than or equal to zero.");if(n.x<1||n.y<1)throw new C("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=_(e.pixelFormat,de.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Vn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(ni.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return h(this._texture)||(this._texture=new Nt({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}}});function QS(e,t){const n=e._context,i=e.numberOfImages,o=2,s=e._borderWidthInPixels;if(i>0){const a=e._texture.width,c=e._texture.height,l=o*(a+t.width+s),u=o*(c+t.height+s),d=a/l,p=c/u,g=new Ci(new U(a+s,s),new U(l,c)),y=new Ci(new U,new U(l,c),e._root,g),x=new Ci(new U(s,c+s),new U(l,u)),E=new Ci(new U,new U(l,u),y,x);for(let A=0;A<e._textureCoordinates.length;A++){const O=e._textureCoordinates[A];h(O)&&(O.x*=d,O.y*=p,O.width*=d,O.height*=p)}const b=new Nt({context:e._context,width:l,height:u,pixelFormat:e._pixelFormat}),D=new On({context:n,colorTextures:[e._texture],destroyAttachments:!1});D._bind(),b.copyFromFramebuffer(0,0,0,0,l,u),D._unBind(),D.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=E}else{let a=o*(t.width+2*s),c=o*(t.height+2*s);a<e._initialSize.x&&(a=e._initialSize.x),c<e._initialSize.y&&(c=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Nt({context:e._context,width:a,height:c,pixelFormat:e._pixelFormat}),e._root=new Ci(new U(s,s),new U(a,c))}}function Ea(e,t,n){if(h(t)){if(!h(t.childNode1)&&!h(t.childNode2)){if(h(t.imageIndex))return;const i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,s=i-n.width,a=o-n.height;if(s<0||a<0)return;if(s===0&&a===0)return t;if(s>a){t.childNode1=new Ci(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.bottomLeft.x+n.width,t.topRight.y));const c=t.bottomLeft.x+n.width+e._borderWidthInPixels;c<t.topRight.x&&(t.childNode2=new Ci(new U(c,t.bottomLeft.y),new U(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Ci(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.topRight.x,t.bottomLeft.y+n.height));const c=t.bottomLeft.y+n.height+e._borderWidthInPixels;c<t.topRight.y&&(t.childNode2=new Ci(new U(t.bottomLeft.x,c),new U(t.topRight.x,t.topRight.y)))}return Ea(e,t.childNode1,n)}return Ea(e,t.childNode1,n)||Ea(e,t.childNode2,n)}}function mm(e,t,n){const i=Ea(e,e._root,t);if(h(i)){i.imageIndex=n;const o=e._texture.width,s=e._texture.height,a=i.topRight.x-i.bottomLeft.x,c=i.topRight.y-i.bottomLeft.y,l=i.bottomLeft.x/o,u=i.bottomLeft.y/s,d=a/o,p=c/s;e._textureCoordinates[n]=new Ce(l,u,d,p),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else QS(e,t),mm(e,t,n);e._guid=Vn()}function _m(e,t){if(!h(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return mm(e,t,n),n}ni.prototype.getImageIndex=function(e){if(!h(e))throw new C("id is required.");return this._indexHash[e]},ni.prototype.addImageSync=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("image is required.");let n=this._indexHash[e];return h(n)||(n=_m(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n},ni.prototype.addImage=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("image is required.");let n=this._idHash[e];if(h(n))return n;if(typeof t=="function"){if(t=t(e),!h(t))throw new C("image is required.")}else(typeof t=="string"||t instanceof ne)&&(t=ne.createIfNeeded(t).fetchImage());const i=this;return n=Promise.resolve(t).then(function(o){const s=_m(i,o);return i._indexHash[e]=s,s}),this._idHash[e]=n,n},ni.prototype.addSubRegion=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("subRegion is required.");const n=this._idHash[e];if(!h(n))throw new at(`image with id "${e}" not found in the atlas.`);const i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;const s=i._texture.width,a=i._texture.height,c=i._textureCoordinates[o],l=c.x+t.x/s,u=c.y+t.y/a,d=t.width/s,p=t.height/a,g=i._textureCoordinates.push(new Ce(l,u,d,p))-1;return i._indexHash[e]=g,i._guid=Vn(),g})},ni.prototype.isDestroyed=function(){return!1},ni.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),Qe(this)};const JS=fe.SHOW_INDEX,Wr=fe.POSITION_INDEX,gm=fe.PIXEL_OFFSET_INDEX,ym=fe.EYE_OFFSET_INDEX,e1=fe.HORIZONTAL_ORIGIN_INDEX,t1=fe.VERTICAL_ORIGIN_INDEX,n1=fe.SCALE_INDEX,jr=fe.IMAGE_INDEX_INDEX,xm=fe.COLOR_INDEX,i1=fe.ROTATION_INDEX,o1=fe.ALIGNED_AXIS_INDEX,Cm=fe.SCALE_BY_DISTANCE_INDEX,Em=fe.TRANSLUCENCY_BY_DISTANCE_INDEX,bm=fe.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,wm=fe.DISTANCE_DISPLAY_CONDITION,r1=fe.DISABLE_DEPTH_DISTANCE,s1=fe.TEXTURE_COORDINATE_BOUNDS,Tm=fe.SDF_INDEX,Sm=fe.SPLIT_DIRECTION_INDEX,Ul=fe.NUMBER_OF_PROPERTIES;let ke;const a1={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,splitDirection:12},c1={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,splitDirection:13};function Jt(e){e=_(e,_.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(Ul),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new K,this._baseVolumeWC=new K,this._baseVolume2D=new K,this._boundingVolume=new K,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=_(e.debugShowTextureAtlas,!1),this.blendOption=_(e.blendOption,ft.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=me.SCENE3D,this._buffersUsage=[De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW],this._highlightColor=T.clone(T.WHITE);const t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};const n=this._scene;h(n)&&h(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){const i=this._billboards,o=i.length;for(let s=0;s<o;++s)h(i[s])&&i[s]._updateClamping()},this))}Object.defineProperties(Jt.prototype,{length:{get:function(){return kl(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}}});function Am(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Jt.prototype.add=function(e){const t=new fe(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},Jt.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},Jt.prototype.removeAll=function(){Am(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function kl(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;const t=[],n=e._billboards,i=n.length;for(let o=0,s=0;o<i;++o){const a=n[o];h(a)&&(a._index=s++,t.push(a))}e._billboards=t}}Jt.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},Jt.prototype.contains=function(e){return h(e)&&e._billboardCollection===this},Jt.prototype.get=function(e){return m.typeOf.number("index",e),kl(this),this._billboards[e]};let Vl;function l1(e){let n=e.cache.billboardCollection_indexBufferBatched;if(h(n))return n;const i=16384*6-6,o=new Uint16Array(i);for(let s=0,a=0;s<i;s+=6,a+=4)o[s]=a,o[s+1]=a+1,o[s+2]=a+2,o[s+3]=a+0,o[s+4]=a+2,o[s+5]=a+3;return n=vt.createIndexBuffer({context:e,typedArray:o,usage:De.STATIC_DRAW,indexDatatype:Ct.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function h1(e){let t=e.cache.billboardCollection_indexBufferInstanced;return h(t)||(t=vt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:De.STATIC_DRAW,indexDatatype:Ct.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function f1(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return h(t)||(t=vt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:De.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Jt.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Ul;++i){const o=n[i]===0?De.STATIC_DRAW:De.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function u1(e,t,n,i,o,s){const a=[{index:ke.positionHighAndScale,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Wr]},{index:ke.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Wr]},{index:ke.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[gm]},{index:ke.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Em]},{index:ke.compressedAttribute2,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[xm]},{index:ke.eyeOffset,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[ym]},{index:ke.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Cm]},{index:ke.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[bm]},{index:ke.compressedAttribute3,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[wm]},{index:ke.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[s1]},{index:ke.splitDirection,componentsPerAttribute:1,componentDatatype:oe.FLOAT,usage:n[Sm]}];i&&a.push({index:ke.direction,componentsPerAttribute:2,componentDatatype:oe.FLOAT,vertexBuffer:f1(e)}),h(o)&&a.push({index:ke.a_batchId,componentsPerAttribute:1,componentDatatype:oe.FLOAT,bufferUsage:De.STATIC_DRAW}),s&&a.push({index:ke.sdf,componentsPerAttribute:2,componentDatatype:oe.FLOAT,usage:n[Tm]});const c=i?t:4*t;return new Tt(e,a,c,i)}const Gl=new Ye;function Dm(e,t,n,i,o){let s;const a=i[ke.positionHighAndScale],c=i[ke.positionLowAndRotation],l=o._getActualPosition();e._mode===me.SCENE3D&&(K.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),Ye.fromCartesian(l,Gl);const u=o.scale,d=o.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);const p=Gl.high,g=Gl.low;e._instanced?(s=o._index,a(s,p.x,p.y,p.z,u),c(s,g.x,g.y,g.z,d)):(s=o._index*4,a(s+0,p.x,p.y,p.z,u),a(s+1,p.x,p.y,p.z,u),a(s+2,p.x,p.y,p.z,u),a(s+3,p.x,p.y,p.z,u),c(s+0,g.x,g.y,g.z,d),c(s+1,g.x,g.y,g.z,d),c(s+2,g.x,g.y,g.z,d),c(s+3,g.x,g.y,g.z,d))}const bn=new U,wn=32768,Wo=65536,ql=4096,ii=256,d1=128,p1=32,m1=8,Om=4,_1=1/256,vm=0,Im=2,Rm=3,zm=1;function Pm(e,t,n,i,o){let s;const a=i[ke.compressedAttribute0],c=o.pixelOffset,l=c.x,u=c.y,d=o._translate,p=d.x,g=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(l+p),Math.abs(-u+g));const y=o.horizontalOrigin;let x=o._verticalOrigin,E=o.show&&o.clusterShow;o.color.alpha===0&&(E=!1),x===Je.BASELINE&&(x=Je.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&y===In.CENTER,e._allVerticalCenter=e._allVerticalCenter&&x===Je.CENTER;let b=0,D=0,A=0,O=0;const I=o._imageIndex;if(I!==-1){const G=n[I];if(!h(G))throw new C(`Invalid billboard image index: ${I}`);b=G.x,D=G.y,A=G.width,O=G.height}const B=b+A,M=D+O;let q=Math.floor(S.clamp(l,-wn,wn)+wn)*d1;q+=(y+1)*p1,q+=(x+1)*m1,q+=(E?1:0)*Om;let P=Math.floor(S.clamp(u,-wn,wn)+wn)*ii,V=Math.floor(S.clamp(p,-wn,wn)+wn)*ii;const k=(S.clamp(g,-wn,wn)+wn)*_1,H=Math.floor(k),j=Math.floor((k-H)*ii);P+=H,V+=j,bn.x=b,bn.y=D;const r=Te.compressTextureCoordinates(bn);bn.x=B;const w=Te.compressTextureCoordinates(bn);bn.y=M;const v=Te.compressTextureCoordinates(bn);bn.x=b;const z=Te.compressTextureCoordinates(bn);e._instanced?(s=o._index,a(s,q,P,V,r)):(s=o._index*4,a(s+0,q+vm,P,V,r),a(s+1,q+Im,P,V,w),a(s+2,q+Rm,P,V,v),a(s+3,q+zm,P,V,z))}function Bm(e,t,n,i,o){let s;const a=i[ke.compressedAttribute1],c=o.alignedAxis;f.equals(c,f.ZERO)||(e._shaderAlignedAxis=!0);let l=0,u=1,d=1,p=1;const g=o.translucencyByDistance;h(g)&&(l=g.near,u=g.nearValue,d=g.far,p=g.farValue,(u!==1||p!==1)&&(e._shaderTranslucencyByDistance=!0));let y=0;const x=o._imageIndex;if(x!==-1){const O=n[x];if(!h(O))throw new C(`Invalid billboard image index: ${x}`);y=O.width}const E=e._textureAtlas.texture.width,b=Math.round(_(o.width,E*y));e._maxSize=Math.max(e._maxSize,b);let D=S.clamp(b,0,Wo),A=0;Math.abs(f.magnitudeSquared(c)-1)<S.EPSILON6&&(A=Te.octEncodeFloat(c)),u=S.clamp(u,0,1),u=u===1?255:u*255|0,D=D*ii+u,p=S.clamp(p,0,1),p=p===1?255:p*255|0,A=A*ii+p,e._instanced?(s=o._index,a(s,D,A,l,d)):(s=o._index*4,a(s+0,D,A,l,d),a(s+1,D,A,l,d),a(s+2,D,A,l,d),a(s+3,D,A,l,d))}function Hl(e,t,n,i,o){let s;const a=i[ke.compressedAttribute2],c=o.color,l=h(e._batchTable)?T.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,d=Math.abs(f.magnitudeSquared(o.alignedAxis)-1)<S.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let p=0;const g=o._imageIndex;if(g!==-1){const q=n[g];if(!h(q))throw new C(`Invalid billboard image index: ${g}`);p=q.height}const y=e._textureAtlas.texture.dimensions,x=Math.round(_(o.height,y.y*p));e._maxSize=Math.max(e._maxSize,x);let E=_(o._labelHorizontalOrigin,-2);E+=2;const b=x*Om+E;let D=T.floatToByte(c.red),A=T.floatToByte(c.green),O=T.floatToByte(c.blue);const I=D*Wo+A*ii+O;D=T.floatToByte(l.red),A=T.floatToByte(l.green),O=T.floatToByte(l.blue);const B=D*Wo+A*ii+O;let M=T.floatToByte(c.alpha)*Wo+T.floatToByte(l.alpha)*ii;M+=u*2+d,e._instanced?(s=o._index,a(s,I,B,M,b)):(s=o._index*4,a(s+0,I,B,M,b),a(s+1,I,B,M,b),a(s+2,I,B,M,b),a(s+3,I,B,M,b))}function Wl(e,t,n,i,o){let s;const a=i[ke.eyeOffset],c=o.eyeOffset;let l=c.z;if(o._heightReference!==di.NONE&&(l*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(c.x),Math.abs(c.y),Math.abs(l)),e._instanced){let u=0,d=0;const p=o._imageIndex;if(p!==-1){const y=n[p];if(!h(y))throw new C(`Invalid billboard image index: ${p}`);u=y.width,d=y.height}bn.x=u,bn.y=d;const g=Te.compressTextureCoordinates(bn);s=o._index,a(s,c.x,c.y,l,g)}else s=o._index*4,a(s+0,c.x,c.y,l,0),a(s+1,c.x,c.y,l,0),a(s+2,c.x,c.y,l,0),a(s+3,c.x,c.y,l,0)}function Nm(e,t,n,i,o){let s;const a=i[ke.scaleByDistance];let c=0,l=1,u=1,d=1;const p=o.scaleByDistance;h(p)&&(c=p.near,l=p.nearValue,u=p.far,d=p.farValue,(l!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(s=o._index,a(s,c,l,u,d)):(s=o._index*4,a(s+0,c,l,u,d),a(s+1,c,l,u,d),a(s+2,c,l,u,d),a(s+3,c,l,u,d))}function Fm(e,t,n,i,o){let s;const a=i[ke.pixelOffsetScaleByDistance];let c=0,l=1,u=1,d=1;const p=o.pixelOffsetScaleByDistance;h(p)&&(c=p.near,l=p.nearValue,u=p.far,d=p.farValue,(l!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(s=o._index,a(s,c,l,u,d)):(s=o._index*4,a(s+0,c,l,u,d),a(s+1,c,l,u,d),a(s+2,c,l,u,d),a(s+3,c,l,u,d))}function Lm(e,t,n,i,o){let s;const a=i[ke.compressedAttribute3];let c=0,l=Number.MAX_VALUE;const u=o.distanceDisplayCondition;h(u)&&(c=u.near,l=u.far,c*=c,l*=l,e._shaderDistanceDisplayCondition=!0);let d=o.disableDepthTestDistance;const p=$s(o.heightReference)&&t.context.depthTexture;h(d)||(d=p?5e3:0),d*=d,(p||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let g,y;if(h(o._labelDimensions))y=o._labelDimensions.x,g=o._labelDimensions.y;else{let D=0,A=0;const O=o._imageIndex;if(O!==-1){const B=n[O];if(!h(B))throw new C(`Invalid billboard image index: ${O}`);D=B.height,A=B.width}g=Math.round(_(o.height,e._textureAtlas.texture.dimensions.y*D));const I=e._textureAtlas.texture.width;y=Math.round(_(o.width,I*A))}const x=Math.floor(S.clamp(y,0,ql)),E=Math.floor(S.clamp(g,0,ql)),b=x*ql+E;e._instanced?(s=o._index,a(s,c,l,d,b)):(s=o._index*4,a(s+0,c,l,d,b),a(s+1,c,l,d,b),a(s+2,c,l,d,b),a(s+3,c,l,d,b))}function Mm(e,t,n,i,o){if($s(o.heightReference)){const x=e._scene,E=t.context,b=t.globeTranslucencyState.translucent,D=h(x.globe)&&x.globe.depthTestAgainstTerrain;e._shaderClampToGround=E.depthTexture&&!b&&D}let s;const a=i[ke.textureCoordinateBoundsOrLabelTranslate];if(Ee.maximumVertexTextureImageUnits>0){let x=0,E=0;h(o._labelTranslate)&&(x=o._labelTranslate.x,E=o._labelTranslate.y),e._instanced?(s=o._index,a(s,x,E,0,0)):(s=o._index*4,a(s+0,x,E,0,0),a(s+1,x,E,0,0),a(s+2,x,E,0,0),a(s+3,x,E,0,0));return}let c=0,l=0,u=0,d=0;const p=o._imageIndex;if(p!==-1){const x=n[p];if(!h(x))throw new C(`Invalid billboard image index: ${p}`);c=x.x,l=x.y,u=x.width,d=x.height}const g=c+u,y=l+d;e._instanced?(s=o._index,a(s,c,l,g,y)):(s=o._index*4,a(s+0,c,l,g,y),a(s+1,c,l,g,y),a(s+2,c,l,g,y),a(s+3,c,l,g,y))}function g1(e,t,n,i,o){if(!h(e._batchTable))return;const s=i[ke.a_batchId],a=o._batchIndex;let c;e._instanced?(c=o._index,s(c,a)):(c=o._index*4,s(c+0,a),s(c+1,a),s(c+2,a),s(c+3,a))}function Um(e,t,n,i,o){if(!e._sdf)return;let s;const a=i[ke.sdf],c=o.outlineColor,l=o.outlineWidth,u=T.floatToByte(c.red),d=T.floatToByte(c.green),p=T.floatToByte(c.blue),g=u*Wo+d*ii+p,y=l/pn.RADIUS,x=T.floatToByte(c.alpha)*Wo+T.floatToByte(y)*ii;e._instanced?(s=o._index,a(s,g,x)):(s=o._index*4,a(s+0,g+vm,x),a(s+1,g+Im,x),a(s+2,g+Rm,x),a(s+3,g+zm,x))}function km(e,t,n,i,o){const s=i[ke.splitDirection];let a=0;const c=o.splitDirection;h(c)&&(a=c);let l;e._instanced?(l=o._index,s(l,a)):(l=o._index*4,s(l+0,a),s(l+1,a),s(l+2,a),s(l+3,a))}function y1(e,t,n,i,o){Dm(e,t,n,i,o),Pm(e,t,n,i,o),Bm(e,t,n,i,o),Hl(e,t,n,i,o),Wl(e,t,n,i,o),Nm(e,t,n,i,o),Fm(e,t,n,i,o),Lm(e,t,n,i,o),Mm(e,t,n,i,o),g1(e,t,n,i,o),Um(e,t,n,i,o),km(e,t,n,i,o)}function jl(e,t,n,i,o,s){let a;i.mode===me.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const c=[];for(let l=0;l<n;++l){const u=t[l],d=u.position,p=fe._computeActualPosition(u,d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function x1(e,t){const n=t.mode,i=e._billboards,o=e._billboardsToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==me.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===me.SCENE3D||n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&jl(e,i,i.length,t,s,!0)):n===me.MORPHING?jl(e,i,i.length,t,s,!0):(n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&jl(e,o,e._billboardsToUpdateIndex,t,s,!1)}function C1(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);const s=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+s}function E1(e,t){const i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
6340
+ `;function fe(e,t){if(e=_(e,_.EMPTY_OBJECT),h(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,s=e.distanceDisplayCondition;if(h(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=we.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=we.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=we.clone(o)}if(h(s)){if(s.far<=s.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");s=rt.clone(s)}this._show=_(e.show,!0),this._position=f.clone(_(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._pixelOffset=U.clone(_(e.pixelOffset,U.ZERO)),this._translate=new U(0,0),this._eyeOffset=f.clone(_(e.eyeOffset,f.ZERO)),this._heightReference=_(e.heightReference,pi.NONE),this._verticalOrigin=_(e.verticalOrigin,Je.CENTER),this._horizontalOrigin=_(e.horizontalOrigin,In.CENTER),this._scale=_(e.scale,1),this._color=T.clone(_(e.color,T.WHITE)),this._rotation=_(e.rotation,0),this._alignedAxis=f.clone(_(e.alignedAxis,f.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=_(e.sizeInMeters,!1),this._distanceDisplayCondition=s,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=_(e.collection,t),this._pickId=void 0,this._pickPrimitive=_(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 c=e.imageId;h(a)&&(h(c)||(typeof a=="string"?c=a:h(a.src)?c=a.src:c=Vn()),this._imageId=c,this._image=a),h(e.imageSubRegion)&&(this._imageId=c,this._imageSubRegion=e.imageSubRegion),h(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=me.SCENE3D,this._clusterShow=!0,this._outlineColor=T.clone(_(e.outlineColor,T.BLACK)),this._outlineWidth=_(e.outlineWidth,0),this._updateClamping(),this._splitDirection=_(e.splitDirection,Ou.NONE)}const lm=fe.SHOW_INDEX=0,ga=fe.POSITION_INDEX=1,hm=fe.PIXEL_OFFSET_INDEX=2,US=fe.EYE_OFFSET_INDEX=3,kS=fe.HORIZONTAL_ORIGIN_INDEX=4,VS=fe.VERTICAL_ORIGIN_INDEX=5,GS=fe.SCALE_INDEX=6,ya=fe.IMAGE_INDEX_INDEX=7,fm=fe.COLOR_INDEX=8,qS=fe.ROTATION_INDEX=9,HS=fe.ALIGNED_AXIS_INDEX=10,WS=fe.SCALE_BY_DISTANCE_INDEX=11,jS=fe.TRANSLUCENCY_BY_DISTANCE_INDEX=12,YS=fe.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,XS=fe.DISTANCE_DISPLAY_CONDITION=14,$S=fe.DISABLE_DEPTH_DISTANCE=15;fe.TEXTURE_COORDINATE_BOUNDS=16;const um=fe.SDF_INDEX=17,ZS=fe.SPLIT_DIRECTION_INDEX=18;fe.NUMBER_OF_PROPERTIES=19;function Ze(e,t){const n=e._billboardCollection;h(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(fe.prototype,{show:{get:function(){return this._show},set:function(e){m.typeOf.bool("value",e),this._show!==e&&(this._show=e,Ze(this,lm))}},position:{get:function(){return this._position},set:function(e){m.typeOf.object("value",e);const t=this._position;f.equals(t,e)||(f.clone(e,t),f.clone(e,this._actualPosition),this._updateClamping(),Ze(this,ga))}},heightReference:{get:function(){return this._heightReference},set:function(e){m.typeOf.number("value",e);const t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Ze(this,ga))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){m.typeOf.object("value",e);const t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Ze(this,hm))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;we.equals(t,e)||(this._scaleByDistance=we.clone(e,t),Ze(this,WS))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;we.equals(t,e)||(this._translucencyByDistance=we.clone(e,t),Ze(this,jS))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;we.equals(t,e)||(this._pixelOffsetScaleByDistance=we.clone(e,t),Ze(this,YS))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){m.typeOf.object("value",e);const t=this._eyeOffset;f.equals(t,e)||(f.clone(e,t),Ze(this,US))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){m.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Ze(this,kS))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){m.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,Ze(this,VS))}},scale:{get:function(){return this._scale},set:function(e){m.typeOf.number("value",e),this._scale!==e&&(this._scale=e,Ze(this,GS))}},color:{get:function(){return this._color},set:function(e){m.typeOf.object("value",e);const t=this._color;T.equals(t,e)||(T.clone(e,t),Ze(this,fm))}},rotation:{get:function(){return this._rotation},set:function(e){m.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,Ze(this,qS))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){m.typeOf.object("value",e);const t=this._alignedAxis;f.equals(t,e)||(f.clone(e,t),Ze(this,HS))}},width:{get:function(){return _(this._width,this._imageWidth)},set:function(e){h(e)&&m.typeOf.number("value",e),this._width!==e&&(this._width=e,Ze(this,ya))}},height:{get:function(){return _(this._height,this._imageHeight)},set:function(e){h(e)&&m.typeOf.number("value",e),this._height!==e&&(this._height=e,Ze(this,ya))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){m.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,Ze(this,fm))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!rt.equals(e,this._distanceDisplayCondition)){if(h(e)&&(m.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");this._distanceDisplayCondition=rt.clone(e,this._distanceDisplayCondition),Ze(this,XS)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(h(e)&&(m.typeOf.number("value",e),e<0))throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ze(this,$S))}},id:{get:function(){return this._id},set:function(e){this._id=e,h(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,h(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){h(e)?typeof e=="string"?this.setImage(e,e):e instanceof ne?this.setImage(e.url,e):h(e.src)?this.setImage(e.src,e):this.setImage(Vn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Ze(this,ya))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=f.clone(e,this._actualClampedPosition),Ze(this,ga)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ze(this,lm))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;T.equals(t,e)||(T.clone(e,t),Ze(this,um))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ze(this,um))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ze(this,ZS))}}}),fe.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},fe.prototype._updateClamping=function(){fe._updateClamping(this._billboardCollection,this)};const xa=new ee;fe._updateClamping=function(e,t){const n=e._scene;if(!h(n)){if(t._heightReference!==pi.NONE)throw new C("Height reference is not supported without a scene.");return}const i=_(n.ellipsoid,le.default),o=n.frameState.mode,s=o!==t._mode;if(t._mode=o,(t._heightReference===pi.NONE||s)&&h(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===pi.NONE||!h(t._position))return;h(t._removeCallbackFunc)&&t._removeCallbackFunc();const a=i.cartesianToCartographic(t._position);if(!h(a)){t._actualClampedPosition=void 0;return}function c(u){const d=i.cartographicToCartesian(u,t._clampedPosition);Tx(t._heightReference)&&(t._mode===me.SCENE3D?(u.height+=a.height,i.cartographicToCartesian(u,d)):d.x+=a.height),t._clampedPosition=d}t._removeCallbackFunc=n.updateHeight(a,c,t._heightReference),ee.clone(a,xa);const l=n.getHeight(a,t._heightReference);h(l)&&(xa.height=l),c(xa)},fe.prototype._loadImage=function(){const e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion;let o;const s=this;function a(l){if(s._imageId!==t||s._image!==n||!Ce.equals(s._imageSubRegion,i))return;const u=e.textureCoordinates[l];s._imageWidth=e.texture.width*u.width,s._imageHeight=e.texture.height*u.height,s._imageIndex=l,s._ready=!0,s._image=void 0,s._imageIndexPromise=void 0,Ze(s,ya);const d=s._billboardCollection._scene;h(d)&&d.frameState.afterRender.push(()=>!0)}if(h(n)&&(o=e.addImage(t,n)),h(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!h(o))return;const c=e.getImageIndex(t);if(h(c)&&!h(i)){a(c);return}o.then(a).catch(function(l){console.error(`Error loading image for billboard: ${l}`),s._imageIndexPromise=void 0})},fe.prototype.setImage=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,h(this._billboardCollection._textureAtlas)&&this._loadImage())},fe.prototype.setImageSubRegion=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("subRegion is required.");this._imageId===e&&Ce.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ce.clone(t),h(this._billboardCollection._textureAtlas)&&this._loadImage())},fe.prototype._setTranslate=function(e){if(!h(e))throw new C("value is required.");const t=this._translate;U.equals(t,e)||(U.clone(e,t),Ze(this,hm))},fe.prototype._getActualPosition=function(){return h(this._clampedPosition)?this._clampedPosition:this._actualPosition},fe.prototype._setActualPosition=function(e){h(this._clampedPosition)||f.clone(e,this._actualPosition),Ze(this,ga)};const dm=new Y;fe._computeActualPosition=function(e,t,n,i){return h(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===me.SCENE3D?t:(N.multiplyByPoint(i,t,dm),At.computeActualEllipsoidPosition(n,dm))};const pm=new f;fe._computeScreenSpacePosition=function(e,t,n,i,o,s){const a=N.multiplyByPoint(e,t,pm),c=At.worldWithEyeOffsetToWindowCoordinates(o,a,n,s);if(h(c))return U.add(c,i,c),c};const Ca=new U(0,0);fe.prototype.computeScreenSpacePosition=function(e,t){const n=this._billboardCollection;if(h(t)||(t=new U),!h(n))throw new C("Billboard must be in a collection. Was it removed?");if(!h(e))throw new C("scene is required.");U.clone(this._pixelOffset,Ca),U.add(Ca,this._translate,Ca);let i=n.modelMatrix,o=this._position;if(h(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==me.SCENE3D)){const a=e.mapProjection,c=a.ellipsoid,l=a.unproject(o,xa);o=c.cartographicToCartesian(l,pm),i=N.IDENTITY}return fe._computeScreenSpacePosition(i,o,this._eyeOffset,Ca,e,t)},fe.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height;const s=e.scale;i*=s,o*=s;let a=t.x;e.horizontalOrigin===In.RIGHT?a-=i:e.horizontalOrigin===In.CENTER&&(a-=i*.5);let c=t.y;return e.verticalOrigin===Je.BOTTOM||e.verticalOrigin===Je.BASELINE?c-=o:e.verticalOrigin===Je.CENTER&&(c-=o*.5),h(n)||(n=new Ce),n.x=a,n.y=c,n.width=i,n.height=o,n},fe.prototype.equals=function(e){return this===e||h(e)&&this._id===e._id&&f.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&&Ce.equals(this._imageSubRegion,e._imageSubRegion)&&T.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&f.equals(this._eyeOffset,e._eyeOffset)&&we.equals(this._scaleByDistance,e._scaleByDistance)&&we.equals(this._translucencyByDistance,e._translucencyByDistance)&&we.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},fe.prototype._destroy=function(){h(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),h(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};const ft=Object.freeze({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2}),pn=Object.freeze({FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25});function Ei(e,t,n,i,o){this.bottomLeft=_(e,U.ZERO),this.topRight=_(t,U.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}const KS=new U(16,16);function ni(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.borderWidthInPixels,1),n=_(e.initialSize,KS);if(!h(e.context))throw new C("context is required.");if(t<0)throw new C("borderWidthInPixels must be greater than or equal to zero.");if(n.x<1||n.y<1)throw new C("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=_(e.pixelFormat,de.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Vn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(ni.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return h(this._texture)||(this._texture=new Nt({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}}});function QS(e,t){const n=e._context,i=e.numberOfImages,o=2,s=e._borderWidthInPixels;if(i>0){const a=e._texture.width,c=e._texture.height,l=o*(a+t.width+s),u=o*(c+t.height+s),d=a/l,p=c/u,g=new Ei(new U(a+s,s),new U(l,c)),y=new Ei(new U,new U(l,c),e._root,g),x=new Ei(new U(s,c+s),new U(l,u)),E=new Ei(new U,new U(l,u),y,x);for(let A=0;A<e._textureCoordinates.length;A++){const O=e._textureCoordinates[A];h(O)&&(O.x*=d,O.y*=p,O.width*=d,O.height*=p)}const b=new Nt({context:e._context,width:l,height:u,pixelFormat:e._pixelFormat}),D=new On({context:n,colorTextures:[e._texture],destroyAttachments:!1});D._bind(),b.copyFromFramebuffer(0,0,0,0,l,u),D._unBind(),D.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=b,e._root=E}else{let a=o*(t.width+2*s),c=o*(t.height+2*s);a<e._initialSize.x&&(a=e._initialSize.x),c<e._initialSize.y&&(c=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Nt({context:e._context,width:a,height:c,pixelFormat:e._pixelFormat}),e._root=new Ei(new U(s,s),new U(a,c))}}function Ea(e,t,n){if(h(t)){if(!h(t.childNode1)&&!h(t.childNode2)){if(h(t.imageIndex))return;const i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,s=i-n.width,a=o-n.height;if(s<0||a<0)return;if(s===0&&a===0)return t;if(s>a){t.childNode1=new Ei(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.bottomLeft.x+n.width,t.topRight.y));const c=t.bottomLeft.x+n.width+e._borderWidthInPixels;c<t.topRight.x&&(t.childNode2=new Ei(new U(c,t.bottomLeft.y),new U(t.topRight.x,t.topRight.y)))}else{t.childNode1=new Ei(new U(t.bottomLeft.x,t.bottomLeft.y),new U(t.topRight.x,t.bottomLeft.y+n.height));const c=t.bottomLeft.y+n.height+e._borderWidthInPixels;c<t.topRight.y&&(t.childNode2=new Ei(new U(t.bottomLeft.x,c),new U(t.topRight.x,t.topRight.y)))}return Ea(e,t.childNode1,n)}return Ea(e,t.childNode1,n)||Ea(e,t.childNode2,n)}}function mm(e,t,n){const i=Ea(e,e._root,t);if(h(i)){i.imageIndex=n;const o=e._texture.width,s=e._texture.height,a=i.topRight.x-i.bottomLeft.x,c=i.topRight.y-i.bottomLeft.y,l=i.bottomLeft.x/o,u=i.bottomLeft.y/s,d=a/o,p=c/s;e._textureCoordinates[n]=new Ce(l,u,d,p),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else QS(e,t),mm(e,t,n);e._guid=Vn()}function _m(e,t){if(!h(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return mm(e,t,n),n}ni.prototype.getImageIndex=function(e){if(!h(e))throw new C("id is required.");return this._indexHash[e]},ni.prototype.addImageSync=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("image is required.");let n=this._indexHash[e];return h(n)||(n=_m(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n},ni.prototype.addImage=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("image is required.");let n=this._idHash[e];if(h(n))return n;if(typeof t=="function"){if(t=t(e),!h(t))throw new C("image is required.")}else(typeof t=="string"||t instanceof ne)&&(t=ne.createIfNeeded(t).fetchImage());const i=this;return n=Promise.resolve(t).then(function(o){const s=_m(i,o);return i._indexHash[e]=s,s}),this._idHash[e]=n,n},ni.prototype.addSubRegion=function(e,t){if(!h(e))throw new C("id is required.");if(!h(t))throw new C("subRegion is required.");const n=this._idHash[e];if(!h(n))throw new at(`image with id "${e}" not found in the atlas.`);const i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;const s=i._texture.width,a=i._texture.height,c=i._textureCoordinates[o],l=c.x+t.x/s,u=c.y+t.y/a,d=t.width/s,p=t.height/a,g=i._textureCoordinates.push(new Ce(l,u,d,p))-1;return i._indexHash[e]=g,i._guid=Vn(),g})},ni.prototype.isDestroyed=function(){return!1},ni.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),Qe(this)};const JS=fe.SHOW_INDEX,Wr=fe.POSITION_INDEX,gm=fe.PIXEL_OFFSET_INDEX,ym=fe.EYE_OFFSET_INDEX,e1=fe.HORIZONTAL_ORIGIN_INDEX,t1=fe.VERTICAL_ORIGIN_INDEX,n1=fe.SCALE_INDEX,jr=fe.IMAGE_INDEX_INDEX,xm=fe.COLOR_INDEX,i1=fe.ROTATION_INDEX,o1=fe.ALIGNED_AXIS_INDEX,Cm=fe.SCALE_BY_DISTANCE_INDEX,Em=fe.TRANSLUCENCY_BY_DISTANCE_INDEX,bm=fe.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,wm=fe.DISTANCE_DISPLAY_CONDITION,r1=fe.DISABLE_DEPTH_DISTANCE,s1=fe.TEXTURE_COORDINATE_BOUNDS,Tm=fe.SDF_INDEX,Sm=fe.SPLIT_DIRECTION_INDEX,Ul=fe.NUMBER_OF_PROPERTIES;let ke;const a1={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,splitDirection:12},c1={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,splitDirection:13};function Jt(e){e=_(e,_.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(Ul),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new K,this._baseVolumeWC=new K,this._baseVolume2D=new K,this._boundingVolume=new K,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=_(e.debugShowTextureAtlas,!1),this.blendOption=_(e.blendOption,ft.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=me.SCENE3D,this._buffersUsage=[De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW],this._highlightColor=T.clone(T.WHITE);const t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};const n=this._scene;h(n)&&h(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){const i=this._billboards,o=i.length;for(let s=0;s<o;++s)h(i[s])&&i[s]._updateClamping()},this))}Object.defineProperties(Jt.prototype,{length:{get:function(){return kl(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}}});function Am(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Jt.prototype.add=function(e){const t=new fe(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},Jt.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},Jt.prototype.removeAll=function(){Am(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function kl(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;const t=[],n=e._billboards,i=n.length;for(let o=0,s=0;o<i;++o){const a=n[o];h(a)&&(a._index=s++,t.push(a))}e._billboards=t}}Jt.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},Jt.prototype.contains=function(e){return h(e)&&e._billboardCollection===this},Jt.prototype.get=function(e){return m.typeOf.number("index",e),kl(this),this._billboards[e]};let Vl;function l1(e){let n=e.cache.billboardCollection_indexBufferBatched;if(h(n))return n;const i=16384*6-6,o=new Uint16Array(i);for(let s=0,a=0;s<i;s+=6,a+=4)o[s]=a,o[s+1]=a+1,o[s+2]=a+2,o[s+3]=a+0,o[s+4]=a+2,o[s+5]=a+3;return n=vt.createIndexBuffer({context:e,typedArray:o,usage:De.STATIC_DRAW,indexDatatype:Ct.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function h1(e){let t=e.cache.billboardCollection_indexBufferInstanced;return h(t)||(t=vt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:De.STATIC_DRAW,indexDatatype:Ct.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function f1(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return h(t)||(t=vt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:De.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Jt.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Ul;++i){const o=n[i]===0?De.STATIC_DRAW:De.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function u1(e,t,n,i,o,s){const a=[{index:ke.positionHighAndScale,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Wr]},{index:ke.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Wr]},{index:ke.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[gm]},{index:ke.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Em]},{index:ke.compressedAttribute2,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[xm]},{index:ke.eyeOffset,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[ym]},{index:ke.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Cm]},{index:ke.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[bm]},{index:ke.compressedAttribute3,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[wm]},{index:ke.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[s1]},{index:ke.splitDirection,componentsPerAttribute:1,componentDatatype:oe.FLOAT,usage:n[Sm]}];i&&a.push({index:ke.direction,componentsPerAttribute:2,componentDatatype:oe.FLOAT,vertexBuffer:f1(e)}),h(o)&&a.push({index:ke.a_batchId,componentsPerAttribute:1,componentDatatype:oe.FLOAT,bufferUsage:De.STATIC_DRAW}),s&&a.push({index:ke.sdf,componentsPerAttribute:2,componentDatatype:oe.FLOAT,usage:n[Tm]});const c=i?t:4*t;return new Tt(e,a,c,i)}const Gl=new Ye;function Dm(e,t,n,i,o){let s;const a=i[ke.positionHighAndScale],c=i[ke.positionLowAndRotation],l=o._getActualPosition();e._mode===me.SCENE3D&&(K.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),Ye.fromCartesian(l,Gl);const u=o.scale,d=o.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);const p=Gl.high,g=Gl.low;e._instanced?(s=o._index,a(s,p.x,p.y,p.z,u),c(s,g.x,g.y,g.z,d)):(s=o._index*4,a(s+0,p.x,p.y,p.z,u),a(s+1,p.x,p.y,p.z,u),a(s+2,p.x,p.y,p.z,u),a(s+3,p.x,p.y,p.z,u),c(s+0,g.x,g.y,g.z,d),c(s+1,g.x,g.y,g.z,d),c(s+2,g.x,g.y,g.z,d),c(s+3,g.x,g.y,g.z,d))}const bn=new U,wn=32768,Wo=65536,ql=4096,ii=256,d1=128,p1=32,m1=8,Om=4,_1=1/256,vm=0,Im=2,Rm=3,zm=1;function Pm(e,t,n,i,o){let s;const a=i[ke.compressedAttribute0],c=o.pixelOffset,l=c.x,u=c.y,d=o._translate,p=d.x,g=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(l+p),Math.abs(-u+g));const y=o.horizontalOrigin;let x=o._verticalOrigin,E=o.show&&o.clusterShow;o.color.alpha===0&&(E=!1),x===Je.BASELINE&&(x=Je.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&y===In.CENTER,e._allVerticalCenter=e._allVerticalCenter&&x===Je.CENTER;let b=0,D=0,A=0,O=0;const I=o._imageIndex;if(I!==-1){const G=n[I];if(!h(G))throw new C(`Invalid billboard image index: ${I}`);b=G.x,D=G.y,A=G.width,O=G.height}const B=b+A,M=D+O;let q=Math.floor(S.clamp(l,-wn,wn)+wn)*d1;q+=(y+1)*p1,q+=(x+1)*m1,q+=(E?1:0)*Om;let P=Math.floor(S.clamp(u,-wn,wn)+wn)*ii,V=Math.floor(S.clamp(p,-wn,wn)+wn)*ii;const k=(S.clamp(g,-wn,wn)+wn)*_1,H=Math.floor(k),j=Math.floor((k-H)*ii);P+=H,V+=j,bn.x=b,bn.y=D;const r=Te.compressTextureCoordinates(bn);bn.x=B;const w=Te.compressTextureCoordinates(bn);bn.y=M;const v=Te.compressTextureCoordinates(bn);bn.x=b;const z=Te.compressTextureCoordinates(bn);e._instanced?(s=o._index,a(s,q,P,V,r)):(s=o._index*4,a(s+0,q+vm,P,V,r),a(s+1,q+Im,P,V,w),a(s+2,q+Rm,P,V,v),a(s+3,q+zm,P,V,z))}function Bm(e,t,n,i,o){let s;const a=i[ke.compressedAttribute1],c=o.alignedAxis;f.equals(c,f.ZERO)||(e._shaderAlignedAxis=!0);let l=0,u=1,d=1,p=1;const g=o.translucencyByDistance;h(g)&&(l=g.near,u=g.nearValue,d=g.far,p=g.farValue,(u!==1||p!==1)&&(e._shaderTranslucencyByDistance=!0));let y=0;const x=o._imageIndex;if(x!==-1){const O=n[x];if(!h(O))throw new C(`Invalid billboard image index: ${x}`);y=O.width}const E=e._textureAtlas.texture.width,b=Math.round(_(o.width,E*y));e._maxSize=Math.max(e._maxSize,b);let D=S.clamp(b,0,Wo),A=0;Math.abs(f.magnitudeSquared(c)-1)<S.EPSILON6&&(A=Te.octEncodeFloat(c)),u=S.clamp(u,0,1),u=u===1?255:u*255|0,D=D*ii+u,p=S.clamp(p,0,1),p=p===1?255:p*255|0,A=A*ii+p,e._instanced?(s=o._index,a(s,D,A,l,d)):(s=o._index*4,a(s+0,D,A,l,d),a(s+1,D,A,l,d),a(s+2,D,A,l,d),a(s+3,D,A,l,d))}function Hl(e,t,n,i,o){let s;const a=i[ke.compressedAttribute2],c=o.color,l=h(e._batchTable)?T.WHITE:o.getPickId(t.context).color,u=o.sizeInMeters?1:0,d=Math.abs(f.magnitudeSquared(o.alignedAxis)-1)<S.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&u===1;let p=0;const g=o._imageIndex;if(g!==-1){const q=n[g];if(!h(q))throw new C(`Invalid billboard image index: ${g}`);p=q.height}const y=e._textureAtlas.texture.dimensions,x=Math.round(_(o.height,y.y*p));e._maxSize=Math.max(e._maxSize,x);let E=_(o._labelHorizontalOrigin,-2);E+=2;const b=x*Om+E;let D=T.floatToByte(c.red),A=T.floatToByte(c.green),O=T.floatToByte(c.blue);const I=D*Wo+A*ii+O;D=T.floatToByte(l.red),A=T.floatToByte(l.green),O=T.floatToByte(l.blue);const B=D*Wo+A*ii+O;let M=T.floatToByte(c.alpha)*Wo+T.floatToByte(l.alpha)*ii;M+=u*2+d,e._instanced?(s=o._index,a(s,I,B,M,b)):(s=o._index*4,a(s+0,I,B,M,b),a(s+1,I,B,M,b),a(s+2,I,B,M,b),a(s+3,I,B,M,b))}function Wl(e,t,n,i,o){let s;const a=i[ke.eyeOffset],c=o.eyeOffset;let l=c.z;if(o._heightReference!==pi.NONE&&(l*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(c.x),Math.abs(c.y),Math.abs(l)),e._instanced){let u=0,d=0;const p=o._imageIndex;if(p!==-1){const y=n[p];if(!h(y))throw new C(`Invalid billboard image index: ${p}`);u=y.width,d=y.height}bn.x=u,bn.y=d;const g=Te.compressTextureCoordinates(bn);s=o._index,a(s,c.x,c.y,l,g)}else s=o._index*4,a(s+0,c.x,c.y,l,0),a(s+1,c.x,c.y,l,0),a(s+2,c.x,c.y,l,0),a(s+3,c.x,c.y,l,0)}function Nm(e,t,n,i,o){let s;const a=i[ke.scaleByDistance];let c=0,l=1,u=1,d=1;const p=o.scaleByDistance;h(p)&&(c=p.near,l=p.nearValue,u=p.far,d=p.farValue,(l!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(s=o._index,a(s,c,l,u,d)):(s=o._index*4,a(s+0,c,l,u,d),a(s+1,c,l,u,d),a(s+2,c,l,u,d),a(s+3,c,l,u,d))}function Fm(e,t,n,i,o){let s;const a=i[ke.pixelOffsetScaleByDistance];let c=0,l=1,u=1,d=1;const p=o.pixelOffsetScaleByDistance;h(p)&&(c=p.near,l=p.nearValue,u=p.far,d=p.farValue,(l!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(s=o._index,a(s,c,l,u,d)):(s=o._index*4,a(s+0,c,l,u,d),a(s+1,c,l,u,d),a(s+2,c,l,u,d),a(s+3,c,l,u,d))}function Lm(e,t,n,i,o){let s;const a=i[ke.compressedAttribute3];let c=0,l=Number.MAX_VALUE;const u=o.distanceDisplayCondition;h(u)&&(c=u.near,l=u.far,c*=c,l*=l,e._shaderDistanceDisplayCondition=!0);let d=o.disableDepthTestDistance;const p=$s(o.heightReference)&&t.context.depthTexture;h(d)||(d=p?5e3:0),d*=d,(p||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let g,y;if(h(o._labelDimensions))y=o._labelDimensions.x,g=o._labelDimensions.y;else{let D=0,A=0;const O=o._imageIndex;if(O!==-1){const B=n[O];if(!h(B))throw new C(`Invalid billboard image index: ${O}`);D=B.height,A=B.width}g=Math.round(_(o.height,e._textureAtlas.texture.dimensions.y*D));const I=e._textureAtlas.texture.width;y=Math.round(_(o.width,I*A))}const x=Math.floor(S.clamp(y,0,ql)),E=Math.floor(S.clamp(g,0,ql)),b=x*ql+E;e._instanced?(s=o._index,a(s,c,l,d,b)):(s=o._index*4,a(s+0,c,l,d,b),a(s+1,c,l,d,b),a(s+2,c,l,d,b),a(s+3,c,l,d,b))}function Mm(e,t,n,i,o){if($s(o.heightReference)){const x=e._scene,E=t.context,b=t.globeTranslucencyState.translucent,D=h(x.globe)&&x.globe.depthTestAgainstTerrain;e._shaderClampToGround=E.depthTexture&&!b&&D}let s;const a=i[ke.textureCoordinateBoundsOrLabelTranslate];if(Ee.maximumVertexTextureImageUnits>0){let x=0,E=0;h(o._labelTranslate)&&(x=o._labelTranslate.x,E=o._labelTranslate.y),e._instanced?(s=o._index,a(s,x,E,0,0)):(s=o._index*4,a(s+0,x,E,0,0),a(s+1,x,E,0,0),a(s+2,x,E,0,0),a(s+3,x,E,0,0));return}let c=0,l=0,u=0,d=0;const p=o._imageIndex;if(p!==-1){const x=n[p];if(!h(x))throw new C(`Invalid billboard image index: ${p}`);c=x.x,l=x.y,u=x.width,d=x.height}const g=c+u,y=l+d;e._instanced?(s=o._index,a(s,c,l,g,y)):(s=o._index*4,a(s+0,c,l,g,y),a(s+1,c,l,g,y),a(s+2,c,l,g,y),a(s+3,c,l,g,y))}function g1(e,t,n,i,o){if(!h(e._batchTable))return;const s=i[ke.a_batchId],a=o._batchIndex;let c;e._instanced?(c=o._index,s(c,a)):(c=o._index*4,s(c+0,a),s(c+1,a),s(c+2,a),s(c+3,a))}function Um(e,t,n,i,o){if(!e._sdf)return;let s;const a=i[ke.sdf],c=o.outlineColor,l=o.outlineWidth,u=T.floatToByte(c.red),d=T.floatToByte(c.green),p=T.floatToByte(c.blue),g=u*Wo+d*ii+p,y=l/pn.RADIUS,x=T.floatToByte(c.alpha)*Wo+T.floatToByte(y)*ii;e._instanced?(s=o._index,a(s,g,x)):(s=o._index*4,a(s+0,g+vm,x),a(s+1,g+Im,x),a(s+2,g+Rm,x),a(s+3,g+zm,x))}function km(e,t,n,i,o){const s=i[ke.splitDirection];let a=0;const c=o.splitDirection;h(c)&&(a=c);let l;e._instanced?(l=o._index,s(l,a)):(l=o._index*4,s(l+0,a),s(l+1,a),s(l+2,a),s(l+3,a))}function y1(e,t,n,i,o){Dm(e,t,n,i,o),Pm(e,t,n,i,o),Bm(e,t,n,i,o),Hl(e,t,n,i,o),Wl(e,t,n,i,o),Nm(e,t,n,i,o),Fm(e,t,n,i,o),Lm(e,t,n,i,o),Mm(e,t,n,i,o),g1(e,t,n,i,o),Um(e,t,n,i,o),km(e,t,n,i,o)}function jl(e,t,n,i,o,s){let a;i.mode===me.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const c=[];for(let l=0;l<n;++l){const u=t[l],d=u.position,p=fe._computeActualPosition(u,d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function x1(e,t){const n=t.mode,i=e._billboards,o=e._billboardsToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==me.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===me.SCENE3D||n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&jl(e,i,i.length,t,s,!0)):n===me.MORPHING?jl(e,i,i.length,t,s,!0):(n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&jl(e,o,e._billboardsToUpdateIndex,t,s,!1)}function C1(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);const s=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+s}function E1(e,t){const i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
6341
6341
  in vec2 v_textureCoordinates;
6342
6342
  void main()
6343
6343
  {
6344
6344
  out_FragColor = texture(billboard_texture, v_textureCoordinates);
6345
6345
  }
6346
- `,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Pt.OVERLAY,i}const b1=[];Jt.prototype.update=function(e){if(kl(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,ke=this._instanced?c1:a1,Vl=this._instanced?h1:l1;let o=this._textureAtlas;if(!h(o)){o=this._textureAtlas=new ni({context:i});for(let P=0;P<n;++P)t[P]._loadImage()}const s=o.textureCoordinates;if(s.length===0)return;x1(this,e),t=this._billboards,n=t.length;const a=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,l=this._propertiesChanged,u=o.guid,d=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let p;const g=e.passes,y=g.pick;if(d||!y&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Ul;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=u1(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),p=this._vaf.writers;for(let P=0;P<n;++P){const V=this._billboards[P];V._dirty=!1,y1(this,e,s,p,V)}this._vaf.commit(Vl(i))}this._billboardsToUpdateIndex=0}else if(c>0){const P=b1;P.length=0,(l[Wr]||l[i1]||l[n1])&&P.push(Dm),(l[jr]||l[gm]||l[e1]||l[t1]||l[JS])&&(P.push(Pm),this._instanced&&P.push(Wl)),(l[jr]||l[o1]||l[Em])&&(P.push(Bm),P.push(Hl)),(l[jr]||l[xm])&&P.push(Hl),l[ym]&&P.push(Wl),l[Cm]&&P.push(Nm),l[bm]&&P.push(Fm),(l[wm]||l[r1]||l[jr]||l[Wr])&&P.push(Lm),(l[jr]||l[Wr])&&P.push(Mm),l[Tm]&&P.push(Um),l[Sm]&&P.push(km);const V=P.length;if(p=this._vaf.writers,c/n>.1){for(let k=0;k<c;++k){const H=a[k];H._dirty=!1;for(let j=0;j<V;++j)P[j](this,e,s,p,H)}this._vaf.commit(Vl(i))}else{for(let k=0;k<c;++k){const H=a[k];H._dirty=!1;for(let j=0;j<V;++j)P[j](this,e,s,p,H);this._instanced?this._vaf.subCommit(H._index,1):this._vaf.subCommit(H._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>n*1.5&&(a.length=n),!h(this._vaf)||!h(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,K.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let x,E=N.IDENTITY;e.mode===me.SCENE3D?(E=this.modelMatrix,x=K.clone(this._baseVolumeWC,this._boundingVolume)):x=K.clone(this._baseVolume2D,this._boundingVolume),C1(this,e,x);const b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===ft.OPAQUE||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:R.LESS},depthMask:!0}):this._rsOpaque=void 0;const P=this._blendOption===ft.TRANSLUCENT;this._blendOption===ft.TRANSLUCENT||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:P?R.LEQUAL:R.LESS},depthMask:P,blending:to.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let D,A,O,I,B;const M=Ee.maximumVertexTextureImageUnits>0;if(b||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){D=MS,A=LS,B=[],h(this._batchTable)&&(B.push("VECTOR_TILE"),D=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(D),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),O=new ye({defines:B,sources:[D]}),this._instanced&&O.defines.push("INSTANCED"),this._shaderRotation&&O.defines.push("ROTATION"),this._shaderAlignedAxis&&O.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&O.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&O.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&O.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&O.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&O.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(M?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK"));const P=1-pn.CUTOFF;this._sdf&&O.defines.push("SDF");const V=h(this._batchTable)?"VECTOR_TILE":"";this._blendOption===ft.OPAQUE_AND_TRANSLUCENT&&(I=new ye({defines:["OPAQUE",V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._sp=ot.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke}),I=new ye({defines:["TRANSLUCENT",V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=ot.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke})),this._blendOption===ft.OPAQUE&&(I=new ye({defines:[V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._sp=ot.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke})),this._blendOption===ft.TRANSLUCENT&&(I=new ye({defines:[V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=ot.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke})),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 q=e.commandList;if(g.render||g.pick){const P=this._colorCommands,V=this._blendOption===ft.OPAQUE,k=this._blendOption===ft.OPAQUE_AND_TRANSLUCENT,H=this._vaf.va,j=H.length;let r=this._uniforms,w;h(this._batchTable)?(r=this._batchTable.getUniformMapCallback()(r),w=this._batchTable.getPickId()):w="v_pickColor",P.length=j;const v=k?j*2:j;for(let z=0;z<v;++z){let G=P[z];h(G)||(G=P[z]=new $e);const W=V||k&&z%2===0;G.pass=W||!k?Pt.OPAQUE:Pt.TRANSLUCENT,G.owner=this;const Z=k?Math.floor(z/2):z;G.boundingVolume=x,G.modelMatrix=E,G.count=H[Z].indicesCount,G.shaderProgram=W?this._sp:this._spTranslucent,G.uniformMap=r,G.vertexArray=H[Z].va,G.renderState=W?this._rsOpaque:this._rsTranslucent,G.debugShowBoundingVolume=this.debugShowBoundingVolume,G.pickId=w,this._instanced&&(G.count=6,G.instanceCount=n),q.push(G)}this.debugShowTextureAtlas&&(h(this.debugCommand)||(this.debugCommand=E1(this,e.context)),q.push(this.debugCommand))}},Jt.prototype.isDestroyed=function(){return!1},Jt.prototype.destroy=function(){return h(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(),Am(this._billboards),Qe(this)};function w1(e,t,n,i,o){const s=e.measureText(t);if(!!/\S/.test(t)){const c=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),l=document.createElement("canvas"),u=100,d=s.width+u|0,p=3*c,g=p/2;l.width=d,l.height=p;const y=l.getContext("2d");y.font=n,y.fillStyle="white",y.fillRect(0,0,l.width+1,l.height+1),i&&(y.strokeStyle="black",y.lineWidth=e.lineWidth,y.strokeText(t,u/2,g)),o&&(y.fillStyle="black",y.fillText(t,u/2,g));const x=y.getImageData(0,0,d,p).data,E=x.length,b=d*4;let D,A,O,I;for(D=0;D<E;++D)if(x[D]!==255){O=D/b|0;break}for(D=E-1;D>=0;--D)if(x[D]!==255){I=D/b|0;break}let B=-1;for(D=0;D<d&&B===-1;++D)for(A=0;A<p;++A){const M=D*4+A*b;if(x[M]!==255||x[M+1]!==255||x[M+2]!==255||x[M+3]!==255){B=D;break}}return{width:s.width,height:I-O,ascent:g-O,descent:I-g,minx:B-u/2}}return{width:s.width,height:0,ascent:0,descent:0,minx:0}}let lo;function T1(e,t){if(!h(e))throw new C("text is required.");if(e==="")return;t=_(t,_.EMPTY_OBJECT);const n=_(t.font,"10px sans-serif"),i=_(t.stroke,!1),o=_(t.fill,!0),s=_(t.strokeWidth,1),a=_(t.backgroundColor,T.TRANSPARENT),c=_(t.padding,0),l=c*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;const d=u.getContext("2d",{willReadFrequently:!0});h(lo)||(h(d.imageSmoothingEnabled)?lo="imageSmoothingEnabled":h(d.mozImageSmoothingEnabled)?lo="mozImageSmoothingEnabled":h(d.webkitImageSmoothingEnabled)?lo="webkitImageSmoothingEnabled":h(d.msImageSmoothingEnabled)&&(lo="msImageSmoothingEnabled")),d.font=n,d.lineJoin="round",d.lineWidth=s,d[lo]=!1,u.style.visibility="hidden",document.body.appendChild(u);const p=w1(d,e,n,i,o);u.dimensions=p,document.body.removeChild(u),u.style.visibility="";const g=-p.minx,y=Math.ceil(p.width)+g+l,x=p.height+l,E=x-p.ascent+c,b=x-E+l;if(u.width=y,u.height=x,d.font=n,d.lineJoin="round",d.lineWidth=s,d[lo]=!1,a!==T.TRANSPARENT&&(d.fillStyle=a.toCssColorString(),d.fillRect(0,0,u.width,u.height)),i){const D=_(t.strokeColor,T.BLACK);d.strokeStyle=D.toCssColorString(),d.strokeText(e,g+c,b)}if(o){const D=_(t.fillColor,T.WHITE);d.fillStyle=D.toCssColorString(),d.fillText(e,g+c,b)}return u}var S1=A1,Yr=1e20;function A1(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,s,a,c,l,u,d,p,g,y,x,E;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");s=t.width,a=t.height,l=e,t.stride?d=t.stride:d=Math.floor(e.length/s/a)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(g=e,p=g.getContext("2d"),s=g.width,a=g.height,y=p.getImageData(0,0,s,a),l=y.data,d=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(g=e.canvas,p=e,s=g.width,a=g.height,y=p.getImageData(0,0,s,a),l=y.data,d=4):window.ImageData&&e instanceof window.ImageData&&(y=e,s=e.width,a=e.height,l=y.data,d=4);if(c=Math.max(s,a),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(s*a),x=0,E=Math.floor(u.length/d);x<E;x++)l[x]=u[x*d+o]/255;else if(d!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(s*a),D=Array(s*a),A=Array(c),O=Array(c),I=Array(c+1),B=Array(c);for(x=0,E=s*a;x<E;x++){var M=l[x];b[x]=M===1?0:M===0?Yr:Math.pow(Math.max(0,.5-M),2),D[x]=M===1?Yr:M===0?0:Math.pow(Math.max(0,M-.5),2)}Vm(b,s,a,A,O,B,I),Vm(D,s,a,A,O,B,I);var q=window.Float32Array?new Float32Array(s*a):new Array(s*a);for(x=0,E=s*a;x<E;x++)q[x]=Math.min(Math.max(1-((b[x]-D[x])/i+n),0),1);return q}function Vm(e,t,n,i,o,s,a){for(var c=0;c<t;c++){for(var l=0;l<n;l++)i[l]=e[l*t+c];for(Gm(i,o,s,a,n),l=0;l<n;l++)e[l*t+c]=o[l]}for(l=0;l<n;l++){for(c=0;c<t;c++)i[c]=e[l*t+c];for(Gm(i,o,s,a,t),c=0;c<t;c++)e[l*t+c]=Math.sqrt(o[c])}}function Gm(e,t,n,i,o){n[0]=0,i[0]=-Yr,i[1]=+Yr;for(var s=1,a=0;s<o;s++){for(var c=(e[s]+s*s-(e[n[a]]+n[a]*n[a]))/(2*s-2*n[a]);c<=i[a];)a--,c=(e[s]+s*s-(e[n[a]]+n[a]*n[a]))/(2*s-2*n[a]);a++,n[a]=s,i[a]=c,i[a+1]=+Yr}for(s=0,a=0;s<o;s++){for(;i[a+1]<s;)a++;t[s]=(s-n[a])*(s-n[a])+e[n[a]]}}const D1=rs(S1),Ei=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),qm={};let Hm=0;const O1=256,v1=new T(.165,.165,.165,.8),I1=new U(7,5),gt=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function ho(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Xr(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function $r(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Wm(e){let t=qm[e._font];if(!h(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($r(n,"line-height"));isNaN(i)&&(i=void 0),t={family:$r(n,"font-family"),size:$r(n,"font-size").replace("px",""),style:$r(n,"font-style"),weight:$r(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Hm<O1&&(qm[e._font]=t,Hm++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Ln(e,t){if(e=_(e,_.EMPTY_OBJECT),h(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,s=e.distanceDisplayCondition;if(h(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=we.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=we.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=we.clone(o)}if(h(s)){if(s.far<=s.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");s=rt.clone(s)}this._renderedText=void 0,this._text=void 0,this._show=_(e.show,!0),this._font=_(e.font,"30px sans-serif"),this._fillColor=T.clone(_(e.fillColor,T.WHITE)),this._outlineColor=T.clone(_(e.outlineColor,T.BLACK)),this._outlineWidth=_(e.outlineWidth,1),this._showBackground=_(e.showBackground,!1),this._backgroundColor=T.clone(_(e.backgroundColor,v1)),this._backgroundPadding=U.clone(_(e.backgroundPadding,I1)),this._style=_(e.style,Ei.FILL),this._verticalOrigin=_(e.verticalOrigin,Je.BASELINE),this._horizontalOrigin=_(e.horizontalOrigin,In.LEFT),this._pixelOffset=U.clone(_(e.pixelOffset,U.ZERO)),this._eyeOffset=f.clone(_(e.eyeOffset,f.ZERO)),this._position=f.clone(_(e.position,f.ZERO)),this._scale=_(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=_(e.heightReference,di.NONE),this._distanceDisplayCondition=s,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=_(e.text,""),this._relativeSize=1,Wm(this),this._updateClamping()}Object.defineProperties(Ln.prototype,{show:{get:function(){return this._show},set:function(e){if(!h(e))throw new C("value is required.");if(this._show!==e){this._show=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i].billboard;h(s)&&(s.show=e)}const n=this._backgroundBillboard;h(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!h(e))throw new C("value is required.");const t=this._position;if(!f.equals(t,e)){f.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o].billboard;h(a)&&(a.position=e)}const i=this._backgroundBillboard;h(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!h(e))throw new C("value is required.");if(e!==this._heightReference){this._heightReference=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i].billboard;h(s)&&(s.heightReference=e)}const n=this._backgroundBillboard;h(n)&&(n.heightReference=e),Xr(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!h(e))throw new C("value is required.");if(this._text!==e){this._text=e;const t=e.replace(/\u00ad/g,"");this._renderedText=Ln.enableRightToLeftDetection?F1(t):t,ho(this)}}},font:{get:function(){return this._font},set:function(e){if(!h(e))throw new C("value is required.");this._font!==e&&(this._font=e,ho(this),Wm(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._fillColor;T.equals(t,e)||(T.clone(e,t),ho(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;T.equals(t,e)||(T.clone(e,t),ho(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!h(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,ho(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!h(e))throw new C("value is required.");this._showBackground!==e&&(this._showBackground=e,ho(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._backgroundColor;if(!T.equals(t,e)){T.clone(e,t);const n=this._backgroundBillboard;h(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!h(e))throw new C("value is required.");const t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),Xr(this))}},style:{get:function(){return this._style},set:function(e){if(!h(e))throw new C("value is required.");this._style!==e&&(this._style=e,ho(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!h(e))throw new C("value is required.");const t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.pixelOffset=e)}const i=this._backgroundBillboard;h(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;if(!we.equals(t,e)){this._translucencyByDistance=we.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.translucencyByDistance=e)}const i=this._backgroundBillboard;h(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;if(!we.equals(t,e)){this._pixelOffsetScaleByDistance=we.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}const i=this._backgroundBillboard;h(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;if(!we.equals(t,e)){this._scaleByDistance=we.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.scaleByDistance=e)}const i=this._backgroundBillboard;h(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!h(e))throw new C("value is required.");const t=this._eyeOffset;if(!f.equals(t,e)){f.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.eyeOffset=e)}const i=this._backgroundBillboard;h(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!h(e))throw new C("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Xr(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!h(e))throw new C("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.verticalOrigin=e)}const n=this._backgroundBillboard;h(n)&&(n.verticalOrigin=e),Xr(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!h(e))throw new C("value is required.");if(this._scale!==e){this._scale=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.scale=e*this._relativeSize)}const n=this._backgroundBillboard;h(n)&&(n.scale=e*this._relativeSize),Xr(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far must be greater than near");if(!rt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=rt.clone(e,this._distanceDisplayCondition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.distanceDisplayCondition=e)}const n=this._backgroundBillboard;h(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(h(e)&&e<0)throw new C("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.disableDepthTestDistance=e)}const n=this._backgroundBillboard;h(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 i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.id=e)}const n=this._backgroundBillboard;h(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!h(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=f.clone(e,this._actualClampedPosition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard._clampedPosition=e)}const n=this._backgroundBillboard;h(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 i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.clusterShow=e)}const n=this._backgroundBillboard;h(n)&&(n.clusterShow=e)}}}}),Ln.prototype._updateClamping=function(){fe._updateClamping(this._labelCollection,this)},Ln.prototype.computeScreenSpacePosition=function(e,t){if(!h(e))throw new C("scene is required.");h(t)||(t=new U);const i=this._labelCollection.modelMatrix,o=h(this._actualClampedPosition)?this._actualClampedPosition:this._position;return fe._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)},Ln.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,s=0,a=0;const c=e.totalScale,l=e._backgroundBillboard;if(h(l))i=t.x+l._translate.x,o=t.y-l._translate.y,s=l.width*c,a=l.height*c,e.verticalOrigin===Je.BOTTOM||e.verticalOrigin===Je.BASELINE?o-=a:e.verticalOrigin===Je.CENTER&&(o-=a*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,d=0;const p=e._glyphs,g=p.length;for(let y=0;y<g;++y){const x=p[y],E=x.billboard;if(!h(E))continue;const b=t.x+E._translate.x;let D=t.y-E._translate.y;const A=x.dimensions.width*c,O=x.dimensions.height*c;e.verticalOrigin===Je.BOTTOM||e.verticalOrigin===Je.BASELINE?D-=O:e.verticalOrigin===Je.CENTER&&(D-=O*.5),e._verticalOrigin===Je.TOP?D+=pn.PADDING*c:(e._verticalOrigin===Je.BOTTOM||e._verticalOrigin===Je.BASELINE)&&(D-=pn.PADDING*c),i=Math.min(i,b),o=Math.min(o,D),u=Math.max(u,b+A),d=Math.max(d,D+O)}s=u-i,a=d-o}return h(n)||(n=new Ce),n.x=i,n.y=o,n.width=s,n.height=a,n},Ln.prototype.equals=function(e){return this===e||h(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&&f.equals(this._position,e._position)&&T.equals(this._fillColor,e._fillColor)&&T.equals(this._outlineColor,e._outlineColor)&&T.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&f.equals(this._eyeOffset,e._eyeOffset)&&we.equals(this._translucencyByDistance,e._translucencyByDistance)&&we.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&we.equals(this._scaleByDistance,e._scaleByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},Ln.prototype.isDestroyed=function(){return!1},Ln.enableRightToLeftDetection=!1;function R1(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[];let s="",a=gt.LTR,c="";const l=e.length;for(let u=0;u<l;++u){const d=e.charAt(u);t.test(d)?c=gt.RTL:n.test(d)?c=gt.LTR:i.test(d)?c=gt.BRACKETS:c=gt.WEAK,u===0&&(a=c),a===c&&c!==gt.BRACKETS?s+=d:(s!==""&&o.push({Type:a,Word:s}),a=c,s=d)}return o.push({Type:c,Word:s}),o}function z1(e){return e.split("").reverse().join("")}function Zr(e,t,n){return e.slice(0,t)+n+e.slice(t)}function P1(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}const B1="א-ת",N1="؀-ۿݐ-ݿࢠ-ࣿ",jm=new RegExp(`[${B1}${N1}]`);function F1(e){const t=e.split(`
6346
+ `,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Pt.OVERLAY,i}const b1=[];Jt.prototype.update=function(e){if(kl(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,ke=this._instanced?c1:a1,Vl=this._instanced?h1:l1;let o=this._textureAtlas;if(!h(o)){o=this._textureAtlas=new ni({context:i});for(let P=0;P<n;++P)t[P]._loadImage()}const s=o.textureCoordinates;if(s.length===0)return;x1(this,e),t=this._billboards,n=t.length;const a=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,l=this._propertiesChanged,u=o.guid,d=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let p;const g=e.passes,y=g.pick;if(d||!y&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Ul;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=u1(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),p=this._vaf.writers;for(let P=0;P<n;++P){const V=this._billboards[P];V._dirty=!1,y1(this,e,s,p,V)}this._vaf.commit(Vl(i))}this._billboardsToUpdateIndex=0}else if(c>0){const P=b1;P.length=0,(l[Wr]||l[i1]||l[n1])&&P.push(Dm),(l[jr]||l[gm]||l[e1]||l[t1]||l[JS])&&(P.push(Pm),this._instanced&&P.push(Wl)),(l[jr]||l[o1]||l[Em])&&(P.push(Bm),P.push(Hl)),(l[jr]||l[xm])&&P.push(Hl),l[ym]&&P.push(Wl),l[Cm]&&P.push(Nm),l[bm]&&P.push(Fm),(l[wm]||l[r1]||l[jr]||l[Wr])&&P.push(Lm),(l[jr]||l[Wr])&&P.push(Mm),l[Tm]&&P.push(Um),l[Sm]&&P.push(km);const V=P.length;if(p=this._vaf.writers,c/n>.1){for(let k=0;k<c;++k){const H=a[k];H._dirty=!1;for(let j=0;j<V;++j)P[j](this,e,s,p,H)}this._vaf.commit(Vl(i))}else{for(let k=0;k<c;++k){const H=a[k];H._dirty=!1;for(let j=0;j<V;++j)P[j](this,e,s,p,H);this._instanced?this._vaf.subCommit(H._index,1):this._vaf.subCommit(H._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>n*1.5&&(a.length=n),!h(this._vaf)||!h(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,K.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let x,E=N.IDENTITY;e.mode===me.SCENE3D?(E=this.modelMatrix,x=K.clone(this._baseVolumeWC,this._boundingVolume)):x=K.clone(this._baseVolume2D,this._boundingVolume),C1(this,e,x);const b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===ft.OPAQUE||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:R.LESS},depthMask:!0}):this._rsOpaque=void 0;const P=this._blendOption===ft.TRANSLUCENT;this._blendOption===ft.TRANSLUCENT||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:P?R.LEQUAL:R.LESS},depthMask:P,blending:no.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let D,A,O,I,B;const M=Ee.maximumVertexTextureImageUnits>0;if(b||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){D=MS,A=LS,B=[],h(this._batchTable)&&(B.push("VECTOR_TILE"),D=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(D),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),O=new ye({defines:B,sources:[D]}),this._instanced&&O.defines.push("INSTANCED"),this._shaderRotation&&O.defines.push("ROTATION"),this._shaderAlignedAxis&&O.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&O.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&O.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&O.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&O.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&O.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(M?O.defines.push("VERTEX_DEPTH_CHECK"):O.defines.push("FRAGMENT_DEPTH_CHECK"));const P=1-pn.CUTOFF;this._sdf&&O.defines.push("SDF");const V=h(this._batchTable)?"VECTOR_TILE":"";this._blendOption===ft.OPAQUE_AND_TRANSLUCENT&&(I=new ye({defines:["OPAQUE",V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._sp=ot.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke}),I=new ye({defines:["TRANSLUCENT",V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=ot.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke})),this._blendOption===ft.OPAQUE&&(I=new ye({defines:[V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._sp=ot.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke})),this._blendOption===ft.TRANSLUCENT&&(I=new ye({defines:[V],sources:[A]}),this._shaderClampToGround&&(M?I.defines.push("VERTEX_DEPTH_CHECK"):I.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(I.defines.push("SDF"),I.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=ot.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:ke})),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 q=e.commandList;if(g.render||g.pick){const P=this._colorCommands,V=this._blendOption===ft.OPAQUE,k=this._blendOption===ft.OPAQUE_AND_TRANSLUCENT,H=this._vaf.va,j=H.length;let r=this._uniforms,w;h(this._batchTable)?(r=this._batchTable.getUniformMapCallback()(r),w=this._batchTable.getPickId()):w="v_pickColor",P.length=j;const v=k?j*2:j;for(let z=0;z<v;++z){let G=P[z];h(G)||(G=P[z]=new $e);const W=V||k&&z%2===0;G.pass=W||!k?Pt.OPAQUE:Pt.TRANSLUCENT,G.owner=this;const Z=k?Math.floor(z/2):z;G.boundingVolume=x,G.modelMatrix=E,G.count=H[Z].indicesCount,G.shaderProgram=W?this._sp:this._spTranslucent,G.uniformMap=r,G.vertexArray=H[Z].va,G.renderState=W?this._rsOpaque:this._rsTranslucent,G.debugShowBoundingVolume=this.debugShowBoundingVolume,G.pickId=w,this._instanced&&(G.count=6,G.instanceCount=n),q.push(G)}this.debugShowTextureAtlas&&(h(this.debugCommand)||(this.debugCommand=E1(this,e.context)),q.push(this.debugCommand))}},Jt.prototype.isDestroyed=function(){return!1},Jt.prototype.destroy=function(){return h(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(),Am(this._billboards),Qe(this)};function w1(e,t,n,i,o){const s=e.measureText(t);if(!!/\S/.test(t)){const c=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),l=document.createElement("canvas"),u=100,d=s.width+u|0,p=3*c,g=p/2;l.width=d,l.height=p;const y=l.getContext("2d");y.font=n,y.fillStyle="white",y.fillRect(0,0,l.width+1,l.height+1),i&&(y.strokeStyle="black",y.lineWidth=e.lineWidth,y.strokeText(t,u/2,g)),o&&(y.fillStyle="black",y.fillText(t,u/2,g));const x=y.getImageData(0,0,d,p).data,E=x.length,b=d*4;let D,A,O,I;for(D=0;D<E;++D)if(x[D]!==255){O=D/b|0;break}for(D=E-1;D>=0;--D)if(x[D]!==255){I=D/b|0;break}let B=-1;for(D=0;D<d&&B===-1;++D)for(A=0;A<p;++A){const M=D*4+A*b;if(x[M]!==255||x[M+1]!==255||x[M+2]!==255||x[M+3]!==255){B=D;break}}return{width:s.width,height:I-O,ascent:g-O,descent:I-g,minx:B-u/2}}return{width:s.width,height:0,ascent:0,descent:0,minx:0}}let ho;function T1(e,t){if(!h(e))throw new C("text is required.");if(e==="")return;t=_(t,_.EMPTY_OBJECT);const n=_(t.font,"10px sans-serif"),i=_(t.stroke,!1),o=_(t.fill,!0),s=_(t.strokeWidth,1),a=_(t.backgroundColor,T.TRANSPARENT),c=_(t.padding,0),l=c*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;const d=u.getContext("2d",{willReadFrequently:!0});h(ho)||(h(d.imageSmoothingEnabled)?ho="imageSmoothingEnabled":h(d.mozImageSmoothingEnabled)?ho="mozImageSmoothingEnabled":h(d.webkitImageSmoothingEnabled)?ho="webkitImageSmoothingEnabled":h(d.msImageSmoothingEnabled)&&(ho="msImageSmoothingEnabled")),d.font=n,d.lineJoin="round",d.lineWidth=s,d[ho]=!1,u.style.visibility="hidden",document.body.appendChild(u);const p=w1(d,e,n,i,o);u.dimensions=p,document.body.removeChild(u),u.style.visibility="";const g=-p.minx,y=Math.ceil(p.width)+g+l,x=p.height+l,E=x-p.ascent+c,b=x-E+l;if(u.width=y,u.height=x,d.font=n,d.lineJoin="round",d.lineWidth=s,d[ho]=!1,a!==T.TRANSPARENT&&(d.fillStyle=a.toCssColorString(),d.fillRect(0,0,u.width,u.height)),i){const D=_(t.strokeColor,T.BLACK);d.strokeStyle=D.toCssColorString(),d.strokeText(e,g+c,b)}if(o){const D=_(t.fillColor,T.WHITE);d.fillStyle=D.toCssColorString(),d.fillText(e,g+c,b)}return u}var S1=A1,Yr=1e20;function A1(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,s,a,c,l,u,d,p,g,y,x,E;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");s=t.width,a=t.height,l=e,t.stride?d=t.stride:d=Math.floor(e.length/s/a)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(g=e,p=g.getContext("2d"),s=g.width,a=g.height,y=p.getImageData(0,0,s,a),l=y.data,d=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(g=e.canvas,p=e,s=g.width,a=g.height,y=p.getImageData(0,0,s,a),l=y.data,d=4):window.ImageData&&e instanceof window.ImageData&&(y=e,s=e.width,a=e.height,l=y.data,d=4);if(c=Math.max(s,a),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(s*a),x=0,E=Math.floor(u.length/d);x<E;x++)l[x]=u[x*d+o]/255;else if(d!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(s*a),D=Array(s*a),A=Array(c),O=Array(c),I=Array(c+1),B=Array(c);for(x=0,E=s*a;x<E;x++){var M=l[x];b[x]=M===1?0:M===0?Yr:Math.pow(Math.max(0,.5-M),2),D[x]=M===1?Yr:M===0?0:Math.pow(Math.max(0,M-.5),2)}Vm(b,s,a,A,O,B,I),Vm(D,s,a,A,O,B,I);var q=window.Float32Array?new Float32Array(s*a):new Array(s*a);for(x=0,E=s*a;x<E;x++)q[x]=Math.min(Math.max(1-((b[x]-D[x])/i+n),0),1);return q}function Vm(e,t,n,i,o,s,a){for(var c=0;c<t;c++){for(var l=0;l<n;l++)i[l]=e[l*t+c];for(Gm(i,o,s,a,n),l=0;l<n;l++)e[l*t+c]=o[l]}for(l=0;l<n;l++){for(c=0;c<t;c++)i[c]=e[l*t+c];for(Gm(i,o,s,a,t),c=0;c<t;c++)e[l*t+c]=Math.sqrt(o[c])}}function Gm(e,t,n,i,o){n[0]=0,i[0]=-Yr,i[1]=+Yr;for(var s=1,a=0;s<o;s++){for(var c=(e[s]+s*s-(e[n[a]]+n[a]*n[a]))/(2*s-2*n[a]);c<=i[a];)a--,c=(e[s]+s*s-(e[n[a]]+n[a]*n[a]))/(2*s-2*n[a]);a++,n[a]=s,i[a]=c,i[a+1]=+Yr}for(s=0,a=0;s<o;s++){for(;i[a+1]<s;)a++;t[s]=(s-n[a])*(s-n[a])+e[n[a]]}}const D1=rs(S1),bi=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),qm={};let Hm=0;const O1=256,v1=new T(.165,.165,.165,.8),I1=new U(7,5),gt=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function fo(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Xr(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function $r(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Wm(e){let t=qm[e._font];if(!h(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($r(n,"line-height"));isNaN(i)&&(i=void 0),t={family:$r(n,"font-family"),size:$r(n,"font-size").replace("px",""),style:$r(n,"font-style"),weight:$r(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Hm<O1&&(qm[e._font]=t,Hm++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Ln(e,t){if(e=_(e,_.EMPTY_OBJECT),h(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,s=e.distanceDisplayCondition;if(h(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=we.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=we.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=we.clone(o)}if(h(s)){if(s.far<=s.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");s=rt.clone(s)}this._renderedText=void 0,this._text=void 0,this._show=_(e.show,!0),this._font=_(e.font,"30px sans-serif"),this._fillColor=T.clone(_(e.fillColor,T.WHITE)),this._outlineColor=T.clone(_(e.outlineColor,T.BLACK)),this._outlineWidth=_(e.outlineWidth,1),this._showBackground=_(e.showBackground,!1),this._backgroundColor=T.clone(_(e.backgroundColor,v1)),this._backgroundPadding=U.clone(_(e.backgroundPadding,I1)),this._style=_(e.style,bi.FILL),this._verticalOrigin=_(e.verticalOrigin,Je.BASELINE),this._horizontalOrigin=_(e.horizontalOrigin,In.LEFT),this._pixelOffset=U.clone(_(e.pixelOffset,U.ZERO)),this._eyeOffset=f.clone(_(e.eyeOffset,f.ZERO)),this._position=f.clone(_(e.position,f.ZERO)),this._scale=_(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=_(e.heightReference,pi.NONE),this._distanceDisplayCondition=s,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=_(e.text,""),this._relativeSize=1,Wm(this),this._updateClamping()}Object.defineProperties(Ln.prototype,{show:{get:function(){return this._show},set:function(e){if(!h(e))throw new C("value is required.");if(this._show!==e){this._show=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i].billboard;h(s)&&(s.show=e)}const n=this._backgroundBillboard;h(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!h(e))throw new C("value is required.");const t=this._position;if(!f.equals(t,e)){f.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o].billboard;h(a)&&(a.position=e)}const i=this._backgroundBillboard;h(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!h(e))throw new C("value is required.");if(e!==this._heightReference){this._heightReference=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i].billboard;h(s)&&(s.heightReference=e)}const n=this._backgroundBillboard;h(n)&&(n.heightReference=e),Xr(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!h(e))throw new C("value is required.");if(this._text!==e){this._text=e;const t=e.replace(/\u00ad/g,"");this._renderedText=Ln.enableRightToLeftDetection?F1(t):t,fo(this)}}},font:{get:function(){return this._font},set:function(e){if(!h(e))throw new C("value is required.");this._font!==e&&(this._font=e,fo(this),Wm(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._fillColor;T.equals(t,e)||(T.clone(e,t),fo(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;T.equals(t,e)||(T.clone(e,t),fo(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!h(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,fo(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!h(e))throw new C("value is required.");this._showBackground!==e&&(this._showBackground=e,fo(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._backgroundColor;if(!T.equals(t,e)){T.clone(e,t);const n=this._backgroundBillboard;h(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!h(e))throw new C("value is required.");const t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),Xr(this))}},style:{get:function(){return this._style},set:function(e){if(!h(e))throw new C("value is required.");this._style!==e&&(this._style=e,fo(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!h(e))throw new C("value is required.");const t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.pixelOffset=e)}const i=this._backgroundBillboard;h(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;if(!we.equals(t,e)){this._translucencyByDistance=we.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.translucencyByDistance=e)}const i=this._backgroundBillboard;h(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._pixelOffsetScaleByDistance;if(!we.equals(t,e)){this._pixelOffsetScaleByDistance=we.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}const i=this._backgroundBillboard;h(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;if(!we.equals(t,e)){this._scaleByDistance=we.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.scaleByDistance=e)}const i=this._backgroundBillboard;h(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!h(e))throw new C("value is required.");const t=this._eyeOffset;if(!f.equals(t,e)){f.clone(e,t);const n=this._glyphs;for(let o=0,s=n.length;o<s;o++){const a=n[o];h(a.billboard)&&(a.billboard.eyeOffset=e)}const i=this._backgroundBillboard;h(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!h(e))throw new C("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Xr(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!h(e))throw new C("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.verticalOrigin=e)}const n=this._backgroundBillboard;h(n)&&(n.verticalOrigin=e),Xr(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!h(e))throw new C("value is required.");if(this._scale!==e){this._scale=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.scale=e*this._relativeSize)}const n=this._backgroundBillboard;h(n)&&(n.scale=e*this._relativeSize),Xr(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far must be greater than near");if(!rt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=rt.clone(e,this._distanceDisplayCondition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.distanceDisplayCondition=e)}const n=this._backgroundBillboard;h(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(h(e)&&e<0)throw new C("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.disableDepthTestDistance=e)}const n=this._backgroundBillboard;h(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 i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.id=e)}const n=this._backgroundBillboard;h(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!h(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=f.clone(e,this._actualClampedPosition);const t=this._glyphs;for(let i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard._clampedPosition=e)}const n=this._backgroundBillboard;h(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 i=0,o=t.length;i<o;i++){const s=t[i];h(s.billboard)&&(s.billboard.clusterShow=e)}const n=this._backgroundBillboard;h(n)&&(n.clusterShow=e)}}}}),Ln.prototype._updateClamping=function(){fe._updateClamping(this._labelCollection,this)},Ln.prototype.computeScreenSpacePosition=function(e,t){if(!h(e))throw new C("scene is required.");h(t)||(t=new U);const i=this._labelCollection.modelMatrix,o=h(this._actualClampedPosition)?this._actualClampedPosition:this._position;return fe._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)},Ln.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,s=0,a=0;const c=e.totalScale,l=e._backgroundBillboard;if(h(l))i=t.x+l._translate.x,o=t.y-l._translate.y,s=l.width*c,a=l.height*c,e.verticalOrigin===Je.BOTTOM||e.verticalOrigin===Je.BASELINE?o-=a:e.verticalOrigin===Je.CENTER&&(o-=a*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,d=0;const p=e._glyphs,g=p.length;for(let y=0;y<g;++y){const x=p[y],E=x.billboard;if(!h(E))continue;const b=t.x+E._translate.x;let D=t.y-E._translate.y;const A=x.dimensions.width*c,O=x.dimensions.height*c;e.verticalOrigin===Je.BOTTOM||e.verticalOrigin===Je.BASELINE?D-=O:e.verticalOrigin===Je.CENTER&&(D-=O*.5),e._verticalOrigin===Je.TOP?D+=pn.PADDING*c:(e._verticalOrigin===Je.BOTTOM||e._verticalOrigin===Je.BASELINE)&&(D-=pn.PADDING*c),i=Math.min(i,b),o=Math.min(o,D),u=Math.max(u,b+A),d=Math.max(d,D+O)}s=u-i,a=d-o}return h(n)||(n=new Ce),n.x=i,n.y=o,n.width=s,n.height=a,n},Ln.prototype.equals=function(e){return this===e||h(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&&f.equals(this._position,e._position)&&T.equals(this._fillColor,e._fillColor)&&T.equals(this._outlineColor,e._outlineColor)&&T.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&f.equals(this._eyeOffset,e._eyeOffset)&&we.equals(this._translucencyByDistance,e._translucencyByDistance)&&we.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&we.equals(this._scaleByDistance,e._scaleByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},Ln.prototype.isDestroyed=function(){return!1},Ln.enableRightToLeftDetection=!1;function R1(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[];let s="",a=gt.LTR,c="";const l=e.length;for(let u=0;u<l;++u){const d=e.charAt(u);t.test(d)?c=gt.RTL:n.test(d)?c=gt.LTR:i.test(d)?c=gt.BRACKETS:c=gt.WEAK,u===0&&(a=c),a===c&&c!==gt.BRACKETS?s+=d:(s!==""&&o.push({Type:a,Word:s}),a=c,s=d)}return o.push({Type:c,Word:s}),o}function z1(e){return e.split("").reverse().join("")}function Zr(e,t,n){return e.slice(0,t)+n+e.slice(t)}function P1(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}const B1="א-ת",N1="؀-ۿݐ-ݿࢠ-ࣿ",jm=new RegExp(`[${B1}${N1}]`);function F1(e){const t=e.split(`
6347
6347
  `);let n="";for(let i=0;i<t.length;i++){const o=t[i],s=jm.test(o.charAt(0)),a=R1(o,jm);let c=0,l="";for(let u=0;u<a.length;++u){const d=a[u],p=d.Type===gt.BRACKETS?P1(d.Word):z1(d.Word);s?d.Type===gt.RTL?(l=p+l,c=0):d.Type===gt.LTR?(l=Zr(l,c,d.Word),c+=d.Word.length):(d.Type===gt.WEAK||d.Type===gt.BRACKETS)&&(d.Type===gt.WEAK&&a[u-1].Type===gt.BRACKETS?l=p+l:a[u-1].Type===gt.RTL?(l=p+l,c=0):a.length>u+1?a[u+1].Type===gt.RTL?(l=p+l,c=0):(l=Zr(l,c,d.Word),c+=d.Word.length):l=Zr(l,0,p)):d.Type===gt.RTL?l=Zr(l,c,p):d.Type===gt.LTR?(l+=d.Word,c=l.length):(d.Type===gt.WEAK||d.Type===gt.BRACKETS)&&(u>0&&a[u-1].Type===gt.RTL?a.length>u+1?a[u+1].Type===gt.RTL?l=Zr(l,c,p):(l+=d.Word,c=l.length):l+=d.Word:(l+=d.Word,c=l.length))}n+=l,i<t.length-1&&(n+=`
6348
- `)}return n}var Ym={exports:{}};(function(e){function t(){var n=0,i=1,o=2,s=3,a=4,c=5,l=6,u=7,d=8,p=9,g=10,y=11,x=12,E=13,b=14,D=15,A=16,O=17,I=0,B=1,M=2,q=3,P=4;function V(r,w){return 55296<=r.charCodeAt(w)&&r.charCodeAt(w)<=56319&&56320<=r.charCodeAt(w+1)&&r.charCodeAt(w+1)<=57343}function k(r,w){w===void 0&&(w=0);var v=r.charCodeAt(w);if(55296<=v&&v<=56319&&w<r.length-1){var z=v,G=r.charCodeAt(w+1);return 56320<=G&&G<=57343?(z-55296)*1024+(G-56320)+65536:z}if(56320<=v&&v<=57343&&w>=1){var z=r.charCodeAt(w-1),G=v;return 55296<=z&&z<=56319?(z-55296)*1024+(G-56320)+65536:G}return v}function H(r,w,v){var z=[r].concat(w).concat([v]),G=z[z.length-2],W=v,Z=z.lastIndexOf(b);if(Z>1&&z.slice(1,Z).every(function(se){return se==s})&&[s,E,O].indexOf(r)==-1)return M;var X=z.lastIndexOf(a);if(X>0&&z.slice(1,X).every(function(se){return se==a})&&[x,a].indexOf(G)==-1)return z.filter(function(se){return se==a}).length%2==1?q:P;if(G==n&&W==i)return I;if(G==o||G==n||G==i)return W==b&&w.every(function(se){return se==s})?M:B;if(W==o||W==n||W==i)return B;if(G==l&&(W==l||W==u||W==p||W==g))return I;if((G==p||G==u)&&(W==u||W==d))return I;if((G==g||G==d)&&W==d)return I;if(W==s||W==D)return I;if(W==c)return I;if(G==x)return I;var ie=z.indexOf(s)!=-1?z.lastIndexOf(s)-1:z.length-2;return[E,O].indexOf(z[ie])!=-1&&z.slice(ie+1,-1).every(function(se){return se==s})&&W==b||G==D&&[A,O].indexOf(W)!=-1?I:w.indexOf(a)!=-1?M:G==a&&W==a?I:B}this.nextBreak=function(r,w){if(w===void 0&&(w=0),w<0)return 0;if(w>=r.length-1)return r.length;for(var v=j(k(r,w)),z=[],G=w+1;G<r.length;G++)if(!V(r,G-1)){var W=j(k(r,G));if(H(v,z,W))return G;z.push(W)}return r.length},this.splitGraphemes=function(r){for(var w=[],v=0,z;(z=this.nextBreak(r,v))<r.length;)w.push(r.slice(v,z)),v=z;return v<r.length&&w.push(r.slice(v)),w},this.iterateGraphemes=function(r){var w=0,v={next:(function(){var z,G;return(G=this.nextBreak(r,w))<r.length?(z=r.slice(w,G),w=G,{value:z,done:!1}):w<r.length?(z=r.slice(w),w=r.length,{value:z,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(r){for(var w=0,v=0,z;(z=this.nextBreak(r,v))<r.length;)v=z,w++;return v<r.length&&w++,w};function j(r){return 1536<=r&&r<=1541||r==1757||r==1807||r==2274||r==3406||r==69821||70082<=r&&r<=70083||r==72250||72326<=r&&r<=72329||r==73030?x:r==13?n:r==10?i:0<=r&&r<=9||11<=r&&r<=12||14<=r&&r<=31||127<=r&&r<=159||r==173||r==1564||r==6158||r==8203||8206<=r&&r<=8207||r==8232||r==8233||8234<=r&&r<=8238||8288<=r&&r<=8292||r==8293||8294<=r&&r<=8303||55296<=r&&r<=57343||r==65279||65520<=r&&r<=65528||65529<=r&&r<=65531||113824<=r&&r<=113827||119155<=r&&r<=119162||r==917504||r==917505||917506<=r&&r<=917535||917632<=r&&r<=917759||918e3<=r&&r<=921599?o:768<=r&&r<=879||1155<=r&&r<=1159||1160<=r&&r<=1161||1425<=r&&r<=1469||r==1471||1473<=r&&r<=1474||1476<=r&&r<=1477||r==1479||1552<=r&&r<=1562||1611<=r&&r<=1631||r==1648||1750<=r&&r<=1756||1759<=r&&r<=1764||1767<=r&&r<=1768||1770<=r&&r<=1773||r==1809||1840<=r&&r<=1866||1958<=r&&r<=1968||2027<=r&&r<=2035||2070<=r&&r<=2073||2075<=r&&r<=2083||2085<=r&&r<=2087||2089<=r&&r<=2093||2137<=r&&r<=2139||2260<=r&&r<=2273||2275<=r&&r<=2306||r==2362||r==2364||2369<=r&&r<=2376||r==2381||2385<=r&&r<=2391||2402<=r&&r<=2403||r==2433||r==2492||r==2494||2497<=r&&r<=2500||r==2509||r==2519||2530<=r&&r<=2531||2561<=r&&r<=2562||r==2620||2625<=r&&r<=2626||2631<=r&&r<=2632||2635<=r&&r<=2637||r==2641||2672<=r&&r<=2673||r==2677||2689<=r&&r<=2690||r==2748||2753<=r&&r<=2757||2759<=r&&r<=2760||r==2765||2786<=r&&r<=2787||2810<=r&&r<=2815||r==2817||r==2876||r==2878||r==2879||2881<=r&&r<=2884||r==2893||r==2902||r==2903||2914<=r&&r<=2915||r==2946||r==3006||r==3008||r==3021||r==3031||r==3072||3134<=r&&r<=3136||3142<=r&&r<=3144||3146<=r&&r<=3149||3157<=r&&r<=3158||3170<=r&&r<=3171||r==3201||r==3260||r==3263||r==3266||r==3270||3276<=r&&r<=3277||3285<=r&&r<=3286||3298<=r&&r<=3299||3328<=r&&r<=3329||3387<=r&&r<=3388||r==3390||3393<=r&&r<=3396||r==3405||r==3415||3426<=r&&r<=3427||r==3530||r==3535||3538<=r&&r<=3540||r==3542||r==3551||r==3633||3636<=r&&r<=3642||3655<=r&&r<=3662||r==3761||3764<=r&&r<=3769||3771<=r&&r<=3772||3784<=r&&r<=3789||3864<=r&&r<=3865||r==3893||r==3895||r==3897||3953<=r&&r<=3966||3968<=r&&r<=3972||3974<=r&&r<=3975||3981<=r&&r<=3991||3993<=r&&r<=4028||r==4038||4141<=r&&r<=4144||4146<=r&&r<=4151||4153<=r&&r<=4154||4157<=r&&r<=4158||4184<=r&&r<=4185||4190<=r&&r<=4192||4209<=r&&r<=4212||r==4226||4229<=r&&r<=4230||r==4237||r==4253||4957<=r&&r<=4959||5906<=r&&r<=5908||5938<=r&&r<=5940||5970<=r&&r<=5971||6002<=r&&r<=6003||6068<=r&&r<=6069||6071<=r&&r<=6077||r==6086||6089<=r&&r<=6099||r==6109||6155<=r&&r<=6157||6277<=r&&r<=6278||r==6313||6432<=r&&r<=6434||6439<=r&&r<=6440||r==6450||6457<=r&&r<=6459||6679<=r&&r<=6680||r==6683||r==6742||6744<=r&&r<=6750||r==6752||r==6754||6757<=r&&r<=6764||6771<=r&&r<=6780||r==6783||6832<=r&&r<=6845||r==6846||6912<=r&&r<=6915||r==6964||6966<=r&&r<=6970||r==6972||r==6978||7019<=r&&r<=7027||7040<=r&&r<=7041||7074<=r&&r<=7077||7080<=r&&r<=7081||7083<=r&&r<=7085||r==7142||7144<=r&&r<=7145||r==7149||7151<=r&&r<=7153||7212<=r&&r<=7219||7222<=r&&r<=7223||7376<=r&&r<=7378||7380<=r&&r<=7392||7394<=r&&r<=7400||r==7405||r==7412||7416<=r&&r<=7417||7616<=r&&r<=7673||7675<=r&&r<=7679||r==8204||8400<=r&&r<=8412||8413<=r&&r<=8416||r==8417||8418<=r&&r<=8420||8421<=r&&r<=8432||11503<=r&&r<=11505||r==11647||11744<=r&&r<=11775||12330<=r&&r<=12333||12334<=r&&r<=12335||12441<=r&&r<=12442||r==42607||42608<=r&&r<=42610||42612<=r&&r<=42621||42654<=r&&r<=42655||42736<=r&&r<=42737||r==43010||r==43014||r==43019||43045<=r&&r<=43046||43204<=r&&r<=43205||43232<=r&&r<=43249||43302<=r&&r<=43309||43335<=r&&r<=43345||43392<=r&&r<=43394||r==43443||43446<=r&&r<=43449||r==43452||r==43493||43561<=r&&r<=43566||43569<=r&&r<=43570||43573<=r&&r<=43574||r==43587||r==43596||r==43644||r==43696||43698<=r&&r<=43700||43703<=r&&r<=43704||43710<=r&&r<=43711||r==43713||43756<=r&&r<=43757||r==43766||r==44005||r==44008||r==44013||r==64286||65024<=r&&r<=65039||65056<=r&&r<=65071||65438<=r&&r<=65439||r==66045||r==66272||66422<=r&&r<=66426||68097<=r&&r<=68099||68101<=r&&r<=68102||68108<=r&&r<=68111||68152<=r&&r<=68154||r==68159||68325<=r&&r<=68326||r==69633||69688<=r&&r<=69702||69759<=r&&r<=69761||69811<=r&&r<=69814||69817<=r&&r<=69818||69888<=r&&r<=69890||69927<=r&&r<=69931||69933<=r&&r<=69940||r==70003||70016<=r&&r<=70017||70070<=r&&r<=70078||70090<=r&&r<=70092||70191<=r&&r<=70193||r==70196||70198<=r&&r<=70199||r==70206||r==70367||70371<=r&&r<=70378||70400<=r&&r<=70401||r==70460||r==70462||r==70464||r==70487||70502<=r&&r<=70508||70512<=r&&r<=70516||70712<=r&&r<=70719||70722<=r&&r<=70724||r==70726||r==70832||70835<=r&&r<=70840||r==70842||r==70845||70847<=r&&r<=70848||70850<=r&&r<=70851||r==71087||71090<=r&&r<=71093||71100<=r&&r<=71101||71103<=r&&r<=71104||71132<=r&&r<=71133||71219<=r&&r<=71226||r==71229||71231<=r&&r<=71232||r==71339||r==71341||71344<=r&&r<=71349||r==71351||71453<=r&&r<=71455||71458<=r&&r<=71461||71463<=r&&r<=71467||72193<=r&&r<=72198||72201<=r&&r<=72202||72243<=r&&r<=72248||72251<=r&&r<=72254||r==72263||72273<=r&&r<=72278||72281<=r&&r<=72283||72330<=r&&r<=72342||72344<=r&&r<=72345||72752<=r&&r<=72758||72760<=r&&r<=72765||r==72767||72850<=r&&r<=72871||72874<=r&&r<=72880||72882<=r&&r<=72883||72885<=r&&r<=72886||73009<=r&&r<=73014||r==73018||73020<=r&&r<=73021||73023<=r&&r<=73029||r==73031||92912<=r&&r<=92916||92976<=r&&r<=92982||94095<=r&&r<=94098||113821<=r&&r<=113822||r==119141||119143<=r&&r<=119145||119150<=r&&r<=119154||119163<=r&&r<=119170||119173<=r&&r<=119179||119210<=r&&r<=119213||119362<=r&&r<=119364||121344<=r&&r<=121398||121403<=r&&r<=121452||r==121461||r==121476||121499<=r&&r<=121503||121505<=r&&r<=121519||122880<=r&&r<=122886||122888<=r&&r<=122904||122907<=r&&r<=122913||122915<=r&&r<=122916||122918<=r&&r<=122922||125136<=r&&r<=125142||125252<=r&&r<=125258||917536<=r&&r<=917631||917760<=r&&r<=917999?s:127462<=r&&r<=127487?a:r==2307||r==2363||2366<=r&&r<=2368||2377<=r&&r<=2380||2382<=r&&r<=2383||2434<=r&&r<=2435||2495<=r&&r<=2496||2503<=r&&r<=2504||2507<=r&&r<=2508||r==2563||2622<=r&&r<=2624||r==2691||2750<=r&&r<=2752||r==2761||2763<=r&&r<=2764||2818<=r&&r<=2819||r==2880||2887<=r&&r<=2888||2891<=r&&r<=2892||r==3007||3009<=r&&r<=3010||3014<=r&&r<=3016||3018<=r&&r<=3020||3073<=r&&r<=3075||3137<=r&&r<=3140||3202<=r&&r<=3203||r==3262||3264<=r&&r<=3265||3267<=r&&r<=3268||3271<=r&&r<=3272||3274<=r&&r<=3275||3330<=r&&r<=3331||3391<=r&&r<=3392||3398<=r&&r<=3400||3402<=r&&r<=3404||3458<=r&&r<=3459||3536<=r&&r<=3537||3544<=r&&r<=3550||3570<=r&&r<=3571||r==3635||r==3763||3902<=r&&r<=3903||r==3967||r==4145||4155<=r&&r<=4156||4182<=r&&r<=4183||r==4228||r==6070||6078<=r&&r<=6085||6087<=r&&r<=6088||6435<=r&&r<=6438||6441<=r&&r<=6443||6448<=r&&r<=6449||6451<=r&&r<=6456||6681<=r&&r<=6682||r==6741||r==6743||6765<=r&&r<=6770||r==6916||r==6965||r==6971||6973<=r&&r<=6977||6979<=r&&r<=6980||r==7042||r==7073||7078<=r&&r<=7079||r==7082||r==7143||7146<=r&&r<=7148||r==7150||7154<=r&&r<=7155||7204<=r&&r<=7211||7220<=r&&r<=7221||r==7393||7410<=r&&r<=7411||r==7415||43043<=r&&r<=43044||r==43047||43136<=r&&r<=43137||43188<=r&&r<=43203||43346<=r&&r<=43347||r==43395||43444<=r&&r<=43445||43450<=r&&r<=43451||43453<=r&&r<=43456||43567<=r&&r<=43568||43571<=r&&r<=43572||r==43597||r==43755||43758<=r&&r<=43759||r==43765||44003<=r&&r<=44004||44006<=r&&r<=44007||44009<=r&&r<=44010||r==44012||r==69632||r==69634||r==69762||69808<=r&&r<=69810||69815<=r&&r<=69816||r==69932||r==70018||70067<=r&&r<=70069||70079<=r&&r<=70080||70188<=r&&r<=70190||70194<=r&&r<=70195||r==70197||70368<=r&&r<=70370||70402<=r&&r<=70403||r==70463||70465<=r&&r<=70468||70471<=r&&r<=70472||70475<=r&&r<=70477||70498<=r&&r<=70499||70709<=r&&r<=70711||70720<=r&&r<=70721||r==70725||70833<=r&&r<=70834||r==70841||70843<=r&&r<=70844||r==70846||r==70849||71088<=r&&r<=71089||71096<=r&&r<=71099||r==71102||71216<=r&&r<=71218||71227<=r&&r<=71228||r==71230||r==71340||71342<=r&&r<=71343||r==71350||71456<=r&&r<=71457||r==71462||72199<=r&&r<=72200||r==72249||72279<=r&&r<=72280||r==72343||r==72751||r==72766||r==72873||r==72881||r==72884||94033<=r&&r<=94078||r==119142||r==119149?c:4352<=r&&r<=4447||43360<=r&&r<=43388?l:4448<=r&&r<=4519||55216<=r&&r<=55238?u:4520<=r&&r<=4607||55243<=r&&r<=55291?d:r==44032||r==44060||r==44088||r==44116||r==44144||r==44172||r==44200||r==44228||r==44256||r==44284||r==44312||r==44340||r==44368||r==44396||r==44424||r==44452||r==44480||r==44508||r==44536||r==44564||r==44592||r==44620||r==44648||r==44676||r==44704||r==44732||r==44760||r==44788||r==44816||r==44844||r==44872||r==44900||r==44928||r==44956||r==44984||r==45012||r==45040||r==45068||r==45096||r==45124||r==45152||r==45180||r==45208||r==45236||r==45264||r==45292||r==45320||r==45348||r==45376||r==45404||r==45432||r==45460||r==45488||r==45516||r==45544||r==45572||r==45600||r==45628||r==45656||r==45684||r==45712||r==45740||r==45768||r==45796||r==45824||r==45852||r==45880||r==45908||r==45936||r==45964||r==45992||r==46020||r==46048||r==46076||r==46104||r==46132||r==46160||r==46188||r==46216||r==46244||r==46272||r==46300||r==46328||r==46356||r==46384||r==46412||r==46440||r==46468||r==46496||r==46524||r==46552||r==46580||r==46608||r==46636||r==46664||r==46692||r==46720||r==46748||r==46776||r==46804||r==46832||r==46860||r==46888||r==46916||r==46944||r==46972||r==47e3||r==47028||r==47056||r==47084||r==47112||r==47140||r==47168||r==47196||r==47224||r==47252||r==47280||r==47308||r==47336||r==47364||r==47392||r==47420||r==47448||r==47476||r==47504||r==47532||r==47560||r==47588||r==47616||r==47644||r==47672||r==47700||r==47728||r==47756||r==47784||r==47812||r==47840||r==47868||r==47896||r==47924||r==47952||r==47980||r==48008||r==48036||r==48064||r==48092||r==48120||r==48148||r==48176||r==48204||r==48232||r==48260||r==48288||r==48316||r==48344||r==48372||r==48400||r==48428||r==48456||r==48484||r==48512||r==48540||r==48568||r==48596||r==48624||r==48652||r==48680||r==48708||r==48736||r==48764||r==48792||r==48820||r==48848||r==48876||r==48904||r==48932||r==48960||r==48988||r==49016||r==49044||r==49072||r==49100||r==49128||r==49156||r==49184||r==49212||r==49240||r==49268||r==49296||r==49324||r==49352||r==49380||r==49408||r==49436||r==49464||r==49492||r==49520||r==49548||r==49576||r==49604||r==49632||r==49660||r==49688||r==49716||r==49744||r==49772||r==49800||r==49828||r==49856||r==49884||r==49912||r==49940||r==49968||r==49996||r==50024||r==50052||r==50080||r==50108||r==50136||r==50164||r==50192||r==50220||r==50248||r==50276||r==50304||r==50332||r==50360||r==50388||r==50416||r==50444||r==50472||r==50500||r==50528||r==50556||r==50584||r==50612||r==50640||r==50668||r==50696||r==50724||r==50752||r==50780||r==50808||r==50836||r==50864||r==50892||r==50920||r==50948||r==50976||r==51004||r==51032||r==51060||r==51088||r==51116||r==51144||r==51172||r==51200||r==51228||r==51256||r==51284||r==51312||r==51340||r==51368||r==51396||r==51424||r==51452||r==51480||r==51508||r==51536||r==51564||r==51592||r==51620||r==51648||r==51676||r==51704||r==51732||r==51760||r==51788||r==51816||r==51844||r==51872||r==51900||r==51928||r==51956||r==51984||r==52012||r==52040||r==52068||r==52096||r==52124||r==52152||r==52180||r==52208||r==52236||r==52264||r==52292||r==52320||r==52348||r==52376||r==52404||r==52432||r==52460||r==52488||r==52516||r==52544||r==52572||r==52600||r==52628||r==52656||r==52684||r==52712||r==52740||r==52768||r==52796||r==52824||r==52852||r==52880||r==52908||r==52936||r==52964||r==52992||r==53020||r==53048||r==53076||r==53104||r==53132||r==53160||r==53188||r==53216||r==53244||r==53272||r==53300||r==53328||r==53356||r==53384||r==53412||r==53440||r==53468||r==53496||r==53524||r==53552||r==53580||r==53608||r==53636||r==53664||r==53692||r==53720||r==53748||r==53776||r==53804||r==53832||r==53860||r==53888||r==53916||r==53944||r==53972||r==54e3||r==54028||r==54056||r==54084||r==54112||r==54140||r==54168||r==54196||r==54224||r==54252||r==54280||r==54308||r==54336||r==54364||r==54392||r==54420||r==54448||r==54476||r==54504||r==54532||r==54560||r==54588||r==54616||r==54644||r==54672||r==54700||r==54728||r==54756||r==54784||r==54812||r==54840||r==54868||r==54896||r==54924||r==54952||r==54980||r==55008||r==55036||r==55064||r==55092||r==55120||r==55148||r==55176?p:44033<=r&&r<=44059||44061<=r&&r<=44087||44089<=r&&r<=44115||44117<=r&&r<=44143||44145<=r&&r<=44171||44173<=r&&r<=44199||44201<=r&&r<=44227||44229<=r&&r<=44255||44257<=r&&r<=44283||44285<=r&&r<=44311||44313<=r&&r<=44339||44341<=r&&r<=44367||44369<=r&&r<=44395||44397<=r&&r<=44423||44425<=r&&r<=44451||44453<=r&&r<=44479||44481<=r&&r<=44507||44509<=r&&r<=44535||44537<=r&&r<=44563||44565<=r&&r<=44591||44593<=r&&r<=44619||44621<=r&&r<=44647||44649<=r&&r<=44675||44677<=r&&r<=44703||44705<=r&&r<=44731||44733<=r&&r<=44759||44761<=r&&r<=44787||44789<=r&&r<=44815||44817<=r&&r<=44843||44845<=r&&r<=44871||44873<=r&&r<=44899||44901<=r&&r<=44927||44929<=r&&r<=44955||44957<=r&&r<=44983||44985<=r&&r<=45011||45013<=r&&r<=45039||45041<=r&&r<=45067||45069<=r&&r<=45095||45097<=r&&r<=45123||45125<=r&&r<=45151||45153<=r&&r<=45179||45181<=r&&r<=45207||45209<=r&&r<=45235||45237<=r&&r<=45263||45265<=r&&r<=45291||45293<=r&&r<=45319||45321<=r&&r<=45347||45349<=r&&r<=45375||45377<=r&&r<=45403||45405<=r&&r<=45431||45433<=r&&r<=45459||45461<=r&&r<=45487||45489<=r&&r<=45515||45517<=r&&r<=45543||45545<=r&&r<=45571||45573<=r&&r<=45599||45601<=r&&r<=45627||45629<=r&&r<=45655||45657<=r&&r<=45683||45685<=r&&r<=45711||45713<=r&&r<=45739||45741<=r&&r<=45767||45769<=r&&r<=45795||45797<=r&&r<=45823||45825<=r&&r<=45851||45853<=r&&r<=45879||45881<=r&&r<=45907||45909<=r&&r<=45935||45937<=r&&r<=45963||45965<=r&&r<=45991||45993<=r&&r<=46019||46021<=r&&r<=46047||46049<=r&&r<=46075||46077<=r&&r<=46103||46105<=r&&r<=46131||46133<=r&&r<=46159||46161<=r&&r<=46187||46189<=r&&r<=46215||46217<=r&&r<=46243||46245<=r&&r<=46271||46273<=r&&r<=46299||46301<=r&&r<=46327||46329<=r&&r<=46355||46357<=r&&r<=46383||46385<=r&&r<=46411||46413<=r&&r<=46439||46441<=r&&r<=46467||46469<=r&&r<=46495||46497<=r&&r<=46523||46525<=r&&r<=46551||46553<=r&&r<=46579||46581<=r&&r<=46607||46609<=r&&r<=46635||46637<=r&&r<=46663||46665<=r&&r<=46691||46693<=r&&r<=46719||46721<=r&&r<=46747||46749<=r&&r<=46775||46777<=r&&r<=46803||46805<=r&&r<=46831||46833<=r&&r<=46859||46861<=r&&r<=46887||46889<=r&&r<=46915||46917<=r&&r<=46943||46945<=r&&r<=46971||46973<=r&&r<=46999||47001<=r&&r<=47027||47029<=r&&r<=47055||47057<=r&&r<=47083||47085<=r&&r<=47111||47113<=r&&r<=47139||47141<=r&&r<=47167||47169<=r&&r<=47195||47197<=r&&r<=47223||47225<=r&&r<=47251||47253<=r&&r<=47279||47281<=r&&r<=47307||47309<=r&&r<=47335||47337<=r&&r<=47363||47365<=r&&r<=47391||47393<=r&&r<=47419||47421<=r&&r<=47447||47449<=r&&r<=47475||47477<=r&&r<=47503||47505<=r&&r<=47531||47533<=r&&r<=47559||47561<=r&&r<=47587||47589<=r&&r<=47615||47617<=r&&r<=47643||47645<=r&&r<=47671||47673<=r&&r<=47699||47701<=r&&r<=47727||47729<=r&&r<=47755||47757<=r&&r<=47783||47785<=r&&r<=47811||47813<=r&&r<=47839||47841<=r&&r<=47867||47869<=r&&r<=47895||47897<=r&&r<=47923||47925<=r&&r<=47951||47953<=r&&r<=47979||47981<=r&&r<=48007||48009<=r&&r<=48035||48037<=r&&r<=48063||48065<=r&&r<=48091||48093<=r&&r<=48119||48121<=r&&r<=48147||48149<=r&&r<=48175||48177<=r&&r<=48203||48205<=r&&r<=48231||48233<=r&&r<=48259||48261<=r&&r<=48287||48289<=r&&r<=48315||48317<=r&&r<=48343||48345<=r&&r<=48371||48373<=r&&r<=48399||48401<=r&&r<=48427||48429<=r&&r<=48455||48457<=r&&r<=48483||48485<=r&&r<=48511||48513<=r&&r<=48539||48541<=r&&r<=48567||48569<=r&&r<=48595||48597<=r&&r<=48623||48625<=r&&r<=48651||48653<=r&&r<=48679||48681<=r&&r<=48707||48709<=r&&r<=48735||48737<=r&&r<=48763||48765<=r&&r<=48791||48793<=r&&r<=48819||48821<=r&&r<=48847||48849<=r&&r<=48875||48877<=r&&r<=48903||48905<=r&&r<=48931||48933<=r&&r<=48959||48961<=r&&r<=48987||48989<=r&&r<=49015||49017<=r&&r<=49043||49045<=r&&r<=49071||49073<=r&&r<=49099||49101<=r&&r<=49127||49129<=r&&r<=49155||49157<=r&&r<=49183||49185<=r&&r<=49211||49213<=r&&r<=49239||49241<=r&&r<=49267||49269<=r&&r<=49295||49297<=r&&r<=49323||49325<=r&&r<=49351||49353<=r&&r<=49379||49381<=r&&r<=49407||49409<=r&&r<=49435||49437<=r&&r<=49463||49465<=r&&r<=49491||49493<=r&&r<=49519||49521<=r&&r<=49547||49549<=r&&r<=49575||49577<=r&&r<=49603||49605<=r&&r<=49631||49633<=r&&r<=49659||49661<=r&&r<=49687||49689<=r&&r<=49715||49717<=r&&r<=49743||49745<=r&&r<=49771||49773<=r&&r<=49799||49801<=r&&r<=49827||49829<=r&&r<=49855||49857<=r&&r<=49883||49885<=r&&r<=49911||49913<=r&&r<=49939||49941<=r&&r<=49967||49969<=r&&r<=49995||49997<=r&&r<=50023||50025<=r&&r<=50051||50053<=r&&r<=50079||50081<=r&&r<=50107||50109<=r&&r<=50135||50137<=r&&r<=50163||50165<=r&&r<=50191||50193<=r&&r<=50219||50221<=r&&r<=50247||50249<=r&&r<=50275||50277<=r&&r<=50303||50305<=r&&r<=50331||50333<=r&&r<=50359||50361<=r&&r<=50387||50389<=r&&r<=50415||50417<=r&&r<=50443||50445<=r&&r<=50471||50473<=r&&r<=50499||50501<=r&&r<=50527||50529<=r&&r<=50555||50557<=r&&r<=50583||50585<=r&&r<=50611||50613<=r&&r<=50639||50641<=r&&r<=50667||50669<=r&&r<=50695||50697<=r&&r<=50723||50725<=r&&r<=50751||50753<=r&&r<=50779||50781<=r&&r<=50807||50809<=r&&r<=50835||50837<=r&&r<=50863||50865<=r&&r<=50891||50893<=r&&r<=50919||50921<=r&&r<=50947||50949<=r&&r<=50975||50977<=r&&r<=51003||51005<=r&&r<=51031||51033<=r&&r<=51059||51061<=r&&r<=51087||51089<=r&&r<=51115||51117<=r&&r<=51143||51145<=r&&r<=51171||51173<=r&&r<=51199||51201<=r&&r<=51227||51229<=r&&r<=51255||51257<=r&&r<=51283||51285<=r&&r<=51311||51313<=r&&r<=51339||51341<=r&&r<=51367||51369<=r&&r<=51395||51397<=r&&r<=51423||51425<=r&&r<=51451||51453<=r&&r<=51479||51481<=r&&r<=51507||51509<=r&&r<=51535||51537<=r&&r<=51563||51565<=r&&r<=51591||51593<=r&&r<=51619||51621<=r&&r<=51647||51649<=r&&r<=51675||51677<=r&&r<=51703||51705<=r&&r<=51731||51733<=r&&r<=51759||51761<=r&&r<=51787||51789<=r&&r<=51815||51817<=r&&r<=51843||51845<=r&&r<=51871||51873<=r&&r<=51899||51901<=r&&r<=51927||51929<=r&&r<=51955||51957<=r&&r<=51983||51985<=r&&r<=52011||52013<=r&&r<=52039||52041<=r&&r<=52067||52069<=r&&r<=52095||52097<=r&&r<=52123||52125<=r&&r<=52151||52153<=r&&r<=52179||52181<=r&&r<=52207||52209<=r&&r<=52235||52237<=r&&r<=52263||52265<=r&&r<=52291||52293<=r&&r<=52319||52321<=r&&r<=52347||52349<=r&&r<=52375||52377<=r&&r<=52403||52405<=r&&r<=52431||52433<=r&&r<=52459||52461<=r&&r<=52487||52489<=r&&r<=52515||52517<=r&&r<=52543||52545<=r&&r<=52571||52573<=r&&r<=52599||52601<=r&&r<=52627||52629<=r&&r<=52655||52657<=r&&r<=52683||52685<=r&&r<=52711||52713<=r&&r<=52739||52741<=r&&r<=52767||52769<=r&&r<=52795||52797<=r&&r<=52823||52825<=r&&r<=52851||52853<=r&&r<=52879||52881<=r&&r<=52907||52909<=r&&r<=52935||52937<=r&&r<=52963||52965<=r&&r<=52991||52993<=r&&r<=53019||53021<=r&&r<=53047||53049<=r&&r<=53075||53077<=r&&r<=53103||53105<=r&&r<=53131||53133<=r&&r<=53159||53161<=r&&r<=53187||53189<=r&&r<=53215||53217<=r&&r<=53243||53245<=r&&r<=53271||53273<=r&&r<=53299||53301<=r&&r<=53327||53329<=r&&r<=53355||53357<=r&&r<=53383||53385<=r&&r<=53411||53413<=r&&r<=53439||53441<=r&&r<=53467||53469<=r&&r<=53495||53497<=r&&r<=53523||53525<=r&&r<=53551||53553<=r&&r<=53579||53581<=r&&r<=53607||53609<=r&&r<=53635||53637<=r&&r<=53663||53665<=r&&r<=53691||53693<=r&&r<=53719||53721<=r&&r<=53747||53749<=r&&r<=53775||53777<=r&&r<=53803||53805<=r&&r<=53831||53833<=r&&r<=53859||53861<=r&&r<=53887||53889<=r&&r<=53915||53917<=r&&r<=53943||53945<=r&&r<=53971||53973<=r&&r<=53999||54001<=r&&r<=54027||54029<=r&&r<=54055||54057<=r&&r<=54083||54085<=r&&r<=54111||54113<=r&&r<=54139||54141<=r&&r<=54167||54169<=r&&r<=54195||54197<=r&&r<=54223||54225<=r&&r<=54251||54253<=r&&r<=54279||54281<=r&&r<=54307||54309<=r&&r<=54335||54337<=r&&r<=54363||54365<=r&&r<=54391||54393<=r&&r<=54419||54421<=r&&r<=54447||54449<=r&&r<=54475||54477<=r&&r<=54503||54505<=r&&r<=54531||54533<=r&&r<=54559||54561<=r&&r<=54587||54589<=r&&r<=54615||54617<=r&&r<=54643||54645<=r&&r<=54671||54673<=r&&r<=54699||54701<=r&&r<=54727||54729<=r&&r<=54755||54757<=r&&r<=54783||54785<=r&&r<=54811||54813<=r&&r<=54839||54841<=r&&r<=54867||54869<=r&&r<=54895||54897<=r&&r<=54923||54925<=r&&r<=54951||54953<=r&&r<=54979||54981<=r&&r<=55007||55009<=r&&r<=55035||55037<=r&&r<=55063||55065<=r&&r<=55091||55093<=r&&r<=55119||55121<=r&&r<=55147||55149<=r&&r<=55175||55177<=r&&r<=55203?g:r==9757||r==9977||9994<=r&&r<=9997||r==127877||127938<=r&&r<=127940||r==127943||127946<=r&&r<=127948||128066<=r&&r<=128067||128070<=r&&r<=128080||r==128110||128112<=r&&r<=128120||r==128124||128129<=r&&r<=128131||128133<=r&&r<=128135||r==128170||128372<=r&&r<=128373||r==128378||r==128400||128405<=r&&r<=128406||128581<=r&&r<=128583||128587<=r&&r<=128591||r==128675||128692<=r&&r<=128694||r==128704||r==128716||129304<=r&&r<=129308||129310<=r&&r<=129311||r==129318||129328<=r&&r<=129337||129341<=r&&r<=129342||129489<=r&&r<=129501?E:127995<=r&&r<=127999?b:r==8205?D:r==9792||r==9794||9877<=r&&r<=9878||r==9992||r==10084||r==127752||r==127806||r==127859||r==127891||r==127908||r==127912||r==127979||r==127981||r==128139||128187<=r&&r<=128188||r==128295||r==128300||r==128488||r==128640||r==128658?A:128102<=r&&r<=128105?O:y}return this}e.exports&&(e.exports=t)})(Ym);var L1=Ym.exports;const M1=rs(L1);function U1(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function k1(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const V1=1.2,Xm="ID_WHITE_PIXEL",Yl=new U(4,4),G1=new Ce(1,1,1,1);function q1(e){const t=document.createElement("canvas");t.width=Yl.x,t.height=Yl.y;const n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Xm,t)}const Tn={};function H1(e,t,n,i,o,s,a){return Tn.font=t,Tn.fillColor=n,Tn.strokeColor=i,Tn.strokeWidth=o,Tn.padding=pn.PADDING,a===Je.CENTER?Tn.textBaseline="middle":a===Je.TOP?Tn.textBaseline="top":Tn.textBaseline="bottom",Tn.fill=s===Ei.FILL||s===Ei.FILL_AND_OUTLINE,Tn.stroke=s===Ei.OUTLINE||s===Ei.FILL_AND_OUTLINE,Tn.backgroundColor=T.BLACK,T1(e,Tn)}function Xl(e,t){t.textureInfo=void 0,t.dimensions=void 0;const n=t.billboard;h(n)&&(n.show=!1,n.image=void 0,h(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function W1(e,t,n,i){i.index=e.addImageSync(t,n)}const j1=new M1;function Y1(e,t){const n=t._renderedText,i=j1.splitGraphemes(n),o=i.length,s=t._glyphs,a=s.length;let c,l,u;if(t._relativeSize=t._fontSize/pn.FONT_SIZE,o<a)for(l=o;l<a;++l)Xl(e,s[l]);s.length=o;const d=t.show&&t._showBackground&&n.split(`
6349
- `).join("").length>0;let p=t._backgroundBillboard;const g=e._backgroundBillboardCollection;d?(h(p)||(p=g.add({collection:e,image:Xm,imageSubRegion:G1}),t._backgroundBillboard=p),p.color=t._backgroundColor,p.show=t._show,p.position=t._position,p.eyeOffset=t._eyeOffset,p.pixelOffset=t._pixelOffset,p.horizontalOrigin=In.LEFT,p.verticalOrigin=t._verticalOrigin,p.heightReference=t._heightReference,p.scale=t.totalScale,p.pickPrimitive=t,p.id=t._id,p.translucencyByDistance=t._translucencyByDistance,p.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,p.scaleByDistance=t._scaleByDistance,p.distanceDisplayCondition=t._distanceDisplayCondition,p.disableDepthTestDistance=t._disableDepthTestDistance,p.clusterShow=t.clusterShow):h(p)&&(g.remove(p),t._backgroundBillboard=p=void 0);const y=e._glyphTextureCache;for(u=0;u<o;++u){const x=i[u],E=t._verticalOrigin,b=JSON.stringify([x,t._fontFamily,t._fontStyle,t._fontWeight,+E]);let D=y[b];if(!h(D)){const A=`${t._fontStyle} ${t._fontWeight} ${pn.FONT_SIZE}px ${t._fontFamily}`,O=H1(x,A,T.WHITE,T.WHITE,0,Ei.FILL,E);if(D=new k1(e,-1,O.dimensions),y[b]=D,O.width>0&&O.height>0){const I=D1(O,{cutoff:pn.CUTOFF,radius:pn.RADIUS}),B=O.getContext("2d"),M=O.width,q=O.height,P=B.getImageData(0,0,M,q);for(let V=0;V<M;V++)for(let k=0;k<q;k++){const H=k*M+V,j=I[H]*255,r=H*4;P.data[r+0]=j,P.data[r+1]=j,P.data[r+2]=j,P.data[r+3]=j}B.putImageData(P,0,0),x!==" "&&W1(e._textureAtlas,b,O,D)}}if(c=s[u],h(c)?D.index===-1?Xl(e,c):h(c.textureInfo)&&(c.textureInfo=void 0):(c=new U1,s[u]=c),c.textureInfo=D,c.dimensions=D.dimensions,D.index!==-1){let A=c.billboard;const O=e._spareBillboards;h(A)||(O.length>0?A=O.pop():(A=e._billboardCollection.add({collection:e}),A._labelDimensions=new U,A._labelTranslate=new U),c.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=In.LEFT,A.verticalOrigin=t._verticalOrigin,A.heightReference=t._heightReference,A.scale=t.totalScale,A.pickPrimitive=t,A.id=t._id,A.image=b,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,A.scaleByDistance=t._scaleByDistance,A.distanceDisplayCondition=t._distanceDisplayCondition,A.disableDepthTestDistance=t._disableDepthTestDistance,A._batchIndex=t._batchIndex,A.outlineColor=t.outlineColor,t.style===Ei.FILL_AND_OUTLINE?(A.color=t._fillColor,A.outlineWidth=t.outlineWidth):t.style===Ei.FILL?(A.color=t._fillColor,A.outlineWidth=0):t.style===Ei.OUTLINE&&(A.color=T.TRANSPARENT,A.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function $m(e,t,n){return t===In.CENTER?-e/2:t===In.RIGHT?-(e+n.x):n.x}const et=new U,X1=new U;function $1(e){const t=e._glyphs,n=e._renderedText;let i,o,s=0,a=0;const c=[];let l=Number.NEGATIVE_INFINITY,u=0,d=1,p;const g=t.length,y=e._backgroundBillboard,x=U.clone(h(y)?e._backgroundPadding:U.ZERO,X1);for(x.x/=e._relativeSize,x.y/=e._relativeSize,p=0;p<g;++p)n.charAt(p)===`
6348
+ `)}return n}var Ym={exports:{}};(function(e){function t(){var n=0,i=1,o=2,s=3,a=4,c=5,l=6,u=7,d=8,p=9,g=10,y=11,x=12,E=13,b=14,D=15,A=16,O=17,I=0,B=1,M=2,q=3,P=4;function V(r,w){return 55296<=r.charCodeAt(w)&&r.charCodeAt(w)<=56319&&56320<=r.charCodeAt(w+1)&&r.charCodeAt(w+1)<=57343}function k(r,w){w===void 0&&(w=0);var v=r.charCodeAt(w);if(55296<=v&&v<=56319&&w<r.length-1){var z=v,G=r.charCodeAt(w+1);return 56320<=G&&G<=57343?(z-55296)*1024+(G-56320)+65536:z}if(56320<=v&&v<=57343&&w>=1){var z=r.charCodeAt(w-1),G=v;return 55296<=z&&z<=56319?(z-55296)*1024+(G-56320)+65536:G}return v}function H(r,w,v){var z=[r].concat(w).concat([v]),G=z[z.length-2],W=v,Z=z.lastIndexOf(b);if(Z>1&&z.slice(1,Z).every(function(se){return se==s})&&[s,E,O].indexOf(r)==-1)return M;var X=z.lastIndexOf(a);if(X>0&&z.slice(1,X).every(function(se){return se==a})&&[x,a].indexOf(G)==-1)return z.filter(function(se){return se==a}).length%2==1?q:P;if(G==n&&W==i)return I;if(G==o||G==n||G==i)return W==b&&w.every(function(se){return se==s})?M:B;if(W==o||W==n||W==i)return B;if(G==l&&(W==l||W==u||W==p||W==g))return I;if((G==p||G==u)&&(W==u||W==d))return I;if((G==g||G==d)&&W==d)return I;if(W==s||W==D)return I;if(W==c)return I;if(G==x)return I;var ie=z.indexOf(s)!=-1?z.lastIndexOf(s)-1:z.length-2;return[E,O].indexOf(z[ie])!=-1&&z.slice(ie+1,-1).every(function(se){return se==s})&&W==b||G==D&&[A,O].indexOf(W)!=-1?I:w.indexOf(a)!=-1?M:G==a&&W==a?I:B}this.nextBreak=function(r,w){if(w===void 0&&(w=0),w<0)return 0;if(w>=r.length-1)return r.length;for(var v=j(k(r,w)),z=[],G=w+1;G<r.length;G++)if(!V(r,G-1)){var W=j(k(r,G));if(H(v,z,W))return G;z.push(W)}return r.length},this.splitGraphemes=function(r){for(var w=[],v=0,z;(z=this.nextBreak(r,v))<r.length;)w.push(r.slice(v,z)),v=z;return v<r.length&&w.push(r.slice(v)),w},this.iterateGraphemes=function(r){var w=0,v={next:(function(){var z,G;return(G=this.nextBreak(r,w))<r.length?(z=r.slice(w,G),w=G,{value:z,done:!1}):w<r.length?(z=r.slice(w),w=r.length,{value:z,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(v[Symbol.iterator]=function(){return v}),v},this.countGraphemes=function(r){for(var w=0,v=0,z;(z=this.nextBreak(r,v))<r.length;)v=z,w++;return v<r.length&&w++,w};function j(r){return 1536<=r&&r<=1541||r==1757||r==1807||r==2274||r==3406||r==69821||70082<=r&&r<=70083||r==72250||72326<=r&&r<=72329||r==73030?x:r==13?n:r==10?i:0<=r&&r<=9||11<=r&&r<=12||14<=r&&r<=31||127<=r&&r<=159||r==173||r==1564||r==6158||r==8203||8206<=r&&r<=8207||r==8232||r==8233||8234<=r&&r<=8238||8288<=r&&r<=8292||r==8293||8294<=r&&r<=8303||55296<=r&&r<=57343||r==65279||65520<=r&&r<=65528||65529<=r&&r<=65531||113824<=r&&r<=113827||119155<=r&&r<=119162||r==917504||r==917505||917506<=r&&r<=917535||917632<=r&&r<=917759||918e3<=r&&r<=921599?o:768<=r&&r<=879||1155<=r&&r<=1159||1160<=r&&r<=1161||1425<=r&&r<=1469||r==1471||1473<=r&&r<=1474||1476<=r&&r<=1477||r==1479||1552<=r&&r<=1562||1611<=r&&r<=1631||r==1648||1750<=r&&r<=1756||1759<=r&&r<=1764||1767<=r&&r<=1768||1770<=r&&r<=1773||r==1809||1840<=r&&r<=1866||1958<=r&&r<=1968||2027<=r&&r<=2035||2070<=r&&r<=2073||2075<=r&&r<=2083||2085<=r&&r<=2087||2089<=r&&r<=2093||2137<=r&&r<=2139||2260<=r&&r<=2273||2275<=r&&r<=2306||r==2362||r==2364||2369<=r&&r<=2376||r==2381||2385<=r&&r<=2391||2402<=r&&r<=2403||r==2433||r==2492||r==2494||2497<=r&&r<=2500||r==2509||r==2519||2530<=r&&r<=2531||2561<=r&&r<=2562||r==2620||2625<=r&&r<=2626||2631<=r&&r<=2632||2635<=r&&r<=2637||r==2641||2672<=r&&r<=2673||r==2677||2689<=r&&r<=2690||r==2748||2753<=r&&r<=2757||2759<=r&&r<=2760||r==2765||2786<=r&&r<=2787||2810<=r&&r<=2815||r==2817||r==2876||r==2878||r==2879||2881<=r&&r<=2884||r==2893||r==2902||r==2903||2914<=r&&r<=2915||r==2946||r==3006||r==3008||r==3021||r==3031||r==3072||3134<=r&&r<=3136||3142<=r&&r<=3144||3146<=r&&r<=3149||3157<=r&&r<=3158||3170<=r&&r<=3171||r==3201||r==3260||r==3263||r==3266||r==3270||3276<=r&&r<=3277||3285<=r&&r<=3286||3298<=r&&r<=3299||3328<=r&&r<=3329||3387<=r&&r<=3388||r==3390||3393<=r&&r<=3396||r==3405||r==3415||3426<=r&&r<=3427||r==3530||r==3535||3538<=r&&r<=3540||r==3542||r==3551||r==3633||3636<=r&&r<=3642||3655<=r&&r<=3662||r==3761||3764<=r&&r<=3769||3771<=r&&r<=3772||3784<=r&&r<=3789||3864<=r&&r<=3865||r==3893||r==3895||r==3897||3953<=r&&r<=3966||3968<=r&&r<=3972||3974<=r&&r<=3975||3981<=r&&r<=3991||3993<=r&&r<=4028||r==4038||4141<=r&&r<=4144||4146<=r&&r<=4151||4153<=r&&r<=4154||4157<=r&&r<=4158||4184<=r&&r<=4185||4190<=r&&r<=4192||4209<=r&&r<=4212||r==4226||4229<=r&&r<=4230||r==4237||r==4253||4957<=r&&r<=4959||5906<=r&&r<=5908||5938<=r&&r<=5940||5970<=r&&r<=5971||6002<=r&&r<=6003||6068<=r&&r<=6069||6071<=r&&r<=6077||r==6086||6089<=r&&r<=6099||r==6109||6155<=r&&r<=6157||6277<=r&&r<=6278||r==6313||6432<=r&&r<=6434||6439<=r&&r<=6440||r==6450||6457<=r&&r<=6459||6679<=r&&r<=6680||r==6683||r==6742||6744<=r&&r<=6750||r==6752||r==6754||6757<=r&&r<=6764||6771<=r&&r<=6780||r==6783||6832<=r&&r<=6845||r==6846||6912<=r&&r<=6915||r==6964||6966<=r&&r<=6970||r==6972||r==6978||7019<=r&&r<=7027||7040<=r&&r<=7041||7074<=r&&r<=7077||7080<=r&&r<=7081||7083<=r&&r<=7085||r==7142||7144<=r&&r<=7145||r==7149||7151<=r&&r<=7153||7212<=r&&r<=7219||7222<=r&&r<=7223||7376<=r&&r<=7378||7380<=r&&r<=7392||7394<=r&&r<=7400||r==7405||r==7412||7416<=r&&r<=7417||7616<=r&&r<=7673||7675<=r&&r<=7679||r==8204||8400<=r&&r<=8412||8413<=r&&r<=8416||r==8417||8418<=r&&r<=8420||8421<=r&&r<=8432||11503<=r&&r<=11505||r==11647||11744<=r&&r<=11775||12330<=r&&r<=12333||12334<=r&&r<=12335||12441<=r&&r<=12442||r==42607||42608<=r&&r<=42610||42612<=r&&r<=42621||42654<=r&&r<=42655||42736<=r&&r<=42737||r==43010||r==43014||r==43019||43045<=r&&r<=43046||43204<=r&&r<=43205||43232<=r&&r<=43249||43302<=r&&r<=43309||43335<=r&&r<=43345||43392<=r&&r<=43394||r==43443||43446<=r&&r<=43449||r==43452||r==43493||43561<=r&&r<=43566||43569<=r&&r<=43570||43573<=r&&r<=43574||r==43587||r==43596||r==43644||r==43696||43698<=r&&r<=43700||43703<=r&&r<=43704||43710<=r&&r<=43711||r==43713||43756<=r&&r<=43757||r==43766||r==44005||r==44008||r==44013||r==64286||65024<=r&&r<=65039||65056<=r&&r<=65071||65438<=r&&r<=65439||r==66045||r==66272||66422<=r&&r<=66426||68097<=r&&r<=68099||68101<=r&&r<=68102||68108<=r&&r<=68111||68152<=r&&r<=68154||r==68159||68325<=r&&r<=68326||r==69633||69688<=r&&r<=69702||69759<=r&&r<=69761||69811<=r&&r<=69814||69817<=r&&r<=69818||69888<=r&&r<=69890||69927<=r&&r<=69931||69933<=r&&r<=69940||r==70003||70016<=r&&r<=70017||70070<=r&&r<=70078||70090<=r&&r<=70092||70191<=r&&r<=70193||r==70196||70198<=r&&r<=70199||r==70206||r==70367||70371<=r&&r<=70378||70400<=r&&r<=70401||r==70460||r==70462||r==70464||r==70487||70502<=r&&r<=70508||70512<=r&&r<=70516||70712<=r&&r<=70719||70722<=r&&r<=70724||r==70726||r==70832||70835<=r&&r<=70840||r==70842||r==70845||70847<=r&&r<=70848||70850<=r&&r<=70851||r==71087||71090<=r&&r<=71093||71100<=r&&r<=71101||71103<=r&&r<=71104||71132<=r&&r<=71133||71219<=r&&r<=71226||r==71229||71231<=r&&r<=71232||r==71339||r==71341||71344<=r&&r<=71349||r==71351||71453<=r&&r<=71455||71458<=r&&r<=71461||71463<=r&&r<=71467||72193<=r&&r<=72198||72201<=r&&r<=72202||72243<=r&&r<=72248||72251<=r&&r<=72254||r==72263||72273<=r&&r<=72278||72281<=r&&r<=72283||72330<=r&&r<=72342||72344<=r&&r<=72345||72752<=r&&r<=72758||72760<=r&&r<=72765||r==72767||72850<=r&&r<=72871||72874<=r&&r<=72880||72882<=r&&r<=72883||72885<=r&&r<=72886||73009<=r&&r<=73014||r==73018||73020<=r&&r<=73021||73023<=r&&r<=73029||r==73031||92912<=r&&r<=92916||92976<=r&&r<=92982||94095<=r&&r<=94098||113821<=r&&r<=113822||r==119141||119143<=r&&r<=119145||119150<=r&&r<=119154||119163<=r&&r<=119170||119173<=r&&r<=119179||119210<=r&&r<=119213||119362<=r&&r<=119364||121344<=r&&r<=121398||121403<=r&&r<=121452||r==121461||r==121476||121499<=r&&r<=121503||121505<=r&&r<=121519||122880<=r&&r<=122886||122888<=r&&r<=122904||122907<=r&&r<=122913||122915<=r&&r<=122916||122918<=r&&r<=122922||125136<=r&&r<=125142||125252<=r&&r<=125258||917536<=r&&r<=917631||917760<=r&&r<=917999?s:127462<=r&&r<=127487?a:r==2307||r==2363||2366<=r&&r<=2368||2377<=r&&r<=2380||2382<=r&&r<=2383||2434<=r&&r<=2435||2495<=r&&r<=2496||2503<=r&&r<=2504||2507<=r&&r<=2508||r==2563||2622<=r&&r<=2624||r==2691||2750<=r&&r<=2752||r==2761||2763<=r&&r<=2764||2818<=r&&r<=2819||r==2880||2887<=r&&r<=2888||2891<=r&&r<=2892||r==3007||3009<=r&&r<=3010||3014<=r&&r<=3016||3018<=r&&r<=3020||3073<=r&&r<=3075||3137<=r&&r<=3140||3202<=r&&r<=3203||r==3262||3264<=r&&r<=3265||3267<=r&&r<=3268||3271<=r&&r<=3272||3274<=r&&r<=3275||3330<=r&&r<=3331||3391<=r&&r<=3392||3398<=r&&r<=3400||3402<=r&&r<=3404||3458<=r&&r<=3459||3536<=r&&r<=3537||3544<=r&&r<=3550||3570<=r&&r<=3571||r==3635||r==3763||3902<=r&&r<=3903||r==3967||r==4145||4155<=r&&r<=4156||4182<=r&&r<=4183||r==4228||r==6070||6078<=r&&r<=6085||6087<=r&&r<=6088||6435<=r&&r<=6438||6441<=r&&r<=6443||6448<=r&&r<=6449||6451<=r&&r<=6456||6681<=r&&r<=6682||r==6741||r==6743||6765<=r&&r<=6770||r==6916||r==6965||r==6971||6973<=r&&r<=6977||6979<=r&&r<=6980||r==7042||r==7073||7078<=r&&r<=7079||r==7082||r==7143||7146<=r&&r<=7148||r==7150||7154<=r&&r<=7155||7204<=r&&r<=7211||7220<=r&&r<=7221||r==7393||7410<=r&&r<=7411||r==7415||43043<=r&&r<=43044||r==43047||43136<=r&&r<=43137||43188<=r&&r<=43203||43346<=r&&r<=43347||r==43395||43444<=r&&r<=43445||43450<=r&&r<=43451||43453<=r&&r<=43456||43567<=r&&r<=43568||43571<=r&&r<=43572||r==43597||r==43755||43758<=r&&r<=43759||r==43765||44003<=r&&r<=44004||44006<=r&&r<=44007||44009<=r&&r<=44010||r==44012||r==69632||r==69634||r==69762||69808<=r&&r<=69810||69815<=r&&r<=69816||r==69932||r==70018||70067<=r&&r<=70069||70079<=r&&r<=70080||70188<=r&&r<=70190||70194<=r&&r<=70195||r==70197||70368<=r&&r<=70370||70402<=r&&r<=70403||r==70463||70465<=r&&r<=70468||70471<=r&&r<=70472||70475<=r&&r<=70477||70498<=r&&r<=70499||70709<=r&&r<=70711||70720<=r&&r<=70721||r==70725||70833<=r&&r<=70834||r==70841||70843<=r&&r<=70844||r==70846||r==70849||71088<=r&&r<=71089||71096<=r&&r<=71099||r==71102||71216<=r&&r<=71218||71227<=r&&r<=71228||r==71230||r==71340||71342<=r&&r<=71343||r==71350||71456<=r&&r<=71457||r==71462||72199<=r&&r<=72200||r==72249||72279<=r&&r<=72280||r==72343||r==72751||r==72766||r==72873||r==72881||r==72884||94033<=r&&r<=94078||r==119142||r==119149?c:4352<=r&&r<=4447||43360<=r&&r<=43388?l:4448<=r&&r<=4519||55216<=r&&r<=55238?u:4520<=r&&r<=4607||55243<=r&&r<=55291?d:r==44032||r==44060||r==44088||r==44116||r==44144||r==44172||r==44200||r==44228||r==44256||r==44284||r==44312||r==44340||r==44368||r==44396||r==44424||r==44452||r==44480||r==44508||r==44536||r==44564||r==44592||r==44620||r==44648||r==44676||r==44704||r==44732||r==44760||r==44788||r==44816||r==44844||r==44872||r==44900||r==44928||r==44956||r==44984||r==45012||r==45040||r==45068||r==45096||r==45124||r==45152||r==45180||r==45208||r==45236||r==45264||r==45292||r==45320||r==45348||r==45376||r==45404||r==45432||r==45460||r==45488||r==45516||r==45544||r==45572||r==45600||r==45628||r==45656||r==45684||r==45712||r==45740||r==45768||r==45796||r==45824||r==45852||r==45880||r==45908||r==45936||r==45964||r==45992||r==46020||r==46048||r==46076||r==46104||r==46132||r==46160||r==46188||r==46216||r==46244||r==46272||r==46300||r==46328||r==46356||r==46384||r==46412||r==46440||r==46468||r==46496||r==46524||r==46552||r==46580||r==46608||r==46636||r==46664||r==46692||r==46720||r==46748||r==46776||r==46804||r==46832||r==46860||r==46888||r==46916||r==46944||r==46972||r==47e3||r==47028||r==47056||r==47084||r==47112||r==47140||r==47168||r==47196||r==47224||r==47252||r==47280||r==47308||r==47336||r==47364||r==47392||r==47420||r==47448||r==47476||r==47504||r==47532||r==47560||r==47588||r==47616||r==47644||r==47672||r==47700||r==47728||r==47756||r==47784||r==47812||r==47840||r==47868||r==47896||r==47924||r==47952||r==47980||r==48008||r==48036||r==48064||r==48092||r==48120||r==48148||r==48176||r==48204||r==48232||r==48260||r==48288||r==48316||r==48344||r==48372||r==48400||r==48428||r==48456||r==48484||r==48512||r==48540||r==48568||r==48596||r==48624||r==48652||r==48680||r==48708||r==48736||r==48764||r==48792||r==48820||r==48848||r==48876||r==48904||r==48932||r==48960||r==48988||r==49016||r==49044||r==49072||r==49100||r==49128||r==49156||r==49184||r==49212||r==49240||r==49268||r==49296||r==49324||r==49352||r==49380||r==49408||r==49436||r==49464||r==49492||r==49520||r==49548||r==49576||r==49604||r==49632||r==49660||r==49688||r==49716||r==49744||r==49772||r==49800||r==49828||r==49856||r==49884||r==49912||r==49940||r==49968||r==49996||r==50024||r==50052||r==50080||r==50108||r==50136||r==50164||r==50192||r==50220||r==50248||r==50276||r==50304||r==50332||r==50360||r==50388||r==50416||r==50444||r==50472||r==50500||r==50528||r==50556||r==50584||r==50612||r==50640||r==50668||r==50696||r==50724||r==50752||r==50780||r==50808||r==50836||r==50864||r==50892||r==50920||r==50948||r==50976||r==51004||r==51032||r==51060||r==51088||r==51116||r==51144||r==51172||r==51200||r==51228||r==51256||r==51284||r==51312||r==51340||r==51368||r==51396||r==51424||r==51452||r==51480||r==51508||r==51536||r==51564||r==51592||r==51620||r==51648||r==51676||r==51704||r==51732||r==51760||r==51788||r==51816||r==51844||r==51872||r==51900||r==51928||r==51956||r==51984||r==52012||r==52040||r==52068||r==52096||r==52124||r==52152||r==52180||r==52208||r==52236||r==52264||r==52292||r==52320||r==52348||r==52376||r==52404||r==52432||r==52460||r==52488||r==52516||r==52544||r==52572||r==52600||r==52628||r==52656||r==52684||r==52712||r==52740||r==52768||r==52796||r==52824||r==52852||r==52880||r==52908||r==52936||r==52964||r==52992||r==53020||r==53048||r==53076||r==53104||r==53132||r==53160||r==53188||r==53216||r==53244||r==53272||r==53300||r==53328||r==53356||r==53384||r==53412||r==53440||r==53468||r==53496||r==53524||r==53552||r==53580||r==53608||r==53636||r==53664||r==53692||r==53720||r==53748||r==53776||r==53804||r==53832||r==53860||r==53888||r==53916||r==53944||r==53972||r==54e3||r==54028||r==54056||r==54084||r==54112||r==54140||r==54168||r==54196||r==54224||r==54252||r==54280||r==54308||r==54336||r==54364||r==54392||r==54420||r==54448||r==54476||r==54504||r==54532||r==54560||r==54588||r==54616||r==54644||r==54672||r==54700||r==54728||r==54756||r==54784||r==54812||r==54840||r==54868||r==54896||r==54924||r==54952||r==54980||r==55008||r==55036||r==55064||r==55092||r==55120||r==55148||r==55176?p:44033<=r&&r<=44059||44061<=r&&r<=44087||44089<=r&&r<=44115||44117<=r&&r<=44143||44145<=r&&r<=44171||44173<=r&&r<=44199||44201<=r&&r<=44227||44229<=r&&r<=44255||44257<=r&&r<=44283||44285<=r&&r<=44311||44313<=r&&r<=44339||44341<=r&&r<=44367||44369<=r&&r<=44395||44397<=r&&r<=44423||44425<=r&&r<=44451||44453<=r&&r<=44479||44481<=r&&r<=44507||44509<=r&&r<=44535||44537<=r&&r<=44563||44565<=r&&r<=44591||44593<=r&&r<=44619||44621<=r&&r<=44647||44649<=r&&r<=44675||44677<=r&&r<=44703||44705<=r&&r<=44731||44733<=r&&r<=44759||44761<=r&&r<=44787||44789<=r&&r<=44815||44817<=r&&r<=44843||44845<=r&&r<=44871||44873<=r&&r<=44899||44901<=r&&r<=44927||44929<=r&&r<=44955||44957<=r&&r<=44983||44985<=r&&r<=45011||45013<=r&&r<=45039||45041<=r&&r<=45067||45069<=r&&r<=45095||45097<=r&&r<=45123||45125<=r&&r<=45151||45153<=r&&r<=45179||45181<=r&&r<=45207||45209<=r&&r<=45235||45237<=r&&r<=45263||45265<=r&&r<=45291||45293<=r&&r<=45319||45321<=r&&r<=45347||45349<=r&&r<=45375||45377<=r&&r<=45403||45405<=r&&r<=45431||45433<=r&&r<=45459||45461<=r&&r<=45487||45489<=r&&r<=45515||45517<=r&&r<=45543||45545<=r&&r<=45571||45573<=r&&r<=45599||45601<=r&&r<=45627||45629<=r&&r<=45655||45657<=r&&r<=45683||45685<=r&&r<=45711||45713<=r&&r<=45739||45741<=r&&r<=45767||45769<=r&&r<=45795||45797<=r&&r<=45823||45825<=r&&r<=45851||45853<=r&&r<=45879||45881<=r&&r<=45907||45909<=r&&r<=45935||45937<=r&&r<=45963||45965<=r&&r<=45991||45993<=r&&r<=46019||46021<=r&&r<=46047||46049<=r&&r<=46075||46077<=r&&r<=46103||46105<=r&&r<=46131||46133<=r&&r<=46159||46161<=r&&r<=46187||46189<=r&&r<=46215||46217<=r&&r<=46243||46245<=r&&r<=46271||46273<=r&&r<=46299||46301<=r&&r<=46327||46329<=r&&r<=46355||46357<=r&&r<=46383||46385<=r&&r<=46411||46413<=r&&r<=46439||46441<=r&&r<=46467||46469<=r&&r<=46495||46497<=r&&r<=46523||46525<=r&&r<=46551||46553<=r&&r<=46579||46581<=r&&r<=46607||46609<=r&&r<=46635||46637<=r&&r<=46663||46665<=r&&r<=46691||46693<=r&&r<=46719||46721<=r&&r<=46747||46749<=r&&r<=46775||46777<=r&&r<=46803||46805<=r&&r<=46831||46833<=r&&r<=46859||46861<=r&&r<=46887||46889<=r&&r<=46915||46917<=r&&r<=46943||46945<=r&&r<=46971||46973<=r&&r<=46999||47001<=r&&r<=47027||47029<=r&&r<=47055||47057<=r&&r<=47083||47085<=r&&r<=47111||47113<=r&&r<=47139||47141<=r&&r<=47167||47169<=r&&r<=47195||47197<=r&&r<=47223||47225<=r&&r<=47251||47253<=r&&r<=47279||47281<=r&&r<=47307||47309<=r&&r<=47335||47337<=r&&r<=47363||47365<=r&&r<=47391||47393<=r&&r<=47419||47421<=r&&r<=47447||47449<=r&&r<=47475||47477<=r&&r<=47503||47505<=r&&r<=47531||47533<=r&&r<=47559||47561<=r&&r<=47587||47589<=r&&r<=47615||47617<=r&&r<=47643||47645<=r&&r<=47671||47673<=r&&r<=47699||47701<=r&&r<=47727||47729<=r&&r<=47755||47757<=r&&r<=47783||47785<=r&&r<=47811||47813<=r&&r<=47839||47841<=r&&r<=47867||47869<=r&&r<=47895||47897<=r&&r<=47923||47925<=r&&r<=47951||47953<=r&&r<=47979||47981<=r&&r<=48007||48009<=r&&r<=48035||48037<=r&&r<=48063||48065<=r&&r<=48091||48093<=r&&r<=48119||48121<=r&&r<=48147||48149<=r&&r<=48175||48177<=r&&r<=48203||48205<=r&&r<=48231||48233<=r&&r<=48259||48261<=r&&r<=48287||48289<=r&&r<=48315||48317<=r&&r<=48343||48345<=r&&r<=48371||48373<=r&&r<=48399||48401<=r&&r<=48427||48429<=r&&r<=48455||48457<=r&&r<=48483||48485<=r&&r<=48511||48513<=r&&r<=48539||48541<=r&&r<=48567||48569<=r&&r<=48595||48597<=r&&r<=48623||48625<=r&&r<=48651||48653<=r&&r<=48679||48681<=r&&r<=48707||48709<=r&&r<=48735||48737<=r&&r<=48763||48765<=r&&r<=48791||48793<=r&&r<=48819||48821<=r&&r<=48847||48849<=r&&r<=48875||48877<=r&&r<=48903||48905<=r&&r<=48931||48933<=r&&r<=48959||48961<=r&&r<=48987||48989<=r&&r<=49015||49017<=r&&r<=49043||49045<=r&&r<=49071||49073<=r&&r<=49099||49101<=r&&r<=49127||49129<=r&&r<=49155||49157<=r&&r<=49183||49185<=r&&r<=49211||49213<=r&&r<=49239||49241<=r&&r<=49267||49269<=r&&r<=49295||49297<=r&&r<=49323||49325<=r&&r<=49351||49353<=r&&r<=49379||49381<=r&&r<=49407||49409<=r&&r<=49435||49437<=r&&r<=49463||49465<=r&&r<=49491||49493<=r&&r<=49519||49521<=r&&r<=49547||49549<=r&&r<=49575||49577<=r&&r<=49603||49605<=r&&r<=49631||49633<=r&&r<=49659||49661<=r&&r<=49687||49689<=r&&r<=49715||49717<=r&&r<=49743||49745<=r&&r<=49771||49773<=r&&r<=49799||49801<=r&&r<=49827||49829<=r&&r<=49855||49857<=r&&r<=49883||49885<=r&&r<=49911||49913<=r&&r<=49939||49941<=r&&r<=49967||49969<=r&&r<=49995||49997<=r&&r<=50023||50025<=r&&r<=50051||50053<=r&&r<=50079||50081<=r&&r<=50107||50109<=r&&r<=50135||50137<=r&&r<=50163||50165<=r&&r<=50191||50193<=r&&r<=50219||50221<=r&&r<=50247||50249<=r&&r<=50275||50277<=r&&r<=50303||50305<=r&&r<=50331||50333<=r&&r<=50359||50361<=r&&r<=50387||50389<=r&&r<=50415||50417<=r&&r<=50443||50445<=r&&r<=50471||50473<=r&&r<=50499||50501<=r&&r<=50527||50529<=r&&r<=50555||50557<=r&&r<=50583||50585<=r&&r<=50611||50613<=r&&r<=50639||50641<=r&&r<=50667||50669<=r&&r<=50695||50697<=r&&r<=50723||50725<=r&&r<=50751||50753<=r&&r<=50779||50781<=r&&r<=50807||50809<=r&&r<=50835||50837<=r&&r<=50863||50865<=r&&r<=50891||50893<=r&&r<=50919||50921<=r&&r<=50947||50949<=r&&r<=50975||50977<=r&&r<=51003||51005<=r&&r<=51031||51033<=r&&r<=51059||51061<=r&&r<=51087||51089<=r&&r<=51115||51117<=r&&r<=51143||51145<=r&&r<=51171||51173<=r&&r<=51199||51201<=r&&r<=51227||51229<=r&&r<=51255||51257<=r&&r<=51283||51285<=r&&r<=51311||51313<=r&&r<=51339||51341<=r&&r<=51367||51369<=r&&r<=51395||51397<=r&&r<=51423||51425<=r&&r<=51451||51453<=r&&r<=51479||51481<=r&&r<=51507||51509<=r&&r<=51535||51537<=r&&r<=51563||51565<=r&&r<=51591||51593<=r&&r<=51619||51621<=r&&r<=51647||51649<=r&&r<=51675||51677<=r&&r<=51703||51705<=r&&r<=51731||51733<=r&&r<=51759||51761<=r&&r<=51787||51789<=r&&r<=51815||51817<=r&&r<=51843||51845<=r&&r<=51871||51873<=r&&r<=51899||51901<=r&&r<=51927||51929<=r&&r<=51955||51957<=r&&r<=51983||51985<=r&&r<=52011||52013<=r&&r<=52039||52041<=r&&r<=52067||52069<=r&&r<=52095||52097<=r&&r<=52123||52125<=r&&r<=52151||52153<=r&&r<=52179||52181<=r&&r<=52207||52209<=r&&r<=52235||52237<=r&&r<=52263||52265<=r&&r<=52291||52293<=r&&r<=52319||52321<=r&&r<=52347||52349<=r&&r<=52375||52377<=r&&r<=52403||52405<=r&&r<=52431||52433<=r&&r<=52459||52461<=r&&r<=52487||52489<=r&&r<=52515||52517<=r&&r<=52543||52545<=r&&r<=52571||52573<=r&&r<=52599||52601<=r&&r<=52627||52629<=r&&r<=52655||52657<=r&&r<=52683||52685<=r&&r<=52711||52713<=r&&r<=52739||52741<=r&&r<=52767||52769<=r&&r<=52795||52797<=r&&r<=52823||52825<=r&&r<=52851||52853<=r&&r<=52879||52881<=r&&r<=52907||52909<=r&&r<=52935||52937<=r&&r<=52963||52965<=r&&r<=52991||52993<=r&&r<=53019||53021<=r&&r<=53047||53049<=r&&r<=53075||53077<=r&&r<=53103||53105<=r&&r<=53131||53133<=r&&r<=53159||53161<=r&&r<=53187||53189<=r&&r<=53215||53217<=r&&r<=53243||53245<=r&&r<=53271||53273<=r&&r<=53299||53301<=r&&r<=53327||53329<=r&&r<=53355||53357<=r&&r<=53383||53385<=r&&r<=53411||53413<=r&&r<=53439||53441<=r&&r<=53467||53469<=r&&r<=53495||53497<=r&&r<=53523||53525<=r&&r<=53551||53553<=r&&r<=53579||53581<=r&&r<=53607||53609<=r&&r<=53635||53637<=r&&r<=53663||53665<=r&&r<=53691||53693<=r&&r<=53719||53721<=r&&r<=53747||53749<=r&&r<=53775||53777<=r&&r<=53803||53805<=r&&r<=53831||53833<=r&&r<=53859||53861<=r&&r<=53887||53889<=r&&r<=53915||53917<=r&&r<=53943||53945<=r&&r<=53971||53973<=r&&r<=53999||54001<=r&&r<=54027||54029<=r&&r<=54055||54057<=r&&r<=54083||54085<=r&&r<=54111||54113<=r&&r<=54139||54141<=r&&r<=54167||54169<=r&&r<=54195||54197<=r&&r<=54223||54225<=r&&r<=54251||54253<=r&&r<=54279||54281<=r&&r<=54307||54309<=r&&r<=54335||54337<=r&&r<=54363||54365<=r&&r<=54391||54393<=r&&r<=54419||54421<=r&&r<=54447||54449<=r&&r<=54475||54477<=r&&r<=54503||54505<=r&&r<=54531||54533<=r&&r<=54559||54561<=r&&r<=54587||54589<=r&&r<=54615||54617<=r&&r<=54643||54645<=r&&r<=54671||54673<=r&&r<=54699||54701<=r&&r<=54727||54729<=r&&r<=54755||54757<=r&&r<=54783||54785<=r&&r<=54811||54813<=r&&r<=54839||54841<=r&&r<=54867||54869<=r&&r<=54895||54897<=r&&r<=54923||54925<=r&&r<=54951||54953<=r&&r<=54979||54981<=r&&r<=55007||55009<=r&&r<=55035||55037<=r&&r<=55063||55065<=r&&r<=55091||55093<=r&&r<=55119||55121<=r&&r<=55147||55149<=r&&r<=55175||55177<=r&&r<=55203?g:r==9757||r==9977||9994<=r&&r<=9997||r==127877||127938<=r&&r<=127940||r==127943||127946<=r&&r<=127948||128066<=r&&r<=128067||128070<=r&&r<=128080||r==128110||128112<=r&&r<=128120||r==128124||128129<=r&&r<=128131||128133<=r&&r<=128135||r==128170||128372<=r&&r<=128373||r==128378||r==128400||128405<=r&&r<=128406||128581<=r&&r<=128583||128587<=r&&r<=128591||r==128675||128692<=r&&r<=128694||r==128704||r==128716||129304<=r&&r<=129308||129310<=r&&r<=129311||r==129318||129328<=r&&r<=129337||129341<=r&&r<=129342||129489<=r&&r<=129501?E:127995<=r&&r<=127999?b:r==8205?D:r==9792||r==9794||9877<=r&&r<=9878||r==9992||r==10084||r==127752||r==127806||r==127859||r==127891||r==127908||r==127912||r==127979||r==127981||r==128139||128187<=r&&r<=128188||r==128295||r==128300||r==128488||r==128640||r==128658?A:128102<=r&&r<=128105?O:y}return this}e.exports&&(e.exports=t)})(Ym);var L1=Ym.exports;const M1=rs(L1);function U1(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function k1(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const V1=1.2,Xm="ID_WHITE_PIXEL",Yl=new U(4,4),G1=new Ce(1,1,1,1);function q1(e){const t=document.createElement("canvas");t.width=Yl.x,t.height=Yl.y;const n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(Xm,t)}const Tn={};function H1(e,t,n,i,o,s,a){return Tn.font=t,Tn.fillColor=n,Tn.strokeColor=i,Tn.strokeWidth=o,Tn.padding=pn.PADDING,a===Je.CENTER?Tn.textBaseline="middle":a===Je.TOP?Tn.textBaseline="top":Tn.textBaseline="bottom",Tn.fill=s===bi.FILL||s===bi.FILL_AND_OUTLINE,Tn.stroke=s===bi.OUTLINE||s===bi.FILL_AND_OUTLINE,Tn.backgroundColor=T.BLACK,T1(e,Tn)}function Xl(e,t){t.textureInfo=void 0,t.dimensions=void 0;const n=t.billboard;h(n)&&(n.show=!1,n.image=void 0,h(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function W1(e,t,n,i){i.index=e.addImageSync(t,n)}const j1=new M1;function Y1(e,t){const n=t._renderedText,i=j1.splitGraphemes(n),o=i.length,s=t._glyphs,a=s.length;let c,l,u;if(t._relativeSize=t._fontSize/pn.FONT_SIZE,o<a)for(l=o;l<a;++l)Xl(e,s[l]);s.length=o;const d=t.show&&t._showBackground&&n.split(`
6349
+ `).join("").length>0;let p=t._backgroundBillboard;const g=e._backgroundBillboardCollection;d?(h(p)||(p=g.add({collection:e,image:Xm,imageSubRegion:G1}),t._backgroundBillboard=p),p.color=t._backgroundColor,p.show=t._show,p.position=t._position,p.eyeOffset=t._eyeOffset,p.pixelOffset=t._pixelOffset,p.horizontalOrigin=In.LEFT,p.verticalOrigin=t._verticalOrigin,p.heightReference=t._heightReference,p.scale=t.totalScale,p.pickPrimitive=t,p.id=t._id,p.translucencyByDistance=t._translucencyByDistance,p.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,p.scaleByDistance=t._scaleByDistance,p.distanceDisplayCondition=t._distanceDisplayCondition,p.disableDepthTestDistance=t._disableDepthTestDistance,p.clusterShow=t.clusterShow):h(p)&&(g.remove(p),t._backgroundBillboard=p=void 0);const y=e._glyphTextureCache;for(u=0;u<o;++u){const x=i[u],E=t._verticalOrigin,b=JSON.stringify([x,t._fontFamily,t._fontStyle,t._fontWeight,+E]);let D=y[b];if(!h(D)){const A=`${t._fontStyle} ${t._fontWeight} ${pn.FONT_SIZE}px ${t._fontFamily}`,O=H1(x,A,T.WHITE,T.WHITE,0,bi.FILL,E);if(D=new k1(e,-1,O.dimensions),y[b]=D,O.width>0&&O.height>0){const I=D1(O,{cutoff:pn.CUTOFF,radius:pn.RADIUS}),B=O.getContext("2d"),M=O.width,q=O.height,P=B.getImageData(0,0,M,q);for(let V=0;V<M;V++)for(let k=0;k<q;k++){const H=k*M+V,j=I[H]*255,r=H*4;P.data[r+0]=j,P.data[r+1]=j,P.data[r+2]=j,P.data[r+3]=j}B.putImageData(P,0,0),x!==" "&&W1(e._textureAtlas,b,O,D)}}if(c=s[u],h(c)?D.index===-1?Xl(e,c):h(c.textureInfo)&&(c.textureInfo=void 0):(c=new U1,s[u]=c),c.textureInfo=D,c.dimensions=D.dimensions,D.index!==-1){let A=c.billboard;const O=e._spareBillboards;h(A)||(O.length>0?A=O.pop():(A=e._billboardCollection.add({collection:e}),A._labelDimensions=new U,A._labelTranslate=new U),c.billboard=A),A.show=t._show,A.position=t._position,A.eyeOffset=t._eyeOffset,A.pixelOffset=t._pixelOffset,A.horizontalOrigin=In.LEFT,A.verticalOrigin=t._verticalOrigin,A.heightReference=t._heightReference,A.scale=t.totalScale,A.pickPrimitive=t,A.id=t._id,A.image=b,A.translucencyByDistance=t._translucencyByDistance,A.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,A.scaleByDistance=t._scaleByDistance,A.distanceDisplayCondition=t._distanceDisplayCondition,A.disableDepthTestDistance=t._disableDepthTestDistance,A._batchIndex=t._batchIndex,A.outlineColor=t.outlineColor,t.style===bi.FILL_AND_OUTLINE?(A.color=t._fillColor,A.outlineWidth=t.outlineWidth):t.style===bi.FILL?(A.color=t._fillColor,A.outlineWidth=0):t.style===bi.OUTLINE&&(A.color=T.TRANSPARENT,A.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function $m(e,t,n){return t===In.CENTER?-e/2:t===In.RIGHT?-(e+n.x):n.x}const et=new U,X1=new U;function $1(e){const t=e._glyphs,n=e._renderedText;let i,o,s=0,a=0;const c=[];let l=Number.NEGATIVE_INFINITY,u=0,d=1,p;const g=t.length,y=e._backgroundBillboard,x=U.clone(h(y)?e._backgroundPadding:U.ZERO,X1);for(x.x/=e._relativeSize,x.y/=e._relativeSize,p=0;p<g;++p)n.charAt(p)===`
6350
6350
  `?(c.push(s),++d,s=0):(i=t[p],o=i.dimensions,u=Math.max(u,o.height-o.descent),l=Math.max(l,o.descent),s+=o.width-o.minx,p<g-1&&(s+=t[p+1].dimensions.minx),a=Math.max(a,s));c.push(s);const E=u+l,b=e.totalScale,D=e._horizontalOrigin,A=e._verticalOrigin;let O=0,I=c[O],B=$m(I,D,x);const M=(h(e._lineHeight)?e._lineHeight:V1*e._fontSize)/e._relativeSize,q=M*(d-1);let P=a,V=E+q;h(y)&&(P+=x.x*2,V+=x.y*2,y._labelHorizontalOrigin=D),et.x=B*b,et.y=0;let k=!0,H=0;for(p=0;p<g;++p)if(n.charAt(p)===`
6351
6351
  `)++O,H+=M,I=c[O],B=$m(I,D,x),et.x=B*b,k=!0;else if(i=t[p],o=i.dimensions,A===Je.TOP?(et.y=o.height-u-x.y,et.y+=pn.PADDING):A===Je.CENTER?et.y=(q+o.height-u)/2:A===Je.BASELINE?(et.y=q,et.y-=pn.PADDING):(et.y=q+l+x.y,et.y-=pn.PADDING),et.y=(et.y-o.descent-H)*b,k&&(et.x-=pn.PADDING*b,k=!1),h(i.billboard)&&(i.billboard._setTranslate(et),i.billboard._labelDimensions.x=P,i.billboard._labelDimensions.y=V,i.billboard._labelHorizontalOrigin=D),p<g-1){const j=t[p+1];et.x+=(o.width-o.minx+j.dimensions.minx)*b}if(h(y)&&n.split(`
6352
- `).join("").length>0&&(D===In.CENTER?B=-a/2-x.x:D===In.RIGHT?B=-(a+x.x*2):B=0,et.x=B*b,A===Je.TOP?et.y=E-u-l:A===Je.CENTER?et.y=(E-u)/2-l:A===Je.BASELINE?et.y=-x.y-l:et.y=0,et.y=et.y*b,y.width=P,y.height=V,y._setTranslate(et),y._labelTranslate=U.clone(et,y._labelTranslate)),$s(e.heightReference))for(p=0;p<g;++p){i=t[p];const j=i.billboard;h(j)&&(j._labelTranslate=U.clone(et,j._labelTranslate))}}function Zm(e,t){const n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Xl(e,n[i]);h(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,h(t._removeCallbackFunc)&&t._removeCallbackFunc(),Qe(t)}function Mn(e){e=_(e,_.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Jt({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Jt({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=T.clone(T.WHITE),this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ft.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Mn.prototype,{length:{get:function(){return this._labels.length}}}),Mn.prototype.add=function(e){const t=new Ln(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},Mn.prototype.remove=function(e){if(h(e)&&e._labelCollection===this){const t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Zm(this,e),!0}return!1},Mn.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)Zm(this,e[t]);e.length=0},Mn.prototype.contains=function(e){return h(e)&&e._labelCollection===this},Mn.prototype.get=function(e){if(!h(e))throw new C("index is required.");return this._labels[e]},Mn.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;h(this._textureAtlas)||(this._textureAtlas=new ni({context:i}),t.textureAtlas=this._textureAtlas),h(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new ni({context:i,initialSize:Yl}),n.textureAtlas=this._backgroundTextureAtlas,q1(this._backgroundTextureAtlas));const o=this._labelsToUpdate.length;for(let a=0;a<o;++a){const c=this._labelsToUpdate[a];if(c.isDestroyed())continue;const l=c._glyphs.length;c._rebindAllGlyphs&&(Y1(this,c),c._rebindAllGlyphs=!1),c._repositionAllGlyphs&&($1(c),c._repositionAllGlyphs=!1);const u=c._glyphs.length-l;this._totalGlyphCount+=u}const s=n.length>0?ft.TRANSLUCENT:this.blendOption;t.blendOption=s,n.blendOption=s,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)},Mn.prototype.isDestroyed=function(){return!1},Mn.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(),Qe(this)};const Km={id:void 0};function Kr(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){const t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;const o=t.values.slice(0),s=n.values.slice(0),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,s,a)}while(e._refire);e._firing=!1}}}function $t(e){this._owner=e,this._entities=new Zn,this._addedEntities=new Zn,this._removedEntities=new Zn,this._changedEntities=new Zn,this._suspendCount=0,this._collectionChanged=new Pe,this._id=Vn(),this._show=!0,this._firing=!1,this._refire=!1}$t.prototype.suspendEvents=function(){this._suspendCount++},$t.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,Kr(this)},Object.defineProperties($t.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(!h(e))throw new C("value is required.");if(e===this._show)return;this.suspendEvents();let t;const n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){const s=n[t],a=i[t];s!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,s)}this.resumeEvents()}},owner:{get:function(){return this._owner}}}),$t.prototype.computeAvailability=function(){let e=Fi.MAXIMUM_VALUE,t=Fi.MINIMUM_VALUE;const n=this._entities.values;for(let i=0,o=n.length;i<o;i++){const a=n[i].availability;if(h(a)){const c=a.start,l=a.stop;$.lessThan(c,e)&&!c.equals(Fi.MINIMUM_VALUE)&&(e=c),$.greaterThan(l,t)&&!l.equals(Fi.MAXIMUM_VALUE)&&(t=l)}}return Fi.MAXIMUM_VALUE.equals(e)&&(e=Fi.MINIMUM_VALUE),Fi.MINIMUM_VALUE.equals(t)&&(t=Fi.MAXIMUM_VALUE),new Ke({start:e,stop:t})},$t.prototype.add=function(e){if(!h(e))throw new C("entity is required.");e instanceof an||(e=new an(e));const t=e.id,n=this._entities;if(n.contains(t))throw new C(`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($t.prototype._onEntityDefinitionChanged,this),Kr(this),e},$t.prototype.remove=function(e){return h(e)?this.removeById(e.id):!1},$t.prototype.contains=function(e){if(!h(e))throw new C("entity is required");return this._entities.get(e.id)===e},$t.prototype.removeById=function(e){if(!h(e))return!1;const n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener($t.prototype._onEntityDefinitionChanged,this),Kr(this),!0):!1},$t.prototype.removeAll=function(){const e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let s=0;s<t;s++){const a=n[s],c=a.id,l=i.get(c);h(l)||(a.definitionChanged.removeEventListener($t.prototype._onEntityDefinitionChanged,this),o.set(c,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Kr(this)},$t.prototype.getById=function(e){if(!h(e))throw new C("id is required.");return this._entities.get(e)},$t.prototype.getOrCreateEntity=function(e){if(!h(e))throw new C("id is required.");let t=this._entities.get(e);return h(t)||(Km.id=e,t=new an(Km),this.add(t)),t},$t.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Kr(this)};function ba(){C.throwInstantiationError()}Object.defineProperties(ba.prototype,{name:{get:C.throwInstantiationError},clock:{get:C.throwInstantiationError},entities:{get:C.throwInstantiationError},isLoading:{get:C.throwInstantiationError},changedEvent:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},loadingEvent:{get:C.throwInstantiationError},show:{get:C.throwInstantiationError},clustering:{get:C.throwInstantiationError}}),ba.prototype.update=function(e){C.throwInstantiationError()},ba.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};function oi(e,t){m.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new f,this._cameraPositionInScaledSpace=new f,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(oi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=f.magnitudeSquared(n)-1;f.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});const Qm=new f;oi.prototype.isPointVisible=function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,Qm);return $l(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},oi.prototype.isScaledSpacePointVisible=function(e){return $l(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const Z1=new f;oi.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,o;return h(t)&&t<0&&n.minimumRadius>-t?(o=Z1,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),$l(e,o,i)},oi.prototype.computeHorizonCullingPoint=function(e,t,n){return t0(this._ellipsoid,e,t,n)};const Jm=le.clone(le.UNIT_SPHERE);oi.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){const o=e0(this._ellipsoid,n,Jm);return t0(o,e,t,i)},oi.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return n0(this._ellipsoid,e,t,n,i,o)},oi.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,s){const a=e0(this._ellipsoid,o,Jm);return n0(a,e,t,n,i,s)};const K1=[];oi.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){m.typeOf.object("rectangle",e);const i=ce.subsample(e,t,0,K1),o=K.fromPoints(i);if(!(f.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};const Q1=new f;function e0(e,t,n){if(h(t)&&t<0&&e.minimumRadius>-t){const i=f.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,Q1);e=le.fromCartesian3(i,n)}return e}function t0(e,t,n,i){m.typeOf.object("directionToPoint",t),m.defined("positions",n),h(i)||(i=new f);const o=r0(e,t);let s=0;for(let a=0,c=n.length;a<c;++a){const l=n[a],u=i0(e,l,o);if(u<0)return;s=Math.max(s,u)}return o0(o,s,i)}const wa=new f;function n0(e,t,n,i,o,s){m.typeOf.object("directionToPoint",t),m.defined("vertices",n),m.typeOf.number("stride",i),h(s)||(s=new f),i=_(i,3),o=_(o,f.ZERO);const a=r0(e,t);let c=0;for(let l=0,u=n.length;l<u;l+=i){wa.x=n[l]+o.x,wa.y=n[l+1]+o.y,wa.z=n[l+2]+o.z;const d=i0(e,wa,a);if(d<0)return;c=Math.max(c,d)}return o0(a,c,s)}function $l(e,t,n){const i=t,o=n,s=f.subtract(e,i,Qm),a=-f.dot(s,i);return!(o<0?a>0:a>o&&a*a/f.magnitudeSquared(s)>o)}const J1=new f,eA=new f;function i0(e,t,n){const i=e.transformPositionToScaledSpace(t,J1);let o=f.magnitudeSquared(i),s=Math.sqrt(o);const a=f.divideByScalar(i,s,eA);o=Math.max(1,o),s=Math.max(1,s);const c=f.dot(a,n),l=f.magnitude(f.cross(a,n,a)),u=1/s,d=Math.sqrt(o-1)*u;return 1/(c*u-l*d)}function o0(e,t,n){if(!(t<=0||t===1/0||t!==t))return f.multiplyByScalar(e,t,n)}const Zl=new f;function r0(e,t){return f.equals(t,f.ZERO)?t:(e.transformPositionToScaledSpace(t,Zl),f.normalize(Zl,Zl))}function Ie(e,t){if(e=_(e,_.EMPTY_OBJECT),h(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(h(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=we.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=we.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=rt.clone(o)}this._show=_(e.show,!0),this._position=f.clone(_(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._color=T.clone(_(e.color,T.WHITE)),this._outlineColor=T.clone(_(e.outlineColor,T.TRANSPARENT)),this._outlineWidth=_(e.outlineWidth,0),this._pixelSize=_(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=_(e.disableDepthTestDistance,0),this._id=e.id,this._collection=_(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=_(e.splitDirection,Ou.NONE)}const s0=Ie.SHOW_INDEX=0,a0=Ie.POSITION_INDEX=1,tA=Ie.COLOR_INDEX=2,nA=Ie.OUTLINE_COLOR_INDEX=3,iA=Ie.OUTLINE_WIDTH_INDEX=4,oA=Ie.PIXEL_SIZE_INDEX=5,rA=Ie.SCALE_BY_DISTANCE_INDEX=6,sA=Ie.TRANSLUCENCY_BY_DISTANCE_INDEX=7,aA=Ie.DISTANCE_DISPLAY_CONDITION_INDEX=8,cA=Ie.DISABLE_DEPTH_DISTANCE_INDEX=9,lA=Ie.SPLIT_DIRECTION_INDEX=10;Ie.NUMBER_OF_PROPERTIES=11;function mn(e,t){const n=e._pointPrimitiveCollection;h(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Ie.prototype,{show:{get:function(){return this._show},set:function(e){if(!h(e))throw new C("value is required.");this._show!==e&&(this._show=e,mn(this,s0))}},position:{get:function(){return this._position},set:function(e){if(!h(e))throw new C("value is required.");const t=this._position;f.equals(t,e)||(f.clone(e,t),f.clone(e,this._actualPosition),mn(this,a0))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;we.equals(t,e)||(this._scaleByDistance=we.clone(e,t),mn(this,rA))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;we.equals(t,e)||(this._translucencyByDistance=we.clone(e,t),mn(this,sA))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!h(e))throw new C("value is required.");this._pixelSize!==e&&(this._pixelSize=e,mn(this,oA))}},color:{get:function(){return this._color},set:function(e){if(!h(e))throw new C("value is required.");const t=this._color;T.equals(t,e)||(T.clone(e,t),mn(this,tA))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;T.equals(t,e)||(T.clone(e,t),mn(this,nA))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!h(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,mn(this,iA))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far must be greater than near");rt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=rt.clone(e,this._distanceDisplayCondition),mn(this,aA))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!h(e)||e<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,mn(this,cA)}}},id:{get:function(){return this._id},set:function(e){this._id=e,h(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,mn(this,s0))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,mn(this,lA))}}}),Ie.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},Ie.prototype._getActualPosition=function(){return this._actualPosition},Ie.prototype._setActualPosition=function(e){f.clone(e,this._actualPosition),mn(this,a0)};const c0=new Y;Ie._computeActualPosition=function(e,t,n){return t.mode===me.SCENE3D?e:(N.multiplyByPoint(n,e,c0),At.computeActualEllipsoidPosition(t,c0))};const l0=new Y;Ie._computeScreenSpacePosition=function(e,t,n,i){const o=N.multiplyByVector(e,Y.fromElements(t.x,t.y,t.z,1,l0),l0);return At.worldToWindowCoordinates(n,o,i)},Ie.prototype.computeScreenSpacePosition=function(e,t){const n=this._pointPrimitiveCollection;if(h(t)||(t=new U),!h(n))throw new C("PointPrimitive must be in a collection.");if(!h(e))throw new C("scene is required.");const i=n.modelMatrix,o=Ie._computeScreenSpacePosition(i,this._actualPosition,e,t);if(h(o))return o.y=e.canvas.clientHeight-o.y,o},Ie.getScreenSpaceBoundingBox=function(e,t,n){const i=e.pixelSize,o=i*.5,s=t.x-o,a=t.y-o,c=i,l=i;return h(n)||(n=new Ce),n.x=s,n.y=a,n.width=c,n.height=l,n},Ie.prototype.equals=function(e){return this===e||h(e)&&this._id===e._id&&f.equals(this._position,e._position)&&T.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&T.equals(this._outlineColor,e._outlineColor)&&we.equals(this._scaleByDistance,e._scaleByDistance)&&we.equals(this._translucencyByDistance,e._translucencyByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},Ie.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};const Ta=`in vec4 v_color;
6352
+ `).join("").length>0&&(D===In.CENTER?B=-a/2-x.x:D===In.RIGHT?B=-(a+x.x*2):B=0,et.x=B*b,A===Je.TOP?et.y=E-u-l:A===Je.CENTER?et.y=(E-u)/2-l:A===Je.BASELINE?et.y=-x.y-l:et.y=0,et.y=et.y*b,y.width=P,y.height=V,y._setTranslate(et),y._labelTranslate=U.clone(et,y._labelTranslate)),$s(e.heightReference))for(p=0;p<g;++p){i=t[p];const j=i.billboard;h(j)&&(j._labelTranslate=U.clone(et,j._labelTranslate))}}function Zm(e,t){const n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Xl(e,n[i]);h(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,h(t._removeCallbackFunc)&&t._removeCallbackFunc(),Qe(t)}function Mn(e){e=_(e,_.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Jt({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Jt({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=T.clone(T.WHITE),this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ft.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Mn.prototype,{length:{get:function(){return this._labels.length}}}),Mn.prototype.add=function(e){const t=new Ln(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},Mn.prototype.remove=function(e){if(h(e)&&e._labelCollection===this){const t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Zm(this,e),!0}return!1},Mn.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)Zm(this,e[t]);e.length=0},Mn.prototype.contains=function(e){return h(e)&&e._labelCollection===this},Mn.prototype.get=function(e){if(!h(e))throw new C("index is required.");return this._labels[e]},Mn.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;h(this._textureAtlas)||(this._textureAtlas=new ni({context:i}),t.textureAtlas=this._textureAtlas),h(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new ni({context:i,initialSize:Yl}),n.textureAtlas=this._backgroundTextureAtlas,q1(this._backgroundTextureAtlas));const o=this._labelsToUpdate.length;for(let a=0;a<o;++a){const c=this._labelsToUpdate[a];if(c.isDestroyed())continue;const l=c._glyphs.length;c._rebindAllGlyphs&&(Y1(this,c),c._rebindAllGlyphs=!1),c._repositionAllGlyphs&&($1(c),c._repositionAllGlyphs=!1);const u=c._glyphs.length-l;this._totalGlyphCount+=u}const s=n.length>0?ft.TRANSLUCENT:this.blendOption;t.blendOption=s,n.blendOption=s,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)},Mn.prototype.isDestroyed=function(){return!1},Mn.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(),Qe(this)};const Km={id:void 0};function Kr(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){const t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;const o=t.values.slice(0),s=n.values.slice(0),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,s,a)}while(e._refire);e._firing=!1}}}function $t(e){this._owner=e,this._entities=new Zn,this._addedEntities=new Zn,this._removedEntities=new Zn,this._changedEntities=new Zn,this._suspendCount=0,this._collectionChanged=new Pe,this._id=Vn(),this._show=!0,this._firing=!1,this._refire=!1}$t.prototype.suspendEvents=function(){this._suspendCount++},$t.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,Kr(this)},Object.defineProperties($t.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(!h(e))throw new C("value is required.");if(e===this._show)return;this.suspendEvents();let t;const n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){const s=n[t],a=i[t];s!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,s)}this.resumeEvents()}},owner:{get:function(){return this._owner}}}),$t.prototype.computeAvailability=function(){let e=Li.MAXIMUM_VALUE,t=Li.MINIMUM_VALUE;const n=this._entities.values;for(let i=0,o=n.length;i<o;i++){const a=n[i].availability;if(h(a)){const c=a.start,l=a.stop;$.lessThan(c,e)&&!c.equals(Li.MINIMUM_VALUE)&&(e=c),$.greaterThan(l,t)&&!l.equals(Li.MAXIMUM_VALUE)&&(t=l)}}return Li.MAXIMUM_VALUE.equals(e)&&(e=Li.MINIMUM_VALUE),Li.MINIMUM_VALUE.equals(t)&&(t=Li.MAXIMUM_VALUE),new Ke({start:e,stop:t})},$t.prototype.add=function(e){if(!h(e))throw new C("entity is required.");e instanceof an||(e=new an(e));const t=e.id,n=this._entities;if(n.contains(t))throw new C(`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($t.prototype._onEntityDefinitionChanged,this),Kr(this),e},$t.prototype.remove=function(e){return h(e)?this.removeById(e.id):!1},$t.prototype.contains=function(e){if(!h(e))throw new C("entity is required");return this._entities.get(e.id)===e},$t.prototype.removeById=function(e){if(!h(e))return!1;const n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener($t.prototype._onEntityDefinitionChanged,this),Kr(this),!0):!1},$t.prototype.removeAll=function(){const e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let s=0;s<t;s++){const a=n[s],c=a.id,l=i.get(c);h(l)||(a.definitionChanged.removeEventListener($t.prototype._onEntityDefinitionChanged,this),o.set(c,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Kr(this)},$t.prototype.getById=function(e){if(!h(e))throw new C("id is required.");return this._entities.get(e)},$t.prototype.getOrCreateEntity=function(e){if(!h(e))throw new C("id is required.");let t=this._entities.get(e);return h(t)||(Km.id=e,t=new an(Km),this.add(t)),t},$t.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Kr(this)};function ba(){C.throwInstantiationError()}Object.defineProperties(ba.prototype,{name:{get:C.throwInstantiationError},clock:{get:C.throwInstantiationError},entities:{get:C.throwInstantiationError},isLoading:{get:C.throwInstantiationError},changedEvent:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},loadingEvent:{get:C.throwInstantiationError},show:{get:C.throwInstantiationError},clustering:{get:C.throwInstantiationError}}),ba.prototype.update=function(e){C.throwInstantiationError()},ba.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};function oi(e,t){m.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new f,this._cameraPositionInScaledSpace=new f,this._distanceToLimbInScaledSpaceSquared=0,h(t)&&(this.cameraPosition=t)}Object.defineProperties(oi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=f.magnitudeSquared(n)-1;f.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});const Qm=new f;oi.prototype.isPointVisible=function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,Qm);return $l(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},oi.prototype.isScaledSpacePointVisible=function(e){return $l(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const Z1=new f;oi.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,o;return h(t)&&t<0&&n.minimumRadius>-t?(o=Z1,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),$l(e,o,i)},oi.prototype.computeHorizonCullingPoint=function(e,t,n){return t0(this._ellipsoid,e,t,n)};const Jm=le.clone(le.UNIT_SPHERE);oi.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){const o=e0(this._ellipsoid,n,Jm);return t0(o,e,t,i)},oi.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return n0(this._ellipsoid,e,t,n,i,o)},oi.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,s){const a=e0(this._ellipsoid,o,Jm);return n0(a,e,t,n,i,s)};const K1=[];oi.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){m.typeOf.object("rectangle",e);const i=ce.subsample(e,t,0,K1),o=K.fromPoints(i);if(!(f.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};const Q1=new f;function e0(e,t,n){if(h(t)&&t<0&&e.minimumRadius>-t){const i=f.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,Q1);e=le.fromCartesian3(i,n)}return e}function t0(e,t,n,i){m.typeOf.object("directionToPoint",t),m.defined("positions",n),h(i)||(i=new f);const o=r0(e,t);let s=0;for(let a=0,c=n.length;a<c;++a){const l=n[a],u=i0(e,l,o);if(u<0)return;s=Math.max(s,u)}return o0(o,s,i)}const wa=new f;function n0(e,t,n,i,o,s){m.typeOf.object("directionToPoint",t),m.defined("vertices",n),m.typeOf.number("stride",i),h(s)||(s=new f),i=_(i,3),o=_(o,f.ZERO);const a=r0(e,t);let c=0;for(let l=0,u=n.length;l<u;l+=i){wa.x=n[l]+o.x,wa.y=n[l+1]+o.y,wa.z=n[l+2]+o.z;const d=i0(e,wa,a);if(d<0)return;c=Math.max(c,d)}return o0(a,c,s)}function $l(e,t,n){const i=t,o=n,s=f.subtract(e,i,Qm),a=-f.dot(s,i);return!(o<0?a>0:a>o&&a*a/f.magnitudeSquared(s)>o)}const J1=new f,eA=new f;function i0(e,t,n){const i=e.transformPositionToScaledSpace(t,J1);let o=f.magnitudeSquared(i),s=Math.sqrt(o);const a=f.divideByScalar(i,s,eA);o=Math.max(1,o),s=Math.max(1,s);const c=f.dot(a,n),l=f.magnitude(f.cross(a,n,a)),u=1/s,d=Math.sqrt(o-1)*u;return 1/(c*u-l*d)}function o0(e,t,n){if(!(t<=0||t===1/0||t!==t))return f.multiplyByScalar(e,t,n)}const Zl=new f;function r0(e,t){return f.equals(t,f.ZERO)?t:(e.transformPositionToScaledSpace(t,Zl),f.normalize(Zl,Zl))}function Ie(e,t){if(e=_(e,_.EMPTY_OBJECT),h(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(h(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=we.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=we.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=rt.clone(o)}this._show=_(e.show,!0),this._position=f.clone(_(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._color=T.clone(_(e.color,T.WHITE)),this._outlineColor=T.clone(_(e.outlineColor,T.TRANSPARENT)),this._outlineWidth=_(e.outlineWidth,0),this._pixelSize=_(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=_(e.disableDepthTestDistance,0),this._id=e.id,this._collection=_(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=_(e.splitDirection,Ou.NONE)}const s0=Ie.SHOW_INDEX=0,a0=Ie.POSITION_INDEX=1,tA=Ie.COLOR_INDEX=2,nA=Ie.OUTLINE_COLOR_INDEX=3,iA=Ie.OUTLINE_WIDTH_INDEX=4,oA=Ie.PIXEL_SIZE_INDEX=5,rA=Ie.SCALE_BY_DISTANCE_INDEX=6,sA=Ie.TRANSLUCENCY_BY_DISTANCE_INDEX=7,aA=Ie.DISTANCE_DISPLAY_CONDITION_INDEX=8,cA=Ie.DISABLE_DEPTH_DISTANCE_INDEX=9,lA=Ie.SPLIT_DIRECTION_INDEX=10;Ie.NUMBER_OF_PROPERTIES=11;function mn(e,t){const n=e._pointPrimitiveCollection;h(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Ie.prototype,{show:{get:function(){return this._show},set:function(e){if(!h(e))throw new C("value is required.");this._show!==e&&(this._show=e,mn(this,s0))}},position:{get:function(){return this._position},set:function(e){if(!h(e))throw new C("value is required.");const t=this._position;f.equals(t,e)||(f.clone(e,t),f.clone(e,this._actualPosition),mn(this,a0))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._scaleByDistance;we.equals(t,e)||(this._scaleByDistance=we.clone(e,t),mn(this,rA))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");const t=this._translucencyByDistance;we.equals(t,e)||(this._translucencyByDistance=we.clone(e,t),mn(this,sA))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!h(e))throw new C("value is required.");this._pixelSize!==e&&(this._pixelSize=e,mn(this,oA))}},color:{get:function(){return this._color},set:function(e){if(!h(e))throw new C("value is required.");const t=this._color;T.equals(t,e)||(T.clone(e,t),mn(this,tA))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;T.equals(t,e)||(T.clone(e,t),mn(this,nA))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!h(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,mn(this,iA))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(h(e)&&e.far<=e.near)throw new C("far must be greater than near");rt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=rt.clone(e,this._distanceDisplayCondition),mn(this,aA))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!h(e)||e<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,mn(this,cA)}}},id:{get:function(){return this._id},set:function(e){this._id=e,h(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,mn(this,s0))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,mn(this,lA))}}}),Ie.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},Ie.prototype._getActualPosition=function(){return this._actualPosition},Ie.prototype._setActualPosition=function(e){f.clone(e,this._actualPosition),mn(this,a0)};const c0=new Y;Ie._computeActualPosition=function(e,t,n){return t.mode===me.SCENE3D?e:(N.multiplyByPoint(n,e,c0),At.computeActualEllipsoidPosition(t,c0))};const l0=new Y;Ie._computeScreenSpacePosition=function(e,t,n,i){const o=N.multiplyByVector(e,Y.fromElements(t.x,t.y,t.z,1,l0),l0);return At.worldToWindowCoordinates(n,o,i)},Ie.prototype.computeScreenSpacePosition=function(e,t){const n=this._pointPrimitiveCollection;if(h(t)||(t=new U),!h(n))throw new C("PointPrimitive must be in a collection.");if(!h(e))throw new C("scene is required.");const i=n.modelMatrix,o=Ie._computeScreenSpacePosition(i,this._actualPosition,e,t);if(h(o))return o.y=e.canvas.clientHeight-o.y,o},Ie.getScreenSpaceBoundingBox=function(e,t,n){const i=e.pixelSize,o=i*.5,s=t.x-o,a=t.y-o,c=i,l=i;return h(n)||(n=new Ce),n.x=s,n.y=a,n.width=c,n.height=l,n},Ie.prototype.equals=function(e){return this===e||h(e)&&this._id===e._id&&f.equals(this._position,e._position)&&T.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&T.equals(this._outlineColor,e._outlineColor)&&we.equals(this._scaleByDistance,e._scaleByDistance)&&we.equals(this._translucencyByDistance,e._translucencyByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},Ie.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};const Ta=`in vec4 v_color;
6353
6353
  in vec4 v_outlineColor;
6354
6354
  in float v_innerPercent;
6355
6355
  in float v_pixelDistance;
@@ -6581,4 +6581,4 @@ void main()
6581
6581
  v_pickColor = pickColor;
6582
6582
  v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
6583
6583
  }
6584
- `,fA=Ie.SHOW_INDEX,Kl=Ie.POSITION_INDEX,h0=Ie.COLOR_INDEX,uA=Ie.OUTLINE_COLOR_INDEX,dA=Ie.OUTLINE_WIDTH_INDEX,pA=Ie.PIXEL_SIZE_INDEX,f0=Ie.SCALE_BY_DISTANCE_INDEX,u0=Ie.TRANSLUCENCY_BY_DISTANCE_INDEX,d0=Ie.DISTANCE_DISPLAY_CONDITION_INDEX,mA=Ie.DISABLE_DEPTH_DISTANCE_INDEX,_A=Ie.SPLIT_DIRECTION_INDEX,Ql=Ie.NUMBER_OF_PROPERTIES,Zt={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function _n(e){e=_(e,_.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(Ql),this._maxPixelSize=1,this._baseVolume=new K,this._baseVolumeWC=new K,this._baseVolume2D=new K,this._boundingVolume=new K,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ft.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=me.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(_n.prototype,{length:{get:function(){return Jl(this),this._pointPrimitives.length}}});function p0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}_n.prototype.add=function(e){const t=new Ie(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},_n.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},_n.prototype.removeAll=function(){p0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Jl(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let o=0,s=0;o<i;++o){const a=n[o];a&&(a._index=s++,t.push(a))}e._pointPrimitives=t}}_n.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},_n.prototype.contains=function(e){return h(e)&&e._pointPrimitiveCollection===this},_n.prototype.get=function(e){if(!h(e))throw new C("index is required.");return Jl(this),this._pointPrimitives[e]},_n.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Ql;++i){const o=n[i]===0?De.STATIC_DRAW:De.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function gA(e,t,n){return new Tt(e,[{index:Zt.positionHighAndSize,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Kl]},{index:Zt.positionLowAndShow,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Kl]},{index:Zt.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[h0]},{index:Zt.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[u0]},{index:Zt.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[f0]},{index:Zt.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[d0]}],t)}const eh=new Ye;function m0(e,t,n,i){const o=i._index,s=i._getActualPosition();e._mode===me.SCENE3D&&(K.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),Ye.fromCartesian(s,eh);const a=i.pixelSize,c=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+c);const l=n[Zt.positionHighAndSize],u=eh.high;l(o,u.x,u.y,u.z,a);const d=n[Zt.positionLowAndOutline],p=eh.low;d(o,p.x,p.y,p.z,c)}const Sa=65536,Qr=256;function _0(e,t,n,i){const o=i._index,s=i.color,a=i.getPickId(t).color,c=i.outlineColor;let l=T.floatToByte(s.red),u=T.floatToByte(s.green),d=T.floatToByte(s.blue);const p=l*Sa+u*Qr+d;l=T.floatToByte(c.red),u=T.floatToByte(c.green),d=T.floatToByte(c.blue);const g=l*Sa+u*Qr+d;l=T.floatToByte(a.red),u=T.floatToByte(a.green),d=T.floatToByte(a.blue);const y=l*Sa+u*Qr+d,x=T.floatToByte(s.alpha)*Sa+T.floatToByte(c.alpha)*Qr+T.floatToByte(a.alpha),E=n[Zt.compressedAttribute0];E(o,p,g,y,x)}function g0(e,t,n,i){const o=i._index;let s=0,a=1,c=1,l=1;const u=i.translucencyByDistance;h(u)&&(s=u.near,a=u.nearValue,c=u.far,l=u.farValue,(a!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(d=!1),a=S.clamp(a,0,1),a=a===1?255:a*255|0;const p=(d?1:0)*Qr+a;l=S.clamp(l,0,1),l=l===1?255:l*255|0;const g=l,y=n[Zt.compressedAttribute1];y(o,p,g,s,c)}function y0(e,t,n,i){const o=i._index,s=n[Zt.scaleByDistance];let a=0,c=1,l=1,u=1;const d=i.scaleByDistance;h(d)&&(a=d.near,c=d.nearValue,l=d.far,u=d.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),s(o,a,c,l,u)}function x0(e,t,n,i){const o=i._index,s=n[Zt.distanceDisplayConditionAndDisableDepthAndSplitDirection];let a=0,c=Number.MAX_VALUE;const l=i.distanceDisplayCondition;h(l)&&(a=l.near,c=l.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let d=0;const p=i.splitDirection;h(p)&&(d=p),s(o,a,c,u,d)}function yA(e,t,n,i){m0(e,t,n,i),_0(e,t,n,i),g0(e,t,n,i),y0(e,t,n,i),x0(e,t,n,i)}function th(e,t,n,i,o,s){let a;i.mode===me.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const c=[];for(let l=0;l<n;++l){const u=t[l],d=u.position,p=Ie._computeActualPosition(d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function xA(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==me.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===me.SCENE3D||n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&th(e,i,i.length,t,s,!0)):n===me.MORPHING?th(e,i,i.length,t,s,!0):(n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&th(e,o,e._pointPrimitivesToUpdateIndex,t,s,!1)}function CA(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const EA=[];_n.prototype.update=function(e){if(Jl(this),!this.show)return;this._maxTotalPointSize=Ee.maximumAliasedPointSize,xA(this,e);const n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,s=this._propertiesChanged,a=this._createVertexArray;let c;const l=e.context,u=e.passes,d=u.pick;if(a||!d&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<Ql;++B)s[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=gA(l,n,this._buffersUsage),c=this._vaf.writers;for(let B=0;B<n;++B){const M=this._pointPrimitives[B];M._dirty=!1,yA(this,l,c,M)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=EA;B.length=0,(s[Kl]||s[dA]||s[pA])&&B.push(m0),(s[h0]||s[uA])&&B.push(_0),(s[fA]||s[u0])&&B.push(g0),s[f0]&&B.push(y0),(s[d0]||s[mA]||s[_A])&&B.push(x0);const M=B.length;if(c=this._vaf.writers,o/n>.1){for(let q=0;q<o;++q){const P=i[q];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P)}this._vaf.commit()}else{for(let q=0;q<o;++q){const P=i[q];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!h(this._vaf)||!h(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,K.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let p,g=N.IDENTITY;e.mode===me.SCENE3D?(g=this.modelMatrix,p=K.clone(this._baseVolumeWC,this._boundingVolume)):p=K.clone(this._baseVolume2D,this._boundingVolume),CA(this,e,p);const y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===ft.OPAQUE||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ft.TRANSLUCENT||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:to.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,E;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(x=new ye({sources:[hA]}),this._shaderScaleByDistance&&x.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&x.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&x.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&x.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===ft.OPAQUE_AND_TRANSLUCENT&&(E=new ye({defines:["OPAQUE"],sources:[Ta]}),this._sp=ot.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt}),E=new ye({defines:["TRANSLUCENT"],sources:[Ta]}),this._spTranslucent=ot.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._blendOption===ft.OPAQUE&&(E=new ye({sources:[Ta]}),this._sp=ot.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._blendOption===ft.TRANSLUCENT&&(E=new ye({sources:[Ta]}),this._spTranslucent=ot.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,D,A,O;const I=e.commandList;if(u.render||d){const B=this._colorCommands,M=this._blendOption===ft.OPAQUE,q=this._blendOption===ft.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,D=b.length,B.length=D;const P=q?D*2:D;for(O=0;O<P;++O){const V=M||q&&O%2===0;A=B[O],h(A)||(A=B[O]=new $e),A.primitiveType=qe.POINTS,A.pass=V||!q?Pt.OPAQUE:Pt.TRANSLUCENT,A.owner=this;const k=q?Math.floor(O/2):O;A.boundingVolume=p,A.modelMatrix=g,A.shaderProgram=V?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=b[k].va,A.renderState=V?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",I.push(A)}}},_n.prototype.isDestroyed=function(){return!1},_n.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(),p0(this._pointPrimitives),Qe(this)};const C0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],nh=1,Jr=8;class ih{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=i>>4;if(o!==nh)throw new Error(`Got v${o} data when expected v${nh}.`);const s=C0[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new ih(c,a,s,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const s=C0.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Jr,t),this.coords=new this.ArrayType(this.data,Jr+c+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Jr+a+c+l),this.ids=new this.IndexArrayType(this.data,Jr,t),this.coords=new this.ArrayType(this.data,Jr+c+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(nh<<4)+s]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return oh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:a,nodeSize:c}=this,l=[0,s.length-1,0],u=[];for(;l.length;){const d=l.pop()||0,p=l.pop()||0,g=l.pop()||0;if(p-g<=c){for(let b=g;b<=p;b++){const D=a[2*b],A=a[2*b+1];D>=t&&D<=i&&A>=n&&A<=o&&u.push(s[b])}continue}const y=g+p>>1,x=a[2*y],E=a[2*y+1];x>=t&&x<=i&&E>=n&&E<=o&&u.push(s[y]),(d===0?t<=x:n<=E)&&(l.push(g),l.push(y-1),l.push(1-d)),(d===0?i>=x:o>=E)&&(l.push(y+1),l.push(p),l.push(1-d))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],l=[],u=i*i;for(;c.length;){const d=c.pop()||0,p=c.pop()||0,g=c.pop()||0;if(p-g<=a){for(let b=g;b<=p;b++)b0(s[2*b],s[2*b+1],t,n)<=u&&l.push(o[b]);continue}const y=g+p>>1,x=s[2*y],E=s[2*y+1];b0(x,E,t,n)<=u&&l.push(o[y]),(d===0?t-i<=x:n-i<=E)&&(c.push(g),c.push(y-1),c.push(1-d)),(d===0?t+i>=x:n+i>=E)&&(c.push(y+1),c.push(p),c.push(1-d))}return l}}function oh(e,t,n,i,o,s){if(o-i<=n)return;const a=i+o>>1;E0(e,t,a,i,o,s),oh(e,t,n,i,a-1,1-s),oh(e,t,n,a+1,o,1-s)}function E0(e,t,n,i,o,s){for(;o>i;){if(o-i>600){const u=o-i+1,d=n-i+1,p=Math.log(u),g=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*g*(u-g)/u)*(d-u/2<0?-1:1),x=Math.max(i,Math.floor(n-d*g/u+y)),E=Math.min(o,Math.floor(n+(u-d)*g/u+y));E0(e,t,n,x,E,s)}const a=t[2*n+s];let c=i,l=o;for(es(e,t,i,n),t[2*o+s]>a&&es(e,t,i,o);c<l;){for(es(e,t,c,l),c++,l--;t[2*c+s]<a;)c++;for(;t[2*l+s]>a;)l--}t[2*i+s]===a?es(e,t,i,l):(l++,es(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function es(e,t,n,i){rh(e,n,i),rh(t,2*n,2*i),rh(t,2*n+1,2*i+1)}function rh(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function b0(e,t,n,i){const o=e-n,s=t-i;return o*o+s*s}function Un(e){e=_(e,_.EMPTY_OBJECT),this._enabled=_(e.enabled,!1),this._pixelRange=_(e.pixelRange,80),this._minimumClusterSize=_(e.minimumClusterSize,2),this._clusterBillboards=_(e.clusterBillboards,!0),this._clusterLabels=_(e.clusterLabels,!0),this._clusterPoints=_(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 Pe,this.show=_(e.show,!0)}function w0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const bA=new Ce;function T0(e,t,n,i,o){if(h(e._labelCollection)&&i._clusterLabels?o=Ln.getScreenSpaceBoundingBox(e,t,o):h(e._billboardCollection)&&i._clusterBillboards?o=fe.getScreenSpaceBoundingBox(e,t,o):h(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ie.getScreenSpaceBoundingBox(e,t,o)),w0(o,n),i._clusterLabels&&!h(e._labelCollection)&&h(e.id)&&A0(i,e.id.id)&&h(e.id._label)){const s=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(s),c=Ln.getScreenSpaceBoundingBox(a,t,bA);w0(c,n),o=Ce.union(o,c,o)}return o}function wA(e,t){if(e.clusterShow=!0,!h(e._labelCollection)&&h(e.id)&&A0(t,e.id.id)&&h(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function S0(e,t,n,i){const o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function A0(e,t){return h(e)&&h(e._collectionIndicesByEntity[t])&&h(e._collectionIndicesByEntity[t].labelIndex)}function sh(e,t,n,i,o){if(!h(e))return;const s=e.length;for(let a=0;a<s;++a){const c=e.get(a);if(c.clusterShow=!1,!c.show||o._scene.mode===me.SCENE3D&&!i.isPointVisible(c.position))continue;const l=o._clusterLabels&&h(c._labelCollection),u=o._clusterBillboards&&h(c.id._billboard),d=o._clusterPoints&&h(c.id._point);if(l&&(d||u))continue;const p=c.computeScreenSpacePosition(n);h(p)&&t.push({index:a,collection:e,clustered:!1,coord:p})}}const TA=new Ce,SA=new Ce,AA=new Ce;function DA(e){return function(t){if(h(t)&&t<.05||!e.enabled)return;const n=e._scene,i=e._labelCollection,o=e._billboardCollection,s=e._pointCollection;if(!h(i)&&!h(o)&&!h(s)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let a=e._clusterLabelCollection,c=e._clusterBillboardCollection,l=e._clusterPointCollection;h(a)?a.removeAll():a=e._clusterLabelCollection=new Mn({scene:n}),h(c)?c.removeAll():c=e._clusterBillboardCollection=new Jt({scene:n}),h(l)?l.removeAll():l=e._clusterPointCollection=new _n;const u=e._pixelRange,d=e._minimumClusterSize,p=e._previousClusters,g=[],y=e._previousHeight,x=n.camera.positionCartographic.height,E=n.ellipsoid,b=n.camera.positionWC,D=new oi(E,b),A=[];e._clusterLabels&&sh(i,A,n,D,e),e._clusterBillboards&&sh(o,A,n,D,e),e._clusterPoints&&sh(s,A,n,D,e);let O,I,B,M,q,P,V,k,H,j,r,w;if(A.length>0){const v=new ih(A.length,64,Uint32Array);for(let z=0;z<A.length;++z)v.add(A[z].coord.x,A[z].coord.y);if(v.finish(),x<y)for(B=p.length,O=0;O<B;++O){const z=p[O];if(!D.isPointVisible(z.position))continue;const G=fe._computeScreenSpacePosition(N.IDENTITY,z.position,f.ZERO,U.ZERO,n);if(!h(G))continue;const W=1-x/y;let Z=z.width=z.width*W,X=z.height=z.height*W;Z=Math.max(Z,z.minimumWidth),X=Math.max(X,z.minimumHeight);const ie=G.x-Z*.5,se=G.y-X*.5,ge=G.x+Z,be=G.y+X;for(q=v.range(ie,se,ge,be),P=q.length,j=0,H=[],I=0;I<P;++I)V=q[I],k=A[V],k.clustered||(++j,r=k.collection,w=k.index,H.push(r.get(w).id));if(j>=d)for(S0(z.position,j,H,e),g.push(z),I=0;I<P;++I)A[q[I]].clustered=!0}for(B=A.length,O=0;O<B;++O){const z=A[O];if(z.clustered)continue;z.clustered=!0,r=z.collection,w=z.index;const G=r.get(w);M=T0(G,z.coord,u,e,TA);const W=Ce.clone(M,SA);q=v.range(M.x,M.y,M.x+M.width,M.y+M.height),P=q.length;const Z=f.clone(G.position);for(j=1,H=[G.id],I=0;I<P;++I)if(V=q[I],k=A[V],!k.clustered){const X=k.collection.get(k.index),ie=T0(X,k.coord,u,e,AA);f.add(X.position,Z,Z),Ce.union(W,ie,W),++j,H.push(X.id)}if(j>=d){const X=f.multiplyByScalar(Z,1/j,Z);for(S0(X,j,H,e),g.push({position:X,width:W.width,height:W.height,minimumWidth:M.width,minimumHeight:M.height}),I=0;I<P;++I)A[q[I]].clustered=!0}else wA(G,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),c.length===0&&(c.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=g,e._previousHeight=x}}Un.prototype._initialize=function(e){this._scene=e;const t=DA(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(Un.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}}});function ah(e,t,n,i){return function(o){let s=this[e];h(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(h(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),h(s)&&h(a[i]))return s.get(a[i]);h(s)||(s=this[e]=new t({scene:this._scene}));let c,l;const u=this[n];u.length>0?(c=u.shift(),l=s.get(c)):(l=s.add(),c=s.length-1),a[i]=c;const d=this;return Promise.resolve().then(function(){d._clusterDirty=!0}),l}}function ch(e,t){const n=e._collectionIndicesByEntity[t];!h(n.billboardIndex)&&!h(n.labelIndex)&&!h(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Un.prototype.getLabel=ah("_labelCollection",Mn,"_unusedLabelIndices","labelIndex"),Un.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._labelCollection)||!h(t)||!h(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,ch(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},Un.prototype.getBillboard=ah("_billboardCollection",Jt,"_unusedBillboardIndices","billboardIndex"),Un.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._billboardCollection)||!h(t)||!h(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,ch(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},Un.prototype.getPoint=ah("_pointCollection",_n,"_unusedPointIndices","pointIndex"),Un.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._pointCollection)||!h(t)||!h(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,ch(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function lh(e){if(!h(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function OA(e){e.enabled||(h(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),h(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),h(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,lh(e._labelCollection),lh(e._billboardCollection),lh(e._pointCollection))}Un.prototype.update=function(e){if(!this.show)return;let t;h(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),h(this._billboardCollection)&&this._billboardCollection.length>0&&!h(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,OA(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),h(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),h(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),h(this._clusterPointCollection)&&this._clusterPointCollection.update(e),h(this._labelCollection)&&this._labelCollection.update(e),h(this._billboardCollection)&&this._billboardCollection.update(e),h(this._pointCollection)&&this._pointCollection.update(e)},Un.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(),h(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};function hh(e){this._name=e,this._clock=void 0,this._changed=new Pe,this._error=new Pe,this._isLoading=!1,this._loading=new Pe,this._entityCollection=new $t(this),this._entityCluster=new Un}Object.defineProperties(hh.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){ba.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(!h(e))throw new C("value must be defined.");this._entityCluster=e}}}),hh.prototype.update=function(e){return!0};function qi(e,t,n=10,i="#ba1919"){return{name:t,label:{text:t,font:"18px sans-serif"},polyline:{show:!0,positions:e,clampToGround:!1,width:n,material:T.fromCssColorString(i),arcType:ei.NONE,shadows:ca.DISABLED}}}function fh(e,t,n,i,o=new lt(0,0,0),s=1){return{id:e,name:n,position:t,orientation:_e.headingPitchRollQuaternion(t,o),model:{show:!0,uri:i,scale:s,heightReference:di.NONE}}}function D0(e,t,n,i,o){n||(n=new lt);const s=_e.headingPitchRollQuaternion(e,n,i,o),a=N.fromRotationTranslation(L.fromQuaternion(s,new L),e,new N);return N.multiplyByPoint(a,t,new f)}function Hi(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...vA(e[i],e[i+1],t*-1e3,100));return n}function vA(e,t,n,i){var o=[],s=ee.fromCartesian(e),a=ee.fromCartesian(t),c=s.longitude*180/Math.PI,l=s.latitude*180/Math.PI,u=a.longitude*180/Math.PI,d=a.latitude*180/Math.PI,p=Math.sqrt((c-u)*(c-u)+(l-d)*(l-d)),g=p*n,y=f.clone(e),x=f.clone(t),E=f.distance(y,f.ZERO),b=f.distance(x,f.ZERO);if(f.normalize(y,y),f.normalize(x,x),f.distance(y,x)==0)return o;var D=f.angleBetween(y,x);o.push(e);for(var A=1;A<i-1;A++){var O=A*1/(i-1),I=1-O,B=Math.sin(I*D)/Math.sin(D),M=Math.sin(O*D)/Math.sin(D),q=f.multiplyByScalar(y,B,new f),P=f.multiplyByScalar(x,M,new f),V=f.add(q,P,new f),k=O*Math.PI,H=E*I+b*O+Math.sin(k)*g;V=f.multiplyByScalar(V,H,V),o.push(V)}return o.push(t),o}class IA{constructor(){he(this,"LineID","myEntity1");he(this,"Tag","");he(this,"towers",[]);he(this,"ISPhaseSequence",!1);he(this,"Type",0);he(this,"wireAColor","#FFFFFF");he(this,"wireBColor","#FFFFFF");he(this,"wireCColor","#FFFFFF");he(this,"wireD1Color","#FFFFFF");he(this,"wireD2Color","#FFFFFF");he(this,"wireWidth",1)}}class RA{constructor(){he(this,"id","");he(this,"name","");he(this,"type",0);he(this,"Longitude",0);he(this,"Latitude",0);he(this,"Altitude",0);he(this,"RollX",0);he(this,"RollY",90);he(this,"RollZ",0);he(this,"towerScale",1);he(this,"towerHeight",42);he(this,"towerModelUri","");he(this,"towerPoint",[]);he(this,"Insulators",[])}}class zA{constructor(){he(this,"id","");he(this,"name","");he(this,"type",0);he(this,"linenum",1);he(this,"Wairnum","");he(this,"PhaseSequence",0);he(this,"RollX",90);he(this,"RollY",0);he(this,"RollZ",0);he(this,"InsulatorScale",1);he(this,"InsulatorLength",0);he(this,"InsulatorModelUri","");he(this,"InsulatorPoint",[])}}class PA{constructor(){he(this,"name","");he(this,"X",-45);he(this,"Y",90);he(this,"Z",0)}}var fo=(e=>(e[e.A相=0]="A相",e[e.B相=1]="B相",e[e.C相=2]="C相",e[e.地线1=3]="地线1",e[e.地线2=4]="地线2",e))(fo||{}),O0=(e=>(e[e.直线塔=0]="直线塔",e[e.耐张塔=1]="耐张塔",e[e.门架塔=2]="门架塔",e[e.换位塔=3]="换位塔",e))(O0||{}),v0=(e=>(e[e.交流单回路=0]="交流单回路",e[e.交流双回路=1]="交流双回路",e[e.直流单回路=2]="直流单回路",e[e.直流双回路=3]="直流双回路",e[e.交流四回路=4]="交流四回路",e))(v0||{}),ts=(e=>(e[e.地线=0]="地线",e[e.回路一=1]="回路一",e[e.回路二=2]="回路二",e[e.回路三=3]="回路三",e[e.回路四=4]="回路四",e))(ts||{}),I0=(e=>(e[e.悬垂串=0]="悬垂串",e[e.耐张串=1]="耐张串",e[e.跳线串=2]="跳线串",e[e.硬跳串=3]="硬跳串",e[e.V串=4]="V串",e[e.地线串=5]="地线串",e[e.绕跳临时=6]="绕跳临时",e))(I0||{});class BA{constructor(t,n,i){he(this,"viewer");he(this,"LineInfo");he(this,"Keym","");he(this,"dataSource2");he(this,"entityCollection2");he(this,"offsetTowers",[]);he(this,"offsetWires11",[]);he(this,"offsetWires12",[]);he(this,"offsetWires13",[]);he(this,"offsetWires21",[]);he(this,"offsetWires22",[]);he(this,"offsetWires23",[]);he(this,"offsetArcWires1A",[]);he(this,"offsetArcWires1B",[]);he(this,"offsetArcWires1C",[]);he(this,"offsetArcWires2A",[]);he(this,"offsetArcWires2B",[]);he(this,"offsetArcWires2C",[]);he(this,"offsetGrouundWires1",[]);he(this,"offsetGrouundWires2",[]);he(this,"offsetGrouundWires11",[]);he(this,"offsetGrouundWires12",[]);this.Keym=i,this.viewer=t,this.LineInfo=n,this.dataSource2=new hh(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities}loadLineTower(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(f.fromDegrees(t.Longitude,t.Latitude,t.Altitude-t.towerHeight))}),this.offsetTowers.forEach((t,n)=>{const i=new lt(S.toRadians(this.LineInfo.towers[n].RollX),S.toRadians(this.LineInfo.towers[n].RollY),S.toRadians(this.LineInfo.towers[n].RollZ));this.entityCollection2.add(fh(this.LineInfo.towers[n].id,t,this.LineInfo.towers[n].name,this.LineInfo.towers[n].towerModelUri,i,this.LineInfo.towers[n].towerScale));let o=new lt(S.toRadians(this.LineInfo.towers[n].RollX),0,0),s=0;this.LineInfo.towers[n].Insulators.forEach(a=>{const c=new lt(S.toRadians(a.RollX),S.toRadians(a.RollY),S.toRadians(a.RollZ)),l=D0(t,new f(this.LineInfo.towers[n].towerPoint[s].X,this.LineInfo.towers[n].towerPoint[s].Y,this.LineInfo.towers[n].towerPoint[s].Z),o);this.entityCollection2.add(fh(a.id,l,a.name,a.InsulatorModelUri,c,a.InsulatorScale));const u=D0(t,new f(a.InsulatorPoint[0].X,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);switch(a.linenum){case ts.回路一:switch(s){case 2:this.offsetWires11.push(u);break;case 3:this.offsetWires12.push(u);break;case 4:this.offsetWires13.push(u);break}break;case ts.回路二:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case fo.A相:debugger;this.offsetWires21.push(u);break;case fo.B相:this.offsetWires22.push(u);break;case fo.C相:this.offsetWires23.push(u);break}else switch(s){case 5:this.offsetWires11.push(u);break;case 6:this.offsetWires12.push(u);break;case 7:this.offsetWires13.push(u);break}break;case ts.地线:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case fo.地线1:this.offsetGrouundWires11.push(u);break;case fo.地线2:this.offsetGrouundWires12.push(u);break}else switch(s){case 0:this.offsetGrouundWires11.push(u);break;case 1:this.offsetGrouundWires12.push(u);break}break}s=s+1})}),this.offsetArcWires1A=Hi(this.offsetWires11),this.offsetArcWires1B=Hi(this.offsetWires12),this.offsetArcWires1C=Hi(this.offsetWires13),this.offsetArcWires2A=Hi(this.offsetWires21),this.offsetArcWires2B=Hi(this.offsetWires22),this.offsetArcWires2C=Hi(this.offsetWires23),this.offsetGrouundWires1=Hi(this.offsetGrouundWires11,2),this.offsetGrouundWires2=Hi(this.offsetGrouundWires12,2),this.entityCollection2.add(qi(this.offsetArcWires1A,"导线A",this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.entityCollection2.add(qi(this.offsetArcWires1B,"导线B",this.LineInfo.wireWidth,this.LineInfo.wireBColor)),this.entityCollection2.add(qi(this.offsetArcWires1C,"导线C",this.LineInfo.wireWidth,this.LineInfo.wireCColor)),this.entityCollection2.add(qi(this.offsetArcWires2A,"导线A2",this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.entityCollection2.add(qi(this.offsetArcWires2B,"导线B2",this.LineInfo.wireWidth,this.LineInfo.wireBColor)),this.entityCollection2.add(qi(this.offsetArcWires2C,"导线C2",this.LineInfo.wireWidth,this.LineInfo.wireCColor)),this.entityCollection2.add(qi(this.offsetGrouundWires1,"地线1",this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.entityCollection2.add(qi(this.offsetGrouundWires2,"地线2",this.LineInfo.wireWidth,this.LineInfo.wireD2Color)))}loadLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setLineVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}pt.GUAPoint=PA,pt.InsulatorInfo=zA,pt.InsulatorType=I0,pt.LineNum=ts,pt.LineType=v0,pt.OWEEgineManager=BA,pt.PhaseSType=fo,pt.TowerInfo=RA,pt.TowerLineInfo=IA,pt.TowerType=O0,pt.drawModel=fh,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})});
6584
+ `,fA=Ie.SHOW_INDEX,Kl=Ie.POSITION_INDEX,h0=Ie.COLOR_INDEX,uA=Ie.OUTLINE_COLOR_INDEX,dA=Ie.OUTLINE_WIDTH_INDEX,pA=Ie.PIXEL_SIZE_INDEX,f0=Ie.SCALE_BY_DISTANCE_INDEX,u0=Ie.TRANSLUCENCY_BY_DISTANCE_INDEX,d0=Ie.DISTANCE_DISPLAY_CONDITION_INDEX,mA=Ie.DISABLE_DEPTH_DISTANCE_INDEX,_A=Ie.SPLIT_DIRECTION_INDEX,Ql=Ie.NUMBER_OF_PROPERTIES,Zt={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function _n(e){e=_(e,_.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(Ql),this._maxPixelSize=1,this._baseVolume=new K,this._baseVolumeWC=new K,this._baseVolume2D=new K,this._boundingVolume=new K,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ft.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=me.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW,De.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(_n.prototype,{length:{get:function(){return Jl(this),this._pointPrimitives.length}}});function p0(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}_n.prototype.add=function(e){const t=new Ie(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},_n.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},_n.prototype.removeAll=function(){p0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Jl(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;const t=[],n=e._pointPrimitives,i=n.length;for(let o=0,s=0;o<i;++o){const a=n[o];a&&(a._index=s++,t.push(a))}e._pointPrimitives=t}}_n.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},_n.prototype.contains=function(e){return h(e)&&e._pointPrimitiveCollection===this},_n.prototype.get=function(e){if(!h(e))throw new C("index is required.");return Jl(this),this._pointPrimitives[e]},_n.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Ql;++i){const o=n[i]===0?De.STATIC_DRAW:De.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function gA(e,t,n){return new Tt(e,[{index:Zt.positionHighAndSize,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Kl]},{index:Zt.positionLowAndShow,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Kl]},{index:Zt.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[h0]},{index:Zt.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[u0]},{index:Zt.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[f0]},{index:Zt.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[d0]}],t)}const eh=new Ye;function m0(e,t,n,i){const o=i._index,s=i._getActualPosition();e._mode===me.SCENE3D&&(K.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),Ye.fromCartesian(s,eh);const a=i.pixelSize,c=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+c);const l=n[Zt.positionHighAndSize],u=eh.high;l(o,u.x,u.y,u.z,a);const d=n[Zt.positionLowAndOutline],p=eh.low;d(o,p.x,p.y,p.z,c)}const Sa=65536,Qr=256;function _0(e,t,n,i){const o=i._index,s=i.color,a=i.getPickId(t).color,c=i.outlineColor;let l=T.floatToByte(s.red),u=T.floatToByte(s.green),d=T.floatToByte(s.blue);const p=l*Sa+u*Qr+d;l=T.floatToByte(c.red),u=T.floatToByte(c.green),d=T.floatToByte(c.blue);const g=l*Sa+u*Qr+d;l=T.floatToByte(a.red),u=T.floatToByte(a.green),d=T.floatToByte(a.blue);const y=l*Sa+u*Qr+d,x=T.floatToByte(s.alpha)*Sa+T.floatToByte(c.alpha)*Qr+T.floatToByte(a.alpha),E=n[Zt.compressedAttribute0];E(o,p,g,y,x)}function g0(e,t,n,i){const o=i._index;let s=0,a=1,c=1,l=1;const u=i.translucencyByDistance;h(u)&&(s=u.near,a=u.nearValue,c=u.far,l=u.farValue,(a!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let d=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(d=!1),a=S.clamp(a,0,1),a=a===1?255:a*255|0;const p=(d?1:0)*Qr+a;l=S.clamp(l,0,1),l=l===1?255:l*255|0;const g=l,y=n[Zt.compressedAttribute1];y(o,p,g,s,c)}function y0(e,t,n,i){const o=i._index,s=n[Zt.scaleByDistance];let a=0,c=1,l=1,u=1;const d=i.scaleByDistance;h(d)&&(a=d.near,c=d.nearValue,l=d.far,u=d.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),s(o,a,c,l,u)}function x0(e,t,n,i){const o=i._index,s=n[Zt.distanceDisplayConditionAndDisableDepthAndSplitDirection];let a=0,c=Number.MAX_VALUE;const l=i.distanceDisplayCondition;h(l)&&(a=l.near,c=l.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let d=0;const p=i.splitDirection;h(p)&&(d=p),s(o,a,c,u,d)}function yA(e,t,n,i){m0(e,t,n,i),_0(e,t,n,i),g0(e,t,n,i),y0(e,t,n,i),x0(e,t,n,i)}function th(e,t,n,i,o,s){let a;i.mode===me.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;const c=[];for(let l=0;l<n;++l){const u=t[l],d=u.position,p=Ie._computeActualPosition(d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function xA(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==me.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===me.SCENE3D||n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&th(e,i,i.length,t,s,!0)):n===me.MORPHING?th(e,i,i.length,t,s,!0):(n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&th(e,o,e._pointPrimitivesToUpdateIndex,t,s,!1)}function CA(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const EA=[];_n.prototype.update=function(e){if(Jl(this),!this.show)return;this._maxTotalPointSize=Ee.maximumAliasedPointSize,xA(this,e);const n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,s=this._propertiesChanged,a=this._createVertexArray;let c;const l=e.context,u=e.passes,d=u.pick;if(a||!d&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let B=0;B<Ql;++B)s[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=gA(l,n,this._buffersUsage),c=this._vaf.writers;for(let B=0;B<n;++B){const M=this._pointPrimitives[B];M._dirty=!1,yA(this,l,c,M)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=EA;B.length=0,(s[Kl]||s[dA]||s[pA])&&B.push(m0),(s[h0]||s[uA])&&B.push(_0),(s[fA]||s[u0])&&B.push(g0),s[f0]&&B.push(y0),(s[d0]||s[mA]||s[_A])&&B.push(x0);const M=B.length;if(c=this._vaf.writers,o/n>.1){for(let q=0;q<o;++q){const P=i[q];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P)}this._vaf.commit()}else{for(let q=0;q<o;++q){const P=i[q];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!h(this._vaf)||!h(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,K.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let p,g=N.IDENTITY;e.mode===me.SCENE3D?(g=this.modelMatrix,p=K.clone(this._baseVolumeWC,this._boundingVolume)):p=K.clone(this._baseVolume2D,this._boundingVolume),CA(this,e,p);const y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===ft.OPAQUE||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ft.TRANSLUCENT||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:no.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,E;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(x=new ye({sources:[hA]}),this._shaderScaleByDistance&&x.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&x.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&x.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&x.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===ft.OPAQUE_AND_TRANSLUCENT&&(E=new ye({defines:["OPAQUE"],sources:[Ta]}),this._sp=ot.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt}),E=new ye({defines:["TRANSLUCENT"],sources:[Ta]}),this._spTranslucent=ot.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._blendOption===ft.OPAQUE&&(E=new ye({sources:[Ta]}),this._sp=ot.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._blendOption===ft.TRANSLUCENT&&(E=new ye({sources:[Ta]}),this._spTranslucent=ot.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,D,A,O;const I=e.commandList;if(u.render||d){const B=this._colorCommands,M=this._blendOption===ft.OPAQUE,q=this._blendOption===ft.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,D=b.length,B.length=D;const P=q?D*2:D;for(O=0;O<P;++O){const V=M||q&&O%2===0;A=B[O],h(A)||(A=B[O]=new $e),A.primitiveType=qe.POINTS,A.pass=V||!q?Pt.OPAQUE:Pt.TRANSLUCENT,A.owner=this;const k=q?Math.floor(O/2):O;A.boundingVolume=p,A.modelMatrix=g,A.shaderProgram=V?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=b[k].va,A.renderState=V?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",I.push(A)}}},_n.prototype.isDestroyed=function(){return!1},_n.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(),p0(this._pointPrimitives),Qe(this)};const C0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],nh=1,Jr=8;class ih{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=i>>4;if(o!==nh)throw new Error(`Got v${o} data when expected v${nh}.`);const s=C0[i&15];if(!s)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[c]=new Uint32Array(t,4,1);return new ih(c,a,s,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const s=C0.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Jr,t),this.coords=new this.ArrayType(this.data,Jr+c+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Jr+a+c+l),this.ids=new this.IndexArrayType(this.data,Jr,t),this.coords=new this.ArrayType(this.data,Jr+c+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(nh<<4)+s]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return oh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:a,nodeSize:c}=this,l=[0,s.length-1,0],u=[];for(;l.length;){const d=l.pop()||0,p=l.pop()||0,g=l.pop()||0;if(p-g<=c){for(let b=g;b<=p;b++){const D=a[2*b],A=a[2*b+1];D>=t&&D<=i&&A>=n&&A<=o&&u.push(s[b])}continue}const y=g+p>>1,x=a[2*y],E=a[2*y+1];x>=t&&x<=i&&E>=n&&E<=o&&u.push(s[y]),(d===0?t<=x:n<=E)&&(l.push(g),l.push(y-1),l.push(1-d)),(d===0?i>=x:o>=E)&&(l.push(y+1),l.push(p),l.push(1-d))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:s,nodeSize:a}=this,c=[0,o.length-1,0],l=[],u=i*i;for(;c.length;){const d=c.pop()||0,p=c.pop()||0,g=c.pop()||0;if(p-g<=a){for(let b=g;b<=p;b++)b0(s[2*b],s[2*b+1],t,n)<=u&&l.push(o[b]);continue}const y=g+p>>1,x=s[2*y],E=s[2*y+1];b0(x,E,t,n)<=u&&l.push(o[y]),(d===0?t-i<=x:n-i<=E)&&(c.push(g),c.push(y-1),c.push(1-d)),(d===0?t+i>=x:n+i>=E)&&(c.push(y+1),c.push(p),c.push(1-d))}return l}}function oh(e,t,n,i,o,s){if(o-i<=n)return;const a=i+o>>1;E0(e,t,a,i,o,s),oh(e,t,n,i,a-1,1-s),oh(e,t,n,a+1,o,1-s)}function E0(e,t,n,i,o,s){for(;o>i;){if(o-i>600){const u=o-i+1,d=n-i+1,p=Math.log(u),g=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*g*(u-g)/u)*(d-u/2<0?-1:1),x=Math.max(i,Math.floor(n-d*g/u+y)),E=Math.min(o,Math.floor(n+(u-d)*g/u+y));E0(e,t,n,x,E,s)}const a=t[2*n+s];let c=i,l=o;for(es(e,t,i,n),t[2*o+s]>a&&es(e,t,i,o);c<l;){for(es(e,t,c,l),c++,l--;t[2*c+s]<a;)c++;for(;t[2*l+s]>a;)l--}t[2*i+s]===a?es(e,t,i,l):(l++,es(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function es(e,t,n,i){rh(e,n,i),rh(t,2*n,2*i),rh(t,2*n+1,2*i+1)}function rh(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function b0(e,t,n,i){const o=e-n,s=t-i;return o*o+s*s}function Un(e){e=_(e,_.EMPTY_OBJECT),this._enabled=_(e.enabled,!1),this._pixelRange=_(e.pixelRange,80),this._minimumClusterSize=_(e.minimumClusterSize,2),this._clusterBillboards=_(e.clusterBillboards,!0),this._clusterLabels=_(e.clusterLabels,!0),this._clusterPoints=_(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 Pe,this.show=_(e.show,!0)}function w0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const bA=new Ce;function T0(e,t,n,i,o){if(h(e._labelCollection)&&i._clusterLabels?o=Ln.getScreenSpaceBoundingBox(e,t,o):h(e._billboardCollection)&&i._clusterBillboards?o=fe.getScreenSpaceBoundingBox(e,t,o):h(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ie.getScreenSpaceBoundingBox(e,t,o)),w0(o,n),i._clusterLabels&&!h(e._labelCollection)&&h(e.id)&&A0(i,e.id.id)&&h(e.id._label)){const s=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(s),c=Ln.getScreenSpaceBoundingBox(a,t,bA);w0(c,n),o=Ce.union(o,c,o)}return o}function wA(e,t){if(e.clusterShow=!0,!h(e._labelCollection)&&h(e.id)&&A0(t,e.id.id)&&h(e.id._label)){const n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function S0(e,t,n,i){const o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function A0(e,t){return h(e)&&h(e._collectionIndicesByEntity[t])&&h(e._collectionIndicesByEntity[t].labelIndex)}function sh(e,t,n,i,o){if(!h(e))return;const s=e.length;for(let a=0;a<s;++a){const c=e.get(a);if(c.clusterShow=!1,!c.show||o._scene.mode===me.SCENE3D&&!i.isPointVisible(c.position))continue;const l=o._clusterLabels&&h(c._labelCollection),u=o._clusterBillboards&&h(c.id._billboard),d=o._clusterPoints&&h(c.id._point);if(l&&(d||u))continue;const p=c.computeScreenSpacePosition(n);h(p)&&t.push({index:a,collection:e,clustered:!1,coord:p})}}const TA=new Ce,SA=new Ce,AA=new Ce;function DA(e){return function(t){if(h(t)&&t<.05||!e.enabled)return;const n=e._scene,i=e._labelCollection,o=e._billboardCollection,s=e._pointCollection;if(!h(i)&&!h(o)&&!h(s)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let a=e._clusterLabelCollection,c=e._clusterBillboardCollection,l=e._clusterPointCollection;h(a)?a.removeAll():a=e._clusterLabelCollection=new Mn({scene:n}),h(c)?c.removeAll():c=e._clusterBillboardCollection=new Jt({scene:n}),h(l)?l.removeAll():l=e._clusterPointCollection=new _n;const u=e._pixelRange,d=e._minimumClusterSize,p=e._previousClusters,g=[],y=e._previousHeight,x=n.camera.positionCartographic.height,E=n.ellipsoid,b=n.camera.positionWC,D=new oi(E,b),A=[];e._clusterLabels&&sh(i,A,n,D,e),e._clusterBillboards&&sh(o,A,n,D,e),e._clusterPoints&&sh(s,A,n,D,e);let O,I,B,M,q,P,V,k,H,j,r,w;if(A.length>0){const v=new ih(A.length,64,Uint32Array);for(let z=0;z<A.length;++z)v.add(A[z].coord.x,A[z].coord.y);if(v.finish(),x<y)for(B=p.length,O=0;O<B;++O){const z=p[O];if(!D.isPointVisible(z.position))continue;const G=fe._computeScreenSpacePosition(N.IDENTITY,z.position,f.ZERO,U.ZERO,n);if(!h(G))continue;const W=1-x/y;let Z=z.width=z.width*W,X=z.height=z.height*W;Z=Math.max(Z,z.minimumWidth),X=Math.max(X,z.minimumHeight);const ie=G.x-Z*.5,se=G.y-X*.5,ge=G.x+Z,be=G.y+X;for(q=v.range(ie,se,ge,be),P=q.length,j=0,H=[],I=0;I<P;++I)V=q[I],k=A[V],k.clustered||(++j,r=k.collection,w=k.index,H.push(r.get(w).id));if(j>=d)for(S0(z.position,j,H,e),g.push(z),I=0;I<P;++I)A[q[I]].clustered=!0}for(B=A.length,O=0;O<B;++O){const z=A[O];if(z.clustered)continue;z.clustered=!0,r=z.collection,w=z.index;const G=r.get(w);M=T0(G,z.coord,u,e,TA);const W=Ce.clone(M,SA);q=v.range(M.x,M.y,M.x+M.width,M.y+M.height),P=q.length;const Z=f.clone(G.position);for(j=1,H=[G.id],I=0;I<P;++I)if(V=q[I],k=A[V],!k.clustered){const X=k.collection.get(k.index),ie=T0(X,k.coord,u,e,AA);f.add(X.position,Z,Z),Ce.union(W,ie,W),++j,H.push(X.id)}if(j>=d){const X=f.multiplyByScalar(Z,1/j,Z);for(S0(X,j,H,e),g.push({position:X,width:W.width,height:W.height,minimumWidth:M.width,minimumHeight:M.height}),I=0;I<P;++I)A[q[I]].clustered=!0}else wA(G,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),c.length===0&&(c.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=g,e._previousHeight=x}}Un.prototype._initialize=function(e){this._scene=e;const t=DA(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(Un.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}}});function ah(e,t,n,i){return function(o){let s=this[e];h(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(h(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),h(s)&&h(a[i]))return s.get(a[i]);h(s)||(s=this[e]=new t({scene:this._scene}));let c,l;const u=this[n];u.length>0?(c=u.shift(),l=s.get(c)):(l=s.add(),c=s.length-1),a[i]=c;const d=this;return Promise.resolve().then(function(){d._clusterDirty=!0}),l}}function ch(e,t){const n=e._collectionIndicesByEntity[t];!h(n.billboardIndex)&&!h(n.labelIndex)&&!h(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Un.prototype.getLabel=ah("_labelCollection",Mn,"_unusedLabelIndices","labelIndex"),Un.prototype.removeLabel=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._labelCollection)||!h(t)||!h(t.labelIndex))return;const n=t.labelIndex;t.labelIndex=void 0,ch(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},Un.prototype.getBillboard=ah("_billboardCollection",Jt,"_unusedBillboardIndices","billboardIndex"),Un.prototype.removeBillboard=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._billboardCollection)||!h(t)||!h(t.billboardIndex))return;const n=t.billboardIndex;t.billboardIndex=void 0,ch(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},Un.prototype.getPoint=ah("_pointCollection",_n,"_unusedPointIndices","pointIndex"),Un.prototype.removePoint=function(e){const t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!h(this._pointCollection)||!h(t)||!h(t.pointIndex))return;const n=t.pointIndex;t.pointIndex=void 0,ch(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function lh(e){if(!h(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function OA(e){e.enabled||(h(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),h(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),h(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,lh(e._labelCollection),lh(e._billboardCollection),lh(e._pointCollection))}Un.prototype.update=function(e){if(!this.show)return;let t;h(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),h(this._billboardCollection)&&this._billboardCollection.length>0&&!h(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,OA(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),h(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),h(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),h(this._clusterPointCollection)&&this._clusterPointCollection.update(e),h(this._labelCollection)&&this._labelCollection.update(e),h(this._billboardCollection)&&this._billboardCollection.update(e),h(this._pointCollection)&&this._pointCollection.update(e)},Un.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(),h(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};function hh(e){this._name=e,this._clock=void 0,this._changed=new Pe,this._error=new Pe,this._isLoading=!1,this._loading=new Pe,this._entityCollection=new $t(this),this._entityCluster=new Un}Object.defineProperties(hh.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){ba.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(!h(e))throw new C("value must be defined.");this._entityCluster=e}}}),hh.prototype.update=function(e){return!0};function Hi(e,t,n=10,i="#ba1919"){return{name:t,label:{text:t,font:"18px sans-serif"},polyline:{show:!0,positions:e,clampToGround:!1,width:n,material:T.fromCssColorString(i),arcType:ei.NONE,shadows:ca.DISABLED}}}function fh(e,t,n,i,o=new lt(0,0,0),s=1){return{id:e,name:n,position:t,orientation:_e.headingPitchRollQuaternion(t,o),model:{show:!0,uri:i,scale:s,heightReference:pi.NONE}}}function D0(e,t,n,i,o){n||(n=new lt);const s=_e.headingPitchRollQuaternion(e,n,i,o),a=N.fromRotationTranslation(L.fromQuaternion(s,new L),e,new N);return N.multiplyByPoint(a,t,new f)}function Wi(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...vA(e[i],e[i+1],t*-1e3,100));return n}function vA(e,t,n,i){var o=[],s=ee.fromCartesian(e),a=ee.fromCartesian(t),c=s.longitude*180/Math.PI,l=s.latitude*180/Math.PI,u=a.longitude*180/Math.PI,d=a.latitude*180/Math.PI,p=Math.sqrt((c-u)*(c-u)+(l-d)*(l-d)),g=p*n,y=f.clone(e),x=f.clone(t),E=f.distance(y,f.ZERO),b=f.distance(x,f.ZERO);if(f.normalize(y,y),f.normalize(x,x),f.distance(y,x)==0)return o;var D=f.angleBetween(y,x);o.push(e);for(var A=1;A<i-1;A++){var O=A*1/(i-1),I=1-O,B=Math.sin(I*D)/Math.sin(D),M=Math.sin(O*D)/Math.sin(D),q=f.multiplyByScalar(y,B,new f),P=f.multiplyByScalar(x,M,new f),V=f.add(q,P,new f),k=O*Math.PI,H=E*I+b*O+Math.sin(k)*g;V=f.multiplyByScalar(V,H,V),o.push(V)}return o.push(t),o}class IA{constructor(){he(this,"LineID","myEntity1");he(this,"Tag","");he(this,"towers",[]);he(this,"ISPhaseSequence",!1);he(this,"Type",0);he(this,"wireAColor","#FFFFFF");he(this,"wireBColor","#FFFFFF");he(this,"wireCColor","#FFFFFF");he(this,"wireD1Color","#FFFFFF");he(this,"wireD2Color","#FFFFFF");he(this,"wireWidth",1)}}class RA{constructor(){he(this,"id","");he(this,"name","");he(this,"type",0);he(this,"Longitude",0);he(this,"Latitude",0);he(this,"Altitude",0);he(this,"RollX",0);he(this,"RollY",90);he(this,"RollZ",0);he(this,"towerScale",1);he(this,"towerHeight",42);he(this,"towerModelUri","");he(this,"towerPoint",[]);he(this,"Insulators",[])}}class zA{constructor(){he(this,"id","");he(this,"name","");he(this,"type",0);he(this,"linenum",1);he(this,"Wairnum","");he(this,"PhaseSequence",0);he(this,"RollX",90);he(this,"RollY",0);he(this,"RollZ",0);he(this,"InsulatorScale",1);he(this,"InsulatorLength",0);he(this,"InsulatorModelUri","");he(this,"InsulatorPoint",[])}}class PA{constructor(){he(this,"name","");he(this,"X",-45);he(this,"Y",90);he(this,"Z",0)}}var ri=(e=>(e[e.A相=0]="A相",e[e.B相=1]="B相",e[e.C相=2]="C相",e[e.地线1=3]="地线1",e[e.地线2=4]="地线2",e))(ri||{}),O0=(e=>(e[e.直线塔=0]="直线塔",e[e.耐张塔=1]="耐张塔",e[e.门架塔=2]="门架塔",e[e.换位塔=3]="换位塔",e))(O0||{}),v0=(e=>(e[e.交流单回路=0]="交流单回路",e[e.交流双回路=1]="交流双回路",e[e.直流单回路=2]="直流单回路",e[e.直流双回路=3]="直流双回路",e[e.交流四回路=4]="交流四回路",e))(v0||{}),ts=(e=>(e[e.地线=0]="地线",e[e.回路一=1]="回路一",e[e.回路二=2]="回路二",e[e.回路三=3]="回路三",e[e.回路四=4]="回路四",e))(ts||{}),I0=(e=>(e[e.悬垂串=0]="悬垂串",e[e.耐张串=1]="耐张串",e[e.跳线串=2]="跳线串",e[e.硬跳串=3]="硬跳串",e[e.V串=4]="V串",e[e.地线串=5]="地线串",e[e.绕跳临时=6]="绕跳临时",e))(I0||{});class BA{constructor(t,n,i){he(this,"viewer");he(this,"LineInfo");he(this,"Keym","");he(this,"dataSource2");he(this,"entityCollection2");he(this,"offsetTowers",[]);he(this,"offsetWires11",[]);he(this,"offsetWires12",[]);he(this,"offsetWires13",[]);he(this,"offsetWires21",[]);he(this,"offsetWires22",[]);he(this,"offsetWires23",[]);he(this,"offsetArcWires1A",[]);he(this,"offsetArcWires1B",[]);he(this,"offsetArcWires1C",[]);he(this,"offsetArcWires2A",[]);he(this,"offsetArcWires2B",[]);he(this,"offsetArcWires2C",[]);he(this,"offsetGrouundWires1",[]);he(this,"offsetGrouundWires2",[]);he(this,"offsetGrouundWires11",[]);he(this,"offsetGrouundWires12",[]);this.Keym=i,this.viewer=t,this.LineInfo=n,this.dataSource2=new hh(this.LineInfo.LineID),this.entityCollection2=this.dataSource2.entities}loadLineTower(){this.Keym=="OW_JPS_EEngin_001"&&(this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(f.fromDegrees(t.Longitude,t.Latitude,t.Altitude-t.towerHeight))}),this.offsetTowers.forEach((t,n)=>{const i=new lt(S.toRadians(this.LineInfo.towers[n].RollX),S.toRadians(this.LineInfo.towers[n].RollY),S.toRadians(this.LineInfo.towers[n].RollZ));this.entityCollection2.add(fh(this.LineInfo.towers[n].id,t,this.LineInfo.towers[n].name,this.LineInfo.towers[n].towerModelUri,i,this.LineInfo.towers[n].towerScale));let o=new lt(S.toRadians(this.LineInfo.towers[n].RollX),0,0),s=0;this.LineInfo.towers[n].Insulators.forEach(a=>{const c=new lt(S.toRadians(a.RollX),S.toRadians(a.RollY),S.toRadians(a.RollZ)),l=D0(t,new f(this.LineInfo.towers[n].towerPoint[s].X,this.LineInfo.towers[n].towerPoint[s].Y,this.LineInfo.towers[n].towerPoint[s].Z),o);this.entityCollection2.add(fh(a.id,l,a.name,a.InsulatorModelUri,c,a.InsulatorScale));const u=D0(t,new f(a.InsulatorPoint[0].X,a.InsulatorPoint[0].Y,a.InsulatorPoint[0].Z),o);switch(a.linenum){case ts.回路一:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case ri.A相:debugger;this.offsetWires11.push(u);break;case ri.B相:this.offsetWires12.push(u);break;case ri.C相:this.offsetWires13.push(u);break}else switch(s){case 2:this.offsetWires11.push(u);break;case 3:this.offsetWires12.push(u);break;case 4:this.offsetWires13.push(u);break}break;case ts.回路二:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case ri.A相:debugger;this.offsetWires21.push(u);break;case ri.B相:this.offsetWires22.push(u);break;case ri.C相:this.offsetWires23.push(u);break}else switch(s){case 5:this.offsetWires11.push(u);break;case 6:this.offsetWires12.push(u);break;case 7:this.offsetWires13.push(u);break}break;case ts.地线:if(this.LineInfo.ISPhaseSequence)switch(a.PhaseSequence){case ri.地线1:this.offsetGrouundWires11.push(u);break;case ri.地线2:this.offsetGrouundWires12.push(u);break}else switch(s){case 0:this.offsetGrouundWires11.push(u);break;case 1:this.offsetGrouundWires12.push(u);break}break}s=s+1})}),this.offsetArcWires1A=Wi(this.offsetWires11),this.offsetArcWires1B=Wi(this.offsetWires12),this.offsetArcWires1C=Wi(this.offsetWires13),this.offsetArcWires2A=Wi(this.offsetWires21),this.offsetArcWires2B=Wi(this.offsetWires22),this.offsetArcWires2C=Wi(this.offsetWires23),this.offsetGrouundWires1=Wi(this.offsetGrouundWires11,2),this.offsetGrouundWires2=Wi(this.offsetGrouundWires12,2),this.entityCollection2.add(Hi(this.offsetArcWires1A,"导线A",this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.entityCollection2.add(Hi(this.offsetArcWires1B,"导线B",this.LineInfo.wireWidth,this.LineInfo.wireBColor)),this.entityCollection2.add(Hi(this.offsetArcWires1C,"导线C",this.LineInfo.wireWidth,this.LineInfo.wireCColor)),this.entityCollection2.add(Hi(this.offsetArcWires2A,"导线A2",this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.entityCollection2.add(Hi(this.offsetArcWires2B,"导线B2",this.LineInfo.wireWidth,this.LineInfo.wireBColor)),this.entityCollection2.add(Hi(this.offsetArcWires2C,"导线C2",this.LineInfo.wireWidth,this.LineInfo.wireCColor)),this.entityCollection2.add(Hi(this.offsetGrouundWires1,"地线1",this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.entityCollection2.add(Hi(this.offsetGrouundWires2,"地线2",this.LineInfo.wireWidth,this.LineInfo.wireD2Color)))}loadLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.add(this.dataSource2),this.viewer.entities.show)}setLineVisible(t){this.Keym=="OW_JPS_EEngin_001"&&(this.entityCollection2.show=t)}RemoveLineModel(){this.Keym=="OW_JPS_EEngin_001"&&(this.viewer.dataSources.remove(this.dataSource2),this.entityCollection2.show=!1)}}pt.GUAPoint=PA,pt.InsulatorInfo=zA,pt.InsulatorType=I0,pt.LineNum=ts,pt.LineType=v0,pt.OWEEgineManager=BA,pt.PhaseSType=ri,pt.TowerInfo=RA,pt.TowerLineInfo=IA,pt.TowerType=O0,pt.drawModel=fh,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})});