define(["exports","./GeometryOffsetAttribute-ed56ff58","./Transforms-98ffa11d","./Matrix2-e3fb4559","./Cartesian3-7e9cc2ff","./Check-741c5f3c","./ComponentDatatype-aaeec80f","./defaultValue-81eec7ed","./EllipseGeometryLibrary-77f59e46","./GeometryAttribute-b025f9a8","./GeometryAttributes-32b29525","./GeometryInstance-ce434bcb","./GeometryPipeline-4b426993","./IndexDatatype-f1e3f799","./Math-5f585871","./Matrix4-d34187af","./VertexFormat-d50a69ba"],(function(t,e,i,r,n,o,a,s,l,u,m,c,p,y,d,f,A){"use strict";const x=new n.Cartesian3,h=new n.Cartesian3,g=new n.Cartesian3,_=new n.Cartesian3,b=new r.Cartesian2,C=new f.Matrix3,w=new f.Matrix3,M=new i.Quaternion,E=new n.Cartesian3,I=new n.Cartesian3,T=new n.Cartesian3,G=new r.Cartographic,N=new n.Cartesian3,P=new r.Cartesian2,F=new r.Cartesian2;function v(t,o,c){const p=o.vertexFormat,y=o.center,d=o.semiMajorAxis,A=o.semiMinorAxis,_=o.ellipsoid,v=o.stRotation,V=c?t.length/3*2:t.length/3,D=o.shadowVolume,O=p.st?new Float32Array(2*V):void 0,S=p.normal?new Float32Array(3*V):void 0,L=p.tangent?new Float32Array(3*V):void 0,R=p.bitangent?new Float32Array(3*V):void 0,j=D?new Float32Array(3*V):void 0;let k=0,z=E,B=I,Y=T;const H=new i.GeographicProjection(_),U=H.project(_.cartesianToCartographic(y,G),N),Q=_.scaleToGeodeticSurface(y,x);_.geodeticSurfaceNormal(Q,Q);let W=C,J=w;if(0!==v){let t=i.Quaternion.fromAxisAngle(Q,v,M);W=f.Matrix3.fromQuaternion(t,W),t=i.Quaternion.fromAxisAngle(Q,-v,M),J=f.Matrix3.fromQuaternion(t,J)}else W=f.Matrix3.clone(f.Matrix3.IDENTITY,W),J=f.Matrix3.clone(f.Matrix3.IDENTITY,J);const q=r.Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,P),Z=r.Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,F);let K=t.length;const X=c?K:0,$=X/3*2;for(let e=0;e1;--o){for(e[s++]=i++,e[s++]=i,e[s++]=n,r=2*o,a=0;ad.CesiumMath.PI&&(y.north=y.north>0?d.CesiumMath.PI_OVER_TWO-d.CesiumMath.EPSILON7:y.north,y.south=y.south<0?d.CesiumMath.EPSILON7-d.CesiumMath.PI_OVER_TWO:y.south,y.east=d.CesiumMath.PI,y.west=-d.CesiumMath.PI),y}function j(t){const e=(t=s.defaultValue(t,s.defaultValue.EMPTY_OBJECT)).center,i=s.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o=t.semiMajorAxis,a=t.semiMinorAxis,l=s.defaultValue(t.granularity,d.CesiumMath.RADIANS_PER_DEGREE),u=s.defaultValue(t.vertexFormat,A.VertexFormat.DEFAULT),m=s.defaultValue(t.height,0),c=s.defaultValue(t.extrudedHeight,m);this._center=n.Cartesian3.clone(e),this._semiMajorAxis=o,this._semiMinorAxis=a,this._ellipsoid=r.Ellipsoid.clone(i),this._rotation=s.defaultValue(t.rotation,0),this._stRotation=s.defaultValue(t.stRotation,0),this._height=Math.max(c,m),this._granularity=l,this._vertexFormat=A.VertexFormat.clone(u),this._extrudedHeight=Math.min(c,m),this._shadowVolume=s.defaultValue(t.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=t.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}j.packedLength=n.Cartesian3.packedLength+r.Ellipsoid.packedLength+A.VertexFormat.packedLength+9,j.pack=function(t,e,i){return i=s.defaultValue(i,0),n.Cartesian3.pack(t._center,e,i),i+=n.Cartesian3.packedLength,r.Ellipsoid.pack(t._ellipsoid,e,i),i+=r.Ellipsoid.packedLength,A.VertexFormat.pack(t._vertexFormat,e,i),i+=A.VertexFormat.packedLength,e[i++]=t._semiMajorAxis,e[i++]=t._semiMinorAxis,e[i++]=t._rotation,e[i++]=t._stRotation,e[i++]=t._height,e[i++]=t._granularity,e[i++]=t._extrudedHeight,e[i++]=t._shadowVolume?1:0,e[i]=s.defaultValue(t._offsetAttribute,-1),e};const k=new n.Cartesian3,z=new r.Ellipsoid,B=new A.VertexFormat,Y={center:k,ellipsoid:z,vertexFormat:B,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};j.unpack=function(t,e,i){e=s.defaultValue(e,0);const o=n.Cartesian3.unpack(t,e,k);e+=n.Cartesian3.packedLength;const a=r.Ellipsoid.unpack(t,e,z);e+=r.Ellipsoid.packedLength;const l=A.VertexFormat.unpack(t,e,B);e+=A.VertexFormat.packedLength;const u=t[e++],m=t[e++],c=t[e++],p=t[e++],y=t[e++],d=t[e++],f=t[e++],x=1===t[e++],h=t[e];return s.defined(i)?(i._center=n.Cartesian3.clone(o,i._center),i._ellipsoid=r.Ellipsoid.clone(a,i._ellipsoid),i._vertexFormat=A.VertexFormat.clone(l,i._vertexFormat),i._semiMajorAxis=u,i._semiMinorAxis=m,i._rotation=c,i._stRotation=p,i._height=y,i._granularity=d,i._extrudedHeight=f,i._shadowVolume=x,i._offsetAttribute=-1===h?void 0:h,i):(Y.height=y,Y.extrudedHeight=f,Y.granularity=d,Y.stRotation=p,Y.rotation=c,Y.semiMajorAxis=u,Y.semiMinorAxis=m,Y.shadowVolume=x,Y.offsetAttribute=-1===h?void 0:h,new j(Y))},j.computeRectangle=function(t,e){const i=(t=s.defaultValue(t,s.defaultValue.EMPTY_OBJECT)).center,n=s.defaultValue(t.ellipsoid,r.Ellipsoid.WGS84),o=t.semiMajorAxis,a=t.semiMinorAxis,l=s.defaultValue(t.granularity,d.CesiumMath.RADIANS_PER_DEGREE);return R(i,o,a,s.defaultValue(t.rotation,0),l,n,e)},j.createGeometry=function(t){if(t._semiMajorAxis<=0||t._semiMinorAxis<=0)return;const r=t._height,o=t._extrudedHeight,m=!d.CesiumMath.equalsEpsilon(r,o,0,d.CesiumMath.EPSILON2);t._center=t._ellipsoid.scaleToGeodeticSurface(t._center,t._center);const c={center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:t._ellipsoid,rotation:t._rotation,height:r,granularity:t._granularity,vertexFormat:t._vertexFormat,stRotation:t._stRotation};let p;if(m)c.extrudedHeight=o,c.shadowVolume=t._shadowVolume,c.offsetAttribute=t._offsetAttribute,p=L(c);else if(p=function(t){const e=t.center;D=n.Cartesian3.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(e,D),t.height,D),D=n.Cartesian3.add(e,D,D);const r=new i.BoundingSphere(D,t.semiMajorAxis),o=l.EllipseGeometryLibrary.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,u=v(a,t,!1);let m=V(s);return m=y.IndexDatatype.createTypedArray(a.length/3,m),{boundingSphere:r,attributes:u,indices:m}}(c),s.defined(t._offsetAttribute)){const i=p.attributes.position.values.length,r=new Uint8Array(i/3),n=t._offsetAttribute===e.GeometryOffsetAttribute.NONE?0:1;e.arrayFill(r,n),p.attributes.applyOffset=new u.GeometryAttribute({componentDatatype:a.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:r})}return new u.Geometry({attributes:p.attributes,indices:p.indices,primitiveType:u.PrimitiveType.TRIANGLES,boundingSphere:p.boundingSphere,offsetAttribute:t._offsetAttribute})},j.createShadowVolume=function(t,e,i){const r=t._granularity,n=t._ellipsoid,o=e(r,n),a=i(r,n);return new j({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,ellipsoid:n,rotation:t._rotation,stRotation:t._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:A.VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(j.prototype,{rectangle:{get:function(){return s.defined(this._rectangle)||(this._rectangle=R(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return s.defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=function(t){const e=-t._stRotation;if(0===e)return[0,0,0,1,1,0];const i=l.EllipseGeometryLibrary.computeEllipsePositions({center:t._center,semiMajorAxis:t._semiMajorAxis,semiMinorAxis:t._semiMinorAxis,rotation:t._rotation,granularity:t._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let t=0;t