define(["./createTaskProcessorWorker","./Cartographic-1d953166","./Cartesian4-3408960c","./pako_inflate-e5e032ee","./Rectangle-f841217d","./when-d186add7","./Check-2514d21d","./Math-7f5f2992"],(function(t,e,a,l,n,r,i,h){"use strict";var o,c=(o=!0,function(t,e){var a=o?function(){if(e){var a=e.apply(t,arguments);return e=null,a}}:function(){};return o=!1,a}),d=c(void 0,(function(){return d.toString().search("(((.+)+)+)+$").toString().constructor(d).search("(((.+)+)+)+$")}));d();var u=Object.freeze({UNLOAD:0,LOADING:1,LOADED:2,VOLLOADED:3,PARSING:4,PARSED:5,TRANSFORMING:6,TRANSFORMED:7,LOST:8,LOADVOL:9,FAILED:10,VOLFAILED:11});function s(t){var a=new e.t(1,255,65025);(a=e.t.multiplyByScalar(a,t,a)).x=a.x-Math.floor(a.x),a.y=a.y-Math.floor(a.y),a.z=a.z-Math.floor(a.z);var l=new e.t,n=new e.t(1/255,1/255,0);return l.x=a.y*n.x,l.y=a.z*n.y,l.z=a.z*n.z,a=e.t.subtract(a,l,a)}function _(t,e,l,n){for(var r=t._nLength*t._nLength*4,i=new Array(r),h=l-e,o=e,c=0;c<t.cellDepth;c++)for(var d=parseInt(c/t._nSideBlockCount)*t._nBlockLength,u=c%t._nSideBlockCount*t._nBlockLength,_=-1;_<t._nBlockLength-1;_++)for(var f=-1;f<t._nBlockLength-1;f++){var g=Math.min(f,t.validWidth-1),v=Math.min(_,t.validHeight-1);g=Math.max(0,g),v=Math.max(0,v);var y,L,p=0;if(t.ySpan>0&&(p=t.validHeight-t.cellHeight),g<t.cellWidth&&v>=p?(L=0,y=c*t.cellHeight*t.cellWidth+(t.validHeight-1-v)*t.cellWidth+g):g<t.cellWidth?(L=0==t.xSpan?1:2,y=c*t.cellHeight*t.cellWidth+(t.validHeight-t.cellHeight-1-v)*t.cellWidth+g):v>=p?(L=1,y=c*t.cellHeight*t.cellWidth+(t.validHeight-1-v)*t.cellWidth+g-t.cellWidth):(L=3,y=c*t.cellHeight*t.cellWidth+(t.validHeight-t.cellHeight-1-v)*t.cellWidth+g-t.cellWidth),!(y<0)){var x=n[L][y],w=new a.e(0,0,0,0);if(-9999!=x){x<e||x>l?x=o:o=x;var B=s(x=(x-e)/h);w.x=B.x,w.y=B.y,w.z=B.z,w.w=1}var W=255*w.x,S=255*w.y,D=255*w.z,H=255*w.w;i[4*(y=(d+_)*t._nLength+u+f)]=parseInt(W),i[4*y+1]=parseInt(S),i[4*y+2]=parseInt(D),i[4*y+3]=parseInt(H)}}return new Uint8Array(i,0,r)}return t((function(t,e){for(var r=t.arrayWork,i=[],h=0;h<r.length;h++)if(r[h]._s3mLoadState===u.LOADED){var o=r[h]._arrayBuffer.slice(16,r[h]._arrayBuffer.byteLength),c=l.pako.inflate(o).buffer;r[h]._arrayBuffer=c,r[h]._s3mLoadState=u.TRANSFORMED,i.push({index:h,buffer:c})}var d=t.textureLevel,s=t._availableNode,f=t._time,g=t._layerBounds,v=t._minFiltration,y=t._maxFiltration;d.cellWidth=t._cellWidth,d.cellHeight=t._cellHeight,d.cellDepth=t._cellDepth;var L=function(t,e,l,r,i,h,o){for(var c=t.length,d=[],u=0;u<c;u++)d.push(t[u]._arrayBuffer.slice(36,t[u]._arrayBuffer.byteLength));var s=4*e.cellWidth*e.cellHeight*e.cellDepth,f=t[0],g=t[c-1],v=e.cellWidth,y=e.cellHeight;o.EndCol-1==g._x&&(v=o.Width-g._x*v),o.EndRow-1==g._y&&(y=o.Height-g._y*y),e.startCol=f._x,e.startRow=f._y,e.endCol=g._x,e.endRow=g._y,e.ySpan=g._y-f._y,e.xSpan=g._x-f._x,e.ySpan>0&&(y+=e.cellHeight),e.xSpan>0&&(v+=e.cellWidth),e._nSideBlockCount=Math.ceil(Math.sqrt(e.cellDepth)),e._nBlockLength=Math.max(y,v)+2,e._nLength=function(t){for(var e=1;e<t;)e<<=1;return e}(e._nBlockLength*e._nSideBlockCount-2),e.validWidth=v,e.validHeight=y,e.bounds=new n.h(f._dataBounds.west,g._dataBounds.south,g._dataBounds.east,f._dataBounds.north);var L=new n.h(r.west,r.south,r.east,r.north);e.multiResolutionTranslation=new a.e((f._dataBounds.west-L.west)/L.width,(g._dataBounds.south-L.south)/L.height,L.width/e.bounds.width,L.height/e.bounds.height);for(var p=[],x=0;x<l;x++){var w=[];for(u=0;u<d.length;u++){var B=new Float32Array(d[u].slice(x*s,(x+1)*s));w.push(B)}p.push(_(e,i,h,w))}return p}(r,d,f,g,v,y,s);return{textureLevel:d,imageDatas:L,unzipTile:i}}))}));
