/** * @license * Cesium - https://github.com/CesiumGS/cesium * Version 1.96.6 * * Copyright 2011-2022 Cesium Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Columbus View (Pat. Pend.) * * Portions licensed separately. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ define(["exports","./RuntimeError-a977b8e0","./defaultValue-028a8a27","./ComponentDatatype-438cad2a"],(function(e,t,n,r){"use strict";function a(e,t,r){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0)}a.fromSpherical=function(e,r){t.Check.typeOf.object("spherical",e),n.defined(r)||(r=new a);const c=e.clock,o=e.cone,i=n.defaultValue(e.magnitude,1),u=i*Math.sin(o);return r.x=u*Math.cos(c),r.y=u*Math.sin(c),r.z=i*Math.cos(o),r},a.fromElements=function(e,t,r,c){return n.defined(c)?(c.x=e,c.y=t,c.z=r,c):new a(e,t,r)},a.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a]=e.z,r},a.unpack=function(e,r,c){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(c)||(c=new a),c.x=e[r++],c.y=e[r++],c.z=e[r],c},a.packArray=function(e,r){t.Check.defined("array",e);const c=e.length,o=3*c;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==o)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");r.length!==o&&(r.length=o)}else r=new Array(o);for(let t=0;t<c;++t)a.pack(e[t],r,3*t);return r},a.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new t.DeveloperError("array length must be a multiple of 3.");const c=e.length;n.defined(r)?r.length=c/3:r=new Array(c/3);for(let t=0;t<c;t+=3){const n=t/3;r[n]=a.unpack(e,t,r[n])}return r},a.fromArray=a.unpack,a.maximumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.z=Math.min(e.z,n.z),r},a.maximumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r.z=Math.max(e.z,n.z),r},a.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);const o=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y),u=r.CesiumMath.clamp(e.z,n.z,a.z);return c.x=o,c.y=i,c.z=u,c},a.magnitudeSquared=function(e){return t.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};const c=new a;a.distance=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.subtract(e,n,c),a.magnitude(c)},a.distanceSquared=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.subtract(e,n,c),a.magnitudeSquared(c)},a.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=a.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,isNaN(n.x)||isNaN(n.y)||isNaN(n.z))throw new t.DeveloperError("normalized result is not a number");return n},a.dot=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z},a.multiplyComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r.z=e.z*n.z,r},a.divideComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r.z=e.z/n.z,r},a.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r.z=e.z+n.z,r},a.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r.z=e.z-n.z,r},a.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r.z=e.z*n,r},a.divideByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r.z=e.z/n,r},a.negate=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n},a.abs=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n};const o=new a;a.lerp=function(e,n,r,c){return t.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",c),a.multiplyByScalar(n,r,o),c=a.multiplyByScalar(e,1-r,c),a.add(o,c,c)};const i=new a,u=new a;a.angleBetween=function(e,n){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),a.normalize(e,i),a.normalize(n,u);const r=a.dot(i,u),c=a.magnitude(a.cross(i,u,i));return Math.atan2(c,r)};const s=new a;a.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=a.normalize(e,s);return a.abs(r,r),n=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,n):a.clone(a.UNIT_Z,n):r.y<=r.z?a.clone(a.UNIT_Y,n):a.clone(a.UNIT_Z,n),n},a.projectVector=function(e,n,r){t.Check.defined("a",e),t.Check.defined("b",n),t.Check.defined("result",r);const c=a.dot(e,n)/a.dot(n,n);return a.multiplyByScalar(n,c,r)},a.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},a.equalsEpsilon=function(e,t,a,c){return e===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)&&r.CesiumMath.equalsEpsilon(e.z,t.z,a,c)},a.cross=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e.x,c=e.y,o=e.z,i=n.x,u=n.y,s=n.z,f=c*s-o*u,h=o*i-a*s,l=a*u-c*i;return r.x=f,r.y=h,r.z=l,r},a.midpoint=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=.5*(e.x+n.x),r.y=.5*(e.y+n.y),r.z=.5*(e.z+n.z),r},a.fromDegrees=function(e,n,c,o,i){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),a.fromRadians(e,n,c,o,i)};let f=new a,h=new a;const l=new a(40680631590769,40680631590769,40408299984661.445);a.fromRadians=function(e,r,c,o,i){t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),c=n.defaultValue(c,0);const u=n.defined(o)?o.radiiSquared:l,s=Math.cos(r);f.x=s*Math.cos(e),f.y=s*Math.sin(e),f.z=Math.sin(r),f=a.normalize(f,f),a.multiplyComponents(u,f,h);const y=Math.sqrt(a.dot(f,h));return h=a.divideByScalar(h,y,h),f=a.multiplyByScalar(f,c,f),n.defined(i)||(i=new a),a.add(h,f,i)},a.fromDegreesArray=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<2||e.length%2!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;n.defined(c)?c.length=o/2:c=new Array(o/2);for(let t=0;t<o;t+=2){const n=e[t],o=e[t+1],i=t/2;c[i]=a.fromDegrees(n,o,0,r,c[i])}return c},a.fromRadiansArray=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<2||e.length%2!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 2 and at least 2");const o=e.length;n.defined(c)?c.length=o/2:c=new Array(o/2);for(let t=0;t<o;t+=2){const n=e[t],o=e[t+1],i=t/2;c[i]=a.fromRadians(n,o,0,r,c[i])}return c},a.fromDegreesArrayHeights=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<3||e.length%3!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;n.defined(c)?c.length=o/3:c=new Array(o/3);for(let t=0;t<o;t+=3){const n=e[t],o=e[t+1],i=e[t+2],u=t/3;c[u]=a.fromDegrees(n,o,i,r,c[u])}return c},a.fromRadiansArrayHeights=function(e,r,c){if(t.Check.defined("coordinates",e),e.length<3||e.length%3!==0)throw new t.DeveloperError("the number of coordinates must be a multiple of 3 and at least 3");const o=e.length;n.defined(c)?c.length=o/3:c=new Array(o/3);for(let t=0;t<o;t+=3){const n=e[t],o=e[t+1],i=e[t+2],u=t/3;c[u]=a.fromRadians(n,o,i,r,c[u])}return c},a.ZERO=Object.freeze(new a(0,0,0)),a.ONE=Object.freeze(new a(1,1,1)),a.UNIT_X=Object.freeze(new a(1,0,0)),a.UNIT_Y=Object.freeze(new a(0,1,0)),a.UNIT_Z=Object.freeze(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const y=new a,p=new a;function d(e,c,o,i,u){if(!n.defined(e))throw new t.DeveloperError("cartesian is required.");if(!n.defined(c))throw new t.DeveloperError("oneOverRadii is required.");if(!n.defined(o))throw new t.DeveloperError("oneOverRadiiSquared is required.");if(!n.defined(i))throw new t.DeveloperError("centerToleranceSquared is required.");const s=e.x,f=e.y,h=e.z,l=c.x,d=c.y,m=c.z,O=s*s*l*l,C=f*f*d*d,b=h*h*m*m,k=O+C+b,x=Math.sqrt(1/k),g=a.multiplyByScalar(e,x,y);if(k<i)return isFinite(x)?a.clone(g,u):void 0;const j=o.x,w=o.y,M=o.z,z=p;z.x=g.x*j*2,z.y=g.y*w*2,z.z=g.z*M*2;let E,q,T,S,R,_,V,v,A,N,I,U=(1-x)*a.magnitude(e)/(.5*a.magnitude(z)),P=0;do{U-=P,T=1/(1+U*j),S=1/(1+U*w),R=1/(1+U*M),_=T*T,V=S*S,v=R*R,A=_*T,N=V*S,I=v*R,E=O*_+C*V+b*v-1,q=O*A*j+C*N*w+b*I*M;const e=-2*q;P=E/e}while(Math.abs(E)>r.CesiumMath.EPSILON12);return n.defined(u)?(u.x=s*T,u.y=f*S,u.z=h*R,u):new a(s*T,f*S,h*R)}function m(e,t,r){this.longitude=n.defaultValue(e,0),this.latitude=n.defaultValue(t,0),this.height=n.defaultValue(r,0)}m.fromRadians=function(e,r,a,c){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",r),a=n.defaultValue(a,0),n.defined(c)?(c.longitude=e,c.latitude=r,c.height=a,c):new m(e,r,a)},m.fromDegrees=function(e,n,a,c){return t.Check.typeOf.number("longitude",e),t.Check.typeOf.number("latitude",n),e=r.CesiumMath.toRadians(e),n=r.CesiumMath.toRadians(n),m.fromRadians(e,n,a,c)};const O=new a,C=new a,b=new a,k=new a(1/6378137,1/6378137,1/6356752.314245179),x=new a(1/40680631590769,1/40680631590769,1/40408299984661.445),g=r.CesiumMath.EPSILON1;function j(e,c,o,i){c=n.defaultValue(c,0),o=n.defaultValue(o,0),i=n.defaultValue(i,0),t.Check.typeOf.number.greaterThanOrEquals("x",c,0),t.Check.typeOf.number.greaterThanOrEquals("y",o,0),t.Check.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new a(c,o,i),e._radiiSquared=new a(c*c,o*o,i*i),e._radiiToTheFourth=new a(c*c*c*c,o*o*o*o,i*i*i*i),e._oneOverRadii=new a(0===c?0:1/c,0===o?0:1/o,0===i?0:1/i),e._oneOverRadiiSquared=new a(0===c?0:1/(c*c),0===o?0:1/(o*o),0===i?0:1/(i*i)),e._minimumRadius=Math.min(c,o,i),e._maximumRadius=Math.max(c,o,i),e._centerToleranceSquared=r.CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function w(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,j(this,e,t,n)}m.fromCartesian=function(e,t,c){const o=n.defined(t)?t.oneOverRadii:k,i=n.defined(t)?t.oneOverRadiiSquared:x,u=n.defined(t)?t._centerToleranceSquared:g,s=d(e,o,i,u,C);if(!n.defined(s))return;let f=a.multiplyComponents(s,i,O);f=a.normalize(f,f);const h=a.subtract(e,s,b),l=Math.atan2(f.y,f.x),y=Math.asin(f.z),p=r.CesiumMath.sign(a.dot(h,e))*a.magnitude(h);return n.defined(c)?(c.longitude=l,c.latitude=y,c.height=p,c):new m(l,y,p)},m.toCartesian=function(e,n,r){return t.Check.defined("cartographic",e),a.fromRadians(e.longitude,e.latitude,e.height,n,r)},m.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new m(e.longitude,e.latitude,e.height)},m.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},m.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},m.ZERO=Object.freeze(new m(0,0,0)),m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`},Object.defineProperties(w.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}}}),w.clone=function(e,t){if(!n.defined(e))return;const r=e._radii;return n.defined(t)?(a.clone(r,t._radii),a.clone(e._radiiSquared,t._radiiSquared),a.clone(e._radiiToTheFourth,t._radiiToTheFourth),a.clone(e._oneOverRadii,t._oneOverRadii),a.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new w(r.x,r.y,r.z)},w.fromCartesian3=function(e,t){return n.defined(t)||(t=new w),n.defined(e)&&j(t,e.x,e.y,e.z),t},w.WGS84=Object.freeze(new w(6378137,6378137,6356752.314245179)),w.UNIT_SPHERE=Object.freeze(new w(1,1,1)),w.MOON=Object.freeze(new w(r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS,r.CesiumMath.LUNAR_RADIUS)),w.prototype.clone=function(e){return w.clone(this,e)},w.packedLength=a.packedLength,w.pack=function(e,r,c){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),c=n.defaultValue(c,0),a.pack(e._radii,r,c),r},w.unpack=function(e,r,c){t.Check.defined("array",e),r=n.defaultValue(r,0);const o=a.unpack(e,r);return w.fromCartesian3(o,c)},w.prototype.geocentricSurfaceNormal=a.normalize,w.prototype.geodeticSurfaceNormalCartographic=function(e,r){t.Check.typeOf.object("cartographic",e);const c=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(c),s=i*Math.sin(c),f=Math.sin(o);return n.defined(r)||(r=new a),r.x=u,r.y=s,r.z=f,a.normalize(r,r)},w.prototype.geodeticSurfaceNormal=function(e,t){if(!a.equalsEpsilon(e,a.ZERO,r.CesiumMath.EPSILON14))return n.defined(t)||(t=new a),t=a.multiplyComponents(e,this._oneOverRadiiSquared,t),a.normalize(t,t)};const M=new a,z=new a;w.prototype.cartographicToCartesian=function(e,t){const r=M,c=z;this.geodeticSurfaceNormalCartographic(e,r),a.multiplyComponents(this._radiiSquared,r,c);const o=Math.sqrt(a.dot(r,c));return a.divideByScalar(c,o,c),a.multiplyByScalar(r,e.height,r),n.defined(t)||(t=new a),a.add(c,r,t)},w.prototype.cartographicArrayToCartesianArray=function(e,r){t.Check.defined("cartographics",e);const a=e.length;n.defined(r)?r.length=a:r=new Array(a);for(let t=0;t<a;t++)r[t]=this.cartographicToCartesian(e[t],r[t]);return r};const E=new a,q=new a,T=new a;w.prototype.cartesianToCartographic=function(e,t){const c=this.scaleToGeodeticSurface(e,q);if(!n.defined(c))return;const o=this.geodeticSurfaceNormal(c,E),i=a.subtract(e,c,T),u=Math.atan2(o.y,o.x),s=Math.asin(o.z),f=r.CesiumMath.sign(a.dot(i,e))*a.magnitude(i);return n.defined(t)?(t.longitude=u,t.latitude=s,t.height=f,t):new m(u,s,f)},w.prototype.cartesianArrayToCartographicArray=function(e,r){t.Check.defined("cartesians",e);const a=e.length;n.defined(r)?r.length=a:r=new Array(a);for(let t=0;t<a;++t)r[t]=this.cartesianToCartographic(e[t],r[t]);return r},w.prototype.scaleToGeodeticSurface=function(e,t){return d(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},w.prototype.scaleToGeocentricSurface=function(e,r){t.Check.typeOf.object("cartesian",e),n.defined(r)||(r=new a);const c=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(c*c*u.x+o*o*u.y+i*i*u.z);return a.multiplyByScalar(e,s,r)},w.prototype.transformPositionToScaledSpace=function(e,t){return n.defined(t)||(t=new a),a.multiplyComponents(e,this._oneOverRadii,t)},w.prototype.transformPositionFromScaledSpace=function(e,t){return n.defined(t)||(t=new a),a.multiplyComponents(e,this._radii,t)},w.prototype.equals=function(e){return this===e||n.defined(e)&&a.equals(this._radii,e._radii)},w.prototype.toString=function(){return this._radii.toString()},w.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,c,o){if(t.Check.typeOf.object("position",e),!r.CesiumMath.equalsEpsilon(this._radii.x,this._radii.y,r.CesiumMath.EPSILON15))throw new t.DeveloperError("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t.Check.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),c=n.defaultValue(c,0);const i=this._squaredXOverSquaredZ;if(n.defined(o)||(o=new a),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-c))return o};const S=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],R=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function _(e,n,r){t.Check.typeOf.number("a",e),t.Check.typeOf.number("b",n),t.Check.typeOf.func("func",r);const a=.5*(n+e),c=.5*(n-e);let o=0;for(let t=0;t<5;t++){const e=c*S[t];o+=R[t]*(r(a+e)+r(a-e))}return o*=c,o}function V(e,t,r,a,c,o,i,u,s){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(a,0),this[2]=n.defaultValue(i,0),this[3]=n.defaultValue(t,0),this[4]=n.defaultValue(c,0),this[5]=n.defaultValue(u,0),this[6]=n.defaultValue(r,0),this[7]=n.defaultValue(o,0),this[8]=n.defaultValue(s,0)}w.prototype.surfaceArea=function(e){t.Check.typeOf.object("rectangle",e);const n=e.west;let a=e.east;const c=e.south,o=e.north;for(;a<n;)a+=r.CesiumMath.TWO_PI;const i=this._radiiSquared,u=i.x,s=i.y,f=i.z,h=u*s;return _(c,o,(function(e){const t=Math.cos(e),r=Math.sin(e);return Math.cos(e)*_(n,a,(function(e){const n=Math.cos(e),a=Math.sin(e);return Math.sqrt(h*r*r+f*(s*n*n+u*a*a)*t*t)}))}))},V.packedLength=9,V.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r},V.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new V),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a},V.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=9*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 9 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)V.pack(e[t],r,9*t);return r},V.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new t.DeveloperError("array length must be a multiple of 9.");const a=e.length;n.defined(r)?r.length=a/9:r=new Array(a/9);for(let t=0;t<a;t+=9){const n=t/9;r[n]=V.unpack(e,t,r[n])}return r},V.clone=function(e,t){if(n.defined(e))return n.defined(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 V(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},V.fromArray=V.unpack,V.fromColumnMajorArray=function(e,n){return t.Check.defined("values",e),V.clone(e,n)},V.fromRowMajorArray=function(e,r){return t.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new V(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},V.fromQuaternion=function(e,r){t.Check.typeOf.object("quaternion",e);const a=e.x*e.x,c=e.x*e.y,o=e.x*e.z,i=e.x*e.w,u=e.y*e.y,s=e.y*e.z,f=e.y*e.w,h=e.z*e.z,l=e.z*e.w,y=e.w*e.w,p=a-u-h+y,d=2*(c-l),m=2*(o+f),O=2*(c+l),C=-a+u-h+y,b=2*(s-i),k=2*(o-f),x=2*(s+i),g=-a-u+h+y;return n.defined(r)?(r[0]=p,r[1]=O,r[2]=k,r[3]=d,r[4]=C,r[5]=x,r[6]=m,r[7]=b,r[8]=g,r):new V(p,d,m,O,C,b,k,x,g)},V.fromHeadingPitchRoll=function(e,r){t.Check.typeOf.object("headingPitchRoll",e);const a=Math.cos(-e.pitch),c=Math.cos(-e.heading),o=Math.cos(e.roll),i=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),f=a*c,h=-o*u+s*i*c,l=s*u+o*i*c,y=a*u,p=o*c+s*i*u,d=-s*c+o*i*u,m=-i,O=s*a,C=o*a;return n.defined(r)?(r[0]=f,r[1]=y,r[2]=m,r[3]=h,r[4]=p,r[5]=O,r[6]=l,r[7]=d,r[8]=C,r):new V(f,h,l,y,p,d,m,O,C)},V.fromScale=function(e,r){return t.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new V(e.x,0,0,0,e.y,0,0,0,e.z)},V.fromUniformScale=function(e,r){return t.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new V(e,0,0,0,e,0,0,0,e)},V.fromCrossProduct=function(e,r){return t.Check.typeOf.object("vector",e),n.defined(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new V(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},V.fromRotationX=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=a,r[5]=c,r[6]=0,r[7]=-c,r[8]=a,r):new V(1,0,0,0,a,-c,0,c,a)},V.fromRotationY=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=a,r[1]=0,r[2]=-c,r[3]=0,r[4]=1,r[5]=0,r[6]=c,r[7]=0,r[8]=a,r):new V(a,0,c,0,1,0,-c,0,a)},V.fromRotationZ=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=a,r[1]=c,r[2]=0,r[3]=-c,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new V(a,-c,0,c,a,0,0,0,1)},V.toArray=function(e,r){return t.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},V.getElementIndex=function(e,n){return t.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,2),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,2),3*e+n},V.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("result",r);const a=3*n,c=e[a],o=e[a+1],i=e[a+2];return r.x=c,r.y=o,r.z=i,r},V.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=V.clone(e,a);const c=3*n;return a[c]=r.x,a[c+1]=r.y,a[c+2]=r.z,a},V.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("result",r);const a=e[n],c=e[n+3],o=e[n+6];return r.x=a,r.y=c,r.z=o,r},V.setRow=function(e,n,r,a){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,2),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=V.clone(e,a),a[n]=r.x,a[n+3]=r.y,a[n+6]=r.z,a};const v=new a;V.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=V.getScale(e,v),c=n.x/a.x,o=n.y/a.y,i=n.z/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3]*o,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*i,r};const A=new a;V.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);const a=V.getScale(e,A),c=n/a.x,o=n/a.y,i=n/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3]*o,r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*i,r[7]=e[7]*i,r[8]=e[8]*i,r};const N=new a;V.getScale=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=a.magnitude(a.fromElements(e[0],e[1],e[2],N)),n.y=a.magnitude(a.fromElements(e[3],e[4],e[5],N)),n.z=a.magnitude(a.fromElements(e[6],e[7],e[8],N)),n};const I=new a;V.getMaximumScale=function(e){return V.getScale(e,I),a.maximumComponent(I)};const U=new a;V.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);const a=V.getScale(e,U);return r[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.x,r[3]=n[3]*a.y,r[4]=n[4]*a.y,r[5]=n[5]*a.y,r[6]=n[6]*a.z,r[7]=n[7]*a.z,r[8]=n[8]*a.z,r};const P=new a;function L(e){let t=0;for(let n=0;n<9;++n){const r=e[n];t+=r*r}return Math.sqrt(t)}V.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=V.getScale(e,P);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.x,n[3]=e[3]/r.y,n[4]=e[4]/r.y,n[5]=e[5]/r.y,n[6]=e[6]/r.z,n[7]=e[7]/r.z,n[8]=e[8]/r.z,n},V.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0]*n[0]+e[3]*n[1]+e[6]*n[2],c=e[1]*n[0]+e[4]*n[1]+e[7]*n[2],o=e[2]*n[0]+e[5]*n[1]+e[8]*n[2],i=e[0]*n[3]+e[3]*n[4]+e[6]*n[5],u=e[1]*n[3]+e[4]*n[4]+e[7]*n[5],s=e[2]*n[3]+e[5]*n[4]+e[8]*n[5],f=e[0]*n[6]+e[3]*n[7]+e[6]*n[8],h=e[1]*n[6]+e[4]*n[7]+e[7]*n[8],l=e[2]*n[6]+e[5]*n[7]+e[8]*n[8];return r[0]=a,r[1]=c,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=f,r[7]=h,r[8]=l,r},V.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r},V.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r},V.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=e[0]*a+e[3]*c+e[6]*o,u=e[1]*a+e[4]*c+e[7]*o,s=e[2]*a+e[5]*c+e[8]*o;return r.x=i,r.y=u,r.z=s,r},V.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},V.multiplyByScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.x,r[3]=e[3]*n.y,r[4]=e[4]*n.y,r[5]=e[5]*n.y,r[6]=e[6]*n.z,r[7]=e[7]*n.z,r[8]=e[8]*n.z,r},V.multiplyByUniformScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r},V.negate=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.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},V.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[0],a=e[3],c=e[6],o=e[1],i=e[4],u=e[7],s=e[2],f=e[5],h=e[8];return n[0]=r,n[1]=a,n[2]=c,n[3]=o,n[4]=i,n[5]=u,n[6]=s,n[7]=f,n[8]=h,n};const W=[1,0,0],B=[2,2,1];function D(e){let t=0;for(let n=0;n<3;++n){const r=e[V.getElementIndex(B[n],W[n])];t+=2*r*r}return Math.sqrt(t)}function $(e,t){const n=r.CesiumMath.EPSILON15;let a=0,c=1;for(let r=0;r<3;++r){const t=Math.abs(e[V.getElementIndex(B[r],W[r])]);t>a&&(c=r,a=t)}let o=1,i=0;const u=W[c],s=B[c];if(Math.abs(e[V.getElementIndex(s,u)])>n){const t=e[V.getElementIndex(s,s)],n=e[V.getElementIndex(u,u)],r=e[V.getElementIndex(s,u)],a=(t-n)/2/r;let c;c=a<0?-1/(-a+Math.sqrt(1+a*a)):1/(a+Math.sqrt(1+a*a)),o=1/Math.sqrt(1+c*c),i=c*o}return t=V.clone(V.IDENTITY,t),t[V.getElementIndex(u,u)]=t[V.getElementIndex(s,s)]=o,t[V.getElementIndex(s,u)]=i,t[V.getElementIndex(u,s)]=-i,t}const X=new V,Z=new V;V.computeEigenDecomposition=function(e,a){t.Check.typeOf.object("matrix",e);const c=r.CesiumMath.EPSILON20,o=10;let i=0,u=0;n.defined(a)||(a={});const s=a.unitary=V.clone(V.IDENTITY,a.unitary),f=a.diagonal=V.clone(e,a.diagonal),h=c*L(f);for(;u<o&&D(f)>h;)$(f,X),V.transpose(X,Z),V.multiply(f,X,f),V.multiply(Z,f,f),V.multiply(s,X,s),++i>2&&(++u,i=0);return a},V.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n},V.determinant=function(e){t.Check.typeOf.object("matrix",e);const n=e[0],r=e[3],a=e[6],c=e[1],o=e[4],i=e[7],u=e[2],s=e[5],f=e[8];return n*(o*f-s*i)+c*(s*a-r*f)+u*(r*i-o*a)},V.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const a=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=V.determinant(e);if(Math.abs(y)<=r.CesiumMath.EPSILON15)throw new t.DeveloperError("matrix is not invertible");n[0]=u*l-h*s,n[1]=h*o-c*l,n[2]=c*s-u*o,n[3]=f*s-i*l,n[4]=a*l-f*o,n[5]=i*o-a*s,n[6]=i*h-f*u,n[7]=f*c-a*h,n[8]=a*u-i*c;const p=1/y;return V.multiplyByScalar(n,p,n)};const Y=new V;function F(e,t,r,a){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0),this.w=n.defaultValue(a,0)}V.inverseTranspose=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),V.inverse(V.transpose(e,Y),n)},V.equals=function(e,t){return e===t||n.defined(e)&&n.defined(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]},V.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},V.IDENTITY=Object.freeze(new V(1,0,0,0,1,0,0,0,1)),V.ZERO=Object.freeze(new V(0,0,0,0,0,0,0,0,0)),V.COLUMN0ROW0=0,V.COLUMN0ROW1=1,V.COLUMN0ROW2=2,V.COLUMN1ROW0=3,V.COLUMN1ROW1=4,V.COLUMN1ROW2=5,V.COLUMN2ROW0=6,V.COLUMN2ROW1=7,V.COLUMN2ROW2=8,Object.defineProperties(V.prototype,{length:{get:function(){return V.packedLength}}}),V.prototype.clone=function(e){return V.clone(this,e)},V.prototype.equals=function(e){return V.equals(this,e)},V.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]},V.prototype.equalsEpsilon=function(e,t){return V.equalsEpsilon(this,e,t)},V.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})\n(${this[1]}, ${this[4]}, ${this[7]})\n(${this[2]}, ${this[5]}, ${this[8]})`},F.fromElements=function(e,t,r,a,c){return n.defined(c)?(c.x=e,c.y=t,c.z=r,c.w=a,c):new F(e,t,r,a)},F.fromColor=function(e,r){return t.Check.typeOf.object("color",e),n.defined(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new F(e.red,e.green,e.blue,e.alpha)},F.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new F(e.x,e.y,e.z,e.w)},F.packedLength=4,F.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a++]=e.y,r[a++]=e.z,r[a]=e.w,r},F.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new F),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},F.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)F.pack(e[t],r,4*t);return r},F.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new t.DeveloperError("array length must be a multiple of 4.");const a=e.length;n.defined(r)?r.length=a/4:r=new Array(a/4);for(let t=0;t<a;t+=4){const n=t/4;r[n]=F.unpack(e,t,r[n])}return r},F.fromArray=F.unpack,F.maximumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},F.minimumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},F.minimumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.z=Math.min(e.z,n.z),r.w=Math.min(e.w,n.w),r},F.maximumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r.z=Math.max(e.z,n.z),r.w=Math.max(e.w,n.w),r},F.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);const o=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y),u=r.CesiumMath.clamp(e.z,n.z,a.z),s=r.CesiumMath.clamp(e.w,n.w,a.w);return c.x=o,c.y=i,c.z=u,c.w=s,c},F.magnitudeSquared=function(e){return t.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},F.magnitude=function(e){return Math.sqrt(F.magnitudeSquared(e))};const G=new F;F.distance=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),F.subtract(e,n,G),F.magnitude(G)},F.distanceSquared=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),F.subtract(e,n,G),F.magnitudeSquared(G)},F.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=F.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,n.z=e.z/r,n.w=e.w/r,isNaN(n.x)||isNaN(n.y)||isNaN(n.z)||isNaN(n.w))throw new t.DeveloperError("normalized result is not a number");return n},F.dot=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y+e.z*n.z+e.w*n.w},F.multiplyComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r.z=e.z*n.z,r.w=e.w*n.w,r},F.divideComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r.z=e.z/n.z,r.w=e.w/n.w,r},F.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r.z=e.z+n.z,r.w=e.w+n.w,r},F.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r.z=e.z-n.z,r.w=e.w-n.w,r},F.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r.z=e.z*n,r.w=e.w*n,r},F.divideByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r.z=e.z/n,r.w=e.w/n,r},F.negate=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n.z=-e.z,n.w=-e.w,n},F.abs=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n.z=Math.abs(e.z),n.w=Math.abs(e.w),n};const H=new F;F.lerp=function(e,n,r,a){return t.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",a),F.multiplyByScalar(n,r,H),a=F.multiplyByScalar(e,1-r,a),F.add(H,a,a)};const Q=new F;F.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=F.normalize(e,Q);return F.abs(r,r),n=r.x<=r.y?r.x<=r.z?r.x<=r.w?F.clone(F.UNIT_X,n):F.clone(F.UNIT_W,n):r.z<=r.w?F.clone(F.UNIT_Z,n):F.clone(F.UNIT_W,n):r.y<=r.z?r.y<=r.w?F.clone(F.UNIT_Y,n):F.clone(F.UNIT_W,n):r.z<=r.w?F.clone(F.UNIT_Z,n):F.clone(F.UNIT_W,n),n},F.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},F.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]},F.equalsEpsilon=function(e,t,a,c){return e===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)&&r.CesiumMath.equalsEpsilon(e.z,t.z,a,c)&&r.CesiumMath.equalsEpsilon(e.w,t.w,a,c)},F.ZERO=Object.freeze(new F(0,0,0,0)),F.ONE=Object.freeze(new F(1,1,1,1)),F.UNIT_X=Object.freeze(new F(1,0,0,0)),F.UNIT_Y=Object.freeze(new F(0,1,0,0)),F.UNIT_Z=Object.freeze(new F(0,0,1,0)),F.UNIT_W=Object.freeze(new F(0,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}, ${this.w})`};const J=new Float32Array(1),K=new Uint8Array(J.buffer),ee=new Uint32Array([287454020]),te=68===new Uint8Array(ee.buffer)[0];function ne(e,t,r,a,c,o,i,u,s,f,h,l,y,p,d,m){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(c,0),this[2]=n.defaultValue(s,0),this[3]=n.defaultValue(y,0),this[4]=n.defaultValue(t,0),this[5]=n.defaultValue(o,0),this[6]=n.defaultValue(f,0),this[7]=n.defaultValue(p,0),this[8]=n.defaultValue(r,0),this[9]=n.defaultValue(i,0),this[10]=n.defaultValue(h,0),this[11]=n.defaultValue(d,0),this[12]=n.defaultValue(a,0),this[13]=n.defaultValue(u,0),this[14]=n.defaultValue(l,0),this[15]=n.defaultValue(m,0)}F.packFloat=function(e,r){return t.Check.typeOf.number("value",e),n.defined(r)||(r=new F),J[0]=e,te?(r.x=K[0],r.y=K[1],r.z=K[2],r.w=K[3]):(r.x=K[3],r.y=K[2],r.z=K[1],r.w=K[0]),r},F.unpackFloat=function(e){return t.Check.typeOf.object("packedFloat",e),te?(K[0]=e.x,K[1]=e.y,K[2]=e.z,K[3]=e.w):(K[0]=e.w,K[1]=e.z,K[2]=e.y,K[3]=e.x),J[0]},ne.packedLength=16,ne.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r[a++]=e[4],r[a++]=e[5],r[a++]=e[6],r[a++]=e[7],r[a++]=e[8],r[a++]=e[9],r[a++]=e[10],r[a++]=e[11],r[a++]=e[12],r[a++]=e[13],r[a++]=e[14],r[a]=e[15],r},ne.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new ne),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a[4]=e[r++],a[5]=e[r++],a[6]=e[r++],a[7]=e[r++],a[8]=e[r++],a[9]=e[r++],a[10]=e[r++],a[11]=e[r++],a[12]=e[r++],a[13]=e[r++],a[14]=e[r++],a[15]=e[r],a},ne.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=16*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 16 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)ne.pack(e[t],r,16*t);return r},ne.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new t.DeveloperError("array length must be a multiple of 16.");const a=e.length;n.defined(r)?r.length=a/16:r=new Array(a/16);for(let t=0;t<a;t+=16){const n=t/16;r[n]=ne.unpack(e,t,r[n])}return r},ne.clone=function(e,t){if(n.defined(e))return n.defined(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 ne(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])},ne.fromArray=ne.unpack,ne.fromColumnMajorArray=function(e,n){return t.Check.defined("values",e),ne.clone(e,n)},ne.fromRowMajorArray=function(e,r){return t.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15],r):new ne(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])},ne.fromRotationTranslation=function(e,r,c){return t.Check.typeOf.object("rotation",e),r=n.defaultValue(r,a.ZERO),n.defined(c)?(c[0]=e[0],c[1]=e[1],c[2]=e[2],c[3]=0,c[4]=e[3],c[5]=e[4],c[6]=e[5],c[7]=0,c[8]=e[6],c[9]=e[7],c[10]=e[8],c[11]=0,c[12]=r.x,c[13]=r.y,c[14]=r.z,c[15]=1,c):new ne(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},ne.fromTranslationQuaternionRotationScale=function(e,r,a,c){t.Check.typeOf.object("translation",e),t.Check.typeOf.object("rotation",r),t.Check.typeOf.object("scale",a),n.defined(c)||(c=new ne);const o=a.x,i=a.y,u=a.z,s=r.x*r.x,f=r.x*r.y,h=r.x*r.z,l=r.x*r.w,y=r.y*r.y,p=r.y*r.z,d=r.y*r.w,m=r.z*r.z,O=r.z*r.w,C=r.w*r.w,b=s-y-m+C,k=2*(f-O),x=2*(h+d),g=2*(f+O),j=-s+y-m+C,w=2*(p-l),M=2*(h-d),z=2*(p+l),E=-s-y+m+C;return c[0]=b*o,c[1]=g*o,c[2]=M*o,c[3]=0,c[4]=k*i,c[5]=j*i,c[6]=z*i,c[7]=0,c[8]=x*u,c[9]=w*u,c[10]=E*u,c[11]=0,c[12]=e.x,c[13]=e.y,c[14]=e.z,c[15]=1,c},ne.fromTranslationRotationScale=function(e,n){return t.Check.typeOf.object("translationRotationScale",e),ne.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,n)},ne.fromTranslation=function(e,n){return t.Check.typeOf.object("translation",e),ne.fromRotationTranslation(V.IDENTITY,e,n)},ne.fromScale=function(e,r){return t.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e.y,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e.z,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):new ne(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},ne.fromUniformScale=function(e,r){return t.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):new ne(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},ne.fromRotation=function(e,r){return t.Check.typeOf.object("rotation",e),n.defined(r)||(r=new ne),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r};const re=new a,ae=new a,ce=new a;ne.fromCamera=function(e,r){t.Check.typeOf.object("camera",e);const c=e.position,o=e.direction,i=e.up;t.Check.typeOf.object("camera.position",c),t.Check.typeOf.object("camera.direction",o),t.Check.typeOf.object("camera.up",i),a.normalize(o,re),a.normalize(a.cross(re,i,ae),ae),a.normalize(a.cross(ae,re,ce),ce);const u=ae.x,s=ae.y,f=ae.z,h=re.x,l=re.y,y=re.z,p=ce.x,d=ce.y,m=ce.z,O=c.x,C=c.y,b=c.z,k=u*-O+s*-C+f*-b,x=p*-O+d*-C+m*-b,g=h*O+l*C+y*b;return n.defined(r)?(r[0]=u,r[1]=p,r[2]=-h,r[3]=0,r[4]=s,r[5]=d,r[6]=-l,r[7]=0,r[8]=f,r[9]=m,r[10]=-y,r[11]=0,r[12]=k,r[13]=x,r[14]=g,r[15]=1,r):new ne(u,s,f,k,p,d,m,x,-h,-l,-y,g,0,0,0,1)},ne.computePerspectiveFieldOfView=function(e,n,r,a,c){t.Check.typeOf.number.greaterThan("fovY",e,0),t.Check.typeOf.number.lessThan("fovY",e,Math.PI),t.Check.typeOf.number.greaterThan("near",r,0),t.Check.typeOf.number.greaterThan("far",a,0),t.Check.typeOf.object("result",c);const o=Math.tan(.5*e),i=1/o,u=i/n,s=(a+r)/(r-a),f=2*a*r/(r-a);return c[0]=u,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=i,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=s,c[11]=-1,c[12]=0,c[13]=0,c[14]=f,c[15]=0,c},ne.computeOrthographicOffCenter=function(e,n,r,a,c,o,i){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.number("far",o),t.Check.typeOf.object("result",i);let u=1/(n-e),s=1/(a-r),f=1/(o-c);const h=-(n+e)*u,l=-(a+r)*s,y=-(o+c)*f;return u*=2,s*=2,f*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=f,i[11]=0,i[12]=h,i[13]=l,i[14]=y,i[15]=1,i},ne.computePerspectiveOffCenter=function(e,n,r,a,c,o,i){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.number("far",o),t.Check.typeOf.object("result",i);const u=2*c/(n-e),s=2*c/(a-r),f=(n+e)/(n-e),h=(a+r)/(a-r),l=-(o+c)/(o-c),y=-1,p=-2*o*c/(o-c);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=f,i[9]=h,i[10]=l,i[11]=y,i[12]=0,i[13]=0,i[14]=p,i[15]=0,i},ne.computeInfinitePerspectiveOffCenter=function(e,n,r,a,c,o){t.Check.typeOf.number("left",e),t.Check.typeOf.number("right",n),t.Check.typeOf.number("bottom",r),t.Check.typeOf.number("top",a),t.Check.typeOf.number("near",c),t.Check.typeOf.object("result",o);const i=2*c/(n-e),u=2*c/(a-r),s=(n+e)/(n-e),f=(a+r)/(a-r),h=-1,l=-1,y=-2*c;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=f,o[10]=h,o[11]=l,o[12]=0,o[13]=0,o[14]=y,o[15]=0,o},ne.computeViewportTransformation=function(e,t,r,a){n.defined(a)||(a=new ne),e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);const c=n.defaultValue(e.x,0),o=n.defaultValue(e.y,0),i=n.defaultValue(e.width,0),u=n.defaultValue(e.height,0);t=n.defaultValue(t,0),r=n.defaultValue(r,1);const s=.5*i,f=.5*u,h=.5*(r-t),l=s,y=f,p=h,d=c+s,m=o+f,O=t+h,C=1;return a[0]=l,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=y,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=d,a[13]=m,a[14]=O,a[15]=C,a},ne.computeView=function(e,n,r,c,o){return t.Check.typeOf.object("position",e),t.Check.typeOf.object("direction",n),t.Check.typeOf.object("up",r),t.Check.typeOf.object("right",c),t.Check.typeOf.object("result",o),o[0]=c.x,o[1]=r.x,o[2]=-n.x,o[3]=0,o[4]=c.y,o[5]=r.y,o[6]=-n.y,o[7]=0,o[8]=c.z,o[9]=r.z,o[10]=-n.z,o[11]=0,o[12]=-a.dot(c,e),o[13]=-a.dot(r,e),o[14]=a.dot(n,e),o[15]=1,o},ne.toArray=function(e,r){return t.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r):[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]]},ne.getElementIndex=function(e,n){return t.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,3),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,3),4*e+n},ne.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("result",r);const a=4*n,c=e[a],o=e[a+1],i=e[a+2],u=e[a+3];return r.x=c,r.y=o,r.z=i,r.w=u,r},ne.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=ne.clone(e,a);const c=4*n;return a[c]=r.x,a[c+1]=r.y,a[c+2]=r.z,a[c+3]=r.w,a},ne.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("result",r);const a=e[n],c=e[n+4],o=e[n+8],i=e[n+12];return r.x=a,r.y=c,r.z=o,r.w=i,r},ne.setRow=function(e,n,r,a){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,3),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=ne.clone(e,a),a[n]=r.x,a[n+4]=r.y,a[n+8]=r.z,a[n+12]=r.w,a},ne.setTranslation=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("translation",n),t.Check.typeOf.object("result",r),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=n.x,r[13]=n.y,r[14]=n.z,r[15]=e[15],r};const oe=new a;ne.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=ne.getScale(e,oe),c=n.x/a.x,o=n.y/a.y,i=n.z/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3],r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7],r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};const ie=new a;ne.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);const a=ne.getScale(e,ie),c=n/a.x,o=n/a.y,i=n/a.z;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*c,r[3]=e[3],r[4]=e[4]*o,r[5]=e[5]*o,r[6]=e[6]*o,r[7]=e[7],r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};const ue=new a;ne.getScale=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=a.magnitude(a.fromElements(e[0],e[1],e[2],ue)),n.y=a.magnitude(a.fromElements(e[4],e[5],e[6],ue)),n.z=a.magnitude(a.fromElements(e[8],e[9],e[10],ue)),n};const se=new a;ne.getMaximumScale=function(e){return ne.getScale(e,se),a.maximumComponent(se)};const fe=new a;ne.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);const a=ne.getScale(e,fe);return r[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.x,r[3]=e[3],r[4]=n[3]*a.y,r[5]=n[4]*a.y,r[6]=n[5]*a.y,r[7]=e[7],r[8]=n[6]*a.z,r[9]=n[7]*a.z,r[10]=n[8]*a.z,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};const he=new a;ne.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=ne.getScale(e,he);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.x,n[3]=e[4]/r.y,n[4]=e[5]/r.y,n[5]=e[6]/r.y,n[6]=e[8]/r.z,n[7]=e[9]/r.z,n[8]=e[10]/r.z,n},ne.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0],c=e[1],o=e[2],i=e[3],u=e[4],s=e[5],f=e[6],h=e[7],l=e[8],y=e[9],p=e[10],d=e[11],m=e[12],O=e[13],C=e[14],b=e[15],k=n[0],x=n[1],g=n[2],j=n[3],w=n[4],M=n[5],z=n[6],E=n[7],q=n[8],T=n[9],S=n[10],R=n[11],_=n[12],V=n[13],v=n[14],A=n[15],N=a*k+u*x+l*g+m*j,I=c*k+s*x+y*g+O*j,U=o*k+f*x+p*g+C*j,P=i*k+h*x+d*g+b*j,L=a*w+u*M+l*z+m*E,W=c*w+s*M+y*z+O*E,B=o*w+f*M+p*z+C*E,D=i*w+h*M+d*z+b*E,$=a*q+u*T+l*S+m*R,X=c*q+s*T+y*S+O*R,Z=o*q+f*T+p*S+C*R,Y=i*q+h*T+d*S+b*R,F=a*_+u*V+l*v+m*A,G=c*_+s*V+y*v+O*A,H=o*_+f*V+p*v+C*A,Q=i*_+h*V+d*v+b*A;return r[0]=N,r[1]=I,r[2]=U,r[3]=P,r[4]=L,r[5]=W,r[6]=B,r[7]=D,r[8]=$,r[9]=X,r[10]=Z,r[11]=Y,r[12]=F,r[13]=G,r[14]=H,r[15]=Q,r},ne.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r[4]=e[4]+n[4],r[5]=e[5]+n[5],r[6]=e[6]+n[6],r[7]=e[7]+n[7],r[8]=e[8]+n[8],r[9]=e[9]+n[9],r[10]=e[10]+n[10],r[11]=e[11]+n[11],r[12]=e[12]+n[12],r[13]=e[13]+n[13],r[14]=e[14]+n[14],r[15]=e[15]+n[15],r},ne.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r[4]=e[4]-n[4],r[5]=e[5]-n[5],r[6]=e[6]-n[6],r[7]=e[7]-n[7],r[8]=e[8]-n[8],r[9]=e[9]-n[9],r[10]=e[10]-n[10],r[11]=e[11]-n[11],r[12]=e[12]-n[12],r[13]=e[13]-n[13],r[14]=e[14]-n[14],r[15]=e[15]-n[15],r},ne.multiplyTransformation=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0],c=e[1],o=e[2],i=e[4],u=e[5],s=e[6],f=e[8],h=e[9],l=e[10],y=e[12],p=e[13],d=e[14],m=n[0],O=n[1],C=n[2],b=n[4],k=n[5],x=n[6],g=n[8],j=n[9],w=n[10],M=n[12],z=n[13],E=n[14],q=a*m+i*O+f*C,T=c*m+u*O+h*C,S=o*m+s*O+l*C,R=a*b+i*k+f*x,_=c*b+u*k+h*x,V=o*b+s*k+l*x,v=a*g+i*j+f*w,A=c*g+u*j+h*w,N=o*g+s*j+l*w,I=a*M+i*z+f*E+y,U=c*M+u*z+h*E+p,P=o*M+s*z+l*E+d;return r[0]=q,r[1]=T,r[2]=S,r[3]=0,r[4]=R,r[5]=_,r[6]=V,r[7]=0,r[8]=v,r[9]=A,r[10]=N,r[11]=0,r[12]=I,r[13]=U,r[14]=P,r[15]=1,r},ne.multiplyByMatrix3=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("rotation",n),t.Check.typeOf.object("result",r);const a=e[0],c=e[1],o=e[2],i=e[4],u=e[5],s=e[6],f=e[8],h=e[9],l=e[10],y=n[0],p=n[1],d=n[2],m=n[3],O=n[4],C=n[5],b=n[6],k=n[7],x=n[8],g=a*y+i*p+f*d,j=c*y+u*p+h*d,w=o*y+s*p+l*d,M=a*m+i*O+f*C,z=c*m+u*O+h*C,E=o*m+s*O+l*C,q=a*b+i*k+f*x,T=c*b+u*k+h*x,S=o*b+s*k+l*x;return r[0]=g,r[1]=j,r[2]=w,r[3]=0,r[4]=M,r[5]=z,r[6]=E,r[7]=0,r[8]=q,r[9]=T,r[10]=S,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},ne.multiplyByTranslation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("translation",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=a*e[0]+c*e[4]+o*e[8]+e[12],u=a*e[1]+c*e[5]+o*e[9]+e[13],s=a*e[2]+c*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=i,r[13]=u,r[14]=s,r[15]=e[15],r},ne.multiplyByScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z;return 1===a&&1===c&&1===o?ne.clone(e,r):(r[0]=a*e[0],r[1]=a*e[1],r[2]=a*e[2],r[3]=e[3],r[4]=c*e[4],r[5]=c*e[5],r[6]=c*e[6],r[7]=e[7],r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r)},ne.multiplyByUniformScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3],r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7],r[8]=e[8]*n,r[9]=e[9]*n,r[10]=e[10]*n,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},ne.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=n.w,u=e[0]*a+e[4]*c+e[8]*o+e[12]*i,s=e[1]*a+e[5]*c+e[9]*o+e[13]*i,f=e[2]*a+e[6]*c+e[10]*o+e[14]*i,h=e[3]*a+e[7]*c+e[11]*o+e[15]*i;return r.x=u,r.y=s,r.z=f,r.w=h,r},ne.multiplyByPointAsVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=e[0]*a+e[4]*c+e[8]*o,u=e[1]*a+e[5]*c+e[9]*o,s=e[2]*a+e[6]*c+e[10]*o;return r.x=i,r.y=u,r.z=s,r},ne.multiplyByPoint=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=n.x,c=n.y,o=n.z,i=e[0]*a+e[4]*c+e[8]*o+e[12],u=e[1]*a+e[5]*c+e[9]*o+e[13],s=e[2]*a+e[6]*c+e[10]*o+e[14];return r.x=i,r.y=u,r.z=s,r},ne.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*n,r[9]=e[9]*n,r[10]=e[10]*n,r[11]=e[11]*n,r[12]=e[12]*n,r[13]=e[13]*n,r[14]=e[14]*n,r[15]=e[15]*n,r},ne.negate=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.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]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=-e[15],n},ne.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[1],a=e[2],c=e[3],o=e[6],i=e[7],u=e[11];return n[0]=e[0],n[1]=e[4],n[2]=e[8],n[3]=e[12],n[4]=r,n[5]=e[5],n[6]=e[9],n[7]=e[13],n[8]=a,n[9]=o,n[10]=e[10],n[11]=e[14],n[12]=c,n[13]=i,n[14]=u,n[15]=e[15],n},ne.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n[4]=Math.abs(e[4]),n[5]=Math.abs(e[5]),n[6]=Math.abs(e[6]),n[7]=Math.abs(e[7]),n[8]=Math.abs(e[8]),n[9]=Math.abs(e[9]),n[10]=Math.abs(e[10]),n[11]=Math.abs(e[11]),n[12]=Math.abs(e[12]),n[13]=Math.abs(e[13]),n[14]=Math.abs(e[14]),n[15]=Math.abs(e[15]),n},ne.equals=function(e,t){return e===t||n.defined(e)&&n.defined(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]},ne.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},ne.getTranslation=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=e[12],n.y=e[13],n.z=e[14],n},ne.getMatrix3=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],n};const le=new V,ye=new V,pe=new F,de=new F(0,0,0,1);ne.inverse=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const a=e[0],c=e[4],o=e[8],i=e[12],u=e[1],s=e[5],f=e[9],h=e[13],l=e[2],y=e[6],p=e[10],d=e[14],m=e[3],O=e[7],C=e[11],b=e[15];let k=p*b,x=d*C,g=y*b,j=d*O,w=y*C,M=p*O,z=l*b,E=d*m,q=l*C,T=p*m,S=l*O,R=y*m;const _=k*s+j*f+w*h-(x*s+g*f+M*h),v=x*u+z*f+T*h-(k*u+E*f+q*h),A=g*u+E*s+S*h-(j*u+z*s+R*h),N=M*u+q*s+R*f-(w*u+T*s+S*f),I=x*c+g*o+M*i-(k*c+j*o+w*i),U=k*a+E*o+q*i-(x*a+z*o+T*i),P=j*a+z*c+R*i-(g*a+E*c+S*i),L=w*a+T*c+S*o-(M*a+q*c+R*o);k=o*h,x=i*f,g=c*h,j=i*s,w=c*f,M=o*s,z=a*h,E=i*u,q=a*f,T=o*u,S=a*s,R=c*u;const W=k*O+j*C+w*b-(x*O+g*C+M*b),B=x*m+z*C+T*b-(k*m+E*C+q*b),D=g*m+E*O+S*b-(j*m+z*O+R*b),$=M*m+q*O+R*C-(w*m+T*O+S*C),X=g*p+M*d+x*y-(w*d+k*y+j*p),Z=q*d+k*l+E*p-(z*p+T*d+x*l),Y=z*y+R*d+j*l-(S*d+g*l+E*y),G=S*p+w*l+T*y-(q*y+R*p+M*l);let H=a*_+c*v+o*A+i*N;if(Math.abs(H)<r.CesiumMath.EPSILON21){if(V.equalsEpsilon(ne.getMatrix3(e,le),ye,r.CesiumMath.EPSILON7)&&F.equals(ne.getRow(e,3,pe),de))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;throw new t.RuntimeError("matrix is not invertible because its determinate is zero.")}return H=1/H,n[0]=_*H,n[1]=v*H,n[2]=A*H,n[3]=N*H,n[4]=I*H,n[5]=U*H,n[6]=P*H,n[7]=L*H,n[8]=W*H,n[9]=B*H,n[10]=D*H,n[11]=$*H,n[12]=X*H,n[13]=Z*H,n[14]=Y*H,n[15]=G*H,n},ne.inverseTransformation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[0],a=e[1],c=e[2],o=e[4],i=e[5],u=e[6],s=e[8],f=e[9],h=e[10],l=e[12],y=e[13],p=e[14],d=-r*l-a*y-c*p,m=-o*l-i*y-u*p,O=-s*l-f*y-h*p;return n[0]=r,n[1]=o,n[2]=s,n[3]=0,n[4]=a,n[5]=i,n[6]=f,n[7]=0,n[8]=c,n[9]=u,n[10]=h,n[11]=0,n[12]=d,n[13]=m,n[14]=O,n[15]=1,n};const me=new ne;function Oe(e,t,r,a){this.west=n.defaultValue(e,0),this.south=n.defaultValue(t,0),this.east=n.defaultValue(r,0),this.north=n.defaultValue(a,0)}ne.inverseTranspose=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),ne.inverse(ne.transpose(e,me),n)},ne.IDENTITY=Object.freeze(new ne(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),ne.ZERO=Object.freeze(new ne(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),ne.COLUMN0ROW0=0,ne.COLUMN0ROW1=1,ne.COLUMN0ROW2=2,ne.COLUMN0ROW3=3,ne.COLUMN1ROW0=4,ne.COLUMN1ROW1=5,ne.COLUMN1ROW2=6,ne.COLUMN1ROW3=7,ne.COLUMN2ROW0=8,ne.COLUMN2ROW1=9,ne.COLUMN2ROW2=10,ne.COLUMN2ROW3=11,ne.COLUMN3ROW0=12,ne.COLUMN3ROW1=13,ne.COLUMN3ROW2=14,ne.COLUMN3ROW3=15,Object.defineProperties(ne.prototype,{length:{get:function(){return ne.packedLength}}}),ne.prototype.clone=function(e){return ne.clone(this,e)},ne.prototype.equals=function(e){return ne.equals(this,e)},ne.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]},ne.prototype.equalsEpsilon=function(e,t){return ne.equalsEpsilon(this,e,t)},ne.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`},Object.defineProperties(Oe.prototype,{width:{get:function(){return Oe.computeWidth(this)}},height:{get:function(){return Oe.computeHeight(this)}}}),Oe.packedLength=4,Oe.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.west,r[a++]=e.south,r[a++]=e.east,r[a]=e.north,r},Oe.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new Oe),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},Oe.computeWidth=function(e){t.Check.typeOf.object("rectangle",e);let n=e.east;const a=e.west;return n<a&&(n+=r.CesiumMath.TWO_PI),n-a},Oe.computeHeight=function(e){return t.Check.typeOf.object("rectangle",e),e.north-e.south},Oe.fromDegrees=function(e,t,a,c,o){return e=r.CesiumMath.toRadians(n.defaultValue(e,0)),t=r.CesiumMath.toRadians(n.defaultValue(t,0)),a=r.CesiumMath.toRadians(n.defaultValue(a,0)),c=r.CesiumMath.toRadians(n.defaultValue(c,0)),n.defined(o)?(o.west=e,o.south=t,o.east=a,o.north=c,o):new Oe(e,t,a,c)},Oe.fromRadians=function(e,t,r,a,c){return n.defined(c)?(c.west=n.defaultValue(e,0),c.south=n.defaultValue(t,0),c.east=n.defaultValue(r,0),c.north=n.defaultValue(a,0),c):new Oe(e,t,r,a)},Oe.fromCartographicArray=function(e,a){t.Check.defined("cartographics",e);let c=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,u=-Number.MAX_VALUE,s=Number.MAX_VALUE,f=-Number.MAX_VALUE;for(let t=0,n=e.length;t<n;t++){const n=e[t];c=Math.min(c,n.longitude),o=Math.max(o,n.longitude),s=Math.min(s,n.latitude),f=Math.max(f,n.latitude);const a=n.longitude>=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;i=Math.min(i,a),u=Math.max(u,a)}return o-c>u-i&&(c=i,o=u,o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI),c>r.CesiumMath.PI&&(c-=r.CesiumMath.TWO_PI)),n.defined(a)?(a.west=c,a.south=s,a.east=o,a.north=f,a):new Oe(c,s,o,f)},Oe.fromCartesianArray=function(e,a,c){t.Check.defined("cartesians",e),a=n.defaultValue(a,w.WGS84);let o=Number.MAX_VALUE,i=-Number.MAX_VALUE,u=Number.MAX_VALUE,s=-Number.MAX_VALUE,f=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(let t=0,n=e.length;t<n;t++){const n=a.cartesianToCartographic(e[t]);o=Math.min(o,n.longitude),i=Math.max(i,n.longitude),f=Math.min(f,n.latitude),h=Math.max(h,n.latitude);const c=n.longitude>=0?n.longitude:n.longitude+r.CesiumMath.TWO_PI;u=Math.min(u,c),s=Math.max(s,c)}return i-o>s-u&&(o=u,i=s,i>r.CesiumMath.PI&&(i-=r.CesiumMath.TWO_PI),o>r.CesiumMath.PI&&(o-=r.CesiumMath.TWO_PI)),n.defined(c)?(c.west=o,c.south=f,c.east=i,c.north=h,c):new Oe(o,f,i,h)},Oe.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Oe(e.west,e.south,e.east,e.north)},Oe.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.west-t.west)<=r&&Math.abs(e.south-t.south)<=r&&Math.abs(e.east-t.east)<=r&&Math.abs(e.north-t.north)<=r},Oe.prototype.clone=function(e){return Oe.clone(this,e)},Oe.prototype.equals=function(e){return Oe.equals(this,e)},Oe.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Oe.prototype.equalsEpsilon=function(e,t){return Oe.equalsEpsilon(this,e,t)},Oe.validate=function(e){t.Check.typeOf.object("rectangle",e);const n=e.north;t.Check.typeOf.number.greaterThanOrEquals("north",n,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("north",n,r.CesiumMath.PI_OVER_TWO);const a=e.south;t.Check.typeOf.number.greaterThanOrEquals("south",a,-r.CesiumMath.PI_OVER_TWO),t.Check.typeOf.number.lessThanOrEquals("south",a,r.CesiumMath.PI_OVER_TWO);const c=e.west;t.Check.typeOf.number.greaterThanOrEquals("west",c,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("west",c,Math.PI);const o=e.east;t.Check.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),t.Check.typeOf.number.lessThanOrEquals("east",o,Math.PI)},Oe.southwest=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new m(e.west,e.south)},Oe.northwest=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new m(e.west,e.north)},Oe.northeast=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new m(e.east,e.north)},Oe.southeast=function(e,r){return t.Check.typeOf.object("rectangle",e),n.defined(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new m(e.east,e.south)},Oe.center=function(e,a){t.Check.typeOf.object("rectangle",e);let c=e.east;const o=e.west;c<o&&(c+=r.CesiumMath.TWO_PI);const i=r.CesiumMath.negativePiToPi(.5*(o+c)),u=.5*(e.south+e.north);return n.defined(a)?(a.longitude=i,a.latitude=u,a.height=0,a):new m(i,u)},Oe.intersection=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a);let o=e.east,i=e.west,u=a.east,s=a.west;o<i&&u>0?o+=r.CesiumMath.TWO_PI:u<s&&o>0&&(u+=r.CesiumMath.TWO_PI),o<i&&s<0?s+=r.CesiumMath.TWO_PI:u<s&&i<0&&(i+=r.CesiumMath.TWO_PI);const f=r.CesiumMath.negativePiToPi(Math.max(i,s)),h=r.CesiumMath.negativePiToPi(Math.min(o,u));if((e.west<e.east||a.west<a.east)&&h<=f)return;const l=Math.max(e.south,a.south),y=Math.min(e.north,a.north);return l>=y?void 0:n.defined(c)?(c.west=f,c.south=l,c.east=h,c.north=y,c):new Oe(f,l,h,y)},Oe.simpleIntersection=function(e,r,a){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",r);const c=Math.max(e.west,r.west),o=Math.max(e.south,r.south),i=Math.min(e.east,r.east),u=Math.min(e.north,r.north);if(!(o>=u||c>=i))return n.defined(a)?(a.west=c,a.south=o,a.east=i,a.north=u,a):new Oe(c,o,i,u)},Oe.union=function(e,a,c){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("otherRectangle",a),n.defined(c)||(c=new Oe);let o=e.east,i=e.west,u=a.east,s=a.west;o<i&&u>0?o+=r.CesiumMath.TWO_PI:u<s&&o>0&&(u+=r.CesiumMath.TWO_PI),o<i&&s<0?s+=r.CesiumMath.TWO_PI:u<s&&i<0&&(i+=r.CesiumMath.TWO_PI);const f=r.CesiumMath.negativePiToPi(Math.min(i,s)),h=r.CesiumMath.negativePiToPi(Math.max(o,u));return c.west=f,c.south=Math.min(e.south,a.south),c.east=h,c.north=Math.max(e.north,a.north),c},Oe.expand=function(e,r,a){return t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("cartographic",r),n.defined(a)||(a=new Oe),a.west=Math.min(e.west,r.longitude),a.south=Math.min(e.south,r.latitude),a.east=Math.max(e.east,r.longitude),a.north=Math.max(e.north,r.latitude),a},Oe.contains=function(e,n){t.Check.typeOf.object("rectangle",e),t.Check.typeOf.object("cartographic",n);let a=n.longitude;const c=n.latitude,o=e.west;let i=e.east;return i<o&&(i+=r.CesiumMath.TWO_PI,a<0&&(a+=r.CesiumMath.TWO_PI)),(a>o||r.CesiumMath.equalsEpsilon(a,o,r.CesiumMath.EPSILON14))&&(a<i||r.CesiumMath.equalsEpsilon(a,i,r.CesiumMath.EPSILON14))&&c>=e.south&&c<=e.north};const Ce=new m;function be(e,t){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0)}Oe.subsample=function(e,a,c,o){t.Check.typeOf.object("rectangle",e),a=n.defaultValue(a,w.WGS84),c=n.defaultValue(c,0),n.defined(o)||(o=[]);let i=0;const u=e.north,s=e.south,f=e.east,h=e.west,l=Ce;l.height=c,l.longitude=h,l.latitude=u,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=s,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.latitude=u<0?u:s>0?s:0;for(let t=1;t<8;++t)l.longitude=-Math.PI+t*r.CesiumMath.PI_OVER_TWO,Oe.contains(e,l)&&(o[i]=a.cartographicToCartesian(l,o[i]),i++);return 0===l.latitude&&(l.longitude=h,o[i]=a.cartographicToCartesian(l,o[i]),i++,l.longitude=f,o[i]=a.cartographicToCartesian(l,o[i]),i++),o.length=i,o},Oe.subsection=function(e,a,c,o,i,u){if(t.Check.typeOf.object("rectangle",e),t.Check.typeOf.number.greaterThanOrEquals("westLerp",a,0),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,1),t.Check.typeOf.number.greaterThanOrEquals("southLerp",c,0),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,1),t.Check.typeOf.number.greaterThanOrEquals("eastLerp",o,0),t.Check.typeOf.number.lessThanOrEquals("eastLerp",o,1),t.Check.typeOf.number.greaterThanOrEquals("northLerp",i,0),t.Check.typeOf.number.lessThanOrEquals("northLerp",i,1),t.Check.typeOf.number.lessThanOrEquals("westLerp",a,o),t.Check.typeOf.number.lessThanOrEquals("southLerp",c,i),n.defined(u)||(u=new Oe),e.west<=e.east){const t=e.east-e.west;u.west=e.west+a*t,u.east=e.west+o*t}else{const t=r.CesiumMath.TWO_PI+e.east-e.west;u.west=r.CesiumMath.negativePiToPi(e.west+a*t),u.east=r.CesiumMath.negativePiToPi(e.west+o*t)}const s=e.north-e.south;return u.south=e.south+c*s,u.north=e.south+i*s,1===a&&(u.west=e.east),1===o&&(u.east=e.east),1===c&&(u.south=e.north),1===i&&(u.north=e.north),u},Oe.MAX_VALUE=Object.freeze(new Oe(-Math.PI,-r.CesiumMath.PI_OVER_TWO,Math.PI,r.CesiumMath.PI_OVER_TWO)),be.fromElements=function(e,t,r){return n.defined(r)?(r.x=e,r.y=t,r):new be(e,t)},be.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.x=e.x,t.y=e.y,t):new be(e.x,e.y)},be.fromCartesian3=be.clone,be.fromCartesian4=be.clone,be.packedLength=2,be.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e.x,r[a]=e.y,r},be.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new be),a.x=e[r++],a.y=e[r],a},be.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=2*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 2 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)be.pack(e[t],r,2*t);return r},be.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new t.DeveloperError("array length must be a multiple of 2.");const a=e.length;n.defined(r)?r.length=a/2:r=new Array(a/2);for(let t=0;t<a;t+=2){const n=t/2;r[n]=be.unpack(e,t,r[n])}return r},be.fromArray=be.unpack,be.maximumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.max(e.x,e.y)},be.minimumComponent=function(e){return t.Check.typeOf.object("cartesian",e),Math.min(e.x,e.y)},be.minimumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r},be.maximumByComponent=function(e,n,r){return t.Check.typeOf.object("first",e),t.Check.typeOf.object("second",n),t.Check.typeOf.object("result",r),r.x=Math.max(e.x,n.x),r.y=Math.max(e.y,n.y),r},be.clamp=function(e,n,a,c){t.Check.typeOf.object("value",e),t.Check.typeOf.object("min",n),t.Check.typeOf.object("max",a),t.Check.typeOf.object("result",c);const o=r.CesiumMath.clamp(e.x,n.x,a.x),i=r.CesiumMath.clamp(e.y,n.y,a.y);return c.x=o,c.y=i,c},be.magnitudeSquared=function(e){return t.Check.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},be.magnitude=function(e){return Math.sqrt(be.magnitudeSquared(e))};const ke=new be;be.distance=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),be.subtract(e,n,ke),be.magnitude(ke)},be.distanceSquared=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),be.subtract(e,n,ke),be.magnitudeSquared(ke)},be.normalize=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=be.magnitude(e);if(n.x=e.x/r,n.y=e.y/r,isNaN(n.x)||isNaN(n.y))throw new t.DeveloperError("normalized result is not a number");return n},be.dot=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.x+e.y*n.y},be.cross=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),e.x*n.y-e.y*n.x},be.multiplyComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x*n.x,r.y=e.y*n.y,r},be.divideComponents=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x/n.x,r.y=e.y/n.y,r},be.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x+n.x,r.y=e.y+n.y,r},be.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r.x=e.x-n.x,r.y=e.y-n.y,r},be.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x*n,r.y=e.y*n,r},be.divideByScalar=function(e,n,r){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r.x=e.x/n,r.y=e.y/n,r},be.negate=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=-e.x,n.y=-e.y,n},be.abs=function(e,n){return t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n),n.x=Math.abs(e.x),n.y=Math.abs(e.y),n};const xe=new be;be.lerp=function(e,n,r,a){return t.Check.typeOf.object("start",e),t.Check.typeOf.object("end",n),t.Check.typeOf.number("t",r),t.Check.typeOf.object("result",a),be.multiplyByScalar(n,r,xe),a=be.multiplyByScalar(e,1-r,a),be.add(xe,a,a)};const ge=new be,je=new be;be.angleBetween=function(e,n){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),be.normalize(e,ge),be.normalize(n,je),r.CesiumMath.acosClamped(be.dot(ge,je))};const we=new be;function Me(e,t,r,a){this[0]=n.defaultValue(e,0),this[1]=n.defaultValue(r,0),this[2]=n.defaultValue(t,0),this[3]=n.defaultValue(a,0)}be.mostOrthogonalAxis=function(e,n){t.Check.typeOf.object("cartesian",e),t.Check.typeOf.object("result",n);const r=be.normalize(e,we);return be.abs(r,r),n=r.x<=r.y?be.clone(be.UNIT_X,n):be.clone(be.UNIT_Y,n),n},be.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y},be.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},be.equalsEpsilon=function(e,t,a,c){return e===t||n.defined(e)&&n.defined(t)&&r.CesiumMath.equalsEpsilon(e.x,t.x,a,c)&&r.CesiumMath.equalsEpsilon(e.y,t.y,a,c)},be.ZERO=Object.freeze(new be(0,0)),be.ONE=Object.freeze(new be(1,1)),be.UNIT_X=Object.freeze(new be(1,0)),be.UNIT_Y=Object.freeze(new be(0,1)),be.prototype.clone=function(e){return be.clone(this,e)},be.prototype.equals=function(e){return be.equals(this,e)},be.prototype.equalsEpsilon=function(e,t,n){return be.equalsEpsilon(this,e,t,n)},be.prototype.toString=function(){return`(${this.x}, ${this.y})`},Me.packedLength=4,Me.pack=function(e,r,a){return t.Check.typeOf.object("value",e),t.Check.defined("array",r),a=n.defaultValue(a,0),r[a++]=e[0],r[a++]=e[1],r[a++]=e[2],r[a++]=e[3],r},Me.unpack=function(e,r,a){return t.Check.defined("array",e),r=n.defaultValue(r,0),n.defined(a)||(a=new Me),a[0]=e[r++],a[1]=e[r++],a[2]=e[r++],a[3]=e[r++],a},Me.packArray=function(e,r){t.Check.defined("array",e);const a=e.length,c=4*a;if(n.defined(r)){if(!Array.isArray(r)&&r.length!==c)throw new t.DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");r.length!==c&&(r.length=c)}else r=new Array(c);for(let t=0;t<a;++t)Me.pack(e[t],r,4*t);return r},Me.unpackArray=function(e,r){if(t.Check.defined("array",e),t.Check.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new t.DeveloperError("array length must be a multiple of 4.");const a=e.length;n.defined(r)?r.length=a/4:r=new Array(a/4);for(let t=0;t<a;t+=4){const n=t/4;r[n]=Me.unpack(e,t,r[n])}return r},Me.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Me(e[0],e[2],e[1],e[3])},Me.fromArray=Me.unpack,Me.fromColumnMajorArray=function(e,n){return t.Check.defined("values",e),Me.clone(e,n)},Me.fromRowMajorArray=function(e,r){return t.Check.defined("values",e),n.defined(r)?(r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3],r):new Me(e[0],e[1],e[2],e[3])},Me.fromScale=function(e,r){return t.Check.typeOf.object("scale",e),n.defined(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=e.y,r):new Me(e.x,0,0,e.y)},Me.fromUniformScale=function(e,r){return t.Check.typeOf.number("scale",e),n.defined(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=e,r):new Me(e,0,0,e)},Me.fromRotation=function(e,r){t.Check.typeOf.number("angle",e);const a=Math.cos(e),c=Math.sin(e);return n.defined(r)?(r[0]=a,r[1]=c,r[2]=-c,r[3]=a,r):new Me(a,-c,c,a)},Me.toArray=function(e,r){return t.Check.typeOf.object("matrix",e),n.defined(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r):[e[0],e[1],e[2],e[3]]},Me.getElementIndex=function(e,n){return t.Check.typeOf.number.greaterThanOrEquals("row",n,0),t.Check.typeOf.number.lessThanOrEquals("row",n,1),t.Check.typeOf.number.greaterThanOrEquals("column",e,0),t.Check.typeOf.number.lessThanOrEquals("column",e,1),2*e+n},Me.getColumn=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("result",r);const a=2*n,c=e[a],o=e[a+1];return r.x=c,r.y=o,r},Me.setColumn=function(e,n,r,a){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=Me.clone(e,a);const c=2*n;return a[c]=r.x,a[c+1]=r.y,a},Me.getRow=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("result",r);const a=e[n],c=e[n+2];return r.x=a,r.y=c,r},Me.setRow=function(e,n,r,a){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number.greaterThanOrEquals("index",n,0),t.Check.typeOf.number.lessThanOrEquals("index",n,1),t.Check.typeOf.object("cartesian",r),t.Check.typeOf.object("result",a),a=Me.clone(e,a),a[n]=r.x,a[n+2]=r.y,a};const ze=new be;Me.setScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r);const a=Me.getScale(e,ze),c=n.x/a.x,o=n.y/a.y;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*o,r[3]=e[3]*o,r};const Ee=new be;Me.setUniformScale=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r);const a=Me.getScale(e,Ee),c=n/a.x,o=n/a.y;return r[0]=e[0]*c,r[1]=e[1]*c,r[2]=e[2]*o,r[3]=e[3]*o,r};const qe=new be;Me.getScale=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n.x=be.magnitude(be.fromElements(e[0],e[1],qe)),n.y=be.magnitude(be.fromElements(e[2],e[3],qe)),n};const Te=new be;Me.getMaximumScale=function(e){return Me.getScale(e,Te),be.maximumComponent(Te)};const Se=new be;Me.setRotation=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",r);const a=Me.getScale(e,Se);return r[0]=n[0]*a.x,r[1]=n[1]*a.x,r[2]=n[2]*a.y,r[3]=n[3]*a.y,r};const Re=new be;Me.getRotation=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=Me.getScale(e,Re);return n[0]=e[0]/r.x,n[1]=e[1]/r.x,n[2]=e[2]/r.y,n[3]=e[3]/r.y,n},Me.multiply=function(e,n,r){t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r);const a=e[0]*n[0]+e[2]*n[1],c=e[0]*n[2]+e[2]*n[3],o=e[1]*n[0]+e[3]*n[1],i=e[1]*n[2]+e[3]*n[3];return r[0]=a,r[1]=o,r[2]=c,r[3]=i,r},Me.add=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]+n[0],r[1]=e[1]+n[1],r[2]=e[2]+n[2],r[3]=e[3]+n[3],r},Me.subtract=function(e,n,r){return t.Check.typeOf.object("left",e),t.Check.typeOf.object("right",n),t.Check.typeOf.object("result",r),r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],r[3]=e[3]-n[3],r},Me.multiplyByVector=function(e,n,r){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("cartesian",n),t.Check.typeOf.object("result",r);const a=e[0]*n.x+e[2]*n.y,c=e[1]*n.x+e[3]*n.y;return r.x=a,r.y=c,r},Me.multiplyByScalar=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scalar",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r},Me.multiplyByScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n.x,r[1]=e[1]*n.x,r[2]=e[2]*n.y,r[3]=e[3]*n.y,r},Me.multiplyByUniformScale=function(e,n,r){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.number("scale",n),t.Check.typeOf.object("result",r),r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r},Me.negate=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=-e[0],n[1]=-e[1],n[2]=-e[2],n[3]=-e[3],n},Me.transpose=function(e,n){t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n);const r=e[0],a=e[2],c=e[1],o=e[3];return n[0]=r,n[1]=a,n[2]=c,n[3]=o,n},Me.abs=function(e,n){return t.Check.typeOf.object("matrix",e),t.Check.typeOf.object("result",n),n[0]=Math.abs(e[0]),n[1]=Math.abs(e[1]),n[2]=Math.abs(e[2]),n[3]=Math.abs(e[3]),n},Me.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Me.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]},Me.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},Me.IDENTITY=Object.freeze(new Me(1,0,0,1)),Me.ZERO=Object.freeze(new Me(0,0,0,0)),Me.COLUMN0ROW0=0,Me.COLUMN0ROW1=1,Me.COLUMN1ROW0=2,Me.COLUMN1ROW1=3,Object.defineProperties(Me.prototype,{length:{get:function(){return Me.packedLength}}}),Me.prototype.clone=function(e){return Me.clone(this,e)},Me.prototype.equals=function(e){return Me.equals(this,e)},Me.prototype.equalsEpsilon=function(e,t){return Me.equalsEpsilon(this,e,t)},Me.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`},e.Cartesian2=be,e.Cartesian3=a,e.Cartesian4=F,e.Cartographic=m,e.Ellipsoid=w,e.Matrix2=Me,e.Matrix3=V,e.Matrix4=ne,e.Rectangle=Oe}));