@arcgis/core 5.2.0-next.36 → 5.2.0-next.38

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 (288) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02b043a3c5fa8bcb4c5b.js +1 -0
  3. package/assets/esri/core/workers/chunks/{acbc14395c31f6da509e.js → 03437a8ef35c200dbf17.js} +1 -1
  4. package/assets/esri/core/workers/chunks/034dd8ee5152a12412cd.js +1 -0
  5. package/assets/esri/core/workers/chunks/{29542a3d7f3fa8d42380.js → 0603cbd938ab619c706b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0a6e03263ab0906d8bcf.js +1 -0
  7. package/assets/esri/core/workers/chunks/0edd250159ec259601b3.js +1 -0
  8. package/assets/esri/core/workers/chunks/{401ee7fa500adad77db1.js → 1079914101d69a40b3eb.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{c72121076e438ed28d60.js → 1599dc5309a4e60017ce.js} +2 -2
  10. package/assets/esri/core/workers/chunks/181e98399732f425305d.js +1 -0
  11. package/assets/esri/core/workers/chunks/{47d88e1b003c4519b7b6.js → 18f4b2099299942aaf97.js} +1 -1
  12. package/assets/esri/core/workers/chunks/196e7515a43bd0026f49.js +1 -0
  13. package/assets/esri/core/workers/chunks/1aa7496a7dc95aae11ac.js +1 -0
  14. package/assets/esri/core/workers/chunks/{c2a02c33462bcdabd39d.js → 1c263ffb7144e171a64f.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1d524690c4b66289bd20.js +1 -0
  16. package/assets/esri/core/workers/chunks/{f72f38e7609756a7f8ea.js → 20fa2c3d4360afa5e136.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{03350a56f840cffe5459.js → 2757c4bf0280e27f3484.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{93ceb74ac88ef460fe5f.js → 278409028bc5af45b507.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{afaf6874a645854c3357.js → 294537e1ac43e8dfeaea.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{2c61bb25578f73ba49bc.js → 29a1d0659bbc5a039864.js} +1 -1
  21. package/assets/esri/core/workers/chunks/29df3f829006719b2680.js +1 -0
  22. package/assets/esri/core/workers/chunks/{2c00f89030c7a4201033.js → 2a344bca6837ca3b5c41.js} +2 -2
  23. package/assets/esri/core/workers/chunks/30cf84a47ebefd180bb7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{71a593fa116770e58832.js → 37a95f097533bad1b338.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7335a762412bc8c15a2f.js → 37e823202424c11076cb.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{ee446250a40e5d89bb5a.js → 3a76fffa2016c16d7989.js} +3 -3
  27. package/assets/esri/core/workers/chunks/{58ce4bcfb15f378b1b9f.js → 3d6d2b42ba2ad7086d5d.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3ec91474658eae87b832.js +1 -0
  29. package/assets/esri/core/workers/chunks/448e0596005cba9a4225.js +1 -0
  30. package/assets/esri/core/workers/chunks/{f148666308071bdb185a.js → 45530a49fa1f09d1682e.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{155940ef3d1888272d73.js → 459e89d1b94a3b204d20.js} +2 -2
  32. package/assets/esri/core/workers/chunks/{f71f5778e03f68f27482.js → 45b2e58051f42ebd236e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/4611cf051c3c396fdf96.js +1 -0
  34. package/assets/esri/core/workers/chunks/{efaa1d05705f6b450e8f.js → 46e3d33e44e5398221e2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{866950e9ab96aebc6b32.js → 4a8201e09bc3ad5cc00b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{110135b0562a3b5708b9.js → 4abe820bbe4f7ffccc09.js} +1 -1
  37. package/assets/esri/core/workers/chunks/4ad86d6b1be07c97b6f6.js +1 -0
  38. package/assets/esri/core/workers/chunks/{20ffeb09bb30400de110.js → 4e28f49d0be20ea50fd7.js} +1 -1
  39. package/assets/esri/core/workers/chunks/4f25aac84d9eb10cac83.js +1 -0
  40. package/assets/esri/core/workers/chunks/{0197e459fdb04dfb28ef.js → 51838d55d8ec4ce70398.js} +1 -1
  41. package/assets/esri/core/workers/chunks/542d8a6c415098b9857c.js +1 -0
  42. package/assets/esri/core/workers/chunks/57abf838fcff0f0e2c5e.js +1 -0
  43. package/assets/esri/core/workers/chunks/57dd017fed2943d24e3d.js +1 -0
  44. package/assets/esri/core/workers/chunks/59801b2ccaaf4b394e02.js +1 -0
  45. package/assets/esri/core/workers/chunks/{add79af151e3eb560599.js → 5a2d2dcdfa8d958f277d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5a62c9f64db4fcae5e52.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e84c13ac59e5381b77e2.js → 5aebecb5c2b3e7887127.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{c19fe4f31e4ef84bbcf6.js → 5e68b74fd548c7cdba36.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{9dcb2cbf89dcb7558432.js → 5f360492560ae07083a6.js} +1 -1
  50. package/assets/esri/core/workers/chunks/6022f43ebd58e21c737a.js +1 -0
  51. package/assets/esri/core/workers/chunks/62b137a795e487fa06a1.js +1 -0
  52. package/assets/esri/core/workers/chunks/{007485862ce95928717a.js → 632de34ebd2f44b4423d.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{1ad5fcae6d6a9801cf58.js → 63ca17f569407c89bde1.js} +2 -2
  54. package/assets/esri/core/workers/chunks/6896a6dd36fa91a27151.js +1 -0
  55. package/assets/esri/core/workers/chunks/{e6263e1983e703befe48.js → 68bc674affe2f7269c40.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{759686b896f51f0fe6a9.js → 6a51499c6623ddce5f00.js} +1 -1
  57. package/assets/esri/core/workers/chunks/6cdf1db30793133294dd.js +1 -0
  58. package/assets/esri/core/workers/chunks/{b0e4af49fc968b0a910f.js → 6ff6783f89ecd3a5e752.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{857532de88f21e8c3466.js → 70763c7b68d8abe8d5fe.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{e67a9f9298d63026e7f6.js → 716b1f073e3cd807abd3.js} +1 -1
  61. package/assets/esri/core/workers/chunks/71a3f05cb86ae2920f8d.js +1 -0
  62. package/assets/esri/core/workers/chunks/723bb56de2324b41df4e.js +1 -0
  63. package/assets/esri/core/workers/chunks/73f61107cb7e6d30bf03.js +1 -0
  64. package/assets/esri/core/workers/chunks/752c34cee981862add89.js +1 -0
  65. package/assets/esri/core/workers/chunks/760dfd585b6c2c1937ce.js +1 -0
  66. package/assets/esri/core/workers/chunks/{595401947e74a0a67144.js → 76449e50222111ba0eb1.js} +1 -1
  67. package/assets/esri/core/workers/chunks/76bed5497f42f23a27ed.js +1 -0
  68. package/assets/esri/core/workers/chunks/832ecc1f7d45774c4726.js +1 -0
  69. package/assets/esri/core/workers/chunks/860a0f9d20f53db1caf4.js +1 -0
  70. package/assets/esri/core/workers/chunks/867e39bb444947c93586.js +1 -0
  71. package/assets/esri/core/workers/chunks/{4f08b69f4a33a114c5f7.js → 8a66a3e8391206f7d8aa.js} +1 -1
  72. package/assets/esri/core/workers/chunks/8a8b7ac6693bdfbebf07.js +1 -0
  73. package/assets/esri/core/workers/chunks/{cda2bae39135e5519d8c.js → 8e80441eddef1b5be8b9.js} +1 -1
  74. package/assets/esri/core/workers/chunks/8fce15ce4cfdccf407f3.js +1 -0
  75. package/assets/esri/core/workers/chunks/{5260f623438bd84f2caa.js → 937cf55b3b9d324eea73.js} +1 -1
  76. package/assets/esri/core/workers/chunks/93df864c2e829f0fd5ce.js +1 -0
  77. package/assets/esri/core/workers/chunks/{7b5e628ea3d4a51f1c4e.js → 966d002acec8c72be56a.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{367a3031abbeff0c0090.js → 9aef0b87f471626abd66.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{f1d211904d5a1de93cb3.js → 9ba9a3705623679bc305.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{aec82b94787821153d2b.js → a188d0767825d322f96d.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a638de0102c3990403d1.js +1 -0
  82. package/assets/esri/core/workers/chunks/{828b64624c76156a6416.js → a6bda5f17fb1c03f7e4b.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{050aba7089318e1c7d53.js → b022debf9e0bc2bff0e2.js} +1 -1
  84. package/assets/esri/core/workers/chunks/b09935d0105d50a0971b.js +1 -0
  85. package/assets/esri/core/workers/chunks/b12fc1b5a9da97346684.js +1 -0
  86. package/assets/esri/core/workers/chunks/b2c0262c4a76b8a86200.js +1 -0
  87. package/assets/esri/core/workers/chunks/{599bd80379423c99799d.js → b4323e69e624c6b51754.js} +1 -1
  88. package/assets/esri/core/workers/chunks/b5141f240ca79729686d.js +1 -0
  89. package/assets/esri/core/workers/chunks/b549a4d4b1a34bee8beb.js +1 -0
  90. package/assets/esri/core/workers/chunks/bb89b6fd93513c61b2d3.js +1 -0
  91. package/assets/esri/core/workers/chunks/{3bd32387af52fa48d747.js → bc553ecc8cbcc1b02717.js} +1 -1
  92. package/assets/esri/core/workers/chunks/bcba02f61cf0abcb5600.js +1 -0
  93. package/assets/esri/core/workers/chunks/{f63e7b01c70352538b1e.js → bd0f488e228a75fbefb3.js} +2 -2
  94. package/assets/esri/core/workers/chunks/c48dfda8dcb9551606fb.js +1 -0
  95. package/assets/esri/core/workers/chunks/c4e44fde4bc4ff89e2bc.js +1 -0
  96. package/assets/esri/core/workers/chunks/c93a68618674b38b932e.js +1 -0
  97. package/assets/esri/core/workers/chunks/d2745886ba5a86fd5c4c.js +680 -0
  98. package/assets/esri/core/workers/chunks/d4c341b15d9244276fb9.js +1 -0
  99. package/assets/esri/core/workers/chunks/d5faab9799891e5da5a8.js +1 -0
  100. package/assets/esri/core/workers/chunks/d811924acc9c0be95bba.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4b96aa2dc5b88846bb53.js → e0a4d0288abd334b0673.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{b22a1c98271c2e4d8808.js → e1ddb8e4977b317fd40c.js} +1 -1
  103. package/assets/esri/core/workers/chunks/e961c6140c39921816a8.js +1 -0
  104. package/assets/esri/core/workers/chunks/eb7daa0f6610983ff8db.js +1 -0
  105. package/assets/esri/core/workers/chunks/eb842cf470ce28a73187.js +1 -0
  106. package/assets/esri/core/workers/chunks/ed1d4ebf487c7dcd5c33.js +1 -0
  107. package/assets/esri/core/workers/chunks/f80cadcc2a588da63b38.js +1 -0
  108. package/assets/esri/core/workers/chunks/f8bbb52b865a0a242140.js +1 -0
  109. package/assets/esri/core/workers/chunks/f9592bcdd9988199a7ea.js +1 -0
  110. package/assets/esri/core/workers/chunks/ff7e1eb2366d4301d288.js +1 -0
  111. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  112. package/chunks/NavigationDepth.glsl.js +18 -0
  113. package/chunks/Path.glsl.js +20 -16
  114. package/config.js +1 -1
  115. package/core/accessorSupport/diffUtils.js +1 -1
  116. package/geometry/FlatGeometry.js +1 -1
  117. package/geometry/support/Indices.js +1 -1
  118. package/geometry/support/ShortArray.js +1 -1
  119. package/geometry/support/UintArray.js +1 -1
  120. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  121. package/kernel.js +1 -1
  122. package/layers/mixins/PublishableLayer.js +1 -1
  123. package/layers/mixins/RefreshableLayer.js +1 -1
  124. package/layers/raster/functions/pixelUtils.js +1 -1
  125. package/layers/support/kustoUtils.js +1 -1
  126. package/package.json +2 -2
  127. package/popup/Feature.js +1 -1
  128. package/portal/support/resourceUtils.js +1 -1
  129. package/renderers/support/rasterTypeUtils.js +1 -1
  130. package/rest/query/operations/pbfFeatureSetUtils.js +1 -1
  131. package/support/revision.js +1 -1
  132. package/symbols/cim/utils.js +1 -1
  133. package/tables/support/tablesUtils.js +1 -1
  134. package/views/2d/engine/flow/utils.js +1 -1
  135. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js +1 -1
  140. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  141. package/views/2d/layers/features/layerAdapters/labelingUtils.js +1 -1
  142. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  143. package/views/2d/layers/support/annodime/utils.js +1 -1
  144. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  145. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  146. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  147. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  148. package/views/3d/layers/Lyr3DWasm.js +1 -1
  149. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  150. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  151. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  152. package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
  153. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  154. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  155. package/views/3d/state/utils/navigationUtils.js +1 -1
  156. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  157. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  158. package/views/3d/support/orientedBoundingBox.js +1 -1
  159. package/views/3d/terrain/terrainUtils.js +1 -1
  160. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  161. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  162. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +32 -16
  163. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
  164. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
  165. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  166. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  167. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  168. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  169. package/views/3d/webgl-engine/lib/NavigationDepthCache.js +2 -0
  170. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  171. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  172. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  173. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  174. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  175. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  176. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  177. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  178. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  179. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  180. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  181. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  182. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  183. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  184. package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +2 -0
  185. package/views/3d/webgl-engine/shaders/NavigationDepthTechnique.js +2 -0
  186. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  187. package/views/SelectionManager.js +1 -1
  188. package/views/draw/support/Reshape.js +1 -1
  189. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  190. package/views/support/selectionUtils.js +1 -1
  191. package/views/webgl/BufferObject.js +1 -1
  192. package/views/webgl/FramebufferObject.js +1 -1
  193. package/views/webgl/RenderingContext.js +1 -1
  194. package/views/webgl/VertexAttributeLayouts.js +1 -1
  195. package/webscene/spec-certification/utils.js +1 -1
  196. package/widgets/Editor/legacy/workflowUtils.js +1 -1
  197. package/widgets/Editor/workflowUtils.js +1 -1
  198. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  199. package/widgets/OrientedImageryViewer/navigation/errors.js +1 -1
  200. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  201. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  202. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  203. package/widgets/OrientedImageryViewer/utils.js +1 -1
  204. package/widgets/OrientedImageryViewer.js +1 -1
  205. package/widgets/PanoramicViewer/constants.js +1 -1
  206. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  207. package/widgets/PanoramicViewer/utils.js +1 -1
  208. package/widgets/support/dateUtils.js +1 -1
  209. package/assets/esri/core/workers/chunks/0a2f08298a3c932614f2.js +0 -1
  210. package/assets/esri/core/workers/chunks/0df978697328b6453c94.js +0 -1
  211. package/assets/esri/core/workers/chunks/168c15cf462f9abcbdd2.js +0 -1
  212. package/assets/esri/core/workers/chunks/22c447fcc9a28afeb6e3.js +0 -1
  213. package/assets/esri/core/workers/chunks/24aa98cb2021ddd789ce.js +0 -1
  214. package/assets/esri/core/workers/chunks/2509da565e5a2b43ac7f.js +0 -1
  215. package/assets/esri/core/workers/chunks/256cc116e3be4feee593.js +0 -1
  216. package/assets/esri/core/workers/chunks/2bb3494659609594c4ca.js +0 -1
  217. package/assets/esri/core/workers/chunks/2c017eae434254610c8e.js +0 -1
  218. package/assets/esri/core/workers/chunks/303e723e829ea7088d43.js +0 -1
  219. package/assets/esri/core/workers/chunks/368db1420b8520beae05.js +0 -1
  220. package/assets/esri/core/workers/chunks/38a6a7c56c592f336a12.js +0 -1
  221. package/assets/esri/core/workers/chunks/39ff5b2a05a90e1cb214.js +0 -1
  222. package/assets/esri/core/workers/chunks/3b914ca36e7e2b00cfe6.js +0 -1
  223. package/assets/esri/core/workers/chunks/3e8fa2a7a36881234479.js +0 -1
  224. package/assets/esri/core/workers/chunks/451331f69d21c61ec93b.js +0 -1
  225. package/assets/esri/core/workers/chunks/4656a4bf430d7eed1465.js +0 -1
  226. package/assets/esri/core/workers/chunks/472ec242cd3070e6acfe.js +0 -1
  227. package/assets/esri/core/workers/chunks/51d7145f748b4865de7f.js +0 -1
  228. package/assets/esri/core/workers/chunks/54f54623532f633dc0e2.js +0 -1
  229. package/assets/esri/core/workers/chunks/570a4725b2a4a19c5148.js +0 -1
  230. package/assets/esri/core/workers/chunks/586ca90e46f5cbdfeece.js +0 -1
  231. package/assets/esri/core/workers/chunks/59c22bab85f9cdbb9948.js +0 -1
  232. package/assets/esri/core/workers/chunks/5dfeefee96659832398a.js +0 -1
  233. package/assets/esri/core/workers/chunks/6c746ac4bd2e57b8cb41.js +0 -1
  234. package/assets/esri/core/workers/chunks/6d72a1bdc2664df62c4c.js +0 -1
  235. package/assets/esri/core/workers/chunks/7085b4c655a19694da04.js +0 -1
  236. package/assets/esri/core/workers/chunks/777b16b76db406c99c69.js +0 -1
  237. package/assets/esri/core/workers/chunks/818a481ce579f519de1c.js +0 -1
  238. package/assets/esri/core/workers/chunks/85a280ee915010a8da3c.js +0 -1
  239. package/assets/esri/core/workers/chunks/86731e276b31453bc235.js +0 -1
  240. package/assets/esri/core/workers/chunks/87b86375f8557418dbe6.js +0 -1
  241. package/assets/esri/core/workers/chunks/8817d25c7f4cf0e6c6bd.js +0 -1
  242. package/assets/esri/core/workers/chunks/8a9b2efa0603e9fa4e8b.js +0 -1
  243. package/assets/esri/core/workers/chunks/8aa5bbf9a9b09815725a.js +0 -1
  244. package/assets/esri/core/workers/chunks/8b68a69ab8fb1679e7b2.js +0 -1
  245. package/assets/esri/core/workers/chunks/98685bd149dee1d6dc99.js +0 -1
  246. package/assets/esri/core/workers/chunks/9de673a04c70bd47047e.js +0 -1
  247. package/assets/esri/core/workers/chunks/9de9cec5c644bc452294.js +0 -1
  248. package/assets/esri/core/workers/chunks/9fb0431b0628dcb53004.js +0 -680
  249. package/assets/esri/core/workers/chunks/a2a688dd2ed4565e01ff.js +0 -1
  250. package/assets/esri/core/workers/chunks/a3ae7c41832c7a8b0570.js +0 -1
  251. package/assets/esri/core/workers/chunks/a3e86830460e52706a4d.js +0 -1
  252. package/assets/esri/core/workers/chunks/a58b8903ae17acf117d6.js +0 -1
  253. package/assets/esri/core/workers/chunks/a99ce2f12c8204ee542a.js +0 -1
  254. package/assets/esri/core/workers/chunks/ab3d1c00ef514b61ce0b.js +0 -1
  255. package/assets/esri/core/workers/chunks/ae5363956b4467208e04.js +0 -1
  256. package/assets/esri/core/workers/chunks/b24b7411a73d1da87c30.js +0 -1
  257. package/assets/esri/core/workers/chunks/b97b83159fec34f383af.js +0 -1
  258. package/assets/esri/core/workers/chunks/bec660ee2e7828f965e2.js +0 -1
  259. package/assets/esri/core/workers/chunks/c7316fd2bdb7ac9eada3.js +0 -1
  260. package/assets/esri/core/workers/chunks/ca7d4d76a6bf5a3046cd.js +0 -1
  261. package/assets/esri/core/workers/chunks/cffef41791f0cfa6c26c.js +0 -1
  262. package/assets/esri/core/workers/chunks/d26b1a9f47b4b2744c89.js +0 -1
  263. package/assets/esri/core/workers/chunks/d4a96f0402172787823a.js +0 -1
  264. package/assets/esri/core/workers/chunks/d9fcc63df008f687848a.js +0 -1
  265. package/assets/esri/core/workers/chunks/e3a4695c31d3f9d55213.js +0 -1
  266. package/assets/esri/core/workers/chunks/e65d291bab13f7f5323b.js +0 -1
  267. package/assets/esri/core/workers/chunks/eeee7421f64a52074ff4.js +0 -1
  268. package/assets/esri/core/workers/chunks/eef7e0bee19c4258ba55.js +0 -1
  269. package/assets/esri/core/workers/chunks/efaf998d18479a0380ae.js +0 -1
  270. package/assets/esri/core/workers/chunks/f0573db9a3d3e1499a7e.js +0 -1
  271. package/assets/esri/core/workers/chunks/f07722efd7fa2b75d4dd.js +0 -1
  272. package/assets/esri/core/workers/chunks/f137e544076482e348ad.js +0 -1
  273. package/assets/esri/core/workers/chunks/fd53ef66176ae164e221.js +0 -1
  274. package/assets/esri/core/workers/chunks/fd956a58787020d610af.js +0 -1
  275. package/rest/sharedTemplates/addSharedTemplates.js +0 -2
  276. package/support/featureFlags.js +0 -2
  277. package/views/2d/engine/webgl/ClippingInfo.js +0 -2
  278. package/views/2d/engine/webgl/Mesh2D.js +0 -2
  279. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +0 -2
  280. package/views/2d/layers/features/ProcessorTileMessageQueue.js +0 -2
  281. package/views/3d/support/AsyncWorkerQueue.js +0 -2
  282. package/views/3d/webgl-engine/lib/PathGeometryData.js +0 -2
  283. package/widgets/BatchAttributeForm/templates/support/contingentValuesUtils.js +0 -2
  284. package/widgets/OrientedImageryViewer/components/NavigationAction.js +0 -2
  285. package/widgets/OrientedImageryViewer/components/NavigationActions.js +0 -2
  286. package/widgets/OrientedImageryViewer/support/NonPanoramicMediaCollection.js +0 -2
  287. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +0 -2
  288. /package/assets/esri/core/workers/chunks/{2c00f89030c7a4201033.js.LICENSE.txt → 2a344bca6837ca3b5c41.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createScreenPointArray as t,createRenderScreenPointArray3 as n}from"../../../../core/screenUtils.js";import{transformMat4 as r,copy as e,distance as o,set as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as s,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as u,expandPointInPlace as f,clone as a,intersects as p,containsPoint as l,create as m,fromValues as h}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as d,create as g,distance2 as M}from"../../../../geometry/support/lineSegment.js";import{signedDistance as b,intersectLineSegment as j}from"../../../../geometry/support/plane.js";import{containsPoint2dFromValues as x}from"../../../../geometry/support/triangle.js";class I{constructor(t,n,r){this.bounds=t,this.nearestDistance=n,this.nearestPoint=r}}function N(t,n){return t.isRectangle?l(t.bounds,n):O(n,t.points)}function T(t,n){if(!p(t.bounds,n))return!1;if(t.isRectangle)return!0;for(const r of t.points)if(l(n,r))return!0;for(let r=0;r<4;r++)if(O(k(z,n,r),t.points))return!0;for(let r=0;r<t.points.length;r++){const e=t.points[r],o=r===t.points.length-1?t.points[0]:t.points[r+1];for(let t=0;t<4;t++){if(V(e,o,k(z,n,t),k(A,n,(t+1)%4)))return!0}}return!1}function S(t,n,r,e){const o=Math.min(n[0],r[0],e[0]),i=Math.min(n[1],r[1],e[1]),s=Math.max(n[0],r[0],e[0]),c=Math.max(n[1],r[1],e[1]);if(!T(t,h(o,i,s,c,q)))return!1;if(N(t,n)||N(t,r)||N(t,e))return!0;for(const u of t.points)if(x(n,r,e,u,nt))return!0;for(let u=0;u<t.points.length;u++){const o=t.points[u],i=t.points[(u+1)%t.points.length];if(V(n,r,o,i)||V(r,e,o,i)||V(e,n,o,i))return!0}return!1}function R(t,n,r,e){const o=Math.min(n[0],r[0])-e,i=Math.min(n[1],r[1])-e,s=Math.max(n[0],r[0])+e,c=Math.max(n[1],r[1])+e;if(!p(t.bounds,h(o,i,s,c,q)))return!1;if(N(t,n)||N(t,r))return!0;const u=e*e;for(const f of t.points)if(B(f,n,r)<=u)return!0;for(let f=0;f<t.points.length;f++){const e=t.points[f],o=t.points[(f+1)%t.points.length];if(V(n,r,e,o)||Y(n,r,e,o)<=u)return!0}return!1}function y(t,n,r){return _(t,n.bbMin,n.bbMax,r)}function _(t,n,o,i){const c=u(q);tt.reset(t.eye);let p=0;for(let s=0;s<2;s++)for(let u=0;u<2;u++)for(let a=0;a<2;a++)J[0]=0===s?n[0]:o[0],J[1]=0===u?n[1]:o[1],J[2]=0===a?n[2]:o[2],i&&r(J,J,i),e(X[p++],J),F(t,J)||(t.projectToScreen(J,z),f(c,z),tt.addNearestCandidate(J));return v(t,c,X,tt),tt.valid?new I(a(c),tt.distance,s(tt.point)):null}function v(t,n,r,e){for(let o=0;o<r.length;o++)for(const i of Z){const s=o|i;if(s===o)continue;E(t,r[o],r[s],K)&&(t.projectToScreen(K,z),f(n,z),e.addNearestCandidate(K))}}function C(t,n,r,o,i){e(K,n),e(L,r);const s=t.projectToRenderScreen(K,G),c=t.projectToRenderScreen(L,H);if(null==s||null==c)return!1;const u=F(t,K),f=F(t,L);if(u&&f)return!1;if(u!==f){const n=u?K:L,r=u?s:c;if(!w(t,n,u?L:K))return!1;if(!t.projectToRenderScreen(n,r))return!1}return o[0]=s[0],o[1]=s[1],o[2]=0,i[0]=c[0],i[1]=c[1],i[2]=0,!0}function F(t,n){return P(t,n)>0}function P(t,n){return b(t.frustum[4],n)}function w(t,n,r){return E(t,n,r,n)}function E(t,n,r,e){return j(t.frustum[4],d(n,r,W),e)}function O(t,n){let r=!1;for(let e=0,o=n.length-1;e<n.length;o=e++){const i=n[e],s=n[o];if(!(i[1]>t[1]!=s[1]>t[1]))continue;const c=(s[0]-i[0])*(t[1]-i[1])/(s[1]-i[1])+i[0];t[0]<c&&(r=!r)}return r}function V(t,n,r,e){const o=D(t,n,r),i=D(t,n,e),s=D(r,e,t),c=D(r,e,n);return o!==i&&s!==c||(0===o&&U(t,n,r)||0===i&&U(t,n,e)||0===s&&U(r,e,t)||0===c&&U(r,e,n))}function Y(t,n,r,e){return V(t,n,r,e)?0:Math.min(B(t,r,e),B(n,r,e),B(r,t,n),B(e,t,n))}function B(t,n,r){return M(d(i(K,n[0],n[1],0),i(L,r[0],r[1],0),W),i(Q,t[0],t[1],0))}function D(t,n,r){const e=(n[1]-t[1])*(r[0]-n[0])-(n[0]-t[0])*(r[1]-n[1]);return Math.abs(e)<=nt?0:Math.sign(e)}function U(t,n,r){return r[0]>=Math.min(t[0],n[0])-nt&&r[0]<=Math.max(t[0],n[0])+nt&&r[1]>=Math.min(t[1],n[1])-nt&&r[1]<=Math.max(t[1],n[1])+nt}function k(t,n,r){return t[0]=0===r||3===r?n[0]:n[2],t[1]=r<2?n[1]:n[3],t}const q=m(),z=t(),A=t(),G=n(),H=n(),J=c(),K=c(),L=c(),Q=c(),W=g(),X=[c(),c(),c(),c(),c(),c(),c(),c()],Z=[1,2,4];class ${constructor(){this._origin=c(),this.point=c(),this.distance=Number.POSITIVE_INFINITY}get valid(){return Number.isFinite(this.distance)}addNearestCandidate(t){const n=o(this._origin,t);n<this.distance&&(this.distance=n,e(this.point,t))}reset(t){this.distance=Number.POSITIVE_INFINITY,e(this._origin,t)}}const tt=new $,nt=1e-9;export{I as ProjectedScreenBounds,F as isBehindNearPlane,_ as projectAabbToScreenBounds,y as projectBoundingInfoToScreenBounds,C as projectWorldLineSegmentToRenderScreen,N as screenPolygonContainsPoint,T as screenPolygonIntersectsBounds,R as screenPolygonIntersectsBufferedSegment,S as screenPolygonIntersectsTriangle};
2
+ import{createScreenPointArray as t,createRenderScreenPointArray3 as n}from"../../../../core/screenUtils.js";import{transformMat4 as r,copy as e,distance as o,set as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as s,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as c,expandPointInPlace as f,clone as a,intersects as p,containsPoint as l,create as h,fromValues as m}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as d,create as g,distance2 as M}from"../../../../geometry/support/lineSegment.js";import{signedDistance as b,intersectLineSegment as j}from"../../../../geometry/support/plane.js";import{containsPoint2dFromValues as x}from"../../../../geometry/support/triangle.js";class I{constructor(t,n,r){this.bounds=t,this.nearestDistance=n,this.nearestPoint=r}}function N(t,n){return t.isRectangle?l(t.bounds,n):V(n,t.points)}function T(t,n,r){const e=n[0]-r,o=n[1]-r,i=n[0]+r,s=n[1]+r;if(!p(t.bounds,m(e,o,i,s,z)))return!1;if(N(t,n))return!0;const u=r*r;for(const c of t.points){const t=c[0]-n[0],r=c[1]-n[1];if(t*t+r*r<=u)return!0}for(let c=0;c<t.points.length;c++){if(D(n,t.points[c],t.points[(c+1)%t.points.length])<=u)return!0}return!1}function S(t,n){if(!p(t.bounds,n))return!1;if(t.isRectangle)return!0;for(const r of t.points)if(l(n,r))return!0;for(let r=0;r<4;r++)if(V(q(A,n,r),t.points))return!0;for(let r=0;r<t.points.length;r++){const e=t.points[r],o=r===t.points.length-1?t.points[0]:t.points[r+1];for(let t=0;t<4;t++){if(Y(e,o,q(A,n,t),q(G,n,(t+1)%4)))return!0}}return!1}function R(t,n,r,e){const o=Math.min(n[0],r[0],e[0]),i=Math.min(n[1],r[1],e[1]),s=Math.max(n[0],r[0],e[0]),u=Math.max(n[1],r[1],e[1]);if(!S(t,m(o,i,s,u,z)))return!1;if(N(t,n)||N(t,r)||N(t,e))return!0;for(const c of t.points)if(x(n,r,e,c,rt))return!0;for(let c=0;c<t.points.length;c++){const o=t.points[c],i=t.points[(c+1)%t.points.length];if(Y(n,r,o,i)||Y(r,e,o,i)||Y(e,n,o,i))return!0}return!1}function y(t,n,r,e){const o=Math.min(n[0],r[0])-e,i=Math.min(n[1],r[1])-e,s=Math.max(n[0],r[0])+e,u=Math.max(n[1],r[1])+e;if(!p(t.bounds,m(o,i,s,u,z)))return!1;if(N(t,n)||N(t,r))return!0;const c=e*e;for(const f of t.points)if(D(f,n,r)<=c)return!0;for(let f=0;f<t.points.length;f++){const e=t.points[f],o=t.points[(f+1)%t.points.length];if(Y(n,r,e,o)||B(n,r,e,o)<=c)return!0}return!1}function _(t,n,r){return v(t,n.bbMin,n.bbMax,r)}function v(t,n,o,i){const u=c(z);nt.reset(t.eye);let p=0;for(let s=0;s<2;s++)for(let c=0;c<2;c++)for(let a=0;a<2;a++)K[0]=0===s?n[0]:o[0],K[1]=0===c?n[1]:o[1],K[2]=0===a?n[2]:o[2],i&&r(K,K,i),e(Z[p++],K),P(t,K)||(t.projectToScreen(K,A),f(u,A),nt.addNearestCandidate(K));return C(t,u,Z,nt),nt.valid?new I(a(u),nt.distance,s(nt.point)):null}function C(t,n,r,e){for(let o=0;o<r.length;o++)for(const i of $){const s=o|i;if(s===o)continue;O(t,r[o],r[s],L)&&(t.projectToScreen(L,A),f(n,A),e.addNearestCandidate(L))}}function F(t,n,r,o,i){e(L,n),e(Q,r);const s=t.projectToRenderScreen(L,H),u=t.projectToRenderScreen(Q,J);if(null==s||null==u)return!1;const c=P(t,L),f=P(t,Q);if(c&&f)return!1;if(c!==f){const n=c?L:Q,r=c?s:u;if(!E(t,n,c?Q:L))return!1;if(!t.projectToRenderScreen(n,r))return!1}return o[0]=s[0],o[1]=s[1],o[2]=0,i[0]=u[0],i[1]=u[1],i[2]=0,!0}function P(t,n){return w(t,n)>0}function w(t,n){return b(t.frustum[4],n)}function E(t,n,r){return O(t,n,r,n)}function O(t,n,r,e){return j(t.frustum[4],d(n,r,X),e)}function V(t,n){let r=!1;for(let e=0,o=n.length-1;e<n.length;o=e++){const i=n[e],s=n[o];if(!(i[1]>t[1]!=s[1]>t[1]))continue;const u=(s[0]-i[0])*(t[1]-i[1])/(s[1]-i[1])+i[0];t[0]<u&&(r=!r)}return r}function Y(t,n,r,e){const o=U(t,n,r),i=U(t,n,e),s=U(r,e,t),u=U(r,e,n);return o!==i&&s!==u||(0===o&&k(t,n,r)||0===i&&k(t,n,e)||0===s&&k(r,e,t)||0===u&&k(r,e,n))}function B(t,n,r,e){return Y(t,n,r,e)?0:Math.min(D(t,r,e),D(n,r,e),D(r,t,n),D(e,t,n))}function D(t,n,r){return M(d(i(L,n[0],n[1],0),i(Q,r[0],r[1],0),X),i(W,t[0],t[1],0))}function U(t,n,r){const e=(n[1]-t[1])*(r[0]-n[0])-(n[0]-t[0])*(r[1]-n[1]);return Math.abs(e)<=rt?0:Math.sign(e)}function k(t,n,r){return r[0]>=Math.min(t[0],n[0])-rt&&r[0]<=Math.max(t[0],n[0])+rt&&r[1]>=Math.min(t[1],n[1])-rt&&r[1]<=Math.max(t[1],n[1])+rt}function q(t,n,r){return t[0]=0===r||3===r?n[0]:n[2],t[1]=r<2?n[1]:n[3],t}const z=h(),A=t(),G=t(),H=n(),J=n(),K=u(),L=u(),Q=u(),W=u(),X=g(),Z=[u(),u(),u(),u(),u(),u(),u(),u()],$=[1,2,4];class tt{constructor(){this._origin=u(),this.point=u(),this.distance=Number.POSITIVE_INFINITY}get valid(){return Number.isFinite(this.distance)}addNearestCandidate(t){const n=o(this._origin,t);n<this.distance&&(this.distance=n,e(this.point,t))}reset(t){this.distance=Number.POSITIVE_INFINITY,e(this._origin,t)}}const nt=new tt,rt=1e-9;export{I as ProjectedScreenBounds,P as isBehindNearPlane,v as projectAabbToScreenBounds,_ as projectBoundingInfoToScreenBounds,F as projectWorldLineSegmentToRenderScreen,N as screenPolygonContainsPoint,S as screenPolygonIntersectsBounds,y as screenPolygonIntersectsBufferedSegment,T as screenPolygonIntersectsCircle,R as screenPolygonIntersectsTriangle};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{copy as e,set as n,transformMat4 as o,distance as r,squaredDistance as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as l,setMax as a,getMax as u,getMin as c,create as f}from"../../../../geometry/support/aaBoundingBox.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as p,closestPointFromValues as d}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as I}from"./intersectionConstants.js";import{projectAabbToScreenBounds as h,projectBoundingInfoToScreenBounds as g,screenPolygonIntersectsBounds as b,screenPolygonIntersectsTriangle as v}from"./screenPolygonOverlapUtils.js";class y{constructor(){this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=s(),this.normal=s()}reset(){this.distance=Number.POSITIVE_INFINITY}update(t,n,o,r){this.distance=t,this.primitiveIndex=n,e(this.point,o),this.hasNormal=null!=r,null!=r&&e(this.normal,r)}updateIfCloserFromValues(t,e,n,o){t<this.distance&&this.update(t,e,n,o)}updateIfCloser(t){const{distance:e,primitiveIndex:n,point:o,normal:r}=t;this.updateIfCloserFromValues(e,n,o,t.hasNormal?r:null)}get valid(){return Number.isFinite(this.distance)}}function N(t,e,n,o,r){if(!t.visible||0!==t.type)return null;const i=new y;let s;if(t.boundingInfo)s=x(t.boundingInfo,e,n,o,r);else{const i=t.positionAttribute,l=t.primitivePositionIndices;s=j(e,n,o,0,l.length/3,l,i.data,i.stride,r,null,0)}for(const l of s)i.updateIfCloser(l);return i.valid?i:null}function T(t,e,n,o,r,i,s,l,a){const u=new y;for(const c of j(t,e,n,o,r,i,s,l,a,null,0))u.updateIfCloser(c);return u.valid?u:null}function*j(t,e,n,o,i,s,l,a,u,c=null,f=0){if(null==t.camera)return;const{camera:d,screenPolygonPrimitiveProcessor:I}=t;for(let h=o;h<i;++h){const t=(c?.[h]??h)+f,o=null==c?t:h,i=3*t;C(O[0],s,l,a,i+0,u,o,e),C(O[1],s,l,a,i+1,u,o,e),C(O[2],s,l,a,i+2,u,o,e);const g=Y;let b;B.reset();for(const{list:e,count:s}of I.processTriangle(M,O)){const o=m(d.frustum[4],e,s,S,!1);if(!(o<3)){for(let t=0;t<o;t++)d.projectToScreen(S[t],w[t]);P(n,w,o)&&(F(d.eye,S,o,E),null==b&&(b=p(Y,O[0],O[1],O[2])),B.updateIfCloserFromValues(r(d.eye,E),t,E,b?g:null))}}B.valid&&(yield B)}}function*x(t,e,n,o,r){const i=e.camera,s=null!=r?(l(V,t.bbMin),a(V,t.bbMax),r.applyToAabb(V),h(i,c(V,O[0]),u(V,O[1]),n)):g(i,t,n);if(null==s||!b(o,s.bounds))return;const{primitiveIndices:f,position:m}=t,p=f?f.length:m.indices.length/3;if(p>I){const i=t.getChildren();if(void 0!==i){for(const t of i)yield*x(t,e,n,o,r);return}}yield*j(e,n,o,0,p,m.indices,m.data,m.stride,r,f,0)}function C(t,e,r,i,s,l,a,u){const c=i*e[s],f=r[c+0],m=r[c+1],p=r[c+2];null!=l?l.applyToVertex(t,f,m,p,a):n(t,f,m,p),u&&o(t,t,u)}function P(t,e,n){for(let o=1;o<n-1;o++)if(v(t,e[0],e[o],e[o+1]))return!0;return!1}function F(t,n,o,r){let s=Number.POSITIVE_INFINITY;for(let l=1;l<o-1;l++){d(_,t,n[0],n[l],n[l+1]);const o=i(t,_);o<s&&(s=o,e(r,_))}}const V=f(),A=12,O=[s(),s(),s()],S=Array.from({length:A},()=>s()),w=Array.from({length:A},()=>t()),E=s(),Y=s(),_=s(),B=new y,M={list:[],count:0};export{y as Hit,j as forEachTriangleRangeScreenPolygonHit,N as intersectTriangleGeometryScreenPolygon,T as intersectTriangleRangeScreenPolygon};
2
+ import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{copy as e,distance as n,squaredDistance as o,set as r,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as l,setMax as u,getMax as c,getMin as a,create as f}from"../../../../geometry/support/aaBoundingBox.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as p,closestPointFromValues as d}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as I}from"./intersectionConstants.js";import{projectAabbToScreenBounds as h,projectBoundingInfoToScreenBounds as g,screenPolygonIntersectsBounds as b,screenPolygonIntersectsTriangle as v}from"./screenPolygonOverlapUtils.js";class y{constructor(){this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=s(),this.normal=s()}reset(){this.distance=Number.POSITIVE_INFINITY}update(t,n,o,r){this.distance=t,this.primitiveIndex=n,e(this.point,o),this.hasNormal=null!=r,null!=r&&e(this.normal,r)}updateIfCloserFromValues(t,e,n,o){t<this.distance&&this.update(t,e,n,o)}updateIfCloser(t){const{distance:e,primitiveIndex:n,point:o,normal:r}=t;this.updateIfCloserFromValues(e,n,o,t.hasNormal?r:null)}get valid(){return Number.isFinite(this.distance)}}function N(t,e,n,o,r){if(!t.visible||0!==t.type)return null;const i=new y;let s;if(t.boundingInfo)s=P(t.boundingInfo,e,n,o,r);else{const i=t.positionAttribute,l=t.primitivePositionIndices;s=x(e,n,o,0,l.length/3,l,i.data,i.stride,r,null,0)}for(const l of s)i.updateIfCloser(l);return i.valid?i:null}function T(t,e,n,o,r,i,s,l,u){const c=new y;for(const a of x(t,e,n,o,r,i,s,l,u,null,0))c.updateIfCloser(a);return c.valid?c:null}function j(t,e,n,o,r){const i=new y;for(const s of C(t,e,n,o,r))i.updateIfCloser(s);return i.valid?i:null}function*x(t,e,n,o,r,i,s,l,u,c=null,a=0){const f=(t,n,o,r)=>{const f=(c?.[r]??r)+a,m=null==c?f:r,p=3*f;return F(t,i,s,l,p+0,u,m,e),F(n,i,s,l,p+1,u,m,e),F(o,i,s,l,p+2,u,m,e),f};return yield*C(t,n,o,r,f)}function*C(t,e,o,r,i){if(null==t.camera)return;const{camera:s,screenPolygonPrimitiveProcessor:l}=t;for(let u=o;u<r;++u){const t=i(S[0],S[1],S[2],u),o=B;let r;U.reset();for(const{list:i,count:u}of l.processTriangle(k,S)){const l=m(s.frustum[4],i,u,E,!1);if(!(l<3)){for(let t=0;t<l;t++)s.projectToScreen(E[t],Y[t]);V(e,Y,l)&&(w(s.eye,E,l,_),null==r&&(r=p(B,S[0],S[1],S[2])),U.updateIfCloserFromValues(n(s.eye,_),t,_,r?o:null))}}U.valid&&(yield U)}}function*P(t,e,n,o,r){const i=e.camera,s=null!=r?(l(A,t.bbMin),u(A,t.bbMax),r.applyToAabb(A),h(i,a(A,S[0]),c(A,S[1]),n)):g(i,t,n);if(null==s||!b(o,s.bounds))return;const{primitiveIndices:f,position:m}=t,p=f?f.length:m.indices.length/3;if(p>I){const i=t.getChildren();if(void 0!==i){for(const t of i)yield*P(t,e,n,o,r);return}}yield*x(e,n,o,0,p,m.indices,m.data,m.stride,r,f,0)}function F(t,e,n,o,s,l,u,c){const a=o*e[s],f=n[a+0],m=n[a+1],p=n[a+2];null!=l?l.applyToVertex(t,f,m,p,u):r(t,f,m,p),c&&i(t,t,c)}function V(t,e,n){for(let o=1;o<n-1;o++)if(v(t,e[0],e[o],e[o+1]))return!0;return!1}function w(t,n,r,i){let s=Number.POSITIVE_INFINITY;for(let l=1;l<r-1;l++){d(M,t,n[0],n[l],n[l+1]);const r=o(t,M);r<s&&(s=r,e(i,M))}}const A=f(),O=12,S=[s(),s(),s()],E=Array.from({length:O},()=>s()),Y=Array.from({length:O},()=>t()),_=s(),B=s(),M=s(),U=new y,k={list:[],count:0};export{y as Hit,x as forEachTriangleRangeScreenPolygonHit,C as forEachTriangleReaderRangeScreenPolygonHit,N as intersectTriangleGeometryScreenPolygon,T as intersectTriangleRangeScreenPolygon,j as intersectTriangleReaderRangeScreenPolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
2
+ import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(){const r=e().u32("pathVertexInfo",{integer:!0});return t()&&r.vec4u8("olidColor"),r.freeze()}function p(e){const t=[{type:"vec3f32",name:"position"},{type:"vec2snorm16",name:"profileRight"},{type:"vec2snorm16",name:"profileUp"}];return 1===e.upVectorAlignment&&t.push({type:"vec2snorm16",name:"pathRotationUp"}),e.hasVVSize&&t.push({type:"f32",name:"sizeFeatureAttribute"}),e.hasVVColor&&t.push({type:"f32",name:"colorFeatureAttribute"}),e.hasVVOpacity&&t.push({type:"f32",name:"opacityFeatureAttribute"}),t.push({type:"f16",name:"pathMaxStretchDistance"},{type:"snorm16",name:"profileRotation"}),new r(t)}export{o as getLayout,p as getTextureLayout};
2
+ import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as o}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function r(){return e().u32("pathVertexInfo",{integer:!0}).freeze()}function p(e){const r=[{type:"vec3f32",name:"position"},{type:"vec2snorm16",name:"profileRight"},{type:"vec2snorm16",name:"profileUp"}];return 1===e.upVectorAlignment&&r.push({type:"vec2snorm16",name:"pathRotationUp"}),e.hasVVSize&&r.push({type:"f32",name:"sizeFeatureAttribute"}),e.hasPathSize&&r.push({type:"vec2f32",name:"size"}),e.hasVVColor&&r.push({type:"f32",name:"colorFeatureAttribute"}),e.hasPathColor&&r.push({type:"vec4unorm8",name:"color"}),e.hasVVOpacity&&r.push({type:"f32",name:"opacityFeatureAttribute"}),t()&&r.push({type:"vec4unorm8",name:"olidColor"}),r.push({type:"f16",name:"pathMaxStretchDistance"},{type:"snorm16",name:"profileRotation"}),e.hasPathOpacity&&r.push({type:"unorm8",name:"opacity"}),new o(r)}export{r as getLayout,p as getTextureLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as s,BufferViewVec3f as o,BufferViewVec2Snorm16 as a,BufferViewSnorm16 as n,BufferViewFloat16 as c,BufferViewFloat as h}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as u}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as p,is3DGeometry as f,isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import m from"../lib/GLMaterial.js";import{isPathGeometry as g}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as b}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as d,intersectAabbInvDir as _}from"../lib/RayIntersections.js";import{intersectTriangleRangeScreenPolygon as y}from"../lib/screenPolygonTriangleIntersections.js";import{assert as S}from"../lib/Util.js";import{applyPolygonOffsetToHit as x}from"./intersectWithPolygonOffset.js";import{getLayout as z,getTextureLayout as V}from"./PathLayouts.js";import{PathPassParameters as j,PathTechnique as w}from"./PathTechnique.js";import{PathTechniqueConfiguration as F}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as v}from"./TriangleMaterial.js";import{writeAttributes as R,writePosition as P,writeBufferVec2 as M,writeBufferInt16 as C,writeBufferFloat16 as A,writeBufferFloat as B}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as O}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class I extends v{constructor(t,e){super(t,D),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&p(t)||f(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&p(t)||f(t))&&this.transparent]]),this._configuration=new F(e.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,l(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=O(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=T}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersectRay(t,e,this._pp0,this._pp1,r)}intersectScreenPolygon(t,e,i,r){const s=L(t);return null==s?null:x(q(s,this._computeSize(s),e,i,r),this._configuration,i.camera.eye)}_intersectRay(t,e,i,s,o){const a=L(t);if(null==a)return;const n=this._computeSize(a),c=new d(e.tolerance,!1,e.options.normalRequired),h=Math.max(n[0],n[1]),u=t.boundingInfo;if(null==u)return void k(a,n,i,s,c,o);const p=r(u.bbMin[0]-h,u.bbMin[1]-h,u.bbMin[2]-h,u.bbMax[0]+h,u.bbMax[1]+h,u.bbMax[2]+h),f=[s[0]-i[0],s[1]-i[1],s[2]-i[2]],l=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]),m=[l/f[0],l/f[1],l/f[2]];_(p,i,m,e.tolerance)&&k(a,n,i,s,c,o)}_computeSize(i){const r=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:s,minSize:o,maxSize:a,fallback:n}=this.parameters.vvSize,c=i.sizeAttributeValue;Number.isNaN(c)?(r[0]*=n[0],r[1]*=n[2]):(r[0]*=t(e[0]+c*s[0],o[0],a[0]),r[1]*=t(e[2]+c*s[2],o[2],a[2]))}return r}createBufferWriter(){return new G(z(),V(this.parameters))}createGLMaterial(t){return new U(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class U extends m{beginSlot(t){return this.getTechnique(w,t)}}function k({baked:t},e,i,r,s,o){t.size&&t.size[0]===e[0]&&t.size[1]===e[1]||t.bake(e),t.intersect(i,r,s,o)}function q({baked:t},e,i,r,s){t.size&&t.size[0]===e[0]&&t.size[1]===e[1]||t.bake(e);const{vertexIndices:o}=t.builder;return y(r,i,s,0,o.length/3,o,t.positions,3,null)}function L(t){const e=t;return g(e)?e.path:null}class D extends j{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class G{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=u}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,u,p){S(null!=p,"Texture buffer is required for path material"),R(i,r,this.layout,t,e,u);const f=p.offset,l=p.textureBufferRange.from,m=u.buffer.getField("pathVertexInfo",s),g=i.get("pathVertexInfo");if(m&&g){S(1===g.size);const{data:t,stride:e,indices:i}=g;for(let r=0;r<i.length;++r){const s=t[e*i[r]];m.set(u.offset+r,b(s,l))}}const d=p.buffer.getField("position",o),_=i.get("position");d&&_&&(S(3===_.size),P(_,t,d,f));const y=p.buffer.getField("profileRight",a),x=i.get("profileRight");y&&x&&(S(2===x.size),M(x,y,f));const z=p.buffer.getField("profileUp",a),V=i.get("profileUp");z&&V&&(S(2===V.size),M(V,z,f));const j=p.buffer.getField("profileRotation",n),w=i.get("profileRotation");j&&w&&(S(1===w.size),C(w,j,f));const F=p.buffer.getField("pathRotationUp",a),v=i.get("pathRotationUp");F&&v&&(S(2===v.size),M(v,F,f));const O=p.buffer.getField("pathMaxStretchDistance",c),T=i.get("pathMaxStretchDistance");O&&T&&(S(1===T.size),A(T,O,f));const I=p.buffer.getField("sizeFeatureAttribute",h),U=i.get("sizeFeatureAttribute");I&&U&&B(U,I,f);const k=p.buffer.getField("opacityFeatureAttribute",h),q=i.get("opacityFeatureAttribute");k&&q&&B(q,k,f);const L=p.buffer.getField("colorFeatureAttribute",h),D=i.get("colorFeatureAttribute");L&&D&&B(D,L,f)}}export{D as Parameters,G as PathBufferWriter,I as PathMaterial};
2
+ import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as e}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as i,BufferViewVec3f as r,BufferViewVec2Snorm16 as s,BufferViewSnorm16 as o,BufferViewFloat16 as a,BufferViewFloat as n,BufferViewVec2f as h,BufferViewVec4Unorm8 as c,BufferViewUnorm8 as p}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as u}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as f,is3DGeometry as l,isColor as g}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import d from"../lib/GLMaterial.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as y}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as _,intersectAabbInvDir as S}from"../lib/RayIntersections.js";import{assert as F}from"../lib/Util.js";import{applyPolygonOffsetToHit as P}from"./intersectWithPolygonOffset.js";import{getLayout as x,getTextureLayout as V}from"./PathLayouts.js";import{PathPassParameters as w,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as j}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as z,writePosition as M,writeBufferVec2 as O,writeBufferInt16 as v,writeBufferFloat16 as A,writeBufferFloat as B,writeColor as T,writeBufferUint8 as I,writeOlidColor as U}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as q}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as L}from"../../../../webscene/support/AlphaCutoff.js";class D extends C{constructor(e,i){super(e,W),this.supportsEdges=!0,this._pp0=t(0,0,1),this._pp1=t(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&f(t)||l(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&f(t)||l(t))&&this.transparent]]),this._configuration=new j(i.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,g(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=q(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=L}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersectRay(t,e,this._pp0,this._pp1,r)}intersectScreenPolygon(t,e,i,r){return b(t)?P(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(t,i,r,s,o){if(!b(t))return;const a=new _(i.tolerance,!1,i.options.normalRequired),n=t.boundingInfo;if(null==n)return void t.intersectRay(r,s,a,o);const h=e(n.bbMin[0],n.bbMin[1],n.bbMin[2],n.bbMax[0],n.bbMax[1],n.bbMax[2]),c=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],p=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]),u=[p/c[0],p/c[1],p/c[2]];S(h,r,u,i.tolerance)&&t.intersectRay(r,s,a,o)}createBufferWriter(){return new H(x(),V(this.parameters))}createGLMaterial(t){return new G(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class G extends d{beginSlot(t){return this.getTechnique(R,t)}}class W extends w{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class H{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=u}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,u,f,l,g){F(null!=g,"Texture buffer is required for path material"),z(u,f,this.layout,t,e,l);const d=g.offset,b=g.textureBufferRange.from,_=l.buffer.getField("pathVertexInfo",i),S=u.get("pathVertexInfo");if(_&&S){F(1===S.size);const{data:t,stride:e,indices:i}=S;for(let r=0;r<i.length;++r){const s=t[e*i[r]];_.set(l.offset+r,y(s,b))}}const P=g.buffer.getField("position",r),x=u.get("position");P&&x&&(F(3===x.size),M(x,t,P,d));const V=g.buffer.getField("profileRight",s),w=u.get("profileRight");V&&w&&(F(2===w.size),O(w,V,d));const R=g.buffer.getField("profileUp",s),j=u.get("profileUp");R&&j&&(F(2===j.size),O(j,R,d));const C=g.buffer.getField("profileRotation",o),q=u.get("profileRotation");C&&q&&(F(1===q.size),v(q,C,d));const L=g.buffer.getField("pathRotationUp",s),D=u.get("pathRotationUp");L&&D&&(F(2===D.size),O(D,L,d));const G=g.buffer.getField("pathMaxStretchDistance",a),W=u.get("pathMaxStretchDistance");G&&W&&(F(1===W.size),A(W,G,d));const H=g.buffer.getField("sizeFeatureAttribute",n),k=u.get("sizeFeatureAttribute");H&&k&&B(k,H,d);const E=g.buffer.getField("size",h),J=u.get("size");E&&J&&(F(2===J.size),O(J,E,d));const K=g.buffer.getField("colorFeatureAttribute",n),N=u.get("colorFeatureAttribute");K&&N&&B(N,K,d);const Q=g.buffer.getField("color",c),X=u.get("color");Q&&X&&T(X,4,Q,d);const Y=g.buffer.getField("opacityFeatureAttribute",n),Z=u.get("opacityFeatureAttribute");Y&&Z&&B(Z,Y,d);const $=g.buffer.getField("opacity",p),tt=u.get("opacity");if($&&tt&&(F(1===tt.size),I(tt,$,d)),m()){const t=g.buffer.getField("olidColor",c),e=x?.indices.length??0;f&&t&&e&&U(f,t,e,d)}}}export{W as Parameters,H as PathBufferWriter,D as PathMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";class i extends e{constructor(o){super(),this.spherical=o,this.offsetBackfaces=!1,this.cullFace=0,this.pbrMode=0,this.emissionSource=0,this.upVectorAlignment=0,this.pathCapType=3,this.pathProfileType=0,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasOccludees=!1,this.snowCover=!1,this.receiveGlobalIllumination=!1,this.supportNaN=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1,this.doubleSidedMode=0,this.renderOccluded=!1}}o([t()],i.prototype,"offsetBackfaces",void 0),o([t({count:3})],i.prototype,"cullFace",void 0),o([t({count:7})],i.prototype,"pbrMode",void 0),o([t({count:8})],i.prototype,"emissionSource",void 0),o([t({count:2})],i.prototype,"upVectorAlignment",void 0),o([t({count:4})],i.prototype,"pathCapType",void 0),o([t({count:2})],i.prototype,"pathProfileType",void 0),o([t()],i.prototype,"receiveShadows",void 0),o([t()],i.prototype,"hasShadowHighlights",void 0),o([t()],i.prototype,"receiveAmbientOcclusion",void 0),o([t()],i.prototype,"hasVVSize",void 0),o([t()],i.prototype,"hasVVColor",void 0),o([t()],i.prototype,"hasVVOpacity",void 0),o([t()],i.prototype,"hasOccludees",void 0),o([t()],i.prototype,"snowCover",void 0),o([t()],i.prototype,"receiveGlobalIllumination",void 0);export{i as PathTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{TriangleTechniqueConfiguration as e}from"./TriangleTechniqueConfiguration.js";class i extends e{constructor(t){super(),this.spherical=t,this.offsetBackfaces=!1,this.cullFace=0,this.pbrMode=0,this.emissionSource=0,this.upVectorAlignment=0,this.pathCapType=3,this.pathProfileType=0,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.hasPathSize=!1,this.hasPathColor=!1,this.hasPathOpacity=!1,this.hasOccludees=!1,this.snowCover=!1,this.receiveGlobalIllumination=!1,this.supportNaN=!0,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1,this.doubleSidedMode=0,this.renderOccluded=!1}}t([o()],i.prototype,"offsetBackfaces",void 0),t([o({count:3})],i.prototype,"cullFace",void 0),t([o({count:7})],i.prototype,"pbrMode",void 0),t([o({count:8})],i.prototype,"emissionSource",void 0),t([o({count:2})],i.prototype,"upVectorAlignment",void 0),t([o({count:4})],i.prototype,"pathCapType",void 0),t([o({count:2})],i.prototype,"pathProfileType",void 0),t([o()],i.prototype,"receiveShadows",void 0),t([o()],i.prototype,"hasShadowHighlights",void 0),t([o()],i.prototype,"receiveAmbientOcclusion",void 0),t([o()],i.prototype,"hasVVSize",void 0),t([o()],i.prototype,"hasVVColor",void 0),t([o()],i.prototype,"hasVVOpacity",void 0),t([o()],i.prototype,"hasPathSize",void 0),t([o()],i.prototype,"hasPathColor",void 0),t([o()],i.prototype,"hasPathOpacity",void 0),t([o()],i.prototype,"hasOccludees",void 0),t([o()],i.prototype,"snowCover",void 0),t([o()],i.prototype,"receiveGlobalIllumination",void 0);export{i as PathTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{subtract as e,length as t,scale as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOrthoNormal as r,hasIdentityRotation as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as n,BufferViewVec4f as s,BufferViewFloat as c,BufferViewVec2i16 as l,BufferViewVec2f16 as d,BufferViewVec2f as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}from"../../lib/Util.js";function g(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function y(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l)n[f]=r[i[l]],f+=s;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)n[f]=e,f+=s}}function B(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function b(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function h(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=2*r[c];i[f]=o[e],i[f+1]=o[e+1],f+=n}}function m(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=3*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}}function v(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=4*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}}function S(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride,i=e.elementCount;t*=r;for(let n=0;n<f;++n){for(let e=0;e<i;++e)o[t+e]=0;t+=r}}function F(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=9*r[c];for(let t=0;t<9;++t)i[f+t]=o[e+t];f+=n}}function z(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=16*r[c];for(let t=0;t<16;++t)i[f+t]=o[e+t];f+=n}}function w(e,t,f,o,r=1){if(!t)return void m(e,f,o,r);const{data:n,indices:s}=e,c=f.typedBuffer,l=f.typedBufferStride,d=s.length,u=t[0],a=t[1],p=t[2],g=t[4],y=t[5],B=t[6],b=t[8],h=t[9],v=t[10],S=t[12],F=t[13],z=t[14];o*=l;let w=0,k=0,N=0;const $=i(t)?e=>{w=n[e]+S,k=n[e+1]+F,N=n[e+2]+z}:e=>{const t=n[e],f=n[e+1],o=n[e+2];w=u*t+g*f+b*o+S,k=a*t+y*f+h*o+F,N=p*t+B*f+v*o+z};if(1===r)for(let i=0;i<d;++i)$(3*s[i]),c[o]=w,c[o+1]=k,c[o+2]=N,o+=l;else for(let i=0;i<d;++i){$(3*s[i]);for(let e=0;e<r;++e)c[o]=w,c[o+1]=k,c[o+2]=N,o+=l}}function k(e,t,f,o,n=1){if(!t)return void m(e,f,o,n);const{data:s,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],y=l[2],B=l[4],b=l[5],h=l[6],v=l[8],S=l[9],F=l[10],z=!r(l),w=1e-6,k=1-w;o*=u;let N=0,$=0,x=0;const M=i(l)?e=>{N=s[e],$=s[e+1],x=s[e+2]}:e=>{const t=s[e],f=s[e+1],o=s[e+2];N=p*t+B*f+v*o,$=g*t+b*f+S*o,x=y*t+h*f+F*o};if(1===n)if(z)for(let r=0;r<a;++r){M(3*c[r]);const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);d[o]=N*t,d[o+1]=$*t,d[o+2]=x*t}else d[o]=N,d[o+1]=$,d[o+2]=x;o+=u}else for(let r=0;r<a;++r)M(3*c[r]),d[o]=N,d[o+1]=$,d[o+2]=x,o+=u;else for(let r=0;r<a;++r){if(M(3*c[r]),z){const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);N*=t,$*=t,x*=t}}for(let e=0;e<n;++e)d[o]=N,d[o+1]=$,d[o+2]=x,o+=u}}function N(e,t,f,o,i=1){if(!t)return void v(e,f,o,i);const{data:n,indices:s}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=s.length,a=c[0],p=c[1],g=c[2],y=c[4],B=c[5],b=c[6],h=c[8],m=c[9],S=c[10],F=!r(c),z=1e-6,w=1-z;if(o*=d,1===i)for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],i=n[e+2],c=n[e+3];let u=a*t+y*f+h*i,v=p*t+B*f+m*i,k=g*t+b*f+S*i;if(F){const e=u*u+v*v+k*k;if(e<w&&e>z){const t=1/Math.sqrt(e);u*=t,v*=t,k*=t}}l[o]=u,l[o+1]=v,l[o+2]=k,l[o+3]=c,o+=d}else for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],c=n[e+2],u=n[e+3];let v=a*t+y*f+h*c,k=p*t+B*f+m*c,N=g*t+b*f+S*c;if(F){const e=v*v+k*k+N*N;if(e<w&&e>z){const t=1/Math.sqrt(e);v*=t,k*=t,N*=t}}for(let r=0;r<i;++r)l[o]=v,l[o+1]=k,l[o+2]=N,l[o+3]=u,o+=d}}function $(e,t,f,o,r=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length;if(o*=c,t===i.length&&4===t){s[o]=i[0],s[o+1]=i[1],s[o+2]=i[2],s[o+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[o/=4];o+=t;const d=l*r;for(let f=1;f<d;++f)e[o]=n,o+=t;return}if(1!==r)if(4!==t)for(let d=0;d<l;++d){const e=3*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=255,o+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=i[e+3],o+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=i[t+3],o+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=255,o+=c}}}function x(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length,c=o[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function M(o,r,i,n){e(j,o,r);const s=Math.max(Math.sqrt(t(j)),1e-4);f(j,j,1/s),i[n++]=j[0],i[n++]=j[1],i[n++]=j[2],i[n++]=s}const j=o();function q(e,t,f,o,r=1){const i=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let s=0;s<f;++s)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n;else for(let s=0;s<f;++s)for(let t=0;t<r;++t)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n}function A(e,t,f,o,r,i){const{buffer:s,offset:c}=i;for(const l of f.fields.keys()){const f=e.get(l),i=f?.indices;if(f&&i)C(l,f,o,r,s,c);else if("olidColor"===l&&null!=t){const f=e.get("position")?.indices;if(f){const e=f.length;q(t,s.getField(l,n),e,c)}}}}function C(e,t,f,o,r,i){switch(e){case"position":{p(3===t.size);const o=r.getField(e,a);p(!!o,`No buffer view for ${e}`),w(t,f,o,i);break}case"normal":{p(3===t.size);const f=r.getField(e,a);p(!!f,`No buffer view for ${e}`),k(t,o,f,i);break}case"normalCompressed":case"profileRight":case"profileUp":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),h(t,f,i);break}case"uv0":{p(2===t.size);const f=r.getField(e,d)??r.getField(e,u);p(!!f,`No buffer view for ${e}`),h(t,f,i);break}case"uvi":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),h(t,f,i);break}case"color":case"symbolColor":{const f=r.getField(e,n);p(!!f,`No buffer view for ${e}`),p(3===t.size||4===t.size),$(t,t.size,f,i);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const f=r.getField(e,c)??r.getField(e,c);p(!!f,`No buffer view for ${e}`),p(1===t.size),x(t,f,i);break}case"tangent":{p(4===t.size);const o=r.getField(e,s);p(!!o,`No buffer view for ${e}`),N(t,f,o,i);break}}}function U(e,t,f,o){const{data:r,stride:i,size:n,indices:s}=e;p(1===n,"Index should be 1D");const c=s.length;for(let l=0;l<c;++l){const e=r[i*s[l]];t.set(f+l,o+e)}}function D(e,t,f,o){for(let r=0;r<o;++r)e.set(t+r,f)}export{C as writeAttribute,A as writeAttributes,y as writeBufferFloat,g as writeBufferFloat16,B as writeBufferInt16,F as writeBufferMat3f,z as writeBufferMat4f,b as writeBufferUint32,h as writeBufferVec2,m as writeBufferVec3,v as writeBufferVec4,S as writeBufferZeros,$ as writeColor,D as writeConstTextureElementIndex,M as writeDeltaF16Vector,k as writeNormal,q as writeOlidColor,w as writePosition,N as writeTangent,U as writeTextureElementIndex,x as writeVVFeatureAttribute};
2
+ import{subtract as e,length as t,scale as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOrthoNormal as r,hasIdentityRotation as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as n,BufferViewVec4f as s,BufferViewFloat as c,BufferViewVec2i16 as l,BufferViewVec2f16 as d,BufferViewVec2f as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}from"../../lib/Util.js";function g(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function y(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l)n[f]=r[i[l]],f+=s;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)n[f]=e,f+=s}}function B(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function h(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function b(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function m(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=2*r[c];i[f]=o[e],i[f+1]=o[e+1],f+=n}}function v(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=3*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}}function S(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=4*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}}function F(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride,i=e.elementCount;t*=r;for(let n=0;n<f;++n){for(let e=0;e<i;++e)o[t+e]=0;t+=r}}function z(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=9*r[c];for(let t=0;t<9;++t)i[f+t]=o[e+t];f+=n}}function w(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=16*r[c];for(let t=0;t<16;++t)i[f+t]=o[e+t];f+=n}}function k(e,t,f,o,r=1){if(!t)return void v(e,f,o,r);const{data:n,indices:s}=e,c=f.typedBuffer,l=f.typedBufferStride,d=s.length,u=t[0],a=t[1],p=t[2],g=t[4],y=t[5],B=t[6],h=t[8],b=t[9],m=t[10],S=t[12],F=t[13],z=t[14];o*=l;let w=0,k=0,N=0;const $=i(t)?e=>{w=n[e]+S,k=n[e+1]+F,N=n[e+2]+z}:e=>{const t=n[e],f=n[e+1],o=n[e+2];w=u*t+g*f+h*o+S,k=a*t+y*f+b*o+F,N=p*t+B*f+m*o+z};if(1===r)for(let i=0;i<d;++i)$(3*s[i]),c[o]=w,c[o+1]=k,c[o+2]=N,o+=l;else for(let i=0;i<d;++i){$(3*s[i]);for(let e=0;e<r;++e)c[o]=w,c[o+1]=k,c[o+2]=N,o+=l}}function N(e,t,f,o,n=1){if(!t)return void v(e,f,o,n);const{data:s,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],y=l[2],B=l[4],h=l[5],b=l[6],m=l[8],S=l[9],F=l[10],z=!r(l),w=1e-6,k=1-w;o*=u;let N=0,$=0,x=0;const M=i(l)?e=>{N=s[e],$=s[e+1],x=s[e+2]}:e=>{const t=s[e],f=s[e+1],o=s[e+2];N=p*t+B*f+m*o,$=g*t+h*f+S*o,x=y*t+b*f+F*o};if(1===n)if(z)for(let r=0;r<a;++r){M(3*c[r]);const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);d[o]=N*t,d[o+1]=$*t,d[o+2]=x*t}else d[o]=N,d[o+1]=$,d[o+2]=x;o+=u}else for(let r=0;r<a;++r)M(3*c[r]),d[o]=N,d[o+1]=$,d[o+2]=x,o+=u;else for(let r=0;r<a;++r){if(M(3*c[r]),z){const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);N*=t,$*=t,x*=t}}for(let e=0;e<n;++e)d[o]=N,d[o+1]=$,d[o+2]=x,o+=u}}function $(e,t,f,o,i=1){if(!t)return void S(e,f,o,i);const{data:n,indices:s}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=s.length,a=c[0],p=c[1],g=c[2],y=c[4],B=c[5],h=c[6],b=c[8],m=c[9],v=c[10],F=!r(c),z=1e-6,w=1-z;if(o*=d,1===i)for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],i=n[e+2],c=n[e+3];let u=a*t+y*f+b*i,S=p*t+B*f+m*i,k=g*t+h*f+v*i;if(F){const e=u*u+S*S+k*k;if(e<w&&e>z){const t=1/Math.sqrt(e);u*=t,S*=t,k*=t}}l[o]=u,l[o+1]=S,l[o+2]=k,l[o+3]=c,o+=d}else for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],c=n[e+2],u=n[e+3];let S=a*t+y*f+b*c,k=p*t+B*f+m*c,N=g*t+h*f+v*c;if(F){const e=S*S+k*k+N*N;if(e<w&&e>z){const t=1/Math.sqrt(e);S*=t,k*=t,N*=t}}for(let r=0;r<i;++r)l[o]=S,l[o+1]=k,l[o+2]=N,l[o+3]=u,o+=d}}function x(e,t,f,o,r=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length;if(o*=c,t===i.length&&4===t){s[o]=i[0],s[o+1]=i[1],s[o+2]=i[2],s[o+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[o/=4];o+=t;const d=l*r;for(let f=1;f<d;++f)e[o]=n,o+=t;return}if(1!==r)if(4!==t)for(let d=0;d<l;++d){const e=3*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=255,o+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=i[e+3],o+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=i[t+3],o+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=255,o+=c}}}function M(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length,c=o[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function j(o,r,i,n){e(q,o,r);const s=Math.max(Math.sqrt(t(q)),1e-4);f(q,q,1/s),i[n++]=q[0],i[n++]=q[1],i[n++]=q[2],i[n++]=s}const q=o();function A(e,t,f,o,r=1){const i=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let s=0;s<f;++s)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n;else for(let s=0;s<f;++s)for(let t=0;t<r;++t)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n}function C(e,t,f,o,r,i){const{buffer:s,offset:c}=i;for(const l of f.fields.keys()){const f=e.get(l),i=f?.indices;if(f&&i)U(l,f,o,r,s,c);else if("olidColor"===l&&null!=t){const f=e.get("position")?.indices;if(f){const e=f.length;A(t,s.getField(l,n),e,c)}}}}function U(e,t,f,o,r,i){switch(e){case"position":{p(3===t.size);const o=r.getField(e,a);p(!!o,`No buffer view for ${e}`),k(t,f,o,i);break}case"normal":{p(3===t.size);const f=r.getField(e,a);p(!!f,`No buffer view for ${e}`),N(t,o,f,i);break}case"normalCompressed":case"profileRight":case"profileUp":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"uv0":{p(2===t.size);const f=r.getField(e,d)??r.getField(e,u);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"uvi":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),m(t,f,i);break}case"color":case"symbolColor":{const f=r.getField(e,n);p(!!f,`No buffer view for ${e}`),p(3===t.size||4===t.size),x(t,t.size,f,i);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const f=r.getField(e,c)??r.getField(e,c);p(!!f,`No buffer view for ${e}`),p(1===t.size),M(t,f,i);break}case"tangent":{p(4===t.size);const o=r.getField(e,s);p(!!o,`No buffer view for ${e}`),$(t,f,o,i);break}}}function D(e,t,f,o){const{data:r,stride:i,size:n,indices:s}=e;p(1===n,"Index should be 1D");const c=s.length;for(let l=0;l<c;++l){const e=r[i*s[l]];t.set(f+l,o+e)}}function I(e,t,f,o){for(let r=0;r<o;++r)e.set(t+r,f)}export{U as writeAttribute,C as writeAttributes,y as writeBufferFloat,g as writeBufferFloat16,B as writeBufferInt16,z as writeBufferMat3f,w as writeBufferMat4f,h as writeBufferUint32,b as writeBufferUint8,m as writeBufferVec2,v as writeBufferVec3,S as writeBufferVec4,F as writeBufferZeros,x as writeColor,I as writeConstTextureElementIndex,j as writeDeltaF16Vector,N as writeNormal,A as writeOlidColor,k as writePosition,$ as writeTangent,D as writeTextureElementIndex,M as writeVVFeatureAttribute};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as v}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as x}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as j}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as y}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as b}from"../effects/clouds/CloudsComposition.js";import{Fog as R}from"../effects/fog/Fog.js";import{ObjectAndLayerID as A}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccluded as S}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as T}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as O}from"../effects/glow/Glow.js";import{Haze as U}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as M}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as L}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as D}from"../effects/magnifier/Magnifier.js";import{SMAA as k}from"../effects/smaa/SMAA.js";import{SSAO as F}from"../effects/ssao/SSAO.js";import{Stars as W}from"../effects/stars/Stars.js";import{GLMaterialRepository as B}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as I}from"../lib/Renderer.js";import{RenderingContext as E}from"../lib/RenderingContext.js";import{RenderingContextOptions as G}from"../lib/RenderingContextOptions.js";import{TextureRepository as P}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as z}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as N}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as V}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as X}from"./contextCache.js";import{removeLoadedShaderModules as Q}from"./renderUtils.js";import{ScreenshotManager as J,ScreenshotContext as K}from"./ScreenshotManager.js";import{contextCache as Y}from"./testUtils.js";import{noBudget as Z}from"../../../support/Scheduler.js";import{checkWebGLError as $}from"../../../webgl/checkWebGLError.js";let ee=class extends t{constructor(e,t){super(e),this.olidRenderHelper=C()?new H:null,this.waterTextures=new V,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.globalIllumination=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=N(this._rctx,r),this.markerTextures=z(this._rctx,r),this.techniques=new v(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new P(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const s=new B(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new I(t,s,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const i={renderScene:(e,t,r,s)=>(this.renderer.setTime(t),this.renderer.render(e,r,s)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new J(this._rctx,i,e=>t.view.overlayManager.updateOverlays(Z,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new W({view:e}),f(e.spatialReference)||(this.glow=new O({view:e}),2===t?new j({view:e}):g(e.spatialReference)?new y({view:e}):(new x({view:e}),new b({view:e}),new U({view:e}),this.fog=new R({view:e}))),has("global-illumination")?this.globalIllumination=new T({view:e}):new F({view:e}),new k({view:e,isEnabled:()=>this.renderer.hasSMAA}),new D({view:e}),new q({view:e}),new L({view:e}),new M({view:e,viewingMode:t}),new S({view:e}),C()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let d=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=l(4*s,h,i.nearFar);d>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(d=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&d>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(d=s)}return d===Number.MAX_VALUE?void 0:d}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Q(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;const n=p(i-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),i=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new K(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");$(n,!0),this._rctx=te(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function te(e,t){const r=new G(t);if(Y.enabled){let t=re.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new E(e,r),re.set(e,t),t.ref(),t)}return new E(e,r)}e([m({type:Boolean,readOnly:!0})],ee.prototype,"updating",null),e([m({constructOnly:!0})],ee.prototype,"view",void 0),e([m({readOnly:!0})],ee.prototype,"componentObjectCollection",null),e([m()],ee.prototype,"_componentObjectCollection",void 0),e([m()],ee.prototype,"_needsUpdate",void 0),e([m()],ee.prototype,"_needsWaterReflectionUpdate",void 0),ee=e([u("esri.views.3d.webgl-engine.parts.RenderView")],ee);const re=X();export{ee as RenderView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as v}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as x}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as y}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as j}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as b}from"../effects/clouds/CloudsComposition.js";import{Fog as R}from"../effects/fog/Fog.js";import{ObjectAndLayerID as A}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccluded as S}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as T}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as M}from"../effects/glow/Glow.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as U}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as D}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as L}from"../effects/magnifier/Magnifier.js";import{SMAA as F}from"../effects/smaa/SMAA.js";import{SSAO as k}from"../effects/ssao/SSAO.js";import{Stars as W}from"../effects/stars/Stars.js";import{GLMaterialRepository as B}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as E}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as H}from"../lib/Renderer.js";import{RenderingContext as I}from"../lib/RenderingContext.js";import{RenderingContextOptions as G}from"../lib/RenderingContextOptions.js";import{TextureRepository as P}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as z}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as N}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as V}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as X}from"./contextCache.js";import{removeLoadedShaderModules as Q}from"./renderUtils.js";import{ScreenshotManager as J,ScreenshotContext as K}from"./ScreenshotManager.js";import{contextCache as Y}from"./testUtils.js";import{noBudget as Z}from"../../../support/Scheduler.js";import{checkWebGLError as $}from"../../../webgl/checkWebGLError.js";const ee=has("disable-feature:async-navigation-3d-depth-readback");let te=class extends t{constructor(e,t){super(e),this.olidRenderHelper=C()?new E:null,this.waterTextures=new V,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.globalIllumination=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=N(this._rctx,r),this.markerTextures=z(this._rctx,r),this.techniques=new v(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new P(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new B(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new H(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new J(this._rctx,s,e=>t.view.overlayManager.updateOverlays(Z,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new W({view:e}),f(e.spatialReference)||(this.glow=new M({view:e}),2===t?new y({view:e}):g(e.spatialReference)?new j({view:e}):(new x({view:e}),new b({view:e}),new O({view:e}),this.fog=new R({view:e}))),has("enable-feature:global-illumination")?this.globalIllumination=new T({view:e}):new k({view:e}),new F({view:e,isEnabled:()=>this.renderer.hasSMAA}),new L({view:e}),new U({view:e}),new D({view:e}),new q({view:e,viewingMode:t}),new S({view:e}),C()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=ee?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Q(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=p(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new K(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");$(n,!0),this._rctx=re(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function re(e,t){const r=new G(t);if(Y.enabled){let t=ie.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new I(e,r),ie.set(e,t),t.ref(),t)}return new I(e,r)}e([m({type:Boolean,readOnly:!0})],te.prototype,"updating",null),e([m({constructOnly:!0})],te.prototype,"view",void 0),e([m({readOnly:!0})],te.prototype,"componentObjectCollection",null),e([m()],te.prototype,"_componentObjectCollection",void 0),e([m()],te.prototype,"_needsUpdate",void 0),e([m()],te.prototype,"_needsWaterReflectionUpdate",void 0),te=e([u("esri.views.3d.webgl-engine.parts.RenderView")],te);const ie=X();export{te as RenderView};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderModules/BooleanPassUniform.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{N as NavigationDepthPassParameters,b as build}from"../../../../chunks/NavigationDepth.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../chunks/NavigationDepth.glsl.js";import{makePipelineState as t,defaultColorWrite as a}from"../../../webgl/renderState.js";let n=class extends o{constructor(){super(...arguments),this.shader=new i(s,()=>import("./NavigationDepth.glsl.js"))}initializePipeline(){return t({colorWrite:a})}};n=e([r("esri.views.3d.webgl-engine.shaders.NavigationDepthTechnique")],n);export{n as NavigationDepthTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class n extends a{constructor(){super(...arguments),this.useFloatBlend=!0}}t([o()],n.prototype,"useFloatBlend",void 0);const e=16,l=e;function s(t,o){o.useFloatBlend?(t.constants.add("floatBlendOutputScale","float",1),t.constants.add("floatBlendInputScale","float",1)):(t.constants.add("floatBlendOutputScale","float",1/e),t.constants.add("floatBlendInputScale","float",e)),t.constants.add("maxEmissiveStrength","float",l)}export{n as OITResolutionConfiguration,e as floatBlendReductionFactor,l as maxEmissiveStrength,s as oitResolution};
2
+ import{__decorate as t}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class n extends a{constructor(){super(...arguments),this.useFloatBlend=!0}}t([o()],n.prototype,"useFloatBlend",void 0);const e=16,l=e;function s(t,o){o.useFloatBlend?(t.constants.add("floatBlendOutputScale","float",1),t.constants.add("floatBlendInputScale","float",1)):(t.constants.add("floatBlendOutputScale","float",1/e),t.constants.add("floatBlendInputScale","float",e)),t.constants.add("maxEmissiveStrength","float",l)}export{n as OITResolutionConfiguration,e as floatBlendReductionFactor,s as oitResolution};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as a}from"../core/Evented.js";import{makeHandle as l}from"../core/handleUtils.js";import c from"../core/Logger.js";import{getOrCreateMapValue as h}from"../core/MapUtils.js";import{destroyMaybe as d}from"../core/maybe.js";import p from"../core/ReactiveMap.js";import{watch as u,initial as g,on as f}from"../core/reactiveUtils.js";import{addMany as m,symmetricDifference as y}from"../core/SetUtils.js";import{property as _,subclass as w}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../core/support/UpdatingHandles.js";import{getGraphicLayer as S}from"../graphic/graphicOriginUtils.js";import{isSubtypeSublayer as M,isSubtypeGroupLayer as E,isKnowledgeGraphLayer as b,isMapImageLayer as j}from"../layers/support/layerUtils.js";import H from"../rest/support/Query.js";import{isGraphic as L}from"../support/graphicInstanceUtils.js";import{isSelectableLayerWithObjectIds as V,isSelectableLayerViewWithObjectIds as U,isSelectableLayer as C,isSelectableLayerView as I,isTableLayer as F,isSelectableLayerViewWithHighlights as z,isSelectableLayerWithGraphics as O,isSelectableLayerBaseWithEditing as T}from"./support/selectionUtils.js";let A=class extends a{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new p,this._sources=new i,this._trashCan=[],this._updatingHandles=new v,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([u(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),u(()=>this.view,e=>{e?.when().then(()=>this.syncSources())},g),f(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),d(this._layerEditHandles),d(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(c.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}add(e,t){const s=new Set;m(s,this._selectionMap.get(e)?.selection);for(const i of t)s.add(N(e,i));this._setSelection(e,Array.from(s))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{b(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):j(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):E(t)?t.sublayers?.forEach(s):C(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return c.getLogger(this).warn("Cannot query layer views without a view."),[];const r=n.map(async t=>{const{layer:n,selection:r}=t;if(r.length&&V(n)&&(!e||e.includes(n))){if(o&&"layerView"===i&&!n.isTable){const e=await this._findLayerView(n);if(U(e))return P(e,r,s)}return P(n,r,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,new Set(n.selection));let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=h(t,e,()=>new Set),n=N(e,s);null!=n&&(o.add(n),i=!0)}}for(const s of e.removed){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=t.get(e),n=N(e,s);n&&o&&(o.delete(n),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n),a=Array.from(r);void 0!==t&&i.push(t),e.set(n,{selection:a}),o.push({layer:n,selection:a,...s(void 0!==t?t.selection:[],a)})}this._onSelectionChange(o)}}setSelection(e,t){r(c.getLogger(this),"SelectionManager.setSelection is deprecated. Use SelectionManager.replace instead.",{replacement:"SelectionManager.replace",warnOnce:!0}),this.replace(e,t)}appendToSelection(e,t){r(c.getLogger(this),"SelectionManager.appendToSelection is deprecated. Use SelectionManager.add instead.",{replacement:"SelectionManager.add",warnOnce:!0}),this.add(e,t)}remove(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[],o=new Set(t.map(t=>N(e,t)));for(const n of s.selection)o.has(n)||i.push(n);this._setSelection(e,i)}replace(e,t){this._setSelection(e,t.map(t=>N(e,t)))}removeFromSelection(e,t){r(c.getLogger(this),"SelectionManager.removeFromSelection is deprecated. Use SelectionManager.remove instead.",{replacement:"SelectionManager.remove",warnOnce:!0}),this.remove(e,t)}toggle(e,t){const s=this._selectionMap.get(e),i=t.map(t=>N(e,t));if(!s||0===s.selection.length)return void this._setSelection(e,i);const o=new Set(s.selection),n=new Set(i),r=y(o,n);this._setSelection(e,Array.from(r))}toggleInSelection(e,t){r(c.getLogger(this),"SelectionManager.toggleInSelection is deprecated. Use SelectionManager.toggle instead.",{replacement:"SelectionManager.toggle",warnOnce:!0}),this.toggle(e,t)}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=M(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return I(i)?(this.layerViewMap.set(e,i),i.addHandles(l(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!F(n)){const e=await this._findLayerView(n);if(z(e)&&o===this._vizTaskId){const i=s.selection;s.highlightHandle=e.highlight(i,{name:t})}}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>M(e)?e.parent:e));for(const t of e)C(t)&&(O(t)?this._layerEditHandles.push(t.graphics.on("change",e=>this._onGraphicsLayerEdit(t,e))):T(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(t,e))))}_onLayerEdit(e,t){if(E(e))this._onParentLayerEdit(e,t);else if(t.deletedFeatures.length&&this._selectionMap.has(e)){const s=[];t.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.remove(e,s)}}_onGraphicsLayerEdit(e,t){const{removed:s}=t;s.length&&this._selectionMap.has(e)&&this.remove(e,s)}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=t;if(i?.updateFeatures?.forEach(t=>{const s=t.getObjectId()??t.attributes[e.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=e.findSublayerForFeature(t);if(!C(i))return;const n=e.sublayers.find(e=>!(!C(e)||!this.getSelection(e)?.includes(s)));C(n)&&n!==i&&(this.remove(n,[s]),this.add(i,[s]))}),s.length){const t=[];s.forEach(({error:e,objectId:s})=>{null!=s&&null==e&&t.push(s)}),e.sublayers.forEach(e=>{C(e)&&this._selectionMap.has(e)&&this.remove(e,t)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(!i||!k(i,{selection:t})){i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o=i?s(i.selection,t):{};this._onSelectionChange([{layer:e,selection:[...t],...o}])}}};e([_()],A.prototype,"_layerEditHandles",void 0),e([_()],A.prototype,"_selectionMap",void 0),e([_()],A.prototype,"_sources",void 0),e([_()],A.prototype,"_updatingHandles",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"count",null),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"hasSelection",null),e([_()],A.prototype,"highlightEnabled",void 0),e([_()],A.prototype,"highlightName",void 0),e([_()],A.prototype,"layerViewMap",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"selections",null),e([_()],A.prototype,"showHighlight",null),e([_()],A.prototype,"sources",null),e([_()],A.prototype,"updating",null),e([_()],A.prototype,"view",void 0),A=e([w("esri.views.SelectionManager")],A);const N=(e,t)=>{if(V(e)&&L(t)){const e=t.getObjectId();if(null!=e)return e}return t},k=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},P=async(e,t,s={})=>e.queryFeatures(new H({...s,objectIds:t})).then(t=>({data:t,layer:I(e)?e.layer:e})),q=A;export{q as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t,difference as s}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{deprecatedProperty as n,deprecatedFunction as r}from"../core/deprecate.js";import{EventedAccessor as a}from"../core/Evented.js";import{makeHandle as l}from"../core/handleUtils.js";import c from"../core/Logger.js";import{getOrCreateMapValue as h}from"../core/MapUtils.js";import{destroyMaybe as d}from"../core/maybe.js";import p from"../core/ReactiveMap.js";import{watch as u,initial as g,on as f}from"../core/reactiveUtils.js";import{addMany as m,symmetricDifference as y}from"../core/SetUtils.js";import{property as _,subclass as w}from"../core/accessorSupport/decorators.js";import{UpdatingHandles as v}from"../core/support/UpdatingHandles.js";import{getGraphicLayer as S}from"../graphic/graphicOriginUtils.js";import{isSubtypeSublayer as M,isSubtypeGroupLayer as E,isKnowledgeGraphLayer as b,isMapImageLayer as j}from"../layers/support/layerUtils.js";import H from"../rest/support/Query.js";import{isGraphic as L}from"../support/graphicInstanceUtils.js";import{isSelectableLayerWithObjectIds as V,isSelectableLayerViewWithObjectIds as U,isSelectableLayer as C,isSelectableLayerView as I,isTableLayer as F,isSelectableLayerViewWithHighlights as z,isSelectableLayerWithGraphics as O,isSelectableLayerBaseWithEditing as T}from"./support/selectionUtils.js";let A=class extends a{constructor(e){super(e),this._layerEditHandles=new i,this._selectionMap=new p,this._sources=new i,this._trashCan=[],this._updatingHandles=new v,this._vizTaskId=0,this.highlightEnabled=!0,this.highlightName="default",this.layerViewMap=new WeakMap,this.view=null}initialize(){this.addHandles([u(()=>[this.view,this.highlightEnabled],()=>{this._refreshVisualization()}),u(()=>this.view,e=>{e?.when().then(()=>this.syncSources()).catch(()=>{})},g),f(()=>this.sources,"change",e=>{const t=this._selectionMap,s=[];for(const i of e.removed){const e=t.get(i);e&&(t.delete(i),e.highlightHandle?.remove(),s.push({layer:i,selection:[],added:[],removed:[...e.selection]}))}this._refreshListeners(),s.length&&this._onSelectionChange(s)},{onListenerAdd:()=>this._refreshListeners()})])}destroy(){this.clear(),this._layerEditHandles.destroyAll(),this._updatingHandles.destroy(),d(this._layerEditHandles),d(this._sources)}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,s]=e;return{layer:t,selection:[...s.selection]}})}get showHighlight(){return this.highlightEnabled}set showHighlight(e){n(c.getLogger(this),"showHighlight",{replacement:"highlightEnabled"}),this.highlightEnabled=e}get sources(){return this._sources}set sources(e){o(e,this._sources)}get updating(){return this._updatingHandles.updating}add(e,t){const s=new Set;m(s,this._selectionMap.get(e)?.selection);for(const i of t)s.add(N(e,i));this._setSelection(e,Array.from(s))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[s,i]of this._selectionMap.entries())t.push({layer:s,added:[],removed:[...i.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}getSelection(e){return this._selectionMap.get(e)?.selection}syncSources(){const e=new Set,t=this.view?.map;if(!t)return;const s=t=>{b(t)?(t.layers?.forEach(s),t.tables?.forEach(s)):j(t)?(t.sublayers?.forEach(s),t.subtables?.forEach(s)):E(t)?t.sublayers?.forEach(s):C(t)&&e.add(t)};t.allLayers.forEach(s),t.allTables.forEach(s),this.sources=[...e]}async getSelectedFeatures(e,s={},i="layerView"){const{view:o,selections:n}=this;if(!o&&"layerView"===i)return c.getLogger(this).warn("Cannot query layer views without a view."),[];const r=n.map(async t=>{const{layer:n,selection:r}=t;if(r.length&&V(n)&&(!e||e.includes(n))){if(o&&"layerView"===i&&!n.isTable){const e=await this._findLayerView(n);if(U(e))return P(e,r,s)}return P(n,r,s)}}).filter(t);return(await Promise.all(r)).filter(t)}updateSelection(e){const t=new Map;for(const[s,n]of this._selectionMap)t.set(s,new Set(n.selection));let i=!1;const o=e.current.concat(e.added);for(const s of o){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=h(t,e,()=>new Set),n=N(e,s);null!=n&&(o.add(n),i=!0)}}for(const s of e.removed){const e=S(s);if(C(e)&&this.sources.includes(e)){const o=t.get(e),n=N(e,s);n&&o&&(o.delete(n),i=!0)}}if(i){const{_selectionMap:e,_trashCan:i}=this,o=[];for(const[n,r]of t){const t=e.get(n),a=Array.from(r);void 0!==t&&i.push(t),e.set(n,{selection:a}),o.push({layer:n,selection:a,...s(void 0!==t?t.selection:[],a)})}this._onSelectionChange(o)}}setSelection(e,t){r(c.getLogger(this),"SelectionManager.setSelection is deprecated. Use SelectionManager.replace instead.",{replacement:"SelectionManager.replace",warnOnce:!0}),this.replace(e,t)}appendToSelection(e,t){r(c.getLogger(this),"SelectionManager.appendToSelection is deprecated. Use SelectionManager.add instead.",{replacement:"SelectionManager.add",warnOnce:!0}),this.add(e,t)}remove(e,t){const s=this._selectionMap.get(e);if(!s)return;const i=[],o=new Set(t.map(t=>N(e,t)));for(const n of s.selection)o.has(n)||i.push(n);this._setSelection(e,i)}replace(e,t){this._setSelection(e,t.map(t=>N(e,t)))}removeFromSelection(e,t){r(c.getLogger(this),"SelectionManager.removeFromSelection is deprecated. Use SelectionManager.remove instead.",{replacement:"SelectionManager.remove",warnOnce:!0}),this.remove(e,t)}toggle(e,t){const s=this._selectionMap.get(e),i=t.map(t=>N(e,t));if(!s||0===s.selection.length)return void this._setSelection(e,i);const o=new Set(s.selection),n=new Set(i),r=y(o,n);this._setSelection(e,Array.from(r))}toggleInSelection(e,t){r(c.getLogger(this),"SelectionManager.toggleInSelection is deprecated. Use SelectionManager.toggle instead.",{replacement:"SelectionManager.toggle",warnOnce:!0}),this.toggle(e,t)}async _findLayerView(e){const t=this.layerViewMap.get(e);if(t||!this.view)return t;const s=M(e)&&e.parent?e.parent:e,i=await this.view.whenLayerView(s).catch(()=>{});return I(i)?(this.layerViewMap.set(e,i),i.addHandles(l(()=>this.layerViewMap.delete(e))),i):void 0}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}async _refreshVisualization(){await this._updatingHandles.addPromise(this._updateVisualization())}async _updateVisualization(){for(this._vizTaskId++;this._trashCan.length>0;){const e=this._trashCan.pop();e?.highlightHandle?.remove()}const{_selectionMap:e,highlightName:t,sources:s}=this,i=this.view&&this.highlightEnabled,o=this._vizTaskId;for(const n of s){const s=e.get(n);if(s?.highlightHandle?.remove(),i&&s?.selection.length&&!F(n)){const e=await this._findLayerView(n);if(z(e)&&o===this._vizTaskId){const i=s.selection;s.highlightHandle=e.highlight(i,{name:t})}}}}_refreshListeners(){this._layerEditHandles.destroyAll();const e=new Set(this.sources.map(e=>M(e)?e.parent:e));for(const t of e)C(t)&&(O(t)?this._layerEditHandles.push(t.graphics.on("change",e=>this._onGraphicsLayerEdit(t,e))):T(t)&&this._layerEditHandles.push(t.on("edits",e=>this._onLayerEdit(t,e))))}_onLayerEdit(e,t){if(E(e))this._onParentLayerEdit(e,t);else if(t.deletedFeatures.length&&this._selectionMap.has(e)){const s=[];t.deletedFeatures.forEach(({error:e,objectId:t})=>{null!=t&&null==e&&s.push(t)}),this.remove(e,s)}}_onGraphicsLayerEdit(e,t){const{removed:s}=t;s.length&&this._selectionMap.has(e)&&this.remove(e,s)}_onParentLayerEdit(e,t){const{deletedFeatures:s,edits:i,updatedFeatures:o}=t;if(i?.updateFeatures?.forEach(t=>{const s=t.getObjectId()??t.attributes[e.objectIdField];if(null==s)return;if(o.find(e=>e.objectId===s)?.error)return;const i=e.findSublayerForFeature(t);if(!C(i))return;const n=e.sublayers.find(e=>!(!C(e)||!this.getSelection(e)?.includes(s)));C(n)&&n!==i&&(this.remove(n,[s]),this.add(i,[s]))}),s.length){const t=[];s.forEach(({error:e,objectId:s})=>{null!=s&&null==e&&t.push(s)}),e.sublayers.forEach(e=>{C(e)&&this._selectionMap.has(e)&&this.remove(e,t)})}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const i=this._selectionMap.get(e);if(!i||!k(i,{selection:t})){i&&this._trashCan.push(i),this._selectionMap.set(e,{selection:[...t]});const o=i?s(i.selection,t):{};this._onSelectionChange([{layer:e,selection:[...t],...o}])}}};e([_()],A.prototype,"_layerEditHandles",void 0),e([_()],A.prototype,"_selectionMap",void 0),e([_()],A.prototype,"_sources",void 0),e([_()],A.prototype,"_updatingHandles",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"count",null),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"hasSelection",null),e([_()],A.prototype,"highlightEnabled",void 0),e([_()],A.prototype,"highlightName",void 0),e([_()],A.prototype,"layerViewMap",void 0),e([_({readOnly:!0,nonNullable:!0})],A.prototype,"selections",null),e([_()],A.prototype,"showHighlight",null),e([_()],A.prototype,"sources",null),e([_()],A.prototype,"updating",null),e([_()],A.prototype,"view",void 0),A=e([w("esri.views.SelectionManager")],A);const N=(e,t)=>{if(V(e)&&L(t)){const e=t.getObjectId();if(null!=e)return e}return t},k=(e,t)=>{if(null==e&&null==t)return!0;if(null!=e&&null==t||null==e&&null!=t)return!1;if(null!=e&&null!=t&&null!=e.selection&&null!=t.selection){const s=[...e.selection],i=[...t.selection];if(s.length!==i.length)return!1;s.sort(),i.sort();for(let e=0;e<s.length;e++)if(s[e]!==i[e])return!1}return!0},P=async(e,t,s={})=>e.queryFeatures(new H({...s,objectIds:t})).then(t=>({data:t,layer:I(e)?e.layer:e})),q=A;export{q as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{throwIfAborted as c}from"../../../core/promiseUtils.js";import{pausable as d,when as m,watch as v,initial as u,sync as y}from"../../../core/reactiveUtils.js";import{property as _,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import G from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as x,toGeometry as M}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as S,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{fromJSON as E}from"../../../geometry/support/jsonUtils.js";import{isPoint as w}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as I}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as V,toEllipticArc7 as H}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as k,getEndpoint as O,isCircularArc as P,isEllipticArc4 as L,isBezierCurve as T,isCoordinate as R,cloneCurve as A,isEllipticArc7 as j}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as U}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as F}from"../../../geometry/support/curves/mathUtils.js";import D from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as z}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as K}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as N,getZFromVertexSnappingCandidates as W,cloneMove as $}from"./drawUtils.js";import q from"./GraphicMover.js";import X from"./HighlightHelper.js";import{addUniqueLayer as Y,isConnectedReshapeSupportedLayer as Z}from"./layerUtils.js";import{createTooltipInfos as B,connectTooltip as J,updateTranslateTooltipInfo as Q,updateTranslateVertexTooltipInfo as tt}from"./reshapeTooltipUtils.js";import{defaultSymbols as et,createMidpointGraphics as it,createVertexGraphics as st,createCurveControlPointGraphics as ot,createCurveConstructionLineGraphics as rt,attributeKeys as nt,getMidpoint as at,controlPointKinds as ht,fastCloneGeometry as pt,saveUpdatedCurveOrCoordinate as lt,toolIdAttribute as ct,splitCurve as dt,isSingleSegmentCircle as mt,isSingleSegmentEllipse as vt}from"./reshapeUtils.js";import{ViewEventPriorities as ut}from"../../input/InputManager.js";import{createCoordinateHelper as yt}from"../../interactive/coordinateHelper.js";import{sketchKeys as _t}from"../../interactive/keybindings.js";import{EditGeometryOperations as gt}from"../../interactive/editGeometry/EditGeometryOperations.js";import ft from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as Gt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as bt,enterInputModeIfAvailable as xt}from"../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Mt}from"../../support/GeometryWorkerHandle.js";const St=Symbol(),Ct={mode:"on-the-ground",offset:0};let Et=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new f,this._measurementWorker=new Mt({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=et,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new ft,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new X({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=d(()=>this.graphic?.geometry,t=>{if(!t||!0===this._primaryGraphicMoving)return;const e=new Set(this.selectedManipulators.map(Rt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t)),this.curveControlPointGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},y),this.tooltip=bt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=B(this.sketchOptions),this.addHandles([m(()=>t?.ready,()=>{const{layer:t,view:e}=this;Y(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ut.TOOL))},{once:!0,initial:!0}),v(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[v(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],v(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),v(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),v(()=>this.enableMidpoints,()=>this.refresh()),J(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),v(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),v(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??yt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:t,activeTooltipInfo:e,graphic:i}=this;return{sketchOptions:t,activeTooltipInfo:e,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return!!(this._updatingHandles?.updating||this._connectedReshapeManager?.updating||this._segmentLabels?.updating||this.snappingManager?.updating)}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(t){if(this._reset(),this._setup(),t){for(const e of this.vertexGraphics)t.has(Rt(e))&&this._addToSelection(e);for(const e of this.curveControlPointGraphics)t.has(Rt(e))&&this._addToSelection(e)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&S(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=gt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new D({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new Gt({editGeometryOperations:i,elevationInfo:Ct,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new z(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(St),this._connectedReshapeManager?.finish()}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view.map?.layers.remove(this._snappingGraphicsLayer),h(this._snappingGraphicsLayer)),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;this._relatedGraphicIndex=null,t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=wt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=it(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const e=st(t,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=e.graphicIndex,this.vertexGraphics.addMany(e.graphics),this.layer.addMany(e.graphics)}else{const e=st(t,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}}_setupCurveGraphics(t){this._removeCurveGraphics();const e=ot(t,this.symbols,this._coordinateHelper),i=rt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await this._updatingHandles.addPromise(e.promise);if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:Ct,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[nt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new q({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager??=new K({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?jt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,Ut(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:e,dyMap:o}=N(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const t=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const e of t){if("point"===e.geometry?.type){const{pathIndex:t,pointIndex:i}=e.attributes,s=k(n)[t][i];if(s){const t=O(s);e.geometry=this._coordinateHelper.arrayToPoint(t)}}this._addToSelection(e.clone())}}}else{const t=wt(n);this._updateVertexGraphicLocations(t)}this._connectedReshapeManager?.translate(e,o,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!e)return;const{dx:i,dy:s,graphic:o,x:r,y:n}=t,{operationType:a}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>this._handleVertexSnap(o,{x:r,y:n},a))}_afterMoveStop(t,e){if(this._effectiveFilterVerticesEnabled&&"move"===e){const t=new Set;for(const e of this.selectedManipulators)t.add(Rt(e));return this.refresh(t),void this._updateTooltip()}this._isMidpoint(t)||t.getAttribute(nt.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(t)?t:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_handleVertexSnap(t,e,s){const o=t.geometry,r=this.snappingManager?.getVertexCandidates(),n=this.callbacks.onVertexSnap,a=()=>"move"===s?this._emitMoveStopEvent():this._emitReshapeStopEvent(t);if(!(n&&o&&w(o)&&r&&0!==r.length))return a(),void this._afterMoveStop(t,s);p(this._snappingTask),this._snappingTask=i(async i=>{try{const s=await n(o,e,r);c(i);const a=E(s);this._syncGeometryAfterVertexMove(t,a,0,0),t.geometry=a}finally{a(),this._afterMoveStop(t,s)}})}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t,e){const{_coordinateHelper:i}=this;if(e)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!e.has(o))continue;const a=e.get(o);if(!a.has(r)&&!a.has(n))continue;const h=t[o];s.geometry=new G(at(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:e,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=t[e];s.geometry=new G(at(n[o],n[r],i))}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Tt(s);null!=t&&null!=e&&s.getAttribute(nt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Tt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(P(r)||L(r)){const i=O(t[e][o-1]),n=P(r)?V(i,r):U(i,r),[a,h]=I(n,.25);s.geometry=new G({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(T(r)){const t=s.getAttribute(nt.controlPointKind),[e,i]=t===ht.bezier.cp1?r.b[1]:r.b[2];s.geometry=new G({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(nt.controlPointKind),[o,r]=Tt(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===ht.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Tt(t);s===e&&o>=i&&t.setAttribute(nt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(nt.pathIndex)!==e)continue;const t=o.getAttribute(nt.pointIndexStart);t>=i&&(o.setAttribute(nt.pointIndexStart,t+1),o.setAttribute(nt.pointIndexEnd,o.getAttribute(nt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Tt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&w(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});if(p.valid){const i=p.apply();i.z=W(this.snappingManager)??i.z,this._stagedVertex=i,this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r()}}),this._updatingHandles.consumePromise(this._snappingTask.promise)}else{const i=null!=this._stagedVertex?new G(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=pt(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);let p=null;if(h){const t=n.getZ(a);p=[h.pos[0],h.pos[1]];const e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){p&&!this._isVertex(t)&&(p=null);const o=n.spatialReference,[a,h]=Tt(t);let l=It(r);const c=n.pointToArray(e);if(this._updateGeometryFromGraphic(t,l,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)){const e=new Map;e.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,t,c,e,p),l=this._moveSelectedHandleCoordinates(l,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,e),this._updateCurveGraphicLocations(l)}else this._isMidpoint(t)&&this._updateCurveGraphicLocations(l);lt(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Lt(t,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=e.geometry.x,n.coordinate[1]=e.geometry.y,n.graphic.geometry=e.geometry,this._relatedGraphicIndex.insert(n));return t}const{relatedGraphicIndices:r}=e.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return t;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=Tt(o);s&&a(s,r,()=>new Set).add(p),Lt(t,r,p,i,n),o.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Tt(n),h=n.getAttribute(nt.relatedGraphicIndices),p=$(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Tt(e);Lt(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?Ht(e,i,s,[o[0],o[1]],t.getAttribute(nt.controlPointKind)):(Lt(e,i,s,o,r),n&&(0===s?Lt(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(St),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=pt(i),o=[],{[nt.pathIndex]:r,[nt.pointIndexStart]:n,[nt.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[nt.tool]:ct,[nt.pathIndex]:r,[nt.pointIndex]:p,[nt.relatedGraphicIndices]:[]};const l=It(s),c=l[r][a];if(R(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(nt.controlPointKind,ht.circle.interior),e.setAttribute(nt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),lt(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(l[r][n]),e=dt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:O(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=At(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&xt(t,this.tooltip)||_t.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=pt(e);let r=It(o);const n=[],a=At(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!R(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);lt(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),St)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,Q(i,o,this._tooltipsContext,this._updatingHandles,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,tt(i,o,n,this._tooltipsContext,this._updatingHandles,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function wt(t){let e=It(t);e=e.map(t=>t.slice());for(const i of e)for(let t=0;t<i.length;t++)i[t]=A(i[t]);if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!R(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function It(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Vt(t,e,i,s){const o=t[e][i];if(P(o))o.c[1]=s;else if(L(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function Ht(t,e,i,s,o){switch(o){case ht.circle.interior:Vt(t,e,i,s);break;case ht.bezier.cp1:t[e][i].b[1]=s;break;case ht.bezier.cp2:t[e][i].b[2]=s}}function kt(t,e){return t<1e-8*e}function Ot(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(kt(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,S]=[G/b*x,-f/b*x],C=M**2+S**2,[E,w]=[d/2-M,m/2-S];if(kt(E**2+w**2,C)){const[t,e]=v?[-S,M]:[S,-M];return[t+M+h,e+S+p]}const I=Math.sqrt((M**2+S**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+S+p]}function Pt(t,e,i){const s=x(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=M(s,i),r=o[0][1];return j(r)?r:H(t,r)}function Lt(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(mt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(vt(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=F(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=O(r);if(R(r))r.splice(0,r.length,...s);else if(T(r))r.b[0].splice(0,r.b[0].length,...s);else if(P(r)||L(r)){const o=O(t[e][i-1]),n=P(r)?V(o,r):U(o,r);t[e].splice(i,1,{c:[[...s],Ot(o,n,s,!0)]})}else if(j(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Pt(n,r,o).a}if(n&&!R(n)&&!T(r))if(P(n)||L(n)){const o=O(n),r=P(n)?V(a,n):U(a,n);t[e].splice(i+1,1,{c:[o,Ot(o,r,s,!1)]})}else if(j(n)){const t=O(r);n.a=Pt(t,n,o).a}}function Tt({attributes:t}){return[t?.[nt.pathIndex]||0,t?.[nt.pointIndex]||0]}function Rt({attributes:t}){return`${t?.[nt.pathIndex]}-${t?.[nt.pointIndex]}-${t?.[nt.controlPointKind]??"vertex"}`}function At(t){return t instanceof e?[t]:[...t]}function jt(t){const e=t.sourceLayer??t.layer;return Z(e)?{graphic:t,layer:e}:null}function Ut(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[nt.pathIndex],vertexIndex:t[nt.pointIndex]}))}t([_()],Et.prototype,"_activeOperationInfo",void 0),t([_()],Et.prototype,"_connectedReshapeManager",void 0),t([_()],Et.prototype,"_coordinateHelper",null),t([_()],Et.prototype,"_editGeometryOperations",void 0),t([_()],Et.prototype,"_effectiveFilterVerticesEnabled",null),t([_()],Et.prototype,"_primaryGraphicMoving",void 0),t([_()],Et.prototype,"_segmentLabels",void 0),t([_()],Et.prototype,"test",null),t([_()],Et.prototype,"_segmentLabelsImportTask",void 0),t([_()],Et.prototype,"_updatingHandles",void 0),t([_()],Et.prototype,"_selectedManipulator",null),t([_()],Et.prototype,"_tooltipsContext",null),t([_()],Et.prototype,"callbacks",void 0),t([_()],Et.prototype,"connectedReshapeProviders",void 0),t([_()],Et.prototype,"enableMidpoints",void 0),t([_()],Et.prototype,"enableCurveOnMidpoint",void 0),t([_()],Et.prototype,"enableMovement",void 0),t([_()],Et.prototype,"enableVertices",void 0),t([_()],Et.prototype,"filterVerticesEnabled",void 0),t([_()],Et.prototype,"graphic",void 0),t([_()],Et.prototype,"highlightName",void 0),t([_()],Et.prototype,"highlightsEnabled",void 0),t([_()],Et.prototype,"layer",void 0),t([_()],Et.prototype,"snappingManager",void 0),t([_({readOnly:!0})],Et.prototype,"state",null),t([_()],Et.prototype,"symbols",void 0),t([_()],Et.prototype,"tooltip",void 0),t([_()],Et.prototype,"tooltipInfos",void 0),t([_()],Et.prototype,"activeTooltipInfo",void 0),t([_()],Et.prototype,"updating",null),t([_({type:ft})],Et.prototype,"sketchOptions",void 0),t([_({readOnly:!0})],Et.prototype,"type",void 0),t([_({readOnly:!0})],Et.prototype,"vertexGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"curveControlPointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"constructionLineGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"midpointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"selectedManipulators",void 0),t([_()],Et.prototype,"view",void 0),Et=t([g("esri.views.draw.support.Reshape")],Et);const Ft=Et;export{Ft as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{throwIfAborted as c}from"../../../core/promiseUtils.js";import{pausable as d,when as m,watch as v,initial as u,sync as y}from"../../../core/reactiveUtils.js";import{property as _,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import G from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as x,toGeometry as M}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as S,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{fromJSON as E}from"../../../geometry/support/jsonUtils.js";import{isPoint as w}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as I}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as V,toEllipticArc7 as H}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as k,getEndpoint as O,isCircularArc as P,isEllipticArc4 as L,isBezierCurve as T,isCoordinate as R,cloneCurve as A,isEllipticArc7 as j}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as U}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as F}from"../../../geometry/support/curves/mathUtils.js";import D from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as z}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as K}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as N,getZFromVertexSnappingCandidates as W,cloneMove as Z}from"./drawUtils.js";import $ from"./GraphicMover.js";import q from"./HighlightHelper.js";import{addUniqueLayer as X,isConnectedReshapeSupportedLayer as Y}from"./layerUtils.js";import{createTooltipInfos as B,connectTooltip as J,updateTranslateTooltipInfo as Q,updateTranslateVertexTooltipInfo as ee}from"./reshapeTooltipUtils.js";import{defaultSymbols as te,createMidpointGraphics as ie,createVertexGraphics as se,createCurveControlPointGraphics as oe,createCurveConstructionLineGraphics as re,attributeKeys as ne,getMidpoint as ae,controlPointKinds as he,fastCloneGeometry as pe,saveUpdatedCurveOrCoordinate as le,toolIdAttribute as ce,splitCurve as de,isSingleSegmentCircle as me,isSingleSegmentEllipse as ve}from"./reshapeUtils.js";import{ViewEventPriorities as ue}from"../../input/InputManager.js";import{createCoordinateHelper as ye}from"../../interactive/coordinateHelper.js";import{sketchKeys as _e}from"../../interactive/keybindings.js";import{EditGeometryOperations as ge}from"../../interactive/editGeometry/EditGeometryOperations.js";import fe from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as Ge}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as be,enterInputModeIfAvailable as xe}from"../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Me}from"../../support/GeometryWorkerHandle.js";const Se=Symbol(),Ce={mode:"on-the-ground",offset:0};let Ee=class extends r{constructor(e){super(e),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new f,this._measurementWorker=new Me({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=te,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new fe,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const e=this.view;this._highlightHelper=new q({view:e}),this._setup(),this._updateHandlesOnExternalGeometryChange=d(()=>this.graphic?.geometry,e=>{if(!e||!0===this._primaryGraphicMoving)return;const t=new Set(this.selectedManipulators.map(Re));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(e=>t.has(Re(e))).forEach(e=>this._addToSelection(e)),this.curveControlPointGraphics.filter(e=>t.has(Re(e))).forEach(e=>this._addToSelection(e));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},y),this.tooltip=be(()=>({view:e,options:this.sketchOptions.tooltips})),this.tooltipInfos=B(this.sketchOptions),this.addHandles([m(()=>e?.ready,()=>{const{layer:e,view:t}=this;X(t,e),this.addHandles(t.on("key-down",e=>this._keyDownHandler(e),ue.TOOL))},{once:!0,initial:!0}),v(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[v(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],v(()=>this.layer,(e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()}),v(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),v(()=>this.enableMidpoints,()=>this.refresh()),J(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),v(()=>this.sketchOptions.labels.enabled,e=>{this._segmentLabels?this._segmentLabels.visible=e:this._setUpGeometryHelper()}),v(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??ye(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:e,activeTooltipInfo:t,graphic:i}=this;return{sketchOptions:e,activeTooltipInfo:t,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(e,t,i,s,o)=>{this._setUpGeometryHelper();const r=e===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(e);const n=!0;if(this._syncGeometryAfterVertexMove(e,t,s,o,n),r){const{view:e}=this,s=e.toScreen(i),o=e.toScreen(t),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(e),this._emitReshapeStopEvent(e)}}}get state(){const e=this.view.ready,t=!(!this.graphic||!this.layer);return e&&t?"active":e?"ready":"disabled"}get updating(){return!!(this._updatingHandles?.updating||this._connectedReshapeManager?.updating||this._segmentLabels?.updating||this.snappingManager?.updating)}isUIGraphic(e){return e===this.graphic||this._isMidpoint(e)||this._isCurveControlPoint(e)||this._isVertex(e)||this._isConstructionLine(e)}refresh(e){if(this._reset(),this._setup(),e){for(const t of this.vertexGraphics)e.has(Re(t))&&this._addToSelection(t);for(const t of this.curveControlPointGraphics)e.has(Re(t))&&this._addToSelection(t)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:e}=this;e.length&&this._removeVertices(e)}_setup(){const{graphic:e,layer:t}=this;if(!t||null==e?.geometry)return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&S(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(null==e||"mesh"===e.type||"extent"===e.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(e):this._editGeometryOperations=ge.fromGeometry(e,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new D({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new Ge({editGeometryOperations:i,elevationInfo:Ce,pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new z(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(Se),this._connectedReshapeManager?.finish()}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view.map?.layers.remove(this._snappingGraphicsLayer),h(this._snappingGraphicsLayer)),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._removeCurveGraphics(e),this._updateTooltip()}_removeMidpointGraphics(e=this.layer){const{midpointGraphics:t}=this;e?.removeMany(t.items),t.drain(h)}_removeVertexGraphics(e=this.layer){const{vertexGraphics:t}=this;this._relatedGraphicIndex=null,e?.removeMany(t.items),t.drain(h)}_removeCurveGraphics(e=this.layer){const{curveControlPointGraphics:t,constructionLineGraphics:i}=this;e?.removeMany(t.items),e?.removeMany(i.items),t.drain(h),i.drain(h)}_setupGraphics(){const e=this.graphic.geometry;if(null!=e&&("polyline"===e.type||"polygon"===e.type||"multipoint"===e.type)){const t=we(e);this.enableMidpoints&&"multipoint"!==e.type&&this._setUpMidpointGraphics(t),this.enableVertices&&(this._setUpVertexGraphics(t),this._setupCurveGraphics(t))}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=ie(e,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const t=se(e,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=t.graphicIndex,this.vertexGraphics.addMany(t.graphics),this.layer.addMany(t.graphics)}else{const t=se(e,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}}_setupCurveGraphics(e){this._removeCurveGraphics();const t=oe(e,this.symbols,this._coordinateHelper),i=re(e,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(t),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(t)}async _setupSegmentLabels(){const e=this._editGeometryOperations,t=this.sketchOptions.labels.enabled;if(e&&this._segmentLabels?.context?.editGeometryOperations===e&&t||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&e&&t){const t=this._segmentLabelsImportTask??=i(async e=>{const t=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(t);return e.aborted?null:i}),s=await this._updatingHandles.addPromise(t.promise);if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:e,elevationInfo:Ce,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const e=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",e),hover:this.symbols.vertices.hover?.clone().set("color",e)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",e),hover:this.symbols.controlPoints.hover?.clone().set("color",e)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",e)};for(const t of this.vertexGraphics)this._isSelected(t)?t.symbol=this.symbols.vertices.selected:this._hoverGraphic===t?t.symbol=this.symbols.vertices.hover:t.symbol=this.symbols.vertices.default;for(const t of this.curveControlPointGraphics)this._isSelected(t)?t.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===t?t.symbol=this.symbols.controlPoints.hover:t.symbol=this.symbols.controlPoints.default;for(const t of this.constructionLineGraphics)t.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map(({geometry:e})=>({x:e.x,y:e.y}));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const o=t[i],r=t[e];o.x===r.x&&o.y===r.y&&s.push(e)}e[i].attributes[ne.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();e&&"multipoint"!==t.geometry?.type&&r.push(t),this._mover=new $({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:e}=this;null!=e&&0!==e.length&&(this._connectedReshapeManager??=new K({providerFactories:e,view:this.view}))}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic,i=this._isCurveControlPoint(t);if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick?.(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(e);this.refresh(),s.length&&this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t)||i){if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)return void(i||this._removeVertices(t));e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,o=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const{dx:t,dy:i,graphic:s}=e,o=this._connectedReshapeManager,r=o?je(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(e),this._emitMoveStartEvent(t,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,t,i,e,()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(t,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const t=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(e);i.length&&(this._emitVertexAddEvent([s],t,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(e),r){const e=n.filter(e=>this._isVertex(e));o?.startVertexMove(r,Ue(e))}this._emitReshapeStartEvent(s),this._onHandleMove(s,t,i,e,()=>{this._updateTooltip(s,e.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(e){const t=this._activeOperationInfo;if(!t)return;const{dx:i,dy:s,graphic:o}=e;t.totalDx+=i,t.totalDy+=s;const{operationType:r}=t,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,e,()=>{this._updateTooltip(o,e.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,e,()=>{this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:t,dyMap:o}=N(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const e=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const t of e){if("point"===t.geometry?.type){const{pathIndex:e,pointIndex:i}=t.attributes,s=k(n)[e][i];if(s){const e=O(s);t.geometry=this._coordinateHelper.arrayToPoint(e)}}this._addToSelection(t.clone())}}}else{const e=we(n);this._updateVertexGraphicLocations(e)}this._connectedReshapeManager?.translate(t,o,0),this._updateTooltip(this.graphic,e.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(e){const t=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!t)return;const{dx:i,dy:s,graphic:o,x:r,y:n}=e,{operationType:a}=t;t.totalDx+=i,t.totalDy+=s,this._onHandleMove(o,i,s,e,()=>this._handleVertexSnap(o,{x:r,y:n},a))}_afterMoveStop(e,t){if(this._effectiveFilterVerticesEnabled&&"move"===t){const e=new Set;for(const t of this.selectedManipulators)e.add(Re(t));return this.refresh(e),void this._updateTooltip()}this._isMidpoint(e)||e.getAttribute(ne.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(e)?e:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_handleVertexSnap(e,t,s){const o=e.geometry,r=this.snappingManager?.getVertexCandidates(),n=this.callbacks.onVertexSnap,a=()=>"move"===s?this._emitMoveStopEvent():this._emitReshapeStopEvent(e);if(!(n&&o&&w(o)&&r&&0!==r.length))return a(),void this._afterMoveStop(e,s);p(this._snappingTask),this._snappingTask=i(async i=>{try{const s=await n(o,t,r);c(i);const a=E(s);this._coordinateHelper.hasZ()||(a.z=void 0),this._syncGeometryAfterVertexMove(e,a,0,0),e.geometry=a}finally{a(),this._afterMoveStop(e,s)}})}_updateVertexGraphicLocations(e){const{_coordinateHelper:t}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=t.arrayToPoint(O(e[s][o]))}this._updateMidpointGraphicLocations(e),this._updateCurveGraphicLocations(e)}_updateMidpointGraphicLocations(e,t){const{_coordinateHelper:i}=this;if(t)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!t.has(o))continue;const a=t.get(o);if(!a.has(r)&&!a.has(n))continue;const h=e[o];s.geometry=new G(ae(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:t,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=e[t];s.geometry=new G(ae(n[o],n[r],i))}}_updateCurveGraphicLocations(e){const{spatialReference:t}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[e,t]=Te(s);null!=e&&null!=t&&s.getAttribute(ne.controlPointKind)&&a(i,e,()=>new Set)?.add(t)}for(const s of this.curveControlPointGraphics){const[t,o]=Te(s);if(i.get(t)?.has(o))continue;const r=e[t][o];if(P(r)||L(r)){const i=O(e[t][o-1]),n=P(r)?V(i,r):U(i,r),[a,h]=I(n,.25);s.geometry=new G({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(T(r)){const e=s.getAttribute(ne.controlPointKind),[t,i]=e===he.bezier.cp1?r.b[1]:r.b[2];s.geometry=new G({x:t,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(ne.controlPointKind),[o,r]=Te(s),n=e[o],a=O(n[r-1]),h=O(n[r]),p=e[o][r];i===he.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:t}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:t})}}_refreshGraphicIndicesAttributes(e){const{componentIndex:t,vertexIndex:i}=e,s=e=>{const[s,o]=Te(e);s===t&&o>=i&&e.setAttribute(ne.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(ne.pathIndex)!==t)continue;const e=o.getAttribute(ne.pointIndexStart);e>=i&&(o.setAttribute(ne.pointIndexStart,e+1),o.setAttribute(ne.pointIndexEnd,o.getAttribute(ne.pointIndexEnd)+1))}}_getVertexFromEditGeometry(e){const[t,i]=Te(e);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[t].vertices[i]}_onHandleMove(e,t,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=e.geometry,h="graphic-move-stop"===o.type;if(a&&w(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(e,new G(this._stagedVertex),t,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});if(p.valid){const i=p.apply();i.z=this._coordinateHelper.hasZ()?W(this.snappingManager)??i.z:void 0,this._stagedVertex=i,this._syncGeometryAfterVertexMove(e,new G(this._stagedVertex),t,s,h),r()}}),this._updatingHandles.consumePromise(this._snappingTask.promise)}else{const i=null!=this._stagedVertex?new G(this._stagedVertex):a;this._syncGeometryAfterVertexMove(e,i,t,s,h),r()}else r()}_syncGeometryAfterVertexMove(e,t,i,s,o=!1){const r=pe(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(t),h=this._getVertexFromEditGeometry(e);let p=null;if(h){const e=n.getZ(a);p=[h.pos[0],h.pos[1]];const t=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=e?e-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],t,i,s),this._connectedReshapeManager?.translate(t,i,s)}if("point"===r.type)e.geometry=t;else if("mesh"===r.type)e.geometry=r.centerAt(t);else{if(e!==this.graphic){p&&!this._isVertex(e)&&(p=null);const o=n.spatialReference,[a,h]=Te(e);let l=Ie(r);const c=n.pointToArray(t);if(this._updateGeometryFromGraphic(e,l,a,h,c,o,"polygon"===r.type),this._isVertex(e)||this._isCurveControlPoint(e)){const t=new Map;t.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,e,c,t,p),l=this._moveSelectedHandleCoordinates(l,e,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,t),this._updateCurveGraphicLocations(l)}else this._isMidpoint(e)&&this._updateCurveGraphicLocations(l);le(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_syncEditGeometryOperations(e){const t=this._editGeometryOperations?.trySetGeometry(e);t||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(e,t,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Le(e,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=t.geometry.x,n.coordinate[1]=t.geometry.y,n.graphic.geometry=t.geometry,this._relatedGraphicIndex.insert(n));return e}const{relatedGraphicIndices:r}=t.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return e;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=Te(o);s&&a(s,r,()=>new Set).add(p),Le(e,r,p,i,n),o.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==t){const[t,a]=Te(n),h=n.getAttribute(ne.relatedGraphicIndices),p=Z(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,e,t,a,l,r,o),h?.length)for(const i of h){const t=this.vertexGraphics.at(i),[s,o]=Te(t);Le(e,s,o,l,r),t.geometry=p}}return e}_updateGeometryFromGraphic(e,t,i,s,o,r,n){const a=t[i].length-1;this._isCurveControlPoint(e)?He(t,i,s,[o[0],o[1]],e.getAttribute(ne.controlPointKind)):(Le(t,i,s,o,r),n&&(0===s?Le(t,i,a,o,r):s===a&&(t[i][0]=o)))}_onGraphicPointerOverCallback(e){const t=e.graphic;this._hoverGraphic=t;const i=this._isVertex(t);i&&!this._isSelected(t)?t.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?t:null),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._hoverGraphic=null,this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this._isCurveControlPoint(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.controlPoints.default),this.removeHandles(Se),this._updateTooltip()}_handleMidpointClickOrStartMove(e){const{graphic:t}=e,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=pe(i),o=[],{[ne.pathIndex]:r,[ne.pointIndexStart]:n,[ne.pointIndexEnd]:a}=t.attributes,h=C(t.geometry),p=0===a?n+1:a;t.attributes={[ne.tool]:ce,[ne.pathIndex]:r,[ne.pointIndex]:p,[ne.relatedGraphicIndices]:[]};const l=Ie(s),c=l[r][a];if(R(c)){if(this.enableCurveOnMidpoint&&e.viewEvent.native.shiftKey){const e=O(l[r][p]);l[r].splice(p,1,{c:[e,[h[0],h[1]]]}),t.setAttribute(ne.controlPointKind,he.circle.interior),t.setAttribute(ne.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(t),this.curveControlPointGraphics.push(t),le(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const e=O(l[r][n]),t=de(e,c,.5,this._coordinateHelper);l[r].splice(a,1,...t),o.push({coordinates:O(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(e){const t=Ae(e);for(const i of t)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(t)}_removeFromSelection(e,t){if(this._isVertex(e)){const{vertices:i}=this.symbols;e.symbol=t?i.hover:i.default}else if(this._isCurveControlPoint(e)){const{controlPoints:i}=this.symbols;e.symbol=t?i.hover:i.default}this.selectedManipulators.remove(e),this._emitDeselectEvent([e]),this._updateTooltip()}_clearSelection(){const e=this.selectedManipulators.toArray(),{controlPoints:t,vertices:i}=this.symbols;if(e.length>0){for(const s of e)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=t.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(e),this._updateTooltip()}}_keyDownHandler(e){null==this._activeOperationInfo&&xe(e,this.tooltip)||_e.delete.includes(e.key)&&!e.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),e.stopPropagation())}_removeVertices(e){const t=this.graphic.geometry,i=this.vertexGraphics.length;if(null==t||"polygon"!==t.type&&"polyline"!==t.type&&"multipoint"!==t.type)return;if("polygon"===t.type&&i<4||"multipoint"===t.type&&i<2||"polyline"===t.type&&i<3)return;const s=this.graphic.clone(),o=pe(t);let r=Ie(o);const n=[],a=Ae(e);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:e,y:t}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(e===a&&t===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const e=r[i][o];e&&!R(e)&&(r[i][o]=O(e))}}}}if("polygon"===o.type)r=r.filter(e=>{if(e.length<2)return!1;const[t,i]=O(e[0]),[s,o]=O(e[e.length-1]);return(2!==e.length||t!==s||i!==o)&&(t===s&&i===o||e.push(e[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);le(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isCurveControlPoint(e){return this.curveControlPointGraphics.includes(e)}_isConstructionLine(e){return this.constructionLineGraphics.includes(e)}_isSelected(e){return(this._isVertex(e)||this.curveControlPointGraphics.includes(e))&&this.selectedManipulators.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){const t=this._isMidpoint(e)?"copy":"move";this.addHandles(this.view.acquireCursor(t,"high"),Se)}_updateTooltip(e,t){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:e===this.graphic?(i=r.translateGraphic,Q(i,o,this._tooltipsContext,this._updatingHandles,t)):e&&this.selectedManipulators.length>1&&(i=r.translateVertices,ee(i,o,n,this._tooltipsContext,this._updatingHandles,t)),this.activeTooltipInfo=i}_updateGraphicGeometry(e){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=e,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(e,t){const i={type:"move-start",mover:this.graphic,dx:e,dy:t};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(e,t){const i={type:"move",mover:this.graphic,dx:e,dy:t};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(e,t){if(null==e||null==t){const i=this._activeOperationInfo;if(!i)return;e=i.totalDx,t=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:e,dy:t};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(e){const t={type:"reshape-start",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",t),this.callbacks.onReshapeStart?.(t)}_emitReshapeEvent(e){const t={type:"reshape",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape",t),this.callbacks.onReshape?.(t)}_emitReshapeStopEvent(e){const t={type:"reshape-stop",graphic:this.graphic,mover:e,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",t),this.callbacks.onReshapeStop?.(t)}_emitSelectEvent(e){const t={type:"vertex-select",added:e};this.emit("select",t),this.callbacks.onVertexSelect?.(t)}_emitDeselectEvent(e){const t={type:"vertex-deselect",removed:e};this.emit("deselect",t),this.callbacks.onVertexDeselect?.(t)}_emitVertexAddEvent(e,t,i){const s={type:"vertex-add",added:e,graphic:this.graphic,oldGraphic:t,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(e,t,i){const s={type:"vertex-remove",removed:e,graphic:this.graphic,oldGraphic:t,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function we(e){let t=Ie(e);t=t.map(e=>e.slice());for(const i of t)for(let e=0;e<i.length;e++)i[e]=A(i[e]);if("polygon"===e.type)for(const i of t){const e=i[i.length-1];if(!R(e))continue;const t=i[0];t[0]===e[0]&&t[1]===e[1]&&i.length>2&&i.pop()}return t}function Ie(e){return"polygon"===e.type?e.curveRings?.slice()??e.rings.slice():"polyline"===e.type?e.curvePaths?.slice()??e.paths.slice():e.points.map(e=>[e])}function Ve(e,t,i,s){const o=e[t][i];if(P(o))o.c[1]=s;else if(L(o)){const o=O(e[t][i]);e[t][i]={c:[o,s]}}}function He(e,t,i,s,o){switch(o){case he.circle.interior:Ve(e,t,i,s);break;case he.bezier.cp1:e[t][i].b[1]=s;break;case he.bezier.cp2:e[t][i].b[2]=s}}function ke(e,t){return e<1e-8*t}function Oe(e,{cx:t,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=e,[l,c]=n,d=l-h,m=c-p;t-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[t,i]:v?[-i,t]:[i,-t],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(ke(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,S]=[G/b*x,-f/b*x],C=M**2+S**2,[E,w]=[d/2-M,m/2-S];if(ke(E**2+w**2,C)){const[e,t]=v?[-S,M]:[S,-M];return[e+M+h,t+S+p]}const I=Math.sqrt((M**2+S**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+S+p]}function Pe(e,t,i){const s=x(new b({curvePaths:[[e,t]],spatialReference:i})),{curvePaths:o}=M(s,i),r=o[0][1];return j(r)?r:H(e,r)}function Le(e,t,i,s,o){const r=e[t][i],n=e[t].at(i+1);if(me(e,t)){const i=e[t][1];return e[t][0]=[...s],void(e[t][1]={a:[[...s],[...i.a[1]],0,0]})}if(ve(e,t)){const i=e[t][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=F(l,p);return e[t][0]=[...s],void(e[t][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=O(r);if(R(r))r.splice(0,r.length,...s);else if(T(r))r.b[0].splice(0,r.b[0].length,...s);else if(P(r)||L(r)){const o=O(e[t][i-1]),n=P(r)?V(o,r):U(o,r);e[t].splice(i,1,{c:[[...s],Oe(o,n,s,!0)]})}else if(j(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(e[t][i-1]);r.a=Pe(n,r,o).a}if(n&&!R(n)&&!T(r))if(P(n)||L(n)){const o=O(n),r=P(n)?V(a,n):U(a,n);e[t].splice(i+1,1,{c:[o,Oe(o,r,s,!1)]})}else if(j(n)){const e=O(r);n.a=Pe(e,n,o).a}}function Te({attributes:e}){return[e?.[ne.pathIndex]||0,e?.[ne.pointIndex]||0]}function Re({attributes:e}){return`${e?.[ne.pathIndex]}-${e?.[ne.pointIndex]}-${e?.[ne.controlPointKind]??"vertex"}`}function Ae(e){return e instanceof t?[e]:[...e]}function je(e){const t=e.sourceLayer??e.layer;return Y(t)?{graphic:e,layer:t}:null}function Ue(e){return e.toArray().map(({attributes:e})=>({pathIndex:e[ne.pathIndex],vertexIndex:e[ne.pointIndex]}))}e([_()],Ee.prototype,"_activeOperationInfo",void 0),e([_()],Ee.prototype,"_connectedReshapeManager",void 0),e([_()],Ee.prototype,"_coordinateHelper",null),e([_()],Ee.prototype,"_editGeometryOperations",void 0),e([_()],Ee.prototype,"_effectiveFilterVerticesEnabled",null),e([_()],Ee.prototype,"_primaryGraphicMoving",void 0),e([_()],Ee.prototype,"_segmentLabels",void 0),e([_()],Ee.prototype,"test",null),e([_()],Ee.prototype,"_segmentLabelsImportTask",void 0),e([_()],Ee.prototype,"_updatingHandles",void 0),e([_()],Ee.prototype,"_selectedManipulator",null),e([_()],Ee.prototype,"_tooltipsContext",null),e([_()],Ee.prototype,"callbacks",void 0),e([_()],Ee.prototype,"connectedReshapeProviders",void 0),e([_()],Ee.prototype,"enableMidpoints",void 0),e([_()],Ee.prototype,"enableCurveOnMidpoint",void 0),e([_()],Ee.prototype,"enableMovement",void 0),e([_()],Ee.prototype,"enableVertices",void 0),e([_()],Ee.prototype,"filterVerticesEnabled",void 0),e([_()],Ee.prototype,"graphic",void 0),e([_()],Ee.prototype,"highlightName",void 0),e([_()],Ee.prototype,"highlightsEnabled",void 0),e([_()],Ee.prototype,"layer",void 0),e([_()],Ee.prototype,"snappingManager",void 0),e([_({readOnly:!0})],Ee.prototype,"state",null),e([_()],Ee.prototype,"symbols",void 0),e([_()],Ee.prototype,"tooltip",void 0),e([_()],Ee.prototype,"tooltipInfos",void 0),e([_()],Ee.prototype,"activeTooltipInfo",void 0),e([_()],Ee.prototype,"updating",null),e([_({type:fe})],Ee.prototype,"sketchOptions",void 0),e([_({readOnly:!0})],Ee.prototype,"type",void 0),e([_({readOnly:!0})],Ee.prototype,"vertexGraphics",void 0),e([_({readOnly:!0})],Ee.prototype,"curveControlPointGraphics",void 0),e([_({readOnly:!0})],Ee.prototype,"constructionLineGraphics",void 0),e([_({readOnly:!0})],Ee.prototype,"midpointGraphics",void 0),e([_({readOnly:!0})],Ee.prototype,"selectedManipulators",void 0),e([_()],Ee.prototype,"view",void 0),Ee=e([g("esri.views.draw.support.Reshape")],Ee);const Fe=Ee;export{Fe as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createLength as n}from"../../core/quantity.js";import{lengthUnitFromSpatialReference as t,verticalLengthUnitFromSpatialReference as e}from"../../core/units.js";import{distance as r,set as l}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as u}from"../../geometry/projection/projectVectorToVector.js";import{equals as o}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as c}from"./measurementUtils.js";function s(n){return f(n,0)}function a(n){return f(n,1)}function f(e,r){const{hasZ:l,spatialReference:i}=e,u=c(i);let o=0;const s=t(u);if(null==s)return null;const a=0===r?g:j;for(const n of e.paths){if(n.length<2)continue;const t=n.length-1;for(let e=0;e<t;++e){const t=n[e];S[0]=t[0],S[1]=t[1],S[2]=l?t[2]:0;const r=n[e+1];M[0]=r[0],M[1]=r[1],M[2]=l?r[2]:0;const u=a(S,M,i);if(null==u)return null;o+=u.value}}return n(o,s)}function p(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(S[0]=n.x,S[1]=n.y,S[2]=n.hasZ?n.z:0,M[0]=t.x,M[1]=t.y,M[2]=t.hasZ?t.z:0,Z(S,M,e)):null}function h(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(S[0]=n.x,S[1]=n.y,S[2]=n.hasZ?n.z:0,M[0]=t.x,M[1]=t.y,M[2]=t.hasZ?t.z:0,g(S,M,e)):null}function m(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(S[0]=n.x,S[1]=n.y,S[2]=n.hasZ?n.z:0,M[0]=t.x,M[1]=t.y,M[2]=t.hasZ?t.z:0,j(S,M,e)):null}function z(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(S[0]=n.x,S[1]=n.y,S[2]=n.hasZ?n.z:0,M[0]=t.x,M[1]=t.y,M[2]=t.hasZ?t.z:0,v(S,M,e)):null}function x(n,t){const{spatialReference:e}=n;return o(e,t.spatialReference)?(S[0]=n.x,S[1]=n.y,S[2]=n.hasZ?n.z:0,M[0]=t.x,M[1]=t.y,M[2]=t.hasZ?t.z:0,d(S,M,e)):null}function y(n){return null!=n?R(n.hasZ?n.z:0,n.spatialReference):null}function R(t,r){const l=e(r);return null!=l?n(t??0,l):null}function Z(t,e,r){const l=b(t,e,r);return null!=l?{direct:n(l.direct,l.unit),horizontal:n(l.horizontal,l.unit),vertical:n(l.vertical,l.unit)}:null}function g(t,e,r){const l=b(t,e,r,0);return null!=l?n(l.direct,l.unit):null}function j(t,e,r){const l=b(t,e,r,1);return null!=l?n(l.horizontal,l.unit):null}function v(t,e,r){const l=b(t,e,r,2);return null!=l?n(Math.abs(l.verticalSigned),l.unit):null}function d(t,e,r){const l=b(t,e,r,2);return null!=l?n(l.verticalSigned,l.unit):null}function b(n,e,i,o){const s=c(i),a=t(s);if(null==a)return null;const f=e[2]-n[2];if(2===o)return{verticalSigned:f,unit:a};if(!u(n,i,U,s)||!u(e,i,V,s))return null;if(0===o){return{direct:r(V,U),unit:a}}if(l(q,n[0],n[1],e[2]),!u(q,i,q,s))return null;const p=r(q,V);if(1===o)return{horizontal:p,unit:a};return{direct:r(V,U),horizontal:p,vertical:Math.abs(f),unit:a}}const S=i(),M=i(),U=i(),V=i(),q=i();export{y as elevationFromPoint,R as elevationFromZ,g as euclideanDirectDistance,h as euclideanDirectDistanceBetweenPoints,Z as euclideanDistance,p as euclideanDistanceBetweenPoints,j as euclideanHorizontalDistance,m as euclideanHorizontalDistanceBetweenPoints,a as euclideanHorizontalLength,s as euclideanLength,v as verticalDistance,z as verticalDistanceBetweenPoints,d as verticalSignedDistance,x as verticalSignedDistanceBetweenPoints};
2
+ import{createLength as n}from"../../core/quantity.js";import{lengthUnitFromSpatialReference as t,verticalLengthUnitFromSpatialReference as e}from"../../core/units.js";import{distance as r,set as l}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../geometry/projection/projectVectorToVector.js";import{equals as u}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as c}from"./measurementUtils.js";function s(n){return a(n)}function a(e,r){const{hasZ:l,spatialReference:i}=e,o=c(i);let u=0;const s=t(o);if(null==s)return null;const a=R;for(const n of e.paths){if(n.length<2)continue;const t=n.length-1;for(let e=0;e<t;++e){const t=n[e];d[0]=t[0],d[1]=t[1],d[2]=l?t[2]:0;const r=n[e+1];b[0]=r[0],b[1]=r[1],b[2]=l?r[2]:0;const o=a(d,b,i);if(null==o)return null;u+=o.value}}return n(u,s)}function f(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,y(d,b,e)):null}function p(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,R(d,b,e)):null}function h(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,g(d,b,e)):null}function m(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,j(d,b,e)):null}function z(n){return null!=n?x(n.hasZ?n.z:0,n.spatialReference):null}function x(t,r){const l=e(r);return null!=l?n(t??0,l):null}function y(t,e,r){const l=v(t,e,r);return null!=l?{direct:n(l.direct,l.unit),horizontal:n(l.horizontal,l.unit),vertical:n(l.vertical,l.unit)}:null}function R(t,e,r){const l=v(t,e,r,0);return null!=l?n(l.direct,l.unit):null}function Z(t,e,r){const l=v(t,e,r,1);return null!=l?n(l.horizontal,l.unit):null}function g(t,e,r){const l=v(t,e,r,2);return null!=l?n(Math.abs(l.verticalSigned),l.unit):null}function j(t,e,r){const l=v(t,e,r,2);return null!=l?n(l.verticalSigned,l.unit):null}function v(n,e,i,u){const s=c(i),a=t(s);if(null==a)return null;const f=e[2]-n[2];if(2===u)return{verticalSigned:f,unit:a};if(!o(n,i,S,s)||!o(e,i,M,s))return null;if(0===u){return{direct:r(M,S),unit:a}}if(l(U,n[0],n[1],e[2]),!o(U,i,U,s))return null;const p=r(U,M);if(1===u)return{horizontal:p,unit:a};return{direct:r(M,S),horizontal:p,vertical:Math.abs(f),unit:a}}const d=i(),b=i(),S=i(),M=i(),U=i();export{z as elevationFromPoint,x as elevationFromZ,R as euclideanDirectDistance,p as euclideanDirectDistanceBetweenPoints,y as euclideanDistance,f as euclideanDistanceBetweenPoints,Z as euclideanHorizontalDistance,s as euclideanLength,g as verticalDistance,h as verticalDistanceBetweenPoints,j as verticalSignedDistance,m as verticalSignedDistanceBetweenPoints};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isGraphic as n}from"../../support/graphicInstanceUtils.js";function e(n){return!(null==n||"object"!=typeof n||!("id"in n)||!("type"in n))}function r(n){return!!(e(n)&&"on"in n&&n.on)}function t(n){return!!(e(n)&&"graphics"in n&&n.graphics)}function i(n){return!!(e(n)&&"fields"in n&&"fieldsIndex"in n&&"objectIdField"in n&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function u(n){return i(n)||t(n)}function c(n){return!!(null!=n&&"object"==typeof n&&"layer"in n&&n.layer&&e(n.layer)&&"view"in n)}function o(n){return!(!c(n)||!("queryGraphics"in n))}function a(n){return!!(c(n)&&"highlight"in n&&n.highlight)}function f(n){return!!(c(n)&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function l(n){return f(n)||o(n)}function y(n){return!(null==n||"object"!=typeof n||!("isTable"in n)||!n.isTable)}function s(e){return!!e.length&&n(e[0])}export{s as isGraphicsSelectionIdentifier,u as isSelectableLayer,e as isSelectableLayerBase,r as isSelectableLayerBaseWithEditing,l as isSelectableLayerView,c as isSelectableLayerViewBase,o as isSelectableLayerViewWithGraphics,a as isSelectableLayerViewWithHighlights,f as isSelectableLayerViewWithObjectIds,t as isSelectableLayerWithGraphics,i as isSelectableLayerWithObjectIds,y as isTableLayer};
2
+ function e(e){return!(null==e||"object"!=typeof e||!("id"in e)||!("type"in e))}function n(n){return!!(e(n)&&"on"in n&&n.on)}function r(n){return!!(e(n)&&"graphics"in n&&n.graphics)}function i(n){return!!(e(n)&&"fields"in n&&"fieldsIndex"in n&&"objectIdField"in n&&"createQuery"in n&&n.createQuery&&"queryFeatures"in n&&n.queryFeatures)}function t(e){return i(e)||r(e)}function u(n){return!!(null!=n&&"object"==typeof n&&"layer"in n&&n.layer&&e(n.layer)&&"view"in n)}function c(e){return!(!u(e)||!("queryGraphics"in e))}function o(e){return!!(u(e)&&"highlight"in e&&e.highlight)}function a(e){return!!(u(e)&&"createQuery"in e&&e.createQuery&&"queryFeatures"in e&&e.queryFeatures)}function f(e){return a(e)||c(e)}function l(e){return!(null==e||"object"!=typeof e||!("isTable"in e)||!e.isTable)}export{t as isSelectableLayer,e as isSelectableLayerBase,n as isSelectableLayerBaseWithEditing,f as isSelectableLayerView,u as isSelectableLayerViewBase,c as isSelectableLayerViewWithGraphics,o as isSelectableLayerViewWithHighlights,a as isSelectableLayerViewWithObjectIds,r as isSelectableLayerWithGraphics,i as isSelectableLayerWithObjectIds,l as isTableLayer};