define(["exports","./arrayFill-deb10550","./buildModuleUrl-d920237a","./Cartographic-1d953166","./ComponentDatatype-07894a2b","./when-d186add7","./Check-2514d21d","./Rectangle-f841217d","./GeometryAttribute-95780fd1","./GeometryAttributes-9c67dd14","./GeometryOffsetAttribute-da5a1d35","./IndexDatatype-61ffec74","./Math-7f5f2992","./FeatureDetection-4281d393"],(function(t,i,e,o,n,r,a,s,m,u,f,d,c,l){"use strict";var _=new o.t(1,1,1),h=Math.cos,p=Math.sin;function v(t){t=r.u(t,r.u.EMPTY_OBJECT);var i=r.u(t.radii,_),e=r.u(t.innerRadii,i),n=r.u(t.minimumClock,0),s=r.u(t.maximumClock,c.e.TWO_PI),m=r.u(t.minimumCone,0),u=r.u(t.maximumCone,c.e.PI),d=Math.round(r.u(t.stackPartitions,10)),l=Math.round(r.u(t.slicePartitions,8)),h=Math.round(r.u(t.subdivisions,128));if(d<1)throw new a.t("options.stackPartitions cannot be less than 1");if(l<0)throw new a.t("options.slicePartitions cannot be less than 0");if(h<0)throw new a.t("options.subdivisions must be greater than or equal to zero.");if(r.e(t.offsetAttribute)&&t.offsetAttribute===f.z.TOP)throw new a.t("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=o.t.clone(i),this._innerRadii=o.t.clone(e),this._minimumClock=n,this._maximumClock=s,this._minimumCone=m,this._maximumCone=u,this._stackPartitions=d,this._slicePartitions=l,this._subdivisions=h,this._offsetAttribute=t.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}v.packedLength=2*o.t.packedLength+8,v.pack=function(t,i,e){if(!r.e(t))throw new a.t("value is required");if(!r.e(i))throw new a.t("array is required");return e=r.u(e,0),o.t.pack(t._radii,i,e),e+=o.t.packedLength,o.t.pack(t._innerRadii,i,e),e+=o.t.packedLength,i[e++]=t._minimumClock,i[e++]=t._maximumClock,i[e++]=t._minimumCone,i[e++]=t._maximumCone,i[e++]=t._stackPartitions,i[e++]=t._slicePartitions,i[e++]=t._subdivisions,i[e]=r.u(t._offsetAttribute,-1),i};var b=new o.t,k=new o.t,y={radii:b,innerRadii:k,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};v.unpack=function(t,i,e){if(!r.e(t))throw new a.t("array is required");i=r.u(i,0);var n=o.t.unpack(t,i,b);i+=o.t.packedLength;var s=o.t.unpack(t,i,k);i+=o.t.packedLength;var m=t[i++],u=t[i++],f=t[i++],d=t[i++],c=t[i++],l=t[i++],_=t[i++],h=t[i];return r.e(e)?(e._radii=o.t.clone(n,e._radii),e._innerRadii=o.t.clone(s,e._innerRadii),e._minimumClock=m,e._maximumClock=u,e._minimumCone=f,e._maximumCone=d,e._stackPartitions=c,e._slicePartitions=l,e._subdivisions=_,e._offsetAttribute=-1===h?void 0:h,e):(y.minimumClock=m,y.maximumClock=u,y.minimumCone=f,y.maximumCone=d,y.stackPartitions=c,y.slicePartitions=l,y.subdivisions=_,y.offsetAttribute=-1===h?void 0:h,new v(y))},v.createGeometry=function(t){var o=t._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a=t._innerRadii;if(!(a.x<=0||a.y<=0||a.z<=0)){var _=t._minimumClock,v=t._maximumClock,b=t._minimumCone,k=t._maximumCone,y=t._subdivisions,C=s.t.fromCartesian3(o),w=t._slicePartitions+1,x=t._stackPartitions+1;(w=Math.round(w*Math.abs(v-_)/c.e.TWO_PI))<2&&(w=2),(x=Math.round(x*Math.abs(k-b)/c.e.PI))<2&&(x=2);var A=0,P=1,g=a.x!==o.x||a.y!==o.y||a.z!==o.z,M=!1,z=!1;g&&(P=2,b>0&&(M=!0,A+=w),k<Math.PI&&(z=!0,A+=w));var O,D,I,E,T=y*P*(x+w),L=new Float64Array(3*T),R=2*(T+A-(w+x)*P),G=d.IndexDatatype.createTypedArray(T,R),N=0,q=new Array(x),U=new Array(x);for(O=0;O<x;O++)E=b+O*(k-b)/(x-1),q[O]=p(E),U[O]=h(E);var B=new Array(y),F=new Array(y);for(O=0;O<y;O++)I=_+O*(v-_)/(y-1),B[O]=p(I),F[O]=h(I);for(O=0;O<x;O++)for(D=0;D<y;D++)L[N++]=o.x*q[O]*F[D],L[N++]=o.y*q[O]*B[D],L[N++]=o.z*U[O];if(g)for(O=0;O<x;O++)for(D=0;D<y;D++)L[N++]=a.x*q[O]*F[D],L[N++]=a.y*q[O]*B[D],L[N++]=a.z*U[O];for(q.length=y,U.length=y,O=0;O<y;O++)E=b+O*(k-b)/(y-1),q[O]=p(E),U[O]=h(E);for(B.length=w,F.length=w,O=0;O<w;O++)I=_+O*(v-_)/(w-1),B[O]=p(I),F[O]=h(I);for(O=0;O<y;O++)for(D=0;D<w;D++)L[N++]=o.x*q[O]*F[D],L[N++]=o.y*q[O]*B[D],L[N++]=o.z*U[O];if(g)for(O=0;O<y;O++)for(D=0;D<w;D++)L[N++]=a.x*q[O]*F[D],L[N++]=a.y*q[O]*B[D],L[N++]=a.z*U[O];for(N=0,O=0;O<x*P;O++){var S=O*y;for(D=0;D<y-1;D++)G[N++]=S+D,G[N++]=S+D+1}var W=x*y*P;for(O=0;O<w;O++)for(D=0;D<y-1;D++)G[N++]=W+O+D*w,G[N++]=W+O+(D+1)*w;if(g)for(W=x*y*P+w*y,O=0;O<w;O++)for(D=0;D<y-1;D++)G[N++]=W+O+D*w,G[N++]=W+O+(D+1)*w;if(g){var Y=x*y*P,J=Y+y*w;if(M)for(O=0;O<w;O++)G[N++]=Y+O,G[N++]=J+O;if(z)for(Y+=y*w-w,J+=y*w-w,O=0;O<w;O++)G[N++]=Y+O,G[N++]=J+O}var j=new u.a({position:new m.o({componentDatatype:n.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:L})});if(r.e(t._offsetAttribute)){var H=L.length,K=new Uint8Array(H/3),Q=t._offsetAttribute===f.z.NONE?0:1;i.d(K,Q),j.applyOffset=new m.o({componentDatatype:n.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:1,values:K})}return new m.I({attributes:j,indices:G,primitiveType:l._0x12cc5d.LINES,boundingSphere:e.i.fromEllipsoid(C),offsetAttribute:t._offsetAttribute})}}},t.x=v}));
