@arcgis/core 4.34.0-next.54 → 4.34.0-next.56

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 (391) hide show
  1. package/WebScene.js +1 -1
  2. package/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +4 -0
  3. package/analysis/ElevationProfile/ElevationProfileGroundLine.js +5 -0
  4. package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +4 -0
  5. package/analysis/ElevationProfile/ElevationProfileInputLine.js +5 -0
  6. package/analysis/ElevationProfile/ElevationProfileLine.d.ts +4 -0
  7. package/analysis/ElevationProfile/ElevationProfileLine.js +5 -0
  8. package/analysis/ElevationProfile/ElevationProfileLineChartOptions.d.ts +4 -0
  9. package/analysis/ElevationProfile/{LineChartOptions.js → ElevationProfileLineChartOptions.js} +1 -1
  10. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +4 -0
  11. package/analysis/ElevationProfile/{LineViewOptions.js → ElevationProfileLineViewOptions.js} +1 -1
  12. package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +4 -0
  13. package/analysis/ElevationProfile/ElevationProfileQueryLine.js +5 -0
  14. package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +4 -0
  15. package/analysis/ElevationProfile/ElevationProfileSceneLine.js +5 -0
  16. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +4 -0
  17. package/analysis/ElevationProfile/{Units.js → ElevationProfileUnits.js} +1 -1
  18. package/analysis/ElevationProfile/ElevationProfileViewOptions.d.ts +4 -0
  19. package/analysis/ElevationProfile/{ViewOptions.js → ElevationProfileViewOptions.js} +1 -1
  20. package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
  21. package/analysis/ElevationProfileAnalysis.js +1 -1
  22. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  23. package/assets/esri/core/workers/RemoteClient.js +1 -1
  24. package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +1 -0
  25. package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +1 -0
  26. package/assets/esri/core/workers/chunks/0a4586e596413ef7a4b5.js +1 -0
  27. package/assets/esri/core/workers/chunks/10b46438885916d18425.js +1 -0
  28. package/assets/esri/core/workers/chunks/1166ed298cf5ca7ad444.js +1 -0
  29. package/assets/esri/core/workers/chunks/13797036850dcc3671c3.js +1 -0
  30. package/assets/esri/core/workers/chunks/18ceea59e469a0f2721b.js +1 -0
  31. package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +1 -0
  32. package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +1 -0
  33. package/assets/esri/core/workers/chunks/{ac41b882f9cbf8d56f0c.js → 222f981e876f60ae282f.js} +1 -1
  34. package/assets/esri/core/workers/chunks/22334a464f798b5279b2.js +1 -0
  35. package/assets/esri/core/workers/chunks/{99b9392946d776a62997.js → 23e600e368ac829680b5.js} +1 -1
  36. package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +1 -0
  37. package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +1 -0
  38. package/assets/esri/core/workers/chunks/{93af38d29d066f27ed28.js → 2cb14d040e67a261b31c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{0021118bafefd1e47ff7.js → 31c088966ccfff2ea1db.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c9c109d43a1e5160955d.js → 3490d47cac7c8dec70cd.js} +2 -2
  41. package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +1 -0
  42. package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +1 -0
  43. package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +1 -0
  44. package/assets/esri/core/workers/chunks/4b58da6cb91f7bf6af8b.js +1 -0
  45. package/assets/esri/core/workers/chunks/{cac060a187f3a27a19ba.js → 4d5abcf57a6ded4750ba.js} +1 -1
  46. package/assets/esri/core/workers/chunks/527557b603400189d49a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{d0bf1fc6e3c198bc565d.js → 57486b18421a3c9690d0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{4bd92232928b832dea76.js → 5900dde7a201a7d47469.js} +1 -1
  49. package/assets/esri/core/workers/chunks/5f518931a660b3c4f519.js +1 -0
  50. package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +1 -0
  51. package/assets/esri/core/workers/chunks/66f3659ba18f92cd623e.js +1 -0
  52. package/assets/esri/core/workers/chunks/67355372ac5fd8a15d18.js +1 -0
  53. package/assets/esri/core/workers/chunks/{b0ee061747bef6729bb9.js → 6801b92bce7a918fda6f.js} +1 -1
  54. package/assets/esri/core/workers/chunks/6940bb6524938894a246.js +1 -0
  55. package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +1 -0
  56. package/assets/esri/core/workers/chunks/{5691d504ffe5592bc40f.js → 6dc0009889f2b7cc8cff.js} +1 -1
  57. package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +1 -0
  58. package/assets/esri/core/workers/chunks/{69dc5a7abc1fda2474ad.js → 722931d1a60be461e521.js} +1 -1
  59. package/assets/esri/core/workers/chunks/79ab06fb4c91ac8da323.js +1 -0
  60. package/assets/esri/core/workers/chunks/{0a4357af5b8c0532b439.js → 7bdfc7c7ce1d94c00745.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{0ce671588de2858516d2.js → 83737d86584bf1b32368.js} +1 -1
  62. package/assets/esri/core/workers/chunks/853b9f29b4d62fa621b9.js +1 -0
  63. package/assets/esri/core/workers/chunks/855f25ce748aaef44b1a.js +1 -0
  64. package/assets/esri/core/workers/chunks/{71acded1b3c0057917a1.js → 862fe2f96d4b777ff5b8.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{98ea12c7a000a30f3dc0.js → 87f68c2b9361bd3f8cac.js} +1 -1
  66. package/assets/esri/core/workers/chunks/8fa50cac57b6e1ecec76.js +1 -0
  67. package/assets/esri/core/workers/chunks/9307108821d82c131654.js +1 -0
  68. package/assets/esri/core/workers/chunks/97ae2fdb6cb98249f5fa.js +1 -0
  69. package/assets/esri/core/workers/chunks/9a20390602126995f831.js +1 -0
  70. package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +1 -0
  71. package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +1 -0
  72. package/assets/esri/core/workers/chunks/a778a72456fefdf40115.js +1 -0
  73. package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +1 -0
  74. package/assets/esri/core/workers/chunks/adf11d31f95481f89a55.js +1 -0
  75. package/assets/esri/core/workers/chunks/ae73ac81bd10614c2b53.js +1 -0
  76. package/assets/esri/core/workers/chunks/af4412e79275c5a87539.js +1 -0
  77. package/assets/esri/core/workers/chunks/{7a8d740d1226719a578a.js → b457b7dd907f06278bee.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{81e518dd62bd95611d00.js → b47688e3263099540873.js} +1 -1
  79. package/assets/esri/core/workers/chunks/c7d4c296011c5393bcaa.js +1 -0
  80. package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +1 -0
  81. package/assets/esri/core/workers/chunks/c91217d977a6baaee74a.js +1 -0
  82. package/assets/esri/core/workers/chunks/{a1d3f1c221389eb6090c.js → c95e6bef8c97cf647869.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → cb57cdff976d2d4b0b41.js} +1 -1
  84. package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +1 -0
  85. package/assets/esri/core/workers/chunks/{9fef330b241f958b55df.js → d0124b0dd62b331afe58.js} +1 -1
  86. package/assets/esri/core/workers/chunks/d3a7747f23e91d1f1b5e.js +1 -0
  87. package/assets/esri/core/workers/chunks/d3ae88fcde2d7fb3e2e2.js +1 -0
  88. package/assets/esri/core/workers/chunks/{b6a201e86f9caef45ff0.js → d42fd0effc560eefb14b.js} +1 -1
  89. package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +1 -0
  90. package/assets/esri/core/workers/chunks/{2da12a64d3baef4aaaa1.js → d87fdc64a5cc6be4bd69.js} +1 -1
  91. package/assets/esri/core/workers/chunks/db5d3feeb61ccb5ede98.js +1 -0
  92. package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +1 -0
  93. package/assets/esri/core/workers/chunks/{aab349d4624b78ef429f.js → e6bf4f3f6868dc9028e3.js} +1 -1
  94. package/assets/esri/core/workers/chunks/e982cf44906eb26164f2.js +1 -0
  95. package/assets/esri/core/workers/chunks/{081b22fa73ef7b696409.js → ead1acf95c3385630da8.js} +2 -2
  96. package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +1 -0
  97. package/assets/esri/core/workers/chunks/f74b0cdc1c2b56bac5f0.js +1 -0
  98. package/assets/esri/core/workers/chunks/f807e7fc90e0e7ce6b67.js +1 -0
  99. package/assets/esri/core/workers/chunks/{fae6030a81cb91a91b69.js → faf4002f9547a0cc4e33.js} +1 -1
  100. package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +1 -0
  101. package/assets/esri/core/workers/chunks/{fe55833c80cf59df9c2b.js → ff42b24b48019a03d841.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{e10c5405f956b2cc59e4.js → ff4e15a872de94d2b438.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{ff7962063d132c1ec814.js → ff8a4bf1bceb362d67ab.js} +1 -1
  104. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  105. package/chunks/Laserlines.glsl.js +1 -1
  106. package/chunks/LineSeries.js +1 -1
  107. package/chunks/Theme.js +1 -1
  108. package/chunks/boundedPlane.js +1 -1
  109. package/chunks/bundle.js +1 -1
  110. package/chunks/chartUtilsAm5.js +1 -1
  111. package/chunks/sphere.js +1 -1
  112. package/chunks/vec42.js +1 -1
  113. package/config.js +1 -1
  114. package/core/ArrayPool.js +1 -1
  115. package/core/Collection.js +1 -1
  116. package/core/ObjectPool.js +1 -1
  117. package/core/accessorSupport/Properties.js +1 -1
  118. package/core/accessorSupport/watch.js +1 -1
  119. package/core/arrayUtils.js +1 -1
  120. package/core/has.js +1 -1
  121. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  122. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  123. package/core/pbf.js +1 -1
  124. package/core/typedArrayUtil.js +1 -1
  125. package/geohash/GeohashCell.js +1 -1
  126. package/geohash/GeohashTree.js +1 -1
  127. package/geometry/Multipoint.js +1 -1
  128. package/geometry/support/DoubleArray.js +1 -1
  129. package/geometry/support/boundedPlane.js +1 -1
  130. package/geometry/support/coordsUtils.js +1 -1
  131. package/geometry/support/extentUtils.js +1 -1
  132. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  133. package/geometry/support/sphere.js +1 -1
  134. package/graphic/KMLGraphicOrigin.js +5 -0
  135. package/graphic/isKMLGraphicOrigin.js +5 -0
  136. package/interfaces.d.ts +147 -142
  137. package/kernel.js +1 -1
  138. package/layers/KMLLayer.js +1 -1
  139. package/layers/SceneLayer.js +1 -1
  140. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  141. package/layers/graphics/sources/ParquetSource.js +1 -1
  142. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  143. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  144. package/layers/support/ElevationQuery.js +1 -1
  145. package/layers/support/KMLSublayer.js +1 -1
  146. package/layers/support/featureReductionUtils.js +1 -1
  147. package/layers/support/kmlUtils.js +1 -1
  148. package/package.json +1 -1
  149. package/renderers/support/colorRampUtils.js +1 -1
  150. package/rest/knowledgeGraphService.js +1 -1
  151. package/support/requestUtils.js +1 -1
  152. package/support/revision.js +1 -1
  153. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  154. package/views/2d/engine/Container.js +1 -1
  155. package/views/2d/engine/DisplayObject.js +1 -1
  156. package/views/2d/engine/flow/dataUtils.js +1 -1
  157. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  158. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  159. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  160. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  161. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  162. package/views/2d/engine/webgl/PooledUint32Array.js +1 -1
  163. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  164. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  165. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  166. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  167. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  168. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  169. package/views/2d/layers/KMLLayerView2D.js +1 -1
  170. package/views/2d/layers/features/FeatureContainer.js +1 -1
  171. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  172. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  173. package/views/2d/layers/features/FeatureSpatialIndex.js +1 -1
  174. package/views/2d/layers/features/Processor.js +1 -1
  175. package/views/2d/layers/features/RenderState.js +1 -1
  176. package/views/2d/layers/features/aggregation/AccumulatedStatistics.js +1 -1
  177. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  178. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  179. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  180. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  181. package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
  182. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  183. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  184. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  185. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  186. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  187. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  188. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  189. package/views/2d/layers/features/support/FeatureSetCache.js +1 -1
  190. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  191. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  192. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  193. package/views/2d/layers/features/support/StaticBitSet.js +1 -1
  194. package/views/2d/tiling/TileCoverage.js +1 -1
  195. package/views/2d/tiling/TileKey.js +1 -1
  196. package/views/3d/FocusAreasView.js +1 -1
  197. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  198. package/views/3d/analysis/ElevationProfile/{HoveredPointVisualization.js → ElevationProfileHoveredPointVisualization.js} +1 -1
  199. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  200. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +5 -0
  201. package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +5 -0
  202. package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +5 -0
  203. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +5 -0
  204. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  205. package/views/3d/analysis/Slice/SliceController.js +1 -1
  206. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  207. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  208. package/views/3d/analysis/Viewshed/{ArrowManipulator.js → ViewshedArrowManipulator.js} +1 -1
  209. package/views/3d/analysis/Viewshed/{FieldOfViewManipulation.js → ViewshedFieldOfViewManipulation.js} +1 -1
  210. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +5 -0
  211. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +5 -0
  212. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  213. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +5 -0
  214. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  215. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  216. package/views/3d/camera/constraintUtils/distance.js +1 -1
  217. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  218. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  219. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  220. package/views/3d/layers/I3SMeshView3D.js +1 -1
  221. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  222. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  223. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  224. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  225. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  226. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  227. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  228. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  229. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  230. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  231. package/views/3d/layers/i3s/I3SNode.js +1 -1
  232. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  233. package/views/3d/state/ViewState.js +1 -1
  234. package/views/3d/state/ViewStateManager.js +1 -1
  235. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  236. package/views/3d/support/ViewSlice.js +1 -1
  237. package/views/3d/support/orientedBoundingBox.js +1 -1
  238. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  239. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  240. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  241. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  242. package/views/3d/terrain/ScaleRangeQueries.js +1 -1
  243. package/views/3d/terrain/SphericalPatch.js +1 -1
  244. package/views/3d/terrain/TerrainRenderer.js +1 -1
  245. package/views/3d/terrain/TerrainSurface.js +1 -1
  246. package/views/3d/terrain/Tile.js +1 -1
  247. package/views/3d/terrain/TilePerLayerInfo.js +1 -1
  248. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  249. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  250. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  251. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  252. package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
  253. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  254. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  255. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  256. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  257. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  258. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  259. package/views/analysis/ElevationProfile/ElevationProfileController.js +5 -0
  260. package/views/analysis/ElevationProfile/{ProfileGenerationError.js → ElevationProfileGenerationError.js} +1 -1
  261. package/views/analysis/ElevationProfile/ElevationProfileGroundLineComputation.js +5 -0
  262. package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +5 -0
  263. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +5 -0
  264. package/views/analysis/ElevationProfile/ElevationProfileQueryLineComputation.js +5 -0
  265. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +4 -0
  266. package/views/analysis/ElevationProfile/ElevationProfileResult.js +5 -0
  267. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +5 -0
  268. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +5 -0
  269. package/views/draw/DrawOperation.js +1 -1
  270. package/views/draw/MultipointDrawAction.js +1 -1
  271. package/views/draw/PointDrawAction.js +1 -1
  272. package/views/draw/PolygonDrawAction.js +1 -1
  273. package/views/draw/PolylineDrawAction.js +1 -1
  274. package/views/draw/SegmentDrawAction.js +1 -1
  275. package/views/draw/support/Box.js +1 -1
  276. package/views/draw/support/GraphicMover.js +1 -1
  277. package/views/draw/support/Reshape.js +1 -1
  278. package/views/draw/support/drawUtils.js +1 -1
  279. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  280. package/views/input/InputManager.js +1 -1
  281. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  282. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  283. package/views/interactive/editGeometry/operations/AppendVertex.js +1 -1
  284. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  285. package/views/interactive/sketch/constraints.js +1 -1
  286. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  287. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  288. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  289. package/views/interactive/tooltip/infos/SelectedVertexTooltipInfo.js +1 -1
  290. package/views/layers/FeatureLayerView.js +1 -1
  291. package/views/support/PropertiesPool.js +1 -1
  292. package/webscene/spec-certification/api.js +1 -1
  293. package/webscene/spec-certification/compare.js +1 -1
  294. package/webscene/spec-certification/spec.js +1 -1
  295. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  296. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  297. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  298. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  299. package/widgets/OrientedImageryViewer.js +1 -1
  300. package/widgets/Sketch/SketchViewModel.js +1 -1
  301. package/widgets/Sketch/support/sketchUtils.js +1 -1
  302. package/analysis/ElevationProfile/GroundLine.d.ts +0 -4
  303. package/analysis/ElevationProfile/GroundLine.js +0 -5
  304. package/analysis/ElevationProfile/InputLine.d.ts +0 -4
  305. package/analysis/ElevationProfile/InputLine.js +0 -5
  306. package/analysis/ElevationProfile/Line.d.ts +0 -4
  307. package/analysis/ElevationProfile/Line.js +0 -5
  308. package/analysis/ElevationProfile/LineChartOptions.d.ts +0 -4
  309. package/analysis/ElevationProfile/LineViewOptions.d.ts +0 -4
  310. package/analysis/ElevationProfile/QueryLine.d.ts +0 -4
  311. package/analysis/ElevationProfile/QueryLine.js +0 -5
  312. package/analysis/ElevationProfile/SceneLine.d.ts +0 -4
  313. package/analysis/ElevationProfile/SceneLine.js +0 -5
  314. package/analysis/ElevationProfile/Units.d.ts +0 -4
  315. package/analysis/ElevationProfile/ViewOptions.d.ts +0 -4
  316. package/assets/esri/core/workers/chunks/02902303e5585a16ebea.js +0 -1
  317. package/assets/esri/core/workers/chunks/0445de3a8968c0734c91.js +0 -1
  318. package/assets/esri/core/workers/chunks/09268dc856c3d5ce178f.js +0 -1
  319. package/assets/esri/core/workers/chunks/0f51e51db83f303ce5a6.js +0 -1
  320. package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +0 -1
  321. package/assets/esri/core/workers/chunks/17776d9d3558d45ea7b5.js +0 -1
  322. package/assets/esri/core/workers/chunks/1cbd59918c60a1a21494.js +0 -1
  323. package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +0 -1
  324. package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +0 -1
  325. package/assets/esri/core/workers/chunks/2efa4d8fe5454f8b2a05.js +0 -1
  326. package/assets/esri/core/workers/chunks/3149a86cd25684dcb0b3.js +0 -1
  327. package/assets/esri/core/workers/chunks/3800764932a1c32cb29f.js +0 -1
  328. package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +0 -1
  329. package/assets/esri/core/workers/chunks/3c57b2e13628b5c1f6de.js +0 -1
  330. package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +0 -1
  331. package/assets/esri/core/workers/chunks/43bd338bb0de375b9bb7.js +0 -1
  332. package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +0 -1
  333. package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +0 -1
  334. package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +0 -1
  335. package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +0 -1
  336. package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +0 -1
  337. package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +0 -1
  338. package/assets/esri/core/workers/chunks/5fc414fc2cfc68828c5b.js +0 -1
  339. package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +0 -1
  340. package/assets/esri/core/workers/chunks/772e81e9162e2240a7a6.js +0 -1
  341. package/assets/esri/core/workers/chunks/8c81156b1605a16acc29.js +0 -1
  342. package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +0 -1
  343. package/assets/esri/core/workers/chunks/8f6ff09e7d2f01b79faf.js +0 -1
  344. package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +0 -1
  345. package/assets/esri/core/workers/chunks/9639a6f6fab52a501bf7.js +0 -1
  346. package/assets/esri/core/workers/chunks/998c38974372720b1c52.js +0 -1
  347. package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +0 -1
  348. package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +0 -1
  349. package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +0 -1
  350. package/assets/esri/core/workers/chunks/a7530dcb08b43e37bbb2.js +0 -1
  351. package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +0 -1
  352. package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +0 -1
  353. package/assets/esri/core/workers/chunks/b4251e10621fb3ad03a3.js +0 -1
  354. package/assets/esri/core/workers/chunks/b9f5672093727c6f92c9.js +0 -1
  355. package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +0 -1
  356. package/assets/esri/core/workers/chunks/c51e2a048df152abd901.js +0 -1
  357. package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +0 -1
  358. package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +0 -1
  359. package/assets/esri/core/workers/chunks/d578c3880eaf2dd62324.js +0 -1
  360. package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.js +0 -1
  361. package/assets/esri/core/workers/chunks/de499e33035b56b6697d.js +0 -1
  362. package/assets/esri/core/workers/chunks/e28d3ed65c3a76a044c8.js +0 -1
  363. package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +0 -1
  364. package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +0 -1
  365. package/assets/esri/core/workers/chunks/ed25bf087f52e5d3e71b.js +0 -1
  366. package/assets/esri/core/workers/chunks/ee0286b5f5475f2d853f.js +0 -1
  367. package/assets/esri/core/workers/chunks/f8505bf69795f5293a79.js +0 -1
  368. package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +0 -1
  369. package/views/3d/analysis/ElevationProfile/HoveredPointsVisualization.js +0 -5
  370. package/views/3d/analysis/ElevationProfile/InputVisualization.js +0 -5
  371. package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +0 -5
  372. package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +0 -5
  373. package/views/3d/analysis/ElevationProfile/Visualization.js +0 -5
  374. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +0 -5
  375. package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +0 -5
  376. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +0 -5
  377. package/views/analysis/ElevationProfile/Controller.js +0 -5
  378. package/views/analysis/ElevationProfile/GroundLineComputation.js +0 -5
  379. package/views/analysis/ElevationProfile/InputLineComputation.js +0 -5
  380. package/views/analysis/ElevationProfile/LineComputation.js +0 -5
  381. package/views/analysis/ElevationProfile/QueryLineComputation.js +0 -5
  382. package/views/analysis/ElevationProfile/Result.d.ts +0 -4
  383. package/views/analysis/ElevationProfile/Result.js +0 -5
  384. package/views/analysis/ElevationProfile/geometryUtils.js +0 -5
  385. package/views/analysis/ElevationProfile/profileGenerationUtils.js +0 -5
  386. /package/assets/esri/core/workers/chunks/{c9c109d43a1e5160955d.js.LICENSE.txt → 3490d47cac7c8dec70cd.js.LICENSE.txt} +0 -0
  387. /package/views/analysis/ElevationProfile/{elevationQuerySourceUtils.js → elevationProfileQuerySourceUtils.js} +0 -0
  388. /package/views/analysis/ElevationProfile/{statisticsUtils.js → elevationProfileStatisticsUtils.js} +0 -0
  389. /package/views/analysis/ElevationProfile/{traversalUtils.js → elevationProfileTraversalUtils.js} +0 -0
  390. /package/views/analysis/ElevationProfile/{unitUtils.js → elevationProfileUnitUtils.js} +0 -0
  391. /package/views/analysis/ElevationProfile/{visualizationUtils.js → elevationProfileVisualizationUtils.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as n}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as o}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as h,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as c}from"./DisplayIdGenerator.js";import u from"./FeatureFilterEvaluator.js";import{PixelType as p}from"../../../../webgl/enums.js";function g(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const _=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),y=h(d,_()),f={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class m{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=n(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=n(t),r=1<<e;0!==(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):_().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=o(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class b{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new c,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=p.FLOAT;y(`Creating AttributeStore ${f.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:p.UNSIGNED_BYTE,layout:1},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:p.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map(t=>t?u.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map(async t=>{const i=await this._bind(e,t);this._updateReferences(i)}));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map(async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)}))}}}setHighlight(t,e){let i=null;0===t.length&&0===e.length&&(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));for(const{displayId:s,highlightFlags:r}of t){if(null==s||-1===s)continue;i||(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));const t=n(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=n(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,o=1,h=4;let d=null;a&&(d="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,d?.size&&d.forEach((t,s)=>{const a=s*o%h,n=Math.floor(s*o/h),d=this._getBlock(n+3);let c=t.field?.read(e,i);t.valueRepresentation&&(c=g(c,t.valueRepresentation));(null===c||isNaN(c)||c===1/0||c===-1/0)&&(c=l),d.setData(r,a,c)}))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map(t=>null!=t?t.toMessage():null),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null)})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;y(`Initializing AttributeBlock at index ${t}`);const i=new m(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;y("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return _().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{b as AttributeStore,g as getVisualVariableSizeValueRepresentationRatio};
5
+ import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as n}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as o}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as l}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as h,DEBUG_ATTR_UPDATES as d}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as c}from"./DisplayIdGenerator.js";import u from"./FeatureFilterEvaluator.js";import{PixelType as p}from"../../../../webgl/enums.js";function g(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const _=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),y=h(d,_()),m={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class f{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get usedMemory(){return this.data?.byteLength??0}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=n(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=n(t),r=1<<e;0!==(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):_().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=o(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class b{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new c,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=p.FLOAT;y(`Creating AttributeStore ${m.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:p.UNSIGNED_BYTE,layout:1},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:p.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let t=0;for(const e of this._blocks)e&&(t+=e.usedMemory);return t+=this._idGenerator.usedMemory,t}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map(t=>t?u.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map(async t=>{const i=await this._bind(e,t);this._updateReferences(i)}));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map(async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)}))}}}setHighlight(t,e){let i=null;0===t.length&&0===e.length&&(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));for(const{displayId:s,highlightFlags:r}of t){if(null==s||-1===s)continue;i||(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));const t=n(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=n(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=n(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,o=1,h=4;let d=null;a&&(d="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,d?.size&&d.forEach((t,s)=>{const a=s*o%h,n=Math.floor(s*o/h),d=this._getBlock(n+3);let c=t.field?.read(e,i);t.valueRepresentation&&(c=g(c,t.valueRepresentation));(null===c||isNaN(c)||c===1/0||c===-1/0)&&(c=l),d.setData(r,a,c)}))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map(t=>null!=t?t.toMessage():null),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null)})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;y(`Initializing AttributeBlock at index ${t}`);const i=new f(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;y("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return _().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{b as AttributeStore,g as getVisualVariableSizeValueRepresentationRatio};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{createDisplayId as e}from"../../../engine/webgl/DisplayId.js";class t{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return 0===this._referenceCount}}class s{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(s){let r=this._objectIdToDisplayId.get(s);return r?r.increment():(r=new t(e(this._getFreeId(),!1)),r.increment(),this._objectIdToDisplayId.set(s,r)),r.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return null!=t?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}export{s as DisplayIdGenerator};
5
+ import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{createDisplayId as t}from"../../../engine/webgl/DisplayId.js";class s{constructor(e){this.data=e,this._referenceCount=0}static{this.estimatedMemory=20}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return 0===this._referenceCount}}class r{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}get usedMemory(){let t=0;return t+=e(this._freeIdsGenerationA),t+=e(this._freeIdsGenerationB),t+=this._objectIdToDisplayId.size*(s.estimatedMemory+8),t}createIdForObjectId(e){let r=this._objectIdToDisplayId.get(e);return r?r.increment():(r=new s(t(this._getFreeId(),!1)),r.increment(),this._objectIdToDisplayId.set(e,r)),r.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return null!=t?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}export{r as DisplayIdGenerator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{StaticBitSet as t}from"./StaticBitSet.js";class a{constructor(a){this._valid=t.create(a),this._data=new Array(a)}has(t){return this._valid.has(t)}set(t,a){this._valid.set(t),this._data[t]=a}get(t){return this._data[t]}}export{a as FeatureSetCache};
5
+ import{estimateNumberMemory as t}from"../../../../../core/memoryEstimations.js";import{StaticBitSet as s}from"./StaticBitSet.js";class a{constructor(t){this._valid=s.create(t),this._data=new Array(t)}get usedMemory(){let s=this._valid.usedMemory;if(this._data.length>0){const a="string"==typeof this._data[0]?64:t;s+=this._data.length*a}return s}has(t){return this._valid.has(t)}set(t,s){this._valid.set(t),this._data[t]=s}get(t){return this._data[t]}}export{a as FeatureSetCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{DateOnly as t}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as r}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as s}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as i}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as o}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as n,quantizeY as d}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as u}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as h,generalizeOptimizedGeometry as c,quantizeForDisplay as l,unquantizeOptimizedGeometry as m}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as y}from"../../../../../layers/graphics/OptimizedFeature.js";import f from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as p,unknown as g}from"../../../../../time/constants.js";import{FeatureSetCache as _}from"./FeatureSetCache.js";const b=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],x=b[0],D=b[1],T=b[2],F=b[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],S=A[0],I=A[1],B=A[2],j=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),M=4294967295;function C(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class v{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?j:1;t>4e6?r=B*s:t>1e6?r=I*s:t>5e5?r=S*s:t>1e5&&(r=s);let i=0;return e>4e3?i=F*r:e>2e3?i=T*r:e>100?i=D:e>15&&(i=x),i}getBounds(e){C(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return i(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let r=1/0,s=1/0,a=-1/0,o=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),a=Math.max(a,e),o=Math.max(o,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(a),this.setBoundsYMax(o),i(e,r,s,a,o),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),a=this.getBoundsXMax(),o=this.getBoundsYMax();return i(e,r,s,a,o),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new y(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return h(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=c(new f,t,this.hasZ,this.hasM,this.metadata.geometryType,e.scale[0])),t&&(t=l(t,e,this.metadata.geometryType,this.hasZ,this.hasM)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=n(e,t.coords[0]),s=d(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&m(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&m(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new _(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=h(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??p):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===g}field(s){let i=this.fields.get(s);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(this.readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(this.readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,this.readAttribute(s,!0));default:return this.readAttribute(s,!1)}for(const a of this._joined)if(a.setIndex(this.getIndex()),i=a.fields.get(s),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return t.fromReader(a._readAttribute(s,!1));case"time-only":case"esriFieldTypeTimeOnly":return r.fromReader(a._readAttribute(s,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(a._readAttribute(s,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(s,a._readAttribute(s,!0));default:return this.readAttribute(s,!1)}throw new Error(`Field ${s} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return u(new f,e,this.hasM,this.hasZ);const t=s.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=o(t);return r?(r[1]*=-1,new f([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return h(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new f([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new f([2],[e-1,t+1,1,-1])}}export{v as FeatureSetReader};
5
+ import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as c,generalizeOptimizedGeometry as l,quantizeForDisplay as m,unquantizeOptimizedGeometry as y}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as f}from"../../../../../layers/graphics/OptimizedFeature.js";import p from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as g,unknown as _}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=x[0],T=x[1],F=x[2],A=x[3],S=has("featurelayer-simplify-payload-size-factors")??[1,2,4],I=S[0],B=S[1],j=S[2],M=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),C=4294967295;function v(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class O{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?M:1;t>4e6?r=j*s:t>1e6?r=B*s:t>5e5?r=I*s:t>1e5&&(r=s);let i=0;return e>4e3?i=A*r:e>2e3?i=F*r:e>100?i=T:e>15&&(i=D),i}getBounds(e){v(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===C||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(C),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new f(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return c(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=l(new p,t,this.hasZ,this.hasM,this.metadata.geometryType,e.scale[0])),t&&(t=m(t,e,this.metadata.geometryType,this.hasZ,this.hasM)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&y(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&y(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=c(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??g):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===_}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}return!0}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(new p,e,this.hasM,this.hasZ);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new p([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return c(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new p([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new p([2],[e-1,t+1,1,-1])}}export{O as FeatureSetReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
5
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{getFeatureIdInfoFieldNames as e}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import t from"../../../../../layers/support/FieldsIndex.js";import{parseField as s,parseTransform as r}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class o{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}function a(a,i,c,f=!1){const d=9,u=12,p=13,g=15,l=a.asUnsafe(),h=l.pos(),y=new o;let m=0,w=0;const k=1,x=2,I=4,b=3;let A=null,L=!1;const F=[];for(;l.next();)switch(l.tag()){case u:A=l.processMessage(r);break;case d:if(y.exceededTransferLimit=l.getBool(),y.exceededTransferLimit){y.offsets.geometry=f?new Float64Array(8e3):new Int32Array(8e3),y.centroid=f?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<y.centroid.length;e++)y.centroid[e]=n}break;case p:{const e=l.processMessage(s);e.index=m++,F.push(e);break}case g:{const e=l.getLength(),t=l.pos()+e;if(!y.exceededTransferLimit){const e=y.offsets.geometry,t=y.centroid;e.push(0),t.push(n),t.push(n)}!L&&y.exceededTransferLimit&&(L=!0,y.offsets.attributes=f?new Float64Array(8e3*m):new Uint32Array(8e3*m));let s=w*m;for(;l.pos()<t&&l.next();)switch(l.tag()){case k:{if(L)y.offsets.attributes[s++]=l.pos();else{y.offsets.attributes.push(l.pos())}const e=l.getLength();l.skipLen(e);break}case x:if(i){const e=l.getLength(),t=l.pos()+e;for(;l.pos()<t&&l.next();)switch(l.tag()){case b:{l.getUInt32();const e=l.getSInt64(),t=l.getSInt64();y.centroid[2*w]=e,y.centroid[2*w+1]=t;break}default:l.skip()}}else{y.offsets.geometry[w]=l.pos();const e=l.getLength();y.vertexCount+=e,l.skipLen(e)}break;case I:{const e=l.getLength(),t=l.pos()+e;for(;l.pos()<t&&l.next();)switch(l.tag()){case b:{l.getUInt32();const e=l.getSInt64(),t=l.getSInt64();y.centroid[2*w]=e,y.centroid[2*w+1]=t;break}default:l.skip()}break}default:l.skip()}w++,y.hasFeatures=!0;break}default:l.skip()}y.fields=new t(F),y.featureCount=w,y.fieldCount=m;const C=e(c);return y.idFieldIndices=Array.from(C,e=>y.fields.get(e)?.index),y.transform=A,y.displayIds=new Uint32Array(y.featureCount),y.groupIds=new Uint16Array(y.featureCount),l.move(h),y}export{o as FeatureSetHeader,a as parseHeader};
5
+ import{estimateNumberArrayMemory as e}from"../../../../../core/memoryEstimations.js";import{getFeatureIdInfoFieldNames as t}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import s from"../../../../../layers/support/FieldsIndex.js";import{parseField as r,parseTransform as o}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class i{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let t=0;return t+=e(this.idFieldIndices),t+=e(this.offsets.attributes),t+=e(this.offsets.geometry),t+=e(this.centroid),this.displayIds&&(t+=e(this.displayIds)),this.groupIds&&(t+=e(this.groupIds)),t}}function a(e,a,c,f=!1){const d=9,u=12,p=13,g=15,h=e.asUnsafe(),l=h.pos(),m=new i;let y=0,I=0;const w=1,b=2,k=4,x=3;let A=null,L=!1;const F=[];for(;h.next();)switch(h.tag()){case u:A=h.processMessage(o);break;case d:if(m.exceededTransferLimit=h.getBool(),m.exceededTransferLimit){m.offsets.geometry=f?new Float64Array(8e3):new Int32Array(8e3),m.centroid=f?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<m.centroid.length;e++)m.centroid[e]=n}break;case p:{const e=h.processMessage(r);e.index=y++,F.push(e);break}case g:{const e=h.getLength(),t=h.pos()+e;if(!m.exceededTransferLimit){const e=m.offsets.geometry,t=m.centroid;e.push(0),t.push(n),t.push(n)}!L&&m.exceededTransferLimit&&(L=!0,m.offsets.attributes=f?new Float64Array(8e3*y):new Uint32Array(8e3*y));let s=I*y;for(;h.pos()<t&&h.next();)switch(h.tag()){case w:{if(L)m.offsets.attributes[s++]=h.pos();else{m.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case b:if(a){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}}else{m.offsets.geometry[I]=h.pos();const e=h.getLength();m.vertexCount+=e,h.skipLen(e)}break;case k:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case x:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*I]=e,m.centroid[2*I+1]=t;break}default:h.skip()}break}default:h.skip()}I++,m.hasFeatures=!0;break}default:h.skip()}m.fields=new s(F),m.featureCount=I,m.fieldCount=y;const C=t(c);return m.idFieldIndices=Array.from(C,e=>m.fields.get(e)?.index),m.transform=A,m.displayIds=new Uint32Array(m.featureCount),m.groupIds=new Uint16Array(m.featureCount),h.move(l),m}export{i as FeatureSetHeader,a as parseHeader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- class t{static fromBuffer(e,s){return new t(e,s)}static create(e,s=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new t(r,s)}constructor(t,e){this._mask=0,this._buf=t,this._mask=e}_getIndex(t){return Math.floor(t/32)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<<e%32)}hasRange(t,e){let s=t,r=e;for(;s%32&&s!==r;){if(this.has(s))return!0;s++}for(;r%32&&s!==r;){if(this.has(s))return!0;r--}if(s===r)return!1;for(let h=s/32;h!==r/32;h++){if(this._buf[h])return!0}return!1}set(t){const e=this._mask&t,s=this._getIndex(e),r=1<<e%32;this._buf[s]|=r}setRange(t,e){let s=t,r=e;for(;s%32&&s!==r;)this.set(s++);for(;r%32&&s!==r;)this.set(r--);if(s!==r)for(let h=s/32;h!==r/32;h++)this._buf[h]=4294967295}unset(t){const e=this._mask&t,s=this._getIndex(e),r=1<<e%32;this._buf[s]&=4294967295^r}resize(t){const e=this._buf,s=new Uint32Array(Math.ceil(t/32));s.set(e),this._buf=s}or(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=t._buf[e];return this}and(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=t._buf[e];return this}xor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=t._buf[e];return this}ior(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=~t._buf[e];return this}iand(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=~t._buf[e];return this}ixor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=~t._buf[e];return this}any(){for(let t=0;t<this._buf.length;t++)if(this._buf[t])return!0;return!1}copy(t){for(let e=0;e<this._buf.length;e++)this._buf[e]=t._buf[e];return this}clone(){return new t(this._buf.slice(),this._mask)}clear(){for(let t=0;t<this._buf.length;t++)this._buf[t]=0;return this}forEachSet(t){for(let e=0;e<this._buf.length;e++){let s=this._buf[e],r=32*e;if(s)for(;s;){1&s&&t(r),s>>>=1,r++}}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}export{t as StaticBitSet};
5
+ import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";class e{static fromBuffer(t,r){return new e(t,r)}static create(t,r=4294967295){const s=new Uint32Array(Math.ceil(t/32));return new e(s,r)}constructor(t,e){this._mask=0,this._buf=t,this._mask=e}_getIndex(t){return Math.floor(t/32)}get usedMemory(){return t(this._buf)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<<e%32)}hasRange(t,e){let r=t,s=e;for(;r%32&&r!==s;){if(this.has(r))return!0;r++}for(;s%32&&r!==s;){if(this.has(r))return!0;s--}if(r===s)return!1;for(let i=r/32;i!==s/32;i++){if(this._buf[i])return!0}return!1}set(t){const e=this._mask&t,r=this._getIndex(e),s=1<<e%32;this._buf[r]|=s}setRange(t,e){let r=t,s=e;for(;r%32&&r!==s;)this.set(r++);for(;s%32&&r!==s;)this.set(s--);if(r!==s)for(let i=r/32;i!==s/32;i++)this._buf[i]=4294967295}unset(t){const e=this._mask&t,r=this._getIndex(e),s=1<<e%32;this._buf[r]&=4294967295^s}resize(t){const e=this._buf,r=new Uint32Array(Math.ceil(t/32));r.set(e),this._buf=r}or(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=t._buf[e];return this}and(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=t._buf[e];return this}xor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=t._buf[e];return this}ior(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=~t._buf[e];return this}iand(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=~t._buf[e];return this}ixor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=~t._buf[e];return this}any(){for(let t=0;t<this._buf.length;t++)if(this._buf[t])return!0;return!1}copy(t){for(let e=0;e<this._buf.length;e++)this._buf[e]=t._buf[e];return this}clone(){return new e(this._buf.slice(),this._mask)}clear(){for(let t=0;t<this._buf.length;t++)this._buf[t]=0;return this}forEachSet(t){for(let e=0;e<this._buf.length;e++){let r=this._buf[e],s=32*e;if(r)for(;r;){1&r&&t(s),r>>>=1,s++}}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}export{e as StaticBitSet};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}static{this.pool=new o(s)}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:t,colTo:e}of this.spans)for(let r=t;r<=e;r++){const t=o.getWorldForColumn(r);yield new l(o.level,s,o.normalizeCol(r),t)}}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}export{s as default};
5
+ import o from"../../../core/ObjectPool.js";import l from"./TileKey.js";class s{constructor(){this.spans=[]}static{this.pool=new o(()=>new s)}acquire(o){this.lodInfo=o}release(){this.lodInfo=null,this.spans.length=0}*keys(){const o=this.lodInfo;for(const{row:s,colFrom:t,colTo:e}of this.spans)for(let r=t;r<=e;r++){const t=o.getWorldForColumn(r);yield new l(o.level,s,o.normalizeCol(r),t)}}forEach(o,l){const{spans:s,lodInfo:t}=this,{level:e}=t;if(0!==s.length)for(const{row:r,colFrom:n,colTo:c}of s)for(let s=n;s<=c;s++)o.call(l,e,r,t.normalizeCol(s),t.getWorldForColumn(s))}}export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/ObjectPool.js";class e{static{this.pool=new t(e,null,null,25,50)}static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}export{e as default};
5
+ import t from"../../../core/ObjectPool.js";class e{static{this.pool=new t(()=>new e(""),null,null,25,50)}static getId(t,e,l,o){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${l}/${o}`}constructor(t,e,l,o){this.set(t,e,l,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,l=63&this.level;return(3&this.world)<<30|e<<22|t<<8|l}acquire(t,e,l,o){this.set(t,e,l,o)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new e(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,l,o){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,l,o,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(l),this.col=parseFloat(o),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+l,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new e(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,l){const o=this.clone();return o.col+=t,o.row+=e,l.normalizeKey(o),o}getChildKeys(){const t=this.level+1,l=this.row<<1,o=this.col<<1,s=this.world;return[new e(t,l,o,s),new e(t,l,o+1,s),new e(t,l+1,o,s),new e(t,l+1,o+1,s)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}export{e as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as m,syncAndInitial as c}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as p,convertFromSpatialReferenceUnit as l}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{e as f}from"../../chunks/earcut.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../geometry/ellipsoidUtils.js";import j from"../../geometry/Point.js";import{project as w}from"../../geometry/projectionUtils.js";import{execute as v}from"../../geometry/operators/gx/operatorDensify.js";import{execute as _}from"../../geometry/operators/gx/operatorSimplify.js";import{fromSpatialReference as A,fromPolygon as x,toPolygon as b}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as R}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as N}from"../../geometry/support/DoubleArray.js";import{earth as M}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as C}from"../../geometry/support/Indices.js";import{t as U}from"../../chunks/vec3.js";import{ElevationContext as k}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as V}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as H}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as E}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as F}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaMaskNode as G}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as I}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const P=2e4;let S=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new k,this._outlineMap=new t}initialize(){this.addHandles([m(()=>this.polygons,e=>this._updateVolumes(e),c)]),this._outlineMap=n(()=>this.areas?.areas,e=>new I({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,o)=>e.concat(o.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new j(e);return this.polygons.some(e=>e.contains(o))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=this.view.renderCoordsHelper,t=g(),n=1===o.viewingMode,a=d(),m=d(),c=this.view.spatialReference,u=A(c),h=y(c).radius/M.radius,j=p(5e5*h,"meters",c,!0);n||o.worldUpAtPosition([0,0,0],t);const k=new Map;for(const r of e){const e=this._volumes.get(r);if(e)k.set(r,e);else try{const e=c.equals(r.spatialReference)?r:w(r,c),s=Math.max(e.extent.width,e.extent.height),i=l(s,c,"meters",!0),p=Math.max(5*i,P*h),d=n?h/10:h,g=this._reduceGeometryHeight(e,p,d),y=H(g);if(null==y)continue;const A=x(g),M=_(A,u,!1)??A,F=v(M,j,0,0),G=b(F,c);if(null==G)continue;R(c,[y.x,y.y,0],a,o.spatialReference),m[12]=-a[12],m[13]=-a[13],m[14]=-a[14];const I=E(G,this.view.elevationProvider,o,this._elevationContext),{polygons:S,mapPositions:O,position:q}=I,z=new Array,T=new D(z,[a[12],a[13],a[14]]);for(const o of S){const e=o.count,r=f(o.mapPositions,o.holeIndices,3);if(0===r.length)continue;const s=r.length,i=6*e,a=i+s,c=N(3*i),l=C(a),u=C(s);V(q,O,r,o,c,null,null,null,l,u,p,t,n),U(c,c,m);const h=new L(c,u,l,p);z.push(h)}k.set(r,T)}catch(F){i.getLogger(this).error(new s("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:r,error:F}))}}this._volumes=k,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){this.view.stage&&(0===this.volumes.size?(this._maskRenderNode=a(this._maskRenderNode),this._colorRenderNode=a(this._colorRenderNode)):(this._maskRenderNode??=new G({focusAreasView:this}),this._colorRenderNode??=new F({focusAreasView:this}),this.view.stage.renderView.requestRender()))}_reduceGeometryHeight(e,o,r){const t=-12e5*r,s=Math.max(-o/2,t),i=e.rings.map(e=>e.map(e=>[e[0],e[1],s])),n=e.clone();return n.rings=i,n.hasZ=!0,n}get volumes(){return this._volumes}};e([u()],S.prototype,"_volumes",void 0),e([u({constructOnly:!0})],S.prototype,"view",void 0),S=e([h("esri.views.3d.FocusAreasView")],S);class D{constructor(e,o){this.geometryVolumes=e,this.origin=o}}class L{constructor(e,o,r,t){this.positions=e,this.indicesBottom=o,this.indicesExtruded=r,this.height=t}}export{S as FocusAreasView};
5
+ import{__decorate as e}from"tslib";import o from"../../core/Accessor.js";import{equals as r}from"../../core/arrayUtils.js";import t from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Logger.js";import{mapCollection as n}from"../../core/mapCollectionUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as m,syncAndInitial as c}from"../../core/reactiveUtils.js";import{convertToSpatialReferenceUnit as p,convertFromSpatialReferenceUnit as l}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../chunks/earcut.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as y}from"../../geometry/ellipsoidUtils.js";import j from"../../geometry/Point.js";import{project as w}from"../../geometry/projectionUtils.js";import{execute as v}from"../../geometry/operators/gx/operatorDensify.js";import{execute as _}from"../../geometry/operators/gx/operatorSimplify.js";import{fromSpatialReference as A,fromPolygon as x,toPolygon as b}from"../../geometry/operators/support/apiConverter.js";import{computeTranslationToOriginAndRotation as R}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as N}from"../../geometry/support/DoubleArray.js";import{earth as M}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as C}from"../../geometry/support/Indices.js";import{t as U}from"../../chunks/vec3.js";import{ElevationContext as k}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as V}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as H}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as E}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as F}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaMaskNode as G}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";import{FocusAreaOutlineItem as I}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";const P=2e4;let S=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new k,this._outlineMap=new t}initialize(){this.addHandles([m(()=>({polygons:this.polygons,ready:this.view.basemapTerrain?.ready}),({polygons:e,ready:o})=>{o&&this._updateVolumes(e)},c)]),this._outlineMap=n(()=>this.areas?.areas,e=>new I({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??"bright"}get polygons(){return this.enabledAreas.reduce((e,o)=>e.concat(o.geometries.toArray()),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new j(e);return this.polygons.some(e=>e.contains(o))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes()}_extrude(e){if(!this.view.renderCoordsHelper||r(Array.from(this._volumes.keys()),e))return;const o=this.view.renderCoordsHelper,t=g(),n=1===o.viewingMode,a=f(),m=f(),c=this.view.spatialReference,u=A(c),h=y(c).radius/M.radius,j=p(5e5*h,"meters",c,!0);n||o.worldUpAtPosition([0,0,0],t);const k=new Map;for(const r of e){const e=this._volumes.get(r);if(e)k.set(r,e);else try{const e=c.equals(r.spatialReference)?r:w(r,c),s=Math.max(e.extent.width,e.extent.height),i=l(s,c,"meters",!0),p=Math.max(5*i,P*h),f=n?h/10:h,g=this._reduceGeometryHeight(e,p,f),y=H(g);if(null==y)continue;const A=x(g),M=_(A,u,!1)??A,F=v(M,j,0,0),G=b(F,c);if(null==G)continue;R(c,[y.x,y.y,0],a,o.spatialReference),m[12]=-a[12],m[13]=-a[13],m[14]=-a[14];const I=E(G,this.view.elevationProvider,o,this._elevationContext),{polygons:S,mapPositions:O,position:T}=I,q=new Array,z=new D(q,[a[12],a[13],a[14]]);for(const o of S){const e=o.count,r=d(o.mapPositions,o.holeIndices,3);if(0===r.length)continue;const s=r.length,i=6*e,a=i+s,c=N(3*i),l=C(a),u=C(s);V(T,O,r,o,c,null,null,null,l,u,p,t,n),U(c,c,m);const h=new L(c,u,l,p);q.push(h)}k.set(r,z)}catch(F){i.getLogger(this).error(new s("focusareasview:projection-failed","Failed to project focus area geometry to view spatial reference",{geometry:r,error:F}))}}this._volumes=k,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(){this.view.stage&&(0===this.volumes.size?(this._maskRenderNode=a(this._maskRenderNode),this._colorRenderNode=a(this._colorRenderNode)):(this._maskRenderNode??=new G({focusAreasView:this}),this._colorRenderNode??=new F({focusAreasView:this}),this.view.stage.renderView.requestRender()))}_reduceGeometryHeight(e,o,r){const t=-12e5*r,s=Math.max(-o/2,t),i=e.rings.map(e=>e.map(e=>[e[0],e[1],s])),n=e.clone();return n.rings=i,n.hasZ=!0,n}get volumes(){return this._volumes}};e([u()],S.prototype,"_volumes",void 0),e([u({constructOnly:!0})],S.prototype,"view",void 0),S=e([h("esri.views.3d.FocusAreasView")],S);class D{constructor(e,o){this.geometryVolumes=e,this.origin=o}}class L{constructor(e,o,r,t){this.positions=e,this.indicesBottom=o,this.indicesExtruded=r,this.height=t}}export{S as FocusAreasView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as l}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as c}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as m}from"../../support/projectionUtils.js";import{createCoordinateHelper as u}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as p,Part as d}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let g=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{c(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=l(i,t.spatialReference);null==o&&m(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?y.fromGeometry(i,t.state.viewingMode):new y(new p("polygon",u(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,f),e(f,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;if(0===this._editGeometry.parts.length){const e=this.view;this._editGeometry.parts.push(new d(e.spatialReference,e.state.viewingMode))}const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],g.prototype,"areaMeasurement",null),e([s({value:null})],g.prototype,"view",null),e([s()],g.prototype,"isEmptyPolygon",null),e([s()],g.prototype,"isValidPolygon",null),e([s()],g.prototype,"extent",null),e([s()],g.prototype,"spatialReference",null),e([s()],g.prototype,"numVertices",null),e([s()],g.prototype,"polygonIsClosed",null),g=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],g);const f=new a;export{g as AreaMeasurement3DPathHelper};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as l}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as c}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as m}from"../../support/projectionUtils.js";import{createCoordinateHelper as u}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as p}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as d}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let y=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{c(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=l(i,t.spatialReference);null==o&&m(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?d.fromGeometry(i,t.state.viewingMode):new d(new p("polygon",u(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,g),e(g,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],y.prototype,"areaMeasurement",null),e([s({value:null})],y.prototype,"view",null),e([s()],y.prototype,"isEmptyPolygon",null),e([s()],y.prototype,"isValidPolygon",null),e([s()],y.prototype,"extent",null),e([s()],y.prototype,"spatialReference",null),e([s()],y.prototype,"numVertices",null),e([s()],y.prototype,"polygonIsClosed",null),y=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],y);const g=new a;export{y as AreaMeasurement3DPathHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import e from"../../../../Color.js";import t from"../../../../core/Accessor.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";let l=class extends t{constructor(o){super(o),this.position=null,this.color=new e("#ffffff"),this.element=a()}initialize(){this.addHandles([r(()=>this._screenLocation,o=>{o&&(this.element.style.transform=`translate(${o.x}px, ${o.y}px)`)},i),r(()=>this.color.toCss(),o=>{this.element.style.background=o},i)]),this.view.surface?.appendChild(this.element)}destroy(){this.element.remove()}get _screenLocation(){const{position:o,view:e}=this;e.commitProperty("size"),e.commitProperty("camera");const t=e?.spatialReference,r=t?p(o,t).geometry:null;return r&&e?.ready?e.toScreen(r):null}};function a(){const o=document.createElement("div"),{size:e,borderStyle:t,borderColor:r,borderWidth:i,boxShadow:s}=c().hoveredPointsStyle,{style:n}=o;return n.display="block",n.position="absolute",n.top="0",n.left="0",n.contain="strict",n.boxSizing="border-box",n.width=`${e}px`,n.height=`${e}px`,n.marginTop=`-${e/2}px`,n.marginLeft=`-${e/2}px`,n.border=`${t} ${i}px ${r}`,n.borderRadius=`${e}px`,n.boxShadow=s,o}o([s()],l.prototype,"position",void 0),o([s({type:e})],l.prototype,"color",void 0),o([s()],l.prototype,"view",void 0),o([s()],l.prototype,"_screenLocation",null),l=o([n("esri.views.3d.analysis.ElevationProfile.HoveredPointVisualization")],l);export{l as HoveredPointVisualization};
5
+ import{__decorate as o}from"tslib";import e from"../../../../Color.js";import t from"../../../../core/Accessor.js";import{watch as r,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{getConfig as l}from"../../../analysis/ElevationProfile/constants.js";let c=class extends t{constructor(o){super(o),this.position=null,this.color=new e("#ffffff"),this.element=a()}initialize(){this.addHandles([r(()=>this._screenLocation,o=>{o&&(this.element.style.transform=`translate(${o.x}px, ${o.y}px)`)},i),r(()=>this.color.toCss(),o=>{this.element.style.background=o},i)]),this.view.surface?.appendChild(this.element)}destroy(){this.element.remove()}get _screenLocation(){const{position:o,view:e}=this;e.commitProperty("size"),e.commitProperty("camera");const t=e?.spatialReference,r=t?p(o,t).geometry:null;return r&&e?.ready?e.toScreen(r):null}};function a(){const o=document.createElement("div"),{size:e,borderStyle:t,borderColor:r,borderWidth:i,boxShadow:s}=l().hoveredPointsStyle,{style:n}=o;return n.display="block",n.position="absolute",n.top="0",n.left="0",n.contain="strict",n.boxSizing="border-box",n.width=`${e}px`,n.height=`${e}px`,n.marginTop=`-${e/2}px`,n.marginLeft=`-${e/2}px`,n.border=`${t} ${i}px ${r}`,n.borderRadius=`${e}px`,n.boxShadow=s,o}o([s()],c.prototype,"position",void 0),o([s({type:e})],c.prototype,"color",void 0),o([s()],c.prototype,"view",void 0),o([s()],c.prototype,"_screenLocation",null),c=o([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileHoveredPointVisualization")],c);export{c as ElevationProfileHoveredPointVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as o}from"tslib";import e from"../../../../core/Accessor.js";import r from"../../../../core/Collection.js";import{watch as t,syncAndInitial as i}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let l=class extends e{constructor(o){super(o),this._hoveredPoints=new r}initialize(){this.addHandles([t(()=>{const{analysis:o,hoveredPoints:e,visible:r}=this.analysisViewData;return r?e.map((e,r)=>{const t=o.profiles.at(r);return!0===t?.viewOptions.hoveredPointVisible&&null!=e?{hoveredPoint:e,color:t.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}_update(o){const{view:e,_hoveredPoints:r}=this,t=o.length;for(;r.length>t;)r.pop()?.destroy();for(;r.length<t;){const o=new a({view:e});r.push(o)}for(let i=0;i<t;++i){const e=o[i],s=r.at(t-1-i);s.position=e.hoveredPoint,s.color=e.color}}};o([s()],l.prototype,"view",void 0),o([s()],l.prototype,"analysisViewData",void 0),o([s()],l.prototype,"_hoveredPoints",void 0),l=o([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],l);export{l as ElevationProfileHoveredPointsVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import e from"../../../../core/Accessor.js";import{createTask as t}from"../../../../core/asyncUtils.js";import{destroyHandle as s,handlesGroup as r}from"../../../../core/handleUtils.js";import{abortMaybe as o,removeMaybe as a}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as h,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{getGraphicEffectiveElevationInfo as c}from"../../../../support/elevationInfoUtils.js";import{Settings as g}from"../../interactive/editingTools/settings.js";import{OutlineVisualElement as u}from"../../interactive/visualElements/OutlineVisualElement.js";import{GraphicState as d}from"../../layers/graphics/GraphicState.js";import{getInputGraphic as v,isPolylineGraphic as y,getInputGeometry as f,isValidInputPath as _}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{highlightsSupported as w}from"../../../support/layerViewUtils.js";let j=class extends e{constructor(i){super(i),this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null}initialize(){this._settings=new g({getTheme:()=>this.view.effectiveTheme}),this.addHandles(h(()=>{const{analysis:i,inputIsSketched:e,interactive:t,visible:s}=this.analysisViewData,r=v(i.input);return r&&(r.commitProperty("geometry"),r.commitProperty("layer")),{graphic:r,inputIsSketched:e,interactive:t,visible:s&&i.viewOptions.highlightEnabled}},({graphic:i,inputIsSketched:e,interactive:t,visible:s})=>{if(!s)return this._remove();e?e&&!t?this._showReshaping(i):this._remove():this._showHighlight(i)},n))}destroy(){this._remove()}get updating(){return null!=this._highlightTask&&!this._highlightTask.finished}_remove(){this._highlightTask=o(this._highlightTask),this._highlightHandle=a(this._highlightHandle),this._visualElementHandle=a(this._visualElementHandle)}_showHighlight(i){if(this._remove(),!y(i))return;const e=i.layer;e&&"building-component"!==e.type&&"subtype-sublayer"!==e.type&&(this._highlightTask=t(async t=>{const s=await this.view.whenLayerView(e);l(t),w(s)&&(this._highlightHandle=s.highlight(i))}))}_showReshaping(i){if(this._remove(),!i)return;const{view:e}=this,t=new u({view:e,geometry:b(i),attached:!1,elevationInfo:c(i),renderOccluded:8,isDecoration:!0}),o=new d({graphic:i}),a=[h(()=>o.isDraped,i=>{t.isDraped=i}),o.on("changed",()=>{t.geometry=b(i)}),e.trackGraphicState(o),e.maskOccludee(i),s(t)];this._settings.visualElements.lineObjects.outline.apply(t),t.attached=!0,this._visualElementHandle=r(a)}};function b(i){const e=f(i);return _(e)?e:null}i([p()],j.prototype,"view",void 0),i([p()],j.prototype,"analysisViewData",void 0),i([p()],j.prototype,"updating",null),j=i([m("esri.views.3d.analysis.ElevationProfile.ElevationProfileInputVisualization")],j);export{j as ElevationProifileInputVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{watch as o,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{throttle as r}from"../../../../core/throttle.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as n,fromArray as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as m}from"../../interactive/visualElements/OutlineVisualElement.js";import{getConfig as c}from"../../../analysis/ElevationProfile/constants.js";import{getInputGeometry as f}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{createLineGeometry as d}from"../../../analysis/ElevationProfile/elevationProfileVisualizationUtils.js";let h=class extends i{constructor(e){super(e),this._visualElements=[],this._updateThrottled=r(e=>this._update(e),c().profileLinesUpdateThrottleMillis)}initialize(){const{analysisViewData:e}=this;this.addHandles([o(()=>({lineInfos:e.results.filter(e=>e.available).map(({computation:t,samples:i})=>{const o=t.profileLine;return{color:o.color,samples:i,visible:o.viewOptions.lineVisible&&e.visible}}),refined:1===e.progress,spatialReference:this.view.spatialReference}),e=>this._updateThrottled(e),s),o(()=>f(e.analysis.input),()=>this._remove(),s),this._updateThrottled])}destroy(){this._destroyVisualElements()}get updating(){return this._updateThrottled.hasPendingUpdates()}_remove(){this._destroyVisualElements()}_update(e){const{lineInfos:i}=e;if(!i||0===i.length)return this._remove();if(!e.refined)return;const o=this._visualElements,s=i.filter(e=>e.visible),r=s.length;for(;o.length>r;)o.pop().destroy();for(;o.length<r;){const e=new m({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:0,innerColor:n(0,0,0,0),width:3,falloff:0,renderOccluded:16,isDecoration:!0});o.push(e)}const{spatialReference:l}=e;for(let a=0;a<r;++a){const e=o[a],i=s[r-1-a];e.geometry=d(i.samples,l),e.color=p(t.toUnitRGBA(i.color))}}_destroyVisualElements(){this._visualElements.forEach(e=>e.destroy()),this._visualElements.length=0}};e([l()],h.prototype,"view",void 0),e([l()],h.prototype,"analysisViewData",void 0),e([l()],h.prototype,"updating",null),h=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLinesVisualization")],h);export{h as ElevationProfileLinesVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as o}from"../../../../core/unitUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as d}from"../../support/hitTest.js";import{Intersector as y}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{getInputGraphic as v}from"../../../analysis/ElevationProfile/elevationProfileGeometryUtils.js";import{ElevationProfileLineComputation as h}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const _=2e5;let w=class extends h{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,i,o,n,s)=>({inputGraphicUid:j(e),visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*o(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([i(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const i=this._queryElevationDependencies;if(null==i)throw new Error(`${this.declaredClass}: no dependencies`);const o=this._intersector;if(null==o)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:n,view:s,spatialReference:a}=i,c=s.renderCoordsHelper,p=s.sceneIntersectionHelper,d=this._vecA,y=this._vecA,f=this._vecB,v=this._ray;if(!a)return{geometry:e,noDataValue:t};const h=await m.fromGeometry(e).project(a,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,j=w.length;for(let m=0;m<j;++m){const e=w[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(d,_,f);const r=u(d,f,v);p.computeIntersection(r,o,!0,n);const s=g(i,o.results.all);s?(s.getIntersectionPoint(y),c.fromRenderCoords(y,y,a),e.z=y[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:i}=this.profileLine;return d(e,{include:r,exclude:[...this._pointCloudLayers,...t(i)?i:i?[i]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new y(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function g({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(!o.withinDistance(r))continue;const i=f(o,e);if(null==i||j(i)!==t)return o}return null}function j(e){const t=v(e);if(!t)return null;if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}e([n({readOnly:!0})],w.prototype,"minDemResolution",null),e([n()],w.prototype,"_queryElevationDependencies",null),e([n()],w.prototype,"_visibleLayers",null),e([n()],w.prototype,"_intersectOptions",null),e([n()],w.prototype,"_pointCloudLayers",null),e([n()],w.prototype,"_view",null),e([n()],w.prototype,"_maxIntersectionDistance",null),e([n()],w.prototype,"_intersector",null),w=e([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileSceneLineComputation")],w);export{w as ElevationProfileSceneLineComputation};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as i}from"tslib";import o from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileHoveredPointsVisualization as e}from"./ElevationProfileHoveredPointsVisualization.js";import{ElevationProifileInputVisualization as a}from"./ElevationProfileInputVisualization.js";import{ElevationProfileLinesVisualization as r}from"./ElevationProfileLinesVisualization.js";let n=class extends o{constructor(i){super(i)}initialize(){const{view:i,analysisViewData:o}=this;this._hoveredPointsVisualization=new e({view:i,analysisViewData:o}),this._inputVisualization=new a({view:i,analysisViewData:o}),this._profileLinesVisualization=new r({view:i,analysisViewData:o})}destroy(){this._inputVisualization.destroy(),this._hoveredPointsVisualization.destroy(),this._profileLinesVisualization.destroy()}get updating(){return this._inputVisualization.updating||this._profileLinesVisualization.updating}};i([t()],n.prototype,"view",void 0),i([t()],n.prototype,"analysisViewData",void 0),i([t()],n.prototype,"updating",null),n=i([s("esri.views.3d.analysis.ElevationProfile.ElevationProfileVisualization")],n);export{n as ElevationProfileVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{SceneLineComputation as s}from"./ElevationProfile/SceneLineComputation.js";import{Visualization as n}from"./ElevationProfile/Visualization.js";import{Controller as l}from"../../analysis/ElevationProfile/Controller.js";import{GroundLineComputation as a}from"../../analysis/ElevationProfile/GroundLineComputation.js";import{InputLineComputation as p}from"../../analysis/ElevationProfile/InputLineComputation.js";import{QueryLineComputation as u}from"../../analysis/ElevationProfile/QueryLineComputation.js";let c=class extends(r(e)){constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null,this.inputIsSketched=!1}initialize(){this._controller=new l({analysis:this.analysis,analysisViewData:this,view:this.view,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new a(t);case"input":return new p(t);case"query":return new u(t);case"scene":return new s(t)}}}}),this._visualizattion=new n({view:this.view,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualizattion.destroy()}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return this._controller?.updating||this._visualizattion?.updating}get visible(){return super.visible}set visible(t){super.visible=t}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"tool",void 0),t([o()],c.prototype,"inputIsSketched",void 0),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualizattion",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const y=c;export{y as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{ElevationProfileSceneLineComputation as s}from"./ElevationProfile/ElevationProfileSceneLineComputation.js";import{ElevationProfileVisualization as n}from"./ElevationProfile/ElevationProfileVisualization.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as u}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";let c=class extends(r(e)){constructor(t){super(t),this.type="elevation-profile-view-3d",this.analysis=null,this.hoveredPosition=null,this.inputIsSketched=!1}initialize(){this._controller=new l({analysis:this.analysis,analysisViewData:this,view:this.view,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new a(t);case"input":return new p(t);case"query":return new u(t);case"scene":return new s(t)}}}}),this._visualizattion=new n({view:this.view,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualizattion.destroy()}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return this._controller?.updating||this._visualizattion?.updating}get visible(){return super.visible}set visible(t){super.visible=t}};t([o({readOnly:!0})],c.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",void 0),t([o()],c.prototype,"hoveredPosition",void 0),t([o()],c.prototype,"hoveredPoints",null),t([o({readOnly:!0})],c.prototype,"progress",null),t([o({readOnly:!0})],c.prototype,"results",null),t([o({readOnly:!0})],c.prototype,"statistics",null),t([o({readOnly:!0})],c.prototype,"updating",null),t([o()],c.prototype,"tool",void 0),t([o()],c.prototype,"inputIsSketched",void 0),t([o()],c.prototype,"_controller",void 0),t([o()],c.prototype,"_visualizattion",void 0),c=t([i("esri.views.3d.analysis.ElevationProfileAnalysisView3D")],c);const v=c;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as o}from"../../../../chunks/boundedPlane.js";import c from"../../../../layers/Layer.js";import h from"../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isBuildingSceneLayerView3D as u,projectAndElevationAlignShape as d,projectedShapeToPlane as p,planeToShape as y}from"./sliceToolUtils.js";import{logFailedGeometryProjectionError as w}from"../support/projectionUtils.js";import{isTerrainSurfaceLayer as v}from"../../terrain/isTerrainSurfaceLayer.js";let f=class extends t{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",e=>{const i=e.item;null!=i&&(i instanceof c||i instanceof h)?i instanceof c&&v(i)?(a.getLogger(this).error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(i)&&e.preventDefault():(a.getLogger(this).error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),S(this.view,this),this.addHandles([l(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},s),l(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),s),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),l(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()},s),l(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this.addHandles([l(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},s),l(()=>"web-scene"!==this.analysis.origin?.type,()=>this._updateViewSlicePlaneDecoration(),s)],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slice.plane=null,this._updateActiveController(),this._updateViewSlicePlane()),L(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(u).flatMap(({sublayerViews:e})=>e.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(null==t&&null==e||null!=t&&null!=e&&e.equals(t))return;let l=null,s=null;if(null!=e?.position){const t=e.position.spatialReference,n=d(e,this.view);null==n&&w(this.analysis,t,a.getLogger(this)),l=p(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},o()),null!=l&&(s=new i({heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height}))}this._currentSlicePlane=s,this._internalChange=!0,this.analysisViewData.plane=l,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=y(e,this.view,this.view.spatialReference,new i);let a=null;null!=t&&(a=new i({heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height})),this._currentSlicePlane=a,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(g)return;const e=b(this.view);if(!e)return;if(this.analysisViewData.active)null!=e.activeController&&e.activeController!==this?(g=!0,e.activeController.analysisViewData.active=!1,g=!1):null!=e.activeController&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(null!=e.activeController&&e.activeController!==this)return;null!=e.activeController&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){V(this.view)}_updateViewSlicePlaneDecoration(){_(this.view)}_updateLayerViews(){const e=null!=this.analysisViewData.plane&&this.analysisViewData.visible&&this.analysisViewData.active,i=[],t=e=>{"layers"in e?e.layers.forEach(t):i.push(e)};this.analysis.excludedLayers.forEach(t),this.view.allLayerViews.forEach(t=>{t.destroyed||("slicePlaneEnabled"in t&&(t.slicePlaneEnabled=e&&!i.includes(t.layer)),"sublayerViews"in t&&t.sublayerViews.forEach(t=>{t.slicePlaneEnabled=e&&!i.includes(t.sublayer)}))}),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};e([n()],f.prototype,"view",void 0),e([n()],f.prototype,"analysis",void 0),e([n()],f.prototype,"analysisViewData",void 0),e([n()],f.prototype,"_allLayerAndSubLayerViews",null),f=e([r("esri.views.3d.analysis.Slice.SliceController")],f);const m=new Map;let g=!1;function V(e){const i=b(e),t=i?.activeController;null!=t?.analysisViewData.plane&&t.analysisViewData.visible?e.slice.plane=t.analysisViewData.plane:e.slice.plane=null}function _(e){const i=b(e),t=i?.activeController;e.slice.isDecoration="web-scene"!==t?.analysis.origin?.type}function S(e,i){m.has(e)||m.set(e,{all:[],activeController:null}),m.get(e)?.all.push(i)}function b(e){return m.get(e)}function L(e,i){if(!m.has(e))throw new Error("view expected in global slice register");const t=m.get(e),a=t?.all.lastIndexOf(i)??-1;if(!t||-1===a)throw new Error("controller expected in global slice register");t.all.splice(a,1),0===t.all.length&&m.delete(e)}export{f as SliceController};
5
+ import{__decorate as e}from"tslib";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as o}from"../../../../chunks/boundedPlane.js";import c from"../../../../layers/Layer.js";import h from"../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isBuildingSceneLayerView3D as u,projectAndElevationAlignShape as d,projectedShapeToPlane as p,planeToShape as y}from"./sliceToolUtils.js";import{logFailedGeometryProjectionError as w}from"../support/projectionUtils.js";import{isTerrainSurfaceLayer as v}from"../../terrain/isTerrainSurfaceLayer.js";let f=class extends t{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",e=>{const i=e.item;null!=i&&(i instanceof c||i instanceof h)?i instanceof c&&v(i)?(a.getLogger(this).error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(i)&&e.preventDefault():(a.getLogger(this).error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),S(this.view,this),this.addHandles([l(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},s),l(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),s),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),l(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()},s),l(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this.addHandles([l(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},s),l(()=>"web-scene"!==this.analysis.origin?.type,()=>this._updateViewSlicePlaneDecoration(),s)],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slice.plane=null,this._updateActiveController(),this._updateViewSlicePlane()),L(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(u).flatMap(({sublayerViews:e})=>e.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(null==t&&null==e||null!=t&&null!=e&&e.equals(t))return;let l=null,s=null;if(null!=e?.position){const t=e.position.spatialReference,n=d(e,this.view);null==n&&w(this.analysis,t,a.getLogger(this)),l=p(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},o()),null!=l&&(s=new i({heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height}))}this._currentSlicePlane=s,this._internalChange=!0,this.analysisViewData.plane=l,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=y(e,this.view,this.view.spatialReference,new i);let a=null;null!=t&&(a=new i({heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height})),this._currentSlicePlane=a,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(g)return;const e=b(this.view);if(!e)return;if(this.analysisViewData.active)null!=e.activeController&&e.activeController!==this?(g=!0,e.activeController.analysisViewData.active=!1,g=!1):null!=e.activeController&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(null!=e.activeController&&e.activeController!==this)return;null!=e.activeController&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){V(this.view)}_updateViewSlicePlaneDecoration(){_(this.view)}_updateLayerViews(){const e=null!=this.analysisViewData.plane&&this.analysisViewData.visible&&this.analysisViewData.active,i=[],t=e=>{"layers"in e?e.layers.forEach(t):i.push(e)};this.analysis.excludedLayers.forEach(t),this.view.allLayerViews.forEach(t=>{t.destroyed||("slicePlaneEnabled"in t&&(t.slicePlaneEnabled=e&&!i.includes(t.layer)),"sublayerViews"in t&&t.sublayerViews.forEach(t=>{t.slicePlaneEnabled=e&&!i.includes(t.sublayer)}))}),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};e([n()],f.prototype,"view",void 0),e([n()],f.prototype,"analysis",void 0),e([n()],f.prototype,"analysisViewData",void 0),e([n()],f.prototype,"_allLayerAndSubLayerViews",null),f=e([r("esri.views.3d.analysis.Slice.SliceController")],f);const m=new Map;let g=!1;function V(e){const i=b(e),t=i?.activeController;null!=t?.analysisViewData.plane&&t.analysisViewData.visible?e.slice.plane=t.analysisViewData.plane:e.slice.plane=null}function _(e){const i=b(e),t=i?.activeController;e.slice.isDecoration="web-scene"!==t?.analysis.origin?.type}function S(e,i){m.has(e)||m.set(e,{all:[],activeController:null}),m.get(e)?.all.push(i)}function b(e){return m.get(e)}function L(e,i){if(!m.has(e))throw new Error("view expected in global slice register");const t=m.get(e),a=t?.all.lastIndexOf(i)??-1;if(!t||-1===a)throw new Error("controller expected in global slice register");t.all.splice(a,1),0===t.all.length&&m.delete(e)}export{f as SliceController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{e as P,l as y,c as w,g,f,t as M,n as D,i as V}from"../../../../chunks/vec32.js";import{create as T,clone as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as S,ZEROS as k}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as x,c as E,n as j,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as I,getNormal as z}from"../../../../geometry/support/plane.js";import{create as O}from"../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as B,getTiltRotateTexture as A}from"../images/Factory.js";import{ResizeManipulator as F}from"./ResizeManipulator.js";import{RotateManipulator as L}from"./RotateManipulator.js";import{getOutlineColor as q,planeColor as N}from"./settings.js";import{ShiftManipulator as J}from"./ShiftManipulator.js";import{pointerMoveTimerMs as Q,planePreviewOutlineWidth as W,forceVerticalModifier as X,forceHorizontalModifier as Y,previewFadeDurationSeconds as Z,previewFadeDotThreshold as $,initialDepthOffsetFrac as tt}from"./sliceToolConfig.js";import{createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,resizePlane as nt,calculatePlaneHalfSize as rt,createPlane as lt,DidPointerMoveRecentlyFlag as ot,calculateBoundedPlaneTranslateRotate as ht,updateShiftRestartHandle as pt,updateRotateHeadingHandle as ut,updateRotateTiltHandle as ct,updateResizeHandle as dt,createShiftPlane as _t}from"./sliceToolUtils.js";import{calculateInputRotationTransform as vt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as mt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as yt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as wt}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as ft}from"../../../support/screenUtils.js";var Mt;let Dt=class extends yt{static{Mt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=Q,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&E(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new J(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new L(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new L(this.view,(t,e)=>A(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new F(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=W,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active?this._placingSlicePlane||"exclude"===this.mode?"crosshair":null!=this._creatingPointerId?"grabbing":null:null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Tt(t))return;this._placingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=ft(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(ft(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=ft(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),E(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=ft(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=Pt(this.view.state.camera,i,St);this.inputState=Vt(e,t.pointerId,a.origin,a)}return E(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),"pointer-drag"!==t.type&&this.stop(),!0}return!1}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(ft(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=t.sourceLayer||t.layer;e&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===X||t.key===Y)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==X&&t.key!==Y||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,St);E(this.analysisViewData.plane,this._startPlane),this.inputState=Vt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(j(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(G.get(),this._startPlane.origin),i=w(G.get(),j(this._startPlane));g(i,i,-t.depth),f(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=z(t.rotatePlane),a=vt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(U.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(G.get(),this._startPlane.basis1,e),a=M(G.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,St),a=G.get();I(this.analysisViewData.plane.plane,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:b(a)})}_createResizeDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=E(this.analysisViewData.plane,x());e.next(mt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,E(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?E(i,bt):null,this._pickPlane(t,!0,e,a)){const t=$;let e=!1;null!=i&&(e=P(z(i.plane),z(a.plane))<t||P(D(G.get(),i.basis1),D(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Z),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&g(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*tt,p=g(G.get(),r,h);f(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[X]?2:i[Y]?1:u;return lt(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ot,this.rotateHeadingManipulator.state|=ot,this.rotateTiltManipulator.state|=ot,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ot,this.rotateHeadingManipulator.state&=~ot,this.rotateTiltManipulator.state&=~ot},this._pointerMoveTimerMs)}_updateManipulators(){if(Mt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=ht(t,U.get());pt(this.shiftManipulator,e,t,this.view.state.camera),ut(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),ct(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>dt(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(!this._creatingPointerId&&(i||"place"===this._mode)),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=ht(t,U.get()),i=V(G.get(),y(t.basis1),y(t.basis2),1),a=v(U.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=q(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=S(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=k}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Vt(t,e,i,a){const s=_t(i,j(a),t.direction,R()),n=T();return I(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],Dt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Dt.prototype,"view",void 0),t([c()],Dt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Dt.prototype,"state",null),t([c({readOnly:!0})],Dt.prototype,"cursor",null),t([c()],Dt.prototype,"analysis",null),t([c()],Dt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Dt.prototype,"_mode",void 0),t([c()],Dt.prototype,"mode",null),t([c({value:null})],Dt.prototype,"inputState",null),t([c()],Dt.prototype,"_placingSlicePlane",null),t([c()],Dt.prototype,"_creatingPointerId",null),Dt=Mt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Dt);const bt=x(),St=O();export{Dt as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{e as P,l as y,c as w,g,f,t as M,n as D,i as V}from"../../../../chunks/vec32.js";import{create as T,clone as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as S,ZEROS as k}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{c as x,a as E,n as j,f as C}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as I,getNormal as z}from"../../../../geometry/support/plane.js";import{create as O}from"../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as B,getTiltRotateTexture as A}from"../images/Factory.js";import{ResizeManipulator as F}from"./ResizeManipulator.js";import{RotateManipulator as L}from"./RotateManipulator.js";import{getOutlineColor as q,planeColor as N}from"./settings.js";import{ShiftManipulator as J}from"./ShiftManipulator.js";import{pointerMoveTimerMs as Q,planePreviewOutlineWidth as W,forceVerticalModifier as X,forceHorizontalModifier as Y,previewFadeDurationSeconds as Z,previewFadeDotThreshold as $,initialDepthOffsetFrac as tt}from"./sliceToolConfig.js";import{createGridVisualElement as et,createOutlineVisualElement as it,planeToShape as at,createRotatePlane as st,resizePlane as nt,calculatePlaneHalfSize as rt,createPlane as lt,DidPointerMoveRecentlyFlag as ot,calculateBoundedPlaneTranslateRotate as ht,updateShiftRestartHandle as pt,updateRotateHeadingHandle as ut,updateRotateTiltHandle as ct,updateResizeHandle as dt,createShiftPlane as _t}from"./sliceToolUtils.js";import{calculateInputRotationTransform as vt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as mt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as yt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as wt}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as ft}from"../../../support/screenUtils.js";var Mt;let Dt=class extends yt{static{Mt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=Q,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&E(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new J(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new L(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new L(this.view,(t,e)=>A(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new F(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=et(this.view),this._previewPlaneOutlineVisualElement=it(this.view),this._previewPlaneOutlineVisualElement.width=W,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active?this._placingSlicePlane||"exclude"===this.mode?"crosshair":null!=this._creatingPointerId?"grabbing":null:null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}get _creatingPointerId(){return null!=this.inputState&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Tt(t))return;this._placingSlicePlane?this._onClickPlacePlane(t)&&t.stopPropagation():this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t);break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Tt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&null!=e&&"shift"===e.type){const i=ft(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(ft(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&null!=this.analysisViewData.plane){const e=ft(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),E(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=ft(t),a=x();if(this._pickPlane(i,!1,this._activeKeyModifiers,a)){if("pointer-drag"===t.type){const e=Pt(this.view.state.camera,i,St);this.inputState=Vt(e,t.pointerId,a.origin,a)}return E(a,this._startPlane),this.analysis.shape=at(a,this.view,this.view.spatialReference,new e),"pointer-drag"!==t.type&&this.stop(),!0}return!1}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(ft(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=t.sourceLayer||t.layer;e&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===X||t.key===Y)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==X&&t.key!==Y||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,St);E(this.analysisViewData.plane,this._startPlane),this.inputState=Vt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(P(j(this.analysisViewData.plane),e.ray.direction)/y(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(G.get(),this._startPlane.origin),i=w(G.get(),j(this._startPlane));g(i,i,-t.depth),f(i,i,e);const a=C(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=st(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,St),a=T();I(e,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?E(this.analysisViewData.plane,x()):null;e.next(mt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=z(t.rotatePlane),a=vt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(U.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(G.get(),this._startPlane.basis1,e),a=M(G.get(),this._startPlane.basis2,e),s=C(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,St),a=G.get();I(this.analysisViewData.plane.plane,i,a)&&(E(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:b(a)})}_createResizeDragPipeline(t){return wt(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=E(this.analysisViewData.plane,x());e.next(mt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,E(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?E(i,bt):null,this._pickPlane(t,!0,e,a)){const t=$;let e=!1;null!=i&&(e=P(z(i.plane),z(a.plane))<t||P(D(G.get(),i.basis1),D(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*Z),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;P(r,l.viewForward)>0&&g(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*tt,p=g(G.get(),r,h);f(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[X]?2:i[Y]?1:u;return lt(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ot,this.rotateHeadingManipulator.state|=ot,this.rotateTiltManipulator.state|=ot,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ot,this.rotateHeadingManipulator.state&=~ot,this.rotateTiltManipulator.state&=~ot},this._pointerMoveTimerMs)}_updateManipulators(){if(Mt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=ht(t,U.get());pt(this.shiftManipulator,e,t,this.view.state.camera),ut(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),ct(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>dt(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(!this._creatingPointerId&&(i||"place"===this._mode)),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=ht(t,U.get()),i=V(G.get(),y(t.basis1),y(t.basis2),1),a=v(U.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=q(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=S(N);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=k}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Vt(t,e,i,a){const s=_t(i,j(a),t.direction,R()),n=T();return I(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Tt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],Dt.prototype,"_clock",void 0),t([c({constructOnly:!0})],Dt.prototype,"view",void 0),t([c()],Dt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],Dt.prototype,"state",null),t([c({readOnly:!0})],Dt.prototype,"cursor",null),t([c()],Dt.prototype,"analysis",null),t([c()],Dt.prototype,"removeIncompleteOnCancel",void 0),t([c()],Dt.prototype,"_mode",void 0),t([c()],Dt.prototype,"mode",null),t([c({value:null})],Dt.prototype,"inputState",null),t([c()],Dt.prototype,"_placingSlicePlane",null),t([c()],Dt.prototype,"_creatingPointerId",null),Dt=Mt=t([d("esri.views.3d.analysis.Slice.SliceTool")],Dt);const bt=x(),St=O();export{Dt as default};