define(["exports","./Transforms-3ac41eb6","./Matrix2-fc7e9822","./ComponentDatatype-4a60b8d6","./CylinderGeometryLibrary-7b029c87","./defaultValue-94c3e563","./RuntimeError-c581ca93","./GeometryAttribute-a441ff32","./GeometryAttributes-7df9bef6","./GeometryOffsetAttribute-ec11b721","./IndexDatatype-db156785","./VertexFormat-e46f29d6"],(function(t,e,r,o,n,a,i,s,u,f,m,d){"use strict";const l=new r.Cartesian2,p=new r.Cartesian3,c=new r.Cartesian3,y=new r.Cartesian3,b=new r.Cartesian3;function A(t){t=a.defaultValue(t,a.defaultValue.EMPTY_OBJECT);const e=t.length,r=t.topRadius,o=t.bottomRadius,n=a.defaultValue(t.vertexFormat,d.VertexFormat.DEFAULT),s=a.defaultValue(t.slices,128);if(!a.defined(e))throw new i.DeveloperError("options.length must be defined.");if(!a.defined(r))throw new i.DeveloperError("options.topRadius must be defined.");if(!a.defined(o))throw new i.DeveloperError("options.bottomRadius must be defined.");if(s<3)throw new i.DeveloperError("options.slices must be greater than or equal to 3.");if(a.defined(t.offsetAttribute)&&t.offsetAttribute===f.GeometryOffsetAttribute.TOP)throw new i.DeveloperError("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=e,this._topRadius=r,this._bottomRadius=o,this._vertexFormat=d.VertexFormat.clone(n),this._slices=s,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}A.packedLength=d.VertexFormat.packedLength+5,A.pack=function(t,e,r){if(!a.defined(t))throw new i.DeveloperError("value is required");if(!a.defined(e))throw new i.DeveloperError("array is required");return r=a.defaultValue(r,0),d.VertexFormat.pack(t._vertexFormat,e,r),r+=d.VertexFormat.packedLength,e[r++]=t._length,e[r++]=t._topRadius,e[r++]=t._bottomRadius,e[r++]=t._slices,e[r]=a.defaultValue(t._offsetAttribute,-1),e};const h=new d.VertexFormat,w={vertexFormat:h,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};let g;A.unpack=function(t,e,r){if(!a.defined(t))throw new i.DeveloperError("array is required");e=a.defaultValue(e,0);const o=d.VertexFormat.unpack(t,e,h);e+=d.VertexFormat.packedLength;const n=t[e++],s=t[e++],u=t[e++],f=t[e++],m=t[e];return a.defined(r)?(r._vertexFormat=d.VertexFormat.clone(o,r._vertexFormat),r._length=n,r._topRadius=s,r._bottomRadius=u,r._slices=f,r._offsetAttribute=-1===m?void 0:m,r):(w.length=n,w.topRadius=s,w.bottomRadius=u,w.slices=f,w.offsetAttribute=-1===m?void 0:m,new A(w))},A.createGeometry=function(t){let i=t._length;const d=t._topRadius,A=t._bottomRadius,h=t._vertexFormat,w=t._slices;if(i<=0||d<0||A<0||0===d&&0===A)return;const g=w+w,v=w+g,x=g+g,_=n.CylinderGeometryLibrary.computePositions(i,d,A,w,!0),F=h.st?new Float32Array(2*x):void 0,C=h.normal?new Float32Array(3*x):void 0,D=h.tangent?new Float32Array(3*x):void 0,G=h.bitangent?new Float32Array(3*x):void 0;let R;const O=h.normal||h.tangent||h.bitangent;if(O){const t=h.tangent||h.bitangent;let e=0,n=0,a=0;const s=Math.atan2(A-d,i),u=p;u.z=Math.sin(s);const f=Math.cos(s);let m=y,l=c;for(R=0;R