define(["./AxisAlignedBoundingBox-7a3018c0","./Matrix2-fc7e9822","./defaultValue-94c3e563","./TerrainEncoding-229275c2","./IndexDatatype-db156785","./ComponentDatatype-4a60b8d6","./RuntimeError-c581ca93","./Transforms-3ac41eb6","./WebMercatorProjection-843df830","./createTaskProcessorWorker","./AttributeCompression-4d18cc04","./WebGLConstants-7dccdc96","./_commonjsHelpers-3aae1032-f55dc0c4","./combine-761d9c3f"],(function(e,t,r,n,o,i,a,s,c,h,d,u,l,I){"use strict";function m(){a.DeveloperError.throwInstantiationError()}Object.defineProperties(m.prototype,{errorEvent:{get:a.DeveloperError.throwInstantiationError},credit:{get:a.DeveloperError.throwInstantiationError},tilingScheme:{get:a.DeveloperError.throwInstantiationError},ready:{get:a.DeveloperError.throwInstantiationError},readyPromise:{get:a.DeveloperError.throwInstantiationError},hasWaterMask:{get:a.DeveloperError.throwInstantiationError},hasVertexNormals:{get:a.DeveloperError.throwInstantiationError},availability:{get:a.DeveloperError.throwInstantiationError}});const g=[];m.getRegularGridIndices=function(e,t){if(e*t>=i.CesiumMath.FOUR_GIGABYTES)throw new a.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=g[e];r.defined(n)||(g[e]=n=[]);let o=n[t];return r.defined(o)||(o=e*t=i.CesiumMath.FOUR_GIGABYTES)throw new a.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=T[e];r.defined(n)||(T[e]=n=[]);let o=n[t];if(!r.defined(o)){const r=m.getRegularGridIndices(e,t),i=f(e,t),a=i.westIndicesSouthToNorth,s=i.southIndicesEastToWest,c=i.eastIndicesNorthToSouth,h=i.northIndicesWestToEast;o=n[t]={indices:r,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:h}}return o};const E=[];function f(e,t){const r=new Array(t),n=new Array(e),o=new Array(t),i=new Array(e);let a;for(a=0;a=i.CesiumMath.FOUR_GIGABYTES)throw new a.DeveloperError("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=E[e];r.defined(n)||(E[e]=n=[]);let s=n[t];if(!r.defined(s)){const r=e*t,i=(e-1)*(t-1)*6,a=2*e+2*t,c=6*Math.max(0,a-4),h=r+a,d=i+c,u=f(e,t),l=u.westIndicesSouthToNorth,I=u.southIndicesEastToWest,g=u.eastIndicesNorthToSouth,T=u.northIndicesWestToEast,E=o.IndexDatatype.createTypedArray(h,d);p(e,t,E,0),m.addSkirtIndices(l,I,g,T,r,E,i),s=n[t]={indices:E,westIndicesSouthToNorth:l,southIndicesEastToWest:I,eastIndicesNorthToSouth:g,northIndicesWestToEast:T,indexCountWithoutSkirts:i}}return s},m.addSkirtIndices=function(e,t,r,n,o,i,a){let s=o;a=w(e,s,i,a),s+=e.length,a=w(t,s,i,a),s+=t.length,a=w(r,s,i,a),s+=r.length,w(n,s,i,a)},m.heightmapTerrainQuality=.25,m.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*m.heightmapTerrainQuality/(t*r)},m.prototype.requestTileGeometry=a.DeveloperError.throwInstantiationError,m.prototype.getLevelMaximumGeometricError=a.DeveloperError.throwInstantiationError,m.prototype.getTileDataAvailable=a.DeveloperError.throwInstantiationError,m.prototype.loadTileDataAvailability=a.DeveloperError.throwInstantiationError;const y=32767,N=new t.Cartesian3,S=new t.Cartesian3,M=new t.Cartesian3,b=new t.Cartographic,x=new t.Cartesian2;function A(a,h){const d=a.quantizedVertices,u=d.length/3,l=a.octEncodedNormals,I=a.westIndices.length+a.eastIndices.length+a.southIndices.length+a.northIndices.length,g=a.includeWebMercatorT,T=a.exaggeration,E=a.exaggerationRelativeHeight,f=1!==T,p=f,w=t.Rectangle.clone(a.rectangle),A=w.west,D=w.south,P=w.east,G=w.north,F=t.Ellipsoid.clone(a.ellipsoid),_=a.minimumHeight,k=a.maximumHeight,H=a.relativeToCenter,Y=s.Transforms.eastNorthUpToFixedFrame(H,F),O=t.Matrix4.inverseTransformation(Y,new t.Matrix4);let B,V;g&&(B=c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(D),V=1/(c.WebMercatorProjection.geodeticLatitudeToMercatorAngle(G)-B));const R=d.subarray(0,u),L=d.subarray(u,2*u),U=d.subarray(2*u,3*u),j=r.defined(l),z=new Array(u),q=new Array(u),Q=new Array(u),K=g?new Array(u):[],X=p?new Array(u):[],Z=S;Z.x=Number.POSITIVE_INFINITY,Z.y=Number.POSITIVE_INFINITY,Z.z=Number.POSITIVE_INFINITY;const J=M;J.x=Number.NEGATIVE_INFINITY,J.y=Number.NEGATIVE_INFINITY,J.z=Number.NEGATIVE_INFINITY;let $=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,te=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY;for(let e=0;e