ow-eengine-power 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OW_EEngine_Power.js +4730 -4651
- package/dist/OW_EEngine_Power.umd.cjs +93 -93
- package/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(
|
|
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 R0(e){return`${e} is required, actual value was undefined`}function fo(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(R0(e))},m.typeOf.func=function(e,t){if(typeof t!="function")throw new C(fo(typeof t,"function",e))},m.typeOf.string=function(e,t){if(typeof t!="string")throw new C(fo(typeof t,"string",e))},m.typeOf.number=function(e,t){if(typeof t!="number")throw new C(fo(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(fo(typeof t,"object",e))},m.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(fo(typeof t,"boolean",e))},m.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(fo(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 uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ts(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 z0=ri;const dh=ts(z0),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 ns=[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=ns.length;if(e>=t){let n=ns[t-1];for(let i=t;i<=e;i++){const o=n*i;ns.push(o),n=o}}return ns[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 ph=new dh;S.setRandomNumberSeed=function(e){if(!h(e))throw new C("seed is required.");ph=new dh(e)},S.nextRandomNumber=function(){return ph.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 is=new f;f.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,is),f.magnitude(is)},f.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,is),f.magnitudeSquared(is)},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 mh=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,mh),i=f.multiplyByScalar(e,1-n,i),f.add(mh,i,i)};const os=new f,Oa=new f;f.angleBetween=function(e,t){m.typeOf.object("left",e),m.typeOf.object("right",t),f.normalize(e,os),f.normalize(t,Oa);const n=f.dot(os,Oa),i=f.magnitude(f.cross(os,Oa,os));return Math.atan2(i,n)};const P0=new f;f.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.normalize(e,P0);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,po=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,po);const c=Math.sqrt(f.dot(gn,po));return po=f.divideByScalar(po,c,po),gn=f.multiplyByScalar(gn,n,gn),h(o)||(o=new f),f.add(po,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 rs=new Y;Y.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,rs),Y.magnitude(rs)},Y.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,rs),Y.magnitudeSquared(rs)},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 _h=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,_h),i=Y.multiplyByScalar(e,1-n,i),Y.add(_h,i,i)};const B0=new Y;Y.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=Y.normalize(e,B0);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 va=new Float32Array(1),kt=new Uint8Array(va.buffer),N0=new Uint32Array([287454020]),gh=new Uint8Array(N0.buffer)[0]===68;Y.packFloat=function(e,t){return m.typeOf.number("value",e),h(t)||(t=new Y),va[0]=e,gh?(t.x=kt[0],t.y=kt[1],t.z=kt[2],t.w=kt[3]):(t.x=kt[3],t.y=kt[2],t.z=kt[1],t.w=kt[0]),t},Y.unpackFloat=function(e){return m.typeOf.object("packedFloat",e),gh?(kt[0]=e.x,kt[1]=e.y,kt[2]=e.z,kt[3]=e.w):(kt[0]=e.w,kt[1]=e.z,kt[2]=e.y,kt[3]=e.x),va[0]};function F(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)}F.packedLength=9,F.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},F.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new F),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},F.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)F.pack(e[o],t,o*9);return t},F.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]=F.unpack(e,i,t[o])}return t},F.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 F(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},F.fromArray=F.unpack,F.fromColumnMajorArray=function(e,t){return m.defined("values",e),F.clone(e,t)},F.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 F(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},F.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),T=-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]=T,t[5]=O,t[6]=x,t[7]=D,t[8]=I,t):new F(g,y,x,E,T,D,A,O,I)},F.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,T=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]=T,t):new F(l,u,d,p,g,y,x,E,T)},F.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 F(e.x,0,0,0,e.y,0,0,0,e.z)},F.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 F(e,0,0,0,e,0,0,0,e)},F.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 F(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},F.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 F(1,0,0,0,n,-i,0,i,n)},F.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 F(n,0,i,0,1,0,-i,0,n)},F.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 F(n,-i,0,i,n,0,0,0,1)},F.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]]},F.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},F.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},F.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=F.clone(e,i);const o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i},F.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},F.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=F.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};const L0=new f;F.setScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("scale",t),m.typeOf.object("result",n);const i=F.getScale(e,L0),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 F0=new f;F.setUniformScale=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.number("scale",t),m.typeOf.object("result",n);const i=F.getScale(e,F0),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 Ia=new f;F.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],Ia)),t.y=f.magnitude(f.fromElements(e[3],e[4],e[5],Ia)),t.z=f.magnitude(f.fromElements(e[6],e[7],e[8],Ia)),t};const yh=new f;F.getMaximumScale=function(e){return F.getScale(e,yh),f.maximumComponent(yh)};const M0=new f;F.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=F.getScale(e,M0);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 U0=new f;F.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=F.getScale(e,U0);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},F.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},F.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},F.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},F.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},F.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},F.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},F.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},F.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},F.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 k0(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}const Ra=[1,0,0],za=[2,2,1];function V0(e){let t=0;for(let n=0;n<3;++n){const i=e[F.getElementIndex(za[n],Ra[n])];t+=2*i*i}return Math.sqrt(t)}function q0(e,t){const n=S.EPSILON15;let i=0,o=1;for(let u=0;u<3;++u){const d=Math.abs(e[F.getElementIndex(za[u],Ra[u])]);d>i&&(o=u,i=d)}let s=1,a=0;const c=Ra[o],l=za[o];if(Math.abs(e[F.getElementIndex(l,c)])>n){const u=e[F.getElementIndex(l,l)],d=e[F.getElementIndex(c,c)],p=e[F.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=F.clone(F.IDENTITY,t),t[F.getElementIndex(c,c)]=t[F.getElementIndex(l,l)]=s,t[F.getElementIndex(l,c)]=a,t[F.getElementIndex(c,l)]=-a,t}const ss=new F,xh=new F;F.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=F.clone(F.IDENTITY,t.unitary),c=t.diagonal=F.clone(e,t.diagonal),l=n*k0(c);for(;s<i&&V0(c)>l;)q0(c,ss),F.transpose(ss,xh),F.multiply(c,ss,c),F.multiply(xh,c,c),F.multiply(a,ss,a),++o>2&&(++s,o=0);return t},F.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},F.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)},F.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=F.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 F.multiplyByScalar(t,g,t)};const G0=new F;F.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),F.inverse(F.transpose(e,G0),t)},F.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]},F.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},F.IDENTITY=Object.freeze(new F(1,0,0,0,1,0,0,0,1)),F.ZERO=Object.freeze(new F(0,0,0,0,0,0,0,0,0)),F.COLUMN0ROW0=0,F.COLUMN0ROW1=1,F.COLUMN0ROW2=2,F.COLUMN1ROW0=3,F.COLUMN1ROW1=4,F.COLUMN1ROW2=5,F.COLUMN2ROW0=6,F.COLUMN2ROW1=7,F.COLUMN2ROW2=8,Object.defineProperties(F.prototype,{length:{get:function(){return F.packedLength}}}),F.prototype.clone=function(e){return F.clone(this,e)},F.prototype.equals=function(e){return F.equals(this,e)},F.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]},F.prototype.equalsEpsilon=function(e,t){return F.equalsEpsilon(this,e,t)},F.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
1
|
+
(function(Vt,It){typeof exports=="object"&&typeof module<"u"?It(exports):typeof define=="function"&&define.amd?define(["exports"],It):(Vt=typeof globalThis<"u"?globalThis:Vt||self,It(Vt.OW_EEngine_Power={}))})(this,function(Vt){"use strict";var BA=Object.defineProperty;var NA=(Vt,It,h)=>It in Vt?BA(Vt,It,{enumerable:!0,configurable:!0,writable:!0,value:h}):Vt[It]=h;var ue=(Vt,It,h)=>NA(Vt,typeof It!="symbol"?It+"":It,h);var It=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 z0(e){return`${e} is required, actual value was undefined`}function fo(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(z0(e))},m.typeOf.func=function(e,t){if(typeof t!="function")throw new C(fo(typeof t,"function",e))},m.typeOf.string=function(e,t){if(typeof t!="string")throw new C(fo(typeof t,"string",e))},m.typeOf.number=function(e,t){if(typeof t!="number")throw new C(fo(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(fo(typeof t,"object",e))},m.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(fo(typeof t,"boolean",e))},m.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(fo(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 uo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(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 P0=ri;const dh=os(P0),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 rs=[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=rs.length;if(e>=t){let n=rs[t-1];for(let i=t;i<=e;i++){const o=n*i;rs.push(o),n=o}}return rs[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 ph=new dh;S.setRandomNumberSeed=function(e){if(!h(e))throw new C("seed is required.");ph=new dh(e)},S.nextRandomNumber=function(){return ph.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 ss=new f;f.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,ss),f.magnitude(ss)},f.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),f.subtract(e,t,ss),f.magnitudeSquared(ss)},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 mh=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,mh),i=f.multiplyByScalar(e,1-n,i),f.add(mh,i,i)};const as=new f,Ra=new f;f.angleBetween=function(e,t){m.typeOf.object("left",e),m.typeOf.object("right",t),f.normalize(e,as),f.normalize(t,Ra);const n=f.dot(as,Ra),i=f.magnitude(f.cross(as,Ra,as));return Math.atan2(i,n)};const B0=new f;f.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=f.normalize(e,B0);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,po=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,po);const c=Math.sqrt(f.dot(gn,po));return po=f.divideByScalar(po,c,po),gn=f.multiplyByScalar(gn,n,gn),h(o)||(o=new f),f.add(po,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 cs=new Y;Y.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,cs),Y.magnitude(cs)},Y.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),Y.subtract(e,t,cs),Y.magnitudeSquared(cs)},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 _h=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,_h),i=Y.multiplyByScalar(e,1-n,i),Y.add(_h,i,i)};const N0=new Y;Y.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=Y.normalize(e,N0);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 za=new Float32Array(1),kt=new Uint8Array(za.buffer),F0=new Uint32Array([287454020]),gh=new Uint8Array(F0.buffer)[0]===68;Y.packFloat=function(e,t){return m.typeOf.number("value",e),h(t)||(t=new Y),za[0]=e,gh?(t.x=kt[0],t.y=kt[1],t.z=kt[2],t.w=kt[3]):(t.x=kt[3],t.y=kt[2],t.z=kt[1],t.w=kt[0]),t},Y.unpackFloat=function(e){return m.typeOf.object("packedFloat",e),gh?(kt[0]=e.x,kt[1]=e.y,kt[2]=e.z,kt[3]=e.w):(kt[0]=e.w,kt[1]=e.z,kt[2]=e.y,kt[3]=e.x),za[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),T=-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]=T,t[5]=O,t[6]=x,t[7]=D,t[8]=I,t):new L(g,y,x,E,T,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,T=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]=T,t):new L(l,u,d,p,g,y,x,E,T)},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 L0=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,L0),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 M0=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,M0),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 Pa=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],Pa)),t.y=f.magnitude(f.fromElements(e[3],e[4],e[5],Pa)),t.z=f.magnitude(f.fromElements(e[6],e[7],e[8],Pa)),t};const yh=new f;L.getMaximumScale=function(e){return L.getScale(e,yh),f.maximumComponent(yh)};const U0=new f;L.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=L.getScale(e,U0);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 V0=new f;L.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=L.getScale(e,V0);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 k0(e){let t=0;for(let n=0;n<9;++n){const i=e[n];t+=i*i}return Math.sqrt(t)}const Ba=[1,0,0],Na=[2,2,1];function G0(e){let t=0;for(let n=0;n<3;++n){const i=e[L.getElementIndex(Na[n],Ba[n])];t+=2*i*i}return Math.sqrt(t)}function q0(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(Na[u],Ba[u])]);d>i&&(o=u,i=d)}let s=1,a=0;const c=Ba[o],l=Na[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 ls=new L,xh=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*k0(c);for(;s<i&&G0(c)>l;)q0(c,ls),L.transpose(ls,xh),L.multiply(c,ls,c),L.multiply(xh,c,c),L.multiply(a,ls,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 H0=new L;L.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),L.inverse(L.transpose(e,H0),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
|
-
(${this[2]}, ${this[5]}, ${this[8]})`};function
|
|
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,T=t.w*t.w,D=c-p-x+T,A=2*(l-E),O=2*(u+y),I=2*(l+E),B=-c+p-x+T,M=2*(g-d),G=2*(u-y),P=2*(g+d),V=-c-p+x+T;return i[0]=D*o,i[1]=I*o,i[2]=G*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(F.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 mo=new f,_o=new f,jo=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,mo),f.normalize(f.cross(mo,o,_o),_o),f.normalize(f.cross(_o,mo,jo),jo);const s=_o.x,a=_o.y,c=_o.z,l=mo.x,u=mo.y,d=mo.z,p=jo.x,g=jo.y,y=jo.z,x=n.x,E=n.y,T=n.z,D=s*-x+a*-E+c*-T,A=p*-x+g*-E+y*-T,O=l*x+u*E+d*T;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,T=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]=T,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 H0=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,H0),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 W0=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,W0),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 Pa=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],Pa)),t.y=f.magnitude(f.fromElements(e[4],e[5],e[6],Pa)),t.z=f.magnitude(f.fromElements(e[8],e[9],e[10],Pa)),t};const Ch=new f;N.getMaximumScale=function(e){return N.getScale(e,Ch),f.maximumComponent(Ch)};const j0=new f;N.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=N.getScale(e,j0);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 Y0=new f;N.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=N.getScale(e,Y0);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],T=e[13],D=e[14],A=e[15],O=t[0],I=t[1],B=t[2],M=t[3],G=t[4],P=t[5],V=t[6],k=t[7],H=t[8],j=t[9],r=t[10],b=t[11],v=t[12],z=t[13],q=t[14],W=t[15],Z=i*O+c*I+p*B+E*M,X=o*O+l*I+g*B+T*M,ie=s*O+u*I+y*B+D*M,se=a*O+d*I+x*B+A*M,_e=i*G+c*P+p*V+E*k,Ee=o*G+l*P+g*V+T*k,ye=s*G+u*P+y*V+D*k,Re=a*G+d*P+x*V+A*k,We=i*H+c*j+p*r+E*b,tt=o*H+l*j+g*r+T*b,ft=s*H+u*j+y*r+D*b,Pe=a*H+d*j+x*r+A*b,gt=i*v+c*z+p*q+E*W,At=o*v+l*z+g*q+T*W,yt=s*v+u*z+y*q+D*W,cn=a*v+d*z+x*q+A*W;return n[0]=Z,n[1]=X,n[2]=ie,n[3]=se,n[4]=_e,n[5]=Ee,n[6]=ye,n[7]=Re,n[8]=We,n[9]=tt,n[10]=ft,n[11]=Pe,n[12]=gt,n[13]=At,n[14]=yt,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],T=t[1],D=t[2],A=t[4],O=t[5],I=t[6],B=t[8],M=t[9],G=t[10],P=t[12],V=t[13],k=t[14],H=i*E+a*T+u*D,j=o*E+c*T+d*D,r=s*E+l*T+p*D,b=i*A+a*O+u*I,v=o*A+c*O+d*I,z=s*A+l*O+p*I,q=i*B+a*M+u*G,W=o*B+c*M+d*G,Z=s*B+l*M+p*G,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]=b,n[5]=v,n[6]=z,n[7]=0,n[8]=q,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],T=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,G=s*g+l*y+p*x,P=i*E+a*T+u*D,V=o*E+c*T+d*D,k=s*E+l*T+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]=G,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 X0=new F,$0=new F,Z0=new Y,K0=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],T=e[11],D=e[15];let A=g*D,O=y*T,I=p*D,B=y*E,M=p*T,G=g*E,P=d*D,V=y*x,k=d*T,H=g*x,j=d*E,r=p*x;const b=A*c+B*l+M*u-(O*c+I*l+G*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),q=G*a+k*c+r*l-(M*a+H*c+j*l),W=O*i+I*o+G*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-(G*n+k*i+r*o);A=o*u,O=s*l,I=i*u,B=s*c,M=i*l,G=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*T+M*D-(O*E+I*T+G*D),_e=O*x+P*T+H*D-(A*x+V*T+k*D),Ee=I*x+V*E+j*D-(B*x+P*E+r*D),ye=G*x+k*E+r*T-(M*x+H*E+j*T),Re=I*g+G*y+O*p-(M*y+A*p+B*g),We=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),ft=j*g+M*d+H*p-(k*p+r*g+G*d);let Pe=n*b+i*v+o*z+s*q;if(Math.abs(Pe)<S.EPSILON21){if(F.equalsEpsilon(N.getMatrix3(e,X0),$0,S.EPSILON7)&&Y.equals(N.getRow(e,3,Z0),K0))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 Pe=1/Pe,t[0]=b*Pe,t[1]=v*Pe,t[2]=z*Pe,t[3]=q*Pe,t[4]=W*Pe,t[5]=Z*Pe,t[6]=X*Pe,t[7]=ie*Pe,t[8]=se*Pe,t[9]=_e*Pe,t[10]=Ee*Pe,t[11]=ye*Pe,t[12]=Re*Pe,t[13]=We*Pe,t[14]=tt*Pe,t[15]=ft*Pe,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,T=-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]=T,t[15]=1,t};const Q0=new N;N.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),N.inverse(N.transpose(e,Q0),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]})
|
|
4
|
+
(${this[2]}, ${this[5]}, ${this[8]})`};function ct(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}h(Object.create)&&(ct.prototype=Object.create(Error.prototype),ct.prototype.constructor=ct),ct.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return h(this.stack)&&(e+=`
|
|
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,T=t.w*t.w,D=c-p-x+T,A=2*(l-E),O=2*(u+y),I=2*(l+E),B=-c+p-x+T,M=2*(g-d),q=2*(u-y),P=2*(g+d),k=-c-p+x+T;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]=k*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 mo=new f,_o=new f,Yo=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,mo),f.normalize(f.cross(mo,o,_o),_o),f.normalize(f.cross(_o,mo,Yo),Yo);const s=_o.x,a=_o.y,c=_o.z,l=mo.x,u=mo.y,d=mo.z,p=Yo.x,g=Yo.y,y=Yo.z,x=n.x,E=n.y,T=n.z,D=s*-x+a*-E+c*-T,A=p*-x+g*-E+y*-T,O=l*x+u*E+d*T;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,T=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]=T,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 W0=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,W0),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 j0=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,j0),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 Fa=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],Fa)),t.y=f.magnitude(f.fromElements(e[4],e[5],e[6],Fa)),t.z=f.magnitude(f.fromElements(e[8],e[9],e[10],Fa)),t};const Ch=new f;N.getMaximumScale=function(e){return N.getScale(e,Ch),f.maximumComponent(Ch)};const Y0=new f;N.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=N.getScale(e,Y0);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 X0=new f;N.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=N.getScale(e,X0);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],T=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],k=t[6],V=t[7],H=t[8],j=t[9],r=t[10],b=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+T*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*k+E*V,Te=o*q+l*P+g*k+T*V,xe=s*q+u*P+y*k+D*V,ze=a*q+d*P+x*k+A*V,je=i*H+c*j+p*r+E*b,tt=o*H+l*j+g*r+T*b,ut=s*H+u*j+y*r+D*b,Be=a*H+d*j+x*r+A*b,gt=i*v+c*z+p*G+E*W,At=o*v+l*z+g*G+T*W,yt=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]=Te,n[6]=xe,n[7]=ze,n[8]=je,n[9]=tt,n[10]=ut,n[11]=Be,n[12]=gt,n[13]=At,n[14]=yt,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],T=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],k=t[13],V=t[14],H=i*E+a*T+u*D,j=o*E+c*T+d*D,r=s*E+l*T+p*D,b=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*k+u*V+g,ie=o*P+c*k+d*V+y,se=s*P+l*k+p*V+x;return n[0]=H,n[1]=j,n[2]=r,n[3]=0,n[4]=b,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],T=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*T+u*D,k=o*E+c*T+d*D,V=s*E+l*T+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]=k,n[6]=V,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 $0=new L,Z0=new L,K0=new Y,Q0=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],T=e[11],D=e[15];let A=g*D,O=y*T,I=p*D,B=y*E,M=p*T,q=g*E,P=d*D,k=y*x,V=d*T,H=g*x,j=d*E,r=p*x;const b=A*c+B*l+M*u-(O*c+I*l+q*u),v=O*a+P*l+H*u-(A*a+k*l+V*u),z=I*a+k*c+j*u-(B*a+P*c+r*u),G=q*a+V*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+k*o+V*s-(O*n+P*o+H*s),X=B*n+P*i+r*s-(I*n+k*i+j*s),ie=M*n+H*i+j*o-(q*n+V*i+r*o);A=o*u,O=s*l,I=i*u,B=s*c,M=i*l,q=o*c,P=n*u,k=s*a,V=n*l,H=o*a,j=n*c,r=i*a;const se=A*E+B*T+M*D-(O*E+I*T+q*D),ge=O*x+P*T+H*D-(A*x+k*T+V*D),Te=I*x+k*E+j*D-(B*x+P*E+r*D),xe=q*x+V*E+r*T-(M*x+H*E+j*T),ze=I*g+q*y+O*p-(M*y+A*p+B*g),je=V*y+A*d+k*g-(P*g+H*y+O*d),tt=P*p+r*y+B*d-(j*y+I*d+k*p),ut=j*g+M*d+H*p-(V*p+r*g+q*d);let Be=n*b+i*v+o*z+s*G;if(Math.abs(Be)<S.EPSILON21){if(L.equalsEpsilon(N.getMatrix3(e,$0),Z0,S.EPSILON7)&&Y.equals(N.getRow(e,3,K0),Q0))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 ct("matrix is not invertible because its determinate is zero.")}return Be=1/Be,t[0]=b*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]=Te*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,T=-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]=T,t[15]=1,t};const J0=new N;N.inverseTranspose=function(e,t){return m.typeOf.object("matrix",e),m.typeOf.object("result",t),N.inverse(N.transpose(e,J0),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}),J0=new f;function re(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const Rt={};Rt[R.FLOAT]="float",Rt[R.FLOAT_VEC2]="vec2",Rt[R.FLOAT_VEC3]="vec3",Rt[R.FLOAT_VEC4]="vec4",Rt[R.INT]="int",Rt[R.INT_VEC2]="ivec2",Rt[R.INT_VEC3]="ivec3",Rt[R.INT_VEC4]="ivec4",Rt[R.BOOL]="bool",Rt[R.BOOL_VEC2]="bvec2",Rt[R.BOOL_VEC3]="bvec3",Rt[R.BOOL_VEC4]="bvec4",Rt[R.FLOAT_MAT2]="mat2",Rt[R.FLOAT_MAT3]="mat3",Rt[R.FLOAT_MAT4]="mat4",Rt[R.SAMPLER_2D]="sampler2D",Rt[R.SAMPLER_CUBE]="samplerCube",re.prototype.getDeclaration=function(e){let t=`uniform ${Rt[this._datatype]} ${e}`;const n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};const as={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,J0)}}),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 e_(){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=e_}const Dt={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT};Dt.getSizeInBytes=function(e){switch(e){case Dt.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Dt.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Dt.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")},Dt.fromSizeInBytes=function(e){switch(e){case 2:return Dt.UNSIGNED_SHORT;case 4:return Dt.UNSIGNED_INT;case 1:return Dt.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}},Dt.validate=function(e){return h(e)&&(e===Dt.UNSIGNED_BYTE||e===Dt.UNSIGNED_SHORT||e===Dt.UNSIGNED_INT)},Dt.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)},Dt.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)},Dt.fromTypedArray=function(e){if(e instanceof Uint8Array)return Dt.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Dt.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Dt.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};const xt=Object.freeze(Dt),cs={STREAM_DRAW:R.STREAM_DRAW,STATIC_DRAW:R.STATIC_DRAW,DYNAMIC_DRAW:R.DYNAMIC_DRAW,validate:function(e){return e===cs.STREAM_DRAW||e===cs.STATIC_DRAW||e===cs.DYNAMIC_DRAW}},Ae=Object.freeze(cs);function Ot(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)),!Ae.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}Ot.createVertexBuffer=function(e){return m.defined("options.context",e.context),new Ot({context:e.context,bufferTarget:R.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},Ot.createIndexBuffer=function(e){if(m.defined("options.context",e.context),!xt.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===xt.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=xt.getSizeInBytes(n),o=new Ot({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(Ot.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),Ot.prototype._getBuffer=function(){return this._buffer},Ot.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)},Ot.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)},Ot.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)},Ot.prototype.isDestroyed=function(){return!1},Ot.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 Vt;typeof navigator<"u"?Vt=navigator:Vt={};function Wi(e){const t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}let ls,Eh;function Ba(){if(!h(ls)&&(ls=!1,!ds())){const e=/ Chrome\/([\.0-9]+)/.exec(Vt.userAgent);e!==null&&(ls=!0,Eh=Wi(e[1]))}return ls}function t_(){return Ba()&&Eh}let hs,Th;function bh(){if(!h(hs)&&(hs=!1,!Ba()&&!ds()&&/ Safari\/[\.0-9]+/.test(Vt.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Vt.userAgent);e!==null&&(hs=!0,Th=Wi(e[1]))}return hs}function n_(){return bh()&&Th}let fs,Na;function wh(){if(!h(fs)){fs=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Vt.userAgent);e!==null&&(fs=!0,Na=Wi(e[1]),Na.isNightly=!!e[2])}return fs}function i_(){return wh()&&Na}let Yo,La;function Sh(){if(!h(Yo)){Yo=!1;let e;Vt.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Vt.userAgent),e!==null&&(Yo=!0,La=Wi(e[1]))):Vt.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Vt.userAgent),e!==null&&(Yo=!0,La=Wi(e[1])))}return Yo}function o_(){return Sh()&&La}let us,Ah;function ds(){if(!h(us)){us=!1;const e=/ Edg\/([\.0-9]+)/.exec(Vt.userAgent);e!==null&&(us=!0,Ah=Wi(e[1]))}return us}function r_(){return ds()&&Ah}let ps,Fa;function ms(){if(!h(ps)){ps=!1;const e=/Firefox\/([\.0-9]+)/.exec(Vt.userAgent);e!==null&&(ps=!0,Fa=Wi(e[1]))}return ps}let Ma;function s_(){return h(Ma)||(Ma=/Windows/i.test(Vt.appVersion)),Ma}let Ua;function a_(){return h(Ua)||(Ua=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Ua}function c_(){return ms()&&Fa}let ka;function l_(){return h(ka)||(ka=!ms()&&typeof PointerEvent<"u"&&(!h(Vt.pointerEnabled)||Vt.pointerEnabled)),ka}let Dh,_s;function Oh(){if(!h(_s)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;_s=h(t)&&t!=="",_s&&(Dh=t)}return _s}function h_(){return Oh()?Dh: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 go=[];typeof ArrayBuffer<"u"&&(go.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&go.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&go.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&go.push(BigInt64Array),typeof BigUint64Array<"u"&&go.push(BigUint64Array));const mt={isChrome:Ba,chromeVersion:t_,isSafari:bh,safariVersion:n_,isWebkit:wh,webkitVersion:i_,isInternetExplorer:Sh,internetExplorerVersion:o_,isEdge:ds,edgeVersion:r_,isFirefox:ms,firefoxVersion:c_,isWindows:s_,isIPadOrIOS:a_,hardwareConcurrency:_(Vt.hardwareConcurrency,3),supportsPointerEvents:l_,supportsImageRenderingPixelated:Oh,supportsWebP:qt,imageRenderingValue:h_,typedArrayTypes:go};mt.supportsBasis=function(e){return mt.supportsWebAssembly()&&e.context.supportsBasis},mt.supportsFullscreen=function(){return en.supportsFullscreen()},mt.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},mt.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},mt.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},mt.supportsBigInt=function(){return typeof BigInt<"u"},mt.supportsWebWorkers=function(){return typeof Worker<"u"},mt.supportsWebAssembly=function(){return typeof WebAssembly<"u"},mt.supportsWebgl2=function(e){return m.defined("scene",e),e.context.webgl2},mt.supportsEsmWebWorkers=function(){return!ms()||parseInt(Fa)>=114};function Va(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 w(e,t,n,i){this.red=_(e,1),this.green=_(t,1),this.blue=_(n,1),this.alpha=_(i,1)}w.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 w(e.x,e.y,e.z,e.w)},w.fromBytes=function(e,t,n,i,o){return e=w.byteToFloat(_(e,255)),t=w.byteToFloat(_(t,255)),n=w.byteToFloat(_(n,255)),i=w.byteToFloat(_(i,255)),h(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new w(e,t,n,i)},w.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 w(e.red,e.green,e.blue,t)};let qa,Ga,si;mt.supportsTypedArrays()&&(qa=new ArrayBuffer(4),Ga=new Uint32Array(qa),si=new Uint8Array(qa)),w.fromRgba=function(e,t){return Ga[0]=e,w.fromBytes(si[0],si[1],si[2],si[3],t)},w.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=Va(u,l,e+1/3),a=Va(u,l,e),c=Va(u,l,e-1/3)}return h(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=i,o):new w(s,a,c,i)},w.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 w(n,i,o,s)};const f_=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,u_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,d_=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,p_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;w.fromCssColorString=function(e,t){m.typeOf.string("color",e),h(t)||(t=new w),e=e.trim();const n=w[e.toUpperCase()];if(h(n))return w.clone(n,t),t;let i=f_.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=u_.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=d_.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=p_.exec(e),i!==null?w.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(_(i[4],"1.0")),t):(t=void 0,t))))},w.packedLength=4,w.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},w.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new w),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},w.byteToFloat=function(e){return e/255},w.floatToByte=function(e){return e===1?255:e*256|0},w.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 w(e.red,e.green,e.blue,e.alpha)},w.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},w.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]},w.prototype.clone=function(e){return w.clone(this,e)},w.prototype.equals=function(e){return w.equals(this,e)},w.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},w.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},w.prototype.toCssColorString=function(){const e=w.floatToByte(this.red),t=w.floatToByte(this.green),n=w.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},w.prototype.toCssHexString=function(){let e=w.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=w.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=w.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=w.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},w.prototype.toBytes=function(e){const t=w.floatToByte(this.red),n=w.floatToByte(this.green),i=w.floatToByte(this.blue),o=w.floatToByte(this.alpha);return h(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]},w.prototype.toRgba=function(){return si[0]=w.floatToByte(this.red),si[1]=w.floatToByte(this.green),si[2]=w.floatToByte(this.blue),si[3]=w.floatToByte(this.alpha),Ga[0]},w.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},w.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},w.prototype.withAlpha=function(e,t){return w.fromAlpha(this,e,t)},w.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},w.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},w.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},w.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},w.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},w.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},w.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},w.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},w.ALICEBLUE=Object.freeze(w.fromCssColorString("#F0F8FF")),w.ANTIQUEWHITE=Object.freeze(w.fromCssColorString("#FAEBD7")),w.AQUA=Object.freeze(w.fromCssColorString("#00FFFF")),w.AQUAMARINE=Object.freeze(w.fromCssColorString("#7FFFD4")),w.AZURE=Object.freeze(w.fromCssColorString("#F0FFFF")),w.BEIGE=Object.freeze(w.fromCssColorString("#F5F5DC")),w.BISQUE=Object.freeze(w.fromCssColorString("#FFE4C4")),w.BLACK=Object.freeze(w.fromCssColorString("#000000")),w.BLANCHEDALMOND=Object.freeze(w.fromCssColorString("#FFEBCD")),w.BLUE=Object.freeze(w.fromCssColorString("#0000FF")),w.BLUEVIOLET=Object.freeze(w.fromCssColorString("#8A2BE2")),w.BROWN=Object.freeze(w.fromCssColorString("#A52A2A")),w.BURLYWOOD=Object.freeze(w.fromCssColorString("#DEB887")),w.CADETBLUE=Object.freeze(w.fromCssColorString("#5F9EA0")),w.CHARTREUSE=Object.freeze(w.fromCssColorString("#7FFF00")),w.CHOCOLATE=Object.freeze(w.fromCssColorString("#D2691E")),w.CORAL=Object.freeze(w.fromCssColorString("#FF7F50")),w.CORNFLOWERBLUE=Object.freeze(w.fromCssColorString("#6495ED")),w.CORNSILK=Object.freeze(w.fromCssColorString("#FFF8DC")),w.CRIMSON=Object.freeze(w.fromCssColorString("#DC143C")),w.CYAN=Object.freeze(w.fromCssColorString("#00FFFF")),w.DARKBLUE=Object.freeze(w.fromCssColorString("#00008B")),w.DARKCYAN=Object.freeze(w.fromCssColorString("#008B8B")),w.DARKGOLDENROD=Object.freeze(w.fromCssColorString("#B8860B")),w.DARKGRAY=Object.freeze(w.fromCssColorString("#A9A9A9")),w.DARKGREEN=Object.freeze(w.fromCssColorString("#006400")),w.DARKGREY=w.DARKGRAY,w.DARKKHAKI=Object.freeze(w.fromCssColorString("#BDB76B")),w.DARKMAGENTA=Object.freeze(w.fromCssColorString("#8B008B")),w.DARKOLIVEGREEN=Object.freeze(w.fromCssColorString("#556B2F")),w.DARKORANGE=Object.freeze(w.fromCssColorString("#FF8C00")),w.DARKORCHID=Object.freeze(w.fromCssColorString("#9932CC")),w.DARKRED=Object.freeze(w.fromCssColorString("#8B0000")),w.DARKSALMON=Object.freeze(w.fromCssColorString("#E9967A")),w.DARKSEAGREEN=Object.freeze(w.fromCssColorString("#8FBC8F")),w.DARKSLATEBLUE=Object.freeze(w.fromCssColorString("#483D8B")),w.DARKSLATEGRAY=Object.freeze(w.fromCssColorString("#2F4F4F")),w.DARKSLATEGREY=w.DARKSLATEGRAY,w.DARKTURQUOISE=Object.freeze(w.fromCssColorString("#00CED1")),w.DARKVIOLET=Object.freeze(w.fromCssColorString("#9400D3")),w.DEEPPINK=Object.freeze(w.fromCssColorString("#FF1493")),w.DEEPSKYBLUE=Object.freeze(w.fromCssColorString("#00BFFF")),w.DIMGRAY=Object.freeze(w.fromCssColorString("#696969")),w.DIMGREY=w.DIMGRAY,w.DODGERBLUE=Object.freeze(w.fromCssColorString("#1E90FF")),w.FIREBRICK=Object.freeze(w.fromCssColorString("#B22222")),w.FLORALWHITE=Object.freeze(w.fromCssColorString("#FFFAF0")),w.FORESTGREEN=Object.freeze(w.fromCssColorString("#228B22")),w.FUCHSIA=Object.freeze(w.fromCssColorString("#FF00FF")),w.GAINSBORO=Object.freeze(w.fromCssColorString("#DCDCDC")),w.GHOSTWHITE=Object.freeze(w.fromCssColorString("#F8F8FF")),w.GOLD=Object.freeze(w.fromCssColorString("#FFD700")),w.GOLDENROD=Object.freeze(w.fromCssColorString("#DAA520")),w.GRAY=Object.freeze(w.fromCssColorString("#808080")),w.GREEN=Object.freeze(w.fromCssColorString("#008000")),w.GREENYELLOW=Object.freeze(w.fromCssColorString("#ADFF2F")),w.GREY=w.GRAY,w.HONEYDEW=Object.freeze(w.fromCssColorString("#F0FFF0")),w.HOTPINK=Object.freeze(w.fromCssColorString("#FF69B4")),w.INDIANRED=Object.freeze(w.fromCssColorString("#CD5C5C")),w.INDIGO=Object.freeze(w.fromCssColorString("#4B0082")),w.IVORY=Object.freeze(w.fromCssColorString("#FFFFF0")),w.KHAKI=Object.freeze(w.fromCssColorString("#F0E68C")),w.LAVENDER=Object.freeze(w.fromCssColorString("#E6E6FA")),w.LAVENDAR_BLUSH=Object.freeze(w.fromCssColorString("#FFF0F5")),w.LAWNGREEN=Object.freeze(w.fromCssColorString("#7CFC00")),w.LEMONCHIFFON=Object.freeze(w.fromCssColorString("#FFFACD")),w.LIGHTBLUE=Object.freeze(w.fromCssColorString("#ADD8E6")),w.LIGHTCORAL=Object.freeze(w.fromCssColorString("#F08080")),w.LIGHTCYAN=Object.freeze(w.fromCssColorString("#E0FFFF")),w.LIGHTGOLDENRODYELLOW=Object.freeze(w.fromCssColorString("#FAFAD2")),w.LIGHTGRAY=Object.freeze(w.fromCssColorString("#D3D3D3")),w.LIGHTGREEN=Object.freeze(w.fromCssColorString("#90EE90")),w.LIGHTGREY=w.LIGHTGRAY,w.LIGHTPINK=Object.freeze(w.fromCssColorString("#FFB6C1")),w.LIGHTSEAGREEN=Object.freeze(w.fromCssColorString("#20B2AA")),w.LIGHTSKYBLUE=Object.freeze(w.fromCssColorString("#87CEFA")),w.LIGHTSLATEGRAY=Object.freeze(w.fromCssColorString("#778899")),w.LIGHTSLATEGREY=w.LIGHTSLATEGRAY,w.LIGHTSTEELBLUE=Object.freeze(w.fromCssColorString("#B0C4DE")),w.LIGHTYELLOW=Object.freeze(w.fromCssColorString("#FFFFE0")),w.LIME=Object.freeze(w.fromCssColorString("#00FF00")),w.LIMEGREEN=Object.freeze(w.fromCssColorString("#32CD32")),w.LINEN=Object.freeze(w.fromCssColorString("#FAF0E6")),w.MAGENTA=Object.freeze(w.fromCssColorString("#FF00FF")),w.MAROON=Object.freeze(w.fromCssColorString("#800000")),w.MEDIUMAQUAMARINE=Object.freeze(w.fromCssColorString("#66CDAA")),w.MEDIUMBLUE=Object.freeze(w.fromCssColorString("#0000CD")),w.MEDIUMORCHID=Object.freeze(w.fromCssColorString("#BA55D3")),w.MEDIUMPURPLE=Object.freeze(w.fromCssColorString("#9370DB")),w.MEDIUMSEAGREEN=Object.freeze(w.fromCssColorString("#3CB371")),w.MEDIUMSLATEBLUE=Object.freeze(w.fromCssColorString("#7B68EE")),w.MEDIUMSPRINGGREEN=Object.freeze(w.fromCssColorString("#00FA9A")),w.MEDIUMTURQUOISE=Object.freeze(w.fromCssColorString("#48D1CC")),w.MEDIUMVIOLETRED=Object.freeze(w.fromCssColorString("#C71585")),w.MIDNIGHTBLUE=Object.freeze(w.fromCssColorString("#191970")),w.MINTCREAM=Object.freeze(w.fromCssColorString("#F5FFFA")),w.MISTYROSE=Object.freeze(w.fromCssColorString("#FFE4E1")),w.MOCCASIN=Object.freeze(w.fromCssColorString("#FFE4B5")),w.NAVAJOWHITE=Object.freeze(w.fromCssColorString("#FFDEAD")),w.NAVY=Object.freeze(w.fromCssColorString("#000080")),w.OLDLACE=Object.freeze(w.fromCssColorString("#FDF5E6")),w.OLIVE=Object.freeze(w.fromCssColorString("#808000")),w.OLIVEDRAB=Object.freeze(w.fromCssColorString("#6B8E23")),w.ORANGE=Object.freeze(w.fromCssColorString("#FFA500")),w.ORANGERED=Object.freeze(w.fromCssColorString("#FF4500")),w.ORCHID=Object.freeze(w.fromCssColorString("#DA70D6")),w.PALEGOLDENROD=Object.freeze(w.fromCssColorString("#EEE8AA")),w.PALEGREEN=Object.freeze(w.fromCssColorString("#98FB98")),w.PALETURQUOISE=Object.freeze(w.fromCssColorString("#AFEEEE")),w.PALEVIOLETRED=Object.freeze(w.fromCssColorString("#DB7093")),w.PAPAYAWHIP=Object.freeze(w.fromCssColorString("#FFEFD5")),w.PEACHPUFF=Object.freeze(w.fromCssColorString("#FFDAB9")),w.PERU=Object.freeze(w.fromCssColorString("#CD853F")),w.PINK=Object.freeze(w.fromCssColorString("#FFC0CB")),w.PLUM=Object.freeze(w.fromCssColorString("#DDA0DD")),w.POWDERBLUE=Object.freeze(w.fromCssColorString("#B0E0E6")),w.PURPLE=Object.freeze(w.fromCssColorString("#800080")),w.RED=Object.freeze(w.fromCssColorString("#FF0000")),w.ROSYBROWN=Object.freeze(w.fromCssColorString("#BC8F8F")),w.ROYALBLUE=Object.freeze(w.fromCssColorString("#4169E1")),w.SADDLEBROWN=Object.freeze(w.fromCssColorString("#8B4513")),w.SALMON=Object.freeze(w.fromCssColorString("#FA8072")),w.SANDYBROWN=Object.freeze(w.fromCssColorString("#F4A460")),w.SEAGREEN=Object.freeze(w.fromCssColorString("#2E8B57")),w.SEASHELL=Object.freeze(w.fromCssColorString("#FFF5EE")),w.SIENNA=Object.freeze(w.fromCssColorString("#A0522D")),w.SILVER=Object.freeze(w.fromCssColorString("#C0C0C0")),w.SKYBLUE=Object.freeze(w.fromCssColorString("#87CEEB")),w.SLATEBLUE=Object.freeze(w.fromCssColorString("#6A5ACD")),w.SLATEGRAY=Object.freeze(w.fromCssColorString("#708090")),w.SLATEGREY=w.SLATEGRAY,w.SNOW=Object.freeze(w.fromCssColorString("#FFFAFA")),w.SPRINGGREEN=Object.freeze(w.fromCssColorString("#00FF7F")),w.STEELBLUE=Object.freeze(w.fromCssColorString("#4682B4")),w.TAN=Object.freeze(w.fromCssColorString("#D2B48C")),w.TEAL=Object.freeze(w.fromCssColorString("#008080")),w.THISTLE=Object.freeze(w.fromCssColorString("#D8BFD8")),w.TOMATO=Object.freeze(w.fromCssColorString("#FF6347")),w.TURQUOISE=Object.freeze(w.fromCssColorString("#40E0D0")),w.VIOLET=Object.freeze(w.fromCssColorString("#EE82EE")),w.WHEAT=Object.freeze(w.fromCssColorString("#F5DEB3")),w.WHITE=Object.freeze(w.fromCssColorString("#FFFFFF")),w.WHITESMOKE=Object.freeze(w.fromCssColorString("#F5F5F5")),w.YELLOW=Object.freeze(w.fromCssColorString("#FFFF00")),w.YELLOWGREEN=Object.freeze(w.fromCssColorString("#9ACD32")),w.TRANSPARENT=Object.freeze(new w(0,0,0,0));const zt=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 gs=new U;U.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,gs),U.magnitude(gs)},U.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,gs),U.magnitudeSquared(gs)},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 vh=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,vh),i=U.multiplyByScalar(e,1-n,i),U.add(vh,i,i)};const Ih=new U,Rh=new U;U.angleBetween=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.normalize(e,Ih),U.normalize(t,Rh),S.acosClamped(U.dot(Ih,Rh))};const m_=new U;U.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=U.normalize(e,m_);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 __=new f,g_=new f;function zh(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),T=f.multiplyByScalar(e,E,__);if(x<i)return isFinite(E)?f.clone(T,o):void 0;const D=n.x,A=n.y,O=n.z,I=g_;I.x=T.x*D*2,I.y=T.y*A*2,I.z=T.z*O*2;let B=(1-E)*f.magnitude(e)/(.5*f.magnitude(I)),M=0,G,P,V,k,H,j,r,b,v,z,q;do{B-=M,V=1/(1+B*D),k=1/(1+B*A),H=1/(1+B*O),j=V*V,r=k*k,b=H*H,v=j*V,z=r*k,q=b*H,G=p*j+g*r+y*b-1,P=p*v*D+g*z*A+y*q*O;const W=-2*P;M=G/W}while(Math.abs(G)>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 y_=new f,x_=new f,C_=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=zh(e,i,o,s,x_);if(!h(a))return;let c=f.multiplyComponents(a,o,y_);c=f.normalize(c,c);const l=f.subtract(e,a,C_),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 Ph(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,Ph(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)&&Ph(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 E_=new f,T_=new f;le.prototype.cartographicToCartesian=function(e,t){const n=E_,i=T_;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 b_=new f,w_=new f,S_=new f;le.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,w_);if(!h(n))return;const i=this.geodeticSurfaceNormal(n,b_),o=f.subtract(e,n,S_),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 zh(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 A_=new f;le.prototype.getLocalCurvature=function(e,t){m.typeOf.object("surfacePosition",e),h(t)||(t=new U);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,A_),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 D_=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],O_=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Bh(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*D_[a];s+=O_[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 Bh(i,o,function(d){const p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Bh(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 Ct=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function Xo(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 Ha(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}function Wa(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 Nh=[31,28,31,30,31,30,31,31,30,31,30,31];function ja(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(),T(),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 T(){const D=t===2&&Wa(e)?Nh[t-1]+1:Nh[t-1];if(n>D)throw new C("Month and Day represents invalid date")}}function Ve(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}),Oe=Object.freeze({UTC:0,TAI:1}),Lh=new ja,ys=[31,28,31,30,31,30,31,31,30,31,30,31],xs=29;function Ya(e,t){return $.compare(e.julianDate,t.julianDate)}const yo=new Ve;function Cs(e){yo.julianDate=e;const t=$.leapSeconds;let n=Xo(t,yo,Ya);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 Fh(e,t){yo.julianDate=e;const n=$.leapSeconds;let i=Xo(n,yo,Ya);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 Xa(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 v_=/^(\d{4})$/,I_=/^(\d{4})-(\d{2})$/,R_=/^(\d{4})-?(\d{3})$/,z_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,P_=/^(\d{4})-?(\d{2})-?(\d{2})$/,$a=/([Z+\-])?(\d{2})?:?(\d{2})?$/,B_=/^(\d{2})(\.\d+)?/.source+$a.source,N_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+$a.source,L_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+$a.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,Oe.UTC);const i=e|0;t=t+(e-i)*nt.SECONDS_PER_DAY,Oi(i,t,this),n===Oe.UTC&&Cs(this)}$.fromGregorianDate=function(e,t){if(!(e instanceof ja))throw new C("date must be a valid GregorianDate.");const n=Xa(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return h(t)?(Oi(n[0],n[1],t),Cs(t),t):new $(n[0],n[1],Oe.UTC)},$.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");const n=Xa(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return h(t)?(Oi(n[0],n[1],t),Cs(t),t):new $(n[0],n[1],Oe.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(P_),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(I_),n!==null)i=+n[1],o=+n[2];else if(n=d.match(v_),n!==null)i=+n[1];else{let A;if(n=d.match(R_),n!==null){if(i=+n[1],A=+n[2],y=Wa(i),A<1||y&&A>366||!y&&A>365)throw new C(An)}else if(n=d.match(z_),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=Wa(i),o<1||o>12||s<1||(o!==2||!y)&&s>ys[o-1]||y&&o===2&&s>xs)throw new C(An);let E;if(h(p)){if(n=p.match(L_),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(N_),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(B_),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 T=l===60;for(T&&l--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(g=y&&o===2?xs:ys[o-1];s>g;)s-=g,o++,o>12&&(o-=12,i++),g=y&&o===2?xs:ys[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?xs:ys[o-1],s+=g;const D=Xa(i,o,s,a,c,l,u);return h(t)?(Oi(D[0],D[1],t),Cs(t)):t=new $(D[0],D[1],Oe.UTC),T&&$.addSeconds(t,1,t),t},$.now=function(e){return $.fromDate(new Date,e)};const Es=new $(0,0,Oe.TAI);$.toGregorianDate=function(e,t){if(!h(e))throw new C("julianDate is required.");let n=!1,i=Fh(e,Es);h(i)||($.addSeconds(e,-1,Es),i=Fh(Es,Es),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 T=x|0;const D=(x-T)/nt.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(T+=1),h(t)?(t.year=g,t.month=p,t.day=d,t.hour=y,t.minute=E,t.second=T,t.millisecond=D,t.isLeapSecond=n,t):new ja(g,p,d,y,E,T,D,n)},$.toDate=function(e){if(!h(e))throw new C("julianDate is required.");const t=$.toGregorianDate(e,Lh);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,Lh);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,Oe.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){yo.julianDate=e;const t=$.leapSeconds;let n=Xo(t,yo,Ya);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 Ve(new $(2441317,43210,Oe.TAI),10),new Ve(new $(2441499,43211,Oe.TAI),11),new Ve(new $(2441683,43212,Oe.TAI),12),new Ve(new $(2442048,43213,Oe.TAI),13),new Ve(new $(2442413,43214,Oe.TAI),14),new Ve(new $(2442778,43215,Oe.TAI),15),new Ve(new $(2443144,43216,Oe.TAI),16),new Ve(new $(2443509,43217,Oe.TAI),17),new Ve(new $(2443874,43218,Oe.TAI),18),new Ve(new $(2444239,43219,Oe.TAI),19),new Ve(new $(2444786,43220,Oe.TAI),20),new Ve(new $(2445151,43221,Oe.TAI),21),new Ve(new $(2445516,43222,Oe.TAI),22),new Ve(new $(2446247,43223,Oe.TAI),23),new Ve(new $(2447161,43224,Oe.TAI),24),new Ve(new $(2447892,43225,Oe.TAI),25),new Ve(new $(2448257,43226,Oe.TAI),26),new Ve(new $(2448804,43227,Oe.TAI),27),new Ve(new $(2449169,43228,Oe.TAI),28),new Ve(new $(2449534,43229,Oe.TAI),29),new Ve(new $(2450083,43230,Oe.TAI),30),new Ve(new $(2450630,43231,Oe.TAI),31),new Ve(new $(2451179,43232,Oe.TAI),32),new Ve(new $(2453736,43233,Oe.TAI),33),new Ve(new $(2454832,43234,Oe.TAI),34),new Ve(new $(2456109,43235,Oe.TAI),35),new Ve(new $(2457204,43236,Oe.TAI),36),new Ve(new $(2457754,43237,Oe.TAI),37)];var Mh={exports:{}},$o={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */$o.exports;var Uh;function F_(){return Uh||(Uh=1,function(e,t){(function(n){var i=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,s=typeof uo=="object"&&uo;(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="-",T=/^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,G;function P(X){throw new RangeError(O[X])}function V(X,ie){for(var se=X.length,_e=[];se--;)_e[se]=ie(X[se]);return _e}function k(X,ie){var se=X.split("@"),_e="";se.length>1&&(_e=se[0]+"@",X=se[1]),X=X.replace(A,".");var Ee=X.split("."),ye=V(Ee,ie).join(".");return _e+ye}function H(X){for(var ie=[],se=0,_e=X.length,Ee,ye;se<_e;)Ee=X.charCodeAt(se++),Ee>=55296&&Ee<=56319&&se<_e?(ye=X.charCodeAt(se++),(ye&64512)==56320?ie.push(((Ee&1023)<<10)+(ye&1023)+65536):(ie.push(Ee),se--)):ie.push(Ee);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 b(X,ie){return X+22+75*(X<26)-((ie!=0)<<5)}function v(X,ie,se){var _e=0;for(X=se?B(X/g):X>>1,X+=B(X/ie);X>I*d>>1;_e+=l)X=B(X/I);return B(_e+(I+1)*X/(X+p))}function z(X){var ie=[],se=X.length,_e,Ee=0,ye=x,Re=y,We,tt,ft,Pe,gt,At,yt,cn,ln;for(We=X.lastIndexOf(E),We<0&&(We=0),tt=0;tt<We;++tt)X.charCodeAt(tt)>=128&&P("not-basic"),ie.push(X.charCodeAt(tt));for(ft=We>0?We+1:0;ft<se;){for(Pe=Ee,gt=1,At=l;ft>=se&&P("invalid-input"),yt=r(X.charCodeAt(ft++)),(yt>=l||yt>B((c-Ee)/gt))&&P("overflow"),Ee+=yt*gt,cn=At<=Re?u:At>=Re+d?d:At-Re,!(yt<cn);At+=l)ln=l-cn,gt>B(c/ln)&&P("overflow"),gt*=ln;_e=ie.length+1,Re=v(Ee-Pe,_e,Pe==0),B(Ee/_e)>c-ye&&P("overflow"),ye+=B(Ee/_e),Ee%=_e,ie.splice(Ee++,0,ye)}return j(ie)}function q(X){var ie,se,_e,Ee,ye,Re,We,tt,ft,Pe,gt,At=[],yt,cn,ln,kn;for(X=H(X),yt=X.length,ie=x,se=0,ye=y,Re=0;Re<yt;++Re)gt=X[Re],gt<128&&At.push(M(gt));for(_e=Ee=At.length,Ee&&At.push(E);_e<yt;){for(We=c,Re=0;Re<yt;++Re)gt=X[Re],gt>=ie&><We&&(We=gt);for(cn=_e+1,We-ie>B((c-se)/cn)&&P("overflow"),se+=(We-ie)*cn,ie=We,Re=0;Re<yt;++Re)if(gt=X[Re],gt<ie&&++se>c&&P("overflow"),gt==ie){for(tt=se,ft=l;Pe=ft<=ye?u:ft>=ye+d?d:ft-ye,!(tt<Pe);ft+=l)kn=tt-Pe,ln=l-Pe,At.push(M(b(Pe+kn%ln,0))),tt=B(kn/ln);At.push(M(b(tt,0))),ye=v(se,cn,_e==Ee),se=0,++_e}++se,++ie}return At.join("")}function W(X){return k(X,function(ie){return T.test(ie)?z(ie.slice(4).toLowerCase()):ie})}function Z(X){return k(X,function(ie){return D.test(ie)?"xn--"+q(ie):ie})}if(a={version:"1.3.2",ucs2:{decode:H,encode:j},decode:z,encode:q,toASCII:Z,toUnicode:W},i&&o)if(e.exports==i)o.exports=a;else for(G in a)a.hasOwnProperty(G)&&(i[G]=a[G]);else n.punycode=a})(uo)}($o,$o.exports)),$o.exports}var Za={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}),e_=new f;function re(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}const Rt={};Rt[R.FLOAT]="float",Rt[R.FLOAT_VEC2]="vec2",Rt[R.FLOAT_VEC3]="vec3",Rt[R.FLOAT_VEC4]="vec4",Rt[R.INT]="int",Rt[R.INT_VEC2]="ivec2",Rt[R.INT_VEC3]="ivec3",Rt[R.INT_VEC4]="ivec4",Rt[R.BOOL]="bool",Rt[R.BOOL_VEC2]="bvec2",Rt[R.BOOL_VEC3]="bvec3",Rt[R.BOOL_VEC4]="bvec4",Rt[R.FLOAT_MAT2]="mat2",Rt[R.FLOAT_MAT3]="mat3",Rt[R.FLOAT_MAT4]="mat4",Rt[R.SAMPLER_2D]="sampler2D",Rt[R.SAMPLER_CUBE]="samplerCube",re.prototype.getDeclaration=function(e){let t=`uniform ${Rt[this._datatype]} ${e}`;const n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};const hs={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,e_)}}),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 kn(){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 t_(){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=t_}const Dt={UNSIGNED_BYTE:R.UNSIGNED_BYTE,UNSIGNED_SHORT:R.UNSIGNED_SHORT,UNSIGNED_INT:R.UNSIGNED_INT};Dt.getSizeInBytes=function(e){switch(e){case Dt.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Dt.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Dt.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")},Dt.fromSizeInBytes=function(e){switch(e){case 2:return Dt.UNSIGNED_SHORT;case 4:return Dt.UNSIGNED_INT;case 1:return Dt.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}},Dt.validate=function(e){return h(e)&&(e===Dt.UNSIGNED_BYTE||e===Dt.UNSIGNED_SHORT||e===Dt.UNSIGNED_INT)},Dt.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)},Dt.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)},Dt.fromTypedArray=function(e){if(e instanceof Uint8Array)return Dt.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Dt.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Dt.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};const xt=Object.freeze(Dt),fs={STREAM_DRAW:R.STREAM_DRAW,STATIC_DRAW:R.STATIC_DRAW,DYNAMIC_DRAW:R.DYNAMIC_DRAW,validate:function(e){return e===fs.STREAM_DRAW||e===fs.STATIC_DRAW||e===fs.DYNAMIC_DRAW}},De=Object.freeze(fs);function Ot(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=kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=s,this._buffer=c,this.vertexArrayDestroyable=!0}Ot.createVertexBuffer=function(e){return m.defined("options.context",e.context),new Ot({context:e.context,bufferTarget:R.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},Ot.createIndexBuffer=function(e){if(m.defined("options.context",e.context),!xt.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===xt.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=xt.getSizeInBytes(n),o=new Ot({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(Ot.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),Ot.prototype._getBuffer=function(){return this._buffer},Ot.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)},Ot.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)},Ot.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)},Ot.prototype.isDestroyed=function(){return!1},Ot.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),Qe(this)};let Di;const lt={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[lt.fullscreenElement]}},changeEventName:{get:function(){if(en.supportsFullscreen())return lt.fullscreenchange}},errorEventName:{get:function(){if(en.supportsFullscreen())return lt.fullscreenerror}},enabled:{get:function(){if(en.supportsFullscreen())return document[lt.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 lt.requestFullscreen="requestFullscreen",lt.exitFullscreen="exitFullscreen",lt.fullscreenEnabled="fullscreenEnabled",lt.fullscreenElement="fullscreenElement",lt.fullscreenchange="fullscreenchange",lt.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"?(lt.requestFullscreen=n,Di=!0):(n=`${s}RequestFullScreen`,typeof e[n]=="function"&&(lt.requestFullscreen=n,Di=!0)),n=`${s}ExitFullscreen`,typeof document[n]=="function"?lt.exitFullscreen=n:(n=`${s}CancelFullScreen`,typeof document[n]=="function"&&(lt.exitFullscreen=n)),n=`${s}FullscreenEnabled`,document[n]!==void 0?lt.fullscreenEnabled=n:(n=`${s}FullScreenEnabled`,document[n]!==void 0&&(lt.fullscreenEnabled=n)),n=`${s}FullscreenElement`,document[n]!==void 0?lt.fullscreenElement=n:(n=`${s}FullScreenElement`,document[n]!==void 0&&(lt.fullscreenElement=n)),n=`${s}fullscreenchange`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenChange"),lt.fullscreenchange=n),n=`${s}fullscreenerror`,document[`on${n}`]!==void 0&&(s==="ms"&&(n="MSFullscreenError"),lt.fullscreenerror=n)}return Di},en.requestFullscreen=function(e,t){en.supportsFullscreen()&&e[lt.requestFullscreen]({vrDisplay:t})},en.exitFullscreen=function(){en.supportsFullscreen()&&document[lt.exitFullscreen]()},en._names=lt;let Gt;typeof navigator<"u"?Gt=navigator:Gt={};function Wi(e){const t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}let us,Eh;function La(){if(!h(us)&&(us=!1,!_s())){const e=/ Chrome\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(us=!0,Eh=Wi(e[1]))}return us}function n_(){return La()&&Eh}let ds,Th;function bh(){if(!h(ds)&&(ds=!1,!La()&&!_s()&&/ Safari\/[\.0-9]+/.test(Gt.userAgent))){const e=/ Version\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ds=!0,Th=Wi(e[1]))}return ds}function i_(){return bh()&&Th}let ps,Ma;function wh(){if(!h(ps)){ps=!1;const e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Gt.userAgent);e!==null&&(ps=!0,Ma=Wi(e[1]),Ma.isNightly=!!e[2])}return ps}function o_(){return wh()&&Ma}let Xo,Ua;function Sh(){if(!h(Xo)){Xo=!1;let e;Gt.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Gt.userAgent),e!==null&&(Xo=!0,Ua=Wi(e[1]))):Gt.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Gt.userAgent),e!==null&&(Xo=!0,Ua=Wi(e[1])))}return Xo}function r_(){return Sh()&&Ua}let ms,Ah;function _s(){if(!h(ms)){ms=!1;const e=/ Edg\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(ms=!0,Ah=Wi(e[1]))}return ms}function s_(){return _s()&&Ah}let gs,Va;function ys(){if(!h(gs)){gs=!1;const e=/Firefox\/([\.0-9]+)/.exec(Gt.userAgent);e!==null&&(gs=!0,Va=Wi(e[1]))}return gs}let ka;function a_(){return h(ka)||(ka=/Windows/i.test(Gt.appVersion)),ka}let Ga;function c_(){return h(Ga)||(Ga=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Ga}function l_(){return ys()&&Va}let qa;function h_(){return h(qa)||(qa=!ys()&&typeof PointerEvent<"u"&&(!h(Gt.pointerEnabled)||Gt.pointerEnabled)),qa}let Dh,xs;function Oh(){if(!h(xs)){const e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const t=e.style.imageRendering;xs=h(t)&&t!=="",xs&&(Dh=t)}return xs}function f_(){return Oh()?Dh: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 go=[];typeof ArrayBuffer<"u"&&(go.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&go.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&go.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&go.push(BigInt64Array),typeof BigUint64Array<"u"&&go.push(BigUint64Array));const mt={isChrome:La,chromeVersion:n_,isSafari:bh,safariVersion:i_,isWebkit:wh,webkitVersion:o_,isInternetExplorer:Sh,internetExplorerVersion:r_,isEdge:_s,edgeVersion:s_,isFirefox:ys,firefoxVersion:l_,isWindows:a_,isIPadOrIOS:c_,hardwareConcurrency:_(Gt.hardwareConcurrency,3),supportsPointerEvents:h_,supportsImageRenderingPixelated:Oh,supportsWebP:qt,imageRenderingValue:f_,typedArrayTypes:go};mt.supportsBasis=function(e){return mt.supportsWebAssembly()&&e.context.supportsBasis},mt.supportsFullscreen=function(){return en.supportsFullscreen()},mt.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},mt.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},mt.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},mt.supportsBigInt=function(){return typeof BigInt<"u"},mt.supportsWebWorkers=function(){return typeof Worker<"u"},mt.supportsWebAssembly=function(){return typeof WebAssembly<"u"},mt.supportsWebgl2=function(e){return m.defined("scene",e),e.context.webgl2},mt.supportsEsmWebWorkers=function(){return!ys()||parseInt(Va)>=114};function Ha(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 w(e,t,n,i){this.red=_(e,1),this.green=_(t,1),this.blue=_(n,1),this.alpha=_(i,1)}w.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 w(e.x,e.y,e.z,e.w)},w.fromBytes=function(e,t,n,i,o){return e=w.byteToFloat(_(e,255)),t=w.byteToFloat(_(t,255)),n=w.byteToFloat(_(n,255)),i=w.byteToFloat(_(i,255)),h(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new w(e,t,n,i)},w.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 w(e.red,e.green,e.blue,t)};let Wa,ja,si;mt.supportsTypedArrays()&&(Wa=new ArrayBuffer(4),ja=new Uint32Array(Wa),si=new Uint8Array(Wa)),w.fromRgba=function(e,t){return ja[0]=e,w.fromBytes(si[0],si[1],si[2],si[3],t)},w.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=Ha(u,l,e+1/3),a=Ha(u,l,e),c=Ha(u,l,e-1/3)}return h(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=i,o):new w(s,a,c,i)},w.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 w(n,i,o,s)};const u_=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,d_=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,p_=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,m_=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;w.fromCssColorString=function(e,t){m.typeOf.string("color",e),h(t)||(t=new w),e=e.trim();const n=w[e.toUpperCase()];if(h(n))return w.clone(n,t),t;let i=u_.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=d_.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=p_.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=m_.exec(e),i!==null?w.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(_(i[4],"1.0")),t):(t=void 0,t))))},w.packedLength=4,w.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},w.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new w),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n},w.byteToFloat=function(e){return e/255},w.floatToByte=function(e){return e===1?255:e*256|0},w.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 w(e.red,e.green,e.blue,e.alpha)},w.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},w.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]},w.prototype.clone=function(e){return w.clone(this,e)},w.prototype.equals=function(e){return w.equals(this,e)},w.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},w.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`},w.prototype.toCssColorString=function(){const e=w.floatToByte(this.red),t=w.floatToByte(this.green),n=w.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`},w.prototype.toCssHexString=function(){let e=w.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=w.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=w.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=w.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`},w.prototype.toBytes=function(e){const t=w.floatToByte(this.red),n=w.floatToByte(this.green),i=w.floatToByte(this.blue),o=w.floatToByte(this.alpha);return h(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]},w.prototype.toRgba=function(){return si[0]=w.floatToByte(this.red),si[1]=w.floatToByte(this.green),si[2]=w.floatToByte(this.blue),si[3]=w.floatToByte(this.alpha),ja[0]},w.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},w.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},w.prototype.withAlpha=function(e,t){return w.fromAlpha(this,e,t)},w.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},w.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},w.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},w.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},w.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},w.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},w.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},w.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},w.ALICEBLUE=Object.freeze(w.fromCssColorString("#F0F8FF")),w.ANTIQUEWHITE=Object.freeze(w.fromCssColorString("#FAEBD7")),w.AQUA=Object.freeze(w.fromCssColorString("#00FFFF")),w.AQUAMARINE=Object.freeze(w.fromCssColorString("#7FFFD4")),w.AZURE=Object.freeze(w.fromCssColorString("#F0FFFF")),w.BEIGE=Object.freeze(w.fromCssColorString("#F5F5DC")),w.BISQUE=Object.freeze(w.fromCssColorString("#FFE4C4")),w.BLACK=Object.freeze(w.fromCssColorString("#000000")),w.BLANCHEDALMOND=Object.freeze(w.fromCssColorString("#FFEBCD")),w.BLUE=Object.freeze(w.fromCssColorString("#0000FF")),w.BLUEVIOLET=Object.freeze(w.fromCssColorString("#8A2BE2")),w.BROWN=Object.freeze(w.fromCssColorString("#A52A2A")),w.BURLYWOOD=Object.freeze(w.fromCssColorString("#DEB887")),w.CADETBLUE=Object.freeze(w.fromCssColorString("#5F9EA0")),w.CHARTREUSE=Object.freeze(w.fromCssColorString("#7FFF00")),w.CHOCOLATE=Object.freeze(w.fromCssColorString("#D2691E")),w.CORAL=Object.freeze(w.fromCssColorString("#FF7F50")),w.CORNFLOWERBLUE=Object.freeze(w.fromCssColorString("#6495ED")),w.CORNSILK=Object.freeze(w.fromCssColorString("#FFF8DC")),w.CRIMSON=Object.freeze(w.fromCssColorString("#DC143C")),w.CYAN=Object.freeze(w.fromCssColorString("#00FFFF")),w.DARKBLUE=Object.freeze(w.fromCssColorString("#00008B")),w.DARKCYAN=Object.freeze(w.fromCssColorString("#008B8B")),w.DARKGOLDENROD=Object.freeze(w.fromCssColorString("#B8860B")),w.DARKGRAY=Object.freeze(w.fromCssColorString("#A9A9A9")),w.DARKGREEN=Object.freeze(w.fromCssColorString("#006400")),w.DARKGREY=w.DARKGRAY,w.DARKKHAKI=Object.freeze(w.fromCssColorString("#BDB76B")),w.DARKMAGENTA=Object.freeze(w.fromCssColorString("#8B008B")),w.DARKOLIVEGREEN=Object.freeze(w.fromCssColorString("#556B2F")),w.DARKORANGE=Object.freeze(w.fromCssColorString("#FF8C00")),w.DARKORCHID=Object.freeze(w.fromCssColorString("#9932CC")),w.DARKRED=Object.freeze(w.fromCssColorString("#8B0000")),w.DARKSALMON=Object.freeze(w.fromCssColorString("#E9967A")),w.DARKSEAGREEN=Object.freeze(w.fromCssColorString("#8FBC8F")),w.DARKSLATEBLUE=Object.freeze(w.fromCssColorString("#483D8B")),w.DARKSLATEGRAY=Object.freeze(w.fromCssColorString("#2F4F4F")),w.DARKSLATEGREY=w.DARKSLATEGRAY,w.DARKTURQUOISE=Object.freeze(w.fromCssColorString("#00CED1")),w.DARKVIOLET=Object.freeze(w.fromCssColorString("#9400D3")),w.DEEPPINK=Object.freeze(w.fromCssColorString("#FF1493")),w.DEEPSKYBLUE=Object.freeze(w.fromCssColorString("#00BFFF")),w.DIMGRAY=Object.freeze(w.fromCssColorString("#696969")),w.DIMGREY=w.DIMGRAY,w.DODGERBLUE=Object.freeze(w.fromCssColorString("#1E90FF")),w.FIREBRICK=Object.freeze(w.fromCssColorString("#B22222")),w.FLORALWHITE=Object.freeze(w.fromCssColorString("#FFFAF0")),w.FORESTGREEN=Object.freeze(w.fromCssColorString("#228B22")),w.FUCHSIA=Object.freeze(w.fromCssColorString("#FF00FF")),w.GAINSBORO=Object.freeze(w.fromCssColorString("#DCDCDC")),w.GHOSTWHITE=Object.freeze(w.fromCssColorString("#F8F8FF")),w.GOLD=Object.freeze(w.fromCssColorString("#FFD700")),w.GOLDENROD=Object.freeze(w.fromCssColorString("#DAA520")),w.GRAY=Object.freeze(w.fromCssColorString("#808080")),w.GREEN=Object.freeze(w.fromCssColorString("#008000")),w.GREENYELLOW=Object.freeze(w.fromCssColorString("#ADFF2F")),w.GREY=w.GRAY,w.HONEYDEW=Object.freeze(w.fromCssColorString("#F0FFF0")),w.HOTPINK=Object.freeze(w.fromCssColorString("#FF69B4")),w.INDIANRED=Object.freeze(w.fromCssColorString("#CD5C5C")),w.INDIGO=Object.freeze(w.fromCssColorString("#4B0082")),w.IVORY=Object.freeze(w.fromCssColorString("#FFFFF0")),w.KHAKI=Object.freeze(w.fromCssColorString("#F0E68C")),w.LAVENDER=Object.freeze(w.fromCssColorString("#E6E6FA")),w.LAVENDAR_BLUSH=Object.freeze(w.fromCssColorString("#FFF0F5")),w.LAWNGREEN=Object.freeze(w.fromCssColorString("#7CFC00")),w.LEMONCHIFFON=Object.freeze(w.fromCssColorString("#FFFACD")),w.LIGHTBLUE=Object.freeze(w.fromCssColorString("#ADD8E6")),w.LIGHTCORAL=Object.freeze(w.fromCssColorString("#F08080")),w.LIGHTCYAN=Object.freeze(w.fromCssColorString("#E0FFFF")),w.LIGHTGOLDENRODYELLOW=Object.freeze(w.fromCssColorString("#FAFAD2")),w.LIGHTGRAY=Object.freeze(w.fromCssColorString("#D3D3D3")),w.LIGHTGREEN=Object.freeze(w.fromCssColorString("#90EE90")),w.LIGHTGREY=w.LIGHTGRAY,w.LIGHTPINK=Object.freeze(w.fromCssColorString("#FFB6C1")),w.LIGHTSEAGREEN=Object.freeze(w.fromCssColorString("#20B2AA")),w.LIGHTSKYBLUE=Object.freeze(w.fromCssColorString("#87CEFA")),w.LIGHTSLATEGRAY=Object.freeze(w.fromCssColorString("#778899")),w.LIGHTSLATEGREY=w.LIGHTSLATEGRAY,w.LIGHTSTEELBLUE=Object.freeze(w.fromCssColorString("#B0C4DE")),w.LIGHTYELLOW=Object.freeze(w.fromCssColorString("#FFFFE0")),w.LIME=Object.freeze(w.fromCssColorString("#00FF00")),w.LIMEGREEN=Object.freeze(w.fromCssColorString("#32CD32")),w.LINEN=Object.freeze(w.fromCssColorString("#FAF0E6")),w.MAGENTA=Object.freeze(w.fromCssColorString("#FF00FF")),w.MAROON=Object.freeze(w.fromCssColorString("#800000")),w.MEDIUMAQUAMARINE=Object.freeze(w.fromCssColorString("#66CDAA")),w.MEDIUMBLUE=Object.freeze(w.fromCssColorString("#0000CD")),w.MEDIUMORCHID=Object.freeze(w.fromCssColorString("#BA55D3")),w.MEDIUMPURPLE=Object.freeze(w.fromCssColorString("#9370DB")),w.MEDIUMSEAGREEN=Object.freeze(w.fromCssColorString("#3CB371")),w.MEDIUMSLATEBLUE=Object.freeze(w.fromCssColorString("#7B68EE")),w.MEDIUMSPRINGGREEN=Object.freeze(w.fromCssColorString("#00FA9A")),w.MEDIUMTURQUOISE=Object.freeze(w.fromCssColorString("#48D1CC")),w.MEDIUMVIOLETRED=Object.freeze(w.fromCssColorString("#C71585")),w.MIDNIGHTBLUE=Object.freeze(w.fromCssColorString("#191970")),w.MINTCREAM=Object.freeze(w.fromCssColorString("#F5FFFA")),w.MISTYROSE=Object.freeze(w.fromCssColorString("#FFE4E1")),w.MOCCASIN=Object.freeze(w.fromCssColorString("#FFE4B5")),w.NAVAJOWHITE=Object.freeze(w.fromCssColorString("#FFDEAD")),w.NAVY=Object.freeze(w.fromCssColorString("#000080")),w.OLDLACE=Object.freeze(w.fromCssColorString("#FDF5E6")),w.OLIVE=Object.freeze(w.fromCssColorString("#808000")),w.OLIVEDRAB=Object.freeze(w.fromCssColorString("#6B8E23")),w.ORANGE=Object.freeze(w.fromCssColorString("#FFA500")),w.ORANGERED=Object.freeze(w.fromCssColorString("#FF4500")),w.ORCHID=Object.freeze(w.fromCssColorString("#DA70D6")),w.PALEGOLDENROD=Object.freeze(w.fromCssColorString("#EEE8AA")),w.PALEGREEN=Object.freeze(w.fromCssColorString("#98FB98")),w.PALETURQUOISE=Object.freeze(w.fromCssColorString("#AFEEEE")),w.PALEVIOLETRED=Object.freeze(w.fromCssColorString("#DB7093")),w.PAPAYAWHIP=Object.freeze(w.fromCssColorString("#FFEFD5")),w.PEACHPUFF=Object.freeze(w.fromCssColorString("#FFDAB9")),w.PERU=Object.freeze(w.fromCssColorString("#CD853F")),w.PINK=Object.freeze(w.fromCssColorString("#FFC0CB")),w.PLUM=Object.freeze(w.fromCssColorString("#DDA0DD")),w.POWDERBLUE=Object.freeze(w.fromCssColorString("#B0E0E6")),w.PURPLE=Object.freeze(w.fromCssColorString("#800080")),w.RED=Object.freeze(w.fromCssColorString("#FF0000")),w.ROSYBROWN=Object.freeze(w.fromCssColorString("#BC8F8F")),w.ROYALBLUE=Object.freeze(w.fromCssColorString("#4169E1")),w.SADDLEBROWN=Object.freeze(w.fromCssColorString("#8B4513")),w.SALMON=Object.freeze(w.fromCssColorString("#FA8072")),w.SANDYBROWN=Object.freeze(w.fromCssColorString("#F4A460")),w.SEAGREEN=Object.freeze(w.fromCssColorString("#2E8B57")),w.SEASHELL=Object.freeze(w.fromCssColorString("#FFF5EE")),w.SIENNA=Object.freeze(w.fromCssColorString("#A0522D")),w.SILVER=Object.freeze(w.fromCssColorString("#C0C0C0")),w.SKYBLUE=Object.freeze(w.fromCssColorString("#87CEEB")),w.SLATEBLUE=Object.freeze(w.fromCssColorString("#6A5ACD")),w.SLATEGRAY=Object.freeze(w.fromCssColorString("#708090")),w.SLATEGREY=w.SLATEGRAY,w.SNOW=Object.freeze(w.fromCssColorString("#FFFAFA")),w.SPRINGGREEN=Object.freeze(w.fromCssColorString("#00FF7F")),w.STEELBLUE=Object.freeze(w.fromCssColorString("#4682B4")),w.TAN=Object.freeze(w.fromCssColorString("#D2B48C")),w.TEAL=Object.freeze(w.fromCssColorString("#008080")),w.THISTLE=Object.freeze(w.fromCssColorString("#D8BFD8")),w.TOMATO=Object.freeze(w.fromCssColorString("#FF6347")),w.TURQUOISE=Object.freeze(w.fromCssColorString("#40E0D0")),w.VIOLET=Object.freeze(w.fromCssColorString("#EE82EE")),w.WHEAT=Object.freeze(w.fromCssColorString("#F5DEB3")),w.WHITE=Object.freeze(w.fromCssColorString("#FFFFFF")),w.WHITESMOKE=Object.freeze(w.fromCssColorString("#F5F5F5")),w.YELLOW=Object.freeze(w.fromCssColorString("#FFFF00")),w.YELLOWGREEN=Object.freeze(w.fromCssColorString("#9ACD32")),w.TRANSPARENT=Object.freeze(new w(0,0,0,0));const zt=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 Cs=new U;U.distance=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,Cs),U.magnitude(Cs)},U.distanceSquared=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.subtract(e,t,Cs),U.magnitudeSquared(Cs)},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 vh=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,vh),i=U.multiplyByScalar(e,1-n,i),U.add(vh,i,i)};const Ih=new U,Rh=new U;U.angleBetween=function(e,t){return m.typeOf.object("left",e),m.typeOf.object("right",t),U.normalize(e,Ih),U.normalize(t,Rh),S.acosClamped(U.dot(Ih,Rh))};const __=new U;U.mostOrthogonalAxis=function(e,t){m.typeOf.object("cartesian",e),m.typeOf.object("result",t);const n=U.normalize(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 g_=new f,y_=new f;function zh(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),T=f.multiplyByScalar(e,E,g_);if(x<i)return isFinite(E)?f.clone(T,o):void 0;const D=n.x,A=n.y,O=n.z,I=y_;I.x=T.x*D*2,I.y=T.y*A*2,I.z=T.z*O*2;let B=(1-E)*f.magnitude(e)/(.5*f.magnitude(I)),M=0,q,P,k,V,H,j,r,b,v,z,G;do{B-=M,k=1/(1+B*D),V=1/(1+B*A),H=1/(1+B*O),j=k*k,r=V*V,b=H*H,v=j*k,z=r*V,G=b*H,q=p*j+g*r+y*b-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*k,o.y=a*V,o.z=c*H,o):new f(s*k,a*V,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 x_=new f,C_=new f,E_=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=zh(e,i,o,s,C_);if(!h(a))return;let c=f.multiplyComponents(a,o,x_);c=f.normalize(c,c);const l=f.subtract(e,a,E_),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 Ph(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,Ph(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)&&Ph(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 T_=new f,b_=new f;le.prototype.cartographicToCartesian=function(e,t){const n=T_,i=b_;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 w_=new f,S_=new f,A_=new f;le.prototype.cartesianToCartographic=function(e,t){const n=this.scaleToGeodeticSurface(e,S_);if(!h(n))return;const i=this.geodeticSurfaceNormal(n,w_),o=f.subtract(e,n,A_),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 zh(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 D_=new f;le.prototype.getLocalCurvature=function(e,t){m.typeOf.object("surfacePosition",e),h(t)||(t=new U);const n=this.getSurfaceNormalIntersectionWithZAxis(e,0,D_),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 O_=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],v_=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Bh(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*O_[a];s+=v_[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 Bh(i,o,function(d){const p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Bh(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 Ct=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function $o(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 Ya(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}function Xa(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 Nh=[31,28,31,30,31,30,31,31,30,31,30,31];function $a(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(),T(),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 T(){const D=t===2&&Xa(e)?Nh[t-1]+1:Nh[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}),Fh=new $a,Es=[31,28,31,30,31,30,31,31,30,31,30,31],Ts=29;function Za(e,t){return $.compare(e.julianDate,t.julianDate)}const yo=new Ge;function bs(e){yo.julianDate=e;const t=$.leapSeconds;let n=$o(t,yo,Za);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 Lh(e,t){yo.julianDate=e;const n=$.leapSeconds;let i=$o(n,yo,Za);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 Ka(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 I_=/^(\d{4})$/,R_=/^(\d{4})-(\d{2})$/,z_=/^(\d{4})-?(\d{3})$/,P_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,B_=/^(\d{4})-?(\d{2})-?(\d{2})$/,Qa=/([Z+\-])?(\d{2})?:?(\d{2})?$/,N_=/^(\d{2})(\.\d+)?/.source+Qa.source,F_=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Qa.source,L_=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Qa.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&&bs(this)}$.fromGregorianDate=function(e,t){if(!(e instanceof $a))throw new C("date must be a valid GregorianDate.");const n=Ka(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return h(t)?(Oi(n[0],n[1],t),bs(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=Ka(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return h(t)?(Oi(n[0],n[1],t),bs(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(B_),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(R_),n!==null)i=+n[1],o=+n[2];else if(n=d.match(I_),n!==null)i=+n[1];else{let A;if(n=d.match(z_),n!==null){if(i=+n[1],A=+n[2],y=Xa(i),A<1||y&&A>366||!y&&A>365)throw new C(An)}else if(n=d.match(P_),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=Xa(i),o<1||o>12||s<1||(o!==2||!y)&&s>Es[o-1]||y&&o===2&&s>Ts)throw new C(An);let E;if(h(p)){if(n=p.match(L_),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(F_),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(N_),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 T=l===60;for(T&&l--;c>=60;)c-=60,a++;for(;a>=24;)a-=24,s++;for(g=y&&o===2?Ts:Es[o-1];s>g;)s-=g,o++,o>12&&(o-=12,i++),g=y&&o===2?Ts:Es[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?Ts:Es[o-1],s+=g;const D=Ka(i,o,s,a,c,l,u);return h(t)?(Oi(D[0],D[1],t),bs(t)):t=new $(D[0],D[1],ve.UTC),T&&$.addSeconds(t,1,t),t},$.now=function(e){return $.fromDate(new Date,e)};const ws=new $(0,0,ve.TAI);$.toGregorianDate=function(e,t){if(!h(e))throw new C("julianDate is required.");let n=!1,i=Lh(e,ws);h(i)||($.addSeconds(e,-1,ws),i=Lh(ws,ws),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 T=x|0;const D=(x-T)/nt.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(T+=1),h(t)?(t.year=g,t.month=p,t.day=d,t.hour=y,t.minute=E,t.second=T,t.millisecond=D,t.isLeapSecond=n,t):new $a(g,p,d,y,E,T,D,n)},$.toDate=function(e){if(!h(e))throw new C("julianDate is required.");const t=$.toGregorianDate(e,Fh);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,Fh);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){yo.julianDate=e;const t=$.leapSeconds;let n=$o(t,yo,Za);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 Mh={exports:{}},Zo={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */Zo.exports;var Uh;function M_(){return Uh||(Uh=1,function(e,t){(function(n){var i=t&&!t.nodeType&&t,o=e&&!e.nodeType&&e,s=typeof uo=="object"&&uo;(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="-",T=/^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 k(X,ie){for(var se=X.length,ge=[];se--;)ge[se]=ie(X[se]);return ge}function V(X,ie){var se=X.split("@"),ge="";se.length>1&&(ge=se[0]+"@",X=se[1]),X=X.replace(A,".");var Te=X.split("."),xe=k(Te,ie).join(".");return ge+xe}function H(X){for(var ie=[],se=0,ge=X.length,Te,xe;se<ge;)Te=X.charCodeAt(se++),Te>=55296&&Te<=56319&&se<ge?(xe=X.charCodeAt(se++),(xe&64512)==56320?ie.push(((Te&1023)<<10)+(xe&1023)+65536):(ie.push(Te),se--)):ie.push(Te);return ie}function j(X){return k(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 b(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,Te=0,xe=x,ze=y,je,tt,ut,Be,gt,At,yt,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=Te,gt=1,At=l;ut>=se&&P("invalid-input"),yt=r(X.charCodeAt(ut++)),(yt>=l||yt>B((c-Te)/gt))&&P("overflow"),Te+=yt*gt,cn=At<=ze?u:At>=ze+d?d:At-ze,!(yt<cn);At+=l)ln=l-cn,gt>B(c/ln)&&P("overflow"),gt*=ln;ge=ie.length+1,ze=v(Te-Be,ge,Be==0),B(Te/ge)>c-xe&&P("overflow"),xe+=B(Te/ge),Te%=ge,ie.splice(Te++,0,xe)}return j(ie)}function G(X){var ie,se,ge,Te,xe,ze,je,tt,ut,Be,gt,At=[],yt,cn,ln,Vn;for(X=H(X),yt=X.length,ie=x,se=0,xe=y,ze=0;ze<yt;++ze)gt=X[ze],gt<128&&At.push(M(gt));for(ge=Te=At.length,Te&&At.push(E);ge<yt;){for(je=c,ze=0;ze<yt;++ze)gt=X[ze],gt>=ie&><je&&(je=gt);for(cn=ge+1,je-ie>B((c-se)/cn)&&P("overflow"),se+=(je-ie)*cn,ie=je,ze=0;ze<yt;++ze)if(gt=X[ze],gt<ie&&++se>c&&P("overflow"),gt==ie){for(tt=se,ut=l;Be=ut<=xe?u:ut>=xe+d?d:ut-xe,!(tt<Be);ut+=l)Vn=tt-Be,ln=l-Be,At.push(M(b(Be+Vn%ln,0))),tt=B(Vn/ln);At.push(M(b(tt,0))),xe=v(se,cn,ge==Te),se=0,++ge}++se,++ie}return At.join("")}function W(X){return V(X,function(ie){return T.test(ie)?z(ie.slice(4).toLowerCase()):ie})}function Z(X){return V(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})(uo)}(Zo,Zo.exports)),Zo.exports}var Ja={exports:{}};/*!
|
|
9
9
|
* URI.js - Mutating URLs
|
|
10
10
|
* IPv6 Support
|
|
11
11
|
*
|
|
@@ -17,7 +17,7 @@ ${this.stack.toString()}`),e};function N(e,t,n,i,o,s,a,c,l,u,d,p,g,y,x,E){this[0
|
|
|
17
17
|
* Licensed under
|
|
18
18
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
19
19
|
*
|
|
20
|
-
*/var
|
|
20
|
+
*/var Vh;function U_(){return Vh||(Vh=1,function(e){(function(t,n){e.exports?e.exports=n():t.IPv6=n(t)})(uo,function(t){var n=t&&t.IPv6;function i(s){var a=s.toLowerCase(),c=a.split(":"),l=c.length,u=8;c[0]===""&&c[1]===""&&c[2]===""?(c.shift(),c.shift()):c[0]===""&&c[1]===""?c.shift():c[l-1]===""&&c[l-2]===""&&c.pop(),l=c.length,c[l-1].indexOf(".")!==-1&&(u=7);var d;for(d=0;d<l&&c[d]!=="";d++);if(d<u)for(c.splice(d,1,"0000");c.length<u;)c.splice(d,0,"0000");for(var p,g=0;g<u;g++){p=c[g].split("");for(var y=0;y<3&&(p[0]==="0"&&p.length>1);y++)p.splice(0,1);c[g]=p.join("")}var x=-1,E=0,T=0,D=-1,A=!1;for(g=0;g<u;g++)A?c[g]==="0"?T+=1:(A=!1,T>E&&(x=D,E=T)):c[g]==="0"&&(A=!0,D=g,T=1);T>E&&(x=D,E=T),E>1&&c.splice(x,E,""),l=c.length;var O="";for(c[0]===""&&(O=":"),g=0;g<l&&(O+=c[g],g!==l-1);g++)O+=":";return c[l-1]===""&&(O+=":"),O}function o(){return t.IPv6===this&&(t.IPv6=n),this}return{best:i,noConflict:o}})}(Ja)),Ja.exports}var ec={exports:{}};/*!
|
|
21
21
|
* URI.js - Mutating URLs
|
|
22
22
|
* Second Level Domain (SLD) Support
|
|
23
23
|
*
|
|
@@ -29,7 +29,7 @@ ${this.stack.toString()}`),e};function N(e,t,n,i,o,s,a,c,l,u,d,p,g,y,x,E){this[0
|
|
|
29
29
|
* Licensed under
|
|
30
30
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
31
31
|
*
|
|
32
|
-
*/var
|
|
32
|
+
*/var kh;function V_(){return kh||(kh=1,function(e){(function(t,n){e.exports?e.exports=n():t.SecondLevelDomains=n(t)})(uo,function(t){var n=t&&t.SecondLevelDomains,i={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return!1;var a=o.lastIndexOf(".",s-1);if(a<=0||a>=s-1)return!1;var c=i.list[o.slice(s+1)];return c?c.indexOf(" "+o.slice(a+1,s)+" ")>=0:!1},is:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return!1;var a=o.lastIndexOf(".",s-1);if(a>=0)return!1;var c=i.list[o.slice(s+1)];return c?c.indexOf(" "+o.slice(0,s)+" ")>=0:!1},get:function(o){var s=o.lastIndexOf(".");if(s<=0||s>=o.length-1)return null;var a=o.lastIndexOf(".",s-1);if(a<=0||a>=s-1)return null;var c=i.list[o.slice(s+1)];return!c||c.indexOf(" "+o.slice(a+1,s)+" ")<0?null:o.slice(a+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=n),this}};return i})}(ec)),ec.exports}/*!
|
|
33
33
|
* URI.js - Mutating URLs
|
|
34
34
|
*
|
|
35
35
|
* Version: 1.19.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(F_(),M_(),U_()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(uo,function(t,n,i,o){var s=o&&o.URI;function a(r,b){var v=arguments.length>=1,z=arguments.length>=2;if(!(this instanceof a))return v?z?new a(r,b):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),b!==void 0?this.absoluteTo(b):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,b){var v={},z,q;if(p(b)==="RegExp")v=null;else if(g(b))for(z=0,q=b.length;z<q;z++)v[b[z]]=!0;else v[b]=!0;for(z=0,q=r.length;z<q;z++){var W=v&&v[r[z]]!==void 0||!v&&b.test(r[z]);W&&(r.splice(z,1),q--,z--)}return r}function x(r,b){var v,z;if(g(b)){for(v=0,z=b.length;v<z;v++)if(!x(r,b[v]))return!1;return!0}var q=p(b);for(v=0,z=r.length;v<z;v++)if(q==="RegExp"){if(typeof r[v]=="string"&&r[v].match(b))return!0}else if(r[v]===b)return!0;return!1}function E(r,b){if(!g(r)||!g(b)||r.length!==b.length)return!1;r.sort(),b.sort();for(var v=0,z=r.length;v<z;v++)if(r[v]!==b[v])return!1;return!0}function T(r){var b=/^\/+|\/+$/g;return r.replace(b,"")}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 b=r.nodeName.toLowerCase();if(!(b==="input"&&r.type!=="image"))return a.domAttributes[b]}};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,b){var v=a.encode(r+"");return b===void 0&&(b=a.escapeQuerySpace),b?v.replace(/%20/g,"+"):v},a.decodeQuery=function(r,b){r+="",b===void 0&&(b=a.escapeQuerySpace);try{return a.decode(b?r.replace(/\+/g,"%20"):r)}catch{return r}};var O={encode:"encode",decode:"decode"},I,B=function(r,b){return function(v){try{return a[b](v+"").replace(a.characters[r][b].expression,function(z){return a.characters[r][b].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,b,v){return function(z){var q;v?q=function(ie){return a[b](a[v](ie))}:q=a[b];for(var W=(z+"").split(r),Z=0,X=W.length;Z<X;Z++)W[Z]=q(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,b){var v;return b||(b={preventInvalidHostname:a.preventInvalidHostname}),r=r.replace(a.leading_whitespace_expression,""),r=r.replace(a.ascii_tab_whitespace,""),v=r.indexOf("#"),v>-1&&(b.fragment=r.substring(v+1)||null,r=r.substring(0,v)),v=r.indexOf("?"),v>-1&&(b.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)==="//"?(b.protocol=null,r=r.substring(2),r=a.parseAuthority(r,b)):(v=r.indexOf(":"),v>-1&&(b.protocol=r.substring(0,v)||null,b.protocol&&!b.protocol.match(a.protocol_expression)?b.protocol=void 0:r.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(r=r.substring(v+3),r=a.parseAuthority(r,b)):(r=r.substring(v+1),b.urn=!0))),b.path=r,b},a.parseHost=function(r,b){r||(r=""),r=r.replace(/\\/g,"/");var v=r.indexOf("/"),z,q;if(v===-1&&(v=r.length),r.charAt(0)==="[")z=r.indexOf("]"),b.hostname=r.substring(1,z)||null,b.port=r.substring(z+2,v)||null,b.port==="/"&&(b.port=null);else{var W=r.indexOf(":"),Z=r.indexOf("/"),X=r.indexOf(":",W+1);X!==-1&&(Z===-1||X<Z)?(b.hostname=r.substring(0,v)||null,b.port=null):(q=r.substring(0,v).split(":"),b.hostname=q[0]||null,b.port=q[1]||null)}return b.hostname&&r.substring(v).charAt(0)!=="/"&&(v++,r="/"+r),b.preventInvalidHostname&&a.ensureValidHostname(b.hostname,b.protocol),b.port&&a.ensureValidPort(b.port),r.substring(v)||"/"},a.parseAuthority=function(r,b){return r=a.parseUserinfo(r,b),a.parseHost(r,b)},a.parseUserinfo=function(r,b){var v=r,z=r.indexOf("\\");z!==-1&&(r=r.replace(/\\/g,"/"));var q=r.indexOf("/"),W=r.lastIndexOf("@",q>-1?q:r.length-1),Z;return W>-1&&(q===-1||W<q)?(Z=r.substring(0,W).split(":"),b.username=Z[0]?a.decode(Z[0]):null,Z.shift(),b.password=Z[0]?a.decode(Z.join(":")):null,r=v.substring(W+1)):(b.username=null,b.password=null),r},a.parseQuery=function(r,b){if(!r)return{};if(r=r.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!r)return{};for(var v={},z=r.split("&"),q=z.length,W,Z,X,ie=0;ie<q;ie++)W=z[ie].split("="),Z=a.decodeQuery(W.shift(),b),X=W.length?a.decodeQuery(W.join("="),b):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 b="",v=!1;return r.protocol&&(b+=r.protocol+":"),!r.urn&&(b||r.hostname)&&(b+="//",v=!0),b+=a.buildAuthority(r)||"",typeof r.path=="string"&&(r.path.charAt(0)!=="/"&&v&&(b+="/"),b+=r.path),typeof r.query=="string"&&r.query&&(b+="?"+r.query),typeof r.fragment=="string"&&r.fragment&&(b+="#"+r.fragment),b},a.buildHost=function(r){var b="";if(r.hostname)a.ip6_expression.test(r.hostname)?b+="["+r.hostname+"]":b+=r.hostname;else return"";return r.port&&(b+=":"+r.port),b},a.buildAuthority=function(r){return a.buildUserinfo(r)+a.buildHost(r)},a.buildUserinfo=function(r){var b="";return r.username&&(b+=a.encode(r.username)),r.password&&(b+=":"+a.encode(r.password)),b&&(b+="@"),b},a.buildQuery=function(r,b,v){var z="",q,W,Z,X;for(W in r)if(W!=="__proto__"&&u.call(r,W))if(g(r[W]))for(q={},Z=0,X=r[W].length;Z<X;Z++)r[W][Z]!==void 0&&q[r[W][Z]+""]===void 0&&(z+="&"+a.buildQueryParameter(W,r[W][Z],v),b!==!0&&(q[r[W][Z]+""]=!0));else r[W]!==void 0&&(z+="&"+a.buildQueryParameter(W,r[W],v));return z.substring(1)},a.buildQueryParameter=function(r,b,v){return a.encodeQuery(r,v)+(b!==null?"="+a.encodeQuery(b,v):"")},a.addQuery=function(r,b,v){if(typeof b=="object")for(var z in b)u.call(b,z)&&a.addQuery(r,z,b[z]);else if(typeof b=="string"){if(r[b]===void 0){r[b]=v;return}else typeof r[b]=="string"&&(r[b]=[r[b]]);g(v)||(v=[v]),r[b]=(r[b]||[]).concat(v)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(r,b,v){if(typeof b=="object")for(var z in b)u.call(b,z)&&a.setQuery(r,z,b[z]);else if(typeof b=="string")r[b]=v===void 0?null:v;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(r,b,v){var z,q,W;if(g(b))for(z=0,q=b.length;z<q;z++)r[b[z]]=void 0;else if(p(b)==="RegExp")for(W in r)b.test(W)&&(r[W]=void 0);else if(typeof b=="object")for(W in b)u.call(b,W)&&a.removeQuery(r,W,b[W]);else if(typeof b=="string")v!==void 0?p(v)==="RegExp"?!g(r[b])&&v.test(r[b])?r[b]=void 0:r[b]=y(r[b],v):r[b]===String(v)&&(!g(v)||v.length===1)?r[b]=void 0:g(r[b])&&(r[b]=y(r[b],v)):r[b]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(r,b,v,z){switch(p(b)){case"String":break;case"RegExp":for(var q in r)if(u.call(r,q)&&b.test(q)&&(v===void 0||a.hasQuery(r,q,v)))return!0;return!1;case"Object":for(var W in b)if(u.call(b,W)&&!a.hasQuery(r,W,b[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 b in r;case"Boolean":var Z=!!(g(r[b])?r[b].length:r[b]);return v===Z;case"Function":return!!v(r[b],b,r);case"Array":if(!g(r[b]))return!1;var X=z?x:E;return X(r[b],v);case"RegExp":return g(r[b])?z?x(r[b],v):!1:!!(r[b]&&r[b].match(v));case"Number":v=String(v);case"String":return g(r[b])?z?x(r[b],v):!1:r[b]===v;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var r=[],b=[],v=0,z=0;z<arguments.length;z++){var q=new a(arguments[z]);r.push(q);for(var W=q.segment(),Z=0;Z<W.length;Z++)typeof W[Z]=="string"&&b.push(W[Z]),W[Z]&&v++}if(!b.length||!v)return new a("");var X=new a("").segment(b);return(r[0].path()===""||r[0].path().slice(0,1)==="/")&&X.path("/"+X.path()),X.normalize()},a.commonPath=function(r,b){var v=Math.min(r.length,b.length),z;for(z=0;z<v;z++)if(r.charAt(z)!==b.charAt(z)){z--;break}return z<1?r.charAt(0)===b.charAt(0)&&r.charAt(0)==="/"?"/":"":((r.charAt(z)!=="/"||b.charAt(z)!=="/")&&(z=r.substring(0,z).lastIndexOf("/")),r.substring(0,z+1))},a.withinString=function(r,b,v){v||(v={});var z=v.start||a.findUri.start,q=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 _e=r.slice(Math.max(se-3,0),se);if(_e&&X.test(_e))continue}for(var Ee=se+r.slice(se).search(q),ye=r.slice(se,Ee),Re=-1;;){var We=Z.exec(ye);if(!We)break;var tt=We.index+We[0].length;Re=Math.max(Re,tt)}if(Re>-1?ye=ye.slice(0,Re)+ye.slice(Re).replace(W,""):ye=ye.replace(W,""),!(ye.length<=ie[0].length)&&!(v.ignore&&v.ignore.test(ye))){Ee=se+ye.length;var ft=b(ye,se,Ee,r);if(ft===void 0){z.lastIndex=Ee;continue}ft=String(ft),r=r.slice(0,se)+ft+r.slice(Ee),z.lastIndex=se+ft.length}}return z.lastIndex=0,r},a.ensureValidHostname=function(r,b){var v=!!r,z=!!b,q=!1;if(z&&(q=x(a.hostProtocols,b)),q&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+b);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 b=Number(r);if(!(c(b)&&b>0&&b<65536))throw new TypeError('Port "'+r+'" is not a valid port')}},a.noConflict=function(r){if(r){var b={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(b.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(b.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(b.SecondLevelDomains=o.SecondLevelDomains.noConflict()),b}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 G(r){return function(b,v){return b===void 0?this._parts[r]||"":(this._parts[r]=b||null,this.build(!v),this)}}function P(r,b){return function(v,z){return v===void 0?this._parts[r]||"":(v!==null&&(v=v+"",v.charAt(0)===b&&(v=v.substring(1))),this._parts[r]=v,this.build(!z),this)}}l.protocol=G("protocol"),l.username=G("username"),l.password=G("password"),l.hostname=G("hostname"),l.port=G("port"),l.query=P("query","?"),l.fragment=P("fragment","#"),l.search=function(r,b){var v=this.query(r,b);return typeof v=="string"&&v.length?"?"+v:v},l.hash=function(r,b){var v=this.fragment(r,b);return typeof v=="string"&&v.length?"#"+v:v},l.pathname=function(r,b){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(!b),this},l.path=l.pathname,l.href=function(r,b){var v;if(r===void 0)return this.toString();this._string="",this._parts=a._parts();var z=r instanceof a,q=typeof r=="object"&&(r.hostname||r.path||r.pathname);if(r.nodeName){var W=a.getDomAttribute(r);r=r[W]||"",q=!1}if(!z&&q&&r.pathname!==void 0&&(r=r.toString()),typeof r=="string"||r instanceof String)this._parts=a.parse(String(r),this._parts);else if(z||q){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(!b),this},l.is=function(r){var b=!1,v=!1,z=!1,q=!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),b=v||z,q=!b,W=q&&i&&i.has(this._parts.hostname),Z=q&&a.idn_expression.test(this._parts.hostname),X=q&&a.punycode_expression.test(this._parts.hostname)),r.toLowerCase()){case"relative":return ie;case"absolute":return!ie;case"domain":case"name":return q;case"sld":return W;case"ip":return b;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,b){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,b)},l.scheme=l.protocol,l.port=function(r,b){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,b))},l.hostname=function(r,b){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,b)},l.origin=function(r,b){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 q=a(r);return this.protocol(q.protocol()).authority(q.authority()).build(!b),this}},l.host=function(r,b){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(!b),this},l.authority=function(r,b){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(!b),this},l.userinfo=function(r,b){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(!b),this},l.resource=function(r,b){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(!b),this)},l.subdomain=function(r,b){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,q=this._parts.hostname.substring(0,z),W=new RegExp("^"+d(q));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(!b),this}},l.domain=function(r,b){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(b=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(b).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 q=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(q,r)}return this.build(!b),this}},l.tld=function(r,b){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(b=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 b!==!0&&i&&i.list[z.toLowerCase()]&&i.get(this._parts.hostname)||z}else{var q;if(r)if(r.match(/[^a-zA-Z0-9-]/))if(i&&i.is(r))q=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(q,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");q=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(q,r)}else throw new TypeError("cannot set TLD empty");return this.build(!b),this}},l.directory=function(r,b){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 q=this._parts.path.length-this.filename().length,W=this._parts.path.substring(0,q),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(!b),this}},l.filename=function(r,b){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 q=!1;r.charAt(0)==="/"&&(r=r.substring(1)),r.match(/\.?\//)&&(q=!0);var W=new RegExp(d(this.filename())+"$");return r=a.recodePath(r),this._parts.path=this._parts.path.replace(W,r),q?this.normalizePath(b):this.build(!b),this}},l.suffix=function(r,b){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("."),q,W;return z===-1?"":(q=v.substring(z+1),W=/^[a-z0-9%]+$/i.test(q)?q:"",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(!b),this}},l.segment=function(r,b,v){var z=this._parts.urn?":":"/",q=this.path(),W=q.substring(0,1)==="/",Z=q.split(z);if(r!==void 0&&typeof r!="number"&&(v=b,b=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)),b===void 0)return r===void 0?Z:Z[r];if(r===null||Z[r]===void 0)if(g(b)){Z=[];for(var X=0,ie=b.length;X<ie;X++)!b[X].length&&(!Z.length||!Z[Z.length-1].length)||(Z.length&&!Z[Z.length-1].length&&Z.pop(),Z.push(T(b[X])))}else(b||typeof b=="string")&&(b=T(b),Z[Z.length-1]===""?Z[Z.length-1]=b:Z.push(b));else b?Z[r]=T(b):Z.splice(r,1);return W&&Z.unshift(""),this.path(Z.join(z),v)},l.segmentCoded=function(r,b,v){var z,q,W;if(typeof r!="number"&&(v=b,b=r,r=void 0),b===void 0){if(z=this.segment(r,b,v),!g(z))z=z!==void 0?a.decode(z):void 0;else for(q=0,W=z.length;q<W;q++)z[q]=a.decode(z[q]);return z}if(!g(b))b=typeof b=="string"||b instanceof String?a.encode(b):b;else for(q=0,W=b.length;q<W;q++)b[q]=a.encode(b[q]);return this.segment(r,b,v)};var j=l.query;return l.query=function(r,b){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(!b),this}else return r!==void 0&&typeof r!="string"?(this._parts.query=a.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):j.call(this,r,b)},l.setQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof r=="string"||r instanceof String)z[r]=b!==void 0?b:null;else if(typeof r=="object")for(var q in r)u.call(r,q)&&(z[q]=r[q]);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=b),this.build(!v),this},l.addQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(z,r,b===void 0?null:b),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=b),this.build(!v),this},l.removeQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(z,r,b),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=b),this.build(!v),this},l.hasQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(z,r,b,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 b=this._parts.path;if(!b)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;b=a.recodePath(b);var v,z="",q,W;for(b.charAt(0)!=="/"&&(v=!0,b="/"+b),(b.slice(-3)==="/.."||b.slice(-2)==="/.")&&(b+="/"),b=b.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),v&&(z=b.substring(1).match(/^(\.\.\/)+/)||"",z&&(z=z[0]));q=b.search(/\/\.\.(\/|$)/),q!==-1;){if(q===0){b=b.substring(3);continue}W=b.substring(0,q).lastIndexOf("/"),W===-1&&(W=q),b=b.substring(0,W)+b.substring(q+3)}return v&&this.is("relative")&&(b=z+b.substring(1)),this._parts.path=b,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,b=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=r,a.decode=b}return this},l.unicode=function(){var r=a.encode,b=a.decode;a.encode=A,a.decode=unescape;try{this.normalize()}finally{a.encode=r,a.decode=b}return this},l.readable=function(){var r=this.clone();r.username("").password("").normalize();var b="";if(r._parts.protocol&&(b+=r._parts.protocol+"://"),r._parts.hostname&&(r.is("punycode")&&t?(b+=t.toUnicode(r._parts.hostname),r._parts.port&&(b+=":"+r._parts.port)):b+=r.host()),r._parts.hostname&&r._parts.path&&r._parts.path.charAt(0)!=="/"&&(b+="/"),b+=r.path(!0),r._parts.query){for(var v="",z=0,q=r._parts.query.split("&"),W=q.length;z<W;z++){var Z=(q[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"))}b+="?"+v.substring(1)}return b+=a.decodeQuery(r.hash(),!0),b},l.absoluteTo=function(r){var b=this.clone(),v=["protocol","username","password","hostname","port"],z,q,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)),b._parts.protocol||(b._parts.protocol=r._parts.protocol,this._parts.hostname))return b;for(q=0;W=v[q];q++)b._parts[W]=r._parts[W];return b._parts.path?(b._parts.path.substring(-2)===".."&&(b._parts.path+="/"),b.path().charAt(0)!=="/"&&(z=r.directory(),z=z||(r.path().indexOf("/")===0?"/":""),b._parts.path=(z?z+"/":"")+b._parts.path,b.normalizePath())):(b._parts.path=r._parts.path,b._parts.query||(b._parts.query=r._parts.query)),b.build(),b},l.relativeTo=function(r){var b=this.clone().normalize(),v,z,q,W,Z;if(b._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(r=new a(r).normalize(),v=b._parts,z=r._parts,W=b.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 b.build();if(v.hostname===z.hostname&&v.port===z.port)v.hostname=null,v.port=null;else return b.build();if(W===Z)return v.path="",b.build();if(q=a.commonPath(W,Z),!q)return b.build();var X=z.path.substring(q.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return v.path=X+v.path.substring(q.length)||"./",b.build()},l.equals=function(r){var b=this.clone(),v=new a(r),z={},q={},W={},Z,X,ie;if(b.normalize(),v.normalize(),b.toString()===v.toString())return!0;if(Z=b.query(),X=v.query(),b.query(""),v.query(""),b.toString()!==v.toString()||Z.length!==X.length)return!1;z=a.parseQuery(Z,this._parts.escapeQuerySpace),q=a.parseQuery(X,this._parts.escapeQuerySpace);for(ie in z)if(u.call(z,ie)){if(g(z[ie])){if(!E(z[ie],q[ie]))return!1}else if(z[ie]!==q[ie])return!1;W[ie]=!0}for(ie in q)if(u.call(q,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})})(Mh);var k_=Mh.exports;const ai=ts(k_);function V_(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 Zo(){let e,t;const n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}function Ko(e,t){let n;return typeof document<"u"&&(n=document),Ko._implementation(e,t,n)}Ko._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 q_(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 G_(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 qh={};function Gh(e,t,n){h(t)||(t=e.width),h(n)||(n=e.height);let i=qh[t];h(i)||(i={},qh[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 H_=/^blob:/i;function Hh(e){return m.typeOf.string("uri",e),H_.test(e)}let qn;function Qa(e){h(qn)||(qn=document.createElement("a")),qn.href=window.location.href;const t=qn.host,n=qn.protocol;return qn.href=e,qn.href=qn.href,n!==qn.protocol||t!==qn.host}const W_=/^data:/i;function Wh(e){return m.typeOf.string("uri",e),W_.test(e)}function j_(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 Y_(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 X_(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 dt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),$_=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Ts(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,$_.OTHER),this.serverKey=e.serverKey,this.state=dt.UNISSUED,this.deferred=void 0,this.cancelled=!1}Ts.prototype.cancel=function(){this.cancelled=!0},Ts.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=dt.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Ts(this)};function Z_(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 Qo(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=Z_(this.responseHeaders))}Qo.prototype.toString=function(){let e="Request has failed.";return h(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};function ze(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(ze.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),ze.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)}},ze.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 K_(e,t){return t-e}ze.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(K_),e=0;e<i;e++){const s=o[e];t.splice(s,1),n.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function ji(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(ji.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 Ja(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}ji.prototype.reserve=function(e){e=_(e,this._length),this._array.length=e},ji.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?(Ja(i,o,e),e=o):s=!1}},ji.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},ji.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)Ja(t,o,a),o=a;else break}let s;return h(i)&&this._length>i&&(s=t[i],this._length=i),s},ji.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 Ja(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function Q_(e,t){return e.priority-t.priority}const Le={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let xo=20;const Gt=new ji({comparator:Q_});Gt.maximumLength=xo,Gt.reserve(xo);const Gn=[];let ci={};const J_=typeof document<"u"?new ai(document.location.href):new ai,bs=new ze;function Xe(){}Xe.maximumRequests=50,Xe.maximumRequestsPerServer=18,Xe.requestsByServer={},Xe.throttleRequests=!0,Xe.debugShowStatistics=!1,Xe.requestCompletedEvent=bs,Object.defineProperties(Xe,{statistics:{get:function(){return Le}},priorityHeapLength:{get:function(){return xo},set:function(e){if(e<xo)for(;Gt.length>e;){const t=Gt.pop();Yi(t)}xo=e,Gt.maximumLength=e,Gt.reserve(e)}}});function jh(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 Gt.length+e<=xo};function Yh(e){return e.state===dt.UNISSUED&&(e.state=dt.ISSUED,e.deferred=Zo()),e.deferred.promise}function eg(e){return function(t){if(e.state===dt.CANCELLED)return;const n=e.deferred;--Le.numberOfActiveRequests,--ci[e.serverKey],bs.raiseEvent(),e.state=dt.RECEIVED,e.deferred=void 0,n.resolve(t)}}function tg(e){return function(t){e.state!==dt.CANCELLED&&(++Le.numberOfFailedRequests,--Le.numberOfActiveRequests,--ci[e.serverKey],bs.raiseEvent(t),e.state=dt.FAILED,e.deferred.reject(t))}}function Xh(e){const t=Yh(e);return e.state=dt.ACTIVE,Gn.push(e),++Le.numberOfActiveRequests,++Le.numberOfActiveRequestsEver,++ci[e.serverKey],e.requestFunction().then(eg(e)).catch(tg(e)),t}function Yi(e){const t=e.state===dt.ACTIVE;if(e.state=dt.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=Gn.length;for(e=0;e<i;++e){if(t=Gn[e],t.cancelled&&Yi(t),t.state!==dt.ACTIVE){++n;continue}n>0&&(Gn[e-n]=t)}Gn.length-=n;const o=Gt.internalArray,s=Gt.length;for(e=0;e<s;++e)jh(o[e]);Gt.resort();const a=Math.max(Xe.maximumRequests-Gn.length,0);let c=0;for(;c<a&&Gt.length>0;){if(t=Gt.pop(),t.cancelled){Yi(t);continue}if(t.throttleByServer&&!Xe.serverHasOpenSlots(t.serverKey)){Yi(t);continue}Xh(t),++c}ng()},Xe.getServerKey=function(e){m.typeOf.string("url",e);let t=new ai(e);t.scheme()===""&&(t=t.absoluteTo(J_),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),Wh(e.url)||Hh(e.url))return bs.raiseEvent(),e.state=dt.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 Xh(e);if(Gn.length>=Xe.maximumRequests)return;jh(e);const t=Gt.insert(e);if(h(t)){if(t===e)return;Yi(t)}return Yh(e)};function ng(){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(;Gt.length>0;){const t=Gt.pop();Yi(t)}const e=Gn.length;for(let t=0;t<e;++t)Yi(Gn[t]);Gn.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=Gt;const Co={};let Eo={};Co.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(Eo[n])||(Eo[n]=!0)},Co.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(Eo[n])&&delete Eo[n]};function ig(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}}Co.contains=function(e){if(!h(e))throw new C("url is required.");const t=ig(e);return!!(h(t)&&h(Eo[t]))},Co.clear=function(){Eo={}};const $h=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 Ts),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 To;ne.supportsImageBitmapOptions=function(){return h(To)?To:typeof createImageBitmap!="function"?(To=Promise.resolve(!1),To):(To=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=Gh(t[0]),i=Gh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),To)},Object.defineProperties(ne,{isBlobSupported:{get:function(){return $h}}}),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 G_(this._url)}},isDataUri:{get:function(){return Wh(this._url)}},isBlobUri:{get:function(){return Hh(this._url)}},isCrossOriginUrl:{get:function(){return Qa(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=og(o.query());this._queryParameters=t?ws(s,this.queryParameters,n):s,o.search(""),o.fragment(""),h(i)&&o.scheme()===""&&(o=o.absoluteTo(Ko(i))),this._url=o.toString()};function og(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:X_(e)}function ws(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}${rg(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 rg(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!h(e[t[0]])?`?${t[0]}`:`?${Y_(e)}`}ne.prototype.setQueryParameters=function(e,t){t?this._queryParameters=ws(this._queryParameters,e,!1):this._queryParameters=ws(e,this._queryParameters,!1)},ne.prototype.appendQueryParameters=function(e){this._queryParameters=ws(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 q_(this.getUrlComponent(e),e)},ne.prototype.appendForwardSlash=function(){this._url=V_(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(tc(this.request),!$h||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return ec({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}),ec({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 ec(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=Zo();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!==dt.FAILED?Promise.reject(c):t.retryOnError(c).then(function(l){return l?(s.state=dt.UNISSUED,s.deferred=void 0,ec({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"),tc(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(h(window[t]));return Zh(this,e,t)};function Zh(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=Zo();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!==dt.FAILED?Promise.reject(c):e.retryOnError(c).then(function(l){return l?(o.state=dt.UNISSUED,o.deferred=void 0,Zh(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;tc(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=Zo(),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!==dt.FAILED?Promise.reject(s):t.retryOnError(s).then(function(a){return a?(n.state=dt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})};function tc(e){if(e.state===dt.ISSUED||e.state===dt.ACTIVE)throw new at("The Resource is already being fetched.");e.state=dt.UNISSUED,e.deferred=void 0}const sg=/^data:(.*?)(;base64)?,(.*)$/;function Ss(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Kh(e,t){const n=Ss(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 ag(e,t){t=_(t,"");const n=e[1],i=!!e[2],o=e[3];let s,a;switch(t){case"":case"text":return Ss(i,o);case"arraybuffer":return Kh(i,o);case"blob":return s=Kh(i,o),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(Ss(i,o),n);case"json":return JSON.parse(Ss(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&&(Co.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=Zo(),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 cg(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 Qo(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 Qo)})}const lg=typeof XMLHttpRequest>"u";ne._Implementations.loadWithXhr=function(e,t,n,i,o,s,a){const c=sg.exec(e);if(c!==null){s.resolve(ag(c,t));return}if(lg){cg(e,t,n,i,o,s);return}const l=new XMLHttpRequest;if(Co.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 Qo(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 T=E.split(": "),D=T.shift();x[D]=T.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 Qo)},l.send(i),l},ne._Implementations.loadAndExecuteScript=function(e,t,n){return j_(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 Jo(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)?Qh(this,e.data):Qh(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Jo.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 Jo({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},Jo.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 Ha(0,0,0,0,0),t}}),Jo.prototype.compute=function(e,t){if(!h(this._samples))return;if(h(t)||(t=new Ha(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,ef(this,n,this._samples,e,o,s,t),t}let a=Xo(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,ef(this,n,this._samples,e,o,s,t),t};function hg(e,t){return $.compare(e.julianDate,t)}function Qh(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],T=u[y+l],D=E+nt.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new $(D,T,Oe.TAI);if(d.push(A),g){if(T!==p&&h(p)){const O=$.leapSeconds,I=Xo(O,A,hg);if(I<0){const B=new Ve(A,T);O.splice(~I,0,B)}}p=T}}}function Jh(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 er(e,t,n){return t+e*(n-t)}function ef(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 Jh(e,n,o,c,a),a;if(i.equals(u))return Jh(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 T=n[p+e._taiMinusUtcSecondsColumn],D=n[g+e._taiMinusUtcSecondsColumn];T!==D&&(u.equals(i)?y=x:x-=D-T)}return a.xPoleWander=er(d,n[p+e._xPoleWanderRadiansColumn],n[g+e._xPoleWanderRadiansColumn]),a.yPoleWander=er(d,n[p+e._yPoleWanderRadiansColumn],n[g+e._yPoleWanderRadiansColumn]),a.xPoleOffset=er(d,n[p+e._xCelestialPoleOffsetRadiansColumn],n[g+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=er(d,n[p+e._yCelestialPoleOffsetRadiansColumn],n[g+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=er(d,y,x),a}function pt(e,t,n){this.heading=_(e,0),this.pitch=_(t,0),this.roll=_(n,0)}pt.fromQuaternion=function(e,t){if(!h(e))throw new C("quaternion is required");h(t)||(t=new pt);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},pt.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 pt),i.heading=e*S.RADIANS_PER_DEGREE,i.pitch=t*S.RADIANS_PER_DEGREE,i.roll=n*S.RADIANS_PER_DEGREE,i},pt.clone=function(e,t){if(h(e))return h(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new pt(e.heading,e.pitch,e.roll)},pt.equals=function(e,t){return e===t||h(e)&&h(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},pt.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)},pt.prototype.clone=function(e){return pt.clone(this,e)},pt.prototype.equals=function(e){return pt.equals(this,e)},pt.prototype.equalsEpsilon=function(e,t,n){return pt.equalsEpsilon(this,e,t,n)},pt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const tf=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function fg(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const i=e[t].getAttribute("src"),o=tf.exec(i);if(o!==null)return o[1]}}let As;function nf(e){return typeof document>"u"?e:(h(As)||(As=document.createElement("a")),As.href=e,As.href)}let Xi;function of(){if(h(Xi))return Xi;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:It&&It.tagName.toUpperCase()==="SCRIPT"&&It.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href)?e=Ko(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:It&&It.tagName.toUpperCase()==="SCRIPT"&&It.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href):typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?e=Ko("..",hn("Core/buildModuleUrl.js")):e=fg(),!h(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Xi=new ne({url:nf(e)}),Xi.appendForwardSlash(),Xi}function ug(e){return nf(require.toUrl(`../${e}`))}function rf(e){return of().getDerivedResource({url:e}).url}let Ds;function hn(e){return h(Ds)||(typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?Ds=ug:Ds=rf),Ds(e)}hn._cesiumScriptRegex=tf,hn._buildModuleUrlFromBaseUrl=rf,hn._clearBaseResource=function(){Xi=void 0},hn.setBaseUrl=function(e){Xi=ne.DEFAULT.getDerivedResource({url:e})},hn.getCesiumBaseUrl=of;function sf(e,t,n){this.x=e,this.y=t,this.s=n}function nc(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,Oe.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 dg=new $(0,0,Oe.TAI);function ic(e,t,n){const i=dg;return i.dayNumber=t,i.secondsOfDay=n,$.daysDifference(i,e._sampleZeroDateTT)}nc.prototype.preload=function(e,t,n,i){const o=ic(this,e,t),s=ic(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(oc(this,p));return Promise.all(d)},nc.prototype.computeXysRadians=function(e,t,n){const i=ic(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])||(oc(this,a/this._samplesPerXysFile|0),l=!0),h(u[c*3])||(oc(this,c/this._samplesPerXysFile|0),l=!0),l)return;h(n)?(n.x=0,n.y=0,n.s=0):n=new sf(0,0,0);const d=i-a*this._stepSizeDays,p=this._work,g=this._denominators,y=this._coef,x=this._xTable;let E,T;for(E=0;E<=s;++E)p[E]=d-x[E];for(E=0;E<=s;++E){for(y[E]=1,T=0;T<=s;++T)T!==E&&(y[E]*=p[T]);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 oc(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 tr=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);tr=f.normalize(e,tr);const s=tr.x*o,a=tr.y*o,c=tr.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 pg=[1,2,0],mg=new Array(3);J.fromRotationMatrix=function(e,t){m.typeOf.object("matrix",e);let n,i,o,s,a;const c=e[F.COLUMN0ROW0],l=e[F.COLUMN1ROW1],u=e[F.COLUMN2ROW2],d=c+l+u;if(d>0)n=Math.sqrt(d+1),a=.5*n,n=.5/n,i=(e[F.COLUMN1ROW2]-e[F.COLUMN2ROW1])*n,o=(e[F.COLUMN2ROW0]-e[F.COLUMN0ROW2])*n,s=(e[F.COLUMN0ROW1]-e[F.COLUMN1ROW0])*n;else{const p=pg;let g=0;l>c&&(g=1),u>c&&u>l&&(g=2);const y=p[g],x=p[y];n=Math.sqrt(e[F.getElementIndex(g,g)]-e[F.getElementIndex(y,y)]-e[F.getElementIndex(x,x)]+1);const E=mg;E[g]=.5*n,n=.5/n,a=(e[F.getElementIndex(x,y)]-e[F.getElementIndex(y,x)])*n,E[y]=(e[F.getElementIndex(y,g)]+e[F.getElementIndex(g,y)])*n,E[x]=(e[F.getElementIndex(x,g)]+e[F.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 af=new J;let cf=new J,rc=new J,lf=new J;J.fromHeadingPitchRoll=function(e,t){return m.typeOf.object("headingPitchRoll",e),lf=J.fromAxisAngle(f.UNIT_X,e.roll,af),rc=J.fromAxisAngle(f.UNIT_Y,-e.pitch,t),t=J.multiply(rc,lf,rc),cf=J.fromAxisAngle(f.UNIT_Z,-e.heading,af),J.multiply(cf,t,t)};const Os=new f,sc=new f,Dn=new J,hf=new J,vs=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,vs),J.conjugate(vs,vs);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,vs,Dn),Dn.w<0&&J.negate(Dn,Dn),J.computeAxis(Dn,Os);const c=J.computeAngle(Dn);h(i)||(i=[]),i[a]=Os.x*c,i[a+1]=Os.y*c,i[a+2]=Os.z*c}},J.unpackInterpolationResult=function(e,t,n,i,o){h(o)||(o=new J),f.fromArray(e,0,sc);const s=f.magnitude(sc);return J.unpack(t,i*4,hf),s===0?J.clone(J.IDENTITY,Dn):J.fromAxisAngle(sc,s,Dn),J.multiply(Dn,hf,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 ac=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),ac=J.multiplyByScalar(t,n,ac),i=J.multiplyByScalar(e,1-n,i),J.add(ac,i,i)};let ff=new J,cc=new J,lc=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=ff=J.negate(t,ff)),1-o<S.EPSILON6)return J.lerp(e,s,n,i);const a=Math.acos(o);return cc=J.multiplyByScalar(e,Math.sin((1-n)*a),cc),lc=J.multiplyByScalar(s,Math.sin(n*a),lc),i=J.add(cc,lc,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 _g=new f,gg=new f,nr=new J,bo=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,nr);J.multiply(o,n,bo);const s=J.log(bo,_g);J.multiply(o,e,bo);const a=J.log(bo,gg);return f.add(s,a,s),f.multiplyByScalar(s,.25,s),f.negate(s,s),J.exp(s,nr),J.multiply(t,nr,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,nr),c=J.slerp(n,i,o,bo);return J.slerp(a,c,2*o*(1-o),s)};const yg=new J,uf=1.9011074535173003,Is=mt.supportsTypedArrays()?new Float32Array(8):[],Rs=mt.supportsTypedArrays()?new Float32Array(8):[],li=mt.supportsTypedArrays()?new Float32Array(8):[],hi=mt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Is[e]=1/(t*n),Rs[e]=t/n}Is[7]=uf/(8*17),Rs[7]=uf*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]=(Is[y]*l-Rs[y])*a,hi[y]=(Is[y]*u-Rs[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,yg);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,nr),c=J.fastSlerp(n,i,o,bo);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 me={},hc={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"}},wo={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},fc={},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;me.localFrameToFixedFrameGenerator=function(e,t){if(!hc.hasOwnProperty(e)||!hc[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=hc[e][t];let i;const o=e+t;return h(fc[o])?i=fc[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(wo[e],0,vi),f.unpack(wo[t],0,Ii),f.unpack(wo[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(wo[e],0,vi),e!=="east"&&e!=="west"&&f.multiplyByScalar(vi,l,vi),f.unpack(wo[t],0,Ii),t!=="east"&&t!=="west"&&f.multiplyByScalar(Ii,l,Ii),f.unpack(wo[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},fc[o]=i),i},me.eastNorthUpToFixedFrame=me.localFrameToFixedFrameGenerator("east","north"),me.northEastDownToFixedFrame=me.localFrameToFixedFrameGenerator("north","east"),me.northUpEastToFixedFrame=me.localFrameToFixedFrameGenerator("north","up"),me.northWestUpToFixedFrame=me.localFrameToFixedFrameGenerator("north","west");const xg=new J,Cg=new f(1,1,1),Eg=new N;me.headingPitchRollToFixedFrame=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t),i=_(i,me.eastNorthUpToFixedFrame);const s=J.fromHeadingPitchRoll(t,xg),a=N.fromTranslationQuaternionRotationScale(f.ZERO,s,Cg,Eg);return o=i(e,n,o),N.multiply(o,a,o)};const Tg=new N,bg=new F;me.headingPitchRollQuaternion=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t);const s=me.headingPitchRollToFixedFrame(e,t,n,i,Tg),a=N.getMatrix3(s,bg);return J.fromRotationMatrix(a,o)};const wg=new f(1,1,1),Sg=new f,df=new N,Ag=new N,Dg=new F,Og=new J;me.fixedFrameToHeadingPitchRoll=function(e,t,n,i){m.defined("transform",e),t=_(t,le.default),n=_(n,me.eastNorthUpToFixedFrame),h(i)||(i=new pt);const o=N.getTranslation(e,Sg);if(f.equals(o,f.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let s=N.inverseTransformation(n(o,t,df),df),a=N.setScale(e,wg,Ag);a=N.setTranslation(a,f.ZERO,a),s=N.multiply(s,a,s);let c=J.fromRotationMatrix(N.getMatrix3(s,Dg),Og);return c=J.normalize(c,c),pt.fromQuaternion(c,i)};const vg=6*3600+41*60+50.54841,Ig=8640184812866e-6,Rg=.093104,zg=-62e-7,Pg=11772758384668e-32,Bg=72921158553e-15,Ng=S.TWO_PI/86400;let zs=new $;me.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=me.computeIcrfToFixedMatrix(e,t);return h(n)||(n=me.computeTemeToPseudoFixedMatrix(e,t)),n},me.computeTemeToPseudoFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");zs=$.addSeconds(e,-$.computeTaiMinusUtc(e),zs);const n=zs.dayNumber,i=zs.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=(vg+o*(Ig+o*(Rg+o*zg)))*Ng%S.TWO_PI,l=Bg+Pg*(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 F(p,g,0,-g,p,0,0,0,1)},me.iau2006XysData=new nc,me.earthOrientationParameters=Jo.NONE;const uc=32.184,Lg=2451545;me.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+uc,i=e.stop.dayNumber,o=e.stop.secondsOfDay+uc;return me.iau2006XysData.preload(t,n,i,o)},me.computeIcrfToFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new F);const n=me.computeFixedToIcrfMatrix(e,t);if(h(n))return F.transpose(n,t)};const Fg=32.184,Mg=2451545,Ps=new pt,Ug=new F,kg=new $;me.computeMoonFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");const n=$.addSeconds(e,Fg,kg),i=$.totalDays(n)-Mg,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 Ps.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),Ps.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),Ps.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),F.fromHeadingPitchRoll(Ps,Ug)},me.computeIcrfToMoonFixedMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new F);const n=me.computeMoonFixedToIcrfMatrix(e,t);if(h(n))return F.transpose(n,t)};const Vg=new sf(0,0,0),qg=new Ha(0,0,0,0,0),dc=new F,pc=new F;me.computeFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");h(t)||(t=new F);const n=me.earthOrientationParameters.compute(e,qg);if(!h(n))return;const i=e.dayNumber,o=e.secondsOfDay+uc,s=me.iau2006XysData.computeXysRadians(i,o,Vg);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=dc;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=F.fromRotationZ(-s.s,pc),p=F.multiply(u,d,dc),g=e.dayNumber,y=e.secondsOfDay-$.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=y/nt.SECONDS_PER_DAY;let T=.779057273264+E+.00273781191135448*(x+E);T=T%1*S.TWO_PI;const D=F.fromRotationZ(T,pc),A=F.multiply(p,D,dc),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),B=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander);let G=i-Lg+o/nt.SECONDS_PER_DAY;G/=36525;const P=-47e-6*G*S.RADIANS_PER_DEGREE/3600,V=Math.cos(P),k=Math.sin(P),H=pc;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,F.multiply(A,H,t)};const Gg=new Y;me.pointToWindowCoordinates=function(e,t,n,i){return i=me.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i},me.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=Gg;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 Hg=new f,Wg=new f,jg=new f;me.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,Hg);let s=f.cross(t,o,Wg);f.equalsEpsilon(s,f.ZERO,S.EPSILON6)&&(s=f.clone(f.UNIT_X,s));const a=f.cross(s,t,jg);return f.normalize(a,a),f.cross(t,a,s),f.negate(s,s),f.normalize(s,s),h(i)||(i=new F),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 pf=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),mf=new ee,mc=new f,Yg=new f,Xg=new F,_c=new N,_f=new N;me.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,Yg),o=e.ellipsoid;let s;if(f.equals(i,f.ZERO))s=f.clone(f.ZERO,mc);else{const d=o.cartesianToCartographic(i,mf);s=e.project(d,mc),f.fromElements(s.z,s.x,s.y,s)}const a=me.eastNorthUpToFixedFrame(i,o,_c),c=N.inverseTransformation(a,_f),l=N.getMatrix3(t,Xg),u=N.multiplyByMatrix3(c,l,n);return N.multiply(pf,u,n),N.setTranslation(n,s,n),n},me.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=me.eastNorthUpToFixedFrame(t,i,_c),s=N.inverseTransformation(o,_f),a=i.cartesianToCartographic(t,mf),c=e.project(a,mc);f.fromElements(c.z,c.x,c.y,c);const l=N.fromTranslation(c,_c);return N.multiply(pf,s,n),N.multiply(l,n,n),n};const gf={};function ir(e,t){if(!h(e))throw new C("identifier is required.");h(gf[e])||(gf[e]=!0,console.warn(_(t,e)))}ir.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.",ir.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",ir.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",ir.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function $g(e,t){if(!h(e)||!h(t))throw new C("identifier and message are required.");ir(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 Zg=new f,Kg=new f,Qg=new f,Jg=new f,ey=new f,gc=new Array(5);for(let e=0;e<gc.length;++e)gc[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=me.eastNorthUpToFixedFrame(i,t,Zg),a=N.multiplyByPointAsVector(s,f.UNIT_X,Kg);f.normalize(a,a);const c=N.multiplyByPointAsVector(s,f.UNIT_Y,Qg);f.normalize(c,c),f.multiplyByScalar(c,o,c),f.multiplyByScalar(a,o,a);const l=f.negate(c,ey),u=f.negate(a,Jg),d=gc;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 $g("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 ty=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=ty;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 xe(e,t,n,i){this.x=_(e,0),this.y=_(t,0),this.width=_(n,0),this.height=_(i,0)}xe.packedLength=4,xe.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},xe.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new xe),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},xe.fromPoints=function(e,t){if(h(t)||(t=new xe),!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 yf=new Sn,ny=new ee,iy=new ee;xe.fromRectangle=function(e,t,n){if(h(n)||(n=new xe),!h(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;yf._ellipsoid=le.default,t=_(t,yf);const i=t.project(ce.southwest(e,ny)),o=t.project(ce.northeast(e,iy));return U.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n},xe.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 xe(e.x,e.y,e.width,e.height)},xe.union=function(e,t,n){m.typeOf.object("left",e),m.typeOf.object("right",t),h(n)||(n=new xe);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},xe.expand=function(e,t,n){m.typeOf.object("rectangle",e),m.typeOf.object("point",t),n=xe.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},xe.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?Ct.OUTSIDE:Ct.INTERSECTING},xe.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},xe.prototype.clone=function(e){return xe.clone(this,e)},xe.prototype.intersect=function(e){return xe.intersect(this,e)},xe.prototype.equals=function(e){return xe.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 Ht(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 Ht(this,it.CULL)},set:function(e){Ht(this,it.CULL)!==e&&(zi(this,it.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ht(this,it.OCCLUDE)},set:function(e){Ht(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 Ht(this,it.CAST_SHADOWS)},set:function(e){Ht(this,it.CAST_SHADOWS)!==e&&(zi(this,it.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ht(this,it.RECEIVE_SHADOWS)},set:function(e){Ht(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 Ht(this,it.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ht(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 Ht(this,it.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ht(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 Ht(this,it.PICK_ONLY)},set:function(e){Ht(this,it.PICK_ONLY)!==e&&(zi(this,it.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ht(this,it.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ht(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 we={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};we.toWebGLConstant=function(e,t){switch(e){case we.UNSIGNED_BYTE:return R.UNSIGNED_BYTE;case we.UNSIGNED_SHORT:return R.UNSIGNED_SHORT;case we.UNSIGNED_INT:return R.UNSIGNED_INT;case we.FLOAT:return R.FLOAT;case we.HALF_FLOAT:return t.webgl2?R.HALF_FLOAT:R.HALF_FLOAT_OES;case we.UNSIGNED_INT_24_8:return R.UNSIGNED_INT_24_8;case we.UNSIGNED_SHORT_4_4_4_4:return R.UNSIGNED_SHORT_4_4_4_4;case we.UNSIGNED_SHORT_5_5_5_1:return R.UNSIGNED_SHORT_5_5_5_1;case we.UNSIGNED_SHORT_5_6_5:return we.UNSIGNED_SHORT_5_6_5}},we.isPacked=function(e){return e===we.UNSIGNED_INT_24_8||e===we.UNSIGNED_SHORT_4_4_4_4||e===we.UNSIGNED_SHORT_5_5_5_1||e===we.UNSIGNED_SHORT_5_6_5},we.sizeInBytes=function(e){switch(e){case we.UNSIGNED_BYTE:return 1;case we.UNSIGNED_SHORT:case we.UNSIGNED_SHORT_4_4_4_4:case we.UNSIGNED_SHORT_5_5_5_1:case we.UNSIGNED_SHORT_5_6_5:case we.HALF_FLOAT:return 2;case we.UNSIGNED_INT:case we.FLOAT:case we.UNSIGNED_INT_24_8:return 4}},we.validate=function(e){return e===we.UNSIGNED_BYTE||e===we.UNSIGNED_SHORT||e===we.UNSIGNED_INT||e===we.FLOAT||e===we.HALF_FLOAT||e===we.UNSIGNED_INT_24_8||e===we.UNSIGNED_SHORT_4_4_4_4||e===we.UNSIGNED_SHORT_5_5_5_1||e===we.UNSIGNED_SHORT_5_6_5},we.getTypedArrayConstructor=function(e){const t=we.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===we.FLOAT?Float32Array:Uint32Array};const de=Object.freeze(we),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 de.isPacked(t)&&(o=1),o*de.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=de.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===de.UNSIGNED_SHORT)return R.DEPTH_COMPONENT16;if(t===de.UNSIGNED_INT)return R.DEPTH_COMPONENT24}if(t===de.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===de.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 ue=Object.freeze(te),Ce={_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(Ce,{maximumCombinedTextureImageUnits:{get:function(){return Ce._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Ce._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Ce._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Ce._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Ce._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Ce._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Ce._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Ce._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Ce._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Ce._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Ce._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Ce._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Ce._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Ce._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Ce._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Ce._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Ce._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Ce._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Ce._maximumColorAttachments}},maximumSamples:{get:function(){return Ce._maximumSamples}},highpFloatSupported:{get:function(){return Ce._highpFloatSupported}},highpIntSupported:{get:function(){return Ce._highpIntSupported}}});function yc(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Bs(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=Ce.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(!ue.isColorFormat(u.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(u.pixelDatatype===de.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===de.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;yc(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;Bs(this,d,u),this._activeColorAttachments[l]=d,this._colorRenderbuffers[l]=u}}if(h(e.depthTexture)){const a=e.depthTexture;if(a.pixelFormat!==ue.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");yc(this,this._gl.DEPTH_ATTACHMENT,a),this._depthTexture=a}if(h(e.depthRenderbuffer)){const a=e.depthRenderbuffer;Bs(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a}if(h(e.stencilRenderbuffer)){const a=e.stencilRenderbuffer;Bs(this,this._gl.STENCIL_ATTACHMENT,a),this._stencilRenderbuffer=a}if(h(e.depthStencilTexture)){const a=e.depthStencilTexture;if(a.pixelFormat!==ue.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");yc(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilTexture=a}if(h(e.depthStencilRenderbuffer)){const a=e.depthStencilRenderbuffer;Bs(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 Ns={CLOCKWISE:R.CW,COUNTER_CLOCKWISE:R.CCW};Ns.validate=function(e){return e===Ns.CLOCKWISE||e===Ns.COUNTER_CLOCKWISE};const xf=Object.freeze(Ns);function Cf(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]=Cf(e[t]));return Object.freeze(e)}function Ef(e){return e===R.FUNC_ADD||e===R.FUNC_SUBTRACT||e===R.FUNC_REVERSE_SUBTRACT||e===R.MIN||e===R.MAX}function Ls(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 oy(e){return e===R.FRONT||e===R.BACK||e===R.FRONT_AND_BACK}function ry(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 So(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 ke(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,xf.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:xe.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 w(_(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 xe(E.x,E.y,E.width,E.height):void 0,this.lineWidth<Ce.minimumAliasedLineWidth||this.lineWidth>Ce.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!xf.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!oy(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(!ry(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(!Ef(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!Ef(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!Ls(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!Ls(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!Ls(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!Ls(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(!So(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!So(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!So(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!So(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!So(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!So(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>Ce.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${Ce.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>Ce.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${Ce.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}let sy=0,Wn={};ke.fromCache=function(e){const t=JSON.stringify(e);let n=Wn[t];if(h(n))return++n.referenceCount,n.state;let i=new ke(e);const o=JSON.stringify(i);return n=Wn[o],h(n)||(i.id=sy++,i=Cf(i),n={referenceCount:0,state:i},Wn[o]=n),++n.referenceCount,Wn[t]={referenceCount:1,state:n.state},n.state},ke.removeFromCache=function(e){const t=new ke(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]},ke.getCache=function(){return Wn},ke.clearCache=function(){Wn={}};function $i(e,t,n){n?e.enable(t):e.disable(t)}function bf(e,t){e.frontFace(t.frontFace)}function wf(e,t){const n=t.cull,i=n.enabled;$i(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Sf(e,t){e.lineWidth(t.lineWidth)}function Af(e,t){const n=t.polygonOffset,i=n.enabled;$i(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Df(e,t,n){const i=t.scissorTest,o=h(n.scissorTest)?n.scissorTest.enabled:i.enabled;if($i(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 Of(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function vf(e,t){const n=t.depthTest,i=n.enabled;$i(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function If(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Rf(e,t){e.depthMask(t.depthMask)}function zf(e,t){e.stencilMask(t.stencilMask)}function ay(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Pf(e,t,n){const i=t.blending,o=h(n.blendingEnabled)?n.blendingEnabled:i.enabled;$i(e,e.BLEND,o),o&&(ay(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Bf(e,t){const n=t.stencilTest,i=n.enabled;if($i(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 Nf(e,t){const n=t.sampleCoverage,i=n.enabled;$i(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}const cy=new xe;function Lf(e,t,n){let i=_(t.viewport,n.viewport);h(i)||(i=cy,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)}ke.apply=function(e,t,n){bf(e,t),wf(e,t),Sf(e,t),Af(e,t),Of(e,t),vf(e,t),If(e,t),Rf(e,t),zf(e,t),Bf(e,t),Nf(e,t),Df(e,t,n),Pf(e,t,n),Lf(e,t,n)};function ly(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(bf),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(wf),e.lineWidth!==t.lineWidth&&n.push(Sf),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Af),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Of),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(vf),(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(If),e.depthMask!==t.depthMask&&n.push(Rf),e.stencilMask!==t.stencilMask&&n.push(zf),(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(Bf),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Nf),n}ke.partialApply=function(e,t,n,i,o,s){if(t!==n){let d=n._applyFunctions[t.id];h(d)||(d=ly(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)&&Df(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)&&Pf(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Lf(e,n,o)},ke.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:xe.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:w.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)?xe.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 hy=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,hy),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 fy=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,fy),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 Ff=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],Ff)),t.y=U.magnitude(U.fromElements(e[2],e[3],Ff)),t};const Mf=new U;ae.getMaximumScale=function(e){return ae.getScale(e,Mf),U.maximumComponent(Mf)};const uy=new U;ae.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=ae.getScale(e,uy);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 dy=new U;ae.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=ae.getScale(e,dy);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
|
-
(${this[1]}, ${this[3]})`};function py(e,t,n,i){switch(t.type){case e.FLOAT:return new Uf(e,t,n,i);case e.FLOAT_VEC2:return new kf(e,t,n,i);case e.FLOAT_VEC3:return new Vf(e,t,n,i);case e.FLOAT_VEC4:return new qf(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new xc(e,t,n,i);case e.INT:case e.BOOL:return new Gf(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Hf(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Wf(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new jf(e,t,n,i);case e.FLOAT_MAT2:return new Yf(e,t,n,i);case e.FLOAT_MAT3:return new Xf(e,t,n,i);case e.FLOAT_MAT4:return new $f(e,t,n,i);default:throw new at(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Uf(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Uf.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function kf(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}kf.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 Vf(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Vf.prototype.set=function(){const e=this.value;if(h(e.red))w.equals(e,this._value)||(this._value=w.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 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))w.equals(e,this._value)||(this._value=w.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 xc(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}xc.prototype.set=function(){const e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);const t=this.value;e.bindTexture(t._target,t._texture)},xc.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Gf(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Gf.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Hf(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}Hf.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 Wf(e,t,n,i){this.name=n,this.value=void 0,this._value=new f,this._gl=e,this._location=i}Wf.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 jf(e,t,n,i){this.name=n,this.value=void 0,this._value=new Y,this._gl=e,this._location=i}jf.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 my=new Float32Array(4);function Yf(e,t,n,i){this.name=n,this.value=void 0,this._value=new ae,this._gl=e,this._location=i}Yf.prototype.set=function(){if(!ae.equalsArray(this.value,this._value,0)){ae.clone(this.value,this._value);const e=ae.toArray(this.value,my);this._gl.uniformMatrix2fv(this._location,!1,e)}};const _y=new Float32Array(9);function Xf(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}Xf.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);const e=F.toArray(this.value,_y);this._gl.uniformMatrix3fv(this._location,!1,e)}};const gy=new Float32Array(16);function $f(e,t,n,i){this.name=n,this.value=void 0,this._value=new N,this._gl=e,this._location=i}$f.prototype.set=function(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);const e=N.toArray(this.value,gy);this._gl.uniformMatrix4fv(this._location,!1,e)}};function yy(e,t,n,i){switch(t.type){case e.FLOAT:return new Zf(e,t,n,i);case e.FLOAT_VEC2:return new Kf(e,t,n,i);case e.FLOAT_VEC3:return new Qf(e,t,n,i);case e.FLOAT_VEC4:return new Jf(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new Cc(e,t,n,i);case e.INT:case e.BOOL:return new eu(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new tu(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new nu(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new iu(e,t,n,i);case e.FLOAT_MAT2:return new ou(e,t,n,i);case e.FLOAT_MAT3:return new ru(e,t,n,i);case e.FLOAT_MAT4:return new su(e,t,n,i);default:throw new at(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Zf(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]}Zf.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 Kf(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]}Kf.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 Qf(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]}Qf.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 Jf(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]}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];if(h(a.red))w.equalsArray(a,n,o)||(w.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 Cc(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}Cc.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)}},Cc.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 eu(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]}eu.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 tu(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]}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];U.equalsArray(a,n,o)||(U.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function nu(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]}nu.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 iu(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]}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];Y.equalsArray(a,n,o)||(Y.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function ou(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]}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];ae.equalsArray(a,n,o)||(ae.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function ru(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]}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];F.equalsArray(a,n,o)||(F.pack(a,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function su(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]}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];N.equalsArray(a,n,o)||(N.pack(a,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};let xy=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=Cy(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=xy++}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 Fs(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return Fs(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return Fs(this),this._uniformsByName}}});function au(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 Cy(e,t){const n={};if(!Ce.highpFloatSupported||!Ce.highpIntSupported){let i,o,s,a;const c=au(e),l=au(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 Ey(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:
|
|
43
|
+
*/(function(e){(function(t,n){e.exports?e.exports=n(M_(),U_(),V_()):t.URI=n(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(uo,function(t,n,i,o){var s=o&&o.URI;function a(r,b){var v=arguments.length>=1,z=arguments.length>=2;if(!(this instanceof a))return v?z?new a(r,b):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),b!==void 0?this.absoluteTo(b):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,b){var v={},z,G;if(p(b)==="RegExp")v=null;else if(g(b))for(z=0,G=b.length;z<G;z++)v[b[z]]=!0;else v[b]=!0;for(z=0,G=r.length;z<G;z++){var W=v&&v[r[z]]!==void 0||!v&&b.test(r[z]);W&&(r.splice(z,1),G--,z--)}return r}function x(r,b){var v,z;if(g(b)){for(v=0,z=b.length;v<z;v++)if(!x(r,b[v]))return!1;return!0}var G=p(b);for(v=0,z=r.length;v<z;v++)if(G==="RegExp"){if(typeof r[v]=="string"&&r[v].match(b))return!0}else if(r[v]===b)return!0;return!1}function E(r,b){if(!g(r)||!g(b)||r.length!==b.length)return!1;r.sort(),b.sort();for(var v=0,z=r.length;v<z;v++)if(r[v]!==b[v])return!1;return!0}function T(r){var b=/^\/+|\/+$/g;return r.replace(b,"")}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 b=r.nodeName.toLowerCase();if(!(b==="input"&&r.type!=="image"))return a.domAttributes[b]}};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,b){var v=a.encode(r+"");return b===void 0&&(b=a.escapeQuerySpace),b?v.replace(/%20/g,"+"):v},a.decodeQuery=function(r,b){r+="",b===void 0&&(b=a.escapeQuerySpace);try{return a.decode(b?r.replace(/\+/g,"%20"):r)}catch{return r}};var O={encode:"encode",decode:"decode"},I,B=function(r,b){return function(v){try{return a[b](v+"").replace(a.characters[r][b].expression,function(z){return a.characters[r][b].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,b,v){return function(z){var G;v?G=function(ie){return a[b](a[v](ie))}:G=a[b];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,b){var v;return b||(b={preventInvalidHostname:a.preventInvalidHostname}),r=r.replace(a.leading_whitespace_expression,""),r=r.replace(a.ascii_tab_whitespace,""),v=r.indexOf("#"),v>-1&&(b.fragment=r.substring(v+1)||null,r=r.substring(0,v)),v=r.indexOf("?"),v>-1&&(b.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)==="//"?(b.protocol=null,r=r.substring(2),r=a.parseAuthority(r,b)):(v=r.indexOf(":"),v>-1&&(b.protocol=r.substring(0,v)||null,b.protocol&&!b.protocol.match(a.protocol_expression)?b.protocol=void 0:r.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(r=r.substring(v+3),r=a.parseAuthority(r,b)):(r=r.substring(v+1),b.urn=!0))),b.path=r,b},a.parseHost=function(r,b){r||(r=""),r=r.replace(/\\/g,"/");var v=r.indexOf("/"),z,G;if(v===-1&&(v=r.length),r.charAt(0)==="[")z=r.indexOf("]"),b.hostname=r.substring(1,z)||null,b.port=r.substring(z+2,v)||null,b.port==="/"&&(b.port=null);else{var W=r.indexOf(":"),Z=r.indexOf("/"),X=r.indexOf(":",W+1);X!==-1&&(Z===-1||X<Z)?(b.hostname=r.substring(0,v)||null,b.port=null):(G=r.substring(0,v).split(":"),b.hostname=G[0]||null,b.port=G[1]||null)}return b.hostname&&r.substring(v).charAt(0)!=="/"&&(v++,r="/"+r),b.preventInvalidHostname&&a.ensureValidHostname(b.hostname,b.protocol),b.port&&a.ensureValidPort(b.port),r.substring(v)||"/"},a.parseAuthority=function(r,b){return r=a.parseUserinfo(r,b),a.parseHost(r,b)},a.parseUserinfo=function(r,b){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(":"),b.username=Z[0]?a.decode(Z[0]):null,Z.shift(),b.password=Z[0]?a.decode(Z.join(":")):null,r=v.substring(W+1)):(b.username=null,b.password=null),r},a.parseQuery=function(r,b){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(),b),X=W.length?a.decodeQuery(W.join("="),b):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 b="",v=!1;return r.protocol&&(b+=r.protocol+":"),!r.urn&&(b||r.hostname)&&(b+="//",v=!0),b+=a.buildAuthority(r)||"",typeof r.path=="string"&&(r.path.charAt(0)!=="/"&&v&&(b+="/"),b+=r.path),typeof r.query=="string"&&r.query&&(b+="?"+r.query),typeof r.fragment=="string"&&r.fragment&&(b+="#"+r.fragment),b},a.buildHost=function(r){var b="";if(r.hostname)a.ip6_expression.test(r.hostname)?b+="["+r.hostname+"]":b+=r.hostname;else return"";return r.port&&(b+=":"+r.port),b},a.buildAuthority=function(r){return a.buildUserinfo(r)+a.buildHost(r)},a.buildUserinfo=function(r){var b="";return r.username&&(b+=a.encode(r.username)),r.password&&(b+=":"+a.encode(r.password)),b&&(b+="@"),b},a.buildQuery=function(r,b,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),b!==!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,b,v){return a.encodeQuery(r,v)+(b!==null?"="+a.encodeQuery(b,v):"")},a.addQuery=function(r,b,v){if(typeof b=="object")for(var z in b)u.call(b,z)&&a.addQuery(r,z,b[z]);else if(typeof b=="string"){if(r[b]===void 0){r[b]=v;return}else typeof r[b]=="string"&&(r[b]=[r[b]]);g(v)||(v=[v]),r[b]=(r[b]||[]).concat(v)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},a.setQuery=function(r,b,v){if(typeof b=="object")for(var z in b)u.call(b,z)&&a.setQuery(r,z,b[z]);else if(typeof b=="string")r[b]=v===void 0?null:v;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},a.removeQuery=function(r,b,v){var z,G,W;if(g(b))for(z=0,G=b.length;z<G;z++)r[b[z]]=void 0;else if(p(b)==="RegExp")for(W in r)b.test(W)&&(r[W]=void 0);else if(typeof b=="object")for(W in b)u.call(b,W)&&a.removeQuery(r,W,b[W]);else if(typeof b=="string")v!==void 0?p(v)==="RegExp"?!g(r[b])&&v.test(r[b])?r[b]=void 0:r[b]=y(r[b],v):r[b]===String(v)&&(!g(v)||v.length===1)?r[b]=void 0:g(r[b])&&(r[b]=y(r[b],v)):r[b]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},a.hasQuery=function(r,b,v,z){switch(p(b)){case"String":break;case"RegExp":for(var G in r)if(u.call(r,G)&&b.test(G)&&(v===void 0||a.hasQuery(r,G,v)))return!0;return!1;case"Object":for(var W in b)if(u.call(b,W)&&!a.hasQuery(r,W,b[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 b in r;case"Boolean":var Z=!!(g(r[b])?r[b].length:r[b]);return v===Z;case"Function":return!!v(r[b],b,r);case"Array":if(!g(r[b]))return!1;var X=z?x:E;return X(r[b],v);case"RegExp":return g(r[b])?z?x(r[b],v):!1:!!(r[b]&&r[b].match(v));case"Number":v=String(v);case"String":return g(r[b])?z?x(r[b],v):!1:r[b]===v;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},a.joinPaths=function(){for(var r=[],b=[],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"&&b.push(W[Z]),W[Z]&&v++}if(!b.length||!v)return new a("");var X=new a("").segment(b);return(r[0].path()===""||r[0].path().slice(0,1)==="/")&&X.path("/"+X.path()),X.normalize()},a.commonPath=function(r,b){var v=Math.min(r.length,b.length),z;for(z=0;z<v;z++)if(r.charAt(z)!==b.charAt(z)){z--;break}return z<1?r.charAt(0)===b.charAt(0)&&r.charAt(0)==="/"?"/":"":((r.charAt(z)!=="/"||b.charAt(z)!=="/")&&(z=r.substring(0,z).lastIndexOf("/")),r.substring(0,z+1))},a.withinString=function(r,b,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 Te=se+r.slice(se).search(G),xe=r.slice(se,Te),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))){Te=se+xe.length;var ut=b(xe,se,Te,r);if(ut===void 0){z.lastIndex=Te;continue}ut=String(ut),r=r.slice(0,se)+ut+r.slice(Te),z.lastIndex=se+ut.length}}return z.lastIndex=0,r},a.ensureValidHostname=function(r,b){var v=!!r,z=!!b,G=!1;if(z&&(G=x(a.hostProtocols,b)),G&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+b);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 b=Number(r);if(!(c(b)&&b>0&&b<65536))throw new TypeError('Port "'+r+'" is not a valid port')}},a.noConflict=function(r){if(r){var b={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(b.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(b.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(b.SecondLevelDomains=o.SecondLevelDomains.noConflict()),b}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(b,v){return b===void 0?this._parts[r]||"":(this._parts[r]=b||null,this.build(!v),this)}}function P(r,b){return function(v,z){return v===void 0?this._parts[r]||"":(v!==null&&(v=v+"",v.charAt(0)===b&&(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,b){var v=this.query(r,b);return typeof v=="string"&&v.length?"?"+v:v},l.hash=function(r,b){var v=this.fragment(r,b);return typeof v=="string"&&v.length?"#"+v:v},l.pathname=function(r,b){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(!b),this},l.path=l.pathname,l.href=function(r,b){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(!b),this},l.is=function(r){var b=!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),b=v||z,G=!b,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 b;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 k=l.protocol,V=l.port,H=l.hostname;l.protocol=function(r,b){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 k.call(this,r,b)},l.scheme=l.protocol,l.port=function(r,b){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))),V.call(this,r,b))},l.hostname=function(r,b){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,b)},l.origin=function(r,b){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(!b),this}},l.host=function(r,b){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(!b),this},l.authority=function(r,b){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(!b),this},l.userinfo=function(r,b){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(!b),this},l.resource=function(r,b){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(!b),this)},l.subdomain=function(r,b){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(!b),this}},l.domain=function(r,b){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(b=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(b).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(!b),this}},l.tld=function(r,b){if(this._parts.urn)return r===void 0?"":this;if(typeof r=="boolean"&&(b=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 b!==!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(!b),this}},l.directory=function(r,b){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(!b),this}},l.filename=function(r,b){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(b):this.build(!b),this}},l.suffix=function(r,b){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(!b),this}},l.segment=function(r,b,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=b,b=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)),b===void 0)return r===void 0?Z:Z[r];if(r===null||Z[r]===void 0)if(g(b)){Z=[];for(var X=0,ie=b.length;X<ie;X++)!b[X].length&&(!Z.length||!Z[Z.length-1].length)||(Z.length&&!Z[Z.length-1].length&&Z.pop(),Z.push(T(b[X])))}else(b||typeof b=="string")&&(b=T(b),Z[Z.length-1]===""?Z[Z.length-1]=b:Z.push(b));else b?Z[r]=T(b):Z.splice(r,1);return W&&Z.unshift(""),this.path(Z.join(z),v)},l.segmentCoded=function(r,b,v){var z,G,W;if(typeof r!="number"&&(v=b,b=r,r=void 0),b===void 0){if(z=this.segment(r,b,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(b))b=typeof b=="string"||b instanceof String?a.encode(b):b;else for(G=0,W=b.length;G<W;G++)b[G]=a.encode(b[G]);return this.segment(r,b,v)};var j=l.query;return l.query=function(r,b){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(!b),this}else return r!==void 0&&typeof r!="string"?(this._parts.query=a.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!b),this):j.call(this,r,b)},l.setQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof r=="string"||r instanceof String)z[r]=b!==void 0?b: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=b),this.build(!v),this},l.addQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.addQuery(z,r,b===void 0?null:b),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=b),this.build(!v),this},l.removeQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.removeQuery(z,r,b),this._parts.query=a.buildQuery(z,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof r!="string"&&(v=b),this.build(!v),this},l.hasQuery=function(r,b,v){var z=a.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return a.hasQuery(z,r,b,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 b=this._parts.path;if(!b)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;b=a.recodePath(b);var v,z="",G,W;for(b.charAt(0)!=="/"&&(v=!0,b="/"+b),(b.slice(-3)==="/.."||b.slice(-2)==="/.")&&(b+="/"),b=b.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),v&&(z=b.substring(1).match(/^(\.\.\/)+/)||"",z&&(z=z[0]));G=b.search(/\/\.\.(\/|$)/),G!==-1;){if(G===0){b=b.substring(3);continue}W=b.substring(0,G).lastIndexOf("/"),W===-1&&(W=G),b=b.substring(0,W)+b.substring(G+3)}return v&&this.is("relative")&&(b=z+b.substring(1)),this._parts.path=b,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,b=a.decode;a.encode=escape,a.decode=decodeURIComponent;try{this.normalize()}finally{a.encode=r,a.decode=b}return this},l.unicode=function(){var r=a.encode,b=a.decode;a.encode=A,a.decode=unescape;try{this.normalize()}finally{a.encode=r,a.decode=b}return this},l.readable=function(){var r=this.clone();r.username("").password("").normalize();var b="";if(r._parts.protocol&&(b+=r._parts.protocol+"://"),r._parts.hostname&&(r.is("punycode")&&t?(b+=t.toUnicode(r._parts.hostname),r._parts.port&&(b+=":"+r._parts.port)):b+=r.host()),r._parts.hostname&&r._parts.path&&r._parts.path.charAt(0)!=="/"&&(b+="/"),b+=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"))}b+="?"+v.substring(1)}return b+=a.decodeQuery(r.hash(),!0),b},l.absoluteTo=function(r){var b=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)),b._parts.protocol||(b._parts.protocol=r._parts.protocol,this._parts.hostname))return b;for(G=0;W=v[G];G++)b._parts[W]=r._parts[W];return b._parts.path?(b._parts.path.substring(-2)===".."&&(b._parts.path+="/"),b.path().charAt(0)!=="/"&&(z=r.directory(),z=z||(r.path().indexOf("/")===0?"/":""),b._parts.path=(z?z+"/":"")+b._parts.path,b.normalizePath())):(b._parts.path=r._parts.path,b._parts.query||(b._parts.query=r._parts.query)),b.build(),b},l.relativeTo=function(r){var b=this.clone().normalize(),v,z,G,W,Z;if(b._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(r=new a(r).normalize(),v=b._parts,z=r._parts,W=b.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 b.build();if(v.hostname===z.hostname&&v.port===z.port)v.hostname=null,v.port=null;else return b.build();if(W===Z)return v.path="",b.build();if(G=a.commonPath(W,Z),!G)return b.build();var X=z.path.substring(G.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return v.path=X+v.path.substring(G.length)||"./",b.build()},l.equals=function(r){var b=this.clone(),v=new a(r),z={},G={},W={},Z,X,ie;if(b.normalize(),v.normalize(),b.toString()===v.toString())return!0;if(Z=b.query(),X=v.query(),b.query(""),v.query(""),b.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})})(Mh);var k_=Mh.exports;const ai=os(k_);function G_(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 Ko(){let e,t;const n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}function Qo(e,t){let n;return typeof document<"u"&&(n=document),Qo._implementation(e,t,n)}Qo._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 q_(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 H_(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 Gh={};function qh(e,t,n){h(t)||(t=e.width),h(n)||(n=e.height);let i=Gh[t];h(i)||(i={},Gh[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 W_=/^blob:/i;function Hh(e){return m.typeOf.string("uri",e),W_.test(e)}let Gn;function tc(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 j_=/^data:/i;function Wh(e){return m.typeOf.string("uri",e),j_.test(e)}function Y_(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 X_(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 $_(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 pt=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),Z_=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Ss(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,Z_.OTHER),this.serverKey=e.serverKey,this.state=pt.UNISSUED,this.deferred=void 0,this.cancelled=!1}Ss.prototype.cancel=function(){this.cancelled=!0},Ss.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=pt.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Ss(this)};function K_(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 Jo(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=K_(this.responseHeaders))}Jo.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 Q_(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(Q_),e=0;e<i;e++){const s=o[e];t.splice(s,1),n.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function ji(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(ji.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 nc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}ji.prototype.reserve=function(e){e=_(e,this._length),this._array.length=e},ji.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?(nc(i,o,e),e=o):s=!1}},ji.prototype.resort=function(){const e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},ji.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)nc(t,o,a),o=a;else break}let s;return h(i)&&this._length>i&&(s=t[i],this._length=i),s},ji.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 nc(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};function J_(e,t){return e.priority-t.priority}const Le={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let xo=20;const Ht=new ji({comparator:J_});Ht.maximumLength=xo,Ht.reserve(xo);const qn=[];let ci={};const eg=typeof document<"u"?new ai(document.location.href):new ai,As=new Pe;function Xe(){}Xe.maximumRequests=50,Xe.maximumRequestsPerServer=18,Xe.requestsByServer={},Xe.throttleRequests=!0,Xe.debugShowStatistics=!1,Xe.requestCompletedEvent=As,Object.defineProperties(Xe,{statistics:{get:function(){return Le}},priorityHeapLength:{get:function(){return xo},set:function(e){if(e<xo)for(;Ht.length>e;){const t=Ht.pop();Yi(t)}xo=e,Ht.maximumLength=e,Ht.reserve(e)}}});function jh(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<=xo};function Yh(e){return e.state===pt.UNISSUED&&(e.state=pt.ISSUED,e.deferred=Ko()),e.deferred.promise}function tg(e){return function(t){if(e.state===pt.CANCELLED)return;const n=e.deferred;--Le.numberOfActiveRequests,--ci[e.serverKey],As.raiseEvent(),e.state=pt.RECEIVED,e.deferred=void 0,n.resolve(t)}}function ng(e){return function(t){e.state!==pt.CANCELLED&&(++Le.numberOfFailedRequests,--Le.numberOfActiveRequests,--ci[e.serverKey],As.raiseEvent(t),e.state=pt.FAILED,e.deferred.reject(t))}}function Xh(e){const t=Yh(e);return e.state=pt.ACTIVE,qn.push(e),++Le.numberOfActiveRequests,++Le.numberOfActiveRequestsEver,++ci[e.serverKey],e.requestFunction().then(tg(e)).catch(ng(e)),t}function Yi(e){const t=e.state===pt.ACTIVE;if(e.state=pt.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&&Yi(t),t.state!==pt.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)jh(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){Yi(t);continue}if(t.throttleByServer&&!Xe.serverHasOpenSlots(t.serverKey)){Yi(t);continue}Xh(t),++c}ig()},Xe.getServerKey=function(e){m.typeOf.string("url",e);let t=new ai(e);t.scheme()===""&&(t=t.absoluteTo(eg),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),Wh(e.url)||Hh(e.url))return As.raiseEvent(),e.state=pt.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 Xh(e);if(qn.length>=Xe.maximumRequests)return;jh(e);const t=Ht.insert(e);if(h(t)){if(t===e)return;Yi(t)}return Yh(e)};function ig(){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();Yi(t)}const e=qn.length;for(let t=0;t<e;++t)Yi(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 Co={};let Eo={};Co.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(Eo[n])||(Eo[n]=!0)},Co.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(Eo[n])&&delete Eo[n]};function og(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}}Co.contains=function(e){if(!h(e))throw new C("url is required.");const t=og(e);return!!(h(t)&&h(Eo[t]))},Co.clear=function(){Eo={}};const $h=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 Ss),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 To;ne.supportsImageBitmapOptions=function(){return h(To)?To:typeof createImageBitmap!="function"?(To=Promise.resolve(!1),To):(To=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=qh(t[0]),i=qh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),To)},Object.defineProperties(ne,{isBlobSupported:{get:function(){return $h}}}),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 H_(this._url)}},isDataUri:{get:function(){return Wh(this._url)}},isBlobUri:{get:function(){return Hh(this._url)}},isCrossOriginUrl:{get:function(){return tc(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=rg(o.query());this._queryParameters=t?Ds(s,this.queryParameters,n):s,o.search(""),o.fragment(""),h(i)&&o.scheme()===""&&(o=o.absoluteTo(Qo(i))),this._url=o.toString()};function rg(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:$_(e)}function Ds(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}${sg(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 sg(e){const t=Object.keys(e);return t.length===0?"":t.length===1&&!h(e[t[0]])?`?${t[0]}`:`?${X_(e)}`}ne.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Ds(this._queryParameters,e,!1):this._queryParameters=Ds(e,this._queryParameters,!1)},ne.prototype.appendQueryParameters=function(e){this._queryParameters=Ds(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 q_(this.getUrlComponent(e),e)},ne.prototype.appendForwardSlash=function(){this._url=G_(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(oc(this.request),!$h||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return ic({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}),ic({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 ic(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=Ko();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!==pt.FAILED?Promise.reject(c):t.retryOnError(c).then(function(l){return l?(s.state=pt.UNISSUED,s.deferred=void 0,ic({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"),oc(this.request);let t;do t=`loadJsonp${S.nextRandomNumber().toString().substring(2,8)}`;while(h(window[t]));return Zh(this,e,t)};function Zh(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=Ko();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!==pt.FAILED?Promise.reject(c):e.retryOnError(c).then(function(l){return l?(o.state=pt.UNISSUED,o.deferred=void 0,Zh(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;oc(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=Ko(),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!==pt.FAILED?Promise.reject(s):t.retryOnError(s).then(function(a){return a?(n.state=pt.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(s)})})};function oc(e){if(e.state===pt.ISSUED||e.state===pt.ACTIVE)throw new ct("The Resource is already being fetched.");e.state=pt.UNISSUED,e.deferred=void 0}const ag=/^data:(.*?)(;base64)?,(.*)$/;function Os(e,t){const n=decodeURIComponent(t);return e?atob(n):n}function Kh(e,t){const n=Os(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 cg(e,t){t=_(t,"");const n=e[1],i=!!e[2],o=e[3];let s,a;switch(t){case"":case"text":return Os(i,o);case"arraybuffer":return Kh(i,o);case"blob":return s=Kh(i,o),new Blob([s],{type:n});case"document":return a=new DOMParser,a.parseFromString(Os(i,o),n);case"json":return JSON.parse(Os(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&&(Co.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=Ko(),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 ct(`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 lg(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 Jo(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 Jo)})}const hg=typeof XMLHttpRequest>"u";ne._Implementations.loadWithXhr=function(e,t,n,i,o,s,a){const c=ag.exec(e);if(c!==null){s.resolve(cg(c,t));return}if(hg){lg(e,t,n,i,o,s);return}const l=new XMLHttpRequest;if(Co.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 Jo(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 T=E.split(": "),D=T.shift();x[D]=T.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 ct("Invalid XMLHttpRequest response type."))},l.onerror=function(d){s.reject(new Jo)},l.send(i),l},ne._Implementations.loadAndExecuteScript=function(e,t,n){return Y_(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 er(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)?Qh(this,e.data):Qh(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}er.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 ct(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new er({addNewLeapSeconds:t.addNewLeapSeconds,data:i})},er.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 Ya(0,0,0,0,0),t}}),er.prototype.compute=function(e,t){if(!h(this._samples))return;if(h(t)||(t=new Ya(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,ef(this,n,this._samples,e,o,s,t),t}let a=$o(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,ef(this,n,this._samples,e,o,s,t),t};function fg(e,t){return $.compare(e.julianDate,t)}function Qh(e,t){if(!h(t.columnNames))throw new ct("Error in loaded EOP data: The columnNames property is required.");if(!h(t.samples))throw new ct("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 ct("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],T=u[y+l],D=E+nt.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new $(D,T,ve.TAI);if(d.push(A),g){if(T!==p&&h(p)){const O=$.leapSeconds,I=$o(O,A,fg);if(I<0){const B=new Ge(A,T);O.splice(~I,0,B)}}p=T}}}function Jh(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 tr(e,t,n){return t+e*(n-t)}function ef(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 Jh(e,n,o,c,a),a;if(i.equals(u))return Jh(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 T=n[p+e._taiMinusUtcSecondsColumn],D=n[g+e._taiMinusUtcSecondsColumn];T!==D&&(u.equals(i)?y=x:x-=D-T)}return a.xPoleWander=tr(d,n[p+e._xPoleWanderRadiansColumn],n[g+e._xPoleWanderRadiansColumn]),a.yPoleWander=tr(d,n[p+e._yPoleWanderRadiansColumn],n[g+e._yPoleWanderRadiansColumn]),a.xPoleOffset=tr(d,n[p+e._xCelestialPoleOffsetRadiansColumn],n[g+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=tr(d,n[p+e._yCelestialPoleOffsetRadiansColumn],n[g+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=tr(d,y,x),a}function it(e,t,n){this.heading=_(e,0),this.pitch=_(t,0),this.roll=_(n,0)}it.fromQuaternion=function(e,t){if(!h(e))throw new C("quaternion is required");h(t)||(t=new it);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},it.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 it),i.heading=e*S.RADIANS_PER_DEGREE,i.pitch=t*S.RADIANS_PER_DEGREE,i.roll=n*S.RADIANS_PER_DEGREE,i},it.clone=function(e,t){if(h(e))return h(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new it(e.heading,e.pitch,e.roll)},it.equals=function(e,t){return e===t||h(e)&&h(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},it.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)},it.prototype.clone=function(e){return it.clone(this,e)},it.prototype.equals=function(e){return it.equals(this,e)},it.prototype.equalsEpsilon=function(e,t,n){return it.equalsEpsilon(this,e,t,n)},it.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const tf=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function ug(){const e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){const i=e[t].getAttribute("src"),o=tf.exec(i);if(o!==null)return o[1]}}let vs;function nf(e){return typeof document>"u"?e:(h(vs)||(vs=document.createElement("a")),vs.href=e,vs.href)}let Xi;function of(){if(h(Xi))return Xi;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:It&&It.tagName.toUpperCase()==="SCRIPT"&&It.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href)?e=Qo(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:It&&It.tagName.toUpperCase()==="SCRIPT"&&It.src||new URL("OW_EEngine_Power.umd.cjs",document.baseURI).href):typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?e=Qo("..",hn("Core/buildModuleUrl.js")):e=ug(),!h(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Xi=new ne({url:nf(e)}),Xi.appendForwardSlash(),Xi}function dg(e){return nf(require.toUrl(`../${e}`))}function rf(e){return of().getDerivedResource({url:e}).url}let Is;function hn(e){return h(Is)||(typeof define=="object"&&h(define.amd)&&!define.amd.toUrlUndefined&&h(require.toUrl)?Is=dg:Is=rf),Is(e)}hn._cesiumScriptRegex=tf,hn._buildModuleUrlFromBaseUrl=rf,hn._clearBaseResource=function(){Xi=void 0},hn.setBaseUrl=function(e){Xi=ne.DEFAULT.getDerivedResource({url:e})},hn.getCesiumBaseUrl=of;function sf(e,t,n){this.x=e,this.y=t,this.s=n}function rc(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 pg=new $(0,0,ve.TAI);function sc(e,t,n){const i=pg;return i.dayNumber=t,i.secondsOfDay=n,$.daysDifference(i,e._sampleZeroDateTT)}rc.prototype.preload=function(e,t,n,i){const o=sc(this,e,t),s=sc(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(ac(this,p));return Promise.all(d)},rc.prototype.computeXysRadians=function(e,t,n){const i=sc(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])||(ac(this,a/this._samplesPerXysFile|0),l=!0),h(u[c*3])||(ac(this,c/this._samplesPerXysFile|0),l=!0),l)return;h(n)?(n.x=0,n.y=0,n.s=0):n=new sf(0,0,0);const d=i-a*this._stepSizeDays,p=this._work,g=this._denominators,y=this._coef,x=this._xTable;let E,T;for(E=0;E<=s;++E)p[E]=d-x[E];for(E=0;E<=s;++E){for(y[E]=1,T=0;T<=s;++T)T!==E&&(y[E]*=p[T]);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 ac(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 nr=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);nr=f.normalize(e,nr);const s=nr.x*o,a=nr.y*o,c=nr.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 mg=[1,2,0],_g=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=mg;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=_g;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 af=new J;let cf=new J,cc=new J,lf=new J;J.fromHeadingPitchRoll=function(e,t){return m.typeOf.object("headingPitchRoll",e),lf=J.fromAxisAngle(f.UNIT_X,e.roll,af),cc=J.fromAxisAngle(f.UNIT_Y,-e.pitch,t),t=J.multiply(cc,lf,cc),cf=J.fromAxisAngle(f.UNIT_Z,-e.heading,af),J.multiply(cf,t,t)};const Rs=new f,lc=new f,Dn=new J,hf=new J,zs=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,zs),J.conjugate(zs,zs);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,zs,Dn),Dn.w<0&&J.negate(Dn,Dn),J.computeAxis(Dn,Rs);const c=J.computeAngle(Dn);h(i)||(i=[]),i[a]=Rs.x*c,i[a+1]=Rs.y*c,i[a+2]=Rs.z*c}},J.unpackInterpolationResult=function(e,t,n,i,o){h(o)||(o=new J),f.fromArray(e,0,lc);const s=f.magnitude(lc);return J.unpack(t,i*4,hf),s===0?J.clone(J.IDENTITY,Dn):J.fromAxisAngle(lc,s,Dn),J.multiply(Dn,hf,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 hc=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),hc=J.multiplyByScalar(t,n,hc),i=J.multiplyByScalar(e,1-n,i),J.add(hc,i,i)};let ff=new J,fc=new J,uc=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=ff=J.negate(t,ff)),1-o<S.EPSILON6)return J.lerp(e,s,n,i);const a=Math.acos(o);return fc=J.multiplyByScalar(e,Math.sin((1-n)*a),fc),uc=J.multiplyByScalar(s,Math.sin(n*a),uc),i=J.add(fc,uc,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 gg=new f,yg=new f,ir=new J,bo=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,ir);J.multiply(o,n,bo);const s=J.log(bo,gg);J.multiply(o,e,bo);const a=J.log(bo,yg);return f.add(s,a,s),f.multiplyByScalar(s,.25,s),f.negate(s,s),J.exp(s,ir),J.multiply(t,ir,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,ir),c=J.slerp(n,i,o,bo);return J.slerp(a,c,2*o*(1-o),s)};const xg=new J,uf=1.9011074535173003,Ps=mt.supportsTypedArrays()?new Float32Array(8):[],Bs=mt.supportsTypedArrays()?new Float32Array(8):[],li=mt.supportsTypedArrays()?new Float32Array(8):[],hi=mt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){const t=e+1,n=2*t+1;Ps[e]=1/(t*n),Bs[e]=t/n}Ps[7]=uf/(8*17),Bs[7]=uf*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]=(Ps[y]*l-Bs[y])*a,hi[y]=(Ps[y]*u-Bs[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,xg);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,ir),c=J.fastSlerp(n,i,o,bo);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={},dc={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"}},wo={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},pc={},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(!dc.hasOwnProperty(e)||!dc[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");const n=dc[e][t];let i;const o=e+t;return h(pc[o])?i=pc[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(wo[e],0,vi),f.unpack(wo[t],0,Ii),f.unpack(wo[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(wo[e],0,vi),e!=="east"&&e!=="west"&&f.multiplyByScalar(vi,l,vi),f.unpack(wo[t],0,Ii),t!=="east"&&t!=="west"&&f.multiplyByScalar(Ii,l,Ii),f.unpack(wo[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},pc[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 Cg=new J,Eg=new f(1,1,1),Tg=new N;_e.headingPitchRollToFixedFrame=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t),i=_(i,_e.eastNorthUpToFixedFrame);const s=J.fromHeadingPitchRoll(t,Cg),a=N.fromTranslationQuaternionRotationScale(f.ZERO,s,Eg,Tg);return o=i(e,n,o),N.multiply(o,a,o)};const bg=new N,wg=new L;_e.headingPitchRollQuaternion=function(e,t,n,i,o){m.typeOf.object("HeadingPitchRoll",t);const s=_e.headingPitchRollToFixedFrame(e,t,n,i,bg),a=N.getMatrix3(s,wg);return J.fromRotationMatrix(a,o)};const Sg=new f(1,1,1),Ag=new f,df=new N,Dg=new N,Og=new L,vg=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 it);const o=N.getTranslation(e,Ag);if(f.equals(o,f.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let s=N.inverseTransformation(n(o,t,df),df),a=N.setScale(e,Sg,Dg);a=N.setTranslation(a,f.ZERO,a),s=N.multiply(s,a,s);let c=J.fromRotationMatrix(N.getMatrix3(s,Og),vg);return c=J.normalize(c,c),it.fromQuaternion(c,i)};const Ig=6*3600+41*60+50.54841,Rg=8640184812866e-6,zg=.093104,Pg=-62e-7,Bg=11772758384668e-32,Ng=72921158553e-15,Fg=S.TWO_PI/86400;let Ns=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.");Ns=$.addSeconds(e,-$.computeTaiMinusUtc(e),Ns);const n=Ns.dayNumber,i=Ns.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=(Ig+o*(Rg+o*(zg+o*Pg)))*Fg%S.TWO_PI,l=Ng+Bg*(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 rc,_e.earthOrientationParameters=er.NONE;const mc=32.184,Lg=2451545;_e.preloadIcrfFixed=function(e){const t=e.start.dayNumber,n=e.start.secondsOfDay+mc,i=e.stop.dayNumber,o=e.stop.secondsOfDay+mc;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 Mg=32.184,Ug=2451545,Fs=new it,Vg=new L,kg=new $;_e.computeMoonFixedToIcrfMatrix=function(e,t){if(!h(e))throw new C("date is required.");const n=$.addSeconds(e,Mg,kg),i=$.totalDays(n)-Ug,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 Fs.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),Fs.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),Fs.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(Fs,Vg)},_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 Gg=new sf(0,0,0),qg=new Ya(0,0,0,0,0),_c=new L,gc=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,qg);if(!h(n))return;const i=e.dayNumber,o=e.secondsOfDay+mc,s=_e.iau2006XysData.computeXysRadians(i,o,Gg);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=_c;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,gc),p=L.multiply(u,d,_c),g=e.dayNumber,y=e.secondsOfDay-$.computeTaiMinusUtc(e)+n.ut1MinusUtc,x=g-2451545,E=y/nt.SECONDS_PER_DAY;let T=.779057273264+E+.00273781191135448*(x+E);T=T%1*S.TWO_PI;const D=L.fromRotationZ(T,gc),A=L.multiply(p,D,_c),O=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),B=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander);let q=i-Lg+o/nt.SECONDS_PER_DAY;q/=36525;const P=-47e-6*q*S.RADIANS_PER_DEGREE/3600,k=Math.cos(P),V=Math.sin(P),H=gc;return H[0]=O*k,H[1]=O*V,H[2]=B,H[3]=-I*V+M*B*k,H[4]=I*k+M*B*V,H[5]=-M*O,H[6]=-M*V-I*B*k,H[7]=M*k-I*B*V,H[8]=I*O,L.multiply(A,H,t)};const Hg=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=Hg;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 Wg=new f,jg=new f,Yg=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,Wg);let s=f.cross(t,o,jg);f.equalsEpsilon(s,f.ZERO,S.EPSILON6)&&(s=f.clone(f.UNIT_X,s));const a=f.cross(s,t,Yg);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 pf=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),mf=new ee,yc=new f,Xg=new f,$g=new L,xc=new N,_f=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,Xg),o=e.ellipsoid;let s;if(f.equals(i,f.ZERO))s=f.clone(f.ZERO,yc);else{const d=o.cartesianToCartographic(i,mf);s=e.project(d,yc),f.fromElements(s.z,s.x,s.y,s)}const a=_e.eastNorthUpToFixedFrame(i,o,xc),c=N.inverseTransformation(a,_f),l=N.getMatrix3(t,$g),u=N.multiplyByMatrix3(c,l,n);return N.multiply(pf,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,xc),s=N.inverseTransformation(o,_f),a=i.cartesianToCartographic(t,mf),c=e.project(a,yc);f.fromElements(c.z,c.x,c.y,c);const l=N.fromTranslation(c,xc);return N.multiply(pf,s,n),N.multiply(l,n,n),n};const gf={};function or(e,t){if(!h(e))throw new C("identifier is required.");h(gf[e])||(gf[e]=!0,console.warn(_(t,e)))}or.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.",or.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",or.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",or.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function Zg(e,t){if(!h(e)||!h(t))throw new C("identifier and message are required.");or(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 Kg=new f,Qg=new f,Jg=new f,ey=new f,ty=new f,Cc=new Array(5);for(let e=0;e<Cc.length;++e)Cc[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,Kg),a=N.multiplyByPointAsVector(s,f.UNIT_X,Qg);f.normalize(a,a);const c=N.multiplyByPointAsVector(s,f.UNIT_Y,Jg);f.normalize(c,c),f.multiplyByScalar(c,o,c),f.multiplyByScalar(a,o,a);const l=f.negate(c,ty),u=f.negate(a,ey),d=Cc;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 Zg("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 ny=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=ny;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 yf=new Sn,iy=new ee,oy=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;yf._ellipsoid=le.default,t=_(t,yf);const i=t.project(ce.southwest(e,iy)),o=t.project(ce.northeast(e,oy));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?Ct.OUTSIDE:Ct.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 Ft={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};Ft.isLines=function(e){return e===Ft.LINES||e===Ft.LINE_LOOP||e===Ft.LINE_STRIP},Ft.isTriangles=function(e){return e===Ft.TRIANGLES||e===Ft.TRIANGLE_STRIP||e===Ft.TRIANGLE_FAN},Ft.validate=function(e){return e===Ft.POINTS||e===Ft.LINES||e===Ft.LINE_LOOP||e===Ft.LINE_STRIP||e===Ft.TRIANGLES||e===Ft.TRIANGLE_STRIP||e===Ft.TRIANGLE_FAN};const qe=Object.freeze(Ft),ot={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,ot.CULL)},set:function(e){Wt(this,ot.CULL)!==e&&(zi(this,ot.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Wt(this,ot.OCCLUDE)},set:function(e){Wt(this,ot.OCCLUDE)!==e&&(zi(this,ot.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,ot.CAST_SHADOWS)},set:function(e){Wt(this,ot.CAST_SHADOWS)!==e&&(zi(this,ot.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Wt(this,ot.RECEIVE_SHADOWS)},set:function(e){Wt(this,ot.RECEIVE_SHADOWS)!==e&&(zi(this,ot.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,ot.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Wt(this,ot.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(zi(this,ot.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,ot.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Wt(this,ot.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(zi(this,ot.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,ot.PICK_ONLY)},set:function(e){Wt(this,ot.PICK_ONLY)!==e&&(zi(this,ot.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Wt(this,ot.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Wt(this,ot.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(zi(this,ot.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 Ec(e,t,n){const i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Ls(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;Ec(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;Ls(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.");Ec(this,this._gl.DEPTH_ATTACHMENT,a),this._depthTexture=a}if(h(e.depthRenderbuffer)){const a=e.depthRenderbuffer;Ls(this,this._gl.DEPTH_ATTACHMENT,a),this._depthRenderbuffer=a}if(h(e.stencilRenderbuffer)){const a=e.stencilRenderbuffer;Ls(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.");Ec(this,this._gl.DEPTH_STENCIL_ATTACHMENT,a),this._depthStencilTexture=a}if(h(e.depthStencilRenderbuffer)){const a=e.depthStencilRenderbuffer;Ls(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 Ms={CLOCKWISE:R.CW,COUNTER_CLOCKWISE:R.CCW};Ms.validate=function(e){return e===Ms.CLOCKWISE||e===Ms.COUNTER_CLOCKWISE};const xf=Object.freeze(Ms);function Cf(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]=Cf(e[t]));return Object.freeze(e)}function Ef(e){return e===R.FUNC_ADD||e===R.FUNC_SUBTRACT||e===R.FUNC_REVERSE_SUBTRACT||e===R.MIN||e===R.MAX}function Us(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 ry(e){return e===R.FRONT||e===R.BACK||e===R.FRONT_AND_BACK}function sy(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 So(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 ke(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,xf.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 w(_(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(!xf.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!ry(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(!sy(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(!Ef(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!Ef(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!Us(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!Us(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!Us(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!Us(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(!So(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!So(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!So(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!So(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!So(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!So(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 ay=0,Wn={};ke.fromCache=function(e){const t=JSON.stringify(e);let n=Wn[t];if(h(n))return++n.referenceCount,n.state;let i=new ke(e);const o=JSON.stringify(i);return n=Wn[o],h(n)||(i.id=ay++,i=Cf(i),n={referenceCount:0,state:i},Wn[o]=n),++n.referenceCount,Wn[t]={referenceCount:1,state:n.state},n.state},ke.removeFromCache=function(e){const t=new ke(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]},ke.getCache=function(){return Wn},ke.clearCache=function(){Wn={}};function $i(e,t,n){n?e.enable(t):e.disable(t)}function bf(e,t){e.frontFace(t.frontFace)}function wf(e,t){const n=t.cull,i=n.enabled;$i(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function Sf(e,t){e.lineWidth(t.lineWidth)}function Af(e,t){const n=t.polygonOffset,i=n.enabled;$i(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function Df(e,t,n){const i=t.scissorTest,o=h(n.scissorTest)?n.scissorTest.enabled:i.enabled;if($i(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 Of(e,t){const n=t.depthRange;e.depthRange(n.near,n.far)}function vf(e,t){const n=t.depthTest,i=n.enabled;$i(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function If(e,t){const n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Rf(e,t){e.depthMask(t.depthMask)}function zf(e,t){e.stencilMask(t.stencilMask)}function cy(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Pf(e,t,n){const i=t.blending,o=h(n.blendingEnabled)?n.blendingEnabled:i.enabled;$i(e,e.BLEND,o),o&&(cy(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Bf(e,t){const n=t.stencilTest,i=n.enabled;if($i(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 Nf(e,t){const n=t.sampleCoverage,i=n.enabled;$i(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}const ly=new Ce;function Ff(e,t,n){let i=_(t.viewport,n.viewport);h(i)||(i=ly,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)}ke.apply=function(e,t,n){bf(e,t),wf(e,t),Sf(e,t),Af(e,t),Of(e,t),vf(e,t),If(e,t),Rf(e,t),zf(e,t),Bf(e,t),Nf(e,t),Df(e,t,n),Pf(e,t,n),Ff(e,t,n)};function hy(e,t){const n=[];return e.frontFace!==t.frontFace&&n.push(bf),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(wf),e.lineWidth!==t.lineWidth&&n.push(Sf),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Af),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Of),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(vf),(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(If),e.depthMask!==t.depthMask&&n.push(Rf),e.stencilMask!==t.stencilMask&&n.push(zf),(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(Bf),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Nf),n}ke.partialApply=function(e,t,n,i,o,s){if(t!==n){let d=n._applyFunctions[t.id];h(d)||(d=hy(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)&&Df(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)&&Pf(e,n,o),(t!==n||i!==o||i.context!==o.context)&&Ff(e,n,o)},ke.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:w.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 fy=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,fy),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 uy=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,uy),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 Lf=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],Lf)),t.y=U.magnitude(U.fromElements(e[2],e[3],Lf)),t};const Mf=new U;ae.getMaximumScale=function(e){return ae.getScale(e,Mf),U.maximumComponent(Mf)};const dy=new U;ae.setRotation=function(e,t,n){m.typeOf.object("matrix",e),m.typeOf.object("result",n);const i=ae.getScale(e,dy);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 py=new U;ae.getRotation=function(e,t){m.typeOf.object("matrix",e),m.typeOf.object("result",t);const n=ae.getScale(e,py);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
|
+
(${this[1]}, ${this[3]})`};function my(e,t,n,i){switch(t.type){case e.FLOAT:return new Uf(e,t,n,i);case e.FLOAT_VEC2:return new Vf(e,t,n,i);case e.FLOAT_VEC3:return new kf(e,t,n,i);case e.FLOAT_VEC4:return new Gf(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 qf(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Hf(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Wf(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new jf(e,t,n,i);case e.FLOAT_MAT2:return new Yf(e,t,n,i);case e.FLOAT_MAT3:return new Xf(e,t,n,i);case e.FLOAT_MAT4:return new $f(e,t,n,i);default:throw new ct(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Uf(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Uf.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Vf(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}Vf.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 kf(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}kf.prototype.set=function(){const e=this.value;if(h(e.red))w.equals(e,this._value)||(this._value=w.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 Gf(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}Gf.prototype.set=function(){const e=this.value;if(h(e.red))w.equals(e,this._value)||(this._value=w.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 Tc(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}Tc.prototype.set=function(){const e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);const t=this.value;e.bindTexture(t._target,t._texture)},Tc.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function qf(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}qf.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Hf(e,t,n,i){this.name=n,this.value=void 0,this._value=new U,this._gl=e,this._location=i}Hf.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 Wf(e,t,n,i){this.name=n,this.value=void 0,this._value=new f,this._gl=e,this._location=i}Wf.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 jf(e,t,n,i){this.name=n,this.value=void 0,this._value=new Y,this._gl=e,this._location=i}jf.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 _y=new Float32Array(4);function Yf(e,t,n,i){this.name=n,this.value=void 0,this._value=new ae,this._gl=e,this._location=i}Yf.prototype.set=function(){if(!ae.equalsArray(this.value,this._value,0)){ae.clone(this.value,this._value);const e=ae.toArray(this.value,_y);this._gl.uniformMatrix2fv(this._location,!1,e)}};const gy=new Float32Array(9);function Xf(e,t,n,i){this.name=n,this.value=void 0,this._value=new L,this._gl=e,this._location=i}Xf.prototype.set=function(){if(!L.equalsArray(this.value,this._value,0)){L.clone(this.value,this._value);const e=L.toArray(this.value,gy);this._gl.uniformMatrix3fv(this._location,!1,e)}};const yy=new Float32Array(16);function $f(e,t,n,i){this.name=n,this.value=void 0,this._value=new N,this._gl=e,this._location=i}$f.prototype.set=function(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);const e=N.toArray(this.value,yy);this._gl.uniformMatrix4fv(this._location,!1,e)}};function xy(e,t,n,i){switch(t.type){case e.FLOAT:return new Zf(e,t,n,i);case e.FLOAT_VEC2:return new Kf(e,t,n,i);case e.FLOAT_VEC3:return new Qf(e,t,n,i);case e.FLOAT_VEC4:return new Jf(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new bc(e,t,n,i);case e.INT:case e.BOOL:return new eu(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new tu(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new nu(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new iu(e,t,n,i);case e.FLOAT_MAT2:return new ou(e,t,n,i);case e.FLOAT_MAT3:return new ru(e,t,n,i);case e.FLOAT_MAT4:return new su(e,t,n,i);default:throw new ct(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Zf(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]}Zf.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 Kf(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]}Kf.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 Qf(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]}Qf.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 Jf(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]}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];if(h(a.red))w.equalsArray(a,n,o)||(w.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 bc(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}bc.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)}},bc.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 eu(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]}eu.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 tu(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]}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];U.equalsArray(a,n,o)||(U.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function nu(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]}nu.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 iu(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]}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];Y.equalsArray(a,n,o)||(Y.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function ou(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]}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];ae.equalsArray(a,n,o)||(ae.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function ru(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]}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];L.equalsArray(a,n,o)||(L.pack(a,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function su(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]}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];N.equalsArray(a,n,o)||(N.pack(a,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};let Cy=0;function rt(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=Ey(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=Cy++}rt.fromCache=function(e){return e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},rt.replaceCache=function(e){return e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(rt.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 au(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 Ey(e,t){const n={};if(!Ee.highpFloatSupported||!Ee.highpIntSupported){let i,o,s,a;const c=au(e),l=au(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 Ty(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
|
-
${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(s),e.deleteProgram(a),new
|
|
48
|
-
${x}`)}}function Ty(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 by(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=py(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=yy(e,c,u,p),n[u]=d,i.push(d),d._setSampler&&o.push(d)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function wy(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=as[a];h(l)?n.push({uniform:s,automaticUniform:l}):i.push(s)}return{automaticUniforms:n,manualUniforms:i}}function Sy(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 Fs(e){h(e._program)||cu(e)}function cu(e){const t=e._program,n=e._gl,i=Ey(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),s=by(n,i),a=wy(e,s.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Ty(n,i,o),e._uniformsByName=s.uniformsByName,e._uniforms=s.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=Sy(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{cu(e),u(e._program)}catch(x){e._vertexShaderText=p,e._fragmentShaderText=g;const T=/(?:Compile|Link) error: ([^]*)/.exec(x.message);d(T?T[1]:x.message)}})}ot.prototype._bind=function(){Fs(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 fe={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};fe.getSizeInBytes=function(e){if(!h(e))throw new C("value is required.");switch(e){case fe.BYTE:return Int8Array.BYTES_PER_ELEMENT;case fe.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case fe.SHORT:return Int16Array.BYTES_PER_ELEMENT;case fe.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case fe.INT:return Int32Array.BYTES_PER_ELEMENT;case fe.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case fe.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case fe.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}},fe.fromTypedArray=function(e){if(e instanceof Int8Array)return fe.BYTE;if(e instanceof Uint8Array)return fe.UNSIGNED_BYTE;if(e instanceof Int16Array)return fe.SHORT;if(e instanceof Uint16Array)return fe.UNSIGNED_SHORT;if(e instanceof Int32Array)return fe.INT;if(e instanceof Uint32Array)return fe.UNSIGNED_INT;if(e instanceof Float32Array)return fe.FLOAT;if(e instanceof Float64Array)return fe.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},fe.validate=function(e){return h(e)&&(e===fe.BYTE||e===fe.UNSIGNED_BYTE||e===fe.SHORT||e===fe.UNSIGNED_SHORT||e===fe.INT||e===fe.UNSIGNED_INT||e===fe.FLOAT||e===fe.DOUBLE)},fe.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 fe.BYTE:return new Int8Array(t);case fe.UNSIGNED_BYTE:return new Uint8Array(t);case fe.SHORT:return new Int16Array(t);case fe.UNSIGNED_SHORT:return new Uint16Array(t);case fe.INT:return new Int32Array(t);case fe.UNSIGNED_INT:return new Uint32Array(t);case fe.FLOAT:return new Float32Array(t);case fe.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}},fe.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)/fe.getSizeInBytes(e)),e){case fe.BYTE:return new Int8Array(t,n,i);case fe.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case fe.SHORT:return new Int16Array(t,n,i);case fe.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case fe.INT:return new Int32Array(t,n,i);case fe.UNSIGNED_INT:return new Uint32Array(t,n,i);case fe.FLOAT:return new Float32Array(t,n,i);case fe.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}},fe.fromName=function(e){switch(e){case"BYTE":return fe.BYTE;case"UNSIGNED_BYTE":return fe.UNSIGNED_BYTE;case"SHORT":return fe.SHORT;case"UNSIGNED_SHORT":return fe.UNSIGNED_SHORT;case"INT":return fe.INT;case"UNSIGNED_INT":return fe.UNSIGNED_INT;case"FLOAT":return fe.FLOAT;case"DOUBLE":return fe.DOUBLE;default:throw new C("name is not a valid value.")}};const oe=Object.freeze(fe),or=Object.freeze({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3});function lt(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,or.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}lt.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 Ay=new ee,Dy=new f,lu=new N,Oy=[new ee,new ee,new ee],vy=[new U,new U,new U],Iy=[new U,new U,new U],Ry=new f,zy=new J,Py=new N,By=new ae;lt._textureCoordinateRotationPoints=function(e,t,n,i){let o;const s=ce.center(i,Ay),a=ee.toCartesian(s,n,Dy),c=me.eastNorthUpToFixedFrame(a,n,lu),l=N.inverse(c,lu),u=vy,d=Oy;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=Ry;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,zy),y=F.fromQuaternion(g,Py),x=e.length;let E=Number.POSITIVE_INFINITY,T=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=F.multiplyByVector(y,p,p),E=Math.min(E,p.x),T=Math.min(T,p.y),D=Math.max(D,p.x),A=Math.max(A,p.y);const O=ae.fromRotation(t,By),I=Iy;I[0].x=E,I[0].y=T,I[1].x=E,I[1].y=A,I[2].x=D,I[2].y=T;const B=u[0],M=u[2].x-B.x,G=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)/G}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 Pt(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 Ao(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(Ao.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}}}),Ao.clone=function(e){if(h(e))return new Ao(e._format,e._datatype,e._width,e._height,e._buffer)},Ao.prototype.clone=function(){return Ao.clone(this)};function hu(){if(!h(Et._canTransferArrayBuffer)){const e=bc("transferTypedArrayTest");e.postMessage=_(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Et._canTransferArrayBuffer=!1,Et._canTransferArrayBuffer}Et._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){const s=o.data.array,a=h(s)&&s[0]===t;i(a),e.terminate(),Et._canTransferArrayBuffer=a}})}return Et._canTransferArrayBuffer}const Ec=new ze;function Tc(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 bc(e){const t=new ai(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={};let s,a;if(Qa(e))a=e;else if(!n){const c=hn(`${Et._workerModulePrefix}/${i}.js`);Qa(c)&&(a=c)}if(a){const c=`import "${a}";`;return s=Tc(c),o.type="module",new Worker(s,o)}if(!n&&typeof CESIUM_WORKERS<"u"){const c=`
|
|
49
|
-
importScripts("${
|
|
47
|
+
${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(s),e.deleteProgram(a),new ct(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 by(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 wy(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=my(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=xy(e,c,u,p),n[u]=d,i.push(d),d._setSampler&&o.push(d)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Sy(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=hs[a];h(l)?n.push({uniform:s,automaticUniform:l}):i.push(s)}return{automaticUniforms:n,manualUniforms:i}}function Ay(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)||cu(e)}function cu(e){const t=e._program,n=e._gl,i=Ty(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),s=wy(n,i),a=Sy(e,s.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=by(n,i,o),e._uniformsByName=s.uniformsByName,e._uniforms=s.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=Ay(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{cu(e),u(e._program)}catch(x){e._vertexShaderText=p,e._fragmentShaderText=g;const T=/(?:Compile|Link) error: ([^]*)/.exec(x.message);d(T?T[1]:x.message)}})}rt.prototype._bind=function(){Vs(this),this._gl.useProgram(this._program)},rt.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)}`)}},rt.prototype.isDestroyed=function(){return!1},rt.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},rt.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),Qe(this)};const fe={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};fe.getSizeInBytes=function(e){if(!h(e))throw new C("value is required.");switch(e){case fe.BYTE:return Int8Array.BYTES_PER_ELEMENT;case fe.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case fe.SHORT:return Int16Array.BYTES_PER_ELEMENT;case fe.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case fe.INT:return Int32Array.BYTES_PER_ELEMENT;case fe.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case fe.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case fe.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}},fe.fromTypedArray=function(e){if(e instanceof Int8Array)return fe.BYTE;if(e instanceof Uint8Array)return fe.UNSIGNED_BYTE;if(e instanceof Int16Array)return fe.SHORT;if(e instanceof Uint16Array)return fe.UNSIGNED_SHORT;if(e instanceof Int32Array)return fe.INT;if(e instanceof Uint32Array)return fe.UNSIGNED_INT;if(e instanceof Float32Array)return fe.FLOAT;if(e instanceof Float64Array)return fe.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")},fe.validate=function(e){return h(e)&&(e===fe.BYTE||e===fe.UNSIGNED_BYTE||e===fe.SHORT||e===fe.UNSIGNED_SHORT||e===fe.INT||e===fe.UNSIGNED_INT||e===fe.FLOAT||e===fe.DOUBLE)},fe.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 fe.BYTE:return new Int8Array(t);case fe.UNSIGNED_BYTE:return new Uint8Array(t);case fe.SHORT:return new Int16Array(t);case fe.UNSIGNED_SHORT:return new Uint16Array(t);case fe.INT:return new Int32Array(t);case fe.UNSIGNED_INT:return new Uint32Array(t);case fe.FLOAT:return new Float32Array(t);case fe.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}},fe.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)/fe.getSizeInBytes(e)),e){case fe.BYTE:return new Int8Array(t,n,i);case fe.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case fe.SHORT:return new Int16Array(t,n,i);case fe.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case fe.INT:return new Int32Array(t,n,i);case fe.UNSIGNED_INT:return new Uint32Array(t,n,i);case fe.FLOAT:return new Float32Array(t,n,i);case fe.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}},fe.fromName=function(e){switch(e){case"BYTE":return fe.BYTE;case"UNSIGNED_BYTE":return fe.UNSIGNED_BYTE;case"SHORT":return fe.SHORT;case"UNSIGNED_SHORT":return fe.UNSIGNED_SHORT;case"INT":return fe.INT;case"UNSIGNED_INT":return fe.UNSIGNED_INT;case"FLOAT":return fe.FLOAT;case"DOUBLE":return fe.DOUBLE;default:throw new C("name is not a valid value.")}};const oe=Object.freeze(fe),rr=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,rr.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 Dy=new ee,Oy=new f,lu=new N,vy=[new ee,new ee,new ee],Iy=[new U,new U,new U],Ry=[new U,new U,new U],zy=new f,Py=new J,By=new N,Ny=new ae;ht._textureCoordinateRotationPoints=function(e,t,n,i){let o;const s=ce.center(i,Dy),a=ee.toCartesian(s,n,Oy),c=_e.eastNorthUpToFixedFrame(a,n,lu),l=N.inverse(c,lu),u=Iy,d=vy;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=zy;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,Py),y=L.fromQuaternion(g,By),x=e.length;let E=Number.POSITIVE_INFINITY,T=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),T=Math.min(T,p.y),D=Math.max(D,p.x),A=Math.max(A,p.y);const O=ae.fromRotation(t,Ny),I=Ry;I[0].x=E,I[0].y=T,I[1].x=E,I[1].y=A,I[2].x=D,I[2].y=T;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],k=I[1],V=I[2],H=new Array(6);return U.pack(P,H),U.pack(k,H,2),U.pack(V,H,4),H};function Pt(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 Ao(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(Ao.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}}}),Ao.clone=function(e){if(h(e))return new Ao(e._format,e._datatype,e._width,e._height,e._buffer)},Ao.prototype.clone=function(){return Ao.clone(this)};function hu(){if(!h(Et._canTransferArrayBuffer)){const e=Ac("transferTypedArrayTest");e.postMessage=_(e.webkitPostMessage,e.postMessage);const t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Et._canTransferArrayBuffer=!1,Et._canTransferArrayBuffer}Et._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){const s=o.data.array,a=h(s)&&s[0]===t;i(a),e.terminate(),Et._canTransferArrayBuffer=a}})}return Et._canTransferArrayBuffer}const wc=new Pe;function Sc(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 Ac(e){const t=new ai(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={};let s,a;if(tc(e))a=e;else if(!n){const c=hn(`${Et._workerModulePrefix}/${i}.js`);tc(c)&&(a=c)}if(a){const c=`import "${a}";`;return s=Sc(c),o.type="module",new Worker(s,o)}if(!n&&typeof CESIUM_WORKERS<"u"){const c=`
|
|
49
|
+
importScripts("${Sc(CESIUM_WORKERS)}");
|
|
50
50
|
CesiumWorkers["${i}"]();
|
|
51
|
-
`;return s=Tc(c),new Worker(s,o)}if(s=e,n||(s=hn(`${Et._workerModulePrefix+i}.js`)),!mt.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 Ny(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!mt.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 Et(e,t){this._workerPath=e,this._maximumActiveTasks=_(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Ly=(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),Ec.raiseEvent(a),i(a)}else Ec.raiseEvent(),n(s.result);e.removeEventListener("message",o)}};return o},Fy=[];async function My(e,t,n){const i=await Promise.resolve(hu());h(n)?i||(n.length=0):n=Fy;const o=e._nextID++,s=new Promise((a,c)=>{e._worker.addEventListener("message",Ly(e._worker,o,a,c))});return e._worker.postMessage({id:o,baseUrl:hn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),s}async function Uy(e,t,n){++e._activeTasks;try{const i=await My(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Et.prototype.scheduleTask=function(e,t){if(h(this._worker)||(this._worker=bc(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Uy(this,e,t)},Et.prototype.initWebAssemblyModule=async function(e){if(h(this._webAssemblyPromise))return this._webAssemblyPromise;const t=async()=>{const n=this._worker=bc(this._workerPath),i=await Ny(this,e),o=await Promise.resolve(hu());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},Et.prototype.isDestroyed=function(){return!1},Et.prototype.destroy=function(){return h(this._worker)&&this._worker.terminate(),Qe(this)},Et.taskCompletedEvent=Ec,Et._defaultWorkerModulePrefix="Workers/",Et._workerModulePrefix=Et._defaultWorkerModulePrefix,Et._canTransferArrayBuffer=void 0;function fi(){}fi._transcodeTaskProcessor=new Et("transcodeKTX2",Number.POSITIVE_INFINITY),fi._readyPromise=void 0;function ky(){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)||ky(),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 Ao(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 fu;uu.setKTX2SupportedFormats=function(e,t,n,i,o,s){fu={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:s}};function uu(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,fu)})}function Ms(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(Ms.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),Ms.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,T=this._flipY;let D=4;h(d)&&(D=ue.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),T&&(d=ue.flipY(d,g,x,p,p)),O=d):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,T),O=i),A=!0):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,!1),O=ue.createTypedArray(g,x,p,p)),c.texImage2D(u,0,y,p,p,0,g,de.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),T&&(d=ue.flipY(d,g,x,s,a)),c.texSubImage2D(u,0,t,n,s,a,g,de.toWebGLConstant(x,this._context),d)):(c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E),c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,T),c.texSubImage2D(u,0,t,n,g,de.toWebGLConstant(x,this._context),i))),c.bindTexture(l,null)},Ms.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===de.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===de.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 Us={DONT_CARE:R.DONT_CARE,FASTEST:R.FASTEST,NICEST:R.NICEST,validate:function(e){return e===Us.DONT_CARE||e===Us.FASTEST||e===Us.NICEST}},ks=Object.freeze(Us),Vs={NEAREST:R.NEAREST,LINEAR:R.LINEAR};Vs.validate=function(e){return e===Vs.NEAREST||e===Vs.LINEAR};const Zi=Object.freeze(Vs),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 Ft=Object.freeze(Pi),qs={CLAMP_TO_EDGE:R.CLAMP_TO_EDGE,REPEAT:R.REPEAT,MIRRORED_REPEAT:R.MIRRORED_REPEAT,validate:function(e){return e===qs.CLAMP_TO_EDGE||e===qs.REPEAT||e===qs.MIRRORED_REPEAT}},Do=Object.freeze(qs);function Yn(e){e=_(e,_.EMPTY_OBJECT);const{wrapS:t=Do.CLAMP_TO_EDGE,wrapT:n=Do.CLAMP_TO_EDGE,minificationFilter:i=Ft.LINEAR,magnificationFilter:o=Zi.LINEAR,maximumAnisotropy:s=1}=e;if(!Do.validate(t))throw new C("Invalid sampler.wrapS.");if(!Do.validate(n))throw new C("Invalid sampler.wrapT.");if(!Ft.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!Zi.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:Do.CLAMP_TO_EDGE,wrapT:Do.CLAMP_TO_EDGE,minificationFilter:Ft.NEAREST,magnificationFilter:Zi.NEAREST}));function Tt(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=ue.RGBA,pixelDatatype:o=de.UNSIGNED_BYTE,flipY:s=!0,skipColorSpaceConversion:a=!1,sampler:c=new Yn}=e,l=e.preMultiplyAlpha||i===ue.RGB||i===ue.LUMINANCE;let{width:u,height:d}=e;if(h(n)){if(!Object.values(Tt.FaceName).every(O=>h(n[O])))throw new C(`options.source requires faces ${Object.values(Tt.FaceName).join(", ")}.`);({width:u,height:d}=n.positiveX);for(const O of Tt.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>Ce.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${Ce.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ue.validate(i))throw new C("Invalid options.pixelFormat.");if(ue.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!de.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===de.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===de.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=ue.textureSizeInBytes(i,o,p,p)*6,y=ue.toInternalFormat(i,o,t),x=t._gl,E=x.TEXTURE_CUBE_MAP,T=x.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=E,this._texture=T,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 Ms(t,T,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,pu(this,c),x.activeTexture(x.TEXTURE0),x.bindTexture(E,T),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 Tt.getFaceNames())du(this[O],n==null?void 0:n[O],0);x.bindTexture(E,null)}Tt.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Vy(){yield Tt.FaceName.POSITIVEX,yield Tt.FaceName.NEGATIVEX,yield Tt.FaceName.POSITIVEY,yield Tt.FaceName.NEGATIVEY,yield Tt.FaceName.POSITIVEZ,yield Tt.FaceName.NEGATIVEZ}Tt.getFaceNames=function(){return Vy()};function du(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,de.toWebGLConstant(a,d),null);return}let{arrayBufferView:g}=t,y=4;h(g)&&(y=ue.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=ue.flipY(g,s,a,o,o)),p.texImage2D(i,n,c,o,o,0,s,de.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,de.toWebGLConstant(a,d),t))}Object.defineProperties(Tt.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){pu(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 pu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Ft.NEAREST_MIPMAP_NEAREST,Ft.NEAREST_MIPMAP_LINEAR,Ft.LINEAR_MIPMAP_NEAREST,Ft.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelDatatype;(a===de.FLOAT&&!s.textureFloatLinear||a===de.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Ft.NEAREST_MIPMAP_NEAREST:Ft.NEAREST,i=Zi.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)}Tt.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 Tt.getFaceNames())du(this[u],c[u],l)}i.bindTexture(s,null),this._hasMipmap=!0},Tt.prototype.generateMipmap=function(e){if(e=_(e,ks.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(!ks.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)},Tt.prototype.isDestroyed=function(){return!1},Tt.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 wc={czm_degreesPerRadian:`/**
|
|
51
|
+
`;return s=Sc(c),new Worker(s,o)}if(s=e,n||(s=hn(`${Et._workerModulePrefix+i}.js`)),!mt.supportsEsmWebWorkers())throw new ct("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function Fy(e,t){const n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!mt.supportsWebAssembly()){if(!h(t.fallbackModulePath))throw new ct(`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 Et(e,t){this._workerPath=e,this._maximumActiveTasks=_(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Ly=(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 ct(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),wc.raiseEvent(a),i(a)}else wc.raiseEvent(),n(s.result);e.removeEventListener("message",o)}};return o},My=[];async function Uy(e,t,n){const i=await Promise.resolve(hu());h(n)?i||(n.length=0):n=My;const o=e._nextID++,s=new Promise((a,c)=>{e._worker.addEventListener("message",Ly(e._worker,o,a,c))});return e._worker.postMessage({id:o,baseUrl:hn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),s}async function Vy(e,t,n){++e._activeTasks;try{const i=await Uy(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Et.prototype.scheduleTask=function(e,t){if(h(this._worker)||(this._worker=Ac(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Vy(this,e,t)},Et.prototype.initWebAssemblyModule=async function(e){if(h(this._webAssemblyPromise))return this._webAssemblyPromise;const t=async()=>{const n=this._worker=Ac(this._workerPath),i=await Fy(this,e),o=await Promise.resolve(hu());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 ct("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},s),c};return this._webAssemblyPromise=t(),this._webAssemblyPromise},Et.prototype.isDestroyed=function(){return!1},Et.prototype.destroy=function(){return h(this._worker)&&this._worker.terminate(),Qe(this)},Et.taskCompletedEvent=wc,Et._defaultWorkerModulePrefix="Workers/",Et._workerModulePrefix=Et._defaultWorkerModulePrefix,Et._canTransferArrayBuffer=void 0;function fi(){}fi._transcodeTaskProcessor=new Et("transcodeKTX2",Number.POSITIVE_INFINITY),fi._readyPromise=void 0;function ky(){const e=fi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return fi._transcodeTaskProcessor;throw new ct("KTX2 transcoder could not be initialized.")});fi._readyPromise=e}fi.transcode=function(e,t){return m.defined("supportedTargetFormats",t),h(fi._readyPromise)||ky(),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 Ao(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 fu;uu.setKTX2SupportedFormats=function(e,t,n,i,o,s){fu={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:s}};function uu(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,fu)})}function ks(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(ks.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),ks.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,T=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),T&&(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,T),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),T&&(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,T),c.texSubImage2D(u,0,t,n,g,pe.toWebGLConstant(x,this._context),i))),c.bindTexture(l,null)},ks.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 Gs={DONT_CARE:R.DONT_CARE,FASTEST:R.FASTEST,NICEST:R.NICEST,validate:function(e){return e===Gs.DONT_CARE||e===Gs.FASTEST||e===Gs.NICEST}},qs=Object.freeze(Gs),Hs={NEAREST:R.NEAREST,LINEAR:R.LINEAR};Hs.validate=function(e){return e===Hs.NEAREST||e===Hs.LINEAR};const Zi=Object.freeze(Hs),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 Lt=Object.freeze(Pi),Ws={CLAMP_TO_EDGE:R.CLAMP_TO_EDGE,REPEAT:R.REPEAT,MIRRORED_REPEAT:R.MIRRORED_REPEAT,validate:function(e){return e===Ws.CLAMP_TO_EDGE||e===Ws.REPEAT||e===Ws.MIRRORED_REPEAT}},Do=Object.freeze(Ws);function Yn(e){e=_(e,_.EMPTY_OBJECT);const{wrapS:t=Do.CLAMP_TO_EDGE,wrapT:n=Do.CLAMP_TO_EDGE,minificationFilter:i=Lt.LINEAR,magnificationFilter:o=Zi.LINEAR,maximumAnisotropy:s=1}=e;if(!Do.validate(t))throw new C("Invalid sampler.wrapS.");if(!Do.validate(n))throw new C("Invalid sampler.wrapT.");if(!Lt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!Zi.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:Do.CLAMP_TO_EDGE,wrapT:Do.CLAMP_TO_EDGE,minificationFilter:Lt.NEAREST,magnificationFilter:Zi.NEAREST}));function Tt(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(Tt.FaceName).every(O=>h(n[O])))throw new C(`options.source requires faces ${Object.values(Tt.FaceName).join(", ")}.`);({width:u,height:d}=n.positiveX);for(const O of Tt.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,T=x.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=E,this._texture=T,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 ks(t,T,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,pu(this,c),x.activeTexture(x.TEXTURE0),x.bindTexture(E,T),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 Tt.getFaceNames())du(this[O],n==null?void 0:n[O],0);x.bindTexture(E,null)}Tt.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*Gy(){yield Tt.FaceName.POSITIVEX,yield Tt.FaceName.NEGATIVEX,yield Tt.FaceName.POSITIVEY,yield Tt.FaceName.NEGATIVEY,yield Tt.FaceName.POSITIVEZ,yield Tt.FaceName.NEGATIVEZ}Tt.getFaceNames=function(){return Gy()};function du(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(Tt.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){pu(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 pu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Lt.NEAREST_MIPMAP_NEAREST,Lt.NEAREST_MIPMAP_LINEAR,Lt.LINEAR_MIPMAP_NEAREST,Lt.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelDatatype;(a===pe.FLOAT&&!s.textureFloatLinear||a===pe.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Lt.NEAREST_MIPMAP_NEAREST:Lt.NEAREST,i=Zi.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)}Tt.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 Tt.getFaceNames())du(this[u],c[u],l)}i.bindTexture(s,null),this._hasMipmap=!0},Tt.prototype.generateMipmap=function(e){if(e=_(e,qs.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(!qs.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)},Tt.prototype.isDestroyed=function(){return!1},Tt.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 Dc={czm_degreesPerRadian:`/**
|
|
52
52
|
* A built-in GLSL floating-point constant for converting radians to degrees.
|
|
53
53
|
*
|
|
54
54
|
* @alias czm_degreesPerRadian
|
|
@@ -3785,14 +3785,14 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives
|
|
|
3785
3785
|
#endif
|
|
3786
3786
|
${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
|
|
3787
3787
|
${n}`,n}function mu(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){const n=t.match(/\n/gm).length;let i="";for(let o=0;o<n;++o)i+=`
|
|
3788
|
-
`;return i})}function _u(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return h(i)||(t=mu(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function gu(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);h(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&
|
|
3788
|
+
`;return i})}function _u(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return h(i)||(t=mu(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function gu(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);h(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&ye._czmBuiltinsAndUniforms.hasOwnProperty(i)){const o=_u(i,ye._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),gu(o,t)}}))}function Hy(e){const t=[],n=[];for(;e.length>0;){const o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){const o=t.shift();e.push(o);for(let s=0;s<o.dependsOn.length;++s){const a=o.dependsOn[s],c=a.requiredBy.indexOf(o);a.requiredBy.splice(c,1),a.requiredBy.length===0&&t.push(a)}}const i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o]);if(i.length!==0){let o=`A circular dependency was found in the following built-in functions/structs/constants:
|
|
3789
3789
|
`;for(let s=0;s<i.length;++s)o=`${o+i[s].name}
|
|
3790
|
-
`;throw new C(o)}}function
|
|
3790
|
+
`;throw new C(o)}}function Wy(e){const t=[],n=_u("main",e,t);gu(n,t),Hy(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
|
|
3791
3791
|
`;return i.replace(n.glslSource,"")}function yu(e,t,n){let i,o,s="";const a=e.sources;if(h(a))for(i=0,o=a.length;i<o;++i)s+=`
|
|
3792
3792
|
#line 0
|
|
3793
3793
|
${a[i]}`;s=mu(s);let c;s=s.replace(/#version\s+(.*?)\n/gm,function(E,T){if(h(c)&&c!==T)throw new C(`inconsistent versions found: ${c} and ${T}`);return c=T,`
|
|
3794
3794
|
`});const l=[];s=s.replace(/#extension.*\n/gm,function(E){return l.push(E),`
|
|
3795
|
-
`}),s=s.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");const u=e.pickColorQualifier;h(u)&&(s=
|
|
3795
|
+
`}),s=s.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");const u=e.pickColorQualifier;h(u)&&(s=ye.createPickFragmentShaderSource(s,u));let d="";const p=l.length;for(i=0;i<p;i++)d+=l[i];t&&(d+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
3796
3796
|
precision highp float;
|
|
3797
3797
|
precision highp int;
|
|
3798
3798
|
#else
|
|
@@ -3806,20 +3806,20 @@ ${a[i]}`;s=mu(s);let c;s=s.replace(/#version\s+(.*?)\n/gm,function(E,T){if(h(c)&
|
|
|
3806
3806
|
|
|
3807
3807
|
`),n.floatingPointTexture&&(d+=`#define OES_texture_float
|
|
3808
3808
|
|
|
3809
|
-
`);let y="";e.includeBuiltIns&&(y=
|
|
3809
|
+
`);let y="";e.includeBuiltIns&&(y=Wy(s)),d+=`
|
|
3810
3810
|
#line 0
|
|
3811
3811
|
`;const x=y+s;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(x)&&!/czm_out_FragColor/g.test(x)&&/out_FragColor/g.test(x)&&(d+=`layout(location = 0) out vec4 out_FragColor;
|
|
3812
3812
|
|
|
3813
3813
|
`),d+=y,d+=s,n.webgl2?d=`#version 300 es
|
|
3814
|
-
${d}`:d=qy(d,t),d}function
|
|
3815
|
-
`);return`${t}:${n}:${i}:${o}`},
|
|
3814
|
+
${d}`:d=qy(d,t),d}function ye(e){e=_(e,_.EMPTY_OBJECT);const t=e.pickColorQualifier;if(h(t)&&t!=="uniform"&&t!=="in")throw new C("options.pickColorQualifier must be 'uniform' or 'in'.");this.defines=h(e.defines)?e.defines.slice(0):[],this.sources=h(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=_(e.includeBuiltIns,!0)}ye.prototype.clone=function(){return new ye({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},ye.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},ye.prototype.getCacheKey=function(){const t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
|
|
3815
|
+
`);return`${t}:${n}:${i}:${o}`},ye.prototype.createCombinedVertexShader=function(e){return yu(this,!1,e)},ye.prototype.createCombinedFragmentShader=function(e){return yu(this,!0,e)},ye._czmBuiltinsAndUniforms={};for(const e in Dc)Dc.hasOwnProperty(e)&&(ye._czmBuiltinsAndUniforms[e]=Dc[e]);for(const e in hs)if(hs.hasOwnProperty(e)){const t=hs[e];typeof t.getDeclaration=="function"&&(ye._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}ye.createPickVertexShaderSource=function(e){return`${ye.replaceMain(e,"czm_old_main")}
|
|
3816
3816
|
in vec4 pickColor;
|
|
3817
3817
|
out vec4 czm_pickColor;
|
|
3818
3818
|
void main()
|
|
3819
3819
|
{
|
|
3820
3820
|
czm_old_main();
|
|
3821
3821
|
czm_pickColor = pickColor;
|
|
3822
|
-
}`},
|
|
3822
|
+
}`},ye.createPickFragmentShaderSource=function(e,t){const n=ye.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
|
|
3823
3823
|
void main()
|
|
3824
3824
|
{
|
|
3825
3825
|
czm_old_main();
|
|
@@ -3828,8 +3828,8 @@ void main()
|
|
|
3828
3828
|
}
|
|
3829
3829
|
out_FragColor = czm_pickColor;
|
|
3830
3830
|
}`;return`${n}
|
|
3831
|
-
${i}`};function Wy(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 xu(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 Cu(e,t){const n=t.length;for(let i=0;i<n;++i){const o=t[i];if(xu(e,o))return o}}const jy=["v_normalEC","v_normal"];ge.findNormalVarying=function(e){return xu(e,"#ifdef HAS_NORMALS")?Wy(e,"HAS_NORMALS")?"v_normalEC":void 0:Cu(e,jy)};const Yy=["v_positionEC"];ge.findPositionVarying=function(e){return Cu(e,Yy)};function Bt(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const{context:t,source:n,pixelFormat:i=ue.RGBA,pixelDatatype:o=de.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===ue.RGB||i===ue.LUMINANCE,p=ue.toInternalFormat(i,o,t),g=ue.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>Ce.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${Ce.maximumTextureSize}). Check maximumTextureSize.`);if(m.typeOf.number.greaterThan("height",u,0),u>Ce.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${Ce.maximumTextureSize}). Check maximumTextureSize.`);if(!ue.validate(i))throw new C("Invalid options.pixelFormat.");if(!g&&!de.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===ue.DEPTH_COMPONENT&&o!==de.UNSIGNED_SHORT&&o!==de.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ue.DEPTH_STENCIL&&o!==de.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===de.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===de.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(ue.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(ue.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(ue.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(ue.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(ue.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(ue.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(ue.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(ue.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?ue.compressedTextureSizeInBytes(i,l,u):ue.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,Eu(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)?ue.isCompressedFormat(p)?Xy(this,n):$y(this,n):h(n.framebuffer)?Zy(this,n):Ky(this,n),this._initialized=!0):Qy(this),y.bindTexture(this._textureTarget,null)}function Xy(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=Gs(l),u=Gs(u),i.compressedTexImage2D(o,d+1,s,l,u,0,t.mipLevels[d])}}function $y(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=ue.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=ue.flipY(g,l,u,a,c)),i.texImage2D(o,0,s,a,c,0,l,de.toWebGLConstant(u,n),g),h(t.mipLevels)){let y=a,x=c;for(let E=0;E<t.mipLevels.length;++E)y=Gs(y),x=Gs(x),i.texImage2D(o,E+1,s,y,x,0,l,de.toWebGLConstant(u,n),t.mipLevels[E])}}function Zy(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 Ky(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,de.toWebGLConstant(e.pixelDatatype,n),t)}function Gs(e){const t=Math.floor(e/2)|0;return Math.max(t,1)}function Qy(e){const t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,de.toWebGLConstant(e._pixelDatatype,t),null)}Bt.create=function(e){return new Bt(e)},Bt.fromFramebuffer=function(e){e=_(e,_.EMPTY_OBJECT),m.defined("options.context",e.context);const t=e.context,n=t._gl,{pixelFormat:i=ue.RGB,framebufferXOffset:o=0,framebufferYOffset:s=0,width:a=n.drawingBufferWidth,height:c=n.drawingBufferHeight,framebuffer:l}=e;if(!ue.validate(i))throw new C("Invalid pixelFormat.");if(ue.isDepthFormat(i)||ue.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 Bt({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(Bt.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Eu(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 Eu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Ft.NEAREST_MIPMAP_NEAREST,Ft.NEAREST_MIPMAP_LINEAR,Ft.LINEAR_MIPMAP_NEAREST,Ft.LINEAR_MIPMAP_LINEAR].includes(n),s=e._context,a=e._pixelFormat,c=e._pixelDatatype;(c===de.FLOAT&&!s.textureFloatLinear||c===de.HALF_FLOAT&&!s.textureHalfFloatLinear)&&(n=o?Ft.NEAREST_MIPMAP_NEAREST:Ft.NEAREST,i=Zi.NEAREST),s.webgl2&&ue.isDepthFormat(a)&&(n=Ft.NEAREST,i=Zi.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)}Bt.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),ue.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ue.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,T=this._preMultiplyAlpha,D=this._flipY;let A=4;h(d)&&(A=ue.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=ue.flipY(d,x,E,p,g):I=d):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,T),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=ue.createTypedArray(x,E,p,g)),a.texImage2D(c,0,y,p,g,0,x,de.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=ue.flipY(d,x,E,l,u):I=d):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,T),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,D),I=i),a.texSubImage2D(c,0,t,n,l,u,x,de.toWebGLConstant(E,s),I)}a.bindTexture(c,null)},Bt.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),ue.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===de.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===de.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ue.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},Bt.prototype.generateMipmap=function(e){if(e=_(e,ks.DONT_CARE),ue.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ue.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(!ks.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)},Bt.prototype.isDestroyed=function(){return!1},Bt.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),Qe(this)};function je(){this.high=f.clone(f.ZERO),this.low=f.clone(f.ZERO)}je.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};je.fromCartesian=function(e,t){m.typeOf.object("cartesian",e),h(t)||(t=new je);const n=t.high,i=t.low;return je.encode(e.x,ui),n.x=ui.high,i.x=ui.low,je.encode(e.y,ui),n.y=ui.high,i.y=ui.low,je.encode(e.z,ui),n.z=ui.high,i.z=ui.low,t};const Sc=new je;je.writeElements=function(e,t,n){m.defined("cartesianArray",t),m.typeOf.number("index",n),m.typeOf.number.greaterThanOrEquals("index",n,0),je.fromCartesian(e,Sc);const i=Sc.high,o=Sc.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 Be(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}Be.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 Be(t,i)};const Jy=new f;Be.fromCartesian4=function(e,t){m.typeOf.object("coefficients",e);const n=f.fromCartesian4(e,Jy),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 Be(n,i)},Be.getPointDistance=function(e,t){return m.typeOf.object("plane",e),m.typeOf.object("point",t),f.dot(e.normal,t)+e.distance};const ex=new f;Be.projectPointOntoPlane=function(e,t,n){m.typeOf.object("plane",e),m.typeOf.object("point",t),h(n)||(n=new f);const i=Be.getPointDistance(e,t),o=f.multiplyByScalar(e.normal,i,ex);return f.subtract(t,o,n)};const tx=new N,nx=new Y,ix=new f;Be.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,tx);let a=Y.fromElements(i.x,i.y,i.z,o,nx);a=N.multiplyByVector(s,a,a);const c=f.fromCartesian4(a,ix);return a=Y.divideByScalar(a,f.magnitude(c),a),Be.fromCartesian4(a,n)},Be.clone=function(e,t){return m.typeOf.object("plane",e),h(t)?(f.clone(e.normal,t.normal),t.distance=e.distance,t):new Be(e.normal,e.distance)},Be.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)},Be.ORIGIN_XY_PLANE=Object.freeze(new Be(f.UNIT_Z,0)),Be.ORIGIN_YZ_PLANE=Object.freeze(new Be(f.UNIT_X,0)),Be.ORIGIN_ZX_PLANE=Object.freeze(new Be(f.UNIT_Y,0));function yn(e){this.planes=_(e,[])}const rr=[new f,new f,new f];f.clone(f.UNIT_X,rr[0]),f.clone(f.UNIT_Y,rr[1]),f.clone(f.UNIT_Z,rr[2]);const Bi=new f,ox=new f,Tu=new Be(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=rr.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=rr[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,ox),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(Be.fromCartesian4(t[i],Tu));if(s===Ct.OUTSIDE)return Ct.OUTSIDE;s===Ct.INTERSECTING&&(n=!0)}return n?Ct.INTERSECTING:Ct.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(Be.fromCartesian4(i[o],Tu));if(c===Ct.OUTSIDE)return yn.MASK_OUTSIDE;c===Ct.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 bu(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 bu(this),this._orthographicMatrix}}});const rx=new f,sx=new f,ax=new f,Ac=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,rx);f.normalize(d,d);const p=sx;f.multiplyByScalar(t,l,p),f.add(e,p,p);const g=ax;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,Ac),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,Ac),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,Ac),g),this._cullingVolume},vn.prototype.getPixelDimensions=function(e,t,n,i,o){if(bu(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 Hs={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Hs.getMorphTime=function(e){return e===Hs.SCENE3D?1:e===Hs.MORPHING?void 0:0};const pe=Object.freeze(Hs);function cx(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 wu(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)cx(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),wu(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 Su(e){return e.values.length/e.componentsPerAttribute}function lx(e){return oe.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function hx(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=Su(e[o[0]]),t=1;t<a;++t){const u=Su(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+=lx(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,T=y[n],D=T.pointer,A=i.componentsPerAttribute;for(let O=0;O<A;++O)D[T.index+O]=E[t*A+O];T.index+=T.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,Ae.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=hx(p);if(h(x)){u=Ot.createVertexBuffer({context:t,typedArray:x.buffer,usage:i});const E=x.offsetsInBytes,T=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:T}):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=Ot.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)&&(lt.computeNumberOfVertices(n)>=S.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?g=Ot.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:xt.UNSIGNED_INT}):g=Ot.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:xt.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 fx(e){const t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;const i=t._vertexAttribDivisors,o=e._attributes,s=Ce.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 ux(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&&fx(this),this._hasConstantAttributes&&ux(this,this._gl)):wu(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 bt(e,t,n,i){if(m.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");const o=bt._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=bt._vertexSizeInBytes(c),g=c[0].usage,y={vertexSizeInBytes:p,vertexBuffer:void 0,usage:g,needsCommit:!1,arrayBuffer:void 0,arrayViews:bt._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)}bt._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,Ae.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(!Ae.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},bt._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},bt._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},bt.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];bt._resize(o,this._size),bt._appendWriters(this.writers,o)}Dc(this)},bt._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 dx=[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}}];bt._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]=dx[s.componentsPerAttribute-1](t,s.view,s.vertexSizeInComponentType)}},bt.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=px(this,i)||t;if(t||!h(this.va)){Dc(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);bt._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 px(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=Ot.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}bt._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})}},bt.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)mx(n[i],e,t)};function mx(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)}}bt.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Dc(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}bt.prototype.isDestroyed=function(){return!1},bt.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 Dc(this),Qe(this)};function $n(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new ze,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 _x(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 gx(e){return new $n(e)}function L(e,t,n){return _x(e,`_${e.toString()}`,`_${e.toString()}Subscription`,_(t,!1),_(n,gx))}function sr(e){this._definitionChanged=new ze,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(sr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),image:L("image"),scale:L("scale"),pixelOffset:L("pixelOffset"),eyeOffset:L("eyeOffset"),horizontalOrigin:L("horizontalOrigin"),verticalOrigin:L("verticalOrigin"),heightReference:L("heightReference"),color:L("color"),rotation:L("rotation"),alignedAxis:L("alignedAxis"),sizeInMeters:L("sizeInMeters"),width:L("width"),height:L("height"),scaleByDistance:L("scaleByDistance"),translucencyByDistance:L("translucencyByDistance"),pixelOffsetScaleByDistance:L("pixelOffsetScaleByDistance"),imageSubRegion:L("imageSubRegion"),distanceDisplayCondition:L("distanceDisplayCondition"),disableDepthTestDistance:L("disableDepthTestDistance"),splitDirection:L("splitDirection")}),sr.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 sr(this)},sr.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 Te(e,t,n,i){this.near=_(e,0),this.nearValue=_(t,0),this.far=_(n,1),this.farValue=_(i,0)}Te.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 Te(e.near,e.nearValue,e.far,e.farValue)},Te.packedLength=4,Te.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},Te.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new Te),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},Te.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},Te.prototype.clone=function(e){return Te.clone(this,e)},Te.prototype.equals=function(e){return Te.equals(this,e)};const Ki={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(Ki);function Ws(e){return e===Ki.CLAMP_TO_GROUND||e===Ki.CLAMP_TO_3D_TILE||e===Ki.CLAMP_TO_TERRAIN}function yx(e){return e===Ki.RELATIVE_TO_GROUND||e===Ki.RELATIVE_TO_3D_TILE||e===Ki.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 Se(){C.throwInstantiationError()}Object.defineProperties(Se.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}}),Se.prototype.getValue=C.throwInstantiationError,Se.prototype.equals=C.throwInstantiationError,Se.equals=function(e,t){return e===t||h(e)&&e.equals(t)},Se.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(!Se.equals(e[i],t[i]))return!1;return!0},Se.isConstant=function(e){return!h(e)||e.isConstant},Se.getValueOrUndefined=function(e,t,n){return h(e)?e.getValue(t,n):void 0},Se.getValueOrDefault=function(e,t,n,i){return h(e)?_(e.getValue(t,i),n):n},Se.getValueOrClonedDefault=function(e,t,n,i){let o;return h(e)&&(o=e.getValue(t,i)),h(o)||(o=n.clone(o)),o};const Au=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});function Qi(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 Oc=new f,vc=new f,Ic=new f,Rc=new f,zc=new f,Pc=new f,Bc=new f,Nt=new f,Nc=new f,Lc=new f,Fc=new f,Mc=new f,xx=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],Bc),i=f.clone(n,Oc),o=f.clone(n,vc),s=f.clone(n,Ic),a=f.clone(n,Rc),c=f.clone(n,zc),l=f.clone(n,Pc),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,Nt)),g=f.magnitudeSquared(f.subtract(c,o,Nt)),y=f.magnitudeSquared(f.subtract(l,s,Nt));let x=i,E=a,T=p;g>T&&(T=g,x=o,E=c),y>T&&(T=y,x=s,E=l);const D=Nc;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,Nt)),O=Math.sqrt(A);const I=Lc;I.x=i.x,I.y=o.y,I.z=s.z;const B=Fc;B.x=a.x,B.y=c.y,B.z=l.z;const M=f.midpoint(I,B,Mc);let G=0;for(d=0;d<u;d++){f.clone(e[d],n);const P=f.magnitude(f.subtract(n,M,Nt));P>G&&(G=P);const V=f.magnitudeSquared(f.subtract(n,D,Nt));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<G?(f.clone(D,t.center),t.radius=O):(f.clone(M,t.center),t.radius=G),t};const Du=new Sn,Cx=new f,Ex=new f,Uc=new ee,kc=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;Du._ellipsoid=le.default,t=_(t,Du),ce.southwest(e,Uc),Uc.height=n,ce.northeast(e,kc),kc.height=i;const s=t.project(Uc,Cx),a=t.project(kc,Ex),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 Tx=[];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,Tx);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=Bc;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;const s=f.clone(o,Oc),a=f.clone(o,vc),c=f.clone(o,Ic),l=f.clone(o,Rc),u=f.clone(o,zc),d=f.clone(o,Pc),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,Nt)),x=f.magnitudeSquared(f.subtract(u,a,Nt)),E=f.magnitudeSquared(f.subtract(d,c,Nt));let T=s,D=l,A=y;x>A&&(A=x,T=a,D=u),E>A&&(A=E,T=c,D=d);const O=Nc;O.x=(T.x+D.x)*.5,O.y=(T.y+D.y)*.5,O.z=(T.z+D.z)*.5;let I=f.magnitudeSquared(f.subtract(D,O,Nt)),B=Math.sqrt(I);const M=Lc;M.x=s.x,M.y=a.y,M.z=c.z;const G=Fc;G.x=l.x,G.y=u.y,G.z=d.z;const P=f.midpoint(M,G,Mc);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,Nt));k>V&&(V=k);const H=f.magnitudeSquared(f.subtract(o,O,Nt));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=Bc;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const o=f.clone(i,Oc),s=f.clone(i,vc),a=f.clone(i,Ic),c=f.clone(i,Rc),l=f.clone(i,zc),u=f.clone(i,Pc),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,Nt)),y=f.magnitudeSquared(f.subtract(l,s,Nt)),x=f.magnitudeSquared(f.subtract(u,a,Nt));let E=o,T=c,D=g;y>D&&(D=y,E=s,T=l),x>D&&(D=x,E=a,T=u);const A=Nc;A.x=(E.x+T.x)*.5,A.y=(E.y+T.y)*.5,A.z=(E.z+T.z)*.5;let O=f.magnitudeSquared(f.subtract(T,A,Nt)),I=Math.sqrt(O);const B=Lc;B.x=o.x,B.y=s.y,B.z=a.z;const M=Fc;M.x=c.x,M.y=l.y,M.z=u.z;const G=f.midpoint(B,M,Mc);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,G,Nt));V>P&&(P=V);const k=f.magnitudeSquared(f.subtract(i,A,Nt));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(G,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 bx=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,bx)+c.radius)}return t.radius=a,t};const wx=new f,Sx=new f,Ax=new f;K.fromOrientedBoundingBox=function(e,t){m.defined("orientedBoundingBox",e),h(t)||(t=new K);const n=e.halfAxes,i=F.getColumn(n,0,wx),o=F.getColumn(n,1,Sx),s=F.getColumn(n,2,Ax);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 Dx=new f,Ox=new f;K.fromTransformation=function(e,t){m.typeOf.object("transformation",e),h(t)||(t=new K);const n=N.getTranslation(e,Dx),i=N.getScale(e,Ox),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 vx=new f,Ix=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,vx),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,Ix);return f.add(d,i,d),f.clone(d,n.center),n.radius=u,n};const Rx=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,Rx));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?Ct.OUTSIDE:s<i?Ct.INTERSECTING:Ct.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 zx=new f;K.distanceSquaredTo=function(e,t){m.typeOf.object("sphere",e),m.typeOf.object("cartesian",t);const n=f.subtract(e.center,t,zx),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 Px=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 Qi);const o=f.subtract(e.center,t,Px),s=f.dot(n,o);return i.start=s-e.radius,i.stop=s+e.radius,i};const Ou=new f,Bx=new f,Nx=new f,Lx=new f,Fx=new f,Mx=new ee,vu=new Array(8);for(let e=0;e<8;++e)vu[e]=new f;const Iu=new Sn;K.projectTo2D=function(e,t,n){m.typeOf.object("sphere",e),Iu._ellipsoid=le.default,t=_(t,Iu);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,Ou):a=i.geodeticSurfaceNormal(o,Ou);const c=f.cross(f.UNIT_Z,a,Bx);f.normalize(c,c);const l=f.cross(a,c,Nx);f.normalize(l,l),f.multiplyByScalar(a,s,a),f.multiplyByScalar(l,s,l),f.multiplyByScalar(c,s,c);const u=f.negate(l,Fx),d=f.negate(c,Lx),p=vu;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,Mx);t.project(O,A)}n=K.fromPoints(p,n),o=n.center;const x=o.x,E=o.y,T=o.z;return o.x=T,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 xx*e*e*e};function Ru(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 zu=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 Oo(e,t,n,i){e=_(e,1),t=_(t,1),n=_(n,1),i=_(i,1),this.value=new Uint8Array([w.floatToByte(e),w.floatToByte(t),w.floatToByte(n),w.floatToByte(i)])}Object.defineProperties(Oo.prototype,{componentDatatype:{get:function(){return oe.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),Oo.fromColor=function(e){if(!h(e))throw new C("color is required.");return new Oo(e.red,e.green,e.blue,e.alpha)},Oo.toValue=function(e,t){if(!h(e))throw new C("color is required.");return h(t)?e.toBytes(t):new Uint8Array(e.toBytes())},Oo.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 js(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 vo={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):(vo.start=i,vo.stop=o,vo.isStartIncluded=s,vo.isStopIncluded=a,vo.data=c,new Ke(vo))},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 Pu=Object.freeze($.fromIso8601("0000-01-01T00:00:00Z")),Bu=Object.freeze($.fromIso8601("9999-12-31T24:00:00Z")),Ux=Object.freeze(new Ke({start:Pu,stop:Bu})),Li={MINIMUM_VALUE:Pu,MAXIMUM_VALUE:Bu,MAXIMUM_INTERVAL:Ux};function ar(e,t,n){e=_(e,0),t=_(t,0),n=_(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(ar.prototype,{componentDatatype:{get:function(){return oe.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),ar.fromCartesian3=function(e){return m.defined("offset",e),new ar(e.x,e.y,e.z)},ar.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 kx={ADD:R.FUNC_ADD,SUBTRACT:R.FUNC_SUBTRACT,REVERSE_SUBTRACT:R.FUNC_REVERSE_SUBTRACT,MIN:R.MIN,MAX:R.MAX},Io=Object.freeze(kx),Vx={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(Vx),qx={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Io.ADD,equationAlpha:Io.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:Io.ADD,equationAlpha:Io.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:Io.ADD,equationAlpha:Io.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE,functionDestinationAlpha:xn.ONE})},Ji=Object.freeze(qx),Gx={FRONT:R.FRONT,BACK:R.BACK,FRONT_AND_BACK:R.FRONT_AND_BACK},Ro=Object.freeze(Gx);function Mt(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(Mt.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}}}),Mt.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
|
-
`)},Mt.prototype.isTranslucent=function(){return h(this.material)&&this.material.isTranslucent()||!h(this.material)&&this.translucent},Mt.prototype.getRenderState=function(){const e=this.isTranslucent(),t=tn(this.renderState,!1);return e?(t.depthMask=!1,t.blending=Ji.ALPHA_BLEND):t.depthMask=!0,t},Mt.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=Ji.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ro.BACK}),h(n)&&(i=nn(n,i,!0)),i};const
|
|
3831
|
+
${i}`};function jy(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 xu(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 Cu(e,t){const n=t.length;for(let i=0;i<n;++i){const o=t[i];if(xu(e,o))return o}}const Yy=["v_normalEC","v_normal"];ye.findNormalVarying=function(e){return xu(e,"#ifdef HAS_NORMALS")?jy(e,"HAS_NORMALS")?"v_normalEC":void 0:Cu(e,Yy)};const Xy=["v_positionEC"];ye.findPositionVarying=function(e){return Cu(e,Xy)};function Bt(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=kn(),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,Eu(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)?$y(this,n):Zy(this,n):h(n.framebuffer)?Ky(this,n):Qy(this,n),this._initialized=!0):Jy(this),y.bindTexture(this._textureTarget,null)}function $y(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=js(l),u=js(u),i.compressedTexImage2D(o,d+1,s,l,u,0,t.mipLevels[d])}}function Zy(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=js(y),x=js(x),i.texImage2D(o,E+1,s,y,x,0,l,pe.toWebGLConstant(u,n),t.mipLevels[E])}}function Ky(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 Qy(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 js(e){const t=Math.floor(e/2)|0;return Math.max(t,1)}function Jy(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)}Bt.create=function(e){return new Bt(e)},Bt.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 Bt({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(Bt.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Eu(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 Eu(e,t){let{minificationFilter:n,magnificationFilter:i}=t;const o=[Lt.NEAREST_MIPMAP_NEAREST,Lt.NEAREST_MIPMAP_LINEAR,Lt.LINEAR_MIPMAP_NEAREST,Lt.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?Lt.NEAREST_MIPMAP_NEAREST:Lt.NEAREST,i=Zi.NEAREST),s.webgl2&&de.isDepthFormat(a)&&(n=Lt.NEAREST,i=Zi.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)}Bt.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,T=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,T),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,T),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)},Bt.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},Bt.prototype.generateMipmap=function(e){if(e=_(e,qs.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(!qs.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)},Bt.prototype.isDestroyed=function(){return!1},Bt.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 Oc=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,Oc);const i=Oc.high,o=Oc.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 ex=new f;Ne.fromCartesian4=function(e,t){m.typeOf.object("coefficients",e);const n=f.fromCartesian4(e,ex),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 tx=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,tx);return f.subtract(t,o,n)};const nx=new N,ix=new Y,ox=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,nx);let a=Y.fromElements(i.x,i.y,i.z,o,ix);a=N.multiplyByVector(s,a,a);const c=f.fromCartesian4(a,ox);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 sr=[new f,new f,new f];f.clone(f.UNIT_X,sr[0]),f.clone(f.UNIT_Y,sr[1]),f.clone(f.UNIT_Z,sr[2]);const Bi=new f,rx=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=sr.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=sr[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,rx),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===Ct.OUTSIDE)return Ct.OUTSIDE;s===Ct.INTERSECTING&&(n=!0)}return n?Ct.INTERSECTING:Ct.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===Ct.OUTSIDE)return yn.MASK_OUTSIDE;c===Ct.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 bu(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 bu(this),this._orthographicMatrix}}});const sx=new f,ax=new f,cx=new f,vc=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,sx);f.normalize(d,d);const p=ax;f.multiplyByScalar(t,l,p),f.add(e,p,p);const g=cx;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,vc),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,vc),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,vc),g),this._cullingVolume},vn.prototype.getPixelDimensions=function(e,t,n,i,o){if(bu(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 Ys={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};Ys.getMorphTime=function(e){return e===Ys.SCENE3D?1:e===Ys.MORPHING?void 0:0};const me=Object.freeze(Ys);function lx(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 wu(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)lx(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),wu(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 Su(e){return e.values.length/e.componentsPerAttribute}function hx(e){return oe.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function fx(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=Su(e[o[0]]),t=1;t<a;++t){const u=Su(e[o[t]]);if(u!==s)throw new ct(`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+=hx(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,T=y[n],D=T.pointer,A=i.componentsPerAttribute;for(let O=0;O<A;++O)D[T.index+O]=E[t*A+O];T.index+=T.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=fx(p);if(h(x)){u=Ot.createVertexBuffer({context:t,typedArray:x.buffer,usage:i});const E=x.offsetsInBytes,T=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:T}):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=Ot.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=Ot.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:xt.UNSIGNED_INT}):g=Ot.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:xt.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 ux(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 dx(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&&ux(this),this._hasConstantAttributes&&dx(this,this._gl)):wu(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 bt(e,t,n,i){if(m.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");const o=bt._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=bt._vertexSizeInBytes(c),g=c[0].usage,y={vertexSizeInBytes:p,vertexBuffer:void 0,usage:g,needsCommit:!1,arrayBuffer:void 0,arrayViews:bt._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)}bt._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},bt._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},bt._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},bt.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];bt._resize(o,this._size),bt._appendWriters(this.writers,o)}Ic(this)},bt._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 px=[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}}];bt._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]=px[s.componentsPerAttribute-1](t,s.view,s.vertexSizeInComponentType)}},bt.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=mx(this,i)||t;if(t||!h(this.va)){Ic(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);bt._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 mx(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=Ot.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}bt._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})}},bt.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)_x(n[i],e,t)};function _x(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)}}bt.prototype.endSubCommits=function(){const e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Ic(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}bt.prototype.isDestroyed=function(){return!1},bt.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 Ic(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 gx(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 yx(e){return new $n(e)}function F(e,t,n){return gx(e,`_${e.toString()}`,`_${e.toString()}Subscription`,_(t,!1),_(n,yx))}function ar(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(ar.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")}),ar.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 ar(this)},ar.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 st(e,t){e=_(e,0),this._near=e,t=_(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(st.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}}}),st.packedLength=2,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.near,t[n]=e.far,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.near=e[t++],n.far=e[t],n},st.equals=function(e,t){return e===t||h(e)&&h(t)&&e.near===t.near&&e.far===t.far},st.clone=function(e,t){if(h(e))return h(t)||(t=new st),t.near=e.near,t.far=e.far,t},st.prototype.clone=function(e){return st.clone(this,e)},st.prototype.equals=function(e){return st.equals(this,e)};function be(e,t,n,i){this.near=_(e,0),this.nearValue=_(t,0),this.far=_(n,1),this.farValue=_(i,0)}be.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 be(e.near,e.nearValue,e.far,e.farValue)},be.packedLength=4,be.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},be.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new be),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n},be.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},be.prototype.clone=function(e){return be.clone(this,e)},be.prototype.equals=function(e){return be.equals(this,e)};const Ki={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(Ki);function Xs(e){return e===Ki.CLAMP_TO_GROUND||e===Ki.CLAMP_TO_3D_TILE||e===Ki.CLAMP_TO_TERRAIN}function xx(e){return e===Ki.RELATIVE_TO_GROUND||e===Ki.RELATIVE_TO_3D_TILE||e===Ki.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 Au=Object.freeze({LEFT:-1,NONE:0,RIGHT:1});function Qi(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 Rc=new f,zc=new f,Pc=new f,Bc=new f,Nc=new f,Fc=new f,Lc=new f,Nt=new f,Mc=new f,Uc=new f,Vc=new f,kc=new f,Cx=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],Lc),i=f.clone(n,Rc),o=f.clone(n,zc),s=f.clone(n,Pc),a=f.clone(n,Bc),c=f.clone(n,Nc),l=f.clone(n,Fc),u=e.length;let d;for(d=1;d<u;d++){f.clone(e[d],n);const P=n.x,k=n.y,V=n.z;P<i.x&&f.clone(n,i),P>a.x&&f.clone(n,a),k<o.y&&f.clone(n,o),k>c.y&&f.clone(n,c),V<s.z&&f.clone(n,s),V>l.z&&f.clone(n,l)}const p=f.magnitudeSquared(f.subtract(a,i,Nt)),g=f.magnitudeSquared(f.subtract(c,o,Nt)),y=f.magnitudeSquared(f.subtract(l,s,Nt));let x=i,E=a,T=p;g>T&&(T=g,x=o,E=c),y>T&&(T=y,x=s,E=l);const D=Mc;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,Nt)),O=Math.sqrt(A);const I=Uc;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,kc);let q=0;for(d=0;d<u;d++){f.clone(e[d],n);const P=f.magnitude(f.subtract(n,M,Nt));P>q&&(q=P);const k=f.magnitudeSquared(f.subtract(n,D,Nt));if(k>A){const V=Math.sqrt(k);O=(O+V)*.5,A=O*O;const H=V-O;D.x=(O*D.x+H*n.x)/V,D.y=(O*D.y+H*n.y)/V,D.z=(O*D.z+H*n.z)/V}}return O<q?(f.clone(D,t.center),t.radius=O):(f.clone(M,t.center),t.radius=q),t};const Du=new Sn,Ex=new f,Tx=new f,Gc=new ee,qc=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;Du._ellipsoid=le.default,t=_(t,Du),ce.southwest(e,Gc),Gc.height=n,ce.northeast(e,qc),qc.height=i;const s=t.project(Gc,Ex),a=t.project(qc,Tx),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 bx=[];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,bx);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=Lc;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;const s=f.clone(o,Rc),a=f.clone(o,zc),c=f.clone(o,Pc),l=f.clone(o,Bc),u=f.clone(o,Nc),d=f.clone(o,Fc),p=e.length;let g;for(g=0;g<p;g+=n){const V=e[g]+t.x,H=e[g+1]+t.y,j=e[g+2]+t.z;o.x=V,o.y=H,o.z=j,V<s.x&&f.clone(o,s),V>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,Nt)),x=f.magnitudeSquared(f.subtract(u,a,Nt)),E=f.magnitudeSquared(f.subtract(d,c,Nt));let T=s,D=l,A=y;x>A&&(A=x,T=a,D=u),E>A&&(A=E,T=c,D=d);const O=Mc;O.x=(T.x+D.x)*.5,O.y=(T.y+D.y)*.5,O.z=(T.z+D.z)*.5;let I=f.magnitudeSquared(f.subtract(D,O,Nt)),B=Math.sqrt(I);const M=Uc;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,kc);let k=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 V=f.magnitude(f.subtract(o,P,Nt));V>k&&(k=V);const H=f.magnitudeSquared(f.subtract(o,O,Nt));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<k?(f.clone(O,i.center),i.radius=B):(f.clone(P,i.center),i.radius=k),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=Lc;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];const o=f.clone(i,Rc),s=f.clone(i,zc),a=f.clone(i,Pc),c=f.clone(i,Bc),l=f.clone(i,Nc),u=f.clone(i,Fc),d=e.length;let p;for(p=0;p<d;p+=3){const k=e[p]+t[p],V=e[p+1]+t[p+1],H=e[p+2]+t[p+2];i.x=k,i.y=V,i.z=H,k<o.x&&f.clone(i,o),k>c.x&&f.clone(i,c),V<s.y&&f.clone(i,s),V>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,Nt)),y=f.magnitudeSquared(f.subtract(l,s,Nt)),x=f.magnitudeSquared(f.subtract(u,a,Nt));let E=o,T=c,D=g;y>D&&(D=y,E=s,T=l),x>D&&(D=x,E=a,T=u);const A=Mc;A.x=(E.x+T.x)*.5,A.y=(E.y+T.y)*.5,A.z=(E.z+T.z)*.5;let O=f.magnitudeSquared(f.subtract(T,A,Nt)),I=Math.sqrt(O);const B=Uc;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,kc);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 k=f.magnitude(f.subtract(i,q,Nt));k>P&&(P=k);const V=f.magnitudeSquared(f.subtract(i,A,Nt));if(V>O){const H=Math.sqrt(V);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 wx=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,wx)+c.radius)}return t.radius=a,t};const Sx=new f,Ax=new f,Dx=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,Sx),o=L.getColumn(n,1,Ax),s=L.getColumn(n,2,Dx);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 Ox=new f,vx=new f;K.fromTransformation=function(e,t){m.typeOf.object("transformation",e),h(t)||(t=new K);const n=N.getTranslation(e,Ox),i=N.getScale(e,vx),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 Ix=new f,Rx=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,Ix),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,Rx);return f.add(d,i,d),f.clone(d,n.center),n.radius=u,n};const zx=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,zx));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?Ct.OUTSIDE:s<i?Ct.INTERSECTING:Ct.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 Px=new f;K.distanceSquaredTo=function(e,t){m.typeOf.object("sphere",e),m.typeOf.object("cartesian",t);const n=f.subtract(e.center,t,Px),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 Bx=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 Qi);const o=f.subtract(e.center,t,Bx),s=f.dot(n,o);return i.start=s-e.radius,i.stop=s+e.radius,i};const Ou=new f,Nx=new f,Fx=new f,Lx=new f,Mx=new f,Ux=new ee,vu=new Array(8);for(let e=0;e<8;++e)vu[e]=new f;const Iu=new Sn;K.projectTo2D=function(e,t,n){m.typeOf.object("sphere",e),Iu._ellipsoid=le.default,t=_(t,Iu);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,Ou):a=i.geodeticSurfaceNormal(o,Ou);const c=f.cross(f.UNIT_Z,a,Nx);f.normalize(c,c);const l=f.cross(a,c,Fx);f.normalize(l,l),f.multiplyByScalar(a,s,a),f.multiplyByScalar(l,s,l),f.multiplyByScalar(c,s,c);const u=f.negate(l,Mx),d=f.negate(c,Lx),p=vu;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,Ux);t.project(O,A)}n=K.fromPoints(p,n),o=n.center;const x=o.x,E=o.y,T=o.z;return o.x=T,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 Cx*e*e*e};function Ru(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 zu=Object.freeze({NONE:0,TOP:1,ALL:2});function at(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)}at.POSITION_ONLY=Object.freeze(new at({position:!0})),at.POSITION_AND_NORMAL=Object.freeze(new at({position:!0,normal:!0})),at.POSITION_NORMAL_AND_ST=Object.freeze(new at({position:!0,normal:!0,st:!0})),at.POSITION_AND_ST=Object.freeze(new at({position:!0,st:!0})),at.POSITION_AND_COLOR=Object.freeze(new at({position:!0,color:!0})),at.ALL=Object.freeze(new at({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),at.DEFAULT=at.POSITION_NORMAL_AND_ST,at.packedLength=6,at.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},at.unpack=function(e,t,n){if(!h(e))throw new C("array is required");return t=_(t,0),h(n)||(n=new at),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},at.clone=function(e,t){if(h(e))return h(t)||(t=new at),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 Oo(e,t,n,i){e=_(e,1),t=_(t,1),n=_(n,1),i=_(i,1),this.value=new Uint8Array([w.floatToByte(e),w.floatToByte(t),w.floatToByte(n),w.floatToByte(i)])}Object.defineProperties(Oo.prototype,{componentDatatype:{get:function(){return oe.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),Oo.fromColor=function(e){if(!h(e))throw new C("color is required.");return new Oo(e.red,e.green,e.blue,e.alpha)},Oo.toValue=function(e,t){if(!h(e))throw new C("color is required.");return h(t)?e.toBytes(t):new Uint8Array(e.toBytes())},Oo.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 $s(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 vo={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):(vo.start=i,vo.stop=o,vo.isStartIncluded=s,vo.isStopIncluded=a,vo.data=c,new Ke(vo))},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 Pu=Object.freeze($.fromIso8601("0000-01-01T00:00:00Z")),Bu=Object.freeze($.fromIso8601("9999-12-31T24:00:00Z")),Vx=Object.freeze(new Ke({start:Pu,stop:Bu})),Fi={MINIMUM_VALUE:Pu,MAXIMUM_VALUE:Bu,MAXIMUM_INTERVAL:Vx};function cr(e,t,n){e=_(e,0),t=_(t,0),n=_(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(cr.prototype,{componentDatatype:{get:function(){return oe.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),cr.fromCartesian3=function(e){return m.defined("offset",e),new cr(e.x,e.y,e.z)},cr.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 kx={ADD:R.FUNC_ADD,SUBTRACT:R.FUNC_SUBTRACT,REVERSE_SUBTRACT:R.FUNC_REVERSE_SUBTRACT,MIN:R.MIN,MAX:R.MAX},Io=Object.freeze(kx),Gx={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(Gx),qx={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Io.ADD,equationAlpha:Io.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:Io.ADD,equationAlpha:Io.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:Io.ADD,equationAlpha:Io.ADD,functionSourceRgb:xn.SOURCE_ALPHA,functionSourceAlpha:xn.ONE,functionDestinationRgb:xn.ONE,functionDestinationAlpha:xn.ONE})},Ji=Object.freeze(qx),Hx={FRONT:R.FRONT,BACK:R.BACK,FRONT_AND_BACK:R.FRONT_AND_BACK},Ro=Object.freeze(Hx);function Mt(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(Mt.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}}}),Mt.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
|
+
`)},Mt.prototype.isTranslucent=function(){return h(this.material)&&this.material.isTranslucent()||!h(this.material)&&this.translucent},Mt.prototype.getRenderState=function(){const e=this.isTranslucent(),t=tn(this.renderState,!1);return e?(t.depthMask=!1,t.blending=Ji.ALPHA_BLEND):t.depthMask=!0,t},Mt.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=Ji.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ro.BACK}),h(n)&&(i=nn(n,i,!0)),i};const Wx=`uniform sampler2D image;
|
|
3833
3833
|
|
|
3834
3834
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
3835
3835
|
{
|
|
@@ -3840,7 +3840,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
3840
3840
|
material.alpha = rampColor.a;
|
|
3841
3841
|
return material;
|
|
3842
3842
|
}
|
|
3843
|
-
`,
|
|
3843
|
+
`,jx=`uniform sampler2D image;
|
|
3844
3844
|
uniform float strength;
|
|
3845
3845
|
uniform vec2 repeat;
|
|
3846
3846
|
|
|
@@ -3869,7 +3869,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
3869
3869
|
|
|
3870
3870
|
return material;
|
|
3871
3871
|
}
|
|
3872
|
-
`,
|
|
3872
|
+
`,Yx=`uniform vec4 lightColor;
|
|
3873
3873
|
uniform vec4 darkColor;
|
|
3874
3874
|
uniform vec2 repeat;
|
|
3875
3875
|
|
|
@@ -3898,7 +3898,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
3898
3898
|
|
|
3899
3899
|
return material;
|
|
3900
3900
|
}
|
|
3901
|
-
`,
|
|
3901
|
+
`,Xx=`uniform vec4 lightColor;
|
|
3902
3902
|
uniform vec4 darkColor;
|
|
3903
3903
|
uniform vec2 repeat;
|
|
3904
3904
|
|
|
@@ -3916,7 +3916,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
3916
3916
|
|
|
3917
3917
|
return material;
|
|
3918
3918
|
}
|
|
3919
|
-
|
|
3919
|
+
`,$x=`uniform sampler2D heights;
|
|
3920
3920
|
uniform sampler2D colors;
|
|
3921
3921
|
|
|
3922
3922
|
// This material expects heights to be sorted from lowest to highest.
|
|
@@ -3990,7 +3990,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
3990
3990
|
material.alpha = color.a;
|
|
3991
3991
|
return material;
|
|
3992
3992
|
}
|
|
3993
|
-
|
|
3993
|
+
`,Zx=`uniform vec4 color;
|
|
3994
3994
|
uniform float spacing;
|
|
3995
3995
|
uniform float width;
|
|
3996
3996
|
|
|
@@ -4016,7 +4016,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4016
4016
|
|
|
4017
4017
|
return material;
|
|
4018
4018
|
}
|
|
4019
|
-
`,
|
|
4019
|
+
`,Kx=`uniform sampler2D image;
|
|
4020
4020
|
uniform float minimumHeight;
|
|
4021
4021
|
uniform float maximumHeight;
|
|
4022
4022
|
|
|
@@ -4030,7 +4030,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4030
4030
|
material.alpha = rampColor.a;
|
|
4031
4031
|
return material;
|
|
4032
4032
|
}
|
|
4033
|
-
`,
|
|
4033
|
+
`,Qx=`uniform vec4 fadeInColor;
|
|
4034
4034
|
uniform vec4 fadeOutColor;
|
|
4035
4035
|
uniform float maximumDistance;
|
|
4036
4036
|
uniform bool repeat;
|
|
@@ -4067,7 +4067,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4067
4067
|
|
|
4068
4068
|
return material;
|
|
4069
4069
|
}
|
|
4070
|
-
`,
|
|
4070
|
+
`,Jx=`uniform vec4 color;
|
|
4071
4071
|
uniform float cellAlpha;
|
|
4072
4072
|
uniform vec2 lineCount;
|
|
4073
4073
|
uniform vec2 lineThickness;
|
|
@@ -4124,7 +4124,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4124
4124
|
|
|
4125
4125
|
return material;
|
|
4126
4126
|
}
|
|
4127
|
-
`,
|
|
4127
|
+
`,eC=`uniform sampler2D image;
|
|
4128
4128
|
uniform float strength;
|
|
4129
4129
|
uniform vec2 repeat;
|
|
4130
4130
|
|
|
@@ -4143,7 +4143,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4143
4143
|
|
|
4144
4144
|
return material;
|
|
4145
4145
|
}
|
|
4146
|
-
`,
|
|
4146
|
+
`,tC=`uniform vec4 color;
|
|
4147
4147
|
|
|
4148
4148
|
float getPointOnLine(vec2 p0, vec2 p1, float x)
|
|
4149
4149
|
{
|
|
@@ -4206,7 +4206,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4206
4206
|
material.alpha = outColor.a;
|
|
4207
4207
|
return material;
|
|
4208
4208
|
}
|
|
4209
|
-
`,
|
|
4209
|
+
`,nC=`uniform vec4 color;
|
|
4210
4210
|
uniform vec4 gapColor;
|
|
4211
4211
|
uniform float dashLength;
|
|
4212
4212
|
uniform float dashPattern;
|
|
@@ -4245,7 +4245,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4245
4245
|
material.alpha = fragColor.a;
|
|
4246
4246
|
return material;
|
|
4247
4247
|
}
|
|
4248
|
-
`,
|
|
4248
|
+
`,iC=`uniform vec4 color;
|
|
4249
4249
|
uniform float glowPower;
|
|
4250
4250
|
uniform float taperPower;
|
|
4251
4251
|
|
|
@@ -4270,7 +4270,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4270
4270
|
|
|
4271
4271
|
return material;
|
|
4272
4272
|
}
|
|
4273
|
-
`,
|
|
4273
|
+
`,oC=`uniform vec4 color;
|
|
4274
4274
|
uniform vec4 outlineColor;
|
|
4275
4275
|
uniform float outlineWidth;
|
|
4276
4276
|
|
|
@@ -4299,7 +4299,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4299
4299
|
|
|
4300
4300
|
return material;
|
|
4301
4301
|
}
|
|
4302
|
-
`,
|
|
4302
|
+
`,rC=`uniform vec4 color;
|
|
4303
4303
|
uniform vec4 rimColor;
|
|
4304
4304
|
uniform float width;
|
|
4305
4305
|
|
|
@@ -4320,7 +4320,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4320
4320
|
|
|
4321
4321
|
return material;
|
|
4322
4322
|
}
|
|
4323
|
-
`,
|
|
4323
|
+
`,sC=`uniform sampler2D image;
|
|
4324
4324
|
|
|
4325
4325
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
4326
4326
|
{
|
|
@@ -4331,7 +4331,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4331
4331
|
material.alpha = rampColor.a;
|
|
4332
4332
|
return material;
|
|
4333
4333
|
}
|
|
4334
|
-
`,
|
|
4334
|
+
`,aC=`uniform vec4 evenColor;
|
|
4335
4335
|
uniform vec4 oddColor;
|
|
4336
4336
|
uniform float offset;
|
|
4337
4337
|
uniform float repeat;
|
|
@@ -4355,7 +4355,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4355
4355
|
|
|
4356
4356
|
return material;
|
|
4357
4357
|
}
|
|
4358
|
-
`,
|
|
4358
|
+
`,cC=`uniform vec4 waterColor;
|
|
4359
4359
|
uniform vec4 landColor;
|
|
4360
4360
|
|
|
4361
4361
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
@@ -4370,7 +4370,7 @@ czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
|
4370
4370
|
|
|
4371
4371
|
return material;
|
|
4372
4372
|
}
|
|
4373
|
-
`,
|
|
4373
|
+
`,lC=`// Thanks for the contribution Jonas
|
|
4374
4374
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
4375
4375
|
|
|
4376
4376
|
uniform sampler2D specularMap;
|
|
@@ -4428,16 +4428,16 @@ 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,
|
|
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,Lt.LINEAR),this._magnificationFilter=_(e.magnificationFilter,Zi.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,hC(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 Bt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:d},sampler:p}):g=new Bt({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 Tt({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 hC(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:kn(),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}pC(t),h(i)||Q._materialCache.addMaterial(t.type,t),_C(t),CC(t),TC(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 Hc(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 Nu(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 fC(e,t){const n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}const uC=["type","materials","uniforms","components","source"],dC=["diffuse","specular","shininess","normal","emission","alpha"];function pC(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.");Hc(t,uC,Nu,!0),Hc(o,dC,Nu,!0);const s=[];for(const a in i)i.hasOwnProperty(a)&&s.push(a);Hc(n,s,fC,!1)}function mC(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 _C(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);
|
|
4435
|
-
`,h(t)){const i=Object.keys(e._template.materials).length>0;for(const o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){const a=i&&
|
|
4435
|
+
`,h(t)){const i=Object.keys(e._template.materials).length>0;for(const o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){const a=i&&mC(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${a};
|
|
4436
4436
|
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
|
|
4437
4437
|
`:e.shaderSource+=`material.${o} = ${t[o]};
|
|
4438
4438
|
`}e.shaderSource+=`return material;
|
|
4439
4439
|
}
|
|
4440
|
-
`}}const Lu={mat2:ae,mat3:F,mat4:N},_C=/\.ktx2$/i;function gC(e){let t;return function(n,i){const o=n.uniforms,s=o[e],a=t!==s,c=!h(s)||s===Q.DefaultImageId;t=s;let l=n._textures[e],u,d;if(s instanceof HTMLVideoElement){if(s.readyState>=2){if(a&&h(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!h(l)||l===i.defaultTexture){const g=new Yn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Bt({context:i,source:s,sampler:g}),n._textures[e]=l;return}l.copyFrom({source:s})}else h(l)||(n._textures[e]=i.defaultTexture);return}if(s instanceof Bt&&s!==l){n._texturePaths[e]=void 0;const g=n._textures[e];h(g)&&g!==n._defaultTexture&&g.destroy(),n._textures[e]=s,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(d=o[u],d.x=s._width,d.y=s._height);return}if(a&&h(l)&&c&&(l!==n._defaultTexture&&l.destroy(),l=void 0),h(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(d=o[u],d.x=l._width,d.y=l._height)),c)return;const p=s instanceof ne;if(!h(n._texturePaths[e])||p&&s.url!==n._texturePaths[e].url||!p&&s!==n._texturePaths[e]){if(typeof s=="string"||p){const g=p?s:ne.createIfNeeded(s);let y;_C.test(g.url)?y=uu(g.url):y=g.fetchImage(),Promise.resolve(y).then(function(x){n._loadedImages.push({id:e,image:x})}).catch(function(){h(l)&&l!==n._defaultTexture&&l.destroy(),n._textures[e]=n._defaultTexture})}else(s instanceof HTMLCanvasElement||s instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:s});n._texturePaths[e]=s}}}function yC(e){return function(t,n){const i=t.uniforms[e];if(i instanceof Tt){const s=t._textures[e];s!==t._defaultTexture&&s.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(h(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Q.DefaultCubeMapId)return;const o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){const s=[ne.createIfNeeded(i.positiveX).fetchImage(),ne.createIfNeeded(i.negativeX).fetchImage(),ne.createIfNeeded(i.positiveY).fetchImage(),ne.createIfNeeded(i.negativeY).fetchImage(),ne.createIfNeeded(i.positiveZ).fetchImage(),ne.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(s).then(function(a){t._loadedCubeMaps.push({id:e,images:a})}),t._texturePaths[e]=o}}}function xC(e){const t=e._template.uniforms;for(const n in t)t.hasOwnProperty(n)&&Fu(e,n)}function Fu(e,t){const n=e._strict,i=e._template.uniforms,o=i[t],s=CC(o);if(!h(s))throw new C(`fabric: uniform '${t}' has invalid type.`);let a;if(s==="channels"){if(a=cr(e,t,o,!1),a===0&&n)throw new C(`strict: shader source does not use channels '${t}'.`)}else{if(s==="sampler2D"){const u=`${t}Dimensions`;TC(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Fu(e,u))}if(!new RegExp(`uniform\\s+${s}\\s+${t}\\s*;`).test(e.shaderSource)){const u=`uniform ${s} ${t};`;e.shaderSource=u+e.shaderSource}const l=`${t}_${e._count++}`;if(a=cr(e,t,l),a===1&&n)throw new C(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,s==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(gC(t));else if(s==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(yC(t));else if(s.indexOf("mat")!==-1){const u=new Lu[s];e._uniforms[l]=function(){return Lu[s].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function CC(e){let t=e.type;if(!h(t)){const n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ne||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Q.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(const o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function EC(e){const t=e._strict,n=e._template.materials;for(const i in n)if(n.hasOwnProperty(i)){const o=new Q({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=nn(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);const s="czm_getMaterial",a=`${s}_${e._count++}`;cr(o,s,a),e.shaderSource=o.shaderSource+e.shaderSource;const c=`${a}(materialInput)`;if(cr(e,i,c)===0&&t)throw new C(`strict: shader source does not use material '${i}'.`)}}function cr(e,t,n,i){i=_(i,!0);let o=0;const s="([\\w])?",a=`([\\w${i?".":""}])?`,c=new RegExp(a+t+s,"g");return e.shaderSource=e.shaderSource.replace(c,function(l,u,d){return u||d?l:(o+=1,n)}),o}function TC(e,t,n){return cr(e,t,t,n)}Q._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},Q.DefaultImageId="czm_defaultImage",Q.DefaultCubeMapId="czm_defaultCubeMap",Q.ColorType="Color",Q._materialCache.addMaterial(Q.ColorType,{fabric:{type:Q.ColorType,uniforms:{color:new w(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Q.ImageType="Image",Q._materialCache.addMaterial(Q.ImageType,{fabric:{type:Q.ImageType,uniforms:{image:Q.DefaultImageId,repeat:new U(1,1),color:new w(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Q.DiffuseMapType="DiffuseMap",Q._materialCache.addMaterial(Q.DiffuseMapType,{fabric:{type:Q.DiffuseMapType,uniforms:{image:Q.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Q.AlphaMapType="AlphaMap",Q._materialCache.addMaterial(Q.AlphaMapType,{fabric:{type:Q.AlphaMapType,uniforms:{image:Q.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),Q.SpecularMapType="SpecularMap",Q._materialCache.addMaterial(Q.SpecularMapType,{fabric:{type:Q.SpecularMapType,uniforms:{image:Q.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),Q.EmissionMapType="EmissionMap",Q._materialCache.addMaterial(Q.EmissionMapType,{fabric:{type:Q.EmissionMapType,uniforms:{image:Q.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Q.BumpMapType="BumpMap",Q._materialCache.addMaterial(Q.BumpMapType,{fabric:{type:Q.BumpMapType,uniforms:{image:Q.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:Wx},translucent:!1}),Q.NormalMapType="NormalMap",Q._materialCache.addMaterial(Q.NormalMapType,{fabric:{type:Q.NormalMapType,uniforms:{image:Q.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:Jx},translucent:!1}),Q.GridType="Grid",Q._materialCache.addMaterial(Q.GridType,{fabric:{type:Q.GridType,uniforms:{color:new w(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:Qx},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),Q.StripeType="Stripe",Q._materialCache.addMaterial(Q.StripeType,{fabric:{type:Q.StripeType,uniforms:{horizontal:!0,evenColor:new w(1,1,1,.5),oddColor:new w(0,0,1,.5),offset:0,repeat:5},source:sC},translucent:function(e){const t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),Q.CheckerboardType="Checkerboard",Q._materialCache.addMaterial(Q.CheckerboardType,{fabric:{type:Q.CheckerboardType,uniforms:{lightColor:new w(1,1,1,.5),darkColor:new w(0,0,0,.5),repeat:new U(5,5)},source:jx},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),Q.DotType="Dot",Q._materialCache.addMaterial(Q.DotType,{fabric:{type:Q.DotType,uniforms:{lightColor:new w(1,1,0,.75),darkColor:new w(0,1,1,.75),repeat:new U(5,5)},source:Yx},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),Q.WaterType="Water",Q._materialCache.addMaterial(Q.WaterType,{fabric:{type:Q.WaterType,uniforms:{baseWaterColor:new w(.2,.3,.6,1),blendColor:new w(0,1,.699,1),specularMap:Q.DefaultImageId,normalMap:Q.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:cC},translucent:function(e){const t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),Q.RimLightingType="RimLighting",Q._materialCache.addMaterial(Q.RimLightingType,{fabric:{type:Q.RimLightingType,uniforms:{color:new w(1,0,0,.7),rimColor:new w(1,1,1,.4),width:.3},source:oC},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),Q.FadeType="Fade",Q._materialCache.addMaterial(Q.FadeType,{fabric:{type:Q.FadeType,uniforms:{fadeInColor:new w(1,0,0,1),fadeOutColor:new w(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:Kx},translucent:function(e){const t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),Q.PolylineArrowType="PolylineArrow",Q._materialCache.addMaterial(Q.PolylineArrowType,{fabric:{type:Q.PolylineArrowType,uniforms:{color:new w(1,1,1,1)},source:eC},translucent:!0}),Q.PolylineDashType="PolylineDash",Q._materialCache.addMaterial(Q.PolylineDashType,{fabric:{type:Q.PolylineDashType,uniforms:{color:new w(1,0,1,1),gapColor:new w(0,0,0,0),dashLength:16,dashPattern:255},source:tC},translucent:!0}),Q.PolylineGlowType="PolylineGlow",Q._materialCache.addMaterial(Q.PolylineGlowType,{fabric:{type:Q.PolylineGlowType,uniforms:{color:new w(0,.5,1,1),glowPower:.25,taperPower:1},source:nC},translucent:!0}),Q.PolylineOutlineType="PolylineOutline",Q._materialCache.addMaterial(Q.PolylineOutlineType,{fabric:{type:Q.PolylineOutlineType,uniforms:{color:new w(1,1,1,1),outlineColor:new w(1,0,0,1),outlineWidth:1},source:iC},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),Q.ElevationContourType="ElevationContour",Q._materialCache.addMaterial(Q.ElevationContourType,{fabric:{type:Q.ElevationContourType,uniforms:{spacing:100,color:new w(1,0,0,1),width:1},source:$x},translucent:!1}),Q.ElevationRampType="ElevationRamp",Q._materialCache.addMaterial(Q.ElevationRampType,{fabric:{type:Q.ElevationRampType,uniforms:{image:Q.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:Zx},translucent:!1}),Q.SlopeRampMaterialType="SlopeRamp",Q._materialCache.addMaterial(Q.SlopeRampMaterialType,{fabric:{type:Q.SlopeRampMaterialType,uniforms:{image:Q.DefaultImageId},source:rC},translucent:!1}),Q.AspectRampMaterialType="AspectRamp",Q._materialCache.addMaterial(Q.AspectRampMaterialType,{fabric:{type:Q.AspectRampMaterialType,uniforms:{image:Q.DefaultImageId},source:Hx},translucent:!1}),Q.ElevationBandType="ElevationBand",Q._materialCache.addMaterial(Q.ElevationBandType,{fabric:{type:Q.ElevationBandType,uniforms:{heights:Q.DefaultImageId,colors:Q.DefaultImageId},source:Xx},translucent:!0}),Q.WaterMaskType="WaterMask",Q._materialCache.addMaterial(Q.WaterMaskType,{fabric:{type:Q.WaterMaskType,source:aC,uniforms:{waterColor:new w(1,1,1,1),landColor:new w(0,0,0,0)}},translucent:!1});const bC=`in vec3 v_positionEC;
|
|
4440
|
+
`}}const Fu={mat2:ae,mat3:L,mat4:N},gC=/\.ktx2$/i;function yC(e){let t;return function(n,i){const o=n.uniforms,s=o[e],a=t!==s,c=!h(s)||s===Q.DefaultImageId;t=s;let l=n._textures[e],u,d;if(s instanceof HTMLVideoElement){if(s.readyState>=2){if(a&&h(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!h(l)||l===i.defaultTexture){const g=new Yn({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Bt({context:i,source:s,sampler:g}),n._textures[e]=l;return}l.copyFrom({source:s})}else h(l)||(n._textures[e]=i.defaultTexture);return}if(s instanceof Bt&&s!==l){n._texturePaths[e]=void 0;const g=n._textures[e];h(g)&&g!==n._defaultTexture&&g.destroy(),n._textures[e]=s,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(d=o[u],d.x=s._width,d.y=s._height);return}if(a&&h(l)&&c&&(l!==n._defaultTexture&&l.destroy(),l=void 0),h(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(d=o[u],d.x=l._width,d.y=l._height)),c)return;const p=s instanceof ne;if(!h(n._texturePaths[e])||p&&s.url!==n._texturePaths[e].url||!p&&s!==n._texturePaths[e]){if(typeof s=="string"||p){const g=p?s:ne.createIfNeeded(s);let y;gC.test(g.url)?y=uu(g.url):y=g.fetchImage(),Promise.resolve(y).then(function(x){n._loadedImages.push({id:e,image:x})}).catch(function(){h(l)&&l!==n._defaultTexture&&l.destroy(),n._textures[e]=n._defaultTexture})}else(s instanceof HTMLCanvasElement||s instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:s});n._texturePaths[e]=s}}}function xC(e){return function(t,n){const i=t.uniforms[e];if(i instanceof Tt){const s=t._textures[e];s!==t._defaultTexture&&s.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(h(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Q.DefaultCubeMapId)return;const o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){const s=[ne.createIfNeeded(i.positiveX).fetchImage(),ne.createIfNeeded(i.negativeX).fetchImage(),ne.createIfNeeded(i.positiveY).fetchImage(),ne.createIfNeeded(i.negativeY).fetchImage(),ne.createIfNeeded(i.positiveZ).fetchImage(),ne.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(s).then(function(a){t._loadedCubeMaps.push({id:e,images:a})}),t._texturePaths[e]=o}}}function CC(e){const t=e._template.uniforms;for(const n in t)t.hasOwnProperty(n)&&Lu(e,n)}function Lu(e,t){const n=e._strict,i=e._template.uniforms,o=i[t],s=EC(o);if(!h(s))throw new C(`fabric: uniform '${t}' has invalid type.`);let a;if(s==="channels"){if(a=lr(e,t,o,!1),a===0&&n)throw new C(`strict: shader source does not use channels '${t}'.`)}else{if(s==="sampler2D"){const u=`${t}Dimensions`;bC(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Lu(e,u))}if(!new RegExp(`uniform\\s+${s}\\s+${t}\\s*;`).test(e.shaderSource)){const u=`uniform ${s} ${t};`;e.shaderSource=u+e.shaderSource}const l=`${t}_${e._count++}`;if(a=lr(e,t,l),a===1&&n)throw new C(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,s==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(yC(t));else if(s==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(xC(t));else if(s.indexOf("mat")!==-1){const u=new Fu[s];e._uniforms[l]=function(){return Fu[s].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function EC(e){let t=e.type;if(!h(t)){const n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ne||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Q.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(const o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function TC(e){const t=e._strict,n=e._template.materials;for(const i in n)if(n.hasOwnProperty(i)){const o=new Q({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=nn(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);const s="czm_getMaterial",a=`${s}_${e._count++}`;lr(o,s,a),e.shaderSource=o.shaderSource+e.shaderSource;const c=`${a}(materialInput)`;if(lr(e,i,c)===0&&t)throw new C(`strict: shader source does not use material '${i}'.`)}}function lr(e,t,n,i){i=_(i,!0);let o=0;const s="([\\w])?",a=`([\\w${i?".":""}])?`,c=new RegExp(a+t+s,"g");return e.shaderSource=e.shaderSource.replace(c,function(l,u,d){return u||d?l:(o+=1,n)}),o}function bC(e,t,n){return lr(e,t,t,n)}Q._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},Q.DefaultImageId="czm_defaultImage",Q.DefaultCubeMapId="czm_defaultCubeMap",Q.ColorType="Color",Q._materialCache.addMaterial(Q.ColorType,{fabric:{type:Q.ColorType,uniforms:{color:new w(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Q.ImageType="Image",Q._materialCache.addMaterial(Q.ImageType,{fabric:{type:Q.ImageType,uniforms:{image:Q.DefaultImageId,repeat:new U(1,1),color:new w(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),Q.DiffuseMapType="DiffuseMap",Q._materialCache.addMaterial(Q.DiffuseMapType,{fabric:{type:Q.DiffuseMapType,uniforms:{image:Q.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Q.AlphaMapType="AlphaMap",Q._materialCache.addMaterial(Q.AlphaMapType,{fabric:{type:Q.AlphaMapType,uniforms:{image:Q.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),Q.SpecularMapType="SpecularMap",Q._materialCache.addMaterial(Q.SpecularMapType,{fabric:{type:Q.SpecularMapType,uniforms:{image:Q.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),Q.EmissionMapType="EmissionMap",Q._materialCache.addMaterial(Q.EmissionMapType,{fabric:{type:Q.EmissionMapType,uniforms:{image:Q.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),Q.BumpMapType="BumpMap",Q._materialCache.addMaterial(Q.BumpMapType,{fabric:{type:Q.BumpMapType,uniforms:{image:Q.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:jx},translucent:!1}),Q.NormalMapType="NormalMap",Q._materialCache.addMaterial(Q.NormalMapType,{fabric:{type:Q.NormalMapType,uniforms:{image:Q.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:eC},translucent:!1}),Q.GridType="Grid",Q._materialCache.addMaterial(Q.GridType,{fabric:{type:Q.GridType,uniforms:{color:new w(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:Jx},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),Q.StripeType="Stripe",Q._materialCache.addMaterial(Q.StripeType,{fabric:{type:Q.StripeType,uniforms:{horizontal:!0,evenColor:new w(1,1,1,.5),oddColor:new w(0,0,1,.5),offset:0,repeat:5},source:aC},translucent:function(e){const t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),Q.CheckerboardType="Checkerboard",Q._materialCache.addMaterial(Q.CheckerboardType,{fabric:{type:Q.CheckerboardType,uniforms:{lightColor:new w(1,1,1,.5),darkColor:new w(0,0,0,.5),repeat:new U(5,5)},source:Yx},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),Q.DotType="Dot",Q._materialCache.addMaterial(Q.DotType,{fabric:{type:Q.DotType,uniforms:{lightColor:new w(1,1,0,.75),darkColor:new w(0,1,1,.75),repeat:new U(5,5)},source:Xx},translucent:function(e){const t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),Q.WaterType="Water",Q._materialCache.addMaterial(Q.WaterType,{fabric:{type:Q.WaterType,uniforms:{baseWaterColor:new w(.2,.3,.6,1),blendColor:new w(0,1,.699,1),specularMap:Q.DefaultImageId,normalMap:Q.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:lC},translucent:function(e){const t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),Q.RimLightingType="RimLighting",Q._materialCache.addMaterial(Q.RimLightingType,{fabric:{type:Q.RimLightingType,uniforms:{color:new w(1,0,0,.7),rimColor:new w(1,1,1,.4),width:.3},source:rC},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),Q.FadeType="Fade",Q._materialCache.addMaterial(Q.FadeType,{fabric:{type:Q.FadeType,uniforms:{fadeInColor:new w(1,0,0,1),fadeOutColor:new w(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:Qx},translucent:function(e){const t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),Q.PolylineArrowType="PolylineArrow",Q._materialCache.addMaterial(Q.PolylineArrowType,{fabric:{type:Q.PolylineArrowType,uniforms:{color:new w(1,1,1,1)},source:tC},translucent:!0}),Q.PolylineDashType="PolylineDash",Q._materialCache.addMaterial(Q.PolylineDashType,{fabric:{type:Q.PolylineDashType,uniforms:{color:new w(1,0,1,1),gapColor:new w(0,0,0,0),dashLength:16,dashPattern:255},source:nC},translucent:!0}),Q.PolylineGlowType="PolylineGlow",Q._materialCache.addMaterial(Q.PolylineGlowType,{fabric:{type:Q.PolylineGlowType,uniforms:{color:new w(0,.5,1,1),glowPower:.25,taperPower:1},source:iC},translucent:!0}),Q.PolylineOutlineType="PolylineOutline",Q._materialCache.addMaterial(Q.PolylineOutlineType,{fabric:{type:Q.PolylineOutlineType,uniforms:{color:new w(1,1,1,1),outlineColor:new w(1,0,0,1),outlineWidth:1},source:oC},translucent:function(e){const t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),Q.ElevationContourType="ElevationContour",Q._materialCache.addMaterial(Q.ElevationContourType,{fabric:{type:Q.ElevationContourType,uniforms:{spacing:100,color:new w(1,0,0,1),width:1},source:Zx},translucent:!1}),Q.ElevationRampType="ElevationRamp",Q._materialCache.addMaterial(Q.ElevationRampType,{fabric:{type:Q.ElevationRampType,uniforms:{image:Q.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:Kx},translucent:!1}),Q.SlopeRampMaterialType="SlopeRamp",Q._materialCache.addMaterial(Q.SlopeRampMaterialType,{fabric:{type:Q.SlopeRampMaterialType,uniforms:{image:Q.DefaultImageId},source:sC},translucent:!1}),Q.AspectRampMaterialType="AspectRamp",Q._materialCache.addMaterial(Q.AspectRampMaterialType,{fabric:{type:Q.AspectRampMaterialType,uniforms:{image:Q.DefaultImageId},source:Wx},translucent:!1}),Q.ElevationBandType="ElevationBand",Q._materialCache.addMaterial(Q.ElevationBandType,{fabric:{type:Q.ElevationBandType,uniforms:{heights:Q.DefaultImageId,colors:Q.DefaultImageId},source:$x},translucent:!0}),Q.WaterMaskType="WaterMask",Q._materialCache.addMaterial(Q.WaterMaskType,{fabric:{type:Q.WaterMaskType,source:cC,uniforms:{waterColor:new w(1,1,1,1),landColor:new w(0,0,0,0)}},translucent:!1});const wC=`in vec3 v_positionEC;
|
|
4441
4441
|
in vec3 v_normalEC;
|
|
4442
4442
|
in vec4 v_color;
|
|
4443
4443
|
|
|
@@ -4461,7 +4461,7 @@ void main()
|
|
|
4461
4461
|
|
|
4462
4462
|
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
4463
4463
|
}
|
|
4464
|
-
`,
|
|
4464
|
+
`,SC=`in vec3 position3DHigh;
|
|
4465
4465
|
in vec3 position3DLow;
|
|
4466
4466
|
in vec3 normal;
|
|
4467
4467
|
in vec4 color;
|
|
@@ -4487,7 +4487,7 @@ void main()
|
|
|
4487
4487
|
{
|
|
4488
4488
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
4489
4489
|
}
|
|
4490
|
-
`,
|
|
4490
|
+
`,AC=`in vec3 position3DHigh;
|
|
4491
4491
|
in vec3 position3DLow;
|
|
4492
4492
|
in vec4 color;
|
|
4493
4493
|
in float batchId;
|
|
@@ -4502,7 +4502,7 @@ void main()
|
|
|
4502
4502
|
|
|
4503
4503
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
4504
4504
|
}
|
|
4505
|
-
`;function Wt(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=_(e.closed,!1),i=_(e.flat,!1),o=i?SC:wC,s=i?Mu:bC,a=i?Wt.FLAT_VERTEX_FORMAT:Wt.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,o),this._fragmentShaderSource=_(e.fragmentShaderSource,s),this._renderState=Mt.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=_(e.faceForward,!n)}Object.defineProperties(Wt.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}}}),Wt.VERTEX_FORMAT=st.POSITION_AND_NORMAL,Wt.FLAT_VERTEX_FORMAT=st.POSITION_ONLY,Wt.prototype.getFragmentShaderSource=Mt.prototype.getFragmentShaderSource,Wt.prototype.isTranslucent=Mt.prototype.isTranslucent,Wt.prototype.getRenderState=Mt.prototype.getRenderState;function zo(e){this._definitionChanged=new ze,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(zo.prototype,{isConstant:{get:function(){return Se.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:L("color")}),zo.prototype.getType=function(e){return"Color"};const AC=new $;zo.prototype.getValue=function(e,t){return h(e)||(e=$.now(AC)),h(t)||(t={}),t.color=Se.getValueOrClonedDefault(this._color,e,w.WHITE,t.color),t},zo.prototype.equals=function(e){return this===e||e instanceof zo&&Se.equals(this._color,e._color)};function Fi(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(Fi.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Fi.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},Fi.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},Fi.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)},Fi.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},Fi.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},Fi.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 Uu=new f,ku=new f,Vu=new ee,qc=new f,DC=new f,qu=new K,OC=new Fi,lr=[new ee,new ee,new ee,new ee],hr=new U,Fe={};Fe.initialize=function(){let e=Fe._initPromise;return h(e)||(e=ne.fetchJson(hn("Assets/approximateTerrainHeights.json")).then(function(t){Fe._terrainHeights=t}),Fe._initPromise=e),e},Fe.getMinimumMaximumHeights=function(e,t){if(m.defined("rectangle",e),!h(Fe._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=Gu(e);let i=Fe._defaultMinTerrainHeight,o=Fe._defaultMaxTerrainHeight;if(h(n)){const s=`${n.level}-${n.x}-${n.y}`,a=Fe._terrainHeights[s];h(a)&&(i=a[0],o=a[1]),t.cartographicToCartesian(ce.northeast(e,Vu),Uu),t.cartographicToCartesian(ce.southwest(e,Vu),ku),f.midpoint(ku,Uu,qc);const c=t.scaleToGeodeticSurface(qc,DC);if(h(c)){const l=f.distance(qc,c);i=Math.min(i,-l)}else i=Fe._defaultMinTerrainHeight}return i=Math.max(Fe._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}},Fe.getBoundingSphere=function(e,t){if(m.defined("rectangle",e),!h(Fe._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=Gu(e);let i=Fe._defaultMaxTerrainHeight;if(h(n)){const s=`${n.level}-${n.x}-${n.y}`,a=Fe._terrainHeights[s];h(a)&&(i=a[1])}const o=K.fromRectangle3D(e,t,0);return K.fromRectangle3D(e,t,i,qu),K.union(o,qu,o)};function Gu(e){ee.fromRadians(e.east,e.north,0,lr[0]),ee.fromRadians(e.west,e.north,0,lr[1]),ee.fromRadians(e.east,e.south,0,lr[2]),ee.fromRadians(e.west,e.south,0,lr[3]);let t=0,n=0,i=0,o=0;const s=Fe._terrainHeightsMaxLevel;let a;for(a=0;a<=s;++a){let c=!1;for(let l=0;l<4;++l){const u=lr[l];if(OC.positionToTileXY(u,a,hr),l===0)i=hr.x,o=hr.y;else if(i!==hr.x||o!==hr.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}}Fe._terrainHeightsMaxLevel=6,Fe._defaultMaxTerrainHeight=9e3,Fe._defaultMinTerrainHeight=-1e5,Fe._terrainHeights=void 0,Fe._initPromise=void 0,Object.defineProperties(Fe,{initialized:{get:function(){return h(Fe._terrainHeights)}}});function jt(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}jt.fromCorners=function(e,t,n){return m.defined("minimum",e),m.defined("maximum",t),h(n)||(n=new jt),n.minimum=f.clone(e,n.minimum),n.maximum=f.clone(t,n.maximum),n.center=f.midpoint(e,t,n.center),n},jt.fromPoints=function(e,t){if(h(t)||(t=new jt),!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},jt.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 jt(e.minimum,e.maximum,e.center)},jt.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 Ys=new f;jt.intersectPlane=function(e,t){m.defined("box",e),m.defined("plane",t),Ys=f.subtract(e.maximum,e.minimum,Ys);const n=f.multiplyByScalar(Ys,.5,Ys),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?Ct.INSIDE:s+o<0?Ct.OUTSIDE:Ct.INTERSECTING},jt.prototype.clone=function(e){return jt.clone(this,e)},jt.prototype.intersectPlane=function(e){return jt.intersectPlane(this,e)},jt.prototype.equals=function(e){return jt.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 Hu(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=Hu(o,-s,S.EPSILON14);if(a<0)return[];const c=-.5*Hu(t,S.sign(t)*Math.sqrt(a),S.EPSILON14);return t>0?[c/e,n/c]:[n/c,c/e]};const fr={};fr.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 Gc(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 T,D;if(E<0){let ie,se,_e;d*u>=l*p?(ie=o,se=g,_e=-2*s*g+o*y):(ie=c,se=x,_e=-c*y+2*a*x);const ye=-(_e<0?-1:1)*Math.abs(ie)*Math.sqrt(-E);D=-_e+ye;const Re=D/2,We=Re<0?-Math.pow(-Re,1/3):Math.pow(Re,1/3),tt=D===ye?-We:-se/We;return T=se<=0?We+tt:-_e/(We*We+tt*tt+se),d*u>=l*p?[(T-s)/o]:[-c/(T+a)]}const A=g,O=-2*s*g+o*y,I=x,B=-c*y+2*a*x,M=Math.sqrt(E),G=Math.sqrt(3)/2;let P=Math.abs(Math.atan2(o*M,-O)/3);T=2*Math.sqrt(-A);let V=Math.cos(P);D=T*V;let k=T*(-V/2-G*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),T=2*Math.sqrt(-I),V=Math.cos(P),D=T*V,k=T*(-V/2-G*Math.sin(P));const b=-c,v=D+k<2*a?D+a:k+a,z=b/v,q=j*v,W=-H*v-j*b,Z=H*b,X=(a*W-s*Z)/(-s*W+a*q);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]}fr.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 Gc(e,0,n,i)}else{if(n===0)return i===0?(s=-t/e,s<0?[s,0,0]:[0,0,s]):Gc(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 Gc(e,t,n,i)};const Hc={};Hc.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=fr.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),T=Math.sqrt(y);return[u-T,u-E,u+E,u+T]}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 ur(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=fr.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,T=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||T*O<A*D){const j=Math.sqrt(A);I=j/2,B=j===0?0:(e*E-n)/j}else{const j=Math.sqrt(T);I=j===0?0:(e*E-n)/j,B=j/2}let M,G;x===0&&I===0?(M=0,G=0):S.sign(x)===S.sign(I)?(M=x+I,G=p/M):(G=x-I,M=p/G);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,G,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[]}Hc.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 fr.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 ur(s,a,c,l);case 2:return ur(s,a,c,l);case 3:return zn(s,a,c,l);case 4:return zn(s,a,c,l);case 5:return ur(s,a,c,l);case 6:return zn(s,a,c,l);case 7:return zn(s,a,c,l);case 8:return ur(s,a,c,l);case 9:return zn(s,a,c,l);case 10:return zn(s,a,c,l);case 11:return ur(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 Po(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}Po.clone=function(e,t){if(h(e))return h(t)?(t.origin=f.clone(e.origin),t.direction=f.clone(e.direction),t):new Po(e.origin,e.direction)},Po.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 Ne={};Ne.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 vC=new f,IC=new f,Wu=new f,ju=new f,Yu=new f;Ne.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,vC),l=f.subtract(i,t,IC),u=f.cross(a,l,Wu),d=f.dot(c,u);let p,g,y,x,E;if(o){if(d<S.EPSILON6||(p=f.subtract(s,t,ju),y=f.dot(p,u),y<0||y>d)||(g=f.cross(p,c,Yu),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 T=1/d;if(p=f.subtract(s,t,ju),y=f.dot(p,u)*T,y<0||y>1||(g=f.cross(p,c,Yu),x=f.dot(a,g)*T,x<0||y+x>1))return;E=f.dot(l,g)*T}return E},Ne.rayTriangle=function(e,t,n,i,o,s){const a=Ne.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 RC=new Po;Ne.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=RC;f.clone(e,c.origin),f.subtract(t,e,c.direction),f.normalize(c.direction,c.direction);const l=Ne.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 zC(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 PC={root0:0,root1:0};function Xu(e,t,n){h(n)||(n=new Qi);const i=e.origin,o=e.direction,s=t.center,a=t.radius*t.radius,c=f.subtract(i,s,Wu),l=f.dot(o,o),u=2*f.dot(o,c),d=f.magnitudeSquared(c)-a,p=zC(l,u,d,PC);if(h(p))return n.start=p.root0,n.stop=p.root1,n}Ne.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=Xu(e,t,n),!(!h(n)||n.stop<0))return n.start=Math.max(n.start,0),n};const BC=new Po;Ne.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=BC;f.clone(e,o.origin);const s=f.subtract(t,e,o.direction),a=f.magnitude(s);if(f.normalize(s,s),i=Xu(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 NC=new f,LC=new f;Ne.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,NC),o=f.multiplyComponents(n,e.direction,LC),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 Qi(x,E):{start:E,stop:x}}const y=Math.sqrt(c/l);return new Qi(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 Qi(0,p/l);if(a<0)return l=f.magnitudeSquared(o),new Qi(0,-a/l)};function eo(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}Ne.quadraticVectorExpression=function(e,t,n,i,o){const s=i*i,a=o*o,c=(e[F.COLUMN1ROW1]-e[F.COLUMN2ROW2])*a,l=o*(i*eo(e[F.COLUMN1ROW0],e[F.COLUMN0ROW1],S.EPSILON15)+t.y),u=e[F.COLUMN0ROW0]*s+e[F.COLUMN2ROW2]*a+i*t.x+n,d=a*eo(e[F.COLUMN2ROW1],e[F.COLUMN1ROW2],S.EPSILON15),p=o*(i*eo(e[F.COLUMN2ROW0],e[F.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,T=c*c,D=p*d,A=T+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=Hc.computeRealRoots(A,O,I,B,M);const G=g.length;if(G===0)return y;for(let P=0;P<G;++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=eo(c*k+u,l*V,S.EPSILON12):S.sign(u)===S.sign(l*V)?r=eo(c*k,l*V+u,S.EPSILON12):r=eo(c*k+l*V,u,S.EPSILON12);const b=eo(d*V,p,S.EPSILON15),v=r*b;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 Wc=new f,$u=new f,Zu=new f,Xs=new f,FC=new f,MC=new F,UC=new F,kC=new F,VC=new F,qC=new F,Ku=new F,Qu=new F,Ju=new f,GC=new f,HC=new ee;Ne.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,Wc);if(f.dot(i,M)>=0)return n}const o=h(this.rayEllipsoid(e,t)),s=t.transformPositionToScaledSpace(i,Wc),a=f.normalize(s,s),c=f.mostOrthogonalAxis(s,Xs),l=f.normalize(f.cross(c,a,$u),$u),u=f.normalize(f.cross(a,l,Zu),Zu),d=MC;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=F.transpose(d,UC),g=F.fromScale(t.radii,kC),y=F.fromScale(t.oneOverRadii,VC),x=qC;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=F.multiply(F.multiply(p,y,Ku),x,Ku),T=F.multiply(F.multiply(E,g,Qu),d,Qu),D=F.multiplyByVector(E,n,FC),A=Ne.quadraticVectorExpression(T,f.negate(D,Wc),0,0,1);let O,I;const B=A.length;if(B>0){let M=f.clone(f.ZERO,GC),G=Number.NEGATIVE_INFINITY;for(let V=0;V<B;++V){O=F.multiplyByVector(g,F.multiplyByVector(d,A[V],Ju),Ju);const k=f.normalize(f.subtract(O,n,Xs),Xs),H=f.dot(k,i);H>G&&(G=H,M=f.clone(O,M))}const P=t.cartesianToCartographic(M,HC);return G=S.clamp(G,0,1),I=f.magnitude(f.subtract(M,n,Xs))*Math.sqrt(1-G*G),I=o?-I:I,P.height=I,t.cartographicToCartesian(P,new f)}};const WC=new f;Ne.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,WC),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},Ne.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 Ne.lineSegmentPlane(e,t,i,d),Ne.lineSegmentPlane(e,n,i,p),{positions:[e,t,n,d,p],indices:[0,3,4,1,2,4,1,4,3]};if(c)return Ne.lineSegmentPlane(t,n,i,d),Ne.lineSegmentPlane(t,e,i,p),{positions:[e,t,n,d,p],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Ne.lineSegmentPlane(n,e,i,d),Ne.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 Ne.lineSegmentPlane(e,n,i,d),Ne.lineSegmentPlane(t,n,i,p),{positions:[e,t,n,d,p],indices:[0,1,4,0,4,3,2,3,4]}}else return Ne.lineSegmentPlane(n,t,i,d),Ne.lineSegmentPlane(e,t,i,p),{positions:[e,t,n,d,p],indices:[2,0,4,2,4,3,1,3,4]};else return Ne.lineSegmentPlane(t,e,i,d),Ne.lineSegmentPlane(n,e,i,p),{positions:[e,t,n,d,p],indices:[1,2,4,1,4,3,0,3,4]}};const jc=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=me.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=f.fromCartesian4(N.getColumn(n,0,jc)),this._yAxis=f.fromCartesian4(N.getColumn(n,1,jc));const i=f.fromCartesian4(N.getColumn(n,2,jc));this._plane=Be.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 jC=new jt;Kn.fromPoints=function(e,t){m.defined("cartesians",e);const n=jt.fromPoints(e,jC);return new Kn(n.center,t)};const ed=new Po,$s=new f;Kn.prototype.projectPointOntoPlane=function(e,t){m.defined("cartesian",e);const n=ed;n.origin=e,f.normalize(e,n.direction);let i=Ne.rayPlane(n,this._plane,$s);if(h(i)||(f.negate(n.direction,n.direction),i=Ne.rayPlane(n,this._plane,$s)),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=ed;n.origin=e,f.clone(this._plane.normal,n.direction);let i=Ne.rayPlane(n,this._plane,$s);h(i)||(f.negate(n.direction,n.direction),i=Ne.rayPlane(n,this._plane,$s));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 YC=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=YC;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 Ie(e,t){this.center=f.clone(_(e,f.ZERO)),this.halfAxes=F.clone(_(t,F.ZERO))}Ie.packedLength=f.packedLength+F.packedLength,Ie.pack=function(e,t,n){return m.typeOf.object("value",e),m.defined("array",t),n=_(n,0),f.pack(e.center,t,n),F.pack(e.halfAxes,t,n+f.packedLength),t},Ie.unpack=function(e,t,n){return m.defined("array",e),t=_(t,0),h(n)||(n=new Ie),f.unpack(e,t,n.center),F.unpack(e,t+f.packedLength,n.halfAxes),n};const XC=new f,$C=new f,ZC=new f,KC=new f,QC=new f,JC=new f,eE=new F,tE={unitary:new F,diagonal:new F};Ie.fromPoints=function(e,t){if(h(t)||(t=new Ie),!h(e)||e.length===0)return t.halfAxes=F.ZERO,t.center=f.ZERO,t;let n;const i=e.length,o=f.clone(e[0],XC);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,$C),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=eE;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=F.computeEigenDecomposition(y,tE),E=F.clone(x.unitary,t.halfAxes);let T=F.getColumn(E,0,KC),D=F.getColumn(E,1,QC),A=F.getColumn(E,2,JC),O=-Number.MAX_VALUE,I=-Number.MAX_VALUE,B=-Number.MAX_VALUE,M=Number.MAX_VALUE,G=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)g=e[n],O=Math.max(f.dot(T,g),O),I=Math.max(f.dot(D,g),I),B=Math.max(f.dot(A,g),B),M=Math.min(f.dot(T,g),M),G=Math.min(f.dot(D,g),G),P=Math.min(f.dot(A,g),P);T=f.multiplyByScalar(T,.5*(M+O),T),D=f.multiplyByScalar(D,.5*(G+I),D),A=f.multiplyByScalar(A,.5*(P+B),A);const V=f.add(T,D,t.center);f.add(V,A,V);const k=ZC;return k.x=O-M,k.y=I-G,k.z=B-P,f.multiplyByScalar(k,.5,k),F.multiplyByScale(t.halfAxes,k,t.halfAxes),t};const td=new f,nE=new f;function nd(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 Ie);const p=d.halfAxes;F.setColumn(p,0,t,p),F.setColumn(p,1,n,p),F.setColumn(p,2,i,p);let g=td;g.x=(o+s)/2,g.y=(a+c)/2,g.z=(l+u)/2;const y=nE;y.x=(s-o)/2,y.y=(c-a)/2,y.z=(u-l)/2;const x=d.center;return g=F.multiplyByVector(p,g,g),f.add(e,g,x),F.multiplyByScale(p,y,p),d}const id=new ee,iE=new f,oE=new ee,rE=new ee,sE=new ee,aE=new ee,cE=new ee,lE=new f,od=new f,hE=new f,rd=new f,fE=new f,uE=new U,dE=new U,pE=new U,mE=new U,_E=new U,gE=new f,yE=new f,xE=new f,CE=new f,EE=new U,TE=new f,bE=new f,wE=new f,SE=new Be(f.UNIT_X,0);Ie.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 G=ce.center(e,id),P=i.cartographicToCartesian(G,iE),V=new Kn(P,i);p=V.plane;const k=G.longitude,H=e.south<0&&e.north>0?0:G.latitude,j=ee.fromRadians(k,e.north,n,oE),r=ee.fromRadians(e.west,e.north,n,rE),b=ee.fromRadians(e.west,H,n,sE),v=ee.fromRadians(e.west,e.south,n,aE),z=ee.fromRadians(k,e.south,n,cE),q=i.cartographicToCartesian(j,lE);let W=i.cartographicToCartesian(r,od);const Z=i.cartographicToCartesian(b,hE);let X=i.cartographicToCartesian(v,rd);const ie=i.cartographicToCartesian(z,fE),se=V.projectPointToNearestOnPlane(q,uE),_e=V.projectPointToNearestOnPlane(W,dE),Ee=V.projectPointToNearestOnPlane(Z,pE),ye=V.projectPointToNearestOnPlane(X,mE),Re=V.projectPointToNearestOnPlane(ie,_E);return s=Math.min(_e.x,Ee.x,ye.x),a=-s,l=Math.max(_e.y,se.y),c=Math.min(ye.y,Re.y),r.height=v.height=t,W=i.cartographicToCartesian(r,od),X=i.cartographicToCartesian(v,rd),u=Math.min(Be.getPointDistance(p,W),Be.getPointDistance(p,X)),d=n,nd(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,id).longitude,T=f.fromRadians(E,x,n,i,gE);T.z=0;const A=Math.abs(T.x)<S.EPSILON10&&Math.abs(T.y)<S.EPSILON10?f.UNIT_X:f.normalize(T,yE),O=f.UNIT_Z,I=f.cross(A,O,xE);p=Be.fromPointNormal(T,A,SE);const B=f.fromRadians(E+S.PI_OVER_TWO,x,n,i,CE);a=f.dot(Be.projectPointOntoPlane(p,B,EE),I),s=-a,l=f.fromRadians(0,e.north,y?t:n,i,TE).z,c=f.fromRadians(0,e.south,g?t:n,i,bE).z;const M=f.fromRadians(e.east,x,n,i,wE);return u=Be.getPointDistance(p,M),d=0,nd(T,I,O,A,s,a,c,l,u,d,o)},Ie.fromTransformation=function(e,t){return m.typeOf.object("transformation",e),h(t)||(t=new Ie),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=F.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t},Ie.clone=function(e,t){if(h(e))return h(t)?(f.clone(e.center,t.center),F.clone(e.halfAxes,t.halfAxes),t):new Ie(e.center,e.halfAxes)},Ie.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[F.COLUMN0ROW0]+a*o[F.COLUMN0ROW1]+c*o[F.COLUMN0ROW2])+Math.abs(s*o[F.COLUMN1ROW0]+a*o[F.COLUMN1ROW1]+c*o[F.COLUMN1ROW2])+Math.abs(s*o[F.COLUMN2ROW0]+a*o[F.COLUMN2ROW1]+c*o[F.COLUMN2ROW2]),u=f.dot(i,n)+t.distance;return u<=-l?Ct.OUTSIDE:u>=l?Ct.INSIDE:Ct.INTERSECTING};const sd=new f,ad=new f,cd=new f,AE=new f,ld=new f,DE=new f;Ie.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,td),i=e.halfAxes;let o=F.getColumn(i,0,sd),s=F.getColumn(i,1,ad),a=F.getColumn(i,2,cd);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,T;if(y===1){let I=o;x=s,E=a,p?g||(I=a,E=o):(I=s,x=o),T=f.cross(x,E,ld),I===o?o=T:I===s?s=T:I===a&&(a=T)}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,AE),f.normalize(E,E),T=f.cross(x,E,ld),f.normalize(T,T),x===o?(s=E,a=T):x===s?(a=E,o=T):x===a&&(o=E,s=T)}else y===3&&(o=f.UNIT_X,s=f.UNIT_Y,a=f.UNIT_Z);const D=DE;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 OE=new f,vE=new f;Ie.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 Qi);let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const a=e.center,c=e.halfAxes,l=F.getColumn(c,0,sd),u=F.getColumn(c,1,ad),d=F.getColumn(c,2,cd),p=f.add(l,u,OE);f.add(p,d,p),f.add(p,a,p);const g=f.subtract(p,t,vE);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 IE=new f,RE=new f,zE=new f;Ie.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=F.getColumn(i,0,IE),s=F.getColumn(i,1,RE),a=F.getColumn(i,2,zE);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 PE=new F;Ie.computeTransformation=function(e,t){m.typeOf.object("box",e),h(t)||(t=new N);const n=e.center,i=F.multiplyByUniformScale(e.halfAxes,2,PE);return N.fromRotationTranslation(i,n,t)};const BE=new K;Ie.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,BE);return!t.isBoundingSphereVisible(n)},Ie.prototype.intersectPlane=function(e){return Ie.intersectPlane(this,e)},Ie.prototype.distanceSquaredTo=function(e){return Ie.distanceSquaredTo(this,e)},Ie.prototype.computePlaneDistances=function(e,t,n){return Ie.computePlaneDistances(this,e,t,n)},Ie.prototype.computeCorners=function(e){return Ie.computeCorners(this,e)},Ie.prototype.computeTransformation=function(e){return Ie.computeTransformation(this,e)},Ie.prototype.isOccluded=function(e){return Ie.isOccluded(this,e)},Ie.equals=function(e,t){return e===t||h(e)&&h(t)&&f.equals(e.center,t.center)&&F.equals(e.halfAxes,t.halfAxes)},Ie.prototype.clone=function(e){return Ie.clone(this,e)},Ie.prototype.equals=function(e){return Ie.equals(this,e)};const dr={};dr.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 NE=new ee;dr.getPosition=function(e,t,n,i,o){const s=t.cartesianToCartographic(e,NE);if(!h(s))return f.clone(e,o);const a=dr.getHeight(s.height,n,i);return f.fromRadians(s.longitude,s.latitude,a,t,o)};const LE=`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?AC:SC,s=i?Mu:wC,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=Mt.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=at.POSITION_AND_NORMAL,jt.FLAT_VERTEX_FORMAT=at.POSITION_ONLY,jt.prototype.getFragmentShaderSource=Mt.prototype.getFragmentShaderSource,jt.prototype.isTranslucent=Mt.prototype.isTranslucent,jt.prototype.getRenderState=Mt.prototype.getRenderState;function zo(e){this._definitionChanged=new Pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(zo.prototype,{isConstant:{get:function(){return Ae.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:F("color")}),zo.prototype.getType=function(e){return"Color"};const DC=new $;zo.prototype.getValue=function(e,t){return h(e)||(e=$.now(DC)),h(t)||(t={}),t.color=Ae.getValueOrClonedDefault(this._color,e,w.WHITE,t.color),t},zo.prototype.equals=function(e){return this===e||e instanceof zo&&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 Uu=new f,Vu=new f,ku=new ee,Wc=new f,OC=new f,Gu=new K,vC=new Li,hr=[new ee,new ee,new ee,new ee],fr=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=qu(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,ku),Uu),t.cartographicToCartesian(ce.southwest(e,ku),Vu),f.midpoint(Vu,Uu,Wc);const c=t.scaleToGeodeticSurface(Wc,OC);if(h(c)){const l=f.distance(Wc,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=qu(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,Gu),K.union(o,Gu,o)};function qu(e){ee.fromRadians(e.east,e.north,0,hr[0]),ee.fromRadians(e.west,e.north,0,hr[1]),ee.fromRadians(e.east,e.south,0,hr[2]),ee.fromRadians(e.west,e.south,0,hr[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=hr[l];if(vC.positionToTileXY(u,a,fr),l===0)i=fr.x,o=fr.y;else if(i!==fr.x||o!==fr.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 Zs=new f;Yt.intersectPlane=function(e,t){m.defined("box",e),m.defined("plane",t),Zs=f.subtract(e.maximum,e.minimum,Zs);const n=f.multiplyByScalar(Zs,.5,Zs),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?Ct.INSIDE:s+o<0?Ct.OUTSIDE:Ct.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 Hu(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=Hu(o,-s,S.EPSILON14);if(a<0)return[];const c=-.5*Hu(t,S.sign(t)*Math.sqrt(a),S.EPSILON14);return t>0?[c/e,n/c]:[n/c,c/e]};const ur={};ur.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 jc(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 T,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 T=se<=0?je+tt:-ge/(je*je+tt*tt+se),d*u>=l*p?[(T-s)/o]:[-c/(T+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);T=2*Math.sqrt(-A);let k=Math.cos(P);D=T*k;let V=T*(-k/2-q*Math.sin(P));const H=D+V>2*s?D-s:V-s,j=o,r=H/j;P=Math.abs(Math.atan2(c*M,-B)/3),T=2*Math.sqrt(-I),k=Math.cos(P),D=T*k,V=T*(-k/2-q*Math.sin(P));const b=-c,v=D+V<2*a?D+a:V+a,z=b/v,G=j*v,W=-H*v-j*b,Z=H*b,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]}ur.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 jc(e,0,n,i)}else{if(n===0)return i===0?(s=-t/e,s<0?[s,0,0]:[0,0,s]):jc(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 jc(e,t,n,i)};const Yc={};Yc.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=ur.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),T=Math.sqrt(y);return[u-T,u-E,u+E,u+T]}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 dr(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=ur.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,T=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||T*O<A*D){const j=Math.sqrt(A);I=j/2,B=j===0?0:(e*E-n)/j}else{const j=Math.sqrt(T);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,k;E===0&&B===0?(P=0,k=0):S.sign(E)===S.sign(B)?(P=E+B,k=i/P):(k=E-B,P=i/k);const V=Rn.computeRealRoots(1,M,P),H=Rn.computeRealRoots(1,q,k);if(V.length!==0)return H.length!==0?V[1]<=H[0]?[V[0],V[1],H[0],H[1]]:H[1]<=V[0]?[H[0],H[1],V[0],V[1]]:V[0]>=H[0]&&V[1]<=H[1]?[H[0],V[0],V[1],H[1]]:H[0]>=V[0]&&H[1]<=V[1]?[V[0],H[0],H[1],V[1]]:V[0]>H[0]&&V[0]<H[1]?[H[0],V[0],H[1],V[1]]:[V[0],H[0],V[1],H[1]]:V;if(H.length!==0)return H}return[]}Yc.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 ur.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 dr(s,a,c,l);case 2:return dr(s,a,c,l);case 3:return zn(s,a,c,l);case 4:return zn(s,a,c,l);case 5:return dr(s,a,c,l);case 6:return zn(s,a,c,l);case 7:return zn(s,a,c,l);case 8:return dr(s,a,c,l);case 9:return zn(s,a,c,l);case 10:return zn(s,a,c,l);case 11:return dr(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 Po(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}Po.clone=function(e,t){if(h(e))return h(t)?(t.origin=f.clone(e.origin),t.direction=f.clone(e.direction),t):new Po(e.origin,e.direction)},Po.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 IC=new f,RC=new f,Wu=new f,ju=new f,Yu=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,IC),l=f.subtract(i,t,RC),u=f.cross(a,l,Wu),d=f.dot(c,u);let p,g,y,x,E;if(o){if(d<S.EPSILON6||(p=f.subtract(s,t,ju),y=f.dot(p,u),y<0||y>d)||(g=f.cross(p,c,Yu),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 T=1/d;if(p=f.subtract(s,t,ju),y=f.dot(p,u)*T,y<0||y>1||(g=f.cross(p,c,Yu),x=f.dot(a,g)*T,x<0||y+x>1))return;E=f.dot(l,g)*T}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 zC=new Po;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=zC;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 PC(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 BC={root0:0,root1:0};function Xu(e,t,n){h(n)||(n=new Qi);const i=e.origin,o=e.direction,s=t.center,a=t.radius*t.radius,c=f.subtract(i,s,Wu),l=f.dot(o,o),u=2*f.dot(o,c),d=f.magnitudeSquared(c)-a,p=PC(l,u,d,BC);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=Xu(e,t,n),!(!h(n)||n.stop<0))return n.start=Math.max(n.start,0),n};const NC=new Po;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=NC;f.clone(e,o.origin);const s=f.subtract(t,e,o.direction),a=f.magnitude(s);if(f.normalize(s,s),i=Xu(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 FC=new f,LC=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,FC),o=f.multiplyComponents(n,e.direction,LC),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 Qi(x,E):{start:E,stop:x}}const y=Math.sqrt(c/l);return new Qi(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 Qi(0,p/l);if(a<0)return l=f.magnitudeSquared(o),new Qi(0,-a/l)};function eo(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*eo(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*eo(e[L.COLUMN2ROW1],e[L.COLUMN1ROW2],S.EPSILON15),p=o*(i*eo(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],k=Math.sqrt(Math.max(1-P*P,0));if(y.push(new f(i,o*P,o*-k)),y.push(new f(i,o*P,o*k)),g.length===2){const V=g[1],H=Math.sqrt(Math.max(1-V*V,0));y.push(new f(i,o*V,o*-H)),y.push(new f(i,o*V,o*H))}return y}const x=p*p,E=d*d,T=c*c,D=p*d,A=T+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=Yc.computeRealRoots(A,O,I,B,M);const q=g.length;if(q===0)return y;for(let P=0;P<q;++P){const k=g[P],V=k*k,H=Math.max(1-V,0),j=Math.sqrt(H);let r;S.sign(c)===S.sign(u)?r=eo(c*V+u,l*k,S.EPSILON12):S.sign(u)===S.sign(l*k)?r=eo(c*V,l*k+u,S.EPSILON12):r=eo(c*V+l*k,u,S.EPSILON12);const b=eo(d*k,p,S.EPSILON15),v=r*b;v<0?y.push(new f(i,o*k,o*j)):v>0?y.push(new f(i,o*k,o*-j)):j!==0?(y.push(new f(i,o*k,o*-j)),y.push(new f(i,o*k,o*j)),++P):y.push(new f(i,o*k,o*j))}return y};const Xc=new f,$u=new f,Zu=new f,Ks=new f,MC=new f,UC=new L,VC=new L,kC=new L,GC=new L,qC=new L,Ku=new L,Qu=new L,Ju=new f,HC=new f,WC=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,Xc);if(f.dot(i,M)>=0)return n}const o=h(this.rayEllipsoid(e,t)),s=t.transformPositionToScaledSpace(i,Xc),a=f.normalize(s,s),c=f.mostOrthogonalAxis(s,Ks),l=f.normalize(f.cross(c,a,$u),$u),u=f.normalize(f.cross(a,l,Zu),Zu),d=UC;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,VC),g=L.fromScale(t.radii,kC),y=L.fromScale(t.oneOverRadii,GC),x=qC;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,Ku),x,Ku),T=L.multiply(L.multiply(E,g,Qu),d,Qu),D=L.multiplyByVector(E,n,MC),A=Fe.quadraticVectorExpression(T,f.negate(D,Xc),0,0,1);let O,I;const B=A.length;if(B>0){let M=f.clone(f.ZERO,HC),q=Number.NEGATIVE_INFINITY;for(let k=0;k<B;++k){O=L.multiplyByVector(g,L.multiplyByVector(d,A[k],Ju),Ju);const V=f.normalize(f.subtract(O,n,Ks),Ks),H=f.dot(V,i);H>q&&(q=H,M=f.clone(O,M))}const P=t.cartesianToCartographic(M,WC);return q=S.clamp(q,0,1),I=f.magnitude(f.subtract(M,n,Ks))*Math.sqrt(1-q*q),I=o?-I:I,P.height=I,t.cartographicToCartesian(P,new f)}};const jC=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,jC),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 $c=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,$c)),this._yAxis=f.fromCartesian4(N.getColumn(n,1,$c));const i=f.fromCartesian4(N.getColumn(n,2,$c));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 YC=new Yt;Kn.fromPoints=function(e,t){m.defined("cartesians",e);const n=Yt.fromPoints(e,YC);return new Kn(n.center,t)};const ed=new Po,Qs=new f;Kn.prototype.projectPointOntoPlane=function(e,t){m.defined("cartesian",e);const n=ed;n.origin=e,f.normalize(e,n.direction);let i=Fe.rayPlane(n,this._plane,Qs);if(h(i)||(f.negate(n.direction,n.direction),i=Fe.rayPlane(n,this._plane,Qs)),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=ed;n.origin=e,f.clone(this._plane.normal,n.direction);let i=Fe.rayPlane(n,this._plane,Qs);h(i)||(f.negate(n.direction,n.direction),i=Fe.rayPlane(n,this._plane,Qs));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 XC=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=XC;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 $C=new f,ZC=new f,KC=new f,QC=new f,JC=new f,eE=new f,tE=new L,nE={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],$C);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,ZC),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=tE;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,nE),E=L.clone(x.unitary,t.halfAxes);let T=L.getColumn(E,0,QC),D=L.getColumn(E,1,JC),A=L.getColumn(E,2,eE),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(T,g),O),I=Math.max(f.dot(D,g),I),B=Math.max(f.dot(A,g),B),M=Math.min(f.dot(T,g),M),q=Math.min(f.dot(D,g),q),P=Math.min(f.dot(A,g),P);T=f.multiplyByScalar(T,.5*(M+O),T),D=f.multiplyByScalar(D,.5*(q+I),D),A=f.multiplyByScalar(A,.5*(P+B),A);const k=f.add(T,D,t.center);f.add(k,A,k);const V=KC;return V.x=O-M,V.y=I-q,V.z=B-P,f.multiplyByScalar(V,.5,V),L.multiplyByScale(t.halfAxes,V,t.halfAxes),t};const td=new f,iE=new f;function nd(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=td;g.x=(o+s)/2,g.y=(a+c)/2,g.z=(l+u)/2;const y=iE;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 id=new ee,oE=new f,rE=new ee,sE=new ee,aE=new ee,cE=new ee,lE=new ee,hE=new f,od=new f,fE=new f,rd=new f,uE=new f,dE=new U,pE=new U,mE=new U,_E=new U,gE=new U,yE=new f,xE=new f,CE=new f,EE=new f,TE=new U,bE=new f,wE=new f,SE=new f,AE=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,id),P=i.cartographicToCartesian(q,oE),k=new Kn(P,i);p=k.plane;const V=q.longitude,H=e.south<0&&e.north>0?0:q.latitude,j=ee.fromRadians(V,e.north,n,rE),r=ee.fromRadians(e.west,e.north,n,sE),b=ee.fromRadians(e.west,H,n,aE),v=ee.fromRadians(e.west,e.south,n,cE),z=ee.fromRadians(V,e.south,n,lE),G=i.cartographicToCartesian(j,hE);let W=i.cartographicToCartesian(r,od);const Z=i.cartographicToCartesian(b,fE);let X=i.cartographicToCartesian(v,rd);const ie=i.cartographicToCartesian(z,uE),se=k.projectPointToNearestOnPlane(G,dE),ge=k.projectPointToNearestOnPlane(W,pE),Te=k.projectPointToNearestOnPlane(Z,mE),xe=k.projectPointToNearestOnPlane(X,_E),ze=k.projectPointToNearestOnPlane(ie,gE);return s=Math.min(ge.x,Te.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,od),X=i.cartographicToCartesian(v,rd),u=Math.min(Ne.getPointDistance(p,W),Ne.getPointDistance(p,X)),d=n,nd(k.origin,k.xAxis,k.yAxis,k.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,id).longitude,T=f.fromRadians(E,x,n,i,yE);T.z=0;const A=Math.abs(T.x)<S.EPSILON10&&Math.abs(T.y)<S.EPSILON10?f.UNIT_X:f.normalize(T,xE),O=f.UNIT_Z,I=f.cross(A,O,CE);p=Ne.fromPointNormal(T,A,AE);const B=f.fromRadians(E+S.PI_OVER_TWO,x,n,i,EE);a=f.dot(Ne.projectPointOntoPlane(p,B,TE),I),s=-a,l=f.fromRadians(0,e.north,y?t:n,i,bE).z,c=f.fromRadians(0,e.south,g?t:n,i,wE).z;const M=f.fromRadians(e.east,x,n,i,SE);return u=Ne.getPointDistance(p,M),d=0,nd(T,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?Ct.OUTSIDE:u>=l?Ct.INSIDE:Ct.INTERSECTING};const sd=new f,ad=new f,cd=new f,DE=new f,ld=new f,OE=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,td),i=e.halfAxes;let o=L.getColumn(i,0,sd),s=L.getColumn(i,1,ad),a=L.getColumn(i,2,cd);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,T;if(y===1){let I=o;x=s,E=a,p?g||(I=a,E=o):(I=s,x=o),T=f.cross(x,E,ld),I===o?o=T:I===s?s=T:I===a&&(a=T)}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,DE),f.normalize(E,E),T=f.cross(x,E,ld),f.normalize(T,T),x===o?(s=E,a=T):x===s?(a=E,o=T):x===a&&(o=E,s=T)}else y===3&&(o=f.UNIT_X,s=f.UNIT_Y,a=f.UNIT_Z);const D=OE;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 vE=new f,IE=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 Qi);let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;const a=e.center,c=e.halfAxes,l=L.getColumn(c,0,sd),u=L.getColumn(c,1,ad),d=L.getColumn(c,2,cd),p=f.add(l,u,vE);f.add(p,d,p),f.add(p,a,p);const g=f.subtract(p,t,IE);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 RE=new f,zE=new f,PE=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,RE),s=L.getColumn(i,1,zE),a=L.getColumn(i,2,PE);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 BE=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,BE);return N.fromRotationTranslation(i,n,t)};const NE=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,NE);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 pr={};pr.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 FE=new ee;pr.getPosition=function(e,t,n,i,o){const s=t.cartesianToCartographic(e,FE);if(!h(s))return f.clone(e,o);const a=pr.getHeight(s.height,n,i);return f.fromRadians(s.longitude,s.latitude,a,t,o)};const LE=`in vec3 position3DHigh;
|
|
4506
4506
|
in vec3 position3DLow;
|
|
4507
4507
|
in float batchId;
|
|
4508
4508
|
|
|
@@ -4603,7 +4603,7 @@ void main()
|
|
|
4603
4603
|
|
|
4604
4604
|
gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
|
|
4605
4605
|
}
|
|
4606
|
-
`,
|
|
4606
|
+
`,ME=`#ifdef VECTOR_TILE
|
|
4607
4607
|
uniform vec4 u_highlightColor;
|
|
4608
4608
|
#endif
|
|
4609
4609
|
|
|
@@ -4616,7 +4616,7 @@ void main(void)
|
|
|
4616
4616
|
#endif
|
|
4617
4617
|
czm_writeDepthClamp();
|
|
4618
4618
|
}
|
|
4619
|
-
`,hd={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};hd.NUMBER_OF_CLASSIFICATION_TYPES=3;const pi=Object.freeze(hd),
|
|
4619
|
+
`,hd={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};hd.NUMBER_OF_CLASSIFICATION_TYPES=3;const pi=Object.freeze(hd),UE={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},fd=Object.freeze(UE);function VE(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=kE(t),o=e.floatingPointTexture,s=i===pe.FLOAT&&!o,a=GE(t,s),c=qE(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 T=4*d*p;this._batchValues=i===pe.FLOAT&&!s?new Float32Array(T):new Uint8Array(T),this._batchValuesDirty=!1}Object.defineProperties(mi.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function kE(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 ud(e,t){const n=e[t].componentsPerAttribute;return n===2?U:n===3?f:n===4?Y:Number}function GE(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 qE(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 mr=new Y;function HE(e,t,n){let i=Y.unpack(e,t,mr);const o=Y.unpackFloat(i);i=Y.unpack(e,t+4,mr);const s=Y.unpackFloat(i);i=Y.unpack(e,t+8,mr);const a=Y.unpackFloat(i);i=Y.unpack(e,t+12,mr);const c=Y.unpackFloat(i);return Y.fromElements(o,s,a,c,n)}function WE(e,t,n){let i=Y.packFloat(e.x,mr);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 dd=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=HE(this._batchValues,a,dd):c=Y.unpack(this._batchValues,a,dd);const l=ud(i,t);return h(l.fromCartesian4)?l.fromCartesian4(c,n):h(l.clone)?l.clone(c,n):c.x};const jE=[void 0,void 0,new U,new f,new Y],YE=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=jE[i[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,o),a=ud(this._attributes,t);if(h(a.equals)?a.equals(s,n):s===n)return;const l=YE;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?WE(l,this._batchValues,p):Y.pack(l,this._batchValues,p),this._batchValuesDirty=!0};function XE(e,t){const n=e._textureDimensions;e._texture=new Bt({context:t,pixelFormat:de.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Yn.NEAREST,flipY:!1})}function $E(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)||XE(this,e.context),$E(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 ZE(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;
|
|
@@ -4637,26 +4637,26 @@ vec2 computeSt(float batchId)
|
|
|
4637
4637
|
float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
|
|
4638
4638
|
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
|
|
4639
4639
|
}
|
|
4640
|
-
`}function
|
|
4640
|
+
`}function KE(e){return e===1?"float":`vec${e}`}function QE(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function JE(e,t){const i=e._attributes[t],o=i.componentsPerAttribute,s=i.functionName,a=KE(o),c=QE(o),l=e._offsets[t];let u=`${a} ${s}(float batchId)
|
|
4641
4641
|
{
|
|
4642
4642
|
vec2 st = computeSt(batchId);
|
|
4643
4643
|
st.x += batchTextureStep.x * float(${l});
|
|
4644
|
-
`;return e._packFloats&&i.componentDatatype!==
|
|
4644
|
+
`;return e._packFloats&&i.componentDatatype!==pe.UNSIGNED_BYTE?u+=`vec4 textureValue;
|
|
4645
4645
|
textureValue.x = czm_unpackFloat(texture(batchTexture, st));
|
|
4646
4646
|
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
|
|
4647
4647
|
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
|
|
4648
4648
|
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
|
|
4649
4649
|
`:u+=` vec4 textureValue = texture(batchTexture, st);
|
|
4650
4650
|
`,u+=` ${a} value = textureValue${c};
|
|
4651
|
-
`,e._pixelDatatype===
|
|
4652
|
-
`:e._pixelDatatype===
|
|
4651
|
+
`,e._pixelDatatype===pe.UNSIGNED_BYTE&&i.componentDatatype===oe.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
|
|
4652
|
+
`:e._pixelDatatype===pe.FLOAT&&i.componentDatatype===oe.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
|
|
4653
4653
|
`),u+=` return value;
|
|
4654
4654
|
}
|
|
4655
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;
|
|
4656
|
-
`;t+=`${
|
|
4657
|
-
`;const n=e.length;for(let i=0;i<n;++i)t+=
|
|
4656
|
+
`;t+=`${ZE(this)}
|
|
4657
|
+
`;const n=e.length;for(let i=0;i<n;++i)t+=JE(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 Me={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Me.getMathType=function(e){switch(e){case Me.SCALAR:return Number;case Me.VEC2:return U;case Me.VEC3:return f;case Me.VEC4:return Y;case Me.MAT2:return ae;case Me.MAT3:return F;case Me.MAT4:return N;default:throw new C("attributeType is not a valid value.")}},Me.getNumberOfComponents=function(e){switch(e){case Me.SCALAR:return 1;case Me.VEC2:return 2;case Me.VEC3:return 3;case Me.VEC4:case Me.MAT2:return 4;case Me.MAT3:return 9;case Me.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}},Me.getAttributeLocationCount=function(e){switch(e){case Me.SCALAR:case Me.VEC2:case Me.VEC3:case Me.VEC4:return 1;case Me.MAT2:return 2;case Me.MAT3:return 3;case Me.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}},Me.getGlslType=function(e){switch(m.typeOf.string("attributeType",e),e){case Me.SCALAR:return"float";case Me.VEC2:return"vec2";case Me.VEC3:return"vec3";case Me.VEC4:return"vec4";case Me.MAT2:return"mat2";case Me.MAT3:return"mat3";case Me.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};const JE=Object.freeze(Me),pd=1/256,md=256,be={};be.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},be.octEncode=function(e,t){return be.octEncodeInRange(e,255,t)};const mr=new U,_d=new Uint8Array(1);function Zs(e){return _d[0]=e,_d[0]}be.octEncodeToCartesian4=function(e,t){return be.octEncodeInRange(e,65535,mr),t.x=Zs(mr.x*pd),t.y=Zs(mr.x),t.z=Zs(mr.y*pd),t.w=Zs(mr.y),t},be.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)},be.octDecode=function(e,t,n){return be.octDecodeInRange(e,t,255,n)},be.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*md+i,c=o*md+s;return be.octDecodeInRange(a,c,65535,t)},be.octPackFloat=function(e){return m.defined("encoded",e),256*e.x+e.y};const Yc=new U;be.octEncodeFloat=function(e){return be.octEncode(e,Yc),be.octPackFloat(Yc)},be.octDecodeFloat=function(e,t){m.defined("value",e);const n=e/256,i=Math.floor(n),o=(n-i)*256;return be.octDecode(i,o,t)},be.octPack=function(e,t,n,i){m.defined("v1",e),m.defined("v2",t),m.defined("v3",n),m.defined("result",i);const o=be.octEncodeFloat(e),s=be.octEncodeFloat(t),a=be.octEncode(n,Yc);return i.x=65536*a.x+o,i.y=65536*a.y+s,i},be.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;be.octDecodeFloat(a,t),be.octDecodeFloat(l,n),be.octDecode(s,c,i)},be.compressTextureCoordinates=function(e){m.defined("textureCoordinates",e);const t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n},be.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 Xc(e){return e>>1^-(e&1)}be.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+=Xc(e[c]),s+=Xc(t[c]),e[c]=o,t[c]=s,h(n)&&(a+=Xc(n[c]),n[c]=a)},be.dequantize=function(e,t,n,i){m.defined("typedArray",e),m.defined("componentDatatype",t),m.defined("type",n),m.defined("count",i);const o=JE.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},be.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 gd=new f,yd=new f,xd=new f;function eT(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,gd),a=f.subtract(i,t,yd),c=f.subtract(e,t,xd),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,gd),a=U.subtract(i,t,yd),c=U.subtract(e,t,xd),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 $c={};$c.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)},$c.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,b){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<b;){if(H[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(H,j,r,b,v,z,q){let W=-1,Z,X=-1,ie=0;for(;ie<r.length;){const se=r[ie];b[se].numLiveTriangles&&(Z=0,v-b[se].timeStamp+2*b[se].numLiveTriangles<=j&&(Z=v-b[se].timeStamp),(Z>X||X===-1)&&(X=Z,W=se)),++ie}return W===-1?s(b,z,H,q):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,T=i+1;o=1;let D=[];const A=[];let O,I,B=0;const M=[],G=c/3,P=[];for(y=0;y<G;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,T-O.timeStamp>i&&(O.timeStamp=T,++T),++u}E=a(t,i,D,g,T,A,l)}return M};const Ge={};function Ks(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function tT(e){const t=e.length,n=t/3*6,i=xt.createTypedArray(t,n);let o=0;for(let s=0;s<t;s+=3,o+=6)Ks(i,o,e[s],e[s+1],e[s+2]);return i}function nT(e){const t=e.length;if(t>=3){const n=(t-2)*6,i=xt.createTypedArray(t,n);Ks(i,0,e[0],e[1],e[2]);let o=6;for(let s=3;s<t;++s,o+=6)Ks(i,o,e[s-1],e[s],e[s-2]);return i}return new Uint16Array}function iT(e){if(e.length>0){const t=e.length-1,n=(t-1)*6,i=xt.createTypedArray(t,n),o=e[0];let s=0;for(let a=1;a<t;++a,s+=6)Ks(i,s,o,e[a],e[a+1]);return i}return new Uint16Array}Ge.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=tT(t);break;case qe.TRIANGLE_STRIP:e.indices=nT(t);break;case qe.TRIANGLE_FAN:e.indices=iT(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=qe.LINES}return e},Ge.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 lt({attributes:{position:new Pt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:qe.LINES,boundingSphere:l})},Ge.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},Ge.reorderForPreVertexCache=function(e){if(!h(e))throw new C("geometry is required.");const t=lt.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=xt.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 T=y.componentsPerAttribute,D=oe.createTypedArray(y.componentDatatype,u*T);for(;E<t;){const A=i[E];if(A!==-1)for(let O=0;O<T;O++)D[T*A+O]=x[T*E+O];++E}y.values=D}}return e},Ge.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=$c.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Cd(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 Pt({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function oT(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])}}Ge.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=lt.computeNumberOfVertices(e);if(h(e.indices)&&n>=S.SIXTY_FOUR_KILOBYTES){let i=[],o=[],s=0,a=Cd(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,oT(a,e.attributes,g)),o.push(y)}s+u>=S.SIXTY_FOUR_KILOBYTES&&(t.push(new lt({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],s=0,a=Cd(e.attributes))}o.length!==0&&t.push(new lt({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};const Ed=new f,rT=new ee;Ge.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,Ed),g=a.cartesianToCartographic(p,rT);if(!h(g))throw new C(`Could not project point (${p.x}, ${p.y}, ${p.z}) to 2D.`);const y=o.project(g,Ed);l[u++]=y.x,l[u++]=y.y,l[u++]=y.z}return e.attributes[n]=s,e.attributes[i]=new Pt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};const Zc={high:0,low:0};Ge.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)je.encode(s[d],Zc),c[d]=Zc.high,l[d]=Zc.low;const u=o.componentsPerAttribute;return e.attributes[n]=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:c}),e.attributes[i]=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};let Pn=new f;function Kc(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 Qc(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),F.multiplyByVector(e,Pn,Pn),Pn=f.normalize(Pn,Pn),f.pack(Pn,n,o)}}const Qs=new N,Js=new F;Ge.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;Kc(t,n.position),Kc(t,n.prevPosition),Kc(t,n.nextPosition),(h(n.normal)||h(n.tangent)||h(n.bitangent))&&(N.inverse(t,Qs),N.transpose(Qs,Qs),N.getMatrix3(Qs,Js),Qc(Js,n.normal),Qc(Js,n.tangent),Qc(Js,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 sT(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 Pt({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:oe.createTypedArray(a.componentDatatype,c)}))}return i}const aT=new f;function Jc(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=sT(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=lt.computeNumberOfVertices(new lt({attributes:d,primitiveType:qe.POINTS})),I=xt.createTypedArray(O,A);let B=0,M=0;for(o=0;o<n;++o){const G=e[o][t].indices,P=G.length;for(a=0;a<P;++a)I[B++]=M+G[a];M+=lt.computeNumberOfVertices(e[o][t])}x=I}let E=new f,T=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,aT))+D.radius;A>T&&(T=A)}return new lt({attributes:d,indices:x,primitiveType:u,boundingSphere:h(E)?new K(E,T):void 0})}Ge.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(Jc(t,"geometry")),n.length>0&&(o.push(Jc(n,"westHemisphereGeometry")),o.push(Jc(n,"eastHemisphereGeometry"))),o};const Cn=new f,_r=new f,Bo=new f,No=new f;Ge.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],T=t[u+2],D=x*3,A=E*3,O=T*3;_r.x=i[D],_r.y=i[D+1],_r.z=i[D+2],Bo.x=i[A],Bo.y=i[A+1],Bo.z=i[A+2],No.x=i[O],No.y=i[O+1],No.z=i[O+2],a[x].count++,a[E].count++,a[T].count++,f.subtract(Bo,_r,Bo),f.subtract(No,_r,No),c[d]=f.cross(Bo,No,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 Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e};const cT=new f,Td=new f,lT=new f;Ge.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],T=n[u+1],D=n[u+2];d=E*3,p=T*3,g=D*3;const A=E*2,O=T*2,I=D*2,B=i[d],M=i[d+1],G=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,b=(H*(i[p+1]-M)-k*(i[g+1]-M))*j,v=(H*(i[p+2]-G)-k*(i[g+2]-G))*j;l[d]+=r,l[d+1]+=b,l[d+2]+=v,l[p]+=r,l[p+1]+=b,l[p+2]+=v,l[g]+=r,l[g+1]+=b,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,cT),T=f.fromArray(l,d,lT),D=f.dot(E,T);f.multiplyByScalar(E,D,Td),f.normalize(f.subtract(T,Td,T),T),y[d]=T.x,y[p]=T.y,y[g]=T.z,f.normalize(f.cross(E,T,T),T),x[d]=T.x,x[p]=T.y,x[g]=T.z}return e.attributes.tangent=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:x}),e};const gr=new U,Bn=new f,bd=new f,wd=new f;let ea=new U;Ge.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 G=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}ea=be.octEncodeInRange(Bn,65535,ea),G[P++]=ea.x,G[P++]=ea.y}return e.attributes.compressedAttributes=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,values:G}),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,gr),I[B++]=be.compressTextureCoordinates(gr));const M=n*3;a&&h(x)&&h(E)?(f.fromArray(g,M,Bn),f.fromArray(x,M,bd),f.fromArray(E,M,wd),be.octPack(Bn,bd,wd,gr),I[B++]=gr.x,I[B++]=gr.y):(a&&(f.fromArray(g,M,Bn),I[B++]=be.octEncodeFloat(Bn)),d&&(f.fromArray(x,M,Bn),I[B++]=be.octEncodeFloat(Bn)),p&&(f.fromArray(E,M,Bn),I[B++]=be.octEncodeFloat(Bn)))}return e.attributes.compressedAttributes=new Pt({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 hT(e){if(h(e.indices))return e;const t=lt.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=xt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function fT(e){const t=lt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");const n=xt.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 uT(e){const t=lt.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");const n=xt.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 dT(e){if(h(e.indices))return e;const t=lt.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=xt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function pT(e){const t=lt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=xt.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 mT(e){const t=lt.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=xt.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 _T(e){switch(e.primitiveType){case qe.TRIANGLE_FAN:return fT(e);case qe.TRIANGLE_STRIP:return uT(e);case qe.TRIANGLES:return hT(e);case qe.LINE_STRIP:return pT(e);case qe.LINE_LOOP:return mT(e);case qe.LINES:return dT(e)}return e}function Mi(e,t){Math.abs(e.y)<S.EPSILON6&&(t?e.y=-S.EPSILON6:e.y=S.EPSILON6)}function gT(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 Sd=new f;function En(e,t,n,i){f.add(e,f.multiplyByScalar(f.subtract(t,e,Sd),e.y/(e.y-t.y),Sd),n),f.clone(n,i),Mi(n,!0),Mi(i,!1)}const to=new f,no=new f,io=new f,oo=new f,el={positions:new Array(7),indices:new Array(3*3)};function yT(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;gT(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=el.indices;a===1?(c[1]=3,c[2]=4,c[5]=6,c[7]=6,c[8]=5,i?(En(e,t,to,io),En(e,n,no,oo),c[0]=0,c[3]=1,c[4]=2,c[6]=1):o?(En(t,n,to,io),En(t,e,no,oo),c[0]=1,c[3]=2,c[4]=0,c[6]=2):s&&(En(n,e,to,io),En(n,t,no,oo),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,to,io),En(n,t,no,oo),c[0]=0,c[1]=1,c[3]=0,c[6]=2):(En(t,n,to,io),En(t,e,no,oo),c[0]=2,c[1]=0,c[3]=2,c[6]=1):(En(e,t,to,io),En(e,n,no,oo),c[0]=1,c[1]=2,c[3]=1,c[6]=0));const l=el.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(a===1||a===2)&&(l[3]=to,l[4]=no,l[5]=io,l[6]=oo,l.length=7),el}function Ad(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=lt.computeNumberOfVertices(e);return e.indices=xt.createTypedArray(i,e.indices),t&&(e.boundingSphere=K.fromVertices(n.position.values)),e}function Lo(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 Pt({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new lt({attributes:n,indices:[],primitiveType:e.primitiveType})}function tl(e,t,n){const i=h(e.geometry.boundingSphere);t=Ad(t,i),n=Ad(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 nl(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 T=e.add(y,x,y);e.add(T,E,T),g&&e.normalize(T,T),e.pack(T,d,p*t)}}const xT=nl(Y,4),ta=nl(f,3),Dd=nl(U,2),CT=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},yr=new f,il=new f,ol=new f,ET=new f;function na(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 T=f.fromArray(o,e*3,yr),D=f.fromArray(o,t*3,il),A=f.fromArray(o,n*3,ol),O=eT(i,T,D,A,ET);if(h(O)){if(h(s)&&ta(e,t,n,O,s,p.normal.values,E,!0),h(u)){const I=f.fromArray(u,e*3,yr),B=f.fromArray(u,t*3,il),M=f.fromArray(u,n*3,ol);f.multiplyByScalar(I,O.x,I),f.multiplyByScalar(B,O.y,B),f.multiplyByScalar(M,O.z,M);let G;!f.equals(I,f.ZERO)||!f.equals(B,f.ZERO)||!f.equals(M,f.ZERO)?(G=f.add(I,B,I),f.add(G,M,G),f.normalize(G,G)):(G=yr,G.x=0,G.y=0,G.z=0),f.pack(G,p.extrudeDirection.values,E*3)}if(h(d)&&CT(e,t,n,O,d,p.applyOffset.values,E),h(a)&&ta(e,t,n,O,a,p.tangent.values,E,!0),h(c)&&ta(e,t,n,O,c,p.bitangent.values,E,!0),h(l)&&Dd(e,t,n,O,l,p.st.values,E),y>0)for(let I=0;I<y;I++){const B=g[I];TT(e,t,n,O,E,x[B],p[B])}}}function TT(e,t,n,i,o,s,a){const c=s.componentsPerAttribute,l=s.values,u=a.values;switch(c){case 4:xT(e,t,n,i,l,u,o,!1);break;case 3:ta(e,t,n,i,l,u,o,!1);break;case 2:Dd(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 bT={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Od(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 G in n)n.hasOwnProperty(G)&&!bT[G]&&h(n[G])&&p.push(G);const g=p.length,y=Lo(t),x=Lo(t);let E,T,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 G=d[O],P=d[O+1],V=d[O+2];let k=f.fromArray(i,G*3),H=f.fromArray(i,P*3),j=f.fromArray(i,V*3);const r=yT(k,H,j);if(h(r)&&r.positions.length>3){const b=r.positions,v=r.indices,z=v.length;for(let q=0;q<z;++q){const W=v[q],Z=b[W];Z.y<0?(E=x.attributes,T=x.indices,D=I):(E=y.attributes,T=y.indices,D=B),A=Qn(E,T,D,d,W<3?O+W:-1,Z),na(G,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,T=x.indices,D=I):(E=y.attributes,T=y.indices,D=B),A=Qn(E,T,D,d,O,k),na(G,P,V,k,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,T,D,d,O+1,H),na(G,P,V,H,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,T,D,d,O+2,j),na(G,P,V,j,i,o,a,s,c,l,u,E,p,g,n,A)}tl(e,x,y)}const vd=Be.fromPointNormal(f.ZERO,f.UNIT_Y),wT=new f,ST=new f;function Fo(e,t,n,i,o,s,a){if(!h(a))return;const c=f.fromArray(i,e*3,yr);f.equalsEpsilon(c,n,S.EPSILON10)?s.applyOffset.values[o]=a[e]:s.applyOffset.values[o]=a[t]}function Id(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=Lo(t),c=Lo(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,yr),E=f.fromArray(i,y*3,il);let T;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 G=Ne.lineSegmentPlane(x,E,vd,ol);if(h(G)){const P=f.multiplyByScalar(f.UNIT_Y,5*S.EPSILON9,wT);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(G,P,ST);T=Qn(D,A,O,s,l,x),Fo(g,y,x,i,T,D,o),T=Qn(D,A,O,s,-1,V),Fo(g,y,V,i,T,D,o),f.negate(P,P),f.add(G,P,V),T=Qn(I,B,M,s,-1,V),Fo(g,y,V,i,T,I,o),T=Qn(I,B,M,s,l+1,E),Fo(g,y,E,i,T,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),T=Qn(P,V,k,s,l,x),Fo(g,y,x,i,T,P,o),T=Qn(P,V,k,s,l+1,E),Fo(g,y,E,i,T,P,o)}}tl(e,c,a)}const Rd=new U,AT=new U,zd=new f,Pd=new f,rl=new f,DT=new f,OT=new f,vT=new f,Bd=new Y;function Nd(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,zd);if(c.x>0)continue;const l=f.unpack(i,a,Pd);(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,rl);(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 IT=5*S.EPSILON9,ia=S.EPSILON6;function RT(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=Lo(t),d=Lo(t);let p,g,y,x=!1;const E=i.length/3;for(p=0;p<E;p+=4){const T=p,D=p+2,A=f.fromArray(i,T*3,zd),O=f.fromArray(i,D*3,Pd);if(Math.abs(A.y)<ia)for(A.y=ia*(O.y<0?-1:1),i[p*3+1]=A.y,i[(p+1)*3+1]=A.y,g=T*3;g<T*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)<ia)for(O.y=ia*(A.y<0?-1:1),i[(p+2)*3+1]=O.y,i[(p+3)*3+1]=O.y,g=T*3;g<T*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,G=d.indices;const P=Ne.lineSegmentPlane(A,O,vd,DT);if(h(P)){x=!0;const V=f.multiplyByScalar(f.UNIT_Y,IT,OT);A.y<0&&(f.negate(V,V),I=d.attributes,B=d.indices,M=u.attributes,G=u.indices);const k=f.add(P,V,vT);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[T*3],o[T*3+1],o[T*3+2]),I.prevPosition.values.push(o[T*3+3],o[T*3+4],o[T*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,T*2,Rd),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,rl));if(r/=f.magnitudeSquared(f.subtract(O,A,rl)),h(l)){const b=Y.fromArray(l,T*4,Bd),v=Y.fromArray(l,D*4,Bd),z=S.lerp(b.x,v.x,r),q=S.lerp(b.y,v.y,r),W=S.lerp(b.z,v.z,r),Z=S.lerp(b.w,v.w,r);for(g=T*4;g<T*4+2*4;++g)I.color.values.push(l[g]);for(I.color.values.push(z,q,W,Z),I.color.values.push(z,q,W,Z),M.color.values.push(z,q,W,Z),M.color.values.push(z,q,W,Z),g=D*4;g<D*4+2*4;++g)M.color.values.push(l[g])}if(h(c)){const b=U.fromArray(c,T*2,Rd),v=U.fromArray(c,(p+3)*2,AT),z=S.lerp(b.x,v.x,r);for(g=T*2;g<T*2+2*2;++g)I.st.values.push(c[g]);for(I.st.values.push(z,b.y),I.st.values.push(z,v.y),M.st.values.push(z,b.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,G.push(y,y+2,y+1),G.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&&(Nd(d),Nd(u)),tl(e,d,u)}Ge.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,Be.ORIGIN_ZX_PLANE)!==Ct.INTERSECTING))return e;if(t.geometryType!==or.NONE)switch(t.geometryType){case or.POLYLINES:RT(e);break;case or.TRIANGLES:Od(e);break;case or.LINES:Id(e);break}else _T(t),t.primitiveType===qe.TRIANGLES?Od(e):t.primitiveType===qe.LINES&&Id(e);return e};function Zt(e){this._ellipsoid=_(e,le.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Zt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Zt.mercatorAngleToGeodeticLatitude=function(e){return S.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},Zt.geodeticLatitudeToMercatorAngle=function(e){e>Zt.MaximumLatitude?e=Zt.MaximumLatitude:e<-Zt.MaximumLatitude&&(e=-Zt.MaximumLatitude);const t=Math.sin(e);return .5*Math.log((1+t)/(1-t))},Zt.MaximumLatitude=Zt.mercatorAngleToGeodeticLatitude(Math.PI),Zt.prototype.project=function(e,t){const n=this._semimajorAxis,i=e.longitude*n,o=Zt.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)},Zt.prototype.unproject=function(e,t){if(!h(e))throw new C("cartesian is required");const n=this._oneOverSemimajorAxis,i=e.x*n,o=Zt.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 zT(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)&&Ge.transformToWorldCoordinates(e[s]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function sl(e,t){const n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Pt({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 PT(e){const t=e.length;for(let n=0;n<t;++n){const i=e[n];h(i.geometry)?sl(i.geometry,n):h(i.westHemisphereGeometry)&&h(i.eastHemisphereGeometry)&&(sl(i.westHemisphereGeometry,n),sl(i.eastHemisphereGeometry,n))}}function BT(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(zT(t,c,o),!o)for(l=0;l<p;++l)h(t[l].geometry)&&Ge.splitLongitude(t[l]);if(PT(t),s)for(l=0;l<p;++l){const y=t[l];h(y.geometry)?(Ge.reorderForPostVertexCache(y.geometry),Ge.reorderForPreVertexCache(y.geometry)):h(y.westHemisphereGeometry)&&h(y.eastHemisphereGeometry)&&(Ge.reorderForPostVertexCache(y.westHemisphereGeometry),Ge.reorderForPreVertexCache(y.westHemisphereGeometry),Ge.reorderForPostVertexCache(y.eastHemisphereGeometry),Ge.reorderForPreVertexCache(y.eastHemisphereGeometry))}let g=Ge.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&&Ge.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`,T=`${x}2D`;Ge.projectTo2D(u,x,E,T,n),h(u.boundingSphere)&&x==="position"&&(u.boundingSphereCV=K.fromVertices(u.attributes.position2D.values)),Ge.encodeAttribute(u,E,`${E}High`,`${E}Low`),Ge.encodeAttribute(u,T,`${T}High`,`${T}Low`)}a&&Ge.compressVertices(u)}if(!i){let y=[];for(p=g.length,l=0;l<p;++l)u=g[l],y=y.concat(Ge.fitToUnsignedShortIndices(u));g=y}return g}function al(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 NT(e,t){const n=[];return al(e,"geometry",t,n),al(e,"westHemisphereGeometry",t,n),al(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=BT(e),t.length>0&&(n=Ge.createAttributeLocations(t[0]),e.createPickOffsets&&(s=NT(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 LT(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 FT(e,t){const n=e.length;for(let i=0;i<n;++i)LT(e[i],t)}function MT(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(MT(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 T=y[E],D=g[T];n[a++]=o[T],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,T,D;const A=new Ru,O=n[a++];for(i=0;i<O;i++){const B=t[n[a++]],M=n[a++];D=n[a++];const G=n[a++]!==0;E=n[a++],T=oe.createTypedArray(M,E);for(let P=0;P<E;P++)T[P]=n[a++];A[B]=new Pt({componentDatatype:M,componentsPerAttribute:D,normalize:G,values:T})}let I;if(E=n[a++],E>0){const B=T.length/D;for(I=xt.createTypedArray(B,E),i=0;i<E;i++)I[i]=n[a++]}o[s++]=new lt({primitiveType:l,geometryType:u,boundingSphere:p,boundingSphereCV:g,indices:I,attributes:A,offsetAttribute:d})}return o};function UT(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 kT(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 ar(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:UT(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=kT(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 Zt(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 Ld(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 Fd(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)&&FT(e.geometries,t);const n=Ld(e.boundingSpheres),i=Ld(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:Fd(e.boundingSpheres),boundingSpheresCV:Fd(e.boundingSpheresCV)}};const wt=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 oa=Object.freeze(fn);function De(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,oa.DISABLED),this._translucent=void 0,this._state=wt.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(De.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 VT(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 qT=new U,GT=new f,Md=new Y;function Ud(e){const t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,qT);if(t===3)return f.unpack(e,0,GT);if(t===4)return Y.unpack(e,0,Md)}function HT(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;const s=VT(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 T=c.length,D=new mi(t,c,o);for(y=0;y<o;++y){const A=i[y];g=A.attributes;for(let G=0;G<a;++G){x=s[G],E=g[x];const P=Ud(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=Md;M.x=w.floatToByte(B.red),M.y=w.floatToByte(B.green),M.z=w.floatToByte(B.blue),M.w=w.floatToByte(B.alpha),D.setBatchedAttribute(y,T-1,M)}e._batchTable=D,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=d}function WT(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Pt({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function jT(e){const t=e.attributes,n=new Ru;for(const o in t)t.hasOwnProperty(o)&&h(t[o])&&(n[o]=WT(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 lt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:K.clone(e.boundingSphere)})}function YT(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const XT=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;De._modifyShaderPosition=function(e,t,n){let i,o="",s="",a="";for(;(i=XT.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}`}},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 eT=Object.freeze(Ue),pd=1/256,md=256,we={};we.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},we.octEncode=function(e,t){return we.octEncodeInRange(e,255,t)};const _r=new U,_d=new Uint8Array(1);function Js(e){return _d[0]=e,_d[0]}we.octEncodeToCartesian4=function(e,t){return we.octEncodeInRange(e,65535,_r),t.x=Js(_r.x*pd),t.y=Js(_r.x),t.z=Js(_r.y*pd),t.w=Js(_r.y),t},we.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)},we.octDecode=function(e,t,n){return we.octDecodeInRange(e,t,255,n)},we.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*md+i,c=o*md+s;return we.octDecodeInRange(a,c,65535,t)},we.octPackFloat=function(e){return m.defined("encoded",e),256*e.x+e.y};const Zc=new U;we.octEncodeFloat=function(e){return we.octEncode(e,Zc),we.octPackFloat(Zc)},we.octDecodeFloat=function(e,t){m.defined("value",e);const n=e/256,i=Math.floor(n),o=(n-i)*256;return we.octDecode(i,o,t)},we.octPack=function(e,t,n,i){m.defined("v1",e),m.defined("v2",t),m.defined("v3",n),m.defined("result",i);const o=we.octEncodeFloat(e),s=we.octEncodeFloat(t),a=we.octEncode(n,Zc);return i.x=65536*a.x+o,i.y=65536*a.y+s,i},we.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;we.octDecodeFloat(a,t),we.octDecodeFloat(l,n),we.octDecode(s,c,i)},we.compressTextureCoordinates=function(e){m.defined("textureCoordinates",e);const t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n},we.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 Kc(e){return e>>1^-(e&1)}we.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+=Kc(e[c]),s+=Kc(t[c]),e[c]=o,t[c]=s,h(n)&&(a+=Kc(n[c]),n[c]=a)},we.dequantize=function(e,t,n,i){m.defined("typedArray",e),m.defined("componentDatatype",t),m.defined("type",n),m.defined("count",i);const o=eT.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},we.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 gd=new f,yd=new f,xd=new f;function tT(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,gd),a=f.subtract(i,t,yd),c=f.subtract(e,t,xd),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,gd),a=U.subtract(i,t,yd),c=U.subtract(e,t,xd),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 Qc={};Qc.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)},Qc.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,b){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<b;){if(H[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(H,j,r,b,v,z,G){let W=-1,Z,X=-1,ie=0;for(;ie<r.length;){const se=r[ie];b[se].numLiveTriangles&&(Z=0,v-b[se].timeStamp+2*b[se].numLiveTriangles<=j&&(Z=v-b[se].timeStamp),(Z>X||X===-1)&&(X=Z,W=se)),++ie}return W===-1?s(b,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,T=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 k,V;for(;E!==-1;){D=[],I=g[E],V=I.vertexTriangles.length;for(let H=0;H<V;++H)if(x=I.vertexTriangles[H],!P[x]){P[x]=!0,u=x+x+x;for(let j=0;j<3;++j)k=t[u],D.push(k),A.push(k),M[B]=k,++B,O=g[k],--O.numLiveTriangles,T-O.timeStamp>i&&(O.timeStamp=T,++T),++u}E=a(t,i,D,g,T,A,l)}return M};const He={};function ea(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function nT(e){const t=e.length,n=t/3*6,i=xt.createTypedArray(t,n);let o=0;for(let s=0;s<t;s+=3,o+=6)ea(i,o,e[s],e[s+1],e[s+2]);return i}function iT(e){const t=e.length;if(t>=3){const n=(t-2)*6,i=xt.createTypedArray(t,n);ea(i,0,e[0],e[1],e[2]);let o=6;for(let s=3;s<t;++s,o+=6)ea(i,o,e[s-1],e[s],e[s-2]);return i}return new Uint16Array}function oT(e){if(e.length>0){const t=e.length-1,n=(t-1)*6,i=xt.createTypedArray(t,n),o=e[0];let s=0;for(let a=1;a<t;++a,s+=6)ea(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=nT(t);break;case qe.TRIANGLE_STRIP:e.indices=iT(t);break;case qe.TRIANGLE_FAN:e.indices=oT(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 Pt({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=xt.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 T=y.componentsPerAttribute,D=oe.createTypedArray(y.componentDatatype,u*T);for(;E<t;){const A=i[E];if(A!==-1)for(let O=0;O<T;O++)D[T*A+O]=x[T*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=Qc.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Cd(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 Pt({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function rT(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=Cd(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,rT(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=Cd(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 Ed=new f,sT=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,Ed),g=a.cartesianToCartographic(p,sT);if(!h(g))throw new C(`Could not project point (${p.x}, ${p.y}, ${p.z}) to 2D.`);const y=o.project(g,Ed);l[u++]=y.x,l[u++]=y.y,l[u++]=y.z}return e.attributes[n]=s,e.attributes[i]=new Pt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};const Jc={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],Jc),c[d]=Jc.high,l[d]=Jc.low;const u=o.componentsPerAttribute;return e.attributes[n]=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:c}),e.attributes[i]=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};let Pn=new f;function el(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 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),L.multiplyByVector(e,Pn,Pn),Pn=f.normalize(Pn,Pn),f.pack(Pn,n,o)}}const ta=new N,na=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;el(t,n.position),el(t,n.prevPosition),el(t,n.nextPosition),(h(n.normal)||h(n.tangent)||h(n.bitangent))&&(N.inverse(t,ta),N.transpose(ta,ta),N.getMatrix3(ta,na),tl(na,n.normal),tl(na,n.tangent),tl(na,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 aT(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 Pt({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:oe.createTypedArray(a.componentDatatype,c)}))}return i}const cT=new f;function nl(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=aT(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=xt.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,T=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,cT))+D.radius;A>T&&(T=A)}return new ht({attributes:d,indices:x,primitiveType:u,boundingSphere:h(E)?new K(E,T):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(nl(t,"geometry")),n.length>0&&(o.push(nl(n,"westHemisphereGeometry")),o.push(nl(n,"eastHemisphereGeometry"))),o};const Cn=new f,gr=new f,Bo=new f,No=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],T=t[u+2],D=x*3,A=E*3,O=T*3;gr.x=i[D],gr.y=i[D+1],gr.z=i[D+2],Bo.x=i[A],Bo.y=i[A+1],Bo.z=i[A+2],No.x=i[O],No.y=i[O+1],No.z=i[O+2],a[x].count++,a[E].count++,a[T].count++,f.subtract(Bo,gr,Bo),f.subtract(No,gr,No),c[d]=f.cross(Bo,No,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 Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e};const lT=new f,Td=new f,hT=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],T=n[u+1],D=n[u+2];d=E*3,p=T*3,g=D*3;const A=E*2,O=T*2,I=D*2,B=i[d],M=i[d+1],q=i[d+2],P=s[A],k=s[A+1],V=s[O+1]-k,H=s[I+1]-k,j=1/((s[O]-P)*H-(s[I]-P)*V),r=(H*(i[p]-B)-V*(i[g]-B))*j,b=(H*(i[p+1]-M)-V*(i[g+1]-M))*j,v=(H*(i[p+2]-q)-V*(i[g+2]-q))*j;l[d]+=r,l[d+1]+=b,l[d+2]+=v,l[p]+=r,l[p+1]+=b,l[p+2]+=v,l[g]+=r,l[g+1]+=b,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,lT),T=f.fromArray(l,d,hT),D=f.dot(E,T);f.multiplyByScalar(E,D,Td),f.normalize(f.subtract(T,Td,T),T),y[d]=T.x,y[p]=T.y,y[g]=T.z,f.normalize(f.cross(E,T,T),T),x[d]=T.x,x[p]=T.y,x[g]=T.z}return e.attributes.tangent=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:3,values:x}),e};const yr=new U,Bn=new f,bd=new f,wd=new f;let ia=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}ia=we.octEncodeInRange(Bn,65535,ia),q[P++]=ia.x,q[P++]=ia.y}return e.attributes.compressedAttributes=new Pt({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,yr),I[B++]=we.compressTextureCoordinates(yr));const M=n*3;a&&h(x)&&h(E)?(f.fromArray(g,M,Bn),f.fromArray(x,M,bd),f.fromArray(E,M,wd),we.octPack(Bn,bd,wd,yr),I[B++]=yr.x,I[B++]=yr.y):(a&&(f.fromArray(g,M,Bn),I[B++]=we.octEncodeFloat(Bn)),d&&(f.fromArray(x,M,Bn),I[B++]=we.octEncodeFloat(Bn)),p&&(f.fromArray(E,M,Bn),I[B++]=we.octEncodeFloat(Bn)))}return e.attributes.compressedAttributes=new Pt({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 fT(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=xt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function uT(e){const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");const n=xt.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 dT(e){const t=ht.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");const n=xt.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 pT(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=xt.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function mT(e){const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=xt.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 _T(e){const t=ht.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");const n=xt.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 gT(e){switch(e.primitiveType){case qe.TRIANGLE_FAN:return uT(e);case qe.TRIANGLE_STRIP:return dT(e);case qe.TRIANGLES:return fT(e);case qe.LINE_STRIP:return mT(e);case qe.LINE_LOOP:return _T(e);case qe.LINES:return pT(e)}return e}function Mi(e,t){Math.abs(e.y)<S.EPSILON6&&(t?e.y=-S.EPSILON6:e.y=S.EPSILON6)}function yT(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 Sd=new f;function En(e,t,n,i){f.add(e,f.multiplyByScalar(f.subtract(t,e,Sd),e.y/(e.y-t.y),Sd),n),f.clone(n,i),Mi(n,!0),Mi(i,!1)}const to=new f,no=new f,io=new f,oo=new f,il={positions:new Array(7),indices:new Array(3*3)};function xT(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;yT(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=il.indices;a===1?(c[1]=3,c[2]=4,c[5]=6,c[7]=6,c[8]=5,i?(En(e,t,to,io),En(e,n,no,oo),c[0]=0,c[3]=1,c[4]=2,c[6]=1):o?(En(t,n,to,io),En(t,e,no,oo),c[0]=1,c[3]=2,c[4]=0,c[6]=2):s&&(En(n,e,to,io),En(n,t,no,oo),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,to,io),En(n,t,no,oo),c[0]=0,c[1]=1,c[3]=0,c[6]=2):(En(t,n,to,io),En(t,e,no,oo),c[0]=2,c[1]=0,c[3]=2,c[6]=1):(En(e,t,to,io),En(e,n,no,oo),c[0]=1,c[1]=2,c[3]=1,c[6]=0));const l=il.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(a===1||a===2)&&(l[3]=to,l[4]=no,l[5]=io,l[6]=oo,l.length=7),il}function Ad(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=xt.createTypedArray(i,e.indices),t&&(e.boundingSphere=K.fromVertices(n.position.values)),e}function Fo(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 Pt({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function ol(e,t,n){const i=h(e.geometry.boundingSphere);t=Ad(t,i),n=Ad(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 rl(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 T=e.add(y,x,y);e.add(T,E,T),g&&e.normalize(T,T),e.pack(T,d,p*t)}}const CT=rl(Y,4),oa=rl(f,3),Dd=rl(U,2),ET=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},xr=new f,sl=new f,al=new f,TT=new f;function ra(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 T=f.fromArray(o,e*3,xr),D=f.fromArray(o,t*3,sl),A=f.fromArray(o,n*3,al),O=tT(i,T,D,A,TT);if(h(O)){if(h(s)&&oa(e,t,n,O,s,p.normal.values,E,!0),h(u)){const I=f.fromArray(u,e*3,xr),B=f.fromArray(u,t*3,sl),M=f.fromArray(u,n*3,al);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=xr,q.x=0,q.y=0,q.z=0),f.pack(q,p.extrudeDirection.values,E*3)}if(h(d)&&ET(e,t,n,O,d,p.applyOffset.values,E),h(a)&&oa(e,t,n,O,a,p.tangent.values,E,!0),h(c)&&oa(e,t,n,O,c,p.bitangent.values,E,!0),h(l)&&Dd(e,t,n,O,l,p.st.values,E),y>0)for(let I=0;I<y;I++){const B=g[I];bT(e,t,n,O,E,x[B],p[B])}}}function bT(e,t,n,i,o,s,a){const c=s.componentsPerAttribute,l=s.values,u=a.values;switch(c){case 4:CT(e,t,n,i,l,u,o,!1);break;case 3:oa(e,t,n,i,l,u,o,!1);break;case 2:Dd(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 wT={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Od(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)&&!wT[q]&&h(n[q])&&p.push(q);const g=p.length,y=Fo(t),x=Fo(t);let E,T,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],k=d[O+2];let V=f.fromArray(i,q*3),H=f.fromArray(i,P*3),j=f.fromArray(i,k*3);const r=xT(V,H,j);if(h(r)&&r.positions.length>3){const b=r.positions,v=r.indices,z=v.length;for(let G=0;G<z;++G){const W=v[G],Z=b[W];Z.y<0?(E=x.attributes,T=x.indices,D=I):(E=y.attributes,T=y.indices,D=B),A=Qn(E,T,D,d,W<3?O+W:-1,Z),ra(q,P,k,Z,i,o,a,s,c,l,u,E,p,g,n,A)}}else h(r)&&(V=r.positions[0],H=r.positions[1],j=r.positions[2]),V.y<0?(E=x.attributes,T=x.indices,D=I):(E=y.attributes,T=y.indices,D=B),A=Qn(E,T,D,d,O,V),ra(q,P,k,V,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,T,D,d,O+1,H),ra(q,P,k,H,i,o,a,s,c,l,u,E,p,g,n,A),A=Qn(E,T,D,d,O+2,j),ra(q,P,k,j,i,o,a,s,c,l,u,E,p,g,n,A)}ol(e,x,y)}const vd=Ne.fromPointNormal(f.ZERO,f.UNIT_Y),ST=new f,AT=new f;function Lo(e,t,n,i,o,s,a){if(!h(a))return;const c=f.fromArray(i,e*3,xr);f.equalsEpsilon(c,n,S.EPSILON10)?s.applyOffset.values[o]=a[e]:s.applyOffset.values[o]=a[t]}function Id(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=Fo(t),c=Fo(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,xr),E=f.fromArray(i,y*3,sl);let T;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,vd,al);if(h(q)){const P=f.multiplyByScalar(f.UNIT_Y,5*S.EPSILON9,ST);x.y<0&&(f.negate(P,P),D=c.attributes,A=c.indices,O=d,I=a.attributes,B=a.indices,M=p);const k=f.add(q,P,AT);T=Qn(D,A,O,s,l,x),Lo(g,y,x,i,T,D,o),T=Qn(D,A,O,s,-1,k),Lo(g,y,k,i,T,D,o),f.negate(P,P),f.add(q,P,k),T=Qn(I,B,M,s,-1,k),Lo(g,y,k,i,T,I,o),T=Qn(I,B,M,s,l+1,E),Lo(g,y,E,i,T,I,o)}else{let P,k,V;x.y<0?(P=c.attributes,k=c.indices,V=d):(P=a.attributes,k=a.indices,V=p),T=Qn(P,k,V,s,l,x),Lo(g,y,x,i,T,P,o),T=Qn(P,k,V,s,l+1,E),Lo(g,y,E,i,T,P,o)}}ol(e,c,a)}const Rd=new U,DT=new U,zd=new f,Pd=new f,cl=new f,OT=new f,vT=new f,IT=new f,Bd=new Y;function Nd(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,zd);if(c.x>0)continue;const l=f.unpack(i,a,Pd);(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,cl);(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 RT=5*S.EPSILON9,sa=S.EPSILON6;function zT(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=Fo(t),d=Fo(t);let p,g,y,x=!1;const E=i.length/3;for(p=0;p<E;p+=4){const T=p,D=p+2,A=f.fromArray(i,T*3,zd),O=f.fromArray(i,D*3,Pd);if(Math.abs(A.y)<sa)for(A.y=sa*(O.y<0?-1:1),i[p*3+1]=A.y,i[(p+1)*3+1]=A.y,g=T*3;g<T*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)<sa)for(O.y=sa*(A.y<0?-1:1),i[(p+2)*3+1]=O.y,i[(p+3)*3+1]=O.y,g=T*3;g<T*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,vd,OT);if(h(P)){x=!0;const k=f.multiplyByScalar(f.UNIT_Y,RT,vT);A.y<0&&(f.negate(k,k),I=d.attributes,B=d.indices,M=u.attributes,q=u.indices);const V=f.add(P,k,IT);I.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.position.values.push(V.x,V.y,V.z),I.position.values.push(V.x,V.y,V.z),I.prevPosition.values.push(o[T*3],o[T*3+1],o[T*3+2]),I.prevPosition.values.push(o[T*3+3],o[T*3+4],o[T*3+5]),I.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),I.nextPosition.values.push(V.x,V.y,V.z),I.nextPosition.values.push(V.x,V.y,V.z),I.nextPosition.values.push(V.x,V.y,V.z),I.nextPosition.values.push(V.x,V.y,V.z),f.negate(k,k),f.add(P,k,V),M.position.values.push(V.x,V.y,V.z),M.position.values.push(V.x,V.y,V.z),M.position.values.push(O.x,O.y,O.z,O.x,O.y,O.z),M.prevPosition.values.push(V.x,V.y,V.z),M.prevPosition.values.push(V.x,V.y,V.z),M.prevPosition.values.push(V.x,V.y,V.z),M.prevPosition.values.push(V.x,V.y,V.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,T*2,Rd),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,cl));if(r/=f.magnitudeSquared(f.subtract(O,A,cl)),h(l)){const b=Y.fromArray(l,T*4,Bd),v=Y.fromArray(l,D*4,Bd),z=S.lerp(b.x,v.x,r),G=S.lerp(b.y,v.y,r),W=S.lerp(b.z,v.z,r),Z=S.lerp(b.w,v.w,r);for(g=T*4;g<T*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 b=U.fromArray(c,T*2,Rd),v=U.fromArray(c,(p+3)*2,DT),z=S.lerp(b.x,v.x,r);for(g=T*2;g<T*2+2*2;++g)I.st.values.push(c[g]);for(I.st.values.push(z,b.y),I.st.values.push(z,v.y),M.st.values.push(z,b.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 k,V;for(A.y<0?(k=d.attributes,V=d.indices):(k=u.attributes,V=u.indices),k.position.values.push(A.x,A.y,A.z),k.position.values.push(A.x,A.y,A.z),k.position.values.push(O.x,O.y,O.z),k.position.values.push(O.x,O.y,O.z),g=p*3;g<p*3+4*3;++g)k.prevPosition.values.push(o[g]),k.nextPosition.values.push(s[g]);for(g=p*2;g<p*2+4*2;++g)k.expandAndWidth.values.push(a[g]),h(c)&&k.st.values.push(c[g]);if(h(l))for(g=p*4;g<p*4+4*4;++g)k.color.values.push(l[g]);y=k.position.values.length/3-4,V.push(y,y+2,y+1),V.push(y+1,y+2,y+3)}}x&&(Nd(d),Nd(u)),ol(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)!==Ct.INTERSECTING))return e;if(t.geometryType!==rr.NONE)switch(t.geometryType){case rr.POLYLINES:zT(e);break;case rr.TRIANGLES:Od(e);break;case rr.LINES:Id(e);break}else gT(t),t.primitiveType===qe.TRIANGLES?Od(e):t.primitiveType===qe.LINES&&Id(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 PT(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 ll(e,t){const n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Pt({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 BT(e){const t=e.length;for(let n=0;n<t;++n){const i=e[n];h(i.geometry)?ll(i.geometry,n):h(i.westHemisphereGeometry)&&h(i.eastHemisphereGeometry)&&(ll(i.westHemisphereGeometry,n),ll(i.eastHemisphereGeometry,n))}}function NT(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(PT(t,c,o),!o)for(l=0;l<p;++l)h(t[l].geometry)&&He.splitLongitude(t[l]);if(BT(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`,T=`${x}2D`;He.projectTo2D(u,x,E,T,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,T,`${T}High`,`${T}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 hl(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 FT(e,t){const n=[];return hl(e,"geometry",t,n),hl(e,"westHemisphereGeometry",t,n),hl(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=NT(e),t.length>0&&(n=He.createAttributeLocations(t[0]),e.createPickOffsets&&(s=FT(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 LT(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 MT(e,t){const n=e.length;for(let i=0;i<n;++i)LT(e[i],t)}function UT(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(UT(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 T=y[E],D=g[T];n[a++]=o[T],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,T,D;const A=new Ru,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++],T=oe.createTypedArray(M,E);for(let P=0;P<E;P++)T[P]=n[a++];A[B]=new Pt({componentDatatype:M,componentsPerAttribute:D,normalize:q,values:T})}let I;if(E=n[a++],E>0){const B=T.length/D;for(I=xt.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 VT(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 kT(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 cr(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:VT(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=kT(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 Fd(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 Ld(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)&&MT(e.geometries,t);const n=Fd(e.boundingSpheres),i=Fd(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:Ld(e.boundingSpheres),boundingSpheresCV:Ld(e.boundingSpheresCV)}};const wt=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 aa=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,aa.DISABLED),this._translucent=void 0,this._state=wt.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 GT(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 qT=new U,HT=new f,Md=new Y;function Ud(e){const t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,qT);if(t===3)return f.unpack(e,0,HT);if(t===4)return Y.unpack(e,0,Md)}function WT(e,t){const n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;const s=GT(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 T=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=Ud(E.value),k=l[x];D.setBatchedAttribute(y,k,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=Md;M.x=w.floatToByte(B.red),M.y=w.floatToByte(B.green),M.z=w.floatToByte(B.blue),M.w=w.floatToByte(B.alpha),D.setBatchedAttribute(y,T-1,M)}e._batchTable=D,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=d}function jT(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Pt({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function YT(e){const t=e.attributes,n=new Ru;for(const o in t)t.hasOwnProperty(o)&&h(t[o])&&(n[o]=jT(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 XT(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}const $T=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Oe._modifyShaderPosition=function(e,t,n){let i,o="",s="",a="";for(;(i=$T.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}
|
|
@@ -4693,19 +4693,19 @@ in vec3 ${c}2DLow;
|
|
|
4693
4693
|
}
|
|
4694
4694
|
|
|
4695
4695
|
`)}return[o,s,t,a].join(`
|
|
4696
|
-
`)},
|
|
4696
|
+
`)},Oe._appendShowToShader=function(e,t){return h(e._batchTableAttributeIndices.show)?`${ye.replaceMain(t,"czm_non_show_main")}
|
|
4697
4697
|
void main()
|
|
4698
4698
|
{
|
|
4699
4699
|
czm_non_show_main();
|
|
4700
4700
|
gl_Position *= czm_batchTable_show(batchId);
|
|
4701
|
-
}`:t},
|
|
4701
|
+
}`:t},Oe._updateColorAttribute=function(e,t,n){if(!h(e._batchTableAttributeIndices.color)&&!h(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;if(n&&!h(e._batchTableAttributeIndices.depthFailColor))throw new C("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Vd(e){return`${ye.replaceMain(e,"czm_non_pick_main")}
|
|
4702
4702
|
out vec4 v_pickColor;
|
|
4703
4703
|
void main()
|
|
4704
4704
|
{
|
|
4705
4705
|
czm_non_pick_main();
|
|
4706
4706
|
v_pickColor = czm_batchTable_pickColor(batchId);
|
|
4707
|
-
}`}function
|
|
4708
|
-
${e}`}
|
|
4707
|
+
}`}function kd(e){return`in vec4 v_pickColor;
|
|
4708
|
+
${e}`}Oe._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t},Oe._appendOffsetToShader=function(e,t){if(!h(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
|
|
4709
4709
|
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
|
|
4710
4710
|
`;return o+=` if (czm_sceneMode == czm_sceneMode3D)
|
|
4711
4711
|
`,o+=` {
|
|
@@ -4713,7 +4713,7 @@ ${e}`}De._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick
|
|
|
4713
4713
|
`,o+=` else
|
|
4714
4714
|
`,o+=` {
|
|
4715
4715
|
`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` }
|
|
4716
|
-
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i},
|
|
4716
|
+
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i},Oe._appendDistanceDisplayConditionToShader=function(e,t,n){if(!h(e._batchTableAttributeIndices.distanceDisplayCondition))return t;const i=ye.replaceMain(t,"czm_non_distanceDisplayCondition_main");let o=`void main()
|
|
4717
4717
|
{
|
|
4718
4718
|
czm_non_distanceDisplayCondition_main();
|
|
4719
4719
|
vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
|
|
@@ -4755,7 +4755,7 @@ ${e}`}De._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick
|
|
|
4755
4755
|
float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
|
|
4756
4756
|
gl_Position *= show;
|
|
4757
4757
|
}`,`${i}
|
|
4758
|
-
${o}`};function
|
|
4758
|
+
${o}`};function Gd(e,t){if(!e.compressVertices)return t;const n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;const o=t.search(/in\s+vec3\s+tangent;/g)!==-1,s=t.search(/in\s+vec3\s+bitangent;/g)!==-1;let a=i&&n?2:1;a+=o||s?1:0;const c=a>1?`vec${a}`:"float",l="compressedAttributes",u=`in ${c} ${l};`;let d="",p="";if(i){d+=`vec2 st;
|
|
4759
4759
|
`;const x=a>1?`${l}.x`:l;p+=` st = czm_decompressTextureCoordinates(${x});
|
|
4760
4760
|
`}n&&o&&s?(d+=`vec3 normal;
|
|
4761
4761
|
vec3 tangent;
|
|
@@ -4767,14 +4767,14 @@ vec3 bitangent;
|
|
|
4767
4767
|
`,p+=` tangent = czm_octDecode(${l}.${i&&n?"z":"y"});
|
|
4768
4768
|
`),s&&(d+=`vec3 bitangent;
|
|
4769
4769
|
`,p+=` bitangent = czm_octDecode(${l}.${i&&n?"z":"y"});
|
|
4770
|
-
`));let g=t;g=g.replace(/in\s+vec3\s+normal;/g,""),g=g.replace(/in\s+vec2\s+st;/g,""),g=g.replace(/in\s+vec3\s+tangent;/g,""),g=g.replace(/in\s+vec3\s+bitangent;/g,""),g=
|
|
4770
|
+
`));let g=t;g=g.replace(/in\s+vec3\s+normal;/g,""),g=g.replace(/in\s+vec2\s+st;/g,""),g=g.replace(/in\s+vec3\s+tangent;/g,""),g=g.replace(/in\s+vec3\s+bitangent;/g,""),g=ye.replaceMain(g,"czm_non_compressed_main");const y=`void main()
|
|
4771
4771
|
{
|
|
4772
4772
|
${p} czm_non_compressed_main();
|
|
4773
4773
|
}`;return[u,d,g,y].join(`
|
|
4774
|
-
`)}function
|
|
4774
|
+
`)}function ZT(e){let t=ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
|
|
4775
4775
|
czm_non_depth_clamp_main();
|
|
4776
4776
|
gl_Position = czm_depthClamp(gl_Position);}
|
|
4777
|
-
`,t}function
|
|
4777
|
+
`,t}function KT(e){let t=ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
|
|
4778
4778
|
czm_non_depth_clamp_main();
|
|
4779
4779
|
#if defined(LOG_DEPTH)
|
|
4780
4780
|
czm_writeLogDepth();
|
|
@@ -4782,7 +4782,7 @@ ${p} czm_non_compressed_main();
|
|
|
4782
4782
|
czm_writeDepthClamp();
|
|
4783
4783
|
#endif
|
|
4784
4784
|
}
|
|
4785
|
-
`,t}function Gd(e,t){const n=e.vertexAttributes;for(const i in n)if(n.hasOwnProperty(i)&&!h(t[i]))throw new C(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function KT(e,t){return function(){return e[t]}}const cl=Math.max(mt.hardwareConcurrency-1,1);let ra;const QT=new Et("combineGeometry");function JT(e,t){let n,i,o,s;const a=e._instanceIds;if(e._state===wt.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const c=e._numberOfInstances=n.length,l=[];let u=[];for(o=0;o<c;++o){if(i=n[o].geometry,a.push(n[o].id),h(i._workerName)&&h(i._workerPath)||!h(i._workerName)&&!h(i._workerPath))throw new C("Must define either _workerName or _workerPath for asynchronous geometry.");u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!h(ra))for(ra=new Array(cl),o=0;o<cl;o++)ra[o]=new Et("createGeometry");let d;for(u=UE(u,cl),o=0;o<u.length;o++){let p=0;const g=u[o],y=g.length;for(s=0;s<y;++s)d=g[s],i=d.geometry,h(i.constructor.pack)&&(d.offset=p,p+=_(i.constructor.packedLength,i.packedLength));let x;if(p>0){const E=new Float64Array(p);for(x=[E.buffer],s=0;s<y;++s)d=g[s],i=d.geometry,h(i.constructor.pack)&&(i.constructor.pack(i,E,d.offset),d.geometry=E)}l.push(ra[o].scheduleTask({subTasks:u[o]},x))}e._state=wt.CREATING,Promise.all(l).then(function(p){e._createGeometryResults=p,e._state=wt.CREATED}).catch(function(p){Cr(e,t,wt.FAILED,p)})}else if(e._state===wt.CREATED){const c=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const l=t.scene3DOnly,u=t.mapProjection,d=QT.scheduleTask(Nn.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},c),c);e._createGeometryResults=void 0,e._state=wt.COMBINING,Promise.resolve(d).then(function(p){const g=Nn.unpackCombineGeometryResults(p);e._geometries=g.geometries,e._attributeLocations=g.attributeLocations,e.modelMatrix=N.clone(g.modelMatrix,e.modelMatrix),e._pickOffsets=g.pickOffsets,e._offsetInstanceExtend=g.offsetInstanceExtend,e._instanceBoundingSpheres=g.boundingSpheres,e._instanceBoundingSpheresCV=g.boundingSpheresCV,h(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=wt.COMBINED):Cr(e,t,wt.FAILED,void 0)}).catch(function(p){Cr(e,t,wt.FAILED,p)})}}function eb(e,t){const n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),s=e._instanceIds;let a,c,l=0;for(c=0;c<i;c++){a=n[c];const g=a.geometry;let y;h(g.attributes)&&h(g.primitiveType)?y=jT(g):y=g.constructor.createGeometry(g),o[l++]=YT(a,y),s.push(a.id)}o.length=l;const u=t.scene3DOnly,d=t.mapProjection,p=Nn.combineGeometry({instances:o,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,h(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=wt.COMBINED):Cr(e,t,wt.FAILED,void 0)}function tb(e,t){const n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!h(n)){e._recomputeBoundingSpheres=!1;return}let i;const o=e._offsetInstanceExtend,s=e._instanceBoundingSpheres,a=s.length;let c=e._tempBoundingSpheres;if(!h(c)){for(c=new Array(a),i=0;i<a;i++)c[i]=new K;e._tempBoundingSpheres=c}for(i=0;i<a;++i){let E=c[i];const T=e._batchTable.getBatchedAttribute(i,n,new f);E=s[i].clone(E),Kd(E,T,o[i])}const l=[],u=[],d=[];for(i=0;i<a;++i){const E=c[i];E.center.x-E.radius>0||K.intersectPlane(E,Be.ORIGIN_ZX_PLANE)!==Ct.INTERSECTING?l.push(E):(u.push(E),d.push(E))}let p=l[0],g=d[0],y=u[0];for(i=1;i<l.length;i++)p=K.union(p,l[i]);for(i=1;i<d.length;i++)g=K.union(g,d[i]);for(i=1;i<u.length;i++)y=K.union(y,u[i]);const x=[];for(h(p)&&x.push(p),h(g)&&x.push(g),h(y)&&x.push(y),i=0;i<x.length;i++){const E=x[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=E,e._boundingSphereCV[i]=K.projectTo2D(E,t.mapProjection,e._boundingSphereCV[i])}De._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}const Hd=new je,Wd=new ee,jd=new f,Yd=new K;function nb(e,t){if(!h(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;const i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,s=i.center3DLow,a=i.center2DHigh,c=i.center2DLow,l=i.radius,u=t.mapProjection,d=u.ellipsoid,p=e._batchTable,g=e._instanceBoundingSpheres,y=g.length;for(let x=0;x<y;++x){let E=g[x];if(!h(E))continue;const T=e.modelMatrix;h(T)&&(E=K.transform(E,T,Yd));const D=E.center,A=E.radius;let O=je.fromCartesian(D,Hd);if(p.setBatchedAttribute(x,o,O.high),p.setBatchedAttribute(x,s,O.low),!t.scene3DOnly){const I=d.cartesianToCartographic(D,Wd),B=u.project(I,jd);O=je.fromCartesian(B,Hd),p.setBatchedAttribute(x,a,O.high),p.setBatchedAttribute(x,c,O.low)}p.setBatchedAttribute(x,l,A)}e._batchTableBoundingSpheresUpdated=!0}const ll=new f,ib=new f;function Xd(e,t){if(!h(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;const i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,s=o.ellipsoid,a=e._batchTable,c=e._instanceBoundingSpheres,l=c.length;for(let u=0;u<l;++u){let d=c[u];if(!h(d))continue;const p=a.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(f.equals(p,f.ZERO)){a.setBatchedAttribute(u,i,f.ZERO);continue}const g=e.modelMatrix;h(g)&&(d=K.transform(d,g,Yd));let y=d.center;y=s.scaleToGeodeticSurface(y,ib);let x=s.cartesianToCartographic(y,Wd);const E=o.project(x,jd),T=f.add(p,y,ll);x=s.cartesianToCartographic(T,x);const D=o.project(x,ll),A=f.subtract(D,E,ll),O=A.x;A.x=A.z,A.z=A.y,A.y=O,a.setBatchedAttribute(u,i,A)}e._batchTableOffsetsUpdated=!0}function ob(e,t){const n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,s=t.context,a=[],c=i.length;for(let l=0;l<c;++l){const u=i[l];if(a.push(Xn.fromGeometry({context:s,geometry:u,attributeLocations:n,bufferUsage:Ae.STATIC_DRAW,interleave:e._interleave})),h(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(K.clone(u.boundingSphere)),e._boundingSphereWC.push(new K),!o){const d=u.boundingSphereCV.center,p=d.x,g=d.y,y=d.z;d.x=y,d.y=p,d.z=g,e._boundingSphereCV.push(K.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new K),e._boundingSphereMorph.push(new K)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Cr(e,t,wt.COMPLETE,void 0)}function rb(e,t,n,i){let o=n.getRenderState(),s;i?(s=tn(o,!1),s.cull={enabled:!0,face:Ro.BACK},e._frontFaceRS=ke.fromCache(s),s.cull.face=Ro.FRONT,e._backFaceRS=ke.fromCache(s)):(e._frontFaceRS=ke.fromCache(o),e._backFaceRS=e._frontFaceRS),s=tn(o,!1),h(e._depthFailAppearance)&&(s.depthTest.enabled=!1),h(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),s=tn(o,!1),s.depthTest.func=fd.GREATER,i?(s.cull={enabled:!0,face:Ro.BACK},e._frontFaceDepthFailRS=ke.fromCache(s),s.cull.face=Ro.FRONT,e._backFaceDepthFailRS=ke.fromCache(s)):(e._frontFaceDepthFailRS=ke.fromCache(s),e._backFaceDepthFailRS=e._frontFaceRS))}function sb(e,t,n){const i=t.context,o=e._attributeLocations;let s=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);s=De._appendOffsetToShader(e,s),s=De._appendShowToShader(e,s),s=De._appendDistanceDisplayConditionToShader(e,s,t.scene3DOnly),s=kd(s),s=De._updateColorAttribute(e,s,!1),s=qd(e,s),s=De._modifyShaderPosition(e,s,t.scene3DOnly);let a=n.getFragmentShaderSource();a=Vd(a),e._sp=ot.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:o}),Gd(e._sp,o),h(e._depthFailAppearance)&&(s=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),s=De._appendShowToShader(e,s),s=De._appendDistanceDisplayConditionToShader(e,s,t.scene3DOnly),s=kd(s),s=De._updateColorAttribute(e,s,!0),s=qd(e,s),s=De._modifyShaderPosition(e,s,t.scene3DOnly),s=$T(s),a=e._depthFailAppearance.getFragmentShaderSource(),a=Vd(a),a=ZT(a),e._spDepthFail=ot.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:o}),Gd(e._spDepthFail,o))}const xr=new N,$d=new f;function Zd(e,t,n,i){const o=h(n)?n._uniforms:void 0,s={},a=t.uniforms;if(h(a)){for(const l in a)if(a.hasOwnProperty(l)){if(h(o)&&h(o[l]))throw new C(`Appearance and material have a uniform with the same name: ${l}`);s[l]=KT(a,l)}}let c=nn(s,o);return c=e._batchTable.getUniformMapCallback()(c),h(e.rtcCenter)&&(c.u_modifiedModelView=function(){const l=i.context.uniformState.view;return N.multiply(l,e._modelMatrix,xr),N.multiplyByPoint(xr,e.rtcCenter,$d),N.setTranslation(xr,$d,xr),xr}),c}function ab(e,t,n,i,o,s,a,c){const l=Zd(e,t,n,c);let u;h(e._depthFailAppearance)&&(u=Zd(e,e._depthFailAppearance,e._depthFailAppearance.material,c));const d=i?zt.TRANSLUCENT:zt.OPAQUE;let p=o?2:1;p*=h(e._depthFailAppearance)?2:1,s.length=e._va.length*p;const g=s.length;let y=0;for(let x=0;x<g;++x){let E;o&&(E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._backFaceRS,E.shaderProgram=e._sp,E.uniformMap=l,E.pass=d,++x),E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._frontFaceRS,E.shaderProgram=e._sp,E.uniformMap=l,E.pass=d,h(e._depthFailAppearance)&&(o&&(++x,E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._backFaceDepthFailRS,E.shaderProgram=e._spDepthFail,E.uniformMap=u,E.pass=d),++x,E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._frontFaceDepthFailRS,E.shaderProgram=e._spDepthFail,E.uniformMap=u,E.pass=d),++y}}De._updateBoundingVolumes=function(e,t,n,i){let o,s,a;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),s=e._boundingSpheres.length,o=0;o<s;++o)a=e._boundingSpheres[o],h(a)&&(e._boundingSphereWC[o]=K.transform(a,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=K.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=K.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));const c=e.appearance.pixelSize;if(h(c))for(s=e._boundingSpheres.length,o=0;o<s;++o){a=e._boundingSpheres[o];const l=e._boundingSphereWC[o],d=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*c;l.radius=a.radius+d}};function cb(e,t,n,i,o,s,a,c){if(t.mode!==pe.SCENE3D&&!N.equals(o,N.IDENTITY))throw new C("Primitive.modelMatrix is only supported in 3D mode.");De._updateBoundingVolumes(e,t,o);let l;t.mode===pe.SCENE3D?l=e._boundingSphereWC:t.mode===pe.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===pe.SCENE2D&&h(e._boundingSphere2D)?l=e._boundingSphere2D:h(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);const u=t.commandList,d=t.passes;if(d.render||d.pick){const p=e.allowPicking,g=oa.castShadows(e.shadows),y=oa.receiveShadows(e.shadows),x=n.length;let E=c?2:1;E*=h(e._depthFailAppearance)?2:1;for(let T=0;T<x;++T){const D=Math.floor(T/E),A=n[T];A.modelMatrix=o,A.boundingVolume=l[D],A.cull=s,A.debugShowBoundingVolume=a,A.castShadows=g,A.receiveShadows=y,p?A.pickId="v_pickColor":A.pickId=void 0,u.push(A)}}}De.prototype.update=function(e){if(!h(this.geometryInstances)&&this._va.length===0||h(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!h(this.appearance)||e.mode!==pe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(h(this._error))throw this._error;if(h(this.rtcCenter)&&!e.scene3DOnly)throw new C("RTC rendering is only available for 3D only scenes.");if(this._state===wt.FAILED)return;const t=e.context;if(h(this._batchTable)||HT(this,t),this._batchTable.attributes.length>0){if(Ce.maximumVertexTextureImageUnits===0)throw new at("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==wt.COMPLETE&&this._state!==wt.COMBINED&&(this.asynchronous?JT(this,e):eb(this,e)),this._state===wt.COMBINED&&(nb(this,e),Xd(this,e),ob(this,e)),!this.show||this._state!==wt.COMPLETE)return;this._batchTableOffsetsUpdated||Xd(this,e),this._recomputeBoundingSpheres&&tb(this,e);const n=this.appearance,i=n.material;let o=!1,s=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,s=!0):this._material!==i&&(this._material=i,s=!0);const a=this.depthFailAppearance,c=h(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=c,o=!0,s=!0):this._depthFailMaterial!==c&&(this._depthFailMaterial=c,s=!0);const l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),h(this._material)&&this._material.update(t);const u=n.closed&&l;o&&_(this._createRenderStatesFunction,rb)(this,t,n,u),s&&_(this._createShaderProgramFunction,sb)(this,e,n),(o||s)&&_(this._createCommandsFunction,ab)(this,n,i,l,u,this._colorCommands,this._pickCommands,e),_(this._updateAndQueueCommandsFunction,cb)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};const lb=new K,hb=new K;function Kd(e,t,n){if(n===zu.TOP){const i=K.clone(e,lb),o=K.clone(e,hb);o.center=f.add(o.center,t,o.center),e=K.union(i,o,e)}else n===zu.ALL&&(e.center=f.add(e.center,t,e.center));return e}function fb(e,t,n){return function(){const i=e.getBatchedAttribute(t,n),o=e.attributes[n],s=o.componentsPerAttribute,a=oe.createTypedArray(o.componentDatatype,s);return h(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function ub(e,t,n,i,o){return function(s){if(!h(s)||!h(s.length)||s.length<1||s.length>4)throw new C("value must be and array with length between 1 and 4.");const a=Ud(s);e.setBatchedAttribute(t,n,a),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}const db=new f;function pb(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(h(i)){i=i.clone();const o=e.modelMatrix,s=t.offset;h(s)&&Kd(i,f.fromArray(s.get(),0,db),e._offsetInstanceExtend[n]),h(o)&&(i=K.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function mb(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}De.prototype.getGeometryInstanceAttributes=function(e){if(!h(e))throw new C("id is required");if(!h(this._batchTable))throw new C("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(h(t))return t;let n=-1;const i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,s=o.length;for(let u=0;u<s;++u){const d=(i+u)%s;if(e===o[d]){n=d;break}}if(n===-1)return;const a=this._batchTable,c=this._batchTableAttributeIndices;t={};const l={};for(const u in c)if(c.hasOwnProperty(u)){const d=c[u];l[u]={get:fb(a,n,d),set:ub(a,n,d,this,u)}}return pb(this,l,n),mb(this,l,n),Object.defineProperties(t,l),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t},De.prototype.isDestroyed=function(){return!1},De.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();const n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;const i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,Qe(this)};function Cr(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===wt.COMPLETE||e._state===wt.FAILED})}function Ln(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.value))throw new C("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=_(e.normalize,!1),this.value=e.value}const Qd=`#ifdef TEXTURE_COORDINATES
|
|
4785
|
+
`,t}function qd(e,t){const n=e.vertexAttributes;for(const i in n)if(n.hasOwnProperty(i)&&!h(t[i]))throw new C(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function QT(e,t){return function(){return e[t]}}const fl=Math.max(mt.hardwareConcurrency-1,1);let ca;const JT=new Et("combineGeometry");function eb(e,t){let n,i,o,s;const a=e._instanceIds;if(e._state===wt.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const c=e._numberOfInstances=n.length,l=[];let u=[];for(o=0;o<c;++o){if(i=n[o].geometry,a.push(n[o].id),h(i._workerName)&&h(i._workerPath)||!h(i._workerName)&&!h(i._workerPath))throw new C("Must define either _workerName or _workerPath for asynchronous geometry.");u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!h(ca))for(ca=new Array(fl),o=0;o<fl;o++)ca[o]=new Et("createGeometry");let d;for(u=VE(u,fl),o=0;o<u.length;o++){let p=0;const g=u[o],y=g.length;for(s=0;s<y;++s)d=g[s],i=d.geometry,h(i.constructor.pack)&&(d.offset=p,p+=_(i.constructor.packedLength,i.packedLength));let x;if(p>0){const E=new Float64Array(p);for(x=[E.buffer],s=0;s<y;++s)d=g[s],i=d.geometry,h(i.constructor.pack)&&(i.constructor.pack(i,E,d.offset),d.geometry=E)}l.push(ca[o].scheduleTask({subTasks:u[o]},x))}e._state=wt.CREATING,Promise.all(l).then(function(p){e._createGeometryResults=p,e._state=wt.CREATED}).catch(function(p){Er(e,t,wt.FAILED,p)})}else if(e._state===wt.CREATED){const c=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];const l=t.scene3DOnly,u=t.mapProjection,d=JT.scheduleTask(Nn.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},c),c);e._createGeometryResults=void 0,e._state=wt.COMBINING,Promise.resolve(d).then(function(p){const g=Nn.unpackCombineGeometryResults(p);e._geometries=g.geometries,e._attributeLocations=g.attributeLocations,e.modelMatrix=N.clone(g.modelMatrix,e.modelMatrix),e._pickOffsets=g.pickOffsets,e._offsetInstanceExtend=g.offsetInstanceExtend,e._instanceBoundingSpheres=g.boundingSpheres,e._instanceBoundingSpheresCV=g.boundingSpheresCV,h(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=wt.COMBINED):Er(e,t,wt.FAILED,void 0)}).catch(function(p){Er(e,t,wt.FAILED,p)})}}function tb(e,t){const n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),s=e._instanceIds;let a,c,l=0;for(c=0;c<i;c++){a=n[c];const g=a.geometry;let y;h(g.attributes)&&h(g.primitiveType)?y=YT(g):y=g.constructor.createGeometry(g),o[l++]=XT(a,y),s.push(a.id)}o.length=l;const u=t.scene3DOnly,d=t.mapProjection,p=Nn.combineGeometry({instances:o,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,h(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=wt.COMBINED):Er(e,t,wt.FAILED,void 0)}function nb(e,t){const n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!h(n)){e._recomputeBoundingSpheres=!1;return}let i;const o=e._offsetInstanceExtend,s=e._instanceBoundingSpheres,a=s.length;let c=e._tempBoundingSpheres;if(!h(c)){for(c=new Array(a),i=0;i<a;i++)c[i]=new K;e._tempBoundingSpheres=c}for(i=0;i<a;++i){let E=c[i];const T=e._batchTable.getBatchedAttribute(i,n,new f);E=s[i].clone(E),Kd(E,T,o[i])}const l=[],u=[],d=[];for(i=0;i<a;++i){const E=c[i];E.center.x-E.radius>0||K.intersectPlane(E,Ne.ORIGIN_ZX_PLANE)!==Ct.INTERSECTING?l.push(E):(u.push(E),d.push(E))}let p=l[0],g=d[0],y=u[0];for(i=1;i<l.length;i++)p=K.union(p,l[i]);for(i=1;i<d.length;i++)g=K.union(g,d[i]);for(i=1;i<u.length;i++)y=K.union(y,u[i]);const x=[];for(h(p)&&x.push(p),h(g)&&x.push(g),h(y)&&x.push(y),i=0;i<x.length;i++){const E=x[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=E,e._boundingSphereCV[i]=K.projectTo2D(E,t.mapProjection,e._boundingSphereCV[i])}Oe._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}const Hd=new Ye,Wd=new ee,jd=new f,Yd=new K;function ib(e,t){if(!h(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;const i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,s=i.center3DLow,a=i.center2DHigh,c=i.center2DLow,l=i.radius,u=t.mapProjection,d=u.ellipsoid,p=e._batchTable,g=e._instanceBoundingSpheres,y=g.length;for(let x=0;x<y;++x){let E=g[x];if(!h(E))continue;const T=e.modelMatrix;h(T)&&(E=K.transform(E,T,Yd));const D=E.center,A=E.radius;let O=Ye.fromCartesian(D,Hd);if(p.setBatchedAttribute(x,o,O.high),p.setBatchedAttribute(x,s,O.low),!t.scene3DOnly){const I=d.cartesianToCartographic(D,Wd),B=u.project(I,jd);O=Ye.fromCartesian(B,Hd),p.setBatchedAttribute(x,a,O.high),p.setBatchedAttribute(x,c,O.low)}p.setBatchedAttribute(x,l,A)}e._batchTableBoundingSpheresUpdated=!0}const ul=new f,ob=new f;function Xd(e,t){if(!h(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;const i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,s=o.ellipsoid,a=e._batchTable,c=e._instanceBoundingSpheres,l=c.length;for(let u=0;u<l;++u){let d=c[u];if(!h(d))continue;const p=a.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(f.equals(p,f.ZERO)){a.setBatchedAttribute(u,i,f.ZERO);continue}const g=e.modelMatrix;h(g)&&(d=K.transform(d,g,Yd));let y=d.center;y=s.scaleToGeodeticSurface(y,ob);let x=s.cartesianToCartographic(y,Wd);const E=o.project(x,jd),T=f.add(p,y,ul);x=s.cartesianToCartographic(T,x);const D=o.project(x,ul),A=f.subtract(D,E,ul),O=A.x;A.x=A.z,A.z=A.y,A.y=O,a.setBatchedAttribute(u,i,A)}e._batchTableOffsetsUpdated=!0}function rb(e,t){const n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,s=t.context,a=[],c=i.length;for(let l=0;l<c;++l){const u=i[l];if(a.push(Xn.fromGeometry({context:s,geometry:u,attributeLocations:n,bufferUsage:De.STATIC_DRAW,interleave:e._interleave})),h(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(K.clone(u.boundingSphere)),e._boundingSphereWC.push(new K),!o){const d=u.boundingSphereCV.center,p=d.x,g=d.y,y=d.z;d.x=y,d.y=p,d.z=g,e._boundingSphereCV.push(K.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new K),e._boundingSphereMorph.push(new K)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Er(e,t,wt.COMPLETE,void 0)}function sb(e,t,n,i){let o=n.getRenderState(),s;i?(s=tn(o,!1),s.cull={enabled:!0,face:Ro.BACK},e._frontFaceRS=ke.fromCache(s),s.cull.face=Ro.FRONT,e._backFaceRS=ke.fromCache(s)):(e._frontFaceRS=ke.fromCache(o),e._backFaceRS=e._frontFaceRS),s=tn(o,!1),h(e._depthFailAppearance)&&(s.depthTest.enabled=!1),h(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),s=tn(o,!1),s.depthTest.func=fd.GREATER,i?(s.cull={enabled:!0,face:Ro.BACK},e._frontFaceDepthFailRS=ke.fromCache(s),s.cull.face=Ro.FRONT,e._backFaceDepthFailRS=ke.fromCache(s)):(e._frontFaceDepthFailRS=ke.fromCache(s),e._backFaceDepthFailRS=e._frontFaceRS))}function ab(e,t,n){const i=t.context,o=e._attributeLocations;let s=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);s=Oe._appendOffsetToShader(e,s),s=Oe._appendShowToShader(e,s),s=Oe._appendDistanceDisplayConditionToShader(e,s,t.scene3DOnly),s=Vd(s),s=Oe._updateColorAttribute(e,s,!1),s=Gd(e,s),s=Oe._modifyShaderPosition(e,s,t.scene3DOnly);let a=n.getFragmentShaderSource();a=kd(a),e._sp=rt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:o}),qd(e._sp,o),h(e._depthFailAppearance)&&(s=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),s=Oe._appendShowToShader(e,s),s=Oe._appendDistanceDisplayConditionToShader(e,s,t.scene3DOnly),s=Vd(s),s=Oe._updateColorAttribute(e,s,!0),s=Gd(e,s),s=Oe._modifyShaderPosition(e,s,t.scene3DOnly),s=ZT(s),a=e._depthFailAppearance.getFragmentShaderSource(),a=kd(a),a=KT(a),e._spDepthFail=rt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:o}),qd(e._spDepthFail,o))}const Cr=new N,$d=new f;function Zd(e,t,n,i){const o=h(n)?n._uniforms:void 0,s={},a=t.uniforms;if(h(a)){for(const l in a)if(a.hasOwnProperty(l)){if(h(o)&&h(o[l]))throw new C(`Appearance and material have a uniform with the same name: ${l}`);s[l]=QT(a,l)}}let c=nn(s,o);return c=e._batchTable.getUniformMapCallback()(c),h(e.rtcCenter)&&(c.u_modifiedModelView=function(){const l=i.context.uniformState.view;return N.multiply(l,e._modelMatrix,Cr),N.multiplyByPoint(Cr,e.rtcCenter,$d),N.setTranslation(Cr,$d,Cr),Cr}),c}function cb(e,t,n,i,o,s,a,c){const l=Zd(e,t,n,c);let u;h(e._depthFailAppearance)&&(u=Zd(e,e._depthFailAppearance,e._depthFailAppearance.material,c));const d=i?zt.TRANSLUCENT:zt.OPAQUE;let p=o?2:1;p*=h(e._depthFailAppearance)?2:1,s.length=e._va.length*p;const g=s.length;let y=0;for(let x=0;x<g;++x){let E;o&&(E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._backFaceRS,E.shaderProgram=e._sp,E.uniformMap=l,E.pass=d,++x),E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._frontFaceRS,E.shaderProgram=e._sp,E.uniformMap=l,E.pass=d,h(e._depthFailAppearance)&&(o&&(++x,E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._backFaceDepthFailRS,E.shaderProgram=e._spDepthFail,E.uniformMap=u,E.pass=d),++x,E=s[x],h(E)||(E=s[x]=new $e({owner:e,primitiveType:e._primitiveType})),E.vertexArray=e._va[y],E.renderState=e._frontFaceDepthFailRS,E.shaderProgram=e._spDepthFail,E.uniformMap=u,E.pass=d),++y}}Oe._updateBoundingVolumes=function(e,t,n,i){let o,s,a;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),s=e._boundingSpheres.length,o=0;o<s;++o)a=e._boundingSpheres[o],h(a)&&(e._boundingSphereWC[o]=K.transform(a,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=K.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=K.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));const c=e.appearance.pixelSize;if(h(c))for(s=e._boundingSpheres.length,o=0;o<s;++o){a=e._boundingSpheres[o];const l=e._boundingSphereWC[o],d=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*c;l.radius=a.radius+d}};function lb(e,t,n,i,o,s,a,c){if(t.mode!==me.SCENE3D&&!N.equals(o,N.IDENTITY))throw new C("Primitive.modelMatrix is only supported in 3D mode.");Oe._updateBoundingVolumes(e,t,o);let l;t.mode===me.SCENE3D?l=e._boundingSphereWC:t.mode===me.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===me.SCENE2D&&h(e._boundingSphere2D)?l=e._boundingSphere2D:h(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);const u=t.commandList,d=t.passes;if(d.render||d.pick){const p=e.allowPicking,g=aa.castShadows(e.shadows),y=aa.receiveShadows(e.shadows),x=n.length;let E=c?2:1;E*=h(e._depthFailAppearance)?2:1;for(let T=0;T<x;++T){const D=Math.floor(T/E),A=n[T];A.modelMatrix=o,A.boundingVolume=l[D],A.cull=s,A.debugShowBoundingVolume=a,A.castShadows=g,A.receiveShadows=y,p?A.pickId="v_pickColor":A.pickId=void 0,u.push(A)}}}Oe.prototype.update=function(e){if(!h(this.geometryInstances)&&this._va.length===0||h(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!h(this.appearance)||e.mode!==me.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(h(this._error))throw this._error;if(h(this.rtcCenter)&&!e.scene3DOnly)throw new C("RTC rendering is only available for 3D only scenes.");if(this._state===wt.FAILED)return;const t=e.context;if(h(this._batchTable)||WT(this,t),this._batchTable.attributes.length>0){if(Ee.maximumVertexTextureImageUnits===0)throw new ct("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==wt.COMPLETE&&this._state!==wt.COMBINED&&(this.asynchronous?eb(this,e):tb(this,e)),this._state===wt.COMBINED&&(ib(this,e),Xd(this,e),rb(this,e)),!this.show||this._state!==wt.COMPLETE)return;this._batchTableOffsetsUpdated||Xd(this,e),this._recomputeBoundingSpheres&&nb(this,e);const n=this.appearance,i=n.material;let o=!1,s=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,s=!0):this._material!==i&&(this._material=i,s=!0);const a=this.depthFailAppearance,c=h(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=c,o=!0,s=!0):this._depthFailMaterial!==c&&(this._depthFailMaterial=c,s=!0);const l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),h(this._material)&&this._material.update(t);const u=n.closed&&l;o&&_(this._createRenderStatesFunction,sb)(this,t,n,u),s&&_(this._createShaderProgramFunction,ab)(this,e,n),(o||s)&&_(this._createCommandsFunction,cb)(this,n,i,l,u,this._colorCommands,this._pickCommands,e),_(this._updateAndQueueCommandsFunction,lb)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};const hb=new K,fb=new K;function Kd(e,t,n){if(n===zu.TOP){const i=K.clone(e,hb),o=K.clone(e,fb);o.center=f.add(o.center,t,o.center),e=K.union(i,o,e)}else n===zu.ALL&&(e.center=f.add(e.center,t,e.center));return e}function ub(e,t,n){return function(){const i=e.getBatchedAttribute(t,n),o=e.attributes[n],s=o.componentsPerAttribute,a=oe.createTypedArray(o.componentDatatype,s);return h(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function db(e,t,n,i,o){return function(s){if(!h(s)||!h(s.length)||s.length<1||s.length>4)throw new C("value must be and array with length between 1 and 4.");const a=Ud(s);e.setBatchedAttribute(t,n,a),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}const pb=new f;function mb(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(h(i)){i=i.clone();const o=e.modelMatrix,s=t.offset;h(s)&&Kd(i,f.fromArray(s.get(),0,pb),e._offsetInstanceExtend[n]),h(o)&&(i=K.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function _b(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Oe.prototype.getGeometryInstanceAttributes=function(e){if(!h(e))throw new C("id is required");if(!h(this._batchTable))throw new C("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(h(t))return t;let n=-1;const i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,s=o.length;for(let u=0;u<s;++u){const d=(i+u)%s;if(e===o[d]){n=d;break}}if(n===-1)return;const a=this._batchTable,c=this._batchTableAttributeIndices;t={};const l={};for(const u in c)if(c.hasOwnProperty(u)){const d=c[u];l[u]={get:ub(a,n,d),set:db(a,n,d,this,u)}}return mb(this,l,n),_b(this,l,n),Object.defineProperties(t,l),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t},Oe.prototype.isDestroyed=function(){return!1},Oe.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();const n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;const i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,Qe(this)};function Er(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===wt.COMPLETE||e._state===wt.FAILED})}function Fn(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.value))throw new C("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=_(e.normalize,!1),this.value=e.value}const Qd=`#ifdef TEXTURE_COORDINATES
|
|
4786
4786
|
#ifdef SPHERICAL
|
|
4787
4787
|
in vec4 v_sphericalExtents;
|
|
4788
4788
|
#else // SPHERICAL
|
|
@@ -4943,14 +4943,14 @@ void main(void)
|
|
|
4943
4943
|
czm_writeDepthClamp();
|
|
4944
4944
|
#endif // PICK
|
|
4945
4945
|
}
|
|
4946
|
-
`;function Ut(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
|
|
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}Ut.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 Wt&&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 Wt||(o=t.material.shaderSource),new ge({defines:i,sources:[o,Qd]})},Ut.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 ge({defines:n,sources:[Qd],pickColorQualifier:"in"})},Ut.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),np(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},Ut.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),np(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const Jd=new f,ep=new ee,tp={high:0,low:0};function np(e,t,n,i,o,s,a,c){const l=i.slice();if(c.eastMostYhighDefine===""){const u=ep;u.longitude=S.PI,u.latitude=0,u.height=0;const d=a.project(u,Jd);let p=je.encode(d.x,tp);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=ep;g.longitude=-S.PI,g.latitude=0,g.height=0;const y=a.project(g,Jd);p=je.encode(y.x,tp),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 Wt&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new ge({defines:l,sources:[o]})}function hl(){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(hl.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 ip(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 _b=[new U,new U,new U,new U];function op(e,t){const n=_b,i=U.unpack(t,0,n[0]),o=U.unpack(t,2,n[1]),s=U.unpack(t,4,n[2]);e.uMaxVmax=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,s.x,s.y]});const a=1/ip(i,o,s),c=1/ip(i,s,o);e.uvMinAndExtents=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,c]})}const rp=new ee,sp=new f,gb=new f,yb=new f,sa={high:0,low:0};function ap(e,t,n){const i=rp;i.height=0,i.longitude=e.west,i.latitude=e.south;const o=t.project(i,sp);i.latitude=e.north;const s=t.project(i,gb);i.longitude=e.east,i.latitude=e.south;const a=t.project(i,yb),c=[0,0,0,0],l=[0,0,0,0];let u=je.encode(o.x,sa);c[0]=u.high,l[0]=u.low,u=je.encode(o.y,sa),c[1]=u.high,l[1]=u.low,u=je.encode(s.y,sa),c[2]=u.high,l[2]=u.low,u=je.encode(a.x,sa),c[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:c}),n.planes2D_LOW=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}const xb=new N,Cb=new N,cp=new f,Eb=new ee,Tb=[new ee,new ee,new ee,new ee,new ee,new ee,new ee,new ee];function bb(e,t,n,i,o,s){const a=ce.center(e,Eb);a.height=n;const c=ee.toCartesian(a,t,cp),l=me.eastNorthUpToFixedFrame(c,t,xb),u=N.inverse(l,Cb),d=e.west,p=e.east,g=e.north,y=e.south,x=Tb;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,T=(g+y)*.5;x[4].latitude=y,x[4].longitude=E,x[5].latitude=g,x[5].longitude=E,x[6].latitude=T,x[6].longitude=d,x[7].latitude=T,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,cp);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 G=s;G.x=D,G.y=I,G.z=0,N.multiplyByPoint(l,G,G),f.subtract(G,B,s)}const wb=new f,Sb=new f,Ab=new je;Ut.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=sp,a=wb,c=Sb;bb(e,n,_(o,0),s,a,c);const l={};op(l,t);const u=je.fromCartesian(s,Ab);return l.southWest_HIGH=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.high,[0,0,0])}),l.southWest_LOW=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(u.low,[0,0,0])}),l.eastward=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(a,[0,0,0])}),l.northward=new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:3,normalize:!1,value:f.pack(c,[0,0,0])}),ap(e,i,l),l};const Db=new f;function lp(e,t,n,i){const o=rp;o.latitude=e,o.longitude=t,o.height=0;const s=ee.toCartesian(o,n,Db),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 hp=new U;Ut.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=lp(e.south,e.west,n,hp);let s=o.x,a=o.y;const c=lp(e.north,e.east,n,hp);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 Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[s,a,g,p]}),longitudeRotation:new Ln({componentDatatype:oe.FLOAT,componentsPerAttribute:1,normalize:!1,value:[d]})};return op(y,t),ap(e,i,y),y},Ut.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)},Ut.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 Ob(e){return Math.max(e.width,e.height)>Ut.MAX_WIDTH_FOR_PLANAR_EXTENTS}Ut.shouldUseSphericalCoordinates=function(e){return m.typeOf.object("rectangle",e),Ob(e)},Ut.MAX_WIDTH_FOR_PLANAR_EXTENTS=S.toRadians(1);const vb={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(vb),Ib={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},He=Object.freeze(Ib),aa={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};aa.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Jn.ALWAYS,frontOperation:{fail:He.KEEP,zFail:He.KEEP,zPass:He.REPLACE},backFunction:Jn.ALWAYS,backOperation:{fail:He.KEEP,zFail:He.KEEP,zPass:He.REPLACE},reference:aa.CESIUM_3D_TILE_MASK,mask:aa.CESIUM_3D_TILE_MASK}};const _i=Object.freeze(aa);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 Mo(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:He.KEEP,zFail:He.DECREMENT_WRAP,zPass:He.KEEP},backFunction:n,backOperation:{fail:He.KEEP,zFail:He.INCREMENT_WRAP,zPass:He.KEEP},reference:_i.CESIUM_3D_TILE_MASK,mask:_i.CESIUM_3D_TILE_MASK},stencilMask:_i.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:fd.LESS_OR_EQUAL},depthMask:!1}}function fl(e){return{stencilTest:{enabled:e,frontFunction:Jn.NOT_EQUAL,frontOperation:{fail:He.ZERO,zFail:He.ZERO,zPass:He.ZERO},backFunction:Jn.NOT_EQUAL,backOperation:{fail:He.ZERO,zFail:He.ZERO,zPass:He.ZERO},reference:0,mask:_i.CLASSIFICATION_MASK},stencilMask:_i.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Ji.PRE_MULTIPLIED_ALPHA_BLEND}}const Rb={stencilTest:{enabled:!0,frontFunction:Jn.NOT_EQUAL,frontOperation:{fail:He.ZERO,zFail:He.ZERO,zPass:He.ZERO},backFunction:Jn.NOT_EQUAL,backOperation:{fail:He.ZERO,zFail:He.ZERO,zPass:He.ZERO},reference:0,mask:_i.CLASSIFICATION_MASK},stencilMask:_i.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function zb(e,t,n,i){if(h(e._rsStencilDepthPass))return;const o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ke.fromCache(Mo(o,!1)),e._rsStencilDepthPass3DTiles=ke.fromCache(Mo(o,!0)),e._rsColorPass=ke.fromCache(fl(o)),e._rsPickPass=ke.fromCache(Rb)}function Pb(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;
|
|
4946
|
+
`;function Ut(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 dl;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;const o=new dl;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}Ut.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,Qd]})},Ut.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:[Qd],pickColorQualifier:"in"})},Ut.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),np(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)},Ut.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),np(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};const Jd=new f,ep=new ee,tp={high:0,low:0};function np(e,t,n,i,o,s,a,c){const l=i.slice();if(c.eastMostYhighDefine===""){const u=ep;u.longitude=S.PI,u.latitude=0,u.height=0;const d=a.project(u,Jd);let p=Ye.encode(d.x,tp);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=ep;g.longitude=-S.PI,g.latitude=0,g.height=0;const y=a.project(g,Jd);p=Ye.encode(y.x,tp),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 dl(){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(dl.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 ip(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 gb=[new U,new U,new U,new U];function op(e,t){const n=gb,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/ip(i,o,s),c=1/ip(i,s,o);e.uvMinAndExtents=new Fn({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,c]})}const rp=new ee,sp=new f,yb=new f,xb=new f,la={high:0,low:0};function ap(e,t,n){const i=rp;i.height=0,i.longitude=e.west,i.latitude=e.south;const o=t.project(i,sp);i.latitude=e.north;const s=t.project(i,yb);i.longitude=e.east,i.latitude=e.south;const a=t.project(i,xb),c=[0,0,0,0],l=[0,0,0,0];let u=Ye.encode(o.x,la);c[0]=u.high,l[0]=u.low,u=Ye.encode(o.y,la),c[1]=u.high,l[1]=u.low,u=Ye.encode(s.y,la),c[2]=u.high,l[2]=u.low,u=Ye.encode(a.x,la),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 Cb=new N,Eb=new N,cp=new f,Tb=new ee,bb=[new ee,new ee,new ee,new ee,new ee,new ee,new ee,new ee];function wb(e,t,n,i,o,s){const a=ce.center(e,Tb);a.height=n;const c=ee.toCartesian(a,t,cp),l=_e.eastNorthUpToFixedFrame(c,t,Cb),u=N.inverse(l,Eb),d=e.west,p=e.east,g=e.north,y=e.south,x=bb;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,T=(g+y)*.5;x[4].latitude=y,x[4].longitude=E,x[5].latitude=g,x[5].longitude=E,x[6].latitude=T,x[6].longitude=d,x[7].latitude=T,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 k=ee.toCartesian(x[P],t,cp);N.multiplyByPoint(u,k,k),k.z=0,D=Math.min(D,k.x),A=Math.max(A,k.x),O=Math.min(O,k.y),I=Math.max(I,k.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 Sb=new f,Ab=new f,Db=new Ye;Ut.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=sp,a=Sb,c=Ab;wb(e,n,_(o,0),s,a,c);const l={};op(l,t);const u=Ye.fromCartesian(s,Db);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])}),ap(e,i,l),l};const Ob=new f;function lp(e,t,n,i){const o=rp;o.latitude=e,o.longitude=t,o.height=0;const s=ee.toCartesian(o,n,Ob),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 hp=new U;Ut.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=lp(e.south,e.west,n,hp);let s=o.x,a=o.y;const c=lp(e.north,e.east,n,hp);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 op(y,t),ap(e,i,y),y},Ut.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)},Ut.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 vb(e){return Math.max(e.width,e.height)>Ut.MAX_WIDTH_FOR_PLANAR_EXTENTS}Ut.shouldUseSphericalCoordinates=function(e){return m.typeOf.object("rectangle",e),vb(e)},Ut.MAX_WIDTH_FOR_PLANAR_EXTENTS=S.toRadians(1);const Ib={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(Ib),Rb={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(Rb),ha={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};ha.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:ha.CESIUM_3D_TILE_MASK,mask:ha.CESIUM_3D_TILE_MASK}};const _i=Object.freeze(ha);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 Mo(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:fd.LESS_OR_EQUAL},depthMask:!1}}function pl(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:Ji.PRE_MULTIPLIED_ALPHA_BLEND}}const zb={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 Pb(e,t,n,i){if(h(e._rsStencilDepthPass))return;const o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ke.fromCache(Mo(o,!1)),e._rsStencilDepthPass3DTiles=ke.fromCache(Mo(o,!0)),e._rsColorPass=ke.fromCache(pl(o)),e._rsPickPass=ke.fromCache(zb)}function Bb(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
|
-
`;let a=t;a=a.replace(/in\s+vec3\s+extrudeDirection;/g,""),a=
|
|
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 Bb(e,t){const n=t.context,i=e._primitive;let o=LE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=De._appendDistanceDisplayConditionToShader(i,o),o=De._modifyShaderPosition(e,o,t.scene3DOnly),o=De._updateColorAttribute(i,o);const s=e._hasPlanarExtentsAttributes,a=s||e._hasSphericalExtentsAttribute;e._extruded&&(o=Pb(i,o));const c=e._extruded?"EXTRUDED_GEOMETRY":"";let l=new ge({defines:[c],sources:[o]});const u=new ge({sources:[FE]}),d=e._primitive._attributeLocations,p=new Ut(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=ge.createPickVertexShaderSource(o);x=De._appendShowToShader(i,x),x=De._updatePickColorAttribute(x);const E=p.createPickFragmentShader(!1),T=p.createPickVertexShader([c],x,!1,t.mapProjection);if(e._spPick=ot.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:T,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=De._appendShowToShader(i,o),l=new ge({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),T=p.createVertexShader([c],o,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:d})}e._spColor2D=x}}function Nb(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=zt.TERRAIN_CLASSIFICATION,a=$e.shallowClone(s,s.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=zt.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=zt.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=zt.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=a,u){let T=$e.shallowClone(s,s.derivedCommands.appearance2D);T.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=T,T=$e.shallowClone(a,a.derivedCommands.appearance2D),T.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=T}}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=zt.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,g+=2}}function Lb(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=zt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.renderState=e._rsStencilDepthPass3DTiles,d.pass=zt.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=zt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.pass=zt.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 Fb(e,t,n,i,o,s,a){Nb(e,s),Lb(e,a)}function fp(e,t){return Math.floor(e%t/2)}function ul(e,t,n,i,o,s){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=s,t.commandList.push(e)}function up(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function Mb(e,t,n,i,o,s,a,c){const l=e._primitive;De._updateBoundingVolumes(l,t,o);let u;t.mode===pe.SCENE3D?u=l._boundingSphereWC:t.mode===pe.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===pe.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,T;if(y.render){const D=n.length;for(x=0;x<D;++x)E=u[fp(x,D)],p&&(T=n[x],ul(T,t,o,s,E,a)),g&&(T=n[x].derivedCommands.tileset,ul(T,t,o,s,E,a));if(t.invertClassification){const A=e._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=u[x],T=A[x],ul(T,t,o,s,E,a)}}if(y.pick){const D=i.length,A=l._pickOffsets;for(x=0;x<D;++x){const O=A[fp(x,D)];E=u[O.index],p&&(T=i[x],up(T,t,o,s,E)),g&&(T=i[x].derivedCommands.tileset,up(T,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=Ut.hasAttributesForSphericalExtents(l),y=Ut.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)&&Oo.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 Wt({flat:!0}),this.appearance=t),!u&&t instanceof Wt)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 js({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,T){n._createBoundingVolumeFunction(E,T)}),i._createRenderStatesFunction=function(E,T,D,A){zb(n)},i._createShaderProgramFunction=function(E,T,D){Bb(n,T)},i._createCommandsFunction=function(E,T,D,A,O,I,B){Fb(n,void 0,void 0,!0,!1,I,B)},h(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(E,T,D,A,O,I,B,M){n._updateAndQueueCommandsFunction(E,T,D,A,O,I,B,M)}:i._updateAndQueueCommandsFunction=function(E,T,D,A,O,I,B,M){Mb(n,T,D,A,O,I,B)},this._primitive=new De(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ke.fromCache(Mo(!1,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(Mo(!1,!0)),this._rsColorPass=ke.fromCache(fl(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ke.fromCache(Mo(!0,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(Mo(!0,!0)),this._rsColorPass=ke.fromCache(fl(!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 Wt)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 Ub={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 Wt({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=Fe._defaultMaxTerrainHeight,this._minTerrainHeight=Fe._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:Ub}}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 dp(e){return function(t,n){const i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function pp(e){return function(t,n){return e._minHeight}}const kb=new f,Vb=new f,qb=new f,Gb=new ee,Hb=new ce;function ca(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,kb),y=f.unpack(o,p,Vb),x=f.add(g,y,qb),E=n.cartesianToCartographic(x,Gb),T=E.latitude,D=E.longitude;a=Math.min(a,T),c=Math.min(c,D),l=Math.max(l,T),u=Math.max(u,D)}const d=Hb;return d.north=l,d.south=a,d.east=u,d.west=c,d}function Wb(e,t,n){const i=Fe.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function jb(e,t,n){const i=t.mapProjection.ellipsoid,o=ca(t,n),s=Ie.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 dl(e,t){return Math.floor(e%t/2)}function pl(e,t,n,i,o,s,a){const c=e._primitive;n.mode!==pe.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 mp(e,t,n,i,o,s){const a=e._primitive;n.mode!==pe.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 Yb(e,t,n,i,o,s,a,c){let l;t.mode===pe.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,T;if(g.render){const D=n.length;for(x=0;x<D;++x)E=l[dl(x,D)],d&&(T=n[x],pl(e,T,t,o,s,E,a)),p&&(T=n[x].derivedCommands.tileset,pl(e,T,t,o,s,E,a));if(t.invertClassification){const A=y._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=l[x],T=A[x],pl(e,T,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[dl(x,D)],!e._useFragmentCulling){const O=A[dl(x,D)];E=l[O.index]}d&&(T=i[x],mp(e,T,t,o,s,E)),p&&(T=i[x].derivedCommands.tileset,mp(e,T,t,o,s,E))}}}sn.initializeTerrainHeights=function(){return Fe.initialize()},sn.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;if(!Fe.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=ca(e,s);h(p)?h(E)&&ce.union(p,E,p):p=ce.clone(E);const T=o.id;if(h(T)&&h(E)){const D=Fe.getBoundingSphere(E,i);this._boundingSpheresKeys.push(T),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.")}Wb(this,p,i);const g=e.verticalExaggeration,y=e.verticalExaggerationRelativeHeight;this._minHeight=dr.getHeight(this._minTerrainHeight,g,y),this._maxHeight=dr.getHeight(this._maxTerrainHeight,g,y);const x=sn._supportsMaterials(e.context);if(this._useFragmentCulling=x,x){let E,T=!0;for(d=0;d<l;++d)if(o=c[d],s=o.geometry,p=ca(e,s),Ut.shouldUseSphericalCoordinates(p)){T=!1;break}for(d=0;d<l;++d){o=c[d],s=o.geometry,a=s.constructor;const D=ca(e,s),A=s.textureCoordinateRotationPoints;T?E=Ut.getPlanarTextureCoordinateAttributes(D,A,i,e.mapProjection,this._maxHeight):E=Ut.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 js({geometry:a.createShadowVolume(s,pp(this),dp(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 js({geometry:a.createShadowVolume(s,pp(this),dp(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(E,T){jb(t,E,T)},n._updateAndQueueCommandsFunction=function(E,T,D,A,O,I,B,M){Yb(t,T,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}),_p=S.EPSILON10;function Xb(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,_p)?(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],_p)&&(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 $b(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,T=E*E,D=T*E,A=T*T,O=1+E-3*T/4+5*D/4-175*A/64,I=1-E+15*T/8-35*D/8,B=1-3*E+35*T/4,M=1-5*E,G=O*d-I*Math.sin(2*d)*E/2-B*Math.sin(4*d)*T/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=T,P.u6Over64=D,P.u8Over256=A,P.a0=O,P.a1=I,P.a2=B,P.a3=M,P.distanceRatio=G}function Zb(e,t){return e*t*(4+e*(4-3*t))/16}function gp(e,t,n,i,o,s,a){const c=Zb(e,n);return(1-c)*e*t*(i+c*o*(a+c*s*(2*a*a-1)))}function Kb(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,T=p*x,D=g*x,A=g*y;let O=l,I=S.TWO_PI,B=Math.cos(O),M=Math.sin(O),G,P,V,k,H;do{B=Math.cos(O),M=Math.sin(O);const X=T-A*B;V=Math.sqrt(y*y*M*M+X*X),P=D+E*B,G=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+gp(c,ie,k,G,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,b=j*(256+j*(j*(74-47*j)-128))/1024,v=H*H,z=b*V*(H+b*(P*(2*v-1)-b*H*(4*V*V-3)*(4*v-3)/6)/4),q=n*r*(G-z),W=Math.atan2(y*M,T-A*B),Z=Math.atan2(p*M,T*B-A);e._distance=q,e._startHeading=W,e._endHeading=Z,e._uSquared=j}const Qb=new f,ml=new f;function yp(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,ml),Qb),s=f.normalize(i.cartographicToCartesian(n,ml),ml);m.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(f.angleBetween(o,s))-Math.PI),.0125),Kb(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,$b(e)}function Er(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)&&yp(this,e,t,i)}Object.defineProperties(Er.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}}}),Er.prototype.setEndPoints=function(e,t){m.defined("start",e),m.defined("end",t),yp(this,e,t,this._ellipsoid)},Er.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},Er.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,T=n.u4Over16;let D=2*g*y*o/3+i*(1-x+7*T/4-15*E/4+579*y/64-(T-15*E/4+187*y/16)*o-(5*E/4-115*y/16)*s-29*y*a/16)+(x/2-T+71*E/32-85*y/16)*c+(5*T/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),G=n.cosineU*M,P=n.sineU*B,k=Math.atan2(B*n.sineHeading,G-P*n.cosineHeading)-gp(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 _l(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 Jb(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),T=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),G=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*G+(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)*T+(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 Uo(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 ew(e,t,n,i,o){const s=Uo(e._ellipticity,n),a=Uo(e._ellipticity,o);return Math.atan2(S.negativePiToPi(i-t),a-s)}function tw(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=_l(e._ellipticity,t,o);u=(_l(e._ellipticity,t,a)-d)/Math.cos(c)}return Math.abs(u)}const nw=new f,gl=new f;function xp(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,gl),nw),s=f.normalize(i.cartographicToCartesian(n,gl),gl);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=ew(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=tw(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Cp(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=_l(o,i,e.latitude),p=n*Math.cos(t),g=d+p;if(l=Jb(g,o,i),Math.abs(t)<S.EPSILON10)c=S.negativePiToPi(e.longitude);else{const y=Uo(o,e.latitude),x=Uo(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)&&xp(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=Cp(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),xp(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 Cp(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=Uo(n,o.latitude),a=Uo(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 yl=[Sn,Zt],iw=yl.length,Ep=Math.cos(S.toRadians(30)),Tp=Math.cos(S.toRadians(150)),bp=0,wp=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<iw;i++)if(t instanceof yl[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const ow=new f,Sp=new f,Ap=new f;function xl(e,t,n,i,o){const s=Kt(i,e,0,ow),a=Kt(i,e,n,Sp),c=Kt(i,t,0,Ap),l=gi(a,s,Sp),u=gi(c,s,Ap);return f.cross(u,l,o),f.normalize(o,o)}const rw=new ee,sw=new f,aw=new f,cw=new f;function Cl(e,t,n,i,o,s,a,c,l,u,d){if(o===0)return;let p;s===ei.GEODESIC?p=new Er(e,t,a):s===ei.RHUMB&&(p=new ti(e,t,a));const g=p.surfaceDistance;if(g<o)return;const y=xl(e,t,i,a,cw),x=Math.ceil(g/o),E=g/x;let T=E;const D=x-1;let A=c.length;for(let O=0;O<D;O++){const I=p.interpolateUsingSurfaceDistance(T,rw),B=Kt(a,I,n,sw),M=Kt(a,I,i,aw);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,T+=E}}const El=new ee;function Kt(e,t,n,i){return ee.clone(t,El),El.height=n,ee.toCartesian(El,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 Dp(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 lw=new f,hw=new f,fw=new f,Op=new f,uw=0,dw=-1;function Tl(e,t,n,i,o){const s=gi(n,t,Op),a=Dp(e,t,s,lw),c=Dp(i,t,s,hw);if(S.equalsEpsilon(f.dot(a,c),dw,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,fw);return f.dot(c,l)<uw&&(o=f.negate(o,o)),o}const la=Be.fromPointNormal(f.ZERO,f.UNIT_Y),pw=new f,mw=new f,_w=new f,gw=new f,yw=new f,ha=new f,fa=new ee,vp=new ee,Ip=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 yl[e._projectionIndex](i),c=bp,l=wp;let u,d;const p=e._positions,g=p.length;g===2&&(n=!1);let y,x,E,T;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=Ne.lineSegmentPlane(y,x,la,ha),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,fa).longitude,E=i.cartesianToCartographic(y,fa),T=i.cartesianToCartographic(x,vp),D.setEndPoints(E,T),O=D.findIntersectionWithLongitude(I,Ip),A=i.cartographicToCartesian(O,ha),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=Ne.lineSegmentPlane(y,x,la,ha),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,fa).longitude,E=i.cartesianToCartographic(y,fa),T=i.cartesianToCartographic(x,vp),D.setEndPoints(E,T),O=D.findIntersectionWithLongitude(I,Ip),A=i.cartographicToCartesian(O,ha),h(A)&&!f.equalsEpsilon(A,y,S.EPSILON7)&&!f.equalsEpsilon(A,x,S.EPSILON7)&&B.push(f.clone(A)))));let M=B.length,G=new Array(M);for(d=0;d<M;d++){const se=ee.fromCartesian(B[d],i);se.height=0,G[d]=se}if(G=Xb(G,ee.equalsEpsilon),M=G.length,M<2)return;const P=[],V=[],k=[],H=[];let j=pw,r=mw,b=_w,v=gw,z=yw;const q=G[0],W=G[1],Z=G[M-1];for(j=Kt(i,Z,c,j),v=Kt(i,W,c,v),r=Kt(i,q,c,r),b=Kt(i,q,l,b),n?z=Tl(j,r,b,v,z):z=xl(q,W,l,i,z),f.pack(z,V,0),f.pack(r,k,0),f.pack(b,H,0),P.push(q.latitude),P.push(q.longitude),Cl(q,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=G[d];Kt(i,se,l,b),Kt(i,G[d+1],c,v),Tl(j,r,b,v,z),u=V.length,f.pack(z,V,u),f.pack(r,k,u),f.pack(b,H,u),P.push(se.latitude),P.push(se.longitude),Cl(G[d],G[d+1],c,l,o,s,i,V,k,H,P)}const X=G[M-1],ie=G[M-2];if(r=Kt(i,X,c,r),b=Kt(i,X,l,b),n){const se=G[0];j=Kt(i,ie,c,j),v=Kt(i,se,c,v),z=Tl(j,r,b,v,z)}else z=xl(ie,X,l,i,z);if(u=V.length,f.pack(z,V,u),f.pack(r,k,u),f.pack(b,H,u),P.push(X.latitude),P.push(X.longitude),n){for(Cl(X,q,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(q.latitude),P.push(q.longitude)}return Hw(n,a,k,H,V,P,t)};const xw=new f,Cw=new F,Ew=new J;function Rp(e,t,n,i){const o=gi(n,t,xw),s=f.dot(o,e);if(s>Ep||s<Tp){const a=gi(i,n,Op),c=s<Tp?S.PI_OVER_TWO:-S.PI_OVER_TWO,l=J.fromAxisAngle(a,c,Ew),u=F.fromQuaternion(l,Cw);return F.multiplyByVector(u,e,e),!0}return!1}const zp=new ee,Tw=new f,Pp=new f;function Tr(e,t,n,i,o){const s=ee.toCartesian(t,e._ellipsoid,Tw);let a=f.add(s,n,Pp),c=!1;const l=e._ellipsoid;let u=l.cartesianToCartographic(a,zp);Math.abs(t.longitude-u.longitude)>S.PI_OVER_TWO&&(c=!0,a=f.subtract(s,n,Pp),u=l.cartesianToCartographic(a,zp)),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 bw=new f,Bp=new f;function Np(e,t,n,i,o,s){const a=f.subtract(t,e,bw);f.normalize(a,a);const c=n-bp;let l=f.multiplyByScalar(a,c,Bp);f.add(e,l,o);const u=i-wp;l=f.multiplyByScalar(a,u,Bp),f.add(t,l,s)}const ww=new f;function ua(e,t){const n=Be.getPointDistance(la,e),i=Be.getPointDistance(la,t);let o=ww;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 Sw(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 Lp=new ee,Fp=new ee,Mp=new f,bl=new f,Up=new f,kp=new f,Aw=new f,Vp=new f,Dw=[Lp,Fp],Ow=new ce,vw=new f,Iw=new f,Rw=new f,zw=new f,Pw=new f,Bw=new f,wl=new f,Sl=new f,Nw=new f,Lw=new f,Fw=new f,qp=new f,Mw=new f,Uw=new f,kw=new je,Vw=new je,Gp=new f,qw=new f,Hp=new f,Gw=[new K,new K],Wp=[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],jp=Wp.length;function Hw(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),T=new Float32Array(g),D=new Float32Array(g),A=new Float32Array(g),O=new Float32Array(g),I=new Float32Array(g);let B,M,G,P;a&&(B=new Float32Array(g),M=new Float32Array(g),G=new Float32Array(g),P=new Float32Array(p*2));const V=s.length/2;let k=0;const H=Lp;H.height=0;const j=Fp;j.height=0;let r=Mp,b=bl;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),b=t.project(j,b),k+=f.distance(r,b),l+=2;const v=i.length/3;b=f.unpack(i,0,b);let z=0;for(l=3,c=1;c<v;c++)r=f.clone(b,r),b=f.unpack(i,l,b),z+=f.distance(r,b),l+=3;let q;l=3;let W=0,Z=0,X=0,ie=0,se=!1,_e=f.unpack(n,0,kp),Ee=f.unpack(i,0,bl),ye=f.unpack(o,0,Vp);if(e){const yt=f.unpack(n,n.length-6,Up);Rp(ye,yt,_e,Ee)&&(ye=f.negate(ye,ye))}let Re=0,We=0,tt=0;for(c=0;c<d;c++){const yt=f.clone(_e,Up),cn=f.clone(Ee,Mp);let ln=f.clone(ye,Aw);se&&(ln=f.negate(ln,ln)),_e=f.unpack(n,l,kp),Ee=f.unpack(i,l,bl),ye=f.unpack(o,l,Vp),se=Rp(ye,yt,_e,Ee),H.latitude=s[W],H.longitude=s[W+1],j.latitude=s[W+2],j.longitude=s[W+3];let kn,Go,Gi,Hi;if(a){const ut=Sw(H,j);kn=t.project(H,Pw),Go=t.project(j,Bw);const Wo=gi(Go,kn,Gp);Wo.y=Math.abs(Wo.y),Gi=wl,Hi=Sl,ut===0||f.dot(Wo,f.UNIT_Y)>Ep?(Gi=Tr(t,H,ln,kn,wl),Hi=Tr(t,j,ye,Go,Sl)):ut===1?(Hi=Tr(t,j,ye,Go,Sl),Gi.x=0,Gi.y=S.sign(H.longitude-Math.abs(j.longitude)),Gi.z=0):(Gi=Tr(t,H,ln,kn,wl),Hi.x=0,Hi.y=S.sign(H.longitude-j.longitude),Hi.z=0)}const S0=f.distance(cn,Ee),A0=je.fromCartesian(yt,kw),Ta=f.subtract(_e,yt,Nw),OA=f.normalize(Ta,qp);let Qr=f.subtract(cn,yt,Lw);Qr=f.normalize(Qr,Qr);let Ho=f.cross(OA,Qr,qp);Ho=f.normalize(Ho,Ho);let ba=f.cross(Qr,ln,Mw);ba=f.normalize(ba,ba);let wa=f.subtract(Ee,_e,Fw);wa=f.normalize(wa,wa);let Sa=f.cross(ye,wa,Uw);Sa=f.normalize(Sa,Sa);const vA=S0/z,IA=Re/z;let hh=0,Jr,Aa,lo,D0=0,O0=0;if(a){hh=f.distance(kn,Go),Jr=je.fromCartesian(kn,Vw),Aa=f.subtract(Go,kn,Gp),lo=f.normalize(Aa,qw);const ut=lo.x;lo.x=lo.y,lo.y=-ut,D0=hh/k,O0=We/k}for(q=0;q<8;q++){const ut=ie+q*4,Wo=Z+q*2,es=ut+3,I0=q<4?1:-1,Da=q===2||q===3||q===6||q===7?1:-1;f.pack(A0.high,T,ut),T[es]=Ta.x,f.pack(A0.low,D,ut),D[es]=Ta.y,f.pack(ba,A,ut),A[es]=Ta.z,f.pack(Sa,O,ut),O[es]=vA*I0,f.pack(Ho,I,ut);let ho=IA*Da;ho===0&&Da<0&&(ho=9),I[es]=ho,a&&(B[ut]=Jr.high.x,B[ut+1]=Jr.high.y,B[ut+2]=Jr.low.x,B[ut+3]=Jr.low.y,G[ut]=-Gi.y,G[ut+1]=Gi.x,G[ut+2]=Hi.y,G[ut+3]=-Hi.x,M[ut]=Aa.x,M[ut+1]=Aa.y,M[ut+2]=lo.x,M[ut+3]=lo.y,P[Wo]=D0*I0,ho=O0*Da,ho===0&&Da<0&&(ho=9),P[Wo+1]=ho)}const Ti=Rw,bi=zw,wi=vw,Si=Iw,RA=ce.fromCartographicArray(Dw,Ow),v0=Fe.getMinimumMaximumHeights(RA,u),fh=v0.minimumTerrainHeight,uh=v0.maximumTerrainHeight;tt+=Math.abs(fh),tt+=Math.abs(uh),Np(yt,cn,fh,uh,Ti,wi),Np(_e,Ee,fh,uh,bi,Si);let Ai=f.multiplyByScalar(Ho,S.EPSILON5,Hp);f.add(Ti,Ai,Ti),f.add(bi,Ai,bi),f.add(wi,Ai,wi),f.add(Si,Ai,Si),ua(Ti,bi),ua(wi,Si),f.pack(Ti,E,X),f.pack(bi,E,X+3),f.pack(Si,E,X+6),f.pack(wi,E,X+9),Ai=f.multiplyByScalar(Ho,-2*S.EPSILON5,Hp),f.add(Ti,Ai,Ti),f.add(bi,Ai,bi),f.add(wi,Ai,wi),f.add(Si,Ai,Si),ua(Ti,bi),ua(wi,Si),f.pack(Ti,E,X+12),f.pack(bi,E,X+15),f.pack(Si,E,X+18),f.pack(wi,E,X+21),W+=2,l+=3,Z+=16,X+=24,ie+=32,Re+=S0,We+=hh}l=0;let ft=0;for(c=0;c<d;c++){for(q=0;q<jp;q++)x[l+q]=Wp[q]+ft;ft+=8,l+=jp}const Pe=Gw;K.fromVertices(n,f.ZERO,3,Pe[0]),K.fromVertices(i,f.ZERO,3,Pe[1]);const gt=K.fromBoundingSpheres(Pe);gt.radius+=tt/(d*2);const At={position:new Pt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,normalize:!1,values:E}),startHiAndForwardOffsetX:Vi(T),startLoAndForwardOffsetY:Vi(D),startNormalAndForwardOffsetZ:Vi(A),endNormalAndTextureCoordinateNormalizationX:Vi(O),rightNormalAndTextureCoordinateNormalizationY:Vi(I)};return a&&(At.startHiLo2D=Vi(B),At.offsetAndRight2D=Vi(M),At.startEndNormals2D=Vi(G),At.texcoordNormalization2D=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new lt({attributes:At,indices:x,boundingSphere:gt})}function Vi(e){return new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}ki._projectNormal=Tr;const Ww=`in vec4 v_startPlaneNormalEcAndHalfWidth;
|
|
4953
|
+
`)}}function Nb(e,t){const n=t.context,i=e._primitive;let o=LE;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=Bb(i,o));const c=e._extruded?"EXTRUDED_GEOMETRY":"";let l=new ye({defines:[c],sources:[o]});const u=new ye({sources:[ME]}),d=e._primitive._attributeLocations,p=new Ut(a,s,e.appearance);if(e._spStencil=rt.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),T=p.createPickVertexShader([c],x,!1,t.mapProjection);if(e._spPick=rt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:T,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=rt.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:d});o=Oe._appendShowToShader(i,o),l=new ye({defines:[c],sources:[o]}),e._sp=rt.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=rt.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),T=p.createVertexShader([c],o,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:d})}e._spColor2D=x}}function Fb(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=zt.TERRAIN_CLASSIFICATION,a=$e.shallowClone(s,s.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=zt.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=zt.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=zt.CESIUM_3D_TILE_CLASSIFICATION,s.derivedCommands.tileset=a,u){let T=$e.shallowClone(s,s.derivedCommands.appearance2D);T.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=T,T=$e.shallowClone(a,a.derivedCommands.appearance2D),T.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=T}}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=zt.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,g+=2}}function Lb(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=zt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.renderState=e._rsStencilDepthPass3DTiles,d.pass=zt.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=zt.TERRAIN_CLASSIFICATION,n&&(u.offset=c.offset,u.count=c.count),d=$e.shallowClone(u,u.derivedCommands.tileset),d.pass=zt.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 Mb(e,t,n,i,o,s,a){Fb(e,s),Lb(e,a)}function fp(e,t){return Math.floor(e%t/2)}function ml(e,t,n,i,o,s){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=s,t.commandList.push(e)}function up(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function Ub(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,T;if(y.render){const D=n.length;for(x=0;x<D;++x)E=u[fp(x,D)],p&&(T=n[x],ml(T,t,o,s,E,a)),g&&(T=n[x].derivedCommands.tileset,ml(T,t,o,s,E,a));if(t.invertClassification){const A=e._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=u[x],T=A[x],ml(T,t,o,s,E,a)}}if(y.pick){const D=i.length,A=l._pickOffsets;for(x=0;x<D;++x){const O=A[fp(x,D)];E=u[O.index],p&&(T=i[x],up(T,t,o,s,E)),g&&(T=i[x].derivedCommands.tileset,up(T,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=Ut.hasAttributesForSphericalExtents(l),y=Ut.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)&&Oo.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 $s({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,T){n._createBoundingVolumeFunction(E,T)}),i._createRenderStatesFunction=function(E,T,D,A){Pb(n)},i._createShaderProgramFunction=function(E,T,D){Nb(n,T)},i._createCommandsFunction=function(E,T,D,A,O,I,B){Mb(n,void 0,void 0,!0,!1,I,B)},h(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(E,T,D,A,O,I,B,M){n._updateAndQueueCommandsFunction(E,T,D,A,O,I,B,M)}:i._updateAndQueueCommandsFunction=function(E,T,D,A,O,I,B,M){Ub(n,T,D,A,O,I,B)},this._primitive=new Oe(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ke.fromCache(Mo(!1,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(Mo(!1,!0)),this._rsColorPass=ke.fromCache(pl(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ke.fromCache(Mo(!0,!1)),this._rsStencilDepthPass3DTiles=ke.fromCache(Mo(!0,!0)),this._rsColorPass=ke.fromCache(pl(!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 Vb={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:Vb}}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 dp(e){return function(t,n){const i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function pp(e){return function(t,n){return e._minHeight}}const kb=new f,Gb=new f,qb=new f,Hb=new ee,Wb=new ce;function fa(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,kb),y=f.unpack(o,p,Gb),x=f.add(g,y,qb),E=n.cartesianToCartographic(x,Hb),T=E.latitude,D=E.longitude;a=Math.min(a,T),c=Math.min(c,D),l=Math.max(l,T),u=Math.max(u,D)}const d=Wb;return d.north=l,d.south=a,d.east=u,d.west=c,d}function jb(e,t,n){const i=Me.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function Yb(e,t,n){const i=t.mapProjection.ellipsoid,o=fa(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 _l(e,t){return Math.floor(e%t/2)}function gl(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 mp(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 Xb(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,T;if(g.render){const D=n.length;for(x=0;x<D;++x)E=l[_l(x,D)],d&&(T=n[x],gl(e,T,t,o,s,E,a)),p&&(T=n[x].derivedCommands.tileset,gl(e,T,t,o,s,E,a));if(t.invertClassification){const A=y._commandsIgnoreShow,O=A.length;for(x=0;x<O;++x)E=l[x],T=A[x],gl(e,T,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[_l(x,D)],!e._useFragmentCulling){const O=A[_l(x,D)];E=l[O.index]}d&&(T=i[x],mp(e,T,t,o,s,E)),p&&(T=i[x].derivedCommands.tileset,mp(e,T,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=fa(e,s);h(p)?h(E)&&ce.union(p,E,p):p=ce.clone(E);const T=o.id;if(h(T)&&h(E)){const D=Me.getBoundingSphere(E,i);this._boundingSpheresKeys.push(T),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.")}jb(this,p,i);const g=e.verticalExaggeration,y=e.verticalExaggerationRelativeHeight;this._minHeight=pr.getHeight(this._minTerrainHeight,g,y),this._maxHeight=pr.getHeight(this._maxTerrainHeight,g,y);const x=sn._supportsMaterials(e.context);if(this._useFragmentCulling=x,x){let E,T=!0;for(d=0;d<l;++d)if(o=c[d],s=o.geometry,p=fa(e,s),Ut.shouldUseSphericalCoordinates(p)){T=!1;break}for(d=0;d<l;++d){o=c[d],s=o.geometry,a=s.constructor;const D=fa(e,s),A=s.textureCoordinateRotationPoints;T?E=Ut.getPlanarTextureCoordinateAttributes(D,A,i,e.mapProjection,this._maxHeight):E=Ut.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 $s({geometry:a.createShadowVolume(s,pp(this),dp(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 $s({geometry:a.createShadowVolume(s,pp(this),dp(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(E,T){Yb(t,E,T)},n._updateAndQueueCommandsFunction=function(E,T,D,A,O,I,B,M){Xb(t,T,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}),_p=S.EPSILON10;function $b(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,_p)?(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],_p)&&(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 Zb(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,T=E*E,D=T*E,A=T*T,O=1+E-3*T/4+5*D/4-175*A/64,I=1-E+15*T/8-35*D/8,B=1-3*E+35*T/4,M=1-5*E,q=O*d-I*Math.sin(2*d)*E/2-B*Math.sin(4*d)*T/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=T,P.u6Over64=D,P.u8Over256=A,P.a0=O,P.a1=I,P.a2=B,P.a3=M,P.distanceRatio=q}function Kb(e,t){return e*t*(4+e*(4-3*t))/16}function gp(e,t,n,i,o,s,a){const c=Kb(e,n);return(1-c)*e*t*(i+c*o*(a+c*s*(2*a*a-1)))}function Qb(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,T=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,k,V,H;do{B=Math.cos(O),M=Math.sin(O);const X=T-A*B;k=Math.sqrt(y*y*M*M+X*X),P=D+E*B,q=Math.atan2(k,P);let ie;k===0?(ie=0,V=1):(ie=E*M/k,V=1-ie*ie),I=O,H=P-2*D/V,isFinite(H)||(H=0),O=l+gp(c,ie,V,q,k,P,H)}while(Math.abs(O-I)>S.EPSILON12);const j=V*(t*t-n*n)/(n*n),r=1+j*(4096+j*(j*(320-175*j)-768))/16384,b=j*(256+j*(j*(74-47*j)-128))/1024,v=H*H,z=b*k*(H+b*(P*(2*v-1)-b*H*(4*k*k-3)*(4*v-3)/6)/4),G=n*r*(q-z),W=Math.atan2(y*M,T-A*B),Z=Math.atan2(p*M,T*B-A);e._distance=G,e._startHeading=W,e._endHeading=Z,e._uSquared=j}const Jb=new f,yl=new f;function yp(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,yl),Jb),s=f.normalize(i.cartographicToCartesian(n,yl),yl);m.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(f.angleBetween(o,s))-Math.PI),.0125),Qb(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,Zb(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)&&yp(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),yp(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,T=n.u4Over16;let D=2*g*y*o/3+i*(1-x+7*T/4-15*E/4+579*y/64-(T-15*E/4+187*y/16)*o-(5*E/4-115*y/16)*s-29*y*a/16)+(x/2-T+71*E/32-85*y/16)*c+(5*T/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,V=Math.atan2(B*n.sineHeading,q-P*n.cosineHeading)-gp(n.f,n.sineAlpha,n.cosineSquaredAlpha,D,B,M,I);return h(t)?(t.longitude=this._start.longitude+V,t.latitude=O,t.height=0,t):new ee(this._start.longitude+V,O,0)};function xl(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 ew(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),T=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)*T+(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 Uo(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 tw(e,t,n,i,o){const s=Uo(e._ellipticity,n),a=Uo(e._ellipticity,o);return Math.atan2(S.negativePiToPi(i-t),a-s)}function nw(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=xl(e._ellipticity,t,o);u=(xl(e._ellipticity,t,a)-d)/Math.cos(c)}return Math.abs(u)}const iw=new f,Cl=new f;function xp(e,t,n,i){const o=f.normalize(i.cartographicToCartesian(t,Cl),iw),s=f.normalize(i.cartographicToCartesian(n,Cl),Cl);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=tw(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=nw(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Cp(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=xl(o,i,e.latitude),p=n*Math.cos(t),g=d+p;if(l=ew(g,o,i),Math.abs(t)<S.EPSILON10)c=S.negativePiToPi(e.longitude);else{const y=Uo(o,e.latitude),x=Uo(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)&&xp(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=Cp(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),xp(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 Cp(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=Uo(n,o.latitude),a=Uo(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 El=[Sn,Kt],ow=El.length,Ep=Math.cos(S.toRadians(30)),Tp=Math.cos(S.toRadians(150)),bp=0,wp=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<ow;i++)if(t instanceof El[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};const rw=new f,Sp=new f,Ap=new f;function Tl(e,t,n,i,o){const s=Qt(i,e,0,rw),a=Qt(i,e,n,Sp),c=Qt(i,t,0,Ap),l=gi(a,s,Sp),u=gi(c,s,Ap);return f.cross(u,l,o),f.normalize(o,o)}const sw=new ee,aw=new f,cw=new f,lw=new f;function bl(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=Tl(e,t,i,a,lw),x=Math.ceil(g/o),E=g/x;let T=E;const D=x-1;let A=c.length;for(let O=0;O<D;O++){const I=p.interpolateUsingSurfaceDistance(T,sw),B=Qt(a,I,n,aw),M=Qt(a,I,i,cw);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,T+=E}}const wl=new ee;function Qt(e,t,n,i){return ee.clone(t,wl),wl.height=n,ee.toCartesian(wl,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 gi(e,t,n){return f.subtract(e,t,n),f.normalize(n,n),n}function Dp(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 hw=new f,fw=new f,uw=new f,Op=new f,dw=0,pw=-1;function Sl(e,t,n,i,o){const s=gi(n,t,Op),a=Dp(e,t,s,hw),c=Dp(i,t,s,fw);if(S.equalsEpsilon(f.dot(a,c),pw,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,uw);return f.dot(c,l)<dw&&(o=f.negate(o,o)),o}const ua=Ne.fromPointNormal(f.ZERO,f.UNIT_Y),mw=new f,_w=new f,gw=new f,yw=new f,xw=new f,da=new f,pa=new ee,vp=new ee,Ip=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 El[e._projectionIndex](i),c=bp,l=wp;let u,d;const p=e._positions,g=p.length;g===2&&(n=!1);let y,x,E,T;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,ua,da),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,pa).longitude,E=i.cartesianToCartographic(y,pa),T=i.cartesianToCartographic(x,vp),D.setEndPoints(E,T),O=D.findIntersectionWithLongitude(I,Ip),A=i.cartographicToCartesian(O,da),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,ua,da),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,pa).longitude,E=i.cartesianToCartographic(y,pa),T=i.cartesianToCartographic(x,vp),D.setEndPoints(E,T),O=D.findIntersectionWithLongitude(I,Ip),A=i.cartographicToCartesian(O,da),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=$b(q,ee.equalsEpsilon),M=q.length,M<2)return;const P=[],k=[],V=[],H=[];let j=mw,r=_w,b=gw,v=yw,z=xw;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),b=Qt(i,G,l,b),n?z=Sl(j,r,b,v,z):z=Tl(G,W,l,i,z),f.pack(z,k,0),f.pack(r,V,0),f.pack(b,H,0),P.push(G.latitude),P.push(G.longitude),bl(G,W,c,l,o,s,i,k,V,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,b),Qt(i,q[d+1],c,v),Sl(j,r,b,v,z),u=k.length,f.pack(z,k,u),f.pack(r,V,u),f.pack(b,H,u),P.push(se.latitude),P.push(se.longitude),bl(q[d],q[d+1],c,l,o,s,i,k,V,H,P)}const X=q[M-1],ie=q[M-2];if(r=Qt(i,X,c,r),b=Qt(i,X,l,b),n){const se=q[0];j=Qt(i,ie,c,j),v=Qt(i,se,c,v),z=Sl(j,r,b,v,z)}else z=Tl(ie,X,l,i,z);if(u=k.length,f.pack(z,k,u),f.pack(r,V,u),f.pack(b,H,u),P.push(X.latitude),P.push(X.longitude),n){for(bl(X,G,c,l,o,s,i,k,V,H,P),u=k.length,d=0;d<3;++d)k[u+d]=k[d],V[u+d]=V[d],H[u+d]=H[d];P.push(G.latitude),P.push(G.longitude)}return Ww(n,a,V,H,k,P,t)};const Cw=new f,Ew=new L,Tw=new J;function Rp(e,t,n,i){const o=gi(n,t,Cw),s=f.dot(o,e);if(s>Ep||s<Tp){const a=gi(i,n,Op),c=s<Tp?S.PI_OVER_TWO:-S.PI_OVER_TWO,l=J.fromAxisAngle(a,c,Tw),u=L.fromQuaternion(l,Ew);return L.multiplyByVector(u,e,e),!0}return!1}const zp=new ee,bw=new f,Pp=new f;function br(e,t,n,i,o){const s=ee.toCartesian(t,e._ellipsoid,bw);let a=f.add(s,n,Pp),c=!1;const l=e._ellipsoid;let u=l.cartesianToCartographic(a,zp);Math.abs(t.longitude-u.longitude)>S.PI_OVER_TWO&&(c=!0,a=f.subtract(s,n,Pp),u=l.cartesianToCartographic(a,zp)),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 ww=new f,Bp=new f;function Np(e,t,n,i,o,s){const a=f.subtract(t,e,ww);f.normalize(a,a);const c=n-bp;let l=f.multiplyByScalar(a,c,Bp);f.add(e,l,o);const u=i-wp;l=f.multiplyByScalar(a,u,Bp),f.add(t,l,s)}const Sw=new f;function ma(e,t){const n=Ne.getPointDistance(ua,e),i=Ne.getPointDistance(ua,t);let o=Sw;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 Aw(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 Fp=new ee,Lp=new ee,Mp=new f,Al=new f,Up=new f,Vp=new f,Dw=new f,kp=new f,Ow=[Fp,Lp],vw=new ce,Iw=new f,Rw=new f,zw=new f,Pw=new f,Bw=new f,Nw=new f,Dl=new f,Ol=new f,Fw=new f,Lw=new f,Mw=new f,Gp=new f,Uw=new f,Vw=new f,kw=new Ye,Gw=new Ye,qp=new f,qw=new f,Hp=new f,Hw=[new K,new K],Wp=[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],jp=Wp.length;function Ww(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),T=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 k=s.length/2;let V=0;const H=Fp;H.height=0;const j=Lp;j.height=0;let r=Mp,b=Al;if(a)for(l=0,c=1;c<k;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),b=t.project(j,b),V+=f.distance(r,b),l+=2;const v=i.length/3;b=f.unpack(i,0,b);let z=0;for(l=3,c=1;c<v;c++)r=f.clone(b,r),b=f.unpack(i,l,b),z+=f.distance(r,b),l+=3;let G;l=3;let W=0,Z=0,X=0,ie=0,se=!1,ge=f.unpack(n,0,Vp),Te=f.unpack(i,0,Al),xe=f.unpack(o,0,kp);if(e){const yt=f.unpack(n,n.length-6,Up);Rp(xe,yt,ge,Te)&&(xe=f.negate(xe,xe))}let ze=0,je=0,tt=0;for(c=0;c<d;c++){const yt=f.clone(ge,Up),cn=f.clone(Te,Mp);let ln=f.clone(xe,Dw);se&&(ln=f.negate(ln,ln)),ge=f.unpack(n,l,Vp),Te=f.unpack(i,l,Al),xe=f.unpack(o,l,kp),se=Rp(xe,yt,ge,Te),H.latitude=s[W],H.longitude=s[W+1],j.latitude=s[W+2],j.longitude=s[W+3];let Vn,Ho,qi,Hi;if(a){const dt=Aw(H,j);Vn=t.project(H,Bw),Ho=t.project(j,Nw);const jo=gi(Ho,Vn,qp);jo.y=Math.abs(jo.y),qi=Dl,Hi=Ol,dt===0||f.dot(jo,f.UNIT_Y)>Ep?(qi=br(t,H,ln,Vn,Dl),Hi=br(t,j,xe,Ho,Ol)):dt===1?(Hi=br(t,j,xe,Ho,Ol),qi.x=0,qi.y=S.sign(H.longitude-Math.abs(j.longitude)),qi.z=0):(qi=br(t,H,ln,Vn,Dl),Hi.x=0,Hi.y=S.sign(H.longitude-j.longitude),Hi.z=0)}const A0=f.distance(cn,Te),D0=Ye.fromCartesian(yt,kw),Sa=f.subtract(ge,yt,Fw),IA=f.normalize(Sa,Gp);let ts=f.subtract(cn,yt,Lw);ts=f.normalize(ts,ts);let Wo=f.cross(IA,ts,Gp);Wo=f.normalize(Wo,Wo);let Aa=f.cross(ts,ln,Uw);Aa=f.normalize(Aa,Aa);let Da=f.subtract(Te,ge,Mw);Da=f.normalize(Da,Da);let Oa=f.cross(xe,Da,Vw);Oa=f.normalize(Oa,Oa);const RA=A0/z,zA=ze/z;let hh=0,ns,va,lo,O0=0,v0=0;if(a){hh=f.distance(Vn,Ho),ns=Ye.fromCartesian(Vn,Gw),va=f.subtract(Ho,Vn,qp),lo=f.normalize(va,qw);const dt=lo.x;lo.x=lo.y,lo.y=-dt,O0=hh/V,v0=je/V}for(G=0;G<8;G++){const dt=ie+G*4,jo=Z+G*2,is=dt+3,R0=G<4?1:-1,Ia=G===2||G===3||G===6||G===7?1:-1;f.pack(D0.high,T,dt),T[is]=Sa.x,f.pack(D0.low,D,dt),D[is]=Sa.y,f.pack(Aa,A,dt),A[is]=Sa.z,f.pack(Oa,O,dt),O[is]=RA*R0,f.pack(Wo,I,dt);let ho=zA*Ia;ho===0&&Ia<0&&(ho=9),I[is]=ho,a&&(B[dt]=ns.high.x,B[dt+1]=ns.high.y,B[dt+2]=ns.low.x,B[dt+3]=ns.low.y,q[dt]=-qi.y,q[dt+1]=qi.x,q[dt+2]=Hi.y,q[dt+3]=-Hi.x,M[dt]=va.x,M[dt+1]=va.y,M[dt+2]=lo.x,M[dt+3]=lo.y,P[jo]=O0*R0,ho=v0*Ia,ho===0&&Ia<0&&(ho=9),P[jo+1]=ho)}const Ti=zw,bi=Pw,wi=Iw,Si=Rw,PA=ce.fromCartographicArray(Ow,vw),I0=Me.getMinimumMaximumHeights(PA,u),fh=I0.minimumTerrainHeight,uh=I0.maximumTerrainHeight;tt+=Math.abs(fh),tt+=Math.abs(uh),Np(yt,cn,fh,uh,Ti,wi),Np(ge,Te,fh,uh,bi,Si);let Ai=f.multiplyByScalar(Wo,S.EPSILON5,Hp);f.add(Ti,Ai,Ti),f.add(bi,Ai,bi),f.add(wi,Ai,wi),f.add(Si,Ai,Si),ma(Ti,bi),ma(wi,Si),f.pack(Ti,E,X),f.pack(bi,E,X+3),f.pack(Si,E,X+6),f.pack(wi,E,X+9),Ai=f.multiplyByScalar(Wo,-2*S.EPSILON5,Hp),f.add(Ti,Ai,Ti),f.add(bi,Ai,bi),f.add(wi,Ai,wi),f.add(Si,Ai,Si),ma(Ti,bi),ma(wi,Si),f.pack(Ti,E,X+12),f.pack(bi,E,X+15),f.pack(Si,E,X+18),f.pack(wi,E,X+21),W+=2,l+=3,Z+=16,X+=24,ie+=32,ze+=A0,je+=hh}l=0;let ut=0;for(c=0;c<d;c++){for(G=0;G<jp;G++)x[l+G]=Wp[G]+ut;ut+=8,l+=jp}const Be=Hw;K.fromVertices(n,f.ZERO,3,Be[0]),K.fromVertices(i,f.ZERO,3,Be[1]);const gt=K.fromBoundingSpheres(Be);gt.radius+=tt/(d*2);const At={position:new Pt({componentDatatype:oe.DOUBLE,componentsPerAttribute:3,normalize:!1,values:E}),startHiAndForwardOffsetX:ki(T),startLoAndForwardOffsetY:ki(D),startNormalAndForwardOffsetZ:ki(A),endNormalAndTextureCoordinateNormalizationX:ki(O),rightNormalAndTextureCoordinateNormalizationY:ki(I)};return a&&(At.startHiLo2D=ki(B),At.offsetAndRight2D=ki(M),At.startEndNormals2D=ki(q),At.texcoordNormalization2D=new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new ht({attributes:At,indices:x,boundingSphere:gt})}function ki(e){return new Pt({componentDatatype:oe.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Vi._projectNormal=br;const jw=`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;
|
|
@@ -5036,7 +5036,7 @@ void main(void)
|
|
|
5036
5036
|
|
|
5037
5037
|
czm_writeDepthClamp();
|
|
5038
5038
|
}
|
|
5039
|
-
`,
|
|
5039
|
+
`,Yw=`in vec3 v_forwardDirectionEC;
|
|
5040
5040
|
in vec3 v_texcoordNormalizationAndHalfWidth;
|
|
5041
5041
|
in float v_batchId;
|
|
5042
5042
|
|
|
@@ -5081,7 +5081,7 @@ void main(void)
|
|
|
5081
5081
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
5082
5082
|
#endif // PER_INSTANCE_COLOR
|
|
5083
5083
|
}
|
|
5084
|
-
`,
|
|
5084
|
+
`,Xw=`in vec3 position3DHigh;
|
|
5085
5085
|
in vec3 position3DLow;
|
|
5086
5086
|
|
|
5087
5087
|
in vec4 startHiAndForwardOffsetX;
|
|
@@ -5258,7 +5258,7 @@ void main()
|
|
|
5258
5258
|
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
|
|
5259
5259
|
#endif
|
|
5260
5260
|
}
|
|
5261
|
-
|
|
5261
|
+
`,$w=`in vec3 position3DHigh;
|
|
5262
5262
|
in vec3 position3DLow;
|
|
5263
5263
|
|
|
5264
5264
|
// In 2D and in 3D, texture coordinate normalization component signs encodes:
|
|
@@ -5426,7 +5426,7 @@ void main()
|
|
|
5426
5426
|
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
|
|
5427
5427
|
#endif
|
|
5428
5428
|
}
|
|
5429
|
-
|
|
5429
|
+
`,Zw=`in vec3 position3DHigh;
|
|
5430
5430
|
in vec3 position3DLow;
|
|
5431
5431
|
in vec3 prevPosition3DHigh;
|
|
5432
5432
|
in vec3 prevPosition3DLow;
|
|
@@ -5630,9 +5630,9 @@ vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float
|
|
|
5630
5630
|
vec4 nextEC = czm_modelViewRelativeToEye * next;
|
|
5631
5631
|
return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
|
|
5632
5632
|
}
|
|
5633
|
-
`;let
|
|
5634
|
-
${
|
|
5635
|
-
${
|
|
5633
|
+
`;let vl=`${Yp}
|
|
5634
|
+
${Zw}`;const Kw=Mu;mt.isInternetExplorer()||(vl=`#define CLIP_POLYLINE
|
|
5635
|
+
${vl}`);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,vl),this._fragmentShaderSource=_(e.fragmentShaderSource,Kw),this._renderState=Mt.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=at.POSITION_ONLY,Gi.prototype.getFragmentShaderSource=Mt.prototype.getFragmentShaderSource,Gi.prototype.isTranslucent=Mt.prototype.isTranslucent,Gi.prototype.getRenderState=Mt.prototype.getRenderState;const Qw=`in vec3 position3DHigh;
|
|
5636
5636
|
in vec3 position3DLow;
|
|
5637
5637
|
in vec3 prevPosition3DHigh;
|
|
5638
5638
|
in vec3 prevPosition3DLow;
|
|
@@ -5665,7 +5665,7 @@ void main()
|
|
|
5665
5665
|
v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
|
|
5666
5666
|
v_polylineAngle = angle;
|
|
5667
5667
|
}
|
|
5668
|
-
`,
|
|
5668
|
+
`,Jw=`#ifdef VECTOR_TILE
|
|
5669
5669
|
uniform vec4 u_highlightColor;
|
|
5670
5670
|
#endif
|
|
5671
5671
|
|
|
@@ -5690,10 +5690,10 @@ void main()
|
|
|
5690
5690
|
|
|
5691
5691
|
czm_writeLogDepth();
|
|
5692
5692
|
}
|
|
5693
|
-
`;let
|
|
5694
|
-
${
|
|
5695
|
-
${
|
|
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}}}),ro.VERTEX_FORMAT=st.POSITION_AND_ST,ro.prototype.getFragmentShaderSource=Mt.prototype.getFragmentShaderSource,ro.prototype.isTranslucent=Mt.prototype.isTranslucent,ro.prototype.getRenderState=Mt.prototype.getRenderState;function yi(e){e=_(e,_.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;h(t)||(t=new ro),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=Xp(!1),this._renderState3DTiles=Xp(!0),this._renderStateMorph=ke.fromCache({cull:{enabled:!0,face:Ro.FRONT},depthTest:{enabled:!0},blending:Ji.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 Fe.initialize()};function eS(e,t,n){const i=t.context,o=e._primitive,s=o._attributeLocations;let a=o._batchTable.getVertexShaderCallback()(Xw);a=De._appendShowToShader(o,a),a=De._appendDistanceDisplayConditionToShader(o,a),a=De._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Yw);c=De._appendShowToShader(o,c),c=De._appendDistanceDisplayConditionToShader(o,c),c=De._modifyShaderPosition(e,c,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(Ww);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 ge({defines:u,sources:[a]}),x=new ge({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 ge({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 T=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!h(T)){const D=new ge({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Fe._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[c]});l=o._batchTable.getVertexShaderCallback()(jw);const A=new ge({defines:g,sources:[p,l]});T=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:D,fragmentShaderSource:A,attributeLocations:s})}e._spMorph=T}function Xp(e){return ke.fromCache({cull:{enabled:!0},blending:Ji.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Jn.EQUAL,frontOperation:{fail:He.KEEP,zFail:He.KEEP,zPass:He.KEEP},backFunction:Jn.EQUAL,backOperation:{fail:He.KEEP,zFail:He.KEEP,zPass:He.KEEP},reference:_i.CESIUM_3D_TILE_MASK,mask:_i.CESIUM_3D_TILE_MASK}})}function tS(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=zt.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const x=$e.shallowClone(y,y.derivedCommands.tileset);x.renderState=e._renderState3DTiles,x.pass=zt.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 T=$e.shallowClone(x,x.derivedCommands.color2D);T.shaderProgram=e._sp2D,x.derivedCommands.color2D=T;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 $p(e,t,n,i,o,s,a){n.mode===pe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==pe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=s,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function nS(e,t,n,i,o,s,a){const c=e._primitive;De._updateBoundingVolumes(c,t,o);let l;t.mode===pe.SCENE3D?l=c._boundingSphereWC:t.mode===pe.COLUMBUS_VIEW?l=c._boundingSphereCV:t.mode===pe.SCENE2D&&h(c._boundingSphere2D)?l=c._boundingSphere2D:h(c._boundingSphereMorph)&&(l=c._boundingSphereMorph);const u=t.mode===pe.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 T=0;T<E;++T){const D=l[T];p&&(y=n[T],$p(e,y,t,o,s,D,a)),g&&(y=n[T].derivedCommands.tileset,$p(e,y,t,o,s,D,a))}}}yi.prototype.update=function(e){if(!h(this._primitive)&&!h(this.geometryInstances))return;if(!Fe.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 Ln({componentDatatype:oe.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,ki.setProjectionAndEllipsoid(l.geometry,e.mapProjection),a[t]=new js({geometry:l.geometry,attributes:c,id:l.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,d){eS(n,u,d)},i._createCommandsFunction=function(l,u,d,p,g,y,x){tS(n,u,d,p,y,x)},i._updateAndQueueCommandsFunction=function(l,u,d,p,g,y,x,E){nS(n,u,d,p,g,y,x)},this._primitive=new De(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))})},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 iS=new U(1,1),oS=!1,rS=w.WHITE;function ko(e){e=_(e,_.EMPTY_OBJECT),this._definitionChanged=new ze,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(ko.prototype,{isConstant:{get:function(){return Se.isConstant(this._image)&&Se.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:L("image"),repeat:L("repeat"),color:L("color"),transparent:L("transparent")}),ko.prototype.getType=function(e){return"Image"};const sS=new $;ko.prototype.getValue=function(e,t){return h(e)||(e=$.now(sS)),h(t)||(t={}),t.image=Se.getValueOrUndefined(this._image,e),t.repeat=Se.getValueOrClonedDefault(this._repeat,e,iS,t.repeat),t.color=Se.getValueOrClonedDefault(this._color,e,rS,t.color),Se.getValueOrDefault(this._transparent,e,oS)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},ko.prototype.equals=function(e){return this===e||e instanceof ko&&Se.equals(this._image,e._image)&&Se.equals(this._repeat,e._repeat)&&Se.equals(this._color,e._color)&&Se.equals(this._transparent,e._transparent)};function aS(e){if(e instanceof w)return new zo(e);if(typeof e=="string"||e instanceof ne||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new ko;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function un(e,t){return L(e,t,aS)}function br(e){this._definitionChanged=new ze,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(br.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),dimensions:L("dimensions"),heightReference:L("heightReference"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition")}),br.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 br(this)},br.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 wr=Object.freeze({FIXED:0,INERTIAL:1});function Vo(){C.throwInstantiationError()}Object.defineProperties(Vo.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}}),Vo.prototype.getValue=C.throwInstantiationError,Vo.prototype.getValueInReferenceFrame=C.throwInstantiationError,Vo.prototype.equals=C.throwInstantiationError;const Zp=new F;Vo.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=me.computeIcrfToCentralBodyFixedMatrix(e,Zp);if(n===wr.INERTIAL)return F.multiplyByVector(s,t,o);if(n===wr.FIXED)return F.multiplyByVector(F.transpose(s,Zp),t,o)};function so(e,t){this._definitionChanged=new ze,this._value=f.clone(e),this._referenceFrame=_(t,wr.FIXED)}Object.defineProperties(so.prototype,{isConstant:{get:function(){return!h(this._value)||this._referenceFrame===wr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});const cS=new $;so.prototype.getValue=function(e,t){return h(e)||(e=$.now(cS)),this.getValueInReferenceFrame(e,wr.FIXED,t)},so.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)},so.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 Vo.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},so.prototype.equals=function(e){return this===e||e instanceof so&&f.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};function Sr(e){this._definitionChanged=new ze,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(Sr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),positions:L("positions"),width:L("width"),height:L("height"),heightReference:L("heightReference"),extrudedHeight:L("extrudedHeight"),extrudedHeightReference:L("extrudedHeightReference"),cornerType:L("cornerType"),granularity:L("granularity"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition"),classificationType:L("classificationType"),zIndex:L("zIndex")}),Sr.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 Sr(this)},Sr.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 lS(e){return e}function Ol(e,t){return L(e,t,lS)}function Ar(e){this._definitionChanged=new ze,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(Ar.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),length:L("length"),topRadius:L("topRadius"),bottomRadius:L("bottomRadius"),heightReference:L("heightReference"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),numberOfVerticalLines:L("numberOfVerticalLines"),slices:L("slices"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition")}),Ar.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 Ar(this)},Ar.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 Dr(e){this._definitionChanged=new ze,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(Dr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),semiMajorAxis:L("semiMajorAxis"),semiMinorAxis:L("semiMinorAxis"),height:L("height"),heightReference:L("heightReference"),extrudedHeight:L("extrudedHeight"),extrudedHeightReference:L("extrudedHeightReference"),rotation:L("rotation"),stRotation:L("stRotation"),granularity:L("granularity"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),numberOfVerticalLines:L("numberOfVerticalLines"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition"),classificationType:L("classificationType"),zIndex:L("zIndex")}),Dr.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 Dr(this)},Dr.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 Or(e){this._definitionChanged=new ze,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(Or.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),radii:L("radii"),innerRadii:L("innerRadii"),minimumClock:L("minimumClock"),maximumClock:L("maximumClock"),minimumCone:L("minimumCone"),maximumCone:L("maximumCone"),heightReference:L("heightReference"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),stackPartitions:L("stackPartitions"),slicePartitions:L("slicePartitions"),subdivisions:L("subdivisions"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition")}),Or.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 Or(this)},Or.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 vr(e){this._definitionChanged=new ze,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(vr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),text:L("text"),font:L("font"),style:L("style"),scale:L("scale"),showBackground:L("showBackground"),backgroundColor:L("backgroundColor"),backgroundPadding:L("backgroundPadding"),pixelOffset:L("pixelOffset"),eyeOffset:L("eyeOffset"),horizontalOrigin:L("horizontalOrigin"),verticalOrigin:L("verticalOrigin"),heightReference:L("heightReference"),fillColor:L("fillColor"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),translucencyByDistance:L("translucencyByDistance"),pixelOffsetScaleByDistance:L("pixelOffsetScaleByDistance"),scaleByDistance:L("scaleByDistance"),distanceDisplayCondition:L("distanceDisplayCondition"),disableDepthTestDistance:L("disableDepthTestDistance")}),vr.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 vr(this)},vr.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 hS=new f(1,1,1),fS=f.ZERO,uS=J.IDENTITY;function vl(e,t,n){this.translation=f.clone(_(e,fS)),this.rotation=J.clone(_(t,uS)),this.scale=f.clone(_(n,hS))}vl.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 Il=new vl;function Ir(e){e=_(e,_.EMPTY_OBJECT),this._definitionChanged=new ze,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(Ir.prototype,{isConstant:{get:function(){return Se.isConstant(this._translation)&&Se.isConstant(this._rotation)&&Se.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:L("translation"),rotation:L("rotation"),scale:L("scale")});const dS=new $;Ir.prototype.getValue=function(e,t){return h(e)||(e=$.now(dS)),h(t)||(t=new vl),t.translation=Se.getValueOrClonedDefault(this._translation,e,Il.translation,t.translation),t.rotation=Se.getValueOrClonedDefault(this._rotation,e,Il.rotation,t.rotation),t.scale=Se.getValueOrClonedDefault(this._scale,e,Il.scale,t.scale),t},Ir.prototype.equals=function(e){return this===e||e instanceof Ir&&Se.equals(this._translation,e._translation)&&Se.equals(this._rotation,e._rotation)&&Se.equals(this._scale,e._scale)};function dn(e,t){this._propertyNames=[],this._definitionChanged=new ze,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(!Se.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 pS(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,L(e,!0,_(n,pS))),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 mS=new $;dn.prototype.getValue=function(e,t){h(e)||(e=$.now(mS)),h(t)||(t={});const n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){const s=n[i];t[s]=Se.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 _S(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||!Se.equals(e[a],t[a]))return!1}return!0}dn.prototype.equals=function(e){return this===e||e instanceof dn&&_S(this,e)};function Kp(e){return new Ir(e)}function gS(e){return new dn(e,Kp)}function yS(e){return new dn(e)}function Rr(e){this._definitionChanged=new ze,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(Rr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),uri:L("uri"),scale:L("scale"),enableVerticalExaggeration:L("enableVerticalExaggeration"),minimumPixelSize:L("minimumPixelSize"),maximumScale:L("maximumScale"),incrementallyLoadTextures:L("incrementallyLoadTextures"),runAnimations:L("runAnimations"),clampAnimations:L("clampAnimations"),shadows:L("shadows"),heightReference:L("heightReference"),silhouetteColor:L("silhouetteColor"),silhouetteSize:L("silhouetteSize"),color:L("color"),colorBlendMode:L("colorBlendMode"),colorBlendAmount:L("colorBlendAmount"),imageBasedLightingFactor:L("imageBasedLightingFactor"),lightColor:L("lightColor"),distanceDisplayCondition:L("distanceDisplayCondition"),nodeTransformations:L("nodeTransformations",void 0,gS),articulations:L("articulations",void 0,yS),clippingPlanes:L("clippingPlanes"),customShader:L("customShader")}),Rr.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 Rr(this)},Rr.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,Kp)}const n=e.articulations;if(h(n)){const i=this.articulations;h(i)?i.merge(n):this.articulations=new dn(n)}};function zr(e){this._definitionChanged=new ze,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(zr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),uri:L("uri"),maximumScreenSpaceError:L("maximumScreenSpaceError")}),zr.prototype.clone=function(e){return h(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,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.uri=_(this.uri,e.uri),this.maximumScreenSpaceError=_(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};function Pr(e){this._definitionChanged=new ze,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(Pr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),leadTime:L("leadTime"),trailTime:L("trailTime"),width:L("width"),resolution:L("resolution"),material:un("material"),distanceDisplayCondition:L("distanceDisplayCondition")}),Pr.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 Pr(this)},Pr.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 Br(e){this._definitionChanged=new ze,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(Br.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),plane:L("plane"),dimensions:L("dimensions"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition")}),Br.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 Br(this)},Br.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 Nr(e){this._definitionChanged=new ze,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(Nr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),pixelSize:L("pixelSize"),heightReference:L("heightReference"),color:L("color"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),scaleByDistance:L("scaleByDistance"),translucencyByDistance:L("translucencyByDistance"),distanceDisplayCondition:L("distanceDisplayCondition"),disableDepthTestDistance:L("disableDepthTestDistance"),splitDirection:L("splitDirection")}),Nr.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 Nr(this)},Nr.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 xS(e,t){this.positions=h(e)?e:[],this.holes=h(t)?t:[]}function CS(e){return Array.isArray(e)&&(e=new xS(e)),new $n(e)}function Lr(e){this._definitionChanged=new ze,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(Lr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),hierarchy:L("hierarchy",void 0,CS),height:L("height"),heightReference:L("heightReference"),extrudedHeight:L("extrudedHeight"),extrudedHeightReference:L("extrudedHeightReference"),stRotation:L("stRotation"),granularity:L("granularity"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),perPositionHeight:L("perPositionHeight"),closeTop:L("closeTop"),closeBottom:L("closeBottom"),arcType:L("arcType"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition"),classificationType:L("classificationType"),zIndex:L("zIndex"),textureCoordinates:L("textureCoordinates")}),Lr.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 Lr(this)},Lr.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 Fr(e){this._definitionChanged=new ze,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(Fr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),positions:L("positions"),width:L("width"),granularity:L("granularity"),material:un("material"),depthFailMaterial:un("depthFailMaterial"),arcType:L("arcType"),clampToGround:L("clampToGround"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition"),classificationType:L("classificationType"),zIndex:L("zIndex")}),Fr.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 Fr(this)},Fr.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 Mr(e){this._definitionChanged=new ze,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(Mr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),positions:L("positions"),shape:L("shape"),cornerType:L("cornerType"),granularity:L("granularity"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition")}),Mr.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 Mr(this)},Mr.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 Ur(e){this._definitionChanged=new ze,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(Ur.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),coordinates:L("coordinates"),height:L("height"),heightReference:L("heightReference"),extrudedHeight:L("extrudedHeight"),extrudedHeightReference:L("extrudedHeightReference"),rotation:L("rotation"),stRotation:L("stRotation"),granularity:L("granularity"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition"),classificationType:L("classificationType"),zIndex:L("zIndex")}),Ur.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 Ur(this)},Ur.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 kr(e){this._definitionChanged=new ze,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(kr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:L("show"),positions:L("positions"),minimumHeights:L("minimumHeights"),maximumHeights:L("maximumHeights"),granularity:L("granularity"),fill:L("fill"),material:un("material"),outline:L("outline"),outlineColor:L("outlineColor"),outlineWidth:L("outlineWidth"),shadows:L("shadows"),distanceDisplayCondition:L("distanceDisplayCondition")}),kr.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 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.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 ES=new ee,Rl=[];function TS(e){return new so(e)}function bS(e){return L(e,void 0,TS)}function vt(e,t){return L(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 ze,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",...Rl],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 zl(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)&&zl(s,s._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(an.prototype,{availability:Ol("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Ol("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&&zl(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&&zl(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:vt("billboard",sr),box:vt("box",br),corridor:vt("corridor",Sr),cylinder:vt("cylinder",Ar),description:L("description"),ellipse:vt("ellipse",Dr),ellipsoid:vt("ellipsoid",Or),label:vt("label",vr),model:vt("model",Rr),tileset:vt("tileset",zr),orientation:L("orientation"),path:vt("path",Pr),plane:vt("plane",Br),point:vt("point",Nr),polygon:vt("polygon",Lr),polyline:vt("polyline",Fr),polylineVolume:vt("polylineVolume",Mr),properties:vt("properties",dn),position:bS("position"),rectangle:vt("rectangle",Ur),viewFrom:L("viewFrom"),wall:vt("wall",kr)}),an.registerEntityType=function(e,t){Object.defineProperties(an.prototype,{[e]:vt(e,t)}),Rl.includes(e)||Rl.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,Ol(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 Qp=new F,Jp=new f,em=new J;an.prototype.computeModelMatrix=function(e,t){m.typeOf.object("time",e);const n=Se.getValueOrUndefined(this._position,e,Jp);if(!h(n))return;const i=Se.getValueOrUndefined(this._orientation,e,em);return h(i)?t=N.fromRotationTranslation(F.fromQuaternion(i,Qp),n,t):t=me.eastNorthUpToFixedFrame(n,void 0,t),t},an.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){m.typeOf.object("time",e);const s=Se.getValueOrDefault(t,e,di.NONE);let a=Se.getValueOrUndefined(this._position,e,Jp);if(s===di.NONE||!h(a)||f.equalsEpsilon(a,f.ZERO,S.EPSILON8))return this.computeModelMatrix(e,o);const c=i.cartesianToCartographic(a,ES);Ws(s)?c.height=n:c.height+=n,a=i.cartographicToCartesian(c,a);const l=Se.getValueOrUndefined(this._orientation,e,em);return h(l)?o=N.fromRotationTranslation(F.fromQuaternion(l,Qp),a,o):o=me.eastNorthUpToFixedFrame(a,void 0,o),o},an.supportsMaterialsforEntitiesOnTerrain=function(e){return sn.supportsMaterials(e)},an.supportsPolylinesOnTerrain=function(e){return yi.isSupported(e)};const St={},wS=new Y(0,0,0,1);let Yt=new Y;const SS=new xe,Pl=new U,Bl=new U;St.worldToWindowCoordinates=function(e,t,n){return St.worldWithEyeOffsetToWindowCoordinates(e,t,f.ZERO,n)};const tm=new Y,nm=new f;function Vr(e,t,n,i){const o=n.viewMatrix,s=N.multiplyByVector(o,Y.fromElements(e.x,e.y,e.z,1,tm),tm),a=f.multiplyComponents(t,f.normalize(s,nm),nm);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 AS=new ee(Math.PI,S.PI_OVER_TWO),DS=new f,OS=new f;St.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=St.computeActualEllipsoidPosition(o,t,wS);if(!h(s))return;const a=e.canvas,c=SS;c.x=0,c.y=0,c.width=a.clientWidth,c.height=a.clientHeight;const l=e.camera;let u=!1;if(o.mode===pe.SCENE2D){const d=e.mapProjection,p=AS,g=d.project(p,DS),y=f.clone(l.position,OS),x=l.frustum.clone(),E=N.computeViewportTransformation(c,0,1,new N),T=l.frustum.projectionMatrix,D=l.positionWC.y,A=f.fromElements(S.sign(D)*g.x-D,0,-l.positionWC.x),O=me.pointToGLWindowCoordinates(T,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,Yt=Vr(s,n,l,Yt),St.clipToGLWindowCoordinates(c,Yt,Pl),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,Yt=Vr(s,n,l,Yt),St.clipToGLWindowCoordinates(c,Yt,Bl)}else{c.x+=O.x,c.width-=O.x,l.frustum.left=-g.x-D,Yt=Vr(s,n,l,Yt),St.clipToGLWindowCoordinates(c,Yt,Pl),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,Yt=Vr(s,n,l,Yt),St.clipToGLWindowCoordinates(c,Yt,Bl)}f.clone(y,l.position),l.frustum=x.clone(),i=U.clone(Pl,i),(i.x<0||i.x>a.clientWidth)&&(i.x=Bl.x)}}if(o.mode!==pe.SCENE2D||u){if(Yt=Vr(s,n,l,Yt),Yt.z<0&&!(l.frustum instanceof rn)&&!(l.frustum instanceof vn))return;i=St.clipToGLWindowCoordinates(c,Yt,i)}return i.y=a.clientHeight-i.y,i},St.worldToDrawingBufferCoordinates=function(e,t,n){if(n=St.worldToWindowCoordinates(e,t,n),!!h(n))return St.transformWindowToDrawingBuffer(e,n,n)};const xi=new f,vS=new ee;St.computeActualEllipsoidPosition=function(e,t,n){const i=e.mode;if(i===pe.SCENE3D)return f.clone(t,n);const o=e.mapProjection,s=o.ellipsoid.cartesianToCartographic(t,vS);if(!h(s))return;if(o.project(s,xi),i===pe.COLUMBUS_VIEW)return f.fromElements(xi.z,xi.x,xi.y,n);if(i===pe.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 im=new f,om=new f,rm=new N;St.clipToGLWindowCoordinates=function(e,t,n){return f.divideByScalar(t,t.w,im),N.computeViewportTransformation(e,0,1,rm),N.multiplyByPoint(rm,im,om),U.fromCartesian3(om,n)},St.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 IS=new Y,sm=new Y;St.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,IS);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,sm);const y=1/p.w;f.multiplyByScalar(p,y,p)}else{const y=g.offCenterFrustum;h(y)&&(g=y),p=sm,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 RS=`uniform sampler2D u_atlas;
|
|
5693
|
+
`;let Il=`${Yp}
|
|
5694
|
+
${Qw}`;const eS=Jw;mt.isInternetExplorer()||(Il=`#define CLIP_POLYLINE
|
|
5695
|
+
${Il}`);function ro(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.translucent,!0),n=!1,i=ro.VERTEX_FORMAT;this.material=h(e.material)?e.material:Q.fromType(Q.ColorType),this.translucent=t,this._vertexShaderSource=_(e.vertexShaderSource,Il),this._fragmentShaderSource=_(e.fragmentShaderSource,eS),this._renderState=Mt.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(ro.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}}}),ro.VERTEX_FORMAT=at.POSITION_AND_ST,ro.prototype.getFragmentShaderSource=Mt.prototype.getFragmentShaderSource,ro.prototype.isTranslucent=Mt.prototype.isTranslucent,ro.prototype.getRenderState=Mt.prototype.getRenderState;function yi(e){e=_(e,_.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;h(t)||(t=new ro),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=Xp(!1),this._renderState3DTiles=Xp(!0),this._renderStateMorph=ke.fromCache({cull:{enabled:!0,face:Ro.FRONT},depthTest:{enabled:!0},blending:Ji.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 tS(e,t,n){const i=t.context,o=e._primitive,s=o._attributeLocations;let a=o._batchTable.getVertexShaderCallback()($w);a=Oe._appendShowToShader(o,a),a=Oe._appendDistanceDisplayConditionToShader(o,a),a=Oe._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Xw);c=Oe._appendShowToShader(o,c),c=Oe._appendDistanceDisplayConditionToShader(o,c),c=Oe._modifyShaderPosition(e,c,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(jw);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=rt.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 T=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!h(T)){const D=new ye({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Me._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[c]});l=o._batchTable.getVertexShaderCallback()(Yw);const A=new ye({defines:g,sources:[p,l]});T=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:D,fragmentShaderSource:A,attributeLocations:s})}e._spMorph=T}function Xp(e){return ke.fromCache({cull:{enabled:!0},blending:Ji.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 nS(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=zt.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const x=$e.shallowClone(y,y.derivedCommands.tileset);x.renderState=e._renderState3DTiles,x.pass=zt.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 T=$e.shallowClone(x,x.derivedCommands.color2D);T.shaderProgram=e._sp2D,x.derivedCommands.color2D=T;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 $p(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 iS(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 T=0;T<E;++T){const D=l[T];p&&(y=n[T],$p(e,y,t,o,s,D,a)),g&&(y=n[T].derivedCommands.tileset,$p(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,Vi.setProjectionAndEllipsoid(l.geometry,e.mapProjection),a[t]=new $s({geometry:l.geometry,attributes:c,id:l.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,d){tS(n,u,d)},i._createCommandsFunction=function(l,u,d,p,g,y,x){nS(n,u,d,p,y,x)},i._updateAndQueueCommandsFunction=function(l,u,d,p,g,y,x,E){iS(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 oS=new U(1,1),rS=!1,sS=w.WHITE;function Vo(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(Vo.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")}),Vo.prototype.getType=function(e){return"Image"};const aS=new $;Vo.prototype.getValue=function(e,t){return h(e)||(e=$.now(aS)),h(t)||(t={}),t.image=Ae.getValueOrUndefined(this._image,e),t.repeat=Ae.getValueOrClonedDefault(this._repeat,e,oS,t.repeat),t.color=Ae.getValueOrClonedDefault(this._color,e,sS,t.color),Ae.getValueOrDefault(this._transparent,e,rS)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},Vo.prototype.equals=function(e){return this===e||e instanceof Vo&&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 cS(e){if(e instanceof w)return new zo(e);if(typeof e=="string"||e instanceof ne||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){const t=new Vo;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function un(e,t){return F(e,t,cS)}function wr(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(wr.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")}),wr.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 wr(this)},wr.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 Sr=Object.freeze({FIXED:0,INERTIAL:1});function ko(){C.throwInstantiationError()}Object.defineProperties(ko.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}}),ko.prototype.getValue=C.throwInstantiationError,ko.prototype.getValueInReferenceFrame=C.throwInstantiationError,ko.prototype.equals=C.throwInstantiationError;const Zp=new L;ko.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,Zp);if(n===Sr.INERTIAL)return L.multiplyByVector(s,t,o);if(n===Sr.FIXED)return L.multiplyByVector(L.transpose(s,Zp),t,o)};function so(e,t){this._definitionChanged=new Pe,this._value=f.clone(e),this._referenceFrame=_(t,Sr.FIXED)}Object.defineProperties(so.prototype,{isConstant:{get:function(){return!h(this._value)||this._referenceFrame===Sr.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});const lS=new $;so.prototype.getValue=function(e,t){return h(e)||(e=$.now(lS)),this.getValueInReferenceFrame(e,Sr.FIXED,t)},so.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)},so.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 ko.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)},so.prototype.equals=function(e){return this===e||e instanceof so&&f.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};function Ar(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(Ar.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")}),Ar.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 Ar(this)},Ar.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 hS(e){return e}function Rl(e,t){return F(e,t,hS)}function Dr(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(Dr.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")}),Dr.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 Dr(this)},Dr.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 Or(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(Or.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")}),Or.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 Or(this)},Or.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 vr(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(vr.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")}),vr.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 vr(this)},vr.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 Ir(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(Ir.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")}),Ir.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 Ir(this)},Ir.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 fS=new f(1,1,1),uS=f.ZERO,dS=J.IDENTITY;function zl(e,t,n){this.translation=f.clone(_(e,uS)),this.rotation=J.clone(_(t,dS)),this.scale=f.clone(_(n,fS))}zl.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 Pl=new zl;function Rr(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(Rr.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 pS=new $;Rr.prototype.getValue=function(e,t){return h(e)||(e=$.now(pS)),h(t)||(t=new zl),t.translation=Ae.getValueOrClonedDefault(this._translation,e,Pl.translation,t.translation),t.rotation=Ae.getValueOrClonedDefault(this._rotation,e,Pl.rotation,t.rotation),t.scale=Ae.getValueOrClonedDefault(this._scale,e,Pl.scale,t.scale),t},Rr.prototype.equals=function(e){return this===e||e instanceof Rr&&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 mS(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,mS))),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 _S=new $;dn.prototype.getValue=function(e,t){h(e)||(e=$.now(_S)),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 gS(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&&gS(this,e)};function Kp(e){return new Rr(e)}function yS(e){return new dn(e,Kp)}function xS(e){return new dn(e)}function zr(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(zr.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,yS),articulations:F("articulations",void 0,xS),clippingPlanes:F("clippingPlanes"),customShader:F("customShader")}),zr.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 zr(this)},zr.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,Kp)}const n=e.articulations;if(h(n)){const i=this.articulations;h(i)?i.merge(n):this.articulations=new dn(n)}};function Pr(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(Pr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),uri:F("uri"),maximumScreenSpaceError:F("maximumScreenSpaceError")}),Pr.prototype.clone=function(e){return h(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Pr(this)},Pr.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 Br(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(Br.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")}),Br.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 Br(this)},Br.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 Nr(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(Nr.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")}),Nr.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 Nr(this)},Nr.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 Fr(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(Fr.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")}),Fr.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 Fr(this)},Fr.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 CS(e,t){this.positions=h(e)?e:[],this.holes=h(t)?t:[]}function ES(e){return Array.isArray(e)&&(e=new CS(e)),new $n(e)}function Lr(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(Lr.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:F("show"),hierarchy:F("hierarchy",void 0,ES),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")}),Lr.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 Lr(this)},Lr.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 Mr(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(Mr.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")}),Mr.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 Mr(this)},Mr.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 Ur(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(Ur.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")}),Ur.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 Ur(this)},Ur.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 Vr(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(Vr.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")}),Vr.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 Vr(this)},Vr.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 kr(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(kr.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")}),kr.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 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.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 TS=new ee,Bl=[];function bS(e){return new so(e)}function wS(e){return F(e,void 0,bS)}function vt(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=kn()),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",...Bl],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 Nl(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)&&Nl(s,s._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(an.prototype,{availability:Rl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Rl("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&&Nl(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&&Nl(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:vt("billboard",ar),box:vt("box",wr),corridor:vt("corridor",Ar),cylinder:vt("cylinder",Dr),description:F("description"),ellipse:vt("ellipse",Or),ellipsoid:vt("ellipsoid",vr),label:vt("label",Ir),model:vt("model",zr),tileset:vt("tileset",Pr),orientation:F("orientation"),path:vt("path",Br),plane:vt("plane",Nr),point:vt("point",Fr),polygon:vt("polygon",Lr),polyline:vt("polyline",Mr),polylineVolume:vt("polylineVolume",Ur),properties:vt("properties",dn),position:wS("position"),rectangle:vt("rectangle",Vr),viewFrom:F("viewFrom"),wall:vt("wall",kr)}),an.registerEntityType=function(e,t){Object.defineProperties(an.prototype,{[e]:vt(e,t)}),Bl.includes(e)||Bl.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,Rl(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 Qp=new L,Jp=new f,em=new J;an.prototype.computeModelMatrix=function(e,t){m.typeOf.object("time",e);const n=Ae.getValueOrUndefined(this._position,e,Jp);if(!h(n))return;const i=Ae.getValueOrUndefined(this._orientation,e,em);return h(i)?t=N.fromRotationTranslation(L.fromQuaternion(i,Qp),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,Jp);if(s===di.NONE||!h(a)||f.equalsEpsilon(a,f.ZERO,S.EPSILON8))return this.computeModelMatrix(e,o);const c=i.cartesianToCartographic(a,TS);Xs(s)?c.height=n:c.height+=n,a=i.cartographicToCartesian(c,a);const l=Ae.getValueOrUndefined(this._orientation,e,em);return h(l)?o=N.fromRotationTranslation(L.fromQuaternion(l,Qp),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 St={},SS=new Y(0,0,0,1);let Xt=new Y;const AS=new Ce,Fl=new U,Ll=new U;St.worldToWindowCoordinates=function(e,t,n){return St.worldWithEyeOffsetToWindowCoordinates(e,t,f.ZERO,n)};const tm=new Y,nm=new f;function Gr(e,t,n,i){const o=n.viewMatrix,s=N.multiplyByVector(o,Y.fromElements(e.x,e.y,e.z,1,tm),tm),a=f.multiplyComponents(t,f.normalize(s,nm),nm);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 DS=new ee(Math.PI,S.PI_OVER_TWO),OS=new f,vS=new f;St.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=St.computeActualEllipsoidPosition(o,t,SS);if(!h(s))return;const a=e.canvas,c=AS;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=DS,g=d.project(p,OS),y=f.clone(l.position,vS),x=l.frustum.clone(),E=N.computeViewportTransformation(c,0,1,new N),T=l.frustum.projectionMatrix,D=l.positionWC.y,A=f.fromElements(S.sign(D)*g.x-D,0,-l.positionWC.x),O=_e.pointToGLWindowCoordinates(T,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=Gr(s,n,l,Xt),St.clipToGLWindowCoordinates(c,Xt,Fl),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=Gr(s,n,l,Xt),St.clipToGLWindowCoordinates(c,Xt,Ll)}else{c.x+=O.x,c.width-=O.x,l.frustum.left=-g.x-D,Xt=Gr(s,n,l,Xt),St.clipToGLWindowCoordinates(c,Xt,Fl),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=Gr(s,n,l,Xt),St.clipToGLWindowCoordinates(c,Xt,Ll)}f.clone(y,l.position),l.frustum=x.clone(),i=U.clone(Fl,i),(i.x<0||i.x>a.clientWidth)&&(i.x=Ll.x)}}if(o.mode!==me.SCENE2D||u){if(Xt=Gr(s,n,l,Xt),Xt.z<0&&!(l.frustum instanceof rn)&&!(l.frustum instanceof vn))return;i=St.clipToGLWindowCoordinates(c,Xt,i)}return i.y=a.clientHeight-i.y,i},St.worldToDrawingBufferCoordinates=function(e,t,n){if(n=St.worldToWindowCoordinates(e,t,n),!!h(n))return St.transformWindowToDrawingBuffer(e,n,n)};const xi=new f,IS=new ee;St.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,IS);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 im=new f,om=new f,rm=new N;St.clipToGLWindowCoordinates=function(e,t,n){return f.divideByScalar(t,t.w,im),N.computeViewportTransformation(e,0,1,rm),N.multiplyByPoint(rm,im,om),U.fromCartesian3(om,n)},St.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 RS=new Y,sm=new Y;St.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,RS);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,sm);const y=1/p.w;f.multiplyByScalar(p,y,p)}else{const y=g.offCenterFrustum;h(y)&&(g=y),p=sm,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 zS=`uniform sampler2D u_atlas;
|
|
5697
5697
|
|
|
5698
5698
|
#ifdef VECTOR_TILE
|
|
5699
5699
|
uniform vec4 u_highlightColor;
|
|
@@ -5901,7 +5901,7 @@ void main()
|
|
|
5901
5901
|
#endif
|
|
5902
5902
|
|
|
5903
5903
|
}
|
|
5904
|
-
`,
|
|
5904
|
+
`,PS=`#ifdef INSTANCED
|
|
5905
5905
|
in vec2 direction;
|
|
5906
5906
|
#endif
|
|
5907
5907
|
in vec4 positionHighAndScale;
|
|
@@ -6337,19 +6337,19 @@ if (lengthSq < disableDepthTestDistance) {
|
|
|
6337
6337
|
v_color.a *= translucency;
|
|
6338
6338
|
v_splitDirection = splitDirection;
|
|
6339
6339
|
}
|
|
6340
|
-
`;function he(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=Te.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Te.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Te.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=w.clone(_(e.color,w.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=pe.SCENE3D,this._clusterShow=!0,this._outlineColor=w.clone(_(e.outlineColor,w.BLACK)),this._outlineWidth=_(e.outlineWidth,0),this._updateClamping(),this._splitDirection=_(e.splitDirection,Au.NONE)}const am=he.SHOW_INDEX=0,da=he.POSITION_INDEX=1,cm=he.PIXEL_OFFSET_INDEX=2,PS=he.EYE_OFFSET_INDEX=3,BS=he.HORIZONTAL_ORIGIN_INDEX=4,NS=he.VERTICAL_ORIGIN_INDEX=5,LS=he.SCALE_INDEX=6,pa=he.IMAGE_INDEX_INDEX=7,lm=he.COLOR_INDEX=8,FS=he.ROTATION_INDEX=9,MS=he.ALIGNED_AXIS_INDEX=10,US=he.SCALE_BY_DISTANCE_INDEX=11,kS=he.TRANSLUCENCY_BY_DISTANCE_INDEX=12,VS=he.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,qS=he.DISTANCE_DISPLAY_CONDITION=14,GS=he.DISABLE_DEPTH_DISTANCE=15;he.TEXTURE_COORDINATE_BOUNDS=16;const hm=he.SDF_INDEX=17,HS=he.SPLIT_DIRECTION_INDEX=18;he.NUMBER_OF_PROPERTIES=19;function Ze(e,t){const n=e._billboardCollection;h(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(he.prototype,{show:{get:function(){return this._show},set:function(e){m.typeOf.bool("value",e),this._show!==e&&(this._show=e,Ze(this,am))}},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,da))}},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,da))}},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,cm))}},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;Te.equals(t,e)||(this._scaleByDistance=Te.clone(e,t),Ze(this,US))}},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;Te.equals(t,e)||(this._translucencyByDistance=Te.clone(e,t),Ze(this,kS))}},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;Te.equals(t,e)||(this._pixelOffsetScaleByDistance=Te.clone(e,t),Ze(this,VS))}},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,PS))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){m.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Ze(this,BS))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){m.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,Ze(this,NS))}},scale:{get:function(){return this._scale},set:function(e){m.typeOf.number("value",e),this._scale!==e&&(this._scale=e,Ze(this,LS))}},color:{get:function(){return this._color},set:function(e){m.typeOf.object("value",e);const t=this._color;w.equals(t,e)||(w.clone(e,t),Ze(this,lm))}},rotation:{get:function(){return this._rotation},set:function(e){m.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,Ze(this,FS))}},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,MS))}},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,pa))}},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,pa))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){m.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,Ze(this,lm))}},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,qS)}}},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,GS))}},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,pa))}},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,da)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ze(this,am))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;w.equals(t,e)||(w.clone(e,t),Ze(this,hm))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ze(this,hm))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ze(this,HS))}}}),he.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},he.prototype._updateClamping=function(){he._updateClamping(this._billboardCollection,this)};const ma=new ee;he._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);yx(t._heightReference)&&(t._mode===pe.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,ma);const l=n.getHeight(a,t._heightReference);h(l)&&(ma.height=l),c(ma)},he.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||!xe.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,pa);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})},he.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())},he.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&&xe.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=xe.clone(t),h(this._billboardCollection._textureAtlas)&&this._loadImage())},he.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,cm))},he.prototype._getActualPosition=function(){return h(this._clampedPosition)?this._clampedPosition:this._actualPosition},he.prototype._setActualPosition=function(e){h(this._clampedPosition)||f.clone(e,this._actualPosition),Ze(this,da)};const fm=new Y;he._computeActualPosition=function(e,t,n,i){return h(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===pe.SCENE3D?t:(N.multiplyByPoint(i,t,fm),St.computeActualEllipsoidPosition(n,fm))};const um=new f;he._computeScreenSpacePosition=function(e,t,n,i,o,s){const a=N.multiplyByPoint(e,t,um),c=St.worldWithEyeOffsetToWindowCoordinates(o,a,n,s);if(h(c))return U.add(c,i,c),c};const _a=new U(0,0);he.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,_a),U.add(_a,this._translate,_a);let i=n.modelMatrix,o=this._position;if(h(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==pe.SCENE3D)){const a=e.mapProjection,c=a.ellipsoid,l=a.unproject(o,ma);o=c.cartographicToCartesian(l,um),i=N.IDENTITY}return he._computeScreenSpacePosition(i,o,this._eyeOffset,_a,e,t)},he.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 xe),n.x=a,n.y=c,n.width=i,n.height=o,n},he.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&&xe.equals(this._imageSubRegion,e._imageSubRegion)&&w.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&f.equals(this._eyeOffset,e._eyeOffset)&&Te.equals(this._scaleByDistance,e._scaleByDistance)&&Te.equals(this._translucencyByDistance,e._translucencyByDistance)&&Te.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},he.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 ht=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 WS=new U(16,16);function ni(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.borderWidthInPixels,1),n=_(e.initialSize,WS);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,ue.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 Bt({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 jS(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 T=new Bt({context:e._context,width:l,height:u,pixelFormat:e._pixelFormat}),D=new On({context:n,colorTextures:[e._texture],destroyAttachments:!1});D._bind(),T.copyFromFramebuffer(0,0,0,0,l,u),D._unBind(),D.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=T,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 Bt({context:e._context,width:a,height:c,pixelFormat:e._pixelFormat}),e._root=new Ci(new U(s,s),new U(a,c))}}function ga(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 ga(e,t.childNode1,n)}return ga(e,t.childNode1,n)||ga(e,t.childNode2,n)}}function dm(e,t,n){const i=ga(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 xe(l,u,d,p),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else jS(e,t),dm(e,t,n);e._guid=Vn()}function pm(e,t){if(!h(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return dm(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=pm(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=pm(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 xe(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 YS=he.SHOW_INDEX,qr=he.POSITION_INDEX,mm=he.PIXEL_OFFSET_INDEX,_m=he.EYE_OFFSET_INDEX,XS=he.HORIZONTAL_ORIGIN_INDEX,$S=he.VERTICAL_ORIGIN_INDEX,ZS=he.SCALE_INDEX,Gr=he.IMAGE_INDEX_INDEX,gm=he.COLOR_INDEX,KS=he.ROTATION_INDEX,QS=he.ALIGNED_AXIS_INDEX,ym=he.SCALE_BY_DISTANCE_INDEX,xm=he.TRANSLUCENCY_BY_DISTANCE_INDEX,Cm=he.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Em=he.DISTANCE_DISPLAY_CONDITION,JS=he.DISABLE_DEPTH_DISTANCE,e1=he.TEXTURE_COORDINATE_BOUNDS,Tm=he.SDF_INDEX,bm=he.SPLIT_DIRECTION_INDEX,Nl=he.NUMBER_OF_PROPERTIES;let Ue;const t1={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},n1={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 Qt(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(Nl),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,ht.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=pe.SCENE3D,this._buffersUsage=[Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW],this._highlightColor=w.clone(w.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(Qt.prototype,{length:{get:function(){return Ll(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 wm(e){const t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Qt.prototype.add=function(e){const t=new he(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},Qt.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1},Qt.prototype.removeAll=function(){wm(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Ll(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}}Qt.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},Qt.prototype.contains=function(e){return h(e)&&e._billboardCollection===this},Qt.prototype.get=function(e){return m.typeOf.number("index",e),Ll(this),this._billboards[e]};let Fl;function i1(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=Ot.createIndexBuffer({context:e,typedArray:o,usage:Ae.STATIC_DRAW,indexDatatype:xt.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function o1(e){let t=e.cache.billboardCollection_indexBufferInstanced;return h(t)||(t=Ot.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ae.STATIC_DRAW,indexDatatype:xt.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function r1(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return h(t)||(t=Ot.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ae.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Qt.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Nl;++i){const o=n[i]===0?Ae.STATIC_DRAW:Ae.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function s1(e,t,n,i,o,s){const a=[{index:Ue.positionHighAndScale,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[qr]},{index:Ue.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[qr]},{index:Ue.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[mm]},{index:Ue.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[xm]},{index:Ue.compressedAttribute2,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[gm]},{index:Ue.eyeOffset,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[_m]},{index:Ue.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[ym]},{index:Ue.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Cm]},{index:Ue.compressedAttribute3,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Em]},{index:Ue.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[e1]},{index:Ue.splitDirection,componentsPerAttribute:1,componentDatatype:oe.FLOAT,usage:n[bm]}];i&&a.push({index:Ue.direction,componentsPerAttribute:2,componentDatatype:oe.FLOAT,vertexBuffer:r1(e)}),h(o)&&a.push({index:Ue.a_batchId,componentsPerAttribute:1,componentDatatype:oe.FLOAT,bufferUsage:Ae.STATIC_DRAW}),s&&a.push({index:Ue.sdf,componentsPerAttribute:2,componentDatatype:oe.FLOAT,usage:n[Tm]});const c=i?t:4*t;return new bt(e,a,c,i)}const Ml=new je;function Sm(e,t,n,i,o){let s;const a=i[Ue.positionHighAndScale],c=i[Ue.positionLowAndRotation],l=o._getActualPosition();e._mode===pe.SCENE3D&&(K.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),je.fromCartesian(l,Ml);const u=o.scale,d=o.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);const p=Ml.high,g=Ml.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 Tn=new U,bn=32768,qo=65536,Ul=4096,ii=256,a1=128,c1=32,l1=8,Am=4,h1=1/256,Dm=0,Om=2,vm=3,Im=1;function Rm(e,t,n,i,o){let s;const a=i[Ue.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 T=0,D=0,A=0,O=0;const I=o._imageIndex;if(I!==-1){const q=n[I];if(!h(q))throw new C(`Invalid billboard image index: ${I}`);T=q.x,D=q.y,A=q.width,O=q.height}const B=T+A,M=D+O;let G=Math.floor(S.clamp(l,-bn,bn)+bn)*a1;G+=(y+1)*c1,G+=(x+1)*l1,G+=(E?1:0)*Am;let P=Math.floor(S.clamp(u,-bn,bn)+bn)*ii,V=Math.floor(S.clamp(p,-bn,bn)+bn)*ii;const k=(S.clamp(g,-bn,bn)+bn)*h1,H=Math.floor(k),j=Math.floor((k-H)*ii);P+=H,V+=j,Tn.x=T,Tn.y=D;const r=be.compressTextureCoordinates(Tn);Tn.x=B;const b=be.compressTextureCoordinates(Tn);Tn.y=M;const v=be.compressTextureCoordinates(Tn);Tn.x=T;const z=be.compressTextureCoordinates(Tn);e._instanced?(s=o._index,a(s,G,P,V,r)):(s=o._index*4,a(s+0,G+Dm,P,V,r),a(s+1,G+Om,P,V,b),a(s+2,G+vm,P,V,v),a(s+3,G+Im,P,V,z))}function zm(e,t,n,i,o){let s;const a=i[Ue.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,T=Math.round(_(o.width,E*y));e._maxSize=Math.max(e._maxSize,T);let D=S.clamp(T,0,qo),A=0;Math.abs(f.magnitudeSquared(c)-1)<S.EPSILON6&&(A=be.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 kl(e,t,n,i,o){let s;const a=i[Ue.compressedAttribute2],c=o.color,l=h(e._batchTable)?w.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 G=n[g];if(!h(G))throw new C(`Invalid billboard image index: ${g}`);p=G.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 T=x*Am+E;let D=w.floatToByte(c.red),A=w.floatToByte(c.green),O=w.floatToByte(c.blue);const I=D*qo+A*ii+O;D=w.floatToByte(l.red),A=w.floatToByte(l.green),O=w.floatToByte(l.blue);const B=D*qo+A*ii+O;let M=w.floatToByte(c.alpha)*qo+w.floatToByte(l.alpha)*ii;M+=u*2+d,e._instanced?(s=o._index,a(s,I,B,M,T)):(s=o._index*4,a(s+0,I,B,M,T),a(s+1,I,B,M,T),a(s+2,I,B,M,T),a(s+3,I,B,M,T))}function Vl(e,t,n,i,o){let s;const a=i[Ue.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}Tn.x=u,Tn.y=d;const g=be.compressTextureCoordinates(Tn);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 Pm(e,t,n,i,o){let s;const a=i[Ue.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 Bm(e,t,n,i,o){let s;const a=i[Ue.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 Nm(e,t,n,i,o){let s;const a=i[Ue.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=Ws(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,Ul)),E=Math.floor(S.clamp(g,0,Ul)),T=x*Ul+E;e._instanced?(s=o._index,a(s,c,l,d,T)):(s=o._index*4,a(s+0,c,l,d,T),a(s+1,c,l,d,T),a(s+2,c,l,d,T),a(s+3,c,l,d,T))}function Lm(e,t,n,i,o){if(Ws(o.heightReference)){const x=e._scene,E=t.context,T=t.globeTranslucencyState.translucent,D=h(x.globe)&&x.globe.depthTestAgainstTerrain;e._shaderClampToGround=E.depthTexture&&!T&&D}let s;const a=i[Ue.textureCoordinateBoundsOrLabelTranslate];if(Ce.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 f1(e,t,n,i,o){if(!h(e._batchTable))return;const s=i[Ue.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 Fm(e,t,n,i,o){if(!e._sdf)return;let s;const a=i[Ue.sdf],c=o.outlineColor,l=o.outlineWidth,u=w.floatToByte(c.red),d=w.floatToByte(c.green),p=w.floatToByte(c.blue),g=u*qo+d*ii+p,y=l/pn.RADIUS,x=w.floatToByte(c.alpha)*qo+w.floatToByte(y)*ii;e._instanced?(s=o._index,a(s,g,x)):(s=o._index*4,a(s+0,g+Dm,x),a(s+1,g+Om,x),a(s+2,g+vm,x),a(s+3,g+Im,x))}function Mm(e,t,n,i,o){const s=i[Ue.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 u1(e,t,n,i,o){Sm(e,t,n,i,o),Rm(e,t,n,i,o),zm(e,t,n,i,o),kl(e,t,n,i,o),Vl(e,t,n,i,o),Pm(e,t,n,i,o),Bm(e,t,n,i,o),Nm(e,t,n,i,o),Lm(e,t,n,i,o),f1(e,t,n,i,o),Fm(e,t,n,i,o),Mm(e,t,n,i,o)}function ql(e,t,n,i,o,s){let a;i.mode===pe.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=he._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 d1(e,t){const n=t.mode,i=e._billboards,o=e._billboardsToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==pe.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===pe.SCENE3D||n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&ql(e,i,i.length,t,s,!0)):n===pe.MORPHING?ql(e,i,i.length,t,s,!0):(n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&ql(e,o,e._billboardsToUpdateIndex,t,s,!1)}function p1(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 m1(e,t){const i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
|
|
6340
|
+
`;function he(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=be.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=be.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=be.clone(o)}if(h(s)){if(s.far<=s.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");s=st.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=w.clone(_(e.color,w.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=kn()),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=w.clone(_(e.outlineColor,w.BLACK)),this._outlineWidth=_(e.outlineWidth,0),this._updateClamping(),this._splitDirection=_(e.splitDirection,Au.NONE)}const am=he.SHOW_INDEX=0,_a=he.POSITION_INDEX=1,cm=he.PIXEL_OFFSET_INDEX=2,BS=he.EYE_OFFSET_INDEX=3,NS=he.HORIZONTAL_ORIGIN_INDEX=4,FS=he.VERTICAL_ORIGIN_INDEX=5,LS=he.SCALE_INDEX=6,ga=he.IMAGE_INDEX_INDEX=7,lm=he.COLOR_INDEX=8,MS=he.ROTATION_INDEX=9,US=he.ALIGNED_AXIS_INDEX=10,VS=he.SCALE_BY_DISTANCE_INDEX=11,kS=he.TRANSLUCENCY_BY_DISTANCE_INDEX=12,GS=he.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,qS=he.DISTANCE_DISPLAY_CONDITION=14,HS=he.DISABLE_DEPTH_DISTANCE=15;he.TEXTURE_COORDINATE_BOUNDS=16;const hm=he.SDF_INDEX=17,WS=he.SPLIT_DIRECTION_INDEX=18;he.NUMBER_OF_PROPERTIES=19;function Ze(e,t){const n=e._billboardCollection;h(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(he.prototype,{show:{get:function(){return this._show},set:function(e){m.typeOf.bool("value",e),this._show!==e&&(this._show=e,Ze(this,am))}},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,_a))}},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,_a))}},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,cm))}},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;be.equals(t,e)||(this._scaleByDistance=be.clone(e,t),Ze(this,VS))}},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;be.equals(t,e)||(this._translucencyByDistance=be.clone(e,t),Ze(this,kS))}},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;be.equals(t,e)||(this._pixelOffsetScaleByDistance=be.clone(e,t),Ze(this,GS))}},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,BS))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){m.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Ze(this,NS))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){m.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,Ze(this,FS))}},scale:{get:function(){return this._scale},set:function(e){m.typeOf.number("value",e),this._scale!==e&&(this._scale=e,Ze(this,LS))}},color:{get:function(){return this._color},set:function(e){m.typeOf.object("value",e);const t=this._color;w.equals(t,e)||(w.clone(e,t),Ze(this,lm))}},rotation:{get:function(){return this._rotation},set:function(e){m.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,Ze(this,MS))}},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,US))}},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,ga))}},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,ga))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){m.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,Ze(this,lm))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!st.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=st.clone(e,this._distanceDisplayCondition),Ze(this,qS)}}},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,HS))}},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(kn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Ze(this,ga))}},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,_a)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ze(this,am))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;w.equals(t,e)||(w.clone(e,t),Ze(this,hm))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ze(this,hm))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ze(this,WS))}}}),he.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},he.prototype._updateClamping=function(){he._updateClamping(this._billboardCollection,this)};const ya=new ee;he._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);xx(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,ya);const l=n.getHeight(a,t._heightReference);h(l)&&(ya.height=l),c(ya)},he.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,ga);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})},he.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())},he.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())},he.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,cm))},he.prototype._getActualPosition=function(){return h(this._clampedPosition)?this._clampedPosition:this._actualPosition},he.prototype._setActualPosition=function(e){h(this._clampedPosition)||f.clone(e,this._actualPosition),Ze(this,_a)};const fm=new Y;he._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,fm),St.computeActualEllipsoidPosition(n,fm))};const um=new f;he._computeScreenSpacePosition=function(e,t,n,i,o,s){const a=N.multiplyByPoint(e,t,um),c=St.worldWithEyeOffsetToWindowCoordinates(o,a,n,s);if(h(c))return U.add(c,i,c),c};const xa=new U(0,0);he.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,xa),U.add(xa,this._translate,xa);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,ya);o=c.cartographicToCartesian(l,um),i=N.IDENTITY}return he._computeScreenSpacePosition(i,o,this._eyeOffset,xa,e,t)},he.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},he.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)&&w.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&f.equals(this._eyeOffset,e._eyeOffset)&&be.equals(this._scaleByDistance,e._scaleByDistance)&&be.equals(this._translucencyByDistance,e._translucencyByDistance)&&be.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&st.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},he.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 jS=new U(16,16);function ni(e){e=_(e,_.EMPTY_OBJECT);const t=_(e.borderWidthInPixels,1),n=_(e.initialSize,jS);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=kn(),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 Bt({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 YS(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 T=new Bt({context:e._context,width:l,height:u,pixelFormat:e._pixelFormat}),D=new On({context:n,colorTextures:[e._texture],destroyAttachments:!1});D._bind(),T.copyFromFramebuffer(0,0,0,0,l,u),D._unBind(),D.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=T,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 Bt({context:e._context,width:a,height:c,pixelFormat:e._pixelFormat}),e._root=new Ci(new U(s,s),new U(a,c))}}function Ca(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 Ca(e,t.childNode1,n)}return Ca(e,t.childNode1,n)||Ca(e,t.childNode2,n)}}function dm(e,t,n){const i=Ca(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 YS(e,t),dm(e,t,n);e._guid=kn()}function pm(e,t){if(!h(e)||e.isDestroyed())return-1;const n=e.numberOfImages;return dm(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=pm(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=pm(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 ct(`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=kn(),g})},ni.prototype.isDestroyed=function(){return!1},ni.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),Qe(this)};const XS=he.SHOW_INDEX,qr=he.POSITION_INDEX,mm=he.PIXEL_OFFSET_INDEX,_m=he.EYE_OFFSET_INDEX,$S=he.HORIZONTAL_ORIGIN_INDEX,ZS=he.VERTICAL_ORIGIN_INDEX,KS=he.SCALE_INDEX,Hr=he.IMAGE_INDEX_INDEX,gm=he.COLOR_INDEX,QS=he.ROTATION_INDEX,JS=he.ALIGNED_AXIS_INDEX,ym=he.SCALE_BY_DISTANCE_INDEX,xm=he.TRANSLUCENCY_BY_DISTANCE_INDEX,Cm=he.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Em=he.DISTANCE_DISPLAY_CONDITION,e1=he.DISABLE_DEPTH_DISTANCE,t1=he.TEXTURE_COORDINATE_BOUNDS,Tm=he.SDF_INDEX,bm=he.SPLIT_DIRECTION_INDEX,Ml=he.NUMBER_OF_PROPERTIES;let Ve;const n1={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},i1={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(Ml),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=w.clone(w.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 Ul(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 wm(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 he(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(){wm(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Ul(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),Ul(this),this._billboards[e]};let Vl;function o1(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=Ot.createIndexBuffer({context:e,typedArray:o,usage:De.STATIC_DRAW,indexDatatype:xt.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function r1(e){let t=e.cache.billboardCollection_indexBufferInstanced;return h(t)||(t=Ot.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:De.STATIC_DRAW,indexDatatype:xt.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function s1(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return h(t)||(t=Ot.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<Ml;++i){const o=n[i]===0?De.STATIC_DRAW:De.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function a1(e,t,n,i,o,s){const a=[{index:Ve.positionHighAndScale,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[qr]},{index:Ve.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[qr]},{index:Ve.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[mm]},{index:Ve.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[xm]},{index:Ve.compressedAttribute2,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[gm]},{index:Ve.eyeOffset,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[_m]},{index:Ve.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[ym]},{index:Ve.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Cm]},{index:Ve.compressedAttribute3,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Em]},{index:Ve.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[t1]},{index:Ve.splitDirection,componentsPerAttribute:1,componentDatatype:oe.FLOAT,usage:n[bm]}];i&&a.push({index:Ve.direction,componentsPerAttribute:2,componentDatatype:oe.FLOAT,vertexBuffer:s1(e)}),h(o)&&a.push({index:Ve.a_batchId,componentsPerAttribute:1,componentDatatype:oe.FLOAT,bufferUsage:De.STATIC_DRAW}),s&&a.push({index:Ve.sdf,componentsPerAttribute:2,componentDatatype:oe.FLOAT,usage:n[Tm]});const c=i?t:4*t;return new bt(e,a,c,i)}const kl=new Ye;function Sm(e,t,n,i,o){let s;const a=i[Ve.positionHighAndScale],c=i[Ve.positionLowAndRotation],l=o._getActualPosition();e._mode===me.SCENE3D&&(K.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),Ye.fromCartesian(l,kl);const u=o.scale,d=o.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);const p=kl.high,g=kl.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 Tn=new U,bn=32768,Go=65536,Gl=4096,ii=256,c1=128,l1=32,h1=8,Am=4,f1=1/256,Dm=0,Om=2,vm=3,Im=1;function Rm(e,t,n,i,o){let s;const a=i[Ve.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 T=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}`);T=G.x,D=G.y,A=G.width,O=G.height}const B=T+A,M=D+O;let q=Math.floor(S.clamp(l,-bn,bn)+bn)*c1;q+=(y+1)*l1,q+=(x+1)*h1,q+=(E?1:0)*Am;let P=Math.floor(S.clamp(u,-bn,bn)+bn)*ii,k=Math.floor(S.clamp(p,-bn,bn)+bn)*ii;const V=(S.clamp(g,-bn,bn)+bn)*f1,H=Math.floor(V),j=Math.floor((V-H)*ii);P+=H,k+=j,Tn.x=T,Tn.y=D;const r=we.compressTextureCoordinates(Tn);Tn.x=B;const b=we.compressTextureCoordinates(Tn);Tn.y=M;const v=we.compressTextureCoordinates(Tn);Tn.x=T;const z=we.compressTextureCoordinates(Tn);e._instanced?(s=o._index,a(s,q,P,k,r)):(s=o._index*4,a(s+0,q+Dm,P,k,r),a(s+1,q+Om,P,k,b),a(s+2,q+vm,P,k,v),a(s+3,q+Im,P,k,z))}function zm(e,t,n,i,o){let s;const a=i[Ve.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,T=Math.round(_(o.width,E*y));e._maxSize=Math.max(e._maxSize,T);let D=S.clamp(T,0,Go),A=0;Math.abs(f.magnitudeSquared(c)-1)<S.EPSILON6&&(A=we.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 ql(e,t,n,i,o){let s;const a=i[Ve.compressedAttribute2],c=o.color,l=h(e._batchTable)?w.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 T=x*Am+E;let D=w.floatToByte(c.red),A=w.floatToByte(c.green),O=w.floatToByte(c.blue);const I=D*Go+A*ii+O;D=w.floatToByte(l.red),A=w.floatToByte(l.green),O=w.floatToByte(l.blue);const B=D*Go+A*ii+O;let M=w.floatToByte(c.alpha)*Go+w.floatToByte(l.alpha)*ii;M+=u*2+d,e._instanced?(s=o._index,a(s,I,B,M,T)):(s=o._index*4,a(s+0,I,B,M,T),a(s+1,I,B,M,T),a(s+2,I,B,M,T),a(s+3,I,B,M,T))}function Hl(e,t,n,i,o){let s;const a=i[Ve.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}Tn.x=u,Tn.y=d;const g=we.compressTextureCoordinates(Tn);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 Pm(e,t,n,i,o){let s;const a=i[Ve.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 Bm(e,t,n,i,o){let s;const a=i[Ve.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 Nm(e,t,n,i,o){let s;const a=i[Ve.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=Xs(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,Gl)),E=Math.floor(S.clamp(g,0,Gl)),T=x*Gl+E;e._instanced?(s=o._index,a(s,c,l,d,T)):(s=o._index*4,a(s+0,c,l,d,T),a(s+1,c,l,d,T),a(s+2,c,l,d,T),a(s+3,c,l,d,T))}function Fm(e,t,n,i,o){if(Xs(o.heightReference)){const x=e._scene,E=t.context,T=t.globeTranslucencyState.translucent,D=h(x.globe)&&x.globe.depthTestAgainstTerrain;e._shaderClampToGround=E.depthTexture&&!T&&D}let s;const a=i[Ve.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 u1(e,t,n,i,o){if(!h(e._batchTable))return;const s=i[Ve.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 Lm(e,t,n,i,o){if(!e._sdf)return;let s;const a=i[Ve.sdf],c=o.outlineColor,l=o.outlineWidth,u=w.floatToByte(c.red),d=w.floatToByte(c.green),p=w.floatToByte(c.blue),g=u*Go+d*ii+p,y=l/pn.RADIUS,x=w.floatToByte(c.alpha)*Go+w.floatToByte(y)*ii;e._instanced?(s=o._index,a(s,g,x)):(s=o._index*4,a(s+0,g+Dm,x),a(s+1,g+Om,x),a(s+2,g+vm,x),a(s+3,g+Im,x))}function Mm(e,t,n,i,o){const s=i[Ve.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 d1(e,t,n,i,o){Sm(e,t,n,i,o),Rm(e,t,n,i,o),zm(e,t,n,i,o),ql(e,t,n,i,o),Hl(e,t,n,i,o),Pm(e,t,n,i,o),Bm(e,t,n,i,o),Nm(e,t,n,i,o),Fm(e,t,n,i,o),u1(e,t,n,i,o),Lm(e,t,n,i,o),Mm(e,t,n,i,o)}function Wl(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=he._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 p1(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)&&Wl(e,i,i.length,t,s,!0)):n===me.MORPHING?Wl(e,i,i.length,t,s,!0):(n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&Wl(e,o,e._billboardsToUpdateIndex,t,s,!1)}function m1(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 _1(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=zt.OVERLAY,i}const _1=[];Qt.prototype.update=function(e){if(Ll(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,Ue=this._instanced?n1:t1,Fl=this._instanced?o1:i1;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;d1(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<Nl;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=s1(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,u1(this,e,s,p,V)}this._vaf.commit(Fl(i))}this._billboardsToUpdateIndex=0}else if(c>0){const P=_1;P.length=0,(l[qr]||l[KS]||l[ZS])&&P.push(Sm),(l[Gr]||l[mm]||l[XS]||l[$S]||l[YS])&&(P.push(Rm),this._instanced&&P.push(Vl)),(l[Gr]||l[QS]||l[xm])&&(P.push(zm),P.push(kl)),(l[Gr]||l[gm])&&P.push(kl),l[_m]&&P.push(Vl),l[ym]&&P.push(Pm),l[Cm]&&P.push(Bm),(l[Em]||l[JS]||l[Gr]||l[qr])&&P.push(Nm),(l[Gr]||l[qr])&&P.push(Lm),l[Tm]&&P.push(Fm),l[bm]&&P.push(Mm);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(Fl(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===pe.SCENE3D?(E=this.modelMatrix,x=K.clone(this._baseVolumeWC,this._boundingVolume)):x=K.clone(this._baseVolume2D,this._boundingVolume),p1(this,e,x);const T=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,T){this._blendOption===ht.OPAQUE||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:R.LESS},depthMask:!0}):this._rsOpaque=void 0;const P=this._blendOption===ht.TRANSLUCENT;this._blendOption===ht.TRANSLUCENT||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:P?R.LEQUAL:R.LESS},depthMask:P,blending:Ji.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let D,A,O,I,B;const M=Ce.maximumVertexTextureImageUnits>0;if(T||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=zS,A=RS,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 ge({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===ht.OPAQUE_AND_TRANSLUCENT&&(I=new ge({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:Ue}),I=new ge({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:Ue})),this._blendOption===ht.OPAQUE&&(I=new ge({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:Ue})),this._blendOption===ht.TRANSLUCENT&&(I=new ge({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:Ue})),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 G=e.commandList;if(g.render||g.pick){const P=this._colorCommands,V=this._blendOption===ht.OPAQUE,k=this._blendOption===ht.OPAQUE_AND_TRANSLUCENT,H=this._vaf.va,j=H.length;let r=this._uniforms,b;h(this._batchTable)?(r=this._batchTable.getUniformMapCallback()(r),b=this._batchTable.getPickId()):b="v_pickColor",P.length=j;const v=k?j*2:j;for(let z=0;z<v;++z){let q=P[z];h(q)||(q=P[z]=new $e);const W=V||k&&z%2===0;q.pass=W||!k?zt.OPAQUE:zt.TRANSLUCENT,q.owner=this;const Z=k?Math.floor(z/2):z;q.boundingVolume=x,q.modelMatrix=E,q.count=H[Z].indicesCount,q.shaderProgram=W?this._sp:this._spTranslucent,q.uniformMap=r,q.vertexArray=H[Z].va,q.renderState=W?this._rsOpaque:this._rsTranslucent,q.debugShowBoundingVolume=this.debugShowBoundingVolume,q.pickId=b,this._instanced&&(q.count=6,q.instanceCount=n),G.push(q)}this.debugShowTextureAtlas&&(h(this.debugCommand)||(this.debugCommand=m1(this,e.context)),G.push(this.debugCommand))}},Qt.prototype.isDestroyed=function(){return!1},Qt.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(),wm(this._billboards),Qe(this)};function g1(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,T=d*4;let D,A,O,I;for(D=0;D<E;++D)if(x[D]!==255){O=D/T|0;break}for(D=E-1;D>=0;--D)if(x[D]!==255){I=D/T|0;break}let B=-1;for(D=0;D<d&&B===-1;++D)for(A=0;A<p;++A){const M=D*4+A*T;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 ao;function y1(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,w.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(ao)||(h(d.imageSmoothingEnabled)?ao="imageSmoothingEnabled":h(d.mozImageSmoothingEnabled)?ao="mozImageSmoothingEnabled":h(d.webkitImageSmoothingEnabled)?ao="webkitImageSmoothingEnabled":h(d.msImageSmoothingEnabled)&&(ao="msImageSmoothingEnabled")),d.font=n,d.lineJoin="round",d.lineWidth=s,d[ao]=!1,u.style.visibility="hidden",document.body.appendChild(u);const p=g1(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,T=x-E+l;if(u.width=y,u.height=x,d.font=n,d.lineJoin="round",d.lineWidth=s,d[ao]=!1,a!==w.TRANSPARENT&&(d.fillStyle=a.toCssColorString(),d.fillRect(0,0,u.width,u.height)),i){const D=_(t.strokeColor,w.BLACK);d.strokeStyle=D.toCssColorString(),d.strokeText(e,g+c,T)}if(o){const D=_(t.fillColor,w.WHITE);d.fillStyle=D.toCssColorString(),d.fillText(e,g+c,T)}return u}var x1=C1,Hr=1e20;function C1(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 T=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];T[x]=M===1?0:M===0?Hr:Math.pow(Math.max(0,.5-M),2),D[x]=M===1?Hr:M===0?0:Math.pow(Math.max(0,M-.5),2)}Um(T,s,a,A,O,B,I),Um(D,s,a,A,O,B,I);var G=window.Float32Array?new Float32Array(s*a):new Array(s*a);for(x=0,E=s*a;x<E;x++)G[x]=Math.min(Math.max(1-((T[x]-D[x])/i+n),0),1);return G}function Um(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(km(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(km(i,o,s,a,t),c=0;c<t;c++)e[l*t+c]=Math.sqrt(o[c])}}function km(e,t,n,i,o){n[0]=0,i[0]=-Hr,i[1]=+Hr;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]=+Hr}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 E1=ts(x1),Ei=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),Vm={};let qm=0;const T1=256,b1=new w(.165,.165,.165,.8),w1=new U(7,5),_t=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function co(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Wr(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function jr(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Gm(e){let t=Vm[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(jr(n,"line-height"));isNaN(i)&&(i=void 0),t={family:jr(n,"font-family"),size:jr(n,"font-size").replace("px",""),style:jr(n,"font-style"),weight:jr(n,"font-weight"),lineHeight:i},document.body.removeChild(n),qm<T1&&(Vm[e._font]=t,qm++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Fn(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=Te.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Te.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Te.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=w.clone(_(e.fillColor,w.WHITE)),this._outlineColor=w.clone(_(e.outlineColor,w.BLACK)),this._outlineWidth=_(e.outlineWidth,1),this._showBackground=_(e.showBackground,!1),this._backgroundColor=w.clone(_(e.backgroundColor,b1)),this._backgroundPadding=U.clone(_(e.backgroundPadding,w1)),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,Gm(this),this._updateClamping()}Object.defineProperties(Fn.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),Wr(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=Fn.enableRightToLeftDetection?I1(t):t,co(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,co(this),Gm(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._fillColor;w.equals(t,e)||(w.clone(e,t),co(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;w.equals(t,e)||(w.clone(e,t),co(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,co(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,co(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._backgroundColor;if(!w.equals(t,e)){w.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),Wr(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,co(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(!Te.equals(t,e)){this._translucencyByDistance=Te.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(!Te.equals(t,e)){this._pixelOffsetScaleByDistance=Te.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(!Te.equals(t,e)){this._scaleByDistance=Te.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,Wr(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),Wr(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),Wr(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)}}}}),Fn.prototype._updateClamping=function(){he._updateClamping(this._labelCollection,this)},Fn.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 he._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)},Fn.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 T=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,T),o=Math.min(o,D),u=Math.max(u,T+A),d=Math.max(d,D+O)}s=u-i,a=d-o}return h(n)||(n=new xe),n.x=i,n.y=o,n.width=s,n.height=a,n},Fn.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)&&w.equals(this._fillColor,e._fillColor)&&w.equals(this._outlineColor,e._outlineColor)&&w.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&f.equals(this._eyeOffset,e._eyeOffset)&&Te.equals(this._translucencyByDistance,e._translucencyByDistance)&&Te.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Te.equals(this._scaleByDistance,e._scaleByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},Fn.prototype.isDestroyed=function(){return!1},Fn.enableRightToLeftDetection=!1;function S1(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[];let s="",a=_t.LTR,c="";const l=e.length;for(let u=0;u<l;++u){const d=e.charAt(u);t.test(d)?c=_t.RTL:n.test(d)?c=_t.LTR:i.test(d)?c=_t.BRACKETS:c=_t.WEAK,u===0&&(a=c),a===c&&c!==_t.BRACKETS?s+=d:(s!==""&&o.push({Type:a,Word:s}),a=c,s=d)}return o.push({Type:c,Word:s}),o}function A1(e){return e.split("").reverse().join("")}function Yr(e,t,n){return e.slice(0,t)+n+e.slice(t)}function D1(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}const O1="א-ת",v1="-ۿݐ-ݿࢠ-ࣿ",Hm=new RegExp(`[${O1}${v1}]`);function I1(e){const t=e.split(`
|
|
6347
|
-
`);let n="";for(let i=0;i<t.length;i++){const o=t[i],s=Hm.test(o.charAt(0)),a=
|
|
6348
|
-
`)}return n}var Wm={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,T=14,D=15,A=16,O=17,I=0,B=1,M=2,G=3,P=4;function V(r,b){return 55296<=r.charCodeAt(b)&&r.charCodeAt(b)<=56319&&56320<=r.charCodeAt(b+1)&&r.charCodeAt(b+1)<=57343}function k(r,b){b===void 0&&(b=0);var v=r.charCodeAt(b);if(55296<=v&&v<=56319&&b<r.length-1){var z=v,q=r.charCodeAt(b+1);return 56320<=q&&q<=57343?(z-55296)*1024+(q-56320)+65536:z}if(56320<=v&&v<=57343&&b>=1){var z=r.charCodeAt(b-1),q=v;return 55296<=z&&z<=56319?(z-55296)*1024+(q-56320)+65536:q}return v}function H(r,b,v){var z=[r].concat(b).concat([v]),q=z[z.length-2],W=v,Z=z.lastIndexOf(T);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(q)==-1)return z.filter(function(se){return se==a}).length%2==1?G:P;if(q==n&&W==i)return I;if(q==o||q==n||q==i)return W==T&&b.every(function(se){return se==s})?M:B;if(W==o||W==n||W==i)return B;if(q==l&&(W==l||W==u||W==p||W==g))return I;if((q==p||q==u)&&(W==u||W==d))return I;if((q==g||q==d)&&W==d)return I;if(W==s||W==D)return I;if(W==c)return I;if(q==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==T||q==D&&[A,O].indexOf(W)!=-1?I:b.indexOf(a)!=-1?M:q==a&&W==a?I:B}this.nextBreak=function(r,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=r.length-1)return r.length;for(var v=j(k(r,b)),z=[],q=b+1;q<r.length;q++)if(!V(r,q-1)){var W=j(k(r,q));if(H(v,z,W))return q;z.push(W)}return r.length},this.splitGraphemes=function(r){for(var b=[],v=0,z;(z=this.nextBreak(r,v))<r.length;)b.push(r.slice(v,z)),v=z;return v<r.length&&b.push(r.slice(v)),b},this.iterateGraphemes=function(r){var b=0,v={next:(function(){var z,q;return(q=this.nextBreak(r,b))<r.length?(z=r.slice(b,q),b=q,{value:z,done:!1}):b<r.length?(z=r.slice(b),b=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 b=0,v=0,z;(z=this.nextBreak(r,v))<r.length;)v=z,b++;return v<r.length&&b++,b};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?T: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)})(Wm);var R1=Wm.exports;const z1=ts(R1);function P1(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function B1(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const N1=1.2,jm="ID_WHITE_PIXEL",Gl=new U(4,4),L1=new xe(1,1,1,1);function F1(e){const t=document.createElement("canvas");t.width=Gl.x,t.height=Gl.y;const n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(jm,t)}const wn={};function M1(e,t,n,i,o,s,a){return wn.font=t,wn.fillColor=n,wn.strokeColor=i,wn.strokeWidth=o,wn.padding=pn.PADDING,a===Je.CENTER?wn.textBaseline="middle":a===Je.TOP?wn.textBaseline="top":wn.textBaseline="bottom",wn.fill=s===Ei.FILL||s===Ei.FILL_AND_OUTLINE,wn.stroke=s===Ei.OUTLINE||s===Ei.FILL_AND_OUTLINE,wn.backgroundColor=w.BLACK,y1(e,wn)}function Hl(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 U1(e,t,n,i){i.index=e.addImageSync(t,n)}const k1=new z1;function V1(e,t){const n=t._renderedText,i=k1.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)Hl(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:jm,imageSubRegion:L1}),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,T=JSON.stringify([x,t._fontFamily,t._fontStyle,t._fontWeight,+E]);let D=y[T];if(!h(D)){const A=`${t._fontStyle} ${t._fontWeight} ${pn.FONT_SIZE}px ${t._fontFamily}`,O=
|
|
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,T=e.totalScale,D=e._horizontalOrigin,A=e._verticalOrigin;let O=0,I=c[O],B=Ym(I,D,x);const M=(h(e._lineHeight)?e._lineHeight:
|
|
6351
|
-
`)++O,H+=M,I=c[O],B=Ym(I,D,x),et.x=B*T,
|
|
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*T,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*T,y.width=P,y.height=V,y._setTranslate(et),y._labelTranslate=U.clone(et,y._labelTranslate)),Ws(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 Xm(e,t){const n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Hl(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 Qt({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Qt({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=w.clone(w.WHITE),this.show=_(e.show,!0),this.modelMatrix=N.clone(_(e.modelMatrix,N.IDENTITY)),this.debugShowBoundingVolume=_(e.debugShowBoundingVolume,!1),this.blendOption=_(e.blendOption,ht.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(Mn.prototype,{length:{get:function(){return this._labels.length}}}),Mn.prototype.add=function(e){const t=new Fn(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),Xm(this,e),!0}return!1},Mn.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)Xm(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:Gl}),n.textureAtlas=this._backgroundTextureAtlas,F1(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&&(V1(this,c),c._rebindAllGlyphs=!1),c._repositionAllGlyphs&&(G1(c),c._repositionAllGlyphs=!1);const u=c._glyphs.length-l;this._totalGlyphCount+=u}const s=n.length>0?ht.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 $m={id:void 0};function Xr(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 Xt(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 ze,this._id=Vn(),this._show=!0,this._firing=!1,this._refire=!1}Xt.prototype.suspendEvents=function(){this._suspendCount++},Xt.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,Xr(this)},Object.defineProperties(Xt.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}}}),Xt.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})},Xt.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(Xt.prototype._onEntityDefinitionChanged,this),Xr(this),e},Xt.prototype.remove=function(e){return h(e)?this.removeById(e.id):!1},Xt.prototype.contains=function(e){if(!h(e))throw new C("entity is required");return this._entities.get(e.id)===e},Xt.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(Xt.prototype._onEntityDefinitionChanged,this),Xr(this),!0):!1},Xt.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(Xt.prototype._onEntityDefinitionChanged,this),o.set(c,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Xr(this)},Xt.prototype.getById=function(e){if(!h(e))throw new C("id is required.");return this._entities.get(e)},Xt.prototype.getOrCreateEntity=function(e){if(!h(e))throw new C("id is required.");let t=this._entities.get(e);return h(t)||($m.id=e,t=new an($m),this.add(t)),t},Xt.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Xr(this)};function ya(){C.throwInstantiationError()}Object.defineProperties(ya.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}}),ya.prototype.update=function(e){C.throwInstantiationError()},ya.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 Zm=new f;oi.prototype.isPointVisible=function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,Zm);return Wl(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},oi.prototype.isScaledSpacePointVisible=function(e){return Wl(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const H1=new f;oi.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,o;return h(t)&&t<0&&n.minimumRadius>-t?(o=H1,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),Wl(e,o,i)},oi.prototype.computeHorizonCullingPoint=function(e,t,n){return Jm(this._ellipsoid,e,t,n)};const Km=le.clone(le.UNIT_SPHERE);oi.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){const o=Qm(this._ellipsoid,n,Km);return Jm(o,e,t,i)},oi.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return e0(this._ellipsoid,e,t,n,i,o)},oi.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,s){const a=Qm(this._ellipsoid,o,Km);return e0(a,e,t,n,i,s)};const W1=[];oi.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){m.typeOf.object("rectangle",e);const i=ce.subsample(e,t,0,W1),o=K.fromPoints(i);if(!(f.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};const j1=new f;function Qm(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,j1);e=le.fromCartesian3(i,n)}return e}function Jm(e,t,n,i){m.typeOf.object("directionToPoint",t),m.defined("positions",n),h(i)||(i=new f);const o=i0(e,t);let s=0;for(let a=0,c=n.length;a<c;++a){const l=n[a],u=t0(e,l,o);if(u<0)return;s=Math.max(s,u)}return n0(o,s,i)}const xa=new f;function e0(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=i0(e,t);let c=0;for(let l=0,u=n.length;l<u;l+=i){xa.x=n[l]+o.x,xa.y=n[l+1]+o.y,xa.z=n[l+2]+o.z;const d=t0(e,xa,a);if(d<0)return;c=Math.max(c,d)}return n0(a,c,s)}function Wl(e,t,n){const i=t,o=n,s=f.subtract(e,i,Zm),a=-f.dot(s,i);return!(o<0?a>0:a>o&&a*a/f.magnitudeSquared(s)>o)}const Y1=new f,X1=new f;function t0(e,t,n){const i=e.transformPositionToScaledSpace(t,Y1);let o=f.magnitudeSquared(i),s=Math.sqrt(o);const a=f.divideByScalar(i,s,X1);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 n0(e,t,n){if(!(t<=0||t===1/0||t!==t))return f.multiplyByScalar(e,t,n)}const jl=new f;function i0(e,t){return f.equals(t,f.ZERO)?t:(e.transformPositionToScaledSpace(t,jl),f.normalize(jl,jl))}function ve(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=Te.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=Te.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=w.clone(_(e.color,w.WHITE)),this._outlineColor=w.clone(_(e.outlineColor,w.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,Au.NONE)}const o0=ve.SHOW_INDEX=0,r0=ve.POSITION_INDEX=1,$1=ve.COLOR_INDEX=2,Z1=ve.OUTLINE_COLOR_INDEX=3,K1=ve.OUTLINE_WIDTH_INDEX=4,Q1=ve.PIXEL_SIZE_INDEX=5,J1=ve.SCALE_BY_DISTANCE_INDEX=6,eA=ve.TRANSLUCENCY_BY_DISTANCE_INDEX=7,tA=ve.DISTANCE_DISPLAY_CONDITION_INDEX=8,nA=ve.DISABLE_DEPTH_DISTANCE_INDEX=9,iA=ve.SPLIT_DIRECTION_INDEX=10;ve.NUMBER_OF_PROPERTIES=11;function mn(e,t){const n=e._pointPrimitiveCollection;h(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ve.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,o0))}},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,r0))}},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;Te.equals(t,e)||(this._scaleByDistance=Te.clone(e,t),mn(this,J1))}},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;Te.equals(t,e)||(this._translucencyByDistance=Te.clone(e,t),mn(this,eA))}},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,Q1))}},color:{get:function(){return this._color},set:function(e){if(!h(e))throw new C("value is required.");const t=this._color;w.equals(t,e)||(w.clone(e,t),mn(this,$1))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;w.equals(t,e)||(w.clone(e,t),mn(this,Z1))}},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,K1))}},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,tA))}},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,nA)}}},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,o0))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,mn(this,iA))}}}),ve.prototype.getPickId=function(e){return h(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},ve.prototype._getActualPosition=function(){return this._actualPosition},ve.prototype._setActualPosition=function(e){f.clone(e,this._actualPosition),mn(this,r0)};const s0=new Y;ve._computeActualPosition=function(e,t,n){return t.mode===pe.SCENE3D?e:(N.multiplyByPoint(n,e,s0),St.computeActualEllipsoidPosition(t,s0))};const a0=new Y;ve._computeScreenSpacePosition=function(e,t,n,i){const o=N.multiplyByVector(e,Y.fromElements(t.x,t.y,t.z,1,a0),a0);return St.worldToWindowCoordinates(n,o,i)},ve.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=ve._computeScreenSpacePosition(i,this._actualPosition,e,t);if(h(o))return o.y=e.canvas.clientHeight-o.y,o},ve.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 xe),n.x=s,n.y=a,n.width=c,n.height=l,n},ve.prototype.equals=function(e){return this===e||h(e)&&this._id===e._id&&f.equals(this._position,e._position)&&w.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&w.equals(this._outlineColor,e._outlineColor)&&Te.equals(this._scaleByDistance,e._scaleByDistance)&&Te.equals(this._translucencyByDistance,e._translucencyByDistance)&&rt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection},ve.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};const Ca=`in vec4 v_color;
|
|
6346
|
+
`,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=zt.OVERLAY,i}const g1=[];Jt.prototype.update=function(e){if(Ul(this),!this.show)return;let t=this._billboards,n=t.length;const i=e.context;this._instanced=i.instancedArrays,Ve=this._instanced?i1:n1,Vl=this._instanced?r1:o1;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;p1(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<Ml;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=a1(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),p=this._vaf.writers;for(let P=0;P<n;++P){const k=this._billboards[P];k._dirty=!1,d1(this,e,s,p,k)}this._vaf.commit(Vl(i))}this._billboardsToUpdateIndex=0}else if(c>0){const P=g1;P.length=0,(l[qr]||l[QS]||l[KS])&&P.push(Sm),(l[Hr]||l[mm]||l[$S]||l[ZS]||l[XS])&&(P.push(Rm),this._instanced&&P.push(Hl)),(l[Hr]||l[JS]||l[xm])&&(P.push(zm),P.push(ql)),(l[Hr]||l[gm])&&P.push(ql),l[_m]&&P.push(Hl),l[ym]&&P.push(Pm),l[Cm]&&P.push(Bm),(l[Em]||l[e1]||l[Hr]||l[qr])&&P.push(Nm),(l[Hr]||l[qr])&&P.push(Fm),l[Tm]&&P.push(Lm),l[bm]&&P.push(Mm);const k=P.length;if(p=this._vaf.writers,c/n>.1){for(let V=0;V<c;++V){const H=a[V];H._dirty=!1;for(let j=0;j<k;++j)P[j](this,e,s,p,H)}this._vaf.commit(Vl(i))}else{for(let V=0;V<c;++V){const H=a[V];H._dirty=!1;for(let j=0;j<k;++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),m1(this,e,x);const T=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,T){this._blendOption===ft.OPAQUE||this._blendOption===ft.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.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=ke.fromCache({depthTest:{enabled:!0,func:P?R.LEQUAL:R.LESS},depthMask:P,blending:Ji.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(T||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=PS,A=zS,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 k=h(this._batchTable)?"VECTOR_TILE":"";this._blendOption===ft.OPAQUE_AND_TRANSLUCENT&&(I=new ye({defines:["OPAQUE",k],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=rt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:Ve}),I=new ye({defines:["TRANSLUCENT",k],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=rt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:Ve})),this._blendOption===ft.OPAQUE&&(I=new ye({defines:[k],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=rt.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:Ve})),this._blendOption===ft.TRANSLUCENT&&(I=new ye({defines:[k],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=rt.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:O,fragmentShaderSource:I,attributeLocations:Ve})),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,k=this._blendOption===ft.OPAQUE,V=this._blendOption===ft.OPAQUE_AND_TRANSLUCENT,H=this._vaf.va,j=H.length;let r=this._uniforms,b;h(this._batchTable)?(r=this._batchTable.getUniformMapCallback()(r),b=this._batchTable.getPickId()):b="v_pickColor",P.length=j;const v=V?j*2:j;for(let z=0;z<v;++z){let G=P[z];h(G)||(G=P[z]=new $e);const W=k||V&&z%2===0;G.pass=W||!V?zt.OPAQUE:zt.TRANSLUCENT,G.owner=this;const Z=V?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=b,this._instanced&&(G.count=6,G.instanceCount=n),q.push(G)}this.debugShowTextureAtlas&&(h(this.debugCommand)||(this.debugCommand=_1(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(),wm(this._billboards),Qe(this)};function y1(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,T=d*4;let D,A,O,I;for(D=0;D<E;++D)if(x[D]!==255){O=D/T|0;break}for(D=E-1;D>=0;--D)if(x[D]!==255){I=D/T|0;break}let B=-1;for(D=0;D<d&&B===-1;++D)for(A=0;A<p;++A){const M=D*4+A*T;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 ao;function x1(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,w.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(ao)||(h(d.imageSmoothingEnabled)?ao="imageSmoothingEnabled":h(d.mozImageSmoothingEnabled)?ao="mozImageSmoothingEnabled":h(d.webkitImageSmoothingEnabled)?ao="webkitImageSmoothingEnabled":h(d.msImageSmoothingEnabled)&&(ao="msImageSmoothingEnabled")),d.font=n,d.lineJoin="round",d.lineWidth=s,d[ao]=!1,u.style.visibility="hidden",document.body.appendChild(u);const p=y1(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,T=x-E+l;if(u.width=y,u.height=x,d.font=n,d.lineJoin="round",d.lineWidth=s,d[ao]=!1,a!==w.TRANSPARENT&&(d.fillStyle=a.toCssColorString(),d.fillRect(0,0,u.width,u.height)),i){const D=_(t.strokeColor,w.BLACK);d.strokeStyle=D.toCssColorString(),d.strokeText(e,g+c,T)}if(o){const D=_(t.fillColor,w.WHITE);d.fillStyle=D.toCssColorString(),d.fillText(e,g+c,T)}return u}var C1=E1,Wr=1e20;function E1(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 T=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];T[x]=M===1?0:M===0?Wr:Math.pow(Math.max(0,.5-M),2),D[x]=M===1?Wr:M===0?0:Math.pow(Math.max(0,M-.5),2)}Um(T,s,a,A,O,B,I),Um(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-((T[x]-D[x])/i+n),0),1);return q}function Um(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(Vm(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(Vm(i,o,s,a,t),c=0;c<t;c++)e[l*t+c]=Math.sqrt(o[c])}}function Vm(e,t,n,i,o){n[0]=0,i[0]=-Wr,i[1]=+Wr;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]=+Wr}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 T1=os(C1),Ei=Object.freeze({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2}),km={};let Gm=0;const b1=256,w1=new w(.165,.165,.165,.8),S1=new U(7,5),_t=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function co(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function jr(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Yr(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function qm(e){let t=km[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(Yr(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Yr(n,"font-family"),size:Yr(n,"font-size").replace("px",""),style:Yr(n,"font-style"),weight:Yr(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Gm<b1&&(km[e._font]=t,Gm++)}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=be.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=be.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=be.clone(o)}if(h(s)){if(s.far<=s.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");s=st.clone(s)}this._renderedText=void 0,this._text=void 0,this._show=_(e.show,!0),this._font=_(e.font,"30px sans-serif"),this._fillColor=w.clone(_(e.fillColor,w.WHITE)),this._outlineColor=w.clone(_(e.outlineColor,w.BLACK)),this._outlineWidth=_(e.outlineWidth,1),this._showBackground=_(e.showBackground,!1),this._backgroundColor=w.clone(_(e.backgroundColor,w1)),this._backgroundPadding=U.clone(_(e.backgroundPadding,S1)),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,qm(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),jr(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?R1(t):t,co(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,co(this),qm(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._fillColor;w.equals(t,e)||(w.clone(e,t),co(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;w.equals(t,e)||(w.clone(e,t),co(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,co(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,co(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._backgroundColor;if(!w.equals(t,e)){w.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),jr(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,co(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(!be.equals(t,e)){this._translucencyByDistance=be.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(!be.equals(t,e)){this._pixelOffsetScaleByDistance=be.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(!be.equals(t,e)){this._scaleByDistance=be.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,jr(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),jr(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),jr(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(!st.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=st.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(){he._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 he._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 T=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,T),o=Math.min(o,D),u=Math.max(u,T+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)&&w.equals(this._fillColor,e._fillColor)&&w.equals(this._outlineColor,e._outlineColor)&&w.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&f.equals(this._eyeOffset,e._eyeOffset)&&be.equals(this._translucencyByDistance,e._translucencyByDistance)&&be.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&be.equals(this._scaleByDistance,e._scaleByDistance)&&st.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},Ln.prototype.isDestroyed=function(){return!1},Ln.enableRightToLeftDetection=!1;function A1(e,t){const n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[];let s="",a=_t.LTR,c="";const l=e.length;for(let u=0;u<l;++u){const d=e.charAt(u);t.test(d)?c=_t.RTL:n.test(d)?c=_t.LTR:i.test(d)?c=_t.BRACKETS:c=_t.WEAK,u===0&&(a=c),a===c&&c!==_t.BRACKETS?s+=d:(s!==""&&o.push({Type:a,Word:s}),a=c,s=d)}return o.push({Type:c,Word:s}),o}function D1(e){return e.split("").reverse().join("")}function Xr(e,t,n){return e.slice(0,t)+n+e.slice(t)}function O1(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}const v1="א-ת",I1="-ۿݐ-ݿࢠ-ࣿ",Hm=new RegExp(`[${v1}${I1}]`);function R1(e){const t=e.split(`
|
|
6347
|
+
`);let n="";for(let i=0;i<t.length;i++){const o=t[i],s=Hm.test(o.charAt(0)),a=A1(o,Hm);let c=0,l="";for(let u=0;u<a.length;++u){const d=a[u],p=d.Type===_t.BRACKETS?O1(d.Word):D1(d.Word);s?d.Type===_t.RTL?(l=p+l,c=0):d.Type===_t.LTR?(l=Xr(l,c,d.Word),c+=d.Word.length):(d.Type===_t.WEAK||d.Type===_t.BRACKETS)&&(d.Type===_t.WEAK&&a[u-1].Type===_t.BRACKETS?l=p+l:a[u-1].Type===_t.RTL?(l=p+l,c=0):a.length>u+1?a[u+1].Type===_t.RTL?(l=p+l,c=0):(l=Xr(l,c,d.Word),c+=d.Word.length):l=Xr(l,0,p)):d.Type===_t.RTL?l=Xr(l,c,p):d.Type===_t.LTR?(l+=d.Word,c=l.length):(d.Type===_t.WEAK||d.Type===_t.BRACKETS)&&(u>0&&a[u-1].Type===_t.RTL?a.length>u+1?a[u+1].Type===_t.RTL?l=Xr(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 Wm={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,T=14,D=15,A=16,O=17,I=0,B=1,M=2,q=3,P=4;function k(r,b){return 55296<=r.charCodeAt(b)&&r.charCodeAt(b)<=56319&&56320<=r.charCodeAt(b+1)&&r.charCodeAt(b+1)<=57343}function V(r,b){b===void 0&&(b=0);var v=r.charCodeAt(b);if(55296<=v&&v<=56319&&b<r.length-1){var z=v,G=r.charCodeAt(b+1);return 56320<=G&&G<=57343?(z-55296)*1024+(G-56320)+65536:z}if(56320<=v&&v<=57343&&b>=1){var z=r.charCodeAt(b-1),G=v;return 55296<=z&&z<=56319?(z-55296)*1024+(G-56320)+65536:G}return v}function H(r,b,v){var z=[r].concat(b).concat([v]),G=z[z.length-2],W=v,Z=z.lastIndexOf(T);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==T&&b.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==T||G==D&&[A,O].indexOf(W)!=-1?I:b.indexOf(a)!=-1?M:G==a&&W==a?I:B}this.nextBreak=function(r,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=r.length-1)return r.length;for(var v=j(V(r,b)),z=[],G=b+1;G<r.length;G++)if(!k(r,G-1)){var W=j(V(r,G));if(H(v,z,W))return G;z.push(W)}return r.length},this.splitGraphemes=function(r){for(var b=[],v=0,z;(z=this.nextBreak(r,v))<r.length;)b.push(r.slice(v,z)),v=z;return v<r.length&&b.push(r.slice(v)),b},this.iterateGraphemes=function(r){var b=0,v={next:(function(){var z,G;return(G=this.nextBreak(r,b))<r.length?(z=r.slice(b,G),b=G,{value:z,done:!1}):b<r.length?(z=r.slice(b),b=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 b=0,v=0,z;(z=this.nextBreak(r,v))<r.length;)v=z,b++;return v<r.length&&b++,b};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?T: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)})(Wm);var z1=Wm.exports;const P1=os(z1);function B1(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function N1(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}const F1=1.2,jm="ID_WHITE_PIXEL",jl=new U(4,4),L1=new Ce(1,1,1,1);function M1(e){const t=document.createElement("canvas");t.width=jl.x,t.height=jl.y;const n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage(jm,t)}const wn={};function U1(e,t,n,i,o,s,a){return wn.font=t,wn.fillColor=n,wn.strokeColor=i,wn.strokeWidth=o,wn.padding=pn.PADDING,a===Je.CENTER?wn.textBaseline="middle":a===Je.TOP?wn.textBaseline="top":wn.textBaseline="bottom",wn.fill=s===Ei.FILL||s===Ei.FILL_AND_OUTLINE,wn.stroke=s===Ei.OUTLINE||s===Ei.FILL_AND_OUTLINE,wn.backgroundColor=w.BLACK,x1(e,wn)}function Yl(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 V1(e,t,n,i){i.index=e.addImageSync(t,n)}const k1=new P1;function G1(e,t){const n=t._renderedText,i=k1.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)Yl(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:jm,imageSubRegion:L1}),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,T=JSON.stringify([x,t._fontFamily,t._fontStyle,t._fontWeight,+E]);let D=y[T];if(!h(D)){const A=`${t._fontStyle} ${t._fontWeight} ${pn.FONT_SIZE}px ${t._fontFamily}`,O=U1(x,A,w.WHITE,w.WHITE,0,Ei.FILL,E);if(D=new N1(e,-1,O.dimensions),y[T]=D,O.width>0&&O.height>0){const I=T1(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 k=0;k<M;k++)for(let V=0;V<q;V++){const H=V*M+k,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!==" "&&V1(e._textureAtlas,T,O,D)}}if(c=s[u],h(c)?D.index===-1?Yl(e,c):h(c.textureInfo)&&(c.textureInfo=void 0):(c=new B1,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=T,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=w.TRANSPARENT,A.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Ym(e,t,n){return t===In.CENTER?-e/2:t===In.RIGHT?-(e+n.x):n.x}const et=new U,q1=new U;function H1(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,q1);for(x.x/=e._relativeSize,x.y/=e._relativeSize,p=0;p<g;++p)n.charAt(p)===`
|
|
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,T=e.totalScale,D=e._horizontalOrigin,A=e._verticalOrigin;let O=0,I=c[O],B=Ym(I,D,x);const M=(h(e._lineHeight)?e._lineHeight:F1*e._fontSize)/e._relativeSize,q=M*(d-1);let P=a,k=E+q;h(y)&&(P+=x.x*2,k+=x.y*2,y._labelHorizontalOrigin=D),et.x=B*T,et.y=0;let V=!0,H=0;for(p=0;p<g;++p)if(n.charAt(p)===`
|
|
6351
|
+
`)++O,H+=M,I=c[O],B=Ym(I,D,x),et.x=B*T,V=!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)*T,V&&(et.x-=pn.PADDING*T,V=!1),h(i.billboard)&&(i.billboard._setTranslate(et),i.billboard._labelDimensions.x=P,i.billboard._labelDimensions.y=k,i.billboard._labelHorizontalOrigin=D),p<g-1){const j=t[p+1];et.x+=(o.width-o.minx+j.dimensions.minx)*T}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*T,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*T,y.width=P,y.height=k,y._setTranslate(et),y._labelTranslate=U.clone(et,y._labelTranslate)),Xs(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 Xm(e,t){const n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Yl(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=w.clone(w.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),Xm(this,e),!0}return!1},Mn.prototype.removeAll=function(){const e=this._labels;for(let t=0,n=e.length;t<n;++t)Xm(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:jl}),n.textureAtlas=this._backgroundTextureAtlas,M1(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&&(G1(this,c),c._rebindAllGlyphs=!1),c._repositionAllGlyphs&&(H1(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 $m={id:void 0};function $r(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=kn(),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--,$r(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),$r(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),$r(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(),$r(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)||($m.id=e,t=new an($m),this.add(t)),t},$t.prototype._onEntityDefinitionChanged=function(e){const t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),$r(this)};function Ea(){C.throwInstantiationError()}Object.defineProperties(Ea.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}}),Ea.prototype.update=function(e){C.throwInstantiationError()},Ea.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 Zm=new f;oi.prototype.isPointVisible=function(e){const n=this._ellipsoid.transformPositionToScaledSpace(e,Zm);return Xl(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},oi.prototype.isScaledSpacePointVisible=function(e){return Xl(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};const W1=new f;oi.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){const n=this._ellipsoid;let i,o;return h(t)&&t<0&&n.minimumRadius>-t?(o=W1,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),Xl(e,o,i)},oi.prototype.computeHorizonCullingPoint=function(e,t,n){return Jm(this._ellipsoid,e,t,n)};const Km=le.clone(le.UNIT_SPHERE);oi.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){const o=Qm(this._ellipsoid,n,Km);return Jm(o,e,t,i)},oi.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return e0(this._ellipsoid,e,t,n,i,o)},oi.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,s){const a=Qm(this._ellipsoid,o,Km);return e0(a,e,t,n,i,s)};const j1=[];oi.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){m.typeOf.object("rectangle",e);const i=ce.subsample(e,t,0,j1),o=K.fromPoints(i);if(!(f.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};const Y1=new f;function Qm(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,Y1);e=le.fromCartesian3(i,n)}return e}function Jm(e,t,n,i){m.typeOf.object("directionToPoint",t),m.defined("positions",n),h(i)||(i=new f);const o=i0(e,t);let s=0;for(let a=0,c=n.length;a<c;++a){const l=n[a],u=t0(e,l,o);if(u<0)return;s=Math.max(s,u)}return n0(o,s,i)}const Ta=new f;function e0(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=i0(e,t);let c=0;for(let l=0,u=n.length;l<u;l+=i){Ta.x=n[l]+o.x,Ta.y=n[l+1]+o.y,Ta.z=n[l+2]+o.z;const d=t0(e,Ta,a);if(d<0)return;c=Math.max(c,d)}return n0(a,c,s)}function Xl(e,t,n){const i=t,o=n,s=f.subtract(e,i,Zm),a=-f.dot(s,i);return!(o<0?a>0:a>o&&a*a/f.magnitudeSquared(s)>o)}const X1=new f,$1=new f;function t0(e,t,n){const i=e.transformPositionToScaledSpace(t,X1);let o=f.magnitudeSquared(i),s=Math.sqrt(o);const a=f.divideByScalar(i,s,$1);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 n0(e,t,n){if(!(t<=0||t===1/0||t!==t))return f.multiplyByScalar(e,t,n)}const $l=new f;function i0(e,t){return f.equals(t,f.ZERO)?t:(e.transformPositionToScaledSpace(t,$l),f.normalize($l,$l))}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=be.clone(n)}if(h(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=be.clone(i)}if(h(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=st.clone(o)}this._show=_(e.show,!0),this._position=f.clone(_(e.position,f.ZERO)),this._actualPosition=f.clone(this._position),this._color=w.clone(_(e.color,w.WHITE)),this._outlineColor=w.clone(_(e.outlineColor,w.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,Au.NONE)}const o0=Ie.SHOW_INDEX=0,r0=Ie.POSITION_INDEX=1,Z1=Ie.COLOR_INDEX=2,K1=Ie.OUTLINE_COLOR_INDEX=3,Q1=Ie.OUTLINE_WIDTH_INDEX=4,J1=Ie.PIXEL_SIZE_INDEX=5,eA=Ie.SCALE_BY_DISTANCE_INDEX=6,tA=Ie.TRANSLUCENCY_BY_DISTANCE_INDEX=7,nA=Ie.DISTANCE_DISPLAY_CONDITION_INDEX=8,iA=Ie.DISABLE_DEPTH_DISTANCE_INDEX=9,oA=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,o0))}},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,r0))}},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;be.equals(t,e)||(this._scaleByDistance=be.clone(e,t),mn(this,eA))}},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;be.equals(t,e)||(this._translucencyByDistance=be.clone(e,t),mn(this,tA))}},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,J1))}},color:{get:function(){return this._color},set:function(e){if(!h(e))throw new C("value is required.");const t=this._color;w.equals(t,e)||(w.clone(e,t),mn(this,Z1))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!h(e))throw new C("value is required.");const t=this._outlineColor;w.equals(t,e)||(w.clone(e,t),mn(this,K1))}},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,Q1))}},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");st.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=st.clone(e,this._distanceDisplayCondition),mn(this,nA))}},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,iA)}}},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,o0))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,mn(this,oA))}}}),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,r0)};const s0=new Y;Ie._computeActualPosition=function(e,t,n){return t.mode===me.SCENE3D?e:(N.multiplyByPoint(n,e,s0),St.computeActualEllipsoidPosition(t,s0))};const a0=new Y;Ie._computeScreenSpacePosition=function(e,t,n,i){const o=N.multiplyByVector(e,Y.fromElements(t.x,t.y,t.z,1,a0),a0);return St.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)&&w.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&w.equals(this._outlineColor,e._outlineColor)&&be.equals(this._scaleByDistance,e._scaleByDistance)&&be.equals(this._translucencyByDistance,e._translucencyByDistance)&&st.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 ba=`in vec4 v_color;
|
|
6353
6353
|
in vec4 v_outlineColor;
|
|
6354
6354
|
in float v_innerPercent;
|
|
6355
6355
|
in float v_pixelDistance;
|
|
@@ -6396,7 +6396,7 @@ void main()
|
|
|
6396
6396
|
out_FragColor = czm_gammaCorrect(color);
|
|
6397
6397
|
czm_writeLogDepth();
|
|
6398
6398
|
}
|
|
6399
|
-
`,
|
|
6399
|
+
`,rA=`uniform float u_maxTotalPointSize;
|
|
6400
6400
|
|
|
6401
6401
|
in vec4 positionHighAndSize;
|
|
6402
6402
|
in vec4 positionLowAndOutline;
|
|
@@ -6581,4 +6581,4 @@ void main()
|
|
|
6581
6581
|
v_pickColor = pickColor;
|
|
6582
6582
|
v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
|
|
6583
6583
|
}
|
|
6584
|
-
`,rA=ve.SHOW_INDEX,Yl=ve.POSITION_INDEX,c0=ve.COLOR_INDEX,sA=ve.OUTLINE_COLOR_INDEX,aA=ve.OUTLINE_WIDTH_INDEX,cA=ve.PIXEL_SIZE_INDEX,l0=ve.SCALE_BY_DISTANCE_INDEX,h0=ve.TRANSLUCENCY_BY_DISTANCE_INDEX,f0=ve.DISTANCE_DISPLAY_CONDITION_INDEX,lA=ve.DISABLE_DEPTH_DISTANCE_INDEX,hA=ve.SPLIT_DIRECTION_INDEX,Xl=ve.NUMBER_OF_PROPERTIES,$t={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(Xl),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,ht.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=pe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW,Ae.STATIC_DRAW];const t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(_n.prototype,{length:{get:function(){return $l(this),this._pointPrimitives.length}}});function u0(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 ve(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(){u0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function $l(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 $l(this),this._pointPrimitives[e]},_n.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Xl;++i){const o=n[i]===0?Ae.STATIC_DRAW:Ae.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function fA(e,t,n){return new bt(e,[{index:$t.positionHighAndSize,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Yl]},{index:$t.positionLowAndShow,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Yl]},{index:$t.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[c0]},{index:$t.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[h0]},{index:$t.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[l0]},{index:$t.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[f0]}],t)}const Zl=new je;function d0(e,t,n,i){const o=i._index,s=i._getActualPosition();e._mode===pe.SCENE3D&&(K.expand(e._baseVolume,s,e._baseVolume),e._boundingVolumeDirty=!0),je.fromCartesian(s,Zl);const a=i.pixelSize,c=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+c);const l=n[$t.positionHighAndSize],u=Zl.high;l(o,u.x,u.y,u.z,a);const d=n[$t.positionLowAndOutline],p=Zl.low;d(o,p.x,p.y,p.z,c)}const Ea=65536,$r=256;function p0(e,t,n,i){const o=i._index,s=i.color,a=i.getPickId(t).color,c=i.outlineColor;let l=w.floatToByte(s.red),u=w.floatToByte(s.green),d=w.floatToByte(s.blue);const p=l*Ea+u*$r+d;l=w.floatToByte(c.red),u=w.floatToByte(c.green),d=w.floatToByte(c.blue);const g=l*Ea+u*$r+d;l=w.floatToByte(a.red),u=w.floatToByte(a.green),d=w.floatToByte(a.blue);const y=l*Ea+u*$r+d,x=w.floatToByte(s.alpha)*Ea+w.floatToByte(c.alpha)*$r+w.floatToByte(a.alpha),E=n[$t.compressedAttribute0];E(o,p,g,y,x)}function m0(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)*$r+a;l=S.clamp(l,0,1),l=l===1?255:l*255|0;const g=l,y=n[$t.compressedAttribute1];y(o,p,g,s,c)}function _0(e,t,n,i){const o=i._index,s=n[$t.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 g0(e,t,n,i){const o=i._index,s=n[$t.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 uA(e,t,n,i){d0(e,t,n,i),p0(e,t,n,i),m0(e,t,n,i),_0(e,t,n,i),g0(e,t,n,i)}function Kl(e,t,n,i,o,s){let a;i.mode===pe.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=ve._computeActualPosition(d,i,o);h(p)&&(u._setActualPosition(p),s?c.push(p):K.expand(a,p,a))}s&&K.fromPoints(c,a)}function dA(e,t){const n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,s=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==pe.SCENE3D&&!N.equals(s,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,s),e._createVertexArray=!0,(n===pe.SCENE3D||n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&Kl(e,i,i.length,t,s,!0)):n===pe.MORPHING?Kl(e,i,i.length,t,s,!0):(n===pe.SCENE2D||n===pe.COLUMBUS_VIEW)&&Kl(e,o,e._pointPrimitivesToUpdateIndex,t,s,!1)}function pA(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const mA=[];_n.prototype.update=function(e){if($l(this),!this.show)return;this._maxTotalPointSize=Ce.maximumAliasedPointSize,dA(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<Xl;++B)s[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=fA(l,n,this._buffersUsage),c=this._vaf.writers;for(let B=0;B<n;++B){const M=this._pointPrimitives[B];M._dirty=!1,uA(this,l,c,M)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=mA;B.length=0,(s[Yl]||s[aA]||s[cA])&&B.push(d0),(s[c0]||s[sA])&&B.push(p0),(s[rA]||s[h0])&&B.push(m0),s[l0]&&B.push(_0),(s[f0]||s[lA]||s[hA])&&B.push(g0);const M=B.length;if(c=this._vaf.writers,o/n>.1){for(let G=0;G<o;++G){const P=i[G];P._dirty=!1;for(let V=0;V<M;++V)B[V](this,l,c,P)}this._vaf.commit()}else{for(let G=0;G<o;++G){const P=i[G];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===pe.SCENE3D?(g=this.modelMatrix,p=K.clone(this._baseVolumeWC,this._boundingVolume)):p=K.clone(this._baseVolume2D,this._boundingVolume),pA(this,e,p);const y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===ht.OPAQUE||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ht.TRANSLUCENT||this._blendOption===ht.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:Ji.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 ge({sources:[oA]}),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===ht.OPAQUE_AND_TRANSLUCENT&&(E=new ge({defines:["OPAQUE"],sources:[Ca]}),this._sp=ot.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t}),E=new ge({defines:["TRANSLUCENT"],sources:[Ca]}),this._spTranslucent=ot.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._blendOption===ht.OPAQUE&&(E=new ge({sources:[Ca]}),this._sp=ot.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._blendOption===ht.TRANSLUCENT&&(E=new ge({sources:[Ca]}),this._spTranslucent=ot.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:$t})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let T,D,A,O;const I=e.commandList;if(u.render||d){const B=this._colorCommands,M=this._blendOption===ht.OPAQUE,G=this._blendOption===ht.OPAQUE_AND_TRANSLUCENT;T=this._vaf.va,D=T.length,B.length=D;const P=G?D*2:D;for(O=0;O<P;++O){const V=M||G&&O%2===0;A=B[O],h(A)||(A=B[O]=new $e),A.primitiveType=qe.POINTS,A.pass=V||!G?zt.OPAQUE:zt.TRANSLUCENT,A.owner=this;const k=G?Math.floor(O/2):O;A.boundingVolume=p,A.modelMatrix=g,A.shaderProgram=V?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=T[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(),u0(this._pointPrimitives),Qe(this)};const y0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ql=1,Zr=8;class Jl{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!==Ql)throw new Error(`Got v${o} data when expected v${Ql}.`);const s=y0[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 Jl(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=y0.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,Zr,t),this.coords=new this.ArrayType(this.data,Zr+c+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Zr+a+c+l),this.ids=new this.IndexArrayType(this.data,Zr,t),this.coords=new this.ArrayType(this.data,Zr+c+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Ql<<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 eh(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 T=g;T<=p;T++){const D=a[2*T],A=a[2*T+1];D>=t&&D<=i&&A>=n&&A<=o&&u.push(s[T])}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 T=g;T<=p;T++)C0(s[2*T],s[2*T+1],t,n)<=u&&l.push(o[T]);continue}const y=g+p>>1,x=s[2*y],E=s[2*y+1];C0(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 eh(e,t,n,i,o,s){if(o-i<=n)return;const a=i+o>>1;x0(e,t,a,i,o,s),eh(e,t,n,i,a-1,1-s),eh(e,t,n,a+1,o,1-s)}function x0(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));x0(e,t,n,x,E,s)}const a=t[2*n+s];let c=i,l=o;for(Kr(e,t,i,n),t[2*o+s]>a&&Kr(e,t,i,o);c<l;){for(Kr(e,t,c,l),c++,l--;t[2*c+s]<a;)c++;for(;t[2*l+s]>a;)l--}t[2*i+s]===a?Kr(e,t,i,l):(l++,Kr(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Kr(e,t,n,i){th(e,n,i),th(t,2*n,2*i),th(t,2*n+1,2*i+1)}function th(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function C0(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 ze,this.show=_(e.show,!0)}function E0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const _A=new xe;function T0(e,t,n,i,o){if(h(e._labelCollection)&&i._clusterLabels?o=Fn.getScreenSpaceBoundingBox(e,t,o):h(e._billboardCollection)&&i._clusterBillboards?o=he.getScreenSpaceBoundingBox(e,t,o):h(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=ve.getScreenSpaceBoundingBox(e,t,o)),E0(o,n),i._clusterLabels&&!h(e._labelCollection)&&h(e.id)&&w0(i,e.id.id)&&h(e.id._label)){const s=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(s),c=Fn.getScreenSpaceBoundingBox(a,t,_A);E0(c,n),o=xe.union(o,c,o)}return o}function gA(e,t){if(e.clusterShow=!0,!h(e._labelCollection)&&h(e.id)&&w0(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 b0(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 w0(e,t){return h(e)&&h(e._collectionIndicesByEntity[t])&&h(e._collectionIndicesByEntity[t].labelIndex)}function nh(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===pe.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 yA=new xe,xA=new xe,CA=new xe;function EA(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 Qt({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,T=n.camera.positionWC,D=new oi(E,T),A=[];e._clusterLabels&&nh(i,A,n,D,e),e._clusterBillboards&&nh(o,A,n,D,e),e._clusterPoints&&nh(s,A,n,D,e);let O,I,B,M,G,P,V,k,H,j,r,b;if(A.length>0){const v=new Jl(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 q=he._computeScreenSpacePosition(N.IDENTITY,z.position,f.ZERO,U.ZERO,n);if(!h(q))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=q.x-Z*.5,se=q.y-X*.5,_e=q.x+Z,Ee=q.y+X;for(G=v.range(ie,se,_e,Ee),P=G.length,j=0,H=[],I=0;I<P;++I)V=G[I],k=A[V],k.clustered||(++j,r=k.collection,b=k.index,H.push(r.get(b).id));if(j>=d)for(b0(z.position,j,H,e),g.push(z),I=0;I<P;++I)A[G[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,b=z.index;const q=r.get(b);M=T0(q,z.coord,u,e,yA);const W=xe.clone(M,xA);G=v.range(M.x,M.y,M.x+M.width,M.y+M.height),P=G.length;const Z=f.clone(q.position);for(j=1,H=[q.id],I=0;I<P;++I)if(V=G[I],k=A[V],!k.clustered){const X=k.collection.get(k.index),ie=T0(X,k.coord,u,e,CA);f.add(X.position,Z,Z),xe.union(W,ie,W),++j,H.push(X.id)}if(j>=d){const X=f.multiplyByScalar(Z,1/j,Z);for(b0(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[G[I]].clustered=!0}else gA(q,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=EA(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 ih(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 oh(e,t){const n=e._collectionIndicesByEntity[t];!h(n.billboardIndex)&&!h(n.labelIndex)&&!h(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Un.prototype.getLabel=ih("_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,oh(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=ih("_billboardCollection",Qt,"_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,oh(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=ih("_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,oh(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function rh(e){if(!h(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function TA(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,rh(e._labelCollection),rh(e._billboardCollection),rh(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,TA(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 sh(e){this._name=e,this._clock=void 0,this._changed=new ze,this._error=new ze,this._isLoading=!1,this._loading=new ze,this._entityCollection=new Xt(this),this._entityCluster=new Un}Object.defineProperties(sh.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){ya.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}}}),sh.prototype.update=function(e){return!0};function ah(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:w.fromCssColorString(i),arcType:ei.NONE,shadows:oa.DISABLED}}}function bA(e,t,n,i,o=new pt(0,0,0),s=1){return{id:e,name:n,position:t,orientation:me.headingPitchRollQuaternion(t,o),model:{show:!0,uri:i,scale:s,heightReference:di.NONE}}}function ch(e,t,n,i,o){n||(n=new pt);const s=me.headingPitchRollQuaternion(e,n,i,o),a=N.fromRotationTranslation(F.fromQuaternion(s,new F),e,new N);return N.multiplyByPoint(a,t,new f)}function lh(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...wA(e[i],e[i+1],t*-1e3,100));return n}function wA(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),T=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),G=f.multiplyByScalar(y,B,new f),P=f.multiplyByScalar(x,M,new f),V=f.add(G,P,new f),k=O*Math.PI,H=E*I+T*O+Math.sin(k)*g;V=f.multiplyByScalar(V,H,V),o.push(V)}return o.push(t),o}class SA{constructor(t,n,i){Ye(this,"towerModelUri");Ye(this,"viewer");Ye(this,"LineInfo");Ye(this,"dataSource2",new sh("myEntity2"));Ye(this,"entityCollection2",this.dataSource2.entities);Ye(this,"offsetTowers",[]);Ye(this,"offsetLines11",[]);Ye(this,"offsetLines12",[]);Ye(this,"offsetLines13",[]);Ye(this,"offsetArcLines1A",[]);Ye(this,"offsetArcLines1B",[]);Ye(this,"offsetArcLines1C",[]);this.towerModelUri=n,this.viewer=t,this.LineInfo=i}loadLineTower(){this.LineInfo.towers.forEach(t=>{this.offsetTowers.push(f.fromDegrees(t.Longitude,t.Latitude,t.Altitude-t.towerHeight))}),this.offsetTowers.forEach((t,n)=>{let i=new pt(S.toRadians(this.LineInfo.towers[n].Roll),0,0);this.offsetLines11.push(ch(t,new f(this.LineInfo.TowerAPoint[n][0],this.LineInfo.TowerAPoint[n][1],this.LineInfo.TowerAPoint[n][2]),i)),this.offsetLines12.push(ch(t,new f(this.LineInfo.TowerBPoint[n][0],this.LineInfo.TowerBPoint[n][1],this.LineInfo.TowerBPoint[n][2]),i)),this.offsetLines13.push(ch(t,new f(this.LineInfo.TowerCPoint[n][0],this.LineInfo.TowerCPoint[n][1],this.LineInfo.TowerCPoint[n][2]),i))}),this.offsetArcLines1A=lh(this.offsetLines11),this.offsetArcLines1B=lh(this.offsetLines12),this.offsetArcLines1C=lh(this.offsetLines13),this.entityCollection2.add(ah(this.offsetArcLines1A,"导线A",this.LineInfo.lineWidth,this.LineInfo.lineAColor)),this.entityCollection2.add(ah(this.offsetArcLines1B,"导线B",this.LineInfo.lineWidth,this.LineInfo.lineBColor)),this.entityCollection2.add(ah(this.offsetArcLines1C,"导线C",this.LineInfo.lineWidth,this.LineInfo.lineCColor)),this.offsetTowers.forEach((t,n)=>{const i=S.toRadians(this.LineInfo.towers[n].Roll),o=new pt(i,S.toRadians(90),0);this.entityCollection2.add(bA(this.LineInfo.towers[n].id,t,this.LineInfo.towers[n].name,this.towerModelUri,o,this.LineInfo.towers[n].towerScale))})}loadLineModel(){this.viewer.dataSources.add(this.dataSource2)}RemoveLineModel(){this.viewer.dataSources.remove(this.dataSource2)}}class AA{constructor(){Ye(this,"towers",[]);Ye(this,"TowerAPoint",[]);Ye(this,"TowerBPoint",[]);Ye(this,"TowerCPoint",[]);Ye(this,"lineAColor","#FFFFFF");Ye(this,"lineBColor","#FFFFFF");Ye(this,"lineCColor","#FFFFFF");Ye(this,"lineWidth",1)}}class DA{constructor(){Ye(this,"id","");Ye(this,"name","");Ye(this,"Longitude",0);Ye(this,"Latitude",0);Ye(this,"Altitude",0);Ye(this,"Roll",0);Ye(this,"towerScale",1);Ye(this,"towerHeight",42)}}Jt.OWEEgineManager=SA,Jt.TowerInfo=DA,Jt.TowerLineInfo=AA,Object.defineProperty(Jt,Symbol.toStringTag,{value:"Module"})});
|
|
6584
|
+
`,sA=Ie.SHOW_INDEX,Zl=Ie.POSITION_INDEX,c0=Ie.COLOR_INDEX,aA=Ie.OUTLINE_COLOR_INDEX,cA=Ie.OUTLINE_WIDTH_INDEX,lA=Ie.PIXEL_SIZE_INDEX,l0=Ie.SCALE_BY_DISTANCE_INDEX,h0=Ie.TRANSLUCENCY_BY_DISTANCE_INDEX,f0=Ie.DISTANCE_DISPLAY_CONDITION_INDEX,hA=Ie.DISABLE_DEPTH_DISTANCE_INDEX,fA=Ie.SPLIT_DIRECTION_INDEX,Kl=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(Kl),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 Ql(this),this._pointPrimitives.length}}});function u0(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(){u0(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function Ql(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 Ql(this),this._pointPrimitives[e]},_n.prototype.computeNewBuffersUsage=function(){const e=this._buffersUsage;let t=!1;const n=this._propertiesChanged;for(let i=0;i<Kl;++i){const o=n[i]===0?De.STATIC_DRAW:De.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function uA(e,t,n){return new bt(e,[{index:Zt.positionHighAndSize,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Zl]},{index:Zt.positionLowAndShow,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[Zl]},{index:Zt.compressedAttribute0,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[c0]},{index:Zt.compressedAttribute1,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[h0]},{index:Zt.scaleByDistance,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[l0]},{index:Zt.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:oe.FLOAT,usage:n[f0]}],t)}const Jl=new Ye;function d0(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,Jl);const a=i.pixelSize,c=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+c);const l=n[Zt.positionHighAndSize],u=Jl.high;l(o,u.x,u.y,u.z,a);const d=n[Zt.positionLowAndOutline],p=Jl.low;d(o,p.x,p.y,p.z,c)}const wa=65536,Zr=256;function p0(e,t,n,i){const o=i._index,s=i.color,a=i.getPickId(t).color,c=i.outlineColor;let l=w.floatToByte(s.red),u=w.floatToByte(s.green),d=w.floatToByte(s.blue);const p=l*wa+u*Zr+d;l=w.floatToByte(c.red),u=w.floatToByte(c.green),d=w.floatToByte(c.blue);const g=l*wa+u*Zr+d;l=w.floatToByte(a.red),u=w.floatToByte(a.green),d=w.floatToByte(a.blue);const y=l*wa+u*Zr+d,x=w.floatToByte(s.alpha)*wa+w.floatToByte(c.alpha)*Zr+w.floatToByte(a.alpha),E=n[Zt.compressedAttribute0];E(o,p,g,y,x)}function m0(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)*Zr+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 _0(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 g0(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 dA(e,t,n,i){d0(e,t,n,i),p0(e,t,n,i),m0(e,t,n,i),_0(e,t,n,i),g0(e,t,n,i)}function eh(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 pA(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)&&eh(e,i,i.length,t,s,!0)):n===me.MORPHING?eh(e,i,i.length,t,s,!0):(n===me.SCENE2D||n===me.COLUMBUS_VIEW)&&eh(e,o,e._pointPrimitivesToUpdateIndex,t,s,!1)}function mA(e,t,n){const o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}const _A=[];_n.prototype.update=function(e){if(Ql(this),!this.show)return;this._maxTotalPointSize=Ee.maximumAliasedPointSize,pA(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<Kl;++B)s[B]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=uA(l,n,this._buffersUsage),c=this._vaf.writers;for(let B=0;B<n;++B){const M=this._pointPrimitives[B];M._dirty=!1,dA(this,l,c,M)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){const B=_A;B.length=0,(s[Zl]||s[cA]||s[lA])&&B.push(d0),(s[c0]||s[aA])&&B.push(p0),(s[sA]||s[h0])&&B.push(m0),s[l0]&&B.push(_0),(s[f0]||s[hA]||s[fA])&&B.push(g0);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 k=0;k<M;++k)B[k](this,l,c,P)}this._vaf.commit()}else{for(let q=0;q<o;++q){const P=i[q];P._dirty=!1;for(let k=0;k<M;++k)B[k](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),mA(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=ke.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=ke.fromCache({depthTest:{enabled:!0,func:R.LEQUAL},depthMask:!1,blending:Ji.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:[rA]}),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:[ba]}),this._sp=rt.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt}),E=new ye({defines:["TRANSLUCENT"],sources:[ba]}),this._spTranslucent=rt.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._blendOption===ft.OPAQUE&&(E=new ye({sources:[ba]}),this._sp=rt.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:x,fragmentShaderSource:E,attributeLocations:Zt})),this._blendOption===ft.TRANSLUCENT&&(E=new ye({sources:[ba]}),this._spTranslucent=rt.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 T,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;T=this._vaf.va,D=T.length,B.length=D;const P=q?D*2:D;for(O=0;O<P;++O){const k=M||q&&O%2===0;A=B[O],h(A)||(A=B[O]=new $e),A.primitiveType=qe.POINTS,A.pass=k||!q?zt.OPAQUE:zt.TRANSLUCENT,A.owner=this;const V=q?Math.floor(O/2):O;A.boundingVolume=p,A.modelMatrix=g,A.shaderProgram=k?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=T[V].va,A.renderState=k?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(),u0(this._pointPrimitives),Qe(this)};const y0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],th=1,Kr=8;class nh{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!==th)throw new Error(`Got v${o} data when expected v${th}.`);const s=y0[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 nh(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=y0.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,Kr,t),this.coords=new this.ArrayType(this.data,Kr+c+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Kr+a+c+l),this.ids=new this.IndexArrayType(this.data,Kr,t),this.coords=new this.ArrayType(this.data,Kr+c+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(th<<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 ih(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 T=g;T<=p;T++){const D=a[2*T],A=a[2*T+1];D>=t&&D<=i&&A>=n&&A<=o&&u.push(s[T])}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 T=g;T<=p;T++)C0(s[2*T],s[2*T+1],t,n)<=u&&l.push(o[T]);continue}const y=g+p>>1,x=s[2*y],E=s[2*y+1];C0(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 ih(e,t,n,i,o,s){if(o-i<=n)return;const a=i+o>>1;x0(e,t,a,i,o,s),ih(e,t,n,i,a-1,1-s),ih(e,t,n,a+1,o,1-s)}function x0(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));x0(e,t,n,x,E,s)}const a=t[2*n+s];let c=i,l=o;for(Qr(e,t,i,n),t[2*o+s]>a&&Qr(e,t,i,o);c<l;){for(Qr(e,t,c,l),c++,l--;t[2*c+s]<a;)c++;for(;t[2*l+s]>a;)l--}t[2*i+s]===a?Qr(e,t,i,l):(l++,Qr(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function Qr(e,t,n,i){oh(e,n,i),oh(t,2*n,2*i),oh(t,2*n+1,2*i+1)}function oh(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function C0(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 E0(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}const gA=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=he.getScreenSpaceBoundingBox(e,t,o):h(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ie.getScreenSpaceBoundingBox(e,t,o)),E0(o,n),i._clusterLabels&&!h(e._labelCollection)&&h(e.id)&&w0(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,gA);E0(c,n),o=Ce.union(o,c,o)}return o}function yA(e,t){if(e.clusterShow=!0,!h(e._labelCollection)&&h(e.id)&&w0(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 b0(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 w0(e,t){return h(e)&&h(e._collectionIndicesByEntity[t])&&h(e._collectionIndicesByEntity[t].labelIndex)}function rh(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 xA=new Ce,CA=new Ce,EA=new Ce;function TA(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,T=n.camera.positionWC,D=new oi(E,T),A=[];e._clusterLabels&&rh(i,A,n,D,e),e._clusterBillboards&&rh(o,A,n,D,e),e._clusterPoints&&rh(s,A,n,D,e);let O,I,B,M,q,P,k,V,H,j,r,b;if(A.length>0){const v=new nh(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=he._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,Te=G.y+X;for(q=v.range(ie,se,ge,Te),P=q.length,j=0,H=[],I=0;I<P;++I)k=q[I],V=A[k],V.clustered||(++j,r=V.collection,b=V.index,H.push(r.get(b).id));if(j>=d)for(b0(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,b=z.index;const G=r.get(b);M=T0(G,z.coord,u,e,xA);const W=Ce.clone(M,CA);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(k=q[I],V=A[k],!V.clustered){const X=V.collection.get(V.index),ie=T0(X,V.coord,u,e,EA);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(b0(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 yA(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=TA(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 sh(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 ah(e,t){const n=e._collectionIndicesByEntity[t];!h(n.billboardIndex)&&!h(n.labelIndex)&&!h(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Un.prototype.getLabel=sh("_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,ah(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=sh("_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,ah(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=sh("_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,ah(this,e.id);const i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function ch(e){if(!h(e))return;const t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function bA(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,ch(e._labelCollection),ch(e._billboardCollection),ch(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,bA(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 lh(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(lh.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){Ea.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}}}),lh.prototype.update=function(e){return!0};function Jr(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:w.fromCssColorString(i),arcType:ei.NONE,shadows:aa.DISABLED}}}function S0(e,t,n,i,o=new it(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 qo(e,t,n,i,o){n||(n=new it);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 es(e,t=4){const n=[];for(var i=0;i<e.length-1;i++)n.push(...wA(e[i],e[i+1],t*-1e3,100));return n}function wA(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),T=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),k=f.add(q,P,new f),V=O*Math.PI,H=E*I+T*O+Math.sin(V)*g;k=f.multiplyByScalar(k,H,k),o.push(k)}return o.push(t),o}class SA{constructor(t,n,i){ue(this,"viewer");ue(this,"LineInfo");ue(this,"Keym","");ue(this,"dataSource2");ue(this,"entityCollection2");ue(this,"offsetTowers",[]);ue(this,"offsetWires11",[]);ue(this,"offsetWires12",[]);ue(this,"offsetWires13",[]);ue(this,"offsetArcWires1A",[]);ue(this,"offsetArcWires1B",[]);ue(this,"offsetArcWires1C",[]);ue(this,"offsetGrouundWires1",[]);ue(this,"offsetGrouundWires2",[]);ue(this,"offsetGrouundWires11",[]);ue(this,"offsetGrouundWires12",[]);this.Keym=i,this.viewer=t,this.LineInfo=n,this.dataSource2=new lh(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 it(S.toRadians(this.LineInfo.towers[n].RollX),S.toRadians(this.LineInfo.towers[n].RollY),S.toRadians(this.LineInfo.towers[n].RollZ));this.entityCollection2.add(S0(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 it(S.toRadians(this.LineInfo.towers[n].RollX),0,0),s=0;this.LineInfo.towers[n].Insulators.forEach(a=>{const c=new it(S.toRadians(a.RollX),S.toRadians(a.RollY),S.toRadians(a.RollZ)),l=qo(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(S0(a.id,l,a.name,a.InsulatorModelUri,c,a.InsulatorScale)),s=s+1})}),this.offsetTowers.forEach((t,n)=>{let i=new it(S.toRadians(this.LineInfo.towers[n].RollX),0,0);this.offsetWires11.push(qo(t,new f(this.LineInfo.InsulatorAPoint[n][0],this.LineInfo.InsulatorAPoint[n][1],this.LineInfo.InsulatorAPoint[n][2]),i)),this.offsetWires12.push(qo(t,new f(this.LineInfo.InsulatorBPoint[n][0],this.LineInfo.InsulatorBPoint[n][1],this.LineInfo.InsulatorBPoint[n][2]),i)),this.offsetWires13.push(qo(t,new f(this.LineInfo.InsulatorCPoint[n][0],this.LineInfo.InsulatorCPoint[n][1],this.LineInfo.InsulatorCPoint[n][2]),i)),this.offsetGrouundWires11.push(qo(t,new f(this.LineInfo.InsulatorD1Point[n][0],this.LineInfo.InsulatorD1Point[n][1],this.LineInfo.InsulatorD1Point[n][2]),i)),this.offsetGrouundWires12.push(qo(t,new f(this.LineInfo.InsulatorD2Point[n][0],this.LineInfo.InsulatorD2Point[n][1],this.LineInfo.InsulatorD2Point[n][2]),i))}),this.offsetArcWires1A=es(this.offsetWires11),this.offsetArcWires1B=es(this.offsetWires12),this.offsetArcWires1C=es(this.offsetWires13),this.offsetGrouundWires1=es(this.offsetGrouundWires11,2),this.offsetGrouundWires2=es(this.offsetGrouundWires12,2),this.entityCollection2.add(Jr(this.offsetArcWires1A,"导线A",this.LineInfo.wireWidth,this.LineInfo.wireAColor)),this.entityCollection2.add(Jr(this.offsetArcWires1B,"导线B",this.LineInfo.wireWidth,this.LineInfo.wireBColor)),this.entityCollection2.add(Jr(this.offsetArcWires1C,"导线C",this.LineInfo.wireWidth,this.LineInfo.wireCColor)),this.entityCollection2.add(Jr(this.offsetGrouundWires1,"地线1",this.LineInfo.wireWidth,this.LineInfo.wireD1Color)),this.entityCollection2.add(Jr(this.offsetGrouundWires2,"地线2",this.LineInfo.wireWidth,this.LineInfo.wireD2Color)))}loadLineModel(){this.Keym=="OW_JPS_EEngin_001"&&this.viewer.dataSources.add(this.dataSource2)}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)}}class AA{constructor(){ue(this,"LineID","myEntity1");ue(this,"towers",[]);ue(this,"InsulatorAPoint",[]);ue(this,"InsulatorBPoint",[]);ue(this,"InsulatorCPoint",[]);ue(this,"InsulatorD1Point",[]);ue(this,"InsulatorD2Point",[]);ue(this,"wireAColor","#FFFFFF");ue(this,"wireBColor","#FFFFFF");ue(this,"wireCColor","#FFFFFF");ue(this,"wireD1Color","#FFFFFF");ue(this,"wireD2Color","#FFFFFF");ue(this,"wireWidth",1)}}class DA{constructor(){ue(this,"id","");ue(this,"name","");ue(this,"Longitude",0);ue(this,"Latitude",0);ue(this,"Altitude",0);ue(this,"RollX",0);ue(this,"RollY",90);ue(this,"RollZ",0);ue(this,"towerScale",1);ue(this,"towerHeight",42);ue(this,"towerModelUri","");ue(this,"towerPoint",[]);ue(this,"Insulators",[])}}class OA{constructor(){ue(this,"id","");ue(this,"name","");ue(this,"type","");ue(this,"Wairnum","");ue(this,"RollX",90);ue(this,"RollY",90);ue(this,"RollZ",0);ue(this,"InsulatorScale",.001);ue(this,"InsulatorModelUri","")}}class vA{constructor(){ue(this,"name","");ue(this,"X",-45);ue(this,"Y",90);ue(this,"Z",0)}}Vt.GUAPoint=vA,Vt.InsulatorInfo=OA,Vt.OWEEgineManager=SA,Vt.TowerInfo=DA,Vt.TowerLineInfo=AA,Object.defineProperty(Vt,Symbol.toStringTag,{value:"Module"})});
|