(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cfae2ce4"],{"0ffd":function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));const n=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),o=(()=>{const e=[].concat(n);return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),i=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],a=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),s=function(e,t){let r=(t||n)[e];return void 0===r&&(r="unknown"+String(e)),r},l=new Map;l.set("EXIFIFD",o),l.set("GPSIFD",i);const c={TIFF_TAGS:n,ifdTags:l,GEO_KEYS:a,getTagName:s}},1451:function(e,t,r){"use strict";r.d(t,"a",(function(){return L})),r.d(t,"b",(function(){return U}));var n=r("ce50"),o=r("3e27"),i=r("f4cc"),a=r("c4c2");class s{constructor(e){e&&(this.canvas=e.canvas,this.ctx=e.ctx||e.canvas&&e.canvas.getContext("2d"))}decode(e,t,r){if(!e||e.byteLength<10)throw new n["a"]("imagecanvasdecoder: decode","required a valid encoded data as input.");let{width:o,height:a,format:l}=t;const{applyJpegMask:c}=t;if(c&&(!o||!a))throw new n["a"]("imagecanvasdecoder: decode","image width and height are needed to apply jpeg mask directly to canvas");return new Promise((n,u)=>{let h=null;"jpg"===l&&c&&(h=s._getMask(e,{width:o,height:a}));const f=new Blob([new Uint8Array(e)],{type:"image/"+l=="jpg"?"jpeg":l}),d=URL.createObjectURL(f),p=new Image;let m;p.src=d,p.onload=()=>{if(URL.revokeObjectURL(d),Object(i["n"])(r))return void u(Object(i["e"])());o=p.width,a=p.height,this.canvas?(this.canvas.width===o&&this.canvas.height===a||(this.canvas.width=o,this.canvas.height=a),this.ctx.clearRect(0,0,o,a)):(this.canvas=document.createElement("canvas"),this.canvas.width=o,this.canvas.height=a,this.ctx=this.canvas.getContext("2d")),this.ctx.drawImage(p,0,0);const e=this.ctx.getImageData(0,0,o,a);let s;if(m=e.data,t.renderOnCanvas){if(h)for(s=0;s{URL.revokeObjectURL(d),u("cannot load image")}})}static _getMask(e,t){let r=null;try{const n=new Uint8Array(e),o=Math.ceil(n.length/2);let i=0;const s=n.length-2;for(i=o;i=0;n--)r[o++]=e[t]>>n&1}}catch(n){}return r}}var l=r("e90e");class c{static decode(e){const t=new Uint8Array(e),r=new l["a"];r.parse(t);const{width:n,height:o,numComponents:i,eof:s}=r,c=r.getData(n,o,!0);let u;const h=n*o;let f=0,d=0,p=0;if(s=0;p--)u[r++]=e[f]>>p&1}let m,g=null;if(1===i)g=[c,c,c];else{for(g=[],f=0;f<3;f++)m=new Uint8Array(h),g.push(m);for(p=0,d=0;d=0;s--)n[o++]=i>>s&1;for(s=7;o>s&1,s--;return n};class m{static decode(e,t){const r=t.pixelType,n=[],o=t.width*t.height,i=f(e,t),{bandIds:a,format:s}=t,l=a&&a.length||f(e,t),c=e.byteLength-e.byteLength%(o*d(r)),u=new r(e,0,o*i);let h,m,g,y,b;if("bip"===s)for(h=0;ht;0<=t?++h:--h)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(t),(c=255-this.transparency.indexed.length)>0)for(f=0;0<=c?fc;0<=c?++f:--f)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":a=(u=this.read(t)).indexOf(0),s=String.fromCharCode.apply(String,u.slice(0,a)),this.text[s]=String.fromCharCode.apply(String,u.slice(a+1));break;case"IEND":return i&&this.animation.frames.push(i),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(d=this.colorType)||6===d,r=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*r,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return l.load=function(e,t,r){var n;return"function"==typeof t&&(r=t),(n=new XMLHttpRequest).open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){var e;return e=new l(new Uint8Array(n.response||n.mozResponseArrayBuffer)),"function"==typeof(null!=t?t.getContext:void 0)&&e.render(t),"function"==typeof r?r(e):void 0},n.send(null)},r=1,n=2,t=0,l.prototype.read=function(e){var t,r;for(r=[],t=0;0<=e?te;0<=e?++t:--t)r.push(this.data[this.pos++]);return r},l.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},l.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},l.prototype.decodePixels=function(e){var t,r,n,o,i,s,l,c,u,h,f,d,p,m,g,y,b,w,x,C,v,k,T;if(null==e&&(e=this.imgData),0===e.length)return new Uint8Array(0);for(e=(e=new a["a"](e)).getBytes(),y=(d=this.pixelBitlength/8)*this.width,p=new Uint8Array(y*this.height),s=e.length,g=0,m=0,r=0;m1&&r/o-1&&(r="error"),r}function D(e){let t=null;switch(e){case"lerc":case"lerc2":t=C;break;case"jpg":t=I;break;case"png":t=M;break;case"bsq":case"bip":t=(t,r)=>A(t,r,e);break;case"tiff":t=v;break;case"deflate":t=S;break;case"lzw":t=O;break;case"error":t=()=>{throw new n["a"]("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new n["a"]("rasterCodec:decode","unsupported raster format")}}return t}function E(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function j(e,t=1){if(!e)return;const{pixels:r,width:n,height:i,mask:a}=e;if(!r||0===r.length)return;const s=r.length,l=n-1,c=i-1,u=[];let h,f,d,p,m,g,y;const b=o["a"].getPixelArrayConstructor(e.pixelType);if(0===t){for(h=0;h0){const[n,o]=v(y,k,t,l),[i,a]=v(m,g,t,l);I.push(n),I.push(o),I.push(e),I.push(r),I.push(i),I.push(a)}else{const[n,o]=v(y,b,t,l),[i,a]=v(w,x,t,l),[s,c]=v(T,S,t,l);M.push(e),M.push(r),M.push(s),M.push(c),M.push(i),M.push(a),M.push(n),M.push(o)}k+=i,g+=i,b+=i,x+=i,S+=i}const[P,R]=v(u+n/2,h+a,t,l),D=n/2+f,[E,j]=v(u+D,h+a,t,l),[U,L]=v(u+n/2,h-s,t,l),[B,G]=v(u+D,h-s,t,l);return{pennants:I,barbs:M,shaft:[P,R,E,j,U,L,B,G]}}function v(e,t,r,n=1){const o=Math.sqrt(e*e+t*t)/n,i=(2*Math.PI+Math.atan2(t,e))%(2*Math.PI);return[o,(2*Math.PI+i-r)%(2*Math.PI)]}const k=[0,1,3,6,10,16,21,27,33,40,47,55,63],T=[0,.5,1,1.5,2],S=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function O(e,t,r,n){const o=h(n||"knots",r);let i;for(i=1;ie>0).length:d*p,x=new Float32Array(b*l),C=new Uint32Array(c*b);for(let u=0;u=c){var g;const r=null!=(g=(s[t]+360)%360/180*Math.PI)?g:2*Math.PI*Math.random(),{pennants:i,barbs:a,shaft:c}=M[Math.min(Math.floor(h/5),29)];if(i.length+a.length===0)continue;let y=f.length/l;const b=(e+.5)/n,w=(u+.5)/o;for(let e=0;e=(v-g)*(k-y)*(1-o)){x[n]=1;const[e,r]=d([b[n]/t,w[n]/t]);b[n]=e,w[n]=r}else x[n]=0,b[n]=0,w[n]=0}const v=new i["a"]({width:m,height:g,pixels:[b,w],mask:x});return v.updateStatistics(),v}},2616:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return x}));r("e06a");var n=r("e92d"),o=r("38a4"),i=r("b2b2"),a=r("f4cc"),s=r("880d"),l=r("7f83"),c=r("3af1");const u=n["a"].getLogger("esri.views.2d.engine.flow.dataUtils"),h=9;async function f(e,t,r){const n=performance.now(),o=d(e,t),i=performance.now(),s=m(e,o,t.width,t.height),l=performance.now(),c=y(s,!0),h=performance.now(),f=b(c),p=performance.now();if(e.profile){const e={"_createFlowFieldFromData()":Math.round(i-n),"_getStreamlines()":Math.round(l-i),"createAnimatedLinesData()":Math.round(h-l),"createLinesMesh()":Math.round(p-h),"Total elapsed time":Math.round(p-n)};u.info("createStreamlinesMesh profile",e)}return await Promise.resolve(),Object(a["v"])(r),f}function d(e,t){const r=g(t.data,t.width,t.height,e.smoothing);return e.interpolate?(e,n)=>{const o=Math.floor(e),i=Math.floor(n);if(o<0||o>=t.width)return[0,0];if(i<0||i>=t.height)return[0,0];const a=e-o,s=n-i,l=o,c=i,u=o{const o=Math.round(e),i=Math.round(n);return o<0||o>=t.width||i<0||i>=t.height?[0,0]:[r[2*(i*t.width+o)+0],r[2*(i*t.width+o)+1]]}}function p(e,t,r,n,o,i,a,s,l){const c=[];let u=r,h=n,f=0,[d,p]=t(u,h);d*=e.velocityScale,p*=e.velocityScale;const m=Math.sqrt(d*d+p*p);let g,y;c.push({x:u,y:h,t:f,speed:m});for(let b=0;be.maxTurnAngle)return c;if(e.mergeLines){const e=Math.round(u*l),t=Math.round(h*l);if(e<0||e>a-1||t<0||t>s-1)return c;const r=i[t*a+e];if(-1!==r&&r!==o)return c;i[t*a+e]=o}c.push({x:u,y:h,t:f,speed:d}),g=p,y=m}return c}function m(e,t,r,n){const o=[],i=new s["a"],a=1/Math.max(e.lineCollisionWidth,1),l=Math.round(r*a),c=Math.round(n*a),u=new Int32Array(l*c);for(let s=0;se.sort-t.sort);for(const{x:s,y:f}of h)if(i.getFloat()=t)continue;const l=i[s+o];n+=l*e[2*(c*t+(r+s))+0],a+=l*e[2*(c*t+(r+s))+1]}s[2*(c*t+r)+0]=n,s[2*(c*t+r)+1]=a}const l=new Float32Array(e.length);for(let c=0;c=r)continue;const u=i[l+o];n+=u*s[2*((e+l)*t+c)+0],a+=u*s[2*((e+l)*t+c)+1]}l[2*(e*t+c)+0]=n,l[2*(e*t+c)+1]=a}return l}function y(e,t){const r=new s["a"],n=e.reduce((e,t)=>e+t.length,0),o=new Float32Array(4*n),i=new Array(e.length);let a=0,l=0;for(const s of e){const e=a;for(const t of s)o[4*a+0]=t.x,o[4*a+1]=t.y,o[4*a+2]=t.t,o[4*a+3]=t.speed,a++;i[l++]={startVertex:e,numberOfVertices:s.length,totalTime:s[s.length-1].t,timeSeed:t?r.getFloat():0}}return{lineVertices:o,lineDescriptors:i}}function b(e,t=10){const{lineVertices:r,lineDescriptors:n}=e;let o=0,i=0;for(const h of n)o+=2*h.numberOfVertices,i+=6*(h.numberOfVertices-1);const a=new Float32Array(o*h),s=new Uint32Array(i);let l=0,c=0;function u(){s[c++]=l-2,s[c++]=l,s[c++]=l-1,s[c++]=l,s[c++]=l+1,s[c++]=l-1}function f(e,t,r,n,o,i,s,c){const u=l*h;let f=0;a[u+f++]=e,a[u+f++]=t,a[u+f++]=1,a[u+f++]=r,a[u+f++]=i,a[u+f++]=s,a[u+f++]=n/2,a[u+f++]=o/2,a[u+f++]=c,l++,a[u+f++]=e,a[u+f++]=t,a[u+f++]=-1,a[u+f++]=r,a[u+f++]=i,a[u+f++]=s,a[u+f++]=-n/2,a[u+f++]=-o/2,a[u+f++]=c,l++}for(const h of n){const{totalTime:e,timeSeed:n}=h;let o=null,i=null,a=null,s=null,l=null,c=null;for(let d=0;d0){b=p-o,w=m-i;const r=Math.sqrt(b*b+w*w);if(b/=r,w/=r,d>1){let e=b+l,r=w+c;const n=Math.sqrt(e*e+r*r);e/=n,r/=n;const o=Math.min(1/(e*b+r*w),t);e*=o,r*=o,x=-r,C=e}else x=-w,C=b;null!==x&&null!==C&&(f(o,i,a,x,C,e,n,y),u())}o=p,i=m,a=g,l=b,c=w,s=y}f(o,i,a,-c,l,e,n,s)}return{vertexData:a,indexData:s}}function w(e,t){const r=t.pixels,{width:n,height:i}=t,a=new Float32Array(n*i*2);if("vector-uv"===e)for(let o=0;o=r||(b.data[2*(e*r+w+t)+0]=l.data[2*(e*l.width+t)+0],b.data[2*(e*r+w+t)+1]=l.data[2*(e*l.width+t)+1]);w+=l.width}return b}async function C(e,t,r,n,o,a){const s={requestProjectedLocalDirections:!0,signal:a};if(Object(i["k"])(o)&&(s.timeExtent=o),"imagery"===e.type){await e.load({signal:a});const o=e.rasterInfo.dataType,l=await e.fetchImage(t,r,n,s);return!l||Object(i["j"])(l.pixelData)||Object(i["j"])(l.pixelData.pixelBlock)?{data:new Float32Array(r*n*2),width:r,height:n}:w(o,l.pixelData.pixelBlock)}await e.load({signal:a});const l=e.rasterInfo.dataType,c=await e.fetchPixels(t,r,n,s);return!c||Object(i["j"])(c.pixelBlock)?{data:new Float32Array(r*n*2),width:r,height:n}:w(l,c.pixelBlock)}},"3e27":function(e,t,r){"use strict";r.d(t,"a",(function(){return m}));var n,o=r("a4ee"),i=(r("c120"),r("ce50")),a=r("6a0ed"),s=r("7ffa"),l=r("e92d"),c=r("b2b2"),u=r("59b2"),h=r("1a3e"),f=r("d386");const d=l["a"].getLogger("esri.layers.support.PixelBlock");let p=n=class extends a["a"]{constructor(e){super(e),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.pixels=null,this.statistics=null}static createEmptyBand(e,t){return new(n.getPixelArrayConstructor(e))(t)}static getPixelArrayConstructor(e){let t;switch(e){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":t=Float32Array;break;case"f64":t=Float64Array}return t}castPixelType(e){if(!e)return"f32";let t=e.toLowerCase();return["u1","u2","u4"].indexOf(t)>-1?t="u8":-1===["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].indexOf(t)&&(t="f32"),t}getPlaneCount(){return this.pixels&&this.pixels.length}addData(e){if(!e.pixels||e.pixels.length!==this.width*this.height)throw new i["a"]("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(e.pixels),this.statistics.push(e.statistics||{minValue:null,maxValue:null})}getAsRGBA(){const e=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(e);break;default:this._fillFrom8Bit(e)}return new Uint8ClampedArray(e)}getAsRGBAFloat(){const e=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(e),e}updateStatistics(){this.statistics=this.pixels.map(e=>this._calculateBandStatistics(e,this.mask));const e=this.mask;let t=0;if(e)for(let r=0;ro?o:ce>=this.pixels.length),o=t===e.length&&!e.some((e,t)=>e!==t);return r||o?this:new n({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:e.map(e=>this.pixels[e]),statistics:this.statistics&&e.map(e=>this.statistics[e])})}clone(){const e=new n({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let t;this.mask&&(this.mask instanceof Uint8Array?e.mask=new Uint8Array(this.mask):e.mask=this.mask.slice(0));const r=n.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){e.pixels=[];const n=this.pixels[0].slice;for(t=0;t=3?(i=n[1],a=n[2]):2===n.length&&(i=n[1]);const l=new Uint32Array(e),c=this.width*this.height;if(o.length===c)if(t&&t.length===c)if(r)for(s=0;s0)a=n.map(e=>e.minValue).reduce((e,t)=>Math.min(e,t)),s=n.map(e=>e.maxValue-e.minValue).reduce((e,t)=>Math.max(e,t)),i=255/s;else{let e=255;"s8"===o?(a=-128,e=127):"u16"===o?e=65535:"s16"===o?(a=-32768,e=32767):"u32"===o?e=4294967295:"s32"===o?(a=-2147483648,e=2147483647):"f32"===o?(a=-34e38,e=34e38):"f64"===o&&(a=-Number.MAX_VALUE,e=Number.MAX_VALUE),i=255/(e-a)}const l=new Uint32Array(e),c=this.width*this.height;let u,h,f,p,m;if(u=h=f=t[0],u.length!==c)return d.error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(t.length>=2)if(h=t[1],t.length>=3&&(f=t[2]),r&&r.length===c)for(p=0;p=3?(o=t[1],i=t[2]):2===t.length&&(o=t[1]);const s=this.width*this.height;if(n.length!==s)return d.error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(r&&r.length===s)for(a=0;an?a:n);else for(i=0;in?a:n;return{minValue:r,maxValue:n}}};Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"width",void 0),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"height",void 0),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"pixelType",void 0),Object(o["a"])([Object(h["a"])("pixelType")],p.prototype,"castPixelType",null),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"validPixelCount",void 0),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"mask",void 0),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"maskIsAlpha",void 0),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"pixels",void 0),Object(o["a"])([Object(u["b"])({json:{write:!0}})],p.prototype,"statistics",void 0),p=n=Object(o["a"])([Object(f["a"])("esri.layers.support.PixelBlock")],p);const m=p},"53d3":function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r("a4ee"),o=r("6a0ed"),i=r("59b2"),a=(r("b50f"),r("c120"),r("cea0"),r("d386")),s=r("4ae5");let l=class extends o["a"]{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.blockBoundary=null}};Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"blockWidth",void 0),Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"blockHeight",void 0),Object(n["a"])([Object(i["b"])({type:String,json:{write:!0}})],l.prototype,"compression",void 0),Object(n["a"])([Object(i["b"])({type:s["a"],json:{write:!0}})],l.prototype,"origin",void 0),Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"firstPyramidLevel",void 0),Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"maximumPyramidLevel",void 0),Object(n["a"])([Object(i["b"])({json:{write:!0}})],l.prototype,"pyramidResolutions",void 0),Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"pyramidScalingFactor",void 0),Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"pyramidBlockWidth",void 0),Object(n["a"])([Object(i["b"])({type:Number,json:{write:!0}})],l.prototype,"pyramidBlockHeight",void 0),Object(n["a"])([Object(i["b"])({type:Boolean,json:{write:!0}})],l.prototype,"isVirtualTileInfo",void 0),Object(n["a"])([Object(i["b"])({json:{write:!0}})],l.prototype,"tileInfo",void 0),Object(n["a"])([Object(i["b"])()],l.prototype,"blockBoundary",void 0),l=Object(n["a"])([Object(a["a"])("esri.layers.support.RasterStorageInfo")],l);const c=l},"6d3d":function(e,t,r){"use strict";r.d(t,"a",(function(){return G})),r.d(t,"b",(function(){return B})),r.d(t,"c",(function(){return I})),r.d(t,"d",(function(){return M})),r.d(t,"e",(function(){return A})),r.d(t,"f",(function(){return U})),r.d(t,"g",(function(){return j}));var n=r("742a"),o=r("e90e"),i=r("7754"),a=r("adb6"),s=r("0ffd"),l=r("e55a"),c=r("c4c2");const u=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],h=4294967296,f=new Set([1,5,6,7,8,34712,34887]);function d(e,t){let r="unknown";return 3===e?r="f32":1===e?1===t?r="u1":2===t?r="u2":4===t?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):2===e&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function p(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;default:t=Float32Array}return t}function m(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function g(e,t){var r;return null==(r=e.get(t))?void 0:r.values}function y(e,t){var r;return null==(r=e.get(t))?void 0:r.values}function b(e,t){var r;return null==(r=e.get(t))?void 0:r.values[0]}function w(e,t){var r;return null==(r=e.get(t))?void 0:r.values[0]}function x(e,t,r,n=0,o=s["a"].TIFF_TAGS,i=4){const a=8===i,l=a?R(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),c=4+2*i,u=a?8:2,h=u+l*c;if(r+h>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:h};const f=r+h+4<=e.byteLength?E(new DataView(e,r+h,8===i?8:4),0,t,8===i):null,d=r+u,p=new Map;let m,g,y,b,w,x,C;for(let v=0;v1){const n=Math.round(o.length/f);for(C=0;Ch?h-T*v:v,"u8"===f||"s8"===f||i){if(8===k||32946===k)R=new Uint8Array(e,s[T],C[T]),j=new c["a"](R),U=j.getBytes(),P=new ArrayBuffer(U.length),R=new Uint8Array(P),R.set(U),R.length!==L*u*d*g/8&&console.log("strip byte counts is different than expected");else if(6===k){R=new Uint8Array(e,s[T],C[T]);const t=new o["a"];t.parse(R);const r=t.getData(t.width,t.height,!0);P=new ArrayBuffer(r.length),R=new Uint8Array(P),R.set(r)}else 5===k?(R=Object(a["a"])(e,s[T],C[T],t.littleEndian),P=R.buffer):1===k&&(C[T]!==L*u*d*g/8&&console.log("strip byte counts is different than expected"),P=e.slice(s[T],s[T]+C[T]));A=new b(P)}else{switch(6===k||8===k||32946===k?(R=new Uint8Array(e,s[T],C[T]),j=new c["a"](R),R=j.getBytes(),P=new ArrayBuffer(R.length),D=new Uint8Array(P),R.length!==L*u*d*g/8&&console.log("strip byte counts is different than expected")):1===k&&(C[T]!==L*u*d*g/8&&console.log("strip byte counts is different than expected"),P=new ArrayBuffer(C[T]),R=new Uint8Array(e,s[T],C[T]),D=new Uint8Array(P)),f){case"u16":case"s16":for(O=0;O0&&t&&r))return null;let n,o,i;const a=e[0].length,s=e.length,l=new Uint8Array(a);for(let c=0;ci?0:1;else for(let e=0;ei?0:1);return l},O=function(e){if(!e)return null;const t=e.match(//gi);if(!t||0===t.length)return null;const r=new Map;let n,o,i,a,s;for(let y=0;y")),a=n.indexOf("sample="),a>-1&&(s=n.slice(a+'sample="'.length,n.indexOf('"',a+'sample="'.length))),a=n.indexOf("name="),a>-1&&(o=n.slice(a+'name="'.length,n.indexOf('"',a+'name="'.length))),o&&(i=n.slice(n.indexOf(">")+1,n.indexOf("")).trim(),null!=s?r.has(o)?r.get(o)[s]=i:r.set(o,[i]):r.set(o,i)),s=null;const l=r.get("STATISTICS_MINIMUM"),c=r.get("STATISTICS_MAXIMUM"),u=r.get("STATISTICS_MEAN"),h=r.get("STATISTICS_STDDEV");let f=null;if(l&&c){f=[];for(let e=0;eb&&p>(o?e.byteLength:e?e.byteLength-l+n:0))return r.offlineOffsetSize=[l,p],r.values=null,!1;if(m<=b){if(!t)if(b<=32)l>>>=32-m;else{const e=null!=w&&w.length?w[0]:l>>>0,t=null!=w&&w.length?w[1]:Math.round((l-e)/h);m<=32?(l=e>>>32-m,w[0]=l):(l=e*2**(32-m)+(t>>>32-m),w[0]=e,w[1]=t>>>32-m)}if(1===s&&d===b)c=[l];else if(64===b){const e=null!=w&&w.length?w[0]:l>>>0,t=null!=w&&w.length?w[1]:Math.round((l-e)/h);let r=e,n=32;for(y=1;y<=s;y++){const e=32-d*y%32;if(n>>32-n,i=t<<32-n>>>32-n;r=t,c.push(o+i*2**(d-n)),n-=32-(d-n)}else c.push(r<>>32-d),n-=d;0===n&&(n=32,r=t)}}else for(y=1;y<=s;y++){const e=32-d*y;c.push(l<>>32-d)}}else{l-=n,o&&(l=0);for(let r=l;rparseFloat(e)),C.some(e=>isNaN(e))&&(C=null));const v=null!=(r=w(n,"COMPRESSION"))?r:1;let k;switch(v){case 1:k="NONE";break;case 2:case 3:case 4:case 32771:k="CCITT";break;case 5:k="LZW";break;case 6:case 7:k="JPEG";break;case 32773:k="PACKBITS";break;case 8:case 32946:k="DEFLATE";break;case 34712:k="JPEG2000";break;case 34887:k="LERC";break;default:k=String(v)}let T=!0,S="";f.has(v)||(T=!1,S+="unsupported tag compression "+v),u>3&&(T=!1,S+="unsupported tag sampleFormat "+u),l%8!=0&&(T=!1,S+="unsupported tag bitsPerSample "+l);const A=b(n,"GEOASCIIPARAMS");let I;if(A){const e=A.split("|").find(e=>e.indexOf("ESRI PE String = ")>-1),t=e?e.replace("ESRI PE String = ",""):"";I=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const P=y(n,"GEOTIEPOINTS"),R=y(n,"GEOPIXELSCALE"),D=y(n,"GEOTRANSMATRIX"),E=n.has("GEOKEYDIRECTORY")?n.get("GEOKEYDIRECTORY").data:null;let j,U,B=!1;if(E){B=2===w(E,"GTRasterTypeGeoKey");const e=w(E,"GTModelTypeGeoKey");if(2===e){const e=w(E,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(I={wkid:e})}else if(1===e){const e=w(E,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(I={wkid:e})}}if(R&&P&&P.length>=6?(j=[R[0],0,P[3]-P[0]*R[0],0,-Math.abs(R[1]),P[4]-P[1]*R[1]],B&&(j[2]-=.5*j[0]+.5*j[1],j[5]-=.5*j[3]+.5*j[4])):D&&16===D.length&&(j=B?[D[0],D[1],D[3]-.5*D[0],D[4],D[5],D[7]-.5*D[5]]:[D[0],D[1],D[3],D[4],D[5],D[7]]),j){const e=[{x:0,y:s},{x:0,y:0},{x:a,y:s},{x:a,y:0}];let t,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let a=0;ar?r:t.x,o=t.xn?n:t.y,i=t.y1===b(e,"NEWSUBFILETYPE"));let _,N,F,V,z;if(G.length>0){_=Math.round(Math.log(a/w(G[0],"IMAGEWIDTH"))/Math.LN2);const e=G[G.length-1];N=Math.round(Math.log(a/w(e,"IMAGEWIDTH"))/Math.LN2),F=w(e,"TILEWIDTH"),V=w(e,"TILELENGTH")}F=N>0?F||o:null,V=N>0?V||i:null,o&&(z=[{maxCol:Math.ceil(a/o)-1,maxRow:Math.ceil(s/i)-1,minRow:0,minCol:0}],G.forEach(e=>{z.push({maxCol:Math.ceil(w(e,"IMAGEWIDTH")/w(e,"TILEWIDTH"))-1,maxRow:Math.ceil(w(e,"IMAGELENGTH")/w(e,"TILELENGTH"))-1,minRow:0,minCol:0})}));const W=b(e[0],"GDAL_METADATA"),H=O(W);return S+=" "+L({width:a,height:s,tileWidth:o,tileHeight:i,planes:c,ifds:e}),{width:a,height:s,tileWidth:o,tileHeight:i,planes:c,isBSQ:p,pixelType:h,compression:k,noData:C,isSupported:T,message:S,extent:U,affine:R?null:j,firstPyramidLevel:_,maximumPyramidLevel:N,pyramidBlockWidth:F,pyramidBlockHeight:V,tileBoundary:z,metadata:H}}function M(e,t){const r=g(e,"PLANARCONFIGURATION");return r?2===r[0]:!!t&&t.isBSQ}function P(e){const{littleEndian:t,isBigTiff:r,firstIFD:n}=j(e);let o=n;const i=[];do{const n=U(e,t,o,0,s["a"].TIFF_TAGS,r?8:4);if(!n.success)break;i.push(n.ifd),o=n.nextIFD}while(o>0);return{...I(i),littleEndian:t,isBigTiff:r,ifds:i}}function R(e,t,r){const n=e.getUint32(t,r),o=e.getUint32(t+4,r);return r?o*h+n:n*h+o}function D(e,t,r){let n=r?e.getInt32(t,r):e.getUint32(t,r),o=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const i=(r?n:o)>=0?1:-1;return r?n*=i:o*=i,i*(r?o*h+n:n*h+o)}function E(e,t,r,n){return n?R(e,t,r):e.getUint32(t,r)}function j(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let n=null;if(18761===r)n=!0;else{if(19789!==r)throw"unexpected endianess byte";n=!1}const o=t.getUint16(2,n);if(42!==o&&43!==o)throw"unexpected tiff identifier";let i=4;const a=43===o;if(a){const e=t.getUint16(i,n);if(i+=2,8!==e)throw"unsupported bigtiff version";if(0!==t.getUint16(i,n))throw"unsupported bigtiff version";i+=2}return{littleEndian:n,isBigTiff:a,firstIFD:E(t,i,n,a)}}function U(e,t,r,o=0,i=s["a"].TIFF_TAGS,a=4){const l=x(e,t,r,o,i,a);let c;const u=l.ifd;if(u){if(s["a"].ifdTags.forEach((r,n)=>{u.has(n)&&(c=u.get(n),c.data=x(e,t,c.valueOffset-o,o,r).ifd)}),u.has("GEOKEYDIRECTORY")){c=u.get("GEOKEYDIRECTORY");const r=c.values;if(r&&r.length>4){const n=r[0]+"."+r[1]+"."+r[2];c.data=x(e,t,c.valueOffset+6-o,o,s["a"].GEO_KEYS,2).ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(u.has("XMP")){c=u.get("XMP");const e=c.values;"number"==typeof e[0]&&7===c.type&&(c.values=[Object(n["a"])(new Uint8Array(e))])}}return l}function L(e){const{width:t,height:r,tileHeight:n,tileWidth:o}=e,i=e.planes,a=o?o*n:t*r,s=w(e.ifds[0],"BITSPERSAMPLE");let l="";return a*i>2**30/(s>8?s/8:1)&&(l=o?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),l}async function B(e,t){var r;const{headerInfo:n,ifd:o,offsets:i,sizes:a}=t,s=[];for(let p=0;pe.min):null,A=T?T.map(e=>e.max):null;let I,P;if(null!=k)if(I=new Uint8Array(g),Math.abs(k)>1e24)for(P=0;P1e24)for(a=0;a.001&&(f/=111e3,d/=111e3),"adjusted"===a)if(s){const e=111e3*u,t=111e3*h;f=(c+e**o*i)/(8*e),d=(c+t**o*i)/(8*t)}else f=(c+u**o*i)/(8*u),d=(c+h**o*i)/(8*h);let p=(90-t)*Math.PI/180,m=Math.cos(p),g=(360-r+90)*Math.PI/180,y=Math.sin(p)*Math.cos(g),b=Math.sin(p)*Math.sin(g);const w=[315,270,225,360,180,0],x=[60,60,60,60,60,90],C=new Float32Array([3,5,3,2,1,4]),v=C.reduce((e,t)=>e+t),k=C.map(e=>e/v),T="multi-directional"===n?w.length:1,S=new Float32Array(6),O=new Float32Array(6),A=new Float32Array(6);if("multi-directional"===n)for(let I=0;Im?m:e],i=a[h],s=i*n,g=s*(1-Math.abs(t%2-1)),y=i-s;switch(Math.floor(t)){case 0:f[h]=s+y,d[h]=g+y,p[h]=y;break;case 1:f[h]=g+y,d[h]=s+y,p[h]=y;break;case 2:f[h]=y,d[h]=s+y,p[h]=g+y;break;case 3:f[h]=y,d[h]=g+y,p[h]=s+y;break;case 4:f[h]=g+y,d[h]=y,p[h]=s+y;break;case 5:case 6:f[h]=s+y,d[h]=y,p[h]=g+y}}e.pixels=[f,d,p],e.updateStatistics()}var g=r("7c6e");const y=a["a"].getLogger("esri.renderers.support.RasterSymbolizer");function b(e,t){const{attributeTable:r,bandCount:n}=e;return!(!Object(s["k"])(r)||n>1)&&(!t||null!=r.fields.find(e=>e.name.toLowerCase()===t.toLowerCase()))}function w(e){return"elevation"===e.dataType}function x(e){const{bandCount:t,colormap:r}=e;return Object(s["k"])(r)&&r.length&&1===t}const C={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:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]};let v=class extends i["a"]{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!k(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=Object(h["h"])(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const{extent:n}=e,o=n.spatialReference.isGeographic,i={x:(n.xmax-n.xmin)/t.width,y:(n.ymax-n.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:o,resolution:i});break}}return r}catch(r){return y.error("symbolize",r.message),t}}simpleStretch(e,t){if(!k(e))return e;try{return e.pixels.length>3&&(e=Object(h["h"])(e,[0,1,2])),Object(h["q"])(e,t)}catch(r){return y.error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].indexOf(this.rendererJSON.type)>-1){var t;const{indexedColormap:e,offset:r}=(null==(t=this.lookup)?void 0:t.colormapLut)||{};return{colormap:e,colormapOffset:r,type:"lut"}}const{pixelBlock:r,isGCS:n,resolution:o,bandIds:i}=e,{rendererJSON:a}=this;return"rasterStretch"===a.type?this._generateStretchWebGLParams(r,a,i):"rasterShadedRelief"===a.type?this._generateShadedReliefWebGLParams(a,n,o):"vectorField"===a.type?this._generateVectorFieldWebGLParams(a):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:Object(h["b"])(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const t=this.rasterInfo.pixelType,r=["u8","u16","s8","s16"].indexOf(t)>-1;return this._isLUTChanged()&&!this.bind().success?e:r?Object(h["b"])(e,this.lookup.colormapLut):Object(h["n"])(e,this.lookup.remapLut)}_symbolizeStretch(e,t){const{pixelType:r,bandCount:n}=this.rasterInfo,o=this.rendererJSON,i=["u8","u16","s8","s16"].indexOf(r)>-1;let a,l;const{dra:c}=o,u=o.useGamma?o.gamma:null;if("histogramEqualization"===o.stretchType){const r=c?null:this.lookup.histogramLut,n=this._getStretchCutoff(o,e,t,!r),i=Object(h["q"])(e,{...n,gamma:u});l=Object(h["k"])(i,{lut:c?n.histogramLut:r,offset:0})}else if(i){var f,d;if(c){const n=this._getStretchCutoff(o,e,t);a=Object(h["e"])({pixelType:r,...n,gamma:u})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;n>1&&(null==t?void 0:t.length)===(null==(f=Object(s["t"])(e))?void 0:f.pixels.length)&&(null==(d=a)?void 0:d.lut.length)===n&&(a={lut:t.map(e=>a.lut[e]),offset:a.offset}),l=Object(h["k"])(e,a)}else{const r=this._getStretchCutoff(o,e,t);l=Object(h["q"])(e,{...r,gamma:u})}if(o.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;l=Object(h["b"])(l,this.lookup.colormapLut)}return l}_symbolizeShadedRelief(e,t){var r,n;const o=this.rendererJSON,i={...o,...t},a=p(e,i);if(!o.colorRamp)return a;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return a;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return a;const c=null!=(r=null==(n=Object(s["t"])(this.rasterInfo.statistics))?void 0:n[0])?r:{min:0,max:8e3};return m(a,e,l,c),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:n}=this.rasterInfo,o=e.field1;if(!o)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const i=e.defaultSymbol,a=1===t&&["u8","s8"].includes(n);if(!b(this.rasterInfo,o)&&!a)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const s=[];if(r){const t=r.fields.find(e=>"value"===e.name.toLowerCase());if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(r=>{var n;const a=e.uniqueValueInfos.find(e=>String(e.value)===String(r.attributes[o])),l=null==a||null==(n=a.symbol)?void 0:n.color;l?s.push([r.attributes[t.name]].concat(l)):i&&s.push([r.attributes[t.name]].concat(i.color))})}else{if("value"!==o.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos.forEach(e=>{var t;const r=null==e||null==(t=e.symbol)?void 0:t.color;r?s.push([parseInt(""+e.value,10)].concat(r)):i&&s.push([parseInt(""+e.value,10)].concat(i.color))})}if(0===s.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=Object(h["c"])({colormap:s});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!x(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(e=>[e.value].concat(e.color)).sort((e,t)=>e[0]-t[0]);if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Object(h["c"])({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!w(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation".`};if(e.colorRamp){const t=Object(g["b"])(e.colorRamp,256,!0),r=Object(h["c"])({colormap:t}),n=[],i=r.indexedColormap;for(let e=0;e-1,n=e.classBreakInfos;if(null==n||!n.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const o=n.sort((e,t)=>e.classMaxValue-t.classMaxValue),i=o[o.length-1];let a=e.minValue;if(!r){const t=[];for(let e=0;e0&&null!=e[0].min&&null!=e[0].max}_updateStretchRenderer(e){var t;let{stretchType:r,dra:n}=e;if(!("none"===r||null!=(t=e.statistics)&&t.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||n))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const o=Object(s["t"])(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||null!=o&&o.length||n||(r="minMax");const{gamma:i,useGamma:a,colorRamp:l}=e,c=this.rasterInfo.pixelType,u=!n&&["u8","u16","s8","s16"].indexOf(c)>-1;if("histogramEqualization"===r){const t=o.map(e=>Object(h["d"])(e));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=this._getStretchCutoff(e),r=Object(h["e"])({pixelType:c,...t,gamma:a?i:null});this.lookup={rendererJSON:e,stretchLut:r}}if(l){const t=Object(g["b"])(l,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Object(h["c"])({colormap:t}),this.lookup.rendererJSON=e}return this.canRenderInWebGL=!0,{success:!0}}_getStretchCutoff(e,t=null,r,n){var o,i,a;let l,c,u=e.stretchType;var f;if(e.dra)if("minMax"===u&&Object(s["k"])(t)&&t.statistics)l=t.statistics.map(e=>[e.minValue,e.maxValue,0,0]);else{const e=Object(h["g"])(t);l=Object(s["k"])(e)?e.statistics:null,c=Object(s["k"])(e)?e.histograms:null}else l=(null==(f=e.statistics)?void 0:f.length)>0?e.statistics:Object(s["t"])(this.rasterInfo.statistics),c=e.histograms||Object(s["t"])(this.rasterInfo.histograms);!this._isHistogramRequired(u)||null!=(o=c)&&o.length||(u="minMax");const d=(null==(i=l)?void 0:i.length)||(null==(a=c)?void 0:a.length)||this.rasterInfo.bandCount,p=[],m=[];let g,y,b,w,x,v,k,T,S,O,A,I;switch(l&&!Array.isArray(l[0])&&(l=l.map(e=>[e.min,e.max,e.avg,e.stddev])),u){case"none":{const e=C[this.rasterInfo.pixelType]||C.f32;for(T=0;Tl[T][1]&&(m[T]=l[T][1]);break;case"histogramEqualization":for(T=0;T=20&&(w[0]=w[1]=w[2]=w[w.length-1]=w[w.length-2]=0),b=0,y=(g.max-g.min)/g.size,k=-.5===g.min&&1===y?.5:0,S=0;Sv){p[T]=g.min+y*(S+k);break}for(v=(1-(e.maxPercent||0)/100)*b,S=g.size-2;S>=0;S--)if(x[S]Object(h["d"])(e)))):(A=e.max||255,O=e.min||0);const M={minCutOff:p,maxCutOff:m,outMax:A,outMin:O,histogramLut:I};return this._getSelectedBandCutoffs(M,r)}_getSelectedBandCutoffs(e,t){if(null==t||0===t.length)return e;const r=Math.max.apply(null,t),{minCutOff:n,maxCutOff:o,outMin:i,outMax:a,histogramLut:s}=e;return n.length===t.length||n.length<=r?e:{minCutOff:t.map(e=>n[e]),maxCutOff:t.map(e=>o[e]),histogramLut:s?t.map(e=>s[e]):null,outMin:i,outMax:a}}_generateStretchWebGLParams(e,t,r){let n=null,o=null;const i=this.lookup&&this.lookup.colormapLut;t.colorRamp&&i&&(n=i.indexedColormap,o=i.offset),"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:a}=t,l=!!(t.useGamma&&a&&a.some(e=>1!==e)),{minCutOff:c,maxCutOff:u,outMin:h,outMax:f}=this._getStretchCutoff(t,e,r);let d=0;Object(s["k"])(e)&&(d=e.getPlaneCount(),2===d&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const p=Math.min(3,(null==r?void 0:r.length)||d||this.rasterInfo.bandCount),m=new Float32Array(p),g=n||l?1:255;let y;for(y=0;y1?a[y]>2?b[y]=6.5+(a[y]-2)**2.5:b[y]=6.5+100*(2-a[y])**4:b[y]=1;return{bandCount:p,outMin:h/g,outMax:f/g,minCutOff:c,maxCutOff:u,factor:m,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?b:[1,1,1],colormap:n,colormapOffset:o,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t,r){var n,o,i;let a=null,l=null;const c=this.lookup&&this.lookup.colormapLut;e.colorRamp&&c&&(a=c.indexedColormap,l=c.offset);const u={...e,isGCS:t,resolution:r},h=d(u),f=null==(n=Object(s["t"])(this.rasterInfo.statistics))?void 0:n[0];return{...h,minValue:null!=(o=null==f?void 0:f.min)?o:0,maxValue:null!=(i=null==f?void 0:f.max)?i:8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:a,colormapOffset:l}}_generateVectorFieldWebGLParams(e){var t,r,n,o,i,a,l,c;const{style:u,inputUnit:h,outputUnit:f,visualVariables:d,symbolTileSize:p,flowRepresentation:m}=e;let g;const y=null!=(t=null==(r=this.rasterInfo.statistics)?void 0:r[0].min)?t:0,b=null!=(n=null==(o=this.rasterInfo.statistics)?void 0:o[0].max)?n:50,w=null!=(i=null==d?void 0:d.find(e=>"sizeInfo"===e.type))?i:{type:"sizeInfo",field:"Magnitude",maxDataValue:b,maxSize:.8*p,minDataValue:y,minSize:.2*p},x=null!=(a=w.minDataValue)?a:y,C=null!=(l=w.maxDataValue)?l:b,v=Object(s["k"])(w.maxSize)&&Object(s["k"])(w.minSize)?[w.minSize/p,w.maxSize/p]:[.2,.8];if("wind_speed"===u){const e=(v[0]+v[1])/2;v[0]=v[1]=e}const k=Object(s["k"])(x)&&Object(s["k"])(C)?[x,C]:null;if("classified_arrow"===u)if(Object(s["k"])(x)&&Object(s["k"])(C)&&Object(s["k"])(w)){g=[];const e=(w.maxDataValue-w.minDataValue)/5;for(let t=0;t<6;t++)g.push(w.minDataValue+e*t)}else g=[0,1e-6,3.5,7,10.5,14];const T="flow_to"===m===("ocean_current_kn"===u||"ocean_current_m"===u)?0:Math.PI,S=null==d?void 0:d.find(e=>"rotationInfo"===e.type);return{breakValues:g,dataRange:k,inputUnit:h,outputUnit:f,symbolTileSize:p,symbolPercentRange:v,style:u||"single_arrow",rotation:T,rotationType:(null==(c=this.rasterInfo.storageInfo)?void 0:c.tileInfo)&&"vector-uv"===this.rasterInfo.dataType?"geographic":(null==S?void 0:S.rotationType)||e.rotationType,type:"vectorField"}}};function k(e){return Object(h["j"])(e)&&0!==e.validPixelCount}Object(n["a"])([Object(l["b"])({json:{write:!0}})],v.prototype,"rendererJSON",void 0),Object(n["a"])([Object(l["b"])({type:u["a"],json:{write:!0}})],v.prototype,"rasterInfo",void 0),Object(n["a"])([Object(l["b"])({json:{write:!0}})],v.prototype,"lookup",void 0),Object(n["a"])([Object(l["b"])()],v.prototype,"canRenderInWebGL",void 0),v=Object(n["a"])([Object(c["a"])("esri.renderers.support.RasterSymbolizer")],v);const T=v},"742a":function(e,t,r){"use strict";function n(e,t){let r=0,n="",o=0,i=0;const a=e.length;for(;r>4,o<8?o=1:15===o?(o=4,i=(7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):14===o?(o=3,i=(15&i)<<12|(63&e[r++])<<6|63&e[r++]):(o=2,i=(31&i)<<6|63&e[r++]),(0!==i||t)&&(n+=String.fromCharCode(i));return n}r.d(t,"a",(function(){return n}))},7754:function(e,t,r){"use strict";r.d(t,"a",(function(){return f})),r.d(t,"b",(function(){return s}));var n=r("b2cd");const o=[{pixelType:"S8",size:1,ctor:Int8Array,range:[-128,128]},{pixelType:"U8",size:1,ctor:Uint8Array,range:[0,255]},{pixelType:"S16",size:2,ctor:Int16Array,range:[-32768,32767]},{pixelType:"U16",size:2,ctor:Uint16Array,range:[0,65536]},{pixelType:"S32",size:4,ctor:Int32Array,range:[-2147483648,2147483647]},{pixelType:"U32",size:4,ctor:Uint32Array,range:[0,4294967296]},{pixelType:"F32",size:4,ctor:Float32Array,range:[-34027999387901484e22,34027999387901484e22]},{pixelType:"F64",size:8,ctor:Float64Array,range:[-17976931348623157e292,17976931348623157e292]}];let i=null,a=!1;function s(){return i||(i=r.e("chunk-0744fcd6").then(r.bind(null,"5494")).then(e=>e.l).then(({default:e})=>e({locateFile:e=>Object(n["b"])("esri/layers/support/rasterFormats/"+e)})).then(e=>{u(e),a=!0}),i)}const l={getBlobInfo:null,decode:null};function c(e){return 16+(e>>3<<3)}function u(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:n,_lerc_getDataRanges:i,_lerc_decode_4D:a,asm:s}=e;let u;const h=Object.values(s).find(t=>t&&"buffer"in t&&t.buffer===e.HEAPU8.buffer),f=e=>{const r=e.map(e=>c(e)),n=r.reduce((e,t)=>e+t),o=t(n);u=new Uint8Array(h.buffer);let i=r[0];r[0]=o;for(let t=1;t{const t=12,o=3,a=new Uint8Array(4*t),s=new Uint8Array(8*o),[l,c,d]=f([e.length,a.length,s.length]);u.set(e,l),u.set(a,c),u.set(s,d);let p=n(l,e.length,c,d,t,o);if(p)throw r(l),"lerc-getBlobInfo: error code is "+p;u=new Uint8Array(h.buffer),a.set(u.slice(c,c+a.length)),s.set(u.slice(d,d+s.length));const m=new Uint32Array(a.buffer),g=new Float64Array(s.buffer),[y,b,w,x,C,v,k,T,S,,O]=m,A={version:y,dimCount:w,width:x,height:C,validPixelCount:k,bandCount:v,blobSize:T,maskCount:S,dataType:b,minValue:g[0],maxValue:g[1],maxZerror:g[2],statistics:[],bandCountWithNoData:O};if(O)return A;if(1===w&&1===v)return r(l),A.statistics.push({minValue:g[0],maxValue:g[1]}),A;const I=w*v*8,M=new Uint8Array(I),P=new Uint8Array(I);let R,D=l,E=0,j=!1;if(u.byteLength1){const e=U.slice(r*w,(r+1)*w),t=L.slice(r*w,(r+1)*w),n=Math.min.apply(null,e),o=Math.max.apply(null,t);B.push({minValue:n,maxValue:o,dimStats:{minValues:e,maxValues:t}})}else B.push({minValue:U[r],maxValue:L[r]});return r(D),j||r(E),A},l.decode=(e,t)=>{const{maskCount:n,dimCount:i,bandCount:s,width:l,height:c,dataType:d,bandCountWithNoData:p}=t,m=o[d],g=l*c,y=new Uint8Array(g*s),b=g*i*s*m.size,w=new Uint8Array(b),x=new Uint8Array(s),C=8*s,v=new Uint8Array(C),[k,T,S,O,A]=f([e.length,y.length,w.length,x.length,v.length]);u.set(e,k),u.set(y,T),u.set(w,S),u.set(x,O),u.set(v,A);const I=a(k,e.length,n,T,i,l,c,s,d,S,O,A);if(I)throw r(k),"lerc-decode: error code is "+I;u=new Uint8Array(h.buffer),w.set(u.slice(S,S+b)),y.set(u.slice(T,T+g));let M=null;if(p){x.set(u.slice(O,O+s)),v.set(u.slice(A,A+C)),M=[];for(let e=0;e1){T.set(C[0]);for(let e=1;e=S;if(g>0&&O){const{noDataValue:e}=t;for(let t=0;t1?C:null;return{width:u,height:f,bandCount:d,pixelType:t.pixelType&&0===a.version?t.pixelType:b.pixelType,dimCount:p,statistics:y,pixels:x,mask:T,bandMasks:A}}},"7c6e":function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return h})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return f})),r.d(t,"e",(function(){return m}));var n=r("9ef0"),o=r("d329");const i=[{id:"aspect_predefined",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"blackToWhite_predefined",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blueBright_predefined",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blueLightToDark_predefined",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blueGreenBright_predefined",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blueGreenLightToDark_predefined",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brownLightToDark_predefined",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brownToBlueGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brownToBlueGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficientBias_predefined",fromColor:[214,214,255],toColor:[0,57,148]},{id:"coldToHotDiverging_predefined",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"conditionNumber_predefined",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyanToPurple_predefined",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyanLightToBlueDark_predefined",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance_predefined",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1_predefined",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2_predefined",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors_predefined",fromColor:[255,235,214],toColor:[196,10,10]},{id:"grayLightToDark_predefined",fromColor:[219,219,219],toColor:[69,69,69]},{id:"greenBright_predefined",fromColor:[204,255,204],toColor:[14,204,14]},{id:"greenLightToDark_predefined",fromColor:[220,245,233],toColor:[34,102,51]},{id:"greenToBlue_predefined",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orangeBright_predefined",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orangeLightToDark_predefined",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partialSpectrum_predefined",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partialSpectrum1Diverging_predefined",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partialSpectrum2Diverging_predefined",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pinkToYellowGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pinkToYellowGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation_predefined",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction_predefined",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purpleBright_predefined",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purpleToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purpleToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purpleBlueBright_predefined",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purpleBlueLightToDark_predefined",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purpleRedBright_predefined",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purpleRedLightToDark_predefined",fromColor:[250,215,246],toColor:[143,17,57]},{id:"redBright_predefined",fromColor:[255,204,204],toColor:[219,0,0]},{id:"redLightToDark_predefined",fromColor:[255,224,224],toColor:[143,10,10]},{id:"redToBlueDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"redToBlueDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"redToGreen_predefined",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"redToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"redToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope_predefined",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrumFullBright_predefined",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrumFullDark_predefined",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrumFullLight_predefined",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface_predefined",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature_predefined",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"whiteToBlack_predefined",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellowToDarkRed_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellowToGreenToDarkBlue_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellowToRed_predefined",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellowGreenBright_predefined",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellowGreenLightToDark_predefined",fromColor:[215,240,175],toColor:[96,107,45]}],a={aspect_predefined:"Aspect",blackToWhite_predefined:"Black to White",blueBright_predefined:"Blue Bright",blueLightToDark_predefined:"Blue Light to Dark",blueGreenBright_predefined:"Blue-Green Bright",blueGreenLightToDark_predefined:"Blue-Green Light to Dark",brownLightToDark_predefined:"Brown Light to Dark",brownToBlueGreenDivergingBright_predefined:"Brown to Blue Green Diverging, Bright",brownToBlueGreenDivergingDark_predefined:"Brown to Blue Green Diverging, Dark",coefficientBias_predefined:"Coefficient Bias",coldToHotDiverging_predefined:"Cold to Hot Diverging",conditionNumber_predefined:"Condition Number",cyanToPurple_predefined:"Cyan to Purple",cyanLightToBlueDark_predefined:"Cyan-Light to Blue-Dark",distance_predefined:"Distance",elevation1_predefined:"Elevation #1",elevation2_predefined:"Elevation #2",errors_predefined:"Errors",grayLightToDark_predefined:"Gray Light to Dark",greenBright_predefined:"Green Bright",greenLightToDark_predefined:"Green Light to Dark",greenToBlue_predefined:"Green to Blue",orangeBright_predefined:"Orange Bright",orangeLightToDark_predefined:"Orange Light to Dark",partialSpectrum_predefined:"Partial Spectrum",partialSpectrum1Diverging_predefined:"Partial Spectrum 1 Diverging",partialSpectrum2Diverging_predefined:"Partial Spectrum 2 Diverging",pinkToYellowGreenDivergingBright_predefined:"Pink to YellowGreen Diverging, Bright",pinkToYellowGreenDivergingDark_predefined:"Pink to YellowGreen Diverging, Dark",precipitation_predefined:"Precipitation",prediction_predefined:"Prediction",purpleBright_predefined:"Purple Bright",purpleToGreenDivergingBright_predefined:"Purple to Green Diverging, Bright",purpleToGreenDivergingDark_predefined:"Purple to Green Diverging, Dark",purpleBlueBright_predefined:"Purple-Blue Bright",purpleBlueLightToDark_predefined:"Purple-Blue Light to Dark",purpleRedBright_predefined:"Purple-Red Bright",purpleRedLightToDark_predefined:"Purple-Red Light to Dark",redBright_predefined:"Red Bright",redLightToDark_predefined:"Red Light to Dark",redToBlueDivergingBright_predefined:"Red to Blue Diverging, Bright",redToBlueDivergingDark_predefined:"Red to Blue Diverging, Dark",redToGreen_predefined:"Red to Green",redToGreenDivergingBright_predefined:"Red to Green Diverging, Bright",redToGreenDivergingDark_predefined:"Red to Green Diverging, Dark",slope_predefined:"Slope",spectrumFullBright_predefined:"Spectrum-Full Bright",spectrumFullDark_predefined:"Spectrum-Full Dark",spectrumFullLight_predefined:"Spectrum-Full Light",surface_predefined:"Surface",temperature_predefined:"Temperature",whiteToBlack_predefined:"White to Black",yellowToDarkRed_predefined:"Yellow to Dark Red",yellowToGreenToDarkBlue_predefined:"Yellow to Green to Dark Blue",yellowToRed_predefined:"Yellow to Red",yellowGreenBright_predefined:"Yellow-Green Bright",yellowGreenLightToDark_predefined:"Yellow-Green Light to Dark"};function s(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]{if(s(e.fromColor.toRgb(),t.fromColor)&&s(e.toColor.toRgb(),t.toColor))return a=t.id,!0}):"multipart"===e.type&&r.some(t=>{if(e.colorRamps&&t.colorRamps&&e.colorRamps.length===t.colorRamps.length&&(o=e.colorRamps,!t.colorRamps.some((e,t)=>{if(!s(o[t].fromColor.toRgb(),new n["a"](e.fromColor).toRgb())||!s(o[t].toColor.toRgb(),new n["a"](e.toColor).toRgb()))return!0}))){if(a)return!0;a=t.id}}),a}function u(e){const t=c(e);return t?a[t]:null}function h(e,t,r=!1){if(!e||!t||t<1)return;const n="toJSON"in e?e.toJSON():e,o="multipart"===n.type?n.colorRamps.length:1,i=[],a=[];let s,c,u,h,f,d=0;if(1===t)return s="multipart"===n.type?n.colorRamps[0].fromColor:n.fromColor,a.push([0].concat(s)),a;for(let l=0;l{if(h>=e.start&&(h1?s[3]/255:s[3]:1,d=null!=c[3]?c[3]>1?c[3]/255:c[3]:1;r&&a[p].push(Math.min(255,Math.round(255*(o*(1-f)+d*f))))}});return a}function f(e){const t=u(e);if(e){if("algorithmic"===e.type)return{...d(e),Name:t};if(e.colorRamps){const r=e.colorRamps.map(d);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:t}}}}function d(e){if(!e)return;const t=e.toJSON();return{Algorithm:(null==t?void 0:t.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:p(e.fromColor),ToColor:p(e.toColor)}}function p(e){const t=Object(o["a"])(e);return{type:"HsvColor",Hue:t.h,Saturation:t.s,Value:t.v,AlphaValue:255}}function m(e){const t=e.reverse().map(e=>{const t=e.toString(16);return t.length<2?"0"+t:t});return 4294967295&Number.parseInt(t.join(""),16)}},"9dee":function(e,t,r){"use strict";r.d(t,"a",(function(){return D})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return s})),r.d(t,"d",(function(){return d})),r.d(t,"e",(function(){return h})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return c})),r.d(t,"h",(function(){return a})),r.d(t,"i",(function(){return R})),r.d(t,"j",(function(){return i})),r.d(t,"k",(function(){return m})),r.d(t,"l",(function(){return x})),r.d(t,"m",(function(){return b})),r.d(t,"n",(function(){return g})),r.d(t,"o",(function(){return v})),r.d(t,"p",(function(){return M})),r.d(t,"q",(function(){return p}));var n=r("b2b2"),o=r("3e27");function i(e){return Object(n["k"])(e)&&"esri.layers.support.PixelBlock"===e.declaredClass&&e.pixels&&e.pixels.length>0}function a(e,t){if(null==t||!t.length||!i(e))return e;const r=e.pixels.length;return t&&t.some(e=>e>=r)||1===r&&1===t.length&&0===t[0]?e:r!==t.length||t.some((e,t)=>e!==t)?new o["a"]({pixelType:e.pixelType,width:e.width,height:e.height,mask:e.mask,validPixelCount:e.validPixelCount,maskIsAlpha:e.maskIsAlpha,pixels:t.map(t=>e.pixels[t]),statistics:e.statistics&&t.map(t=>e.statistics[t])}):e}function s(e){if(!e)return;const t=e.colormap;if(!t||0===t.length)return;const r=t.sort((e,t)=>e[0]-t[0]);let n=0;r[0][0]<0&&(n=r[0][0]);const o=Math.max(256,r[r.length-1][0]-n+1),i=new Uint8Array(4*o),a=[];let s,l=0,c=0;const u=5===r[0].length;if(o>65536)return r.forEach(e=>{a[e[0]-n]=u?e.slice(1):e.slice(1).concat([255])}),{indexed2DColormap:a,offset:n,alphaSpecified:u};if(e.fillUnspecified)for(s=r[c],l=s[0]-n;lh?o[f]=0:(p[f]=s[b],m[f]=s[b+1],g[f]=s[b+2],o[f]=s[b+3]));else{for(o=new Uint8Array(a),f=0;fh?o[f]=0:(p[f]=s[b],m[f]=s[b+1],g[f]=s[b+2],o[f]=s[b+3]);r.mask=o}else if(o)for(f=0;f-1&&(h=65536);const d=[],p=[],m=a-i;for(l=0;l=s,y=[];if(g)for(l=0;l1?n[l]>2?y[l]=6.5+(n[l]-2)**2.5:y[l]=6.5+100*(2-n[l])**4:y[l]=1;let b;const w=[];let x,C,v;if(g)for(l=0;l1&&(C-=(1/m)**(b*y[l])),xt[l]?v[c]=Math.floor(C*m*b**(1/n[l]))+i:x>=r[l]?v[c]=a:v[c]=i;w[l]=v}else for(l=0;l=r[l]?v[c]=a:v[c]=Math.floor((x-t[l])/p[l]*m)+i;w[l]=v}if(null!=e.contrastOffset){const t=f(e.contrastOffset,e.brightnessOffset);for(l=0;l0&&r<100?s=(200*a-100*o+2*o*n)/(2*(100-r))+i:r<=0&&r>-100?s=(200*a-100*o+2*o*n)*(100+r)/2e4+i:100===r?(s=200*a-100*o+(o+1)*(100-r)+2*o*n,s=s>0?o:0):-100===r&&(s=i),l[a]=s>o?o:s<0?0:s;return l}function d(e,t=256){t=Math.min(t,256);const{size:r,counts:n}=e,o=new Uint8Array(r),i=n.reduce((e,r)=>e+r/t,0);let a=0,s=0,l=0,c=i;for(let u=0;u=f,v=[];if(C)for(d=0;d1?l[d]>2?v[d]=6.5+(l[d]-2)**2.5:v[d]=6.5+100*(2-l[d])**4:v[d]=1;if(C)if(null!=o){for(p=0;p1&&(g-=(1/b)**(y*v[d])),ma[d]?n[d][p]=Math.floor(g*b*y**(1/l[d]))+c:m>=s[d]?n[d][p]=u:n[d][p]=c}else for(p=0;p1&&(g-=(1/b)**(y*v[d])),ma[d]?n[d][p]=Math.floor(g*b*y**(1/l[d]))+c:m>=s[d]?n[d][p]=u:n[d][p]=c;else if(null!=o){for(p=0;pa[d]?n[d][p]=Math.floor((m-a[d])/x[d]*b)+c:m>=s[d]?n[d][p]=u:n[d][p]=c}else for(p=0;pa[d]?n[d][p]=Math.floor((m-a[d])/x[d]*b)+c:m>=s[d]?n[d][p]=u:n[d][p]=c;return r.pixelType="u8",r.updateStatistics(),r}function m(e,t){if(!i(e))return null;const{pixels:r,mask:n}=e,a=e.width*e.height,s=r.length;let l=t.lut;const{offset:c}=t;let u,h;l&&1===l[0].length&&(l=r.map(()=>l));const f=[];let d,p,m;if(c)if(null==n)for(u=0;u1;){if(u===h.value){g=!0;break}u>h.value?f=m:d=m,m=Math.floor((f+d)/2),h=t[Math.floor(m)]}g||(u===t[f].value?(h=t[f],g=!0):u===t[d].value?(h=t[d],g=!0):ut[f].value&&(ue.pixelBlock);if(!r||Object(n["j"])(r.pixelBlock))return null;const o=(r.extent.xmax-r.extent.xmin)/r.pixelBlock.width,i=(r.extent.ymax-r.extent.ymin)/r.pixelBlock.height,a=.01*Math.min(o,i),s=e.sort((e,t)=>Math.abs(e.extent.ymax-t.extent.ymax)>a?t.extent.ymax-e.extent.ymax:Math.abs(e.extent.xmin-t.extent.xmin)>a?e.extent.xmin-t.extent.xmin:0),l=Math.min.apply(null,s.map(e=>e.extent.xmin)),c=Math.min.apply(null,s.map(e=>e.extent.ymin)),u=Math.max.apply(null,s.map(e=>e.extent.xmax)),h=Math.max.apply(null,s.map(e=>e.extent.ymax)),f={x:Math.round((t.xmin-l)/o),y:Math.round((h-t.ymax)/i)},d={width:Math.round((u-l)/o),height:Math.round((h-c)/i)},p={width:Math.round((t.xmax-t.xmin)/o),height:Math.round((t.ymax-t.ymin)/i)};return Math.round(d.width/r.pixelBlock.width)*Math.round(d.height/r.pixelBlock.height)!==s.length||f.x<0||f.y<0||d.widthe.pixelBlock),d,{clipOffset:f,clipSize:p})}}function w(e,t,r,n,o,i){const{width:a,height:s}=r.block,{x:l,y:c}=r.offset,{width:u,height:h}=r.mosaic,f=y(a,s,n,o,l,c,u,h);let d=0,p=0;if(i){const e=i.hasGCSSShiftTransform?360:i.halfWorldWidth,t=a*i.resolutionX,r=i.startX+n*t,o=r+t;re?p=i.rightPadding:r>=e&&(d=i.leftMargin-i.rightPadding,p=0)}if(f.xmax-=p,"number"!=typeof t)for(let m=f.ymin;mi(e));if(Object(n["j"])(u))return null;const h=s?s.width:t.width,f=s?s.height:t.height,d=u.width,p=u.height,m=t.width/d,g=t.height/p,y={offset:a||{x:0,y:0},mosaic:s||t,block:{width:d,height:p}},b=u.pixelType,x=o["a"].getPixelArrayConstructor(b),v=u.pixels.length,k=[];let T,S,O;for(let n=0;nObject(n["j"])(e)||e.mask&&e.mask.length>0)){O=new Uint8Array(h*f);for(let t=0;tObject(n["k"])(e));if(!Object(n["k"])(a))return null;const s=e.some(e=>!Object(n["k"])(e)||!!e.mask),{width:l,height:c}=t,u=s?new Uint8Array(l*c):null,{blockWidths:h}=r,f=[],d=a.getPlaneCount(),p=o["a"].getPixelArrayConstructor(a.pixelType);if(s)for(let n=0,o=0;nn||c>o)return e;if(0===a&&0===s&&l===n&&c===o)return e;e.mask||(e.mask=new Uint8Array(n*o));const u=e.mask;for(let i=0;i=c||t=l?0:1}return e.updateStatistics(),e}function k(e){if(!i(e))return null;const t=e.clone(),{width:r,height:n,pixels:o,mask:a}=e,s=o[0],l=t.pixels[0];for(let i=2;it&&(r=i.value,t=n),i=o.next();return r}function S(e,t,r){if(0===r)return;const n=e.get(t);1===n?e.delete(t):e.set(t,n-1)}function O(e,t,r){0!==r&&e.set(t,e.has(t)?e.get(t)+1:1)}function A(e,t,r){let{x:n,y:a}=t;const{width:s,height:l}=r;if(0===n&&0===a&&l===e.height&&s===e.width)return e;const{width:c,height:u}=e,h=Math.max(0,a),f=Math.max(0,n),d=Math.min(n+s,c),p=Math.min(a+l,u);if(d<0||p<0||!i(e))return null;n=Math.max(0,-n),a=Math.max(0,-a);const{pixels:m,mask:g}=e,y=s*l,b=m.length,w=[];for(let i=0;i{const n=e instanceof Float32Array||e instanceof Float64Array?0:.5;for(let o=0;o=c)h-=c,g=m>>>32-c,m<<=c;else{g=m>>>32-h,m=l[p++];const e=c-h;h=32-e,g=(g<>>h),m<<=e}if(257===g)break;if(256===g){c=9,u=o(),f=u.length,d=[];continue}const e=u[g];if(null==e){if(g>u.length)throw"data integrity issue: code does not exist on code page";d.push(d[0]),u[f++]=d.slice(),i(w,d)}else i(w,e),d.push(e[0]),d.length>1&&(u[f++]=d.slice()),d=e.slice();if(a.has(f)&&c++,0===h&&(m=l[p++],h=32),p>y||p===y&&h<=b)break}return new Uint8Array(w)}a.add(511),a.add(1023),a.add(2047),a.add(4095),a.add(8191)},c4c2:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,o,i,a={exports:{}};o=a,void 0!==(n=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(e){var t=this.buffer,r=t?t.byteLength:0;if(en&&(r=n)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(t,r)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,r){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},e}(),i=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),o=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],i=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function a(e){throw new Error(e)}function s(e){var t=0,r=e[t++],o=e[t++];-1!=r&&-1!=o||a("Invalid header in flate stream"),8!=(15&r)&&a("Unknown compression method in flate stream"),((r<<8)+o)%31!=0&&a("Bad FCHECK in flate stream"),32&o&&a("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=t,this.codeSize=0,this.codeBuf=0,n.call(this)}return s.prototype=Object.create(n.prototype),s.prototype.getBits=function(e){for(var t,r=this.codeSize,n=this.codeBuf,o=this.bytes,i=this.bytesPos;r>e,this.codeSize=r-=e,this.bytesPos=i,t},s.prototype.getCode=function(e){for(var t=e[0],r=e[1],n=this.codeSize,o=this.codeBuf,i=this.bytes,s=this.bytesPos;n>16,h=65535&c;return(0==n||n>u,this.codeSize=n-u,this.bytesPos=s,h},s.prototype.generateHuffmanTable=function(e){for(var t=e.length,r=0,n=0;nr&&(r=e[n]);for(var o=1<>=1;for(n=u;n0;)t[p++]=o}var s=this.getBits(3);if(1&s&&(this.eof=!0),0!=(s>>=1)){var l,c;if(1==s)l=o,c=i;else if(2==s){for(var u=this.getBits(5)+257,h=this.getBits(5)+1,f=this.getBits(4)+4,d=Array(e.length),p=0;p=x&&(x=(D=this.ensureBuffer(C+1)).length),D[C++]=v;else{if(256==v)return void(this.bufferLength=C);var k=(v=t[v-=257])>>16;k>0&&(k=this.getBits(k)),g=(65535&v)+k,v=this.getCode(c),(k=(v=r[v])>>16)>0&&(k=this.getBits(k));var T=(65535&v)+k;C+g>=x&&(x=(D=this.ensureBuffer(C+g)).length);for(var S=0;Se<=.04045?e/12.92:((e+.055)/1.055)**2.4),r=u(l,t);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function f(e){const t=u(c,[e.x/100,e.y/100,e.z/100]).map(e=>{const t=e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))});return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function d(e){const t=[e.x/95.047,e.y/100,e.z/108.883].map(e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29);return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function p(e){const t=e.l,r=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map(e=>e>6/29?e**3:3*(6/29)**2*(e-4/29));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function m(e){const t=e.l,r=e.a,n=e.b,o=Math.sqrt(r*r+n*n);let i=Math.atan2(n,r);return i=i>0?i:i+2*Math.PI,{l:t,c:o,h:i}}function g(e){const t=e.l,r=e.c,n=e.h;return{l:t,a:r*Math.cos(n),b:r*Math.sin(n)}}function y(e){return d(h(e))}function b(e){return f(p(e))}function w(e){return m(d(h(e)))}function x(e){return f(p(g(e)))}function C(e){const t=e.r,r=e.g,n=e.b,o=Math.max(t,r,n),i=o-Math.min(t,r,n);let a=o,s=0===i?0:o===t?(r-n)/i%6:o===r?(n-t)/i+2:(t-r)/i+4,l=0===i?0:i/a;return s<0&&(s+=6),s*=60,l*=100,a*=100/255,{h:s,s:l,v:a}}function v(e){const t=(e.h+360)%360/60,r=e.s/100,n=e.v/100*255,o=n*r,i=o*(1-Math.abs(t%2-1));let a;switch(Math.floor(t)){case 0:a={r:o,g:i,b:0};break;case 1:a={r:i,g:o,b:0};break;case 2:a={r:0,g:o,b:i};break;case 3:a={r:0,g:i,b:o};break;case 4:a={r:i,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:i};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function k(e){return n(e)?e:a(e)?x(e):i(e)?b(e):s(e)?f(e):o(e)?v(e):e}function T(e){return o(e)?e:C(k(e))}function S(e){return i(e)?e:y(k(e))}function O(e){return a(e)?e:w(k(e))}},e55a:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,1===t[0]})()},e90e:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n,o,i,a={exports:{}};n=a,o=function(){var e=function(){function e(e){this.message="JPEG error: "+e}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,n=799,o=3406,i=2276,a=1567,s=3784,l=5793,c=2896;function u(){this.decodeTransform=null,this.colorTransform=-1}function h(e,t){for(var r,n,o=0,i=[],a=16;a>0&&!e[a-1];)a--;i.push({children:[],index:0});var s,l=i[0];for(r=0;r0;)l=i.pop();for(l.index++,i.push(l);i.length<=r;)i.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s;o++}r+10)return y--,m>>y&1;if(255===(m=r[n++])){var t=r[n++];if(t)throw new e("unexpected marker "+(m<<8|t).toString(16))}return y=7,m>>>7}function w(t){for(var r=t;;){if("number"==typeof(r=r[b()]))return r;if("object"!=typeof r)throw new e("invalid huffman sequence")}}function x(e){for(var t=0;e>0;)t=t<<1|b(),e--;return t}function C(e){if(1===e)return 1===b()?1:-1;var t=x(e);return t>=1<>4;if(0!==s){var c=t[i+=l];e.blockData[r+c]=C(s),i++}else{if(l<15)break;i+=16}}}function k(e,t){var r=w(e.huffmanTableDC),n=0===r?0:C(r)<0)S--;else for(var n=s,o=l;n<=o;){var i=w(e.huffmanTableAC),a=15&i,c=i>>4;if(0!==a){var h=t[n+=c];e.blockData[r+h]=C(a)*(1<>4,0==(o=15&i))h<15?(S=x(h)+(1<=65488&&H<=65495))break;n+=2}return(_=g(r,n))&&_.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+_.invalid),n=_.offset),n-p}function p(t,u,h){var f,d,p,m,g,y,b,w,x,C,v,k,T,S,O,A,I,M=t.quantizationTable,P=t.blockData;if(!M)throw new e("missing required Quantization Table.");for(var R=0;R<64;R+=8)x=P[u+R],C=P[u+R+1],v=P[u+R+2],k=P[u+R+3],T=P[u+R+4],S=P[u+R+5],O=P[u+R+6],A=P[u+R+7],x*=M[R],0!=(C|v|k|T|S|O|A)?(C*=M[R+1],v*=M[R+2],k*=M[R+3],T*=M[R+4],S*=M[R+5],O*=M[R+6],A*=M[R+7],d=(f=(f=l*x+128>>8)+(d=l*T+128>>8)+1>>1)-d,I=(p=v)*s+(m=O)*a+128>>8,p=p*a-m*s+128>>8,b=(g=(g=c*(C-A)+128>>8)+(b=S<<4)+1>>1)-b,y=(w=(w=c*(C+A)+128>>8)+(y=k<<4)+1>>1)-y,m=(f=f+(m=I)+1>>1)-m,p=(d=d+p+1>>1)-p,I=g*i+w*o+2048>>12,g=g*o-w*i+2048>>12,w=I,I=y*n+b*r+2048>>12,y=y*r-b*n+2048>>12,b=I,h[R]=f+w,h[R+7]=f-w,h[R+1]=d+b,h[R+6]=d-b,h[R+2]=p+y,h[R+5]=p-y,h[R+3]=m+g,h[R+4]=m-g):(I=l*x+512>>10,h[R]=I,h[R+1]=I,h[R+2]=I,h[R+3]=I,h[R+4]=I,h[R+5]=I,h[R+6]=I,h[R+7]=I);for(var D=0;D<8;++D)x=h[D],0!=((C=h[D+8])|(v=h[D+16])|(k=h[D+24])|(T=h[D+32])|(S=h[D+40])|(O=h[D+48])|(A=h[D+56]))?(d=(f=4112+((f=l*x+2048>>12)+(d=l*T+2048>>12)+1>>1))-d,I=(p=v)*s+(m=O)*a+2048>>12,p=p*a-m*s+2048>>12,m=I,b=(g=(g=c*(C-A)+2048>>12)+(b=S)+1>>1)-b,y=(w=(w=c*(C+A)+2048>>12)+(y=k)+1>>1)-y,I=g*i+w*o+2048>>12,g=g*o-w*i+2048>>12,w=I,I=y*n+b*r+2048>>12,y=y*r-b*n+2048>>12,x=(x=(f=f+m+1>>1)+w)<16?0:x>=4080?255:x>>4,C=(C=(d=d+p+1>>1)+(b=I))<16?0:C>=4080?255:C>>4,v=(v=(p=d-p)+y)<16?0:v>=4080?255:v>>4,k=(k=(m=f-m)+g)<16?0:k>=4080?255:k>>4,T=(T=m-g)<16?0:T>=4080?255:T>>4,S=(S=p-y)<16?0:S>=4080?255:S>>4,O=(O=d-b)<16?0:O>=4080?255:O>>4,A=(A=f-w)<16?0:A>=4080?255:A>>4,P[u+D]=x,P[u+D+8]=C,P[u+D+16]=v,P[u+D+24]=k,P[u+D+32]=T,P[u+D+40]=S,P[u+D+48]=O,P[u+D+56]=A):(I=(I=l*x+8192>>14)<-2040?0:I>=2024?255:I+2056>>4,P[u+D]=I,P[u+D+8]=I,P[u+D+16]=I,P[u+D+24]=I,P[u+D+32]=I,P[u+D+40]=I,P[u+D+48]=I,P[u+D+56]=I)}function m(e,t){for(var r=t.blocksPerLine,n=t.blocksPerColumn,o=new Int16Array(64),i=0;i=o)return null;var a=n(t);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:t};for(var s=n(i);!(s>=65472&&s<=65534);){if(++i>=o)return null;s=n(i)}return{invalid:a.toString(16),marker:s,offset:i}}return u.prototype={parse:function(r){function n(){var e=r[l]<<8|r[l+1];return l+=2,e}function o(){var e=n(),t=l+e-2,o=g(r,t,l);o&&o.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+o.invalid),t=o.offset);var i=r.subarray(l,t);return l+=i.length,i}function i(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),n=0;n>4==0)for(x=0;x<64;x++)S[t[x]]=r[l++];else{if(T>>4!=1)throw new e("DQT - invalid table spec");for(x=0;x<64;x++)S[t[x]]=n()}f[15&T]=S}break;case 65472:case 65473:case 65474:if(a)throw new e("Only single frame JPEGs supported");n(),(a={}).extended=65473===b,a.progressive=65474===b,a.precision=r[l++],a.scanLines=n(),a.samplesPerLine=n(),a.components=[],a.componentIds={};var O,A=r[l++],I=0,M=0;for(w=0;w>4,R=15&r[l+1];I>4==0?y:p)[15&j]=h(U,B)}break;case 65501:n(),s=n();break;case 65498:n();var G,_=r[l++],N=[];for(w=0;w<_;w++){var F=a.componentIds[r[l++]];G=a.components[F];var V=r[l++];G.huffmanTableDC=y[V>>4],G.huffmanTableAC=p[15&V],N.push(G)}var z=r[l++],W=r[l++],H=r[l++],K=d(r,l,a,N,s,z,W,H>>4,15&H);l+=K;break;case 65535:255!==r[l]&&l--;break;default:if(255===r[l-3]&&r[l-2]>=192&&r[l-2]<=254){l-=3;break}throw new e("unknown marker "+b.toString(16))}b=n()}for(this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=c,this.eof=l,this.adobe=u,this.components=[],w=0;w>8)+C[u+1];return b},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this.colorTransform:1===this.colorTransform},_convertYccToRgb:function(e){for(var t,r,n,o=0,i=e.length;o4)throw new e("Unsupported color mode");var o=this._getLinearizedBlockData(t,r);if(1===this.numComponents&&n){for(var i=o.length,a=new Uint8ClampedArray(3*i),s=0,l=0;l