@arcgis/core 4.28.0-next.20230720 → 4.28.0-next.20230721

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 (261) hide show
  1. package/Color.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/arcade/arcadeCompiler.js +1 -1
  4. package/arcade/featureSetUtils.js +1 -1
  5. package/arcade/featureset/actions/Top.js +1 -1
  6. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  7. package/arcade/featureset/support/FeatureSet.js +1 -1
  8. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  9. package/arcade/functions/convertdirection.js +1 -1
  10. package/arcade/functions/featuresetbase.js +1 -1
  11. package/arcade/functions/geomasync.js +1 -1
  12. package/arcade/functions/geomsync.js +1 -1
  13. package/arcade/lib/comment-handler.js +1 -1
  14. package/arcade/lib/parser.js +1 -1
  15. package/arcade/lib/scanner.js +1 -1
  16. package/assets/esri/core/workers/RemoteClient.js +1 -1
  17. package/assets/esri/core/workers/chunks/{75c28da8d0b02d612d69.js → 040b3fc9c9c0736dd893.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0652f6a8d5221e978033.js +1 -0
  19. package/assets/esri/core/workers/chunks/{c13b332afdb3f6be1ec9.js → 092fda62b6f62c2e4869.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{57e0ad037188bd2997e7.js → 0af18a96cbd4e2d35436.js} +1 -1
  21. package/assets/esri/core/workers/chunks/0b5eeec0f66c87a46a0c.js +1 -0
  22. package/assets/esri/core/workers/chunks/{68e568b67b6fb34393db.js → 0cad2b991d0d0fd07846.js} +1 -1
  23. package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
  24. package/assets/esri/core/workers/chunks/256a82f6f6e1405fbcc6.js +1 -0
  25. package/assets/esri/core/workers/chunks/{bb9213899049e1db90da.js → 2c57c9bd71637c5bed8a.js} +1 -1
  26. package/assets/esri/core/workers/chunks/2cdbabcbfe32286ec78d.js +1 -0
  27. package/assets/esri/core/workers/chunks/{2b1c83453a862e01954b.js → 2d9d80b2d0042a9c09fb.js} +1 -1
  28. package/assets/esri/core/workers/chunks/2f9aec2238ff6cb99e09.js +1 -0
  29. package/assets/esri/core/workers/chunks/{7dbd3e6406fb3e3a1a8f.js → 3cf748c025f3936c1cb2.js} +1 -1
  30. package/assets/esri/core/workers/chunks/4481d1103363434f16da.js +1 -0
  31. package/assets/esri/core/workers/chunks/5ae325e6a795c72eac6c.js +1 -0
  32. package/assets/esri/core/workers/chunks/5e4dde2886a1027b4b96.js +1 -0
  33. package/assets/esri/core/workers/chunks/730eb7e5f617fdab4f10.js +1 -0
  34. package/assets/esri/core/workers/chunks/{5a2e6bed9431cf4f42b1.js → 740dc67038f554431f1b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{09178454bda15bb7929a.js → 7fbdfd1527582c52f9b6.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{1c026947505a9ff94a53.js → 807742f38885fa90b4fe.js} +1 -1
  37. package/assets/esri/core/workers/chunks/82dfbc175b52c7a10475.js +1 -0
  38. package/assets/esri/core/workers/chunks/870a05451e074b58f19a.js +1 -0
  39. package/assets/esri/core/workers/chunks/8c5a8c1dfb086069bb06.js +1 -0
  40. package/assets/esri/core/workers/chunks/99a5a434e0bad48c7a5c.js +1 -0
  41. package/assets/esri/core/workers/chunks/9a5916c66dad91d01d5b.js +1 -0
  42. package/assets/esri/core/workers/chunks/9c133fd8c1fbd0295b86.js +1 -0
  43. package/assets/esri/core/workers/chunks/9cddb504079d396779ea.js +1 -0
  44. package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
  45. package/assets/esri/core/workers/chunks/{9548aa449fe3a300c015.js → a4fa40dc77e116c954ac.js} +1 -1
  46. package/assets/esri/core/workers/chunks/a54ec9929a7db879d5db.js +1 -0
  47. package/assets/esri/core/workers/chunks/afc5b84693757fda2bc8.js +1 -0
  48. package/assets/esri/core/workers/chunks/{591b5c277cfd3a4101a4.js → b08f2a4aa94087c6c367.js} +1 -1
  49. package/assets/esri/core/workers/chunks/c0e12f6a7bb2360e4c21.js +1 -0
  50. package/assets/esri/core/workers/chunks/c8e656cd470a17f538e9.js +1 -0
  51. package/assets/esri/core/workers/chunks/d0e203405f95e14b1399.js +1 -0
  52. package/assets/esri/core/workers/chunks/{ec72f492f24e67e008ae.js → d8e58dc14d3495f0830c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/ddc393a012588f799f42.js +1 -0
  54. package/assets/esri/core/workers/chunks/de3baa85b1639c25458d.js +1 -0
  55. package/assets/esri/core/workers/chunks/e66cea26064ba8353af0.js +1 -0
  56. package/assets/esri/core/workers/chunks/ea478f2f4a19463e13fd.js +1 -0
  57. package/assets/esri/core/workers/chunks/eba197e45507f56f3ed0.js +1 -0
  58. package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +1 -0
  59. package/assets/esri/core/workers/chunks/ef9a9a7d66d818720e20.js +1 -0
  60. package/assets/esri/core/workers/chunks/f3b458f55236566c940b.js +1 -0
  61. package/assets/esri/core/workers/chunks/fd0a91b9e0216cc269c3.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a4fe220a912b1f428e49.js → fdd6403a8390d629392b.js} +1 -1
  63. package/assets/esri/themes/base/widgets/_Directions.scss +13 -7
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/chunks/array.js +1 -1
  68. package/core/Collection.js +1 -1
  69. package/core/accessorSupport/decorators/subclass.js +1 -1
  70. package/core/accessorSupport/ensureType.js +1 -1
  71. package/core/accessorSupport/get.js +1 -1
  72. package/core/accessorSupport/tracking.js +1 -1
  73. package/core/accessorSupport/utils.js +1 -1
  74. package/core/libs/rbush/PooledRBush.js +1 -1
  75. package/core/urlUtils.js +1 -1
  76. package/geometry/GeometryCursor.js +1 -1
  77. package/geometry/support/TileClipper.js +1 -1
  78. package/geometry/support/geodesicUtils.js +1 -1
  79. package/interfaces.d.ts +7 -1
  80. package/layers/LinkChartLayer.js +1 -1
  81. package/layers/VectorTileLayer.js +1 -1
  82. package/layers/VoxelLayer.js +1 -1
  83. package/layers/WCSLayer.js +1 -1
  84. package/layers/effects/EffectView.js +1 -1
  85. package/layers/graphics/sources/geojson/geojson.js +1 -1
  86. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  87. package/layers/mixins/ArcGISCachedService.js +1 -1
  88. package/layers/support/ElevationQuery.js +1 -1
  89. package/layers/support/MultidimensionalSubset.js +1 -1
  90. package/layers/support/TileInfo.js +1 -1
  91. package/layers/support/TileInfoTilemapCache.js +1 -1
  92. package/layers/support/TilemapCache.js +1 -1
  93. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  94. package/layers/support/rasterDatasets/pamParser.js +1 -1
  95. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  96. package/layers/support/rasterFormats/Raw.js +1 -1
  97. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  98. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  99. package/layers/support/rasterFunctions/colormaps.js +1 -1
  100. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  101. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  102. package/layers/video/VideoController.js +1 -1
  103. package/layers/voxel/VoxelDimension.js +1 -1
  104. package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
  105. package/layers/voxel/VoxelVolume.js +1 -1
  106. package/package.json +1 -1
  107. package/renderers/support/RasterSymbolizer.js +1 -1
  108. package/renderers/support/colorRampUtils.js +1 -1
  109. package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
  110. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  111. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  112. package/rest/support/generateRendererUtils.js +1 -1
  113. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  114. package/smartMapping/renderers/color.js +1 -1
  115. package/smartMapping/renderers/support/utils.js +1 -1
  116. package/smartMapping/renderers/type.js +1 -1
  117. package/smartMapping/renderers/univariateColorSize.js +1 -1
  118. package/smartMapping/support/adapters/support/utils.js +1 -1
  119. package/statistics/utils.js +1 -1
  120. package/support/revision.js +1 -1
  121. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  122. package/symbols/cim/GeometryWalker.js +1 -1
  123. package/symbols/cim/cimAnalyzer.js +1 -1
  124. package/symbols/cim/effects/EffectArrow.js +1 -1
  125. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  126. package/symbols/support/symbolUtils.js +1 -1
  127. package/views/2d/constraints/ZoomConstraint.js +1 -1
  128. package/views/2d/engine/flow/dataUtils.js +1 -1
  129. package/views/2d/engine/flow/utils.js +1 -1
  130. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  131. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  132. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  133. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  134. package/views/2d/engine/vectorTiles/tileInfoUtils.js +1 -1
  135. package/views/2d/engine/webgl/TurboLine.js +1 -1
  136. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  137. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  138. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  139. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  140. package/views/2d/layers/BaseLayerView2D.js +1 -1
  141. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  142. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  143. package/views/2d/layers/MediaLayerView2D.js +1 -1
  144. package/views/2d/layers/TileLayerView2D.js +1 -1
  145. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  146. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  147. package/views/2d/layers/features/support/rendererUtils.js +1 -1
  148. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  149. package/views/2d/layers/support/vectorTileDebugUtils.js +5 -0
  150. package/views/2d/tiling/TileInfoView.js +1 -1
  151. package/views/2d/tiling/TileInfoViewPOT.js +1 -1
  152. package/views/2d/tiling/TileQueue.js +1 -1
  153. package/views/2d/tiling.js +1 -1
  154. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  155. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  156. package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
  157. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  158. package/views/3d/layers/TiledLayerView3D.js +1 -1
  159. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  160. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  161. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  162. package/views/3d/layers/support/featureReference.js +1 -1
  163. package/views/3d/support/LaserLineRenderer.js +1 -1
  164. package/views/3d/terrain/Overlay.js +1 -1
  165. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  166. package/views/3d/terrain/OverlayRenderTarget.js +1 -1
  167. package/views/3d/terrain/OverlayRenderer.js +1 -1
  168. package/views/3d/terrain/TerrainRenderer.js +1 -1
  169. package/views/3d/terrain/TileCompositor.js +1 -1
  170. package/views/3d/terrain/TileRenderer.js +1 -1
  171. package/views/3d/terrain/TilingScheme.js +1 -1
  172. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
  174. package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
  175. package/views/3d/webgl-engine/effects/SmaaRenderPass.js +1 -1
  176. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  177. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  178. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  179. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  180. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  181. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  182. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  183. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  184. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  185. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  186. package/views/MapView.js +1 -1
  187. package/views/animation/pointToPoint/Path.js +1 -1
  188. package/views/draw/DrawOperation.js +1 -1
  189. package/views/draw/support/Reshape.js +1 -1
  190. package/views/draw/support/createUtils.js +1 -1
  191. package/views/interactive/SegmentLabels.js +1 -1
  192. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  193. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  194. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  195. package/views/layers/GroupLayerView.js +1 -1
  196. package/views/webgl/ProgramCache.js +1 -1
  197. package/webscene/spec-certification/api.js +1 -1
  198. package/webscene/spec-certification/spec.js +1 -1
  199. package/webscene/spec-certification/utils.js +1 -1
  200. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  201. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  202. package/widgets/BuildingExplorer/support/validation.js +1 -1
  203. package/widgets/Directions/support/resources.js +1 -1
  204. package/widgets/Directions.js +1 -1
  205. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  206. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  207. package/widgets/FeatureForm/FieldInput.js +1 -1
  208. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  209. package/widgets/FeatureForm.js +1 -1
  210. package/widgets/Features.js +1 -1
  211. package/widgets/Histogram/HistogramViewModel.js +1 -1
  212. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  213. package/widgets/Legend/styles/Card.js +1 -1
  214. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  215. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  216. package/widgets/Legend/support/colorRampUtils.js +1 -1
  217. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  218. package/widgets/Legend/support/utils.js +1 -1
  219. package/widgets/Popup.js +1 -1
  220. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  221. package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
  222. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  223. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  224. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  225. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  226. package/widgets/smartMapping/SizeSlider.js +1 -1
  227. package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.js +1 -1
  228. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  229. package/assets/esri/core/workers/chunks/0210f4c2e1f3ed13041b.js +0 -1
  230. package/assets/esri/core/workers/chunks/07bb40162d97d098bc19.js +0 -1
  231. package/assets/esri/core/workers/chunks/0a18317566c1fcb68422.js +0 -1
  232. package/assets/esri/core/workers/chunks/0de65e03db8c611af9fb.js +0 -1
  233. package/assets/esri/core/workers/chunks/1a60d23a92bcf91dbb22.js +0 -1
  234. package/assets/esri/core/workers/chunks/205a0b34b698d5329854.js +0 -1
  235. package/assets/esri/core/workers/chunks/25211d5904ee9d5f4a9d.js +0 -1
  236. package/assets/esri/core/workers/chunks/26b12d1ea713c1e07701.js +0 -1
  237. package/assets/esri/core/workers/chunks/2bfa7ee324c32a56b0d3.js +0 -1
  238. package/assets/esri/core/workers/chunks/4510a17839405146130b.js +0 -1
  239. package/assets/esri/core/workers/chunks/524156c3f5383c2dd0e3.js +0 -1
  240. package/assets/esri/core/workers/chunks/59666ecb7c2c1f5a13b2.js +0 -1
  241. package/assets/esri/core/workers/chunks/5c005c9514354c77ec27.js +0 -1
  242. package/assets/esri/core/workers/chunks/620ec5c75561183d3d73.js +0 -1
  243. package/assets/esri/core/workers/chunks/68512670816f59c0e6a5.js +0 -1
  244. package/assets/esri/core/workers/chunks/6c7374ebc18b46b3480a.js +0 -1
  245. package/assets/esri/core/workers/chunks/75ba2af92da232067adb.js +0 -1
  246. package/assets/esri/core/workers/chunks/7c1f0598a016516dcec3.js +0 -1
  247. package/assets/esri/core/workers/chunks/8dcec8d1b670d2b7ea2b.js +0 -1
  248. package/assets/esri/core/workers/chunks/8e07dfb6fc2673b640cb.js +0 -1
  249. package/assets/esri/core/workers/chunks/9050b167355588b7003d.js +0 -1
  250. package/assets/esri/core/workers/chunks/9230d68799f0b0b9ef36.js +0 -1
  251. package/assets/esri/core/workers/chunks/af4083f2aad5f5d49dde.js +0 -1
  252. package/assets/esri/core/workers/chunks/b0a57718a0765d1c8df0.js +0 -1
  253. package/assets/esri/core/workers/chunks/b431b81a7bf45dd527da.js +0 -1
  254. package/assets/esri/core/workers/chunks/bda311ad48efdb265939.js +0 -1
  255. package/assets/esri/core/workers/chunks/d5cce09fbe16cbb8fee4.js +0 -1
  256. package/assets/esri/core/workers/chunks/da547c3cabe4a89c3ce6.js +0 -1
  257. package/assets/esri/core/workers/chunks/dd295fa57b45b7ec4ec5.js +0 -1
  258. package/assets/esri/core/workers/chunks/f553b464e969d45bf451.js +0 -1
  259. package/assets/esri/core/workers/chunks/f5865294983eb160de8c.js +0 -1
  260. package/assets/esri/core/workers/chunks/fdb7b1fbdb6fe091ad83.js +0 -1
  261. package/views/2d/tiling/PagedTileQueue.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import r from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,abortMaybe as h}from"../../../core/maybe.js";import{zeroMeters as p}from"../../../core/quantityUtils.js";import{when as c,pausable as l,watch as d,syncAndInitial as m}from"../../../core/reactiveUtils.js";import{createScreenPoint as v}from"../../../core/screenUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{closeRingsAndFixWinding as g,geometryToCoordinates as u,getMidpoint as f}from"../../../geometry/support/coordsUtils.js";import x from"../../../layers/GraphicsLayer.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as b}from"../../ViewingMode.js";import{SnappingVisualizer2D as V}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as M}from"./drawUtils.js";import w from"./GraphicMover.js";import S from"./HighlightHelper.js";import{addUniqueLayer as E}from"./layerUtils.js";import{settings as k}from"./settings.js";import{ViewEventPriorities as I}from"../../input/InputManager.js";import{SKETCH_KEYS as O}from"../../interactive/keybindings.js";import{EditGeometryOperations as C}from"../../interactive/editGeometry/EditGeometryOperations.js";import j from"../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as T}from"../../interactive/snapping/SnappingContext.js";import{Tooltip as R}from"../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as H,TranslateVertexTooltipInfo as U}from"../../interactive/tooltip/TranslateTooltipInfos.js";import{autoArea2D as A}from"../../support/automaticAreaMeasurementUtils.js";import{autoDistanceBetweenPoints2D as L,autoLength2D as F}from"../../support/automaticLengthMeasurementUtils.js";import D from"../../../geometry/Polyline.js";import z from"../../../geometry/Point.js";class P{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class q{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class K{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class N{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class B{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class J{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class Q{constructor(e){this.added=e,this.type="vertex-select"}}class W{constructor(e){this.removed=e,this.type="vertex-deselect"}}class X{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class Y{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const Z=k.reshapeGraphics,$={vertices:{default:new G({style:"circle",size:Z.vertex.size,color:Z.vertex.color,outline:{color:Z.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.vertex.hoverSize,color:Z.vertex.hoverColor,outline:{color:Z.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:Z.selected.size,color:Z.selected.color,outline:{color:Z.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}})}};let ee=class extends r.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingContext=null,this._snappingTask=null,this._stagedVertex=null,this._tooltip=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new s,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.tooltipOptions=new j,this.type="reshape",this.vertexGraphics=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new S({view:e}),this._setup(),this.addHandles([c((()=>e?.ready),(()=>{const{layer:e,view:t}=this;E(t,e),this.addHandles(t.on("key-down",(e=>this._keyDownHandler(e)),I.TOOL))}),{once:!0,initial:!0}),l((()=>this.graphic),(()=>this.refresh())),l((()=>this.layer),((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),l((()=>this.enableMidpoints),(()=>this.refresh())),d((()=>this.tooltipOptions.enabled),(e=>{this._tooltip=e?new R({view:this.view}):a(this._tooltip)}),m)])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._tooltip=a(this._tooltip)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=$.midpoints,vertices:i=$.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length>0&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||null==e.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&g(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new D({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=C.fromGeometry(t,b.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new x({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new V(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=a(this._editGeometryOperations),this._snappingTask=h(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=u(e.clone());if("polygon"===e.type)for(const i of t){const e=i.at(-1);i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((e,a)=>{const[h,p]=e;r.push(new t({geometry:new z({x:h,y:p,spatialReference:o}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),r}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((a,h)=>{const[p,c]=a,l=e[h+1]?h+1:0;if("polygon"===this.graphic.geometry?.type||0!==l){const[a,d]=e[l],[m,v]=f([p,c],[a,d]);r.push(new t({geometry:new z({x:m,y:v,spatialReference:o}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:h,pointIndexEnd:l}}))}}))})),r}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i).items;e&&r.push(t),this._mover=new w({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e;if(s===this.graphic){const{geometry:o}=s;return this._setUpOperation(e),this._emitMoveStartEvent(t,i),void(null!=o&&"point"===o.type&&this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)})))}if(!this.selectedVertices.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),t=this._createVertexFromMidpoint(s);this._emitVertexAddEvent([s],e,t)}this._addToSelection(s)}this._setUpOperation(e),this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)}))}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)}));else if("point"===n.type)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}));else if("polyline"===n.type||"polygon"===n.type){const t=this._getCoordinatesForUI(n);this._updateVertexGraphicLocations(t),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e,{operationType:r}=t;t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,(()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o))),this._isMidpoint(o)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(e){const t=this.view.spatialReference;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes,[r,n]=e[s][o];i.geometry=new z({x:r,y:n,spatialReference:t})}this._updateMidpointGraphicLocations(e)}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:o}=t.attributes,[r,n]=e[i][s],[a,h]=e[i][o],[p,c]=f([r,n],[a,h]);t.geometry=new z({x:p,y:c,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,s,o,r){h(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,p="graphic-move-stop"===o.type;if(null!=this.snappingManager&&this.selectedVertices.length<2&&!p){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,p),r(),this._snappingTask=i((async i=>{const h=await o.snap({point:a,context:n,signal:i});h.valid&&(this._stagedVertex=h.apply(),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,p),r())}))}else{const i=null!=this._stagedVertex?new z(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,p),r()}}async _syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=this._editGeometryOperations.data.geometry;if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t),e.notifyGeometryChanged();else{const{x:n,y:a}=t,[h,p]=this._getIndicesForVertexGraphic(e);let c=u(r);const l=c[h].length-1;c[h][p]=[n,a],"polygon"===r.type&&(0===p?c[h][l]=[n,a]:p===l&&(c[h][0]=[n,a])),this._isVertex(e)&&(c=this._moveRelatedCoordinates(c,e,n,a),c=this._moveSelectedHandleCoordinates(c,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(c)),this.graphic.geometry=r.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:o}=t.attributes;for(const r of o){const o=this.vertexGraphics.at(r),{pathIndex:n,pointIndex:a}=o.attributes;e[n][a]=[i,s],o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){for(const r of this.selectedVertices)if(r!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=r.attributes,h=M(r.geometry,i,s,this.view),p=e[t].length-1;e[t][n]=[h.x,h.y],r.geometry=h,o&&(0===n?e[t][p]=[h.x,h.y]:n===p&&(e[t][0]=[h.x,h.y]));for(const i of a){const t=this.vertexGraphics.at(i),{pathIndex:s,pointIndex:o}=t.attributes;e[s][o]=[h.x,h.y],t.geometry=h}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic,i=this._isVertex(t);i&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default",this._updateTooltip()}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(null==s||"polygon"!==s.type&&"polyline"!==s.type)return[];const o=s.clone(),r=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:h}=e.attributes,{x:p,y:c}=e.geometry,l=0===h?a+1:h,d=u(o);return d[n].splice(l,0,[p,c]),e.attributes={...t,pathIndex:n,pointIndex:l,relatedGraphicIndices:[]},r.push({coordinates:d[n][l],componentIndex:n,vertexIndex:l}),this.graphic.geometry=o,r}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,o=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",o);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){O.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),o=i.clone();let r=u(o);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<r.length;t++){const s=r[t];for(let o=0;o<s.length;o++){const[a,h]=s[o];e===a&&i===h&&(n.push({coordinates:r[t][o],componentIndex:t,vertexIndex:o}),r[t].splice(Number(o),1))}}}if("polygon"===o.type)r=r.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,o]=e.at(-1);return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)})),o.rings=r;else{for(const e of r)1===e.length&&r.splice(r.indexOf(e),1);o.paths=r}this.graphic.geometry=o,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_updateTooltip(e,t){null!=this._tooltip&&(e?e===this.graphic?this._updateMoveGraphicTooltip(t):this._updateMoveVertexTooltip(t):this._tooltip.clear())}_updateMoveGraphicTooltip(e){const{_tooltip:t,tooltipOptions:i,view:s}=this;if(null==t)return;const o=new H({tooltipOptions:i});if(e){const{x:t,y:i}=e.origin,r=s.toMap(e),n=s.toMap(v(t,i)),a=L(n,r);o.distance=null!=a?a:p}t.info=o}_updateMoveVertexTooltip(e){const{_tooltip:t,graphic:{geometry:i},tooltipOptions:s,view:o}=this;if(null==t)return;const r=new U({tooltipOptions:s});if(null!=i&&("polygon"===i.type?r.area=A(i):"polyline"===i.type&&(r.totalLength=F(i))),e){const{x:t,y:i}=e.origin,s=o.toMap(e),n=o.toMap(v(t,i)),a=L(n,s);r.distance=null!=a?a:p}t.info=r}_emitMoveStartEvent(e,t){const i=new N(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new B(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const e=this._activeOperationInfo;if(!e)return;const{totalDx:t,totalDy:i}=e,s=new J(this.graphic,t,i);this.emit("move-stop",s),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(s)}_emitReshapeStartEvent(e){const t=new P(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new q(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new K(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new Q(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new W(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new X(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new Y(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],ee.prototype,"_tooltip",void 0),e([y()],ee.prototype,"callbacks",void 0),e([y()],ee.prototype,"enableMidpoints",void 0),e([y()],ee.prototype,"enableMovement",void 0),e([y()],ee.prototype,"enableVertices",void 0),e([y()],ee.prototype,"graphic",void 0),e([y({value:!0})],ee.prototype,"highlightsEnabled",null),e([y()],ee.prototype,"layer",void 0),e([y({readOnly:!0})],ee.prototype,"midpointGraphics",void 0),e([y()],ee.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],ee.prototype,"selectedVertices",void 0),e([y()],ee.prototype,"snappingManager",void 0),e([y({readOnly:!0})],ee.prototype,"state",null),e([y({value:$})],ee.prototype,"symbols",null),e([y({type:j})],ee.prototype,"tooltipOptions",void 0),e([y({readOnly:!0})],ee.prototype,"type",void 0),e([y({readOnly:!0})],ee.prototype,"vertexGraphics",void 0),e([y()],ee.prototype,"view",void 0),ee=e([_("esri.views.draw.support.Reshape")],ee);const te=ee;export{te as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import r from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,abortMaybe as h}from"../../../core/maybe.js";import{zeroMeters as p}from"../../../core/quantityUtils.js";import{when as c,pausable as l,watch as d,syncAndInitial as m}from"../../../core/reactiveUtils.js";import{createScreenPoint as v}from"../../../core/screenUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{closeRingsAndFixWinding as g,geometryToCoordinates as u,getMidpoint as f}from"../../../geometry/support/coordsUtils.js";import x from"../../../layers/GraphicsLayer.js";import G from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as b}from"../../ViewingMode.js";import{SnappingVisualizer2D as V}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as M}from"./drawUtils.js";import w from"./GraphicMover.js";import S from"./HighlightHelper.js";import{addUniqueLayer as E}from"./layerUtils.js";import{settings as k}from"./settings.js";import{ViewEventPriorities as I}from"../../input/InputManager.js";import{SKETCH_KEYS as O}from"../../interactive/keybindings.js";import{EditGeometryOperations as C}from"../../interactive/editGeometry/EditGeometryOperations.js";import j from"../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as T}from"../../interactive/snapping/SnappingContext.js";import{Tooltip as R}from"../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as H,TranslateVertexTooltipInfo as U}from"../../interactive/tooltip/TranslateTooltipInfos.js";import{autoArea2D as A}from"../../support/automaticAreaMeasurementUtils.js";import{autoDistanceBetweenPoints2D as L,autoLength2D as F}from"../../support/automaticLengthMeasurementUtils.js";import D from"../../../geometry/Polyline.js";import z from"../../../geometry/Point.js";class P{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class q{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class K{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class N{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class B{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class J{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class Q{constructor(e){this.added=e,this.type="vertex-select"}}class W{constructor(e){this.removed=e,this.type="vertex-deselect"}}class X{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class Y{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const Z=k.reshapeGraphics,$={vertices:{default:new G({style:"circle",size:Z.vertex.size,color:Z.vertex.color,outline:{color:Z.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.vertex.hoverSize,color:Z.vertex.hoverColor,outline:{color:Z.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:Z.selected.size,color:Z.selected.color,outline:{color:Z.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:Z.midpoint.size,color:Z.midpoint.color,outline:{color:Z.midpoint.outlineColor,width:1}})}};let ee=class extends r.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingContext=null,this._snappingTask=null,this._stagedVertex=null,this._tooltip=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new s,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.tooltipOptions=new j,this.type="reshape",this.vertexGraphics=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new S({view:e}),this._setup(),this.addHandles([c((()=>e?.ready),(()=>{const{layer:e,view:t}=this;E(t,e),this.addHandles(t.on("key-down",(e=>this._keyDownHandler(e)),I.TOOL))}),{once:!0,initial:!0}),l((()=>this.graphic),(()=>this.refresh())),l((()=>this.layer),((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),l((()=>this.enableMidpoints),(()=>this.refresh())),d((()=>this.tooltipOptions.enabled),(e=>{this._tooltip=e?new R({view:this.view}):a(this._tooltip)}),m)])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._tooltip=a(this._tooltip)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=$.midpoints,vertices:i=$.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length>0&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||null==e.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&g(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new D({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=C.fromGeometry(t,b.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new x({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new V(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=a(this._editGeometryOperations),this._snappingTask=h(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=u(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((e,a)=>{const[h,p]=e;r.push(new t({geometry:new z({x:h,y:p,spatialReference:o}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),r}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:o}}=this,r=[];return e?.forEach(((e,n)=>{e.forEach(((a,h)=>{const[p,c]=a,l=e[h+1]?h+1:0;if("polygon"===this.graphic.geometry?.type||0!==l){const[a,d]=e[l],[m,v]=f([p,c],[a,d]);r.push(new t({geometry:new z({x:m,y:v,spatialReference:o}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:h,pointIndexEnd:l}}))}}))})),r}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i).items;e&&r.push(t),this._mover=new w({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e;if(s===this.graphic){const{geometry:o}=s;return this._setUpOperation(e),this._emitMoveStartEvent(t,i),void(null!=o&&"point"===o.type&&this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)})))}if(!this.selectedVertices.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),t=this._createVertexFromMidpoint(s);this._emitVertexAddEvent([s],e,t)}this._addToSelection(s)}this._setUpOperation(e),this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,(()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)}))}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)}));else if("point"===n.type)this._onHandleMove(o,i,s,e,(()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}));else if("polyline"===n.type||"polygon"===n.type){const t=this._getCoordinatesForUI(n);this._updateVertexGraphicLocations(t),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e,{operationType:r}=t;t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,(()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o))),this._isMidpoint(o)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(e){const t=this.view.spatialReference;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes,[r,n]=e[s][o];i.geometry=new z({x:r,y:n,spatialReference:t})}this._updateMidpointGraphicLocations(e)}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:o}=t.attributes,[r,n]=e[i][s],[a,h]=e[i][o],[p,c]=f([r,n],[a,h]);t.geometry=new z({x:p,y:c,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,s,o,r){h(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,p="graphic-move-stop"===o.type;if(null!=this.snappingManager&&this.selectedVertices.length<2&&!p){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,p),r(),this._snappingTask=i((async i=>{const h=await o.snap({point:a,context:n,signal:i});h.valid&&(this._stagedVertex=h.apply(),this._syncGeometryAfterVertexMove(e,new z(this._stagedVertex),t,s,p),r())}))}else{const i=null!=this._stagedVertex?new z(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,p),r()}}async _syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=this._editGeometryOperations.data.geometry;if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t),e.notifyGeometryChanged();else{const{x:n,y:a}=t,[h,p]=this._getIndicesForVertexGraphic(e);let c=u(r);const l=c[h].length-1;c[h][p]=[n,a],"polygon"===r.type&&(0===p?c[h][l]=[n,a]:p===l&&(c[h][0]=[n,a])),this._isVertex(e)&&(c=this._moveRelatedCoordinates(c,e,n,a),c=this._moveSelectedHandleCoordinates(c,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(c)),this.graphic.geometry=r.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:o}=t.attributes;for(const r of o){const o=this.vertexGraphics.at(r),{pathIndex:n,pointIndex:a}=o.attributes;e[n][a]=[i,s],o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){for(const r of this.selectedVertices)if(r!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=r.attributes,h=M(r.geometry,i,s,this.view),p=e[t].length-1;e[t][n]=[h.x,h.y],r.geometry=h,o&&(0===n?e[t][p]=[h.x,h.y]:n===p&&(e[t][0]=[h.x,h.y]));for(const i of a){const t=this.vertexGraphics.at(i),{pathIndex:s,pointIndex:o}=t.attributes;e[s][o]=[h.x,h.y],t.geometry=h}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic,i=this._isVertex(t);i&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default",this._updateTooltip()}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(null==s||"polygon"!==s.type&&"polyline"!==s.type)return[];const o=s.clone(),r=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:h}=e.attributes,{x:p,y:c}=e.geometry,l=0===h?a+1:h,d=u(o);return d[n].splice(l,0,[p,c]),e.attributes={...t,pathIndex:n,pointIndex:l,relatedGraphicIndices:[]},r.push({coordinates:d[n][l],componentIndex:n,vertexIndex:l}),this.graphic.geometry=o,r}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,o=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",o);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){O.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),o=i.clone();let r=u(o);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<r.length;t++){const s=r[t];for(let o=0;o<s.length;o++){const[a,h]=s[o];e===a&&i===h&&(n.push({coordinates:r[t][o],componentIndex:t,vertexIndex:o}),r[t].splice(Number(o),1))}}}if("polygon"===o.type)r=r.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,o]=e[e.length-1];return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)})),o.rings=r;else{for(const e of r)1===e.length&&r.splice(r.indexOf(e),1);o.paths=r}this.graphic.geometry=o,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_updateTooltip(e,t){null!=this._tooltip&&(e?e===this.graphic?this._updateMoveGraphicTooltip(t):this._updateMoveVertexTooltip(t):this._tooltip.clear())}_updateMoveGraphicTooltip(e){const{_tooltip:t,tooltipOptions:i,view:s}=this;if(null==t)return;const o=new H({tooltipOptions:i});if(e){const{x:t,y:i}=e.origin,r=s.toMap(e),n=s.toMap(v(t,i)),a=L(n,r);o.distance=null!=a?a:p}t.info=o}_updateMoveVertexTooltip(e){const{_tooltip:t,graphic:{geometry:i},tooltipOptions:s,view:o}=this;if(null==t)return;const r=new U({tooltipOptions:s});if(null!=i&&("polygon"===i.type?r.area=A(i):"polyline"===i.type&&(r.totalLength=F(i))),e){const{x:t,y:i}=e.origin,s=o.toMap(e),n=o.toMap(v(t,i)),a=L(n,s);r.distance=null!=a?a:p}t.info=r}_emitMoveStartEvent(e,t){const i=new N(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new B(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const e=this._activeOperationInfo;if(!e)return;const{totalDx:t,totalDy:i}=e,s=new J(this.graphic,t,i);this.emit("move-stop",s),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(s)}_emitReshapeStartEvent(e){const t=new P(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new q(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new K(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new Q(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new W(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new X(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new Y(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],ee.prototype,"_tooltip",void 0),e([y()],ee.prototype,"callbacks",void 0),e([y()],ee.prototype,"enableMidpoints",void 0),e([y()],ee.prototype,"enableMovement",void 0),e([y()],ee.prototype,"enableVertices",void 0),e([y()],ee.prototype,"graphic",void 0),e([y({value:!0})],ee.prototype,"highlightsEnabled",null),e([y()],ee.prototype,"layer",void 0),e([y({readOnly:!0})],ee.prototype,"midpointGraphics",void 0),e([y()],ee.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],ee.prototype,"selectedVertices",void 0),e([y()],ee.prototype,"snappingManager",void 0),e([y({readOnly:!0})],ee.prototype,"state",null),e([y({value:$})],ee.prototype,"symbols",null),e([y({type:j})],ee.prototype,"tooltipOptions",void 0),e([y({readOnly:!0})],ee.prototype,"type",void 0),e([y({readOnly:!0})],ee.prototype,"vertexGraphics",void 0),e([y()],ee.prototype,"view",void 0),ee=e([_("esri.views.draw.support.Reshape")],ee);const te=ee;export{te 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.28/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{equals as t,isSome as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{h as r}from"../../../chunks/vec3.js";import{c as a}from"../../../chunks/vec3f64.js";import l from"../../../geometry/Circle.js";import{simplify as s,distance as i}from"../../../geometry/geometryEngine.js";import{unnormalizeGeometryOnDatelineCrossing as c,isClockwise as y,unnormalizeVerticesOnDatelineCrossing as p}from"../../../geometry/support/coordsUtils.js";import{isValid as u}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as m}from"./surfaceCoordinateSystems.js";import f from"../../../geometry/Point.js";import x from"../../../geometry/Multipoint.js";import h from"../../../geometry/Polyline.js";import M from"../../../geometry/Polygon.js";function g(t,e){const o=new f({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function d(t,e){return new x({points:t,spatialReference:e})}function R(t,e,o){const n=new h({paths:t,spatialReference:e});return o&&c(n),n}function j(e,n,r,a=!0){const l=o(e);l.forEach((e=>{const o=e[0],n=e.at(-1);t(o,n)&&1!==e.length||e.push(e[0])}));let i=new M({rings:l,spatialReference:n});return i.rings.forEach((t=>{y(t)||t.reverse()})),r&&c(i),a&&i.isSelfIntersecting&&u(n)&&(i=s(i)),i}function T(t,o,n){const r=o.mapToLocalMultiple(t),a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y},i=Math.round(s.x-l.x),c=Math.round(s.y-l.y),y=Math.max(Math.abs(i),Math.abs(c));if(n){const t={x:l.x+y,y:l.y+y},e={x:l.x-y,y:l.y-y};a.push(m(t.x,e.y),m(e.x,e.y),m(e.x,t.y),m(t.x,t.y))}else{const t={x:i>0?l.x+y:l.x-y,y:c>0?l.y+y:l.y-y};a.push(m(l.x,l.y),m(t.x,l.y),m(t.x,t.y),m(l.x,t.y))}return U(j([a.map((t=>o.localToMap(t))).filter(e)],o.spatialReference,o.doUnnormalization,!0),a,o)}function b(t,o,n){let r=o.mapToLocalMultiple(t);if(1===r.length){const t=48,e=r[0];r=[m(e.x-t,e.y+t),m(e.x+t,e.y-t),m(e.x+t,e.y-t),m(e.x-t,e.y+t)]}const a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y};if(n){const t=Math.round(s.x-l.x),e=Math.round(s.y-l.y);a.push(m(l.x-t,l.y-e),m(s.x,l.y-e),m(s.x,s.y),m(l.x-t,s.y))}else a.push(m(l.x,l.y),m(s.x,l.y),m(s.x,s.y),m(l.x,s.y));return U(j([a.map((t=>o.localToMap(t))).filter(e)],o.spatialReference,o.doUnnormalization,!0),a,o)}function U(t,e,o){const n=P(e[3],e[2],o),r=P(e[1],e[2],o),a=P(e[0],e[1],o),l=P(e[0],e[3],o);return{geometry:t,midpoints:null!=n&&null!=r&&null!=a&&null!=l?{top:n,right:r,bottom:a,left:l}:null}}function P(t,e,o){w[0]=t.x,w[1]=t.y,w[2]=0,I[0]=e.x,I[1]=e.y,I[2]=0,r(w,w,I,.5),z.x=w[0],z.y=I[1],z.z=I[2];const n=o.localToMap(z);return null!=n?g(n,o.spatialReference):null}const z=m(0,0,0),w=a(),I=a();function L(t,e,o,r){const a=e.mapToLocalMultiple(t);let s=null,c=null;if(o)s=a[0],c=a[1];else{const t=a[0],e=a[1],o=Math.round(e.x-t.x),n=Math.round(e.y-t.y),r=Math.max(Math.abs(o),Math.abs(n));s=m(o>0?t.x+r/2:t.x-r/2,n>0?t.y+r/2:t.y-r/2),c=m(Math.abs(o)>Math.abs(n)?s.x-r/2:s.x,Math.abs(o)>Math.abs(n)?s.y:s.y-r/2)}const y=e.localToMap(s),f=e.localToMap(c);if(null==y||null==f)return null;e.doUnnormalization&&p([[y,f]],e.spatialReference);const x=g(y,e.spatialReference),h=g(f,e.spatialReference),M=n(e.spatialReference);let d=0;if(u(e.spatialReference))d=M*i(x,h,null);else{const t=s.x-c.x,e=s.y-c.y;d=M*Math.sqrt(t*t+e*e)*(r||1)}const R=new l({center:x,radius:d,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:j(R.rings,R.spatialReference,!1),center:x,edge:h}}function v(t,o,n){const r=o.mapToLocalMultiple(t),a=r[0],l=r[1],s=Math.round(l.x-a.x),i=Math.round(l.y-a.y),c=m(n?a.x:a.x+s/2,n?a.y:a.y+i/2),y=n?s:s/2,p=n?i:i/2,u=60,f=[],x=2*Math.PI/u;function h(t){const e=Math.cos(t),o=Math.sin(t);return m(y*e+c.x,p*o+c.y)}for(let e=0;e<u;e++)f.push(h(e*x));f.push(f[0]);const{spatialReference:M,doUnnormalization:d}=o,R=j([f.map((t=>o.localToMap(t))).filter(e)],M,d,!1),T=o.localToMap(h(Math.PI/2)),b=o.localToMap(h(0)),U=o.localToMap(h(-Math.PI/2)),P=o.localToMap(h(Math.PI));return{geometry:R,midpoints:null!=T&&null!=b&&null!=U&&null!=P?{top:g(T,M),right:g(b,M),bottom:g(U,M),left:g(P,M)}:null}}export{L as createCircle,v as createEllipse,d as createMultipoint,g as createPoint,j as createPolygon,R as createPolyline,b as createRectangle,T as createSquare};
5
+ import"../../../geometry.js";import{equals as t,isSome as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{h as r}from"../../../chunks/vec3.js";import{c as a}from"../../../chunks/vec3f64.js";import l from"../../../geometry/Circle.js";import{simplify as s,distance as i}from"../../../geometry/geometryEngine.js";import{unnormalizeGeometryOnDatelineCrossing as c,isClockwise as y,unnormalizeVerticesOnDatelineCrossing as p}from"../../../geometry/support/coordsUtils.js";import{isValid as u}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as m}from"./surfaceCoordinateSystems.js";import f from"../../../geometry/Point.js";import x from"../../../geometry/Multipoint.js";import h from"../../../geometry/Polyline.js";import M from"../../../geometry/Polygon.js";function g(t,e){const o=new f({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function d(t,e){return new x({points:t,spatialReference:e})}function R(t,e,o){const n=new h({paths:t,spatialReference:e});return o&&c(n),n}function j(e,n,r,a=!0){const l=o(e);l.forEach((e=>{const o=e[0],n=e[e.length-1];t(o,n)&&1!==e.length||e.push(e[0])}));let i=new M({rings:l,spatialReference:n});return i.rings.forEach((t=>{y(t)||t.reverse()})),r&&c(i),a&&i.isSelfIntersecting&&u(n)&&(i=s(i)),i}function T(t,o,n){const r=o.mapToLocalMultiple(t),a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y},i=Math.round(s.x-l.x),c=Math.round(s.y-l.y),y=Math.max(Math.abs(i),Math.abs(c));if(n){const t={x:l.x+y,y:l.y+y},e={x:l.x-y,y:l.y-y};a.push(m(t.x,e.y),m(e.x,e.y),m(e.x,t.y),m(t.x,t.y))}else{const t={x:i>0?l.x+y:l.x-y,y:c>0?l.y+y:l.y-y};a.push(m(l.x,l.y),m(t.x,l.y),m(t.x,t.y),m(l.x,t.y))}return U(j([a.map((t=>o.localToMap(t))).filter(e)],o.spatialReference,o.doUnnormalization,!0),a,o)}function b(t,o,n){let r=o.mapToLocalMultiple(t);if(1===r.length){const t=48,e=r[0];r=[m(e.x-t,e.y+t),m(e.x+t,e.y-t),m(e.x+t,e.y-t),m(e.x-t,e.y+t)]}const a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y};if(n){const t=Math.round(s.x-l.x),e=Math.round(s.y-l.y);a.push(m(l.x-t,l.y-e),m(s.x,l.y-e),m(s.x,s.y),m(l.x-t,s.y))}else a.push(m(l.x,l.y),m(s.x,l.y),m(s.x,s.y),m(l.x,s.y));return U(j([a.map((t=>o.localToMap(t))).filter(e)],o.spatialReference,o.doUnnormalization,!0),a,o)}function U(t,e,o){const n=P(e[3],e[2],o),r=P(e[1],e[2],o),a=P(e[0],e[1],o),l=P(e[0],e[3],o);return{geometry:t,midpoints:null!=n&&null!=r&&null!=a&&null!=l?{top:n,right:r,bottom:a,left:l}:null}}function P(t,e,o){w[0]=t.x,w[1]=t.y,w[2]=0,I[0]=e.x,I[1]=e.y,I[2]=0,r(w,w,I,.5),z.x=w[0],z.y=I[1],z.z=I[2];const n=o.localToMap(z);return null!=n?g(n,o.spatialReference):null}const z=m(0,0,0),w=a(),I=a();function L(t,e,o,r){const a=e.mapToLocalMultiple(t);let s=null,c=null;if(o)s=a[0],c=a[1];else{const t=a[0],e=a[1],o=Math.round(e.x-t.x),n=Math.round(e.y-t.y),r=Math.max(Math.abs(o),Math.abs(n));s=m(o>0?t.x+r/2:t.x-r/2,n>0?t.y+r/2:t.y-r/2),c=m(Math.abs(o)>Math.abs(n)?s.x-r/2:s.x,Math.abs(o)>Math.abs(n)?s.y:s.y-r/2)}const y=e.localToMap(s),f=e.localToMap(c);if(null==y||null==f)return null;e.doUnnormalization&&p([[y,f]],e.spatialReference);const x=g(y,e.spatialReference),h=g(f,e.spatialReference),M=n(e.spatialReference);let d=0;if(u(e.spatialReference))d=M*i(x,h,null);else{const t=s.x-c.x,e=s.y-c.y;d=M*Math.sqrt(t*t+e*e)*(r||1)}const R=new l({center:x,radius:d,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:j(R.rings,R.spatialReference,!1),center:x,edge:h}}function v(t,o,n){const r=o.mapToLocalMultiple(t),a=r[0],l=r[1],s=Math.round(l.x-a.x),i=Math.round(l.y-a.y),c=m(n?a.x:a.x+s/2,n?a.y:a.y+i/2),y=n?s:s/2,p=n?i:i/2,u=60,f=[],x=2*Math.PI/u;function h(t){const e=Math.cos(t),o=Math.sin(t);return m(y*e+c.x,p*o+c.y)}for(let e=0;e<u;e++)f.push(h(e*x));f.push(f[0]);const{spatialReference:M,doUnnormalization:d}=o,R=j([f.map((t=>o.localToMap(t))).filter(e)],M,d,!1),T=o.localToMap(h(Math.PI/2)),b=o.localToMap(h(0)),U=o.localToMap(h(-Math.PI/2)),P=o.localToMap(h(Math.PI));return{geometry:R,midpoints:null!=T&&null!=b&&null!=U&&null!=P?{top:g(T,M),right:g(b,M),bottom:g(U,M),left:g(P,M)}:null}}export{L as createCircle,v as createEllipse,d as createMultipoint,g as createPoint,j as createPolygon,R as createPolyline,b as createRectangle,T as createSquare};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as o,getContrast as r}from"../../core/colorUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as l,on as c}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{k as m,s as u,e as f,a as b,l as g,i as x}from"../../chunks/vec2.js";import{a as _}from"../../chunks/vec2f64.js";import{G as y}from"../../chunks/vec3.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as j}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as I}from"../../support/getDefaultUnitForView.js";import L from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as D}from"../support/automaticLengthMeasurementUtils.js";const w=3025,O={default:15,far:25};let S=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await j("esri/core/t9n/Units");n(e),this._messagesUnits=t}));this.addHandles([l((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>c((()=>this.context?.editGeometryOperations),e,(()=>this._update())))),i((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return O[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(null==e)return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=t.length;for(let i=0;i<r;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const a=n[0],l=n.at(-1);"polygon"===s.type&&n.length>2&&!y(a,l)&&n.push(a);const c=1===r&&!v(n);let p=k,h=P;this.toScreenPointArray(e,a,p);for(let t=1;t<n.length;++t){const s=n[t-1],o=n[t];this.toScreenPointArray(e,o,h),this._addLabel(e,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,r,i){const{label:n}=this._getOrCreateLabel(e);if(!this.visible||m(s,r)<w)return void(n.visible=!1);const l=null!=e.graphicState?e.graphicState.isDraped?"on-the-ground":"absolute-height":U(e.editGeometryOperations.data.geometry,e.elevationInfo),{spatialReference:c}=e.editGeometryOperations.data,p=D(t,o,c,l),h=this._messagesUnits,d=I(e.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const _=r[0]-s[0],y=r[1]-s[1];i?u(C,-y,_):u(C,y,-_),f(C,C),b(C,C,this._edgeDistancePixels),g(V,s,r,.5),x(V,V,C),n.position=[V[0],V[1]],Math.abs(C[0])>Math.abs(C[1])?n.anchor=C[0]>0?"left":"right":n.anchor=-C[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const{textColor:t}=e.view.effectiveTheme,s=o(r(t),.6),i=new L({anchor:"center",fontSize:10,textColor:t,backgroundColor:s});e.view.overlay?.items.add(i);const n={label:i};return this._labelInfos.push(n),this._nextLabelIndex=this._labelInfos.length,n}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){this.context?.view.overlay?.items.remove(e),e.destroy()}};e([h()],S.prototype,"context",void 0),e([h()],S.prototype,"stagedVertex",void 0),e([h()],S.prototype,"visible",void 0),e([h()],S.prototype,"edgeDistance",void 0),e([h()],S.prototype,"updating",null),e([h()],S.prototype,"_messagesUnits",void 0),e([h()],S.prototype,"_edgeDistancePixels",null),S=e([d("esri.views.interactive")],S);const C=_(),V=_(),k=p(),P=p();export{S as SegmentLabels};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as o,getContrast as r}from"../../core/colorUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as l,on as c}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{k as m,s as u,e as f,a as b,l as g,i as x}from"../../chunks/vec2.js";import{a as _}from"../../chunks/vec2f64.js";import{G as y}from"../../chunks/vec3.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as j}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as I}from"../../support/getDefaultUnitForView.js";import L from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as D}from"../support/automaticLengthMeasurementUtils.js";const w=3025,O={default:15,far:25};let S=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await j("esri/core/t9n/Units");n(e),this._messagesUnits=t}));this.addHandles([l((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>c((()=>this.context?.editGeometryOperations),e,(()=>this._update())))),i((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return O[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(null==e)return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=t.length;for(let i=0;i<r;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const a=n[0],l=n[n.length-1];"polygon"===s.type&&n.length>2&&!y(a,l)&&n.push(a);const c=1===r&&!v(n);let p=k,h=P;this.toScreenPointArray(e,a,p);for(let t=1;t<n.length;++t){const s=n[t-1],o=n[t];this.toScreenPointArray(e,o,h),this._addLabel(e,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,r,i){const{label:n}=this._getOrCreateLabel(e);if(!this.visible||m(s,r)<w)return void(n.visible=!1);const l=null!=e.graphicState?e.graphicState.isDraped?"on-the-ground":"absolute-height":U(e.editGeometryOperations.data.geometry,e.elevationInfo),{spatialReference:c}=e.editGeometryOperations.data,p=D(t,o,c,l),h=this._messagesUnits,d=I(e.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const _=r[0]-s[0],y=r[1]-s[1];i?u(C,-y,_):u(C,y,-_),f(C,C),b(C,C,this._edgeDistancePixels),g(V,s,r,.5),x(V,V,C),n.position=[V[0],V[1]],Math.abs(C[0])>Math.abs(C[1])?n.anchor=C[0]>0?"left":"right":n.anchor=-C[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const{textColor:t}=e.view.effectiveTheme,s=o(r(t),.6),i=new L({anchor:"center",fontSize:10,textColor:t,backgroundColor:s});e.view.overlay?.items.add(i);const n={label:i};return this._labelInfos.push(n),this._nextLabelIndex=this._labelInfos.length,n}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){this.context?.view.overlay?.items.remove(e),e.destroy()}};e([h()],S.prototype,"context",void 0),e([h()],S.prototype,"stagedVertex",void 0),e([h()],S.prototype,"visible",void 0),e([h()],S.prototype,"edgeDistance",void 0),e([h()],S.prototype,"updating",null),e([h()],S.prototype,"_messagesUnits",void 0),e([h()],S.prototype,"_edgeDistancePixels",null),S=e([d("esri.views.interactive")],S);const C=_(),V=_(),k=p(),P=p();export{S as SegmentLabels};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{equals as e}from"../../../core/arrayUtils.js";import t from"../../../core/Evented.js";import s from"../../../geometry/Polygon.js";import i from"../../../geometry/Polyline.js";import{createCoordinateHelper as r}from"../coordinateHelper.js";import{unnormalize as o,getUnnormalizationInfo as n}from"./unnormalizationHelper.js";import{epsilon as h}from"../../support/geometry3dUtils.js";class c{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}}class l{constructor(e,t,s){this.component=e,this.leftVertex=t,this.rightVertex=s,this.type="edge",t.rightEdge=this,s.leftEdge=this}}class p{constructor(e,t){this._spatialReference=e,this._viewingMode=t,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||o(this.vertices,n(this._spatialReference,this._viewingMode))}updateVertexIndex(e,t){if(0===this.vertices.length)return;const s=this.vertices[0];let i=null,r=e,o=t;do{i=r,i.index=o++,r=i.rightEdge?i.rightEdge.rightVertex:null}while(null!=r&&r!==s);i.leftEdge&&i!==this.vertices.at(-1)&&this.swapVertices(this.vertices.indexOf(i),this.vertices.length-1)}getFirstVertex(){return 0===this.vertices.length?null:this.vertices[0]}getLastVertex(){return 0===this.vertices.length?null:this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&null!==this.vertices[0].leftEdge}swapVertices(e,t){const s=this.vertices[e];this.vertices[e]=this.vertices[t],this.vertices[t]=s}iterateVertices(e){if(0===this.vertices.length)return;const t=this.vertices[0];let s=t;do{e(s,s.index),s=null!=s.rightEdge?s.rightEdge.rightVertex:null}while(s!==t&&null!=s)}}class g extends t{constructor(e,t){super(),this.type=e,this.coordinateHelper=t,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon()}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}notifyChanges(e){this._dirty=!0,this.emit("change",e)}firstNonVerticalEdge(){for(const e of this.components)for(const t of e.edges){const e=t.leftVertex.pos,s=t.rightVertex.pos,i=e[0]-s[0],r=e[1]-s[1];if(i*i+r*r>h)return t}return null}_toPoint(){return 0===this.components.length||0===this.components[0].vertices.length?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const e=[],t=this.coordinateHelper.vectorToArray;for(const s of this.components){if(s.vertices.length<1)continue;const i=[];let r=s.vertices.find((e=>null==e.leftEdge));const o=r;do{i.push(t(r.pos)),r=r.rightEdge?r.rightEdge.rightVertex:null}while(r&&r!==o);e.push(i)}return new i({paths:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[],t=this.coordinateHelper.vectorToArray;for(const s of this.components){if(s.vertices.length<1)continue;const i=[],r=s.vertices[0];let o=r;const n=o;do{i.push(t(o.pos)),o=null!=o.rightEdge?o.rightEdge.rightVertex:null}while(o&&o!==n);s.isClosed()&&i.push(t(r.pos)),e.push(i)}return new s({rings:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,s){const i=t.spatialReference,o=r(t.hasZ,t.hasM,i),n=new g(t.type,o);switch(t.type){case"polygon":{const r=t.rings;for(let t=0;t<r.length;++t){const h=r[t],g=new p(i,s);g.index=t;const a=h.length>2&&e(h[0],h.at(-1)),d=a?h.length-1:h.length;for(let e=0;e<d;++e){const t=o.arrayToVector(h[e]),s=new c(g);g.vertices.push(s),s.pos=t,s.index=e}const u=g.vertices.length-1;for(let e=0;e<u;++e){const t=g.vertices[e],s=g.vertices[e+1],i=new l(g,t,s);g.edges.push(i)}if(a){const e=new l(g,g.vertices.at(-1),g.vertices[0]);g.edges.push(e)}n.components.push(g)}break}case"polyline":{const e=t.paths;for(let t=0;t<e.length;++t){const r=e[t],h=new p(i,s);h.index=t;const g=r.length;for(let e=0;e<g;++e){const t=o.arrayToVector(r[e]),s=new c(h);h.vertices.push(s),s.pos=t,s.index=e}const a=h.vertices.length-1;for(let e=0;e<a;++e){const t=h.vertices[e],s=h.vertices[e+1],i=new l(h,t,s);h.edges.push(i)}n.components.push(h)}break}case"point":{const e=new p(i,s);e.index=0;const r=new c(e);r.index=0,r.pos=o.pointToVector(t),e.vertices.push(r),n.components.push(e);break}}return n}}export{p as Component,l as Edge,g as EditGeometry,c as Vertex};
5
+ import{equals as e}from"../../../core/arrayUtils.js";import t from"../../../core/Evented.js";import s from"../../../geometry/Polygon.js";import i from"../../../geometry/Polyline.js";import{createCoordinateHelper as r}from"../coordinateHelper.js";import{unnormalize as n,getUnnormalizationInfo as o}from"./unnormalizationHelper.js";import{epsilon as h}from"../../support/geometry3dUtils.js";class c{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}}class l{constructor(e,t,s){this.component=e,this.leftVertex=t,this.rightVertex=s,this.type="edge",t.rightEdge=this,s.leftEdge=this}}class p{constructor(e,t){this._spatialReference=e,this._viewingMode=t,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||n(this.vertices,o(this._spatialReference,this._viewingMode))}updateVertexIndex(e,t){if(0===this.vertices.length)return;const s=this.vertices[0];let i=null,r=e,n=t;do{i=r,i.index=n++,r=i.rightEdge?i.rightEdge.rightVertex:null}while(null!=r&&r!==s);i.leftEdge&&i!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(i),this.vertices.length-1)}getFirstVertex(){return 0===this.vertices.length?null:this.vertices[0]}getLastVertex(){return 0===this.vertices.length?null:this.vertices[this.vertices.length-1]}isClosed(){return this.vertices.length>2&&null!==this.vertices[0].leftEdge}swapVertices(e,t){const s=this.vertices[e];this.vertices[e]=this.vertices[t],this.vertices[t]=s}iterateVertices(e){if(0===this.vertices.length)return;const t=this.vertices[0];let s=t;do{e(s,s.index),s=null!=s.rightEdge?s.rightEdge.rightVertex:null}while(s!==t&&null!=s)}}class g extends t{constructor(e,t){super(),this.type=e,this.coordinateHelper=t,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon()}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}notifyChanges(e){this._dirty=!0,this.emit("change",e)}firstNonVerticalEdge(){for(const e of this.components)for(const t of e.edges){const e=t.leftVertex.pos,s=t.rightVertex.pos,i=e[0]-s[0],r=e[1]-s[1];if(i*i+r*r>h)return t}return null}_toPoint(){return 0===this.components.length||0===this.components[0].vertices.length?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const e=[],t=this.coordinateHelper.vectorToArray;for(const s of this.components){if(s.vertices.length<1)continue;const i=[];let r=s.vertices.find((e=>null==e.leftEdge));const n=r;do{i.push(t(r.pos)),r=r.rightEdge?r.rightEdge.rightVertex:null}while(r&&r!==n);e.push(i)}return new i({paths:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[],t=this.coordinateHelper.vectorToArray;for(const s of this.components){if(s.vertices.length<1)continue;const i=[],r=s.vertices[0];let n=r;const o=n;do{i.push(t(n.pos)),n=null!=n.rightEdge?n.rightEdge.rightVertex:null}while(n&&n!==o);s.isClosed()&&i.push(t(r.pos)),e.push(i)}return new s({rings:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,s){const i=t.spatialReference,n=r(t.hasZ,t.hasM,i),o=new g(t.type,n);switch(t.type){case"polygon":{const r=t.rings;for(let t=0;t<r.length;++t){const h=r[t],g=new p(i,s);g.index=t;const a=h.length>2&&e(h[0],h[h.length-1]),d=a?h.length-1:h.length;for(let e=0;e<d;++e){const t=n.arrayToVector(h[e]),s=new c(g);g.vertices.push(s),s.pos=t,s.index=e}const u=g.vertices.length-1;for(let e=0;e<u;++e){const t=g.vertices[e],s=g.vertices[e+1],i=new l(g,t,s);g.edges.push(i)}if(a){const e=new l(g,g.vertices[g.vertices.length-1],g.vertices[0]);g.edges.push(e)}o.components.push(g)}break}case"polyline":{const e=t.paths;for(let t=0;t<e.length;++t){const r=e[t],h=new p(i,s);h.index=t;const g=r.length;for(let e=0;e<g;++e){const t=n.arrayToVector(r[e]),s=new c(h);h.vertices.push(s),s.pos=t,s.index=e}const a=h.vertices.length-1;for(let e=0;e<a;++e){const t=h.vertices[e],s=h.vertices[e+1],i=new l(h,t,s);h.edges.push(i)}o.components.push(h)}break}case"point":{const e=new p(i,s);e.index=0;const r=new c(e);r.index=0,r.pos=n.pointToVector(t),e.vertices.push(r),o.components.push(e);break}}return o}}export{p as Component,l as Edge,g as EditGeometry,c as Vertex};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{EditGeometry as r}from"./EditGeometry.js";import{AccumulationBehaviour as o}from"./interfaces.js";import{AppendVertex as s}from"./operations/AppendVertex.js";import{UpdateVertices as i,AccumulationType as n}from"./operations/UpdateVertices.js";import{RemoveVertices as a}from"./operations/RemoveVertices.js";import{SplitEdge as p}from"./operations/SplitEdge.js";import{SetVertexPosition as d}from"./operations/SetVertexPosition.js";import{CloseComponent as c}from"./operations/CloseComponent.js";import{MoveVertex as u}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as h}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as m}from"./operations/RotateVertex.js";import{ScaleVertex as l}from"./operations/ScaleVertex.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class V extends e{constructor(e){super(),this.data=e,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",(e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})}))}destroy(){this._listener.remove()}splitEdge(e,t){return this._apply(new p(this.data,e,t))}updateVertices(e,t,r=o.ACCUMULATE_STEPS){return this._apply(new i(this.data,e,t),r)}moveVertices(e,t,r,s,i=o.ACCUMULATE_STEPS){return this.updateVertices(e,new u(this.data.coordinateHelper,t,r,s),i)}scaleVertices(e,t,r,s,i,a=o.ACCUMULATE_STEPS,p=n.CUMULATIVE){return this.updateVertices(e,new l(t,r,s,i,p),a)}rotateVertices(e,t,r,s=o.ACCUMULATE_STEPS,i=n.CUMULATIVE){return this.updateVertices(e,new m(t,r,i),s)}removeVertices(e){return this._apply(new a(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return 0===this.data.components.length?null:this._apply(new s(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new d(this.data,e,t))}offsetEdge(e,t,r,s=o.ACCUMULATE_STEPS){return this.updateVertices([t.leftVertex,t.rightVertex],new h(this.data.coordinateHelper,e,t,r),s)}closeComponent(e){return this.data.components.includes(e)?this._apply(new c(this.data,e)):null}canRemoveVertex(){return this.data.components[0].vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t((()=>e.close()))}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack.at(-1):null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=o.ACCUMULATE_STEPS){return t!==o.NEW_STEP&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}static fromGeometry(e,t){return new V(r.fromGeometry(e,t))}}export{V as EditGeometryOperations};
5
+ import e from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{EditGeometry as r}from"./EditGeometry.js";import{AccumulationBehaviour as o}from"./interfaces.js";import{AppendVertex as s}from"./operations/AppendVertex.js";import{UpdateVertices as i,AccumulationType as n}from"./operations/UpdateVertices.js";import{RemoveVertices as a}from"./operations/RemoveVertices.js";import{SplitEdge as p}from"./operations/SplitEdge.js";import{SetVertexPosition as d}from"./operations/SetVertexPosition.js";import{CloseComponent as c}from"./operations/CloseComponent.js";import{MoveVertex as h}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as u}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as m}from"./operations/RotateVertex.js";import{ScaleVertex as l}from"./operations/ScaleVertex.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class V extends e{constructor(e){super(),this.data=e,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",(e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})}))}destroy(){this._listener.remove()}splitEdge(e,t){return this._apply(new p(this.data,e,t))}updateVertices(e,t,r=o.ACCUMULATE_STEPS){return this._apply(new i(this.data,e,t),r)}moveVertices(e,t,r,s,i=o.ACCUMULATE_STEPS){return this.updateVertices(e,new h(this.data.coordinateHelper,t,r,s),i)}scaleVertices(e,t,r,s,i,a=o.ACCUMULATE_STEPS,p=n.CUMULATIVE){return this.updateVertices(e,new l(t,r,s,i,p),a)}rotateVertices(e,t,r,s=o.ACCUMULATE_STEPS,i=n.CUMULATIVE){return this.updateVertices(e,new m(t,r,i),s)}removeVertices(e){return this._apply(new a(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return 0===this.data.components.length?null:this._apply(new s(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new d(this.data,e,t))}offsetEdge(e,t,r,s=o.ACCUMULATE_STEPS){return this.updateVertices([t.leftVertex,t.rightVertex],new u(this.data.coordinateHelper,e,t,r),s)}closeComponent(e){return this.data.components.includes(e)?this._apply(new c(this.data,e)):null}canRemoveVertex(){return this.data.components[0].vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t((()=>e.close()))}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=o.ACCUMULATE_STEPS){return t!==o.NEW_STEP&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}static fromGeometry(e,t){return new V(r.fromGeometry(e,t))}}export{V as EditGeometryOperations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(){this._operations=[],this._closed=!1}close(){this._closed=!0}apply(){for(const t of this._operations)t.apply()}undo(){for(let t=this._operations.length-1;t>=0;t--)this._operations[t].undo()}accumulate(t){if(this._closed)return!1;const o=this._operations.length?this._operations.at(-1):null;return o&&o.accumulate(t)||(this._operations.push(t),t.apply()),!0}}export{t as UndoGroup};
5
+ class t{constructor(){this._operations=[],this._closed=!1}close(){this._closed=!0}apply(){for(const t of this._operations)t.apply()}undo(){for(let t=this._operations.length-1;t>=0;t--)this._operations[t].undo()}accumulate(t){if(this._closed)return!1;const o=this._operations.length?this._operations[this._operations.length-1]:null;return o&&o.accumulate(t)||(this._operations.push(t),t.apply()),!0}}export{t as UndoGroup};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.addHandles([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added.at(-1);this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(e?.visible?e:null)))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&("inherited"===this.layer?.visibilityMode?i():"exclusive"===this.layer?.visibilityMode&&e())}};i([a({cast:r})],h.prototype,"layerViews",null),i([a({readOnly:!0})],h.prototype,"updatingProgress",null),i([a()],h.prototype,"view",void 0),h=i([y("esri.views.layers.GroupLayerView")],h);const n=h;export{n as default};
5
+ import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.addHandles([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(e?.visible?e:null)))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&("inherited"===this.layer?.visibilityMode?i():"exclusive"===this.layer?.visibilityMode&&e())}};i([a({cast:r})],h.prototype,"layerViews",null),i([a({readOnly:!0})],h.prototype,"updatingProgress",null),i([a()],h.prototype,"view",void 0),h=i([y("esri.views.layers.GroupLayerView")],h);const n=h;export{n 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.28/esri/copyright.txt for details.
4
4
  */
5
- import{NestedMap as t}from"../../core/NestedMap.js";import{Program as r}from"./Program.js";class e{constructor(r){this._rctx=r,this._store=new t}dispose(){this._store.forEach((t=>t.forEach((t=>t.dispose())))),this._store.clear()}acquire(t,e,s,o){const c=this._store.get(t,e);if(null!=c)return c.ref(),c;const h=new r(this._rctx,t,e,s,o);return h.ref(),this._store.set(t,e,h),h}get test(){let t=0;return this._store.forEach((r=>r.forEach((r=>t+=r.hasGLName?2:1)))),{cachedWebGLObjects:t}}}export{e as ProgramCache};
5
+ import{NestedMap as r}from"../../core/NestedMap.js";import{Program as t}from"./Program.js";class e{constructor(t){this._rctx=t,this._store=new r}dispose(){this._store.forEach((r=>r.forEach((r=>r.dispose())))),this._store.clear()}acquire(r,e,s,o){const c=this._store.get(r,e);if(null!=c)return c.ref(),c;const h=new t(this._rctx,r,e,s,o);return h.ref(),this._store.set(r,e,h),h}get test(){let r=0;return this._store.forEach((t=>t.forEach((t=>r+=t.hasGLName?2:1)))),{cachedWebGLProgramObjects:r}}}export{e as ProgramCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Basemap.js";import t from"../../Ground.js";import n from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as r,Integer as a}from"../../core/accessorSupport/ensureType.js";import{isCollection as y}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import o from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as s}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as u}from"../../layers/mixins/operationalLayers.js";import l from"../../layers/support/Sublayer.js";import{JoinTableDataSource as i,DataLayerSource as c}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as m}from"../../layers/support/source/MapLayerSource.js";import{ScanContext as f}from"./utils.js";async function d(e){return S(null,{typeName:"json",type:e},new f)}async function b(e,t,n){switch(t.typeName){case"array":await v(e,t,n);break;case"union":await k(e,t,n);break;case"json":await S(e,t,n);break;case"native":await w(e,t,n);break;case"enum":await j(e,t,n)}}async function w(e,t,n){n.addProperty({name:e,type:_(t),default:t.default})}function N(e){const t=e.slice();return t.sort(),t}async function j(e,t,n){const r=t.values.slice();t.nullable&&r.push(null),n.currentClass&&n.currentClass.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`}):n.addProperty({name:e,type:_(t),enum:N(r).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|"),default:t.default})}async function v(e,t,n){await b(`${e}[]`,t.elementType,n)}function g(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;if(y&&Array.isArray(y)&&1===y.length&&"string"==typeof y[0])return a?y[0]:I(n,y[0])}return t}async function k(e,t,n){const r=[];for(const a of t.types)if("native"!==a.type.typeName&&t.key){const t=`${e}<${g(a.type,a.value)}>`;await b(t,a.type,n)}else r.push(a.type);if(r.length){const a=r.map(_);t.nullable&&a.push("null"),a.sort(),n.addProperty({type:a.join("|"),name:e,default:t.default})}}async function T(r,a){return r.type===n&&"layers"===a?P("web-scene/operational-layers"):r.type!==e||"baseLayers"!==a&&"baseMapLayers"!==a?r.type===e&&"elevationLayers"===a||r.type===t&&"layers"===a?P("web-scene/ground"):r.type===o&&"layers"===a?P("web-scene/operational-layers",(e=>e!==o)):r.type!==i||"leftTableSource"!==a&&"rightTableSource"!==a?null:B({key:"type",base:null,typeMap:{"data-layer":c,"map-layer":m}}):P("web-scene/basemap")}async function h(e,t,n){const r=await T(e,t);return r||C(n)}function M(e){return e.prototype.declaredClass.replaceAll(".","/")}async function S(e,t,n){const r=t.type.__accessorMetadata__,a=M(t.type);if(!r)return e&&n.addProperty({name:e,type:"unknown"}),null;let y=a,o=null;const p=e&&e.match(/<([^>]+)>$/);p&&(y+=`--${p[1]}`,o=p[1]),t.type===l&&(y+=`--${n.currentClass?.name}`,o=n.currentClass?.name);const s=n.seen.get(y);if(s&&e)return n.addProperty({name:e,type:s}),s;const u={type:t.type,name:a,id:y,properties:[]};e&&(n.addProperty({name:e,type:u}),u.typeValue=o),n.push(e,u);for(const i in r){const e=r[i],a=K(e);if(!a||!a.enabled)continue;if(t.type===l){const e=n.stack.at(-2),t="esri/layers/TileLayer"===e?.klass.name;if(t&&l.test.isMapImageLayerOverridePolicy(a.overridePolicy)||!t&&l.test.isTileImageLayerOverridePolicy(a.overridePolicy))continue}const y=a.target;if("string"==typeof y||null==y){const r=await h(t,i,e);if(!r)continue;await b("string"==typeof y?y:i,r,n)}else await L(t,y,n)}return n.pop()}async function L(e,t,n){for(const r in t){let a=await T(e,r);if(!a){const e=t[r];a=e.types?B(e.types):V(e.type),a.default=e.default,a=O(a)}await b(r,a,n)}}async function P(e,t){const n={typeName:"union",key:"layerType",types:[]};for(const r in u[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===r)continue;const a=await s[r]();a&&(t&&!t(a)||a!==p&&n.types.push({type:{typeName:"json",type:a},value:r}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function _(e){switch(e.typeName){case"array":return`${_(e.elementType)}[]`;case"union":{const t=e.types.map((e=>_(e.type)));return e.nullable&&t.push("null"),t.sort(),`${t.join(" | ")}`}case"native":switch(e.type){case Number:return"number";case a:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";default:return"unknown"}case"json":return e.type.prototype.declaredClass;case"enum":return"string"}}function $(e){const t=e.prototype.itemType&&e.prototype.itemType.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:V(t)};if(t.typeMap){const e=[];for(const n in t.typeMap){const r=t.typeMap[n];e.push({type:V(r),value:D(r)?null:n})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function A(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;return y&&Array.isArray(y)&&"string"==typeof y[0]?a||n.type.map((e=>I(n,e))):null}function O(e){if("array"===e.typeName)return e.elementType=O(e.elementType),e;const t=A(e);return t?{typeName:"union",key:"type",nullable:e.nullable,types:t.map((t=>({value:t,type:e})))}:e}function C(e){const t=E(e);return t?.types?B(t.types):!t?.type&&e.types?B(e.types):x(O(J(e)))}function x(e){return e.nullable&&"native"===e.typeName?{typeName:"union",key:null,types:[{value:null,type:e}],nullable:!0}:e}function B(e){if(Array.isArray(e))return{typeName:"array",elementType:B(e[0])};const t=[];for(const n in e.typeMap){const r=e.typeMap[n];t.push({type:V(r),value:D(r)?null:n})}return{typeName:"union",key:"string"==typeof e.key?e.key:"type",types:t}}function G(e){return null!=e&&e.isJSONMapWriter}function I(e,t){const n=K(e);if(n&&G(n.writer)){const e={value:""};return n.writer?.(t,e,"value"),e.value}return t}function J(e){const t=E(e),n=K(e),r=V(t&&t.type||e.type);return t&&void 0!==t.default&&"function"!=typeof t.default&&(r.default=I(e,t.default)),n?.allowNull&&(r.nullable=!0),r}function V(e){return e?r(e)?W(e):Array.isArray(e)?"string"==typeof e[0]||"number"==typeof e[0]?{typeName:"enum",values:e}:e.length>1?{typeName:"union",key:null,types:e.map((e=>({type:V(e),value:null})))}:{typeName:"array",elementType:V(e[0])}:y(e)?$(e):D(e)?{typeName:"native",type:e}:z(e)?{typeName:"json",type:e}:{typeName:"native",type:null}:{typeName:"native",type:null}}function W(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:V(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map((e=>({type:W(e),value:null})))}}}function z(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function D(e){return e===String||e===Boolean||e===Number||e===a||e===Object}function E(e){if(!e.json)return null;const t=e.json.origins,n=e.json,r=t&&t["web-scene"],a=t&&t["web-document"];return r||a||n||null}function K(e){if(!e.json)return null;const t=e.json.origins,n=e.json.write,r=t&&t["web-scene"]&&t["web-scene"].write,a=t&&t["web-document"]&&t["web-document"].write;return r||a||n||null}export{d as scan};
5
+ import e from"../../Basemap.js";import t from"../../Ground.js";import n from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as r,Integer as a}from"../../core/accessorSupport/ensureType.js";import{isCollection as y}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import o from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as s}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as u}from"../../layers/mixins/operationalLayers.js";import l from"../../layers/support/Sublayer.js";import{JoinTableDataSource as i,DataLayerSource as c}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as m}from"../../layers/support/source/MapLayerSource.js";import{ScanContext as f}from"./utils.js";async function d(e){return S(null,{typeName:"json",type:e},new f)}async function b(e,t,n){switch(t.typeName){case"array":await v(e,t,n);break;case"union":await k(e,t,n);break;case"json":await S(e,t,n);break;case"native":await w(e,t,n);break;case"enum":await j(e,t,n)}}async function w(e,t,n){n.addProperty({name:e,type:_(t),default:t.default})}function N(e){const t=e.slice();return t.sort(),t}async function j(e,t,n){const r=t.values.slice();t.nullable&&r.push(null),n.currentClass&&n.currentClass.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`}):n.addProperty({name:e,type:_(t),enum:N(r).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|"),default:t.default})}async function v(e,t,n){await b(`${e}[]`,t.elementType,n)}function g(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;if(y&&Array.isArray(y)&&1===y.length&&"string"==typeof y[0])return a?y[0]:I(n,y[0])}return t}async function k(e,t,n){const r=[];for(const a of t.types)if("native"!==a.type.typeName&&t.key){const t=`${e}<${g(a.type,a.value)}>`;await b(t,a.type,n)}else r.push(a.type);if(r.length){const a=r.map(_);t.nullable&&a.push("null"),a.sort(),n.addProperty({type:a.join("|"),name:e,default:t.default})}}async function h(r,a){return r.type===n&&"layers"===a?P("web-scene/operational-layers"):r.type!==e||"baseLayers"!==a&&"baseMapLayers"!==a?r.type===e&&"elevationLayers"===a||r.type===t&&"layers"===a?P("web-scene/ground"):r.type===o&&"layers"===a?P("web-scene/operational-layers",(e=>e!==o)):r.type!==i||"leftTableSource"!==a&&"rightTableSource"!==a?null:B({key:"type",base:null,typeMap:{"data-layer":c,"map-layer":m}}):P("web-scene/basemap")}async function T(e,t,n){const r=await h(e,t);return r||C(n)}function M(e){return e.prototype.declaredClass.replaceAll(".","/")}async function S(e,t,n){const r=t.type.__accessorMetadata__,a=M(t.type);if(!r)return e&&n.addProperty({name:e,type:"unknown"}),null;let y=a,o=null;const p=e&&e.match(/<([^>]+)>$/);p&&(y+=`--${p[1]}`,o=p[1]),t.type===l&&(y+=`--${n.currentClass?.name}`,o=n.currentClass?.name);const s=n.seen.get(y);if(s&&e)return n.addProperty({name:e,type:s}),s;const u={type:t.type,name:a,id:y,properties:[]};e&&(n.addProperty({name:e,type:u}),u.typeValue=o),n.push(e,u);for(const i in r){const e=r[i],a=K(e);if(!a||!a.enabled)continue;if(t.type===l){const e="esri/layers/TileLayer"===n.stack[n.stack.length-2].klass.name;if(e&&l.test.isMapImageLayerOverridePolicy(a.overridePolicy)||!e&&l.test.isTileImageLayerOverridePolicy(a.overridePolicy))continue}const y=a.target;if("string"==typeof y||null==y){const r=await T(t,i,e);if(!r)continue;await b("string"==typeof y?y:i,r,n)}else await L(t,y,n)}return n.pop()}async function L(e,t,n){for(const r in t){let a=await h(e,r);if(!a){const e=t[r];a=e.types?B(e.types):V(e.type),a.default=e.default,a=O(a)}await b(r,a,n)}}async function P(e,t){const n={typeName:"union",key:"layerType",types:[]};for(const r in u[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===r)continue;const a=await s[r]();a&&(t&&!t(a)||a!==p&&n.types.push({type:{typeName:"json",type:a},value:r}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function _(e){switch(e.typeName){case"array":return`${_(e.elementType)}[]`;case"union":{const t=e.types.map((e=>_(e.type)));return e.nullable&&t.push("null"),t.sort(),`${t.join(" | ")}`}case"native":switch(e.type){case Number:return"number";case a:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";default:return"unknown"}case"json":return e.type.prototype.declaredClass;case"enum":return"string"}}function $(e){const t=e.prototype.itemType&&e.prototype.itemType.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:V(t)};if(t.typeMap){const e=[];for(const n in t.typeMap){const r=t.typeMap[n];e.push({type:V(r),value:D(r)?null:n})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function A(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;return y&&Array.isArray(y)&&"string"==typeof y[0]?a||n.type.map((e=>I(n,e))):null}function O(e){if("array"===e.typeName)return e.elementType=O(e.elementType),e;const t=A(e);return t?{typeName:"union",key:"type",nullable:e.nullable,types:t.map((t=>({value:t,type:e})))}:e}function C(e){const t=E(e);return t?.types?B(t.types):!t?.type&&e.types?B(e.types):x(O(J(e)))}function x(e){return e.nullable&&"native"===e.typeName?{typeName:"union",key:null,types:[{value:null,type:e}],nullable:!0}:e}function B(e){if(Array.isArray(e))return{typeName:"array",elementType:B(e[0])};const t=[];for(const n in e.typeMap){const r=e.typeMap[n];t.push({type:V(r),value:D(r)?null:n})}return{typeName:"union",key:"string"==typeof e.key?e.key:"type",types:t}}function G(e){return null!=e&&e.isJSONMapWriter}function I(e,t){const n=K(e);if(n&&G(n.writer)){const e={value:""};return n.writer?.(t,e,"value"),e.value}return t}function J(e){const t=E(e),n=K(e),r=V(t&&t.type||e.type);return t&&void 0!==t.default&&"function"!=typeof t.default&&(r.default=I(e,t.default)),n?.allowNull&&(r.nullable=!0),r}function V(e){return e?r(e)?W(e):Array.isArray(e)?"string"==typeof e[0]||"number"==typeof e[0]?{typeName:"enum",values:e}:e.length>1?{typeName:"union",key:null,types:e.map((e=>({type:V(e),value:null})))}:{typeName:"array",elementType:V(e[0])}:y(e)?$(e):D(e)?{typeName:"native",type:e}:z(e)?{typeName:"json",type:e}:{typeName:"native",type:null}:{typeName:"native",type:null}}function W(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:V(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map((e=>({type:W(e),value:null})))}}}function z(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function D(e){return e===String||e===Boolean||e===Number||e===a||e===Object}function E(e){if(!e.json)return null;const t=e.json.origins,n=e.json,r=t&&t["web-scene"],a=t&&t["web-document"];return r||a||n||null}function K(e){if(!e.json)return null;const t=e.json.origins,n=e.json.write,r=t&&t["web-scene"]&&t["web-scene"].write,a=t&&t["web-document"]&&t["web-document"].write;return r||a||n||null}export{d as scan};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties&&t.properties.type.enum)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach((e=>t.distinctTypes.push(e))),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e){return"array"===e.type||!("properties"in e)}function c(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function l(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r),l=n?n.replace("<?TYPE?>",a?`<${a}>`:""):"";if(o(r)){const n=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return n&&i.push(null,n),await L(r,l,i),i.schemaStack.pop(),n}const p=c(e,t,i),u="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(p);if(u&&l)return i.addProperty({name:l,type:u}),i.schemaStack.pop(),u;const f={type:e,name:e,id:p,typeValue:t,properties:[]};return l&&i.addProperty({name:l,type:f}),i.push(l,f),await L(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=R(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t&&!t.includes("<?TYPE?>")?`${t}<?TYPE?>`:t;await l(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack.at(-1)?.replace(/_schema\.json/,""):null;await l(n.schemaId,i,n.schema,t,r)}function u(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function f(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*(imageServiceLayer|tiledImageServiceLayer)_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e){return!!e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function m(e){switch(e.schemaStack.at(-1)){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const y=/raster.*Renderer|vectorFieldRenderer/,d=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,_=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function w(e,t,r){if(h(r)){const n=u(r,t),s=f(r,t);return e.filter((e=>{if(/uniqueValueFromStyleRenderer_schema\.json$/.test(e.$ref))return!1;if(s)return d.test(e.$ref)&&!_.test(e.$ref);if(y.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t}))}if(m(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer"];return e.filter((e=>!t.some((t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))))}return e}async function j(e,t,r){await L(e.items,`${t}[]`,r)}async function $(e,t,r){for(const n in e.properties)if(("webscene_schema.json"!==r.currentClass?.name||"tables"!==n&&"mapRangeInfo"!==n&&"widgets"!==n)&&("baseMap_schema.json"!==r.currentClass?.name||"elevationLayers"!==n)){if(h(r)){const e=r.stack.map((e=>e.klass.type)).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,(async()=>{const s=t?`${t}.${n}`:n;await L(e.properties[n],s,r)}))}}function g(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),g(s.allOf,i,r)}}return r}async function P(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=g(e.allOf);await r.addFilter(s,(()=>p(n,t,r)))}async function S(e,t,r){const s=a(e.oneOf);if("refs"!==s.type&&"refsAndNull"!==s.type)if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await L(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|")});else{const n=w(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await L(e,s,r)}}}function R(e){if("layerDefinition"===e.title)return null;const t=e.properties&&e.properties.type;return t&&t.enum?t.enum:null}async function k(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replaceAll(" ","").split(",").join("|"));const i={name:t,type:s,default:e.default};e.enum&&(i.enum=n(e.enum).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|")),r.addProperty(i)}async function L(e,t,r){return"array"===e.type?j(e,t,r):"properties"in e?$(e,t,r):"allOf"in e?P(e,t,r):"oneOf"in e?S(e,t,r):"$ref"in e?k(e,t,r):O(e,t,r)}const C="#/definitions/";function T(e){return 0===e.indexOf(C)?e.slice(C.length):e}async function b(e,t){const r=await E.create(e,t);return l(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class E extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this._filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return!!this._filteredProperties&&this._filteredProperties.size>0}get filteredPropertiesArray(){const e=[];return this._filteredProperties?.forEach((t=>e.push(t))),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this._filteredProperties?.has(e))return;const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r.forEach((t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])})),await t(),this._filteredProperties=r}async addFilter(e,t){const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this._filteredProperties=r,s}static async create(e,t){return t&&t.useRemoteSchema?E.createRemote(e,t?.baseUrl):E.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new E(t.definitions,r,E._getLocalSchemaRequest())}static async createRemote(e,t){const r=await E._getRemoteSchemaRequest(t),n=new E({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new E(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=T(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=E._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch((()=>n(`${t}/${e}`,{responseType:"json"}).then((t=>(this.definitions[T(e)]=t.data,{schemaId:e,schema:t.data})))))}}}const q=Object.keys(t.definitions).map((e=>e.replace(/_schema\.json$/,"")));export{b as scan,q as schemaDefinitions};
5
+ import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties&&t.properties.type.enum)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach((e=>t.distinctTypes.push(e))),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e){return"array"===e.type||!("properties"in e)}function c(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function l(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r),l=n?n.replace("<?TYPE?>",a?`<${a}>`:""):"";if(o(r)){const n=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return n&&i.push(null,n),await L(r,l,i),i.schemaStack.pop(),n}const p=c(e,t,i),u="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(p);if(u&&l)return i.addProperty({name:l,type:u}),i.schemaStack.pop(),u;const f={type:e,name:e,id:p,typeValue:t,properties:[]};return l&&i.addProperty({name:l,type:f}),i.push(l,f),await L(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=R(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t&&!t.includes("<?TYPE?>")?`${t}<?TYPE?>`:t;await l(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack[r.schemaStack.length-1].replace(/_schema\.json/,""):null;await l(n.schemaId,i,n.schema,t,r)}function u(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function f(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*(imageServiceLayer|tiledImageServiceLayer)_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e){return!!e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function m(e){switch(e.schemaStack[e.schemaStack.length-1]){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const y=/raster.*Renderer|vectorFieldRenderer/,d=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,_=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function w(e,t,r){if(h(r)){const n=u(r,t),s=f(r,t);return e.filter((e=>{if(/uniqueValueFromStyleRenderer_schema\.json$/.test(e.$ref))return!1;if(s)return d.test(e.$ref)&&!_.test(e.$ref);if(y.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t}))}if(m(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer"];return e.filter((e=>!t.some((t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))))}return e}async function j(e,t,r){await L(e.items,`${t}[]`,r)}async function $(e,t,r){for(const n in e.properties)if(("webscene_schema.json"!==r.currentClass?.name||"tables"!==n&&"mapRangeInfo"!==n&&"widgets"!==n)&&("baseMap_schema.json"!==r.currentClass?.name||"elevationLayers"!==n)){if(h(r)){const e=r.stack.map((e=>e.klass.type)).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,(async()=>{const s=t?`${t}.${n}`:n;await L(e.properties[n],s,r)}))}}function g(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),g(s.allOf,i,r)}}return r}async function P(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=g(e.allOf);await r.addFilter(s,(()=>p(n,t,r)))}async function S(e,t,r){const s=a(e.oneOf);if("refs"!==s.type&&"refsAndNull"!==s.type)if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await L(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|")});else{const n=w(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await L(e,s,r)}}}function R(e){if("layerDefinition"===e.title)return null;const t=e.properties&&e.properties.type;return t&&t.enum?t.enum:null}async function k(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replaceAll(" ","").split(",").join("|"));const i={name:t,type:s,default:e.default};e.enum&&(i.enum=n(e.enum).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|")),r.addProperty(i)}async function L(e,t,r){return"array"===e.type?j(e,t,r):"properties"in e?$(e,t,r):"allOf"in e?P(e,t,r):"oneOf"in e?S(e,t,r):"$ref"in e?k(e,t,r):O(e,t,r)}const C="#/definitions/";function T(e){return 0===e.indexOf(C)?e.slice(C.length):e}async function b(e,t){const r=await E.create(e,t);return l(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class E extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this._filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return!!this._filteredProperties&&this._filteredProperties.size>0}get filteredPropertiesArray(){const e=[];return this._filteredProperties?.forEach((t=>e.push(t))),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this._filteredProperties?.has(e))return;const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r.forEach((t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])})),await t(),this._filteredProperties=r}async addFilter(e,t){const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this._filteredProperties=r,s}static async create(e,t){return t&&t.useRemoteSchema?E.createRemote(e,t?.baseUrl):E.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new E(t.definitions,r,E._getLocalSchemaRequest())}static async createRemote(e,t){const r=await E._getRemoteSchemaRequest(t),n=new E({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new E(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=T(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=E._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch((()=>n(`${t}/${e}`,{responseType:"json"}).then((t=>(this.definitions[T(e)]=t.data,{schemaId:e,schema:t.data})))))}}}const q=Object.keys(t.definitions).map((e=>e.replace(/_schema\.json$/,"")));export{b as scan,q as schemaDefinitions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- function t(t){return e(t,"",new Set,{})}function e(t,n,s,r){if(s.has(t))return r;s.add(t),n&&t.id&&(r[n]=t);for(const p of t.properties)if("string"!=typeof p.type){const t=n?`${n}.${p.name}`:p.name;e(p.type,t,s,r)}return s.delete(t),r}function n(t){const e=s(t,"",[]);return e.sort(((t,e)=>(t.name??"").localeCompare(e.name??""))),e}function s(t,e,n){for(const r of t.properties){const t=e?`${e}.${r.name}`:r.name;"string"==typeof r.type?n.push({name:t,type:r.type,default:r.default,enum:r.enum}):0===r.type.properties.length?n.push({name:t,type:"unknown",default:r.default,enum:r.enum}):s(r.type,t,n)}return n}class r{constructor(){this.stack=[],this.seen=new Map}addProperty(t){this.currentClass?.properties.push(t)}push(t,e){this.seen.set(e.id,e),this.stack.push({klass:e,propertyName:t})}pop(){return this.stack.pop()?.klass??null}get currentClass(){return this.stack.length?this.stack.at(-1).klass:null}get pathString(){return this.stack.map((t=>t.propertyName)).filter((t=>!!t)).join(".")}}function p(t){const e=t.slice();return e.sort(),e}export{r as ScanContext,t as collectClassPaths,n as flatten,p as sorted};
5
+ function t(t){return e(t,"",new Set,{})}function e(t,n,s,r){if(s.has(t))return r;s.add(t),n&&t.id&&(r[n]=t);for(const p of t.properties)if("string"!=typeof p.type){const t=n?`${n}.${p.name}`:p.name;e(p.type,t,s,r)}return s.delete(t),r}function n(t){const e=s(t,"",[]);return e.sort(((t,e)=>(t.name??"").localeCompare(e.name??""))),e}function s(t,e,n){for(const r of t.properties){const t=e?`${e}.${r.name}`:r.name;"string"==typeof r.type?n.push({name:t,type:r.type,default:r.default,enum:r.enum}):0===r.type.properties.length?n.push({name:t,type:"unknown",default:r.default,enum:r.enum}):s(r.type,t,n)}return n}class r{constructor(){this.stack=[],this.seen=new Map}addProperty(t){this.currentClass?.properties.push(t)}push(t,e){this.seen.set(e.id,e),this.stack.push({klass:e,propertyName:t})}pop(){return this.stack.pop()?.klass??null}get currentClass(){return this.stack.length?this.stack[this.stack.length-1].klass:null}get pathString(){return this.stack.map((t=>t.propertyName)).filter((t=>!!t)).join(".")}}function p(t){const e=t.slice();return e.sort(),e}export{r as ScanContext,t as collectClassPaths,n as flatten,p as sorted};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{binaryIndexOf as l}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{referenceSetter as a}from"../../core/collectionUtils.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{createLoadLayersFunction as n}from"./support/layerUtils.js";import{getDomainInfo as u,getValidNumber as d,getMin as h,getMax as p}from"./support/validation.js";let y=class extends t{constructor(e){super(e),this.state="disabled",this._valueBeforeReady=null,this._domainInfo=u([]),this._loadLayers=n(),this.layers=new s}initialize(){this.addHandles(this.layers.on("change",(()=>this._onLayersChange()))),this._onLayersChange()}destroy(){this._set("state","disabled")}get enabled(){return this.allowedValues.length>0&&this._get("enabled")}set enabled(e){e!==this.enabled&&this.allowedValues.length>0&&this._set("enabled",e)}get value(){return("ready"===this.state?this._get("value"):this._valueBeforeReady)??0}set value(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);if(e===this.value)return;const t=d(e,this);null!=t&&this._set("value",t)}get min(){return h(this.allowedValues)}get max(){return p(this.allowedValues)}get allowedValues(){return this._domainInfo.allowedValues}get hasNext(){if(!this.enabled)return!0;const e=this._valueIndex;return e>=0&&e<this.allowedValues.length-1}get hasPrevious(){return!this.enabled||this._valueIndex>0}set layers(e){const t=this._get("layers");this._set("layers",a(e,t))}get filterExpressions(){return{solid:null,xRay:null}}get _valueIndex(){return l(this.allowedValues,this.value)}select(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);null!=d(e,this)&&(this.enabled=!0,this.value=e)}clear(){"ready"===this.state?this.enabled=!1:this._valueBeforeReady=null}next(){const{state:e,allowedValues:t,enabled:l,hasNext:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a+1])):(this.enabled=!0,void(this.value=t[0]))}else this._valueBeforeReady++}previous(){const{state:e,allowedValues:t,enabled:l,hasPrevious:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a-1])):(this.enabled=!0,void(this.value=t.at(-1)))}else this._valueBeforeReady++}getValueLabel(e){return 0===this.layers.length?null:this._domainInfo.fieldValueMap.get(e)??null}async _onLayersChange(){if(this._set("state","loading"),this._domainInfo=u([]),0!==this.layers.length)try{await this._loadLayers(this.layers),this._setup()}catch(e){r(e)||this._set("state","failed")}}};e([o({value:!1,nonNullable:!0})],y.prototype,"enabled",null),e([o({nonNullable:!0})],y.prototype,"value",null),e([o({readOnly:!0})],y.prototype,"min",null),e([o({readOnly:!0})],y.prototype,"max",null),e([o({readOnly:!0})],y.prototype,"allowedValues",null),e([o({readOnly:!0})],y.prototype,"hasNext",null),e([o({readOnly:!0})],y.prototype,"hasPrevious",null),e([o({type:s,nonNullable:!0})],y.prototype,"layers",null),e([o({nonNullable:!0})],y.prototype,"state",void 0),e([o()],y.prototype,"_valueBeforeReady",void 0),e([o({readOnly:!0})],y.prototype,"_valueIndex",null),e([o()],y.prototype,"_domainInfo",void 0),y=e([i("esri.widgets.BuildingExplorer.BuildingNumericFilterViewModel")],y);const v=y;export{v as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{binaryIndexOf as l}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{referenceSetter as a}from"../../core/collectionUtils.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{createLoadLayersFunction as n}from"./support/layerUtils.js";import{getDomainInfo as u,getValidNumber as d,getMin as h,getMax as p}from"./support/validation.js";let y=class extends t{constructor(e){super(e),this.state="disabled",this._valueBeforeReady=null,this._domainInfo=u([]),this._loadLayers=n(),this.layers=new s}initialize(){this.addHandles(this.layers.on("change",(()=>this._onLayersChange()))),this._onLayersChange()}destroy(){this._set("state","disabled")}get enabled(){return this.allowedValues.length>0&&this._get("enabled")}set enabled(e){e!==this.enabled&&this.allowedValues.length>0&&this._set("enabled",e)}get value(){return("ready"===this.state?this._get("value"):this._valueBeforeReady)??0}set value(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);if(e===this.value)return;const t=d(e,this);null!=t&&this._set("value",t)}get min(){return h(this.allowedValues)}get max(){return p(this.allowedValues)}get allowedValues(){return this._domainInfo.allowedValues}get hasNext(){if(!this.enabled)return!0;const e=this._valueIndex;return e>=0&&e<this.allowedValues.length-1}get hasPrevious(){return!this.enabled||this._valueIndex>0}set layers(e){const t=this._get("layers");this._set("layers",a(e,t))}get filterExpressions(){return{solid:null,xRay:null}}get _valueIndex(){return l(this.allowedValues,this.value)}select(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);null!=d(e,this)&&(this.enabled=!0,this.value=e)}clear(){"ready"===this.state?this.enabled=!1:this._valueBeforeReady=null}next(){const{state:e,allowedValues:t,enabled:l,hasNext:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a+1])):(this.enabled=!0,void(this.value=t[0]))}else this._valueBeforeReady++}previous(){const{state:e,allowedValues:t,enabled:l,hasPrevious:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a-1])):(this.enabled=!0,void(this.value=t[t.length-1]))}else this._valueBeforeReady++}getValueLabel(e){return 0===this.layers.length?null:this._domainInfo.fieldValueMap.get(e)??null}async _onLayersChange(){if(this._set("state","loading"),this._domainInfo=u([]),0!==this.layers.length)try{await this._loadLayers(this.layers),this._setup()}catch(e){r(e)||this._set("state","failed")}}};e([o({value:!1,nonNullable:!0})],y.prototype,"enabled",null),e([o({nonNullable:!0})],y.prototype,"value",null),e([o({readOnly:!0})],y.prototype,"min",null),e([o({readOnly:!0})],y.prototype,"max",null),e([o({readOnly:!0})],y.prototype,"allowedValues",null),e([o({readOnly:!0})],y.prototype,"hasNext",null),e([o({readOnly:!0})],y.prototype,"hasPrevious",null),e([o({type:s,nonNullable:!0})],y.prototype,"layers",null),e([o({nonNullable:!0})],y.prototype,"state",void 0),e([o()],y.prototype,"_valueBeforeReady",void 0),e([o({readOnly:!0})],y.prototype,"_valueIndex",null),e([o()],y.prototype,"_domainInfo",void 0),y=e([i("esri.widgets.BuildingExplorer.BuildingNumericFilterViewModel")],y);const v=y;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.28/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import r from"./BuildingNumericFilterViewModel.js";import{findFieldInfoByModelName as l}from"./support/buildingLayerUtils.js";import{getValueFromFilters as i}from"./support/filterUtils.js";import{getDomainInfo as o}from"./support/validation.js";const a="demolishedphase",d="createdphase";let n=class extends r{constructor(){super(...arguments),this._createdPhaseFieldName=null,this._demolishedPhaseFieldName=null,this._parseValueFromFilter=e=>{const s=this._createdPhaseFieldName,t=new RegExp(`${s}\\s*<=\\s*(\\d+)\\s*OR\\s*${s}\\s*IS\\s*NULL`,"gi"),r=this._demolishedPhaseFieldName,l=new RegExp(`${r}\\s*>\\s*(\\d+)\\s*OR\\s*${r}\\s*IS\\s*NULL`,"gi");for(const{filterExpression:i}of e.filterBlocks?.items??[]){const e=i?t.exec(i)??l.exec(i):null;if(e)return parseInt(e[1],10)}return null}}get filterExpressions(){if(!this.enabled)return{solid:null,xRay:null};const e=[],s=this._createdPhaseFieldName;s&&e.push(`(${s} <= ${this.value} OR ${s} IS NULL)`);const t=this._demolishedPhaseFieldName;t&&e.push(`(${t} > ${this.value} OR ${t} IS NULL)`);const r=e.join(" AND ");return{solid:r,xRay:r}}get _lastValue(){const e=this.allowedValues;return e.length>0?e.at(-1):0}_setup(){const e=[];this.layers.forEach((s=>{const t=l(s,d);null!=t&&(this._createdPhaseFieldName=t.fieldName,e.push(t));const r=l(s,a);null!=r&&(this._demolishedPhaseFieldName=r.fieldName,e.push(r))})),this._domainInfo=o(e);const s=this._valueBeforeReady;if(this._set("state","ready"),this._valueBeforeReady=null,this.allowedValues.length>0){const e=s??i(this.layers,this._parseValueFromFilter);this.select(e??this._lastValue)}else this.clear()}};e([s({readOnly:!0})],n.prototype,"filterExpressions",null),e([s()],n.prototype,"_createdPhaseFieldName",void 0),e([s()],n.prototype,"_demolishedPhaseFieldName",void 0),e([s({readOnly:!0})],n.prototype,"_lastValue",null),n=e([t("esri.widgets.BuildingExplorer.BuildingPhase")],n);const h=n;export{h as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import l from"./BuildingNumericFilterViewModel.js";import{findFieldInfoByModelName as r}from"./support/buildingLayerUtils.js";import{getValueFromFilters as i}from"./support/filterUtils.js";import{getDomainInfo as o}from"./support/validation.js";const a="demolishedphase",d="createdphase";let n=class extends l{constructor(){super(...arguments),this._createdPhaseFieldName=null,this._demolishedPhaseFieldName=null,this._parseValueFromFilter=e=>{const s=this._createdPhaseFieldName,t=new RegExp(`${s}\\s*<=\\s*(\\d+)\\s*OR\\s*${s}\\s*IS\\s*NULL`,"gi"),l=this._demolishedPhaseFieldName,r=new RegExp(`${l}\\s*>\\s*(\\d+)\\s*OR\\s*${l}\\s*IS\\s*NULL`,"gi");for(const{filterExpression:i}of e.filterBlocks?.items??[]){const e=i?t.exec(i)??r.exec(i):null;if(e)return parseInt(e[1],10)}return null}}get filterExpressions(){if(!this.enabled)return{solid:null,xRay:null};const e=[],s=this._createdPhaseFieldName;s&&e.push(`(${s} <= ${this.value} OR ${s} IS NULL)`);const t=this._demolishedPhaseFieldName;t&&e.push(`(${t} > ${this.value} OR ${t} IS NULL)`);const l=e.join(" AND ");return{solid:l,xRay:l}}get _lastValue(){const e=this.allowedValues;return e.length>0?e[e.length-1]:0}_setup(){const e=[];this.layers.forEach((s=>{const t=r(s,d);null!=t&&(this._createdPhaseFieldName=t.fieldName,e.push(t));const l=r(s,a);null!=l&&(this._demolishedPhaseFieldName=l.fieldName,e.push(l))})),this._domainInfo=o(e);const s=this._valueBeforeReady;if(this._set("state","ready"),this._valueBeforeReady=null,this.allowedValues.length>0){const e=s??i(this.layers,this._parseValueFromFilter);this.select(e??this._lastValue)}else this.clear()}};e([s({readOnly:!0})],n.prototype,"filterExpressions",null),e([s()],n.prototype,"_createdPhaseFieldName",void 0),e([s()],n.prototype,"_demolishedPhaseFieldName",void 0),e([s({readOnly:!0})],n.prototype,"_lastValue",null),n=e([t("esri.widgets.BuildingExplorer.BuildingPhase")],n);const h=n;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.28/esri/copyright.txt for details.
4
4
  */
5
- function l(l){const n={fieldValueMap:new Map,allowedValues:[]};for(const t of l){const l=t.fieldValueMap,e=n.fieldValueMap;l.forEach(((l,t)=>{e.has(t)||(e.set(t,l),n.allowedValues.push(t))}))}return n.allowedValues.sort(((l,n)=>l-n)),n}function n(l){let n=null;for(const t of l)n=null!=n?Math.min(n,t):t;return n}function t(l){let n=null;for(const t of l)n=null!=n?Math.max(n,t):t;return n}function e(l,n){return n.allowedValues.length>0?o(l,n.allowedValues):null}function o(l,n){if(0===n.length)return l;if(l===1/0)return n.at(-1);if(l===-1/0)return n[0];let t=n[0],e=Math.abs(t-l);for(const o of n){const n=Math.abs(o-l);n<e&&(t=o,e=n)}return t}export{o as findClosest,l as getDomainInfo,t as getMax,n as getMin,e as getValidNumber};
5
+ function l(l){const n={fieldValueMap:new Map,allowedValues:[]};for(const e of l){const l=e.fieldValueMap,t=n.fieldValueMap;l.forEach(((l,e)=>{t.has(e)||(t.set(e,l),n.allowedValues.push(e))}))}return n.allowedValues.sort(((l,n)=>l-n)),n}function n(l){let n=null;for(const e of l)n=null!=n?Math.min(n,e):e;return n}function e(l){let n=null;for(const e of l)n=null!=n?Math.max(n,e):e;return n}function t(l,n){return n.allowedValues.length>0?o(l,n.allowedValues):null}function o(l,n){if(0===n.length)return l;if(l===1/0)return n[n.length-1];if(l===-1/0)return n[0];let e=n[0],t=Math.abs(e-l);for(const o of n){const n=Math.abs(o-l);n<t&&(e=o,t=n)}return e}export{o as findClosest,l as getDomainInfo,e as getMax,n as getMin,t as getValidNumber};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.28/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../../../assets.js";const t="esri-directions",n={base:`${t} esri-widget esri-widget--panel`,addStopButton:`${t}__add-stop-button`,clearRouteButton:`${t}__clear-route-button`,collapsibleSection:`${t}__maneuver-section--collapsible`,contentTitle:`${t}__content-title`,costsDetails:`${t}__costs-details`,departureTime:`${t}__departure-time`,departureTimeControls:`${t}__departure-time-controls`,departureTimeSelect:`${t}__departure-time-select`,directionCosts:`${t}__costs`,directionsButton:`${t}__button`,directionsSection:`${t}__directions-section`,disclaimer:`${t}__disclaimer`,horizontalSplitter:`${t}__horizontal-splitter`,interactiveStopIcon:`${t}__stop-icon--interactive`,intermediateCost:`${t}__cost--intermediate`,lastStopIconContainer:`${t}__stop-icon-container--last`,layerDetailsLink:`${t}__layer-details-link`,loader:`${t}__loader`,maneuver:`${t}__maneuver`,maneuverActive:`${t}__maneuver--active`,maneuverCosts:`${t}__maneuver-costs`,maneuverCostsContainer:`${t}__maneuver-costs-container`,maneuverIcon:`${t}__maneuver-icon`,maneuverList:`${t}__maneuver-list`,maneuverSection:`${t}__maneuver-section`,maneuverSectionHeader:`${t}__maneuver-section-header`,maneuverSectionHeaderButton:`${t}__maneuver-section-header-toggle-button`,maneuverSectionTitle:`${t}__maneuver-section-title`,maneuverSectionToggle:`${t}__maneuver-section-toggle`,maneuvers:`${t}__maneuvers`,message:`${t}__message`,messageHeading:`${t}__message_heading`,panelContent:`${t}__panel-content`,panelContentError:`${t}__panel-content--error`,panelContentLoading:`${t}__panel-content--loading`,panelContentSignIn:`${t}__panel-content--sign-in`,primaryCosts:`${t}__costs-value`,printButton:`${t}__print-button`,removeStop:`${t}__remove-stop-icon`,removeStopButton:`${t}__remove-stop`,reverseStops:`${t}__reverse-stops`,routeActions:`${t}__route-actions`,saveAsButton:`${t}__save-as-button`,saveAsButtonPopover:`${t}__save-as-button-with-popover`,saveButton:`${t}__save-button`,saveButtons:`${t}__save-buttons`,saveSection:`${t}__save-section`,scroller:`${t}__scroller`,secondaryCosts:`${t}__other-costs-total`,section:`${t}__section`,sectionSplitter:`${t}__section-splitter`,signInButton:`${t}__sign-in-button`,signInContent:`${t}__sign-in-content`,stopHandle:`${t}__stop-handle`,stopHandleIcon:`${t}__stop-handle-icon`,stopIcon:`${t}__stop-icon`,stopIconContainer:`${t}__stop-icon-container`,stopInput:`${t}__stop-input`,stopOptions:`${t}__stop-options`,stopRow:`${t}__stop-row`,stopRowGhost:`${t}__stop-row-ghost`,stops:`${t}__stops`,summary:`${t}__summary`,toolbarButtons:`${t}__toolbar-buttons`,toolbarSection:`${t}__toolbar-section`,travelMode:`${t}__travel-modes`,travelModeSelect:`${t}__travel-modes-select`,validStopRow:`${t}__stop-row--valid`,verticalSplitter:`${t}__vertical-splitter`,warningCard:`${t}__warning-card`,warningHeader:`${t}__warning-header`,warningHeading:`${t}__warning-heading`,warningMessage:`${t}__warning-message`,closeIcon:"esri-icon-up",handleIcon:"esri-icon-handle-vertical",lastStopIcon:"esri-icon-radio-checked",openIcon:"esri-icon-down",removeStopIcon:"esri-icon-trash",reverseStopIcon:"esri-icon-up-down-arrows",stopsIcon:"esri-icon-radio-unchecked",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-directions",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",emptyContent:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",screenReaderText:"esri-icon-font-fallback-text",select:"esri-select"},o=new Map([["bear-left","bear-left"],["bear-right","bear-right"],["central-fork","fork-middle"],["door","walk-through-door"],["elevator","elevator"],["escalator","escalator"],["left-fork","fork-left"],["left-ramp","ramp-left"],["left-turn","left"],["left-turn-and-immediate-left-turn","left-left"],["left-turn-and-immediate-right-turn","left-right"],["off-ferry","disembark"],["on-ferry","embark"],["pedestrian-ramp","take-pedestrian-ramp"],["right-fork","fork-right"],["right-ramp","exit-highway-right"],["right-ramp","ramp-right"],["right-turn","right"],["right-turn-and-immediate-left-turn","right-left"],["right-turn-and-immediate-right-turn","right-right"],["roundabout","roundabout-left"],["sharp-left","sharp-left"],["sharp-right","sharp-right"],["stairs","stairs"],["straight","straight"],["u-turn","u-turn-left"]]);var r;!function(e){e.NOW="now",e.DEPART_AT="depart-at",e.UNSPECIFIED="unspecified"}(r||(r={}));const i=()=>e("esri/themes/base/images/maneuvers/");function a(e){if(null==e||!o.has(e))return null;const t=o.get(e),n=2===window.devicePixelRatio?"@2x":"";return`${i()}${t}${n}.png`}export{n as CSS,r as DepartureTimeOption,a as getIconPath,i as getManeuversIconDir};
5
+ const e="esri-directions",t={base:`${e} esri-widget esri-widget--panel`,addStopButton:`${e}__add-stop-button`,arrivalTime:`${e}__arrival-time`,arrivalTimeContainer:`${e}__arrival-time-container`,clearRouteButton:`${e}__clear-route-button`,collapsibleSection:`${e}__maneuver-section--collapsible`,contentTitle:`${e}__content-title`,costsDetails:`${e}__costs-details`,departureTime:`${e}__departure-time`,departureTimeControls:`${e}__departure-time-controls`,departureTimeSelect:`${e}__departure-time-select`,directionCosts:`${e}__costs`,directionsButton:`${e}__button`,directionsSection:`${e}__directions-section`,disclaimer:`${e}__disclaimer`,horizontalSplitter:`${e}__horizontal-splitter`,interactiveStopIcon:`${e}__stop-icon--interactive`,intermediateCost:`${e}__cost--intermediate`,lastStopIconContainer:`${e}__stop-icon-container--last`,layerDetailsLink:`${e}__layer-details-link`,loader:`${e}__loader`,maneuver:`${e}__maneuver`,maneuverActive:`${e}__maneuver--active`,maneuverCosts:`${e}__maneuver-costs`,maneuverCostsContainer:`${e}__maneuver-costs-container`,maneuverIcon:`${e}__maneuver-icon`,maneuverList:`${e}__maneuver-list`,maneuverSection:`${e}__maneuver-section`,maneuverSectionHeader:`${e}__maneuver-section-header`,maneuverSectionHeaderButton:`${e}__maneuver-section-header-toggle-button`,maneuverSectionTitle:`${e}__maneuver-section-title`,maneuverSectionToggle:`${e}__maneuver-section-toggle`,maneuvers:`${e}__maneuvers`,message:`${e}__message`,messageHeading:`${e}__message_heading`,panelContent:`${e}__panel-content`,panelContentError:`${e}__panel-content--error`,panelContentLoading:`${e}__panel-content--loading`,panelContentSignIn:`${e}__panel-content--sign-in`,primaryCosts:`${e}__costs-value`,printButton:`${e}__print-button`,removeStop:`${e}__remove-stop-icon`,removeStopButton:`${e}__remove-stop`,reverseStops:`${e}__reverse-stops`,routeActions:`${e}__route-actions`,saveAsButton:`${e}__save-as-button`,saveAsButtonPopover:`${e}__save-as-button-with-popover`,saveButton:`${e}__save-button`,saveButtons:`${e}__save-buttons`,saveSection:`${e}__save-section`,scroller:`${e}__scroller`,secondaryCosts:`${e}__other-costs-total`,section:`${e}__section`,sectionSplitter:`${e}__section-splitter`,signInButton:`${e}__sign-in-button`,signInContent:`${e}__sign-in-content`,stopHandle:`${e}__stop-handle`,stopHandleIcon:`${e}__stop-handle-icon`,stopIcon:`${e}__stop-icon`,stopIconContainer:`${e}__stop-icon-container`,stopInput:`${e}__stop-input`,stopOptions:`${e}__stop-options`,stopRow:`${e}__stop-row`,stopRowGhost:`${e}__stop-row-ghost`,stops:`${e}__stops`,summary:`${e}__summary`,toolbarButtons:`${e}__toolbar-buttons`,toolbarSection:`${e}__toolbar-section`,travelMode:`${e}__travel-modes`,travelModeSelect:`${e}__travel-modes-select`,validStopRow:`${e}__stop-row--valid`,verticalSplitter:`${e}__vertical-splitter`,warningCard:`${e}__warning-card`,warningHeader:`${e}__warning-header`,warningHeading:`${e}__warning-heading`,warningMessage:`${e}__warning-message`,closeIcon:"esri-icon-up",handleIcon:"esri-icon-handle-vertical",lastStopIcon:"esri-icon-radio-checked",openIcon:"esri-icon-down",removeStopIcon:"esri-icon-trash",reverseStopIcon:"esri-icon-up-down-arrows",stopsIcon:"esri-icon-radio-unchecked",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-directions",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",emptyContent:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",screenReaderText:"esri-icon-font-fallback-text",select:"esri-select"},n=new Map([["arrive","route-to"],["bear-left","bear-left"],["bear-right","bear-right"],["boundary-crossing","blank"],["central-fork","fork-middle"],["clockwise-roundabout","round-about-right"],["counter-clockwise-roundabout","round-about"],["depart","route-from"],["door","walk-through-door"],["down-elevator","elevator-down"],["down-escalator","escalator-down"],["down-stairs","stairs-down"],["elevator","elevator"],["escalator","escalator"],["general-event","information"],["landmark","map-pin"],["left-fork","fork-left"],["left-handed-u-turn","u-turn"],["left-ramp","ramp-left"],["left-turn","left"],["left-turn-and-immediate-left-turn","left-left"],["left-turn-and-immediate-right-turn","left-right"],["off-ferry","disembark"],["on-ferry","embark"],["pedestrian-ramp","take-pedestrian-ramp"],["restriction-violation","exclamation-mark-triangle"],["right-fork","fork-right"],["right-handed-u-turn","u-turn-right"],["right-ramp","exit-highway-right"],["right-ramp","ramp-right"],["right-turn","right"],["right-turn-and-immediate-left-turn","right-left"],["right-turn-and-immediate-right-turn","right-right"],["roundabout","round-about"],["scaled-cost-barrier-event","blank"],["sharp-left","sharp-left"],["sharp-right","sharp-right"],["stairs","stairs"],["straight","straight"],["time-zone-change","clock"],["traffic-event","exclamation-mark-triangle"],["u-turn","u-turn"],["up-elevator","elevator-up"],["up-escalator","escalator-up"],["up-stairs","stairs-up"]]);var r;function o(e){if(null==e||!n.has(e))return null;return n.get(e)}!function(e){e.NOW="now",e.DEPART_AT="depart-at",e.UNSPECIFIED="unspecified"}(r||(r={}));export{t as CSS,r as DepartureTimeOption,o as getIconName};