define(["./createTaskProcessorWorker","./ComponentDatatype-c140a87d","./Color-5008547b","./getStringFromTypedArray-c37342c0","./S3MCompressType-555475e4","./Cartographic-3309dd0d","./PrimitiveType-a54dc62f","./pako_inflate-f73548c4","./when-b60132fc","./Check-7b2a090c","./WebGLConstants-4ae0db90","./FeatureDetection-c3b71206","./Math-119be1a3","./RuntimeError-4a5c8994","./IndexDatatype-8a5eead4","./Cartesian4-3ca25aab"],(function(t,e,r,n,a,i,o,E,s,y,p,T,u,l,c,A){"use strict";function d(t,e,r,n,a,i){this.left=t,this.bottom=e,this.right=r,this.top=n,this.minHeight=a,this.maxHeight=i,this.width=r-t,this.length=n-e,this.height=i-a}function v(t,r,n,E,s,y,p){var T=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var u=0,l={},c=l.vertexAttributes=[],A=l.attrLocation={};l.instanceCount=0,l.instanceMode=0;var d=0;s.getUint32(y,!0),y+=Uint32Array.BYTES_PER_ELEMENT;var v=s.getUint16(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var _=v;v>4&&(_=v>>8,v&=15);var m=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var f=void 0,g=void 0;if(m>0){var B=s.getUint16(y,!0);B=v*Float32Array.BYTES_PER_ELEMENT,y+=Uint32Array.BYTES_PER_ELEMENT,u=m*B;var P=E.subarray(y,y+u);if(n){var U=new i.Cartesian3,L=new i.Cartesian3,h=new Float32Array(P.buffer,P.byteOffset,P.byteLength/4),M=new i.Cartographic;f=new i.Cartographic,g=new i.Cartographic;for(var S=new Float32Array(2*m),N=new Float64Array(2*m),R=0;R0){var Y=s.getUint16(y,!0);Y=_*Float32Array.BYTES_PER_ELEMENT,y+=Uint32Array.BYTES_PER_ELEMENT,u=D*Y,t.ignoreNormal||(A.aNormal=d,c.push({index:A.aNormal,typedArray:E.subarray(y,y+u),componentsPerAttribute:_,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:Y,normalize:!1}),d++),y+=u}var C=s.getUint32(y,!0);if(y+=Uint32Array.BYTES_PER_ELEMENT,C>0){var I=new Uint8Array(4*C);p.push(I.buffer);var b=s.getUint32(y,!0);b=4*Float32Array.BYTES_PER_ELEMENT,y+=Uint32Array.BYTES_PER_ELEMENT,u=C*b;for(var F=new Float32Array(E.buffer,y,4*m),x=0;x0&&(y+=u=16*w);var O=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;for(var k,z,G=-1,H=0;H0&&(0==Z?(y+=u=Q*Uint16Array.BYTES_PER_ELEMENT,Q%2==1&&(y+=2)):y+=u=4*Q),K.indicesTypedArray=E.subarray(tt,tt+u);var et=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT;var rt=s.getUint32(y,!0);y+=Uint32Array.BYTES_PER_ELEMENT*et,K.materialCode=rt,J.push(K)}return 2===J.length&&13===J[1].primitiveType&&J[1].indicesCount>=3&&(q=a.S3MEdgeProcessor.createEdgeDataByIndices(l,J[1],p)),t[T]={vertexPackage:l,arrIndexPackage:J,edgeGeometry:q,cartographicBounds:{max:f,min:g}},y}function _(t,r,n){var a=t.vertexAttributes,i=t.attrLocation,o=a.length;i[1===n?"instanceId":"batchId"]=o,a.push({index:o,typedArray:r,componentsPerAttribute:1,componentDatatype:e.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:n})}return new r.Color,t((function(t,e){var r=t.buffer,i=t.supportCompressType,o=t.bVolume,y=null,p=null,T=null,u=t.isCoverImageryLayer,l=t.modelMatrix;if(o&&t.volbuffer.byteLength<8&&(o=!1),o){var c=t.volbuffer,A=new Uint8Array(c,8),m=E.pako.inflate(A).buffer,f=new Float64Array(m,0,1),g=new Uint32Array(m,48,1);if(0===f[0]||3200===g[0]||3201===g[0]){var B=0;0===f[0]&&(B=8),e.push(m);var P=new Float64Array(m,B,6),U=P[0],L=P[1],h=P[2],M=P[3],S=P[4]P[5]?P[4]:P[5];p={left:U,top:L,right:h,bottom:M,minHeight:S,maxHeight:N,width:(y=new d(U,M,h,L,S,N)).width,length:y.length,height:y.height};var R=new Uint32Array(m,48+B,7),D=R[0],Y=R[1],C=R[2],I=R[3];T={nFormat:D,nSideBlockCount:Y,nBlockLength:C,nLength:I,nWidth:R[4],nHeight:R[5],nDepth:R[6],imageArray:new Uint8Array(m,76+B,I*I*4)}}}var b=0,F=new Uint8Array(r,0,4);if(115!==F[0]||51!==F[1]||109!==F[2])return{result:!1};var x=F[3],w=(A=new Uint8Array(r,4),E.pako.inflate(A).buffer),O=new Uint8Array(w);e.push(O.buffer);var k=new DataView(w),z=k.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var G=new Uint8Array(w,b,z),H=z%4;H&&(H=4-H),b+=z+H;var W=n.getStringFromTypedArray(G,void 0,void 0,"gbk");W=(W=W.replace(new RegExp("\r\n","gm"),"")).replace(new RegExp(":","gm"),""),k.getUint32(b,!0),b+=Uint32Array.BYTES_PER_ELEMENT;var V=k.getUint32(b,!0);b+=Uint32Array.BYTES_PER_ELEMENT;var X={};X.ignoreNormal=t.ignoreNormal;for(var j=0;ja.S3MPixelFormat.BGR||Lt===a.S3MPixelFormat.LUMINANCE_ALPHA?(Mt=new Uint8Array(w,b,Bt*Pt),ht=new Uint8Array(Bt*Pt*4)):(Mt=new Uint16Array(w,b,nt/2),ht=new Uint16Array(Bt*Pt)),a.DXTTextureDecode.decode(ht,Bt,Pt,Mt,Lt),e.push(ht.buffer),Ut=0}else ht=new Uint8Array(w,b,nt);ft[gt]={id:gt,width:Bt,height:Pt,compressType:Ut,nFormat:Lt,imageBuffer:ht},b+=nt}return{result:!0,version:x,xmlDoc:W,geoPackage:X,texturePackage:ft,volImageBuffer:T,volBounds:p}}))}));