@arcgis/core 4.24.0-next.20220520 → 4.24.0-next.20220521

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{26646a7545a194e67441.js → 27572edd67242e1b6646.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{d94c5f36d52cf71f0bb9.js → 27f974dae930eb12fe38.js} +1 -1
  4. package/assets/esri/core/workers/chunks/2b708cc5ba0edd6c80e1.js +1 -0
  5. package/assets/esri/core/workers/chunks/{c5fadaa98749ffb490f5.js → 3c258ac11c963b7d9509.js} +1 -1
  6. package/assets/esri/core/workers/chunks/40d70d446abe357d6f43.js +1 -0
  7. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  8. package/assets/esri/core/workers/chunks/{f5089121d845ec594008.js → 6ac32325a961f1cf3c1b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{1c2805cc97dcee70e60d.js → 816ae3f0513ecf856f8f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{8033531b0cc706b40d86.js → 8523d45cf4765eddc380.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{a5ee17cdc9eb23ebeaf0.js → 85f2f6a50cf1b6c7ce82.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c40d9caf5189be2c698e.js → 87b83dfce3ee252aba94.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{6e48b0db65bcaaace838.js → 8cd8dad8bcd5c0ef445e.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{54711b8a98104eeec833.js → 8ec860742695e5bbbcb2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{e51f0e71f2a55af604d3.js → 93c4e01b237a6b3f871f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3e94e35f44aadbb332ff.js → aae70408958f6ee7279e.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7e150c38e25fbb8bacaf.js → b476a80ef81c211685be.js} +1 -1
  18. package/assets/esri/core/workers/chunks/b8db486a3dba68a8030a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{82b6535a30287c74ba13.js → c0e6dbecdbd30066a82c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{66e8a253312d72a8e7f9.js → c4115e8d1eb2ca6bb605.js} +1 -1
  21. package/assets/esri/core/workers/chunks/cd04bae81e5fc27ec97b.js +1 -0
  22. package/assets/esri/core/workers/chunks/{24217129d492e170f0f0.js → f668ccaf8bd0be0ab57b.js} +1 -1
  23. package/core/CollectionFlattener.js +1 -1
  24. package/core/promiseUtils.js +1 -1
  25. package/interfaces.d.ts +78 -2
  26. package/layers/FeatureLayer.js +1 -1
  27. package/layers/SubtypeGroupLayer.js +1 -1
  28. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  29. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  30. package/layers/mixins/ArcGISImageService.js +1 -1
  31. package/layers/mixins/refresh.js +1 -1
  32. package/layers/support/FeatureReductionCluster.js +1 -1
  33. package/layers/support/capabilities.js +1 -1
  34. package/package.json +1 -1
  35. package/support/revision.js +1 -1
  36. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  37. package/views/2d/engine/webgl/TextureManager.js +1 -1
  38. package/views/2d/engine/webgl/animatedFormats/BaseAnimatableTextureResource.js +1 -1
  39. package/views/2d/engine/webgl/animatedFormats/apng.js +1 -1
  40. package/views/2d/engine/webgl/animatedFormats/gif.js +1 -1
  41. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  42. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  43. package/views/2d/layers/features/schemaUtils.js +1 -1
  44. package/views/SceneView.js +1 -1
  45. package/assets/esri/core/workers/chunks/128f461007ef039d4f73.js +0 -1
  46. package/assets/esri/core/workers/chunks/672da24bbf86718bf48d.js +0 -1
  47. package/assets/esri/core/workers/chunks/824a700ba611e6c4fa9a.js +0 -1
  48. package/assets/esri/core/workers/chunks/be4bf1e4cbe2a593f8b3.js +0 -1
  49. package/assets/esri/core/workers/chunks/d6315aa9eedf79a7bca1.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7175],{47175:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ft});var r,n=i(43697),s=i(51773),a=i(70586),o=i(16453),l=i(95330),u=i(5600),p=(i(67676),i(80442),i(75215)),c=i(52011),m=i(30556),d=i(87085),h=i(66577),y=i(38171),f=i(30030),g=i(3172),b=i(20102),R=i(35454),v=i(22974),w=i(92604),_=i(17445),S=i(17452),C=i(44422),I=i(71715),x=i(21506),F=i(35956),T=i(96674),N=i(36030);const D=new Set(["raster","raster2","dem","fillraster"]),P=new Set(["rasters"]),O=e=>e&&e.rasterFunction?A.fromJSON(e):e,j=e=>e&&e instanceof A?e.toJSON():e,V=e=>e?.functionName&&!e.declaredClass,M=e=>V(e)?new A(e):e;let A=r=class extends T.wq{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some((t=>D.has(t.toLowerCase())&&V(e[t])))||t.some((t=>P.has(t.toLowerCase())&&Array.isArray(e[t])&&e[t].some((e=>V(e)))))){e=(0,v.d9)(e);for(const i of t)D.has(i.toLowerCase())?e[i]=M(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map((e=>M(e))))}}this._set("functionArguments",e)}readFunctionArguments(e){return(e=>{if(null==e)return null;e=(0,v.d9)(e);const t={};for(const i of Object.keys(e))D.has(i.toLowerCase())?t[i]=O(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(O):t[i]=e[i];return t})(e)}writeFunctionArguments(e,t,i){const r={};for(const t of Object.keys(e))D.has(t.toLowerCase())?r[t]=j(e[t]):P.has(t.toLowerCase())&&Array.isArray(e[t])?r[t]=e[t].map(j):r[t]=j(e[t]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&"None"!==i[0].name?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new r({functionName:this.functionName,functionArguments:(0,v.d9)(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:(0,v.d9)(this.rasterFunctionDefinition)})}};(0,n._)([(0,u.Cb)({json:{type:Object,name:"rasterFunctionArguments"}})],A.prototype,"functionArguments",null),(0,n._)([(0,I.r)("functionArguments")],A.prototype,"readFunctionArguments",null),(0,n._)([(0,m.c)("functionArguments")],A.prototype,"writeFunctionArguments",null),(0,n._)([(0,u.Cb)({json:{type:String,write:{target:"rasterFunction"}}})],A.prototype,"functionName",void 0),(0,n._)([(0,I.r)("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],A.prototype,"readFunctionName",null),(0,n._)([(0,N.J)({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),(0,u.Cb)({json:{default:"unknown"}})],A.prototype,"outputPixelType",void 0),(0,n._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],A.prototype,"variableName",void 0),(0,n._)([(0,u.Cb)({type:Object,json:{name:"rasterFunctionDefinition"}})],A.prototype,"rasterFunctionDefinition",void 0),A=r=(0,n._)([(0,c.j)("esri.layers.support.RasterFunction")],A);const J=A,E={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}};var z=i(93010),q=i(75509),L=i(27922);const Z={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},k={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},U=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function H(e){return U.has(e.type)}function G(e,t){if(!e||!t)return(0,v.d9)(e||t);const i=(0,v.d9)(e);if(t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),Q(i.rasterFunctionDefinition.arguments,t)}else"none"!==t.functionName.toLowerCase()&&(W(i.functionArguments).Raster=t);return i}function Q(e,t){for(const i in e)"raster"===i.toLowerCase()&&("RasterFunctionVariable"===e[i].type?(e[i]=t.rasterFunctionDefinition,e[i].type="RasterFunctionTemplate"):"RasterFunctionTemplate"===e[i].type&&Q(e[i].arguments,t))}function B(e){const t=(0,v.d9)(E[e.functionName+"Function"]),i=e.functionArguments;for(const e in i)"raster"===e.toLowerCase()?(t.arguments[e]=B(i[e]),t.arguments[e].type="RasterFunctionTemplate"):"colormap"===e.toLowerCase()?(t.arguments[e].value=ee(i[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=i[e];return t}function W(e){const t=e.Raster;return t&&"esri.layers.support.RasterFunction"===t.declaredClass?W(t.functionArguments):e}const $={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function K(e,t){const i=Z[String(t).toLowerCase()];return i&&e.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),e}function X(e){if(!e)return;const{fields:t}=e,i=t&&t.find((e=>e&&e.name&&"value"===e.name.toLowerCase()));return i&&i.name}function Y(e){const t=[];return e.forEach((e=>{const i=e;if(Array.isArray(i))t.push(i);else{if(null==i.min||null==i.max)return;const e=[i.min,i.max,i.avg||0,i.stddev||0];t.push(e)}})),t}function ee(e){const t=[],i=[];return e.forEach((e=>{t.push(e[0]),i.push((0,z.io)([...e.slice(1),255]))})),{type:"RasterColormap",values:t,colors:i}}var te,ie=i(90578),re=i(13473);const ne=(0,R.w)()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),se=(0,R.w)()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});let ae=te=class extends T.wq{constructor(e){super(e),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}readMethod(e,t){return function(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return se.fromJSON(t)}(t.mosaicMethod||t.defaultMosaicMethod)}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),n=i||(r?ne.toJSON(r):null);return ne.fromJSON(n)||"first"}castSortValue(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`}clone(){return new te({ascending:this.ascending,itemRenderingRule:(0,v.d9)(this.itemRenderingRule),lockRasterIds:(0,v.d9)(this.lockRasterIds),method:this.method,multidimensionalDefinition:(0,v.d9)(this.multidimensionalDefinition),objectIds:(0,v.d9)(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:(0,v.d9)(this.viewpoint),where:this.where})}};(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],ae.prototype,"ascending",void 0),(0,n._)([(0,I.r)("ascending",["ascending","sortAscending"])],ae.prototype,"readAscending",null),(0,n._)([(0,u.Cb)({type:J,json:{write:!0}})],ae.prototype,"itemRenderingRule",void 0),(0,n._)([(0,u.Cb)({type:[p.z8],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],ae.prototype,"lockRasterIds",void 0),(0,n._)([(0,u.Cb)({type:String,json:{type:se.jsonValues,write:{target:"mosaicMethod",writer:se.write}}})],ae.prototype,"method",void 0),(0,n._)([(0,I.r)("method",["mosaicMethod","defaultMosaicMethod"])],ae.prototype,"readMethod",null),(0,n._)([(0,u.Cb)({type:[F.Z],json:{write:!0}})],ae.prototype,"multidimensionalDefinition",void 0),(0,n._)([(0,u.Cb)({type:[p.z8],json:{name:"fids",write:!0}})],ae.prototype,"objectIds",void 0),(0,n._)([(0,u.Cb)({json:{type:ne.jsonValues,read:{reader:ne.read},write:{target:"mosaicOperation",writer:ne.write}}})],ae.prototype,"operation",void 0),(0,n._)([(0,I.r)("operation",["mosaicOperation","mosaicOperator"])],ae.prototype,"readOperation",null),(0,n._)([(0,u.Cb)({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],ae.prototype,"sortField",void 0),(0,n._)([(0,u.Cb)({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],ae.prototype,"sortValue",void 0),(0,n._)([(0,ie.p)("sortValue")],ae.prototype,"castSortValue",null),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],ae.prototype,"viewpoint",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ae.prototype,"where",void 0),ae=te=(0,n._)([(0,c.j)("esri.layers.support.MosaicRule")],ae);const oe=ae;var le=i(69608);let ue=class extends T.wq{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.bandIds=void 0,this.compression=void 0,this.compressionQuality=void 0,this.compressionTolerance=.01,this.format=null,this.interpolation=null,this.noData=null,this.noDataInterpretation=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(e,t,i){this.layer.version<10.3||(t[i]=e)}writeCompressionQuality(e,t,i){this.format&&this.format.toLowerCase().includes("jpg")&&null!=e&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}writeLercVersion(e,t,i){"lerc"===this.format&&this.layer.version>=10.5&&(t[i]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("renderingRule"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("renderer"),e.commitProperty("definitionExpression"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const i=e.definitionExpression;return t?i&&i!==t.where&&(t=t.clone(),t.where=i):i&&(t=new oe({where:i})),t}get renderingRule(){const e=this.layer;let t=e.renderingRule;const i=e.pixelFilter,r=!e.format||e.format.includes("jpg")||e.format.includes("png");return t=this._addResampleRasterFunction(t),r&&!i&&(t=this.combineRendererWithRenderingRule()),t}combineRendererWithRenderingRule(){const e=this.layer,{rasterInfo:t,renderingRule:i,renderer:r}=e;return r&&H(r)?G(function(e,t){switch(t=t||{},e.type){case"raster-stretch":return function(e,t){const i=t.convertToRFT,r=new J;r.functionName="Stretch";const n=$[q.v.toJSON(e.stretchType)],s="u8",a={StretchType:n,Statistics:Y(e.statistics),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(a.Min=e.outputMin),null!=e.outputMax&&(a.Max=e.outputMax),n===$.standardDeviation?(a.NumberOfStandardDeviations=e.numberOfStandardDeviations,r.outputPixelType=s):n===$.percentClip?(a.MinPercent=e.minPercent,a.MaxPercent=e.maxPercent,r.outputPixelType=s):n===$.minMax?r.outputPixelType=s:n===$.sigmoid&&(a.SigmoidStrengthLevel=e.sigmoidStrengthLevel),r.functionArguments=a,r.variableName="Raster",e.colorRamp){const n=e.colorRamp,s=new J;if(i)s.functionArguments={ColorRamp:(0,z.pM)(n)};else{const i=(0,z.Uh)(n);i?s.functionArguments={colorRamp:i}:!t.convertColorRampToColormap||"algorithmic"!==n.type&&"multipart"!==n.type?s.functionArguments={colorRamp:e.colorRamp.toJSON()}:s.functionArguments={Colormap:(0,z.Jw)(n,256)}}return s.variableName="Raster",s.functionName="Colormap",s.functionArguments.Raster=r,i?new J({rasterFunctionDefinition:B(s)}):s}return i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"class-breaks":return function(e,t){const i=[],r=[],n=[],s=[],a=1e-6,{pixelType:o,rasterAttributeTable:l}=t,u=l&&l.features,p=X(l);if(u&&Array.isArray(u)&&e.classBreakInfos){e.classBreakInfos.forEach(((t,i)=>{const r=t.symbol.color;let n;r.a&&u.forEach((a=>{n=a.attributes[e.field],(n>=t.minValue&&n<t.maxValue||i===e.classBreakInfos.length-1&&n>=t.minValue)&&s.push([a.attributes[p],r.r,r.g,r.b])}))}));const i=o?K(s,o):s,r=new J;return r.functionName="Colormap",r.functionArguments={},r.functionArguments.Colormap=i,r.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(r)}):r}e.classBreakInfos.forEach(((e,t)=>{const o=e.symbol&&e.symbol.color;o.a?(0===t?i.push(e.minValue,e.maxValue+a):i.push(e.minValue+a,e.maxValue+a),r.push(t),s.push([t,o.r,o.g,o.b])):n.push(e.minValue,e.maxValue)}));const c=o?K(s,o):s,m=new J;m.functionName="Remap",m.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:n},m.variableName="Raster";const d=new J;return d.functionName="Colormap",d.functionArguments={Colormap:c,Raster:m},t.convertToRFT?new J({rasterFunctionDefinition:B(d)}):d}(e,t);case"unique-value":return function(e,t){const i=[],{pixelType:r,rasterAttributeTable:n}=t,s=n&&n.features,a=X(n),o=e.defaultSymbol?.color?.toRgb(),l=e.uniqueValueInfos;if(l)if(s){const t=new Map;l.forEach((e=>{const i=e.value,r=e.symbol.color?.toRgb();null!=i&&r&&t.set(String(i),r)}));const r=e.field;s.forEach((({attributes:e})=>{const n=String(e[r]),s=e[a];if(t.has(n)){const e=t.get(n);i.push([s,...e])}else o&&i.push([s,...o])}))}else for(let e=0;e<l.length;e++){const t=l[e],r=t.symbol.color,n=+t.value;if(r?.a){if(isNaN(n))return null;i.push([n,r.r,r.g,r.b])}}const u=r&&i.length>0?K(i,r):i,p=new J;return p.functionName="Colormap",p.functionArguments={},p.functionArguments.Colormap=u,p.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(p)}):p}(e,t);case"raster-colormap":return function(e,t){const i=e.extractColormap();if(!i||0===i.length)return;const{pixelType:r}=t,n=r?K(i,r):i,s=new J;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=n,t.convertToRFT?new J({rasterFunctionDefinition:B(s)}):s}(e,t);case"vector-field":return function(e,t){const i=new J;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:n}=t,s="vector-uv"===r;let a,o;n&&2===n.length&&(a=n.map((e=>e.BandName.toLowerCase())).indexOf("magnitude"),o=n.map((e=>e.BandName.toLowerCase())).indexOf("direction")),-1!==a&&null!==a||(a=0,o=1);const l="arithmetic"===e.rotationType?1:2,u="flow-from"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>"Magnitude"===e.field)):new L.Z,c={magnitudeBandID:a,directionBandID:o,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:k[e.style.toLowerCase().replace("-","_")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};return i.functionArguments=c,t.convertToRFT?new J({rasterFunctionDefinition:B(i)}):i}(e,t);case"raster-shaded-relief":return function(e,t){const i=t.convertToRFT;if("elevation"!==t.dataType)return new J;const r=new J;r.functionName="Hillshade";const n="traditional"===e.hillshadeType?0:1,s="none"===e.scalingType?1:3,a={HillshadeType:n,SlopeType:s,ZFactor:e.zFactor};return 0===n&&(a.Azimuth=e.azimuth,a.Altitude=e.altitude),3===s&&(a.PSPower=e.pixelSizePower,a.PSZFactor=e.pixelSizeFactor),r.functionArguments=a,r.variableName="Raster",e.colorRamp&&(r.functionName="ShadedRelief",i?a.ColorRamp=(0,z.pM)(e.colorRamp):a.Colormap=(0,z.Jw)(e.colorRamp,256)),i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"flow":throw new Error("Unsupported rendering rule.")}}(r,{rasterAttributeTable:t.attributeTable,pixelType:t.pixelType,dataType:t.dataType,bandProperties:t.keyProperties?.BandProperties,convertColorRampToColormap:e.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition}),i):i}_addResampleRasterFunction(e){if("vector-field"!==this.layer.renderer?.type||"Resample"===e?.functionName)return e;const t="esriImageServiceDataTypeVector-UV"===this.layer.serviceDataType?7:10;let i=new J({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:{x:this.layer.pixelSizeX,y:this.layer.pixelSizeY}}});return i=e?.rasterFunctionDefinition?new J({rasterFunctionDefinition:B(i)}):i,G(i,e)}};(0,n._)([(0,u.Cb)()],ue.prototype,"layer",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"adjustAspectRatio",void 0),(0,n._)([(0,m.c)("adjustAspectRatio")],ue.prototype,"writeAdjustAspectRatio",null),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.bandIds")],ue.prototype,"bandIds",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"compression",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.compressionQuality")],ue.prototype,"compressionQuality",void 0),(0,n._)([(0,m.c)("compressionQuality")],ue.prototype,"writeCompressionQuality",null),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.compressionTolerance")],ue.prototype,"compressionTolerance",void 0),(0,n._)([(0,m.c)("compressionTolerance")],ue.prototype,"writeCompressionTolerance",null),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.format")],ue.prototype,"format",void 0),(0,n._)([(0,u.Cb)({type:String,json:{read:{reader:le.c.read},write:{writer:le.c.write}}}),(0,C.B)("layer.interpolation")],ue.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.noData")],ue.prototype,"noData",void 0),(0,n._)([(0,u.Cb)({type:String,json:{read:{reader:le.k.read},write:{writer:le.k.write}}}),(0,C.B)("layer.noDataInterpretation")],ue.prototype,"noDataInterpretation",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"pixelType",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"lercVersion",void 0),(0,n._)([(0,m.c)("lercVersion")],ue.prototype,"writeLercVersion",null),(0,n._)([(0,u.Cb)({type:Number})],ue.prototype,"version",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"mosaicRule",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"renderingRule",null),ue=(0,n._)([(0,c.j)("esri.layers.mixins.ExportImageServiceParameters")],ue);var pe=i(1231),ce=i(99514),me=i(54163),de=i(48526),he=i(88281),ye=i(75993),fe=i(80676),ge=i(67058),be=i(91219),Re=i(82526),ve=i(11282),we=i(82971);let _e=class extends T.wq{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"north",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"up",void 0),(0,n._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],_e.prototype,"spatialReference",void 0),_e=(0,n._)([(0,c.j)("esri.rest.support.ImageAngleResult")],_e);const Se=_e;var Ce=i(74889);let Ie=class extends T.wq{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"catalogItemVisibilities",void 0),(0,n._)([(0,u.Cb)({type:Ce.default,json:{write:!0}})],Ie.prototype,"catalogItems",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ie.prototype,"location",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"name",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"objectId",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"processedValues",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"properties",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"value",void 0),Ie=(0,n._)([(0,c.j)("esri.rest.support.ImageIdentifyResult")],Ie);const xe=Ie;let Fe=class extends T.wq{constructor(){super(...arguments),this.geometries=null}};(0,n._)([(0,u.Cb)({json:{write:!0}})],Fe.prototype,"geometries",void 0),Fe=(0,n._)([(0,c.j)("esri.rest.support.ImagePixelLocationResult")],Fe);const Te=Fe;let Ne=class extends T.wq{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"attributes",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ne.prototype,"location",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"locationId",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"rasterId",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"resolution",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"pixelValue",void 0),Ne=(0,n._)([(0,c.j)("esri.rest.support.ImageSample")],Ne);const De=Ne;let Pe=class extends T.wq{constructor(){super(...arguments),this.samples=null}};(0,n._)([(0,u.Cb)({type:[De],json:{write:!0}})],Pe.prototype,"samples",void 0),Pe=(0,n._)([(0,c.j)("esri.rest.support.ImageSampleResult")],Pe);const Oe=Pe;function je(e){const t=e?.time;if(t&&(null!=t.start||null!=t.end)){const i=[];null!=t.start&&i.push(t.start),null==t.end||i.includes(t.end)||i.push(t.end),e.time=i.join(",")}}async function Ve(e,t,i){const r=(0,ve.en)(e),n=t.geometry?[t.geometry]:[],s=await(0,Re.aX)(n),o=t.toJSON();je(o);const l=s&&s[0];(0,a.pC)(l)&&(o.geometry=l.toJSON());const u=(0,ve.cv)({...r.query,f:"json",...o});return(0,ve.lA)(u,i)}async function Me(e,t,i){const r=(0,ve.en)(e),n=t.geometry?[t.geometry]:[];return(0,Re.aX)(n).then((e=>{const n=t.toJSON(),s=e&&e[0];(0,a.pC)(s)&&(n.geometry=JSON.stringify(s.toJSON()));const o=(0,ve.cv)({...r.query,f:"json",...n}),l=(0,ve.lA)(o,i);return(0,g.default)(r.path+"/identify",l)})).then((e=>xe.fromJSON(e.data)))}function Ae(e){const{imageCoordinateSystem:t}=e;if(t){const{id:e,referenceServiceName:i}=t;return null!=e?i?{icsid:e,icsns:i}:{icsid:e}:{ics:t}}return e.toJSON()}function Je(e,t){const i=Ae(e),{icsid:r,icsns:n,wkid:s}=i;return null!=r?null==n||t?.toLowerCase().includes("/"+n.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):s?s.toString():JSON.stringify(i)}i(10158);var Ee,ze=i(4967),qe=(i(67900),i(8744),i(98732),i(6570)),Le=(i(9361),i(65091)),Ze=i(38913),ke=(i(58901),i(45091),i(57444)),Ue=(i(40330),i(98326),i(56545),i(41818)),He=i(5396),Ge=(i(75935),i(28141),i(26059)),Qe=i(36679);let Be=Ee=class extends T.wq{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ee((0,v.d9)({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};(0,n._)([(0,u.Cb)({type:[String],json:{name:"angleName",write:!0}})],Be.prototype,"angleNames",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Be.prototype,"point",void 0),(0,n._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],Be.prototype,"spatialReference",void 0),(0,n._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],Be.prototype,"rasterId",void 0),Be=Ee=(0,n._)([(0,c.j)("esri.rest.support.ImageAngleParameters")],Be);const We=Be;var $e,Ke=i(92835),Xe=i(33955);let Ye=$e=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}clone(){return new $e((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};(0,n._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],Ye.prototype,"geometry",void 0),(0,n._)([(0,m.c)("geometry")],Ye.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)({type:oe,json:{write:!0}})],Ye.prototype,"mosaicRule",void 0),(0,n._)([(0,u.Cb)({type:J,json:{write:!0}})],Ye.prototype,"renderingRule",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ye.prototype,"pixelSize",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ye.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],Ye.prototype,"timeExtent",void 0),Ye=$e=(0,n._)([(0,c.j)("esri.rest.support.ImageHistogramParameters")],Ye);const et=Ye;var tt;let it=tt=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON()))}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}writeRenderingRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[i]=JSON.stringify(e.rasterFunctionDefinition))}writeRenderingRules(e,t,i){null!=e&&(t[i]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,i){null!=e&&(t[i]=JSON.stringify(e))}writeTimeExtent(e,t,i){if(null!=e){const r=(0,a.pC)(e.start)?e.start.getTime():null,n=(0,a.pC)(e.end)?e.end.getTime():null;t[i]=null!=r?null!=n?`${r},${n}`:`${r}`:null}}clone(){return new tt((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};(0,n._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"geometry",void 0),(0,n._)([(0,m.c)("geometry")],it.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)({type:oe,json:{write:!0}})],it.prototype,"mosaicRule",null),(0,n._)([(0,m.c)("mosaicRule")],it.prototype,"writeMosaicRule",null),(0,n._)([(0,u.Cb)({type:J,json:{write:!0}})],it.prototype,"renderingRule",null),(0,n._)([(0,m.c)("renderingRule")],it.prototype,"writeRenderingRule",null),(0,n._)([(0,u.Cb)({type:[J],json:{write:!0}})],it.prototype,"renderingRules",void 0),(0,n._)([(0,m.c)("renderingRules")],it.prototype,"writeRenderingRules",null),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],it.prototype,"pixelSize",void 0),(0,n._)([(0,m.c)("pixelSize")],it.prototype,"writePixelSize",null),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnGeometry",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnCatalogItems",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnPixelValues",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],it.prototype,"maxItemCount",void 0),(0,n._)([(0,u.Cb)({type:Ke.Z,json:{write:{target:"time"}}})],it.prototype,"timeExtent",void 0),(0,n._)([(0,m.c)("timeExtent")],it.prototype,"writeTimeExtent",null),(0,n._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"viewId",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"processAsMultidimensional",void 0),it=tt=(0,n._)([(0,c.j)("esri.rest.support.ImageIdentifyParameters")],it);const rt=it;var nt;let st=nt=class extends T.wq{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(e,t,i){t.geometries={geometryType:"esriGeometryPoint",geometries:e.map((e=>e.toJSON()))}}clone(){return new nt({geometries:this.geometries.map((e=>e.clone())),rasterId:this.rasterId})}};(0,n._)([(0,u.Cb)({type:[re.Z],json:{write:!0}})],st.prototype,"geometries",void 0),(0,n._)([(0,m.c)("geometries")],st.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],st.prototype,"rasterId",void 0),st=nt=(0,n._)([(0,c.j)("esri.rest.support.ImagePixelLocationParameters")],st);const at=st;var ot;let lt=ot=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}set locations(e){if(e?.length){const t=new Le.Z({spatialReference:e[0].spatialReference});t.points=e.map((e=>[e.x,e.y])),this._set("locations",e),this.geometry=t}}clone(){return new ot((0,v.d9)({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};(0,n._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],lt.prototype,"geometry",void 0),(0,n._)([(0,m.c)("geometry")],lt.prototype,"writeGeometry",null),(0,n._)([(0,u.Cb)()],lt.prototype,"locations",null),(0,n._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],lt.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)({type:oe,json:{write:!0}})],lt.prototype,"mosaicRule",void 0),(0,n._)([(0,u.Cb)({type:[String],json:{write:!0}})],lt.prototype,"outFields",void 0),(0,n._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],lt.prototype,"pixelSize",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],lt.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],lt.prototype,"returnFirstValueOnly",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleDistance",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleCount",void 0),(0,n._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sliceId",void 0),(0,n._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],lt.prototype,"timeExtent",void 0),lt=ot=(0,n._)([(0,c.j)("esri.rest.support.ImageSampleParameters")],lt);const ut=lt;var pt=i(23808);const ct=w.Z.getLogger("esri.layers.mixins.ArcGISImageService"),mt=(0,R.w)()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),dt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),ht=(0,u.Eg)(p.q9,{min:0,max:255}),yt=e=>{let t=class extends e{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandCount=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelSizeX=null,this.pixelSizeY=null,this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.symbolizer=null,this.rasterAttributeTable=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new ue({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?oe.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get fieldsIndex(){return this.fields?new ce.Z(this.fields):null}set format(e){e&&dt.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?oe.fromJSON(i):this._isMosaicRuleSupported(t)?oe.fromJSON(t):null}writeMosaicRule(e,t,i){let r=this.mosaicRule;const n=this.definitionExpression;r?n&&n!==r.where&&(r=r.clone(),r.where=n):n&&(r=new oe({where:n})),this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=ht(e))}readObjectIdField(e,t){if(!e){const i=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=i&&i[0]&&i[0].name}return e}get parsedUrl(){return this.url?(0,S.mN)(this.url):null}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,n=(0,f.ij)(r,i);return null==n?null:("vector-field"===n.type&&t.symbolTileSize&&!r.symbolTileSize&&(n.symbolTileSize=t.symbolTileSize),H(n)||ct.warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),n)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new pe.Z({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new pe.Z({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new pe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let n=this.fields?(0,v.d9)(this.fields):[];n.push(i),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&n.push(t),this.version>=10.4&&(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&n.push(r),(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{n.push(new pe.Z({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),null==this.pixelFilter||"esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType||(n.push(new pe.Z({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),n.push(new pe.Z({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const s=this.rasterInfo.attributeTable&&this.rasterInfo.attributeTable.fields||null;if(s&&s.length>0){const t=s.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const i=(0,v.d9)(t);return i.name=e+t.name,i}));n=n.concat(t)}return n}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i&&i.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?J.fromJSON({rasterFunctionDefinition:t.renderingRule}):J.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,i){const r=e.toJSON();r.rasterFunctionDefinition?t[i]=r.rasterFunctionDefinition:t[i]=r}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?we.Z.fromJSON(i):null}readPixelType(e){return mt.fromJSON(e)||e}writePixelType(e,t,i){((0,a.Wi)(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[i]=mt.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e;if(!this._isPicture()&&this.renderer&&this.symbolizer&&!this.pixelFilter){const r=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),n=this._rasterJobHandler.instance,{bandIds:s}=this;if(n){r&&(this.symbolizer.bind(),await n.updateSymbolizer(this.symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await n.symbolize({bandIds:s,...e},t);i={extent:e.extent,pixelBlock:a}}else i={extent:e.extent,pixelBlock:this.symbolizer.symbolize({bandIds:s,...e})}}return i}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeAngles)throw new b.Z("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=(0,p.TJ)(We,e).clone(),async function(e,t,i){const r=t.toJSON();(0,a.pC)(r.angleName)&&(r.angleName=r.angleName.join(",")),(0,a.pC)(t.point)&&t.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Ae(t.point.spatialReference)),(0,a.pC)(t.spatialReference)&&t.spatialReference.imageCoordinateSystem&&(r.spatialReference=Je(t.spatialReference));const n=(0,ve.en)(e),s=(0,ve.cv)({...n.query,f:"json",...r}),o=(0,ve.lA)(s,i),{data:l}=await(0,g.default)(`${n.path}/computeAngles`,o);return l.spatialReference=l.spatialReference?null!=l.spatialReference.geodataXform?new we.Z({wkid:0,imageCoordinateSystem:l.spatialReference}):we.Z.fromJSON(l.spatialReference):null,"NaN"===l.north&&(l.north=null),"NaN"===l.up&&(l.up=null),new Se(l)}(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new b.Z("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=(0,p.TJ)(at,e).clone(),async function(e,t,i){const r=t.toJSON(),{geometries:n}=t;for(let e=0;e<n.length;e++)n[e].spatialReference?.imageCoordinateSystem&&(r.geometries.geometries[e].spatialReference=Ae(n[e].spatialReference));const s=(0,ve.en)(e),a=(0,ve.cv)({...s.query,f:"json",...r}),o=(0,ve.lA)(a,i),{data:l}=await(0,g.default)(`${s.path}/computePixelLocation`,o);return Te.fromJSON(l)}(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeHistograms)throw new b.Z("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:n}=this;return n&&null==e.renderingRule&&(e.renderingRule=n),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),n=(0,ve.en)(e),{data:s}=await(0,g.default)(`${n.path}/computeHistograms`,r);return{histograms:s.histograms}}(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new b.Z("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:n}=this;return n&&null==e.renderingRule&&(e.renderingRule=n),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),n=(0,ve.en)(e),{data:s}=await(0,g.default)(`${n.path}/computeStatisticsHistograms`,r),{statistics:a}=s;return a?.length&&a.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a,histograms:s.histograms}}(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return(0,a.pC)(t)?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,r={}){if(null==e||null==t||null==i)return Promise.reject(new b.Z("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const n=this.renderer||this.symbolizer?this.generateRasterInfo(this.renderingRule,{signal:r.signal}):null;return(0,l.gx)(n).then((n=>{n&&(this.rasterInfo=n);const s={imageServiceParameters:this.getExportImageServiceParameters(e,t,i,r.timeExtent),imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:r.requestAsImageElement&&!this.pixelFilter||!1,signal:r.signal};return this._requestArrayBuffer(s)}))}fetchKeyProperties(e){return(0,g.default)(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b.Z("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):(0,g.default)(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>Ce.default.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return async function(e,t,i){const r=(0,ve.en)(e),n=(0,ve.cv)({...r.query,f:"json"}),s=(0,ve.lA)(n,i),a=`${r.path}/${t}/info`,o=(0,g.default)(`${a}`,s),l=(0,g.default)(`${a}/keyProperties`,s),u=await Promise.allSettled([o,l]),p="fulfilled"===u[0].status?u[0].value.data:null,c="fulfilled"===u[1].status?u[1].value.data:null;let m=null;p.statistics?.length&&(m=p.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const d=qe.Z.fromJSON(p.extent),h=Math.ceil(d.width/p.pixelSizeX-.1),y=Math.ceil(d.height/p.pixelSizeY-.1),f=d.spatialReference,b=new re.Z({x:p.pixelSizeX,y:p.pixelSizeY,spatialReference:f}),R=p.histograms?.length?p.histograms:null,v=new Qe.Z({origin:p.origin,blockWidth:p.blockWidth,blockHeight:p.blockHeight,firstPyramidLevel:p.firstPyramidLevel,maximumPyramidLevel:p.maxPyramidLevel});return new de.Z({width:h,height:y,bandCount:p.bandCount,extent:d,spatialReference:f,pixelSize:b,pixelType:p.pixelType.toLowerCase(),statistics:m,histograms:R,keyProperties:c,storageInfo:v})}(this.parsedUrl.path,e,i)}async getCatalogItemICSInfo(e,t){const{data:i}=await(0,g.default)(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),r=i&&i.ics;if(!r)return;let n=null;try{n=(await(0,g.default)(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!n||!n.spatialReference)return{ics:r,icsToPixelTransform:null,icsExtent:null,northDirection:null};const s=this.version>=10.7?(0,g.default)(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=n.spatialReference,o={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[n]}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},l=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(o),...t}).then((e=>e.data)).catch((()=>({}))),u=(n.xmin+n.xmax)/2,p=(n.ymax-n.ymin)/6,c=n.ymin+p,m=[];for(let e=0;e<5;e++)m.push({x:u,y:c+p*e});const d={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:m}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},h=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(d),...t}).then((e=>e.data)).catch((()=>({}))),y=await Promise.all([s,l,h]);let f=y[0].ipxf;if(null==f){const e=r.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=qe.Z.fromJSON(y[1]&&y[1].geometries&&y[1].geometries[0]);b&&(b.spatialReference=new we.Z({wkid:0,imageCoordinateSystem:r}));const R=y[2].geometries?y[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],v=R.length;if(v<3)return{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:null};let w=0,_=0,S=0,C=0;for(let e=0;e<v;e++)w+=R[e].x,_+=R[e].y,S+=R[e].x*R[e].x,C+=R[e].x*R[e].y;const I=(v*C-w*_)/(v*S-w*w);let x=0;const F=R[4].x>R[0].x,T=R[4].y>R[0].y;return I===1/0?x=T?90:270:0===I?x=F?0:180:I>0?x=F?180*Math.atan(I)/Math.PI:180*Math.atan(I)/Math.PI+180:I<0&&(x=T?180+180*Math.atan(I)/Math.PI:360+180*Math.atan(I)/Math.PI),{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:x}}async generateRasterInfo(e,t){if((!e||"none"===e?.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))&&(0,a.pC)(this.serviceRasterInfo))return this.serviceRasterInfo;const i=function(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi)?.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return t?t.join("/"):null}(e);if(this._functionRasterInfos[i])return this._functionRasterInfos[i];const r=this._generateRasterInfo(e,t);this._functionRasterInfos[i]=r;try{return await r}catch{return this._functionRasterInfos[i]=null,null}}getExportImageServiceParameters(e,t,i,r){const n=Je((e=e.clone().shiftCentralMeridian()).spatialReference,this.parsedUrl.path);(0,a.pC)(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const s=this.exportImageServiceParameters.toJSON(),{bandIds:o,noData:l}=s;let{renderingRule:u}=s;const p=this.renderingRule?.rasterFunctionDefinition,c=!this.renderer||"raster-stretch"===this.renderer.type;if(o?.length&&this._hasRenderingRule(this.renderingRule)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;s.bandIds=void 0}else s.bandIds=o?.join(",");l instanceof Array&&l.length>0&&(s.noData=l.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,r):null;s.mosaicRule=m&&JSON.stringify(m),s.renderingRule=this._getRenderingRuleString(J.fromJSON(u));const d={};if(r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${null==e?"null":e},${null==t?"null":t}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:n,imageSR:n,size:t+","+i,...s,...d}}async getSamples(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsGetSamples)throw new b.Z("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=(0,p.TJ)(ut,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=t.toJSON();je(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const n=(await(0,Re.aX)(t.geometry))?.[0];(0,a.pC)(n)&&(r.geometry=n.toJSON());const s=(0,ve.en)(e),o=(0,ve.cv)({...s.query,f:"json",...r}),l=(0,ve.lA)(o,i),{data:u}=await(0,g.default)(`${s.path}/getSamples`,l),p=u?.samples?.map((e=>{const t="NaN"===e.value||""===e.value?null:e.value.split(" ").map((e=>Number(e)));return{...e,pixelValue:t}}));return Oe.fromJSON({samples:p})}(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsIdentify)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");e=(0,p.TJ)(rt,e).clone();const{raster:i,mosaicRule:r,renderingRule:n}=this;if(n&&null==e.renderingRule&&(e.renderingRule=n),r&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(r,e.timeExtent);e.mosaicRule=(0,a.Wg)(t)}return i&&null==e.raster&&(e.raster=i),Me(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new ke.Z;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,ze.e)(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,He.G)(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,Ue.P)(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new b.Z("imagery-layer: query-visible-rasters","missing query parameter");const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:n,showNoDataRecords:s}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p="raster.servicepixelvalue",c=this.rasterFunctionNamesIndex;if((0,a.pC)(e.outFields)&&(o=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>p.length)).map((e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new J({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const m=(0,a.Wi)(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),d=e.timeExtent||this.timeExtent,h=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d),y=this._getQueryParams({geometry:e.geometry,timeExtent:d,mosaicRule:h,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:i,returnCatalogItems:o,returnGeometry:m,raster:this.raster,maxItemCount:n?1:null});delete y.f;const f=new rt(y);try{await this.generateRasterInfo(this.renderingRule);const i=await Me(this.url,f,{signal:t?.signal,query:{...this.customParameters}}),n=e.outFields,l=i.value.toLowerCase().includes("nodata");if(!o||m||!i?.catalogItems?.features.length||!s&&l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:s,templateFields:n});const p=this.objectIdField||"ObjectId",c=i.catalogItems.features,d=c.map((e=>e.attributes?.[p])),h=new ke.Z({objectIds:d,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[p]}),y=await this.queryRasters(h);return y?.features?.length&&y.features.forEach((t=>{c.forEach((i=>{i.attributes[p]===t.attributes[p]&&(i.geometry=new Ze.Z(t.geometry),(0,a.pC)(e.outSpatialReference)&&(i.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:s,templateFields:n})}catch{throw new b.Z("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const i=(0,g.default)(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),r=(0,g.default)(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),n=await Promise.all([i,r]);return n[0]&&n[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:n[0]||null,histograms:n[1]||null}}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,pt.GE)(e.meshType,e.simulationSettings,e.flowData,(0,a.pC)(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),(0,a.pC)(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=(0,a.pC)(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):(0,Ge.g)(this.parsedUrl.path,t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set("serviceRasterInfo",e),e))),r=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,n=this._getRasterFunctionInfos();return Promise.all([i,r,n]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),ct.warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.own((0,_.YP)((()=>this.renderingRule),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))})));const t=(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.multidimensionalInfo;t&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo;if((0,a.Wi)(e)||(0,a.Wi)(this.multidimensionalInfo)||(0,a.Wi)(t)||(0,a.Wi)(i?.startField))return e;const{startField:r}=i;if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==r)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const n=e.multidimensionalDefinition.filter((e=>e.dimensionName===r)),s=(0,a.pC)(t.start)?t.start.getTime():null,o=(0,a.pC)(t.end)?t.end.getTime():null,l=null==s||null==o||s===o,u=l?[s||o]:[[s,o]],p=this.version>=10.8;if(n.length)n.forEach((e=>{e.dimensionName===r&&(p?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=l,e.values=u))}));else if(!p){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=r,e.isSlice=l,e.values=u})):e.multidimensionalDefinition.push(new F.Z({variableName:"",dimensionName:r,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return(0,a.Wi)(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsQuery)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=(0,a.pC)(e)?(0,p.TJ)(ke.Z,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new he.Z;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:i}=this;return"unique-value"===e.type&&this._hasRenderingRule(i)&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||(0,ge.U0)(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:i,ssl:r}=await(0,g.default)(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});t=i,this.sourceJSON=t,r&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly")>-1)throw new b.Z("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if((0,a.Wi)(e))return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),n=i?.ResampleType||i?.resampleType;return r&&(7===n||10===n)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){if(!this._isPicture()&&!this.pixelFilter){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=(0,ge.YD)(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=(0,ge.Ob)(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=(0,ge.ol)(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new be.Z({rendererJSON:t,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:(0,a.pC)(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){(0,a.pC)(e?.renderingRule)&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):(0,ye.J)(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:(await(0,g.default)(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:i,signal:r}=e;if(i&&!this.pixelFilter&&t.format?.indexOf("png")>-1)return{imageElement:(await(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r})).data,params:t};const n=this._initJobHandler(),s=(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r}),a=(await Promise.all([s,n]))[0].data,o=t.format||"jpgpng";let l=o;if("bsq"!==l&&"bip"!==l&&(l=(0,ye.y)(a)),!l)throw new b.Z("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(a)));const u={signal:r},p="gif"===o||"bmp"===o||o.includes("png")&&("png"===l||"jpg"===l)?(0,ye.J)(a,{useCanvas:!0,...t},u):this._decodePixelBlock(a,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:o},u);return{pixelData:{pixelBlock:await p,extent:t.extent},params:t}}_generateRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return(0,Ge.N)(this.parsedUrl.path,e,i)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=e.variables[0].dimensions,i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e],n=r.extent;let s=!0,a=[n[0]];r.hasRanges&&!0===r.hasRanges?(s=!1,a=[r.values[0]]):"stdz"===r.name.toLowerCase()&&Math.abs(n[1])<=Math.abs(n[0])&&(a=[n[1]]),i.push(new F.Z({variableName:"",dimensionName:t[e].name,isSlice:s,values:a}))}if(i.length>0){this.mosaicRule=this.mosaicRule||new oe;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=i)}}_processVisibleRastersResponse(e,t){t=t||{};const i=e.value,{templateRRFunctionNames:r,showNoDataRecords:n,returnDomainValues:s,templateFields:o}=t,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,p=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const c=this.objectIdField||"ObjectId",m="string"==typeof i&&i.toLowerCase().includes("nodata"),d=[];if(i&&!u&&!m){const e={};e[c]=0,p=[i],u=[new y.Z(this.fullExtent,null,e)]}if(!u)return[];let h,f,g;this._updateResponseFieldNames(u,o),m&&!n&&(u=[]);for(let e=0;e<u.length;e++){if(h=u[e],null!=i){if(f=p[e],g=this.renderingRule&&l&&l.length>0&&r&&r.length>0&&r.includes(this.renderingRule.functionName)?l[r.indexOf(this.renderingRule.functionName)]:i,"nodata"===f.toLowerCase()&&!n)continue;const t="Raster.ItemPixelValue",s="Raster.ServicePixelValue";h.attributes[t]=f,h.attributes[s]=g,this._updateFeatureWithMagDirValues(h,f);const o=this.fields&&this.fields.length>0;let u=this.renderingRule&&(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?o?f:i:g;this.renderingRule||(u=o?f:i),this._updateFeatureWithRasterAttributeTableValues(h,u)}if(h.sourceLayer=h.layer=this,s&&this._updateFeatureWithDomainValues(h),r&&l&&r.length===l.length)for(let e=0;e<r.length;e++){const t="Raster.ServicePixelValue."+r[e];h.attributes[t]=l[e]}d.push(u[e])}return d}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo&&this.rasterInfo.attributeTable||(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable,r=i&&i.features;if(!r)return;const n=i.fields,s=n.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),o=s&&s[0];if(!o)return;const l=r.filter((e=>e.attributes[o]===(null!=t?parseInt(t,10):null)));l&&l[0]&&n.forEach((t=>{const i=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[i]=l[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if("esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType)return;const i=t.split(/,\s*/).map((e=>parseFloat(e))),r=i.map((e=>[e])),n=i.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),s=new me.Z({height:1,width:1,pixelType:"f32",pixels:r,statistics:n});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:s,extent:new qe.Z(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[s.pixels[0][0],s.pixels[1][0]]:(0,fe.Tg)([s.pixels[0][0],s.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find((e=>e.code===i));r&&(e.attributes[t.name]=r.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;(0,a.Wi)(i)||e.forEach((e=>{if(e&&e.attributes)for(const r of t)if(i.has(r)){const t=i.get(r).name;t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(this._hasRenderingRule(e)){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRenderingRule(e){return e&&e.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replace(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:i,advancedQueryCapabilities:r,maxRecordCount:n}=e,s=t.includes("image"),a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsMeasure:t.includes("mensuration")&&o,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:i>=10.2&&s,supportsProject:i>=10.3&&s,supportsComputeStatisticsHistograms:i>=10.4&&s,supportsQueryBoundary:i>=10.6&&s,supportsCalculateVolume:i>=10.7&&a,supportsComputePixelLocation:i>=10.7&&t.includes("catalog"),supportsComputeAngles:i>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1},query:{maxRecordCount:n,maxRecordCountFactor:void 0,supportsStatistics:!!r?.supportsStatistics,supportsOrderBy:!!r?.supportsOrderBy,supportsDistinct:!!r?.supportsDistinct,supportsPagination:!!r?.supportsPagination,supportsStandardizedQueriesOnly:!!r?.useStandardizedQueries,supportsPercentileStatistics:!!r?.supportsPercentileStatistics,supportsCentroid:!!r?.supportsReturningGeometryCentroid,supportsDistance:!!r?.supportsQueryWithDistance,supportsExtent:!!r?.supportsReturningQueryExtent,supportsGeometryProperties:!!r?.supportsReturningGeometryProperties,supportsHavingClause:!!r?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!r?.supportsDefaultSR,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return(0,n._)([(0,u.Cb)()],t.prototype,"_functionRasterInfos",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,u.Cb)({dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"_defaultServiceMosaicRule",void 0),(0,n._)([(0,I.r)("_defaultServiceMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultServiceMosaicRule",null),(0,n._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSourceType",void 0),(0,n._)([(0,I.r)("_serviceSourceType",["serviceSourceType","fields"])],t.prototype,"readServiceSourceType",null),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),(0,n._)([(0,I.r)("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),(0,n._)([(0,u.Cb)()],t.prototype,"rasterAttributeTableFieldPrefix",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFunctionNamesIndex",null),(0,n._)([(0,u.Cb)()],t.prototype,"adjustAspectRatio",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.bandCount")],t.prototype,"bandCount",void 0),(0,n._)([(0,u.Cb)({type:[p.z8],json:{write:!0}})],t.prototype,"bandIds",void 0),(0,n._)([(0,I.r)("bandIds")],t.prototype,"readBandIds",null),(0,n._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),(0,n._)([(0,I.r)("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),(0,n._)([(0,u.Cb)({type:Number})],t.prototype,"compressionQuality",void 0),(0,n._)([(0,m.c)("compressionQuality")],t.prototype,"writeCompressionQuality",null),(0,n._)([(0,u.Cb)({type:Number})],t.prototype,"compressionTolerance",void 0),(0,n._)([(0,m.c)("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),(0,n._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,n._)([(0,u.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,type:[pe.Z]})],t.prototype,"fields",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"fieldsIndex",null),(0,n._)([(0,u.Cb)({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],t.prototype,"format",null),(0,n._)([(0,I.r)("service","format",["serviceDataType"])],t.prototype,"readFormat",null),(0,n._)([(0,u.Cb)({type:qe.Z})],t.prototype,"fullExtent",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),(0,n._)([(0,u.Cb)({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),(0,n._)([(0,u.Cb)({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),(0,n._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],t.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"minScale",void 0),(0,n._)([(0,I.r)("service","minScale")],t.prototype,"readMinScale",null),(0,n._)([(0,u.Cb)()],t.prototype,"maxScale",void 0),(0,n._)([(0,I.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,n._)([(0,u.Cb)({type:oe})],t.prototype,"mosaicRule",null),(0,n._)([(0,I.r)("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),(0,n._)([(0,m.c)("mosaicRule")],t.prototype,"writeMosaicRule",null),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.multidimensionalInfo")],t.prototype,"multidimensionalInfo",void 0),(0,n._)([(0,u.Cb)({json:{type:p.z8}})],t.prototype,"noData",void 0),(0,n._)([(0,m.c)("noData")],t.prototype,"writeNoData",null),(0,n._)([(0,u.Cb)({type:String,json:{type:le.k.jsonValues,read:le.k.read,write:le.k.write}})],t.prototype,"noDataInterpretation",void 0),(0,n._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),(0,n._)([(0,I.r)("objectIdField")],t.prototype,"readObjectIdField",null),(0,n._)([(0,u.Cb)({})],t.prototype,"geometryType",void 0),(0,n._)([(0,u.Cb)({})],t.prototype,"typeIdField",void 0),(0,n._)([(0,u.Cb)({})],t.prototype,"types",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"parsedUrl",null),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.pixelSize.x")],t.prototype,"pixelSizeX",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.pixelSize.y")],t.prototype,"pixelSizeY",void 0),(0,n._)([(0,u.Cb)({type:Function})],t.prototype,"pixelFilter",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"viewId",void 0),(0,n._)([(0,u.Cb)({types:f.dr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:f.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,n._)([(0,I.r)("renderer")],t.prototype,"readRenderer",null),(0,n._)([(0,m.c)("renderer")],t.prototype,"writeRenderer",null),(0,n._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),(0,n._)([(0,u.Cb)(x.Oh)],t.prototype,"opacity",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.attributeTable")],t.prototype,"rasterAttributeTable",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFields",null),(0,n._)([(0,u.Cb)({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),(0,n._)([(0,u.Cb)({type:J})],t.prototype,"renderingRule",null),(0,n._)([(0,I.r)("renderingRule",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRenderingRule",null),(0,n._)([(0,m.c)("renderingRule")],t.prototype,"writeRenderingRule",null),(0,n._)([(0,u.Cb)()],t.prototype,"serviceDataType",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,type:we.Z})],t.prototype,"spatialReference",void 0),(0,n._)([(0,I.r)("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),(0,n._)([(0,u.Cb)({json:{type:mt.jsonValues}})],t.prototype,"pixelType",void 0),(0,n._)([(0,I.r)("pixelType")],t.prototype,"readPixelType",null),(0,n._)([(0,m.c)("pixelType")],t.prototype,"writePixelType",null),(0,n._)([(0,u.Cb)({constructOnly:!0,type:de.Z})],t.prototype,"serviceRasterInfo",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,u.Cb)(x.HQ)],t.prototype,"url",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,n._)([(0,I.r)("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=(0,n._)([(0,c.j)("esri.layers.mixins.ArcGISImageService")],t),t};var ft=i(17287),gt=i(71612),bt=i(17017),Rt=i(38009),vt=i(16859),wt=i(34760),_t=i(72965),St=i(28294),Ct=i(60199),It=i(32163);let xt=class extends((0,gt.h)((0,St.n)((0,wt.Q)((0,_t.M)((0,Rt.q)((0,vt.I)(yt((0,bt.N)((0,ft.Y)((0,o.R)(d.Z))))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,a.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}writeOperationalLayerType(e,t,i){const r="vector-field"===this.renderer?.type;t[i]=r?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.rasterFields,i=this.title,r=new Set;let n=!1,s=!1;this.capabilities&&(n=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,s=n&&("esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType));const a=new Set;n&&(a.add("raster.itempixelvalue"),s&&a.add("raster.magnitude").add("raster.direction"));for(const e of t){const t=e.name.toLowerCase();a.has(t)||t.includes("raster.servicepixelvalue.")||r.add(e.name)}return(0,It.eZ)({fields:t,title:i},{...e,visibleFieldNames:r})}queryFeatures(e,t){return this.queryRasters(e,t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return(0,Ct.D)(this,e)}};(0,n._)([(0,u.Cb)(x.rn)],xt.prototype,"legendEnabled",void 0),(0,n._)([(0,u.Cb)({type:["show","hide"]})],xt.prototype,"listMode",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],xt.prototype,"isReference",void 0),(0,n._)([(0,u.Cb)({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],xt.prototype,"operationalLayerType",void 0),(0,n._)([(0,m.c)("web-map","operationalLayerType")],xt.prototype,"writeOperationalLayerType",null),(0,n._)([(0,u.Cb)(x.C_)],xt.prototype,"popupEnabled",void 0),(0,n._)([(0,u.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],xt.prototype,"popupTemplate",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],xt.prototype,"defaultPopupTemplate",null),(0,n._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],xt.prototype,"type",void 0),xt=(0,n._)([(0,c.j)("esri.layers.ImageryLayer")],xt);const Ft=xt},17287:(e,t,i)=>{i.d(t,{Y:()=>u});var r=i(43697),n=i(92604),s=i(70586),a=i(5600),o=(i(67676),i(80442),i(75215),i(52011)),l=i(66677);const u=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,s.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,n.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,a.Cb)()],t.prototype,"title",null),(0,r._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>v});var r=i(43697),n=i(40330),s=i(3172),a=i(66643),o=i(20102),l=i(92604),u=i(70586),p=i(95330),c=i(17452),m=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),h=i(52011),y=i(30556),f=i(65587),g=i(15235),b=i(86082);const R=l.Z.getLogger("esri.layers.mixins.PortalLayer"),v=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,p.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||R.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const i=w.credential===t?w.user:await this._fetchEditingUser(e);return w.credential=t,w.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=n.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,o=f.Z.getDefault();if(o&&o.loaded&&(0,c.Fv)(o.restUrl)===(0,c.Fv)(r))return o.user;const l=`${r}/community/self`,p=(0,u.pC)(e)?e.signal:null,m=await(0,a.q6)((0,s.default)(l,{authMode:"no-prompt",query:{f:"json"},signal:p}));return m.ok?b.default.fromJSON(m.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return i&&r&&!(0,c.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,m.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,r._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,m.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,m.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,h.j)("esri.layers.mixins.PortalLayer")],t),t},w={credential:null,user:null}},41818:(e,t,i)=>{i.d(t,{P:()=>a});var r=i(11282),n=i(34599),s=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,n.executeQueryForCount)(a,s.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>a});var r=i(11282),n=i(34599),s=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,n.executeQueryForIds)(a,s.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>l,e:()=>o});var r=i(11282),n=i(34599),s=i(74889),a=i(57444);async function o(e,t,i){const r=await l(e,t,i);return s.default.fromJSON(r)}async function l(e,t,i){const s=(0,r.en)(e),o={...i},l=a.Z.from(t),{data:u}=await(0,n.executeQuery)(s,l,l.sourceSpatialReference,o);return u}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,n=i(43697),s=i(96674),a=i(5600),o=(i(67676),i(80442),i(75215)),l=i(52011);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let p=r=class extends s.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const n=t.find((e=>e.name===i));return n?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:n.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,n._)([(0,a.Cb)({type:String})],p.prototype,"contentType",void 0),(0,n._)([(0,a.Cb)()],p.prototype,"exifInfo",void 0),(0,n._)([(0,a.Cb)({readOnly:!0})],p.prototype,"orientationInfo",null),(0,n._)([(0,a.Cb)({type:o.z8})],p.prototype,"id",void 0),(0,n._)([(0,a.Cb)({type:String})],p.prototype,"globalId",void 0),(0,n._)([(0,a.Cb)({type:String})],p.prototype,"keywords",void 0),(0,n._)([(0,a.Cb)({type:String})],p.prototype,"name",void 0),(0,n._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentGlobalId",void 0),(0,n._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentObjectId",void 0),(0,n._)([(0,a.Cb)({type:o.z8})],p.prototype,"size",void 0),(0,n._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"url",void 0),p=r=(0,n._)([(0,l.j)("esri.layers.support.AttachmentInfo")],p);const c=p}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7175],{47175:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ft});var r,s=i(43697),n=i(51773),a=i(70586),o=i(16453),l=i(95330),u=i(5600),p=(i(67676),i(80442),i(75215)),c=i(52011),m=i(30556),d=i(87085),h=i(66577),y=i(38171),f=i(30030),g=i(3172),b=i(20102),R=i(35454),v=i(22974),w=i(92604),_=i(17445),S=i(17452),C=i(44422),I=i(71715),x=i(21506),F=i(35956),T=i(96674),N=i(36030);const D=new Set(["raster","raster2","dem","fillraster"]),P=new Set(["rasters"]),O=e=>e&&e.rasterFunction?A.fromJSON(e):e,j=e=>e&&e instanceof A?e.toJSON():e,V=e=>e?.functionName&&!e.declaredClass,M=e=>V(e)?new A(e):e;let A=r=class extends T.wq{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some((t=>D.has(t.toLowerCase())&&V(e[t])))||t.some((t=>P.has(t.toLowerCase())&&Array.isArray(e[t])&&e[t].some((e=>V(e)))))){e=(0,v.d9)(e);for(const i of t)D.has(i.toLowerCase())?e[i]=M(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map((e=>M(e))))}}this._set("functionArguments",e)}readFunctionArguments(e){return(e=>{if(null==e)return null;e=(0,v.d9)(e);const t={};for(const i of Object.keys(e))D.has(i.toLowerCase())?t[i]=O(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(O):t[i]=e[i];return t})(e)}writeFunctionArguments(e,t,i){const r={};for(const t of Object.keys(e))D.has(t.toLowerCase())?r[t]=j(e[t]):P.has(t.toLowerCase())&&Array.isArray(e[t])?r[t]=e[t].map(j):r[t]=j(e[t]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&"None"!==i[0].name?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new r({functionName:this.functionName,functionArguments:(0,v.d9)(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:(0,v.d9)(this.rasterFunctionDefinition)})}};(0,s._)([(0,u.Cb)({json:{type:Object,name:"rasterFunctionArguments"}})],A.prototype,"functionArguments",null),(0,s._)([(0,I.r)("functionArguments")],A.prototype,"readFunctionArguments",null),(0,s._)([(0,m.c)("functionArguments")],A.prototype,"writeFunctionArguments",null),(0,s._)([(0,u.Cb)({json:{type:String,write:{target:"rasterFunction"}}})],A.prototype,"functionName",void 0),(0,s._)([(0,I.r)("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],A.prototype,"readFunctionName",null),(0,s._)([(0,N.J)({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),(0,u.Cb)({json:{default:"unknown"}})],A.prototype,"outputPixelType",void 0),(0,s._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],A.prototype,"variableName",void 0),(0,s._)([(0,u.Cb)({type:Object,json:{name:"rasterFunctionDefinition"}})],A.prototype,"rasterFunctionDefinition",void 0),A=r=(0,s._)([(0,c.j)("esri.layers.support.RasterFunction")],A);const J=A,E={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}};var z=i(93010),q=i(75509),L=i(27922);const Z={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},k={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},U=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function H(e){return U.has(e.type)}function Q(e,t){if(!e||!t)return(0,v.d9)(e||t);const i=(0,v.d9)(e);if(t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),G(i.rasterFunctionDefinition.arguments,t)}else"none"!==t.functionName.toLowerCase()&&(W(i.functionArguments).Raster=t);return i}function G(e,t){for(const i in e)"raster"===i.toLowerCase()&&("RasterFunctionVariable"===e[i].type?(e[i]=t.rasterFunctionDefinition,e[i].type="RasterFunctionTemplate"):"RasterFunctionTemplate"===e[i].type&&G(e[i].arguments,t))}function B(e){const t=(0,v.d9)(E[e.functionName+"Function"]),i=e.functionArguments;for(const e in i)"raster"===e.toLowerCase()?(t.arguments[e]=B(i[e]),t.arguments[e].type="RasterFunctionTemplate"):"colormap"===e.toLowerCase()?(t.arguments[e].value=ee(i[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=i[e];return t}function W(e){const t=e.Raster;return t&&"esri.layers.support.RasterFunction"===t.declaredClass?W(t.functionArguments):e}const $={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function K(e,t){const i=Z[String(t).toLowerCase()];return i&&e.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),e}function X(e){if(!e)return;const{fields:t}=e,i=t&&t.find((e=>e&&e.name&&"value"===e.name.toLowerCase()));return i&&i.name}function Y(e){const t=[];return e.forEach((e=>{const i=e;if(Array.isArray(i))t.push(i);else{if(null==i.min||null==i.max)return;const e=[i.min,i.max,i.avg||0,i.stddev||0];t.push(e)}})),t}function ee(e){const t=[],i=[];return e.forEach((e=>{t.push(e[0]),i.push((0,z.io)([...e.slice(1),255]))})),{type:"RasterColormap",values:t,colors:i}}var te,ie=i(90578),re=i(13473);const se=(0,R.w)()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),ne=(0,R.w)()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});let ae=te=class extends T.wq{constructor(e){super(e),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}readMethod(e,t){return function(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return ne.fromJSON(t)}(t.mosaicMethod||t.defaultMosaicMethod)}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),s=i||(r?se.toJSON(r):null);return se.fromJSON(s)||"first"}castSortValue(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`}clone(){return new te({ascending:this.ascending,itemRenderingRule:(0,v.d9)(this.itemRenderingRule),lockRasterIds:(0,v.d9)(this.lockRasterIds),method:this.method,multidimensionalDefinition:(0,v.d9)(this.multidimensionalDefinition),objectIds:(0,v.d9)(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:(0,v.d9)(this.viewpoint),where:this.where})}};(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],ae.prototype,"ascending",void 0),(0,s._)([(0,I.r)("ascending",["ascending","sortAscending"])],ae.prototype,"readAscending",null),(0,s._)([(0,u.Cb)({type:J,json:{write:!0}})],ae.prototype,"itemRenderingRule",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],ae.prototype,"lockRasterIds",void 0),(0,s._)([(0,u.Cb)({type:String,json:{type:ne.jsonValues,write:{target:"mosaicMethod",writer:ne.write}}})],ae.prototype,"method",void 0),(0,s._)([(0,I.r)("method",["mosaicMethod","defaultMosaicMethod"])],ae.prototype,"readMethod",null),(0,s._)([(0,u.Cb)({type:[F.Z],json:{write:!0}})],ae.prototype,"multidimensionalDefinition",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{name:"fids",write:!0}})],ae.prototype,"objectIds",void 0),(0,s._)([(0,u.Cb)({json:{type:se.jsonValues,read:{reader:se.read},write:{target:"mosaicOperation",writer:se.write}}})],ae.prototype,"operation",void 0),(0,s._)([(0,I.r)("operation",["mosaicOperation","mosaicOperator"])],ae.prototype,"readOperation",null),(0,s._)([(0,u.Cb)({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],ae.prototype,"sortField",void 0),(0,s._)([(0,u.Cb)({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],ae.prototype,"sortValue",void 0),(0,s._)([(0,ie.p)("sortValue")],ae.prototype,"castSortValue",null),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],ae.prototype,"viewpoint",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],ae.prototype,"where",void 0),ae=te=(0,s._)([(0,c.j)("esri.layers.support.MosaicRule")],ae);const oe=ae;var le=i(69608);let ue=class extends T.wq{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.bandIds=void 0,this.compression=void 0,this.compressionQuality=void 0,this.compressionTolerance=.01,this.format=null,this.interpolation=null,this.noData=null,this.noDataInterpretation=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(e,t,i){this.layer.version<10.3||(t[i]=e)}writeCompressionQuality(e,t,i){this.format&&this.format.toLowerCase().includes("jpg")&&null!=e&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}writeLercVersion(e,t,i){"lerc"===this.format&&this.layer.version>=10.5&&(t[i]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("renderingRule"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("renderer"),e.commitProperty("definitionExpression"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const i=e.definitionExpression;return t?i&&i!==t.where&&(t=t.clone(),t.where=i):i&&(t=new oe({where:i})),t}get renderingRule(){const e=this.layer;let t=e.renderingRule;const i=e.pixelFilter,r=!e.format||e.format.includes("jpg")||e.format.includes("png");return t=this._addResampleRasterFunction(t),r&&!i&&(t=this.combineRendererWithRenderingRule()),t}combineRendererWithRenderingRule(){const e=this.layer,{rasterInfo:t,renderingRule:i,renderer:r}=e;return r&&H(r)?Q(function(e,t){switch(t=t||{},e.type){case"raster-stretch":return function(e,t){const i=t.convertToRFT,r=new J;r.functionName="Stretch";const s=$[q.v.toJSON(e.stretchType)],n="u8",a={StretchType:s,Statistics:Y(e.statistics),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(a.Min=e.outputMin),null!=e.outputMax&&(a.Max=e.outputMax),s===$.standardDeviation?(a.NumberOfStandardDeviations=e.numberOfStandardDeviations,r.outputPixelType=n):s===$.percentClip?(a.MinPercent=e.minPercent,a.MaxPercent=e.maxPercent,r.outputPixelType=n):s===$.minMax?r.outputPixelType=n:s===$.sigmoid&&(a.SigmoidStrengthLevel=e.sigmoidStrengthLevel),r.functionArguments=a,r.variableName="Raster",e.colorRamp){const s=e.colorRamp,n=new J;if(i)n.functionArguments={ColorRamp:(0,z.pM)(s)};else{const i=(0,z.Uh)(s);i?n.functionArguments={colorRamp:i}:!t.convertColorRampToColormap||"algorithmic"!==s.type&&"multipart"!==s.type?n.functionArguments={colorRamp:e.colorRamp.toJSON()}:n.functionArguments={Colormap:(0,z.Jw)(s,256)}}return n.variableName="Raster",n.functionName="Colormap",n.functionArguments.Raster=r,i?new J({rasterFunctionDefinition:B(n)}):n}return i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"class-breaks":return function(e,t){const i=[],r=[],s=[],n=[],a=1e-6,{pixelType:o,rasterAttributeTable:l}=t,u=l&&l.features,p=X(l);if(u&&Array.isArray(u)&&e.classBreakInfos){e.classBreakInfos.forEach(((t,i)=>{const r=t.symbol.color;let s;r.a&&u.forEach((a=>{s=a.attributes[e.field],(s>=t.minValue&&s<t.maxValue||i===e.classBreakInfos.length-1&&s>=t.minValue)&&n.push([a.attributes[p],r.r,r.g,r.b])}))}));const i=o?K(n,o):n,r=new J;return r.functionName="Colormap",r.functionArguments={},r.functionArguments.Colormap=i,r.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(r)}):r}e.classBreakInfos.forEach(((e,t)=>{const o=e.symbol&&e.symbol.color;o.a?(0===t?i.push(e.minValue,e.maxValue+a):i.push(e.minValue+a,e.maxValue+a),r.push(t),n.push([t,o.r,o.g,o.b])):s.push(e.minValue,e.maxValue)}));const c=o?K(n,o):n,m=new J;m.functionName="Remap",m.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:s},m.variableName="Raster";const d=new J;return d.functionName="Colormap",d.functionArguments={Colormap:c,Raster:m},t.convertToRFT?new J({rasterFunctionDefinition:B(d)}):d}(e,t);case"unique-value":return function(e,t){const i=[],{pixelType:r,rasterAttributeTable:s}=t,n=s&&s.features,a=X(s),o=e.defaultSymbol?.color?.toRgb(),l=e.uniqueValueInfos;if(l)if(n){const t=new Map;l.forEach((e=>{const i=e.value,r=e.symbol.color?.toRgb();null!=i&&r&&t.set(String(i),r)}));const r=e.field;n.forEach((({attributes:e})=>{const s=String(e[r]),n=e[a];if(t.has(s)){const e=t.get(s);i.push([n,...e])}else o&&i.push([n,...o])}))}else for(let e=0;e<l.length;e++){const t=l[e],r=t.symbol.color,s=+t.value;if(r?.a){if(isNaN(s))return null;i.push([s,r.r,r.g,r.b])}}const u=r&&i.length>0?K(i,r):i,p=new J;return p.functionName="Colormap",p.functionArguments={},p.functionArguments.Colormap=u,p.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(p)}):p}(e,t);case"raster-colormap":return function(e,t){const i=e.extractColormap();if(!i||0===i.length)return;const{pixelType:r}=t,s=r?K(i,r):i,n=new J;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=s,t.convertToRFT?new J({rasterFunctionDefinition:B(n)}):n}(e,t);case"vector-field":return function(e,t){const i=new J;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:s}=t,n="vector-uv"===r;let a,o;s&&2===s.length&&(a=s.map((e=>e.BandName.toLowerCase())).indexOf("magnitude"),o=s.map((e=>e.BandName.toLowerCase())).indexOf("direction")),-1!==a&&null!==a||(a=0,o=1);const l="arithmetic"===e.rotationType?1:2,u="flow-from"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>"Magnitude"===e.field)):new L.Z,c={magnitudeBandID:a,directionBandID:o,isUVComponents:n,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:k[e.style.toLowerCase().replace("-","_")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};return i.functionArguments=c,t.convertToRFT?new J({rasterFunctionDefinition:B(i)}):i}(e,t);case"raster-shaded-relief":return function(e,t){const i=t.convertToRFT;if("elevation"!==t.dataType)return new J;const r=new J;r.functionName="Hillshade";const s="traditional"===e.hillshadeType?0:1,n="none"===e.scalingType?1:3,a={HillshadeType:s,SlopeType:n,ZFactor:e.zFactor};return 0===s&&(a.Azimuth=e.azimuth,a.Altitude=e.altitude),3===n&&(a.PSPower=e.pixelSizePower,a.PSZFactor=e.pixelSizeFactor),r.functionArguments=a,r.variableName="Raster",e.colorRamp&&(r.functionName="ShadedRelief",i?a.ColorRamp=(0,z.pM)(e.colorRamp):a.Colormap=(0,z.Jw)(e.colorRamp,256)),i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"flow":throw new Error("Unsupported rendering rule.")}}(r,{rasterAttributeTable:t.attributeTable,pixelType:t.pixelType,dataType:t.dataType,bandProperties:t.keyProperties?.BandProperties,convertColorRampToColormap:e.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition}),i):i}_addResampleRasterFunction(e){if("vector-field"!==this.layer.renderer?.type||"Resample"===e?.functionName)return e;const t="esriImageServiceDataTypeVector-UV"===this.layer.serviceDataType?7:10;let i=new J({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:{x:this.layer.pixelSizeX,y:this.layer.pixelSizeY}}});return i=e?.rasterFunctionDefinition?new J({rasterFunctionDefinition:B(i)}):i,Q(i,e)}};(0,s._)([(0,u.Cb)()],ue.prototype,"layer",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"adjustAspectRatio",void 0),(0,s._)([(0,m.c)("adjustAspectRatio")],ue.prototype,"writeAdjustAspectRatio",null),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.bandIds")],ue.prototype,"bandIds",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"compression",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.compressionQuality")],ue.prototype,"compressionQuality",void 0),(0,s._)([(0,m.c)("compressionQuality")],ue.prototype,"writeCompressionQuality",null),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.compressionTolerance")],ue.prototype,"compressionTolerance",void 0),(0,s._)([(0,m.c)("compressionTolerance")],ue.prototype,"writeCompressionTolerance",null),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.format")],ue.prototype,"format",void 0),(0,s._)([(0,u.Cb)({type:String,json:{read:{reader:le.c.read},write:{writer:le.c.write}}}),(0,C.B)("layer.interpolation")],ue.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,C.B)("layer.noData")],ue.prototype,"noData",void 0),(0,s._)([(0,u.Cb)({type:String,json:{read:{reader:le.k.read},write:{writer:le.k.write}}}),(0,C.B)("layer.noDataInterpretation")],ue.prototype,"noDataInterpretation",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"pixelType",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"lercVersion",void 0),(0,s._)([(0,m.c)("lercVersion")],ue.prototype,"writeLercVersion",null),(0,s._)([(0,u.Cb)({type:Number})],ue.prototype,"version",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"mosaicRule",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"renderingRule",null),ue=(0,s._)([(0,c.j)("esri.layers.mixins.ExportImageServiceParameters")],ue);var pe=i(1231),ce=i(99514),me=i(54163),de=i(48526),he=i(88281),ye=i(75993),fe=i(80676),ge=i(67058),be=i(91219),Re=i(82526),ve=i(11282),we=i(82971);let _e=class extends T.wq{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"north",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],_e.prototype,"up",void 0),(0,s._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],_e.prototype,"spatialReference",void 0),_e=(0,s._)([(0,c.j)("esri.rest.support.ImageAngleResult")],_e);const Se=_e;var Ce=i(74889);let Ie=class extends T.wq{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"catalogItemVisibilities",void 0),(0,s._)([(0,u.Cb)({type:Ce.default,json:{write:!0}})],Ie.prototype,"catalogItems",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ie.prototype,"location",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"name",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"objectId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"processedValues",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"properties",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"value",void 0),Ie=(0,s._)([(0,c.j)("esri.rest.support.ImageIdentifyResult")],Ie);const xe=Ie;let Fe=class extends T.wq{constructor(){super(...arguments),this.geometries=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Fe.prototype,"geometries",void 0),Fe=(0,s._)([(0,c.j)("esri.rest.support.ImagePixelLocationResult")],Fe);const Te=Fe;let Ne=class extends T.wq{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"attributes",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ne.prototype,"location",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"locationId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"rasterId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"resolution",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"pixelValue",void 0),Ne=(0,s._)([(0,c.j)("esri.rest.support.ImageSample")],Ne);const De=Ne;let Pe=class extends T.wq{constructor(){super(...arguments),this.samples=null}};(0,s._)([(0,u.Cb)({type:[De],json:{write:!0}})],Pe.prototype,"samples",void 0),Pe=(0,s._)([(0,c.j)("esri.rest.support.ImageSampleResult")],Pe);const Oe=Pe;function je(e){const t=e?.time;if(t&&(null!=t.start||null!=t.end)){const i=[];null!=t.start&&i.push(t.start),null==t.end||i.includes(t.end)||i.push(t.end),e.time=i.join(",")}}async function Ve(e,t,i){const r=(0,ve.en)(e),s=t.geometry?[t.geometry]:[],n=await(0,Re.aX)(s),o=t.toJSON();je(o);const l=n&&n[0];(0,a.pC)(l)&&(o.geometry=l.toJSON());const u=(0,ve.cv)({...r.query,f:"json",...o});return(0,ve.lA)(u,i)}async function Me(e,t,i){const r=(0,ve.en)(e),s=t.geometry?[t.geometry]:[];return(0,Re.aX)(s).then((e=>{const s=t.toJSON(),n=e&&e[0];(0,a.pC)(n)&&(s.geometry=JSON.stringify(n.toJSON()));const o=(0,ve.cv)({...r.query,f:"json",...s}),l=(0,ve.lA)(o,i);return(0,g.default)(r.path+"/identify",l)})).then((e=>xe.fromJSON(e.data)))}function Ae(e){const{imageCoordinateSystem:t}=e;if(t){const{id:e,referenceServiceName:i}=t;return null!=e?i?{icsid:e,icsns:i}:{icsid:e}:{ics:t}}return e.toJSON()}function Je(e,t){const i=Ae(e),{icsid:r,icsns:s,wkid:n}=i;return null!=r?null==s||t?.toLowerCase().includes("/"+s.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):n?n.toString():JSON.stringify(i)}i(10158);var Ee,ze=i(4967),qe=(i(67900),i(8744),i(98732),i(6570)),Le=(i(9361),i(65091)),Ze=i(38913),ke=(i(58901),i(45091),i(57444)),Ue=(i(40330),i(98326),i(56545),i(41818)),He=i(5396),Qe=(i(75935),i(28141),i(26059)),Ge=i(36679);let Be=Ee=class extends T.wq{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ee((0,v.d9)({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};(0,s._)([(0,u.Cb)({type:[String],json:{name:"angleName",write:!0}})],Be.prototype,"angleNames",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Be.prototype,"point",void 0),(0,s._)([(0,u.Cb)({type:we.Z,json:{write:!0}})],Be.prototype,"spatialReference",void 0),(0,s._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],Be.prototype,"rasterId",void 0),Be=Ee=(0,s._)([(0,c.j)("esri.rest.support.ImageAngleParameters")],Be);const We=Be;var $e,Ke=i(92835),Xe=i(33955);let Ye=$e=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}clone(){return new $e((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],Ye.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],Ye.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:oe,json:{write:!0}})],Ye.prototype,"mosaicRule",void 0),(0,s._)([(0,u.Cb)({type:J,json:{write:!0}})],Ye.prototype,"renderingRule",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],Ye.prototype,"pixelSize",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],Ye.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],Ye.prototype,"timeExtent",void 0),Ye=$e=(0,s._)([(0,c.j)("esri.rest.support.ImageHistogramParameters")],Ye);const et=Ye;var tt;let it=tt=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON()))}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}writeRenderingRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[i]=JSON.stringify(e.rasterFunctionDefinition))}writeRenderingRules(e,t,i){null!=e&&(t[i]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,i){null!=e&&(t[i]=JSON.stringify(e))}writeTimeExtent(e,t,i){if(null!=e){const r=(0,a.pC)(e.start)?e.start.getTime():null,s=(0,a.pC)(e.end)?e.end.getTime():null;t[i]=null!=r?null!=s?`${r},${s}`:`${r}`:null}}clone(){return new tt((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],it.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:oe,json:{write:!0}})],it.prototype,"mosaicRule",null),(0,s._)([(0,m.c)("mosaicRule")],it.prototype,"writeMosaicRule",null),(0,s._)([(0,u.Cb)({type:J,json:{write:!0}})],it.prototype,"renderingRule",null),(0,s._)([(0,m.c)("renderingRule")],it.prototype,"writeRenderingRule",null),(0,s._)([(0,u.Cb)({type:[J],json:{write:!0}})],it.prototype,"renderingRules",void 0),(0,s._)([(0,m.c)("renderingRules")],it.prototype,"writeRenderingRules",null),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],it.prototype,"pixelSize",void 0),(0,s._)([(0,m.c)("pixelSize")],it.prototype,"writePixelSize",null),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnGeometry",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnCatalogItems",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"returnPixelValues",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],it.prototype,"maxItemCount",void 0),(0,s._)([(0,u.Cb)({type:Ke.Z,json:{write:{target:"time"}}})],it.prototype,"timeExtent",void 0),(0,s._)([(0,m.c)("timeExtent")],it.prototype,"writeTimeExtent",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],it.prototype,"viewId",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],it.prototype,"processAsMultidimensional",void 0),it=tt=(0,s._)([(0,c.j)("esri.rest.support.ImageIdentifyParameters")],it);const rt=it;var st;let nt=st=class extends T.wq{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(e,t,i){t.geometries={geometryType:"esriGeometryPoint",geometries:e.map((e=>e.toJSON()))}}clone(){return new st({geometries:this.geometries.map((e=>e.clone())),rasterId:this.rasterId})}};(0,s._)([(0,u.Cb)({type:[re.Z],json:{write:!0}})],nt.prototype,"geometries",void 0),(0,s._)([(0,m.c)("geometries")],nt.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],nt.prototype,"rasterId",void 0),nt=st=(0,s._)([(0,c.j)("esri.rest.support.ImagePixelLocationParameters")],nt);const at=nt;var ot;let lt=ot=class extends T.wq{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Xe.Ji)(e),t[i]=e.toJSON())}set locations(e){if(e?.length){const t=new Le.Z({spatialReference:e[0].spatialReference});t.points=e.map((e=>[e.x,e.y])),this._set("locations",e),this.geometry=t}}clone(){return new ot((0,v.d9)({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({types:h.qM,json:{read:Xe.im}})],lt.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],lt.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)()],lt.prototype,"locations",null),(0,s._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],lt.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)({type:oe,json:{write:!0}})],lt.prototype,"mosaicRule",void 0),(0,s._)([(0,u.Cb)({type:[String],json:{write:!0}})],lt.prototype,"outFields",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],lt.prototype,"pixelSize",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],lt.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],lt.prototype,"returnFirstValueOnly",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleDistance",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sampleCount",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],lt.prototype,"sliceId",void 0),(0,s._)([(0,u.Cb)({type:Ke.Z,json:{read:{source:"time"},write:{target:"time"}}})],lt.prototype,"timeExtent",void 0),lt=ot=(0,s._)([(0,c.j)("esri.rest.support.ImageSampleParameters")],lt);const ut=lt;var pt=i(23808);const ct=w.Z.getLogger("esri.layers.mixins.ArcGISImageService"),mt=(0,R.w)()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),dt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),ht=(0,u.Eg)(p.q9,{min:0,max:255}),yt=e=>{let t=class extends e{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandCount=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelSizeX=null,this.pixelSizeY=null,this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.symbolizer=null,this.rasterAttributeTable=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new ue({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?oe.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get fieldsIndex(){return this.fields?new ce.Z(this.fields):null}set format(e){e&&dt.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?oe.fromJSON(i):this._isMosaicRuleSupported(t)?oe.fromJSON(t):null}writeMosaicRule(e,t,i){let r=this.mosaicRule;const s=this.definitionExpression;r?s&&s!==r.where&&(r=r.clone(),r.where=s):s&&(r=new oe({where:s})),this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=ht(e))}readObjectIdField(e,t){if(!e){const i=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=i&&i[0]&&i[0].name}return e}get parsedUrl(){return this.url?(0,S.mN)(this.url):null}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=(0,f.ij)(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),H(s)||ct.warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new pe.Z({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new pe.Z({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new pe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let s=this.fields?(0,v.d9)(this.fields):[];s.push(i),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&s.push(t),this.version>=10.4&&(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&s.push(r),(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{s.push(new pe.Z({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),null==this.pixelFilter||"esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType||(s.push(new pe.Z({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),s.push(new pe.Z({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const n=this.rasterInfo.attributeTable&&this.rasterInfo.attributeTable.fields||null;if(n&&n.length>0){const t=n.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const i=(0,v.d9)(t);return i.name=e+t.name,i}));s=s.concat(t)}return s}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i&&i.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?J.fromJSON({rasterFunctionDefinition:t.renderingRule}):J.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,i){const r=e.toJSON();r.rasterFunctionDefinition?t[i]=r.rasterFunctionDefinition:t[i]=r}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?we.Z.fromJSON(i):null}readPixelType(e){return mt.fromJSON(e)||e}writePixelType(e,t,i){((0,a.Wi)(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[i]=mt.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e;if(!this._isPicture()&&this.renderer&&this.symbolizer&&!this.pixelFilter){const r=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),s=this._rasterJobHandler.instance,{bandIds:n}=this;if(s){r&&(this.symbolizer.bind(),await s.updateSymbolizer(this.symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await s.symbolize({bandIds:n,...e},t);i={extent:e.extent,pixelBlock:a}}else i={extent:e.extent,pixelBlock:this.symbolizer.symbolize({bandIds:n,...e})}}return i}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeAngles)throw new b.Z("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=(0,p.TJ)(We,e).clone(),async function(e,t,i){const r=t.toJSON();(0,a.pC)(r.angleName)&&(r.angleName=r.angleName.join(",")),(0,a.pC)(t.point)&&t.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Ae(t.point.spatialReference)),(0,a.pC)(t.spatialReference)&&t.spatialReference.imageCoordinateSystem&&(r.spatialReference=Je(t.spatialReference));const s=(0,ve.en)(e),n=(0,ve.cv)({...s.query,f:"json",...r}),o=(0,ve.lA)(n,i),{data:l}=await(0,g.default)(`${s.path}/computeAngles`,o);return l.spatialReference=l.spatialReference?null!=l.spatialReference.geodataXform?new we.Z({wkid:0,imageCoordinateSystem:l.spatialReference}):we.Z.fromJSON(l.spatialReference):null,"NaN"===l.north&&(l.north=null),"NaN"===l.up&&(l.up=null),new Se(l)}(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new b.Z("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=(0,p.TJ)(at,e).clone(),async function(e,t,i){const r=t.toJSON(),{geometries:s}=t;for(let e=0;e<s.length;e++)s[e].spatialReference?.imageCoordinateSystem&&(r.geometries.geometries[e].spatialReference=Ae(s[e].spatialReference));const n=(0,ve.en)(e),a=(0,ve.cv)({...n.query,f:"json",...r}),o=(0,ve.lA)(a,i),{data:l}=await(0,g.default)(`${n.path}/computePixelLocation`,o);return Te.fromJSON(l)}(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeHistograms)throw new b.Z("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),s=(0,ve.en)(e),{data:n}=await(0,g.default)(`${s.path}/computeHistograms`,r);return{histograms:n.histograms}}(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new b.Z("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(et,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Ve(e,t,i),s=(0,ve.en)(e),{data:n}=await(0,g.default)(`${s.path}/computeStatisticsHistograms`,r),{statistics:a}=n;return a?.length&&a.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a,histograms:n.histograms}}(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return(0,a.pC)(t)?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,r={}){if(null==e||null==t||null==i)return Promise.reject(new b.Z("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const s=this.renderer||this.symbolizer?this.generateRasterInfo(this.renderingRule,{signal:r.signal}):null;return(0,l.gx)(s).then((s=>{s&&(this.rasterInfo=s);const n={imageServiceParameters:this.getExportImageServiceParameters(e,t,i,r.timeExtent),imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:r.requestAsImageElement&&!this.pixelFilter||!1,signal:r.signal};return this._requestArrayBuffer(n)}))}fetchKeyProperties(e){return(0,g.default)(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b.Z("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):(0,g.default)(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>Ce.default.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return async function(e,t,i){const r=(0,ve.en)(e),s=(0,ve.cv)({...r.query,f:"json"}),n=(0,ve.lA)(s,i),a=`${r.path}/${t}/info`,o=(0,g.default)(`${a}`,n),l=(0,g.default)(`${a}/keyProperties`,n),u=await Promise.allSettled([o,l]),p="fulfilled"===u[0].status?u[0].value.data:null,c="fulfilled"===u[1].status?u[1].value.data:null;let m=null;p.statistics?.length&&(m=p.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const d=qe.Z.fromJSON(p.extent),h=Math.ceil(d.width/p.pixelSizeX-.1),y=Math.ceil(d.height/p.pixelSizeY-.1),f=d.spatialReference,b=new re.Z({x:p.pixelSizeX,y:p.pixelSizeY,spatialReference:f}),R=p.histograms?.length?p.histograms:null,v=new Ge.Z({origin:p.origin,blockWidth:p.blockWidth,blockHeight:p.blockHeight,firstPyramidLevel:p.firstPyramidLevel,maximumPyramidLevel:p.maxPyramidLevel});return new de.Z({width:h,height:y,bandCount:p.bandCount,extent:d,spatialReference:f,pixelSize:b,pixelType:p.pixelType.toLowerCase(),statistics:m,histograms:R,keyProperties:c,storageInfo:v})}(this.parsedUrl.path,e,i)}async getCatalogItemICSInfo(e,t){const{data:i}=await(0,g.default)(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),r=i&&i.ics;if(!r)return;let s=null;try{s=(await(0,g.default)(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:r,icsToPixelTransform:null,icsExtent:null,northDirection:null};const n=this.version>=10.7?(0,g.default)(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=s.spatialReference,o={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[s]}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},l=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(o),...t}).then((e=>e.data)).catch((()=>({}))),u=(s.xmin+s.xmax)/2,p=(s.ymax-s.ymin)/6,c=s.ymin+p,m=[];for(let e=0;e<5;e++)m.push({x:u,y:c+p*e});const d={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:m}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},h=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(d),...t}).then((e=>e.data)).catch((()=>({}))),y=await Promise.all([n,l,h]);let f=y[0].ipxf;if(null==f){const e=r.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=qe.Z.fromJSON(y[1]&&y[1].geometries&&y[1].geometries[0]);b&&(b.spatialReference=new we.Z({wkid:0,imageCoordinateSystem:r}));const R=y[2].geometries?y[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],v=R.length;if(v<3)return{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:null};let w=0,_=0,S=0,C=0;for(let e=0;e<v;e++)w+=R[e].x,_+=R[e].y,S+=R[e].x*R[e].x,C+=R[e].x*R[e].y;const I=(v*C-w*_)/(v*S-w*w);let x=0;const F=R[4].x>R[0].x,T=R[4].y>R[0].y;return I===1/0?x=T?90:270:0===I?x=F?0:180:I>0?x=F?180*Math.atan(I)/Math.PI:180*Math.atan(I)/Math.PI+180:I<0&&(x=T?180+180*Math.atan(I)/Math.PI:360+180*Math.atan(I)/Math.PI),{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:x}}async generateRasterInfo(e,t){if((!e||"none"===e?.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))&&(0,a.pC)(this.serviceRasterInfo))return this.serviceRasterInfo;const i=function(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi)?.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return t?t.join("/"):null}(e);if(this._functionRasterInfos[i])return this._functionRasterInfos[i];const r=this._generateRasterInfo(e,t);this._functionRasterInfos[i]=r;try{return await r}catch{return this._functionRasterInfos[i]=null,null}}getExportImageServiceParameters(e,t,i,r){const s=Je((e=e.clone().shiftCentralMeridian()).spatialReference,this.parsedUrl.path);(0,a.pC)(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const n=this.exportImageServiceParameters.toJSON(),{bandIds:o,noData:l}=n;let{renderingRule:u}=n;const p=this.renderingRule?.rasterFunctionDefinition,c=!this.renderer||"raster-stretch"===this.renderer.type;if(o?.length&&this._hasRenderingRule(this.renderingRule)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;n.bandIds=void 0}else n.bandIds=o?.join(",");l instanceof Array&&l.length>0&&(n.noData=l.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,r):null;n.mosaicRule=m&&JSON.stringify(m),n.renderingRule=this._getRenderingRuleString(J.fromJSON(u));const d={};if(r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${null==e?"null":e},${null==t?"null":t}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:s,imageSR:s,size:t+","+i,...n,...d}}async getSamples(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsGetSamples)throw new b.Z("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=(0,p.TJ)(ut,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=t.toJSON();je(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const s=(await(0,Re.aX)(t.geometry))?.[0];(0,a.pC)(s)&&(r.geometry=s.toJSON());const n=(0,ve.en)(e),o=(0,ve.cv)({...n.query,f:"json",...r}),l=(0,ve.lA)(o,i),{data:u}=await(0,g.default)(`${n.path}/getSamples`,l),p=u?.samples?.map((e=>{const t="NaN"===e.value||""===e.value?null:e.value.split(" ").map((e=>Number(e)));return{...e,pixelValue:t}}));return Oe.fromJSON({samples:p})}(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsIdentify)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");e=(0,p.TJ)(rt,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;if(s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(r,e.timeExtent);e.mosaicRule=(0,a.Wg)(t)}return i&&null==e.raster&&(e.raster=i),Me(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new ke.Z;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,ze.e)(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,He.G)(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,Ue.P)(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new b.Z("imagery-layer: query-visible-rasters","missing query parameter");const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:s,showNoDataRecords:n}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p="raster.servicepixelvalue",c=this.rasterFunctionNamesIndex;if((0,a.pC)(e.outFields)&&(o=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>p.length)).map((e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new J({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const m=(0,a.Wi)(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),d=e.timeExtent||this.timeExtent,h=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d),y=this._getQueryParams({geometry:e.geometry,timeExtent:d,mosaicRule:h,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:i,returnCatalogItems:o,returnGeometry:m,raster:this.raster,maxItemCount:s?1:null});delete y.f;const f=new rt(y);try{await this.generateRasterInfo(this.renderingRule);const i=await Me(this.url,f,{signal:t?.signal,query:{...this.customParameters}}),s=e.outFields,l=i.value.toLowerCase().includes("nodata");if(!o||m||!i?.catalogItems?.features.length||!n&&l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s});const p=this.objectIdField||"ObjectId",c=i.catalogItems.features,d=c.map((e=>e.attributes?.[p])),h=new ke.Z({objectIds:d,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[p]}),y=await this.queryRasters(h);return y?.features?.length&&y.features.forEach((t=>{c.forEach((i=>{i.attributes[p]===t.attributes[p]&&(i.geometry=new Ze.Z(t.geometry),(0,a.pC)(e.outSpatialReference)&&(i.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s})}catch{throw new b.Z("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const i=(0,g.default)(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),r=(0,g.default)(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,r]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,pt.GE)(e.meshType,e.simulationSettings,e.flowData,(0,a.pC)(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),(0,a.pC)(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=(0,a.pC)(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):(0,Qe.g)(this.parsedUrl.path,t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set("serviceRasterInfo",e),e))),r=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),ct.warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.own((0,_.YP)((()=>this.renderingRule),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))})));const t=(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.multidimensionalInfo;t&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo;if((0,a.Wi)(e)||(0,a.Wi)(this.multidimensionalInfo)||(0,a.Wi)(t)||(0,a.Wi)(i?.startField))return e;const{startField:r}=i;if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==r)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const s=e.multidimensionalDefinition.filter((e=>e.dimensionName===r)),n=(0,a.pC)(t.start)?t.start.getTime():null,o=(0,a.pC)(t.end)?t.end.getTime():null,l=null==n||null==o||n===o,u=l?[n||o]:[[n,o]],p=this.version>=10.8;if(s.length)s.forEach((e=>{e.dimensionName===r&&(p?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=l,e.values=u))}));else if(!p){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=r,e.isSlice=l,e.values=u})):e.multidimensionalDefinition.push(new F.Z({variableName:"",dimensionName:r,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return(0,a.Wi)(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsQuery)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=(0,a.pC)(e)?(0,p.TJ)(ke.Z,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new he.Z;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:i}=this;return"unique-value"===e.type&&this._hasRenderingRule(i)&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||(0,ge.U0)(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:i,ssl:r}=await(0,g.default)(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});t=i,this.sourceJSON=t,r&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly")>-1)throw new b.Z("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if((0,a.Wi)(e))return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){if(!this._isPicture()&&!this.pixelFilter){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=(0,ge.YD)(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=(0,ge.Ob)(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=(0,ge.ol)(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new be.Z({rendererJSON:t,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:(0,a.pC)(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){(0,a.pC)(e?.renderingRule)&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):(0,ye.J)(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:(await(0,g.default)(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:i,signal:r}=e;if(i&&!this.pixelFilter&&t.format?.indexOf("png")>-1)return{imageElement:(await(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r})).data,params:t};const s=this._initJobHandler(),n=(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r}),a=(await Promise.all([n,s]))[0].data,o=t.format||"jpgpng";let l=o;if("bsq"!==l&&"bip"!==l&&(l=(0,ye.y)(a)),!l)throw new b.Z("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(a)));const u={signal:r},p="gif"===o||"bmp"===o||o.includes("png")&&("png"===l||"jpg"===l)?(0,ye.J)(a,{useCanvas:!0,...t},u):this._decodePixelBlock(a,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:o},u);return{pixelData:{pixelBlock:await p,extent:t.extent},params:t}}_generateRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return(0,Qe.N)(this.parsedUrl.path,e,i)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=e.variables[0].dimensions,i=[];for(const e in t)if(t.hasOwnProperty(e)){const r=t[e],s=r.extent;let n=!0,a=[s[0]];r.hasRanges&&!0===r.hasRanges?(n=!1,a=[r.values[0]]):"stdz"===r.name.toLowerCase()&&Math.abs(s[1])<=Math.abs(s[0])&&(a=[s[1]]),i.push(new F.Z({variableName:"",dimensionName:t[e].name,isSlice:n,values:a}))}if(i.length>0){this.mosaicRule=this.mosaicRule||new oe;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=i)}}_processVisibleRastersResponse(e,t){t=t||{};const i=e.value,{templateRRFunctionNames:r,showNoDataRecords:s,returnDomainValues:n,templateFields:o}=t,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,p=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const c=this.objectIdField||"ObjectId",m="string"==typeof i&&i.toLowerCase().includes("nodata"),d=[];if(i&&!u&&!m){const e={};e[c]=0,p=[i],u=[new y.Z(this.fullExtent,null,e)]}if(!u)return[];let h,f,g;this._updateResponseFieldNames(u,o),m&&!s&&(u=[]);for(let e=0;e<u.length;e++){if(h=u[e],null!=i){if(f=p[e],g=this.renderingRule&&l&&l.length>0&&r&&r.length>0&&r.includes(this.renderingRule.functionName)?l[r.indexOf(this.renderingRule.functionName)]:i,"nodata"===f.toLowerCase()&&!s)continue;const t="Raster.ItemPixelValue",n="Raster.ServicePixelValue";h.attributes[t]=f,h.attributes[n]=g,this._updateFeatureWithMagDirValues(h,f);const o=this.fields&&this.fields.length>0;let u=this.renderingRule&&(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?o?f:i:g;this.renderingRule||(u=o?f:i),this._updateFeatureWithRasterAttributeTableValues(h,u)}if(h.sourceLayer=h.layer=this,n&&this._updateFeatureWithDomainValues(h),r&&l&&r.length===l.length)for(let e=0;e<r.length;e++){const t="Raster.ServicePixelValue."+r[e];h.attributes[t]=l[e]}d.push(u[e])}return d}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo&&this.rasterInfo.attributeTable||(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable,r=i&&i.features;if(!r)return;const s=i.fields,n=s.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),o=n&&n[0];if(!o)return;const l=r.filter((e=>e.attributes[o]===(null!=t?parseInt(t,10):null)));l&&l[0]&&s.forEach((t=>{const i=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[i]=l[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if("esriImageServiceDataTypeVector-UV"!==this.serviceDataType&&"esriImageServiceDataTypeVector-MagDir"!==this.serviceDataType)return;const i=t.split(/,\s*/).map((e=>parseFloat(e))),r=i.map((e=>[e])),s=i.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),n=new me.Z({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new qe.Z(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:(0,fe.Tg)([n.pixels[0][0],n.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find((e=>e.code===i));r&&(e.attributes[t.name]=r.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;(0,a.Wi)(i)||e.forEach((e=>{if(e&&e.attributes)for(const r of t)if(i.has(r)){const t=i.get(r).name;t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(this._hasRenderingRule(e)){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRenderingRule(e){return e&&e.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replace(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:i,advancedQueryCapabilities:r,maxRecordCount:s}=e,n=t.includes("image"),a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:n,supportsExportImage:n,supportsIdentify:n,supportsMeasure:t.includes("mensuration")&&o,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:i>=10.2&&n,supportsProject:i>=10.3&&n,supportsComputeStatisticsHistograms:i>=10.4&&n,supportsQueryBoundary:i>=10.6&&n,supportsCalculateVolume:i>=10.7&&a,supportsComputePixelLocation:i>=10.7&&t.includes("catalog"),supportsComputeAngles:i>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1},query:{maxRecordCount:s,maxRecordCountFactor:void 0,supportsStatistics:!!r?.supportsStatistics,supportsOrderBy:!!r?.supportsOrderBy,supportsDistinct:!!r?.supportsDistinct,supportsPagination:!!r?.supportsPagination,supportsStandardizedQueriesOnly:!!r?.useStandardizedQueries,supportsPercentileStatistics:!!r?.supportsPercentileStatistics,supportsCentroid:!!r?.supportsReturningGeometryCentroid,supportsDistance:!!r?.supportsQueryWithDistance,supportsExtent:!!r?.supportsReturningQueryExtent,supportsGeometryProperties:!!r?.supportsReturningGeometryProperties,supportsHavingClause:!!r?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!r?.supportsDefaultSR,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return(0,s._)([(0,u.Cb)()],t.prototype,"_functionRasterInfos",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,u.Cb)({dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"_defaultServiceMosaicRule",void 0),(0,s._)([(0,I.r)("_defaultServiceMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultServiceMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSourceType",void 0),(0,s._)([(0,I.r)("_serviceSourceType",["serviceSourceType","fields"])],t.prototype,"readServiceSourceType",null),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),(0,s._)([(0,I.r)("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"rasterAttributeTableFieldPrefix",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFunctionNamesIndex",null),(0,s._)([(0,u.Cb)()],t.prototype,"adjustAspectRatio",void 0),(0,s._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.bandCount")],t.prototype,"bandCount",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{write:!0}})],t.prototype,"bandIds",void 0),(0,s._)([(0,I.r)("bandIds")],t.prototype,"readBandIds",null),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),(0,s._)([(0,I.r)("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),(0,s._)([(0,u.Cb)({type:Number})],t.prototype,"compressionQuality",void 0),(0,s._)([(0,m.c)("compressionQuality")],t.prototype,"writeCompressionQuality",null),(0,s._)([(0,u.Cb)({type:Number})],t.prototype,"compressionTolerance",void 0),(0,s._)([(0,m.c)("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),(0,s._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,s._)([(0,u.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:[pe.Z]})],t.prototype,"fields",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"fieldsIndex",null),(0,s._)([(0,u.Cb)({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],t.prototype,"format",null),(0,s._)([(0,I.r)("service","format",["serviceDataType"])],t.prototype,"readFormat",null),(0,s._)([(0,u.Cb)({type:qe.Z})],t.prototype,"fullExtent",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),(0,s._)([(0,u.Cb)({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),(0,s._)([(0,u.Cb)({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),(0,s._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],t.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"minScale",void 0),(0,s._)([(0,I.r)("service","minScale")],t.prototype,"readMinScale",null),(0,s._)([(0,u.Cb)()],t.prototype,"maxScale",void 0),(0,s._)([(0,I.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,s._)([(0,u.Cb)({type:oe})],t.prototype,"mosaicRule",null),(0,s._)([(0,I.r)("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),(0,s._)([(0,m.c)("mosaicRule")],t.prototype,"writeMosaicRule",null),(0,s._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.multidimensionalInfo")],t.prototype,"multidimensionalInfo",void 0),(0,s._)([(0,u.Cb)({json:{type:p.z8}})],t.prototype,"noData",void 0),(0,s._)([(0,m.c)("noData")],t.prototype,"writeNoData",null),(0,s._)([(0,u.Cb)({type:String,json:{type:le.k.jsonValues,read:le.k.read,write:le.k.write}})],t.prototype,"noDataInterpretation",void 0),(0,s._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),(0,s._)([(0,I.r)("objectIdField")],t.prototype,"readObjectIdField",null),(0,s._)([(0,u.Cb)({})],t.prototype,"geometryType",void 0),(0,s._)([(0,u.Cb)({})],t.prototype,"typeIdField",void 0),(0,s._)([(0,u.Cb)({})],t.prototype,"types",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"parsedUrl",null),(0,s._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.pixelSize.x")],t.prototype,"pixelSizeX",void 0),(0,s._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.pixelSize.y")],t.prototype,"pixelSizeY",void 0),(0,s._)([(0,u.Cb)({type:Function})],t.prototype,"pixelFilter",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"viewId",void 0),(0,s._)([(0,u.Cb)({types:f.dr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:f.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,s._)([(0,I.r)("renderer")],t.prototype,"readRenderer",null),(0,s._)([(0,m.c)("renderer")],t.prototype,"writeRenderer",null),(0,s._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),(0,s._)([(0,u.Cb)(x.Oh)],t.prototype,"opacity",void 0),(0,s._)([(0,u.Cb)({readOnly:!0}),(0,C.B)("serviceRasterInfo.attributeTable")],t.prototype,"rasterAttributeTable",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFields",null),(0,s._)([(0,u.Cb)({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),(0,s._)([(0,u.Cb)({type:J})],t.prototype,"renderingRule",null),(0,s._)([(0,I.r)("renderingRule",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRenderingRule",null),(0,s._)([(0,m.c)("renderingRule")],t.prototype,"writeRenderingRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"serviceDataType",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:we.Z})],t.prototype,"spatialReference",void 0),(0,s._)([(0,I.r)("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),(0,s._)([(0,u.Cb)({json:{type:mt.jsonValues}})],t.prototype,"pixelType",void 0),(0,s._)([(0,I.r)("pixelType")],t.prototype,"readPixelType",null),(0,s._)([(0,m.c)("pixelType")],t.prototype,"writePixelType",null),(0,s._)([(0,u.Cb)({constructOnly:!0,type:de.Z})],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,u.Cb)(x.HQ)],t.prototype,"url",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,s._)([(0,I.r)("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=(0,s._)([(0,c.j)("esri.layers.mixins.ArcGISImageService")],t),t};var ft=i(17287),gt=i(71612),bt=i(17017),Rt=i(38009),vt=i(16859),wt=i(34760),_t=i(72965),St=i(28294),Ct=i(60199),It=i(32163);let xt=class extends((0,gt.h)((0,St.n)((0,wt.Q)((0,_t.M)((0,Rt.q)((0,vt.I)(yt((0,bt.N)((0,ft.Y)((0,o.R)(d.Z))))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,a.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}writeOperationalLayerType(e,t,i){const r="vector-field"===this.renderer?.type;t[i]=r?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.rasterFields,i=this.title,r=new Set;let s=!1,n=!1;this.capabilities&&(s=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=s&&("esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType));const a=new Set;s&&(a.add("raster.itempixelvalue"),n&&a.add("raster.magnitude").add("raster.direction"));for(const e of t){const t=e.name.toLowerCase();a.has(t)||t.includes("raster.servicepixelvalue.")||r.add(e.name)}return(0,It.eZ)({fields:t,title:i},{...e,visibleFieldNames:r})}queryFeatures(e,t){return this.queryRasters(e,t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return(0,Ct.D)(this,e)}};(0,s._)([(0,u.Cb)(x.rn)],xt.prototype,"legendEnabled",void 0),(0,s._)([(0,u.Cb)({type:["show","hide"]})],xt.prototype,"listMode",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],xt.prototype,"isReference",void 0),(0,s._)([(0,u.Cb)({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],xt.prototype,"operationalLayerType",void 0),(0,s._)([(0,m.c)("web-map","operationalLayerType")],xt.prototype,"writeOperationalLayerType",null),(0,s._)([(0,u.Cb)(x.C_)],xt.prototype,"popupEnabled",void 0),(0,s._)([(0,u.Cb)({type:n.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],xt.prototype,"popupTemplate",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],xt.prototype,"defaultPopupTemplate",null),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],xt.prototype,"type",void 0),xt=(0,s._)([(0,c.j)("esri.layers.ImageryLayer")],xt);const Ft=xt},17287:(e,t,i)=>{i.d(t,{Y:()=>u});var r=i(43697),s=i(92604),n=i(70586),a=i(5600),o=(i(67676),i(80442),i(75215),i(52011)),l=i(66677);const u=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,n.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,a.Cb)()],t.prototype,"title",null),(0,r._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>v});var r=i(43697),s=i(40330),n=i(3172),a=i(66643),o=i(20102),l=i(92604),u=i(70586),p=i(95330),c=i(17452),m=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),h=i(52011),y=i(30556),f=i(65587),g=i(15235),b=i(86082);const R=l.Z.getLogger("esri.layers.mixins.PortalLayer"),v=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,p.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||R.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=w.credential===t?w.user:await this._fetchEditingUser(e);return w.credential=t,w.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,o=f.Z.getDefault();if(o&&o.loaded&&(0,c.Fv)(o.restUrl)===(0,c.Fv)(r))return o.user;const l=`${r}/community/self`,p=(0,u.pC)(e)?e.signal:null,m=await(0,a.q6)((0,n.default)(l,{authMode:"no-prompt",query:{f:"json"},signal:p}));return m.ok?b.default.fromJSON(m.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return i&&r&&!(0,c.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,m.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,r._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,m.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,m.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,h.j)("esri.layers.mixins.PortalLayer")],t),t},w={credential:null,user:null}},41818:(e,t,i)=>{i.d(t,{P:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForCount)(a,n.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForIds)(a,n.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>l,e:()=>o});var r=i(11282),s=i(34599),n=i(74889),a=i(57444);async function o(e,t,i){const r=await l(e,t,i);return n.default.fromJSON(r)}async function l(e,t,i){const n=(0,r.en)(e),o={...i},l=a.Z.from(t),{data:u}=await(0,s.executeQuery)(n,l,l.sourceSpatialReference,o);return u}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,s=i(43697),n=i(96674),a=i(5600),o=(i(67676),i(80442),i(75215)),l=i(52011);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let p=r=class extends n.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const s=t.find((e=>e.name===i));return s?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:s.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,s._)([(0,a.Cb)({type:String})],p.prototype,"contentType",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"exifInfo",void 0),(0,s._)([(0,a.Cb)({readOnly:!0})],p.prototype,"orientationInfo",null),(0,s._)([(0,a.Cb)({type:o.z8})],p.prototype,"id",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"globalId",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"keywords",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"name",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentGlobalId",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentObjectId",void 0),(0,s._)([(0,a.Cb)({type:o.z8})],p.prototype,"size",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"url",void 0),p=r=(0,s._)([(0,l.j)("esri.layers.support.AttachmentInfo")],p);const c=p}}]);