define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./defaultValue-94c3e563","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785","./VertexFormat-e46f29d6"],(function(t,e,a,n,i,r,o,s,m,u,l){"use strict";const c=new a.Cartesian3,f=new a.Cartesian3,d=new a.Cartesian3,p=new a.Cartesian3,C=new a.Cartesian3,y=new a.Cartesian3(1,1,1),h=Math.cos,_=Math.sin;function x(t){t=i.defaultValue(t,i.defaultValue.EMPTY_OBJECT);const e=i.defaultValue(t.radii,y),o=i.defaultValue(t.innerRadii,e),s=i.defaultValue(t.minimumClock,0),m=i.defaultValue(t.maximumClock,n.CesiumMath.TWO_PI),u=i.defaultValue(t.minimumCone,0),c=i.defaultValue(t.maximumCone,n.CesiumMath.PI),f=Math.round(i.defaultValue(t.stackPartitions,64)),d=Math.round(i.defaultValue(t.slicePartitions,64)),p=i.defaultValue(t.vertexFormat,l.VertexFormat.DEFAULT);if(d<3)throw new r.DeveloperError("options.slicePartitions cannot be less than three.");if(f<3)throw new r.DeveloperError("options.stackPartitions cannot be less than three.");this._radii=a.Cartesian3.clone(e),this._innerRadii=a.Cartesian3.clone(o),this._minimumClock=s,this._maximumClock=m,this._minimumCone=u,this._maximumCone=c,this._stackPartitions=f,this._slicePartitions=d,this._vertexFormat=l.VertexFormat.clone(p),this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidGeometry"}x.packedLength=2*a.Cartesian3.packedLength+l.VertexFormat.packedLength+7,x.pack=function(t,e,n){if(!i.defined(t))throw new r.DeveloperError("value is required");if(!i.defined(e))throw new r.DeveloperError("array is required");return n=i.defaultValue(n,0),a.Cartesian3.pack(t._radii,e,n),n+=a.Cartesian3.packedLength,a.Cartesian3.pack(t._innerRadii,e,n),n+=a.Cartesian3.packedLength,l.VertexFormat.pack(t._vertexFormat,e,n),n+=l.VertexFormat.packedLength,e[n++]=t._minimumClock,e[n++]=t._maximumClock,e[n++]=t._minimumCone,e[n++]=t._maximumCone,e[n++]=t._stackPartitions,e[n++]=t._slicePartitions,e[n]=i.defaultValue(t._offsetAttribute,-1),e};const A=new a.Cartesian3,b=new a.Cartesian3,w=new l.VertexFormat,k={radii:A,innerRadii:b,vertexFormat:w,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};let v;x.unpack=function(t,e,n){if(!i.defined(t))throw new r.DeveloperError("array is required");e=i.defaultValue(e,0);const o=a.Cartesian3.unpack(t,e,A);e+=a.Cartesian3.packedLength;const s=a.Cartesian3.unpack(t,e,b);e+=a.Cartesian3.packedLength;const m=l.VertexFormat.unpack(t,e,w);e+=l.VertexFormat.packedLength;const u=t[e++],c=t[e++],f=t[e++],d=t[e++],p=t[e++],C=t[e++],y=t[e];return i.defined(n)?(n._radii=a.Cartesian3.clone(o,n._radii),n._innerRadii=a.Cartesian3.clone(s,n._innerRadii),n._vertexFormat=l.VertexFormat.clone(m,n._vertexFormat),n._minimumClock=u,n._maximumClock=c,n._minimumCone=f,n._maximumCone=d,n._stackPartitions=p,n._slicePartitions=C,n._offsetAttribute=-1===y?void 0:y,n):(k.minimumClock=u,k.maximumClock=c,k.minimumCone=f,k.maximumCone=d,k.stackPartitions=p,k.slicePartitions=C,k.offsetAttribute=-1===y?void 0:y,new x(k))},x.createGeometry=function(t){const r=t._radii;if(r.x<=0||r.y<=0||r.z<=0)return;const l=t._innerRadii;if(l.x<=0||l.y<=0||l.z<=0)return;const y=t._minimumClock,x=t._maximumClock,A=t._minimumCone,b=t._maximumCone,w=t._vertexFormat;let k,v,P=t._slicePartitions+1,g=t._stackPartitions+1;P=Math.round(P*Math.abs(x-y)/n.CesiumMath.TWO_PI),g=Math.round(g*Math.abs(b-A)/n.CesiumMath.PI),P<2&&(P=2),g<2&&(g=2);let F=0;const V=[A],D=[y];for(k=0;k0&&(O=!0,T+=P-1),b0&&k!==E-1&&0!==v&&v!==M-1&&(S[nt]=!0),nt++;for(F=0,k=1;k=i&&k