@arcgis/core 4.34.0-next.64 → 4.34.0-next.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/Graphic.js +1 -1
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/05016b0713ef760fc57d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{861a6d6fe7958df36aa1.js → 06ff5f34ad9bdf9705de.js} +49 -40
  6. package/assets/esri/core/workers/chunks/{eadac757f74470b89a36.js → 0952aeddddc16705b7a3.js} +1 -1
  7. package/assets/esri/core/workers/chunks/09dd8613bc03e7a3a4cb.js +1 -0
  8. package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/117eb1422e9795d37ea3.js +1 -0
  10. package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/16fe21ca9b24eaee3069.js +1 -0
  12. package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
  13. package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 1c7b5ca80e80c314f78d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2a938096a42613425c7b.js +1 -0
  16. package/assets/esri/core/workers/chunks/31e7358fe802abb3f8db.js +1 -0
  17. package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
  18. package/assets/esri/core/workers/chunks/3bc50ee639a4d16c4f80.js +1 -0
  19. package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 44031bef6d500167ef0b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 481aea82501d04667ba2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → 4be2bab8ff3bd14ffdfb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
  25. package/assets/esri/core/workers/chunks/4fda6e90822bc0198b28.js +2 -0
  26. package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
  27. package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
  28. package/assets/esri/core/workers/chunks/60920d4856a011ace7e2.js +1 -0
  29. package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
  30. package/assets/esri/core/workers/chunks/66ffefd46fe6175c2af4.js +1 -0
  31. package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
  32. package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → 707311e24b2f458d9209.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7a17e78c76076ed4476f.js +1 -0
  34. package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
  35. package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
  36. package/assets/esri/core/workers/chunks/88b8f33ce1cbf8a0f855.js +33 -0
  37. package/assets/esri/core/workers/chunks/8f60804c7ba445f25df8.js +1 -0
  38. package/assets/esri/core/workers/chunks/9a6d359ead62a8eadd3c.js +1 -0
  39. package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 9e3f8c06b4e090a35710.js} +1 -1
  40. package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
  41. package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
  42. package/assets/esri/core/workers/chunks/ad7aa7d09bfceb12609e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
  44. package/assets/esri/core/workers/chunks/af1030e4c4437d4eb600.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
  46. package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → c20aead85cdea91c4b74.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
  50. package/assets/esri/core/workers/chunks/dcad3dcbd4ea2f5a6a04.js +1 -0
  51. package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
  52. package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
  53. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
  54. package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
  55. package/assets/esri/core/workers/chunks/f5101f5f93f776a6456f.js +1 -0
  56. package/assets/esri/themes/base/widgets/_Attribution.scss +0 -1
  57. package/assets/esri/themes/dark/main.css +1 -1
  58. package/assets/esri/themes/light/main.css +1 -1
  59. package/assets/esri/themes/light/view.css +1 -1
  60. package/chunks/ComponentShader.glsl.js +1 -1
  61. package/chunks/DefaultMaterial.glsl.js +2 -2
  62. package/chunks/Fog.glsl.js +2 -2
  63. package/chunks/{BloomBlur.glsl.js → GlowBlur.glsl.js} +5 -5
  64. package/chunks/GlowComposition.glsl.js +41 -0
  65. package/chunks/Path.glsl.js +1 -1
  66. package/chunks/RealisticTree.glsl.js +18 -15
  67. package/config.js +1 -1
  68. package/core/AsyncUpdate.js +1 -1
  69. package/core/mapCollectionUtils.js +1 -1
  70. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  71. package/geometry/Polygon.js +1 -1
  72. package/geometry/support/centroid.js +1 -1
  73. package/geometry/support/geometryUtils.js +1 -1
  74. package/graphic/AggregateGraphicOrigin.js +1 -1
  75. package/graphic/BuildingGraphicOrigin.js +1 -1
  76. package/graphic/CSVGraphicOrigin.js +1 -1
  77. package/graphic/CatalogGraphicOrigin.js +1 -1
  78. package/graphic/FeatureGraphicOrigin.js +1 -1
  79. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  80. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  81. package/graphic/ImageryGraphicOrigin.js +1 -1
  82. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  83. package/graphic/KMLGraphicOrigin.js +1 -1
  84. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  85. package/graphic/LinkChartGraphicOrigin.js +1 -1
  86. package/graphic/MapImageGraphicOrigin.js +1 -1
  87. package/graphic/MapNotesGraphicOrigin.js +1 -1
  88. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  89. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  90. package/graphic/ParquetGraphicOrigin.js +1 -1
  91. package/graphic/PointCloudGraphicOrigin.js +1 -1
  92. package/graphic/SceneGraphicOrigin.js +1 -1
  93. package/graphic/StreamGraphicOrigin.js +1 -1
  94. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  95. package/graphic/TileGraphicOrigin.js +1 -1
  96. package/graphic/TrackGraphicOrigin.js +1 -1
  97. package/graphic/VectorTileGraphicOrigin.js +1 -1
  98. package/graphic/VoxelGraphicOrigin.js +1 -1
  99. package/graphic/WCSGraphicOrigin.js +1 -1
  100. package/graphic/WFSGraphicOrigin.js +1 -1
  101. package/graphic/getIdFieldsProvider.js +5 -0
  102. package/graphic/getSliceableContainer.js +5 -0
  103. package/graphic/graphicOrigins.d.ts +0 -2
  104. package/graphic/graphicOrigins.js +1 -1
  105. package/interfaces.d.ts +141 -60
  106. package/kernel.js +1 -1
  107. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  108. package/layers/IntegratedMeshLayer.js +1 -1
  109. package/layers/LinkChartLayer.js +1 -1
  110. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  111. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  112. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  113. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  114. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  115. package/package.json +1 -1
  116. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  117. package/support/revision.js +1 -1
  118. package/symbols/support/previewCIMSymbol.js +1 -1
  119. package/symbols/support/previewSymbol2D.js +1 -1
  120. package/symbols/support/renderUtils.js +1 -1
  121. package/symbols/support/svgUtils.js +1 -1
  122. package/symbols/support/symbolUtils.js +1 -1
  123. package/symbols/support/utils.js +1 -1
  124. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
  125. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
  126. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
  127. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  128. package/views/2d/layers/support/visualVariableSimpleUtils.js +1 -1
  129. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
  130. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
  131. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
  132. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  133. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  134. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  135. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  136. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  137. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  138. package/views/3d/environment/Fog.js +1 -1
  139. package/views/3d/environment/FogTechniqueConfiguration.js +1 -1
  140. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  141. package/views/3d/layers/I3SMeshView3D.js +1 -1
  142. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  143. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  144. package/views/3d/layers/SceneLayerView3D.js +1 -1
  145. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  146. package/views/3d/layers/i3s/Intersector.js +1 -1
  147. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  148. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  149. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  150. package/views/3d/support/hitTest.js +1 -1
  151. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  152. package/views/3d/support/viewpointUtils.js +1 -1
  153. package/views/3d/terrain/Intersector.js +1 -1
  154. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  155. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  156. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentBVH.js +1 -1
  157. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  158. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  159. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  160. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  161. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
  162. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  163. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
  164. package/views/3d/webgl-engine/effects/{bloom/BloomBlur.glsl.js → glow/GlowBlur.glsl.js} +1 -1
  165. package/views/3d/webgl-engine/effects/glow/GlowBlurTechnique.js +5 -0
  166. package/views/3d/webgl-engine/effects/{bloom/BloomBlurTechniqueConfiguration.js → glow/GlowBlurTechniqueConfiguration.js} +1 -1
  167. package/views/3d/webgl-engine/effects/{bloom/BloomComposition.glsl.js → glow/GlowComposition.glsl.js} +1 -1
  168. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +5 -0
  169. package/views/3d/webgl-engine/effects/{bloom/BloomCompositionTechniqueConfiguration.js → glow/GlowCompositionTechniqueConfiguration.js} +1 -1
  170. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +5 -0
  171. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +5 -0
  172. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  173. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +8 -2
  174. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  175. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  176. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  177. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  178. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  179. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  180. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  181. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  182. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  185. package/views/View2D.js +1 -1
  186. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
  187. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  188. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  189. package/views/analysis/ElevationProfile/constants.js +1 -1
  190. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
  191. package/views/draw/support/createUtils.js +1 -1
  192. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  193. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  194. package/widgets/Legend/styles/card/CardView.js +1 -1
  195. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  196. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  197. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  198. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  199. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  200. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  201. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  202. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  203. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  204. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  205. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  206. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  207. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  208. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  209. package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
  210. package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
  211. package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
  212. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
  213. package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
  214. package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
  215. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
  216. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
  217. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
  218. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
  219. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
  220. package/assets/esri/core/workers/chunks/5de07f7a09eb9f3ab666.js +0 -1
  221. package/assets/esri/core/workers/chunks/659f7e99b2d524ef53fb.js +0 -2
  222. package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
  223. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
  224. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
  225. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
  226. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
  227. package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
  228. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
  229. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
  230. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
  231. package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
  232. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
  233. package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
  234. package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
  235. package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
  236. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
  237. package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
  238. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
  239. package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
  240. package/assets/esri/core/workers/chunks/eacc7fccdc3fb670ac8f.js +0 -33
  241. package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
  242. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
  243. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
  244. package/chunks/BloomComposition.glsl.js +0 -41
  245. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
  246. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
  247. package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
  248. package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
  249. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
  250. package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
  251. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
  252. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
  253. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
  254. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
  255. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
  256. package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +0 -5
  257. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +0 -5
  258. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +0 -5
  259. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +0 -5
  260. /package/assets/esri/core/workers/chunks/{659f7e99b2d524ef53fb.js.LICENSE.txt → 4fda6e90822bc0198b28.js.LICENSE.txt} +0 -0
package/views/View2D.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as g}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import{owningCollectionProperty as c}from"../core/support/OwningCollection.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import f from"../layers/support/TileInfo.js";import{AnalysesCollection as w}from"../support/AnalysesCollection.js";import{BreakpointsOwner as V}from"./BreakpointsOwner.js";import{DOMContainer as v}from"./DOMContainer.js";import{PopupView as M}from"./PopupView.js";import b from"./View.js";import{Viewport2DBaseMixin as _}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as j}from"./Viewport2DMixin.js";import R from"./2d/AnimationManager.js";import{layerView2DImporter as S}from"./2d/layerViewModuleImportUtils.js";import O from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as T}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as C}from"./2d/engine/ManagedCanvas.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as x}from"./2d/layers/support/util.js";import{clipContainsPoint as D}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as A,setDefaultHighlightOptions as P}from"./2d/support/highlightOptionsUtils.js";import{hitTest as E}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as z,takeScreenshot as G}from"./2d/support/screenshotUtils.js";import{Timeline as U}from"./2d/support/Timeline.js";import q from"./navigation/Navigation.js";import I from"./navigation/NavigationActionMap.js";import N from"./support/AnalysisViewManager.js";import W from"./support/HighlightOptions.js";import{check as $}from"./support/WebGLRequirements.js";import F from"./ui/DefaultUI.js";import H from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as B}from"./webgl/RenderingContextOptions.js";import{isWebMap as Z}from"../webmap/utils.js";import J from"../webmap/background/ColorBackground.js";let K,Q,X,Y,ee,te,ie;async function re(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);Q=e,X=t,Y=i,ee=r,te=s,ie=a,K=n}let se=class extends(j(_(V(M(v(b)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new q({actionMap:new I({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.analyses=new w,this.analysisViewManager=new N({importAnalysisViewModule:e=>T(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new U,this.type="2d",this.view2dType=null,this.ui=new H,this.test={takeScreenshot:async e=>z(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get background(){return Z(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get highlightOptions(){return A(this)}set highlightOptions(e){P(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return E(this,e,t)}async takeScreenshot(e){return G(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Z(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Z(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return S.hasLayerViewModule(e)}importLayerView(e){return S.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>D(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=$(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return re()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new C(this.surface),i=new K(this.surface,{canvas:this.renderCanvas,contextOptions:new B(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new te,this._magnifierView.magnifier=this.magnifier,this._gridView=new ie;const r=new Y({view:this});this._set("labelManager",r);const s=new R({view:this});this._set("animationManager",s);const a=new ee({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=x(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new O(f.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new Q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new X(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],se.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],se.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],se.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],se.prototype,"graphicsTileStore",null),e([h()],se.prototype,"graphicsView",void 0),e([h()],se.prototype,"constraintsInfo",null),e([h()],se.prototype,"initialExtentRequired",null),e([h()],se.prototype,"labelManager",void 0),e([h({type:q,nonNullable:!0})],se.prototype,"navigation",void 0),e([h({constructOnly:!0})],se.prototype,"renderCanvas",void 0),e([h()],se.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],se.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],se.prototype,"supportsGround",void 0),e([h()],se.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],se.prototype,"typeSpecificPreconditionsReady",null),e([h(c(w,"analyses"))],se.prototype,"analyses",void 0),e([h()],se.prototype,"analysisViewManager",void 0),e([h({type:J})],se.prototype,"background",null),e([h()],se.prototype,"center",null),e([h({type:i})],se.prototype,"floors",void 0),e([h()],se.prototype,"grid",void 0),e([h({type:W})],se.prototype,"highlightOptions",null),e([h()],se.prototype,"map",void 0),e([h()],se.prototype,"padding",null),e([h({readOnly:!0})],se.prototype,"rendering",null),e([h({readOnly:!0})],se.prototype,"resolution",null),e([h()],se.prototype,"scale",null),e([h({constructOnly:!0})],se.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],se.prototype,"tileInfo",null),e([h({type:U,readOnly:!0})],se.prototype,"timeline",void 0),e([h({readOnly:!0})],se.prototype,"type",void 0),e([h({readOnly:!0})],se.prototype,"updating",null),e([h({readOnly:!0})],se.prototype,"view2dType",void 0),e([h({readOnly:!0})],se.prototype,"visibleArea",null),e([h()],se.prototype,"zoom",null),e([h({readOnly:!0})],se.prototype,"navigating",null),e([h(),g(e=>e instanceof F?e:u(H,e))],se.prototype,"ui",void 0),se=e([d("esri.views.View2D")],se);const ae=se;export{ae as default};
5
+ import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as g}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as u}from"../core/accessorSupport/ensureType.js";import{owningCollectionProperty as c}from"../core/support/OwningCollection.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import f from"../layers/support/TileInfo.js";import{AnalysesCollection as w}from"../support/AnalysesCollection.js";import{BreakpointsOwner as V}from"./BreakpointsOwner.js";import{DOMContainer as M}from"./DOMContainer.js";import{PopupView as v}from"./PopupView.js";import b from"./View.js";import{Viewport2DBaseMixin as _}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as j}from"./Viewport2DMixin.js";import R from"./2d/AnimationManager.js";import{layerView2DImporter as S}from"./2d/layerViewModuleImportUtils.js";import O from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as T}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as C}from"./2d/engine/ManagedCanvas.js";import k from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as x}from"./2d/layers/support/util.js";import{clipContainsPoint as D}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as A,setDefaultHighlightOptions as P}from"./2d/support/highlightOptionsUtils.js";import{hitTest as E}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as z,takeScreenshot as G}from"./2d/support/screenshotUtils.js";import{Timeline as U}from"./2d/support/Timeline.js";import q from"./navigation/Navigation.js";import I from"./navigation/NavigationActionMap.js";import N from"./support/AnalysisViewManager.js";import W from"./support/HighlightOptions.js";import{check as $}from"./support/WebGLRequirements.js";import F from"./ui/DefaultUI.js";import H from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as B}from"./webgl/RenderingContextOptions.js";import{isWebMap as Z}from"../webmap/utils.js";import J from"../webmap/background/ColorBackground.js";let K,Q,X,Y,ee,te,ie;async function re(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);Q=e,X=t,Y=i,ee=r,te=s,ie=a,K=n}let se=class extends(j(_(V(v(M(b)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new q({actionMap:new I({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.analyses=new w,this.analysisViewManager=new N({importAnalysisViewModule:e=>T(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new U,this.type="2d",this.view2dType=null,this.ui=new H,this.test={takeScreenshot:async e=>z(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new k(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get background(){return Z(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get highlightOptions(){return A(this)}set highlightOptions(e){P(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.analysisViewManager||!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.analysisViewManager.updating||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return E(this,e,t)}async takeScreenshot(e){return G(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Z(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Z(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return S.hasLayerViewModule(e)}importLayerView(e){return S.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>D(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=$(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return re()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new C(this.surface),i=new K(this.surface,{canvas:this.renderCanvas,contextOptions:new B(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new te,this._magnifierView.magnifier=this.magnifier,this._gridView=new ie;const r=new Y({view:this});this._set("labelManager",r);const s=new R({view:this});this._set("animationManager",s);const a=new ee({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=x(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new O(f.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new Q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new X(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],se.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],se.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],se.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],se.prototype,"graphicsTileStore",null),e([h()],se.prototype,"graphicsView",void 0),e([h()],se.prototype,"constraintsInfo",null),e([h()],se.prototype,"initialExtentRequired",null),e([h()],se.prototype,"labelManager",void 0),e([h({type:q,nonNullable:!0})],se.prototype,"navigation",void 0),e([h({constructOnly:!0})],se.prototype,"renderCanvas",void 0),e([h()],se.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],se.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],se.prototype,"supportsGround",void 0),e([h()],se.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],se.prototype,"typeSpecificPreconditionsReady",null),e([h(c(w,"analyses"))],se.prototype,"analyses",void 0),e([h()],se.prototype,"analysisViewManager",void 0),e([h({type:J})],se.prototype,"background",null),e([h()],se.prototype,"center",null),e([h({type:i})],se.prototype,"floors",void 0),e([h()],se.prototype,"grid",void 0),e([h({type:W})],se.prototype,"highlightOptions",null),e([h()],se.prototype,"map",void 0),e([h()],se.prototype,"padding",null),e([h({readOnly:!0})],se.prototype,"rendering",null),e([h({readOnly:!0})],se.prototype,"resolution",null),e([h()],se.prototype,"scale",null),e([h({constructOnly:!0})],se.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],se.prototype,"tileInfo",null),e([h({type:U,readOnly:!0})],se.prototype,"timeline",void 0),e([h({readOnly:!0})],se.prototype,"type",void 0),e([h({readOnly:!0})],se.prototype,"updating",null),e([h({readOnly:!0})],se.prototype,"view2dType",void 0),e([h({readOnly:!0})],se.prototype,"visibleArea",null),e([h()],se.prototype,"zoom",null),e([h({readOnly:!0})],se.prototype,"navigating",null),e([h(),g(e=>e instanceof F?e:u(H,e))],se.prototype,"ui",void 0),se=e([d("esri.views.View2D")],se);const ae=se;export{ae as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as o}from"tslib";import e from"../../../Color.js";import t from"../../../core/Accessor.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as p}from"../../../geometry/projectionUtils.js";import{getConfig as c}from"./constants.js";let l=class extends t{constructor(o){super(o),this.position=null,this.color=new e("#ffffff"),this.element=a()}initialize(){this.addHandles([r(()=>this._screenLocation,o=>{o&&(this.element.style.transform=`translate(${o.x}px, ${o.y}px)`)},i),r(()=>this.color.toCss(),o=>{this.element.style.background=o},i)]),this.view.surface?.appendChild(this.element)}destroy(){this.element.remove()}get _screenLocation(){const{position:o,view:e}=this;"3d"===e.type?(e.commitProperty("size"),e.commitProperty("camera")):e.commitProperty("center");const t=e?.spatialReference,r=t?p(o,t).geometry:null;return r&&e?.ready?e.toScreen(r):null}};function a(){const o=document.createElement("div"),{size:e,borderStyle:t,borderColor:r,borderWidth:i,boxShadow:s}=c().hoveredPointsStyle,{style:n}=o;return n.display="block",n.position="absolute",n.top="0",n.left="0",n.contain="strict",n.boxSizing="border-box",n.width=`${e}px`,n.height=`${e}px`,n.marginTop=`-${e/2}px`,n.marginLeft=`-${e/2}px`,n.border=`${t} ${i}px ${r}`,n.borderRadius=`${e}px`,n.boxShadow=s,o}o([s()],l.prototype,"position",void 0),o([s({type:e})],l.prototype,"color",void 0),o([s()],l.prototype,"view",void 0),o([s()],l.prototype,"_screenLocation",null),l=o([n("esri.views.analysis.ElevationProfile.ElevationProfileHoveredPointVisualization")],l);export{l as ElevationProfileHoveredPointVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as o}from"tslib";import e from"../../../core/Accessor.js";import t from"../../../core/Collection.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getInputGeometry as l}from"./elevationProfileGeometryUtils.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let p=class extends e{constructor(o){super(o),this._hoveredPoints=new t}initialize(){const{analysisViewData:o}=this,{analysis:e}=o;this.addHandles([r(()=>{const{hoveredPoints:t,visible:r,progress:i}=o;return r?i<1?null:t.map((o,t)=>{const r=e.profiles.at(t);return!0===r?.viewOptions.hoveredPointVisible&&null!=o?{hoveredPoint:o,color:r.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i),r(()=>l(e.input),()=>this._update([]),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}get updating(){return!1}_update(o){if(!o)return;const{view:e,_hoveredPoints:t}=this,r=o.length;for(;t.length>r;)t.pop()?.destroy();for(;t.length<r;){const o=new a({view:e});t.push(o)}for(let i=0;i<r;++i){const e=o[i],s=t.at(r-1-i);s.position=e.hoveredPoint,s.color=e.color}}};o([s()],p.prototype,"view",void 0),o([s()],p.prototype,"analysisViewData",void 0),o([s()],p.prototype,"_hoveredPoints",void 0),o([s()],p.prototype,"updating",null),p=o([n("esri.views.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],p);export{p as ElevationProfileHoveredPointsVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Accessor.js";import{isSome as s}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{makeHandle as r,handlesGroup as o}from"../../../core/handleUtils.js";import{ignoreAbortErrors as n,isAborted as c,createResolver as p,throwIfAborted as l,createAbortError as h,onAbort as m}from"../../../core/promiseUtils.js";import{watch as y,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import k from"../../../layers/GraphicsLayer.js";import f from"../../../symbols/CIMSymbol.js";import g from"../../../symbols/SimpleLineSymbol.js";import{isPolylineGraphic as v,isPolyline as w,isValidInputGraphic as b}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as G}from"../../input/InputManager.js";import{isCancelEvent as O}from"../../interactive/interactiveToolUtils.js";import S from"../../../widgets/Sketch/SketchViewModel.js";const I=Symbol("main"),V=Symbol("interactive-operation");let j=class extends i{constructor(e){super(e),this._activeOperationInfo=null}initialize(){const{view:e}=this;this._graphicsLayer=new k({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height",offset:null},title:"Elevation profile graphics layer"}),this._sketchViewModel=new S({layer:this._graphicsLayer,view:e,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol}),this.addHandles(y(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:i})=>{switch(L(e,t),i){case"idle":case"selected":this._stopOperation();break;case"picking":case"awaiting-sketch":case"sketching":break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._graphicsLayer.visible=!1,this._ensureUpdatedSketchGraphic()}},d),I)}destroy(){this._sketchViewModel.destroy();const e=this._graphicsLayer;e&&this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),D(this._graphicsLayer,e),this._updateInputFromSketchGraphic())}get state(){const{analysis:e,visible:t,interactive:i}=this.analysisViewData;if(!t)return"idle";switch(this._activeOperationInfo?.type){case"place":return this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch";case"pick-graphic":return"picking";default:{const{input:t}=e;return t?v(t)?"selected":i?"reshaping":"reshaping-disabled":"idle"}}}get updating(){return this._sketchViewModel.updating}get _lineSymbol(){return M(this.view.type)}place(e){return this._startOperation("place",e,(t,i)=>{const s=this.analysisViewData.analysis.clone(),a=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateInputFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateInputFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return n(this._sketchViewModel.create("polyline")),r(()=>(a.remove(),this._sketchViewModel.cancel(),this._updateInputFromSketchGraphic(),this.analysisViewData.analysis.valid?c(e)||s.equals(this.analysisViewData.analysis)?i():void t():(this._clearInput(),i())))})}async pickGraphic(e){return this._startOperation("pick-graphic",e,(e,t)=>{const{view:i}=this;i.closePopup();let s=null;const n=r=>{r.defer(async()=>{s?.abort(),s=a(async s=>{const{results:a}=await i.hitTest(r);l(s);const o=a.filter(e=>"graphic"===e.type).map(e=>e.graphic).find(b);o?(r.preventDefault(),r.stopPropagation(),this.sketchGraphic=null,this.analysisViewData.analysis.input=o,e(),this._stopOperation()):t()}),await s.promise})},c=e=>{O(e)&&(t(),this._stopOperation())};return i.focus(),o([i.on("immediate-click",n,G.TOOL),i.on("key-down",c,G.TOOL),i.acquireCursor("crosshair","high"),r(()=>{s?.abort(),t()})])})}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateInputFromSketchGraphic(),"complete"===e.state&&this._stopOperation()});this._replaceHandles(r(()=>{e.remove(),this._sketchViewModel.cancel()}),V);const t=this._ensureUpdatedSketchGraphic();t&&(this._graphicsLayer.visible=!0,n(this._sketchViewModel.update(t,{tool:"reshape"})))}async _startOperation(e,t,i){const s=this._activeOperationInfo,a=p(),r={type:e,promise:a.promise};if(this._activeOperationInfo=r,s){const e=s.promise.catch(()=>{});this._stopOperation(),await e,l(t)}this.analysisViewData.interactive=!0;const o=i(()=>a.resolve({}),()=>a.reject(h()));this._replaceHandles([o,m(t,()=>this._stopOperation())],V);try{return await a.promise}finally{this._activeOperationInfo===r&&(this._activeOperationInfo=null)}}_stopOperation(){this.removeHandles(V)}_ensureUpdatedSketchGraphic(){const{input:e}=this.analysisViewData.analysis;return w(e)?(this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearInput(){this.sketchGraphic=null,this.analysisViewData.analysis.input=null}_updateInputFromSketchGraphic(){const e=this.sketchGraphic,{analysis:t}=this.analysisViewData;t.input=v(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(s),t)}};function M(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new f({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new g({color:[0,0,0,0]})}function L(e,t){t&&(t.parent&&"remove"in t.parent&&t.parent.remove(t),e?.add(t))}function D({graphics:e},t){t?(e.includes(t)||e.add(t),1!==e.length&&e.removeMany(e.filter(e=>e!==t))):e.removeAll()}e([u({constructOnly:!0})],j.prototype,"analysisViewData",void 0),e([u({constructOnly:!0})],j.prototype,"view",void 0),e([u()],j.prototype,"sketchGraphic",null),e([u({nonNullable:!0})],j.prototype,"state",null),e([u()],j.prototype,"updating",null),e([u()],j.prototype,"_activeOperationInfo",void 0),e([u()],j.prototype,"_lineSymbol",null),j=e([_("esri.views.analysis.ElevationProfile.ElevationProfileTool")],j);export{j as ElevationProfileTool};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../core/Accessor.js";import{isSome as s}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{makeHandle as r,handlesGroup as o}from"../../../core/handleUtils.js";import{ignoreAbortErrors as n,isAborted as p,createResolver as c,throwIfAborted as l,createAbortError as h,onAbort as d}from"../../../core/promiseUtils.js";import{watch as m,syncAndInitial as u}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as k}from"../../../core/support/UpdatingHandles.js";import f from"../../../layers/GraphicsLayer.js";import g from"../../../symbols/CIMSymbol.js";import w from"../../../symbols/SimpleLineSymbol.js";import{isPolylineGraphic as v,isPolyline as b,isValidInputGraphic as G}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as S}from"../../input/InputManager.js";import{isCancelEvent as O}from"../../interactive/interactiveToolUtils.js";import I from"../../../widgets/Sketch/SketchViewModel.js";const j=Symbol("main"),V=Symbol("interactive-operation");let M=class extends i{constructor(e){super(e),this._updatingHandles=new k,this._activeOperationInfo=null}initialize(){const{view:e}=this;this._graphicsLayer=new f({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height",offset:null}}),this._sketchViewModel=new I({layer:this._graphicsLayer,view:e,defaultCreateOptions:{mode:"click",hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol}),this.addHandles(m(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state}),({map:e,internalGraphicsLayer:t,state:i})=>{switch(D(e,t),i){case"idle":case"selected":this._stopOperation();break;case"picking":case"awaiting-sketch":case"sketching":break;case"reshaping":this._startReshape();break;case"reshaping-disabled":this._stopOperation(),this._ensureUpdatedSketchGraphic()}},u),j)}destroy(){this._sketchViewModel.destroy();const e=this._graphicsLayer;e&&this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get("sketchGraphic")}set sketchGraphic(e){e!==this._get("sketchGraphic")&&(this._set("sketchGraphic",e),U(this._graphicsLayer,e),this._updateInputFromSketchGraphic())}get state(){const{analysis:e,visible:t,interactive:i}=this.analysisViewData;if(!t)return"idle";switch(this._activeOperationInfo?.type){case"place":return this._sketchViewModel.createGraphic===this.sketchGraphic?"sketching":"awaiting-sketch";case"pick-graphic":return"picking";default:{const{input:t}=e;return t?v(t)?"selected":i?"reshaping":"reshaping-disabled":"idle"}}}get updating(){return this._sketchViewModel.updating||this._updatingHandles.updating}get _lineSymbol(){return L(this.view.type)}place(e){return this._startOperation("place",e,(t,i)=>{const s=this.analysisViewData.analysis.clone(),a=this._sketchViewModel.on("create",e=>{switch(e.state){case"complete":this._updateInputFromSketchGraphic(),this._stopOperation();break;case"cancel":this._stopOperation();break;case"active":this._updateInputFromSketchGraphic();break;case"start":this.sketchGraphic=e.graphic}});return this._ensureUpdatedSketchGraphic(),this._updatingHandles.addPromise(n(this._sketchViewModel.create("polyline"))),r(()=>(a.remove(),this._sketchViewModel.cancel(),this._updateInputFromSketchGraphic(),this.analysisViewData.analysis.valid?p(e)||s.equals(this.analysisViewData.analysis)?i():void t():(this._clearInput(),i())))})}async pickGraphic(e){return this._startOperation("pick-graphic",e,(e,t)=>{const{view:i}=this;i.closePopup();let s=null;const n=r=>{r.defer(async()=>{s?.abort(),s=a(async s=>{const{results:a}=await i.hitTest(r);l(s);const o=a.filter(e=>"graphic"===e.type).map(e=>e.graphic).find(G);o?(r.preventDefault(),r.stopPropagation(),this.sketchGraphic=null,this.analysisViewData.analysis.input=o,e(),this._stopOperation()):t()}),await s.promise})},p=e=>{O(e)&&(t(),this._stopOperation())};return i.focus(),o([i.on("immediate-click",n,S.TOOL),i.on("key-down",p,S.TOOL),i.acquireCursor("crosshair","high"),r(()=>{s?.abort(),t()})])})}_startReshape(){this._stopOperation();const e=this._sketchViewModel.on("update",e=>{this._updateInputFromSketchGraphic(),"complete"===e.state&&("reshaping"===this.state?this._startReshape():this._stopOperation())});this._replaceHandles(r(()=>{e.remove(),this._sketchViewModel.cancel()}),V);const t=this._ensureUpdatedSketchGraphic();t&&this._updatingHandles.addPromise(n(this._sketchViewModel.update(t,{tool:"reshape"})))}async _startOperation(e,t,i){const s=this._activeOperationInfo,a=c(),r={type:e,promise:a.promise};if(this._activeOperationInfo=r,s){const e=s.promise.catch(()=>{});this._stopOperation(),await e,l(t)}this.analysisViewData.interactive=!0;const o=i(()=>a.resolve({}),()=>a.reject(h()));this._replaceHandles([o,d(t,()=>this._stopOperation())],V);try{return await a.promise}finally{this._activeOperationInfo===r&&(this._activeOperationInfo=null)}}_stopOperation(){this.removeHandles(V)}_ensureUpdatedSketchGraphic(){const{input:e}=this.analysisViewData.analysis;return b(e)?(this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e}),this.sketchGraphic.geometry=e,this.sketchGraphic):(this.sketchGraphic=null,null)}_clearInput(){this.sketchGraphic=null,this.analysisViewData.analysis.input=null}_updateInputFromSketchGraphic(){const e=this.sketchGraphic,{analysis:t}=this.analysisViewData;t.input=v(e)?e.geometry:null}_replaceHandles(e,t){this.removeHandles(t),this.addHandles((Array.isArray(e)?e:[e]).filter(s),t)}};function L(e){if("2d"===e){const e={type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5};return new g({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{...e,effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new w({color:[0,0,0,0]})}function D(e,t){t&&(t.parent&&"remove"in t.parent&&t.parent.remove(t),e?.add(t))}function U({graphics:e},t){t?(e.includes(t)||e.add(t),1!==e.length&&e.removeMany(e.filter(e=>e!==t))):e.removeAll()}e([y({constructOnly:!0})],M.prototype,"analysisViewData",void 0),e([y({constructOnly:!0})],M.prototype,"view",void 0),e([y()],M.prototype,"sketchGraphic",null),e([y({nonNullable:!0})],M.prototype,"state",null),e([y()],M.prototype,"updating",null),e([y()],M.prototype,"_activeOperationInfo",void 0),e([y()],M.prototype,"_lineSymbol",null),M=e([_("esri.views.analysis.ElevationProfile.ElevationProfileTool")],M);export{M as ElevationProfileTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{convertUnit as e}from"../../../core/unitUtils.js";let t={noDataValue:-5e5,defaultQueryOptions:()=>({noDataValue:t.noDataValue,demResolution:"auto",maximumAutoTileRequests:150,ignoreInvisibleLayers:!0}),updateThrottleMillis:100,delayAfterPreviewMillis:500,defaultDemResolution:e(10,"centimeters","meters"),densificationMaxSamples:3e3,largeChartSamples:1e4,maxTotalSamples:1e5,maxChartRatio:300,minSlopeSampleDistance:10,formatPrecision:1,profileLinesUpdateThrottleMillis:100,hoveredPointsStyle:{size:14,borderStyle:"solid",borderWidth:3,borderColor:"#ffffff",boxShadow:"0px 0px 0px 5px rgba(255,255,255,0.2)"}};function a(){return t}function i(e){t=e}const l={progress:1,hasZ:!1,samples:[],statistics:null,spatialReference:null};export{l as errorResult,a as getConfig,i as setConfig};
5
+ import{makeHandle as e}from"../../../core/handleUtils.js";import{convertUnit as t}from"../../../core/unitUtils.js";let i={noDataValue:-5e5,defaultQueryOptions:()=>({noDataValue:i.noDataValue,demResolution:"auto",maximumAutoTileRequests:150,ignoreInvisibleLayers:!0}),updateThrottleMillis:100,delayAfterPreviewMillis:500,defaultDemResolution:t(10,"centimeters","meters"),densificationMaxSamples:3e3,largeChartSamples:1e4,maxTotalSamples:1e5,maxChartRatio:300,minSlopeSampleDistance:10,formatPrecision:1,profileLinesUpdateThrottleMillis:100,hoveredPointsStyle:{size:14,borderStyle:"solid",borderWidth:3,borderColor:"#ffffff",boxShadow:"0px 0px 0px 5px rgba(255,255,255,0.2)"}};function l(){return i}function o(t){const l=i;return i={...i,...t},e(()=>{i=l})}function a(){return o({defaultDemResolution:100,densificationMaxSamples:500,updateThrottleMillis:0,delayAfterPreviewMillis:0})}const r={progress:1,hasZ:!1,samples:[],statistics:null,spatialReference:null};export{r as errorResult,l as getConfig,o as setConfig,a as setTestConfig};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{handlesGroup as i}from"../../../core/handleUtils.js";import{watch as t,syncAndInitial as e}from"../../../core/reactiveUtils.js";import{isPolylineGraphic as r}from"./elevationProfileGeometryUtils.js";function n(n){return i([t(()=>{const{analysis:i,sketchGraphic:t,toolState:e,visible:a}=n.analysisViewData,{input:h,viewOptions:o}=i,{highlightEnabled:l}=o,s=r(h)?h:null,p=s?.layer;return{inputGraphic:s,inputGraphicLayer:p,sketchGraphic:t,toolState:e,visible:a,highlightEnabled:l}},({inputGraphic:i,inputGraphicLayer:t,sketchGraphic:e,toolState:r,visible:a,highlightEnabled:h})=>{if(n.onRemove(),!a)return;if(null!=e&&"reshaping"!==r&&"sketching"!==r)return n.onShowSketchedGraphic(e);return i&&!e&&h?n.onHighlight(i,t):void 0},e)])}export{n as connectVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{m as r}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../../geometry/Circle.js";import s from"../../../geometry/Multipoint.js";import i from"../../../geometry/Point.js";import c from"../../../geometry/Polygon.js";import p from"../../../geometry/Polyline.js";import{e as y}from"../../../chunks/distanceOperator.js";import{i as u,e as m}from"../../../chunks/simplifyOperator.js";import{unnormalizeVerticesOnDatelineCrossing as f,isClockwise as x,unnormalizeGeometryOnDatelineCrossing as h}from"../../../geometry/support/coordsUtils.js";import{isValid as M}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as g}from"./surfaceCoordinateSystems.js";function d(t,e){const o=new i({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function R(t,e){return new s({points:t,spatialReference:e})}function j(t,e,o){const n=new p({paths:t,spatialReference:e});return o&&h(n),n}function T(t,n,r,a=!0){const l=o(t);l.forEach(t=>{const o=t[0],n=t[t.length-1];e(o,n)&&1!==t.length||t.push(t[0])});let s=new c({rings:l,spatialReference:n});return s.rings.forEach(t=>{x(t)||t.reverse()}),r&&h(s),a&&!u(s)&&M(n)&&(s=m(s)||s),s}function b(e,o,n){const r=o.mapToLocalMultiple(e),a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y},i=Math.round(s.x-l.x),c=Math.round(s.y-l.y),p=Math.max(Math.abs(i),Math.abs(c));if(n){const t={x:l.x+p,y:l.y+p},e={x:l.x-p,y:l.y-p};a.push(g(t.x,e.y),g(e.x,e.y),g(e.x,t.y),g(t.x,t.y))}else{const t={x:i>0?l.x+p:l.x-p,y:c>0?l.y+p:l.y-p};a.push(g(l.x,l.y),g(t.x,l.y),g(t.x,t.y),g(l.x,t.y))}return P(T([a.map(t=>o.localToMap(t)).filter(t)],o.spatialReference,o.doUnnormalization,!0),a,o)}function U(e,o,n){let r=o.mapToLocalMultiple(e);if(1===r.length){const t=48,e=r[0];r=[g(e.x-t,e.y+t),g(e.x+t,e.y-t),g(e.x+t,e.y-t),g(e.x-t,e.y+t)]}const a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y};if(n){const t=Math.round(s.x-l.x),e=Math.round(s.y-l.y);a.push(g(l.x-t,l.y-e),g(s.x,l.y-e),g(s.x,s.y),g(l.x-t,s.y))}else a.push(g(l.x,l.y),g(s.x,l.y),g(s.x,s.y),g(l.x,s.y));return P(T([a.map(t=>o.localToMap(t)).filter(t)],o.spatialReference,o.doUnnormalization,!0),a,o)}function P(t,e,o){const n=z(e[3],e[2],o),r=z(e[1],e[2],o),a=z(e[0],e[1],o),l=z(e[0],e[3],o);return{geometry:t,midpoints:null!=n&&null!=r&&null!=a&&null!=l?{top:n,right:r,bottom:a,left:l}:null}}function z(t,e,o){I[0]=t.x,I[1]=t.y,I[2]=0,L[0]=e.x,L[1]=e.y,L[2]=0,r(I,I,L,.5),w.x=I[0],w.y=L[1],w.z=L[2];const n=o.localToMap(w);return null!=n?d(n,o.spatialReference):null}const w=g(0,0,0),I=a(),L=a();function k(t,e,o,r){const a=e.mapToLocalMultiple(t);let s=null,i=null;if(o)s=a[0],i=a[1];else{const t=a[0],e=a[1],o=Math.round(e.x-t.x),n=Math.round(e.y-t.y),r=Math.max(Math.abs(o),Math.abs(n));s=g(o>0?t.x+r/2:t.x-r/2,n>0?t.y+r/2:t.y-r/2),i=g(Math.abs(o)>Math.abs(n)?s.x-r/2:s.x,Math.abs(o)>Math.abs(n)?s.y:s.y-r/2)}const c=e.localToMap(s),p=e.localToMap(i);if(null==c||null==p)return null;e.doUnnormalization&&f([[c,p]],e.spatialReference);const u=d(c,e.spatialReference),m=d(p,e.spatialReference),x=n(e.spatialReference);let h=0;if(M(e.spatialReference))h=x*y(u,m);else{const t=s.x-i.x,e=s.y-i.y;h=x*Math.sqrt(t*t+e*e)*(r||1)}const R=new l({center:u,radius:h,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:T(R.rings,R.spatialReference,!1),center:u,edge:m}}function v(e,o,n){const r=o.mapToLocalMultiple(e),a=r[0],l=r[1],s=Math.round(l.x-a.x),i=Math.round(l.y-a.y),c=g(n?a.x:a.x+s/2,n?a.y:a.y+i/2),p=n?s:s/2,y=n?i:i/2,u=60,m=[],f=2*Math.PI/u;function x(t){const e=Math.cos(t),o=Math.sin(t);return g(p*e+c.x,y*o+c.y)}for(let t=0;t<u;t++)m.push(x(t*f));m.push(m[0]);const{spatialReference:h,doUnnormalization:M}=o,R=T([m.map(t=>o.localToMap(t)).filter(t)],h,M,!1),j=o.localToMap(x(Math.PI/2)),b=o.localToMap(x(0)),U=o.localToMap(x(-Math.PI/2)),P=o.localToMap(x(Math.PI));return{geometry:R,midpoints:null!=j&&null!=b&&null!=U&&null!=P?{top:d(j,h),right:d(b,h),bottom:d(U,h),left:d(P,h)}:null}}export{k as createCircle,v as createEllipse,R as createMultipoint,d as createPoint,T as createPolygon,j as createPolyline,U as createRectangle,b as createSquare};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{m as r}from"../../../chunks/vec32.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import l from"../../../geometry/Circle.js";import s from"../../../geometry/Multipoint.js";import i from"../../../geometry/Point.js";import c from"../../../geometry/Polygon.js";import p from"../../../geometry/Polyline.js";import{e as y}from"../../../chunks/distanceOperator.js";import{i as u,e as m}from"../../../chunks/simplifyOperator.js";import{unnormalizeGeometryOnDatelineCrossing as f,unnormalizeVerticesOnDatelineCrossing as x,isClockwise as h}from"../../../geometry/support/coordsUtils.js";import{isValid as M}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as g}from"./surfaceCoordinateSystems.js";function d(t,e){const o=new i({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function R(t,e){return new s({points:t,spatialReference:e})}function j(t,e,o){const n=new p({paths:t,spatialReference:e});return o&&f(n),n}function T(t,n,r,a=!0){const l=o(t);l.forEach(t=>{const o=t[0],n=t[t.length-1];e(o,n)&&1!==t.length||t.push(t[0])});let s=new c({rings:l,spatialReference:n});return s.rings.forEach(t=>{h(t)||t.reverse()}),r&&f(s),a&&!u(s)&&M(n)&&(s=m(s)||s),s}function b(e,o,n){const r=o.mapToLocalMultiple(e),a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y},i=Math.round(s.x-l.x),c=Math.round(s.y-l.y),p=Math.max(Math.abs(i),Math.abs(c));if(n){const t={x:l.x+p,y:l.y+p},e={x:l.x-p,y:l.y-p};a.push(g(t.x,e.y),g(e.x,e.y),g(e.x,t.y),g(t.x,t.y))}else{const t={x:i>0?l.x+p:l.x-p,y:c>0?l.y+p:l.y-p};a.push(g(l.x,l.y),g(t.x,l.y),g(t.x,t.y),g(l.x,t.y))}return P(T([a.map(t=>o.localToMap(t)).filter(t)],o.spatialReference,o.doUnnormalization,!0),a,o)}function U(e,o,n){let r=o.mapToLocalMultiple(e);if(1===r.length){const t=48,e=r[0];r=[g(e.x-t,e.y+t),g(e.x+t,e.y-t),g(e.x+t,e.y-t),g(e.x-t,e.y+t)]}const a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y};if(n){const t=Math.round(s.x-l.x),e=Math.round(s.y-l.y);a.push(g(l.x-t,l.y-e),g(s.x,l.y-e),g(s.x,s.y),g(l.x-t,s.y))}else a.push(g(l.x,l.y),g(s.x,l.y),g(s.x,s.y),g(l.x,s.y));return P(T([a.map(t=>o.localToMap(t)).filter(t)],o.spatialReference,o.doUnnormalization,!0),a,o)}function P(t,e,o){const n=z(e[3],e[2],o),r=z(e[1],e[2],o),a=z(e[0],e[1],o),l=z(e[0],e[3],o);return{geometry:t,midpoints:null!=n&&null!=r&&null!=a&&null!=l?{top:n,right:r,bottom:a,left:l}:null}}function z(t,e,o){I[0]=t.x,I[1]=t.y,I[2]=0,L[0]=e.x,L[1]=e.y,L[2]=0,r(I,I,L,.5),w.x=I[0],w.y=L[1],w.z=L[2];const n=o.localToMap(w);return null!=n?d(n,o.spatialReference):null}const w=g(0,0,0),I=a(),L=a();function k(t,e,o,r){const a=e.mapToLocalMultiple(t);let s=null,i=null;if(o)s=a[0],i=a[1];else{const t=a[0],e=a[1],o=Math.round(e.x-t.x),n=Math.round(e.y-t.y),r=Math.max(Math.abs(o),Math.abs(n));s=g(o>0?t.x+r/2:t.x-r/2,n>0?t.y+r/2:t.y-r/2),i=g(Math.abs(o)>Math.abs(n)?s.x-r/2:s.x,Math.abs(o)>Math.abs(n)?s.y:s.y-r/2)}const c=e.localToMap(s),p=e.localToMap(i);if(null==c||null==p)return null;e.doUnnormalization&&x([[c,p]],e.spatialReference);const u=d(c,e.spatialReference),m=d(p,e.spatialReference),f=n(e.spatialReference);let h=0;if(M(e.spatialReference))h=f*y(u,m);else{const t=s.x-i.x,e=s.y-i.y;h=f*Math.sqrt(t*t+e*e)*(r||1)}const R=new l({center:u,radius:h,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:T(R.rings,R.spatialReference,!1),center:u,edge:m}}function v(e,o,n){const r=o.mapToLocalMultiple(e),a=r[0],l=r[1],s=Math.round(l.x-a.x),i=Math.round(l.y-a.y),c=g(n?a.x:a.x+s/2,n?a.y:a.y+i/2),p=n?s:s/2,y=n?i:i/2,u=60,m=[],f=2*Math.PI/u;function x(t){const e=Math.cos(t),o=Math.sin(t);return g(p*e+c.x,y*o+c.y)}for(let t=0;t<u;t++)m.push(x(t*f));m.push(m[0]);const{spatialReference:h,doUnnormalization:M}=o,R=T([m.map(t=>o.localToMap(t)).filter(t)],h,M,!1),j=o.localToMap(x(Math.PI/2)),b=o.localToMap(x(0)),U=o.localToMap(x(-Math.PI/2)),P=o.localToMap(x(Math.PI));return{geometry:R,midpoints:null!=j&&null!=b&&null!=U&&null!=P?{top:d(j,h),right:d(b,h),bottom:d(U,h),left:d(P,h)}:null}}export{k as createCircle,v as createEllipse,R as createMultipoint,d as createPoint,T as createPolygon,j as createPolyline,U as createRectangle,b as createSquare};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{debounce as a,throwIfAborted as l}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{sqlAnd as p}from"../../../core/sql.js";import{getMetersPerUnitForSR as c}from"../../../core/unitUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{getResolutionForScale as m}from"../../../geometry/support/scaleUtils.js";import{collectFields as d}from"../../../layers/support/fieldUtils.js";import{getLayerFloorFilterClause as f}from"../../../layers/support/floorFilterUtils.js";import{calculateTolerance as g}from"../../../renderers/support/clickToleranceUtils.js";import{identify as b}from"../../../rest/identify.js";import w from"../../../rest/support/IdentifyParameters.js";import{loadArcade as v}from"../../../support/loadArcade.js";import x from"../../../symbols/SimpleMarkerSymbol.js";import{getRequiredFields as j,getFetchPopupTemplate as S}from"./popupUtils.js";let F=null;function _(e,t){return"tile"===t.type||"map-image"===t.type}let P=class extends r{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=a(async e=>{this.destroyed||await this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const e=e=>{for(const t of e){const{sourceLayer:e}=t;null!=e&&"geometryType"in e&&"point"===e.geometryType&&t.visible&&(t.visible=!1,this.highlightGraphicUpdated?.({graphic:t,property:"visible",oldValue:!0,newValue:!1}))}this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([n(()=>this.highlightGraphics,"change",t=>e(t.added),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtLocation(e,t){const{layerView:{layer:r,view:{scale:i}}}=this;if(!e)throw new s("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const o=G(r.sublayers,i,t);if(!o.length)return[];const a=await U(r,o);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!a)throw new s("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return a?this._fetchPopupFeaturesUsingQueries(e,o,t):this._fetchPopupFeaturesUsingIdentify(e,o,t)}clearHighlights(){this.highlightGraphics?.removeAll()}async _updateHighlightedFeaturesSymbols(e){for(const t of e)this._updateSymbology(t)}_updateSymbology(e){if("point"===e.geometry?.type)return this._updatePointSymbology(e)}_setGraphicSymbol(e,t){if(!t)return;const r=e.symbol;e.symbol=t,this.highlightGraphicUpdated?.({graphic:e,property:"symbol",oldValue:r,newValue:t})}_updatePointSymbology(e){const r=e.sourceLayer&&"renderer"in e.sourceLayer&&e.sourceLayer.renderer,{highlightGraphicUpdated:i,highlightGraphics:s,layerView:{view:o}}=this,a=e=>{e.visible||(e.visible=!0,i?.({graphic:e,property:"visible",oldValue:!1,newValue:!0}))};r&&"getSymbolAsync"in r?r.getSymbolAsync(e).then(async i=>{i||=new x;let l=null;const n="visualVariables"in r?r.visualVariables?.find(e=>"size"===e.type):void 0;n&&(F||(F=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSize),l=F(n,e,{view:o.type,scale:o.scale,shape:"simple-marker"===i.type?i.style:null})),l||="width"in i&&"height"in i&&null!=i.width&&null!=i.height?Math.max(i.width,i.height):"size"in i?i.size:16,s?.includes(e)&&(this._setGraphicSymbol(e,new x({style:"square",size:l,color:new t([255,255,255,1/255]),xoffset:"xoffset"in i?i.xoffset:0,yoffset:"yoffset"in i?i.yoffset:0})),a(e))}):a(e)}async _updateHighlightedFeaturesGeometries(e){const{layerView:{layer:t,view:r},highlightGraphics:i,highlightGraphicUpdated:s}=this;if(this._highlightGeometriesResolution=e,!s||!i?.length||!t.capabilities.operations.supportsQuery)return;const a=this._getTargetResolution(e),l=new Map;for(const c of i)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>a){const e=c.sourceLayer;o(l,e,()=>new Map).set(c.getObjectId(),c)}const n=Array.from(l,([e,t])=>{const i=e.createQuery();return i.objectIds=[...t.keys()],i.outFields=[e.objectIdField],i.returnGeometry=!0,i.maxAllowableOffset=a,i.outSpatialReference=r.spatialReference,e.queryFeatures(i)}),p=await Promise.all(n);if(!this.destroyed)for(const{features:o}of p)for(const e of o){const t=e.sourceLayer,r=l.get(t).get(e.getObjectId());if(r&&i.includes(r)){const t=r.geometry;r.geometry=e.geometry,s({graphic:r,property:"geometry",oldValue:t,newValue:r.geometry}),this._featuresResolutions.set(r,a)}}}_getTargetResolution(e){const t=e*c(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const i=await this._createIdentifyParameters(e,t,r);if(null==i)return[];const{results:s}=await b(this.layerView.layer.parsedUrl,i,r);return s.map(e=>e.feature)}async _createIdentifyParameters(e,t,r){const{floors:i,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;await Promise.all(t.map(({sublayer:e})=>e.load(r).catch(()=>{})));const n=Math.min(has("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((e,t)=>t.renderer?g({renderer:t.renderer,pointerType:r?.pointerType}):e,2)),p=this.createFetchPopupFeaturesQueryGeometry(e,n),c=m(l,a),u=Math.round(p.width/c),h=new y({xmin:p.center.x-c*u,ymin:p.center.y-c*u,xmax:p.center.x+c*u,ymax:p.center.y+c*u,spatialReference:p.spatialReference});return new w({floors:i,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:u,layerOption:"popup",mapExtent:h,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:n,width:u})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:s,timeExtent:o}}=this,a=t.map(async({sublayer:t,popupTemplate:i})=>{if(await t.load(r).catch(()=>{}),t.capabilities&&!t.capabilities.operations.supportsQuery)return[];const a=t.createQuery(),n=g({renderer:t.renderer,pointerType:r?.pointerType}),c=this.createFetchPopupFeaturesQueryGeometry(e,n),u=new Set,[h]=await Promise.all([j(t,i),t.renderer?.collectRequiredFields(u,t.fieldsIndex)]);l(r),d(u,t.fieldsIndex,h);const y=Array.from(u).sort();a.geometry=c,a.outFields=y,a.timeExtent=o;const m=f(s,t);if(a.where=p(a.where,m),t.capabilities?.query.supportsOrderBy&&t.orderBy?.[0]){const e=t.orderBy[0],r=!e.valueExpression&&e.field,i="ascending"===e.order?"asc":"desc";r&&(a.orderByFields=[`${r} ${i}`])}const b=this._getTargetResolution(c.width/n),w=await V(i);l(r);const v="point"===t.geometryType||w&&w.arcadeUtils.hasGeometryOperations(i);v||(a.maxAllowableOffset=b);let{features:x}=await t.queryFeatures(a,r);const S=v?0:b;x=await R(t,x,r);for(const e of x)this._featuresResolutions.set(e,S);return x});return(await Promise.allSettled(a)).reduce((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e,[]).filter(i)}};function G(e,t,r){const i=[];if(!e)return i;const s=e=>{const o=0===e.minScale||t<=e.minScale,a=0===e.maxScale||t>=e.maxScale;if(e.visible&&o&&a)if(e.sublayers)e.sublayers.forEach(s);else if(e.popupEnabled){const t=S(e,{...r,defaultPopupTemplateEnabled:!1});null!=t&&i.unshift({sublayer:e,popupTemplate:t})}};return e.map(s),i}function V(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some(e=>"expression"===e.type)?v():Promise.resolve()}async function U(e,t){if(e.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(t.map(({sublayer:e})=>e.load().then(()=>e.capabilities.operations.supportsQuery)))}catch{return!1}}async function R(e,t,r){const i=e.renderer;return i&&"defaultSymbol"in i&&!i.defaultSymbol&&(t=i.valueExpression?await Promise.all(t.map(e=>i.getSymbolAsync(e,r).then(t=>t?e:null))).then(e=>e.filter(e=>null!=e)):t.filter(e=>null!=i.getSymbol(e))),t}e([u({constructOnly:!0})],P.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),e([u({constructOnly:!0})],P.prototype,"layerView",void 0),e([u({constructOnly:!0})],P.prototype,"highlightGraphics",void 0),e([u({constructOnly:!0})],P.prototype,"highlightGraphicUpdated",void 0),e([u({constructOnly:!0})],P.prototype,"updatingHandles",void 0),P=e([h("esri.views.layers.support.MapServiceLayerViewHelper")],P);export{P as MapServiceLayerViewHelper,G as collectPopupProviders,_ as isMapServiceLayerView};
5
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{debounce as a,throwIfAborted as l,ignoreAbortErrors as n}from"../../../core/promiseUtils.js";import{on as p}from"../../../core/reactiveUtils.js";import{sqlAnd as c}from"../../../core/sql.js";import{getMetersPerUnitForSR as u}from"../../../core/unitUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../../geometry/Extent.js";import{getResolutionForScale as m}from"../../../geometry/support/scaleUtils.js";import{collectFields as f}from"../../../layers/support/fieldUtils.js";import{getLayerFloorFilterClause as g}from"../../../layers/support/floorFilterUtils.js";import{calculateTolerance as b}from"../../../renderers/support/clickToleranceUtils.js";import{identify as w}from"../../../rest/identify.js";import v from"../../../rest/support/IdentifyParameters.js";import{loadArcade as x}from"../../../support/loadArcade.js";import _ from"../../../symbols/SimpleMarkerSymbol.js";import{getRequiredFields as j,getFetchPopupTemplate as F}from"./popupUtils.js";let G=null;function S(e,t){return"tile"===t.type||"map-image"===t.type}let P=class extends r{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=a(async e=>{this.destroyed||await this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const e=e=>{for(const t of e){const{sourceLayer:e}=t;null!=e&&"geometryType"in e&&"point"===e.geometryType&&t.visible&&(t.visible=!1,this.highlightGraphicUpdated?.({graphic:t,property:"visible",oldValue:!0,newValue:!1}))}this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),n(this.updateHighlightedFeatures(this._highlightGeometriesResolution))};this.addHandles([p(()=>this.highlightGraphics,"change",t=>e(t.added),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtLocation(e,t){const{layerView:{layer:r,view:{scale:i}}}=this;if(!e)throw new s("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const o=U(r.sublayers,i,t);if(!o.length)return[];const a=await R(r,o);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!a)throw new s("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return a?this._fetchPopupFeaturesUsingQueries(e,o,t):this._fetchPopupFeaturesUsingIdentify(e,o,t)}clearHighlights(){this.highlightGraphics?.removeAll()}async _updateHighlightedFeaturesSymbols(e){for(const t of e)this._updateSymbology(t)}_updateSymbology(e){if("point"===e.geometry?.type)return this._updatePointSymbology(e)}_setGraphicSymbol(e,t){if(!t)return;const r=e.symbol;e.symbol=t,this.highlightGraphicUpdated?.({graphic:e,property:"symbol",oldValue:r,newValue:t})}_updatePointSymbology(e){const r=e.sourceLayer&&"renderer"in e.sourceLayer&&e.sourceLayer.renderer,{highlightGraphicUpdated:i,highlightGraphics:s,layerView:{view:o}}=this,a=e=>{e.visible||(e.visible=!0,i?.({graphic:e,property:"visible",oldValue:!1,newValue:!0}))};r&&"getSymbolAsync"in r?r.getSymbolAsync(e).then(async i=>{i||=new _;let l=null;const n="visualVariables"in r?r.visualVariables?.find(e=>"size"===e.type):void 0;n&&(G||(G=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSize),l=G(n,e,{view:o.type,scale:o.scale,shape:"simple-marker"===i.type?i.style:null})),l||="width"in i&&"height"in i&&null!=i.width&&null!=i.height?Math.max(i.width,i.height):"size"in i?i.size:16,s?.includes(e)&&(this._setGraphicSymbol(e,new _({style:"square",size:l,color:new t([255,255,255,1/255]),xoffset:"xoffset"in i?i.xoffset:0,yoffset:"yoffset"in i?i.yoffset:0})),a(e))}):a(e)}get _updateContext(){const{layerView:{layer:e},highlightGraphics:t,highlightGraphicUpdated:r}=this;return r&&t?.length&&e.capabilities.operations.supportsQuery?{highlightGraphicUpdated:r,highlightGraphics:t}:null}get highlightFeaturesActive(){return!!this._updateContext}async _updateHighlightedFeaturesGeometries(e){this._highlightGeometriesResolution=e;const t=this._updateContext;if(!t)return;const r=this._getTargetResolution(e),i=new Map,{highlightGraphics:s,highlightGraphicUpdated:a}=t;for(const c of s)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>r){const e=c.sourceLayer;o(i,e,()=>new Map).set(c.getObjectId(),c)}const{layerView:{view:l}}=this,n=Array.from(i,([e,t])=>{const i=e.createQuery();return i.objectIds=[...t.keys()],i.outFields=[e.objectIdField],i.returnGeometry=!0,i.maxAllowableOffset=r,i.outSpatialReference=l.spatialReference,e.queryFeatures(i)}),p=await Promise.all(n);if(!this.destroyed)for(const{features:o}of p)for(const e of o){const t=e.sourceLayer,o=i.get(t).get(e.getObjectId());if(o&&s.includes(o)){const t=o.geometry;o.geometry=e.geometry,a({graphic:o,property:"geometry",oldValue:t,newValue:o.geometry}),this._featuresResolutions.set(o,r)}}}_getTargetResolution(e){const t=e*u(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const i=await this._createIdentifyParameters(e,t,r);if(null==i)return[];const{results:s}=await w(this.layerView.layer.parsedUrl,i,r);return s.map(e=>e.feature)}async _createIdentifyParameters(e,t,r){const{floors:i,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;await Promise.all(t.map(({sublayer:e})=>e.load(r).catch(()=>{})));const n=Math.min(has("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((e,t)=>t.renderer?b({renderer:t.renderer,pointerType:r?.pointerType}):e,2)),p=this.createFetchPopupFeaturesQueryGeometry(e,n),c=m(l,a),u=Math.round(p.width/c),h=new d({xmin:p.center.x-c*u,ymin:p.center.y-c*u,xmax:p.center.x+c*u,ymax:p.center.y+c*u,spatialReference:p.spatialReference});return new v({floors:i,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:u,layerOption:"popup",mapExtent:h,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:n,width:u})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:s,timeExtent:o}}=this,a=t.map(async({sublayer:t,popupTemplate:i})=>{if(await t.load(r).catch(()=>{}),t.capabilities&&!t.capabilities.operations.supportsQuery)return[];const a=t.createQuery(),n=b({renderer:t.renderer,pointerType:r?.pointerType}),p=this.createFetchPopupFeaturesQueryGeometry(e,n),u=new Set,[h]=await Promise.all([j(t,i),t.renderer?.collectRequiredFields(u,t.fieldsIndex)]);l(r),f(u,t.fieldsIndex,h);const y=Array.from(u).sort();a.geometry=p,a.outFields=y,a.timeExtent=o;const d=g(s,t);if(a.where=c(a.where,d),t.capabilities?.query.supportsOrderBy&&t.orderBy?.[0]){const e=t.orderBy[0],r=!e.valueExpression&&e.field,i="ascending"===e.order?"asc":"desc";r&&(a.orderByFields=[`${r} ${i}`])}const m=this._getTargetResolution(p.width/n),w=await V(i);l(r);const v="point"===t.geometryType||w&&w.arcadeUtils.hasGeometryOperations(i);v||(a.maxAllowableOffset=m);let{features:x}=await t.queryFeatures(a,r);const _=v?0:m;x=await A(t,x,r);for(const e of x)this._featuresResolutions.set(e,_);return x});return(await Promise.allSettled(a)).reduce((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e,[]).filter(i)}};function U(e,t,r){const i=[];if(!e)return i;const s=e=>{const o=0===e.minScale||t<=e.minScale,a=0===e.maxScale||t>=e.maxScale;if(e.visible&&o&&a)if(e.sublayers)e.sublayers.forEach(s);else if(e.popupEnabled){const t=F(e,{...r,defaultPopupTemplateEnabled:!1});null!=t&&i.unshift({sublayer:e,popupTemplate:t})}};return e.map(s),i}function V(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some(e=>"expression"===e.type)?x():Promise.resolve()}async function R(e,t){if(e.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(t.map(({sublayer:e})=>e.load().then(()=>e.capabilities.operations.supportsQuery)))}catch{return!1}}async function A(e,t,r){const i=e.renderer;return i&&"defaultSymbol"in i&&!i.defaultSymbol&&(t=i.valueExpression?await Promise.all(t.map(e=>i.getSymbolAsync(e,r).then(t=>t?e:null))).then(e=>e.filter(e=>null!=e)):t.filter(e=>null!=i.getSymbol(e))),t}e([h({constructOnly:!0})],P.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),e([h({constructOnly:!0})],P.prototype,"layerView",void 0),e([h({constructOnly:!0})],P.prototype,"highlightGraphics",void 0),e([h({constructOnly:!0})],P.prototype,"highlightGraphicUpdated",void 0),e([h({constructOnly:!0})],P.prototype,"updatingHandles",void 0),e([h()],P.prototype,"_updateContext",null),P=e([y("esri.views.layers.support.MapServiceLayerViewHelper")],P);export{P as MapServiceLayerViewHelper,U as collectPopupProviders,S as isMapServiceLayerView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import"../../intl.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{destroyMaybe as s}from"../../core/maybe.js";import{watch as a,initial as n}from"../../core/reactiveUtils.js";import{formatDecimal as o,formatImperialArea as m,formatMetricArea as l,formatImperialLength as p,formatMetricLength as c}from"../../core/unitFormatUtils.js";import{convertUnit as u}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/Point.js";import f from"../../geometry/Polygon.js";import g from"../../geometry/Polyline.js";import{e as _}from"../../chunks/areaOperator.js";import{e as w,l as b}from"../../chunks/geodeticAreaOperator.js";import{e as L,l as j}from"../../chunks/geodeticDensifyOperator.js";import{e as S,l as A}from"../../chunks/geodeticLengthOperator.js";import{e as k}from"../../chunks/lengthOperator.js";import{e as G}from"../../chunks/simplifyOperator.js";import{isSupported as x,geodesicDensify as M,geodesicLengths as q,geodesicAreas as C}from"../../geometry/support/geodesicUtils.js";import O from"../../layers/GraphicsLayer.js";import H from"../../symbols/Font.js";import R from"../../symbols/SimpleFillSymbol.js";import U from"../../symbols/SimpleLineSymbol.js";import T from"../../symbols/SimpleMarkerSymbol.js";import z from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as D}from"../../views/2d/interactive/SnappingVisualizer2D.js";import P from"../../views/draw/Draw.js";import{createCoordinateHelper as E}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as V,screenToMap as F,dragManipulatedObject as W}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as I}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as B}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as J}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as K}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as N}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Q}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as X}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as Y}from"../../intl/messages.js";import{onLocaleChange as Z}from"../../intl/locale.js";const $=1e5;let ee=class extends B{constructor(e){super(e),this._measurementLayer=new O({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new O({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new O({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new v,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){Y("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new P({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([Z(async()=>{this.messages=await Y("esri/core/t9n/Units")}),a(()=>[this.unit,this.messages],()=>{this._updateGraphics()},n),a(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),X(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=s(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=s(this._measurementLayer),this._manipulatorLayer=s(this._manipulatorLayer),this._snappingLayer=s(this._snappingLayer),this._updatingHandles=s(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new N({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new K(new J("point",E(!1,!1,this.view.spatialReference)),2),visualizer:new D(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new y({x:i,y:s,spatialReference:t}),n=te(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=K.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=V(n,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=Q({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(F(this.view)).next(t=>{if("start"===t.action){const r=new y(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(W({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new y({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=re(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:s,fillGeometry:a,outlineGeometry:n}=e;this._set("measurement",s);const o=s?ae(this.messages,s,this.unit):null;if(this._set("measurementLabel",o),!a&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new R({color:r(h.accentColor,.3),outline:null})}),l=new t({symbol:new U({color:h.accentColor,width:2})}),p=new t({symbol:new z({color:h.textColor,font:new H({size:14,family:"sans-serif"}),haloColor:r(i(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=a,l.geometry=n,p.geometry=a?.centroid,p.symbol.text=o?.area??""}};function te(e,i,s){const a=8,n={style:"circle",color:r(i.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new T({...n,size:a}),m=new T({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new I({view:i,layer:s,graphic:l,focusedSymbol:m})}function re(e,t){if(2===e.length){const r=new g({paths:[e],spatialReference:t});let i;return i=t.isGeographic?x(t)?M(r,$):L(r,$,{unit:"meters"}):t.isWebMercator?L(r,$,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new g({paths:[e],spatialReference:t}),i=new f({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(x(t)){if(n=M(r,$),o=M(i,$),o=G(o),!o)return null;s=q([r],"meters")[0],a=C([o],"square-meters")[0]}else{if(n=L(r,$,{unit:"meters"}),o=L(i,$,{unit:"meters"}),o=G(o),!o)return null;s=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=L(r,$,{unit:"meters"}),o=L(i,$,{unit:"meters"}),o=G(o),!o)return null;s=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else{if(n=r,o=G(i),!o)return null;s=k(r,{unit:"meters"}),a=_(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function ie(e){return null!=e}async function se(e){(e?.isGeographic&&!x(e)||e?.isWebMercator)&&await Promise.all([b(),j(),A()])}function ae(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=l(e,s,"square-meters");break;case"imperial":i.area=m(e,s,"square-meters");break;default:{const t=u(s,"square-meters",r);i.area=o(e,t,r);break}}const n=ne(r);if(n)switch(n){case"metric":i.perimeter=c(e,a,"meters");break;case"imperial":i.perimeter=p(e,a,"meters");break;default:{const t=u(a,"meters",n);i.perimeter=o(e,t,n);break}}else i.perimeter="";return i}function ne(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([h()],ee.prototype,"_drawActive",void 0),e([h({readOnly:!0})],ee.prototype,"cursor",null),e([h({value:!0})],ee.prototype,"editable",null),e([h({readOnly:!0})],ee.prototype,"measurement",void 0),e([h({readOnly:!0})],ee.prototype,"measurementLabel",void 0),e([h()],ee.prototype,"messages",void 0),e([h({constructOnly:!0})],ee.prototype,"snappingManager",void 0),e([h()],ee.prototype,"unit",void 0),e([h()],ee.prototype,"updating",null),e([h({constructOnly:!0})],ee.prototype,"view",void 0),ee=e([d("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],ee);export{ee as AreaMeasurement2DTool,re as createAreaMeasurementInfo2D,ae as createAreaMeasurementLabel,ie as isSupported,se as loadGeometryOperators};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import"../../intl.js";import{multiplyOpacity as r,getContrast as s}from"../../core/colorUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as n}from"../../core/reactiveUtils.js";import{formatDecimal as o,formatImperialArea as m,formatMetricArea as l,formatImperialLength as p,formatMetricLength as c}from"../../core/unitFormatUtils.js";import{convertUnit as u}from"../../core/unitUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import y from"../../geometry/Point.js";import f from"../../geometry/Polygon.js";import g from"../../geometry/Polyline.js";import{e as _}from"../../chunks/areaOperator.js";import{e as w,l as b}from"../../chunks/geodeticAreaOperator.js";import{e as j,l as L}from"../../chunks/geodeticDensifyOperator.js";import{e as S,l as A}from"../../chunks/geodeticLengthOperator.js";import{e as k}from"../../chunks/lengthOperator.js";import{e as G}from"../../chunks/simplifyOperator.js";import{polygonCentroidPoint as x}from"../../geometry/support/centroid.js";import{isSupported as M,geodesicDensify as q,geodesicLengths as O,geodesicAreas as C}from"../../geometry/support/geodesicUtils.js";import H from"../../layers/GraphicsLayer.js";import R from"../../symbols/Font.js";import U from"../../symbols/SimpleFillSymbol.js";import T from"../../symbols/SimpleLineSymbol.js";import z from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as P}from"../../views/2d/interactive/SnappingVisualizer2D.js";import E from"../../views/draw/Draw.js";import{createCoordinateHelper as V}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as F,screenToMap as W,dragManipulatedObject as I}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as B}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as J}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as N}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as K}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Q}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as X}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as Y}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as Z}from"../../intl/messages.js";import{onLocaleChange as $}from"../../intl/locale.js";const ee=1e5;let te=class extends J{constructor(e){super(e),this._measurementLayer=new H({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new H({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new H({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new v,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){Z("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new E({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([$(async()=>{this.messages=await Z("esri/core/t9n/Units")}),a(()=>[this.unit,this.messages],()=>{this._updateGraphics()},n),a(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),Y(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=i(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=i(this._measurementLayer),this._manipulatorLayer=i(this._manipulatorLayer),this._snappingLayer=i(this._snappingLayer),this._updatingHandles=i(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Q({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new K(new N("point",V(!1,!1,this.view.spatialReference)),2),visualizer:new P(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[s,i]=e[r],a=new y({x:s,y:i,spatialReference:t}),n=re(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=K.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=F(n,(e,t,r,s)=>{const i=this._getSnappingContext(s),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=X({snappingContext:i,snappingManager:a,updatingHandles:n});t.next(W(this.view)).next(t=>{if("start"===t.action){const r=new y(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(I({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[s,i],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,s=this._vertices[r],[i,a]=e[r];s.coord[0]===i&&s.coord[1]===a||(s.coord=[i,a],s.manipulator.graphic.geometry=new y({x:i,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:i,fillGeometry:a,outlineGeometry:n}=e;this._set("measurement",i);const o=i?ne(this.messages,i,this.unit):null;if(this._set("measurementLabel",o),!a&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new U({color:r(h.accentColor,.3),outline:null})}),l=new t({symbol:new T({color:h.accentColor,width:2})}),p=new t({symbol:new D({color:h.textColor,font:new R({size:14,family:"sans-serif"}),haloColor:r(s(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=a,l.geometry=n;const d=a?x(a):null,v=d?y.fromJSON(d):null;p.geometry=v,p.symbol.text=o?.area??""}};function re(e,s,i){const a=8,n={style:"circle",color:r(s.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new z({...n,size:a}),m=new z({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new B({view:s,layer:i,graphic:l,focusedSymbol:m})}function se(e,t){if(2===e.length){const r=new g({paths:[e],spatialReference:t});let s;return s=t.isGeographic?M(t)?q(r,ee):j(r,ee,{unit:"meters"}):t.isWebMercator?j(r,ee,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:s}}e.push(e[0]);const r=new g({paths:[e],spatialReference:t}),s=new f({rings:[e],spatialReference:t});let i,a,n=null,o=null;if(t.isGeographic)if(M(t)){if(n=q(r,ee),o=q(s,ee),o=G(o),!o)return null;i=O([r],"meters")[0],a=C([o],"square-meters")[0]}else{if(n=j(r,ee,{unit:"meters"}),o=j(s,ee,{unit:"meters"}),o=G(o),!o)return null;i=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=j(r,ee,{unit:"meters"}),o=j(s,ee,{unit:"meters"}),o=G(o),!o)return null;i=S(r,{unit:"meters"}),a=w(o,{unit:"square-meters"})}else{if(n=r,o=G(s),!o)return null;i=k(r,{unit:"meters"}),a=_(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:i},fillGeometry:o,outlineGeometry:n}}function ie(e){return null!=e}async function ae(e){(e?.isGeographic&&!M(e)||e?.isWebMercator)&&await Promise.all([b(),L(),A()])}function ne(e,t,r){if(!t||!e)return null;const s={area:null,perimeter:null},{area:i,perimeter:a}=t;switch(r){case"metric":s.area=l(e,i,"square-meters");break;case"imperial":s.area=m(e,i,"square-meters");break;default:{const t=u(i,"square-meters",r);s.area=o(e,t,r);break}}const n=oe(r);if(n)switch(n){case"metric":s.perimeter=c(e,a,"meters");break;case"imperial":s.perimeter=p(e,a,"meters");break;default:{const t=u(a,"meters",n);s.perimeter=o(e,t,n);break}}else s.perimeter="";return s}function oe(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([h()],te.prototype,"_drawActive",void 0),e([h({readOnly:!0})],te.prototype,"cursor",null),e([h({value:!0})],te.prototype,"editable",null),e([h({readOnly:!0})],te.prototype,"measurement",void 0),e([h({readOnly:!0})],te.prototype,"measurementLabel",void 0),e([h()],te.prototype,"messages",void 0),e([h({constructOnly:!0})],te.prototype,"snappingManager",void 0),e([h()],te.prototype,"unit",void 0),e([h()],te.prototype,"updating",null),e([h({constructOnly:!0})],te.prototype,"view",void 0),te=e([d("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],te);export{te as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,ie as isSupported,ae as loadGeometryOperators};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import o from"./LegendElement.js";import{loadCalciteComponents as n}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as a}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let p=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return n({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[i.stacked]:this._hasIndicators};return l("div",{class:this.classes(i.base,s)},e||l("div",{class:i.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:i.carousel,label:this.messages.carousel},e.map((s,t)=>l("calcite-carousel-item",{class:i.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(i.service,i.groupLayer),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(o,{activeLayerInfo:e,effectList:e.effectList,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),r={[i.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(i.service,r),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},l("div",{class:i.serviceCaptionText},e.title)),l("div",{class:i.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(o,{activeLayerInfo:e,effectList:e.effectList,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],p.prototype,"activeLayerInfos",void 0),e([s()],p.prototype,"headingLevel",void 0),e([s()],p.prototype,"layout",void 0),e([s(),a("esri/widgets/Legend/t9n/Legend")],p.prototype,"messages",void 0),e([s(),a("esri/t9n/common")],p.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],p.prototype,"type",void 0),e([s()],p.prototype,"view",void 0),p=e([t("esri.widgets.Legend.styles.card.CardView")],p);export{p as default};
5
+ import{__decorate as e}from"tslib";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import o from"./LegendElement.js";import{loadCalciteComponents as n}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as a}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let p=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return n({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[i.stacked]:this._hasIndicators};return l("div",{class:this.classes(i.base,s)},e||l("div",{class:i.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:i.carousel,label:this.messages.carousel},e.map((s,t)=>l("calcite-carousel-item",{class:i.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(i.service,i.groupLayer),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map(s=>l(o,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),r={[i.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(i.service,r),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},l("div",{class:i.serviceCaptionText},e.title)),l("div",{class:i.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(o,{activeLayerInfo:e,cssEffectFilter:e.cssEffectFilter,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],p.prototype,"activeLayerInfos",void 0),e([s()],p.prototype,"headingLevel",void 0),e([s()],p.prototype,"layout",void 0),e([s(),a("esri/widgets/Legend/t9n/Legend")],p.prototype,"messages",void 0),e([s(),a("esri/t9n/common")],p.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],p.prototype,"type",void 0),e([s()],p.prototype,"view",void 0),p=e([t("esri.widgets.Legend.styles.card.CardView")],p);export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import{getCSSFilterFromEffectList as o}from"../../../../symbols/support/utils.js";import i from"../../../Widget.js";import{css as l}from"./css.js";import{getRampStopLabel as p}from"../support/utils.js";import"../../../support/widgetUtils.js";import{tsx as a}from"../../../support/jsxFactory.js";const n=25,m=25,d=100;let c=class extends i{constructor(e,t){super(e,t),this.effectList=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return a("div",{class:this.classes(l.layerRow,l.colorRampContainer)},this._renderRampLabel(e[0]),a("div",{class:l.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,i=e.length-1,l=m,p=i>2&&!r?n*i:d,c=p+20,h=10,y=[[{shape:{type:"path",path:`M0 ${l/2} L${h} 0 L${h} ${l} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:h,y:0,width:p,height:l},fill:{type:"linear",x1:h,y1:0,x2:p+h,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/i}))},stroke:{width:0}},{shape:{type:"path",path:`M${p+h} 0 L${c} ${l/2} L${p+h} ${l} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],f=s(y,c,l),u={filter:o(this.effectList)??void 0,opacity:null==t?void 0:`${t}`};return a("div",{styles:u},f)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?a("div",{class:l.intervalSeparatorsContainer},a("div",{class:l.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return a("div",{class:l.rampLabel},p(e,this.legendElement.type,this.messages))}};e([t()],c.prototype,"effectList",void 0),e([t()],c.prototype,"legendElement",void 0),e([t()],c.prototype,"messages",void 0),e([t()],c.prototype,"opacity",void 0),c=e([r("esri.widgets.Legend.styles.card.ColorRamp")],c);export{c as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{renderSVG as s}from"../../../../symbols/support/svgUtils.js";import o from"../../../Widget.js";import{css as i}from"./css.js";import{getRampStopLabel as l}from"../support/utils.js";import"../../../support/widgetUtils.js";import{tsx as p}from"../../../support/jsxFactory.js";const a=25,n=25,c=100;let d=class extends o{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const e=this.legendElement.infos.slice().reverse();return p("div",{class:this.classes(i.layerRow,i.colorRampContainer)},this._renderRampLabel(e[0]),p("div",{class:i.symbolContainer},this._renderPreview(e),this._renderMiddleStopRampLabel(e)),this._renderRampLabel(e.at(-1)))}_renderPreview(e){const{opacity:t}=this,r="heatmap-ramp"===this.legendElement.type,o=e.length-1,i=n,l=o>2&&!r?a*o:c,d=l+20,m=10,h=[[{shape:{type:"path",path:`M0 ${i/2} L${m} 0 L${m} ${i} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:m,y:0,width:l,height:i},fill:{type:"linear",x1:m,y1:0,x2:l+m,y2:0,colors:e.map((e,t)=>({color:e.color,offset:r&&"ratio"in e?e.ratio:t/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+m} 0 L${d} ${i/2} L${l+m} ${i} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],y=s(h,d,i),f={filter:this.cssEffectFilter??void 0,opacity:null==t?void 0:`${t}`};return p("div",{styles:f},y)}_renderMiddleStopRampLabel(e){const t=e.length%2!=0?e[e.length/2|0]:null;return t?p("div",{class:i.intervalSeparatorsContainer},p("div",{class:i.intervalSeparator},"|"),this._renderRampLabel(t)):null}_renderRampLabel(e){return p("div",{class:i.rampLabel},l(e,this.legendElement.type,this.messages))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([r("esri.widgets.Legend.styles.card.ColorRamp")],d);export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{getCSSFilterFromEffectList as r}from"../../../../symbols/support/utils.js";import a from"../../../Widget.js";import l from"./ColorRamp.js";import{css as o}from"./css.js";import n from"./SizeRamp.js";import c from"./UnivariateAboveAndBelowRamp.js";import p from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as h}from"../support/relationshipUtils.js";import{getLegendElementTitle as m}from"../support/utils.js";import{attachToNode as d,isImageryStretchedLegend as y,getTitle as g}from"../../support/styleUtils.js";import{Heading as f,incrementHeadingLevel as u}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{tsx as v}from"../../../support/jsxFactory.js";var b;let L=b=class extends a{constructor(e,s){super(e,s),this.effectList=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=m(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?v("div",null,v(f,{class:o.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),v(f,{class:o.layerCaption,level:u(this.headingLevel)},s)):s?v(f,{class:o.layerCaption,level:this.headingLevel},s):null;return v("section",{"aria-labelledby":this.key,class:o.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return v(n,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return v(l,{effectList:this.effectList,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return h(this.legendElement,this.id,{opacity:this.layer.opacity,effectList:this.effectList,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return v("div",{afterCreate:d,bind:this.legendElement.preview,class:o.pieChartRampPreview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return v(c,{effectList:this.effectList,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return v(p,{effectList:this.effectList,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[o.symbolRow],r={[o.labelContainer]:!i&&!t,[o.relationshipLabelContainer]:t};return v("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return v(b,{activeLayerInfo:this.activeLayerInfo,effectList:this.effectList,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const a=y(t,s),l=g(this.messages,i,!1)||"";if("src"in e&&e.src)return v("div",{class:o.layerRow,key:`${r}-row`},this._renderImage(e,t,a),v("div",{class:o.imageLabel},l));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return v("div",{afterCreate:d,bind:e.preview,key:`${r}-row`});const s={[o.symbolCell]:this.hasIndicators};return v("div",{class:this.classes(o.layerRow,{[o.symbolRow]:this.hasIndicators}),key:`${r}-row`},v("div",{afterCreate:d,bind:e.preview,class:this.classes(s)}),v("div",{class:this.classes(o.imageLabel,{[o.labelCell]:this.hasIndicators})},l))}return v("div",{class:o.layerRow,key:`${r}-row`},v("div",{class:o.labelElement,styles:this._getBackgroundStyles(e)},l))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,a=!!i?.a,l="outline"in t?t.outline:null,o=!!l?.color?.a,n=new s(a&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),c=o&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),p=e.symbol.color?.isBright??!0,h=p?"black":"white",m=p?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:a?n.toCss(!0):"none",color:h,textShadow:`-1px -1px 0 ${m},\n 1px -1px 0 ${m},\n -1px 1px 0 ${m},\n 1px 1px 0 ${m}`,border:o?`1px solid ${c.toCss(!0)}`:"none",filter:r(this.effectList)??void 0}}_renderImage(e,s,t){const{label:i,src:r,opacity:a}=e,l={[o.imageryLayerStretchedImage]:t,[o.symbol]:!t},n={opacity:`${a??s.opacity}`},c=g(this.messages,i,!1);return v("img",{alt:c,"aria-label":c,border:0,class:this.classes(l),height:e.height,src:r,styles:n,width:e.width})}};e([t()],L.prototype,"activeLayerInfo",void 0),e([t()],L.prototype,"effectList",void 0),e([t()],L.prototype,"hasIndicators",void 0),e([t()],L.prototype,"headingLevel",void 0),e([t()],L.prototype,"isChild",void 0),e([t()],L.prototype,"layer",void 0),e([t()],L.prototype,"legendElement",void 0),e([t()],L.prototype,"messages",void 0),L=b=e([i("esri.widgets.Legend.styles.card.LegendElement")],L);export{L as default};
5
+ import{__decorate as e}from"tslib";import s from"../../../../Color.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import l from"./ColorRamp.js";import{css as a}from"./css.js";import o from"./SizeRamp.js";import n from"./UnivariateAboveAndBelowRamp.js";import c from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as p}from"../support/relationshipUtils.js";import{getLegendElementTitle as h}from"../support/utils.js";import{attachToNode as m,isImageryStretchedLegend as d,getTitle as y}from"../../support/styleUtils.js";import{Heading as g,incrementHeadingLevel as f}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{tsx as u}from"../../../support/jsxFactory.js";var v;let b=v=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.hasIndicators=!1,this.headingLevel=3,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=h(this.legendElement,this.messages),t=this.hasIndicators&&!this.isChild?u("div",null,u(g,{class:a.carouselTitle,level:this.headingLevel},this.activeLayerInfo.title),u(g,{class:a.layerCaption,level:f(this.headingLevel)},s)):s?u(g,{class:a.layerCaption,level:this.headingLevel},s):null;return u("section",{"aria-labelledby":this.key,class:a.section,id:`${this.key}-panel`,key:this.key,role:"tabpanel",tabIndex:0},t,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return u(o,{hasIndicators:this.hasIndicators,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return u(l,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return p(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return u("div",{afterCreate:m,bind:this.legendElement.preview,class:a.pieChartRampPreview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return u(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return u(c,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);if(!s.length)return null;const t=this.activeLayerInfo.legendElements.some(({type:e})=>"relationship-ramp"===e),i=s[0]?.properties?.classes?.[a.symbolRow],r={[a.labelContainer]:!i&&!t,[a.relationshipLabelContainer]:t};return u("div",{class:this.classes(r)},s)}_renderElementInfo(e,s){const{layer:t}=this,i="label"in e?e.label:null,r=`${this.key}-${i}`;if("type"in e&&e.type)return u(v,{activeLayerInfo:this.activeLayerInfo,cssEffectFilter:this.cssEffectFilter,hasIndicators:this.hasIndicators,headingLevel:this.headingLevel,isChild:!0,key:r,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=d(t,s),o=y(this.messages,i,!1)||"";if("src"in e&&e.src)return u("div",{class:a.layerRow,key:`${r}-row`},this._renderImage(e,t,l),u("div",{class:a.imageLabel},o));if("symbol"in e&&e.preview){if(!e.symbol?.type.includes("simple-fill")){if(!e.label)return u("div",{afterCreate:m,bind:e.preview,key:`${r}-row`});const s={[a.symbolCell]:this.hasIndicators};return u("div",{class:this.classes(a.layerRow,{[a.symbolRow]:this.hasIndicators}),key:`${r}-row`},u("div",{afterCreate:m,bind:e.preview,class:this.classes(s)}),u("div",{class:this.classes(a.imageLabel,{[a.labelCell]:this.hasIndicators})},o))}return u("div",{class:a.layerRow,key:`${r}-row`},u("div",{class:a.labelElement,styles:this._getBackgroundStyles(e)},o))}return null}_getBackgroundStyles(e){const t=e.symbol,i=t.color,r=!!i?.a,l="outline"in t?t.outline:null,a=!!l?.color?.a,o=new s(r&&i?[i.r,i.g,i.b,i.a*this.layer.opacity]:[255,255,255,0]),n=a&&l.color?new s([l.color.r,l.color.g,l.color.b,l.color.a*this.layer.opacity]):new s([255,255,255,0]),c=e.symbol.color?.isBright??!0,p=c?"black":"white",h=c?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)";return{background:r?o.toCss(!0):"none",color:p,textShadow:`-1px -1px 0 ${h},\n 1px -1px 0 ${h},\n -1px 1px 0 ${h},\n 1px 1px 0 ${h}`,border:a?`1px solid ${n.toCss(!0)}`:"none",filter:this.cssEffectFilter??void 0}}_renderImage(e,s,t){const{label:i,src:r,opacity:l}=e,o={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},n={opacity:`${l??s.opacity}`},c=y(this.messages,i,!1);return u("img",{alt:c,"aria-label":c,border:0,class:this.classes(o),height:e.height,src:r,styles:n,width:e.width})}};e([t()],b.prototype,"activeLayerInfo",void 0),e([t()],b.prototype,"cssEffectFilter",void 0),e([t()],b.prototype,"hasIndicators",void 0),e([t()],b.prototype,"headingLevel",void 0),e([t()],b.prototype,"isChild",void 0),e([t()],b.prototype,"layer",void 0),e([t()],b.prototype,"legendElement",void 0),e([t()],b.prototype,"messages",void 0),b=v=e([i("esri.widgets.Legend.styles.card.LegendElement")],b);export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateAboveAndBelowRampElements as s,getUnivariateSizeRampSize as a,getUnivariateColorRampSize as l,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as m}from"../../support/styleUtils.js";import{isRTL as c}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";let f=class extends i{constructor(e,t){super(e,t),this.effectList=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,effectList:o,key:i}=this,{sizeRampElement:f,colorRampElement:y}=s(e,t,"horizontal");if(!f)return null;const h=a(f,"full",!0,"horizontal"),v=l(f,"above",!0,"horizontal"),u=l(f,"below",!0,"horizontal"),g=12,b=this.messages?.previewColorRampAriaLabel,w=p(y,{width:v,height:g,rampAlignment:"horizontal",opacity:t,type:"above",effectList:o,ariaLabel:b}),x=p(y,{width:u,height:g,rampAlignment:"horizontal",opacity:t,type:"below",effectList:o,ariaLabel:b}),j=n(f,"card"),L=f.infos.map(e=>e.label),z=L.length-1,C=L.map((e,t)=>0===t||t===z?d("div",{key:t},e):null),R={display:"flex",flexDirection:"column"},A={display:"flex",flexDirection:"row"},k={marginTop:"3px",display:"flex"};c(this.container)?k.marginRight=`${j}px`:k.marginLeft=`${j}px`;const E={width:`${h}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:r.layerRow,key:`${i}-container`,styles:R},d("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:A},f.infos.map((e,t)=>d("div",{afterCreate:m,bind:e.preview,class:r.symbol,key:t}))),w?d("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:k},d("div",{afterCreate:m,bind:w}),d("div",{afterCreate:m,bind:x})):null,d("div",{class:r.layerInfo},d("div",{class:r.rampLabelsContainer,styles:E},C)))}};e([t()],f.prototype,"effectList",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateAboveAndBelowRamp")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as s}from"./css.js";import{getUnivariateAboveAndBelowRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as d}from"../../../support/jsxFactory.js";let f=class extends r{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:r}=this,{sizeRampElement:f,colorRampElement:y}=i(e,t,"horizontal");if(!f)return null;const h=l(f,"full",!0,"horizontal"),v=a(f,"above",!0,"horizontal"),u=a(f,"below",!0,"horizontal"),g=12,b=this.messages?.previewColorRampAriaLabel,w=p(y,{width:v,height:g,rampAlignment:"horizontal",opacity:t,type:"above",cssEffectFilter:o,ariaLabel:b}),x=p(y,{width:u,height:g,rampAlignment:"horizontal",opacity:t,type:"below",cssEffectFilter:o,ariaLabel:b}),j=n(f,"card"),E=f.infos.map(e=>e.label),z=E.length-1,C=E.map((e,t)=>0===t||t===z?d("div",{key:t},e):null),R={display:"flex",flexDirection:"column"},L={display:"flex",flexDirection:"row"},A={marginTop:"3px",display:"flex"};m(this.container)?A.marginRight=`${j}px`:A.marginLeft=`${j}px`;const F={width:`${h}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return d("div",{class:s.layerRow,key:`${r}-container`,styles:R},d("div",{class:this.classes(s.symbolContainer,s.sizeRampHorizontal),styles:L},f.infos.map((e,t)=>d("div",{afterCreate:c,bind:e.preview,class:s.symbol,key:t}))),w?d("div",{class:s.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:A},d("div",{afterCreate:c,bind:w}),d("div",{afterCreate:c,bind:x})):null,d("div",{class:s.layerInfo},d("div",{class:s.rampLabelsContainer,styles:F},C)))}};e([t()],f.prototype,"cssEffectFilter",void 0),e([t()],f.prototype,"legendElement",void 0),e([t()],f.prototype,"messages",void 0),e([t()],f.prototype,"opacity",void 0),f=e([o("esri.widgets.Legend.styles.card.UnivariateAboveAndBelowRamp")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as m}from"../../support/styleUtils.js";import{isRTL as c}from"../../../support/widgetUtils.js";import{tsx as f}from"../../../support/jsxFactory.js";let d=class extends s{constructor(e,t){super(e,t),this.effectList=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,effectList:o,key:s}=this,{sizeRampElement:d,colorRampElement:y}=i(e,"horizontal");if(!d)return null;const u=l(d,"full",!1,"horizontal"),v=a(d,"full",!1,"horizontal"),g=p(y,{width:v,height:12,rampAlignment:"horizontal",opacity:t,type:"full",effectList:o,ariaLabel:this.messages?.previewColorRampAriaLabel}),h=n(d,"card"),x=d.infos.length-1,j=d.infos.map((e,t)=>0===t||t===x?f("div",{key:t},e.label):null),b={display:"flex",flexDirection:"column"},w={display:"flex",flexDirection:"row"},L={marginTop:"3px",display:"flex"};c(this.container)?L.marginRight=`${h}px`:L.marginLeft=`${h}px`;const C={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return f("div",{class:r.layerRow,key:`${s}-container`,styles:b},f("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:w},d.infos.map((e,t)=>f("div",{afterCreate:m,bind:e.preview,class:r.symbol,key:t}))),f("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:L},f("div",{afterCreate:m,bind:g})),f("div",{class:r.layerInfo},f("div",{class:r.rampLabelsContainer,styles:C},j)))}};e([t()],d.prototype,"effectList",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([o("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],d);export{d as default};
5
+ import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import s from"../../../Widget.js";import{css as r}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,getUnivariateColorRampMargin as n}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{isRTL as m}from"../../../support/widgetUtils.js";import{tsx as f}from"../../../support/jsxFactory.js";let d=class extends s{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:o,key:s}=this,{sizeRampElement:d,colorRampElement:y}=i(e,"horizontal");if(!d)return null;const u=l(d,"full",!1,"horizontal"),v=a(d,"full",!1,"horizontal"),g=p(y,{width:v,height:12,rampAlignment:"horizontal",opacity:t,type:"full",cssEffectFilter:o,ariaLabel:this.messages?.previewColorRampAriaLabel}),h=n(d,"card"),x=d.infos.length-1,j=d.infos.map((e,t)=>0===t||t===x?f("div",{key:t},e.label):null),b={display:"flex",flexDirection:"column"},w={display:"flex",flexDirection:"row"},C={marginTop:"3px",display:"flex"};m(this.container)?C.marginRight=`${h}px`:C.marginLeft=`${h}px`;const E={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return f("div",{class:r.layerRow,key:`${s}-container`,styles:b},f("div",{class:this.classes(r.symbolContainer,r.sizeRampHorizontal),styles:w},d.infos.map((e,t)=>f("div",{afterCreate:c,bind:e.preview,class:r.symbol,key:t}))),f("div",{class:r.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:C},f("div",{afterCreate:c,bind:g})),f("div",{class:r.layerInfo},f("div",{class:r.rampLabelsContainer,styles:E},j)))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([o("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],d);export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../Widget.js";import{css as o,legend as i}from"./css.js";import n from"./LegendElement.js";import{globalCss as l}from"../../../support/globalCss.js";import{Heading as a}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{messageBundle as c}from"../../../support/decorators/messageBundle.js";import{tsx as p}from"../../../support/jsxFactory.js";const d=`${i}__`;let m=class extends t{constructor(e,s){super(e,s),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,s=e?.toArray().map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?p("section",null,s):p("div",{class:o.message,key:"no-legend"},this.messages.noLegend)}_renderLegendForLayer(e,s){if(!e.ready)return null;const r=`${e.layer.uid}-version-${e.version}`,t=`${d}${s?`${s}-`:""}${r}`,i=e.title?a({level:this.headingLevel,class:this.classes(l.heading,o.label)},e.title):null;if(e.children.length){const s=e.children.toArray().map(e=>this._renderLegendForLayer(e,r));return p("section",{class:this.classes(o.service,o.groupLayer),key:t},i,s)}return this._renderLegendElementsForLayer(e,i,t)}_renderLegendElementsForLayer(e,s,r){const t=e.legendElements?.filter(Boolean);if(!t?.length)return null;const i=t.map(s=>p(n,{effectList:e.effectList,isChild:!1,key:`${r}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),l={[o.groupLayerChild]:!!e.parent};return p("section",{class:this.classes(o.service,l),key:r},s,p("div",{class:o.layer},i))}};e([s()],m.prototype,"activeLayerInfos",void 0),e([s()],m.prototype,"headingLevel",void 0),e([s(),c("esri/widgets/Legend/t9n/Legend")],m.prototype,"messages",void 0),e([s({readOnly:!0})],m.prototype,"type",void 0),m=e([r("esri.widgets.Legend.styles.classic.ClassicView")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../Widget.js";import{css as o,legend as i}from"./css.js";import n from"./LegendElement.js";import{globalCss as l}from"../../../support/globalCss.js";import{Heading as a}from"../../../support/Heading.js";import"../../../support/widgetUtils.js";import{messageBundle as c}from"../../../support/decorators/messageBundle.js";import{tsx as p}from"../../../support/jsxFactory.js";const d=`${i}__`;let m=class extends t{constructor(e,s){super(e,s),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,s=e?.toArray().map(e=>this._renderLegendForLayer(e)).filter(Boolean);return s?.length?p("section",null,s):p("div",{class:o.message,key:"no-legend"},this.messages.noLegend)}_renderLegendForLayer(e,s){if(!e.ready)return null;const r=`${e.layer.uid}-version-${e.version}`,t=`${d}${s?`${s}-`:""}${r}`,i=e.title?a({level:this.headingLevel,class:this.classes(l.heading,o.label)},e.title):null;if(e.children.length){const s=e.children.toArray().map(e=>this._renderLegendForLayer(e,r));return p("section",{class:this.classes(o.service,o.groupLayer),key:t},i,s)}return this._renderLegendElementsForLayer(e,i,t)}_renderLegendElementsForLayer(e,s,r){const t=e.legendElements?.filter(Boolean);if(!t?.length)return null;const i=t.map(s=>p(n,{cssEffectFilter:e.cssEffectFilter,isChild:!1,key:`${r}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages})),l={[o.groupLayerChild]:!!e.parent};return p("section",{class:this.classes(o.service,l),key:r},s,p("div",{class:o.layer},i))}};e([s()],m.prototype,"activeLayerInfos",void 0),e([s()],m.prototype,"headingLevel",void 0),e([s(),c("esri/widgets/Legend/t9n/Legend")],m.prototype,"messages",void 0),e([s({readOnly:!0})],m.prototype,"type",void 0),m=e([r("esri.widgets.Legend.styles.classic.ClassicView")],m);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import i from"./ColorRamp.js";import{css as a}from"./css.js";import l from"./SizeRamp.js";import o from"./UnivariateAboveAndBelowRamp.js";import n from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as m}from"../support/relationshipUtils.js";import{getLegendElementTitle as p}from"../support/utils.js";import{attachToNode as c,isImageryStretchedLegend as h,getTitle as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";var g;let f=g=class extends r{constructor(e,s){super(e,s),this.effectList=null,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=p(this.legendElement,this.messages),t=this.isChild?a.layerChildTable:a.layerTable,r=s?y("div",{class:a.layerCaption},s):null,i={[a.layerTableSizeRamp]:"size-ramp"===this.legendElement.type||!this.isChild};return y("section",{class:this.classes(t,i),key:`${this.key}-table`},r,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return y(l,{key:this.key,legendElement:this.legendElement,messages:this.messages});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return y(i,{key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return m(this.legendElement,this.id,{opacity:this.layer.opacity,effectList:this.effectList,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return y("div",{afterCreate:c,bind:this.legendElement.preview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return y(o,{effectList:this.effectList,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return y(n,{effectList:this.effectList,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);return s.length?y("div",{class:a.layerBody},s):null}_renderElementInfo(e,s){const{layer:t}=this,r="label"in e?e.label:null,i=`${this.key}-${r}`;if("type"in e&&e.type)return y(g,{effectList:this.effectList,isChild:!0,key:i,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const l=h(t,s),o={[a.imageryLayerInfoStretched]:l},n={[a.imageryLayerInfoStretched]:l};return y("div",{class:a.layerRow,key:`${i}-row`},y("div",{class:this.classes(a.symbolContainer,n)},this._renderPreview(e,l)),y("div",{class:this.classes(a.layerInfo,o)},d(this.messages,r,!1)||""))}_renderPreview(e,s){const{layer:t}=this;return"preview"in e&&e.preview?y("div",{afterCreate:c,bind:e.preview,class:a.symbol}):"src"in e&&e.src?this._renderImage(e,t,s):null}_renderImage(e,s,t){const{label:r,src:i,opacity:l}=e,o={[a.imageryLayerStretchedImage]:t,[a.symbol]:!t},n={opacity:`${l??s.opacity}`},m=d(this.messages,r,!1);return y("img",{alt:m,"aria-label":m,border:0,class:this.classes(o),height:e.height,src:i,styles:n,width:e.width})}};e([s()],f.prototype,"effectList",void 0),e([s()],f.prototype,"isChild",void 0),e([s()],f.prototype,"layer",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),f=g=e([t("esri.widgets.Legend.styles.classic.LegendElement")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import i from"./ColorRamp.js";import{css as l}from"./css.js";import a from"./SizeRamp.js";import o from"./UnivariateAboveAndBelowRamp.js";import n from"./UnivariateColorSizeRamp.js";import{renderRelationshipRamp as m}from"../support/relationshipUtils.js";import{getLegendElementTitle as c}from"../support/utils.js";import{attachToNode as p,isImageryStretchedLegend as h,getTitle as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";var g;let f=g=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.isChild=!1,this.legendElement=null}render(){const e=this._renderLegendElement(),s=c(this.legendElement,this.messages),t=this.isChild?l.layerChildTable:l.layerTable,r=s?y("div",{class:l.layerCaption},s):null,i={[l.layerTableSizeRamp]:"size-ramp"===this.legendElement.type||!this.isChild};return y("section",{class:this.classes(t,i),key:`${this.key}-table`},r,e)}_renderLegendElement(){switch(this.legendElement.type){case"symbol-table":return this._renderSymbolTable(this.legendElement);case"size-ramp":return y(a,{key:this.key,legendElement:this.legendElement,messages:this.messages});case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":return y(i,{key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"relationship-ramp":return m(this.legendElement,this.id,{opacity:this.layer.opacity,cssEffectFilter:this.cssEffectFilter,ariaLabel:this.messages.previewRelationshipRampAriaLabel,key:this.key});case"pie-chart-ramp":return y("div",{afterCreate:p,bind:this.legendElement.preview,key:`${this.key}-preview`});case"univariate-above-and-below-ramp":return y(o,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});case"univariate-color-size-ramp":return y(n,{cssEffectFilter:this.cssEffectFilter,key:this.key,legendElement:this.legendElement,messages:this.messages,opacity:this.layer.opacity});default:return null}}_renderSymbolTable(e){const s=e.infos.map(s=>this._renderElementInfo(s,e.legendType)).filter(Boolean);return s.length?y("div",{class:l.layerBody},s):null}_renderElementInfo(e,s){const{layer:t}=this,r="label"in e?e.label:null,i=`${this.key}-${r}`;if("type"in e&&e.type)return y(g,{cssEffectFilter:this.cssEffectFilter,isChild:!0,key:i,layer:t,legendElement:e,messages:this.messages});if(!("preview"in e&&e.preview||"src"in e&&e.src))return null;const a=h(t,s),o={[l.imageryLayerInfoStretched]:a},n={[l.imageryLayerInfoStretched]:a};return y("div",{class:l.layerRow,key:`${i}-row`},y("div",{class:this.classes(l.symbolContainer,n)},this._renderPreview(e,a)),y("div",{class:this.classes(l.layerInfo,o)},d(this.messages,r,!1)||""))}_renderPreview(e,s){const{layer:t}=this;return"preview"in e&&e.preview?y("div",{afterCreate:p,bind:e.preview,class:l.symbol}):"src"in e&&e.src?this._renderImage(e,t,s):null}_renderImage(e,s,t){const{label:r,src:i,opacity:a}=e,o={[l.imageryLayerStretchedImage]:t,[l.symbol]:!t},n={opacity:`${a??s.opacity}`},m=d(this.messages,r,!1);return y("img",{alt:m,"aria-label":m,border:0,class:this.classes(o),height:e.height,src:i,styles:n,width:e.width})}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"isChild",void 0),e([s()],f.prototype,"layer",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),f=g=e([t("esri.widgets.Legend.styles.classic.LegendElement")],f);export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import i from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateAboveAndBelowRampElements as r,getUnivariateColorRampSize as l,getUnivariateColorRampPreview as a,getUnivariateColorRampMargin as p,univariateColorRampContainerStyles as n,univariateColorRampStyles as m,univariateRampContainerStyles as c}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as v}from"../../../support/jsxFactory.js";let y=class extends i{constructor(e,t){super(e,t),this.effectList=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,effectList:s,key:i}=this,{sizeRampElement:y,colorRampElement:b}=r(e,t);if(!y)return null;const f=this.messages.previewColorRampAriaLabel,u=l(y,"above",!0),g=l(y,"below",!0),h=12,L=a(b,{width:h,height:u,rampAlignment:"vertical",opacity:t,type:"above",effectList:s,ariaLabel:f}),w=a(b,{width:h,height:g,rampAlignment:"vertical",opacity:t,type:"below",effectList:s,ariaLabel:f}),j=p(y),A=y.infos.map(e=>e.label),$=A.map((e,t)=>{const s=2===t;return 0===t?v("div",{class:e?L?o.univariateAboveAndBelowLabel:o.rampLabel:void 0,key:`${i}-color-ramp-above-label-${e??t}`},e):s?v("div",null):null}),C=A.length-1,R=Math.floor(A.length/2),x=A.map((e,t)=>t===R||t===C?v("div",{class:e?L?o.univariateAboveAndBelowLabel:o.rampLabel:void 0,key:`${i}-color-ramp-below-label-${e??t}`},e):null),k={display:"table-cell",verticalAlign:"middle"},E={marginTop:`${j}px`},B={height:`${u}px`},U={height:`${g}px`};return v("div",{key:`${i}-container`,styles:c},v("div",{class:o.layerBody},y.infos.map((e,t)=>v("div",{class:this.classes(o.layerRow,o.sizeRamp),key:`${i}-row-${t}`},v("div",{afterCreate:d,bind:e.preview,class:o.symbol,styles:k}),L||t%2!=0?null:v("div",{class:o.layerInfo},A[t])))),L?v("div",{styles:E},v("div",{styles:n},v("div",{styles:m},v("div",{afterCreate:d,bind:L,class:o.rampContainer})),v("div",{styles:m},v("div",{class:o.rampLabelsContainer,styles:B},$))),v("div",{styles:n},v("div",{styles:m},v("div",{afterCreate:d,bind:w,class:o.rampContainer})),v("div",{styles:m},v("div",{class:o.rampLabelsContainer,styles:U},x)))):null)}};e([t()],y.prototype,"effectList",void 0),e([t()],y.prototype,"legendElement",void 0),e([t()],y.prototype,"messages",void 0),e([t()],y.prototype,"opacity",void 0),y=e([s("esri.widgets.Legend.styles.classic.UnivariateAboveAndBelowRamp")],y);export{y as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as l}from"./css.js";import{getUnivariateAboveAndBelowRampElements as i,getUnivariateColorRampSize as o,getUnivariateColorRampPreview as a,getUnivariateColorRampMargin as p,univariateColorRampContainerStyles as n,univariateColorRampStyles as c,univariateRampContainerStyles as m}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as v}from"../../../support/jsxFactory.js";let y=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:y,colorRampElement:b}=i(e,s);if(!y)return null;const f=this.messages.previewColorRampAriaLabel,u=o(y,"above",!0),g=o(y,"below",!0),h=12,w=a(b,{width:h,height:u,rampAlignment:"vertical",opacity:s,type:"above",cssEffectFilter:t,ariaLabel:f}),j=a(b,{width:h,height:g,rampAlignment:"vertical",opacity:s,type:"below",cssEffectFilter:t,ariaLabel:f}),L=p(y),A=y.infos.map(e=>e.label),E=A.map((e,s)=>{const t=2===s;return 0===s?v("div",{class:e?w?l.univariateAboveAndBelowLabel:l.rampLabel:void 0,key:`${r}-color-ramp-above-label-${e??s}`},e):t?v("div",null):null}),$=A.length-1,C=Math.floor(A.length/2),R=A.map((e,s)=>s===C||s===$?v("div",{class:e?w?l.univariateAboveAndBelowLabel:l.rampLabel:void 0,key:`${r}-color-ramp-below-label-${e??s}`},e):null),x={display:"table-cell",verticalAlign:"middle"},F={marginTop:`${L}px`},k={height:`${u}px`},B={height:`${g}px`};return v("div",{key:`${r}-container`,styles:m},v("div",{class:l.layerBody},y.infos.map((e,s)=>v("div",{class:this.classes(l.layerRow,l.sizeRamp),key:`${r}-row-${s}`},v("div",{afterCreate:d,bind:e.preview,class:l.symbol,styles:x}),w||s%2!=0?null:v("div",{class:l.layerInfo},A[s])))),w?v("div",{styles:F},v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:w,class:l.rampContainer})),v("div",{styles:c},v("div",{class:l.rampLabelsContainer,styles:k},E))),v("div",{styles:n},v("div",{styles:c},v("div",{afterCreate:d,bind:j,class:l.rampContainer})),v("div",{styles:c},v("div",{class:l.rampLabelsContainer,styles:B},R)))):null)}};e([s()],y.prototype,"cssEffectFilter",void 0),e([s()],y.prototype,"legendElement",void 0),e([s()],y.prototype,"messages",void 0),e([s()],y.prototype,"opacity",void 0),y=e([t("esri.widgets.Legend.styles.classic.UnivariateAboveAndBelowRamp")],y);export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateColorRampMargin as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as m,univariateColorRampStyles as c,univariateRampContainerStyles as n}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";let f=class extends r{constructor(e,s){super(e,s),this.effectList=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,effectList:t,key:r}=this,{sizeRampElement:f,colorRampElement:v}=i(e);if(!f)return null;const u=l(f),g=12,b=a(f,"full",!1),h=p(v,{width:g,height:b,rampAlignment:"vertical",opacity:s,type:"full",effectList:t,ariaLabel:this.messages?.previewColorRampAriaLabel}),j=f.infos.length-1,L=f.infos.map((e,s)=>0===s||s===j?y("div",{class:e.label?v?o.univariateAboveAndBelowLabel:o.rampLabel:void 0,key:`${r}-color-ramp-label-${e.label??s}`},e.label):null),w={display:"table-cell",verticalAlign:"middle"},C={marginTop:`${u}px`},R={height:`${b}px`};return y("div",{key:`${r}-container`,styles:n},y("div",{class:o.layerBody},f.infos.map((e,s)=>y("div",{class:this.classes(o.layerRow,o.sizeRamp),key:`${r}-row-${s}`},y("div",{afterCreate:d,bind:e.preview,class:o.symbol,styles:w})))),y("div",{styles:C},y("div",{styles:m},y("div",{styles:c},y("div",{afterCreate:d,bind:h,class:o.rampContainer})),y("div",{styles:c},y("div",{class:o.rampLabelsContainer,styles:R},L)))))}};e([s()],f.prototype,"effectList",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),e([s()],f.prototype,"opacity",void 0),f=e([t("esri.widgets.Legend.styles.classic.UnivariateColorSizeRamp")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateColorSizeRampElements as i,getUnivariateColorRampMargin as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as p,univariateColorRampContainerStyles as c,univariateColorRampStyles as m,univariateRampContainerStyles as n}from"../support/univariateUtils.js";import{attachToNode as d}from"../../support/styleUtils.js";import"../../../support/widgetUtils.js";import{tsx as y}from"../../../support/jsxFactory.js";let f=class extends r{constructor(e,s){super(e,s),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:s,cssEffectFilter:t,key:r}=this,{sizeRampElement:f,colorRampElement:v}=i(e);if(!f)return null;const u=l(f),g=12,b=a(f,"full",!1),h=p(v,{width:g,height:b,rampAlignment:"vertical",opacity:s,type:"full",cssEffectFilter:t,ariaLabel:this.messages?.previewColorRampAriaLabel}),j=f.infos.length-1,E=f.infos.map((e,s)=>0===s||s===j?y("div",{class:e.label?v?o.univariateAboveAndBelowLabel:o.rampLabel:void 0,key:`${r}-color-ramp-label-${e.label??s}`},e.label):null),w={display:"table-cell",verticalAlign:"middle"},L={marginTop:`${u}px`},C={height:`${b}px`};return y("div",{key:`${r}-container`,styles:n},y("div",{class:o.layerBody},f.infos.map((e,s)=>y("div",{class:this.classes(o.layerRow,o.sizeRamp),key:`${r}-row-${s}`},y("div",{afterCreate:d,bind:e.preview,class:o.symbol,styles:w})))),y("div",{styles:L},y("div",{styles:c},y("div",{styles:m},y("div",{afterCreate:d,bind:h,class:o.rampContainer})),y("div",{styles:m},y("div",{class:o.rampLabelsContainer,styles:C},E)))))}};e([s()],f.prototype,"cssEffectFilter",void 0),e([s()],f.prototype,"legendElement",void 0),e([s()],f.prototype,"messages",void 0),e([s()],f.prototype,"opacity",void 0),f=e([t("esri.widgets.Legend.styles.classic.UnivariateColorSizeRamp")],f);export{f as default};