@arcgis/core 4.23.0-next.20220127 → 4.23.0-next.20220131
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.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
- package/assets/esri/core/workers/chunks/{8001b0e514bfffe9d7f8.js → 0c15d77d8e817cf45a9a.js} +1 -1
- package/assets/esri/core/workers/chunks/{e657ba0cab29f05d02da.js → 0cd0a6eef51fc5b9ea61.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4896cf85fb2da8a9cc7.js → 17de7a324dfa7f57ad5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0317f37b6c8705b363fd.js → 1c733b7db092a2a88ef3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d835b2a683fcd8aeeed8.js → 27474b007988855bea9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{e93dfdede0532a89ffa5.js → 2b25fc7945a187c2bb9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5948923e07bd1662c24a.js → 37c03cfc19086ce631c6.js} +1 -1
- package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
- package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
- package/assets/esri/core/workers/chunks/{5f1dcb6556820cd0aa31.js → 4be35af7d6babbfe9d84.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9ff3eaf4eb324429fbd.js → 5457962a70bd3c557a75.js} +1 -1
- package/assets/esri/core/workers/chunks/56657f890e0f79f5d2ad.js +1 -0
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
- package/assets/esri/core/workers/chunks/{56274b37ff74ca0d68a6.js → 5d11b97b667921d67ae7.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba5eb394f098968c22d2.js → 655b55ac0cd533d7e9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/70d6bb3c7112cb702389.js +1 -0
- package/assets/esri/core/workers/chunks/810a763373d7f78ae398.js +1 -0
- package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
- package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
- package/assets/esri/core/workers/chunks/{601e697dc7414bda128a.js → 952980635afc7ec81804.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8741bf421f80213f1d3.js → 9876a1bae350795fab36.js} +1 -1
- package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
- package/assets/esri/core/workers/chunks/{3f343f792fd9f44d6f25.js → b3f5e91116112b0b612a.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d77467aa71d345fc1b6.js → bcc01bbffaa3bb5f60a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c76146014dc15143ba3.js → be588873c16770ceb9ef.js} +1 -1
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
- package/assets/esri/core/workers/chunks/d98dab12b71912fa397b.js +1 -0
- package/assets/esri/core/workers/chunks/{b62e3dccd9f662c0afeb.js → db3c729ce0c0b2690dc9.js} +1 -1
- package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
- package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
- package/assets/esri/core/workers/chunks/{c9cbf8135e95f0f42cd9.js → e287f49184d076af17e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e6a3c5866e8d8820457.js → eb82ff10cef2bde6e57f.js} +1 -1
- package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
- package/assets/esri/core/workers/chunks/{842db82733635dbf25cb.js → ee6e0db58dc64410e687.js} +1 -1
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
- package/assets/esri/core/workers/chunks/f7150547d7e3259a0f29.js +981 -0
- package/assets/esri/core/workers/chunks/fc046a15466c25d081ff.js +1 -0
- package/assets/esri/images/portal/mediaservice16.png +0 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nb.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- package/chunks/BlendLayers.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +17 -17
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +12 -12
- package/chunks/ComponentShader.glsl.js +3 -3
- package/chunks/Compositing.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +33 -33
- package/chunks/EdgeShaderProgram.glsl.js +7 -7
- package/chunks/Fog.glsl.js +10 -12
- package/chunks/HUDMaterial.glsl.js +2 -2
- package/chunks/HighlightComposition.glsl.js +5 -5
- package/chunks/ImageMaterial.glsl.js +6 -6
- package/chunks/LaserlinePath.glsl.js +8 -8
- package/chunks/LineCallout.glsl.js +6 -6
- package/chunks/MeasurementArrow.glsl.js +1 -1
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +14 -14
- package/chunks/Precipitation.glsl.js +2 -2
- package/chunks/RealisticTree.glsl.js +21 -21
- package/chunks/RibbonLine.glsl.js +11 -11
- package/chunks/SMAA.glsl.js +40 -40
- package/chunks/ShadedColorMaterial.glsl.js +12 -12
- package/chunks/ShadowCast.glsl.js +6 -6
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/SlicePlaneMaterial.glsl.js +3 -3
- package/chunks/Stars.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +11 -11
- package/chunks/TextureOnly.glsl.js +2 -2
- package/chunks/WaterSurface.glsl.js +5 -5
- package/chunks/boundedPlane.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/loadAll.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +653 -55
- package/layers/RouteLayer.d.ts +4 -0
- package/layers/RouteLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/rest/support/DirectionLine.d.ts +4 -0
- package/rest/support/DirectionPoint.d.ts +4 -0
- package/rest/support/RouteInfo.d.ts +4 -0
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteSolveResult.d.ts +4 -0
- package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/IconSymbol3DLayerResource.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Thumbnail.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.glsl.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/Stars.glsl.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/I3SCrossfadeHelper.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
- package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +10 -10
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowHighlightHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/TextureUniformName.js +4 -0
- package/views/3d/webgl-engine/lib/UniformName.js +4 -0
- package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
- package/views/SceneView.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/webdoc/support/{Thumbnail.js → SlideThumbnail.js} +1 -1
- package/webmap/Bookmark.js +1 -1
- package/webmap/Version.js +1 -1
- package/webscene/Slide.js +1 -1
- package/webscene/Version.js +1 -1
- package/webscene/support/SlideVisibleLayer.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions/support/directionsUtils.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/assets/esri/core/workers/chunks/12c0cabb6c59e65d8546.js +0 -1
- package/assets/esri/core/workers/chunks/322d917e8cb398816a93.js +0 -1
- package/assets/esri/core/workers/chunks/392b6382e06652dd4c80.js +0 -1
- package/assets/esri/core/workers/chunks/3aa73119b055e05bbbeb.js +0 -1
- package/assets/esri/core/workers/chunks/52ea678ba1da0e349919.js +0 -1
- package/assets/esri/core/workers/chunks/5ee497d5d7b0e580526a.js +0 -1
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
- package/assets/esri/core/workers/chunks/83b8fec1650e061aaa56.js +0 -1
- package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
- package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +0 -1
- package/assets/esri/core/workers/chunks/d07440469fe7d181c4fd.js +0 -1
- package/assets/esri/core/workers/chunks/dbf192b4ce7e608610f6.js +0 -1
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
- package/assets/esri/core/workers/chunks/dee9929d95e9fe26929c.js +0 -1
- package/assets/esri/core/workers/chunks/e12d91ef44d6f879a02a.js +0 -1
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
- package/assets/esri/core/workers/chunks/fc7e31d87555beb63291.js +0 -1
- package/assets/esri/core/workers/chunks/fff6b0338f06dad0c45d.js +0 -1
- package/widgets/Directions/support/CostSummary.js +0 -5
- package/widgets/Directions/support/RouteSection.js +0 -5
- package/widgets/Directions/support/RouteSections.js +0 -5
- package/widgets/Directions/support/maneuverUtils.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7622,6006],{3920:(e,t,r)=>{r.d(t,{r:()=>u,p:()=>c});var n=r(43697),i=r(15923),s=r(61247),a=r(5600),o=r(52011),l=r(89749);const c=e=>{let t=class extends e{destroy(){var e,t;this.destroyed||(null==(e=this._get("handles"))||e.destroy(),null==(t=this._get("updatingHandles"))||t.destroy())}get handles(){return this._get("handles")||new s.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,n._)([(0,a.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,n._)([(0,a.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,n._)([(0,o.j)("esri.core.HandleOwner")],t),t};let u=class extends(c(i.Z)){};u=(0,n._)([(0,o.j)("esri.core.HandleOwner")],u)},78346:(e,t,r)=>{r.d(t,{bA:()=>A});var n=r(20102),i=r(80442),s=r(95330),a=r(80903),o=r(25045),l=r(40330),c=r(92604),u=r(94362),h=r(99880),d=r(68773),f=(r(2587),r(17452));const p={};function m(e){var t;const r={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(r.async=!0),e.hasOwnProperty("isDebug")||(r.isDebug=!1),e.baseUrl||(r.baseUrl=p.baseUrl),null==(t=p.packages)||t.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(r.packages,e)})),r}var g=r(41213);class y{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class x{constructor(){this._dispatcher=new y,this._workerPostMessage({type:u.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,g.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,g.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,u.QM)(e);if(t&&t.type===u.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await o.default.loadWorker(e);n||(n=await import(e));const i=o.default.connect(n);this._workerPostMessage({type:u.Cs.OPENED,jobId:r,data:i})}}}var w=r(70171),b=r(17202);const v=c.Z.getLogger("esri.core.workers"),{HANDSHAKE:I}=u.Cs;let _,C;const S="Failed to create Worker. Fallback to execute module in main thread";async function k(e){return new Promise((t=>{function r(i){const s=(0,u.QM)(i);s&&s.type===I&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new x).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let R=0;const T=c.Z.getLogger("esri.core.workers"),{ABORT:P,INVOKE:M,OPEN:O,OPENED:E,RESPONSE:F}=u.Cs;class B{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),T.error(e)}))}static async create(e){const t=await async function(){if(!(0,i.Z)("esri-workers")||((0,i.Z)("mozilla"),0))return k(new x);if(!_&&!C)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,w.Kd)(),e.has={"esri-csp-restrictions":(0,i.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,i.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,i.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,i.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,i.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,i.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,i.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,i.Z)("esri-atomics"),"esri-shared-array-buffer":(0,i.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,i.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,i.Z)("esri-workers-arraybuffer-transfer"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,h.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=m({baseUrl:null==t?void 0:t.baseUrl,locale:(0,w.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...null==t?void 0:t.has},map:{...null==t?void 0:t.map},paths:{...null==t?void 0:t.paths},packages:(null==t?void 0:t.packages)||[]}),n={version:l.i8,buildDate:b.r,revision:b.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);_=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){C=e||{}}let e;if(_)try{e=new Worker(_,{name:"esri-worker-"+R++})}catch(t){v.warn(S,C),e=new x}else v.warn(S,C),e=new x;return k(e)}();return new B(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,u.jt)();return new Promise(((t,i)=>{const a={resolve:t,reject:i,abortHandle:(0,s.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:P,jobId:n})}))};this._outJobs.set(n,a),this._post({type:O,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,u.QM)(e);if(t)switch(t.type){case E:this._onOpenedMessage(t);break;case F:this._onResponseMessage(t);break;case P:this._onAbortMessage(t);break;case M:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:i}=e,a=i?new AbortController:null,o=this._inJobs,c=l.Nv[t];let h;try{if("function"!=typeof c)throw new TypeError(`${t} is not a function`);h=c.call(null,n,{signal:a?a.signal:null})}catch(e){return void this._post({type:F,jobId:r,error:(0,u.AB)(e)})}(0,s.y8)(h)?(o.set(r,{controller:a,promise:h}),h.then((e=>{o.has(r)&&(o.delete(r),this._post({type:F,jobId:r},e))}),(e=>{o.has(r)&&(o.delete(r),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:F,jobId:r,error:(0,u.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:F,jobId:r},h)}_onOpenedMessage(e){var t;const{jobId:r,data:n}=e,i=this._outJobs.get(r);i&&(this._outJobs.delete(r),null==(t=i.abortHandle)||t.remove(),i.resolve(n))}_onResponseMessage(e){var t;const{jobId:r,error:i,data:s}=e,a=this._outJobs.get(r);a&&(this._outJobs.delete(r),null==(t=a.abortHandle)||t.remove(),i?a.reject(n.Z.fromJSON(JSON.parse(i))):a.resolve(s))}_post(e,t,r){return(0,u.oi)(this.worker,e,t,r)}}let D=(0,i.Z)("esri-workers-debug")?1:(0,i.Z)("host-browser")?navigator.hardwareConcurrency-1:0;D||(D=(0,i.Z)("safari")&&(0,i.Z)("mac")||(0,i.Z)("trident")?7:2);let N=0;const Z=[];async function H(e,t){const r=new a.Z;return await r.open(e,t),r}async function A(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,i.Z)("host-webworker")&&!(0,i.Z)("esri-workers")&&(r="local"),"local"===r){let r=await o.default.loadWorker(e);r||(r=await import(e)),(0,s.k_)(t.signal);const n=t.client||r;return H([o.default.connect(r)],{...t,client:n})}if(await async function(){if(z)return z;L=new AbortController;const e=[];for(let t=0;t<D;t++){const r=B.create(t).then((e=>(Z[t]=e,e)));e.push(r)}return z=Promise.all(e),z}(),(0,s.k_)(t.signal),"dedicated"===r){const r=N++%D;return H([await Z[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,D);if(r<D){const n=new Array(r);for(let i=0;i<r;++i){const r=N++%D;n[i]=Z[r].open(e,t)}return H(n,t)}}return H(Z.map((r=>r.open(e,t))),t)}let L,z=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),i=r(3172),s=r(20102),a=r(70586);async function o(e){if((0,a.pC)(c.fetchBundleAsset))return c.fetchBundleAsset(e);const t=await(0,i.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],u=(0,n.Su)(i),h=`${l}${c}.json`,d=u?`${l}${c}_${u}.json`:h;let f;try{f=await o(e(d))}catch(t){if(d===h)throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{f=await o(e(h))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return f}(this.getAssetUrl,this.matcher,e,t)}}const c={};var u,h=r(99880);(0,n.tz)((u={pattern:"esri/",location:h.V},new l(u)))},94443:(e,t,r)=>{r.d(t,{ME:()=>f,Su:()=>p,tz:()=>d});var n=r(20102),i=r(95330),s=r(70171);const a=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,o={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){var t;return null!=(t=o[e])&&t}const c=[],u=new Map;function h(e){for(const t of u.keys())m(e.pattern,t)&&u.delete(t)}function d(e){return c.includes(e)||(h(e),c.unshift(e)),{remove(){const t=c.indexOf(e);t>-1&&(c.splice(t,1),h(e))}}}async function f(e){const t=(0,s.Kd)();u.has(e)||u.set(e,async function(e,t){const r=[];for(const n of c)if(m(n.pattern,e))try{return await n.fetchMessageBundle(e,t)}catch(e){r.push(e)}if(r.length)throw new n.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:r});throw new n.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const r=u.get(e);return await g.add(r),r}function p(e){if(!a.test(e))return null;const[,t,r]=a.exec(e),n=t+(r?"-"+r.toUpperCase():"");return l(n)?n:l(t)?t:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,s.Ze)((()=>{u.clear()}));const g=new class{constructor(){this._numLoading=0}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,i.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},940:(e,t,r)=>{r.d(t,{n:()=>c});var n=r(92604),i=r(78286),s=r(19153),a=r(90344),o=r(18848);const l=n.Z.getLogger("esri.intl");function c(e,t,r={}){const{format:n={}}=r;return(0,s.gx)(e,(e=>function(e,t,r){let n,s;const a=e.indexOf(":");if(-1===a?n=e.trim():(n=e.slice(0,a).trim(),s=e.slice(a+1).trim()),!n)return"";const o=(0,i.hS)(n,t);if(null==o)return"";const l=r[s]||r[n];return l?u(o,l):s?h(o,s):d(o)}(e,t,n)))}function u(e,t){switch(t.type){case"date":return(0,a.p6)(e,t.intlOptions);case"number":return(0,o.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),d(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,a.p6)(e);case"numberformat":return(0,o.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,a.p6)(e):/^numberformat/i.test(t)?(0,o.uf)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,o.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,a.p6)(e):""}}},52294:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ve});var n=r(43697),i=r(51773),s=r(14746),a=r(20102),o=r(70586),l=r(16453),c=r(95330),u=r(5600),h=(r(67676),r(80442),r(75215)),d=r(36030),f=r(71715),p=r(52011),m=r(29600),g=r(71612),y=r(17017),x=(r(66577),r(3172)),w=r(92604),b=r(44422),v=r(8744),I=r(66677),_=r(21506),C=r(35956),S=r(88281),k=r(11145),R=r(80676),T=r(67058),P=r(91219),M=r(23808),O=r(6570),E=r(82971);const F=w.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),B=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.fullExtent=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.tileInfo=null,this.symbolizer=null}set url(e){this._set("url",(0,I.Nm)(e,F))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e))return null;const r=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,R.KC)(e,n)}async createStreamlinesMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createStreamlinesMesh(e,t):(0,M.z_)(e.rendererSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo;if((0,o.Wi)(t))return e;let r=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(r)&&r.length||(r=this._getDefaultSlice());const n=e.timeExtent||this.timeExtent;if((0,o.pC)(r)&&(0,o.pC)(n)&&((0,o.pC)(n.start)||(0,o.pC)(n.end))){var i,s;r=r.map((e=>e.clone()));const a=null==(i=t.variables.find((({name:e})=>e===r[0].variableName)))||null==(s=i.dimensions)?void 0:s.find((({name:e})=>"StdTime"===e)),l=r.find((({dimensionName:e})=>"StdTime"===e));if(!a||!l)return{...e,multidimensionalDefinition:null};const{start:c,end:u}=n,h=(0,o.Wi)(c)?null:c.getTime(),d=(0,o.Wi)(u)?null:u.getTime(),f=null!=h?h:d,p=null!=d?d:h;if((0,o.pC)(a.values)){const e=a.values.filter((e=>{if(Array.isArray(e)){if(f===p)return e[0]<=f&&e[1]>=f;const t=e[0]<=f&&e[1]>f||e[0]<p&&e[1]>=p,r=e[0]>=f&&e[1]<=p||e[0]<f&&e[1]>p;return t||r}return f===p?e===f:e>=f&&e<=p}));if(e.length){const t=e.sort(((e,t)=>{var r,n,i,s;return f===p?(null!=(i=e[0])?i:e)-(null!=(s=t[0])?s:t):Math.abs((null!=(r=e[1])?r:e)-p)-Math.abs((null!=(n=t[1])?n:t)-p)}))[0];l.values=[t]}else r=null}else if(a.hasRegularIntervals&&a.extent){const[e,t]=a.extent;f>t||p<e?r=null:l.values=f===p?[f]:[Math.max(e,f),Math.min(t,p)]}}return{...e,multidimensionalDefinition:r}}async updateRenderer(){if(!this.loaded)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const e=this._rasterJobHandler.instance;e&&(this.symbolizer.rendererJSON=(0,T.ol)(this.renderer.toJSON()),this.symbolizer.bind(),await e.updateSymbolizer(this.symbolizer),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const r=e&&e.pixelBlock;if(!((0,o.pC)(r)&&r.pixels&&r.pixels.length>0))return null;let n;await this.updateRenderer();const i=this._rasterJobHandler.instance,{bandIds:s}=this;return n=i?await i.symbolize({...e,simpleStretchParams:t,bandIds:s}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:s}),n}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,v.C5)(e);return k.Z.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,n={}){if(n.requestAsImageElement){const i=this.getTileUrl(e,t,r);return(0,x.default)(i,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(n=this.normalizeRasterFetchOptions(n),(0,o.Wi)(n.multidimensionalDefinition))){const i=n.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,i),pixelBlock:null}}return await this._initJobHandler(),"raster-shaded-relief"===this.renderer.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,n)}async fetchPixels(e,t,r,n={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(n=this.normalizeRasterFetchOptions(n),(0,o.Wi)(n.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),this.raster.fetchPixels(e,t,r,n))}async identify(e,t={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(t=this.normalizeRasterFetchOptions(t),(0,o.Wi)(t.multidimensionalDefinition))?{location:e,value:null}:this.raster.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var e;const t=this.rasterInfo.multidimensionalInfo;if(!(0,o.pC)(t)||"standard-time"!==this.rasterInfo.dataType)return!1;const r=null==(e=this.multidimensionalDefinition[0])?void 0:e.variableName;return t.variables.some((e=>e.name===r&&e.dimensions.some((e=>"StdTime"===e.name))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=this._getDefaultSlice()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new S.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer()})).catch((()=>null)),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this.raster.rasterJobHandler=null}_configDefaultInterpolation(){if(null==this.interpolation){var e;const t=(0,T.In)(this.rasterInfo,this.raster.tileType,null==(e=this.sourceJSON)?void 0:e.defaultResamplingMethod);this._set("interpolation",t)}}_getDefaultSlice(){const{multidimensionalInfo:e}=this.raster.rasterInfo;if(!(0,o.pC)(e))return null;const t=e.variables[0];return t.dimensions.map((e=>{var r,n;return new C.Z({variableName:t.name,dimensionName:e.name,values:[null!=(r=null==(n=e.values)?void 0:n[0])?r:e.extent[0]],isSlice:!0})}))}_configDefaultRenderer(){const e=this.raster.rasterInfo;var t;this.bandIds||(this.bandIds=(0,T.YD)(e)),this.renderer||(this.renderer=(0,T.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?null==(t=this.multidimensionalDefinition[0])?void 0:t.variableName:null})),this.symbolizer?(this.symbolizer.rendererJSON=(0,T.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new P.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const r=this.symbolizer.bind();r.success||F.warn("imagery-tile-mixin",r.error||"The given renderer is not supported by the layer.")}};return(0,n._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"bandIds",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"copyright",void 0),(0,n._)([(0,u.Cb)({type:O.Z}),(0,b.B)("rasterInfo.extent")],t.prototype,"fullExtent",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"ioConfig",void 0),(0,n._)([(0,u.Cb)({type:[C.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,b.B)("raster.rasterInfo")],t.prototype,"rasterInfo",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,u.Cb)({type:E.Z}),(0,b.B)("rasterInfo.spatialReference")],t.prototype,"spatialReference",void 0),(0,n._)([(0,u.Cb)({type:k.Z}),(0,b.B)("rasterInfo.storageInfo.tileInfo")],t.prototype,"tileInfo",void 0),(0,n._)([(0,u.Cb)(_.HQ)],t.prototype,"url",null),(0,n._)([(0,u.Cb)({types:s.dr})],t.prototype,"renderer",null),(0,n._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),t=(0,n._)([(0,p.j)("esri.layers.ImageryTileMixin")],t),t};var D=r(38009),N=r(16859),Z=r(34760),H=r(72965),A=r(28294),L=r(1231),z=r(69608),J=r(30547),W=r(48526),j=r(36679),U=r(96674),q=r(609),$=r(73506),G=r(13473);const V=new Map,Y=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const r=e+"/"+t,n=this._cachedBlocks;if(n.has(r)){const e=n.get(r);return e.refCount--,e.refCount<=0&&(n.delete(r),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const r=e+"/"+t,n=this._cachedBlocks;if(n.has(r)){const e=n.get(r);return e.ts=Date.now(),e.refCount++,n.delete(r),n.set(r,e),e.block}return null}putBlock(e,t,r,n=null){const i=this._cachedBlocks,s=e+"/"+t;if(i.has(s)){const e=i.get(s);e.ts=Date.now(),e.refCount++}else i.set(s,{block:r,ts:Date.now(),refCount:1,controller:n});this._trim(),this._updateTimer()}deleteBlock(e,t){const r=this._cachedBlocks,n=e+"/"+t;r.has(n)&&r.delete(n)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),r=Date.now();for(let n=0;n<t.length&&t[n][1].ts<=r-this._duration;n++)e.delete(t[n][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let r=0;r<t.length-this._size;r++)e.delete(t[r][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function K(e,t){return null==t?e:`${e}?sliceId=${t}`}function X(e,t,r){if(!V.has(e))return null==t?Y.decreaseRefCount(e,r):0;const n=V.get(e);if(null==n[t])return Y.decreaseRefCount(e,r);const i=n[t].cache;if(i.has(r)){const e=i.get(r);if(e.refCount--,0===e.refCount){i.delete(r);for(let e=0;e<n.length;e++)n[e]&&n[e].cache.has(r)&&n[e].cache.delete(r);e.controller&&e.controller.abort()}return e.refCount}return 0}function Q(e,t,r){if(!V.has(e))return null==t?Y.getBlock(e,r):null;const n=V.get(e);if(null==n[t]){for(let e=0;e<n.length;e++)if(n[e]&&n[e].cache.has(r)){const t=n[e].cache.get(r);return t.refCount++,t.block}return Y.getBlock(e,r)}const i=n[t].cache;if(i.has(r)){const e=i.get(r);return e.refCount++,e.block}for(let e=0;e<n.length;e++)if(e!==t&&n[e]&&n[e]&&n[e].cache.has(r)){const t=n[e].cache.get(r);return t.refCount++,i.set(r,t),t.block}return null}function ee(e,t,r,n,i=null){if(!V.has(e))return void(null==t&&Y.putBlock(e,r,n,i));const s=V.get(e);if(null==s[t])return void Y.putBlock(e,r,n,i);const a={refCount:1,block:n,isResolved:!1,isRejected:!1,controller:i};n.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),s[t].cache.set(r,a)}function te(e,t,r){if(!V.has(e))return void(null==t&&Y.deleteBlock(e,r));const n=V.get(e);null!=n[t]?n[t].cache.delete(r):Y.deleteBlock(e,r)}var re=r(75993),ne=r(55914);let ie=class extends((0,q.v)(U.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,$.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:k.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,$.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,I.Nm)(e,w.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,n={}){const i=n.tileInfo||this.rasterInfo.storageInfo.tileInfo,s=this.getTileExtentFromTileInfo(e,t,r,i);return this.fetchPixels(s,i.size[0],i.size[1],n)}async identify(e,t={}){t=this._getRequestOptionsWithSliceId(t);const{spatialReference:r,extent:n}=this.rasterInfo,{datumTransformation:i}=t;let s=(0,$.nF)(e,r,i);if(!n.intersects(s))return{location:s,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(s);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};s=e}let a=0;if(t.srcResolution)a=(0,$.kr)(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(a=await this.computeBestPyramidLevelForLocation(e,t),null==a)return{location:s,value:null};const l=this.identifyPixelLocation(s,a,null);if(null===l)return{location:s,value:null};const{row:c,col:u,rowOffset:h,colOffset:d}=l,f=K(this.url,t.sliceId),p=`${a}/${c}/${u}`;let m=Q(f,null,p);(0,o.Wi)(m)&&(m=this.fetchRawTile(a,c,u,t),ee(f,null,p,m));const g=await m;if((0,o.Wi)(g)||!g.pixels||0===g.pixels.length)return{location:s,value:null};const y=h*this.rasterInfo.storageInfo.blockHeight+d,x=!g.mask||g.mask[y]?g.pixels.map((e=>e[y])):null,w=this.rasterInfo.dataType;return("vector-magdir"===w||"vector-uv"===w)&&(null==x?void 0:x.length)>1?{location:s,value:x,magdirValue:"vector-magdir"===w?[x[0],x[1]]:(0,R.Tg)([x[0],x[1]]),pyramidLevel:a}:{location:s,value:x,pyramidLevel:a}}async fetchPixels(e,t,r,n={}){if(e=(0,$.kZ)(e),(n=this._getRequestOptionsWithSliceId(n)).requestRawData)return this._fetchPixels(e,t,r,n);const i=(0,$.ut)(e.spatialReference),s=(0,$.Hq)(e);if((0,o.Wi)(i)||0===s||1===s&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,n);if(s>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,u=Math.round(i/(c-l)*t),h=u-Math.round((i/2-l)/(c-l)*t);let d=0;const f=[];for(let o=0;o<=s;o++){const p=new O.Z({xmin:0===o?l:-i/2,xmax:o===s?c-i*o:i/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===o?u-h:o===s?t-d:u;d+=m,f.push(m);const g=n.disableWrapAround&&o>0?null:this._fetchPixels(p,m,r,n);a.push(g)}const p=(await Promise.all(a)).map((e=>null==e?void 0:e.pixelBlock));let m=null;const g={width:t,height:r};return m=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},n):(0,ne.us)(p,g,{blockWidths:f}),{extent:e,srcExtent:(0,$.tB)(e,this.rasterInfo.spatialReference,n.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,r,n={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const i=await this._fetchRawTiles(e,t,r,n),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,h=a.y*c,d=new O.Z({xmin:s.xmin+u*t.x,xmax:s.xmin+u*(t.x+r.width-1),ymin:s.ymax-h*(t.y+r.height-1),ymax:s.ymax-h*t.y,spatialReference:s.spatialReference});if(!i)return{extent:d,srcExtent:d,pixelBlock:null};const{pixelBlocks:f}=i;if(1===f.length&&(0,o.pC)(f[0])&&f[0].width===r.width&&f[0].height===r.height)return{extent:d,srcExtent:d,pixelBlock:i.pixelBlocks[0]};const p=e>0?l.pyramidBlockWidth:l.blockWidth,m=e>0?l.pyramidBlockHeight:l.blockHeight,g={width:Math.ceil(r.width/p)*p,height:Math.ceil(r.height/m)*m},y={x:t.x%p,y:t.y%m};let x;return x=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:r,destDimension:r,clipOffset:y,clipSize:r,coefs:null,sampleSpacing:null,interpolation:n.interpolation,alignmentInfo:null,blockWidths:null},n):(0,ne.us)(f,g,{clipOffset:y,clipSize:r}),{extent:d,srcExtent:d,pixelBlock:x}}fetchRawTile(e,t,r,n){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,$.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,re.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,r){var n,i;const{customFetchParameters:s}=this.ioConfig,{range:a,query:o,headers:l}=t;r=null!=(n=null!=(i=r)?i:t.retryCount)?n:this.ioConfig.retryCount;const c=a?{Range:`bytes=${a.from}-${a.to}`}:null;try{return await(0,x.default)(e,{...t,query:{...o,...s},headers:{...l,...c}})}catch(n){if(r>0)return r--,this.request(e,t,r);throw n}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if(!(0,o.pC)(t))return null;if(!(0,o.pC)(e)||0===e.length)return null;let r=0;const n=e[0].variableName;for(let i=0;i<t.variables.length;i++){const s=t.variables[i],a=s.dimensions;if(s.name!==n){r+=a.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const o=a.map((e=>this._getDimensionValuesCount(e))),l=a.length;for(let t=0;t<l;t++){const n=e.filter((e=>e.dimensionName===a[t].name))[0];if(null==n)return null;const i=Array.isArray(n.values[0])?n.values[0][0]:n.values[0],s=this._getIndexFromDimensions(i,a[t]);if(-1===s)return null;o.shift(),r+=t===l-1?s:s*o.reduce(((e,t)=>e+t))}}return r}getTileExtentFromTileInfo(e,t,r,n){const i=n.lodAt(e);return this.getTileExtent({x:i.resolution,y:i.resolution},t,r,n.origin,n.spatialReference,n.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:n}=this.rasterInfo;if(!e.tileInfo){const i=[],s=e.maximumPyramidLevel||0;let a=Math.max(n.x,n.y),o=1/.0254*96*a;for(let e=0;e<=s;e++)i.push({level:s-e,resolution:a,scale:o}),a*=2,o*=2;const l=new G.Z({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new k.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:i}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,n){const{width:i,height:s,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new G.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==n&&(n=Math.max(0,Math.round(Math.log(Math.max(i,s))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],n);e.storageInfo=new j.Z({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:n,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,n,i,s=0,a=2){if(1===i.length&&s>0){i=[...i];let{x:e,y:t}=i[0];for(let r=0;r<s;r++)e*=a,t*=a,i.push({x:e,y:t})}const o=[],{x:l,y:c}=n;for(let n=0;n<i.length;n++){const{x:s,y:a}=i[n];o.push({minCol:Math.floor((e.xmin-l+.1*s)/t/s),maxCol:Math.floor((e.xmax-l-.1*s)/t/s),minRow:Math.floor((c-e.ymax+.1*a)/r/a),maxRow:Math.floor((c-e.ymin-.1*a)/r/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:n}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(r)&&r.length)return r[e-1];const i=n**e;return{x:t.x*i,y:t.y*i}}identifyPixelLocation(e,t,r){const{spatialReference:n,nativeExtent:i}=this.rasterInfo,{blockWidth:s,blockHeight:a,maximumPyramidLevel:o,origin:l}=this.rasterInfo.storageInfo,c=(0,$.nF)(e,n,r);if(!i.intersects(c))return null;if(t<0||t>o)return null;const u=this.getPyramidPixelSize(t),{x:h,y:d}=u,f=(l.y-c.y)/d/a,p=(c.x-l.x)/h/s,m=Math.min(a-1,Math.floor((f-Math.floor(f))*a)),g=Math.min(s-1,Math.floor((p-Math.floor(p))*s));return{pyramidLevel:t,row:Math.floor(f),col:Math.floor(p),rowOffset:m,colOffset:g,srcLocation:c}}getTileExtent(e,t,r,n,i,s){const[a,o]=s,l=n.x+r*a*e.x,c=l+a*e.x,u=n.y-t*o*e.y,h=u-o*e.y;return new O.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:i})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const n=this.rasterInfo.storageInfo.blockBoundary[e];return!n||n.maxRow<t||n.maxCol<r||n.minRow>t||n.minCol>r}async _fetchPixels(e,t,r,n={}){let i=(0,$.Hq)(e);if(i>=2)return{extent:e,pixelBlock:null};const s=this._getSourceDataInfo(e,t,r,n),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:h,srcHeight:d}=s;if(0===h||0===d)return{extent:e,srcExtent:u,pixelBlock:null};const f=(0,o.Wg)(this.rasterInfo.transform),p="gcs-shift"===(null==f?void 0:f.type),m=(0,o.pC)((0,$.ut)(e.spatialReference));!p&&m||(i=(0,$.Hq)(s.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((u.xmin-g.origin.x)/l.x+.1),y:Math.floor((g.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,y,{width:h,height:d,wrapCount:i},n);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const w=a>0?g.pyramidBlockWidth:g.blockWidth,b=a>0?g.pyramidBlockHeight:g.blockHeight,v=w===h&&b===d&&y.x%w==0&&y.y%b==0,I=new G.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),_=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:C}=n;if(!_&&v&&1===x.pixelBlocks.length&&w===t&&b===r&&c.x===I.x&&c.y===I.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const S=m&&(0,o.pC)((0,$.ut)(u.spatialReference)),k=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:I.toJSON(),datumTransformation:C,rasterTransform:f,hasWrapAround:i>0||S,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy},n):(0,$.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:I,datumTransformation:C,rasterTransform:f,hasWrapAround:i>0||S,isAdaptive:!1});let R;const T=!n.requestRawData,P={rows:k.spacing[0],cols:k.spacing[1]},M=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:O,mosaicSize:E,isPartiallyFilled:F}=x;if(this.rasterJobHandler)R=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:O,srcMosaicSize:E,destDimension:T?{width:t,height:r}:null,coefs:T?k.coefficients:null,sampleSpacing:T?P:null,interpolation:n.interpolation,alignmentInfo:M,blockWidths:null},n);else{const e=(0,ne.us)(O,E,{alignmentInfo:M});R=T?(0,ne.Uk)(e,{width:t,height:r},k.coefficients,P,n.interpolation):e}return n.requestRawData?{srcExtent:u,pixelBlock:R,transformGrid:k,extent:e,isPartiallyFilled:F}:{srcExtent:u,extent:e,pixelBlock:R}}async _fetchRawTiles(e,t,r,n){const{origin:i,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:h,height:d,wrapCount:f}=r;const p=this._getRasterTileAlignmentInfo(e,0);n.buffer&&(c-=n.buffer.cols,u-=n.buffer.rows,h+=2*n.buffer.cols,d+=2*n.buffer.rows);let m=0,g=0,y=0;f&&(0,o.pC)(p)&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=p),g*p.blockWidth-m>=c+h&&(m=0));const x=Math.floor(c/a),w=Math.floor(u/l),b=Math.floor((c+h+m-1)/a),v=Math.floor((u+d+m-1)/l),I=s[e];if(!I)return null;const{minRow:_,minCol:C,maxCol:S,maxRow:k}=I;if(0===f&&(v<_||b<C||w>k||x>S))return null;const R=new Array;let T=!1;const P=null==this.ioConfig.allowPartialFill?n.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=w;t<=v;t++)for(let r=x;r<=b;r++){let i=r;if(!n.disableWrapAround&&f&&(0,o.pC)(p)&&g<=r&&(i=r-g-y),t>=_&&i>=C&&k>=t&&S>=i){const r=this._fetchRawTile(e,t,i,n);P?R.push(new Promise((e=>{r.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):R.push(r)}else R.push(null)}if(0===R.length)return null;const M=await Promise.all(R),E={height:(v-w+1)*l,width:(b-x+1)*a},{spatialReference:F}=this.rasterInfo,B=this.getPyramidPixelSize(e),{x:D,y:N}=B;return{extent:new O.Z({xmin:i.x+x*a*D,xmax:i.x+(b+1)*a*D,ymin:i.y-(v+1)*l*N,ymax:i.y-w*l*N,spatialReference:F}),pixelBlocks:M,mosaicSize:E,isPartiallyFilled:T}}_fetchRawTile(e,t,r,n){const i=this.rasterInfo.storageInfo.blockBoundary[e];if(!i)return Promise.resolve(null);const{minRow:s,minCol:a,maxCol:l,maxRow:u}=i;if(t<s||r<a||t>u||r>l)return Promise.resolve(null);const h=K(this.url,n.sliceId),d=`${e}/${t}/${r}`;let f=Q(h,n.registryId,d);if((0,o.Wi)(f)){const i=new AbortController;f=this.fetchRawTile(e,t,r,{...n,signal:i.signal}),ee(h,n.registryId,d,f,i),f.catch((()=>te(h,n.registryId,d)))}return n.signal&&(0,c.fu)(n,(()=>{X(h,n.registryId,d)})),f}_getIndexFromDimensions(e,t){const{extent:r,interval:n,unit:i,values:s}=t;if(null!=s&&s.length)return Array.isArray(s[0])?s.findIndex((t=>t[0]<=e&&t[1]>=e)):s.indexOf(e);if(e>r[1])return-1;const a=r[0];let o=-1;if("ISO8601"===i){var l;switch((null==(l=t.intervalUnit)?void 0:l.toLowerCase())||"seconds"){case"seconds":o=Math.round((e-a)/1e3/n);break;case"minutes":o=Math.round((e-a)/6e4/n);break;case"hours":o=Math.round((e-a)/36e5/n);break;case"days":o=Math.round((e-a)/864e5/n);break;case"years":o=Math.round((new Date(e).getUTCFullYear()-new Date(a).getUTCFullYear())/n);break;case"decades":o=Math.round((new Date(e).getUTCFullYear()-new Date(a).getUTCFullYear())/10/n)}return o}return Math.round((e-a)/n)}_getDimensionValuesCount(e){const{extent:t,interval:r,unit:n,values:i}=e;let s=(null==i?void 0:i.length)||0;if(s)return s;const a=t[0];if(0===s&&"ISO8601"===n){var o;switch((null==(o=e.intervalUnit)?void 0:o.toLowerCase())||"seconds"){case"seconds":s=Math.round((t[1]-t[0])/1e3/r);break;case"minutes":s=Math.round((t[1]-t[0])/6e4/r);break;case"hours":s=Math.round((t[1]-t[0])/36e5/r);break;case"days":s=Math.round((t[1]-t[0])/864e5/r);break;case"years":s=Math.round((new Date(t[1]).getUTCFullYear()-new Date(a).getUTCFullYear())/r);break;case"decades":s=Math.round((new Date(t[1]).getUTCFullYear()-new Date(a).getUTCFullYear())/10/r)}return s}return Math.round((t[1]-t[0])/r)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,$.P_)(this.rasterInfo)),(0,o.pC)(this._rasterTileAlighmentInfo.pyramidsInfo)?{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}:null}_getSourceDataInfo(e,t,r,n={}){const i={datumTransformation:n.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};n.srcResolution&&(i.srcResolution=n.srcResolution,this._updateSourceDataInfo(e,i));const s=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=i,c=a/t,u=o/r,h=l<s&&c*u>=16;if(h||l===s&&(c>8||u>8)||0===a||0===o){const a=new G.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let o=(0,$.VO)(a,this.rasterInfo.spatialReference,e,i.datumTransformation);const d=!o||n.srcResolution&&o.x+o.y<n.srcResolution.x+n.srcResolution.y;if(h&&n.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(s-l+3>=e){const t=2**e;o={x:n.srcResolution.x*t,y:n.srcResolution.y*t}}}o&&(i.srcResolution=o,this._updateSourceDataInfo(e,i))}return(i.srcWidth/t>8||i.srcHeight/r>8)&&(i.srcWidth=0,i.srcHeight=0),i}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:n,datumTransformation:i}=t,{pyramidLevel:s,pyramidResolution:a,excessiveReading:l}=(0,$.kr)(n,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,$.tB)(e,r,i);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/a.x-.1),d=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=s,t.pyramidResolution=a,t.srcWidth=h,t.srcHeight=d}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}};(0,n._)([(0,u.Cb)()],ie.prototype,"_rasterTileAlighmentInfo",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],ie.prototype,"_isGlobalWrappableSource",null),(0,n._)([(0,u.Cb)(_.HQ)],ie.prototype,"url",null),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ie.prototype,"datasetName",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),(0,n._)([(0,u.Cb)()],ie.prototype,"rasterInfo",void 0),(0,n._)([(0,u.Cb)()],ie.prototype,"ioConfig",void 0),(0,n._)([(0,u.Cb)()],ie.prototype,"sourceJSON",void 0),ie=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.BaseRaster")],ie);const se=ie;var ae=r(20095);function oe(e){const t=e.fields,r=e.records,n=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",i=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),s=i.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[n]=o++,l=1;l<s.length;l++)t[s[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:i,features:a}}var le=r(87521),ce=r(74889);const ue=new Map;ue.set("int16","esriFieldTypeSmallInteger"),ue.set("int32","esriFieldTypeInteger"),ue.set("int64","esriFieldTypeInteger"),ue.set("float32","esriFieldTypeSingle"),ue.set("float64","esriFieldTypeDouble"),ue.set("text","esriFieldTypeString");let he=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:null==e?void 0:e.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:r,rasterInfo:n}=this._parseHeader(t);if("thematic"===n.dataType){const e=await this._fetchAuxiliaryInformation();n.attributeTable=e}this._set("storageInfo",r),this._set("rasterInfo",n),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,n={}){const i=this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(i<0)return null;const s=this._buildCacheFilePath(i,t,r,n.multidimensionalDefinition),a=this._getIndexRecordFromBundle(t,r),o=await this.request(s,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:n.signal});if(!o)return null;const l=new Uint8Array(o.data),c=this._getTileEndAndContentType(l,a);if(0===c.recordSize)return null;const u=await this.request(s,{range:{from:c.position,to:c.position+c.recordSize},responseType:"array-buffer",signal:n.signal});return u?this.decodePixelBlock(u.data,{width:this.rasterInfo.storageInfo.tileInfo.size[0],height:this.rasterInfo.storageInfo.tileInfo.size[1],planes:null,pixelType:null}):null}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){var t,r;const n=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,histograms:s,colormap:a,blockWidth:o,blockHeight:l,firstPyramidLevel:c,maximumPyramidLevel:u}=e,h=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),d=e.extent.spatialReference,f=null==(t=e.geodataXform)?void 0:t.spatialReference,p=new E.Z(null!=d&&d.wkid||null!=d&&d.wkt?d:f);let m=new O.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:p});const g=new G.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:p}),y=Math.round((m.xmax-m.xmin)/g.x),x=Math.round((m.ymax-m.ymin)/g.y),w=this._parseTransform(e.geodataXform),b=w?m:null;w&&(m=w.forwardTransform(m),g.x=(m.xmax-m.xmin)/y,g.y=(m.ymax-m.ymin)/x);const v=null!=(r=e.properties)?r:{},I=e.format.toLowerCase().replace("cache/",""),_=new G.Z(e.origin.x,e.origin.y,p);let C,S,R,T;if(a&&a.colors)for(C=[],S=0;S<a.colors.length;S++)R=a.colors[S],T=a.values?a.values[S]:S,C.push([T,255&R,R<<16>>>24,R<<8>>>24,R>>>24]);const P=e.LODInfos,M=[];for(S=0;S<P.levels.length;S++)M.push({level:P.levels[S],resolution:P.resolutions[S],scale:96/.0254*P.resolutions[S]});const F=new k.Z({dpi:96,lods:M,format:I,origin:_,size:[o,l],spatialReference:p}),B={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},D=[{maxCol:Math.ceil(y/o)-1,maxRow:Math.ceil(x/l)-1,minCol:0,minRow:0}];let N=2;if(u>0)for(S=0;S<u;S++)D.push({maxCol:Math.ceil(y/N/o)-1,maxRow:Math.ceil(x/N/l)-1,minCol:0,minRow:0}),N*=2;const Z=e.mdInfo;return{storageInfo:B,rasterInfo:new W.Z({width:y,height:x,pixelType:n,bandCount:i,extent:m,nativeExtent:b,transform:w,spatialReference:p,pixelSize:g,keyProperties:v,statistics:h,histograms:s,multidimensionalInfo:Z,colormap:C,storageInfo:new j.Z({blockWidth:o,blockHeight:l,pyramidBlockWidth:o,pyramidBlockHeight:l,origin:_,tileInfo:F,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:D})})}}_parseTransform(e){var t,r;if(!(0,le.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const n=(0,le.c)(e);if("identity"===n.type)return null;if("polynomial"!==n.type||null==(t=n.forwardCoefficients)||!t.length||null==(r=n.inverseCoefficients)||!r.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return n}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),n=await Promise.all([t,r]);let i;if(n[0]){let e=n[0].fields;const t=n[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ue.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(i={fields:e,features:r})}}return!i&&n[1]&&(i=class{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),r=3&t.getUint8(0);if(3!==r)return{header:{version:r},recordSet:null};const n=t.getUint32(4,!0),i=t.getUint16(8,!0),s=t.getUint16(10,!0),a={version:r,recordCount:n,headerByteCount:i,recordByteCount:s};let o=32;const l=[],c=[];let u;if(3===r){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ae.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<n&&e.byteLength-o>s;){const r=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)r.push((0,ae.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)r.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)r.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const n=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();r.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}o+=t.length})),c.push(r)):o+=s}}return{header:a,fields:l,records:c,recordSet:oe({fields:l,records:c})}}}.parse(n[1]).recordSet),ce.default.fromJSON(i)}_buildCacheFilePath(e,t,r,n){const i=this.storageInfo.packetSize,s=Math.floor(t/i)*i,a=Math.floor(r/i)*i,l="R"+this._toHexString4(s)+"C"+this._toHexString4(a);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=null==n?void 0:n[0];if(!(0,o.pC)(u)||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let d=u.variables.filter((e=>e.name===h.variableName))[0].dimensions[0].values.indexOf(h.values[0]).toString(16);const f=4-d.length;for(let e=0;e<f;e++)d="0"+d;return d="S"+d,`${this.url}/_alllayers/${h.variableName}/${d}/${c}/${l}.bundle`}_getIndexRecordFromBundle(e,t){const r=this.storageInfo.packetSize,n=r*(e%r)+t%r;if(n<0)throw"Invalid level / row / col";return 20+n*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let n,i=0;for(n=0;n<5;n++)i|=(255&r[n])<<8*n;const s=0xffffffffff&i;for(i=0,n=5;n<8;n++)i|=(255&r[n])<<8*(n-5);return{position:s,recordSize:0xffffffffff&i}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,n._)([(0,u.Cb)({readOnly:!0})],he.prototype,"storageInfo",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],he.prototype,"datasetFormat",void 0),he=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.CloudRaster")],he);const de=he;let fe=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(e){var t;await this.init();const{pixelBlock:r,statistics:n,histograms:i,name:s,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=r,d=this.data.extent||new O.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new E.Z({wkid:3857})}),f=null!=(t=this.data.isPseudoSpatialReference)?t:!this.data.extent,p={x:d.width/c,y:d.height/u},m=new W.Z({width:c,height:u,pixelType:h,extent:d,nativeExtent:o,transform:l,pixelSize:p,spatialReference:d.spatialReference,bandCount:3,keyProperties:a||{},statistics:n,isPseudoSpatialReference:f,histograms:i});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(r,{width:512,height:512},e),this.datasetName=s,this.url="/InMemory/"+s}fetchRawTile(e,t,r,n={}){const i=this._pixelBlockTiles.get(`${e}/${t}/${r}`);return Promise.resolve(i)}async _buildInMemoryRaster(e,t,r){const n=this.rasterInfo.storageInfo.maximumPyramidLevel,i=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n},r):Promise.resolve((0,ne.Vl)(e,t,n)),s=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=s&&l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},r):Promise.resolve((0,ne.Hv)(e)),h=await(0,c.as)([i,u]);if(!h[0].value&&h[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");var d,f;this._pixelBlockTiles=h[0].value,s||(this.rasterInfo.statistics=null==(d=h[1].value)?void 0:d.statistics),l&&(this.rasterInfo.histograms=null==(f=h[1].value)?void 0:f.histograms)}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],fe.prototype,"datasetFormat",void 0),(0,n._)([(0,u.Cb)()],fe.prototype,"data",void 0),fe=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],fe);const pe=fe;function me(e,t){if(!e||!t)return[];let r=t;t.indexOf("/")>-1?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const i=me(e,r);for(let e=0;e<i.length;e++)me(i[e],t).forEach((e=>n.push(e)));return n}const i=e.getElementsByTagNameNS("*",r);if(!i||0===i.length)return[];for(let e=0;e<i.length;e++)n.push(i[e]||i.item[e]);return n}function ge(e,t){if(!e||!t)return null;let r=t;t.indexOf("/")>-1?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=me(e,r);return n.length>0?t?ge(n[0],t):n[0]:null}function ye(e,t=null){const r=t?ge(e,t):e;let n;return r?(n=r.textContent||r.nodeValue,n?n.trim():null):null}function xe(e,t){return function(e,t){const r=me(e,t),n=[];let i;for(let e=0;e<r.length;e++)i=r[e].textContent||r[e].nodeValue,i&&(i=i.trim(),""!==i&&n.push(i));return n}(e,t).map((e=>Number(e)))}function we(e,t){const r=ye(e,t);return Number(r)}function be(e,t){var r;const n=null==e||null==(r=e.nodeName)?void 0:r.toLowerCase(),i=t.toLowerCase();return n.slice(n.lastIndexOf(":")+1)===i}var ve=r(87390);function Ie(e,t){if(!e||!t)return null;const r=[];for(let n=0;n<e.length;n++)r.push(e[n]),r.push(t[n]);return r}function _e(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new E.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const r=e.indexOf("VERTCS"),n=e.indexOf("PROJCS"),i=n>-1?n:e.indexOf("GEOGCS");if(-1===i)return null;const s=e.slice(i,e.lastIndexOf("]",r)+1).trim(),a=e.slice(r,e.lastIndexOf("]")).trim();t=Ce(s);const o=new E.Z(t?{wkid:t}:{wkt:s}),l=Ce(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ce(e),new E.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ce(e){var t;const r=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),n=r[r.length-1].split(","),i=null==(t=n[0])?void 0:t.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(n[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Se(e){var t;if("pamdataset"!==(null==e||null==(t=e.documentElement.tagName)?void 0:t.toLowerCase()))return{};const r={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(be(e,"SRS")){if(!r.spatialReference){const t=ye(e);r.spatialReference=_e(t)}}else if(be(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:t,transform:n}=function(e){var t;const r=ge(e,"GeodataXform"),n=_e(we(r,"SpatialReference/WKID")||ye(r,"SpatialReference/WKT"));if("typens:PolynomialXform"!==r.getAttribute("xsi:type"))return{spatialReference:n,transform:null};const i=null!=(t=we(r,"PolynomialOrder"))?t:1,s=xe(r,"CoeffX/Double"),a=xe(r,"CoeffY/Double"),o=xe(r,"InverseCoeffX/Double"),l=xe(r,"InverseCoeffY/Double"),c=Ie(s,a),u=Ie(o,l);return{spatialReference:n,transform:new ve.Z({spatialReference:n,polynomialOrder:i,forwardCoefficients:c,inverseCoefficients:u})}}(e);r.transform=n,r.spatialReference||(r.spatialReference=t)}else me(e,"MDI").forEach((e=>r.metadata[e.getAttribute("key")]=ye(e)));else if(be(e,"PAMRasterBand")){const t=function(e){var t;const r=we(e,"NoDataValue"),n=ge(e,"Histograms/HistItem"),i=we(n,"HistMin"),s=we(n,"HistMax"),a=we(n,"BucketCount"),o=null==(t=ye(n,"HistCounts"))?void 0:t.split("|").map((e=>Number(e)));let l,c,u,h;me(e,"Metadata/MDI").forEach((e=>{var t;const r=Number(null!=(t=e.textContent)?t:e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=r;break;case"STATISTICS_MAXIMUM":c=r;break;case"STATISTICS_MEAN":u=r;break;case"STATISTICS_STDDEV":h=r}}));const d=we(e,"Metadata/SourceBandIndex");return{noDataValue:r,histogram:null!=o&&o.length&&null!=l&&null!=c?{min:i,max:s,size:a||o.length,counts:o}:null,sourceBandIndex:d,statistics:null!=l&&null!=c?{min:l,max:c,avg:u,stddev:h}:null}}(e);null!=t.sourceBandIndex&&null==r.rasterBands[t.sourceBandIndex]?r.rasterBands[t.sourceBandIndex]=t:r.rasterBands.push(t)}}));const n=r.rasterBands;if(n){const e=!!n[0].statistics;r.statistics=e?n.map((e=>e.statistics)):null;const t=!!n[0].histogram;r.histograms=t?n.map((e=>e.histogram)):null}return r}let ke=class extends se{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:r,statistics:n,histograms:i,transform:s}=await this._fetchAuxiliaryData(e);const a=!r;a&&(r=new E.Z({wkid:3857})),null!=i&&i.length&&null==n&&(n=(0,ne.Oh)(i));const{width:o,height:l}=t;let c=new O.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:r});const u=s?s.forwardTransform(c):c;let h=!0;if(s){const e=s.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(s=null,c=u)}const d=new pe({data:{extent:u,nativeExtent:c,transform:s,pixelBlock:t,statistics:n,histograms:i,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await d.open(),this._set("rasterInfo",d.rasterInfo),this._inMemoryRaster=d}fetchRawTile(e,t,r,n={}){return this._inMemoryRaster.fetchRawTile(e,t,r,n)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:null==e?void 0:e.signal}),r=(0,re.y)(t).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new a.Z("image-aux-raster:open","the data is not a supported format");return this._set("datasetFormat",r),await this.decodePixelBlock(t,{format:"jpg",width:1,height:1,useCanvas:!0})}async _fetchAuxiliaryData(e){var t,r;const n=(0,o.Wg)(null==e?void 0:e.signal),i=null!=(t=this.ioConfig.skipExtensions)?t:[],s=i.indexOf("aux.xml")>-1?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:n}),a=this.datasetFormat,l="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,u=i.indexOf(l)>-1?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:n}),h=await(0,c.as)([s,u]);if(null!=n&&n.aborted)throw(0,c.zE)();const d=Se(null==(r=h[0].value)?void 0:r.data);if(!d.transform){const e=h[1].value?h[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;d.transform=6===(null==e?void 0:e.length)?new ve.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return d}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),ke=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],ke);const Re=ke;var Te=r(17452),Pe=r(45322),Me=r(56608),Oe=r(29680);let Ee=class extends se{constructor(){super(...arguments),this._levelOffset=0,this._slices=null,this._tilemapCache=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const t=e&&e.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=r.data;if(this.sourceJSON=n,!n)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].indexOf(n.tileInfo.format.toLowerCase())>-1?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name.slice(n.name.indexOf("/")+1);const i=await this._fetchRasterInfo({signal:t});if(!(0,o.pC)(i))throw new a.Z("image-server-raster:open","cannot initialize image service");{const e="Map"===this.tileType?(0,Pe.d)(n.tileInfo,n):k.Z.fromJSON(n.tileInfo),{extent:t,pixelSize:r}=i,s=.5/i.width*r.x;let a,o;const l=e.lodAt(Math.max.apply(null,e.lods.map((e=>e.level))));"Map"!==this.tileType&&0!==n.maxScale&&("Raster"===this.tileType?(a=e.lods.filter((e=>e.resolution===r.x))[0],a||(a=e.lods[e.lods.length-1])):(a=e.lods.filter((e=>Math.abs(e.scale-n.maxScale)<s))[0],a||(a=e.lods.filter((e=>e.scale>n.maxScale)).sort(((e,t)=>e.scale>t.scale?1:-1))[0])),r.x=r.y=a.resolution,i.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),i.height=Math.ceil((t.ymax-t.ymin)/r.y-.1)),a||(a=l);const c=e.lodAt(Math.min.apply(null,e.lods.map((e=>e.level))));"Map"===this.tileType?this._levelOffset=e.lods[0].level:0!==n.minScale&&"Elevation"===this.tileType&&(o=e.lods.filter((e=>Math.abs(e.scale-n.minScale)<s))[0],this._levelOffset=o.level-c.level),o||(o=c);const u=Math.max(r.x,r.y);(Math.abs(r.x-r.y)>s||!e.lods.some((e=>Math.abs(e.resolution-u)<s)))&&(r.x=r.y=a.resolution,i.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),i.height=Math.ceil((t.ymax-t.ymin)/r.y-.1));const h=a.level-o.level,[d,f]=e.size,p=[];e.lods.forEach((e=>{e.level>=o.level&&e.level<=a.level&&p.push({x:e.resolution,y:e.resolution})})),p.sort(((e,t)=>e.x-t.x));const m=this.computeBlockBoundary(t,d,f,e.origin,p,h),g=p.length>1?p.slice(1):null;i.storageInfo=new j.Z({blockWidth:e.size[0],blockHeight:e.size[1],pyramidBlockWidth:e.size[0],pyramidBlockHeight:e.size[1],pyramidResolutions:g,compression:e.format,origin:e.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:e,blockBoundary:m}),this._fixGCSShift(i),this._set("rasterInfo",i)}if(n.capabilities.toLowerCase().indexOf("tilemap")>-1){const e={tileInfo:i.storageInfo.tileInfo,parsedUrl:(0,Te.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new Me.y({layer:e})}}async fetchRawTile(e,t,r,n={}){if(this._slices&&null==n.sliceId)return null;const{storageInfo:i,extent:s}=this.rasterInfo,a=i.maximumPyramidLevel-e+this._levelOffset,o=`${this.url}/tile/${a}/${t}/${r}`,l=this._slices?{sliceId:n.sliceId||0}:null,{data:c}=await this.request(o,{query:l,responseType:"array-buffer",signal:n.signal});if(!c)return null;const u=await this.decodePixelBlock(c,{width:i.tileInfo.size[0],height:i.tileInfo.size[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType}),h=i.blockBoundary[e];if("jpg"!==i.compression||r>h.minCol&&r<h.maxCol&&t>h.minRow&&t<h.maxRow)return u;const{origin:d,blockWidth:f,blockHeight:p}=i,{x:m,y:g}=this.getPyramidPixelSize(e),y=Math.round((s.xmin-d.x)/m)%f,x=Math.round((s.xmax-d.x)/m)%f,w=Math.round((d.y-s.ymax)/g)%p,b=Math.round((d.y-s.ymin)/g)%p,v=r===h.minCol?y:0,I=t===h.minRow?w:0,_=r===h.maxCol?x:f,C=t===h.maxRow?b:p;return(0,ne.pW)(u,{x:v,y:I},{width:_-v,height:C-I}),u}getSliceIndex(e){if(!this._slices||(0,o.Wi)(e)||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const r=this._slices[e].multidimensionalDefinition;if(r.length===t.length&&!r.some((e=>{const r=t.filter((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName))[0];return!r||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const r=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.statistics})),n=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),i=await Promise.all([r,n]);return i[0]&&i[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:i[0]||null,histograms:i[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===r)return null;let n=0;const{maximumPyramidLevel:i}=this.rasterInfo.storageInfo;let s=i-n+this._levelOffset;const a=r.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,r.row,r.col,t))break}catch{}if(s--,n++,r=this.identifyPixelLocation(a,n,(0,o.Wg)(t.datumTransformation)),null===r)return null}return-1===s||null==r?null:n}async _fetchRasterInfo(e){const t=this.sourceJSON,r=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),n=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),i=E.Z.fromJSON(t.spatialReference||t.extent.spatialReference);if("Map"===this.tileType)return new W.Z({width:r,height:n,bandCount:3,extent:O.Z.fromJSON(t.extent),spatialReference:i,pixelSize:new G.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:i}),pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}});const{slice:s,signal:a}=e,o=!!t.hasRasterAttributeTable&&this.request(this.url+"/rasterAttributeTable",{query:{slice:s,f:"json"},signal:a}).then((e=>ce.default.fromJSON(e.data))).catch((()=>null)),l=!!t.hasColormap&&this.request(this.url+"/colormap",{query:{slice:s,f:"json"},signal:a}).then((e=>{var t;return null==(t=e.data)?void 0:t.colormap})),c=!!t.hasHistograms&&this.request(this.url+"/histograms",{query:{slice:s,f:"json"},signal:a}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),u=this.request(this.url+"/keyProperties",{query:{f:"json"},signal:a}).then((e=>e.data)).catch((()=>{})),h=!!t.hasMultidimensions&&this._fetchMultidimensionalInfo(),d=!!t.hasMultidimensions&&this.request(this.url+"/slices",{query:{f:"json"},signal:a}).then((e=>e.data&&e.data.slices)).catch((()=>{}));return Promise.all([o,l,c,u,h,d]).then((e=>{let s=null;if(t.minValues&&t.minValues.length===t.bandCount){s=[];for(let e=0;e<t.minValues.length;e++)s.push({min:t.minValues[e],max:t.maxValues[e],avg:t.meanValues[e],stddev:t.stdvValues[e]})}return this._slices=e[5]||null,new W.Z({width:r,height:n,bandCount:t.bandCount,extent:O.Z.fromJSON(t.extent),spatialReference:i,pixelSize:new G.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:i}),pixelType:t.pixelType.toLowerCase(),statistics:s,attributeTable:e[0]||null,colormap:e[1]||null,histograms:e[2]||null,keyProperties:e[3]||{},multidimensionalInfo:e[4]||null})}))}async _fetchMultidimensionalInfo(e){var t;const r=await this.request(this.url+"/multidimensionalInfo",{query:{f:"json"},signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.multidimensionalInfo}));return null!=(t=r.variables)&&t.length&&r.variables.forEach((e=>{var t;null!=(t=e.statistics)&&t.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))})),r}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:r}=e;0===t.xmin&&360===t.xmax&&r.wkid&&r.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Oe.Z,e.extent=e.transform.forwardTransform(t))}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],Ee.prototype,"datasetFormat",void 0),(0,n._)([(0,u.Cb)()],Ee.prototype,"tileType",void 0),Ee=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ee);const Fe=Ee;var Be=r(54163),De=r(48279);const Ne=new Map;Ne.set("Int8","s8"),Ne.set("UInt8","u8"),Ne.set("Int16","s16"),Ne.set("UInt16","u16"),Ne.set("Int32","s32"),Ne.set("UInt32","u32"),Ne.set("Float32","f32"),Ne.set("Float64","f32"),Ne.set("Double64","f32");const Ze=new Map;Ze.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ze.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ze.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ze.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let He=class extends se{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){var t;await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const r=e?(0,o.Wg)(e.signal):null,n=await this.request(this.url,{responseType:"xml",signal:r}),{rasterInfo:i,files:s}=this._parseHeader(n.data);if(-1===(null==(t=this.ioConfig.skipExtensions)?void 0:t.indexOf("aux.xml"))){const t=await this._fetchAuxiliaryData(e);var a;null!=t&&(i.statistics=null!=(a=t.statistics)?a:i.statistics,i.histograms=t.histograms,t.histograms&&!(0,o.pC)(i.statistics)&&(i.statistics=(0,ne.Oh)(t.histograms)))}this._set("rasterInfo",i),this._files=s;const l=await this.request(s.index,{responseType:"array-buffer",signal:r});this._storageIndex=this._parseIndex(l.data);const{blockWidth:c,blockHeight:u}=this.rasterInfo.storageInfo,h=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:d,height:f}=this.rasterInfo,p=[],m=this._getBandSegmentCount();let g=0,y=-1;for(;g<this._storageIndex.length;){y++;const e=Math.ceil(d/c/h**y)-1,t=Math.ceil(f/u/h**y)-1;g+=(e+1)*(t+1)*m*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}async fetchRawTile(e,t,r,n={}){const{blockWidth:i,blockHeight:s,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<r||l.minRow>t||l.minCol>r)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:h,actualTileWidth:d,actualTileHeight:f}=this._getTileLocation(e,t,r);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const e=new Uint8Array(i*s);return new Be.Z({width:i,height:s,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)(!p||p.indexOf[y]>-1)&&g.push(this.request(this._files.data,{range:{from:h[y].from,to:h[y].to},responseType:"array-buffer",signal:n.signal}));const x=await Promise.all(g),w=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(w);let v=0;for(y=0;y<m;y++)b.set(new Uint8Array(x[y].data),v),v+=x[y].data.byteLength;const I=Ze.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:i,height:s,format:I,planes:(null==p?void 0:p.length)||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==I&&!_.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=_.width*_.height,r=new Uint8Array(t);if(Math.abs(e)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-e)/e)>1e-6&&(r[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==e&&(r[y]=1);_.mask=r}}let C=0,S=0;if(d!==i||f!==s){let e=_.mask;if(e)for(y=0;y<s;y++)if(S=y*i,y<f)for(C=d;C<i;C++)e[S+C]=0;else for(C=0;C<i;C++)e[S+C]=0;else for(e=new Uint8Array(i*s),_.mask=e,y=0;y<f;y++)for(S=y*i,C=0;C<d;C++)e[S+C]=1}return _}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,r,n,i,s,a;if(De.f){for(r=new Uint8Array(e),i=new ArrayBuffer(e.byteLength),n=new Uint8Array(i),s=0;s<e.byteLength/4;s++)for(a=0;a<4;a++)n[4*s+a]=r[4*s+3-a];t=new Uint32Array(i)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ze.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,r){const{blockWidth:n,blockHeight:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,d=0,f=0;for(h=0;h<e;h++)f=s**h,c=Math.ceil(a/n/f),u=Math.ceil(o/i/f),d+=c*u;f=s**e,c=Math.ceil(a/n/f),u=Math.ceil(o/i/f),d+=t*c+r,d*=4*l;const p=this._storageIndex.subarray(d,d+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=p[4*e+0]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3],y.push({from:m,to:g});return{ranges:y,actualTileWidth:r<c-1?n:Math.ceil(a/f)-n*(c-1),actualTileHeight:t<u-1?i:Math.ceil(o/f)-i*(u-1)}}_parseHeader(e){const t=ge(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const r=ge(t,"Size"),n=parseInt(r.getAttribute("x"),10),i=parseInt(r.getAttribute("y"),10),s=parseInt(r.getAttribute("c"),10),o=(ye(t,"Compression")||"none").toLowerCase();if(!Ze.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=ye(t,"DataType")||"UInt8",c=Ne.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=ge(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),d=parseInt(u.getAttribute("y"),10),f=ge(t,"DataValues");let p,m;if(f&&(m=f.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),ge(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const g=ge(e,"MRF_META/GeoTags"),y=ge(g,"BoundingBox");let x,w=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),r=parseFloat(y.getAttribute("maxx")),n=parseFloat(y.getAttribute("maxy")),i=ye(g,"Projection")||"";let s;if("LOCAL_CS[]"!==i)if(i.toLowerCase().startsWith("epsg:")){const e=Number(i.slice(5));isNaN(e)||0===e||(s=new E.Z({wkid:e}))}else s=_e(i);else w=!0,s=new E.Z({wkid:3857});x=new O.Z(e,t,r,n),x.spatialReference=s}else w=!0,x=new O.Z({xmin:-.5,ymin:.5-i,xmax:n-.5,ymax:.5,spatialReference:new E.Z({wkid:3857})});const b=ge(e,"MRF_META/Rsets"),v=parseInt(b&&b.getAttribute("scale")||"2",10),I=x.spatialReference,_=new j.Z({origin:new G.Z({x:x.xmin,y:x.ymax,spatialReference:I}),blockWidth:h,blockHeight:d,pyramidBlockWidth:h,pyramidBlockHeight:d,compression:o,pyramidScalingFactor:v}),C=new G.Z({x:x.width/n,y:x.height/i,spatialReference:I}),S=new W.Z({width:n,height:i,extent:x,isPseudoSpatialReference:w,spatialReference:I,bandCount:s,pixelType:c,pixelSize:C,noDataValue:p,storageInfo:_}),k=ye(e,"datafile"),R=ye(e,"IndexFile");return{rasterInfo:S,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:k||this.url.replace(".mrf",Ze.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:null==e?void 0:e.signal});return Se(t)}catch{return null}}};(0,n._)([(0,u.Cb)()],He.prototype,"_files",void 0),(0,n._)([(0,u.Cb)()],He.prototype,"_storageIndex",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,n._)([(0,p.j)("esri.layers.support.rasterIO.MRFRaster")],He);const Ae=He;var Le=r(94793),ze=r(9832);const Je=function(e,t){const r=e.get(t);return r&&r.values},We=function(e,t){const r=e.get(t);return r&&r.values[0]};let je=class extends se{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){var t,r,n;await this.init();const i=e?(0,o.Wg)(e.signal):null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:i});if(!s)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:l,firstIFD:c,isBigTiff:u}=(0,Le.cK)(s),h=[];await this._readIFDs(h,s,l,c,0,u?8:4,i);const d=(0,Le.FI)(h),{width:f,height:p,tileWidth:m,tileHeight:g,planes:y,pixelType:x,compression:w,firstPyramidLevel:b,maximumPyramidLevel:v,pyramidBlockWidth:I,pyramidBlockHeight:_,tileBoundary:C,affine:S,metadata:k}=d;let R=_e((null==(t=d.extent.spatialReference)?void 0:t.wkt)||(null==(r=d.extent.spatialReference)?void 0:r.wkid)),T=!1;null==R&&(T=!0,R=new E.Z({wkid:3857}));const P=new O.Z({...d.extent,spatialReference:R}),M=new G.Z(P?{x:P.xmin,y:P.ymax,spatialReference:R}:{x:0,y:0}),F=new j.Z({blockWidth:m,blockHeight:g,pyramidBlockWidth:I,pyramidBlockHeight:_,compression:w,origin:M,firstPyramidLevel:b,maximumPyramidLevel:v,blockBoundary:C}),B=new G.Z({x:(P.xmax-P.xmin)/f,y:(P.ymax-P.ymin)/p,spatialReference:R}),D=k?{BandProperties:k.bandProperties,DataType:k.dataType}:{},N=new W.Z({width:f,height:p,bandCount:y,pixelType:x,compression:w,pixelSize:B,storageInfo:F,spatialReference:R,isPseudoSpatialReference:T,keyProperties:D,extent:P,statistics:k?k.statistics:null});if(null!=S&&S.length&&(N.nativeExtent=new O.Z({xmin:-.5,ymin:.5-p,xmax:f-.5,ymax:.5,spatialReference:R}),N.transform=new ve.Z({polynomialOrder:1,forwardCoefficients:[S[2]+S[0]/2,S[5]-S[3]/2,S[0],S[3],-S[1],-S[4]]}),N.extent=N.transform.forwardTransform(N.nativeExtent),N.pixelSize=new G.Z({x:(P.xmax-P.xmin)/f,y:(P.ymax-P.ymin)/p,spatialReference:R}),F.origin.x=-.5,F.origin.y=.5),null==(n=this.ioConfig.skipExtensions)||!n.includes("aux.xml")){const t=await this._fetchAuxiliaryData(e);if(null!=t){var Z;if(N.statistics=null!=(Z=t.statistics)?Z:N.statistics,N.histograms=t.histograms,t.histograms&&!(0,o.pC)(N.statistics)&&(N.statistics=(0,ne.Oh)(t.histograms)),t.transform&&!S){N.transform=t.transform,N.nativeExtent=N.extent;const e=N.transform.forwardTransform(N.nativeExtent);N.pixelSize=new G.Z({x:(e.xmax-e.xmin)/f,y:(e.ymax-e.ymin)/p,spatialReference:R}),N.extent=e}N.spatialReference||(N.spatialReference=t.spatialReference)}}if(this._set("rasterInfo",N),this._headerInfo={littleEndian:l,isBigTiff:u,ifds:h,...d},!this._headerInfo.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);this.updateTileInfo()}async fetchRawTile(e,t,r,n={}){var i;if(null==(i=this._headerInfo)||!i.isSupported||this.isBlockOutside(e,t,r))return null;const s=this._getTileLocation(e,t,r);if(!s)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=s,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal}))),h=await Promise.all(u),d=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),f=1===h.length?h[0].data:new ArrayBuffer(d),p=[0],m=[0];if(h.length>1){const e=new Uint8Array(f);for(let t=0,r=0;t<h.length;t++){const n=h[t].data;e.set(new Uint8Array(n),r),p[t]=r,r+=n.byteLength,m[t]=n.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(f,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:p,sizes:m},width:g,height:y,planes:null,pixelType:null});let w,b,v;if(o!==g||l!==y){let e=x.mask;if(e)for(w=0;w<y;w++)if(v=w*g,w<l)for(b=o;b<g;b++)e[v+b]=0;else for(b=0;b<g;b++)e[v+b]=0;else for(e=new Uint8Array(g*y),x.mask=e,w=0;w<l;w++)for(v=w*g,b=0;b<o;b++)e[v+b]=1}return x}async _readIFDs(e,t,r,n,i,s=4,a){if(!n)return null;(n>=t.byteLength||n<0)&&(t=(await this.request(this.url,{range:{from:n+i,to:n+i+this._bufferSize},responseType:"array-buffer",signal:a})).data,i=n+i,n=0);const o=await this._readIFD(t,r,n,i,ze.Z.TIFF_TAGS,s,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-i,i,s,a)}async _readIFD(e,t,r,n,i=ze.Z.TIFF_TAGS,s=4,a){if(!e)return null;const o=(0,Le.vr)(e,t,r,n,i,s);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const i=r.map((e=>e.offlineOffsetSize)),s=Math.min.apply(null,i.map((e=>e[0])));if(Math.min.apply(null,i.map((e=>e[0]+e[1])))-s<=this._bufferSize){const{data:i}=await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:a});e=i,n=s,r.forEach((r=>(0,Le.Dq)(e,t,r,n)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),i=r.values;if(i&&i.length>4){const s=i[0]+"."+i[1]+"."+i[2],o=await this._readIFD(e,t,r.valueOffset+6-n,n,ze.Z.GEO_KEYS,2,a);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:n,to:n+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,n,ze.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,r){const{firstPyramidLevel:n,blockBoundary:i}=this.rasterInfo.storageInfo,s=0===e?0:e-(n-1),a=this._headerInfo.ifds[s];if(!a)return null;const o=(0,Le.If)(a,this._headerInfo),l=Je(a,"TILEOFFSETS");if(void 0===l)return null;const c=Je(a,"TILEBYTECOUNTS"),{minRow:u,minCol:h,maxRow:d,maxCol:f}=i[s];if(t>d||r>f||t<u||r<h)return null;const p=We(a,"IMAGEWIDTH"),m=We(a,"IMAGELENGTH"),g=We(a,"TILEWIDTH"),y=We(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,w=x*t*(f+1)+r,b=[{from:l[w],to:l[w+x-1]+c[w+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[w+t]+c[w+t]!==l[w+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[w+e],to:l[w+e]+c[w+e]-1}}const v=l[w],I=c[w];return null==v||null==I?null:{ranges:b,ifd:a,actualTileWidth:r===f?p%g:g,actualTileHeight:t===d?m%y:y}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:null==e?void 0:e.signal});return Se(t)}catch{return null}}};(0,n._)([(0,u.Cb)()],je.prototype,"_files",void 0),(0,n._)([(0,u.Cb)()],je.prototype,"_headerInfo",void 0),(0,n._)([(0,u.Cb)()],je.prototype,"_bufferSize",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],je.prototype,"datasetFormat",void 0),je=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.TIFFRaster")],je);const Ue=je,qe=new Map;qe.set("CRF",{desc:"Cloud Raster Format",constructor:de}),qe.set("MRF",{desc:"Meta Raster Format",constructor:Ae}),qe.set("TIFF",{desc:"GeoTIFF",constructor:Ue}),qe.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Fe}),qe.set("JPG",{desc:"JPG Raster Format",constructor:Re}),qe.set("PNG",{desc:"PNG Raster Format",constructor:Re}),qe.set("GIF",{desc:"GIF Raster Format",constructor:Re}),qe.set("BMP",{desc:"BMP Raster Format",constructor:Re});var $e=r(32163);let Ge=class extends((0,g.h)((0,H.M)((0,D.q)((0,N.I)((0,y.N)(B((0,A.n)((0,Z.Q)((0,l.R)(m.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var e,t;let r=[new L.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const n=null==(e=this.rasterInfo)||null==(t=e.attributeTable)?void 0:t.fields;if(n){const e=n.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));r=r.concat(e)}const i=this.rasterInfo.dataType;if(("vector-magdir"===i||"vector-uv"===i)&&(0,o.pC)(this.rasterInfo.multidimensionalInfo)){var s;const e=null==(s=this.rasterInfo.multidimensionalInfo.variables[0].unit)?void 0:s.trim(),t="Magnitude"+(e?` (${e})`:"");r.push(new L.Z({name:"Raster.Magnitude",alias:t,domain:null,editable:!1,type:"double"})),r.push(new L.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return r}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,r){const n=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,i=(0,s.ij)(n,r)||void 0;if(null!=i)return i}createPopupTemplate(e){return(0,$e.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:r}=this;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){this.raster?(this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url):this.raster=await class{static get supportedFormats(){const e=new Set;return qe.forEach(((t,r)=>e.add(r))),e}static async open(e){const{url:t,ioConfig:r,sourceJSON:n}=e;let i=e.datasetFormat;null==i&&t.lastIndexOf(".")&&(i=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===i||"TIF"===i?i="TIFF":"JPG"!==i&&"JPEG"!==i&&"JFIF"!==i||(i="JPG"),t.toLowerCase().indexOf("/imageserver")>-1&&-1===t.toLowerCase().indexOf("/wcsserver")&&(i="RasterTileServer");const s={url:t,sourceJSON:n,datasetFormat:i,ioConfig:r||{bandIds:null,sampling:null}};let o,l;if(this.supportedFormats.has(i))return o=qe.get(i).constructor,l=new o(s),await l.open({signal:e.signal}),l;if(i)throw new a.Z("rasterfactory:open","not a supported format "+i);const c=Array.from(qe.keys());let u=0;const h=function(){return i=c[u++],i?(o=qe.get(i).constructor,l=new o(s),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null};return h()}static register(e,t,r){qe.has(e.toUpperCase())||qe.set(e.toUpperCase(),{desc:t,constructor:r})}}.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON&&(this._set("version",this.sourceJSON.currentVersion),this._set("copyright",this.sourceJSON.copyrightText),this.sourceJSON.timeInfo&&this._set("timeInfo",J.Z.fromJSON(this.sourceJSON.timeInfo))),null==this.title&&(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.watch("customParameters",(e=>this.raster.ioConfig.customFetchParameters=e))}};(0,n._)([(0,u.Cb)({type:[h.z8],json:{write:{overridePolicy(){var e;return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==(null==(e=this.bandIds)?void 0:e.join(","))}}}}})],Ge.prototype,"bandIds",void 0),(0,n._)([(0,u.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,d.J)(z.c)],Ge.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ge.prototype,"multidimensionalDefinition",void 0),(0,n._)([(0,u.Cb)(_.rn)],Ge.prototype,"legendEnabled",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ge.prototype,"isReference",void 0),(0,n._)([(0,u.Cb)({type:["show","hide"]})],Ge.prototype,"listMode",void 0),(0,n._)([(0,u.Cb)()],Ge.prototype,"sourceJSON",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],Ge.prototype,"version",void 0),(0,n._)([(0,u.Cb)()],Ge.prototype,"title",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],Ge.prototype,"type",void 0),(0,n._)([(0,u.Cb)({type:["ArcGISTiledImageServiceLayer"]})],Ge.prototype,"operationalLayerType",void 0),(0,n._)([(0,u.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],Ge.prototype,"popupEnabled",void 0),(0,n._)([(0,u.Cb)({type:i.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Ge.prototype,"popupTemplate",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],Ge.prototype,"defaultPopupTemplate",null),(0,n._)([(0,u.Cb)({readOnly:!0,type:[L.Z]})],Ge.prototype,"fields",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,type:[L.Z]})],Ge.prototype,"rasterFields",null),(0,n._)([(0,u.Cb)({types:s.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var e;const t="raster-stretch"===(null==(e=this.renderer)?void 0:e.type)&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!t}}},origins:{"web-scene":{types:s.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"animated-flow"!==e.type})}}}}})],Ge.prototype,"renderer",null),(0,n._)([(0,f.r)("renderer")],Ge.prototype,"readRenderer",null),Ge=(0,n._)([(0,p.j)("esri.layers.ImageryTileLayer")],Ge);const Ve=Ge},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var n,i=r(43697),s=r(66577),a=r(1692),o=r(35454),l=r(96674),c=r(22974),u=r(70586),h=r(5600),d=(r(75215),r(71715)),f=r(52011),p=r(30556),m=r(82971),g=r(33955),y=r(1231);const x=new o.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=n=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const i=e[t],s=a.Z.fromJSON(i),o=i.geometry&&i.geometry.spatialReference;(0,u.pC)(s.geometry)&&!o&&(s.geometry.spatialReference=r),n.push(s)}return n}writeGeometryType(e,t,r,n){if(e)return void x.write(e,t,r,n);const{features:i}=this;if(i)for(const e of i)if(e&&(0,u.pC)(e.geometry))return void x.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,g.im)(e);return!r&&t.spatialReference&&(n.spatialReference=m.Z.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,u.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,c.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e&&e[r];n.geometry=t&&t.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,i]}=e,s=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=s.length;e<t;e++)a((0,u.Wg)(s[e].geometry))||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,i],scale:[s,a]}=r,o=this._getHydrationFunction(e,(e=>e*s+n),(e=>i-e*a));for(const{geometry:e}of t)(0,u.pC)(e)&&o(e);return this.transform=null,this}_quantizePoints(e,t,r){let n,i;const s=[];for(let a=0,o=e.length;a<o;a++){const o=e[a];if(a>0){const e=t(o[0]),a=r(o[1]);e===n&&a===i||(s.push([e-n,a-i]),n=e,i=a)}else n=t(o[0]),i=r(o[1]),s.push([n,i])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,g.oU)(e)?e.rings:e.paths,i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],a=this._quantizePoints(s,t,r);a&&i.push(a)}return i.length>0?((0,g.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const n=(0,g.oU)(e)?e.rings:e.paths;let i,s;for(let e=0,a=n.length;e<a;e++){const a=n[e];for(let e=0,n=a.length;e<n;e++){const n=a[e];e>0?(i+=n[0],s+=n[1]):(i=n[0],s=n[1]),n[0]=t(i),n[1]=r(s)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const n=e.points;let i,s;for(let e=0,a=n.length;e<a;e++){const a=n[e];e>0?(i+=a[0],s+=a[1]):(i=a[0],s=a[1]),a[0]=t(i),a[1]=r(s)}}:void 0}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,h.Cb)({type:[a.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,i._)([(0,d.r)("features")],w.prototype,"readFeatures",null),(0,i._)([(0,h.Cb)({type:[y.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:x.read}}})],w.prototype,"geometryType",void 0),(0,i._)([(0,p.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,i._)([(0,h.Cb)({types:s.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,i._)([(0,d.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,i._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,i._)([(0,p.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,i._)([(0,h.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=n=(0,i._)([(0,f.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w},89749:(e,t,r)=>{r.d(t,{t:()=>h});var n=r(43697),i=r(15923),s=r(61247),a=r(70586),o=r(17445),l=r(1654),c=r(5600),u=r(52011);let h=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new s.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,r={}){const n=++this.handleId;r.sync||this._installSyncUpdatingWatch(e,n);const i=(0,o.YP)(e,t,r);return this.handles.add(i,n),{remove:()=>this.handles.remove(n)}}addOnCollectionChange(e,t,{initial:r=!1}={}){const n=++this.handleId;return this.handles.add([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:r?e=>t({added:e.items,removed:[],moved:[],target:e}):void 0})],n),{remove:()=>this.handles.remove(n)}}addPromise(e){if((0,a.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(d)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const r=()=>this.handles.remove(t);return e.then(r,r),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=(0,o.YP)(e,r,{sync:!0,equals:()=>!1});return this.handles.add(n,t),n}_createSyncUpdatingCallback(){return()=>{this.handles.remove(d),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,l.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(d))})),d)}}};(0,n._)([(0,c.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,n._)([(0,u.j)("esri.views.support.WatchUpdatingTracking")],h);const d=-42;var f,p;(p=f||(f={}))[p.NONE=0]="NONE",p[p.SYNC=1]="SYNC",p[p.INIT=2]="INIT"}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7622,6006],{3920:(e,t,r)=>{r.d(t,{r:()=>u,p:()=>c});var n=r(43697),i=r(15923),s=r(61247),a=r(5600),o=r(52011),l=r(89749);const c=e=>{let t=class extends e{destroy(){var e,t;this.destroyed||(null==(e=this._get("handles"))||e.destroy(),null==(t=this._get("updatingHandles"))||t.destroy())}get handles(){return this._get("handles")||new s.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,n._)([(0,a.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,n._)([(0,a.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,n._)([(0,o.j)("esri.core.HandleOwner")],t),t};let u=class extends(c(i.Z)){};u=(0,n._)([(0,o.j)("esri.core.HandleOwner")],u)},78346:(e,t,r)=>{r.d(t,{bA:()=>A});var n=r(20102),i=r(80442),s=r(95330),a=r(80903),o=r(25045),l=r(40330),c=r(92604),u=r(94362),h=r(99880),d=r(68773),f=(r(2587),r(17452));const p={};function m(e){var t;const r={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(r.async=!0),e.hasOwnProperty("isDebug")||(r.isDebug=!1),e.baseUrl||(r.baseUrl=p.baseUrl),null==(t=p.packages)||t.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(r.packages,e)})),r}var g=r(41213);class y{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class x{constructor(){this._dispatcher=new y,this._workerPostMessage({type:u.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,g.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,g.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,u.QM)(e);if(t&&t.type===u.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await o.default.loadWorker(e);n||(n=await import(e));const i=o.default.connect(n);this._workerPostMessage({type:u.Cs.OPENED,jobId:r,data:i})}}}var w=r(70171),b=r(17202);const v=c.Z.getLogger("esri.core.workers"),{HANDSHAKE:I}=u.Cs;let _,C;const S="Failed to create Worker. Fallback to execute module in main thread";async function k(e){return new Promise((t=>{function r(i){const s=(0,u.QM)(i);s&&s.type===I&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new x).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let R=0;const T=c.Z.getLogger("esri.core.workers"),{ABORT:P,INVOKE:M,OPEN:O,OPENED:E,RESPONSE:F}=u.Cs;class B{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),T.error(e)}))}static async create(e){const t=await async function(){if(!(0,i.Z)("esri-workers")||((0,i.Z)("mozilla"),0))return k(new x);if(!_&&!C)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,w.Kd)(),e.has={"esri-csp-restrictions":(0,i.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,i.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,i.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,i.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,i.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,i.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,i.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,i.Z)("esri-atomics"),"esri-shared-array-buffer":(0,i.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,i.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,i.Z)("esri-workers-arraybuffer-transfer"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,h.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=m({baseUrl:null==t?void 0:t.baseUrl,locale:(0,w.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...null==t?void 0:t.has},map:{...null==t?void 0:t.map},paths:{...null==t?void 0:t.paths},packages:(null==t?void 0:t.packages)||[]}),n={version:l.i8,buildDate:b.r,revision:b.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);_=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){C=e||{}}let e;if(_)try{e=new Worker(_,{name:"esri-worker-"+R++})}catch(t){v.warn(S,C),e=new x}else v.warn(S,C),e=new x;return k(e)}();return new B(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,u.jt)();return new Promise(((t,i)=>{const a={resolve:t,reject:i,abortHandle:(0,s.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:P,jobId:n})}))};this._outJobs.set(n,a),this._post({type:O,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,u.QM)(e);if(t)switch(t.type){case E:this._onOpenedMessage(t);break;case F:this._onResponseMessage(t);break;case P:this._onAbortMessage(t);break;case M:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:i}=e,a=i?new AbortController:null,o=this._inJobs,c=l.Nv[t];let h;try{if("function"!=typeof c)throw new TypeError(`${t} is not a function`);h=c.call(null,n,{signal:a?a.signal:null})}catch(e){return void this._post({type:F,jobId:r,error:(0,u.AB)(e)})}(0,s.y8)(h)?(o.set(r,{controller:a,promise:h}),h.then((e=>{o.has(r)&&(o.delete(r),this._post({type:F,jobId:r},e))}),(e=>{o.has(r)&&(o.delete(r),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:F,jobId:r,error:(0,u.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:F,jobId:r},h)}_onOpenedMessage(e){var t;const{jobId:r,data:n}=e,i=this._outJobs.get(r);i&&(this._outJobs.delete(r),null==(t=i.abortHandle)||t.remove(),i.resolve(n))}_onResponseMessage(e){var t;const{jobId:r,error:i,data:s}=e,a=this._outJobs.get(r);a&&(this._outJobs.delete(r),null==(t=a.abortHandle)||t.remove(),i?a.reject(n.Z.fromJSON(JSON.parse(i))):a.resolve(s))}_post(e,t,r){return(0,u.oi)(this.worker,e,t,r)}}let D=(0,i.Z)("esri-workers-debug")?1:(0,i.Z)("host-browser")?navigator.hardwareConcurrency-1:0;D||(D=(0,i.Z)("safari")&&(0,i.Z)("mac")||(0,i.Z)("trident")?7:2);let N=0;const Z=[];async function H(e,t){const r=new a.Z;return await r.open(e,t),r}async function A(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,i.Z)("host-webworker")&&!(0,i.Z)("esri-workers")&&(r="local"),"local"===r){let r=await o.default.loadWorker(e);r||(r=await import(e)),(0,s.k_)(t.signal);const n=t.client||r;return H([o.default.connect(r)],{...t,client:n})}if(await async function(){if(z)return z;L=new AbortController;const e=[];for(let t=0;t<D;t++){const r=B.create(t).then((e=>(Z[t]=e,e)));e.push(r)}return z=Promise.all(e),z}(),(0,s.k_)(t.signal),"dedicated"===r){const r=N++%D;return H([await Z[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,D);if(r<D){const n=new Array(r);for(let i=0;i<r;++i){const r=N++%D;n[i]=Z[r].open(e,t)}return H(n,t)}}return H(Z.map((r=>r.open(e,t))),t)}let L,z=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),i=r(3172),s=r(20102),a=r(70586);async function o(e){if((0,a.pC)(c.fetchBundleAsset))return c.fetchBundleAsset(e);const t=await(0,i.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],u=(0,n.Su)(i),h=`${l}${c}.json`,d=u?`${l}${c}_${u}.json`:h;let f;try{f=await o(e(d))}catch(t){if(d===h)throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{f=await o(e(h))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return f}(this.getAssetUrl,this.matcher,e,t)}}const c={};var u,h=r(99880);(0,n.tz)((u={pattern:"esri/",location:h.V},new l(u)))},94443:(e,t,r)=>{r.d(t,{ME:()=>f,Su:()=>p,tz:()=>d});var n=r(20102),i=r(95330),s=r(70171);const a=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,o={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){var t;return null!=(t=o[e])&&t}const c=[],u=new Map;function h(e){for(const t of u.keys())m(e.pattern,t)&&u.delete(t)}function d(e){return c.includes(e)||(h(e),c.unshift(e)),{remove(){const t=c.indexOf(e);t>-1&&(c.splice(t,1),h(e))}}}async function f(e){const t=(0,s.Kd)();u.has(e)||u.set(e,async function(e,t){const r=[];for(const n of c)if(m(n.pattern,e))try{return await n.fetchMessageBundle(e,t)}catch(e){r.push(e)}if(r.length)throw new n.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:r});throw new n.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const r=u.get(e);return await g.add(r),r}function p(e){if(!a.test(e))return null;const[,t,r]=a.exec(e),n=t+(r?"-"+r.toUpperCase():"");return l(n)?n:l(t)?t:null}function m(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,s.Ze)((()=>{u.clear()}));const g=new class{constructor(){this._numLoading=0}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,i.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},940:(e,t,r)=>{r.d(t,{n:()=>c});var n=r(92604),i=r(78286),s=r(19153),a=r(90344),o=r(18848);const l=n.Z.getLogger("esri.intl");function c(e,t,r={}){const{format:n={}}=r;return(0,s.gx)(e,(e=>function(e,t,r){let n,s;const a=e.indexOf(":");if(-1===a?n=e.trim():(n=e.slice(0,a).trim(),s=e.slice(a+1).trim()),!n)return"";const o=(0,i.hS)(n,t);if(null==o)return"";const l=r[s]||r[n];return l?u(o,l):s?h(o,s):d(o)}(e,t,n)))}function u(e,t){switch(t.type){case"date":return(0,a.p6)(e,t.intlOptions);case"number":return(0,o.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),d(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,a.p6)(e);case"numberformat":return(0,o.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,a.p6)(e):/^numberformat/i.test(t)?(0,o.uf)(e):d(e)}}function d(e){switch(typeof e){case"string":return e;case"number":return(0,o.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,a.p6)(e):""}}},52294:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ve});var n=r(43697),i=r(51773),s=r(14746),a=r(20102),o=r(70586),l=r(16453),c=r(95330),u=r(5600),h=(r(67676),r(80442),r(75215)),d=r(36030),f=r(71715),p=r(52011),m=r(29600),g=r(71612),y=r(17017),x=(r(66577),r(3172)),w=r(92604),b=r(44422),v=r(8744),I=r(66677),_=r(21506),C=r(35956),S=r(88281),k=r(11145),R=r(80676),T=r(67058),P=r(91219),M=r(23808),O=r(6570),E=r(82971);const F=w.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),B=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.fullExtent=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.tileInfo=null,this.symbolizer=null}set url(e){this._set("url",(0,I.Nm)(e,F))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e))return null;const r=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,R.KC)(e,n)}async createStreamlinesMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createStreamlinesMesh(e,t):(0,M.z_)(e.rendererSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo;if((0,o.Wi)(t))return e;let r=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(r)&&r.length||(r=this._getDefaultSlice());const n=e.timeExtent||this.timeExtent;if((0,o.pC)(r)&&(0,o.pC)(n)&&((0,o.pC)(n.start)||(0,o.pC)(n.end))){var i,s;r=r.map((e=>e.clone()));const a=null==(i=t.variables.find((({name:e})=>e===r[0].variableName)))||null==(s=i.dimensions)?void 0:s.find((({name:e})=>"StdTime"===e)),l=r.find((({dimensionName:e})=>"StdTime"===e));if(!a||!l)return{...e,multidimensionalDefinition:null};const{start:c,end:u}=n,h=(0,o.Wi)(c)?null:c.getTime(),d=(0,o.Wi)(u)?null:u.getTime(),f=null!=h?h:d,p=null!=d?d:h;if((0,o.pC)(a.values)){const e=a.values.filter((e=>{if(Array.isArray(e)){if(f===p)return e[0]<=f&&e[1]>=f;const t=e[0]<=f&&e[1]>f||e[0]<p&&e[1]>=p,r=e[0]>=f&&e[1]<=p||e[0]<f&&e[1]>p;return t||r}return f===p?e===f:e>=f&&e<=p}));if(e.length){const t=e.sort(((e,t)=>{var r,n,i,s;return f===p?(null!=(i=e[0])?i:e)-(null!=(s=t[0])?s:t):Math.abs((null!=(r=e[1])?r:e)-p)-Math.abs((null!=(n=t[1])?n:t)-p)}))[0];l.values=[t]}else r=null}else if(a.hasRegularIntervals&&a.extent){const[e,t]=a.extent;f>t||p<e?r=null:l.values=f===p?[f]:[Math.max(e,f),Math.min(t,p)]}}return{...e,multidimensionalDefinition:r}}async updateRenderer(){if(!this.loaded)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const e=this._rasterJobHandler.instance;e&&(this.symbolizer.rendererJSON=(0,T.ol)(this.renderer.toJSON()),this.symbolizer.bind(),await e.updateSymbolizer(this.symbolizer),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const r=e&&e.pixelBlock;if(!((0,o.pC)(r)&&r.pixels&&r.pixels.length>0))return null;let n;await this.updateRenderer();const i=this._rasterJobHandler.instance,{bandIds:s}=this;return n=i?await i.symbolize({...e,simpleStretchParams:t,bandIds:s}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:s}),n}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,v.C5)(e);return k.Z.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,n={}){if(n.requestAsImageElement){const i=this.getTileUrl(e,t,r);return(0,x.default)(i,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(n=this.normalizeRasterFetchOptions(n),(0,o.Wi)(n.multidimensionalDefinition))){const i=n.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,i),pixelBlock:null}}return await this._initJobHandler(),"raster-shaded-relief"===this.renderer.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,n)}async fetchPixels(e,t,r,n={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(n=this.normalizeRasterFetchOptions(n),(0,o.Wi)(n.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),this.raster.fetchPixels(e,t,r,n))}async identify(e,t={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(t=this.normalizeRasterFetchOptions(t),(0,o.Wi)(t.multidimensionalDefinition))?{location:e,value:null}:this.raster.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var e;const t=this.rasterInfo.multidimensionalInfo;if(!(0,o.pC)(t)||"standard-time"!==this.rasterInfo.dataType)return!1;const r=null==(e=this.multidimensionalDefinition[0])?void 0:e.variableName;return t.variables.some((e=>e.name===r&&e.dimensions.some((e=>"StdTime"===e.name))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=this._getDefaultSlice()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new S.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer()})).catch((()=>null)),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this.raster.rasterJobHandler=null}_configDefaultInterpolation(){if(null==this.interpolation){var e;const t=(0,T.In)(this.rasterInfo,this.raster.tileType,null==(e=this.sourceJSON)?void 0:e.defaultResamplingMethod);this._set("interpolation",t)}}_getDefaultSlice(){const{multidimensionalInfo:e}=this.raster.rasterInfo;if(!(0,o.pC)(e))return null;const t=e.variables[0];return t.dimensions.map((e=>{var r,n;return new C.Z({variableName:t.name,dimensionName:e.name,values:[null!=(r=null==(n=e.values)?void 0:n[0])?r:e.extent[0]],isSlice:!0})}))}_configDefaultRenderer(){const e=this.raster.rasterInfo;var t;this.bandIds||(this.bandIds=(0,T.YD)(e)),this.renderer||(this.renderer=(0,T.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?null==(t=this.multidimensionalDefinition[0])?void 0:t.variableName:null})),this.symbolizer?(this.symbolizer.rendererJSON=(0,T.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new P.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const r=this.symbolizer.bind();r.success||F.warn("imagery-tile-mixin",r.error||"The given renderer is not supported by the layer.")}};return(0,n._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"bandIds",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"copyright",void 0),(0,n._)([(0,u.Cb)({type:O.Z}),(0,b.B)("rasterInfo.extent")],t.prototype,"fullExtent",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"ioConfig",void 0),(0,n._)([(0,u.Cb)({type:[C.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,u.Cb)({readOnly:!0}),(0,b.B)("raster.rasterInfo")],t.prototype,"rasterInfo",void 0),(0,n._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,u.Cb)({type:E.Z}),(0,b.B)("rasterInfo.spatialReference")],t.prototype,"spatialReference",void 0),(0,n._)([(0,u.Cb)({type:k.Z}),(0,b.B)("rasterInfo.storageInfo.tileInfo")],t.prototype,"tileInfo",void 0),(0,n._)([(0,u.Cb)(_.HQ)],t.prototype,"url",null),(0,n._)([(0,u.Cb)({types:s.dr})],t.prototype,"renderer",null),(0,n._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),t=(0,n._)([(0,p.j)("esri.layers.ImageryTileMixin")],t),t};var D=r(38009),N=r(16859),Z=r(34760),H=r(72965),A=r(28294),L=r(1231),z=r(69608),J=r(30547),W=r(48526),j=r(36679),U=r(96674),q=r(609),$=r(73506),G=r(13473);const V=new Map,Y=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const r=e+"/"+t,n=this._cachedBlocks;if(n.has(r)){const e=n.get(r);return e.refCount--,e.refCount<=0&&(n.delete(r),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const r=e+"/"+t,n=this._cachedBlocks;if(n.has(r)){const e=n.get(r);return e.ts=Date.now(),e.refCount++,n.delete(r),n.set(r,e),e.block}return null}putBlock(e,t,r,n=null){const i=this._cachedBlocks,s=e+"/"+t;if(i.has(s)){const e=i.get(s);e.ts=Date.now(),e.refCount++}else i.set(s,{block:r,ts:Date.now(),refCount:1,controller:n});this._trim(),this._updateTimer()}deleteBlock(e,t){const r=this._cachedBlocks,n=e+"/"+t;r.has(n)&&r.delete(n)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),r=Date.now();for(let n=0;n<t.length&&t[n][1].ts<=r-this._duration;n++)e.delete(t[n][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let r=0;r<t.length-this._size;r++)e.delete(t[r][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function K(e,t){return null==t?e:`${e}?sliceId=${t}`}function X(e,t,r){if(!V.has(e))return null==t?Y.decreaseRefCount(e,r):0;const n=V.get(e);if(null==n[t])return Y.decreaseRefCount(e,r);const i=n[t].cache;if(i.has(r)){const e=i.get(r);if(e.refCount--,0===e.refCount){i.delete(r);for(let e=0;e<n.length;e++)n[e]&&n[e].cache.has(r)&&n[e].cache.delete(r);e.controller&&e.controller.abort()}return e.refCount}return 0}function Q(e,t,r){if(!V.has(e))return null==t?Y.getBlock(e,r):null;const n=V.get(e);if(null==n[t]){for(let e=0;e<n.length;e++)if(n[e]&&n[e].cache.has(r)){const t=n[e].cache.get(r);return t.refCount++,t.block}return Y.getBlock(e,r)}const i=n[t].cache;if(i.has(r)){const e=i.get(r);return e.refCount++,e.block}for(let e=0;e<n.length;e++)if(e!==t&&n[e]&&n[e]&&n[e].cache.has(r)){const t=n[e].cache.get(r);return t.refCount++,i.set(r,t),t.block}return null}function ee(e,t,r,n,i=null){if(!V.has(e))return void(null==t&&Y.putBlock(e,r,n,i));const s=V.get(e);if(null==s[t])return void Y.putBlock(e,r,n,i);const a={refCount:1,block:n,isResolved:!1,isRejected:!1,controller:i};n.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),s[t].cache.set(r,a)}function te(e,t,r){if(!V.has(e))return void(null==t&&Y.deleteBlock(e,r));const n=V.get(e);null!=n[t]?n[t].cache.delete(r):Y.deleteBlock(e,r)}var re=r(75993),ne=r(55914);let ie=class extends((0,q.v)(U.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,$.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:k.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,$.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,I.Nm)(e,w.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,n={}){const i=n.tileInfo||this.rasterInfo.storageInfo.tileInfo,s=this.getTileExtentFromTileInfo(e,t,r,i);return this.fetchPixels(s,i.size[0],i.size[1],n)}async identify(e,t={}){t=this._getRequestOptionsWithSliceId(t);const{spatialReference:r,extent:n}=this.rasterInfo,{datumTransformation:i}=t;let s=(0,$.nF)(e,r,i);if(!n.intersects(s))return{location:s,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(s);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};s=e}let a=0;if(t.srcResolution)a=(0,$.kr)(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(a=await this.computeBestPyramidLevelForLocation(e,t),null==a)return{location:s,value:null};const l=this.identifyPixelLocation(s,a,null);if(null===l)return{location:s,value:null};const{row:c,col:u,rowOffset:h,colOffset:d}=l,f=K(this.url,t.sliceId),p=`${a}/${c}/${u}`;let m=Q(f,null,p);(0,o.Wi)(m)&&(m=this.fetchRawTile(a,c,u,t),ee(f,null,p,m));const g=await m;if((0,o.Wi)(g)||!g.pixels||0===g.pixels.length)return{location:s,value:null};const y=h*this.rasterInfo.storageInfo.blockHeight+d,x=!g.mask||g.mask[y]?g.pixels.map((e=>e[y])):null,w=this.rasterInfo.dataType;return("vector-magdir"===w||"vector-uv"===w)&&(null==x?void 0:x.length)>1?{location:s,value:x,magdirValue:"vector-magdir"===w?[x[0],x[1]]:(0,R.Tg)([x[0],x[1]]),pyramidLevel:a}:{location:s,value:x,pyramidLevel:a}}async fetchPixels(e,t,r,n={}){if(e=(0,$.kZ)(e),(n=this._getRequestOptionsWithSliceId(n)).requestRawData)return this._fetchPixels(e,t,r,n);const i=(0,$.ut)(e.spatialReference),s=(0,$.Hq)(e);if((0,o.Wi)(i)||0===s||1===s&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,n);if(s>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,u=Math.round(i/(c-l)*t),h=u-Math.round((i/2-l)/(c-l)*t);let d=0;const f=[];for(let o=0;o<=s;o++){const p=new O.Z({xmin:0===o?l:-i/2,xmax:o===s?c-i*o:i/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===o?u-h:o===s?t-d:u;d+=m,f.push(m);const g=n.disableWrapAround&&o>0?null:this._fetchPixels(p,m,r,n);a.push(g)}const p=(await Promise.all(a)).map((e=>null==e?void 0:e.pixelBlock));let m=null;const g={width:t,height:r};return m=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},n):(0,ne.us)(p,g,{blockWidths:f}),{extent:e,srcExtent:(0,$.tB)(e,this.rasterInfo.spatialReference,n.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,r,n={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const i=await this._fetchRawTiles(e,t,r,n),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,h=a.y*c,d=new O.Z({xmin:s.xmin+u*t.x,xmax:s.xmin+u*(t.x+r.width-1),ymin:s.ymax-h*(t.y+r.height-1),ymax:s.ymax-h*t.y,spatialReference:s.spatialReference});if(!i)return{extent:d,srcExtent:d,pixelBlock:null};const{pixelBlocks:f}=i;if(1===f.length&&(0,o.pC)(f[0])&&f[0].width===r.width&&f[0].height===r.height)return{extent:d,srcExtent:d,pixelBlock:i.pixelBlocks[0]};const p=e>0?l.pyramidBlockWidth:l.blockWidth,m=e>0?l.pyramidBlockHeight:l.blockHeight,g={width:Math.ceil(r.width/p)*p,height:Math.ceil(r.height/m)*m},y={x:t.x%p,y:t.y%m};let x;return x=this.rasterJobHandler?await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:r,destDimension:r,clipOffset:y,clipSize:r,coefs:null,sampleSpacing:null,interpolation:n.interpolation,alignmentInfo:null,blockWidths:null},n):(0,ne.us)(f,g,{clipOffset:y,clipSize:r}),{extent:d,srcExtent:d,pixelBlock:x}}fetchRawTile(e,t,r,n){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,$.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,re.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,r){var n,i;const{customFetchParameters:s}=this.ioConfig,{range:a,query:o,headers:l}=t;r=null!=(n=null!=(i=r)?i:t.retryCount)?n:this.ioConfig.retryCount;const c=a?{Range:`bytes=${a.from}-${a.to}`}:null;try{return await(0,x.default)(e,{...t,query:{...o,...s},headers:{...l,...c}})}catch(n){if(r>0)return r--,this.request(e,t,r);throw n}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if(!(0,o.pC)(t))return null;if(!(0,o.pC)(e)||0===e.length)return null;let r=0;const n=e[0].variableName;for(let i=0;i<t.variables.length;i++){const s=t.variables[i],a=s.dimensions;if(s.name!==n){r+=a.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const o=a.map((e=>this._getDimensionValuesCount(e))),l=a.length;for(let t=0;t<l;t++){const n=e.filter((e=>e.dimensionName===a[t].name))[0];if(null==n)return null;const i=Array.isArray(n.values[0])?n.values[0][0]:n.values[0],s=this._getIndexFromDimensions(i,a[t]);if(-1===s)return null;o.shift(),r+=t===l-1?s:s*o.reduce(((e,t)=>e+t))}}return r}getTileExtentFromTileInfo(e,t,r,n){const i=n.lodAt(e);return this.getTileExtent({x:i.resolution,y:i.resolution},t,r,n.origin,n.spatialReference,n.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:n}=this.rasterInfo;if(!e.tileInfo){const i=[],s=e.maximumPyramidLevel||0;let a=Math.max(n.x,n.y),o=1/.0254*96*a;for(let e=0;e<=s;e++)i.push({level:s-e,resolution:a,scale:o}),a*=2,o*=2;const l=new G.Z({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new k.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:i}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,n){const{width:i,height:s,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new G.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==n&&(n=Math.max(0,Math.round(Math.log(Math.max(i,s))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],n);e.storageInfo=new j.Z({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:n,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,n,i,s=0,a=2){if(1===i.length&&s>0){i=[...i];let{x:e,y:t}=i[0];for(let r=0;r<s;r++)e*=a,t*=a,i.push({x:e,y:t})}const o=[],{x:l,y:c}=n;for(let n=0;n<i.length;n++){const{x:s,y:a}=i[n];o.push({minCol:Math.floor((e.xmin-l+.1*s)/t/s),maxCol:Math.floor((e.xmax-l-.1*s)/t/s),minRow:Math.floor((c-e.ymax+.1*a)/r/a),maxRow:Math.floor((c-e.ymin-.1*a)/r/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:n}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(r)&&r.length)return r[e-1];const i=n**e;return{x:t.x*i,y:t.y*i}}identifyPixelLocation(e,t,r){const{spatialReference:n,nativeExtent:i}=this.rasterInfo,{blockWidth:s,blockHeight:a,maximumPyramidLevel:o,origin:l}=this.rasterInfo.storageInfo,c=(0,$.nF)(e,n,r);if(!i.intersects(c))return null;if(t<0||t>o)return null;const u=this.getPyramidPixelSize(t),{x:h,y:d}=u,f=(l.y-c.y)/d/a,p=(c.x-l.x)/h/s,m=Math.min(a-1,Math.floor((f-Math.floor(f))*a)),g=Math.min(s-1,Math.floor((p-Math.floor(p))*s));return{pyramidLevel:t,row:Math.floor(f),col:Math.floor(p),rowOffset:m,colOffset:g,srcLocation:c}}getTileExtent(e,t,r,n,i,s){const[a,o]=s,l=n.x+r*a*e.x,c=l+a*e.x,u=n.y-t*o*e.y,h=u-o*e.y;return new O.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:i})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const n=this.rasterInfo.storageInfo.blockBoundary[e];return!n||n.maxRow<t||n.maxCol<r||n.minRow>t||n.minCol>r}async _fetchPixels(e,t,r,n={}){let i=(0,$.Hq)(e);if(i>=2)return{extent:e,pixelBlock:null};const s=this._getSourceDataInfo(e,t,r,n),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:h,srcHeight:d}=s;if(0===h||0===d)return{extent:e,srcExtent:u,pixelBlock:null};const f=(0,o.Wg)(this.rasterInfo.transform),p="gcs-shift"===(null==f?void 0:f.type),m=(0,o.pC)((0,$.ut)(e.spatialReference));!p&&m||(i=(0,$.Hq)(s.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((u.xmin-g.origin.x)/l.x+.1),y:Math.floor((g.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,y,{width:h,height:d,wrapCount:i},n);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const w=a>0?g.pyramidBlockWidth:g.blockWidth,b=a>0?g.pyramidBlockHeight:g.blockHeight,v=w===h&&b===d&&y.x%w==0&&y.y%b==0,I=new G.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),_=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:C}=n;if(!_&&v&&1===x.pixelBlocks.length&&w===t&&b===r&&c.x===I.x&&c.y===I.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const S=m&&(0,o.pC)((0,$.ut)(u.spatialReference)),k=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:I.toJSON(),datumTransformation:C,rasterTransform:f,hasWrapAround:i>0||S,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy},n):(0,$.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:I,datumTransformation:C,rasterTransform:f,hasWrapAround:i>0||S,isAdaptive:!1});let R;const T=!n.requestRawData,P={rows:k.spacing[0],cols:k.spacing[1]},M=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:O,mosaicSize:E,isPartiallyFilled:F}=x;if(this.rasterJobHandler)R=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:O,srcMosaicSize:E,destDimension:T?{width:t,height:r}:null,coefs:T?k.coefficients:null,sampleSpacing:T?P:null,interpolation:n.interpolation,alignmentInfo:M,blockWidths:null},n);else{const e=(0,ne.us)(O,E,{alignmentInfo:M});R=T?(0,ne.Uk)(e,{width:t,height:r},k.coefficients,P,n.interpolation):e}return n.requestRawData?{srcExtent:u,pixelBlock:R,transformGrid:k,extent:e,isPartiallyFilled:F}:{srcExtent:u,extent:e,pixelBlock:R}}async _fetchRawTiles(e,t,r,n){const{origin:i,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:h,height:d,wrapCount:f}=r;const p=this._getRasterTileAlignmentInfo(e,0);n.buffer&&(c-=n.buffer.cols,u-=n.buffer.rows,h+=2*n.buffer.cols,d+=2*n.buffer.rows);let m=0,g=0,y=0;f&&(0,o.pC)(p)&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=p),g*p.blockWidth-m>=c+h&&(m=0));const x=Math.floor(c/a),w=Math.floor(u/l),b=Math.floor((c+h+m-1)/a),v=Math.floor((u+d+m-1)/l),I=s[e];if(!I)return null;const{minRow:_,minCol:C,maxCol:S,maxRow:k}=I;if(0===f&&(v<_||b<C||w>k||x>S))return null;const R=new Array;let T=!1;const P=null==this.ioConfig.allowPartialFill?n.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=w;t<=v;t++)for(let r=x;r<=b;r++){let i=r;if(!n.disableWrapAround&&f&&(0,o.pC)(p)&&g<=r&&(i=r-g-y),t>=_&&i>=C&&k>=t&&S>=i){const r=this._fetchRawTile(e,t,i,n);P?R.push(new Promise((e=>{r.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):R.push(r)}else R.push(null)}if(0===R.length)return null;const M=await Promise.all(R),E={height:(v-w+1)*l,width:(b-x+1)*a},{spatialReference:F}=this.rasterInfo,B=this.getPyramidPixelSize(e),{x:D,y:N}=B;return{extent:new O.Z({xmin:i.x+x*a*D,xmax:i.x+(b+1)*a*D,ymin:i.y-(v+1)*l*N,ymax:i.y-w*l*N,spatialReference:F}),pixelBlocks:M,mosaicSize:E,isPartiallyFilled:T}}_fetchRawTile(e,t,r,n){const i=this.rasterInfo.storageInfo.blockBoundary[e];if(!i)return Promise.resolve(null);const{minRow:s,minCol:a,maxCol:l,maxRow:u}=i;if(t<s||r<a||t>u||r>l)return Promise.resolve(null);const h=K(this.url,n.sliceId),d=`${e}/${t}/${r}`;let f=Q(h,n.registryId,d);if((0,o.Wi)(f)){const i=new AbortController;f=this.fetchRawTile(e,t,r,{...n,signal:i.signal}),ee(h,n.registryId,d,f,i),f.catch((()=>te(h,n.registryId,d)))}return n.signal&&(0,c.fu)(n,(()=>{X(h,n.registryId,d)})),f}_getIndexFromDimensions(e,t){const{extent:r,interval:n,unit:i,values:s}=t;if(null!=s&&s.length)return Array.isArray(s[0])?s.findIndex((t=>t[0]<=e&&t[1]>=e)):s.indexOf(e);if(e>r[1])return-1;const a=r[0];let o=-1;if("ISO8601"===i){var l;switch((null==(l=t.intervalUnit)?void 0:l.toLowerCase())||"seconds"){case"seconds":o=Math.round((e-a)/1e3/n);break;case"minutes":o=Math.round((e-a)/6e4/n);break;case"hours":o=Math.round((e-a)/36e5/n);break;case"days":o=Math.round((e-a)/864e5/n);break;case"years":o=Math.round((new Date(e).getUTCFullYear()-new Date(a).getUTCFullYear())/n);break;case"decades":o=Math.round((new Date(e).getUTCFullYear()-new Date(a).getUTCFullYear())/10/n)}return o}return Math.round((e-a)/n)}_getDimensionValuesCount(e){const{extent:t,interval:r,unit:n,values:i}=e;let s=(null==i?void 0:i.length)||0;if(s)return s;const a=t[0];if(0===s&&"ISO8601"===n){var o;switch((null==(o=e.intervalUnit)?void 0:o.toLowerCase())||"seconds"){case"seconds":s=Math.round((t[1]-t[0])/1e3/r);break;case"minutes":s=Math.round((t[1]-t[0])/6e4/r);break;case"hours":s=Math.round((t[1]-t[0])/36e5/r);break;case"days":s=Math.round((t[1]-t[0])/864e5/r);break;case"years":s=Math.round((new Date(t[1]).getUTCFullYear()-new Date(a).getUTCFullYear())/r);break;case"decades":s=Math.round((new Date(t[1]).getUTCFullYear()-new Date(a).getUTCFullYear())/10/r)}return s}return Math.round((t[1]-t[0])/r)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,$.P_)(this.rasterInfo)),(0,o.pC)(this._rasterTileAlighmentInfo.pyramidsInfo)?{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}:null}_getSourceDataInfo(e,t,r,n={}){const i={datumTransformation:n.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};n.srcResolution&&(i.srcResolution=n.srcResolution,this._updateSourceDataInfo(e,i));const s=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=i,c=a/t,u=o/r,h=l<s&&c*u>=16;if(h||l===s&&(c>8||u>8)||0===a||0===o){const a=new G.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let o=(0,$.VO)(a,this.rasterInfo.spatialReference,e,i.datumTransformation);const d=!o||n.srcResolution&&o.x+o.y<n.srcResolution.x+n.srcResolution.y;if(h&&n.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(s-l+3>=e){const t=2**e;o={x:n.srcResolution.x*t,y:n.srcResolution.y*t}}}o&&(i.srcResolution=o,this._updateSourceDataInfo(e,i))}return(i.srcWidth/t>8||i.srcHeight/r>8)&&(i.srcWidth=0,i.srcHeight=0),i}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:n,datumTransformation:i}=t,{pyramidLevel:s,pyramidResolution:a,excessiveReading:l}=(0,$.kr)(n,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,$.tB)(e,r,i);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/a.x-.1),d=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=s,t.pyramidResolution=a,t.srcWidth=h,t.srcHeight=d}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}};(0,n._)([(0,u.Cb)()],ie.prototype,"_rasterTileAlighmentInfo",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],ie.prototype,"_isGlobalWrappableSource",null),(0,n._)([(0,u.Cb)(_.HQ)],ie.prototype,"url",null),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ie.prototype,"datasetName",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),(0,n._)([(0,u.Cb)()],ie.prototype,"rasterInfo",void 0),(0,n._)([(0,u.Cb)()],ie.prototype,"ioConfig",void 0),(0,n._)([(0,u.Cb)()],ie.prototype,"sourceJSON",void 0),ie=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.BaseRaster")],ie);const se=ie;var ae=r(20095);function oe(e){const t=e.fields,r=e.records,n=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",i=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),s=i.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[n]=o++,l=1;l<s.length;l++)t[s[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:i,features:a}}var le=r(87521),ce=r(74889);const ue=new Map;ue.set("int16","esriFieldTypeSmallInteger"),ue.set("int32","esriFieldTypeInteger"),ue.set("int64","esriFieldTypeInteger"),ue.set("float32","esriFieldTypeSingle"),ue.set("float64","esriFieldTypeDouble"),ue.set("text","esriFieldTypeString");let he=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:null==e?void 0:e.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:r,rasterInfo:n}=this._parseHeader(t);if("thematic"===n.dataType){const e=await this._fetchAuxiliaryInformation();n.attributeTable=e}this._set("storageInfo",r),this._set("rasterInfo",n),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,n={}){const i=this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(i<0)return null;const s=this._buildCacheFilePath(i,t,r,n.multidimensionalDefinition),a=this._getIndexRecordFromBundle(t,r),o=await this.request(s,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:n.signal});if(!o)return null;const l=new Uint8Array(o.data),c=this._getTileEndAndContentType(l,a);if(0===c.recordSize)return null;const u=await this.request(s,{range:{from:c.position,to:c.position+c.recordSize},responseType:"array-buffer",signal:n.signal});return u?this.decodePixelBlock(u.data,{width:this.rasterInfo.storageInfo.tileInfo.size[0],height:this.rasterInfo.storageInfo.tileInfo.size[1],planes:null,pixelType:null}):null}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){var t,r;const n=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,histograms:s,colormap:a,blockWidth:o,blockHeight:l,firstPyramidLevel:c,maximumPyramidLevel:u}=e,h=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),d=e.extent.spatialReference,f=null==(t=e.geodataXform)?void 0:t.spatialReference,p=new E.Z(null!=d&&d.wkid||null!=d&&d.wkt?d:f);let m=new O.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:p});const g=new G.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:p}),y=Math.round((m.xmax-m.xmin)/g.x),x=Math.round((m.ymax-m.ymin)/g.y),w=this._parseTransform(e.geodataXform),b=w?m:null;w&&(m=w.forwardTransform(m),g.x=(m.xmax-m.xmin)/y,g.y=(m.ymax-m.ymin)/x);const v=null!=(r=e.properties)?r:{},I=e.format.toLowerCase().replace("cache/",""),_=new G.Z(e.origin.x,e.origin.y,p);let C,S,R,T;if(a&&a.colors)for(C=[],S=0;S<a.colors.length;S++)R=a.colors[S],T=a.values?a.values[S]:S,C.push([T,255&R,R<<16>>>24,R<<8>>>24,R>>>24]);const P=e.LODInfos,M=[];for(S=0;S<P.levels.length;S++)M.push({level:P.levels[S],resolution:P.resolutions[S],scale:96/.0254*P.resolutions[S]});const F=new k.Z({dpi:96,lods:M,format:I,origin:_,size:[o,l],spatialReference:p}),B={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},D=[{maxCol:Math.ceil(y/o)-1,maxRow:Math.ceil(x/l)-1,minCol:0,minRow:0}];let N=2;if(u>0)for(S=0;S<u;S++)D.push({maxCol:Math.ceil(y/N/o)-1,maxRow:Math.ceil(x/N/l)-1,minCol:0,minRow:0}),N*=2;const Z=e.mdInfo;return{storageInfo:B,rasterInfo:new W.Z({width:y,height:x,pixelType:n,bandCount:i,extent:m,nativeExtent:b,transform:w,spatialReference:p,pixelSize:g,keyProperties:v,statistics:h,histograms:s,multidimensionalInfo:Z,colormap:C,storageInfo:new j.Z({blockWidth:o,blockHeight:l,pyramidBlockWidth:o,pyramidBlockHeight:l,origin:_,tileInfo:F,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:D})})}}_parseTransform(e){var t,r;if(!(0,le.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const n=(0,le.c)(e);if("identity"===n.type)return null;if("polynomial"!==n.type||null==(t=n.forwardCoefficients)||!t.length||null==(r=n.inverseCoefficients)||!r.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return n}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),n=await Promise.all([t,r]);let i;if(n[0]){let e=n[0].fields;const t=n[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ue.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(i={fields:e,features:r})}}return!i&&n[1]&&(i=class{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),r=3&t.getUint8(0);if(3!==r)return{header:{version:r},recordSet:null};const n=t.getUint32(4,!0),i=t.getUint16(8,!0),s=t.getUint16(10,!0),a={version:r,recordCount:n,headerByteCount:i,recordByteCount:s};let o=32;const l=[],c=[];let u;if(3===r){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ae.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<n&&e.byteLength-o>s;){const r=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)r.push((0,ae.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)r.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)r.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const n=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();r.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}o+=t.length})),c.push(r)):o+=s}}return{header:a,fields:l,records:c,recordSet:oe({fields:l,records:c})}}}.parse(n[1]).recordSet),ce.default.fromJSON(i)}_buildCacheFilePath(e,t,r,n){const i=this.storageInfo.packetSize,s=Math.floor(t/i)*i,a=Math.floor(r/i)*i,l="R"+this._toHexString4(s)+"C"+this._toHexString4(a);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=null==n?void 0:n[0];if(!(0,o.pC)(u)||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let d=u.variables.filter((e=>e.name===h.variableName))[0].dimensions[0].values.indexOf(h.values[0]).toString(16);const f=4-d.length;for(let e=0;e<f;e++)d="0"+d;return d="S"+d,`${this.url}/_alllayers/${h.variableName}/${d}/${c}/${l}.bundle`}_getIndexRecordFromBundle(e,t){const r=this.storageInfo.packetSize,n=r*(e%r)+t%r;if(n<0)throw"Invalid level / row / col";return 20+n*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let n,i=0;for(n=0;n<5;n++)i|=(255&r[n])<<8*n;const s=0xffffffffff&i;for(i=0,n=5;n<8;n++)i|=(255&r[n])<<8*(n-5);return{position:s,recordSize:0xffffffffff&i}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,n._)([(0,u.Cb)({readOnly:!0})],he.prototype,"storageInfo",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],he.prototype,"datasetFormat",void 0),he=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.CloudRaster")],he);const de=he;let fe=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(e){var t;await this.init();const{pixelBlock:r,statistics:n,histograms:i,name:s,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=r,d=this.data.extent||new O.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new E.Z({wkid:3857})}),f=null!=(t=this.data.isPseudoSpatialReference)?t:!this.data.extent,p={x:d.width/c,y:d.height/u},m=new W.Z({width:c,height:u,pixelType:h,extent:d,nativeExtent:o,transform:l,pixelSize:p,spatialReference:d.spatialReference,bandCount:3,keyProperties:a||{},statistics:n,isPseudoSpatialReference:f,histograms:i});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(r,{width:512,height:512},e),this.datasetName=s,this.url="/InMemory/"+s}fetchRawTile(e,t,r,n={}){const i=this._pixelBlockTiles.get(`${e}/${t}/${r}`);return Promise.resolve(i)}async _buildInMemoryRaster(e,t,r){const n=this.rasterInfo.storageInfo.maximumPyramidLevel,i=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n},r):Promise.resolve((0,ne.Vl)(e,t,n)),s=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=s&&l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},r):Promise.resolve((0,ne.Hv)(e)),h=await(0,c.as)([i,u]);if(!h[0].value&&h[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");var d,f;this._pixelBlockTiles=h[0].value,s||(this.rasterInfo.statistics=null==(d=h[1].value)?void 0:d.statistics),l&&(this.rasterInfo.histograms=null==(f=h[1].value)?void 0:f.histograms)}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],fe.prototype,"datasetFormat",void 0),(0,n._)([(0,u.Cb)()],fe.prototype,"data",void 0),fe=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],fe);const pe=fe;function me(e,t){if(!e||!t)return[];let r=t;t.indexOf("/")>-1?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const i=me(e,r);for(let e=0;e<i.length;e++)me(i[e],t).forEach((e=>n.push(e)));return n}const i=e.getElementsByTagNameNS("*",r);if(!i||0===i.length)return[];for(let e=0;e<i.length;e++)n.push(i[e]||i.item[e]);return n}function ge(e,t){if(!e||!t)return null;let r=t;t.indexOf("/")>-1?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=me(e,r);return n.length>0?t?ge(n[0],t):n[0]:null}function ye(e,t=null){const r=t?ge(e,t):e;let n;return r?(n=r.textContent||r.nodeValue,n?n.trim():null):null}function xe(e,t){return function(e,t){const r=me(e,t),n=[];let i;for(let e=0;e<r.length;e++)i=r[e].textContent||r[e].nodeValue,i&&(i=i.trim(),""!==i&&n.push(i));return n}(e,t).map((e=>Number(e)))}function we(e,t){const r=ye(e,t);return Number(r)}function be(e,t){var r;const n=null==e||null==(r=e.nodeName)?void 0:r.toLowerCase(),i=t.toLowerCase();return n.slice(n.lastIndexOf(":")+1)===i}var ve=r(87390);function Ie(e,t){if(!e||!t)return null;const r=[];for(let n=0;n<e.length;n++)r.push(e[n]),r.push(t[n]);return r}function _e(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new E.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const r=e.indexOf("VERTCS"),n=e.indexOf("PROJCS"),i=n>-1?n:e.indexOf("GEOGCS");if(-1===i)return null;const s=e.slice(i,e.lastIndexOf("]",r)+1).trim(),a=e.slice(r,e.lastIndexOf("]")).trim();t=Ce(s);const o=new E.Z(t?{wkid:t}:{wkt:s}),l=Ce(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ce(e),new E.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ce(e){var t;const r=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),n=r[r.length-1].split(","),i=null==(t=n[0])?void 0:t.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(n[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Se(e){var t;if("pamdataset"!==(null==e||null==(t=e.documentElement.tagName)?void 0:t.toLowerCase()))return{};const r={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(be(e,"SRS")){if(!r.spatialReference){const t=ye(e);r.spatialReference=_e(t)}}else if(be(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:t,transform:n}=function(e){var t;const r=ge(e,"GeodataXform"),n=_e(we(r,"SpatialReference/WKID")||ye(r,"SpatialReference/WKT"));if("typens:PolynomialXform"!==r.getAttribute("xsi:type"))return{spatialReference:n,transform:null};const i=null!=(t=we(r,"PolynomialOrder"))?t:1,s=xe(r,"CoeffX/Double"),a=xe(r,"CoeffY/Double"),o=xe(r,"InverseCoeffX/Double"),l=xe(r,"InverseCoeffY/Double"),c=Ie(s,a),u=Ie(o,l);return{spatialReference:n,transform:new ve.Z({spatialReference:n,polynomialOrder:i,forwardCoefficients:c,inverseCoefficients:u})}}(e);r.transform=n,r.spatialReference||(r.spatialReference=t)}else me(e,"MDI").forEach((e=>r.metadata[e.getAttribute("key")]=ye(e)));else if(be(e,"PAMRasterBand")){const t=function(e){var t;const r=we(e,"NoDataValue"),n=ge(e,"Histograms/HistItem"),i=we(n,"HistMin"),s=we(n,"HistMax"),a=we(n,"BucketCount"),o=null==(t=ye(n,"HistCounts"))?void 0:t.split("|").map((e=>Number(e)));let l,c,u,h;me(e,"Metadata/MDI").forEach((e=>{var t;const r=Number(null!=(t=e.textContent)?t:e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=r;break;case"STATISTICS_MAXIMUM":c=r;break;case"STATISTICS_MEAN":u=r;break;case"STATISTICS_STDDEV":h=r}}));const d=we(e,"Metadata/SourceBandIndex");return{noDataValue:r,histogram:null!=o&&o.length&&null!=l&&null!=c?{min:i,max:s,size:a||o.length,counts:o}:null,sourceBandIndex:d,statistics:null!=l&&null!=c?{min:l,max:c,avg:u,stddev:h}:null}}(e);null!=t.sourceBandIndex&&null==r.rasterBands[t.sourceBandIndex]?r.rasterBands[t.sourceBandIndex]=t:r.rasterBands.push(t)}}));const n=r.rasterBands;if(n){const e=!!n[0].statistics;r.statistics=e?n.map((e=>e.statistics)):null;const t=!!n[0].histogram;r.histograms=t?n.map((e=>e.histogram)):null}return r}let ke=class extends se{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:r,statistics:n,histograms:i,transform:s}=await this._fetchAuxiliaryData(e);const a=!r;a&&(r=new E.Z({wkid:3857})),null!=i&&i.length&&null==n&&(n=(0,ne.Oh)(i));const{width:o,height:l}=t;let c=new O.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:r});const u=s?s.forwardTransform(c):c;let h=!0;if(s){const e=s.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(s=null,c=u)}const d=new pe({data:{extent:u,nativeExtent:c,transform:s,pixelBlock:t,statistics:n,histograms:i,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await d.open(),this._set("rasterInfo",d.rasterInfo),this._inMemoryRaster=d}fetchRawTile(e,t,r,n={}){return this._inMemoryRaster.fetchRawTile(e,t,r,n)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:null==e?void 0:e.signal}),r=(0,re.y)(t).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new a.Z("image-aux-raster:open","the data is not a supported format");return this._set("datasetFormat",r),await this.decodePixelBlock(t,{format:"jpg",width:1,height:1,useCanvas:!0})}async _fetchAuxiliaryData(e){var t,r;const n=(0,o.Wg)(null==e?void 0:e.signal),i=null!=(t=this.ioConfig.skipExtensions)?t:[],s=i.indexOf("aux.xml")>-1?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:n}),a=this.datasetFormat,l="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,u=i.indexOf(l)>-1?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:n}),h=await(0,c.as)([s,u]);if(null!=n&&n.aborted)throw(0,c.zE)();const d=Se(null==(r=h[0].value)?void 0:r.data);if(!d.transform){const e=h[1].value?h[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;d.transform=6===(null==e?void 0:e.length)?new ve.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return d}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),ke=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],ke);const Re=ke;var Te=r(17452),Pe=r(45322),Me=r(56608),Oe=r(29680);let Ee=class extends se{constructor(){super(...arguments),this._levelOffset=0,this._slices=null,this._tilemapCache=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const t=e&&e.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=r.data;if(this.sourceJSON=n,!n)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].indexOf(n.tileInfo.format.toLowerCase())>-1?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name.slice(n.name.indexOf("/")+1);const i=await this._fetchRasterInfo({signal:t});if(!(0,o.pC)(i))throw new a.Z("image-server-raster:open","cannot initialize image service");{const e="Map"===this.tileType?(0,Pe.d)(n.tileInfo,n):k.Z.fromJSON(n.tileInfo),{extent:t,pixelSize:r}=i,s=.5/i.width*r.x;let a,o;const l=e.lodAt(Math.max.apply(null,e.lods.map((e=>e.level))));"Map"!==this.tileType&&0!==n.maxScale&&("Raster"===this.tileType?(a=e.lods.filter((e=>e.resolution===r.x))[0],a||(a=e.lods[e.lods.length-1])):(a=e.lods.filter((e=>Math.abs(e.scale-n.maxScale)<s))[0],a||(a=e.lods.filter((e=>e.scale>n.maxScale)).sort(((e,t)=>e.scale>t.scale?1:-1))[0])),r.x=r.y=a.resolution,i.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),i.height=Math.ceil((t.ymax-t.ymin)/r.y-.1)),a||(a=l);const c=e.lodAt(Math.min.apply(null,e.lods.map((e=>e.level))));"Map"===this.tileType?this._levelOffset=e.lods[0].level:0!==n.minScale&&"Elevation"===this.tileType&&(o=e.lods.filter((e=>Math.abs(e.scale-n.minScale)<s))[0],this._levelOffset=o.level-c.level),o||(o=c);const u=Math.max(r.x,r.y);(Math.abs(r.x-r.y)>s||!e.lods.some((e=>Math.abs(e.resolution-u)<s)))&&(r.x=r.y=a.resolution,i.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),i.height=Math.ceil((t.ymax-t.ymin)/r.y-.1));const h=a.level-o.level,[d,f]=e.size,p=[];e.lods.forEach((e=>{e.level>=o.level&&e.level<=a.level&&p.push({x:e.resolution,y:e.resolution})})),p.sort(((e,t)=>e.x-t.x));const m=this.computeBlockBoundary(t,d,f,e.origin,p,h),g=p.length>1?p.slice(1):null;i.storageInfo=new j.Z({blockWidth:e.size[0],blockHeight:e.size[1],pyramidBlockWidth:e.size[0],pyramidBlockHeight:e.size[1],pyramidResolutions:g,compression:e.format,origin:e.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:e,blockBoundary:m}),this._fixGCSShift(i),this._set("rasterInfo",i)}if(n.capabilities.toLowerCase().indexOf("tilemap")>-1){const e={tileInfo:i.storageInfo.tileInfo,parsedUrl:(0,Te.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new Me.y({layer:e})}}async fetchRawTile(e,t,r,n={}){if(this._slices&&null==n.sliceId)return null;const{storageInfo:i,extent:s}=this.rasterInfo,a=i.maximumPyramidLevel-e+this._levelOffset,o=`${this.url}/tile/${a}/${t}/${r}`,l=this._slices?{sliceId:n.sliceId||0}:null,{data:c}=await this.request(o,{query:l,responseType:"array-buffer",signal:n.signal});if(!c)return null;const u=await this.decodePixelBlock(c,{width:i.tileInfo.size[0],height:i.tileInfo.size[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType}),h=i.blockBoundary[e];if("jpg"!==i.compression||r>h.minCol&&r<h.maxCol&&t>h.minRow&&t<h.maxRow)return u;const{origin:d,blockWidth:f,blockHeight:p}=i,{x:m,y:g}=this.getPyramidPixelSize(e),y=Math.round((s.xmin-d.x)/m)%f,x=Math.round((s.xmax-d.x)/m)%f,w=Math.round((d.y-s.ymax)/g)%p,b=Math.round((d.y-s.ymin)/g)%p,v=r===h.minCol?y:0,I=t===h.minRow?w:0,_=r===h.maxCol?x:f,C=t===h.maxRow?b:p;return(0,ne.pW)(u,{x:v,y:I},{width:_-v,height:C-I}),u}getSliceIndex(e){if(!this._slices||(0,o.Wi)(e)||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const r=this._slices[e].multidimensionalDefinition;if(r.length===t.length&&!r.some((e=>{const r=t.filter((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName))[0];return!r||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const r=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.statistics})),n=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),i=await Promise.all([r,n]);return i[0]&&i[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:i[0]||null,histograms:i[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===r)return null;let n=0;const{maximumPyramidLevel:i}=this.rasterInfo.storageInfo;let s=i-n+this._levelOffset;const a=r.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,r.row,r.col,t))break}catch{}if(s--,n++,r=this.identifyPixelLocation(a,n,(0,o.Wg)(t.datumTransformation)),null===r)return null}return-1===s||null==r?null:n}async _fetchRasterInfo(e){const t=this.sourceJSON,r=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),n=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),i=E.Z.fromJSON(t.spatialReference||t.extent.spatialReference);if("Map"===this.tileType)return new W.Z({width:r,height:n,bandCount:3,extent:O.Z.fromJSON(t.extent),spatialReference:i,pixelSize:new G.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:i}),pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}});const{slice:s,signal:a}=e,o=!!t.hasRasterAttributeTable&&this.request(this.url+"/rasterAttributeTable",{query:{slice:s,f:"json"},signal:a}).then((e=>ce.default.fromJSON(e.data))).catch((()=>null)),l=!!t.hasColormap&&this.request(this.url+"/colormap",{query:{slice:s,f:"json"},signal:a}).then((e=>{var t;return null==(t=e.data)?void 0:t.colormap})),c=!!t.hasHistograms&&this.request(this.url+"/histograms",{query:{slice:s,f:"json"},signal:a}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),u=this.request(this.url+"/keyProperties",{query:{f:"json"},signal:a}).then((e=>e.data)).catch((()=>{})),h=!!t.hasMultidimensions&&this._fetchMultidimensionalInfo(),d=!!t.hasMultidimensions&&this.request(this.url+"/slices",{query:{f:"json"},signal:a}).then((e=>e.data&&e.data.slices)).catch((()=>{}));return Promise.all([o,l,c,u,h,d]).then((e=>{let s=null;if(t.minValues&&t.minValues.length===t.bandCount){s=[];for(let e=0;e<t.minValues.length;e++)s.push({min:t.minValues[e],max:t.maxValues[e],avg:t.meanValues[e],stddev:t.stdvValues[e]})}return this._slices=e[5]||null,new W.Z({width:r,height:n,bandCount:t.bandCount,extent:O.Z.fromJSON(t.extent),spatialReference:i,pixelSize:new G.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:i}),pixelType:t.pixelType.toLowerCase(),statistics:s,attributeTable:e[0]||null,colormap:e[1]||null,histograms:e[2]||null,keyProperties:e[3]||{},multidimensionalInfo:e[4]||null})}))}async _fetchMultidimensionalInfo(e){var t;const r=await this.request(this.url+"/multidimensionalInfo",{query:{f:"json"},signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.multidimensionalInfo}));return null!=(t=r.variables)&&t.length&&r.variables.forEach((e=>{var t;null!=(t=e.statistics)&&t.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))})),r}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:r}=e;0===t.xmin&&360===t.xmax&&r.wkid&&r.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Oe.Z,e.extent=e.transform.forwardTransform(t))}};(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],Ee.prototype,"datasetFormat",void 0),(0,n._)([(0,u.Cb)()],Ee.prototype,"tileType",void 0),Ee=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ee);const Fe=Ee;var Be=r(54163),De=r(48279);const Ne=new Map;Ne.set("Int8","s8"),Ne.set("UInt8","u8"),Ne.set("Int16","s16"),Ne.set("UInt16","u16"),Ne.set("Int32","s32"),Ne.set("UInt32","u32"),Ne.set("Float32","f32"),Ne.set("Float64","f32"),Ne.set("Double64","f32");const Ze=new Map;Ze.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ze.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ze.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ze.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let He=class extends se{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){var t;await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const r=e?(0,o.Wg)(e.signal):null,n=await this.request(this.url,{responseType:"xml",signal:r}),{rasterInfo:i,files:s}=this._parseHeader(n.data);if(-1===(null==(t=this.ioConfig.skipExtensions)?void 0:t.indexOf("aux.xml"))){const t=await this._fetchAuxiliaryData(e);var a;null!=t&&(i.statistics=null!=(a=t.statistics)?a:i.statistics,i.histograms=t.histograms,t.histograms&&!(0,o.pC)(i.statistics)&&(i.statistics=(0,ne.Oh)(t.histograms)))}this._set("rasterInfo",i),this._files=s;const l=await this.request(s.index,{responseType:"array-buffer",signal:r});this._storageIndex=this._parseIndex(l.data);const{blockWidth:c,blockHeight:u}=this.rasterInfo.storageInfo,h=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:d,height:f}=this.rasterInfo,p=[],m=this._getBandSegmentCount();let g=0,y=-1;for(;g<this._storageIndex.length;){y++;const e=Math.ceil(d/c/h**y)-1,t=Math.ceil(f/u/h**y)-1;g+=(e+1)*(t+1)*m*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}async fetchRawTile(e,t,r,n={}){const{blockWidth:i,blockHeight:s,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<r||l.minRow>t||l.minCol>r)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:h,actualTileWidth:d,actualTileHeight:f}=this._getTileLocation(e,t,r);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const e=new Uint8Array(i*s);return new Be.Z({width:i,height:s,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)(!p||p.indexOf[y]>-1)&&g.push(this.request(this._files.data,{range:{from:h[y].from,to:h[y].to},responseType:"array-buffer",signal:n.signal}));const x=await Promise.all(g),w=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(w);let v=0;for(y=0;y<m;y++)b.set(new Uint8Array(x[y].data),v),v+=x[y].data.byteLength;const I=Ze.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:i,height:s,format:I,planes:(null==p?void 0:p.length)||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==I&&!_.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=_.width*_.height,r=new Uint8Array(t);if(Math.abs(e)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-e)/e)>1e-6&&(r[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==e&&(r[y]=1);_.mask=r}}let C=0,S=0;if(d!==i||f!==s){let e=_.mask;if(e)for(y=0;y<s;y++)if(S=y*i,y<f)for(C=d;C<i;C++)e[S+C]=0;else for(C=0;C<i;C++)e[S+C]=0;else for(e=new Uint8Array(i*s),_.mask=e,y=0;y<f;y++)for(S=y*i,C=0;C<d;C++)e[S+C]=1}return _}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,r,n,i,s,a;if(De.f){for(r=new Uint8Array(e),i=new ArrayBuffer(e.byteLength),n=new Uint8Array(i),s=0;s<e.byteLength/4;s++)for(a=0;a<4;a++)n[4*s+a]=r[4*s+3-a];t=new Uint32Array(i)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ze.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,r){const{blockWidth:n,blockHeight:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,d=0,f=0;for(h=0;h<e;h++)f=s**h,c=Math.ceil(a/n/f),u=Math.ceil(o/i/f),d+=c*u;f=s**e,c=Math.ceil(a/n/f),u=Math.ceil(o/i/f),d+=t*c+r,d*=4*l;const p=this._storageIndex.subarray(d,d+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=p[4*e+0]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3],y.push({from:m,to:g});return{ranges:y,actualTileWidth:r<c-1?n:Math.ceil(a/f)-n*(c-1),actualTileHeight:t<u-1?i:Math.ceil(o/f)-i*(u-1)}}_parseHeader(e){const t=ge(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const r=ge(t,"Size"),n=parseInt(r.getAttribute("x"),10),i=parseInt(r.getAttribute("y"),10),s=parseInt(r.getAttribute("c"),10),o=(ye(t,"Compression")||"none").toLowerCase();if(!Ze.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=ye(t,"DataType")||"UInt8",c=Ne.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=ge(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),d=parseInt(u.getAttribute("y"),10),f=ge(t,"DataValues");let p,m;if(f&&(m=f.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),ge(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const g=ge(e,"MRF_META/GeoTags"),y=ge(g,"BoundingBox");let x,w=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),r=parseFloat(y.getAttribute("maxx")),n=parseFloat(y.getAttribute("maxy")),i=ye(g,"Projection")||"";let s;if("LOCAL_CS[]"!==i)if(i.toLowerCase().startsWith("epsg:")){const e=Number(i.slice(5));isNaN(e)||0===e||(s=new E.Z({wkid:e}))}else s=_e(i);else w=!0,s=new E.Z({wkid:3857});x=new O.Z(e,t,r,n),x.spatialReference=s}else w=!0,x=new O.Z({xmin:-.5,ymin:.5-i,xmax:n-.5,ymax:.5,spatialReference:new E.Z({wkid:3857})});const b=ge(e,"MRF_META/Rsets"),v=parseInt(b&&b.getAttribute("scale")||"2",10),I=x.spatialReference,_=new j.Z({origin:new G.Z({x:x.xmin,y:x.ymax,spatialReference:I}),blockWidth:h,blockHeight:d,pyramidBlockWidth:h,pyramidBlockHeight:d,compression:o,pyramidScalingFactor:v}),C=new G.Z({x:x.width/n,y:x.height/i,spatialReference:I}),S=new W.Z({width:n,height:i,extent:x,isPseudoSpatialReference:w,spatialReference:I,bandCount:s,pixelType:c,pixelSize:C,noDataValue:p,storageInfo:_}),k=ye(e,"datafile"),R=ye(e,"IndexFile");return{rasterInfo:S,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:k||this.url.replace(".mrf",Ze.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:null==e?void 0:e.signal});return Se(t)}catch{return null}}};(0,n._)([(0,u.Cb)()],He.prototype,"_files",void 0),(0,n._)([(0,u.Cb)()],He.prototype,"_storageIndex",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,n._)([(0,p.j)("esri.layers.support.rasterIO.MRFRaster")],He);const Ae=He;var Le=r(94793),ze=r(9832);const Je=function(e,t){const r=e.get(t);return r&&r.values},We=function(e,t){const r=e.get(t);return r&&r.values[0]};let je=class extends se{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){var t,r,n;await this.init();const i=e?(0,o.Wg)(e.signal):null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:i});if(!s)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:l,firstIFD:c,isBigTiff:u}=(0,Le.cK)(s),h=[];await this._readIFDs(h,s,l,c,0,u?8:4,i);const d=(0,Le.FI)(h),{width:f,height:p,tileWidth:m,tileHeight:g,planes:y,pixelType:x,compression:w,firstPyramidLevel:b,maximumPyramidLevel:v,pyramidBlockWidth:I,pyramidBlockHeight:_,tileBoundary:C,affine:S,metadata:k}=d;let R=_e((null==(t=d.extent.spatialReference)?void 0:t.wkt)||(null==(r=d.extent.spatialReference)?void 0:r.wkid)),T=!1;null==R&&(T=!0,R=new E.Z({wkid:3857}));const P=new O.Z({...d.extent,spatialReference:R}),M=new G.Z(P?{x:P.xmin,y:P.ymax,spatialReference:R}:{x:0,y:0}),F=new j.Z({blockWidth:m,blockHeight:g,pyramidBlockWidth:I,pyramidBlockHeight:_,compression:w,origin:M,firstPyramidLevel:b,maximumPyramidLevel:v,blockBoundary:C}),B=new G.Z({x:(P.xmax-P.xmin)/f,y:(P.ymax-P.ymin)/p,spatialReference:R}),D=k?{BandProperties:k.bandProperties,DataType:k.dataType}:{},N=new W.Z({width:f,height:p,bandCount:y,pixelType:x,compression:w,pixelSize:B,storageInfo:F,spatialReference:R,isPseudoSpatialReference:T,keyProperties:D,extent:P,statistics:k?k.statistics:null});if(null!=S&&S.length&&(N.nativeExtent=new O.Z({xmin:-.5,ymin:.5-p,xmax:f-.5,ymax:.5,spatialReference:R}),N.transform=new ve.Z({polynomialOrder:1,forwardCoefficients:[S[2]+S[0]/2,S[5]-S[3]/2,S[0],S[3],-S[1],-S[4]]}),N.extent=N.transform.forwardTransform(N.nativeExtent),N.pixelSize=new G.Z({x:(P.xmax-P.xmin)/f,y:(P.ymax-P.ymin)/p,spatialReference:R}),F.origin.x=-.5,F.origin.y=.5),null==(n=this.ioConfig.skipExtensions)||!n.includes("aux.xml")){const t=await this._fetchAuxiliaryData(e);if(null!=t){var Z;if(N.statistics=null!=(Z=t.statistics)?Z:N.statistics,N.histograms=t.histograms,t.histograms&&!(0,o.pC)(N.statistics)&&(N.statistics=(0,ne.Oh)(t.histograms)),t.transform&&!S){N.transform=t.transform,N.nativeExtent=N.extent;const e=N.transform.forwardTransform(N.nativeExtent);N.pixelSize=new G.Z({x:(e.xmax-e.xmin)/f,y:(e.ymax-e.ymin)/p,spatialReference:R}),N.extent=e}N.spatialReference||(N.spatialReference=t.spatialReference)}}if(this._set("rasterInfo",N),this._headerInfo={littleEndian:l,isBigTiff:u,ifds:h,...d},!this._headerInfo.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);this.updateTileInfo()}async fetchRawTile(e,t,r,n={}){var i;if(null==(i=this._headerInfo)||!i.isSupported||this.isBlockOutside(e,t,r))return null;const s=this._getTileLocation(e,t,r);if(!s)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=s,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal}))),h=await Promise.all(u),d=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),f=1===h.length?h[0].data:new ArrayBuffer(d),p=[0],m=[0];if(h.length>1){const e=new Uint8Array(f);for(let t=0,r=0;t<h.length;t++){const n=h[t].data;e.set(new Uint8Array(n),r),p[t]=r,r+=n.byteLength,m[t]=n.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(f,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:p,sizes:m},width:g,height:y,planes:null,pixelType:null});let w,b,v;if(o!==g||l!==y){let e=x.mask;if(e)for(w=0;w<y;w++)if(v=w*g,w<l)for(b=o;b<g;b++)e[v+b]=0;else for(b=0;b<g;b++)e[v+b]=0;else for(e=new Uint8Array(g*y),x.mask=e,w=0;w<l;w++)for(v=w*g,b=0;b<o;b++)e[v+b]=1}return x}async _readIFDs(e,t,r,n,i,s=4,a){if(!n)return null;(n>=t.byteLength||n<0)&&(t=(await this.request(this.url,{range:{from:n+i,to:n+i+this._bufferSize},responseType:"array-buffer",signal:a})).data,i=n+i,n=0);const o=await this._readIFD(t,r,n,i,ze.Z.TIFF_TAGS,s,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-i,i,s,a)}async _readIFD(e,t,r,n,i=ze.Z.TIFF_TAGS,s=4,a){if(!e)return null;const o=(0,Le.vr)(e,t,r,n,i,s);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const i=r.map((e=>e.offlineOffsetSize)),s=Math.min.apply(null,i.map((e=>e[0])));if(Math.min.apply(null,i.map((e=>e[0]+e[1])))-s<=this._bufferSize){const{data:i}=await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:a});e=i,n=s,r.forEach((r=>(0,Le.Dq)(e,t,r,n)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),i=r.values;if(i&&i.length>4){const s=i[0]+"."+i[1]+"."+i[2],o=await this._readIFD(e,t,r.valueOffset+6-n,n,ze.Z.GEO_KEYS,2,a);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:n,to:n+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,n,ze.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,r){const{firstPyramidLevel:n,blockBoundary:i}=this.rasterInfo.storageInfo,s=0===e?0:e-(n-1),a=this._headerInfo.ifds[s];if(!a)return null;const o=(0,Le.If)(a,this._headerInfo),l=Je(a,"TILEOFFSETS");if(void 0===l)return null;const c=Je(a,"TILEBYTECOUNTS"),{minRow:u,minCol:h,maxRow:d,maxCol:f}=i[s];if(t>d||r>f||t<u||r<h)return null;const p=We(a,"IMAGEWIDTH"),m=We(a,"IMAGELENGTH"),g=We(a,"TILEWIDTH"),y=We(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,w=x*t*(f+1)+r,b=[{from:l[w],to:l[w+x-1]+c[w+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[w+t]+c[w+t]!==l[w+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[w+e],to:l[w+e]+c[w+e]-1}}const v=l[w],I=c[w];return null==v||null==I?null:{ranges:b,ifd:a,actualTileWidth:r===f?p%g:g,actualTileHeight:t===d?m%y:y}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:null==e?void 0:e.signal});return Se(t)}catch{return null}}};(0,n._)([(0,u.Cb)()],je.prototype,"_files",void 0),(0,n._)([(0,u.Cb)()],je.prototype,"_headerInfo",void 0),(0,n._)([(0,u.Cb)()],je.prototype,"_bufferSize",void 0),(0,n._)([(0,u.Cb)({type:String,json:{write:!0}})],je.prototype,"datasetFormat",void 0),je=(0,n._)([(0,p.j)("esri.layers.support.rasterDatasets.TIFFRaster")],je);const Ue=je,qe=new Map;qe.set("CRF",{desc:"Cloud Raster Format",constructor:de}),qe.set("MRF",{desc:"Meta Raster Format",constructor:Ae}),qe.set("TIFF",{desc:"GeoTIFF",constructor:Ue}),qe.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Fe}),qe.set("JPG",{desc:"JPG Raster Format",constructor:Re}),qe.set("PNG",{desc:"PNG Raster Format",constructor:Re}),qe.set("GIF",{desc:"GIF Raster Format",constructor:Re}),qe.set("BMP",{desc:"BMP Raster Format",constructor:Re});var $e=r(32163);let Ge=class extends((0,g.h)((0,H.M)((0,D.q)((0,N.I)((0,y.N)(B((0,A.n)((0,Z.Q)((0,l.R)(m.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var e,t;let r=[new L.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const n=null==(e=this.rasterInfo)||null==(t=e.attributeTable)?void 0:t.fields;if(n){const e=n.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));r=r.concat(e)}const i=this.rasterInfo.dataType;if(("vector-magdir"===i||"vector-uv"===i)&&(0,o.pC)(this.rasterInfo.multidimensionalInfo)){var s;const e=null==(s=this.rasterInfo.multidimensionalInfo.variables[0].unit)?void 0:s.trim(),t="Magnitude"+(e?` (${e})`:"");r.push(new L.Z({name:"Raster.Magnitude",alias:t,domain:null,editable:!1,type:"double"})),r.push(new L.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return r}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,r){const n=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,i=(0,s.ij)(n,r)||void 0;if(null!=i)return i}createPopupTemplate(e){return(0,$e.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:r}=this;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){this.raster?(this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url):this.raster=await class{static get supportedFormats(){const e=new Set;return qe.forEach(((t,r)=>e.add(r))),e}static async open(e){const{url:t,ioConfig:r,sourceJSON:n}=e;let i=e.datasetFormat;null==i&&t.lastIndexOf(".")&&(i=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===i||"TIF"===i?i="TIFF":"JPG"!==i&&"JPEG"!==i&&"JFIF"!==i||(i="JPG"),t.toLowerCase().indexOf("/imageserver")>-1&&-1===t.toLowerCase().indexOf("/wcsserver")&&(i="RasterTileServer");const s={url:t,sourceJSON:n,datasetFormat:i,ioConfig:r||{bandIds:null,sampling:null}};let o,l;if(this.supportedFormats.has(i))return o=qe.get(i).constructor,l=new o(s),await l.open({signal:e.signal}),l;if(i)throw new a.Z("rasterfactory:open","not a supported format "+i);const c=Array.from(qe.keys());let u=0;const h=function(){return i=c[u++],i?(o=qe.get(i).constructor,l=new o(s),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null};return h()}static register(e,t,r){qe.has(e.toUpperCase())||qe.set(e.toUpperCase(),{desc:t,constructor:r})}}.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON&&(this._set("version",this.sourceJSON.currentVersion),this._set("copyright",this.sourceJSON.copyrightText),this.sourceJSON.timeInfo&&this._set("timeInfo",J.Z.fromJSON(this.sourceJSON.timeInfo))),null==this.title&&(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.watch("customParameters",(e=>this.raster.ioConfig.customFetchParameters=e))}};(0,n._)([(0,u.Cb)({type:[h.z8],json:{write:{overridePolicy(){var e;return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==(null==(e=this.bandIds)?void 0:e.join(","))}}}}})],Ge.prototype,"bandIds",void 0),(0,n._)([(0,u.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,d.J)(z.c)],Ge.prototype,"interpolation",void 0),(0,n._)([(0,u.Cb)({json:{write:!0}})],Ge.prototype,"multidimensionalDefinition",void 0),(0,n._)([(0,u.Cb)(_.rn)],Ge.prototype,"legendEnabled",void 0),(0,n._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ge.prototype,"isReference",void 0),(0,n._)([(0,u.Cb)({type:["show","hide"]})],Ge.prototype,"listMode",void 0),(0,n._)([(0,u.Cb)()],Ge.prototype,"sourceJSON",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],Ge.prototype,"version",void 0),(0,n._)([(0,u.Cb)()],Ge.prototype,"title",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],Ge.prototype,"type",void 0),(0,n._)([(0,u.Cb)({type:["ArcGISTiledImageServiceLayer"]})],Ge.prototype,"operationalLayerType",void 0),(0,n._)([(0,u.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],Ge.prototype,"popupEnabled",void 0),(0,n._)([(0,u.Cb)({type:i.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Ge.prototype,"popupTemplate",void 0),(0,n._)([(0,u.Cb)({readOnly:!0})],Ge.prototype,"defaultPopupTemplate",null),(0,n._)([(0,u.Cb)({readOnly:!0,type:[L.Z]})],Ge.prototype,"fields",void 0),(0,n._)([(0,u.Cb)({readOnly:!0,type:[L.Z]})],Ge.prototype,"rasterFields",null),(0,n._)([(0,u.Cb)({types:s.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var e;const t="raster-stretch"===(null==(e=this.renderer)?void 0:e.type)&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!t}}},origins:{"web-scene":{types:s.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"animated-flow"!==e.type})}}}}})],Ge.prototype,"renderer",null),(0,n._)([(0,f.r)("renderer")],Ge.prototype,"readRenderer",null),Ge=(0,n._)([(0,p.j)("esri.layers.ImageryTileLayer")],Ge);const Ve=Ge},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var n,i=r(43697),s=r(66577),a=r(1692),o=r(35454),l=r(96674),c=r(22974),u=r(70586),h=r(5600),d=(r(75215),r(71715)),f=r(52011),p=r(30556),m=r(82971),g=r(33955),y=r(1231);const x=new o.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=n=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const i=e[t],s=a.Z.fromJSON(i),o=i.geometry&&i.geometry.spatialReference;(0,u.pC)(s.geometry)&&!o&&(s.geometry.spatialReference=r),n.push(s)}return n}writeGeometryType(e,t,r,n){if(e)return void x.write(e,t,r,n);const{features:i}=this;if(i)for(const e of i)if(e&&(0,u.pC)(e.geometry))return void x.write(e.geometry.type,t,r,n)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,n=(0,g.im)(e);return!r&&t.spatialReference&&(n.spatialReference=m.Z.fromJSON(t.spatialReference)),n}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,u.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new n(this.cloneProperties())}cloneProperties(){return(0,c.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const n=t.features[r];if(n.geometry){const t=e&&e[r];n.geometry=t&&t.toJSON()||n.geometry}}return t}quantize(e){const{scale:[t,r],translate:[n,i]}=e,s=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-n)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=s.length;e<t;e++)a((0,u.Wg)(s[e].geometry))||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[n,i],scale:[s,a]}=r,o=this._getHydrationFunction(e,(e=>e*s+n),(e=>i-e*a));for(const{geometry:e}of t)(0,u.pC)(e)&&o(e);return this.transform=null,this}_quantizePoints(e,t,r){let n,i;const s=[];for(let a=0,o=e.length;a<o;a++){const o=e[a];if(a>0){const e=t(o[0]),a=r(o[1]);e===n&&a===i||(s.push([e-n,a-i]),n=e,i=a)}else n=t(o[0]),i=r(o[1]),s.push([n,i])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const n=(0,g.oU)(e)?e.rings:e.paths,i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e],a=this._quantizePoints(s,t,r);a&&i.push(a)}return i.length>0?((0,g.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const n=this._quantizePoints(e.points,t,r);return n.length>0?(e.points=n,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const n=(0,g.oU)(e)?e.rings:e.paths;let i,s;for(let e=0,a=n.length;e<a;e++){const a=n[e];for(let e=0,n=a.length;e<n;e++){const n=a[e];e>0?(i+=n[0],s+=n[1]):(i=n[0],s=n[1]),n[0]=t(i),n[1]=r(s)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const n=e.points;let i,s;for(let e=0,a=n.length;e<a;e++){const a=n[e];e>0?(i+=a[0],s+=a[1]):(i=a[0],s=a[1]),a[0]=t(i),a[1]=r(s)}}:void 0}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,h.Cb)({type:[a.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,i._)([(0,d.r)("features")],w.prototype,"readFeatures",null),(0,i._)([(0,h.Cb)({type:[y.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:x.read}}})],w.prototype,"geometryType",void 0),(0,i._)([(0,p.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,i._)([(0,h.Cb)({types:s.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,i._)([(0,d.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,i._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,i._)([(0,p.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,i._)([(0,h.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=n=(0,i._)([(0,f.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w},89749:(e,t,r)=>{r.d(t,{t:()=>h});var n=r(43697),i=r(15923),s=r(61247),a=r(70586),o=r(17445),l=r(1654),c=r(5600),u=r(52011);let h=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new s.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,r={}){const n=++this.handleId;r.sync||this._installSyncUpdatingWatch(e,n);const i=(0,o.YP)(e,t,r);return this.handles.add(i,n),{remove:()=>this.handles.remove(n)}}addOnCollectionChange(e,t,{initial:r=!1}={}){const n=++this.handleId;return this.handles.add([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:r?e=>t({added:e.toArray(),removed:[]}):void 0})],n),{remove:()=>this.handles.remove(n)}}addPromise(e){if((0,a.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(d)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const r=()=>this.handles.remove(t);return e.then(r,r),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=(0,o.YP)(e,r,{sync:!0,equals:()=>!1});return this.handles.add(n,t),n}_createSyncUpdatingCallback(){return()=>{this.handles.remove(d),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,l.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(d))})),d)}}};(0,n._)([(0,c.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,n._)([(0,u.j)("esri.views.support.WatchUpdatingTracking")],h);const d=-42;var f,p;(p=f||(f={}))[p.NONE=0]="NONE",p[p.SYNC=1]="SYNC",p[p.INIT=2]="INIT"}}]);
|