@arcgis/core 4.29.0-next.20240222 → 4.29.1

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 (279) hide show
  1. package/arcade/treeAnalysis.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{b43fde3e25d0c3b020b5.js → 039a872509872ce67ba4.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0bc21d2a0b65bd4e9d76.js +1 -0
  5. package/assets/esri/core/workers/chunks/{5243f9ff21e768c620c2.js → 23a5d750d93a7829174f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{47e6119be4a4a5ed640d.js → 2447a4d5886aeb0ff72a.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{7f45a9e9bdbcffc2d6e0.js → 348bcc57b99a975902a8.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{8c9fb2601488998013ba.js → 3523789a2948a4ab8cc8.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{24649b410b757599a549.js → 48db6e0bbb1a9c043193.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{752082be991f1cc8558f.js → 4984e2b79d862114d6a6.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{8d9736fd15cdb54d9855.js → 5227f9eea6988aadad7f.js} +1 -1
  12. package/assets/esri/core/workers/chunks/58723274ef657fe212eb.js +1 -0
  13. package/assets/esri/core/workers/chunks/60ab18c6a04d4b2f1d4c.js +1 -0
  14. package/assets/esri/core/workers/chunks/647515801d94180b8402.js +1 -0
  15. package/assets/esri/core/workers/chunks/6c3ae96ec90e9ed7dd50.js +1 -0
  16. package/assets/esri/core/workers/chunks/7a8bba91769ee18cc39f.js +1 -0
  17. package/assets/esri/core/workers/chunks/7a98d2e026f63a581b1e.js +1 -0
  18. package/assets/esri/core/workers/chunks/8c360923cd1850767d3e.js +1 -0
  19. package/assets/esri/core/workers/chunks/{1a25ba411b89e050fbb7.js → a61f337802ae963d7f65.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d0c5318d7ef2e923aad0.js → a8ac511280f873960d46.js} +1 -1
  21. package/assets/esri/core/workers/chunks/b125ab84b7761e761734.js +1 -0
  22. package/assets/esri/core/workers/chunks/{b34d6e58b125fe111f91.js → b42a83db83851cb57d44.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{1497dd943df7eede0704.js → b9c55ff1f21db198ce03.js} +1 -1
  24. package/assets/esri/core/workers/chunks/bb3322ddb89c0bd444f0.js +1 -0
  25. package/assets/esri/core/workers/chunks/becfdaeeb07f089d8be7.js +1 -0
  26. package/assets/esri/core/workers/chunks/{b26e39a399963c176d33.js → c527692694688a5b3b07.js} +2 -2
  27. package/assets/esri/core/workers/chunks/{210a93e0b96c5bff44a3.js → c556644bb0cf88770939.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{e7b26c7e9e24dc6255be.js → cacf97b0a7a1057b9f79.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{a5e7b4acae17f88e2208.js → ce93027b6b81428ce9b0.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{b8ece275abac93f3dccf.js → d14f16bfa6c12909929c.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{1594f06a2d7d9439c62e.js → e2147c99cc5839654be1.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{d33ed3a2a0d4b640bd4a.js → e4c7d8c69e4957c9d27c.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{7709248f59520aee6f51.js → eceaa46f622f6fa31128.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{2286db4c83ff1b6fb088.js → ef3e6209e6ac6a56960b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/f59b5ea05caca8a1a398.js +1 -0
  36. package/chunks/Laserlines.glsl.js +3 -3
  37. package/chunks/Precipitation.glsl.js +1 -1
  38. package/chunks/SSAOBlur.glsl.js +2 -2
  39. package/chunks/boundedPlane.js +1 -1
  40. package/chunks/cameraUtilsSpherical.js +1 -1
  41. package/chunks/sphere.js +1 -1
  42. package/chunks/terrainUtilsPlanar.js +1 -1
  43. package/chunks/vec32.js +1 -1
  44. package/config.js +1 -1
  45. package/copyright.txt +56 -28
  46. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  47. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  48. package/core/libs/gl-matrix-2/vec3.js +1 -1
  49. package/geometry/support/axisAngleDegrees.js +1 -1
  50. package/geometry/support/coordinateSystem.js +1 -1
  51. package/geometry/support/lineSegment.js +1 -1
  52. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  53. package/geometry/support/meshUtils/georeference.js +1 -1
  54. package/geometry/support/meshUtils/merge.js +1 -1
  55. package/geometry/support/meshUtils/rotate.js +1 -1
  56. package/geometry/support/meshUtils/scale.js +1 -1
  57. package/geometry/support/meshUtils/vertexSpaceConversion.js +5 -0
  58. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  59. package/geometry/support/plane.js +1 -1
  60. package/geometry/support/ray.js +1 -1
  61. package/geometry/support/triangle.js +1 -1
  62. package/geometry/support/vector.js +1 -1
  63. package/interfaces.d.ts +12 -12
  64. package/kernel.js +1 -1
  65. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  66. package/layers/LinkChartLayer.js +1 -1
  67. package/layers/VoxelWasmPerSceneView.js +1 -1
  68. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  69. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  70. package/layers/mixins/FeatureReductionLayer.js +1 -1
  71. package/layers/orientedImagery/core/CameraOrientation.js +1 -1
  72. package/layers/orientedImagery/core/ElevationSourceDefinitions.js +1 -1
  73. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  74. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  75. package/layers/orientedImagery/transformations/imageToWorld.js +5 -0
  76. package/layers/orientedImagery/transformations/updateElevation.js +5 -0
  77. package/layers/orientedImagery/transformations/updateElevationUtils.js +5 -0
  78. package/layers/orientedImagery/transformations/utils.js +1 -1
  79. package/layers/orientedImagery/transformations/worldToImage.js +5 -0
  80. package/layers/support/EditingCapabilities.js +1 -1
  81. package/layers/support/editableLayers.js +1 -1
  82. package/layers/support/layerUtils.js +1 -1
  83. package/layers/video/VideoCameraSensorModel.js +1 -1
  84. package/layers/voxel/VoxelVolume.js +1 -1
  85. package/layers/voxel/voxelPlaneUtils.js +1 -1
  86. package/libs/linkchartlayout/LinkChartLayout.js +1 -1
  87. package/package.json +1 -1
  88. package/smartMapping/renderers/pieChart.js +1 -1
  89. package/support/revision.js +1 -1
  90. package/symbols/cim/cimAnalyzer.js +1 -1
  91. package/views/2d/arcade/callExpressionWithCursor.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
  93. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
  94. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  95. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  96. package/views/2d/layers/features/Processor.js +1 -1
  97. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  98. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  99. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  100. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  101. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  102. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  103. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  104. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  105. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  106. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  107. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  108. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  109. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  110. package/views/2d/layers/features/sources/strategies/chunks/DrillDownTileSourceChunk.js +1 -1
  111. package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
  112. package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
  113. package/views/2d/layers/features/sources/strategies/chunks/PagedTileSourceChunk.js +1 -1
  114. package/views/2d/layers/features/sources/strategies/chunks/StreamSourceChunk.js +1 -1
  115. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  116. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  117. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  118. package/views/2d/layers/features/support/Tile.js +1 -1
  119. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  120. package/views/2d/tiling/TileKey.js +1 -1
  121. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  122. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  123. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  124. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  125. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  126. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  127. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  128. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  129. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  130. package/views/3d/analysis/support/measurementUtils.js +1 -1
  131. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  132. package/views/3d/camera/constraintUtils/common.js +1 -1
  133. package/views/3d/camera/constraintUtils/distance.js +1 -1
  134. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  135. package/views/3d/camera/intersectionUtils.js +1 -1
  136. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  137. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  138. package/views/3d/environment/Fog.js +1 -1
  139. package/views/3d/environment/MarsAtmosphere.js +1 -1
  140. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  141. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  142. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  143. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  144. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  145. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  146. package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
  147. package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
  148. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  149. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  150. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  151. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  152. package/views/3d/layers/I3SMeshView3D.js +1 -1
  153. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  154. package/views/3d/layers/PointCloudWorker.js +1 -1
  155. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  157. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  158. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  159. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  160. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  161. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  162. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  163. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  164. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  165. package/views/3d/layers/support/uvUtils.js +1 -1
  166. package/views/3d/state/Frustum.js +1 -1
  167. package/views/3d/state/NearFarHeuristic.js +1 -1
  168. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  169. package/views/3d/state/controllers/RotateController.js +1 -1
  170. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  171. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  172. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  173. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  174. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  175. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  176. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  177. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  178. package/views/3d/state/utils/navigationUtils.js +1 -1
  179. package/views/3d/state/utils/viewUtils.js +1 -1
  180. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  181. package/views/3d/support/cameraUtils.js +1 -1
  182. package/views/3d/support/cameraUtilsInternal.js +1 -1
  183. package/views/3d/support/intersectionUtils.js +1 -1
  184. package/views/3d/support/mathUtils.js +1 -1
  185. package/views/3d/support/orientedBoundingBox.js +1 -1
  186. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  187. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  188. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  189. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  190. package/views/3d/support/sunUtils.js +1 -1
  191. package/views/3d/support/viewpointUtils.js +1 -1
  192. package/views/3d/terrain/OverlayManager.js +1 -1
  193. package/views/3d/terrain/PatchRenderData.js +1 -1
  194. package/views/3d/terrain/SphericalPatch.js +1 -1
  195. package/views/3d/terrain/TerrainRenderer.js +1 -1
  196. package/views/3d/terrain/Tile.js +1 -1
  197. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  198. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  199. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  200. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  201. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  202. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  203. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  204. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  205. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  206. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  207. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  208. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  209. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  210. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  211. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  212. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  213. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  214. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  215. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  216. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  217. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  218. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  220. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  225. package/views/SelectionManager.js +1 -1
  226. package/views/draw/support/createUtils.js +1 -1
  227. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  228. package/views/interactive/GraphicManipulator.js +1 -1
  229. package/views/interactive/SegmentLabels.js +1 -1
  230. package/views/interactive/coordinateHelper.js +1 -1
  231. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  232. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  233. package/views/interactive/sketch/constraints.js +1 -1
  234. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  235. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  236. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  237. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  238. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  239. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  240. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  241. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  242. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  243. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  244. package/views/layers/FeatureLayerView.js +1 -1
  245. package/views/layers/support/editableLayerViews.js +5 -0
  246. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  247. package/views/support/angularMeasurementUtils.js +1 -1
  248. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  249. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  250. package/views/support/geometry3dUtils.js +1 -1
  251. package/widgets/Editor/EditorViewModel.js +1 -1
  252. package/widgets/Editor/support/EditorEditingCapabilities.js +1 -1
  253. package/widgets/Editor/support/EditorItem.js +1 -1
  254. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  255. package/widgets/FeatureForm.js +1 -1
  256. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  257. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  258. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  259. package/widgets/Features/FeaturesViewModel.js +1 -1
  260. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  261. package/widgets/OrientedImageryViewer.js +1 -1
  262. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  263. package/widgets/PanoramicViewer/utils.js +1 -1
  264. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  265. package/widgets/UtilityNetworkTrace.js +1 -1
  266. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  267. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  268. package/assets/esri/core/workers/chunks/0e83f3718a0b45652b5e.js +0 -1
  269. package/assets/esri/core/workers/chunks/1fa5c8af69a09a3730b3.js +0 -1
  270. package/assets/esri/core/workers/chunks/25f73748df0ee82d06cb.js +0 -1
  271. package/assets/esri/core/workers/chunks/2d7a18f8c540269ecee9.js +0 -1
  272. package/assets/esri/core/workers/chunks/4736f79b5c94ce103d43.js +0 -1
  273. package/assets/esri/core/workers/chunks/65f7adaaf1f535310c11.js +0 -1
  274. package/assets/esri/core/workers/chunks/79c041b292648c5eaecc.js +0 -1
  275. package/assets/esri/core/workers/chunks/7c4c2c0beddabac672b6.js +0 -1
  276. package/assets/esri/core/workers/chunks/9a758de08dfa57735879.js +0 -1
  277. package/assets/esri/core/workers/chunks/a4c3da057ec2a07bbbe8.js +0 -1
  278. package/assets/esri/core/workers/chunks/b252270b100351779f1f.js +0 -1
  279. package/assets/esri/core/workers/chunks/dc57aa9f2fc69e654559.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";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 s}from"../../core/accessorSupport/decorators/subclass.js";import{fromValues as i,create as a}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as r,create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as n,transpose as h}from"../../core/libs/gl-matrix-2/math/mat3.js";import{j as m,q as g,f as u,t as c}from"../../chunks/vec32.js";import p from"../../geometry/Point.js";import d from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as f}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBuffer as v}from"../../geometry/projection/projectBuffer.js";import{earth as _}from"../../geometry/support/Ellipsoid.js";import{videoMetadataEntryId as A}from"./videoUtils.js";const M=Math.PI/180;let V=class extends e{constructor(t){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const e=t[0],o=t[1],s=t[2];return i(e[0],o[0],s[0],e[1],o[1],s[1],e[2],o[2],s[2])},this._multiplyMat3=(t,e)=>{const o=a();return n(o,t,e),o},this._transposeMat3=t=>{const e=a();return h(e,t),e},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*M),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*M),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*M),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*M)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*M,this.sensorPitchAngle*M,this.sensorRollAngle*M),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*M),e=Math.cos(this.sensorLatitude*M),o=Math.sin(this.sensorLongitude*M),s=Math.cos(this.sensorLongitude*M);return this._createMat3FromValues([[-t*s,-o,-e*s],[-t*o,s,-e*o],[e,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*M,this.platformPitchAngle*M,this.platformRollAngle*M),this._extractValues=t=>{this.imageWidth=t.get(A.EsriVideoWidth)?.value,this.imageHeight=t.get(A.EsriVideoHeight)?.value;const e=t.get(A.SensorEllipsoidHeight)?.value;this.sensorAltitude=e??t.get(A.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(A.SensorLatitude)?.value,this.sensorLongitude=t.get(A.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(A.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(A.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(A.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(A.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(A.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(A.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(A.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(A.PlatformRollAngle)?.value,this.averageElevation=t.get(A.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,e,o)=>{const s=Math.cos(t),i=Math.sin(t),a=Math.cos(e),r=Math.sin(e),l=Math.cos(o),n=Math.sin(o);return this._createMat3FromValues([[s*a,s*r*n-l*i,i*n+s*l*r],[a*i,s*l+i*r*n,l*i*r-s*n],[-r,a*n,a*l]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),e=this._calculateCameraFovReverse(),o=this._calculateCameraLook(),s=this._calculateImageDimensionsForward(),i=this._calculateImageDimensionsReverse(),a=this._calculatePlatformPositionMatrix(),r=this._calculatePlatformOrientation(),l=this._multiplyMat3(this._multiplyMat3(a,r),o);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(l,t),s);const n=this._multiplyMat3(i,e);this._earthToImageTransform=this._multiplyMat3(n,this._transposeMat3(l)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const e=t.get(A.EsriVideoWidth)?.value??0,o=t.get(A.EsriVideoHeight)?.value??0;if(e<=0||o<=0)return!1;const s=t.get(A.SensorEllipsoidHeight)?.value,i=t.get(A.SensorTrueAltitude)?.value,a=t.get(A.SensorLatitude)?.value,r=t.get(A.SensorLongitude)?.value;if(null==s&&null==i||null==a||null==r)return!1;const l=t.get(A.PlatformHeadingAngle)?.value,n=t.get(A.PlatformPitchAngle)?.value,h=t.get(A.PlatformRollAngle)?.value;if(null==l||null==n||null==h)return!1;const m=t.get(A.SensorHorizontalFOV)?.value,g=t.get(A.SensorVerticalFOV)?.value;if(null==m||null==g)return!1;const u=t.get(A.SensorAzimuthAngle)?.value,c=t.get(A.SensorElevationAngle)?.value,p=t.get(A.SensorRollAngle)?.value;return null!=u&&null!=c&&null!=p},this._projectPointToECEF=(t,e,o)=>{const s=[];return v([t,e,o],d.WGS84,0,s,f,0,1),new p({x:s[0],y:s[1],z:s[2],spatialReference:f})},this._projectImageVectorToEllipsoid=(t,e)=>{const o=_.semiMajorAxis+e,s=_.semiMinorAxis+e,i=s/o,a=o/s,{x:n,y:h,z:u}=this._platformPositionEcef,c=u??this.averageElevation,p=r(n,h,a*c),d=m(t,t),f=m(t,p),v=m(p,p)-o*o,A=(-f-Math.sqrt(f*f-d*v))/d;if(A<0)return[NaN,NaN,NaN];const M=l();return g(M,p,t,A),M[2]=M[2]*i,M};const e=t?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(t,e,o){const s=this._platformPositionEcef;if(!s)return[0,0];const{x:i,y:a,z:n}=s,h=r(i,a,n),m=this._projectPointToECEF(t,e,o||this.averageElevation),g=l(),p=r(m.x,m.y,m.z);u(g,p,h),c(g,g,this._earthToImageTransform);const d=g[0],f=g[1],v=g[2];let _=r(NaN,NaN,NaN);return isNaN(v)||(_=r(d/v,f/v,v/v)),[_[0],_[1]]}transformImageToGeo(t,e){const o=r(t,e,1),s=l();c(s,o,this._imageToEarthTransform);const i=this._projectImageVectorToEllipsoid(s,this.averageElevation);let a;if(!isNaN(i[0])){const t=[];v([i[0],i[1],i[2]],f,0,t,d.WGS84,0,1),a=new p({x:t[0],y:t[1],z:t[2],spatialReference:d.WGS84})}return a}};t([o()],V.prototype,"averageElevation",void 0),t([o()],V.prototype,"imageHeight",void 0),t([o()],V.prototype,"imageWidth",void 0),t([o({readOnly:!0})],V.prototype,"metadataSupportsTransforms",void 0),t([o()],V.prototype,"platformHeadingAngle",void 0),t([o()],V.prototype,"platformPitchAngle",void 0),t([o()],V.prototype,"platformRollAngle",void 0),t([o()],V.prototype,"sensorHeadingAngle",void 0),t([o()],V.prototype,"sensorAltitude",void 0),t([o()],V.prototype,"sensorHorizontalFieldOfView",void 0),t([o()],V.prototype,"sensorLatitude",void 0),t([o()],V.prototype,"sensorLongitude",void 0),t([o()],V.prototype,"sensorPitchAngle",void 0),t([o()],V.prototype,"sensorRollAngle",void 0),t([o()],V.prototype,"sensorVerticalFieldOfView",void 0),t([o()],V.prototype,"vttMetadata",void 0),V=t([s("esri.layers.video.VideoCameraSensorModel")],V);const y=V;export{y as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";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 s}from"../../core/accessorSupport/decorators/subclass.js";import{fromValues as i,create as a}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as r,create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as n,transpose as h}from"../../core/libs/gl-matrix-2/math/mat3.js";import{k as m,r as g,f as u,t as c}from"../../chunks/vec32.js";import p from"../../geometry/Point.js";import d from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as f}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBuffer as v}from"../../geometry/projection/projectBuffer.js";import{earth as _}from"../../geometry/support/Ellipsoid.js";import{videoMetadataEntryId as A}from"./videoUtils.js";const M=Math.PI/180;let V=class extends e{constructor(t){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const e=t[0],o=t[1],s=t[2];return i(e[0],o[0],s[0],e[1],o[1],s[1],e[2],o[2],s[2])},this._multiplyMat3=(t,e)=>{const o=a();return n(o,t,e),o},this._transposeMat3=t=>{const e=a();return h(e,t),e},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*M),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*M),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*M),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*M)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*M,this.sensorPitchAngle*M,this.sensorRollAngle*M),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*M),e=Math.cos(this.sensorLatitude*M),o=Math.sin(this.sensorLongitude*M),s=Math.cos(this.sensorLongitude*M);return this._createMat3FromValues([[-t*s,-o,-e*s],[-t*o,s,-e*o],[e,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*M,this.platformPitchAngle*M,this.platformRollAngle*M),this._extractValues=t=>{this.imageWidth=t.get(A.EsriVideoWidth)?.value,this.imageHeight=t.get(A.EsriVideoHeight)?.value;const e=t.get(A.SensorEllipsoidHeight)?.value;this.sensorAltitude=e??t.get(A.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(A.SensorLatitude)?.value,this.sensorLongitude=t.get(A.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(A.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(A.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(A.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(A.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(A.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(A.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(A.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(A.PlatformRollAngle)?.value,this.averageElevation=t.get(A.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,e,o)=>{const s=Math.cos(t),i=Math.sin(t),a=Math.cos(e),r=Math.sin(e),l=Math.cos(o),n=Math.sin(o);return this._createMat3FromValues([[s*a,s*r*n-l*i,i*n+s*l*r],[a*i,s*l+i*r*n,l*i*r-s*n],[-r,a*n,a*l]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),e=this._calculateCameraFovReverse(),o=this._calculateCameraLook(),s=this._calculateImageDimensionsForward(),i=this._calculateImageDimensionsReverse(),a=this._calculatePlatformPositionMatrix(),r=this._calculatePlatformOrientation(),l=this._multiplyMat3(this._multiplyMat3(a,r),o);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(l,t),s);const n=this._multiplyMat3(i,e);this._earthToImageTransform=this._multiplyMat3(n,this._transposeMat3(l)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const e=t.get(A.EsriVideoWidth)?.value??0,o=t.get(A.EsriVideoHeight)?.value??0;if(e<=0||o<=0)return!1;const s=t.get(A.SensorEllipsoidHeight)?.value,i=t.get(A.SensorTrueAltitude)?.value,a=t.get(A.SensorLatitude)?.value,r=t.get(A.SensorLongitude)?.value;if(null==s&&null==i||null==a||null==r)return!1;const l=t.get(A.PlatformHeadingAngle)?.value,n=t.get(A.PlatformPitchAngle)?.value,h=t.get(A.PlatformRollAngle)?.value;if(null==l||null==n||null==h)return!1;const m=t.get(A.SensorHorizontalFOV)?.value,g=t.get(A.SensorVerticalFOV)?.value;if(null==m||null==g)return!1;const u=t.get(A.SensorAzimuthAngle)?.value,c=t.get(A.SensorElevationAngle)?.value,p=t.get(A.SensorRollAngle)?.value;return null!=u&&null!=c&&null!=p},this._projectPointToECEF=(t,e,o)=>{const s=[];return v([t,e,o],d.WGS84,0,s,f,0,1),new p({x:s[0],y:s[1],z:s[2],spatialReference:f})},this._projectImageVectorToEllipsoid=(t,e)=>{const o=_.semiMajorAxis+e,s=_.semiMinorAxis+e,i=s/o,a=o/s,{x:n,y:h,z:u}=this._platformPositionEcef,c=u??this.averageElevation,p=r(n,h,a*c),d=m(t,t),f=m(t,p),v=m(p,p)-o*o,A=(-f-Math.sqrt(f*f-d*v))/d;if(A<0)return[NaN,NaN,NaN];const M=l();return g(M,p,t,A),M[2]=M[2]*i,M};const e=t?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(t,e,o){const s=this._platformPositionEcef;if(!s)return[0,0];const{x:i,y:a,z:n}=s,h=r(i,a,n),m=this._projectPointToECEF(t,e,o||this.averageElevation),g=l(),p=r(m.x,m.y,m.z);u(g,p,h),c(g,g,this._earthToImageTransform);const d=g[0],f=g[1],v=g[2];let _=r(NaN,NaN,NaN);return isNaN(v)||(_=r(d/v,f/v,v/v)),[_[0],_[1]]}transformImageToGeo(t,e){const o=r(t,e,1),s=l();c(s,o,this._imageToEarthTransform);const i=this._projectImageVectorToEllipsoid(s,this.averageElevation);let a;if(!isNaN(i[0])){const t=[];v([i[0],i[1],i[2]],f,0,t,d.WGS84,0,1),a=new p({x:t[0],y:t[1],z:t[2],spatialReference:d.WGS84})}return a}};t([o()],V.prototype,"averageElevation",void 0),t([o()],V.prototype,"imageHeight",void 0),t([o()],V.prototype,"imageWidth",void 0),t([o({readOnly:!0})],V.prototype,"metadataSupportsTransforms",void 0),t([o()],V.prototype,"platformHeadingAngle",void 0),t([o()],V.prototype,"platformPitchAngle",void 0),t([o()],V.prototype,"platformRollAngle",void 0),t([o()],V.prototype,"sensorHeadingAngle",void 0),t([o()],V.prototype,"sensorAltitude",void 0),t([o()],V.prototype,"sensorHorizontalFieldOfView",void 0),t([o()],V.prototype,"sensorLatitude",void 0),t([o()],V.prototype,"sensorLongitude",void 0),t([o()],V.prototype,"sensorPitchAngle",void 0),t([o()],V.prototype,"sensorRollAngle",void 0),t([o()],V.prototype,"sensorVerticalFieldOfView",void 0),t([o()],V.prototype,"vttMetadata",void 0),V=t([s("esri.layers.video.VideoCameraSensorModel")],V);const y=V;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{f as n,G as o,A as a,g as l}from"../../chunks/vec32.js";import{fromValues as p,fromArray as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import g from"./VoxelDimension.js";let d=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return s.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return s.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=p(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const s=e.z??0,t=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-s)<Math.abs(n*e-s)?i:e));for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new m({x:0,y:0,spatialReference:this.spatialReference});const i=u(e);if(a(i,i,this.voxelSizeInLayerSpaceSigned),l(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new m({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new m({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"id",void 0),e([r({type:[g],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"dimensions",void 0),e([r({type:c,json:{read:{enabled:!1}}})],d.prototype,"spatialReference",void 0),e([r({type:Number,json:{read:!1}})],d.prototype,"zDimension",null),e([r({type:[Boolean],json:{read:!1}})],d.prototype,"isValid",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"originInLayerSpace3D",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"voxelSizeInLayerSpaceSigned",null),e([r({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],d.prototype,"volumeType",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"sizeInVoxels",null),d=e([t("esri.layers.voxel.VoxelVolume")],d);const y=d;export{y as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{f as n,H as o,B as a,g as l}from"../../chunks/vec32.js";import{fromValues as p,fromArray as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";import g from"./VoxelDimension.js";let d=class extends i{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=c.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&(!!Array.isArray(this.dimensions)&&(4===this.dimensions.length&&(!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(-1===this.zDimension||this.dimensions[this.zDimension].size<1))))}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],i[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],t=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let n=0;n<3;++n)t[n]<2?t[n]=1:t[n]-=1;return s.isRegular&&!s.isPositiveUp&&(t[2]*=-1),[(e[1]-e[0])/t[0],(i[1]-i[0])/t[1],(r[1]-r[0])/t[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return s.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!h(this.spatialReference,e.spatialReference))return s.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=p(e.x,e.y,e.z??0);n(i,i,this.originInLayerSpace3D),o(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray(r.irregularSpacing?.values)&&r.irregularSpacing.values.length>1){const s=e.z??0,t=r.irregularSpacing.values,n=r.isPositiveUp?1:-1,o=t.reduce(((e,i)=>Math.abs(n*i-s)<Math.abs(n*e-s)?i:e));for(let e=0;e<t.length;++e)if(t[e]===o){i[2]=e;break}}return[i[0],i[1],i[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new m({x:0,y:0,spatialReference:this.spatialReference});const i=u(e);if(a(i,i,this.voxelSizeInLayerSpaceSigned),l(i,i,this.originInLayerSpace3D),"xyt"===this.volumeType)return new m({x:i[0],y:i[1],spatialReference:this.spatialReference});const s=this.dimensions[this.zDimension];return s.isRegular||Array.isArray(s.irregularSpacing?.values)&&(e[2]<0?i[2]=s.irregularSpacing.values[0]:e[2]<s.irregularSpacing.values.length?i[2]=s.irregularSpacing.values[e[2]]:i[2]=s.irregularSpacing.values[s.irregularSpacing.values.length-1],s.isPositiveUp||(i[2]*=-1)),new m({x:i[0],y:i[1],z:i[2],spatialReference:this.spatialReference})}};e([r({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"id",void 0),e([r({type:[g],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"dimensions",void 0),e([r({type:c,json:{read:{enabled:!1}}})],d.prototype,"spatialReference",void 0),e([r({type:Number,json:{read:!1}})],d.prototype,"zDimension",null),e([r({type:[Boolean],json:{read:!1}})],d.prototype,"isValid",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"originInLayerSpace3D",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"voxelSizeInLayerSpaceSigned",null),e([r({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],d.prototype,"volumeType",null),e([r({type:[Number],json:{read:!1}})],d.prototype,"sizeInVoxels",null),d=e([t("esri.layers.voxel.VoxelVolume")],d);const y=d;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{setAxisAngle as t,multiply as r}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as o}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as a,fromValues as s}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{toDegree as m,toRadian as c}from"../../core/libs/gl-matrix-2/math/common.js";import{c as i,n,r as e}from"../../chunks/vec32.js";const f=a(),l=o(),u=o(),p=o(),h=s(0,0,1),j=s(0,1,0),x=s(1,0,0);function b(r){i(f,r),n(f,f);const a=Math.atan2(f[1],f[0]),s=t(o(),h,-a);e(f,f,s);const c=-1*Math.atan2(f[2],f[0]);return[m(a)+270,m(c)+90]}function g(o,a){return t(u,h,c(o-270)),t(p,j,c(a-90)),r(l,u,p),i(f,x),e(f,f,l),n(f,f),[f[0],f[1],f[2]]}export{g as computeNormalFromOrientationTilt,b as computeOrientationTiltFromNormal};
5
+ import{setAxisAngle as t,multiply as r}from"../../core/libs/gl-matrix-2/math/quat.js";import{create as o}from"../../core/libs/gl-matrix-2/factories/quatf64.js";import{create as a,fromValues as s}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{toDegree as m,toRadian as c}from"../../core/libs/gl-matrix-2/math/common.js";import{c as i,n,u as e}from"../../chunks/vec32.js";const f=a(),l=o(),u=o(),p=o(),h=s(0,0,1),j=s(0,1,0),x=s(1,0,0);function b(r){i(f,r),n(f,f);const a=Math.atan2(f[1],f[0]),s=t(o(),h,-a);e(f,f,s);const c=-1*Math.atan2(f[2],f[0]);return[m(a)+270,m(c)+90]}function g(o,a){return t(u,h,c(o-270)),t(p,j,c(a-90)),r(l,u,p),i(f,x),e(f,f,l),n(f,f),[f[0],f[1],f[2]]}export{g as computeNormalFromOrientationTilt,b as computeOrientationTiltFromNormal};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as t}from"../../assets.js";let e,r=null;function a(){return!!r}function n(){return e||(e=import("../../chunks/lclayout.js").then((t=>t.l)).then((({default:e})=>e({locateFile:e=>t(`esri/libs/linkchartlayout/${e}`)}))).then((t=>{s(t)})),e)}function s(t){r=t}var u,o;function y(t,e,a,n,s,u){const o=a.length,y=s.length,i=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,c=Uint8Array.BYTES_PER_ELEMENT,E=16,p=E-1+o*(c+2*i)+y*(2*l),f=r._malloc(p);try{const c=f+E-f%E,p=c+o*i,b=p+o*i,A=b+y*l,P=A+y*l,L=()=>[r.HEAPF64.subarray(c>>3,(c>>3)+o),r.HEAPF64.subarray(p>>3,(p>>3)+o),r.HEAPU32.subarray(b>>2,(b>>2)+y),r.HEAPU32.subarray(A>>2,(A>>2)+y),r.HEAPU8.subarray(P,P+o)],[d,C,H,_,g]=L();d.set(a),C.set(n),H.set(s),_.set(u),g.set(e);const R=t(o,P,c,p,y,b,A);let h=null;if(R){const t=r.getLayoutLinksTypes(),e=r.getLayoutLinksVerticesEndIndices(),a=r.getLayoutLinksVertices(),n=r.countLayoutLinksVertices();h={types:r.HEAPU8.subarray(t,t+y),vertexEndIndex:r.HEAPU32.subarray(e>>2,(e>>2)+y),vertices:r.HEAPF64.subarray(a>>3,(a>>3)+2*n)}}const[F,m,B,T,U]=L();return a.set(F),n.set(m),s.set(B),u.set(T),e.set(U),{success:R,links:h}}finally{r._free(f),r.cleanupLayout()}}!function(t){t[t.None=0]="None",t[t.IsMovable=1]="IsMovable",t[t.IsGeographic=2]="IsGeographic",t[t.IsRoot=4]="IsRoot"}(u||(u={})),function(t){t[t.Regular=0]="Regular",t[t.Orthogonal=1]="Orthogonal",t[t.Curved=2]="Curved",t[t.Recursive=3]="Recursive"}(o||(o={}));const i=2,l=1,c=-1;var E,p,f,b,A,P,L,d;function C(t,e,a,n,s,u,o,y,i,l,c,E,p,f,b){const A=e.length,P=Float64Array.BYTES_PER_ELEMENT,L=Uint32Array.BYTES_PER_ELEMENT,d=16,C=d-1+t*(8*P)+A*(3*L),H=r._malloc(C);try{const C=H+d-H%d,_=C+t*P,g=_+t*P,R=g+t*P,h=R+t*P,F=h+t*P,m=F+t*P,B=m+t*P,T=B+t*P,U=T+A*L,v=U+A*L,N=()=>[r.HEAPF64.subarray(C>>3,(C>>3)+t),r.HEAPF64.subarray(_>>3,(_>>3)+t),r.HEAPF64.subarray(g>>3,(g>>3)+t),r.HEAPF64.subarray(R>>3,(R>>3)+t),r.HEAPF64.subarray(h>>3,(h>>3)+t),r.HEAPF64.subarray(F>>3,(F>>3)+t),r.HEAPF64.subarray(m>>3,(m>>3)+t),r.HEAPF64.subarray(B>>3,(B>>3)+t),r.HEAPU32.subarray(T>>2,(T>>2)+A),r.HEAPU32.subarray(U>>2,(U>>2)+A),r.HEAPU32.subarray(v>>2,(v>>2)+A)],[I,M,k,S,Y,z,G,x,D,V,j]=N();I.set(y),M.set(i),k.set(l),S.set(c),Y.set(E),z.set(p),G.set(f),x.set(b),D.set(e),V.set(a),j.set(n);const w=r.computeCentrality(t,A,T,U,v,s,u,o,C,_,g,R,h,F,m,B),[O,$,q,J,K,Q,W,X,Z,tt,et]=N();return y.set(O),i.set($),l.set(q),c.set(J),E.set(K),p.set(Q),f.set(W),b.set(X),e.set(Z),a.set(tt),n.set(et),w}finally{r._free(H)}}!function(t){function e(){return r.getMinIdealEdgeLength()}function a(t,e,a,n,s,u=i,o=l,E=c){return y(((t,e,a,n,s,y,i)=>r.applyForceDirectedLayout(t,e,a,n,s,y,i,u,o,E)),t,e,a,n,s)}t.getMinIdealEdgeLength=e,t.apply=a}(E||(E={})),function(t){function e(t,e,a,n,s,u=i,o=l,E=c){return y(((t,e,a,n,s,y,i)=>r.applyCommunityLayout(t,e,a,n,s,y,i,u,o,E)),t,e,a,n,s)}t.apply=e}(p||(p={})),function(t){function e(t,e,a,n,s){return y(r.applySimpleLayout,t,e,a,n,s)}t.apply=e}(f||(f={})),function(t){function e(t,e,a,n,s){return y(r.applyHierarchicalLayout,t,e,a,n,s)}t.apply=e}(b||(b={})),function(t){function e(t,e,a,n,s){return y(r.applyRadialTreeLayout,t,e,a,n,s)}t.apply=e}(A||(A={})),function(t){function e(t,e,a,n,s){return y(r.applySmartTreeLayout,t,e,a,n,s)}t.apply=e}(P||(P={})),function(t){t[t.Undirected=0]="Undirected",t[t.Directed=1]="Directed",t[t.Reversed=2]="Reversed"}(L||(L={})),function(t){t[t.ByCC_Raw=0]="ByCC_Raw",t[t.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",t[t.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(d||(d={}));export{d as CentralityMode,p as LCCommunityLayout,E as LCForceDirectedLayout,b as LCHierarchicalLayout,A as LCRadialTreeLayout,f as LCSimpleLayout,P as LCSmartTreeLayout,o as LinkType,u as NodeFlag,L as RelationshipInterpretation,r as _lclib,C as computeCentrality,i as defaultBudgetTheoreticalSeconds,l as defaultIdealEdgeLengthMultiplier,c as defaultRepulsionRadiusMultiplier,a as isLoaded,n as load};
5
+ import{getAssetUrl as t}from"../../assets.js";let e,r=null;function a(){return!!r}function n(){return e||(e=import("../../chunks/lclayout.js").then((t=>t.l)).then((({default:e})=>e({locateFile:e=>t(`esri/libs/linkchartlayout/${e}`)}))).then((t=>{s(t)})),e)}function s(t){r=t}var u,o;function y(t,e,a,n,s,u){const o=a.length,y=s.length,i=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,c=Uint8Array.BYTES_PER_ELEMENT,E=16,p=E-1+o*(c+2*i)+y*(2*l),f=r._malloc(p);try{const c=f+E-f%E,p=c+o*i,A=p+o*i,b=A+y*l,P=b+y*l,L=()=>[r.HEAPF64.subarray(c>>3,(c>>3)+o),r.HEAPF64.subarray(p>>3,(p>>3)+o),r.HEAPU32.subarray(A>>2,(A>>2)+y),r.HEAPU32.subarray(b>>2,(b>>2)+y),r.HEAPU8.subarray(P,P+o)],[d,C,H,_,g]=L();d.set(a),C.set(n),H.set(s),_.set(u),g.set(e);let F=t(o,P,c,p,y,A,b),R=null;if(F){const t=r.getLayoutLinksTypes(),e=r.getLayoutLinksVerticesEndIndices(),a=r.getLayoutLinksVertices(),n=r.countLayoutLinksVertices();!y||t&&e?n&&!a?F=!1:R={types:new Uint8Array(r.HEAPU8.subarray(t,t+y)),vertexEndIndex:new Uint32Array(r.HEAPU32.subarray(e>>2,(e>>2)+y)),vertices:new Float64Array(r.HEAPF64.subarray(a>>3,(a>>3)+2*n))}:F=!1}const[h,U,m,B,T]=L();return a.set(h),n.set(U),s.set(m),u.set(B),e.set(T),{success:F,links:R}}finally{r._free(f),r.cleanupLayout()}}!function(t){t[t.None=0]="None",t[t.IsMovable=1]="IsMovable",t[t.IsGeographic=2]="IsGeographic",t[t.IsRoot=4]="IsRoot"}(u||(u={})),function(t){t[t.Regular=0]="Regular",t[t.Orthogonal=1]="Orthogonal",t[t.Curved=2]="Curved",t[t.Recursive=3]="Recursive"}(o||(o={}));const i=2,l=1,c=-1;var E,p,f,A,b,P,L,d;function C(t,e,a,n,s,u,o,y,i,l,c,E,p,f,A){const b=e.length,P=Float64Array.BYTES_PER_ELEMENT,L=Uint32Array.BYTES_PER_ELEMENT,d=16,C=d-1+t*(8*P)+b*(3*L),H=r._malloc(C);try{const C=H+d-H%d,_=C+t*P,g=_+t*P,F=g+t*P,R=F+t*P,h=R+t*P,U=h+t*P,m=U+t*P,B=m+t*P,T=B+b*L,v=T+b*L,N=()=>[r.HEAPF64.subarray(C>>3,(C>>3)+t),r.HEAPF64.subarray(_>>3,(_>>3)+t),r.HEAPF64.subarray(g>>3,(g>>3)+t),r.HEAPF64.subarray(F>>3,(F>>3)+t),r.HEAPF64.subarray(R>>3,(R>>3)+t),r.HEAPF64.subarray(h>>3,(h>>3)+t),r.HEAPF64.subarray(U>>3,(U>>3)+t),r.HEAPF64.subarray(m>>3,(m>>3)+t),r.HEAPU32.subarray(B>>2,(B>>2)+b),r.HEAPU32.subarray(T>>2,(T>>2)+b),r.HEAPU32.subarray(v>>2,(v>>2)+b)],[I,M,k,S,w,Y,z,G,x,D,V]=N();I.set(y),M.set(i),k.set(l),S.set(c),w.set(E),Y.set(p),z.set(f),G.set(A),x.set(e),D.set(a),V.set(n);const j=r.computeCentrality(t,b,B,T,v,s,u,o,C,_,g,F,R,h,U,m),[O,$,q,J,K,Q,W,X,Z,tt,et]=N();return y.set(O),i.set($),l.set(q),c.set(J),E.set(K),p.set(Q),f.set(W),A.set(X),e.set(Z),a.set(tt),n.set(et),j}finally{r._free(H)}}!function(t){function e(){return r.getMinIdealEdgeLength()}function a(t,e,a,n,s,u=i,o=l,E=c){return y(((t,e,a,n,s,y,i)=>r.applyForceDirectedLayout(t,e,a,n,s,y,i,u,o,E)),t,e,a,n,s)}t.getMinIdealEdgeLength=e,t.apply=a}(E||(E={})),function(t){function e(t,e,a,n,s,u=i,o=l,E=c){return y(((t,e,a,n,s,y,i)=>r.applyCommunityLayout(t,e,a,n,s,y,i,u,o,E)),t,e,a,n,s)}t.apply=e}(p||(p={})),function(t){function e(t,e,a,n,s){return y(r.applySimpleLayout,t,e,a,n,s)}t.apply=e}(f||(f={})),function(t){function e(t,e,a,n,s){return y(r.applyHierarchicalLayout,t,e,a,n,s)}t.apply=e}(A||(A={})),function(t){function e(t,e,a,n,s){return y(r.applyRadialTreeLayout,t,e,a,n,s)}t.apply=e}(b||(b={})),function(t){function e(t,e,a,n,s){return y(r.applySmartTreeLayout,t,e,a,n,s)}t.apply=e}(P||(P={})),function(t){t[t.Undirected=0]="Undirected",t[t.Directed=1]="Directed",t[t.Reversed=2]="Reversed"}(L||(L={})),function(t){t[t.ByCC_Raw=0]="ByCC_Raw",t[t.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",t[t.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(d||(d={}));export{d as CentralityMode,p as LCCommunityLayout,E as LCForceDirectedLayout,A as LCHierarchicalLayout,b as LCRadialTreeLayout,f as LCSimpleLayout,P as LCSmartTreeLayout,o as LinkType,u as NodeFlag,L as RelationshipInterpretation,r as _lclib,C as computeCentrality,i as defaultBudgetTheoreticalSeconds,l as defaultIdealEdgeLengthMultiplier,c as defaultRepulsionRadiusMultiplier,a as isLoaded,n as load};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.29.0-next.20240222",
3
+ "version": "4.29.1",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import r from"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import"../../symbols.js";import{isSome as a}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{toPt as n}from"../../core/screenUtils.js";import{fetchMessageBundle as i}from"../../intl/messages.js";import s from"../../layers/support/AggregateField.js";import o from"../../layers/support/ExpressionInfo.js";import l from"../../renderers/support/AttributeColorInfo.js";import{OthersCategory as u}from"../../renderers/support/OthersCategory.js";import p from"../heuristics/outline.js";import m from"../heuristics/sizeRange.js";import{createVisualVariables as c}from"./size.js";import{errorCallback as d,createColors as f,createSymbol as h,getSymbolOutlineFromScheme as b,verifyBasicFieldValidity as y,getBasemapInfo as w}from"./support/utils.js";import g from"../statistics/predominantCategories.js";import{getSumOfAttributesExpr as v}from"../statistics/support/utils.js";import{verifyBinningParams as S}from"../support/binningUtils.js";import{getFieldsList as z}from"../support/utils.js";import{LayerType as E,binningCapableLayerTypes as j,createLayerAdapter as C,getLayerTypeLabels as x,getLayerTypes as V}from"../support/adapters/support/layerUtils.js";import{cloneScheme as $,getSchemes as T}from"../symbology/pieChart.js";import{getCIMSymbolColor as I}from"../../symbols/support/cimSymbolUtils.js";import k from"../../symbols/SimpleLineSymbol.js";const O=[E.CSVLayer,E.FeatureLayer,E.GeoJSONLayer,E.OGCFeatureLayer,E.OrientedImageryLayer,E.StreamLayer,E.WFSLayer];async function q(e){if(!(e?.layer&&e.view&&e.attributes?.length))throw new t("pie-chart-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>10)throw new t("pie-chart-renderer:invalid-parameters","PieChart renderer does not support more than 10 attributes");e.forBinning&&S(e,"pie-chart-renderer");const r={...e,layer:e.layer,view:e.view,attributes:e.attributes};r.shape=r.shape||"pie",r.othersCategoryEnabled??=!0,r.includeSizeVariable=e.includeSizeVariable||!1;const a=e.forBinning?j:O,n=C(r.layer,a,e.forBinning);if(!n)throw new t("pie-chart-renderer:invalid-parameters","'layer' must be one of these types: "+x(a).join(", "));r.layer=n;const i=null!=r.signal?{signal:r.signal}:null;await Promise.all([e.view.when(),n.load(i)]);const s=n.geometryType,o="polygon"===s,l="point"===s||"multipoint"===s||o;if(r.outlineOptimizationEnabled=!!o&&r.outlineOptimizationEnabled,r.sizeOptimizationEnabled=!!l&&r.sizeOptimizationEnabled,!l)throw new t("pie-chart-renderer:not-supported","PieChart renderer is only supported for point and polygon layers");const u=[],p=r.attributes;for(const t of p){const e=await z({field:t.field,valueExpression:t.valueExpression});u.push(...e)}const m=y(n,u.filter(Boolean),"pie-chart-renderer:invalid-parameters");if(m)throw m;return r}async function L(e){let r=e.pieChartScheme,a=null,t=null;const n=await w(e.basemap,e.view);if(a=null!=n.basemapId?n.basemapId:null,t=null!=n.basemapTheme?n.basemapTheme:null,r)return{scheme:$(r),basemapId:a,basemapTheme:t};const i=T({numColors:e.attributes.length,geometryType:e.layer.geometryType,basemapTheme:t});return i&&(r=i.primaryScheme,a=i.basemapId,t=i.basemapTheme),{scheme:r,basemapId:a,basemapTheme:t}}async function B(e,r){const{valueExpression:a,sqlExpression:t,sqlWhere:n}=v(e.attributes),s=await i("esri/smartMapping/t9n/smartMapping");return c({layer:e.layer,basemap:e.basemap,valueExpression:a,sqlExpression:t,sqlWhere:n,sizeScheme:r,sizeOptimizationEnabled:e.sizeOptimizationEnabled,legendOptions:{title:s.sumOfCategories},view:e.view,signal:e.signal})}async function R(e){const[s,o]=await Promise.all([q(e),i("esri/smartMapping/t9n/smartMapping")]),c=await L(s),y=c?.scheme;if(!y)throw new t("pie-chart-renderer:insufficient-info","Unable to find pie-chart scheme");const w=s.layer,{includeSizeVariable:v,sizeOptimizationEnabled:S,outlineOptimizationEnabled:z,view:E,signal:j}=s,C=y.sizeScheme,x=s.attributes,V=x.map((e=>e.field)).filter(a),[T,I,O,R]=await Promise.all([V.length>1?g({layer:w,fields:V,view:E,signal:j}):null,v?B(s,C):null,!v&&S?m({layer:w,view:E,signal:j}).catch(d):null,z?p({layer:w,view:E,signal:j}).catch(d):null]),P=T?.predominantCategoryInfos?{uniqueValueInfos:T.predominantCategoryInfos}:{uniqueValueInfos:V.map((e=>({value:e,count:0})))},U=f(y.colors,x.length),F=x.map(((e,r)=>new l({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:U[r]}))),M=w.geometryType,N=null!=C&&"background"in C&&C.background,_=new r({attributes:F,othersCategory:new u({label:o.other,color:s.othersCategoryEnabled?y.colorForOthersCategory:null,threshold:.04}),holePercentage:"donut"===s.shape?.45:0,backgroundFillSymbol:N?h(M,{type:"2d",color:N.color,outline:b(N,M,R?.opacity)}):null,size:n(y.size),outline:new k(b(y,"point",R?.opacity)),legendOptions:s.legendOptions});if(I&&(S||I.visualVariables.forEach((e=>{"number"==typeof e.minSize&&"number"==typeof e.maxSize&&(e.minSize*=2.5,e.maxSize*=1.8)})),S&&"point"===M&&I.visualVariables.forEach((e=>{e?.minSize&&"object"==typeof e.minSize&&e.minSize?.stops?.forEach((e=>{e.size*=1.8}))})),_.authoringInfo=I.authoringInfo.clone(),_.visualVariables=I.visualVariables?.map((e=>e.clone()))),R?.visualVariables?.length){const e=R.visualVariables.map((e=>e.clone()));_.visualVariables?_.visualVariables.push(...e):_.visualVariables=e}return O?.minSize&&("point"===M&&O.minSize.stops?.forEach((e=>{e.size*=2.5})),"polygon"===M&&O.minSize.stops?.forEach((e=>{e.size*=1.8})),_.visualVariables?_.visualVariables.push(O.minSize):_.visualVariables=[O.minSize]),{renderer:_,pieChartScheme:$(y),size:I,basemapId:c.basemapId,basemapTheme:c.basemapTheme,statistics:P}}const P=new Set(["unique-value","class-breaks"]),U=new e("#aaaaaa"),F=new e("#5c5c5c"),M=[new e("#e60049"),new e("#0bb4ff"),new e("#50e991"),new e("#e6d800"),new e("#9b19f5"),new e("#ffa300"),new e("#dc0ab4"),new e("#b3d4ff"),new e("#00bfa0"),new e("#f0cccc")];async function N(e){if(!e||!e.layer)throw new t("pie-chart-cluster-renderer:missing-parameters","'layer' parameter is required");const r={...e};r.shape=r.shape||"pie",r.defaultSymbolEnabled??=!0;const a=e.layer;if(!V(O).includes(a.type))throw new t("pie-chart-cluster-renderer:invalid-parameters","'layer' must be one of these types: "+x(O).join(", "));const n=null!=r.signal?{signal:r.signal}:null;await a.load(n);if(!("point"===a.geometryType))throw new t("pie-chart-cluster-renderer:invalid-parameters","Cluster renderers are only supported for point layers");const{renderer:i}=a;if(!i)throw new t("pie-chart-cluster-renderer:invalid-parameters","input layer does not have a renderer.");if(!P.has(i.type))throw new t("pie-chart-cluster-renderer:invalid-parameters",`Cannot create a pie chart renderer for clusters based on a ${i.type} renderer.`);if("valueExpression"in i&&i.valueExpression)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer whose renderer contains a valueExpression.");if("unique-value"===i.type){if(i.field2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a UniqueValueRenderer using more than one field.");if(null!=i.uniqueValueInfos&&i.uniqueValueInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer cannot be created from a UniqueValueRenderer with more than 10 unique value infos.")}if("class-breaks"===i.type){if(i.classBreakInfos.length<2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer renderer with a continuous color or size gradient.");if(i.classBreakInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with more than 10 class break infos.");if("class-breaks-size"===i?.authoringInfo?.type)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with breaks varied by size instead of color.")}return r}async function _(e){const a=await N(e),{layer:t,shape:n,defaultSymbolEnabled:s,legendOptions:o}=a,{renderer:u}=t,p=(await i("esri/smartMapping/t9n/smartMapping")).other;let m=[];"unique-value"===u?.type&&(m=A({renderer:u,defaultSymbolEnabled:s,defaultLabelBackup:p})),"class-breaks"===u?.type&&(m=D({renderer:u,defaultSymbolEnabled:s,defaultLabelBackup:p}));const c=[],d=[];for(const r of m){const{field:e,color:a}=r;c.push(e),d.push(new l({color:a,field:e.name,label:e.alias}))}return{fields:c,renderer:new r({attributes:d,legendOptions:o,holePercentage:"donut"===n?.45:0,outline:null,size:18,othersCategory:null})}}function A(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,defaultSymbol:i,defaultLabel:l}=r,u=r.uniqueValueInfos??[],p=i&&a,m=p?9:10,c=f(M,m),d=u.slice(0,m).map(((e,r)=>{const a=e.label,t=c[r];return{field:new s({name:W(e.value?.toString()),alias:a,onStatisticExpression:new o({title:`Field definition - ${a}`,expression:H(n,e),returnType:"number"}),statisticType:"sum"}),color:G(e.symbol,t)}}))??[];if(p){const e="cluster_default",r=l||t;d.push({field:new s({name:W(e),alias:r,onStatisticExpression:new o({title:`Field definition - ${r}`,expression:J(n,u),returnType:"number"}),statisticType:"sum"}),color:G(i,F)})}return d}function D(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,classBreakInfos:i,defaultSymbol:l,defaultLabel:u}=r,p=l&&a,m=p?9:10,c=f(M,m),d=i.slice(0,m).map(((e,r)=>{const a=e.label||`${e.minValue} - ${e.maxValue}`,t=c[r];return{field:new s({name:W(a),alias:a,onStatisticExpression:new o({title:`Field definition - ${a}`,expression:Z(n,e),returnType:"number"}),statisticType:"sum"}),color:G(e.symbol,t)}}));if(p){const e="cluster_default",r=u||t;d.push({field:new s({name:W(e),alias:r,onStatisticExpression:new o({title:`Field definition - ${r}`,expression:K(n,i),returnType:"number"}),statisticType:"sum"}),color:G(l,F)})}return d}function W(e){return"SUM_"+(e+"").replaceAll(/[^a-zA-Z0-9_]/g,"_")}function G(e,r){if("simple-marker"===e?.type&&e.color)return e.color.clone();if("cim"===e?.type){const r=I(e);if(r)return r.clone()}return r?r.clone():U.clone()}function H(e,r){return`Number(Text($feature["${e}"]) == "${r.value+""}")`}function J(e,r){return`Number(!(${r.map((r=>`(Text($feature["${e}"]) == "${r.value+""}")`)).join(" || ")}))`}function Z(e,r){return`Number($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`}function K(e,r){return`Number(!(${r.map((r=>`($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`)).join(" || ")}))`}export{R as createRenderer,_ as createRendererForClustering};
5
+ import e from"../../Color.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import r from"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import"../../symbols.js";import{isSome as a}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{toPt as n}from"../../core/screenUtils.js";import{fetchMessageBundle as i}from"../../intl/messages.js";import s from"../../layers/support/AggregateField.js";import o from"../../layers/support/ExpressionInfo.js";import l from"../../renderers/support/AttributeColorInfo.js";import{OthersCategory as u}from"../../renderers/support/OthersCategory.js";import p from"../heuristics/outline.js";import m from"../heuristics/sizeRange.js";import{createVisualVariables as c}from"./size.js";import{errorCallback as d,createColors as f,createSymbol as h,getSymbolOutlineFromScheme as b,verifyBasicFieldValidity as y,getBasemapInfo as w}from"./support/utils.js";import g from"../statistics/predominantCategories.js";import{getSumOfAttributesExpr as v}from"../statistics/support/utils.js";import{verifyBinningParams as S}from"../support/binningUtils.js";import{getFieldsList as z}from"../support/utils.js";import{LayerType as E,binningCapableLayerTypes as j,createLayerAdapter as C,getLayerTypeLabels as x,getLayerTypes as V}from"../support/adapters/support/layerUtils.js";import{cloneScheme as $,getSchemes as T}from"../symbology/pieChart.js";import{getCIMSymbolColor as I}from"../../symbols/support/cimSymbolUtils.js";import k from"../../symbols/SimpleLineSymbol.js";const O=[E.CSVLayer,E.FeatureLayer,E.GeoJSONLayer,E.OGCFeatureLayer,E.OrientedImageryLayer,E.StreamLayer,E.WFSLayer];async function q(e){if(!(e?.layer&&e.view&&e.attributes?.length))throw new t("pie-chart-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>10)throw new t("pie-chart-renderer:invalid-parameters","PieChart renderer does not support more than 10 attributes");e.forBinning&&S(e,"pie-chart-renderer");const r={...e,layer:e.layer,view:e.view,attributes:e.attributes};r.shape=r.shape||"pie",r.othersCategoryEnabled??=!0,r.includeSizeVariable=e.includeSizeVariable||!1;const a=e.forBinning?j:O,n=C(r.layer,a,e.forBinning);if(!n)throw new t("pie-chart-renderer:invalid-parameters","'layer' must be one of these types: "+x(a).join(", "));r.layer=n;const i=null!=r.signal?{signal:r.signal}:null;await Promise.all([e.view.when(),n.load(i)]);const s=n.geometryType,o="polygon"===s,l="point"===s||"multipoint"===s||o;if(r.outlineOptimizationEnabled=!!o&&r.outlineOptimizationEnabled,r.sizeOptimizationEnabled=!!l&&r.sizeOptimizationEnabled,!l)throw new t("pie-chart-renderer:not-supported","PieChart renderer is only supported for point and polygon layers");const u=[],p=r.attributes;for(const t of p){const e=await z({field:t.field,valueExpression:t.valueExpression});u.push(...e)}const m=y(n,u.filter(Boolean),"pie-chart-renderer:invalid-parameters");if(m)throw m;return r}async function L(e){let r=e.pieChartScheme,a=null,t=null;const n=await w(e.basemap,e.view);if(a=null!=n.basemapId?n.basemapId:null,t=null!=n.basemapTheme?n.basemapTheme:null,r)return{scheme:$(r),basemapId:a,basemapTheme:t};const i=T({numColors:e.attributes.length,geometryType:e.layer.geometryType,basemapTheme:t});return i&&(r=i.primaryScheme,a=i.basemapId,t=i.basemapTheme),{scheme:r,basemapId:a,basemapTheme:t}}async function B(e,r){const{valueExpression:a,sqlExpression:t,sqlWhere:n}=v(e.attributes),s=await i("esri/smartMapping/t9n/smartMapping");return c({layer:e.layer,basemap:e.basemap,valueExpression:a,sqlExpression:t,sqlWhere:n,sizeScheme:r,sizeOptimizationEnabled:e.sizeOptimizationEnabled,legendOptions:{title:s.sumOfCategories},view:e.view,signal:e.signal})}async function R(e){const[s,o]=await Promise.all([q(e),i("esri/smartMapping/t9n/smartMapping")]),c=await L(s),y=c?.scheme;if(!y)throw new t("pie-chart-renderer:insufficient-info","Unable to find pie-chart scheme");const w=s.layer,{includeSizeVariable:v,sizeOptimizationEnabled:S,outlineOptimizationEnabled:z,view:E,signal:j}=s,C=y.sizeScheme,x=s.attributes,V=x.map((e=>e.field)).filter(a),[T,I,O,R]=await Promise.all([V.length>1?g({layer:w,fields:V,view:E,signal:j}):null,v?B(s,C):null,!v&&S?m({layer:w,view:E,signal:j}).catch(d):null,z?p({layer:w,view:E,signal:j}).catch(d):null]),P=T?.predominantCategoryInfos?{uniqueValueInfos:T.predominantCategoryInfos}:{uniqueValueInfos:V.map((e=>({value:e,count:0})))},U=f(y.colors,x.length),F=x.map(((e,r)=>new l({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:U[r]}))),M=w.geometryType,N=null!=C&&"background"in C&&C.background,_=new r({attributes:F,othersCategory:new u({label:o.other,color:s.othersCategoryEnabled?y.colorForOthersCategory:null,threshold:.04}),holePercentage:"donut"===s.shape?.45:0,backgroundFillSymbol:N?h(M,{type:"2d",color:N.color,outline:b(N,M,R?.opacity)}):null,size:n(y.size),outline:new k(b(y,"point",R?.opacity)),legendOptions:s.legendOptions});if(I&&(S||I.visualVariables.forEach((e=>{"number"==typeof e.minSize&&"number"==typeof e.maxSize&&(e.minSize*=2.5,e.maxSize*=1.8)})),S&&"point"===M&&I.visualVariables.forEach((e=>{e?.minSize&&"object"==typeof e.minSize&&e.minSize?.stops?.forEach((e=>{e.size*=1.8}))})),_.authoringInfo=I.authoringInfo.clone(),_.visualVariables=I.visualVariables?.map((e=>e.clone()))),R?.visualVariables?.length){const e=R.visualVariables.map((e=>e.clone()));_.visualVariables?_.visualVariables.push(...e):_.visualVariables=e}return O?.minSize&&("point"===M&&O.minSize.stops?.forEach((e=>{e.size*=2.5})),"polygon"===M&&O.minSize.stops?.forEach((e=>{e.size*=1.8})),_.visualVariables?_.visualVariables.push(O.minSize):_.visualVariables=[O.minSize]),{renderer:_,pieChartScheme:$(y),size:I,basemapId:c.basemapId,basemapTheme:c.basemapTheme,statistics:P}}const P=new Set(["unique-value","class-breaks"]),U=new e("#aaaaaa"),F=new e("#5c5c5c"),M=[new e("#e60049"),new e("#0bb4ff"),new e("#50e991"),new e("#e6d800"),new e("#9b19f5"),new e("#ffa300"),new e("#dc0ab4"),new e("#b3d4ff"),new e("#00bfa0"),new e("#f0cccc")];async function N(e){if(!e||!e.layer)throw new t("pie-chart-cluster-renderer:missing-parameters","'layer' parameter is required");const r={...e};r.shape=r.shape||"pie",r.defaultSymbolEnabled??=!0;const a=e.layer;if(!V(O).includes(a.type))throw new t("pie-chart-cluster-renderer:invalid-parameters","'layer' must be one of these types: "+x(O).join(", "));const n=null!=r.signal?{signal:r.signal}:null;await a.load(n);if(!("point"===a.geometryType))throw new t("pie-chart-cluster-renderer:invalid-parameters","Cluster renderers are only supported for point layers");const{renderer:i}=a;if(!i)throw new t("pie-chart-cluster-renderer:invalid-parameters","input layer does not have a renderer.");if(!P.has(i.type))throw new t("pie-chart-cluster-renderer:invalid-parameters",`Cannot create a pie chart renderer for clusters based on a ${i.type} renderer.`);if("valueExpression"in i&&i.valueExpression)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer whose renderer contains a valueExpression.");if("unique-value"===i.type){if(i.field2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a UniqueValueRenderer using more than one field.");if(null!=i.uniqueValueInfos&&i.uniqueValueInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer cannot be created from a UniqueValueRenderer with more than 10 unique value infos.")}if("class-breaks"===i.type){if(i.classBreakInfos.length<2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer renderer with a continuous color or size gradient.");if(i.classBreakInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with more than 10 class break infos.");if("class-breaks-size"===i?.authoringInfo?.type)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with breaks varied by size instead of color.")}return r}async function _(e){const a=await N(e),{layer:t,shape:n,defaultSymbolEnabled:s,legendOptions:o}=a,{renderer:u}=t,p=(await i("esri/smartMapping/t9n/smartMapping")).other;let m=[];"unique-value"===u?.type&&(m=A({renderer:u,defaultSymbolEnabled:s,defaultLabelBackup:p})),"class-breaks"===u?.type&&(m=D({renderer:u,defaultSymbolEnabled:s,defaultLabelBackup:p}));const c=[],d=[];for(const r of m){const{field:e,color:a}=r;c.push(e),d.push(new l({color:a,field:e.name,label:e.alias}))}return{fields:c,renderer:new r({attributes:d,legendOptions:o,holePercentage:"donut"===n?.45:0,outline:null,size:9,othersCategory:null})}}function A(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,defaultSymbol:i,defaultLabel:l}=r,u=r.uniqueValueInfos??[],p=i&&a,m=p?9:10,c=f(M,m),d=u.slice(0,m).map(((e,r)=>{const a=e.label,t=c[r];return{field:new s({name:W(e.value?.toString()),alias:a,onStatisticExpression:new o({title:`Field definition - ${a}`,expression:H(n,e),returnType:"number"}),statisticType:"sum"}),color:G(e.symbol,t)}}))??[];if(p){const e="cluster_default",r=l||t;d.push({field:new s({name:W(e),alias:r,onStatisticExpression:new o({title:`Field definition - ${r}`,expression:J(n,u),returnType:"number"}),statisticType:"sum"}),color:G(i,F)})}return d}function D(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,classBreakInfos:i,defaultSymbol:l,defaultLabel:u}=r,p=l&&a,m=p?9:10,c=f(M,m),d=i.slice(0,m).map(((e,r)=>{const a=e.label||`${e.minValue} - ${e.maxValue}`,t=c[r];return{field:new s({name:W(a),alias:a,onStatisticExpression:new o({title:`Field definition - ${a}`,expression:Z(n,e),returnType:"number"}),statisticType:"sum"}),color:G(e.symbol,t)}}));if(p){const e="cluster_default",r=u||t;d.push({field:new s({name:W(e),alias:r,onStatisticExpression:new o({title:`Field definition - ${r}`,expression:K(n,i),returnType:"number"}),statisticType:"sum"}),color:G(l,F)})}return d}function W(e){return"SUM_"+(e+"").replaceAll(/[^a-zA-Z0-9_]/g,"_")}function G(e,r){if("simple-marker"===e?.type&&e.color)return e.color.clone();if("cim"===e?.type){const r=I(e);if(r)return r.clone()}return r?r.clone():U.clone()}function H(e,r){return`Number(Text($feature["${e}"]) == "${r.value+""}")`}function J(e,r){return`Number(!(${r.map((r=>`(Text($feature["${e}"]) == "${r.value+""}")`)).join(" || ")}))`}function Z(e,r){return`Number($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`}function K(e,r){return`Number(!(${r.map((r=>`($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`)).join(" || ")}))`}export{R as createRenderer,_ as createRendererForClustering};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const e="20240222",f="6ea46ade432ff82ef8f3ccf222a7e43d5d572e13";export{e as buildDate,f as commitHash};
5
+ const c="20240227",e="02dd198ae451a1dc727b356e28e50c23b2557c05";export{c as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as r}from"../../core/fontUtils.js";import{clone as t}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{CIMSymbolHelper as l}from"./CIMSymbolHelper.js";import{defaultCIMValues as n}from"./defaultCIMValues.js";import{Alignment as p}from"./enums.js";import{OverrideHelper as c}from"./OverrideHelper.js";import{getExtent as m,getSDFMetrics as y}from"./SDFHelper.js";import{colorToArray as f,normalizeAlpha as h,getSize as d,isCIMMarkerStrokePlacement as u,getTintColor as v,getValue as O,getDefaultCIMValue as _,getEnum as g,getFillColor as S,getStrokeColor as k,getStrokeWidth as M,fromCIMFontDecoration as P,fromCIMFontStyle as b,fromCIMHorizontalAlignment as C,fromCIMVerticalAlignment as z,isValidCIMValue as x,uncapitalize as L}from"./utils.js";import{CIMEffectHelper as E}from"./effects/CIMEffectHelper.js";import{randomInsidePolygonTextureSize as I}from"../../views/2d/engine/webgl/definitions.js";const V=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function N(e){const r=e.markerPlacement;return r&&r.angleToLine?p.MAP:p.SCREEN}class w{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(r,t,i){if(this._cimLayers=i??[],!r)return this._cimLayers;if(this._reset(),r.primitiveOverrides){this._primitiveOverrides=r.primitiveOverrides;for(const r of this._primitiveOverrides){const t=r.valueExpressionInfo;if(t)this._setPoMap(r.primitiveName,r.propertyName,t);else if(null!=r.value){let t=r.value;r.propertyName.includes("Color")&&(e(t)&&(t=f(t)),t=h(t)),this._setPoMap(r.primitiveName,r.propertyName,t)}}}return this._analyzeSymbol(r.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,r){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,r)}}_analyzeMultiLayerSymbol(e,r){const t=e?.symbolLayers;if(!t)return;const i=e.effects;let o=p.SCREEN;const a=d(e)??0;"CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=p.MAP);const s="CIMPolygonSymbol"===e.type;let l=t.length;for(;l--;){const n=t[l];if(!n||!1===n.enable)continue;let p;i?.length&&(p=[...i]);const m=n.effects;m?.length&&(i?p.push(...m):p=[...m]);let y=null;if(p){y=[];for(const e of p){const r=c.findEffectOverrides(e,this._primitiveOverrides);r&&y.push(r)}}const f=[];switch(c.findApplicableOverrides(n,this._primitiveOverrides,f),n.type){case"CIMSolidFill":this._analyzeSolidFill(n,y);break;case"CIMPictureFill":this._analyzePictureFill(n,y);break;case"CIMHatchFill":this._analyzeHatchFill(n,y);break;case"CIMGradientFill":this._analyzeGradientFill(n,y);break;case"CIMSolidStroke":this._analyzeSolidStroke(n,y,s,a);break;case"CIMPictureStroke":this._analyzePictureStroke(n,y,s,a);break;case"CIMGradientStroke":this._analyzeGradientStroke(n,y,s,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=N(n));const t=[],i=n.primitiveName;i&&t.push(i);const l=s&&u(n.markerPlacement);this._analyzeMarker(n,y,null,t,o,a,r,[],!1,l);break}default:V().error("Cannot analyze CIM layer",n.type)}}}_analyzeSolidFill(e,r){const{primitiveName:t,type:i}=e,o=h(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(i,t,"Color",o),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:r,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,r){const{primitiveName:t,type:i}=e,o=v(e),a=O(e.height,n.CIMPictureFill.height);let s=O(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const r=e.width;let t=1;const i=this._resourceManager.getResource(e.url);null!=i&&(t=i.width/i.height),s/=t*(a/r)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(t,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:r,color:this._getValueOrOverrideExpression(i,t,"TintColor",o),height:this._getValueOrOverrideExpression(i,t,"Height",a),scaleX:this._getValueOrOverrideExpression(i,t,"ScaleX",s),angle:this._getValueOrOverrideExpression(i,t,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,t,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,t,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,r){const{primitiveName:t,type:i}=e,o=this._analyzeMaterialOverrides(t,["Rotation","OffsetX","OffsetY"]),a=this._normalizePrimitiveOverrideProps(o);let s=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const n of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==n.type)continue;const e=n.primitiveName??t;l||!e||n.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(s=h(n.color),s=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(i,e,"Color",s),l=!0);const r=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(r){let t=null,o=null;"number"==typeof r?t=r:o=r.valueExpressionInfo;let s=a.find((e=>"strokeWidth"===e.propertyName));s?s.propertyName="width":(s={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:o,value:t,defaultValue:_(i,"width")},a.push(s))}}const p={type:"sprite-rasterization-param",resource:e,overrides:a};this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:r,color:s,height:this._getValueOrOverrideExpression(i,t,"Separation",O(e.separation,n.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,t,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,t,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,t,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,r){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:r,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,r,t,i){const{primitiveName:o,type:a}=e,s=h(e.color),l=O(e.width,n.CIMSolidStroke.width),p=g(e.capStyle,n.CIMSolidStroke.capstyle),c=g(e.joinStyle,n.CIMSolidStroke.joinstyle),m=e.miterLimit;let y,f,d=[];if(this._analyzePrimitiveOverrides(o,r,null,null)&&(d=this._getPrimitiveMaterialOverrides(o,a)),r&&r instanceof Array&&r.length>0){const e=r[r.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&null===e.offsetAlongLine&&(y=e.dashTemplate,f=e.scaleDash,(r=[...r]).pop())}const u=void 0!==y?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:y,capStyle:p},overrides:d}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:u,isOutline:t,colorLocked:!!e.colorLocked,effects:r,color:this._getValueOrOverrideExpression(a,o,"Color",s),width:this._getValueOrOverrideExpression(a,o,"Width",l),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",p),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",c),miterLimit:m&&this._getValueOrOverrideExpression(a,o,"MiterLimit",m),referenceWidth:i,zOrder:R(e.name),dashTemplate:y,scaleDash:f,sampleAlphaOnly:!0})}_analyzePictureStroke(e,r,t,i){const{primitiveName:o,type:a}=e,s=v(e),l=O(e.width,n.CIMPictureStroke.width),p=g(e.capStyle,n.CIMPictureStroke.capstyle),c=g(e.joinStyle,n.CIMPictureStroke.joinstyle),m=e.miterLimit,y={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(o,a)};this._cimLayers.push({type:"line",spriteRasterizationParam:y,isOutline:t,colorLocked:!!e.colorLocked,effects:r,color:this._getValueOrOverrideExpression(a,o,"TintColor",s),width:this._getValueOrOverrideExpression(a,o,"Width",l),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",p),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",c),miterLimit:m&&this._getValueOrOverrideExpression(a,o,"MiterLimit",m),referenceWidth:i,zOrder:R(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,r,t,i){const{primitiveName:o,type:a}=e,s=O(e.width,n.CIMSolidStroke.width),l=g(e.capStyle,n.CIMGradientStroke.capstyle),p=g(e.joinStyle,n.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:t,colorLocked:!!e.colorLocked,effects:r,color:[128,128,128,1],width:this._getValueOrOverrideExpression(a,o,"Width",s),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",l),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(a,o,"MiterLimit",c),referenceWidth:i,zOrder:R(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,r,t,i,o,a,s,l,p=!1,c=!1){if(p||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,r,p))return;const m=O(e.size,n.CIMVectorMarker.size),y=O(e.rotation),f=O(e.offsetX),h=O(e.offsetY),{primitiveName:d,type:u}=e,v=this._getValueOrOverrideExpression(u,d,"Size",m),_=this._getValueOrOverrideExpression(u,d,"Rotation",y),g=this._getValueOrOverrideExpression(u,d,"OffsetX",f),S=this._getValueOrOverrideExpression(u,d,"OffsetY",h);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,r,t,i,o,a,v,_,g,S,l,p,c);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,r,t,i,o,a,v,_,g,S,l,s,p,c)}}_analyzeMarkerInsidePolygon(e,r,t){const{markerPlacement:i,type:o}=e;if(!i||"CIMMarkerPlacementInsidePolygon"!==i.type)return!1;if("CIMVectorMarker"===o||"CIMPictureMarker"===o){const t=e.primitiveName;if(t&&this._analyzePrimitiveOverrides([t],r,null,null))return!1;const a=i.primitiveName;if(a&&this._analyzePrimitiveOverrides([a],r,null,null))return!1;if("CIMVectorMarker"===o){const{markerGraphics:r}=e;if(r)for(const e of r){const{symbol:r}=e;if("CIMPolygonSymbol"===r?.type&&r.symbolLayers){const{symbolLayers:e}=r;for(const r of e)if("CIMSolidStroke"===r.type)return!1}}}else{const{animatedSymbolProperties:r}=e;if(r)return!1}}const s=Math.abs(i.stepX),l=Math.abs(i.stepY);if(0===s||0===l)return!0;let n,p;if("Random"===i.gridType){const e=a(I),r=Math.max(Math.floor(e/s),1);n=l*Math.max(Math.floor(e/l),1);p=r*s/n}else i.shiftOddRows?(n=2*l,p=s/l*.5):(n=l,p=s/l);const c=v(e),m="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:m,colorLocked:t,effects:r,color:c,height:n,scaleX:p,angle:i.gridAngle,offsetX:O(i.offsetX),offsetY:O(i.offsetY),applyRandomOffset:"Random"===i.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,r,i,o,a,l,n,p,c,m,y,f,h){const{primitiveName:d,type:u}=e;let _=O(e.scaleX,1);const g=v(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const S=this._createAnimatedSymbolPropertiesOverrideExpression(e.animatedSymbolProperties),k=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const r=e.width;let t=1;const i=this._resourceManager.getResource(e.url);null!=i&&(t=i.width/i.height);_/=t*(O(e.size)/r)}const M=[...o];let P;e.primitiveName&&M.push(e.primitiveName),e.animatedSymbolProperties||S?P={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(P=t(e),P.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:P,overrides:this._getMaterialOverrides(M,u)};S&&b.overrides.push(...S.overrides),this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:f,effects:r,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(u,d,"ScaleX",_),rotation:p,offsetX:c,offsetY:m,transform:{type:"cim-marker-transform-param",params:y},color:this._getValueOrOverrideExpression(u,d,"TintColor",g),anchorPoint:{x:k.x,y:k.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:h,markerPlacement:i,animatedSymbolProperties:S})}_analyzeVectorMarker(e,r,t,i,o,a,s,l,n,p,c,m,y,f){const h=e.markerGraphics;if(!h)return;const d=e.frame;let u=0;if(u=d?d.ymax-d.ymin:a,u){const r={offsetX:n,offsetY:p,rotation:l,size:s,frameHeight:u,rotateClockWise:!!e.rotateClockwise};c=[...c,r]}t||(t=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const v of h)if(v){const s=v.symbol;if(!s)continue;const l=v.primitiveName;let n;if(l&&i.push(l),("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&d){let r=0,t=0;const i=v.geometry;"x"in i&&"y"in i&&(r+=i.x-.5*(d.xmin+d.xmax),t+=i.y-.5*(d.ymin+d.ymax));const o=e.anchorPoint;o&&("Absolute"===e.anchorPointUnits?(r-=o.x,t-=o.y):d&&(r-=(d.xmax-d.xmin)*o.x,t-=(d.ymax-d.ymin)*o.y));const a={offsetX:r,offsetY:t,rotation:0,size:0,frameHeight:0,rotateClockWise:!1};n=[...c,a]}switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":m||X(s)?this._analyzeMultiLayerGraphicNonSDF(e,r,t,null,v,i,o,a,n??c,u,y,f):this._analyzeMultiLayerGraphic(e,r,t,null,v,i,o,a,n??c,u,y,f);break;case"CIMTextSymbol":this._analyzeTextGraphic(r,t,v,i,o,a,n??c,y)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,r,t,i,o,a,s,l,n,p,c,f){const d=o.symbol,u=d.symbolLayers;if(!u)return;let v=u.length;if(G(u))return void this._analyzeCompositeMarkerGraphic(e,r,t,i,o,u,s,l,n,p,c,f);const O=this._resourceManager.geometryEngine,_=E.applyEffects(d.effects,o.geometry,O);if(_)for(;v--;){const d=u[v];if(!d||!1===d.enable)continue;const g=d.primitiveName;switch(g&&a.push(g),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const a=E.applyEffects(d.effects,_,O),u=m(a);if(!u)continue;const v="Relative"!==e.anchorPointUnits,[P,b,C,z]=y(u,e.frame,e.size,e.anchorPoint,v),x="CIMSolidFill"===d.type,L={type:"sdf",geom:a,asFill:x},{path:I}=d,V=x?h(S(d)):null==I?h(k(d)):[0,0,0,0],N=x?[0,0,0,0]:h(k(d)),w=M(d)??0;if(!x&&!w)break;const R=o.primitiveName;let A=null;x&&!d.colorLocked&&(A=this._maybeGetValueOrOverrideExpression(R,"FillColor"));let G=null;x||d.colorLocked||(G=this._maybeGetValueOrOverrideExpression(R,"StrokeColor"));const X=A??this._getValueOrOverrideExpression(d.type,g,"Color",V),F=G??this._getValueOrOverrideExpression(d.type,g,"Color",N),T=this._maybeGetValueOrOverrideExpression(R,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,g,"Width",w),Y=I?{type:"sprite-rasterization-param",resource:{type:"path",path:I,asFill:x},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:Y,colorLocked:!!d.colorLocked||!!c,effects:r,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:b,y:C},isAbsoluteAnchorPoint:v,size:p,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:n},frameHeight:p,widthRatio:z,rotateClockwise:!1,referenceSize:l,sizeRatio:P,color:X,outlineColor:F,outlineWidth:T,isOutline:f,markerPlacement:t,animatedSymbolProperties:i});break}case"CIMPictureMarker":case"CIMVectorMarker":d.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,r,t,i,o,a,s,l,n,p,!!d.colorLocked||!!c,f):this._analyzeMarker(d,r,t,a,s,l,!1,n,c,f);break;default:this._analyzeMultiLayerGraphicNonSDF(e,r,t,i,o,a,s,l,n,p,!!d.colorLocked||!!c,f)}g&&a.pop()}}_analyzeTextGraphic(e,t,i,o,a,s,l,p){const m=[];c.findApplicableOverrides(i,this._primitiveOverrides,m);const y=i.geometry;if(!("x"in y)||!("y"in y))return;const f=i.symbol,d=P(f),u=b(f.fontStyleName),v=r(f.fontFamilyName);f.font={family:v,decoration:d,...u};const _=O(f.height,n.CIMTextSymbol.height),g=O(f.angle),x=O(f.offsetX),L=O(f.offsetY),E=h(S(f));let I=h(k(f)),V=M(f)??0;V||(I=h(S(f.haloSymbol)),V=O(f.haloSize));let N=!1;if(f.symbol?.symbolLayers)for(const r of f.symbol.symbolLayers){null!=h(S(r))&&(N=!!r.colorLocked)}const w=i.primitiveName;let R=null;N||(R=this._maybeGetValueOrOverrideExpression(w,"FillColor"));const A=this._maybeGetValueOrOverrideExpression(w,"TextSize"),G=this._maybeGetValueOrOverrideExpression(w,"TextAngle"),X=this._maybeGetValueOrOverrideExpression(w,"TextOffsetX"),F=this._maybeGetValueOrOverrideExpression(w,"TextOffsetY");let T=null,Y=null,j=0;if(f.callout&&"CIMBackgroundCallout"===f.callout.type){const e=f.callout;if(e.backgroundSymbol){const r=e.backgroundSymbol.symbolLayers;if(r)for(const e of r)"CIMSolidFill"===e.type?T=h(e.color):"CIMSolidStroke"===e.type&&(Y=h(e.color),j=O(e.width,n.CIMSolidStroke.width))}}const W=this._getValueOrOverrideExpression(f.type,i.primitiveName,"TextString",i.textString??"");if(null==W)return;const{fontStyleName:D}=f,H=v+(D?"-"+D.toLowerCase():"-regular"),U=this._getMaterialOverrides(o,f.type);U.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,f.type));const J={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:f.font,symbol:f,primitiveName:i.primitiveName},overrides:U};this._cimLayers.push({type:"text",lineWidth:null,textRasterizationParam:J,colorLocked:!!p||!!N,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:H,decoration:d,weight:u.weight,style:u.style,size:A??_,angle:G??g,offsetX:X??x,offsetY:F??L,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:C(f.horizontalAlignment),verticalAlignment:z(f.verticalAlignment),text:W,color:R??this._getValueOrOverrideExpression(f.type,i.primitiveName,"Color",E),outlineColor:I,outlineSize:V,backgroundColor:T,borderLineColor:Y,borderLineWidth:j,referenceSize:s,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,r,t,i,a,s,n,p,c,m,y,f){const h=this._buildSimpleMarker(e,a),d=e.primitiveName,u=this._analyzeMaterialOverrides(d,["Rotation","OffsetX","OffsetY"]),v=this._normalizePrimitiveOverrideProps(u),[O,_,g]=l.getTextureAnchor(h,this._resourceManager),S=this._getMaterialOverrides(s,e.type);S.push(...v);const k={type:"sprite-rasterization-param",resource:{...h,avoidSDFRasterization:!0},overrides:S};this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:y,effects:r,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:O,y:_},isAbsoluteAnchorPoint:!1,size:m,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:c},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:m,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:p,sizeRatio:g/o(e.size),isOutline:f,markerPlacement:t,animatedSymbolProperties:i})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const r=[];return c.findApplicableOverrides(e,this._primitiveOverrides,r),{type:"cim-marker-placement-info",placement:e,overrides:F(r)}}_createAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const r=[];return c.findApplicableOverrides(e,this._primitiveOverrides,r),{type:"cim-animation-info",animation:e,overrides:F(r)}}_buildSimpleMarker(e,r){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[r],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,r,t,i,o,a,s,l,p,c,f,d){const u=o.geometry,v=a[0],_=a[1],g=m(u);if(!g)return;const S="Relative"!==e.anchorPointUnits,[k,M,P,b]=y(g,e.frame,e.size,e.anchorPoint,S),{path:C}=_,z=_.primitiveName,x=v.primitiveName,L=o.primitiveName;let E=null;_.colorLocked||f||(E=this._maybeGetValueOrOverrideExpression(L,"FillColor"));const I=E??this._getValueOrOverrideExpression(_.type,z,"Color",h(_.color));let V=null;v.colorLocked||f||(V=this._maybeGetValueOrOverrideExpression(L,"StrokeColor"));const N=V??this._getValueOrOverrideExpression(v.type,x,"Color",h(v.color)),w=this._maybeGetValueOrOverrideExpression(L,"StrokeWidth")??this._getValueOrOverrideExpression(v.type,x,"Width",O(v.width,n.CIMSolidStroke.width)),R={type:"sprite-rasterization-param",resource:C?{type:"path",path:C,asFill:!0}:{type:"sdf",geom:u,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:R,colorLocked:f,effects:r,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:M,y:P},isAbsoluteAnchorPoint:S,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:p},frameHeight:c,widthRatio:b,rotateClockwise:!1,referenceSize:l,sizeRatio:k,color:I,outlineColor:N,outlineWidth:w,isOutline:d,markerPlacement:t,animatedSymbolProperties:i})}_setPoMap(e,r,t){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[r]=t}_maybeGetValueOrOverrideExpression(e,r,t){return this._getValueOrOverrideExpression("",e,r,t,!1)}_getValueOrOverrideExpression(e,r,t,i,o=!0){if(o&&!x(i)&&(i=_(e,t.toLowerCase())),null==r)return i;const a=this._poMap[r];if(null==a)return i;const s=a[t];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,r,t,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,r){if(!e)return[];const t=[];for(const i of e)t.push(...this._getPrimitiveMaterialOverrides(i,r));return t}_getPrimitiveMaterialOverrides(e,r){if(!e)return[];const t=this._normalizePrimitiveOverrideProps(this._primitiveOverrides.filter((r=>r.primitiveName===e)));return t.forEach((e=>e.defaultValue=_(r,e.propertyName.toLowerCase()))),t}_analyzeMaterialOverrides(e,r){return this._primitiveOverrides.filter((t=>t.primitiveName!==e||!r.includes(t.propertyName)))}_normalizePrimitiveOverrideProps(e){return e.map((e=>({...e,propertyName:L(e.propertyName)})))}}function R(e){if(e&&0===e.indexOf("Level_")){const r=parseInt(e.substr(6),10);if(!isNaN(r))return r}return 0}function A(e,r){if(!r||0===r.length)return e;const i=t(e);return c.applyOverrides(i,r),i}const G=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects;function X(e){const r=e.symbolLayers;if(!r||2!==r.length)return!1;const t=r.find((e=>e.effects?.find((e=>"CIMGeometricEffectDashes"===e.type)))),i=r.find((e=>e.effects?.find((e=>"CIMGeometricEffectAddControlPoints"===e.type))));return!!t||!!i}function F(e){return t(e).map((e=>({...e,propertyName:L(e.propertyName)})))}export{w as CIMAnalyzer,A as analyzeCIMResource};
5
+ import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as r}from"../../core/fontUtils.js";import{clone as t}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{CIMSymbolHelper as l}from"./CIMSymbolHelper.js";import{defaultCIMValues as n}from"./defaultCIMValues.js";import{Alignment as p}from"./enums.js";import{OverrideHelper as c}from"./OverrideHelper.js";import{getExtent as m,getSDFMetrics as y}from"./SDFHelper.js";import{colorToArray as f,normalizeAlpha as h,getSize as d,isCIMMarkerStrokePlacement as u,getTintColor as v,getValue as O,getDefaultCIMValue as _,getEnum as g,getFillColor as S,getStrokeColor as k,getStrokeWidth as M,fromCIMFontDecoration as P,fromCIMFontStyle as b,fromCIMHorizontalAlignment as C,fromCIMVerticalAlignment as z,isValidCIMValue as x,uncapitalize as L}from"./utils.js";import{CIMEffectHelper as E}from"./effects/CIMEffectHelper.js";import{randomInsidePolygonTextureSize as I}from"../../views/2d/engine/webgl/definitions.js";const V=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function N(e){const r=e.markerPlacement;return r&&r.angleToLine?p.MAP:p.SCREEN}class w{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(r,t,i){if(this._cimLayers=i??[],!r)return this._cimLayers;if(this._reset(),r.primitiveOverrides){this._primitiveOverrides=r.primitiveOverrides;for(const r of this._primitiveOverrides){const t=r.valueExpressionInfo;if(t)this._setPoMap(r.primitiveName,r.propertyName,t);else if(null!=r.value){let t=r.value;r.propertyName.includes("Color")&&(e(t)&&(t=f(t)),t=h(t)),this._setPoMap(r.primitiveName,r.propertyName,t)}}}return this._analyzeSymbol(r.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,r){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,r)}}_analyzeMultiLayerSymbol(e,r){const t=e?.symbolLayers;if(!t)return;const i=e.effects;let o=p.SCREEN;const a=d(e)??0;"CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=p.MAP);const s="CIMPolygonSymbol"===e.type;let l=t.length;for(;l--;){const n=t[l];if(!n||!1===n.enable)continue;let p;i?.length&&(p=[...i]);const m=n.effects;m?.length&&(i?p.push(...m):p=[...m]);let y=null;if(p){y=[];for(const e of p){const r=c.findEffectOverrides(e,this._primitiveOverrides);r&&y.push(r)}}const f=[];switch(c.findApplicableOverrides(n,this._primitiveOverrides,f),n.type){case"CIMSolidFill":this._analyzeSolidFill(n,y);break;case"CIMPictureFill":this._analyzePictureFill(n,y);break;case"CIMHatchFill":this._analyzeHatchFill(n,y);break;case"CIMGradientFill":this._analyzeGradientFill(n,y);break;case"CIMSolidStroke":this._analyzeSolidStroke(n,y,s,a);break;case"CIMPictureStroke":this._analyzePictureStroke(n,y,s,a);break;case"CIMGradientStroke":this._analyzeGradientStroke(n,y,s,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=N(n));const t=[],i=n.primitiveName;i&&t.push(i);const l=s&&u(n.markerPlacement);this._analyzeMarker(n,y,null,t,o,a,r,[],!1,l);break}default:V().error("Cannot analyze CIM layer",n.type)}}}_analyzeSolidFill(e,r){const{primitiveName:t,type:i}=e,o=h(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(i,t,"Color",o),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:r,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,r){const{primitiveName:t,type:i}=e,o=v(e),a=O(e.height,n.CIMPictureFill.height);let s=O(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const r=e.width;let t=1;const i=this._resourceManager.getResource(e.url);null!=i&&(t=i.width/i.height),s/=t*(a/r)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(t,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:r,color:this._getValueOrOverrideExpression(i,t,"TintColor",o),height:this._getValueOrOverrideExpression(i,t,"Height",a),scaleX:this._getValueOrOverrideExpression(i,t,"ScaleX",s),angle:this._getValueOrOverrideExpression(i,t,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,t,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,t,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,r){const{primitiveName:t,type:i}=e,o=this._analyzeMaterialOverrides(t,["Rotation","OffsetX","OffsetY"]),a=this._normalizePrimitiveOverrideProps(o);let s=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const n of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==n.type)continue;const e=n.primitiveName??t;l||!e||n.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(s=h(n.color),s=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(i,e,"Color",s),l=!0);const r=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(r){let t=null,o=null;"number"==typeof r?t=r:o=r.valueExpressionInfo;let s=a.find((e=>"strokeWidth"===e.propertyName));s?s.propertyName="width":(s={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:o,value:t,defaultValue:_(i,"width")},a.push(s))}}const p={type:"sprite-rasterization-param",resource:e,overrides:a};this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:r,color:s,height:this._getValueOrOverrideExpression(i,t,"Separation",O(e.separation,n.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,t,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,t,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,t,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,r){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:r,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,r,t,i){const{primitiveName:o,type:a}=e,s=h(e.color),l=O(e.width,n.CIMSolidStroke.width),p=g(e.capStyle,n.CIMSolidStroke.capstyle),c=g(e.joinStyle,n.CIMSolidStroke.joinstyle),m=e.miterLimit;let y,f,d=[];if(this._analyzePrimitiveOverrides(o,r,null,null)&&(d=this._getPrimitiveMaterialOverrides(o,a)),r&&r instanceof Array&&r.length>0){const e=r[r.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&null===e.offsetAlongLine&&(y=e.dashTemplate,f=e.scaleDash,(r=[...r]).pop())}const u=void 0!==y?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:y,capStyle:p},overrides:d}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:u,isOutline:t,colorLocked:!!e.colorLocked,effects:r,color:this._getValueOrOverrideExpression(a,o,"Color",s),width:this._getValueOrOverrideExpression(a,o,"Width",l),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",p),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",c),miterLimit:m&&this._getValueOrOverrideExpression(a,o,"MiterLimit",m),referenceWidth:i,zOrder:R(e.name),dashTemplate:y,scaleDash:f,sampleAlphaOnly:!0})}_analyzePictureStroke(e,r,t,i){const{primitiveName:o,type:a}=e,s=v(e),l=O(e.width,n.CIMPictureStroke.width),p=g(e.capStyle,n.CIMPictureStroke.capstyle),c=g(e.joinStyle,n.CIMPictureStroke.joinstyle),m=e.miterLimit,y={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(o,a)};this._cimLayers.push({type:"line",spriteRasterizationParam:y,isOutline:t,colorLocked:!!e.colorLocked,effects:r,color:this._getValueOrOverrideExpression(a,o,"TintColor",s),width:this._getValueOrOverrideExpression(a,o,"Width",l),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",p),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",c),miterLimit:m&&this._getValueOrOverrideExpression(a,o,"MiterLimit",m),referenceWidth:i,zOrder:R(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,r,t,i){const{primitiveName:o,type:a}=e,s=O(e.width,n.CIMSolidStroke.width),l=g(e.capStyle,n.CIMGradientStroke.capstyle),p=g(e.joinStyle,n.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:t,colorLocked:!!e.colorLocked,effects:r,color:[128,128,128,1],width:this._getValueOrOverrideExpression(a,o,"Width",s),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",l),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(a,o,"MiterLimit",c),referenceWidth:i,zOrder:R(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,r,t,i,o,a,s,l,p=!1,c=!1){if(p||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,r,p))return;const m=O(e.size,n.CIMVectorMarker.size),y=O(e.rotation),f=O(e.offsetX),h=O(e.offsetY),{primitiveName:d,type:u}=e,v=this._getValueOrOverrideExpression(u,d,"Size",m),_=this._getValueOrOverrideExpression(u,d,"Rotation",y),g=this._getValueOrOverrideExpression(u,d,"OffsetX",f),S=this._getValueOrOverrideExpression(u,d,"OffsetY",h);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,r,t,i,o,a,v,_,g,S,l,p,c);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,r,t,i,o,a,v,_,g,S,l,s,p,c)}}_analyzeMarkerInsidePolygon(e,r,t){const{markerPlacement:i,type:o}=e;if(!i||"CIMMarkerPlacementInsidePolygon"!==i.type)return!1;if("CIMVectorMarker"===o||"CIMPictureMarker"===o){const t=e.primitiveName;if(t&&this._analyzePrimitiveOverrides([t],r,null,null))return!1;const a=i.primitiveName;if(a&&this._analyzePrimitiveOverrides([a],r,null,null))return!1;if("CIMVectorMarker"===o){const{markerGraphics:r}=e;if(r)for(const e of r){const{symbol:r}=e;if("CIMPolygonSymbol"===r?.type&&r.symbolLayers){const{symbolLayers:e}=r;for(const r of e)if("CIMSolidStroke"===r.type)return!1}}}else{const{animatedSymbolProperties:r}=e;if(r)return!1}}const s=Math.abs(i.stepX),l=Math.abs(i.stepY);if(0===s||0===l)return!0;let n,p;if("Random"===i.gridType){const e=a(I),r=Math.max(Math.floor(e/s),1);n=l*Math.max(Math.floor(e/l),1);p=r*s/n}else i.shiftOddRows?(n=2*l,p=s/l*.5):(n=l,p=s/l);const c=v(e),m="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:m,colorLocked:t,effects:r,color:c,height:n,scaleX:p,angle:i.gridAngle,offsetX:O(i.offsetX),offsetY:O(i.offsetY),applyRandomOffset:"Random"===i.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,r,i,o,a,l,n,p,c,m,y,f,h){const{primitiveName:d,type:u}=e;let _=O(e.scaleX,1);const g=v(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const S=this._createAnimatedSymbolPropertiesOverrideExpression(e.animatedSymbolProperties),k=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const r=e.width;let t=1;const i=this._resourceManager.getResource(e.url);null!=i&&(t=i.width/i.height);_/=t*(O(e.size)/r)}const M=[...o];let P;e.primitiveName&&M.push(e.primitiveName),e.animatedSymbolProperties||S?P={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(P=t(e),P.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:P,overrides:this._getMaterialOverrides(M,u)};S&&b.overrides.push(...S.overrides),this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:f,effects:r,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(u,d,"ScaleX",_),rotation:p,offsetX:c,offsetY:m,transform:{type:"cim-marker-transform-param",params:y},color:this._getValueOrOverrideExpression(u,d,"TintColor",g),anchorPoint:{x:k.x,y:k.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:h,markerPlacement:i,animatedSymbolProperties:S})}_analyzeVectorMarker(e,r,t,i,o,a,s,l,n,p,c,m,y,f){const h=e.markerGraphics;if(!h)return;const d=e.frame;let u=0;if(u=d?d.ymax-d.ymin:a,u){const r={offsetX:n,offsetY:p,rotation:l,size:s,frameHeight:u,rotateClockWise:!!e.rotateClockwise};c=[...c,r]}t||(t=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const v of h)if(v){const s=v.symbol;if(!s)continue;const l=v.primitiveName;let n;if(l&&i.push(l),("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&d){let r=0,t=0;const i=v.geometry;"x"in i&&"y"in i&&(r+=i.x-.5*(d.xmin+d.xmax),t+=i.y-.5*(d.ymin+d.ymax));const o=e.anchorPoint;o&&("Absolute"===e.anchorPointUnits?(r-=o.x,t-=o.y):d&&(r-=(d.xmax-d.xmin)*o.x,t-=(d.ymax-d.ymin)*o.y));const a={offsetX:r,offsetY:t,rotation:0,size:0,frameHeight:0,rotateClockWise:!1};n=[...c,a]}switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":m||X(s)?this._analyzeMultiLayerGraphicNonSDF(e,r,t,null,v,i,o,a,n??c,u,y,f):this._analyzeMultiLayerGraphic(e,r,t,null,v,i,o,a,n??c,u,y,f);break;case"CIMTextSymbol":this._analyzeTextGraphic(r,t,v,i,o,a,n??c,y)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,r,t,i,o,a,s,l,n,p,c,f){const d=o.symbol,u=d.symbolLayers;if(!u)return;let v=u.length;if(G(u))return void this._analyzeCompositeMarkerGraphic(e,r,t,i,o,u,s,l,n,p,c,f);const O=this._resourceManager.geometryEngine,_=E.applyEffects(d.effects,o.geometry,O);if(_)for(;v--;){const d=u[v];if(!d||!1===d.enable)continue;const g=d.primitiveName;switch(g&&a.push(g),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const a=E.applyEffects(d.effects,_,O),u=m(a);if(!u)continue;const v="Relative"!==e.anchorPointUnits,[P,b,C,z]=y(u,e.frame,e.size,e.anchorPoint,v),x="CIMSolidFill"===d.type,L={type:"sdf",geom:a,asFill:x},{path:I}=d,V=x?h(S(d)):null==I?h(k(d)):[0,0,0,0],N=x?[0,0,0,0]:h(k(d)),w=M(d)??0;if(!x&&!w)break;const R=o.primitiveName;let A=null;x&&!d.colorLocked&&(A=this._maybeGetValueOrOverrideExpression(R,"FillColor"));let G=null;x||d.colorLocked||(G=this._maybeGetValueOrOverrideExpression(R,"StrokeColor"));const X=A??this._getValueOrOverrideExpression(d.type,g,"Color",V),F=G??this._getValueOrOverrideExpression(d.type,g,"Color",N),T=this._maybeGetValueOrOverrideExpression(R,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,g,"Width",w),Y=I?{type:"sprite-rasterization-param",resource:{type:"path",path:I,asFill:x},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:Y,colorLocked:!!d.colorLocked||!!c,effects:r,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:b,y:C},isAbsoluteAnchorPoint:v,size:p,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:n},frameHeight:p,widthRatio:z,rotateClockwise:!1,referenceSize:l,sizeRatio:P,color:X,outlineColor:F,outlineWidth:T,isOutline:f,markerPlacement:t,animatedSymbolProperties:i});break}case"CIMPictureMarker":case"CIMVectorMarker":d.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,r,t,i,o,a,s,l,n,p,!!d.colorLocked||!!c,f):this._analyzeMarker(d,r,t,a,s,l,!1,n,c,f);break;default:this._analyzeMultiLayerGraphicNonSDF(e,r,t,i,o,a,s,l,n,p,!!d.colorLocked||!!c,f)}g&&a.pop()}}_analyzeTextGraphic(e,t,i,o,a,s,l,p){const m=[];c.findApplicableOverrides(i,this._primitiveOverrides,m);const y=i.geometry;if(!("x"in y)||!("y"in y))return;const f=i.symbol,d=P(f),u=b(f.fontStyleName),v=r(f.fontFamilyName);f.font={family:v,decoration:d,...u};const _=O(f.height,n.CIMTextSymbol.height),g=O(f.angle),x=O(f.offsetX),L=O(f.offsetY),E=h(S(f));let I=h(k(f)),V=M(f)??0;V||(I=h(S(f.haloSymbol)),V=O(f.haloSize));let N=!1;if(f.symbol?.symbolLayers)for(const r of f.symbol.symbolLayers){null!=h(S(r))&&(N=!!r.colorLocked)}const w=i.primitiveName;let R=null;N||(R=this._maybeGetValueOrOverrideExpression(w,"FillColor"));const A=this._maybeGetValueOrOverrideExpression(w,"TextSize"),G=this._maybeGetValueOrOverrideExpression(w,"TextAngle"),X=this._maybeGetValueOrOverrideExpression(w,"TextOffsetX"),F=this._maybeGetValueOrOverrideExpression(w,"TextOffsetY");let T=null,Y=null,j=0;if(f.callout&&"CIMBackgroundCallout"===f.callout.type){const e=f.callout;if(e.backgroundSymbol){const r=e.backgroundSymbol.symbolLayers;if(r)for(const e of r)"CIMSolidFill"===e.type?T=h(e.color):"CIMSolidStroke"===e.type&&(Y=h(e.color),j=O(e.width,n.CIMSolidStroke.width))}}const W=this._getValueOrOverrideExpression(f.type,i.primitiveName,"TextString",i.textString??"");if(null==W)return;const{fontStyleName:D}=f,H=v+(D?"-"+D.toLowerCase():"-regular"),U=this._getMaterialOverrides(o,f.type);U.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,f.type));const J={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:f.font,symbol:f,primitiveName:i.primitiveName},overrides:U};this._cimLayers.push({type:"text",lineWidth:null,textRasterizationParam:J,colorLocked:!!p||!!N,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:H,decoration:d,weight:u.weight,style:u.style,size:A??_,angle:G??g,offsetX:X??x,offsetY:F??L,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:C(f.horizontalAlignment),verticalAlignment:z(f.verticalAlignment),text:W,color:R??this._getValueOrOverrideExpression(f.type,i.primitiveName,"Color",E),outlineColor:I,outlineSize:V,backgroundColor:T,borderLineColor:Y,borderLineWidth:j,referenceSize:s,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,r,t,i,a,s,n,p,c,m,y,f){const h=this._buildSimpleMarker(e,a),d=e.primitiveName,u=this._analyzeMaterialOverrides(d,["Rotation","OffsetX","OffsetY"]),v=this._normalizePrimitiveOverrideProps(u),[O,_,g]=l.getTextureAnchor(h,this._resourceManager),S=this._getMaterialOverrides(s,e.type);S.push(...v);const k={type:"sprite-rasterization-param",resource:{...h,avoidSDFRasterization:!0},overrides:S};this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:y,effects:r,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:O,y:_},isAbsoluteAnchorPoint:!1,size:m,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:c},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:m,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:p,sizeRatio:g/o(e.size),isOutline:f,markerPlacement:t,animatedSymbolProperties:i})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const r=[];return c.findApplicableOverrides(e,this._primitiveOverrides,r),{type:"cim-marker-placement-info",placement:e,overrides:F(r)}}_createAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const r=[];return c.findApplicableOverrides(e,this._primitiveOverrides,r),{type:"cim-animation-info",animation:e,overrides:F(r)}}_buildSimpleMarker(e,r){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[r],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,r,t,i,o,a,s,l,p,c,f,d){const u=o.geometry,v=a[0],_=a[1],g=m(u);if(!g)return;const S="Relative"!==e.anchorPointUnits,[k,M,P,b]=y(g,e.frame,e.size,e.anchorPoint,S),{path:C}=_,z=_.primitiveName,x=v.primitiveName,L=o.primitiveName;let E=null;_.colorLocked||f||(E=this._maybeGetValueOrOverrideExpression(L,"FillColor"));const I=E??this._getValueOrOverrideExpression(_.type,z,"Color",h(_.color));let V=null;v.colorLocked||f||(V=this._maybeGetValueOrOverrideExpression(L,"StrokeColor"));const N=V??this._getValueOrOverrideExpression(v.type,x,"Color",h(v.color)),w=this._maybeGetValueOrOverrideExpression(L,"StrokeWidth")??this._getValueOrOverrideExpression(v.type,x,"Width",O(v.width,n.CIMSolidStroke.width)),R={type:"sprite-rasterization-param",resource:C?{type:"path",path:C,asFill:!0}:{type:"sdf",geom:u,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:R,colorLocked:f,effects:r,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:M,y:P},isAbsoluteAnchorPoint:S,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:p},frameHeight:c,widthRatio:b,rotateClockwise:!1,referenceSize:l,sizeRatio:k,color:I,outlineColor:N,outlineWidth:w,isOutline:d,markerPlacement:t,animatedSymbolProperties:i})}_setPoMap(e,r,t){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[r]=t}_maybeGetValueOrOverrideExpression(e,r,t){return this._getValueOrOverrideExpression("",e,r,t,!1)}_getValueOrOverrideExpression(e,r,t,i,o=!0){if(o&&!x(i)&&(i=_(e,t.toLowerCase())),null==r)return i;const a=this._poMap[r];if(null==a)return i;const s=a[t];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,r,t,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,r){if(!e)return[];const t=[];for(const i of e)t.push(...this._getPrimitiveMaterialOverrides(i,r));return t}_getPrimitiveMaterialOverrides(e,r){if(!e)return[];const t=this._normalizePrimitiveOverrideProps(this._primitiveOverrides.filter((r=>r.primitiveName===e)));return t.forEach((e=>e.defaultValue=_(r,e.propertyName.toLowerCase()))),t}_analyzeMaterialOverrides(e,r){return this._primitiveOverrides.filter((t=>t.primitiveName!==e||!r.includes(t.propertyName)))}_normalizePrimitiveOverrideProps(e){return e.map((e=>({...e,propertyName:L(e.propertyName)})))}}function R(e){if(e&&0===e.indexOf("Level_")){const r=parseInt(e.substr(6),10);if(!isNaN(r))return r}return 0}function A(e,r){if(!r||0===r.length)return e;const i=t(e);return c.applyOverrides(i,r),i}const G=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects;function X(e){const r=e.symbolLayers;if(!r||2!==r.length)return!1;const t=r.find((e=>e.effects?.find((e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)))),i=r.find((e=>e.effects?.find((e=>"CIMGeometricEffectAddControlPoints"===e.type))));return!!t||!!i}function F(e){return t(e).map((e=>({...e,propertyName:L(e.propertyName)})))}export{w as CIMAnalyzer,A as analyzeCIMResource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/has.js";import e from"../../../core/Logger.js";function r(r,n,t){if(null==r)return null;const u=n.readArcadeFeature();n.contextTimeZone=t.$view?.timeZone;try{return r.evaluate({...t,$feature:u},r.services)}catch(a){return e.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",a),null}}function n(e){return null==e||e===1/0||e===-1/0||"number"==typeof e&&isNaN(e)}function t(e,r,t,u){if(null==e)return null!=u?u:null;const a=r.readArcadeFeature(),l=e.evaluate({...t,$feature:a},e.services);return n(l)?null!=u?u:null:l}export{r as callExpressionWithCursor,t as callExpressionWithCursorWithDefault,n as isBadArcadeResult};
5
+ import"../../../core/has.js";import e from"../../../core/Logger.js";function r(r,n,t){if(null==r)return null;const u=n.readArcadeFeature();n.contextTimeZone=t.$view?.timeZone;try{return r.evaluate({...t,$feature:u},r.services)}catch(a){return e.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",a),null}}function n(e){return null==e||e===1/0||e===-1/0||"number"==typeof e&&isNaN(e)}function t(e,r,t,u){if(null==e)return null!=u?u:null;const a=r.readArcadeFeature();r.contextTimeZone=t.$view?.timeZone;const o=e.evaluate({...t,$feature:a},e.services);return n(o)?null!=u?u:null:o}export{r as callExpressionWithCursor,t as callExpressionWithCursorWithDefault,n as isBadArcadeResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../../geometry.js";import{getJsonType as e}from"../../../../../../geometry/support/jsonUtils.js";import t from"../../../../../../layers/support/FieldsIndex.js";import{MeshData as r}from"../../mesh/MeshData.js";import{AResourceProxy as o}from"./mesh/AResourceProxy.js";import{createMeshWriterDirect as s}from"./mesh/createMeshWriter.js";import{ComputedAttributeStorage as n}from"../../../../layers/features/support/ComputedAttributeStorage.js";import{FeatureMetadata as m}from"../../../../layers/features/support/FeatureMetadata.js";import{FeatureSetReaderJSON as a}from"../../../../layers/features/support/FeatureSetReaderJSON.js";import i from"../../../../../../geometry/SpatialReference.js";async function l(o){const l=new r("0.0.0.0"),p=new u,d={},c={fields:new t,spatialReference:i.WebMercator},f={$view:{scale:0}},h=new n(c);for(const t of o){const r=await s(h,p,t.technique.meshWriter.constructor,t.instanceId,{params:t.meshParams},d);t.feature.displayId=t.feature.attributes.objectId;const o=a.fromFeatures([t.feature],new m({fields:[],objectIdField:"objectId",geometryType:e(t.feature.geometry),globalIdField:null,spatialReference:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:!1}));o.next(),l.entityStart(o.getDisplayId(),0),r.write(l,p,o,f,0),l.entityEnd()}return l.serialize().message}class u extends o{fetchDictionaryResourceImmediate(e){throw new Error("Method not implemented.")}fetchResourceImmediate(e){throw new Error("Method not implemented.")}enqueueRequest(e){throw new Error("Method not implemented.")}fetchEnqueuedResources(){throw new Error("Method not implemented.")}getResource(e){throw new Error("Method not implemented.")}}export{l as createTestMeshData};
5
+ import"../../../../../../geometry.js";import{getJsonType as e}from"../../../../../../geometry/support/jsonUtils.js";import t from"../../../../../../layers/support/FieldsIndex.js";import{MeshData as r}from"../../mesh/MeshData.js";import{AResourceProxy as o}from"./mesh/AResourceProxy.js";import{createMeshWriterDirect as s}from"./mesh/createMeshWriter.js";import{ComputedAttributeStorage as n}from"../../../../layers/features/support/ComputedAttributeStorage.js";import{FeatureMetadata as m}from"../../../../layers/features/support/FeatureMetadata.js";import{FeatureSetReaderJSON as i}from"../../../../layers/features/support/FeatureSetReaderJSON.js";import a from"../../../../../../geometry/SpatialReference.js";async function l(o){const l=new r("0.0.0.0"),p=new u,d={},c={fields:new t,spatialReference:a.WebMercator},f={$view:{scale:0,timeZone:null}},h=new n(c);for(const t of o){const r=await s(h,p,t.technique.meshWriter.constructor,t.instanceId,{params:t.meshParams},d);t.feature.displayId=t.feature.attributes.objectId;const o=i.fromFeatures([t.feature],new m({fields:[],objectIdField:"objectId",geometryType:e(t.feature.geometry),globalIdField:null,spatialReference:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:!1,timeZone:null}));o.next(),l.entityStart(o.getDisplayId(),0),r.write(l,p,o,f,0),l.entityEnd()}return l.serialize().message}class u extends o{fetchDictionaryResourceImmediate(e){throw new Error("Method not implemented.")}fetchResourceImmediate(e){throw new Error("Method not implemented.")}enqueueRequest(e){throw new Error("Method not implemented.")}fetchEnqueuedResources(){throw new Error("Method not implemented.")}getResource(e){throw new Error("Method not implemented.")}}export{l as createTestMeshData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../../../../../core/arrayUtils.js";import r from"../../../../../../../core/Error.js";import{clone as t}from"../../../../../../../core/lang.js";import s from"../../../../../../../core/Logger.js";import{getStartGroup as a}from"../../../grouping.js";import{applyComputedValue as o}from"./utils.js";import{DictionaryValue as i}from"../../../../../layers/features/support/DictionaryValue.js";const n=()=>s.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function c(e,r,t=!1){const{defaultValue:s,valueExpressionInfo:a,value:o}=r;if(a){const{expression:o}=a,i=await e.createComputedField({expression:o},t);return i?{...r,computed:i,defaultValue:s}:null}return{...r,computed:new i(o),defaultValue:s}}async function m(e,r){const{defaultValue:t,valueExpressionInfo:s}=r,{expression:a}=s,o=await e.createComputedField({expression:a});return o?{...r,computed:o,defaultValue:t}:null}const p=e=>"boolean"!=typeof e&&"number"!=typeof e&&"valueExpressionInfo"in e,f=e=>e.some((e=>{for(const r in e){const t=e[r];if(p(t))return!0}return!1}));class l{static async create(r,t,s){const a={},o=new Map,i=new Map,n=new Map,u=new Map,d=new Map;for(const l in s.params){const h=s.params[l];if(null!=h&&"object"==typeof h)if(Array.isArray(h)){if("object"==typeof h[0])throw new Error(`InternalError: Cannot handle ${l}. Nested array params are not supported`);a[l]=h}else if("valueExpressionInfo"in h){if(h.value){a[l]=h.value;continue}const e=await m(r,h);if(!e){a[l]=h.defaultValue;continue}o.set(l,e),a[l]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some((e=>e.overrides.length))){i.set(l,{effects:await Promise.all(h.effectInfos.map((async t=>{const s=t.overrides.map((e=>c(r,e)));return{effect:t.effect,compiledOverrides:(await Promise.all(s)).filter(e)}})))});break}a[l]=h.effectInfos.map((e=>e.effect));break;case"cim-marker-placement-info":h.overrides.length&&n.set(l,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map((e=>c(r,e))))).filter(e)}),a[l]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e,h.useLegacyLabelEvaluationRules)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}if("animated"===h.resource.type){u.set(l,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:e}=h;if(f(e)){const t={compiledMarkerInfos:[]};await Promise.all(e.map((async e=>{const s={props:{}};for(const t in e)if(p(e[t])){const a=await m(r,e[t]);s.compiledExpressionMap||(s.compiledExpressionMap=new Map);const o=s.compiledExpressionMap;a&&o.set(t,a)}else s.props[t]=e[t];t.compiledMarkerInfos.push(s)}))),d.set(l,t)}else a[l]={type:"cim-marker-transform-info",infos:e};break}default:a[l]=h}else a[l]=h}return new l(s,a,o,i,n,u,d)}constructor(e,r,t,s,a,o,i){this.inputMeshParams=e,this._resolvedMeshParams=r,this._dynamicProperties=t,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=a,this._dynamicAsyncProperties=o,this._dynamicTransformProperties=i,this.evaluator=e=>e}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,s,i){for(const m of this._dynamicAsyncProperties.values()){const p=t(m.rasterizationParam.resource);"animated"===m.rasterizationParam.resource.type&&m.rasterizationParam.resource.randomizeStartTime&&(p.startGroup=a(s.getObjectId()||0));for(const{primitiveName:e,propertyName:t,computed:a,defaultValue:l,valueExpressionInfo:u}of m.compiledOverrides)try{o(p,e,t,a,s,i,l)}catch(c){n().errorOnce(new r("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${e}', property: '${t}')`,c))}const f=e.enqueueRequest({type:"cim-rasterization-info",resource:p});m.objectIdToResourceId.set(s.getObjectId(),f)}}evaluateMeshParams(e,r,t){for(const[s,a]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=a.computed.readWithDefault(r,t,a.defaultValue);for(const[s,a]of this._dynamicPlacementProperties.entries())for(const{computed:e,defaultValue:o,propertyName:i}of a.compiledOverrides){const n=e.readWithDefault(r,t,o);a.placementInfo.placement[i]=n,this._resolvedMeshParams[s]=a.placementInfo.placement}for(const[s,a]of this._dynamicEffectProperties.entries())for(const e of a.effects){for(const{computed:s,defaultValue:a,propertyName:o}of e.compiledOverrides){const i=s.readWithDefault(r,t,a);e.effect[o]=i}this._resolvedMeshParams[s]=a.effects.map((e=>e.effect))}for(const[s,a]of this._dynamicTransformProperties.entries()){const e={type:"cim-marker-transform-info",infos:[]};for(const s of a.compiledMarkerInfos){const a={...s.props};if(s.compiledExpressionMap)for(const[e,o]of s.compiledExpressionMap){const s=o.computed.readWithDefault(r,t,o.defaultValue);a[e]="number"==typeof s||"boolean"==typeof s?s:o.defaultValue}e.infos.push(a)}this._resolvedMeshParams[s]=e}for(const[s,a]of this._dynamicAsyncProperties.entries()){const t=a.objectIdToResourceId.get(r.getObjectId());if(null==t)continue;const o=e.getResource(t);this._resolvedMeshParams[s]=o}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}export{l as MeshWriterInputEvaluator};
5
+ import{isSome as e}from"../../../../../../../core/arrayUtils.js";import r from"../../../../../../../core/Error.js";import{clone as t}from"../../../../../../../core/lang.js";import s from"../../../../../../../core/Logger.js";import{getStartGroup as a}from"../../../grouping.js";import{applyComputedValue as o}from"./utils.js";import{DictionaryValue as i}from"../../../../../layers/features/support/DictionaryValue.js";const n=()=>s.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function c(e,r,t=!1){const{defaultValue:s,valueExpressionInfo:a,value:o}=r;if(a){const{expression:o}=a,i=await e.createComputedField({expression:o},t);return i?{...r,computed:i,defaultValue:s}:null}return{...r,computed:new i(o),defaultValue:s}}async function m(e,r){const{defaultValue:t,valueExpressionInfo:s}=r,{expression:a}=s,o=await e.createComputedField({expression:a});return o?{...r,computed:o,defaultValue:t}:null}const p=e=>"boolean"!=typeof e&&"number"!=typeof e&&"valueExpressionInfo"in e,f=e=>e.some((e=>{for(const r in e){const t=e[r];if(p(t))return!0}return!1}));class l{static async create(r,t,s){const a={},o=new Map,i=new Map,n=new Map,u=new Map,d=new Map;for(const l in s.params){const h=s.params[l];if(null!=h&&"object"==typeof h)if(Array.isArray(h)){if("object"==typeof h[0])throw new Error(`InternalError: Cannot handle ${l}. Nested array params are not supported`);a[l]=h}else if("valueExpressionInfo"in h){if(h.value){a[l]=h.value;continue}const e=await m(r,h);if(!e){a[l]=h.defaultValue;continue}o.set(l,e),a[l]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some((e=>e.overrides.length))){i.set(l,{effects:await Promise.all(h.effectInfos.map((async t=>{const s=t.overrides.map((e=>c(r,e)));return{effect:t.effect,compiledOverrides:(await Promise.all(s)).filter(e)}})))});break}a[l]=h.effectInfos.map((e=>e.effect));break;case"cim-marker-placement-info":h.overrides.length&&n.set(l,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map((e=>c(r,e))))).filter(e)}),a[l]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e,h.useLegacyLabelEvaluationRules)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const t=h.overrides.map((e=>c(r,e)));u.set(l,{compiledOverrides:(await Promise.all(t)).filter(e),rasterizationParam:h,objectIdToResourceId:new Map});continue}if("animated"===h.resource.type){u.set(l,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:h.resource};a[l]=await t.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:e}=h;if(f(e)){const t={compiledMarkerInfos:[]};await Promise.all(e.map((async e=>{const s={props:{}};for(const t in e)if(p(e[t])){const a=await m(r,e[t]);s.compiledExpressionMap||(s.compiledExpressionMap=new Map);const o=s.compiledExpressionMap;a&&o.set(t,a)}else s.props[t]=e[t];t.compiledMarkerInfos.push(s)}))),d.set(l,t)}else a[l]={type:"cim-marker-transform-info",infos:e};break}default:a[l]=h}else a[l]=h}return new l(s,a,o,i,n,u,d)}constructor(e,r,t,s,a,o,i){this.inputMeshParams=e,this._resolvedMeshParams=r,this._dynamicProperties=t,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=a,this._dynamicAsyncProperties=o,this._dynamicTransformProperties=i,this.evaluator=e=>e}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,s,i){for(const m of this._dynamicAsyncProperties.values()){const p=t(m.rasterizationParam.resource);"animated"===m.rasterizationParam.resource.type&&m.rasterizationParam.resource.randomizeStartTime&&(p.primitiveName="__RESERVED__PRIMITIVE__NAME__",p.startGroup=a(s.getObjectId()||0));for(const{primitiveName:e,propertyName:t,computed:a,defaultValue:l,valueExpressionInfo:u}of m.compiledOverrides)try{const r="animated"===m.rasterizationParam.resource.type?p.primitiveName:e;o(p,r,t,a,s,i,l)}catch(c){n().errorOnce(new r("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${e}', property: '${t}')`,c))}const f=e.enqueueRequest({type:"cim-rasterization-info",resource:p});m.objectIdToResourceId.set(s.getObjectId(),f)}}evaluateMeshParams(e,r,t){for(const[s,a]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=a.computed.readWithDefault(r,t,a.defaultValue);for(const[s,a]of this._dynamicPlacementProperties.entries())for(const{computed:e,defaultValue:o,propertyName:i}of a.compiledOverrides){const n=e.readWithDefault(r,t,o);a.placementInfo.placement[i]=n,this._resolvedMeshParams[s]=a.placementInfo.placement}for(const[s,a]of this._dynamicEffectProperties.entries())for(const e of a.effects){for(const{computed:s,defaultValue:a,propertyName:o}of e.compiledOverrides){const i=s.readWithDefault(r,t,a);e.effect[o]=i}this._resolvedMeshParams[s]=a.effects.map((e=>e.effect))}for(const[s,a]of this._dynamicTransformProperties.entries()){const e={type:"cim-marker-transform-info",infos:[]};for(const s of a.compiledMarkerInfos){const a={...s.props};if(s.compiledExpressionMap)for(const[e,o]of s.compiledExpressionMap){const s=o.computed.readWithDefault(r,t,o.defaultValue);a[e]="number"==typeof s||"boolean"==typeof s?s:o.defaultValue}e.infos.push(a)}this._resolvedMeshParams[s]=e}for(const[s,a]of this._dynamicAsyncProperties.entries()){const t=a.objectIdToResourceId.get(r.getObjectId());if(null==t)continue;const o=e.getResource(t);this._resolvedMeshParams[s]=o}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}export{l as MeshWriterInputEvaluator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}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{subtract as h,normalize as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as _,l as m,n as d,g as y,k as u,f as g}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import k from"../../../../layers/GraphicsLayer.js";import{ViewingMode as j}from"../../../ViewingMode.js";import{DragManipulation as P}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as C}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as S,SnapRotation as M}from"./manipulations/utils.js";import{primaryKey as T}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as O}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as D}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as U}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as E}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as L}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as B}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import V from"../../../../geometry/Polygon.js";import I from"../../../../geometry/Point.js";import z from"../../../../symbols/SimpleFillSymbol.js";import K from"../../../../symbols/SimpleMarkerSymbol.js";const N={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:T},W=80,q=10,F=30,J=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Q=1,X=10;let Y=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new S,this._snapRotation=new M,this._graphicsLayer=new k({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=W*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),L(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=q*this.view.resolution;return _(t.basis1,t.basis1,1+i/m(t.basis1)),_(t.basis2,t.basis2,1+i/m(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new V({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return d(t,e.basis1),_(t,t,F*this.view.resolution),y(t,t,e.origin),y(t,t,e.basis1),new I({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),h=u(this._avgCD,o,r,.5),c=u(this._avgDA,r,i,.5);return[new I({x:i[0],y:i[1],spatialReference:t}),new I({x:s[0],y:s[1],spatialReference:t}),new I({x:o[0],y:o[1],spatialReference:t}),new I({x:r[0],y:r[1],spatialReference:t}),new I({x:a[0],y:a[1],spatialReference:t}),new I({x:n[0],y:n[1],spatialReference:t}),new I({x:h[0],y:h[1],spatialReference:t}),new I({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=O.fromGeometry(v(i,e.spatialReference),j.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=D.fromGeometry(v(this._graphic.geometry,e.spatialReference),j.Local),this._backgroundGraphic=new t({symbol:new z({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new K({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new K({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new P({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new C({tool:this,view:e,graphic:t,direction:J[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=H(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=B(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&(t.key!==N.shift||t.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,t.stopPropagation()),t.key!==N.toggleOpacity||t.repeat||("georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),t.stopPropagation()),t.key!==N.primaryKey||t.repeat||(this._factor=X,t.stopPropagation()),this._isModifierActive&&(t.key===N.plus&&(this._scale(this._factor),t.stopPropagation()),t.key===N.minus&&(this._scale(-this._factor),t.stopPropagation()),t.key===N.up&&(this._move(0,this._factor),t.stopPropagation()),t.key===N.down&&(this._move(0,-this._factor),t.stopPropagation()),t.key===N.left&&(this._move(-this._factor,0),t.stopPropagation()),t.key===N.right&&(this._move(this._factor,0),t.stopPropagation())))})),e.on("key-up",(t=>{e.activeTool===this&&(t.key===N.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,t.stopPropagation()),t.key===N.primaryKey&&(this._factor=Q,t.stopPropagation()))}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;y(o,s,t),y(o,o,i);const r=this._cornerB;y(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),y(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=[];for(const a of t.data.components)i.push(...a.vertices);const s=t.data.geometry.extent?.width,o=(s+e*this.view.resolution)/s,r=t.scaleVertices(i,this._plane.origin,p,o,o,U.NEW_STEP,E.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,e*this.view.resolution,t*this.view.resolution,0,U.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Y.prototype,"_plane",null),e([a()],Y.prototype,"_backgroundGraphicGeometry",null),e([a()],Y.prototype,"_rotateGraphicGeometry",null),e([a()],Y.prototype,"_scaleGraphicGeometries",null),e([a()],Y.prototype,"preserveAspectRatio",void 0),e([a()],Y.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Y.prototype,"target",void 0),e([a({constructOnly:!0})],Y.prototype,"view",void 0),Y=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Y);export{Y as TransformTool,N as keys};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}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{subtract as h,normalize as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as _,l as m,n as d,g as y,m as u,f as g}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import j from"../../../../layers/GraphicsLayer.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{DragManipulation as P}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as C}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as S,SnapRotation as M}from"./manipulations/utils.js";import{primaryKey as T}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as O}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as D}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as U}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as E}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as L}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as B}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as H}from"../../../support/screenUtils.js";import V from"../../../../geometry/Polygon.js";import I from"../../../../geometry/Point.js";import z from"../../../../symbols/SimpleFillSymbol.js";import K from"../../../../symbols/SimpleMarkerSymbol.js";const N={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:T},W=80,q=10,F=30,J=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Q=1,X=10;let Y=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new S,this._snapRotation=new M,this._graphicsLayer=new j({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=h(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);c(s,s);let o=W*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),L(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=q*this.view.resolution;return _(t.basis1,t.basis1,1+i/m(t.basis1)),_(t.basis2,t.basis2,1+i/m(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new V({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return d(t,e.basis1),_(t,t,F*this.view.resolution),y(t,t,e.origin),y(t,t,e.basis1),new I({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),h=u(this._avgCD,o,r,.5),c=u(this._avgDA,r,i,.5);return[new I({x:i[0],y:i[1],spatialReference:t}),new I({x:s[0],y:s[1],spatialReference:t}),new I({x:o[0],y:o[1],spatialReference:t}),new I({x:r[0],y:r[1],spatialReference:t}),new I({x:a[0],y:a[1],spatialReference:t}),new I({x:n[0],y:n[1],spatialReference:t}),new I({x:h[0],y:h[1],spatialReference:t}),new I({x:c[0],y:c[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=O.fromGeometry(v(i,e.spatialReference),k.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=D.fromGeometry(v(this._graphic.geometry,e.spatialReference),k.Local),this._backgroundGraphic=new t({symbol:new z({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new K({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new K({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new P({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new C({tool:this,view:e,graphic:t,direction:J[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=H(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=B(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&(t.key!==N.shift||t.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,t.stopPropagation()),t.key!==N.toggleOpacity||t.repeat||("georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),t.stopPropagation()),t.key!==N.primaryKey||t.repeat||(this._factor=X,t.stopPropagation()),this._isModifierActive&&(t.key===N.plus&&(this._scale(this._factor),t.stopPropagation()),t.key===N.minus&&(this._scale(-this._factor),t.stopPropagation()),t.key===N.up&&(this._move(0,this._factor),t.stopPropagation()),t.key===N.down&&(this._move(0,-this._factor),t.stopPropagation()),t.key===N.left&&(this._move(-this._factor,0),t.stopPropagation()),t.key===N.right&&(this._move(this._factor,0),t.stopPropagation())))})),e.on("key-up",(t=>{e.activeTool===this&&(t.key===N.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,t.stopPropagation()),t.key===N.primaryKey&&(this._factor=Q,t.stopPropagation()))}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;y(o,s,t),y(o,o,i);const r=this._cornerB;y(r,s,t),g(r,r,i);const a=this._cornerC;g(a,s,t),g(a,a,i);const n=this._cornerD;g(n,s,t),y(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=[];for(const a of t.data.components)i.push(...a.vertices);const s=t.data.geometry.extent?.width,o=(s+e*this.view.resolution)/s,r=t.scaleVertices(i,this._plane.origin,p,o,o,U.NEW_STEP,E.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,e*this.view.resolution,t*this.view.resolution,0,U.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],Y.prototype,"_plane",null),e([a()],Y.prototype,"_backgroundGraphicGeometry",null),e([a()],Y.prototype,"_rotateGraphicGeometry",null),e([a()],Y.prototype,"_scaleGraphicGeometries",null),e([a()],Y.prototype,"preserveAspectRatio",void 0),e([a()],Y.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],Y.prototype,"target",void 0),e([a({constructOnly:!0})],Y.prototype,"view",void 0),Y=e([n("esri.views.2d.interactive.editingTools.TransformTool")],Y);export{Y as TransformTool,N as keys};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{l as s,c as a,q as n,f as o,j as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as h,c as p}from"../../../../../chunks/boundedPlane.js";import{getInfo as u}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Manipulation as _,ManipulatorType as m}from"./Manipulation.js";import{onGrabChangedHandle as d}from"./utils.js";import{createManipulatorDragEventPipeline as f,screenToMap as v}from"../../../../interactive/dragEventPipeline.js";import{GraphicManipulator as g}from"../../../../interactive/GraphicManipulator.js";import{AccumulationBehavior as b}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as x}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as C}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";const E=10,S=1e-6,j=.3;function y(t){const i=s(t.basis1),e=s(t.basis2);return j*Math.min(i,e)}class w extends _{constructor(i){super(),this._handles=new t,this._planeStart=h(),this._displayPlaneStart=h(),this._originCache=c(),this._axisCache=r(),this._renderStartCache=c(),this._renderEndCache=c(),this._resizeOriginCache=c(),this._view=i.view,this._tool=i.tool,this._graphic=i.graphic,this._direction=i.direction,this._preserveAspectRatio=i.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",(t=>d(t,this._manipulator)))]),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,m.SCALE)}createDragPipeline(t,r){let c=null,h=null,_=null,m=0,d=null,g=null;const j=this._planeStart,w=this._displayPlaneStart,P=this._direction;return f(this._manipulator,((f,M)=>{M.next((i=>{if("start"===i.action){f.cursor="grabbing";const i=t();c=i.plane,h=i.displayPlane,_=i.editGeometryOperations,m=E*this._view.resolution,p(c,j),p(h,w);const e=u(_.data.spatialReference);d=e?e.valid[1]-e.valid[0]-3*E*this._view.resolution:null}return i})).next(v(this._view)).next((t=>{const i=a(this._renderStartCache,[t.mapStart.x,t.mapStart.y,0]),e=a(this._renderEndCache,[t.mapEnd.x,t.mapEnd.y,0]),r=a(this._resizeOriginCache,w.origin);n(r,r,w.basis1,-P[0]),n(r,r,w.basis2,-P[1]),o(e,e,r),o(i,i,r);const c=0!==P[0]&&0!==P[1],p=y(w),u=y(h)/p,_=(t,r)=>{if(0===t)return 1;let a=s(r),n=.5*t*l(r,e)/a;const o=n<0?-1:1;if(c){n+=(a-.5*t*l(r,i)/a)*o*u}const h=a<1.5*m?1:S;return a=Math.max(a-m,S),o>0&&(n-=E*this._view.resolution),o*Math.max(o*(n/a),h)},d=_(P[0],w.basis1),f=_(P[1],w.basis2);return{...t,direction:P,factor1:d,factor2:f}})).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next((t=>{const s=a(this._originCache,j.origin);n(s,s,j.basis1,-P[0]),n(s,s,j.basis2,-P[1]);const o=i(this._axisCache,j.basis1[0],j.basis1[1]);e(o,o);const l=[];for(const i of _.data.components)l.push(...i.vertices);const h="start"===t.action?b.NEW_STEP:b.ACCUMULATE_STEPS,u=_.scaleVertices(l,s,o,t.factor1,t.factor2,h,x.REPLACE);return d&&d<_.data.geometry.extent.width&&g?_.updateVertices(l,g):(p(j,c),C(u,c),g=u.operation,r(t,u)),t})).next((t=>("end"===t.action&&(f.cursor="grab"),t)))}))}_createManipulator(){return new g({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}export{w as ScaleManipulation,y as calculateDiagonalResizeHandleScale};
5
+ import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{l as s,c as a,r as n,f as o,k as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as h,c as p}from"../../../../../chunks/boundedPlane.js";import{getInfo as u}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Manipulation as _,ManipulatorType as m}from"./Manipulation.js";import{onGrabChangedHandle as d}from"./utils.js";import{createManipulatorDragEventPipeline as f,screenToMap as v}from"../../../../interactive/dragEventPipeline.js";import{GraphicManipulator as g}from"../../../../interactive/GraphicManipulator.js";import{AccumulationBehavior as b}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as x}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as C}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";const E=10,S=1e-6,y=.3;function j(t){const i=s(t.basis1),e=s(t.basis2);return y*Math.min(i,e)}class w extends _{constructor(i){super(),this._handles=new t,this._planeStart=h(),this._displayPlaneStart=h(),this._originCache=c(),this._axisCache=r(),this._renderStartCache=c(),this._renderEndCache=c(),this._resizeOriginCache=c(),this._view=i.view,this._tool=i.tool,this._graphic=i.graphic,this._direction=i.direction,this._preserveAspectRatio=i.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",(t=>d(t,this._manipulator)))]),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,m.SCALE)}createDragPipeline(t,r){let c=null,h=null,_=null,m=0,d=null,g=null;const y=this._planeStart,w=this._displayPlaneStart,P=this._direction;return f(this._manipulator,((f,M)=>{M.next((i=>{if("start"===i.action){f.cursor="grabbing";const i=t();c=i.plane,h=i.displayPlane,_=i.editGeometryOperations,m=E*this._view.resolution,p(c,y),p(h,w);const e=u(_.data.spatialReference);d=e?e.valid[1]-e.valid[0]-3*E*this._view.resolution:null}return i})).next(v(this._view)).next((t=>{const i=a(this._renderStartCache,[t.mapStart.x,t.mapStart.y,0]),e=a(this._renderEndCache,[t.mapEnd.x,t.mapEnd.y,0]),r=a(this._resizeOriginCache,w.origin);n(r,r,w.basis1,-P[0]),n(r,r,w.basis2,-P[1]),o(e,e,r),o(i,i,r);const c=0!==P[0]&&0!==P[1],p=j(w),u=j(h)/p,_=(t,r)=>{if(0===t)return 1;let a=s(r),n=.5*t*l(r,e)/a;const o=n<0?-1:1;if(c){n+=(a-.5*t*l(r,i)/a)*o*u}const h=a<1.5*m?1:S;return a=Math.max(a-m,S),o>0&&(n-=E*this._view.resolution),o*Math.max(o*(n/a),h)},d=_(P[0],w.basis1),f=_(P[1],w.basis2);return{...t,direction:P,factor1:d,factor2:f}})).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next((t=>{const s=a(this._originCache,y.origin);n(s,s,y.basis1,-P[0]),n(s,s,y.basis2,-P[1]);const o=i(this._axisCache,y.basis1[0],y.basis1[1]);e(o,o);const l=[];for(const i of _.data.components)l.push(...i.vertices);const h="start"===t.action?b.NEW_STEP:b.ACCUMULATE_STEPS,u=_.scaleVertices(l,s,o,t.factor1,t.factor2,h,x.REPLACE);return d&&d<_.data.geometry.extent.width&&g?_.updateVertices(l,g):(p(y,c),C(u,c),g=u.operation,r(t,u)),t})).next((t=>("end"===t.action&&(f.cursor="grab"),t)))}))}_createManipulator(){return new g({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}export{w as ScaleManipulation,j as calculateDiagonalResizeHandleScale};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{ignoreAbortErrors as e,throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i,hasDiff as a}from"../../../../core/accessorSupport/diffUtils.js";import o from"../../../../geometry/SpatialReference.js";import n from"../../../../layers/support/FieldsIndex.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{BinningStrategy as g}from"./processor/BinningStrategy.js";import{ClusterStrategy as d}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as y}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as p}from"./support/AttributeStore.js";import{ComputedAttributeStorage as _}from"./support/ComputedAttributeStorage.js";import{QueueProcessor as l}from"../../../support/QueueProcessor.js";class f{constructor(t,s){this._connection=t,this._source=s,this._version=1,this._queue=new l({concurrency:1,process:t=>this._process(t)}),this._proxy=new u({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new p({isLocal:!1,update:t=>e(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}async update(t,e,s,r,c){const u=t.processor,g=i(this._schema,u);if(!g&&!r)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:g,schema:u}),this._schema=u;const d=o.fromJSON(t.source.mutable.dataFilter.outSpatialReference),y=new _({fields:new n,spatialReference:d});return await this._attributeStore.update(u.storage,y,this._source.metadata,d,e),this._strategy?.invalidateAttributeData(),r||a(g,"mesh")?(a(g,"mesh.strategy")&&await this._updateStrategy(u.mesh.strategy,d,c),this._updateSortKey(y,"sortKey"in u.mesh?u.mesh.sortKey:null),(a(g,"mesh.factory")||"dictionary"===u.mesh.factory.symbology.type)&&(this._factory=await h.create(y,this._proxy,u.mesh.factory,s)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(t){if(!this._strategy)return;const e=this._strategy.applyOverride(t);for await(const r of e)try{await this._process(r)}catch(s){}this._source.applyOverride(t)}async updateChunks(){return this._doUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy)return void this._attributeStore.setHighlight(t.map((({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1}))));const e=this._strategy.displayMap(t,(({objectId:t})=>t),((t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e})));this._attributeStore.setHighlight(e)}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[];for await(const i of t){const t=this._queue.push(i).catch((t=>s(t)));e.push(t)}try{await Promise.all(e)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new y(this._source,this._attributeStore);break;case"binning":this._strategy=await g.create(t,e,this._source,this._attributeStore);break;case"cluster":this._strategy=await d.create(this._connection,t,e,this._source,this._attributeStore)}for(const r of s)this._strategy.onSubscribe(r)}async _updateSortKey(e,s){if(this._sortInfo=t(this._sortInfo?.computed),null!=s){const t=s.byRenderer?null:await e.createComputedField(s);this._sortInfo={...s,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(t){const e=t.subscription;if(has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}await this._fetchResources(t),r(e.signal);const s=await this._write(t,e.tile.arcadeEvaluationOptions),i=e.tile.tileInfoView.tileInfo.isWrappable,{message:a,transferList:o}=s.serialize(i),n=t.createMessage(a,this._version,this._attributeStore.epoch);if(r(e.signal),await this._connection.container.onMessage(n,{signal:e.signal,transferList:o}),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t){await this._fetchMatcherResources(t),await this._fetchWriterResources(t)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t){if(!t.reader)return;const e=t.reader.getCursor(),s=t.subscription.tile.arcadeEvaluationOptions;for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,s);await this._proxy.fetchEnqueuedResources()}async _write(t,e){const s=t.subscription.tile,r=t.reader?.getCursor(),i=r?.getSize()??0,a=new c(s.key.id,this._strategy.enablePixelBuffering,i);if(!r)return a;const o=s.arcadeEvaluationOptions;for(;r.next();){const t=this._getSortKeyValue(r,e);a.entityStart(r.getDisplayId(),t),this._factory.write(a,this._proxy,r,o,s.level),a.entityEnd()}return a}_getSortKeyValue(t,e){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(t,e):s?.read(t,e);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}export{f as default};
5
+ import has from"../../../../core/has.js";import{destroyMaybe as t}from"../../../../core/maybe.js";import{ignoreAbortErrors as e,throwIfNotAbortError as s,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{diff as i,hasDiff as a}from"../../../../core/accessorSupport/diffUtils.js";import o from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as n}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as c}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as h}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{BinningStrategy as u}from"./processor/BinningStrategy.js";import{ClusterStrategy as g}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as d}from"./processor/FeatureUpdateStrategy.js";import{AttributeStore as y}from"./support/AttributeStore.js";import{ComputedAttributeStorage as _}from"./support/ComputedAttributeStorage.js";import{QueueProcessor as p}from"../../../support/QueueProcessor.js";class l{constructor(t,s){this._connection=t,this._source=s,this._version=1,this._queue=new p({concurrency:1,process:t=>this._process(t)}),this._proxy=new h({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new y({isLocal:!1,update:t=>e(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}async update(t,e,s,r,n){const h=t.processor,u=i(this._schema,h);if(!u&&!r)return;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:u,schema:h}),this._schema=h;const g=o.fromJSON(t.source.mutable.dataFilter.outSpatialReference),d=new _({fields:this._source.metadata.fieldsIndex,spatialReference:g});return await this._attributeStore.update(h.storage,d,this._source.metadata,g,e),this._strategy?.invalidateAttributeData(),r||a(u,"mesh")?(a(u,"mesh.strategy")&&await this._updateStrategy(h.mesh.strategy,g,n),this._updateSortKey(d,"sortKey"in h.mesh?h.mesh.sortKey:null),(a(u,"mesh.factory")||"dictionary"===h.mesh.factory.symbology.type)&&(this._factory=await c.create(d,this._proxy,h.mesh.factory,s)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(t){if(!this._strategy)return;const e=this._strategy.applyOverride(t);for await(const r of e)try{await this._process(r)}catch(s){}this._source.applyOverride(t)}async updateChunks(){return this._doUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy)return void this._attributeStore.setHighlight(t.map((({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1}))),t);const e=this._strategy.displayMap(t,(({objectId:t})=>t),((t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e})));this._attributeStore.setHighlight(e,t)}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[];for await(const i of t){const t=this._queue.push(i).catch((t=>s(t)));e.push(t)}try{await Promise.all(e)}catch(r){}has("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new d(this._source,this._attributeStore);break;case"binning":this._strategy=await u.create(t,e,this._source,this._attributeStore);break;case"cluster":this._strategy=await g.create(this._connection,t,e,this._source,this._attributeStore)}for(const r of s)this._strategy.onSubscribe(r)}async _updateSortKey(e,s){if(this._sortInfo=t(this._sortInfo?.computed),null!=s){const t=s.byRenderer?null:await e.createComputedField(s);this._sortInfo={...s,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(t){const e=t.subscription,s=this._source.metadata.createArcadeEvalOptions(e.tile);if(has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}await this._fetchResources(t,s),r(e.signal);const i=await this._write(t,s),a=e.tile.tileInfoView.tileInfo.isWrappable,{message:o,transferList:n}=i.serialize(a),c=t.createMessage(o,this._version,this._attributeStore.epoch);if(r(e.signal),await this._connection.container.onMessage(c,{signal:e.signal,transferList:n}),await this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t,e){await this._fetchMatcherResources(t),await this._fetchWriterResources(t,e)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t,e){if(!t.reader)return;const s=t.reader.getCursor();for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,e);await this._proxy.fetchEnqueuedResources()}async _write(t,e){const s=t.subscription.tile,r=t.reader?.getCursor(),i=r?.getSize()??0,a=new n(s.key.id,this._strategy.enablePixelBuffering,i);if(!r)return a;for(;r.next();){const t=this._getSortKeyValue(r,e);a.entityStart(r.getDisplayId(),t),this._factory.write(a,this._proxy,r,e,s.level),a.entityEnd()}return a}_getSortKeyValue(t,e){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(t,e):s?.read(t,e);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{GeohashTree as e}from"../../../../../geohash/GeohashTree.js";import{getGeohash as r}from"../../../../../geohash/geohashUtils.js";import{tileSize as t}from"../../../engine/webgl/definitions.js";class s{constructor(r){this._options=r,this._tree=new e(r.fields)}insert(e,r){const t=e.getCursor(),s={$view:{scale:0}};for(;t.next();)this._insertFeature(t,s,r)}putBins(e,r){this._tree.putBins(e,r)}_insertFeature(e,s,o){const{featureFilter:i,geohashLevel:n,spatialReference:a}=this._options;if(null!==i&&!i.check(e))return;let l=0,c=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),c=e.readYWorldSpace();else{if(o){const r=e.readCentroidForDisplay();if(null==r)return;const[s,o]=r.coords;if(s<0||s>t||o<0||o>t)return}const r=e.readCentroidWorldSpace();if(null==r)return;l=r.coords[0],c=r.coords[1]}const h=r(l,c,n,a);h&&this._tree.insert(e,l,c,h[0],h[1],n,s)}}export{s as GeohashSpatialIndex};
5
+ import{GeohashTree as e}from"../../../../../geohash/GeohashTree.js";import{getGeohash as t}from"../../../../../geohash/geohashUtils.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";class o{constructor(t){this._options=t,this._tree=new e(t.fields)}insert(e,t){const r=e.getCursor(),o={$view:{scale:0,timeZone:this._options.timeZone}};for(;r.next();)this._insertFeature(r,o,t)}putBins(e,t){this._tree.putBins(e,t)}_insertFeature(e,o,s){const{featureFilter:i,geohashLevel:n,spatialReference:a}=this._options;if(null!==i&&!i.check(e))return;let l=0,c=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),c=e.readYWorldSpace();else{if(s){const t=e.readCentroidForDisplay();if(null==t)return;const[o,s]=t.coords;if(o<0||o>r||s<0||s>r)return}const t=e.readCentroidWorldSpace();if(null==t)return;l=t.coords[0],c=t.coords[1]}const h=t(l,c,n,a);h&&this._tree.insert(e,l,c,h[0],h[1],n,o)}}export{o as GeohashSpatialIndex};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{getMetersPerUnitForSR as e,inchesPerMeter as t}from"../../../../../core/unitUtils.js";import{tileSize as i}from"../../../engine/webgl/definitions.js";import{GridCell as s}from"./GridCell.js";const o=96;function l(i,s){return e(i)*t*o/s}class r{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=l(e.spatialReference,e.scale)}insert(e,t){const i=e.getCursor(),s={$view:{scale:this._options.scale}};for(;i.next();)this._insertFeature(i,s,t)}putCellsInBounds(e,t){const[i,s,o,l]=t,r=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),n=Math.floor(s*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize),p=Math.ceil(l*this._pixelsPerMapUnit/this._options.cellSize);for(let a=n;a<=p;a++)for(let t=r;t<=c;t++){const i=`${t}.${a}`,s=this._cells.get(i);if(!s)continue;const o=e.get(s.id);o?s&&!e.has(s.id)&&o.merge(s):e.set(s.id,s.clone())}}putCells(e){for(const t of this._cells.values()){const i=e.get(t.id);i?i.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,s){const{featureFilter:o}=this._options;if(null!==o&&!o.check(e))return;let l=0,r=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),r=e.readYWorldSpace();else{if(s){const t=e.readCentroidForDisplay();if(null==t)return;const[s,o]=t.coords;if(s<0||s>i||o<0||o>i)return}const t=e.readCentroidWorldSpace();if(null==t)return;l=t.coords[0],r=t.coords[1]}const n=l*this._pixelsPerMapUnit,c=r*this._pixelsPerMapUnit,p=Math.floor(n/this._options.cellSize),a=Math.floor(c/this._options.cellSize);this._getCellOrCreate(p,a).insert(e,t,l,r)}_getCellOrCreate(e,t){const i=s.createId(e,t);let o=this._cells.get(i);if(!o){const l=1*this._options.cellSize/this._pixelsPerMapUnit;o=s.create(e,t,this._options.fields,l),this._cells.set(i,o)}return o}}export{r as GridSpatialIndex,l as pixelsPerMapUnit};
5
+ import{getMetersPerUnitForSR as e,inchesPerMeter as t}from"../../../../../core/unitUtils.js";import{tileSize as i}from"../../../engine/webgl/definitions.js";import{GridCell as s}from"./GridCell.js";const o=96;function l(i,s){return e(i)*t*o/s}class r{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=l(e.spatialReference,e.scale)}insert(e,t){const i=e.getCursor(),s={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;i.next();)this._insertFeature(i,s,t)}putCellsInBounds(e,t){const[i,s,o,l]=t,r=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),n=Math.floor(s*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize),p=Math.ceil(l*this._pixelsPerMapUnit/this._options.cellSize);for(let a=n;a<=p;a++)for(let t=r;t<=c;t++){const i=`${t}.${a}`,s=this._cells.get(i);if(!s)continue;const o=e.get(s.id);o?s&&!e.has(s.id)&&o.merge(s):e.set(s.id,s.clone())}}putCells(e){for(const t of this._cells.values()){const i=e.get(t.id);i?i.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,s){const{featureFilter:o}=this._options;if(null!==o&&!o.check(e))return;let l=0,r=0;if("esriGeometryPoint"===e.geometryType)l=e.readXWorldSpace(),r=e.readYWorldSpace();else{if(s){const t=e.readCentroidForDisplay();if(null==t)return;const[s,o]=t.coords;if(s<0||s>i||o<0||o>i)return}const t=e.readCentroidWorldSpace();if(null==t)return;l=t.coords[0],r=t.coords[1]}const n=l*this._pixelsPerMapUnit,c=r*this._pixelsPerMapUnit,p=Math.floor(n/this._options.cellSize),a=Math.floor(c/this._options.cellSize);this._getCellOrCreate(p,a).insert(e,t,l,r)}_getCellOrCreate(e,t){const i=s.createId(e,t);let o=this._cells.get(i);if(!o){const l=1*this._options.cellSize/this._pixelsPerMapUnit;o=s.create(e,t,this._options.fields,l),this._cells.set(i,o)}return o}}export{r as GridSpatialIndex,l as pixelsPerMapUnit};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as s,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(s){const o=this.layer,a=o.parent,l=t(a),{capabilities:n,editingInfo:d,objectIdField:p,globalIdField:c,datesInUnknownTimezone:m,orderBy:y,subtypeField:f,parsedUrl:u}=a,b=a.fieldsIndex.toJSON(),g=i(o),h=a.timeInfo?.toJSON(),I=o.spatialReference.toJSON(),S=e(u);let j=p;if(y?.length){const e=!y[0].valueExpression&&y[0].field;e&&(j=e)}return{type:"feature-service",source:S,isSourceHosted:r(S.path),orderByFields:j,metadata:{timeReferenceUnknownClient:m,subtypeField:f,globalIdField:c,fieldsIndex:b,geometryType:g,objectIdField:p,timeInfo:h,spatialReference:I,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:l,lastEditDate:d?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i,customParameters:s,timeExtent:o,apiKey:l}=this.layer.parent;return a(e,{definitionExpression:i,customParameters:s,timeExtent:o},r,t,l)}createProcessorSchema(e,r,t){const{parent:{fields:i,geometryType:s,orderBy:o,objectIdField:a},renderer:n,labelingInfo:d,labelsVisible:p}=this.layer,c={featureReduction:null,fields:i.map((e=>e.toJSON())),geometryType:s,labelingInfo:d,labelsVisible:p,objectIdField:a,orderBy:o??"default",renderer:n?.clone()};return l(e,r,c,t)}get hasRequiredSupport(){return n(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{parent:t,parent:{definitionExpression:i,apiKey:s},renderer:o}=r,a=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:s,customParameters:JSON.stringify(t.customParameters),definitionExpression:i,labelingInfo:a,orderBy:JSON.stringify(t.orderBy),renderer:o}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}}export{d as CatalogFootprintLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveLayerCapabilities as t}from"../../../../../layers/support/layerUtils.js";import{getEffectiveGeometryType as i}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as s,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(s){const o=this.layer,n=o.parent,a=t(n),{capabilities:l,editingInfo:d,objectIdField:p,globalIdField:c,datesInUnknownTimezone:m,orderBy:y,subtypeField:f,parsedUrl:u}=n,b=n.fieldsIndex.toJSON(),g=i(o),h=n.timeInfo?.toJSON(),I=o.spatialReference.toJSON(),S=e(u);let j=p;if(y?.length){const e=!y[0].valueExpression&&y[0].field;e&&(j=e)}return{type:"feature-service",source:S,isSourceHosted:r(S.path),orderByFields:j,metadata:{timeReferenceUnknownClient:m,subtypeField:f,globalIdField:c,fieldsIndex:b,geometryType:g,objectIdField:p,timeInfo:h,spatialReference:I,subtypes:null,typeIdField:null,types:null,timeZone:s.timeZone},queryMetadata:{capabilities:l,effectiveCapabilities:a,lastEditDate:d?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,r,t){const{definitionExpression:i,customParameters:s,timeExtent:o,apiKey:a}=this.layer.parent;return n(e,{definitionExpression:i,customParameters:s,timeExtent:o},r,t,a)}createProcessorSchema(e,r,t){const{parent:{fields:i,geometryType:s,orderBy:o,objectIdField:n},renderer:l,labelingInfo:d,labelsVisible:p}=this.layer,c={featureReduction:null,fields:i.map((e=>e.toJSON())),geometryType:s,labelingInfo:d,labelsVisible:p,objectIdField:n,orderBy:o??"default",renderer:l?.clone()};return a(e,r,c,t)}get hasRequiredSupport(){return l(this.layer.renderer)}getUpdateHashProperties(e){const r=this.layer,{parent:t,parent:{definitionExpression:i,apiKey:s},renderer:o}=r,n=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:s,customParameters:JSON.stringify(t.customParameters),definitionExpression:i,labelingInfo:n,orderBy:JSON.stringify(t.orderBy),renderer:o}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}}export{d as CatalogFootprintLayerAdapter};