define(["./AxisAlignedBoundingBox-8774439c","./BoundingSphere-9a3b5656","./Cartesian2-bd414876","./Cartesian3-e0307675","./defaultValue-81eec7ed","./TerrainEncoding-0f7ffc20","./Math-e73894ab","./Matrix4-4c545f70","./OrientedBoundingBox-c5d2adb7","./Rectangle-cf3e0e3e","./RuntimeError-26acdd3b","./Transforms-5b829630","./WebMercatorProjection-44373a3d","./createTaskProcessorWorker","./Check-741c5f3c","./GeographicProjection-c931c7fb","./AttributeCompression-8f752c03","./ComponentDatatype-aaeec80f","./WebGLConstants-508b9636","./Matrix2-dc0c61cc","./EllipsoidTangentPlane-4d138901","./IntersectionTests-80510c7b","./Plane-bc8b6777","./when-422ea0ae","./Resource-8ae1a924","./combine-3c023bda"],(function(t,e,n,i,o,a,r,s,c,u,h,d,l,g,m,p,f,I,E,T,C,M,x,N,b,S){"use strict";const w=Uint16Array.BYTES_PER_ELEMENT,B=Int32Array.BYTES_PER_ELEMENT,P=Uint32Array.BYTES_PER_ELEMENT,A=Float32Array.BYTES_PER_ELEMENT,R=Float64Array.BYTES_PER_ELEMENT;function y(t,e,n){n=o.defaultValue(n,r.CesiumMath);const i=t.length;for(let o=0;o0&&c.push(c[C]),u.length>0&&u.push(u[C]),s.Matrix4.multiplyByPoint(d.toENU,S,W);const w=d.minimum,B=d.maximum;i.Cartesian3.minimumByComponent(W,w,w),i.Cartesian3.maximumByComponent(W,B,B);const P=d.lastBorderPoint;if(o.defined(P)){const t=P.index;h.push(t,M-1,M,M,C,t)}d.lastBorderPoint=E}}return g((function(g,m){g.ellipsoid=n.Ellipsoid.clone(g.ellipsoid),g.rectangle=u.Rectangle.clone(g.rectangle);const p=function(u,g,m,p,f,I,E,T,C,M,x){let N,b,S,Y,k,U;o.defined(p)?(N=p.west,b=p.south,S=p.east,Y=p.north,k=p.width,U=p.height):(N=r.CesiumMath.toRadians(f.west),b=r.CesiumMath.toRadians(f.south),S=r.CesiumMath.toRadians(f.east),Y=r.CesiumMath.toRadians(f.north),k=r.CesiumMath.toRadians(p.width),U=r.CesiumMath.toRadians(p.height));const H=[b,Y],L=[N,S],G=d.Transforms.eastNorthUpToFixedFrame(g,m),j=s.Matrix4.inverseTransformation(G,O);let D,z;C&&(D=l.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b),z=1/(l.WebMercatorProjection.geodeticLatitudeToMercatorAngle(Y)-D));const q=1!==I,J=new DataView(u);let K=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY;const X=v;X.x=Number.POSITIVE_INFINITY,X.y=Number.POSITIVE_INFINITY,X.z=Number.POSITIVE_INFINITY;const Z=F;Z.x=Number.NEGATIVE_INFINITY,Z.y=Number.NEGATIVE_INFINITY,Z.z=Number.NEGATIVE_INFINITY;let $,tt,et=0,nt=0,it=0;for(tt=0;tt<4;++tt){let t=et;$=J.getUint32(t,!0),t+=P;const e=r.CesiumMath.toRadians(180*J.getFloat64(t,!0));t+=R,-1===y(L,e)&&L.push(e);const n=r.CesiumMath.toRadians(180*J.getFloat64(t,!0));t+=R,-1===y(H,n)&&H.push(n),t+=2*R;let i=J.getInt32(t,!0);t+=B,nt+=i,i=J.getInt32(t,!0),it+=3*i,et+=$+P}const ot=[],at=[],rt=new Array(nt),st=new Array(nt),ct=new Array(nt),ut=C?new Array(nt):[],ht=q?new Array(nt):[],dt=new Array(it),lt=[],gt=[],mt=[],pt=[];let ft=0,It=0;for(et=0,tt=0;tt<4;++tt){$=J.getUint32(et,!0),et+=P;const t=et,e=r.CesiumMath.toRadians(180*J.getFloat64(et,!0));et+=R;const o=r.CesiumMath.toRadians(180*J.getFloat64(et,!0));et+=R;const a=r.CesiumMath.toRadians(180*J.getFloat64(et,!0)),c=.5*a;et+=R;const u=r.CesiumMath.toRadians(180*J.getFloat64(et,!0)),d=.5*u;et+=R;const g=J.getInt32(et,!0);et+=B;const p=J.getInt32(et,!0);et+=B,et+=B;const f=new Array(g);for(let t=0;t0&&pt.length>0){const t=lt[0].index,e=Et,n=pt[pt.length-1].index,i=rt.length-1;dt.push(n,i,e,e,t,n)}nt=rt.length;const xt=e.BoundingSphere.fromPoints(rt);let Nt;o.defined(p)&&(Nt=c.OrientedBoundingBox.fromRectangle(p,K,Q,m));const bt=new a.EllipsoidalOccluder(m).computeHorizonCullingPointPossiblyUnderEllipsoid(g,rt,K),St=new t.AxisAlignedBoundingBox(X,Z,g),wt=new a.TerrainEncoding(g,St,Ct.hMin,Q,G,!1,C,q,I,E),Bt=new Float32Array(nt*wt.stride);let Pt=0;for(let t=0;t