define(["exports","./arrayFill-4d3cc415","./buildModuleUrl-dba4ec07","./Cartesian2-1b9b0d8a","./Cartographic-1bbcab04","./Check-3aa71481","./ComponentDatatype-d430c7f7","./when-515d5295","./EllipseGeometryLibrary-497ff3d7","./Rectangle-e170be8b","./Intersect-53434a77","./GeometryAttribute-9bc31a7f","./GeometryAttributes-7d904f0f","./GeometryInstance-c11993d9","./GeometryOffsetAttribute-800f7650","./GeometryPipeline-137aa28e","./IndexDatatype-eefd5922","./Math-5e38123d","./PrimitiveType-b38a4004","./VertexFormat-e844760b"],(function(e,t,r,n,a,o,i,s,m,u,l,c,p,d,y,f,h,A,x,g){"use strict";var _=new a.a,v=new a.a,b=new a.a,w=new a.a,I=new n.r,T=new x.r,N=new x.r,M=new c.a,E=new a.a,P=new a.a,D=new a.a,F=new a.i,O=new a.a,S=new n.r,C=new n.r;function R(e,r,o){var u=r.vertexFormat,d=r.center,f=r.semiMajorAxis,h=r.semiMinorAxis,A=r.ellipsoid,g=r.stRotation,w=o?e.length/3*2:e.length/3,R=r.shadowVolume,L=u.st?new Float32Array(2*w):void 0,j=u.normal?new Float32Array(3*w):void 0,G=u.tangent?new Float32Array(3*w):void 0,V=u.bitangent?new Float32Array(3*w):void 0,z=R?new Float32Array(3*w):void 0,k=0,Y=E,B=P,H=D,U=new l.s(A),W=U.project(A.cartesianToCartographic(d,F),O),q=A.scaleToGeodeticSurface(d,_);A.geodeticSurfaceNormal(q,q);var Q=T,J=N;if(0!==g){var Z=c.a.fromAxisAngle(q,g,M);Q=x.r.fromQuaternion(Z,Q),Z=c.a.fromAxisAngle(q,-g,M),J=x.r.fromQuaternion(Z,J)}else Q=x.r.clone(x.r.IDENTITY,Q),J=x.r.clone(x.r.IDENTITY,J);for(var K=n.r.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,S),X=n.r.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,C),$=e.length,ee=o?$:0,te=ee/3*2,re=0;re<$;re+=3){var ne=re+1,ae=re+2,oe=a.a.fromArray(e,re,_);if(u.st){var ie=x.r.multiplyByVector(Q,oe,v),se=U.project(A.cartesianToCartographic(ie,F),b);a.a.subtract(se,W,se),I.x=(se.x+f)/(2*f),I.y=(se.y+h)/(2*h),K.x=Math.min(I.x,K.x),K.y=Math.min(I.y,K.y),X.x=Math.max(I.x,X.x),X.y=Math.max(I.y,X.y),o&&(L[k+te]=I.x,L[k+1+te]=I.y),L[k++]=I.x,L[k++]=I.y}(u.normal||u.tangent||u.bitangent||R)&&(Y=A.geodeticSurfaceNormal(oe,Y),R&&(z[re+ee]=-Y.x,z[ne+ee]=-Y.y,z[ae+ee]=-Y.z),(u.normal||u.tangent||u.bitangent)&&((u.tangent||u.bitangent)&&(B=a.a.normalize(a.a.cross(a.a.UNIT_Z,Y,B),B),x.r.multiplyByVector(J,B,B)),u.normal&&(j[re]=Y.x,j[ne]=Y.y,j[ae]=Y.z,o&&(j[re+ee]=-Y.x,j[ne+ee]=-Y.y,j[ae+ee]=-Y.z)),u.tangent&&(G[re]=B.x,G[ne]=B.y,G[ae]=B.z,o&&(G[re+ee]=-B.x,G[ne+ee]=-B.y,G[ae+ee]=-B.z)),u.bitangent&&(H=a.a.normalize(a.a.cross(Y,B,H),H),V[re]=H.x,V[ne]=H.y,V[ae]=H.z,o&&(V[re+ee]=H.x,V[ne+ee]=H.y,V[ae+ee]=H.z))))}if(u.st){$=L.length;for(var me=0;me<$;me+=2)L[me]=(L[me]-K.x)/(X.x-K.x),L[me+1]=(L[me+1]-K.y)/(X.y-K.y)}var ue=new p.t;if(u.position){var le=m.N.raisePositionsToHeight(e,r,o);ue.position=new c.r({componentDatatype:i.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:le})}if(u.st&&(ue.st=new c.r({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:L})),u.normal&&(ue.normal=new c.r({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:j})),u.tangent&&(ue.tangent=new c.r({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:G})),u.bitangent&&(ue.bitangent=new c.r({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:V})),R&&(ue.extrudeDirection=new c.r({componentDatatype:i.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:z})),o&&s.t(r.offsetAttribute)){var ce=new Uint8Array(w);if(r.offsetAttribute===y.I.TOP)ce=t.d(ce,1,0,w/2);else{var pe=r.offsetAttribute===y.I.NONE?0:1;ce=t.d(ce,pe)}ue.applyOffset=new c.r({componentDatatype:i.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:ce})}return ue}function L(e){var t,r,n,a,o,i=new Array(e*(e+1)*12-6),s=0;for(t=0,n=1,a=0;a<3;a++)i[s++]=n++,i[s++]=t,i[s++]=n;for(a=2;a1;--a){for(i[s++]=t++,i[s++]=t,i[s++]=n,r=2*a,o=0;oA.n.PI&&(y.north=y.north>0?A.n.PI_OVER_TWO-A.n.EPSILON7:y.north,y.south=y.south<0?A.n.EPSILON7-A.n.PI_OVER_TWO:y.south,y.east=A.n.PI,y.west=-A.n.PI),y}function Y(e){var t=(e=s.e(e,s.e.EMPTY_OBJECT)).center,r=s.e(e.ellipsoid,u.n.WGS84),n=e.semiMajorAxis,i=e.semiMinorAxis,m=s.e(e.granularity,A.n.RADIANS_PER_DEGREE),l=s.e(e.vertexFormat,g.n.DEFAULT);if(o.n.defined("options.center",t),o.n.typeOf.number("options.semiMajorAxis",n),o.n.typeOf.number("options.semiMinorAxis",i),n