define(["./EllipsoidTangentPlane-edb321d3","./buildModuleUrl-4e1b81e7","./Cartesian2-47311507","./Cartographic-3309dd0d","./when-b60132fc","./TerrainEncoding-c4158481","./Math-119be1a3","./PrimitiveType-a54dc62f","./OrientedBoundingBox-87d59c2a","./RuntimeError-4a5c8994","./GeometryAttribute-3a88ba31","./WebMercatorProjection-01b1b5e7","./createTaskProcessorWorker","./Check-7b2a090c","./Cartesian4-3ca25aab","./IntersectionTests-7386ffbf","./Plane-7ae8294c","./Event-16a2dfbf","./AttributeCompression-90851096","./ComponentDatatype-c140a87d","./WebGLConstants-4ae0db90","./PolygonPipeline-660e1625","./earcut-2.2.1-20c8012f","./EllipsoidRhumbLine-ed1a6bf4","./FeatureDetection-c3b71206"],(function(e,t,i,a,r,n,o,s,u,h,c,d,l,g,m,p,v,E,I,f,C,T,M,b,N){"use strict";var x=Uint16Array.BYTES_PER_ELEMENT,S=Int32Array.BYTES_PER_ELEMENT,P=Uint32Array.BYTES_PER_ELEMENT,w=Float32Array.BYTES_PER_ELEMENT,y=Float64Array.BYTES_PER_ELEMENT;function B(e,t,i){i=r.defaultValue(i,o.CesiumMath);for(var a=e.length,n=0;n0&&u.push(u[f]),s.Matrix4.multiplyByPoint(c.toENU,N,R);var x=c.minimum,S=c.maximum;a.Cartesian3.minimumByComponent(R,x,x),a.Cartesian3.maximumByComponent(R,S,S);var P=c.lastBorderPoint;if(r.defined(P)){var w=P.index;h.push(w,C-1,C,C,f,w)}c.lastBorderPoint=E}}return l((function(l,g){l.ellipsoid=i.Ellipsoid.clone(l.ellipsoid),l.rectangle=i.Rectangle.clone(l.rectangle);var m=function(l,g,m,p,v,E,I,f,C,T){var M,b,N,U,Y,k;r.defined(p)?(M=p.west,b=p.south,N=p.east,U=p.north,Y=p.width,k=p.height):(M=o.CesiumMath.toRadians(v.west),b=o.CesiumMath.toRadians(v.south),N=o.CesiumMath.toRadians(v.east),U=o.CesiumMath.toRadians(v.north),Y=o.CesiumMath.toRadians(p.width),k=o.CesiumMath.toRadians(p.height));var V,L,H=[b,U],D=[M,N],G=c.Transforms.eastNorthUpToFixedFrame(g,m),j=s.Matrix4.inverseTransformation(G,W);f&&(V=d.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b),L=1/(d.WebMercatorProjection.geodeticLatitudeToMercatorAngle(U)-V));var z=new DataView(l),q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=_;K.x=Number.POSITIVE_INFINITY,K.y=Number.POSITIVE_INFINITY,K.z=Number.POSITIVE_INFINITY;var Q=F;Q.x=Number.NEGATIVE_INFINITY,Q.y=Number.NEGATIVE_INFINITY,Q.z=Number.NEGATIVE_INFINITY;var X,Z,$=0,ee=0,te=0;for(Z=0;Z<4;++Z){var ie=$;X=z.getUint32(ie,!0),ie+=P;var ae=o.CesiumMath.toRadians(180*z.getFloat64(ie,!0));ie+=y,-1===B(D,ae)&&D.push(ae);var re=o.CesiumMath.toRadians(180*z.getFloat64(ie,!0));ie+=y,-1===B(H,re)&&H.push(re),ie+=2*y;var ne=z.getInt32(ie,!0);ie+=S,ee+=ne,te+=3*(ne=z.getInt32(ie,!0)),$+=X+P}var oe=[],se=[],ue=new Array(ee),he=new Array(ee),ce=new Array(ee),de=f?new Array(ee):[],le=new Array(te),ge=[],me=[],pe=[],ve=[],Ee=0,Ie=0;for($=0,Z=0;Z<4;++Z){X=z.getUint32($,!0);var fe=$+=P,Ce=o.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=y;var Te=o.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=y;var Me=o.CesiumMath.toRadians(180*z.getFloat64($,!0)),be=.5*Me;$+=y;var Ne=o.CesiumMath.toRadians(180*z.getFloat64($,!0)),xe=.5*Ne;$+=y;var Se=z.getInt32($,!0);$+=S;var Pe=z.getInt32($,!0);$+=S,$+=S;for(var we=new Array(Se),ye=0;ye0&&ve.length>0){var De=ge[0].index,Ge=ke,je=ve[ve.length-1].index,ze=ue.length-1;le.push(je,ze,Ge,Ge,De,je)}ee=ue.length;var qe,Je=t.BoundingSphere.fromPoints(ue);r.defined(p)&&(qe=u.OrientedBoundingBox.fromRectangle(p,q,J,m));for(var Ke=new n.EllipsoidalOccluder(m).computeHorizonCullingPointPossiblyUnderEllipsoid(g,ue,q),Qe=new e.AxisAlignedBoundingBox(K,Q,g),Xe=new n.TerrainEncoding(Qe,Le.hMin,J,G,!1,f),Ze=new Float32Array(ee*Xe.getStride()),$e=0,et=0;et