@arcgis/core 4.34.0-next.69 → 4.34.0-next.70

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 (324) hide show
  1. package/applications/Components/QuantityFormatter.js +1 -1
  2. package/applications/Components/analysisUtils.js +1 -1
  3. package/applications/MapViewer/mediaUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{e2486bf5546443408c85.js → 0618ea8bf9da93d713b1.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0b69d251961d8b46fe30.js +1 -0
  7. package/assets/esri/core/workers/chunks/{adfb018f510e19a520fb.js → 0f37204f86d2997a2811.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{e0fe6bb51ecc9b2faf69.js → 16cfbe7bedf75d3a86e5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{4f0f6653b8e92c633d14.js → 181b3564a0e3939020bc.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{aff553c3d6544e20f188.js → 28a2f74d4a449386d082.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{5185c63fecc5f493e142.js → 3bf99037befdedd75cb4.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{8e2558b14be70b273ce4.js → 43095bed5456251940b9.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4a5092e27e6f294ea888.js +1 -0
  14. package/assets/esri/core/workers/chunks/4d33eec23ad6dbd6a0f0.js +1 -0
  15. package/assets/esri/core/workers/chunks/52286d4135b8395a3400.js +1 -0
  16. package/assets/esri/core/workers/chunks/{66cb5b294d7f251c2cc8.js → 540506802776f77e47f3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7e95896ac41c7e2ca26a.js → 56f54d007b0da0d908aa.js} +1 -1
  18. package/assets/esri/core/workers/chunks/5879cebb22157b0b4998.js +1 -0
  19. package/assets/esri/core/workers/chunks/{4102ed32b8dbdc32cb3b.js → 5c4ba165816809e06340.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{aa970a547c60c43d6c7f.js → 61896e64e9ef49b4bb1b.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{82cb5defb0593e3017ff.js → 6391ce002fbde9f27a77.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{a895da7fd64ebad3d5a4.js → 6dc62c170e9583222df2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/72bde3290ad2e1a11d9b.js +2 -0
  24. package/assets/esri/core/workers/chunks/{48316d91c06928f69f61.js → 78b33c6d73824085c6d1.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{b482132638f3b351724c.js → 7aaa6b318195d7342e6c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/810e4c16c6eae420508b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{837830e1cf712d4243a5.js → 83589cfcc443b925c1aa.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{26b791291689434dde09.js → 8b587affaaa0b1e4368c.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d1b361b8adf1c719a10a.js → 925ad2665c2fe0f47cc3.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{5b84eba4a28e25b6d5c0.js → 9421389888d4d9e4e809.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{80b0c88a76bd523a406a.js → 96740c75ad65d651cc43.js} +1 -1
  32. package/assets/esri/core/workers/chunks/98c94a99e2e04d5ae65f.js +1 -0
  33. package/assets/esri/core/workers/chunks/{ab727ed4417b7dd94ce9.js → 9c00c2263e52ad51c2a2.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{f054557e23978e174686.js → a2baeb9fa805c3537049.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{18c7b1e1fbf7eb6c3c33.js → a33e1a031ba9f028023d.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5c053d197935c65792ce.js → b03dcbc31bccb9fdf9fe.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{e4e224983c3ee24fc51d.js → b7f5a26ff3a73c64552d.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bc5fa33afec5354601a1.js → b818b5e392d5eb7c7e70.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{efea3e82cec476d486e0.js → bce41b41431a7daed33c.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{b052d3ef5493eedb44a5.js → c07507a42def2bd2a222.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{b335e96f6bcac6d2f0ee.js → c427516421edf56e7776.js} +1 -1
  42. package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +1 -0
  43. package/assets/esri/core/workers/chunks/{097a5c333de28ec5e16f.js → cd58b40a8105be758c0e.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ce1f4508487298ab57b6.js +1 -0
  45. package/assets/esri/core/workers/chunks/{144bfd64daf103a06734.js → ce8f56cf371812b57a46.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{0c4f07eb3f3dd5cd2c6c.js → d1711256493d55eca523.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{489fa17e60f25d5f33ae.js → d44f3ee27e142e0c3030.js} +1 -1
  48. package/assets/esri/core/workers/chunks/d682dd49bb9ee7f48f93.js +1 -0
  49. package/assets/esri/core/workers/chunks/{6a5b5b80917a5375b9f6.js → e2384a1079a4722c41dd.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{fe353a53968827bcd9cc.js → e3ad0a390387c5847aca.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{87fb5d755860057da164.js → e8e0f73fb94e63e2abc3.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f8adac87e48ea86bec21.js → eb0a5d592f5805836203.js} +1 -1
  53. package/assets/esri/core/workers/chunks/f3ef59991c577ff5e825.js +1 -0
  54. package/assets/esri/core/workers/chunks/{ed1272e7681e561d843f.js → f51c1420c9243d550c9d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/f749e2a89a14ab89ae59.js +1 -0
  56. package/assets/esri/core/workers/chunks/f7e9cbd54154341bd2de.js +1 -0
  57. package/assets/esri/core/workers/chunks/{09dbb3e200ef8d514eb3.js → f87a6b32292c1464b7b7.js} +2 -2
  58. package/assets/esri/core/workers/chunks/{a2963ffc9a8c90822d2d.js → fdf2b980e8a8aa47ce91.js} +1 -1
  59. package/chunks/Theme.js +1 -1
  60. package/chunks/chartUtilsAm5.js +1 -1
  61. package/config.js +1 -1
  62. package/core/arrayUtils.js +1 -1
  63. package/editing/templateUtils.js +1 -1
  64. package/identity/IdentityModal.js +1 -1
  65. package/interfaces.d.ts +39 -19
  66. package/kernel.js +1 -1
  67. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  68. package/layers/support/GaussianSplatAtlasPageAllocator.js +1 -1
  69. package/package.json +3 -2
  70. package/support/actions/actionUtils.js +1 -1
  71. package/support/modeUtils.js +1 -1
  72. package/support/popupUtils.js +1 -1
  73. package/support/revision.js +1 -1
  74. package/symbols/cim/cimAnalyzer.js +1 -1
  75. package/symbols/cim/defaultCIMValues.js +1 -1
  76. package/symbols/cim/enums.js +5 -0
  77. package/symbols/support/svgUtils.js +1 -1
  78. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  79. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientSizeHelper.js +1 -1
  80. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  81. package/views/2d/interactive/editingTools.js +1 -1
  82. package/views/2d/layers/MediaLayerView2D.js +1 -1
  83. package/views/2d/layers/TileLayerView2D.js +1 -1
  84. package/views/3d/layers/FlowSubView3D.js +1 -1
  85. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  86. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  87. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  88. package/views/3d/layers/TiledLayerView3D.js +1 -1
  89. package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
  90. package/views/3d/layers/support/TerrainTileTree3DDebugger.js +1 -1
  91. package/views/3d/state/ViewStateManager.js +1 -1
  92. package/views/3d/support/CombinedElevationProvider.js +1 -1
  93. package/views/3d/terrain/TerrainSurface.js +1 -1
  94. package/views/3d/terrain/TileAgent.js +1 -1
  95. package/views/3d/terrain/tileUtils.js +1 -1
  96. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  97. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  98. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  99. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  100. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  101. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  102. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  103. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  104. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  105. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  106. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  107. package/views/GroundView.js +1 -1
  108. package/views/SceneView.js +1 -1
  109. package/views/ToolViewManager.js +1 -1
  110. package/views/VideoView.js +1 -1
  111. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  112. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  113. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  114. package/views/interactive/tooltip/components/TooltipField.js +1 -1
  115. package/views/interactive/tooltip/components/ValueByValue.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  117. package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
  118. package/views/interactive/tooltip/content/TooltipContentDrawMesh.js +1 -1
  119. package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
  120. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  121. package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
  122. package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
  123. package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
  124. package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
  125. package/views/interactive/tooltip/content/TooltipContentMovePoint.js +1 -1
  126. package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
  127. package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
  128. package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
  129. package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
  130. package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
  131. package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
  132. package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
  133. package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
  134. package/views/overlay/BoxOverlayItem.js +1 -1
  135. package/views/overlay/CrosshairOverlayItem.js +1 -1
  136. package/views/overlay/OutlineOverlayItem.js +1 -1
  137. package/views/support/GroundViewElevationSampler.js +1 -1
  138. package/widgets/AreaMeasurement2D.js +1 -1
  139. package/widgets/AreaMeasurement3D.js +1 -1
  140. package/widgets/Attachments.js +1 -1
  141. package/widgets/Attribution.js +1 -1
  142. package/widgets/BasemapGallery.js +1 -1
  143. package/widgets/BasemapLayerList.js +1 -1
  144. package/widgets/BasemapToggle.js +1 -1
  145. package/widgets/BatchAttributeForm.js +1 -1
  146. package/widgets/Bookmarks.js +1 -1
  147. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  148. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  149. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  150. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  151. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  152. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  153. package/widgets/BuildingExplorer.js +1 -1
  154. package/widgets/CatalogLayerList.js +1 -1
  155. package/widgets/Compass.js +1 -1
  156. package/widgets/CoordinateConversion.js +1 -1
  157. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  158. package/widgets/Daylight.js +1 -1
  159. package/widgets/DirectLineMeasurement3D.js +1 -1
  160. package/widgets/DirectionalPad.js +1 -1
  161. package/widgets/Directions.js +1 -1
  162. package/widgets/DistanceMeasurement2D.js +1 -1
  163. package/widgets/Editor/EditorViewModel.js +1 -1
  164. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  165. package/widgets/Editor/components/FeatureList.js +1 -1
  166. package/widgets/Editor/components/FooterActions.js +1 -1
  167. package/widgets/Editor/components/Notices.js +1 -1
  168. package/widgets/Editor/components/PanelContent.js +1 -1
  169. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  170. package/widgets/Editor/components/Prompt.js +1 -1
  171. package/widgets/Editor/components/Settings.js +1 -1
  172. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  173. package/widgets/Editor/components/UploadDetails.js +1 -1
  174. package/widgets/Editor.js +1 -1
  175. package/widgets/ElevationProfile/components/Legend.js +1 -1
  176. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  177. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  178. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  179. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  180. package/widgets/ElevationProfile.js +1 -1
  181. package/widgets/Feature/FeatureAttachments.js +1 -1
  182. package/widgets/Feature/FeatureExpression.js +1 -1
  183. package/widgets/Feature/FeatureFields.js +1 -1
  184. package/widgets/Feature/FeatureMedia.js +1 -1
  185. package/widgets/Feature/FeatureRelationship.js +1 -1
  186. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  187. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  188. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  189. package/widgets/Feature.js +1 -1
  190. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/AssociationDetails.js +1 -1
  191. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  192. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  193. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  194. package/widgets/FeatureForm.js +1 -1
  195. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  196. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  197. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  198. package/widgets/FeatureTable.js +1 -1
  199. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  200. package/widgets/FeatureTemplates.js +1 -1
  201. package/widgets/Features/FeaturesDrillIn.js +1 -1
  202. package/widgets/Features.js +1 -1
  203. package/widgets/FloorFilter.js +1 -1
  204. package/widgets/FovOverlay.js +1 -1
  205. package/widgets/Fullscreen.js +1 -1
  206. package/widgets/Histogram.js +1 -1
  207. package/widgets/HistogramRangeSlider.js +1 -1
  208. package/widgets/Home.js +1 -1
  209. package/widgets/LayerList/LayerListItem.js +1 -1
  210. package/widgets/LayerList.js +1 -1
  211. package/widgets/Legend/styles/card/CardView.js +1 -1
  212. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  213. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  214. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  215. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  216. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  217. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  218. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  219. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  220. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  221. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  222. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  223. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  224. package/widgets/Legend/styles/support/sizeRampUtils.js +1 -1
  225. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  226. package/widgets/Legend.js +1 -1
  227. package/widgets/LineOfSight.js +1 -1
  228. package/widgets/Locate.js +1 -1
  229. package/widgets/Measurement.js +1 -1
  230. package/widgets/NavigationToggle.js +1 -1
  231. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  232. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  233. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  234. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  235. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  236. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  237. package/widgets/OrientedImageryViewer.js +1 -1
  238. package/widgets/PanoramicViewer.js +1 -1
  239. package/widgets/Popup.js +1 -1
  240. package/widgets/Print.js +1 -1
  241. package/widgets/ScaleBar.js +1 -1
  242. package/widgets/ScaleRangeSlider.js +1 -1
  243. package/widgets/Search/SearchResultRenderer.js +1 -1
  244. package/widgets/Search.js +1 -1
  245. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  246. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  247. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  248. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  249. package/widgets/ShadowCast.js +1 -1
  250. package/widgets/Sketch/support/ResponsiveToolbar/MeasuredContentGroup.js +1 -1
  251. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  252. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  253. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  254. package/widgets/Sketch.js +1 -1
  255. package/widgets/Slice.js +1 -1
  256. package/widgets/Slider.js +1 -1
  257. package/widgets/Spinner.js +1 -1
  258. package/widgets/Swipe.js +1 -1
  259. package/widgets/TableList.js +1 -1
  260. package/widgets/TimeSlider.js +1 -1
  261. package/widgets/TimeZoneLabel.js +1 -1
  262. package/widgets/Track.js +1 -1
  263. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  264. package/widgets/UtilityNetworkAssociations.js +1 -1
  265. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  266. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  267. package/widgets/UtilityNetworkTrace.js +1 -1
  268. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  269. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  270. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  271. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  272. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  273. package/widgets/ValuePicker.js +1 -1
  274. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  275. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  276. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  277. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  278. package/widgets/VideoPlayer.js +1 -1
  279. package/widgets/Weather/LabeledSlider.js +1 -1
  280. package/widgets/Weather.js +1 -1
  281. package/widgets/Widget.js +1 -1
  282. package/widgets/Zoom.js +1 -1
  283. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  284. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  285. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  286. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  287. package/widgets/smartMapping/ColorSlider.js +1 -1
  288. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  289. package/widgets/smartMapping/OpacitySlider.js +1 -1
  290. package/widgets/smartMapping/SizeSlider.js +1 -1
  291. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  292. package/widgets/support/ColorPicker.js +1 -1
  293. package/widgets/support/FilterBuilder.js +1 -1
  294. package/widgets/support/FilterCondition.js +1 -1
  295. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  296. package/widgets/support/GridControls.js +1 -1
  297. package/widgets/support/Heading.js +1 -1
  298. package/widgets/support/ItemList.js +1 -1
  299. package/widgets/support/LabeledSwitch.js +1 -1
  300. package/widgets/support/MeasurementWidgetContent.js +1 -1
  301. package/widgets/support/SelectionList.js +1 -1
  302. package/widgets/support/SelectionToolbar.js +1 -1
  303. package/widgets/support/SketchTooltipControls.js +1 -1
  304. package/widgets/support/SnappingControls.js +1 -1
  305. package/widgets/support/TimezonePicker.js +1 -1
  306. package/widgets/support/UnitSelect.js +1 -1
  307. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  308. package/widgets/support/widget.js +1 -1
  309. package/assets/esri/core/workers/chunks/12d30c2367652e2c688b.js +0 -1
  310. package/assets/esri/core/workers/chunks/170ec7fb070c63230c81.js +0 -1
  311. package/assets/esri/core/workers/chunks/3386420c9ae891db5be7.js +0 -2
  312. package/assets/esri/core/workers/chunks/3cef77453623bbb37ad2.js +0 -1
  313. package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +0 -1
  314. package/assets/esri/core/workers/chunks/570b17a1a4ab405bbdcb.js +0 -1
  315. package/assets/esri/core/workers/chunks/6433116597021a9af680.js +0 -1
  316. package/assets/esri/core/workers/chunks/7944c18b270c85ff2e41.js +0 -1
  317. package/assets/esri/core/workers/chunks/81e518dd62bd95611d00.js +0 -1
  318. package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +0 -1
  319. package/assets/esri/core/workers/chunks/a6f66492651646c18f10.js +0 -1
  320. package/assets/esri/core/workers/chunks/bd7e303dd64a27ba6846.js +0 -1
  321. package/assets/esri/core/workers/chunks/e956d437c0c2ea81db93.js +0 -1
  322. package/assets/esri/core/workers/chunks/f1865b28f0f75cadd716.js +0 -1
  323. package/layers/GroundLayer.js +0 -5
  324. /package/assets/esri/core/workers/chunks/{3386420c9ae891db5be7.js.LICENSE.txt → 72bde3290ad2e1a11d9b.js.LICENSE.txt} +0 -0
@@ -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{R as t,D as i}from"../../../chunks/ResponsiveTheme.js";import"../../../intl.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{signal as s}from"../../../core/signal.js";import{unitName as a,formatDecimal as l}from"../../../core/unitFormatUtils.js";import{convertUnit as r}from"../../../core/unitUtils.js";import{getEpsilon as d}from"../../../core/libs/gl-matrix-2/math/common.js";import{getConfig as c,notAvailable as p}from"./constants.js";import{getTranslatedLineTitle as m}from"./intlUtils.js";import{niceScale as u}from"./niceScale.js";import{binaryFindClosest as f}from"./profileUtils.js";import{c as x,N as g}from"../../../chunks/chartUtilsAm5.js";import{isRTL as h}from"../../support/widgetUtils.js";import{isDarkMode as A}from"../../../support/modeUtils.js";import{X as v,V as b,A as y,b as T,a as L,L as M}from"../../../chunks/LineSeries.js";import{b as S,d as F,a as P,C as k}from"../../../chunks/Theme.js";import{T as X}from"../../../chunks/Tooltip.js";import{formatNumber as Y}from"../../../intl/number.js";import{substitute as z}from"../../../intl/substitute.js";const C="#f8f8f8",j="#a9a9a9",w="#323232",H="line",B="fill",U=15,D=12,R=.001,O=.1,W=.02,G={fontFamily:"Avenir Next",paddingBottom:D/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:j,axisTooltipFontSize:12,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,axisTooltipPaddingTop:Math.round(D/4),axisTooltipPaddingBottom:Math.round(D/4),axisTooltipPaddingHorizontal:Math.round(U/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(D/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(U/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:C,seriesTooltipLabelColor:w,seriesFillLighten:.9,seriesTooltipSpacing:D/2,seriesTooltipPaddingVertical:Math.round(U/4),seriesTooltipPaddingHorizontal:Math.round(U/4)},V={...G,axisGridStroke:w,axisLabelsColor:j,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,seriesTooltipBackgroundColor:w,seriesTooltipLabelColor:C,seriesFillLighten:-.75},E={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function I(o){const a=await x(o.container);n(o.abortOptions);const l=A(),r=l?V:G;a.setThemes(l?[t.new(a),i.new(a)]:[t.new(a)]);const d=h(o.container),c=a.container.children.push(v.new(a,{panX:!0,panY:!0,paddingTop:r.paddingTop,paddingBottom:r.paddingBottom,paddingLeft:d?r.paddingRight:r.paddingLeft,paddingRight:d?r.paddingLeft:r.paddingRight,maxTooltipDistance:-1}));c.zoomOutButton.set("forceHidden",!0);const p=c.xAxes.push(b.new(a,{renderer:y.new(a,{})})),m=c.yAxes.push(b.new(a,{renderer:T.new(a,{})})),u=s(null),f=s("loading"),g={chart:c,xAxis:p,yAxis:m,seriesInfos:new Map,messages:null,theme:r,pointerIsOver:!1,rtl:d,get state(){return f.value},get data(){return u.value},set data(t){u.value=t}};Z(g),q(g),N(g);const L=e([lt(g,o.onRangeChange),dt(g,o.onCursorPositionChange),yt(a.events.once("frameended",()=>{f.value="ready"})),yt(a)]);let M;return{destroy:()=>{L.remove(),f.value="destroyed"},update:t=>{t.data===g.data&&t.messages===g.messages||$(g)||J(g,t)},zoomOut:()=>K(g),test:M}}function $(t){return"destroyed"===t.state}function N({chart:t,xAxis:i,yAxis:e}){const o=L.new(t.root,{behavior:"none",xAxis:i,yAxis:e,snapToSeriesBy:"y"});o.lineY.set("visible",!1),t.set("cursor",o)}function Z(t){const{chart:i,xAxis:e,theme:o}=t;e.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),e.axisHeader.set("forceHidden",!0);const n=e.get("renderer");n.setAll({inside:!1,minGridDistance:o.xAxisMinGridDistance}),n.labels.template.setAll({centerX:F,centerY:F,fill:S(o.axisLabelsColor),fontFamily:o.fontFamily,fontSize:o.axisLabelsFontSize,fontWeight:o.axisLabelsFontWeight,maxPosition:o.xAxisMaxLabelPosition,minPosition:o.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:o.xAxisLabelsSpacing});const s=e.set("tooltip",X.new(i.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));s.get("background")?.setAll({fill:S(o.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:S(o.axisTooltipLabelColor),fontFamily:o.fontFamily,fontSize:o.axisTooltipFontSize,paddingBottom:o.axisTooltipPaddingBottom,paddingLeft:o.axisTooltipPaddingHorizontal,paddingRight:o.axisTooltipPaddingHorizontal,paddingTop:o.axisTooltipPaddingTop,direction:t.rtl?"rtl":"ltr"}),n.grid.template.setAll({strokeOpacity:1,stroke:S(o.axisGridStroke)})}function q(t){const{yAxis:i,theme:e,rtl:o}=t;i.setAll({baseValue:c().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),i.axisHeader.set("visible",!1);const n=i.get("renderer");n.setAll({minGridDistance:e.yAxisMinGridDistance,opposite:o,inside:!0}),n.labels.template.setAll({centerX:F,centerY:P,fill:S(e.axisLabelsColor),fontFamily:e.fontFamily,fontSize:e.axisLabelsFontSize,fontWeight:e.axisLabelsFontWeight,maxPosition:e.yAxisMaxLabelPosition,minPosition:e.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:o?0:e.yAxisLabelSpacing,paddingRight:o?e.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),n.grid.template.setAll({strokeOpacity:1,stroke:S(e.axisGridStroke)})}function J(t,i){if($(t))return;const e=t.data??void 0,o=i.data??void 0;t.chart.get("cursor")?.set("forceHidden",!o?.refined);const n=e!==o,s=e?.effectiveUnits!==o?.effectiveUnits,a=e?.uniformScaling!==o?.uniformScaling;t.data=o,t.messages=i.messages,(n||s)&&(Q(t),et(t)),a&&K(t),pt(t)}function K(t){$(t)||(t.xAxis.zoom(0,1),t.yAxis.zoom(0,1))}function Q(t){const{chart:i,data:e,xAxis:o,yAxis:n}=t,{minX:s,maxX:a,minY:l,maxY:r}=_({data:e,pixelWidth:o.width(),pixelHeight:n.height()}),d=!!e?.uniformScaling,c=!!e?.refined;i.setAll({panX:!0,panY:d,pinchZoomX:c,pinchZoomY:c&&d,wheelX:"panX",wheelY:c?d?"zoomXY":"zoomX":"none"}),o.setAll({max:a,min:s,panX:!0,panY:!1,zoomX:!0,zoomY:d}),n.setAll({max:r,min:l,panX:!1,panY:d,zoomX:d,zoomY:d})}function _({data:t,pixelWidth:i,pixelHeight:e}){if(null==t)return E;const o=t.statistics,n=0,s=o?.maxDistance;let a=o?.minElevation,l=o?.maxElevation;if(null==s||null==a||null==l)return E;const d=Math.max(s-n,R);let p=Math.max(l-a,R);const m=t.effectiveUnits;if(t.dynamicElevationRange){const t=r(d,m.distance,m.elevation);p=Math.max(p,t/c().maxChartRatio)}return a-=W*p,l=a+p+O*p,[a,l]=u(a,l,10),p=l-a,t.uniformScaling?tt({data:t,bounds:{minX:n,maxX:s,minY:a,maxY:l},pixelWidth:i,pixelHeight:e,centered:!0}):{minX:n,maxX:n+d,minY:a,maxY:a+p}}function tt({data:t,bounds:i,pixelWidth:e,pixelHeight:o,centered:n}){if(null==t)return i;let{minX:s,maxX:a,minY:l,maxY:d}=i;if(null==s||null==a||null==l||null==d)return E;const c=a-s,p=d-l,m=t.effectiveUnits,u=r(p,m.elevation,m.distance)/o/(c/e);return u>=1?[s,a]=it([s,a],u):[l,d]=it([l,d],1/u),{minX:s,maxX:a,minY:l,maxY:d}}function it([t,i],e,o){const n=(i-t)*e;{const e=(t+i)/2-n/2;return[e,e+n]}}function et(t){const{chart:i,data:e,seriesInfos:o,xAxis:n,yAxis:s}=t;if(null==e||0===e.lines.length)return void i.series.clear();const a=new Map,l=new Set(i.series.values),r=e.lines.length;for(let d=0;d<r;d++){const n=e.lines[d];let s=o.get(n.id);s?(s.fill&&l.delete(s.fill),l.delete(s.line)):(s=nt(t,n),s.fill&&i.series.push(s.fill),i.series.push(s.line)),a.set(s.id,s);const c=r-d-1;s.fill?.set("layer",c),s.line.set("layer",r+c),ot(t,s,n)}t.seriesInfos=a;for(const d of l)i.series.removeValue(d);n.set("layer",r+1),s.set("layer",r+2)}function ot({theme:t},i,e){const o=S(e.color.toCss()),n=e.samples??[],s=n.length>0,{line:a,fill:l}=i;a.set("visible",s),a.set("stroke",o),l?.set("visible",s),l?.set("fill",k.lighten(o,t.seriesFillLighten)),a.data.setAll(n),l?.data.setAll(n)}function nt(t,i){const{id:e}=i,o=st(t,`${H}-${e}`),n=at(t);o.setAll({dy:i.chartStrokeOffsetY,tooltip:n}),o.strokes.template.setAll({strokeWidth:i.chartStrokeWidth});let s=null;return i.chartFillEnabled&&(s=st(t,`${B}-${e}`),s.fills.template.setAll({fillOpacity:1,visible:!0})),{id:e,line:o,fill:s}}function st(t,i){return M.new(t.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:i,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:t.xAxis,yAxis:t.yAxis})}function at({theme:t,chart:i,rtl:e}){const o=X.new(i.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),n=t.seriesTooltipPaddingHorizontal,s=t.seriesTooltipPaddingVertical;return o.label.setAll({fill:S(t.seriesTooltipLabelColor),fontFamily:t.fontFamily,fontSize:t.seriesTooltipFontSize,paddingBottom:s,paddingLeft:n,paddingRight:n,paddingTop:s,textAlign:e?"end":"start",direction:"ltr"}),o.get("background")?.setAll({stroke:void 0,fill:S(t.seriesTooltipBackgroundColor)}),o.adapters.add("dy",i=>{const e=t.seriesTooltipSpacing,n=o.get("pointTo")?.y??0;return(i??0)+(o.y()>n?e:-e)}),o}function lt(t,i){const{xAxis:e,yAxis:o}=t,n=()=>{i(rt(e),rt(o))},s=t=>[t.on("start",n),t.on("end",n)];return bt([...s(e),...s(o)])}function rt(t){const i=Math.abs((t.get("end")??0)-(t.get("start")??0)),e=0!==i?1/i:1;return Math.abs(1-e)<d()?1:e}function dt(t,i){const{chart:e,xAxis:o,yAxis:n}=t,s=e.get("cursor"),a=e.plotContainer.events,l=i=>{t.pointerIsOver=i,pt(t)},r=()=>{l(!1),i(null,null)};return bt([s?.events.on("cursormoved",()=>{if(!t.pointerIsOver)return;pt(t);let e=s?.getPrivate("positionX")??0,a=s?.getPrivate("positionY")??0;const l=t.data;if(null!=l?.statistics){const{maxDistance:t,minElevation:i,maxElevation:s}=l.statistics;let r,d;if(null!=t){1===rt(o)?(r=0,d=t):(r=At(o),d=vt(o)),e=ct(e,r,d,0,t)}if(null!=i&&null!=s){1===rt(n)?(r=i,d=s):(r=At(n),d=vt(n)),a=ct(a,r,d,i,s)}}i(e,a)}),a.on("pointerover",()=>l(!0)),a.on("pointerout",r),a.on("blur",r)])}function ct(t,i,e,o,n){return(i+t*(e-i)-o)/(n-o)}function pt(t){const i=mt(t);if(!i)return void t.seriesInfos.forEach(t=>{t.line.get("tooltip")?.set("forceHidden",!0)});t.seriesInfos.forEach(t=>{const e=t.line.get("tooltip");e.set("forceHidden",!1),e.label.set("text",i)});t.xAxis.getTooltip().setAll({tooltipText:xt(t)})}function mt(t){const{data:i}=t,e=i?.lines.map(i=>({line:i,y:ht(t,i)?.elevation})).sort(ut);return e&&0!==e.length&&null!=e[0].y?e.map(({y:i,line:e})=>ft(t,e,i)).join("\n"):null}function ut({y:t},{y:i}){return null==t?1:null==i?-1:i-t}function ft(t,i,e){const{data:o,messages:n}=t;if(null==o||null==n)return"";const s=`[${i.color.toHex()}]●[/]`,a=" ",r=c().formatPrecision,d=z(n.chartTooltip,{name:m(i,n),elevation:null!=e?l(n,e,o.effectiveUnits.elevation,r):p});return t.rtl?d+a+s:s+a+d}function xt(t){const{data:i,messages:e}=t;if(null==i||null==e)return"";const o=i.lines[0],n=o?ht(t,o):null,s=c().formatPrecision;return null!=n?l(e,n.distance,i.effectiveUnits.distance,s):"-"}function gt(t,i){const e=g.new(t.chart.root,{});return e.format=(e,o,n)=>{const{data:s,messages:l}=t;if(null==l||null==s||"string"==typeof e)return"";return`${Y(e,{maximumFractionDigits:n})} ${a(l,s.effectiveUnits[i],"abbr")}`},e}function ht({chart:t,xAxis:i},e){const o=e.samples??[];if(0===o.length)return null;const n=t.get("cursor"),s=n?.getPrivate("positionX")??0,a=i.toAxisPosition(s),l=i.positionToValue(a);return f(o,l,t=>t.distance)}function At(t){return t.positionToValue(t.get("start")??0)}function vt(t){return t.positionToValue(t.get("end")??1)}function bt(t){return e(t.map(yt))}function yt(t){return o(()=>{t?.dispose()})}export{I as createChart,_ as getAdjustedBounds};
5
+ import{R as t,D as i}from"../../../chunks/ResponsiveTheme.js";import"../../../intl.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{signal as s}from"../../../core/signal.js";import{unitName as a,formatDecimal as l}from"../../../core/unitFormatUtils.js";import{convertUnit as r}from"../../../core/unitUtils.js";import{getEpsilon as d}from"../../../core/libs/gl-matrix-2/math/common.js";import{getConfig as c,notAvailable as p}from"./constants.js";import{getTranslatedLineTitle as m}from"./intlUtils.js";import{niceScale as u}from"./niceScale.js";import{binaryFindClosest as f}from"./profileUtils.js";import{c as x,N as g}from"../../../chunks/chartUtilsAm5.js";import{isRTL as h}from"../../support/widgetUtils.js";import{isDarkMode as A}from"../../../support/modeUtils.js";import{X as v,V as b,A as y,b as T,a as L,L as M}from"../../../chunks/LineSeries.js";import{b as S,d as F,a as P,C as k}from"../../../chunks/Theme.js";import{T as X}from"../../../chunks/Tooltip.js";import{formatNumber as Y}from"../../../intl/number.js";import{substitute as z}from"../../../intl/substitute.js";const C="#f8f8f8",j="#a9a9a9",w="#323232",H="line",B="fill",U=15,D=12,R=.001,O=.1,W=.02,G={fontFamily:"Avenir Next",paddingBottom:D/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:j,axisTooltipFontSize:12,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,axisTooltipPaddingTop:Math.round(D/4),axisTooltipPaddingBottom:Math.round(D/4),axisTooltipPaddingHorizontal:Math.round(U/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(D/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(U/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:C,seriesTooltipLabelColor:w,seriesFillLighten:.9,seriesTooltipSpacing:D/2,seriesTooltipPaddingVertical:Math.round(U/4),seriesTooltipPaddingHorizontal:Math.round(U/4)},V={...G,axisGridStroke:w,axisLabelsColor:j,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,seriesTooltipBackgroundColor:w,seriesTooltipLabelColor:C,seriesFillLighten:-.75},E={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function I(o){const a=await x(o.container);n(o.abortOptions);const l=A(o.container),r=l?V:G;a.setThemes(l?[t.new(a),i.new(a)]:[t.new(a)]);const d=h(o.container),c=a.container.children.push(v.new(a,{panX:!0,panY:!0,paddingTop:r.paddingTop,paddingBottom:r.paddingBottom,paddingLeft:d?r.paddingRight:r.paddingLeft,paddingRight:d?r.paddingLeft:r.paddingRight,maxTooltipDistance:-1}));c.zoomOutButton.set("forceHidden",!0);const p=c.xAxes.push(b.new(a,{renderer:y.new(a,{})})),m=c.yAxes.push(b.new(a,{renderer:T.new(a,{})})),u=s(null),f=s("loading"),g={chart:c,xAxis:p,yAxis:m,seriesInfos:new Map,messages:null,theme:r,pointerIsOver:!1,rtl:d,get state(){return f.value},get data(){return u.value},set data(t){u.value=t}};Z(g),q(g),N(g);const L=e([lt(g,o.onRangeChange),dt(g,o.onCursorPositionChange),yt(a.events.once("frameended",()=>{f.value="ready"})),yt(a)]);let M;return{destroy:()=>{L.remove(),f.value="destroyed"},update:t=>{t.data===g.data&&t.messages===g.messages||$(g)||J(g,t)},zoomOut:()=>K(g),test:M}}function $(t){return"destroyed"===t.state}function N({chart:t,xAxis:i,yAxis:e}){const o=L.new(t.root,{behavior:"none",xAxis:i,yAxis:e,snapToSeriesBy:"y"});o.lineY.set("visible",!1),t.set("cursor",o)}function Z(t){const{chart:i,xAxis:e,theme:o}=t;e.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),e.axisHeader.set("forceHidden",!0);const n=e.get("renderer");n.setAll({inside:!1,minGridDistance:o.xAxisMinGridDistance}),n.labels.template.setAll({centerX:F,centerY:F,fill:S(o.axisLabelsColor),fontFamily:o.fontFamily,fontSize:o.axisLabelsFontSize,fontWeight:o.axisLabelsFontWeight,maxPosition:o.xAxisMaxLabelPosition,minPosition:o.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:o.xAxisLabelsSpacing});const s=e.set("tooltip",X.new(i.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));s.get("background")?.setAll({fill:S(o.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:S(o.axisTooltipLabelColor),fontFamily:o.fontFamily,fontSize:o.axisTooltipFontSize,paddingBottom:o.axisTooltipPaddingBottom,paddingLeft:o.axisTooltipPaddingHorizontal,paddingRight:o.axisTooltipPaddingHorizontal,paddingTop:o.axisTooltipPaddingTop,direction:t.rtl?"rtl":"ltr"}),n.grid.template.setAll({strokeOpacity:1,stroke:S(o.axisGridStroke)})}function q(t){const{yAxis:i,theme:e,rtl:o}=t;i.setAll({baseValue:c().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),i.axisHeader.set("visible",!1);const n=i.get("renderer");n.setAll({minGridDistance:e.yAxisMinGridDistance,opposite:o,inside:!0}),n.labels.template.setAll({centerX:F,centerY:P,fill:S(e.axisLabelsColor),fontFamily:e.fontFamily,fontSize:e.axisLabelsFontSize,fontWeight:e.axisLabelsFontWeight,maxPosition:e.yAxisMaxLabelPosition,minPosition:e.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:o?0:e.yAxisLabelSpacing,paddingRight:o?e.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),n.grid.template.setAll({strokeOpacity:1,stroke:S(e.axisGridStroke)})}function J(t,i){if($(t))return;const e=t.data??void 0,o=i.data??void 0;t.chart.get("cursor")?.set("forceHidden",!o?.refined);const n=e!==o,s=e?.effectiveUnits!==o?.effectiveUnits,a=e?.uniformScaling!==o?.uniformScaling;t.data=o,t.messages=i.messages,(n||s)&&(Q(t),et(t)),a&&K(t),pt(t)}function K(t){$(t)||(t.xAxis.zoom(0,1),t.yAxis.zoom(0,1))}function Q(t){const{chart:i,data:e,xAxis:o,yAxis:n}=t,{minX:s,maxX:a,minY:l,maxY:r}=_({data:e,pixelWidth:o.width(),pixelHeight:n.height()}),d=!!e?.uniformScaling,c=!!e?.refined;i.setAll({panX:!0,panY:d,pinchZoomX:c,pinchZoomY:c&&d,wheelX:"panX",wheelY:c?d?"zoomXY":"zoomX":"none"}),o.setAll({max:a,min:s,panX:!0,panY:!1,zoomX:!0,zoomY:d}),n.setAll({max:r,min:l,panX:!1,panY:d,zoomX:d,zoomY:d})}function _({data:t,pixelWidth:i,pixelHeight:e}){if(null==t)return E;const o=t.statistics,n=0,s=o?.maxDistance;let a=o?.minElevation,l=o?.maxElevation;if(null==s||null==a||null==l)return E;const d=Math.max(s-n,R);let p=Math.max(l-a,R);const m=t.effectiveUnits;if(t.dynamicElevationRange){const t=r(d,m.distance,m.elevation);p=Math.max(p,t/c().maxChartRatio)}return a-=W*p,l=a+p+O*p,[a,l]=u(a,l,10),p=l-a,t.uniformScaling?tt({data:t,bounds:{minX:n,maxX:s,minY:a,maxY:l},pixelWidth:i,pixelHeight:e,centered:!0}):{minX:n,maxX:n+d,minY:a,maxY:a+p}}function tt({data:t,bounds:i,pixelWidth:e,pixelHeight:o,centered:n}){if(null==t)return i;let{minX:s,maxX:a,minY:l,maxY:d}=i;if(null==s||null==a||null==l||null==d)return E;const c=a-s,p=d-l,m=t.effectiveUnits,u=r(p,m.elevation,m.distance)/o/(c/e);return u>=1?[s,a]=it([s,a],u):[l,d]=it([l,d],1/u),{minX:s,maxX:a,minY:l,maxY:d}}function it([t,i],e,o){const n=(i-t)*e;{const e=(t+i)/2-n/2;return[e,e+n]}}function et(t){const{chart:i,data:e,seriesInfos:o,xAxis:n,yAxis:s}=t;if(null==e||0===e.lines.length)return void i.series.clear();const a=new Map,l=new Set(i.series.values),r=e.lines.length;for(let d=0;d<r;d++){const n=e.lines[d];let s=o.get(n.id);s?(s.fill&&l.delete(s.fill),l.delete(s.line)):(s=nt(t,n),s.fill&&i.series.push(s.fill),i.series.push(s.line)),a.set(s.id,s);const c=r-d-1;s.fill?.set("layer",c),s.line.set("layer",r+c),ot(t,s,n)}t.seriesInfos=a;for(const d of l)i.series.removeValue(d);n.set("layer",r+1),s.set("layer",r+2)}function ot({theme:t},i,e){const o=S(e.color.toCss()),n=e.samples??[],s=n.length>0,{line:a,fill:l}=i;a.set("visible",s),a.set("stroke",o),l?.set("visible",s),l?.set("fill",k.lighten(o,t.seriesFillLighten)),a.data.setAll(n),l?.data.setAll(n)}function nt(t,i){const{id:e}=i,o=st(t,`${H}-${e}`),n=at(t);o.setAll({dy:i.chartStrokeOffsetY,tooltip:n}),o.strokes.template.setAll({strokeWidth:i.chartStrokeWidth});let s=null;return i.chartFillEnabled&&(s=st(t,`${B}-${e}`),s.fills.template.setAll({fillOpacity:1,visible:!0})),{id:e,line:o,fill:s}}function st(t,i){return M.new(t.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:i,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:t.xAxis,yAxis:t.yAxis})}function at({theme:t,chart:i,rtl:e}){const o=X.new(i.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),n=t.seriesTooltipPaddingHorizontal,s=t.seriesTooltipPaddingVertical;return o.label.setAll({fill:S(t.seriesTooltipLabelColor),fontFamily:t.fontFamily,fontSize:t.seriesTooltipFontSize,paddingBottom:s,paddingLeft:n,paddingRight:n,paddingTop:s,textAlign:e?"end":"start",direction:"ltr"}),o.get("background")?.setAll({stroke:void 0,fill:S(t.seriesTooltipBackgroundColor)}),o.adapters.add("dy",i=>{const e=t.seriesTooltipSpacing,n=o.get("pointTo")?.y??0;return(i??0)+(o.y()>n?e:-e)}),o}function lt(t,i){const{xAxis:e,yAxis:o}=t,n=()=>{i(rt(e),rt(o))},s=t=>[t.on("start",n),t.on("end",n)];return bt([...s(e),...s(o)])}function rt(t){const i=Math.abs((t.get("end")??0)-(t.get("start")??0)),e=0!==i?1/i:1;return Math.abs(1-e)<d()?1:e}function dt(t,i){const{chart:e,xAxis:o,yAxis:n}=t,s=e.get("cursor"),a=e.plotContainer.events,l=i=>{t.pointerIsOver=i,pt(t)},r=()=>{l(!1),i(null,null)};return bt([s?.events.on("cursormoved",()=>{if(!t.pointerIsOver)return;pt(t);let e=s?.getPrivate("positionX")??0,a=s?.getPrivate("positionY")??0;const l=t.data;if(null!=l?.statistics){const{maxDistance:t,minElevation:i,maxElevation:s}=l.statistics;let r,d;if(null!=t){1===rt(o)?(r=0,d=t):(r=At(o),d=vt(o)),e=ct(e,r,d,0,t)}if(null!=i&&null!=s){1===rt(n)?(r=i,d=s):(r=At(n),d=vt(n)),a=ct(a,r,d,i,s)}}i(e,a)}),a.on("pointerover",()=>l(!0)),a.on("pointerout",r),a.on("blur",r)])}function ct(t,i,e,o,n){return(i+t*(e-i)-o)/(n-o)}function pt(t){const i=mt(t);if(!i)return void t.seriesInfos.forEach(t=>{t.line.get("tooltip")?.set("forceHidden",!0)});t.seriesInfos.forEach(t=>{const e=t.line.get("tooltip");e.set("forceHidden",!1),e.label.set("text",i)});t.xAxis.getTooltip().setAll({tooltipText:xt(t)})}function mt(t){const{data:i}=t,e=i?.lines.map(i=>({line:i,y:ht(t,i)?.elevation})).sort(ut);return e&&0!==e.length&&null!=e[0].y?e.map(({y:i,line:e})=>ft(t,e,i)).join("\n"):null}function ut({y:t},{y:i}){return null==t?1:null==i?-1:i-t}function ft(t,i,e){const{data:o,messages:n}=t;if(null==o||null==n)return"";const s=`[${i.color.toHex()}]●[/]`,a=" ",r=c().formatPrecision,d=z(n.chartTooltip,{name:m(i,n),elevation:null!=e?l(n,e,o.effectiveUnits.elevation,r):p});return t.rtl?d+a+s:s+a+d}function xt(t){const{data:i,messages:e}=t;if(null==i||null==e)return"";const o=i.lines[0],n=o?ht(t,o):null,s=c().formatPrecision;return null!=n?l(e,n.distance,i.effectiveUnits.distance,s):"-"}function gt(t,i){const e=g.new(t.chart.root,{});return e.format=(e,o,n)=>{const{data:s,messages:l}=t;if(null==l||null==s||"string"==typeof e)return"";return`${Y(e,{maximumFractionDigits:n})} ${a(l,s.effectiveUnits[i],"abbr")}`},e}function ht({chart:t,xAxis:i},e){const o=e.samples??[];if(0===o.length)return null;const n=t.get("cursor"),s=n?.getPrivate("positionX")??0,a=i.toAxisPosition(s),l=i.positionToValue(a);return f(o,l,t=>t.distance)}function At(t){return t.positionToValue(t.get("start")??0)}function vt(t){return t.positionToValue(t.get("end")??1)}function bt(t){return e(t.map(yt))}function yt(t){return o(()=>{t?.dispose()})}export{I as createChart,_ as getAdjustedBounds};
@@ -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 t}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import{abortMaybe as i,destroyMaybe as s}from"../core/maybe.js";import{memoize as n}from"../core/memoize.js";import{throwIfAborted as r,createAbortError as o}from"../core/promiseUtils.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./ElevationProfile/css.js";import u from"./ElevationProfile/ElevationProfileViewModel.js";import m from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as _}from"./ElevationProfile/components/Legend.js";import{SettingsButton as v}from"./ElevationProfile/components/SettingsButton.js";import{getConfig as C}from"./ElevationProfile/support/constants.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as y}from"./support/decorators/messageBundle.js";import{tsx as b,tsxFragment as w}from"./support/jsxFactory.js";const k=[{type:"select"},{type:"sketch"}],M={none:null,"no-valid-input":"noProfile","no-visible-profiles":"noProfile","refined-but-no-chart-data":"noProfile","too-complex":"tooComplex","unknown-error":"unknown","invalid-geometry":"invalidGeometry","invalid-elevation-info":"invalidElevationInfo"};let B=class extends d{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new m,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=n((t,e,i,s)=>({chart:t,data:e,stationary:i,messages:s})),this._onZoomOutButtonClick=()=>{this._chart?.zoomOut()},this._onClearButtonClick=()=>{this.viewModel.clear()},t?.viewModel||(this._defaultViewModel=new u({view:t?.view}),this.viewModel=this._defaultViewModel)}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}postInitialize(){this.addHandles([a(()=>({container:this._chartContainer}),({container:t})=>{this._destroyChart(),null!=t&&this._initializeChart(t)},l),a(()=>this._chartUpdateParams,()=>this._updateChart(this._chartUpdateParams),l)])}destroy(){this._destroyChart(),null!=this._defaultViewModel&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get icon(){return"altitude"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get test(){return{chart:this._chart}}get _selectButtonVisible(){return!0===this.visibleElements.selectButton&&this.viewModel.selectAvailable}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,null==t||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _profilesArray(){return this.profiles.toArray()}render(){const{viewModel:t,visible:e}=this;return b("div",{"aria-label":this.messages.widgetLabel,class:this.classes({[p.base]:e,[f.widget]:e,[f.panel]:e,[f.widgetDisabled]:e&&"disabled"===t.state,[p.refined]:1===t.progress}),key:this},b("div",{bind:this,key:"content-wrapper"},e?this._renderContentForState():null))}_renderContentForState(){switch(this.viewModel.state){case"ready":case"disabled":return this._renderContentForReadyState();case"selecting":return this._renderContentForSelectingState();case"creating":return this._renderContentForCreatingState();case"selected":return this._renderContentForSelectedState();case"created":return this._renderContentForCreatedState()}}_renderContentForReadyState(){const{messages:t,visibleElements:e,_selectButtonVisible:i}=this,{sketchButton:s}=e;let n;return n=s&&i?t.readyPrompt:s?t.readyPromptCreateOnly:i?t.readyPromptSelectOnly:t.errors?.noProfile,this._renderContent({prompt:n,chart:!1,actions:k})}_renderContentForSelectingState(){const{view:t}=this;if(null==t)return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:"select-cancel"}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(null==t)return null;const i=e.hasVertices?[{type:"sketch-cancel"},{type:"sketch-done",disabled:!e.tool.interaction.canStopCreating}]:[{type:"select"},{type:"sketch",disabled:!0}];if("no-valid-input"===e.errorState){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:i,prompt:e})}const s=this._getErrorMessage();return s?this._renderContent({chart:!1,actions:i,prompt:s}):this._renderContent({chart:!0,actions:i})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_getErrorMessage(){const t=M[this.viewModel.errorState];return t?this.messages?.errors?.[t]:null}_renderContent(t){const e=null!=t.prompt?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),{viewModel:i}=this,s=null!=i.input;return b(w,null,b("header",{class:p.header,key:"header"},this._zoomOutButtonVisible?this._renderZoomOutButton():null,this.visibleElements.clearButton&&s?this._renderClearButton():null,this.visibleElements.settingsButton?b(v,{messages:this.messages,uniformChartScaling:i.uniformChartScaling,unit:i.unit,unitOptions:i.unitOptions,visibleElements:this.visibleElements,onUniformChartScalingChange:t=>i.uniformChartScaling=t,onUnitChange:t=>i.unit=t}):null),b("div",{class:p.mainContainer,key:"main-container"},e),this.visibleElements.legend?b(_,{effectiveUnits:i.effectiveUnits,messages:this.messages,profiles:this._profilesArray}):null,this._renderActions(t))}_renderZoomOutButton(){const t=this.messages.zoomOut;return b("calcite-action",{appearance:"transparent",class:p.zoomOutButton,"data-testid":"zoom-out-button",icon:"magnifying-glass-minus",key:"zoom-out",onclick:this._onZoomOutButtonClick,scale:"s",text:t,title:t})}_renderClearButton(){const t=this.messages.clearProfile;return b("calcite-action",{appearance:"transparent",class:p.clearButton,"data-testid":"clear-button",icon:"trash",key:"clear-profile",onclick:this._onClearButtonClick,scale:"s",text:t,title:t})}_renderPrompt(t){return[b("div",{bind:this,class:p.promptContainer,key:"prompt-container"},b("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return b("div",{class:p.chartContainer,key:"empty-chart-container"});const{chartData:t,progress:e}=this.viewModel,i=this._chartIsRefined||this._canRenderChart(),s=null!=t&&e<1;return i?b(w,null,this._renderSpinner({size:i?"small":"large",visible:s}),b("div",{afterCreate:this._onChartContainerUpdate,afterRemoved:this._onChartContainerRemoved,afterUpdate:this._onChartContainerUpdate,bind:this,class:p.chartContainer,key:"chart-container"})):b(w,null,this._renderSpinner({size:"large",visible:s}),b("div",{class:p.chartContainer,key:"chart-container-empty"}))}_renderSpinner(t){const e="small"===t.size,i=t.visible??!0;return b("calcite-loader",{class:this.classes(p.chartSpinner,e&&p.chartSpinnerSmall,i&&p.chartSpinnerVisible),"data-testid":"chart-spinner",inline:e,key:"spinner",label:"",scale:"s"})}_canRenderChart(){const t=this.viewModel.chartData;if(null==t)return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=null!=i?i.length:0;return t.refined||e<=C().largeChartSamples}_renderActions({actions:t}){const e=t.map(t=>{switch(t.type){case"sketch":return this.visibleElements.sketchButton&&this._renderAction({action:t,className:p.sketchButton,label:this.messages.sketchButtonLabel,onClick:this._onSketchButtonClick,primary:!0});case"sketch-cancel":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.sketchCancelButton,label:this.messagesCommon.cancel,primary:!1});case"sketch-done":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:p.sketchDoneButton,label:this.messagesCommon.done,primary:!0});case"select":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:p.selectButton,label:this.messages.selectButtonLabel,primary:!1});case"select-cancel":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.selectCancelButton,label:this.messagesCommon.cancel,primary:!1})}}).filter(Boolean);return e.length?b("footer",{class:p.footer,key:"footer"},e):null}_renderAction({action:t,className:e,label:i,onClick:s,primary:n}){return b("calcite-button",{appearance:n?"solid":"outline-fill",bind:this,class:this.classes(p.actionButton,e),disabled:t.disabled,key:`action-${t.type}`,onclick:s},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:s,stationary:n}=t;null!=i&&null!=s&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=null!=e&&e.refined)}_onChartContainerUpdate(t){this._chartContainer=t}_onChartContainerRemoved(t){this._chartContainer===t&&(this._chartContainer=null)}_initializeChart(t){i(this._chartInitTask),this._chartInitTask=e(async e=>{const{createChart:i}=await import("./ElevationProfile/support/chartUtils.js");r(e);const n=await i({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw s(n),o();this._chart=n,this._updateChart(this._chartUpdateParams)})}_destroyChart(){this._chartInitTask=i(this._chartInitTask),this._chart=s(this._chart),this._chartIsRefined=!1}};t([c({type:u})],B.prototype,"viewModel",void 0),t([c()],B.prototype,"view",null),t([c()],B.prototype,"input",null),t([c()],B.prototype,"profiles",null),t([c()],B.prototype,"unitOptions",null),t([c()],B.prototype,"unit",null),t([c({type:m,nonNullable:!0})],B.prototype,"visibleElements",void 0),t([c()],B.prototype,"icon",null),t([c()],B.prototype,"label",null),t([c()],B.prototype,"visible",null),t([c(),y("esri/widgets/ElevationProfile/t9n/ElevationProfile")],B.prototype,"messages",void 0),t([c(),y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),t([c(),y("esri/core/t9n/Units")],B.prototype,"messagesUnits",void 0),t([c()],B.prototype,"_chartContainer",void 0),t([c()],B.prototype,"_chart",void 0),t([c()],B.prototype,"_chartInitTask",void 0),t([c()],B.prototype,"_chartIsRefined",void 0),t([c()],B.prototype,"_zoomOutButtonVisible",void 0),t([c()],B.prototype,"_selectButtonVisible",null),t([c()],B.prototype,"_chartUpdateParams",null),t([c()],B.prototype,"_chartMessages",null),t([c()],B.prototype,"_profilesArray",null),B=t([h("esri.widgets.ElevationProfile")],B);const S=B;export{S as default};
5
+ import{__decorate as t}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import{abortMaybe as i,destroyMaybe as s}from"../core/maybe.js";import{memoize as n}from"../core/memoize.js";import{throwIfAborted as r,createAbortError as o}from"../core/promiseUtils.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./ElevationProfile/css.js";import u from"./ElevationProfile/ElevationProfileViewModel.js";import m from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as _}from"./ElevationProfile/components/Legend.js";import{SettingsButton as v}from"./ElevationProfile/components/SettingsButton.js";import{getConfig as C}from"./ElevationProfile/support/constants.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as y}from"./support/decorators/messageBundle.js";import{tsx as b,tsxFragment as w}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";const k=[{type:"select"},{type:"sketch"}],M={none:null,"no-valid-input":"noProfile","no-visible-profiles":"noProfile","refined-but-no-chart-data":"noProfile","too-complex":"tooComplex","unknown-error":"unknown","invalid-geometry":"invalidGeometry","invalid-elevation-info":"invalidElevationInfo"};let B=class extends d{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new m,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=n((t,e,i,s)=>({chart:t,data:e,stationary:i,messages:s})),this._onZoomOutButtonClick=()=>{this._chart?.zoomOut()},this._onClearButtonClick=()=>{this.viewModel.clear()},t?.viewModel||(this._defaultViewModel=new u({view:t?.view}),this.viewModel=this._defaultViewModel)}loadDependencies(){return g({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}postInitialize(){this.addHandles([a(()=>({container:this._chartContainer}),({container:t})=>{this._destroyChart(),null!=t&&this._initializeChart(t)},l),a(()=>this._chartUpdateParams,()=>this._updateChart(this._chartUpdateParams),l)])}destroy(){this._destroyChart(),null!=this._defaultViewModel&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get icon(){return"altitude"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get test(){return{chart:this._chart}}get _selectButtonVisible(){return!0===this.visibleElements.selectButton&&this.viewModel.selectAvailable}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,null==t||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _profilesArray(){return this.profiles.toArray()}render(){const{viewModel:t,visible:e}=this;return b("div",{"aria-label":this.messages.widgetLabel,class:this.classes({[p.base]:e,[f.widget]:e,[f.panel]:e,[f.widgetDisabled]:e&&"disabled"===t.state,[p.refined]:1===t.progress}),key:this},b("div",{bind:this,key:"content-wrapper"},e?this._renderContentForState():null))}_renderContentForState(){switch(this.viewModel.state){case"ready":case"disabled":return this._renderContentForReadyState();case"selecting":return this._renderContentForSelectingState();case"creating":return this._renderContentForCreatingState();case"selected":return this._renderContentForSelectedState();case"created":return this._renderContentForCreatedState()}}_renderContentForReadyState(){const{messages:t,visibleElements:e,_selectButtonVisible:i}=this,{sketchButton:s}=e;let n;return n=s&&i?t.readyPrompt:s?t.readyPromptCreateOnly:i?t.readyPromptSelectOnly:t.errors?.noProfile,this._renderContent({prompt:n,chart:!1,actions:k})}_renderContentForSelectingState(){const{view:t}=this;if(null==t)return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:"select-cancel"}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(null==t)return null;const i=e.hasVertices?[{type:"sketch-cancel"},{type:"sketch-done",disabled:!e.tool.interaction.canStopCreating}]:[{type:"select"},{type:"sketch",disabled:!0}];if("no-valid-input"===e.errorState){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:i,prompt:e})}const s=this._getErrorMessage();return s?this._renderContent({chart:!1,actions:i,prompt:s}):this._renderContent({chart:!0,actions:i})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:k,prompt:t}):this._renderContent({chart:!0,actions:k})}_getErrorMessage(){const t=M[this.viewModel.errorState];return t?this.messages?.errors?.[t]:null}_renderContent(t){const e=null!=t.prompt?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),{viewModel:i}=this,s=null!=i.input;return b(w,null,b("header",{class:p.header,key:"header"},this._zoomOutButtonVisible?this._renderZoomOutButton():null,this.visibleElements.clearButton&&s?this._renderClearButton():null,this.visibleElements.settingsButton?b(v,{messages:this.messages,uniformChartScaling:i.uniformChartScaling,unit:i.unit,unitOptions:i.unitOptions,visibleElements:this.visibleElements,onUniformChartScalingChange:t=>i.uniformChartScaling=t,onUnitChange:t=>i.unit=t}):null),b("div",{class:p.mainContainer,key:"main-container"},e),this.visibleElements.legend?b(_,{effectiveUnits:i.effectiveUnits,messages:this.messages,profiles:this._profilesArray}):null,this._renderActions(t))}_renderZoomOutButton(){const t=this.messages.zoomOut;return b("calcite-action",{appearance:"transparent",class:p.zoomOutButton,"data-testid":"zoom-out-button",icon:"magnifying-glass-minus",key:"zoom-out",onclick:this._onZoomOutButtonClick,scale:"s",text:t,title:t})}_renderClearButton(){const t=this.messages.clearProfile;return b("calcite-action",{appearance:"transparent",class:p.clearButton,"data-testid":"clear-button",icon:"trash",key:"clear-profile",onclick:this._onClearButtonClick,scale:"s",text:t,title:t})}_renderPrompt(t){return[b("div",{bind:this,class:p.promptContainer,key:"prompt-container"},b("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return b("div",{class:p.chartContainer,key:"empty-chart-container"});const{chartData:t,progress:e}=this.viewModel,i=this._chartIsRefined||this._canRenderChart(),s=null!=t&&e<1;return i?b(w,null,this._renderSpinner({size:i?"small":"large",visible:s}),b("div",{afterCreate:this._onChartContainerUpdate,afterRemoved:this._onChartContainerRemoved,afterUpdate:this._onChartContainerUpdate,bind:this,class:p.chartContainer,key:"chart-container"})):b(w,null,this._renderSpinner({size:"large",visible:s}),b("div",{class:p.chartContainer,key:"chart-container-empty"}))}_renderSpinner(t){const e="small"===t.size,i=t.visible??!0;return b("calcite-loader",{class:this.classes(p.chartSpinner,e&&p.chartSpinnerSmall,i&&p.chartSpinnerVisible),"data-testid":"chart-spinner",inline:e,key:"spinner",label:"",scale:"s"})}_canRenderChart(){const t=this.viewModel.chartData;if(null==t)return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=null!=i?i.length:0;return t.refined||e<=C().largeChartSamples}_renderActions({actions:t}){const e=t.map(t=>{switch(t.type){case"sketch":return this.visibleElements.sketchButton&&this._renderAction({action:t,className:p.sketchButton,label:this.messages.sketchButtonLabel,onClick:this._onSketchButtonClick,primary:!0});case"sketch-cancel":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.sketchCancelButton,label:this.messagesCommon.cancel,primary:!1});case"sketch-done":return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:p.sketchDoneButton,label:this.messagesCommon.done,primary:!0});case"select":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:p.selectButton,label:this.messages.selectButtonLabel,primary:!1});case"select-cancel":return this._selectButtonVisible&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:p.selectCancelButton,label:this.messagesCommon.cancel,primary:!1})}}).filter(Boolean);return e.length?b("footer",{class:p.footer,key:"footer"},e):null}_renderAction({action:t,className:e,label:i,onClick:s,primary:n}){return b("calcite-button",{appearance:n?"solid":"outline-fill",bind:this,class:this.classes(p.actionButton,e),disabled:t.disabled,key:`action-${t.type}`,onclick:s},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:s,stationary:n}=t;null!=i&&null!=s&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=null!=e&&e.refined)}_onChartContainerUpdate(t){this._chartContainer=t}_onChartContainerRemoved(t){this._chartContainer===t&&(this._chartContainer=null)}_initializeChart(t){i(this._chartInitTask),this._chartInitTask=e(async e=>{const{createChart:i}=await import("./ElevationProfile/support/chartUtils.js");r(e);const n=await i({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw s(n),o();this._chart=n,this._updateChart(this._chartUpdateParams)})}_destroyChart(){this._chartInitTask=i(this._chartInitTask),this._chart=s(this._chart),this._chartIsRefined=!1}};t([c({type:u})],B.prototype,"viewModel",void 0),t([c()],B.prototype,"view",null),t([c()],B.prototype,"input",null),t([c()],B.prototype,"profiles",null),t([c()],B.prototype,"unitOptions",null),t([c()],B.prototype,"unit",null),t([c({type:m,nonNullable:!0})],B.prototype,"visibleElements",void 0),t([c()],B.prototype,"icon",null),t([c()],B.prototype,"label",null),t([c()],B.prototype,"visible",null),t([c(),y("esri/widgets/ElevationProfile/t9n/ElevationProfile")],B.prototype,"messages",void 0),t([c(),y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),t([c(),y("esri/core/t9n/Units")],B.prototype,"messagesUnits",void 0),t([c()],B.prototype,"_chartContainer",void 0),t([c()],B.prototype,"_chart",void 0),t([c()],B.prototype,"_chartInitTask",void 0),t([c()],B.prototype,"_chartIsRefined",void 0),t([c()],B.prototype,"_zoomOutButtonVisible",void 0),t([c()],B.prototype,"_selectButtonVisible",null),t([c()],B.prototype,"_chartUpdateParams",null),t([c()],B.prototype,"_chartMessages",null),t([c()],B.prototype,"_profilesArray",null),B=t([h("esri.widgets.ElevationProfile")],B);const S=B;export{S 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{watch as t,initial 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 r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Attachments.js";import a from"../Widget.js";import n from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import p from"./support/FeatureElementInfo.js";import"../support/widgetUtils.js";import{tsx as l}from"../support/jsxFactory.js";const d={base:"esri-feature-attachments"};let h=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new o,this.headingLevel=2,this.viewModel=new n}initialize(){this._featureElementInfo=new p,this.addHandles([t(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),i),t(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,i)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return l("div",{class:d.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};e([s({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),e([s()],h.prototype,"description",null),e([s()],h.prototype,"displayType",null),e([s()],h.prototype,"graphic",null),e([s()],h.prototype,"headingLevel",void 0),e([s()],h.prototype,"title",null),e([s({type:n})],h.prototype,"viewModel",void 0),h=e([r("esri.widgets.Feature.FeatureAttachments")],h);export{h as default};
5
+ import{__decorate as t}from"tslib";import{watch as e,initial 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 r}from"../../core/accessorSupport/decorators/subclass.js";import o from"../Attachments.js";import a from"../Widget.js";import n from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import p from"./support/FeatureElementInfo.js";import"../support/widgetUtils.js";import{tsx as l}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const d={base:"esri-feature-attachments"};let h=class extends a{constructor(t,e){super(t,e),this._featureElementInfo=null,this.attachmentsWidget=new o,this.headingLevel=2,this.viewModel=new n}initialize(){this._featureElementInfo=new p,this.addHandles([e(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),i),e(()=>this.viewModel,t=>this.attachmentsWidget.viewModel=t,i)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(t){this.viewModel.description=t}get displayType(){return this.attachmentsWidget.displayType}set displayType(t){this.attachmentsWidget.displayType=t}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}render(){const{attachmentsWidget:t}=this;return l("div",{class:d.base},this._featureElementInfo?.render(),t?.render())}_setupFeatureElementInfo(){const{description:t,title:e,headingLevel:i}=this;this._featureElementInfo?.set({description:t,title:e,headingLevel:i})}};t([s({readOnly:!0})],h.prototype,"attachmentsWidget",void 0),t([s()],h.prototype,"description",null),t([s()],h.prototype,"displayType",null),t([s()],h.prototype,"graphic",null),t([s()],h.prototype,"headingLevel",void 0),t([s()],h.prototype,"title",null),t([s({type:n})],h.prototype,"viewModel",void 0),h=t([r("esri.widgets.Feature.FeatureAttachments")],h);export{h 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{watch as t,initial as o}from"../../core/reactiveUtils.js";import{property as i}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 s from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import l from"./FeatureMedia.js";import a from"./FeatureExpression/FeatureExpressionViewModel.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{tsx as c}from"../support/jsxFactory.js";const m="esri-feature",u={base:`${m}-expression`,loadingSpinnerContainer:`${m}__loading-container`};let g=class extends s{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new a}initialize(){this.addHandles(t(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),o))}loadDependencies(){return p({loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return c("div",{class:u.base},"loading"===e?this._renderLoading():"disabled"===e?null:this._contentWidget?.render())}_renderLoading(){return c("div",{class:u.loadingSpinnerContainer,key:"loading-container"},c("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,o=t?.type;this._destroyContentWidget();const i=e?"fields"===o?new d({viewModel:e}):"media"===o?new l({viewModel:e}):"text"===o?new n({viewModel:e}):null:null;this._contentWidget=i,this.scheduleRender()}};e([i({type:a})],g.prototype,"viewModel",void 0),g=e([r("esri.widgets.Feature.FeatureExpression")],g);export{g as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,initial as o}from"../../core/reactiveUtils.js";import{property as i}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 s from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import l from"./FeatureMedia.js";import a from"./FeatureExpression/FeatureExpressionViewModel.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{tsx as c}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const m="esri-feature",u={base:`${m}-expression`,loadingSpinnerContainer:`${m}__loading-container`};let g=class extends s{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new a}initialize(){this.addHandles(t(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),o))}loadDependencies(){return p({loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return c("div",{class:u.base},"loading"===e?this._renderLoading():"disabled"===e?null:this._contentWidget?.render())}_renderLoading(){return c("div",{class:u.loadingSpinnerContainer,key:"loading-container"},c("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,o=t?.type;this._destroyContentWidget();const i=e?"fields"===o?new d({viewModel:e}):"media"===o?new l({viewModel:e}):"text"===o?new n({viewModel:e}):null:null;this._contentWidget=i,this.scheduleRender()}};e([i({type:a})],g.prototype,"viewModel",void 0),g=e([r("esri.widgets.Feature.FeatureExpression")],g);export{g 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{watch as t,initial as s}from"../../core/reactiveUtils.js";import{property as i}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 o from"../Widget.js";import l from"./FeatureFields/FeatureFieldsViewModel.js";import n from"./support/FeatureElementInfo.js";import{globalCss as d}from"../support/globalCss.js";import{autoLink as a}from"../support/uriUtils.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as f}from"../support/jsxFactory.js";const u="esri-feature-fields",m={base:u,fieldHeader:`${u}__field-header`,fieldData:`${u}__field-data`,fieldDataDate:`${u}__field-data--date`};let c=class extends o{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new l,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new n,this.addHandles(t(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),s))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return f("div",{class:m.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:s}=this.viewModel,i=e.fieldName||"",r=e.label||i,o=s?null==s[i]?"":s[i]:"",l=!!e.format?.dateFormat,n="number"==typeof o&&!l?this._forceLTR(o):a(this.messagesURIUtils,o),d={[m.fieldDataDate]:l};return f("tr",{key:`fields-element-info-row-${i}-${t}`},f("th",{class:m.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${i}-${t}`}),f("td",{class:this.classes(m.fieldData,d),innerHTML:n,key:`fields-element-info-row-data-${i}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?f("table",{class:d.table,summary:this.messages.fieldsSummary},f("tbody",null,e.map((e,t)=>this._renderFieldInfo(e,t)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`&lrm;${e}`}};e([i()],c.prototype,"attributes",null),e([i()],c.prototype,"description",null),e([i()],c.prototype,"expressionInfos",null),e([i()],c.prototype,"fieldInfos",null),e([i()],c.prototype,"title",null),e([i({type:l,nonNullable:!0})],c.prototype,"viewModel",void 0),e([i(),p("esri/widgets/Feature/t9n/Feature")],c.prototype,"messages",void 0),e([i(),p("esri/widgets/support/t9n/uriUtils")],c.prototype,"messagesURIUtils",void 0),c=e([r("esri.widgets.Feature.FeatureFields")],c);export{c as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,initial as s}from"../../core/reactiveUtils.js";import{property as i}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 o from"../Widget.js";import l from"./FeatureFields/FeatureFieldsViewModel.js";import n from"./support/FeatureElementInfo.js";import{globalCss as d}from"../support/globalCss.js";import{autoLink as a}from"../support/uriUtils.js";import"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as f}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const u="esri-feature-fields",m={base:u,fieldHeader:`${u}__field-header`,fieldData:`${u}__field-data`,fieldDataDate:`${u}__field-data--date`};let c=class extends o{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new l,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new n,this.addHandles(t(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),s))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return f("div",{class:m.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:s}=this.viewModel,i=e.fieldName||"",r=e.label||i,o=s?null==s[i]?"":s[i]:"",l=!!e.format?.dateFormat,n="number"==typeof o&&!l?this._forceLTR(o):a(this.messagesURIUtils,o),d={[m.fieldDataDate]:l};return f("tr",{key:`fields-element-info-row-${i}-${t}`},f("th",{class:m.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${i}-${t}`}),f("td",{class:this.classes(m.fieldData,d),innerHTML:n,key:`fields-element-info-row-data-${i}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?f("table",{class:d.table,summary:this.messages.fieldsSummary},f("tbody",null,e.map((e,t)=>this._renderFieldInfo(e,t)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`&lrm;${e}`}};e([i()],c.prototype,"attributes",null),e([i()],c.prototype,"description",null),e([i()],c.prototype,"expressionInfos",null),e([i()],c.prototype,"fieldInfos",null),e([i()],c.prototype,"title",null),e([i({type:l,nonNullable:!0})],c.prototype,"viewModel",void 0),e([i(),p("esri/widgets/Feature/t9n/Feature")],c.prototype,"messages",void 0),e([i(),p("esri/widgets/support/t9n/uriUtils")],c.prototype,"messagesURIUtils",void 0),c=e([r("esri.widgets.Feature.FeatureFields")],c);export{c 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"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r}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{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,h=m(c??void 0)?"_blank":"_self",p="_blank"===h?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:p,target:h,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const h=[o.new(t),c];f()&&h.push(s.new(t)),this._canAnimateChart()&&h.push(n.new(t)),t.setThemes(h);const p=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||p.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return h(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(s,{labelText:c}),p=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),await p.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),p.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),await C.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),p("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T as default};
5
+ import{__decorate as e}from"tslib";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}from"../../core/reactiveUtils.js";import{property as r}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{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,h=m(c??void 0)?"_blank":"_self",p="_blank"===h?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:p,target:h,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const h=[o.new(t),c];f(this.container)&&h.push(s.new(t)),this._canAnimateChart()&&h.push(n.new(t)),t.setThemes(h);const p=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||p.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return h(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(s,{labelText:c}),p=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),await p.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),p.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),await C.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),p("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T 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"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as i,on as r,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as n}from"../../core/string.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../Widget.js";import u from"./FeatureRelationship/FeatureRelationshipViewModel.js";import h from"./support/FeatureElementInfo.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import{globalCss as m}from"../support/globalCss.js";import{isRTL as v}from"../support/widgetUtils.js";import{messageBundle as w}from"../support/decorators/messageBundle.js";import{tsx as _}from"../support/jsxFactory.js";import{substitute as f}from"../../intl/substitute.js";import{formatNumber as g}from"../../intl/number.js";var b;const y="esri-feature",I=`${y}-relationship`,F={base:I,listContainer:`${I}__list`,listItem:`${I}__list-item`,listItemHidden:`${I}__list-item--hidden`,listContainerQuerying:`${I}__list--querying`,featureObserver:`${y}__feature-observer`,stickySpinnerContainer:`${y}__sticky-loading-container`,loadingSpinnerContainer:`${y}__loading-container`},C={title:!0,description:!0};let M=b=class extends c{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements={...C},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:i,featurePage:r}=this.viewModel;"ready"===e&&t&&s.length>=i*r&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new h,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o),i(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),r(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return p({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:i,allCategoriesCount:r}=this.viewModel;return!e&&"ready"===i&&(!!r&&(r>s||0===s)||!!t&&(t>s||0===s))}get displayListItems(){const{relatedFeatureViewModels:e,allCategoriesCount:t}=this.viewModel;return this.displayShowAllButton||!!e.length||!!t}get allItemsDescription(){const{messages:e}=this,{featureCount:t,allCategories:s,allCategoriesCount:i}=this.viewModel;return f(e?.numberRecords,{number:g(s?i:t)})}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){const{activeCategory:e,title:t}=this.viewModel;return e?.name??t}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...C,...e}}render(){const{state:e}=this.viewModel;return _("div",{class:this.classes(F.base,m.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_selectCategory(e){const{flowItems:t,featureVisibleElements:s,viewModel:i}=this;t&&(i.activeCategory=e,i.showAllEnabled=!0,t.push(new b({flowItems:t,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:i})))}async _selectRecord(e){const{flowItems:t,featureVisibleElements:s}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:i}=await import("../Feature.js");t.push(new i({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:s}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:s}=this;t.showAllEnabled=!0;const i=new b({flowItems:e,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:t});e.push(i)}_renderStickyLoading(){return"querying"===this.viewModel.state?_("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return _("calcite-loader",{inline:!0,label:""})}_renderLoading(){return _("div",{class:F.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return _("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=v(this.container)?"chevron-left":"chevron-right";return _("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderCategory(e){const{count:t,name:s,value:i}=e,r=g(t);return _("calcite-list-item",{class:F.listItem,disabled:!t,key:i,label:s,onCalciteListItemSelect:()=>this._selectCategory(e)},_("calcite-chip",{label:r,scale:"s",slot:"content-end"},r),this._renderChevronIconNode())}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const i="loading"===e.state;return _("calcite-list-item",{class:this.classes(F.listItem,{[F.listItemHidden]:i}),description:n(e.description??""),key:e.uid,label:n(s),onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?_("calcite-list-item",{description:this.allItemsDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return _("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},_("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return _("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e,categories:t}=this.viewModel;return _("calcite-list",{displayMode:"flat",label:this.messages?.relatedFeaturesList},t?.map(e=>this._renderCategory(e))??e.toArray().map(e=>this._renderRelatedFeature(e)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return _("div",{class:this.classes(F.listContainer,{[F.listContainerQuerying]:"querying"===t}),key:"list-container"},e?this._renderList():"ready"===t?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return _("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},_("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(e=>{this.addHandles(i(()=>[e.title,e.state],()=>this.scheduleRender(),o),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,i=t.title&&this.title;this._featureElementInfo?.set({description:s,title:i,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([l()],M.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([l({readOnly:!0})],M.prototype,"displayShowAllButton",null),e([l({readOnly:!0})],M.prototype,"displayListItems",null),e([l({readOnly:!0})],M.prototype,"allItemsDescription",null),e([l()],M.prototype,"description",null),e([l()],M.prototype,"featureVisibleElements",void 0),e([l()],M.prototype,"flowItems",void 0),e([l()],M.prototype,"flowType",void 0),e([l()],M.prototype,"headingLevel",void 0),e([l()],M.prototype,"title",null),e([l({type:u})],M.prototype,"viewModel",void 0),e([l(),w("esri/widgets/Feature/t9n/Feature")],M.prototype,"messages",void 0),e([l(),w("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([l()],M.prototype,"visibleElements",void 0),e([a("visibleElements")],M.prototype,"castVisibleElements",null),M=b=e([d("esri.widgets.Feature.FeatureRelationship")],M);export{M as default};
5
+ import{__decorate as e}from"tslib";import"../../intl.js";import{destroyMaybe as t}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{watch as i,on as r,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as n}from"../../core/string.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../Widget.js";import u from"./FeatureRelationship/FeatureRelationshipViewModel.js";import p from"./support/FeatureElementInfo.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{globalCss as m}from"../support/globalCss.js";import{isRTL as v}from"../support/widgetUtils.js";import{messageBundle as w}from"../support/decorators/messageBundle.js";import{tsx as g}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as _}from"../../intl/substitute.js";import{formatNumber as f}from"../../intl/number.js";var b;const y="esri-feature",I=`${y}-relationship`,F={base:I,listContainer:`${I}__list`,listItem:`${I}__list-item`,listItemHidden:`${I}__list-item--hidden`,listContainerQuerying:`${I}__list--querying`,featureObserver:`${y}__feature-observer`,stickySpinnerContainer:`${y}__sticky-loading-container`,loadingSpinnerContainer:`${y}__loading-container`},C={title:!0,description:!0};let M=b=class extends c{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements={...C},this._increaseFeaturePage=()=>{const{state:e,showAllEnabled:t,relatedFeatures:s,featuresPerPage:i,featurePage:r}=this.viewModel;"ready"===e&&t&&s.length>=i*r&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new p,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o),i(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),r(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return h({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:i,allCategoriesCount:r}=this.viewModel;return!e&&"ready"===i&&(!!r&&(r>s||0===s)||!!t&&(t>s||0===s))}get displayListItems(){const{relatedFeatureViewModels:e,allCategoriesCount:t}=this.viewModel;return this.displayShowAllButton||!!e.length||!!t}get allItemsDescription(){const{messages:e}=this,{featureCount:t,allCategories:s,allCategoriesCount:i}=this.viewModel;return _(e?.numberRecords,{number:f(s?i:t)})}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){const{activeCategory:e,title:t}=this.viewModel;return e?.name??t}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...C,...e}}render(){const{state:e}=this.viewModel;return g("div",{class:this.classes(F.base,m.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_selectCategory(e){const{flowItems:t,featureVisibleElements:s,viewModel:i}=this;t&&(i.activeCategory=e,i.showAllEnabled=!0,t.push(new b({flowItems:t,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:i})))}async _selectRecord(e){const{flowItems:t,featureVisibleElements:s}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:i}=await import("../Feature.js");t.push(new i({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:s}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:s}=this;t.showAllEnabled=!0;const i=new b({flowItems:e,featureVisibleElements:s,visibleElements:{title:!1,description:!1},viewModel:t});e.push(i)}_renderStickyLoading(){return"querying"===this.viewModel.state?g("div",{class:F.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return g("calcite-loader",{inline:!0,label:""})}_renderLoading(){return g("div",{class:F.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return g("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=v(this.container)?"chevron-left":"chevron-right";return g("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderCategory(e){const{count:t,name:s,value:i}=e,r=f(t);return g("calcite-list-item",{class:F.listItem,disabled:!t,key:i,label:s,onCalciteListItemSelect:()=>this._selectCategory(e)},g("calcite-chip",{label:r,scale:"s",slot:"content-end"},r),this._renderChevronIconNode())}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&e.formattedAttributes?.global[t];const i="loading"===e.state;return g("calcite-list-item",{class:this.classes(F.listItem,{[F.listItemHidden]:i}),description:n(e.description??""),key:e.uid,label:n(s),onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?g("calcite-list-item",{description:this.allItemsDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return g("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},g("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return g("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:F.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e,categories:t}=this.viewModel;return g("calcite-list",{displayMode:"flat",label:this.messages?.relatedFeaturesList},t?.map(e=>this._renderCategory(e))??e.toArray().map(e=>this._renderRelatedFeature(e)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return g("div",{class:this.classes(F.listContainer,{[F.listContainerQuerying]:"querying"===t}),key:"list-container"},e?this._renderList():"ready"===t?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return g("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},g("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(e=>{this.addHandles(i(()=>[e.title,e.state],()=>this.scheduleRender(),o),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,i=t.title&&this.title;this._featureElementInfo?.set({description:s,title:i,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await s(0),this._relatedFeatureIntersectionObserverNode&&"ready"===e&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};e([l()],M.prototype,"_relatedFeatureIntersectionObserverNode",void 0),e([l({readOnly:!0})],M.prototype,"displayShowAllButton",null),e([l({readOnly:!0})],M.prototype,"displayListItems",null),e([l({readOnly:!0})],M.prototype,"allItemsDescription",null),e([l()],M.prototype,"description",null),e([l()],M.prototype,"featureVisibleElements",void 0),e([l()],M.prototype,"flowItems",void 0),e([l()],M.prototype,"flowType",void 0),e([l()],M.prototype,"headingLevel",void 0),e([l()],M.prototype,"title",null),e([l({type:u})],M.prototype,"viewModel",void 0),e([l(),w("esri/widgets/Feature/t9n/Feature")],M.prototype,"messages",void 0),e([l(),w("esri/t9n/common")],M.prototype,"messagesCommon",void 0),e([l()],M.prototype,"visibleElements",void 0),e([a("visibleElements")],M.prototype,"castVisibleElements",null),M=b=e([d("esri.widgets.Feature.FeatureRelationship")],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"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as i}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 o from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as l}from"../support/componentsUtils.js";import{globalCss as r}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as n,tsxFragment as a}from"../support/jsxFactory.js";import c from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import d from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as p}from"../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as u}from"../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as m}from"../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";import{substitute as h}from"../../intl/substitute.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends d{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new c,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return n("div",{class:this.classes(f.base,r.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():n("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?n(a,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),t=>this._renderTypeList(t,e.get(t)))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const l=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new o({title:!1,description:!1}),viewModel:i});t.push(l)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter(e=>e.title.toLowerCase().includes(this.filterText)).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return u(e.association)?n("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:i,title:s}=e,o="loading"===i.state,l=this._findFlowItem(i),r=l<0&&this._isParentFeature(i),a=r||l>=0;return n("calcite-list-item",{class:o?f.listItemHidden:void 0,description:t(e.terminalName??""),key:`associated-feature-type-${i.uid}`,label:t(s),onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,i)},u(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,m(e.association)?n("calcite-chip",{label:p(e.association),scale:"s",slot:"content-end"},p(e.association)):null,this._renderChevronIconNode(a))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(e=>this._renderItemTooltip(e))}_renderAssociatedFeatureList(e){return e.toArray().map(e=>this._renderAssociatedFeature(e))}_renderChevronIconNode(e){return n("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return n("calcite-list-item",{expanded:!0,key:"show-all",label:e.title,value:e.id},n("calcite-chip",{label:String(t.length),scale:"s",slot:"content-end"},t.length),n("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?n("calcite-list-item",{description:h(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},n("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([i()],v.prototype,"description",void 0),e([i()],v.prototype,"featureVisibleElements",void 0),e([i()],v.prototype,"flowItems",void 0),e([i()],v.prototype,"flowType",void 0),e([i()],v.prototype,"listType",void 0),e([i()],v.prototype,"parentFeatureViewModel",void 0),e([i()],v.prototype,"title",void 0),e([i({type:c})],v.prototype,"viewModel",void 0),e([i({type:o,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([s("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g as default};
5
+ import{__decorate as e}from"tslib";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as i}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 o from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as l}from"../support/componentsUtils.js";import{globalCss as r}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as n,tsxFragment as a}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import c from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import d from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as p}from"../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as u}from"../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as m}from"../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";import{substitute as h}from"../../intl/substitute.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends d{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new c,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return n("div",{class:this.classes(f.base,r.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():n("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?n(a,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),t=>this._renderTypeList(t,e.get(t)))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const l=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new o({title:!1,description:!1}),viewModel:i});t.push(l)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter(e=>e.title.toLowerCase().includes(this.filterText)).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return u(e.association)?n("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:i,title:s}=e,o="loading"===i.state,l=this._findFlowItem(i),r=l<0&&this._isParentFeature(i),a=r||l>=0;return n("calcite-list-item",{class:o?f.listItemHidden:void 0,description:t(e.terminalName??""),key:`associated-feature-type-${i.uid}`,label:t(s),onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,i)},u(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,m(e.association)?n("calcite-chip",{label:p(e.association),scale:"s",slot:"content-end"},p(e.association)):null,this._renderChevronIconNode(a))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(e=>this._renderItemTooltip(e))}_renderAssociatedFeatureList(e){return e.toArray().map(e=>this._renderAssociatedFeature(e))}_renderChevronIconNode(e){return n("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return n("calcite-list-item",{expanded:!0,key:"show-all",label:e.title,value:e.id},n("calcite-chip",{label:String(t.length),scale:"s",slot:"content-end"},t.length),n("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?n("calcite-list-item",{description:h(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},n("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([i()],v.prototype,"description",void 0),e([i()],v.prototype,"featureVisibleElements",void 0),e([i()],v.prototype,"flowItems",void 0),e([i()],v.prototype,"flowType",void 0),e([i()],v.prototype,"listType",void 0),e([i()],v.prototype,"parentFeatureViewModel",void 0),e([i()],v.prototype,"title",void 0),e([i({type:c})],v.prototype,"viewModel",void 0),e([i({type:o,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([s("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g 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{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as s}from"../../core/string.js";import{property as n}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 a from"../Widget.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import c from"./support/FeatureElementInfo.js";import{loadCalciteComponents as d}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import h from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const y="esri-feature-utility-network-associations",g=`${y}__loading-container`,f={base:y,listContainer:`${y}__list`,loadingContainer:g,loadingContainerSticky:`${g}--sticky`};let v=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new h,this.messages=null,this.messagesCommon=null,this.visibleElements=new l}initialize(){this._featureElementInfo=new c,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o)])}loadDependencies(){return d({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(f.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?u("div",{class:f.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return u("div",{class:f.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"information",key:"association-not-found",kind:"info",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:s(e.description),key:`association-type-${e.type}`,label:s(i),value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return u("div",{class:f.listContainer,key:"list-container"},"ready"===i?u("div",null,u("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map(e=>this._renderAssociations(e)))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([n({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([n()],v.prototype,"flowType",void 0),e([n()],v.prototype,"flowItems",void 0),e([n()],v.prototype,"parentFeatureViewModel",void 0),e([n()],v.prototype,"featureVisibleElements",void 0),e([n()],v.prototype,"description",null),e([n()],v.prototype,"headingLevel",void 0),e([n()],v.prototype,"title",null),e([n({type:h})],v.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([n({type:l,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([r("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);export{v as default};
5
+ import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{stripHTML as s}from"../../core/string.js";import{property as n}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 a from"../Widget.js";import l from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import c from"./support/FeatureElementInfo.js";import{loadCalciteComponents as d}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as m}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";import h from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const y="esri-feature-utility-network-associations",g=`${y}__loading-container`,f={base:y,listContainer:`${y}__list`,loadingContainer:g,loadingContainerSticky:`${g}--sticky`};let v=class extends a{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new h,this.messages=null,this.messagesCommon=null,this.visibleElements=new l}initialize(){this._featureElementInfo=new c,this.addHandles([i(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),o)])}loadDependencies(){return d({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(f.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?u("div",{class:f.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return u("div",{class:f.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"information",key:"association-not-found",kind:"info",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:s(e.description),key:`association-type-${e.type}`,label:s(i),value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return u("div",{class:f.listContainer,key:"list-container"},"ready"===i?u("div",null,u("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map(e=>this._renderAssociations(e)))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([n({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([n()],v.prototype,"flowType",void 0),e([n()],v.prototype,"flowItems",void 0),e([n()],v.prototype,"parentFeatureViewModel",void 0),e([n()],v.prototype,"featureVisibleElements",void 0),e([n()],v.prototype,"description",null),e([n()],v.prototype,"headingLevel",void 0),e([n()],v.prototype,"title",null),e([n({type:h})],v.prototype,"viewModel",void 0),e([n(),m("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([n(),m("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([n({type:l,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([r("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);export{v 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 i from"../../Widget.js";import{Heading as o}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as s}from"../../support/jsxFactory.js";const p="esri-feature-element-info",n={base:p,title:`${p}__title`,description:`${p}__description`};let l=class extends i{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return s("div",{class:n.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?s(o,{class:n.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?s("div",{class:n.description,innerHTML:e,key:"description"}):null}};e([t()],l.prototype,"description",void 0),e([t()],l.prototype,"headingLevel",void 0),e([t()],l.prototype,"title",void 0),l=e([r("esri.widgets.Feature.support.FeatureElementInfo")],l);export{l 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 o from"../../Widget.js";import{Heading as i}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as s}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";const p="esri-feature-element-info",n={base:p,title:`${p}__title`,description:`${p}__description`};let l=class extends o{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return s("div",{class:n.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?s(i,{class:n.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?s("div",{class:n.description,innerHTML:e,key:"description"}):null}};e([t()],l.prototype,"description",void 0),e([t()],l.prototype,"headingLevel",void 0),e([t()],l.prototype,"title",void 0),l=e([r("esri.widgets.Feature.support.FeatureElementInfo")],l);export{l 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"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);export{F as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],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"../../support/widgetUtils.js";import{tsx as t}from"../../support/jsxFactory.js";import{getAssociationTitle as e}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{getFeatureTitle as r}from"../../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";function o(t){const{feature:r,association:o,associationType:i,messages:s}=t,{attachment:n,connectivity:c,container:a,content:u,structure:l}=s,p=r.sourceLayer;if(!o&&!i)return;if(!o)switch(i){case"attachment":return n;case"container":return a;case"connectivity":return c;case"content":return u;case"structure":return l}if(!p)return;const m=r.attributes[p.globalIdField]===o.fromNetworkElement.globalId?"from":"to";return e(o,m,s)}function i(e){const{feature:i,heading:s}=e,n=s||r(i),c=o(e)??"";return t("calcite-block",{description:c,heading:n})}export{i as AssociationDetails};
5
+ import"../../support/widgetUtils.js";import{tsx as t}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import{getAssociationTitle as e}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{getFeatureTitle as r}from"../../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";function o(t){const{feature:r,association:o,associationType:i,messages:s}=t,{attachment:n,connectivity:c,container:a,content:u,structure:l}=s,p=r.sourceLayer;if(!o&&!i)return;if(!o)switch(i){case"attachment":return n;case"container":return a;case"connectivity":return c;case"content":return u;case"structure":return l}if(!p)return;const m=r.attributes[p.globalIdField]===o.fromNetworkElement.globalId?"from":"to";return e(o,m,s)}function i(e){const{feature:i,heading:s}=e,n=s||r(i),c=o(e)??"";return t("calcite-block",{description:c,heading:n})}export{i as AssociationDetails};
@@ -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 t}from"tslib";import"../../../intl.js";import{stripHTML as e}from"../../../core/string.js";import{property as i}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 o from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as r}from"./AssociationDetails.js";import a from"./VisibleElements.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{globalCss as c}from"../../support/globalCss.js";import{Heading as l}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as d}from"../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as u}from"../../support/jsxFactory.js";import m from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import h from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as y}from"../../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as g}from"../../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as f}from"../../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";import{substitute as F}from"../../../intl/substitute.js";const v="esri-feature-form-utility-network-association-list",_={base:v,header:`${v}__header`,headingContent:`${v}__heading-content`,listContainer:`${v}__list-container`};let L=class extends h{constructor(t,e){super(t,e),this._isLoadingSelectFeature=!1,this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=async()=>{},this.onAddAssociation=()=>{},this.viewModel=new m,this.visibleElements=new a}initialize(){this.setUpObserver()}loadDependencies(){return n({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:t}=this;if(!t)return 0;const{associatedFeatureInfos:e,associatedLayer:i}=t,s=i?e.get(i):null;return s?s.length:0}render(){const{associationInput:t}=this;if(!t)return p("div",{class:this.classes(_.base,c.widget)});const{associatedLayer:e}=t,{state:i}=this.viewModel;return p("div",{class:this.classes(_.base,c.widget)},"loading"===i||"querying"===i?this.renderLoading():e?this._renderFeatureList(t,e):this._renderLayerList(t))}_renderLayerList(t){const{associatedFeatureInfos:e,editable:i}=t;return p("div",{class:_.listContainer},p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(e.keys(),e=>this._renderLayerItem(t,e))),i?p("calcite-fab",{appearance:"outline-fill",icon:"plus",key:`${t.uid}-add-button`,kind:"neutral",onclick:()=>this.onAddAssociation({feature:t.feature,associationType:t.activeAssociationType,utilityNetwork:t.utilityNetwork}),text:this.messagesCommon.add,textEnabled:!0}):null)}_renderFeatureList(t,e){return p(u,null,this._renderHeader(t,e),p("div",{class:_.listContainer},this.renderFeatureCountWarning(),p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(t,e),this.renderFeatureObserver())))}_renderLayerTitle(t){return t.title?p(l,{key:"title",level:this.headingLevel},p("div",{class:_.headingContent},p("calcite-icon",{icon:"layer"}),t.title)):null}_renderTotal(t,e){const{messagesFeature:i}=this,{associatedFeatureInfos:s}=t,o=s.get(e),r=F(i?.numberRecords,{number:o?.length??"0"});return p("div",{key:e.id},r)}_renderHeader(t,e){const{messagesFeatureForm:i}=this,{activeAssociationType:s,featureItem:o,feature:a}=t;return p("div",{class:_.header,key:"filter"},this.visibleElements.associationDetails?p(r,{associationType:s?.type,feature:a,heading:o?.label,messages:i.associations}):void 0,this._renderLayerTitle(e),this.renderFilter(),this._renderTotal(t,e))}_renderAssociatedFeatureListPage(t,e){const{filterText:i,endIndex:s}=this,o=t.associatedFeatureInfos.get(e)?.filter(t=>t.title?.toLowerCase().includes(i)??!1).slice(0,s).toArray()??[];return[...this._renderTooltips(o),...this._renderAssociatedFeatureList(o)]}_renderItemTooltip(t){const{tooltipReferenceMap:e}=this,i=t.feature.uid.toString();return g(t.association)?p("calcite-tooltip",{key:`tooltip-${i}`,overlayPositioning:"fixed",referenceElement:e.get(i)},this.getConnectivityTooltip(t.association.associationType)):null}_renderAssociatedFeature(t){const i=this.messagesCommon.untitled,s=t.title||i,o=t.feature.uid.toString();return p("calcite-list-item",{description:e(t.terminalName??""),key:`associated-feature-type-${o}`,label:e(s),onCalciteListItemSelect:()=>this._selectAssociation(t)},g(t.association)?this.renderConnectivityIcon(t.association.associationType,o):null,f(t.association)?p("calcite-chip",{label:y(t.association),scale:"s",slot:"content-end"},y(t.association)):null,p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(t){return t.map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(t){return t.map(t=>this._renderAssociatedFeature(t))}_renderLayerItem(t,e){const{associatedFeatureInfos:i}=t,s=i.get(e)?.length??0;return p("calcite-list-item",{expanded:!0,key:`${e.id}-show-all`,label:e.title??this.messagesCommon.untitled,value:e.id,onCalciteListItemSelect:()=>this._showAllAssociations(e)},p("calcite-chip",{label:s.toString(),scale:"s",slot:"content-end"},s),p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _selectAssociation(t){this._isLoadingSelectFeature||(this._isLoadingSelectFeature=!0,await this.onSelectFeature({feature:t.feature,association:t.association}),this._isLoadingSelectFeature=!1)}_showAllAssociations(t){this.onSelectLayer({layer:t,associationInput:this.associationInput})}};t([i()],L.prototype,"associatedFeatureCount",null),t([i({type:o})],L.prototype,"associationInput",void 0),t([i()],L.prototype,"headingLevel",void 0),t([i(),d("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),t([i({constructOnly:!0})],L.prototype,"onSelectLayer",void 0),t([i({constructOnly:!0})],L.prototype,"onSelectFeature",void 0),t([i({constructOnly:!0})],L.prototype,"onAddAssociation",void 0),t([i({type:m})],L.prototype,"viewModel",void 0),t([i({type:a,nonNullable:!0})],L.prototype,"visibleElements",void 0),L=t([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],L);const A=L;export{A as default};
5
+ import{__decorate as t}from"tslib";import"../../../intl.js";import{stripHTML as e}from"../../../core/string.js";import{property as i}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 o from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as r}from"./AssociationDetails.js";import a from"./VisibleElements.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{globalCss as c}from"../../support/globalCss.js";import{Heading as l}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as d}from"../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as u}from"../../support/jsxFactory.js";import"@arcgis/toolkit/dom";import m from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import h from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{formatPercentAlong as y}from"../../support/UtilityNetworkAssociations/utils/formatPercentAlong.js";import{isConnectivity as g}from"../../support/UtilityNetworkAssociations/utils/isConnectivity.js";import{isConnectivityMidspan as f}from"../../support/UtilityNetworkAssociations/utils/isConnectivityMidspan.js";import{substitute as F}from"../../../intl/substitute.js";const v="esri-feature-form-utility-network-association-list",_={base:v,header:`${v}__header`,headingContent:`${v}__heading-content`,listContainer:`${v}__list-container`};let L=class extends h{constructor(t,e){super(t,e),this._isLoadingSelectFeature=!1,this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=async()=>{},this.onAddAssociation=()=>{},this.viewModel=new m,this.visibleElements=new a}initialize(){this.setUpObserver()}loadDependencies(){return n({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:t}=this;if(!t)return 0;const{associatedFeatureInfos:e,associatedLayer:i}=t,s=i?e.get(i):null;return s?s.length:0}render(){const{associationInput:t}=this;if(!t)return p("div",{class:this.classes(_.base,c.widget)});const{associatedLayer:e}=t,{state:i}=this.viewModel;return p("div",{class:this.classes(_.base,c.widget)},"loading"===i||"querying"===i?this.renderLoading():e?this._renderFeatureList(t,e):this._renderLayerList(t))}_renderLayerList(t){const{associatedFeatureInfos:e,editable:i}=t;return p("div",{class:_.listContainer},p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(e.keys(),e=>this._renderLayerItem(t,e))),i?p("calcite-fab",{appearance:"outline-fill",icon:"plus",key:`${t.uid}-add-button`,kind:"neutral",onclick:()=>this.onAddAssociation({feature:t.feature,associationType:t.activeAssociationType,utilityNetwork:t.utilityNetwork}),text:this.messagesCommon.add,textEnabled:!0}):null)}_renderFeatureList(t,e){return p(u,null,this._renderHeader(t,e),p("div",{class:_.listContainer},this.renderFeatureCountWarning(),p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(t,e),this.renderFeatureObserver())))}_renderLayerTitle(t){return t.title?p(l,{key:"title",level:this.headingLevel},p("div",{class:_.headingContent},p("calcite-icon",{icon:"layer"}),t.title)):null}_renderTotal(t,e){const{messagesFeature:i}=this,{associatedFeatureInfos:s}=t,o=s.get(e),r=F(i?.numberRecords,{number:o?.length??"0"});return p("div",{key:e.id},r)}_renderHeader(t,e){const{messagesFeatureForm:i}=this,{activeAssociationType:s,featureItem:o,feature:a}=t;return p("div",{class:_.header,key:"filter"},this.visibleElements.associationDetails?p(r,{associationType:s?.type,feature:a,heading:o?.label,messages:i.associations}):void 0,this._renderLayerTitle(e),this.renderFilter(),this._renderTotal(t,e))}_renderAssociatedFeatureListPage(t,e){const{filterText:i,endIndex:s}=this,o=t.associatedFeatureInfos.get(e)?.filter(t=>t.title?.toLowerCase().includes(i)??!1).slice(0,s).toArray()??[];return[...this._renderTooltips(o),...this._renderAssociatedFeatureList(o)]}_renderItemTooltip(t){const{tooltipReferenceMap:e}=this,i=t.feature.uid.toString();return g(t.association)?p("calcite-tooltip",{key:`tooltip-${i}`,overlayPositioning:"fixed",referenceElement:e.get(i)},this.getConnectivityTooltip(t.association.associationType)):null}_renderAssociatedFeature(t){const i=this.messagesCommon.untitled,s=t.title||i,o=t.feature.uid.toString();return p("calcite-list-item",{description:e(t.terminalName??""),key:`associated-feature-type-${o}`,label:e(s),onCalciteListItemSelect:()=>this._selectAssociation(t)},g(t.association)?this.renderConnectivityIcon(t.association.associationType,o):null,f(t.association)?p("calcite-chip",{label:y(t.association),scale:"s",slot:"content-end"},y(t.association)):null,p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(t){return t.map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(t){return t.map(t=>this._renderAssociatedFeature(t))}_renderLayerItem(t,e){const{associatedFeatureInfos:i}=t,s=i.get(e)?.length??0;return p("calcite-list-item",{expanded:!0,key:`${e.id}-show-all`,label:e.title??this.messagesCommon.untitled,value:e.id,onCalciteListItemSelect:()=>this._showAllAssociations(e)},p("calcite-chip",{label:s.toString(),scale:"s",slot:"content-end"},s),p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _selectAssociation(t){this._isLoadingSelectFeature||(this._isLoadingSelectFeature=!0,await this.onSelectFeature({feature:t.feature,association:t.association}),this._isLoadingSelectFeature=!1)}_showAllAssociations(t){this.onSelectLayer({layer:t,associationInput:this.associationInput})}};t([i()],L.prototype,"associatedFeatureCount",null),t([i({type:o})],L.prototype,"associationInput",void 0),t([i()],L.prototype,"headingLevel",void 0),t([i(),d("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),t([i({constructOnly:!0})],L.prototype,"onSelectLayer",void 0),t([i({constructOnly:!0})],L.prototype,"onSelectFeature",void 0),t([i({constructOnly:!0})],L.prototype,"onAddAssociation",void 0),t([i({type:m})],L.prototype,"viewModel",void 0),t([i({type:a,nonNullable:!0})],L.prototype,"visibleElements",void 0),L=t([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],L);const A=L;export{A as default};