import{aasQ}from"./chunk-QV3DAXWD.js";import{aasz}from"./chunk-N5SNKJ43.js";import{aas_}from"./chunk-6VK5R74O.js";import{aasK}from"./chunk-YFQNY2YN.js";import{aasH}from"./chunk-NT26NNVH.js";import{basJ,casW,dasP}from"./chunk-NW2YE576.js";import{dasj}from"./chunk-2NIQ5ECB.js";import{aasL}from"./chunk-QHHYYTCM.js";import{aasb,cask}from"./chunk-RH3GFHG2.js";import{aasZ}from"./chunk-FRWNWNYJ.js";import{aasx}from"./chunk-TA3RE4KQ.js";import{aasF}from"./chunk-RTY3VPG6.js";import{easg}from"./chunk-LRNH5AEO.js";varM=newk,ot=newb,nt=newb,it=newb,st=newb;functionO(t){t=x(t,x.EMPTY_OBJECT);letn=t.length,e=t.topRadius,h=t.bottomRadius,o=x(t.vertexFormat,_.DEFAULT),r=x(t.slices,128);if(!g(n))thrownewF("options.length must be defined.");if(!g(e))thrownewF("options.topRadius must be defined.");if(!g(h))thrownewF("options.bottomRadius must be defined.");if(r<3)thrownewF("options.slices must be greater than or equal to 3.");if(g(t.offsetAttribute)&&t.offsetAttribute===z.TOP)thrownewF("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=n,this._topRadius=e,this._bottomRadius=h,this._vertexFormat=_.clone(o),this._slices=r,this._offsetAttribute=t.offsetAttribute,this._workerName="createCylinderGeometry"}O.packedLength=_.packedLength+5;O.pack=function(t,n,e){if(!g(t))thrownewF("value is required");if(!g(n))thrownewF("array is required");returne=x(e,0),_.pack(t._vertexFormat,n,e),e+=_.packedLength,n[e++]=t._length,n[e++]=t._topRadius,n[e++]=t._bottomRadius,n[e++]=t._slices,n[e]=x(t._offsetAttribute,-1),n};varX=new_,C={vertexFormat:X,length:void0,topRadius:void0,bottomRadius:void0,slices:void0,offsetAttribute:void0};O.unpack=function(t,n,e){if(!g(t))thrownewF("array is required");n=x(n,0);leth=_.unpack(t,n,X);n+=_.packedLength;leto=t[n++],r=t[n++],p=t[n++],D=t[n++],w=t[n];returng(e)?(e._vertexFormat=_.clone(h,e._vertexFormat),e._length=o,e._topRadius=r,e._bottomRadius=p,e._slices=D,e._offsetAttribute=w===-1?void0:w,e):(C.length=o,C.topRadius=r,C.bottomRadius=p,C.slices=D,C.offsetAttribute=w===-1?void0:w,newO(C))};O.createGeometry=function(t){letn=t._length,e=t._topRadius,h=t._bottomRadius,o=t._vertexFormat,r=t._slices;if(n<=0||e<0||h<0||e===0&&h===0)return;letp=r+r,D=r+p,w=p+p,E=Q.computePositions(n,e,h,r,!0),N=o.st?newFloat32Array(w*2):void0,c=o.normal?newFloat32Array(w*3):void0,m=o.tangent?newFloat32Array(w*3):void0,u=o.bitangent?newFloat32Array(w*3):void0,i,U=o.normal||o.tangent||o.bitangent;if(U){letT=o.tangent||o.bitangent,f=0,d=0,l=0,q=Math.atan2(h-e,n),A=ot;A.z=Math.sin(q);letB=Math.cos(q),R=it,y=nt;for(i=0;i<r;i++){letY=i/r*Z.TWO_PI,tt=B*Math.cos(Y),et=B*Math.sin(Y);U&&(A.x=tt,A.y=et,T&&(R=b.normalize(b.cross(b.UNIT_Z,A,R),R)),o.normal&&(c[f++]=A.x,c[f++]=A.y,c[f++]=A.z,c[f++]=A.x,c[f++]=A.y,c[f++]=A.z),o.tangent&&(m[d++]=R.x,m[d++]=R.y,m[d++]=R.z,m[d++]=R.x,m[d++]=R.y,m[d++]=R.z),o.bitangent&&(y=b.normalize(b.cross(A,R,y),y),u[l++]=y.x,u[l++]=y.y,u[l++]=y.z,u[l++]=y.x,u[l++]=y.y,u[l++]=y.z))}for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=-1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=-1,u[l++]=0);for(i=0;i<r;i++)o.normal&&(c[f++]=0,c[f++]=0,c[f++]=1),o.tangent&&(m[d++]=1,m[d++]=0,m[d++]=0),o.bitangent&&(u[l++]=0,u[l++]=1,u[l++]=0)}let$=12*r-12,s=K.createTypedArray(w,$),a=0,v=0;for(i=0;i<r-1;i++)s[a++]=v,s[a++]=v+2,s[a++]=v+3,s[a++]=v,s[a++]=v+3,s[a++]=v+1,v+=2;for(s[a++]=p-2,s[a++]=0,s[a++]=1,s[a++]=p-2,s[a++]=1,s[a++]=p-1,i=1;i<r-1;i++)s[a++]=p+i+1,s[a++]=p+i,s[a++]=p;for(i=1;i<r-1;i++)s[a++]=D,s[a++]=D+i,s[a++]=D+i+1;letV=0;if(o.st){letT=Math.max(e,h);for(i=0;i<w;i++){letf=b.fromArray(E,i*3,st);N[V++]=(f.x+T)/(2*T),N[V++]=(f.y+T)/(2*T)}}letS=newH;o.position&&(S.position=newP({componentDatatype:L.DOUBLE,componentsPerAttribute:3,values:E})),o.normal&&(S.normal=newP({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:c})),o.tangent&&(S.tangent=newP({componentDatatype:L.FLOAT,componentsPerAttribute:3,values:m})),o.bitangent&&(S.bitangent=newP({componentD