import{A as W,B as z,ea as Vt,C as _t,a6 as Dt,s as Lt,bb as Rt,z as Q,a1 as Nt,Y as nt,aC as Et,b3 as jt,ab as Gt,ij as Ut,ik as Ot}from"./index-b5c8f851.js";let gt=class{constructor(e=null,n=null,o=null){this.minValue=e,this.maxValue=n,this.noDataValue=o}};const qt=9999999e31,Wt=2e-7,Xt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function ht(t){return Xt[t]??[-34028234663852886e22,34028234663852886e22]}function xe(t,e,n){var p,u;if(t.depthCount&&t.depthCount>1)return;const{pixels:o,statistics:h,pixelType:i}=t,r=o[0].length,f=t.bandMasks??[],a=t.mask??new Uint8Array(r).fill(255),l=i==="f32"||i==="f64",s=ht(i);let c=!1;for(let d=0;dm+Number.EPSILON||w=qt?Wt*Math.abs(m):i==="f32"?2**-23:Number.EPSILON);for(let y=0;y1?f:null,t.mask=a),c&&"updateStatistics"in t&&t.updateStatistics()}var Z;let G=Z=class extends Dt{static createEmptyBand(t,e){return new(Z.getPixelArrayConstructor(t))(e)}static getPixelArrayConstructor(t){let e;switch(t){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":e=Float32Array;break;case"f64":e=Float64Array}return e}constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.premultiplyAlpha=!1,this.statistics=null,this.depthCount=1}castPixelType(t){if(!t)return"f32";let e=t.toLowerCase();return["u1","u2","u4"].includes(e)?e="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(e)||(e="f32"),e}getPlaneCount(){var t;return(t=this.pixels)==null?void 0:t.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new Lt("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push(t.statistics??new gt)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map(n=>this._calculateBandStatistics(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:fp>=e.length),i=o===t.length&&!t.some((p,u)=>p!==u);if(h||i)return this;const r=((c=this.bandMasks)==null?void 0:c.length)===o?t.map(p=>this.bandMasks[p]):void 0;let{mask:f,validPixelCount:a}=this;const{width:l,height:s}=this;if(r){if(r.length===1)f=r[0];else{const p=l*s;f=new Uint8Array(p).fill(255);for(let u=0;u!!p).length}return new Z({pixelType:this.pixelType,width:l,height:s,mask:f,bandMasks:r,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(p=>e[p]),statistics:n&&t.map(p=>n[p])})}clone(){const t=new Z({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(o=>new Uint8Array(o)));const n=Z.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const o=!!this.pixels[0].slice;for(e=0;e=3?(r=h[1],f=h[2]):h.length===2&&(r=h[1]);const l=new Uint32Array(t),s=this.width*this.height;if(i.length===s)if(e!=null&&e.length===s)if(n)for(a=0;a0){for(const m of o)if(m.minValue!=null&&(r=Math.min(r,m.minValue)),m.maxValue!=null&&m.minValue!=null){const x=m.maxValue-m.minValue;f=Math.max(f,x)}i=255/f}else{let m=255;h==="s8"?(r=-128,m=127):h==="u16"?m=65535:h==="s16"?(r=-32768,m=32767):h==="u32"?m=4294967295:h==="s32"?(r=-2147483648,m=2147483647):h==="f32"?(r=-34e38,m=34e38):h==="f64"&&(r=-Number.MAX_VALUE,m=Number.MAX_VALUE),i=255/(m-r)}const a=new Uint32Array(t),l=this.width*this.height;let s,c,p,u,d;if(s=c=p=e[0],s.length!==l)return Q.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(c=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===l)for(u=0;u=3?(h=e[1],i=e[2]):e.length===2&&(h=e[1]);const f=this.width*this.height;if(o.length!==f)return Q.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===f)for(r=0;ro?r:o);else for(i=0;io?r:o;return new gt(n,o)}};W([z({json:{write:!0}})],G.prototype,"width",void 0),W([z({json:{write:!0}})],G.prototype,"height",void 0),W([z({json:{write:!0}})],G.prototype,"pixelType",void 0),W([Vt("pixelType")],G.prototype,"castPixelType",null),W([z({json:{write:!0}})],G.prototype,"validPixelCount",void 0),W([z({json:{write:!0}})],G.prototype,"mask",void 0),W([z({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),W([z({json:{write:!0}})],G.prototype,"pixels",void 0),W([z()],G.prototype,"premultiplyAlpha",void 0),W([z({json:{write:!0}})],G.prototype,"statistics",void 0),W([z({json:{write:!0}})],G.prototype,"depthCount",void 0),W([z({json:{write:!0}})],G.prototype,"noDataValues",void 0),W([z({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=Z=W([_t("esri.layers.support.PixelBlock")],G);const _=G;var xt,wt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(xt||(xt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(wt||(wt={}));const we=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function ye(t){var s;if(!(t!=null&&t.length)||t.some(c=>!L(c)))return null;if(t.length===1)return((s=t[0])==null?void 0:s.clone())??null;const e=t,{width:n,height:o,pixelType:h}=e[0];if(e.some(c=>c.width!==n||c.height!==o))return null;const i=e.map(({mask:c})=>c).filter(c=>c!=null);let r=null;i.length&&(r=new Uint8Array(n*o),r.set(i[0]),i.length>1&&Tt(i.slice(1),r));const f=[];e.forEach(({pixels:c})=>f.push(...c));const a=e.map(({statistics:c})=>c).filter(c=>c==null?void 0:c.length),l=[];return a.forEach(c=>l.push(...c)),new _({pixelType:h,width:n,height:o,mask:r,pixels:f,statistics:l.length?l:null})}function ke(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((c,p)=>c[0]-p[0]);let o=0;n[0][0]<0&&(o=n[0][0]);const h=Math.max(256,n[n.length-1][0]-o+1),i=new Uint8Array(4*h),r=[];let f,a=0,l=0;const s=n[0].length===5;if(h>65536)return n.forEach(c=>{r[c[0]-o]=s?c.slice(1):c.slice(1).concat([255])}),{indexed2DColormap:r,offset:o,alphaSpecified:s};if(t.fillUnspecified)for(f=n[l],a=f[0]-o;aw?h[s]=0:(p[s]=r[x],u[s]=r[x+1],d[s]=r[x+2],h[s]=r[x+3]));else{for(h=new Uint8Array(i),s=0;sw?h[s]=0:(p[s]=r[x],u[s]=r[x+1],d[s]=r[x+2],h[s]=r[x+3]);n.mask=h}}else if(f)if(h!=null)for(s=0;si));const f=[],a=e.outputPixelType||"u8";for(let s=0;s1;){if(l===s.value){m=!0;break}l>s.value?c=d:p=d,d=Math.floor((c+p)/2),s=e[Math.floor(d)]}m||(l===e[c].value?(s=e[c],m=!0):l===e[p].value?(s=e[p],m=!0):le[c].value&&(lM-d);m[0]=h[0],m[m.length-1]=h[h.length-1]+(l?1e-6:0);const x=h.length/2,[w,A]=ht(r);for(let M=0;M=0;T--)if(v===m[2*T]||v>m[2*T]&&vA?A:v=f[b]&&v<=f[b+1]){c[y]=0,u[y]=0;break}}}return new _({width:n,height:o,pixelType:r,pixels:[c],mask:u})}function yt(t,e,n,o){const h=n!=null&&n.length>=2?new Set(n):null,i=(n==null?void 0:n.length)===1?n[0]:null,r=!!(e!=null&&e.length);for(let f=0;f=e[s]&&a<=e[s+1]){l=!0;break}l||(o[f]=0)}o[f]&&(a===i||h!=null&&h.has(a))&&(o[f]=0)}}function kt(t,e){const n=t[0].length;for(let o=0;ox-1e-6);m[0]=n[0],r&&(m[m.length-1]=n[n.length-1]);for(let x=0;xu?u:o[x]d.pixelBlock);if((n==null?void 0:n.pixelBlock)==null)return null;const o=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,h=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,i=.01*Math.min(o,h),r=t.sort((d,m)=>Math.abs(d.extent.ymax-m.extent.ymax)>i?m.extent.ymax-d.extent.ymax:Math.abs(d.extent.xmin-m.extent.xmin)>i?d.extent.xmin-m.extent.xmin:0),f=Math.min.apply(null,r.map(d=>d.extent.xmin)),a=Math.min.apply(null,r.map(d=>d.extent.ymin)),l=Math.max.apply(null,r.map(d=>d.extent.xmax)),s=Math.max.apply(null,r.map(d=>d.extent.ymax)),c={x:Math.round((e.xmin-f)/o),y:Math.round((s-e.ymax)/h)},p={width:Math.round((l-f)/o),height:Math.round((s-a)/h)},u={width:Math.round((e.xmax-e.xmin)/o),height:Math.round((e.ymax-e.ymin)/h)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==r.length||c.x<0||c.y<0||p.widthd.pixelBlock),p,{clipOffset:c,clipSize:u})}}function ft(t,e,n,o,h,i){const{width:r,height:f}=n.block,{x:a,y:l}=n.offset,{width:s,height:c}=n.mosaic,p=zt(r,f,o,h,a,l,s,c);let u=0,d=0;if(i){const m=i.hasGCSSShiftTransform?360:i.halfWorldWidth??0,x=r*i.resolutionX,w=i.startX+o*x;wm?d=i.rightPadding:w>=m&&(u=i.leftMargin-i.rightPadding,d=0)}if(p.xmax-=d,typeof e!="number")for(let m=p.ymin;mL(P));if(f==null)return null;const a=h?h.width:e.width,l=h?h.height:e.height,s=f.width,c=f.height,p=e.width/s,u=e.height/c,d={offset:o||{x:0,y:0},mosaic:h||e,block:{width:s,height:c}},m=f.pixelType,x=_.getPixelArrayConstructor(m),w=f.pixels.length,A=[];let k,M;for(let P=0;PP==null||P.mask!=null&&P.mask.length>0),y=t.some(P=>(P==null?void 0:P.bandMasks)&&P.bandMasks.length>1),v=g?new Uint8Array(a*l):void 0,b=y?[]:void 0;if(v){for(let P=0;Pw!=null);if(o==null)return null;const h=t.some(w=>w==null||!!w.mask),{width:i,height:r}=e,f=h?new Uint8Array(i*r):null,{blockWidths:a}=n,l=[],s=o.getPlaneCount(),c=_.getPixelArrayConstructor(o.pixelType);if(h)for(let w=0,A=0;w(w==null?void 0:w.bandMasks)&&w.bandMasks.length>1),u=p?[]:void 0,d=i*r;for(let w=0;wo||a>h||i===0&&r===0&&f===o&&a===h)return t;t.mask||(t.mask=new Uint8Array(o*h));const l=t.mask;for(let s=0;s=a||p=f?0:1}return t.updateStatistics(),t}function Kt(t){if(!L(t))return null;const e=t.clone(),{width:n,height:o,pixels:h}=t,i=h[0],r=e.pixels[0],f=t.mask;for(let a=2;ae&&(n=i.value,e=o),i=h.next();return n}function rt(t,e,n){if(n===0)return;const o=t.get(e);o===1?t.delete(e):t.set(e,o-1)}function lt(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Yt(t,e,n){let{x:o,y:h}=e;const{width:i,height:r}=n;if(o===0&&h===0&&r===t.height&&i===t.width)return t;const{width:f,height:a}=t,l=Math.max(0,h),s=Math.max(0,o),c=Math.min(o+i,f),p=Math.min(h+r,a);if(c<0||p<0||!L(t))return null;o=Math.max(0,-o),h=Math.max(0,-h);const{pixels:u}=t,d=i*r,m=u.length,x=[];for(let M=0;M{const B=U instanceof Float32Array||U instanceof Float64Array?0:.5;for(let F=0;F0){const[K,it]=j(A,v,e,a),[st,D]=j(x,w,e,a);U.push(K),U.push(it),U.push(H),U.push(et),U.push(st),U.push(D)}else{const[K,it]=j(A,k,e,a),[st,D]=j(M,g,e,a),[N,ct]=j(b,T,e,a);I.push(H),I.push(et),I.push(N),I.push(ct),I.push(st),I.push(D),I.push(K),I.push(it)}v+=i,w+=i,k+=i,g+=i,T+=i}const[C,S]=j(l+m,s+r,e,a),B=(o/2+c)*d,[F,V]=j(l+B,s+r,e,a),[E,q]=j(l+m,s-f,e,a),[R,O]=j(l+B,s-f,e,a);return{pennants:U,barbs:I,shaft:[C,S,F,V,E,q,R,O]}}function j(t,e,n,o=1){const h=Math.sqrt(t*t+e*e)/o,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[h,(2*Math.PI+i-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],ee=[0,.5,1,1.5,2],ne=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,o){const h=mt(o||"knots",n);let i;for(i=1;ig>0).length:p*u,A=new Float32Array(w*a),k=new Uint32Array(l*w),M=e.invertDirection?Ct(0,0,0,!1):Zt;for(let g=0;g=dt){const w=(f[m]+360)%360/180*Math.PI,{pennants:A,barbs:k,shaft:M}=ut[Math.min(Math.floor(x/5),29)];if(A.length+k.length===0)continue;let g=l.length/a;const y=(d+.5)/o,v=(u+.5)/h;for(let b=0;b=($-b)*(P-T)*(1-h)){w[v]=1;const[U,I]=Bt([m[v]/y,x[v]/y]);m[v]=U,x[v]=I}else w[v]=0,m[v]=0,x[v]=0}const k=new _({width:p,height:u,pixels:[m,x],mask:w});return k.updateStatistics(),k}const J=Q.getLogger("esri.views.2d.engine.flow.dataUtils"),oe=10;async function Re(t,e,n,o){const h=performance.now(),i=ae(e,n),r=performance.now(),f=ce(e,i,n.width,n.height),a=performance.now(),l=ue(f,!0),s=performance.now(),c=t==="Streamlines"?pe(l,oe):de(l),p=performance.now();return nt("esri-2d-profiler")&&(J.info("I.1","_createFlowFieldFromData (ms)",Math.round(r-h)),J.info("I.2","_getStreamlines (ms)",Math.round(a-r)),J.info("I.3","createAnimatedLinesData (ms)",Math.round(s-a)),J.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-s)),J.info("I.5","createFlowMesh (ms)",Math.round(p-h)),J.info("I.6","Mesh size (bytes)",c.vertexData.buffer.byteLength+c.indexData.buffer.byteLength)),await Promise.resolve(),Et(o),c}function ae(t,e){const n=fe(e.data,e.width,e.height,t.smoothing);return t.interpolate?(o,h)=>{const i=Math.floor(o),r=Math.floor(h);if(i<0||i>=e.width)return[0,0];if(r<0||r>=e.height)return[0,0];const f=o-i,a=h-r,l=i,s=r,c=i{const i=Math.round(o),r=Math.round(h);return i<0||i>=e.width||r<0||r>=e.height?[0,0]:[n[2*(r*e.width+i)],n[2*(r*e.width+i)+1]]}}function he(t,e,n,o,h,i,r,f,a){const l=[];let s=n,c=o,p=0,[u,d]=e(s,c);u*=t.velocityScale,d*=t.velocityScale;const m=Math.sqrt(u*u+d*d);let x,w;l.push({x:s,y:c,t:p,speed:m});for(let A=0;At.maxTurnAngle)return l;if(t.collisions){const b=Math.round(s*a),T=Math.round(c*a);if(b<0||b>r-1||T<0||T>f-1)return l;const $=i[T*r+b];if($!==-1&&$!==h)return l;i[T*r+b]=h}l.push({x:s,y:c,t:p,speed:g}),x=y,w=v}return l}function ce(t,e,n,o){const h=[],i=new Ut,r=1/Math.max(t.lineCollisionWidth,1),f=Math.round(n*r),a=Math.round(o*r),l=new Int32Array(f*a);for(let c=0;cc.sort-p.sort);for(const{x:c,y:p}of s)if(i.getFloat()=e)continue;const d=i[u+h];c+=d*t[2*(l*e+(s+u))],p+=d*t[2*(l*e+(s+u))+1]}f[2*(l*e+s)]=c,f[2*(l*e+s)+1]=p}const a=new Float32Array(t.length);for(let l=0;l=n)continue;const d=i[u+h];c+=d*f[2*((s+u)*e+l)],p+=d*f[2*((s+u)*e+l)+1]}a[2*(s*e+l)]=c,a[2*(s*e+l)+1]=p}return a}function ue(t,e){const n=new Ut,o=t.reduce((a,l)=>a+l.length,0),h=new Float32Array(4*o),i=new Array(t.length);let r=0,f=0;for(const a of t){const l=r;for(const s of a)h[4*r]=s.x,h[4*r+1]=s.y,h[4*r+2]=s.t,h[4*r+3]=s.speed,r++;i[f++]={startVertex:l,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:e?n.getFloat():0}}return{lineVertices:h,lineDescriptors:i}}function pe(t,e){const{lineVertices:o,lineDescriptors:h}=t;let i=0,r=0;for(const u of h)i+=2*u.numberOfVertices,r+=6*(u.numberOfVertices-1);const f=new Float32Array(i*9),a=new Uint32Array(r);let l=0,s=0;function c(){a[s++]=l-2,a[s++]=l,a[s++]=l-1,a[s++]=l,a[s++]=l+1,a[s++]=l-1}function p(u,d,m,x,w,A,k,M){const g=l*9;let y=0;f[g+y++]=u,f[g+y++]=d,f[g+y++]=1,f[g+y++]=m,f[g+y++]=A,f[g+y++]=k,f[g+y++]=x/2,f[g+y++]=w/2,f[g+y++]=M,l++,f[g+y++]=u,f[g+y++]=d,f[g+y++]=-1,f[g+y++]=m,f[g+y++]=A,f[g+y++]=k,f[g+y++]=-x/2,f[g+y++]=-w/2,f[g+y++]=M,l++}for(const u of h){const{totalTime:d,timeSeed:m}=u;let x=null,w=null,A=null,k=null,M=null,g=null;for(let y=0;y0){P=v-x,U=b-w;const S=Math.sqrt(P*P+U*U);if(P/=S,U/=S,y>1){let B=P+M,F=U+g;const V=Math.sqrt(B*B+F*F);B/=V,F/=V;const E=Math.min(1/(B*P+F*U),e);B*=E,F*=E,I=-F,C=B}else I=-U,C=P;I!==null&&C!==null&&(p(x,w,A,I,C,d,m,$),c())}x=v,w=b,A=T,M=P,g=U,k=$}p(x,w,A,-g,M,d,m,k)}return{vertexData:f,indexData:a}}function de(t){const{lineVertices:h,lineDescriptors:i}=t;let r=0,f=0;for(const S of i){const B=S.numberOfVertices-1;r+=4*B*2,f+=6*B*2}const a=new Float32Array(r*16),l=new Uint32Array(f);let s,c,p,u,d,m,x,w,A,k,M,g,y,v,b=0,T=0;function $(){l[T++]=b-8,l[T++]=b-7,l[T++]=b-6,l[T++]=b-7,l[T++]=b-5,l[T++]=b-6,l[T++]=b-4,l[T++]=b-3,l[T++]=b-2,l[T++]=b-3,l[T++]=b-1,l[T++]=b-2}function P(S,B,F,V,E,q,R,O,X,H,et,K,it,st){const D=b*16;let N=0;for(const ct of[1,2])for(const Ft of[1,2,3,4])a[D+N++]=S,a[D+N++]=B,a[D+N++]=F,a[D+N++]=V,a[D+N++]=R,a[D+N++]=O,a[D+N++]=X,a[D+N++]=H,a[D+N++]=ct,a[D+N++]=Ft,a[D+N++]=it,a[D+N++]=st,a[D+N++]=E/2,a[D+N++]=q/2,a[D+N++]=et/2,a[D+N++]=K/2,b++}function U(S,B){let F=A+M,V=k+g;const E=Math.sqrt(F*F+V*V);F/=E,V/=E;const q=A*F+k*V;F/=q,V/=q;let R=M+y,O=g+v;const X=Math.sqrt(R*R+O*O);R/=X,O/=X;const H=M*R+g*O;R/=H,O/=H,P(s,c,p,u,-V,F,d,m,x,w,-O,R,S,B),$()}function I(S,B,F,V,E,q){if(A=M,k=g,M=y,g=v,A==null&&k==null&&(A=M,k=g),d!=null&&m!=null){y=S-d,v=B-m;const R=Math.sqrt(y*y+v*v);y/=R,v/=R}A!=null&&k!=null&&U(E,q),s=d,c=m,p=x,u=w,d=S,m=B,x=F,w=V}function C(S,B){A=M,k=g,M=y,g=v,A==null&&k==null&&(A=M,k=g),A!=null&&k!=null&&U(S,B)}for(const S of i){s=null,c=null,p=null,u=null,d=null,m=null,x=null,w=null,A=null,k=null,M=null,g=null,y=null,v=null;const{totalTime:B,timeSeed:F}=S;for(let V=0;V=n||(A.data[2*(g*n+k+y)]=M.data[2*(g*M.width+y)],A.data[2*(g*n+k+y)+1]=M.data[2*(g*M.width+y)+1],A.mask[g*n+k+y]=M.mask[g*M.width+y]);k+=M.width}return nt("esri-2d-profiler")&&J.info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-r)),A}async function vt(t,e,n,o,h,i){var l;const r={requestProjectedLocalDirections:!0,signal:i};if(h!=null&&(r.timeExtent=h),t.type==="imagery"){await t.load({signal:i});const s=t.rasterInfo.dataType,c=await t.fetchImage(e,n,o,r);return((l=c==null?void 0:c.pixelData)==null?void 0:l.pixelBlock)==null?{data:new Float32Array(n*o*2),mask:new Uint8Array(n*o),width:n,height:o}:bt(s,c.pixelData.pixelBlock)}await t.load({signal:i});const f=t.rasterInfo.dataType,a=await t.fetchPixels(e,n,o,r);return(a==null?void 0:a.pixelBlock)==null?{data:new Float32Array(n*o*2),mask:new Uint8Array(n*o),width:n,height:o}:bt(f,a.pixelBlock)}export{ve as A,Se as I,$e as M,Ce as R,Le as S,Ie as T,Jt as U,Be as W,re as _,Fe as a,De as b,xe as c,at as d,mt as e,At as f,Ne as g,ht as h,Me as i,be as j,Ae as k,Bt as l,_e as m,ke as n,L as o,Ve as p,wt as q,ye as r,Re as s,xt as t,_ as u,we as v,Te as w,Ue as x,Pe as y,Pt as z};