@arcgis/core 4.33.0-next.20250515 → 4.33.0-next.20250517

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 (484) hide show
  1. package/Basemap.js +1 -1
  2. package/applications/Components/QuantityFormatter.d.ts +4 -0
  3. package/applications/Components/QuantityFormatter.js +5 -0
  4. package/applications/Components/baUtils.js +1 -1
  5. package/arcade/ArcadeDate.js +1 -1
  6. package/arcade/enum.js +5 -0
  7. package/arcade/featureset/actions/GroupBy.js +1 -1
  8. package/arcade/functions/convertdirection.js +1 -1
  9. package/arcade/functions/date.js +1 -1
  10. package/arcade/functions/featuresetbase.js +1 -1
  11. package/arcade/functions/geomasync.js +1 -1
  12. package/arcade/functions/geomsync.js +1 -1
  13. package/arcade/functions/string.js +1 -1
  14. package/arcade/geometry/functions.js +1 -1
  15. package/arcade/geometry/unitConversion.js +1 -1
  16. package/assets/esri/core/workers/RemoteClient.js +1 -1
  17. package/assets/esri/core/workers/chunks/{0fd6d80393722132e044.js → 0229c573fa8a2fff2d8b.js} +2 -2
  18. package/assets/esri/core/workers/chunks/{d21d9e8b8c8a2e0485d5.js → 094e8aae6dada24c8115.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ffaa977cd97a2b7190c5.js → 0c2dccec20c0994366fe.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{8f1fbfdac04e694f621d.js → 0c50ee1f3cdd30d96479.js} +1 -1
  21. package/assets/esri/core/workers/chunks/151d6354e7bc105b25c0.js +346 -0
  22. package/assets/esri/core/workers/chunks/1cf0fae3f2e848a2a738.js +1 -0
  23. package/assets/esri/core/workers/chunks/24327d01cb2c5c55a4b7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{1a010d877b8428e755fb.js → 2841888fdbc2770e90c8.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7e1dc8e5e18f18dd21e2.js → 29fb64826bb1351aca8d.js} +2 -2
  26. package/assets/esri/core/workers/chunks/{1f4fd9e3849f4e593375.js → 2b1486a466760d2152f5.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{4e0d2458f4d7a35bb97c.js → 2ce5cc797ae0d66c8678.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{9d564f79b82d427fc1da.js → 2fd30428309f4c517d4c.js} +1 -1
  29. package/assets/esri/core/workers/chunks/3ca6f893fd58f5b17af5.js +1 -0
  30. package/assets/esri/core/workers/chunks/{52d160cb7921ae7a4f57.js → 3fc44d8cef392b4b9c7a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +1 -0
  32. package/assets/esri/core/workers/chunks/{4cb199b547e5b97e65fb.js → 48cedef1c926d11164b7.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{563594357f3648652a5c.js → 4b21c4815533a43835c3.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{d166f805990353578494.js → 523046e04679e301797d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{921c040d0497031fd8ff.js → 54da9c7fd1088a8076ce.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{ab9614555a15f04396f6.js → 54f981fe0f8851767be9.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{28d9e2ffc3059a55311e.js → 59f701c30bcd9088b291.js} +1 -1
  38. package/assets/esri/core/workers/chunks/5d50a8d0427eab0a2514.js +1 -0
  39. package/assets/esri/core/workers/chunks/5f4ca51b82daf0e51010.js +1 -0
  40. package/assets/esri/core/workers/chunks/{05c80002c37002ac99e8.js → 5f6719286a6c9a3ac74b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{a09b5700c92bb76c3234.js → 638ecabe3e22978af5a3.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{9fff43ffcd5602ccc50f.js → 649caffe8f5dbaad0d7b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{4480e4b61affb3b2e9d6.js → 6648e68f00d28e12bcf9.js} +1 -1
  44. package/assets/esri/core/workers/chunks/66a1b92358344dd28ee1.js +1 -0
  45. package/assets/esri/core/workers/chunks/{b92a34f88569c481ed10.js → 67338948e470c1251d8a.js} +3 -3
  46. package/assets/esri/core/workers/chunks/{a8d043b73e087bee7c40.js → 67c5f1112a7c65e9eeff.js} +1 -1
  47. package/assets/esri/core/workers/chunks/6a225393b63e1e8c7933.js +1 -0
  48. package/assets/esri/core/workers/chunks/6c29a768f02dc7ce0ed6.js +1 -0
  49. package/assets/esri/core/workers/chunks/{fbd2f45d5adce4ca323f.js → 73ddb356121add556994.js} +2 -2
  50. package/assets/esri/core/workers/chunks/{a6ca68ef6311ffc365b2.js → 73e179b04bb931ca9b86.js} +1 -1
  51. package/assets/esri/core/workers/chunks/7678177555570682154e.js +1 -0
  52. package/assets/esri/core/workers/chunks/7a9a0383f27f4967bcfa.js +1 -0
  53. package/assets/esri/core/workers/chunks/7b9d14cc4a466ef18d71.js +1 -0
  54. package/assets/esri/core/workers/chunks/7e6141b5baae47682f97.js +1 -0
  55. package/assets/esri/core/workers/chunks/{257db39a1ba1a11ebfb4.js → 8365707e408d19988356.js} +1 -1
  56. package/assets/esri/core/workers/chunks/87fc7b6c3e2d4f7775e2.js +1 -0
  57. package/assets/esri/core/workers/chunks/8a2cee726b7843c7408a.js +1 -0
  58. package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 8eadf90d938753691044.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{ff4e7da880b206fd98ec.js → 9049c81445cc044286f1.js} +1 -1
  60. package/assets/esri/core/workers/chunks/9588328d4ed6b0f04166.js +2 -0
  61. package/assets/esri/core/workers/chunks/{dcf5719f38ad40b92941.js → 9826a1c66885dbbdc130.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{3b4b4f84d594db8945f9.js → 9839309d0cd804fe52c2.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{c10885b3a0739708e9e0.js → 9a06476b834584d00d5c.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{4954e0cf4a40e45d237f.js → 9c8e66da6cf32ace0914.js} +1 -1
  65. package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +1 -0
  66. package/assets/esri/core/workers/chunks/{d60da671aba70485050e.js → 9f18392933c06f1d63b6.js} +1 -1
  67. package/assets/esri/core/workers/chunks/a937076d2f8c2b6a5d8a.js +1 -0
  68. package/assets/esri/core/workers/chunks/{c3b2b05996e2008adbe3.js → a9f16323666042a9d47f.js} +1 -1
  69. package/assets/esri/core/workers/chunks/aad9a693813b47a51530.js +2 -0
  70. package/assets/esri/core/workers/chunks/{654fe135d41af81daa13.js → be1f3cac908c28c64401.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{5e52c1c076a1502f9fe4.js → be2c8c0a8b2bce7979b6.js} +1 -1
  72. package/assets/esri/core/workers/chunks/bf4d9cdcbe6bb8bc9d39.js +1 -0
  73. package/assets/esri/core/workers/chunks/{d49518eb4b351afc5f00.js → ca3851ca2621879eb887.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{56db71ea7eb8a5652d98.js → ca62e7ec102a1bb879dc.js} +1 -1
  75. package/assets/esri/core/workers/chunks/cb16ba9512ae0a09c55d.js +1 -0
  76. package/assets/esri/core/workers/chunks/{8c1242ffd48b3ef800fa.js → d103e184ddf9beec779d.js} +1 -1
  77. package/assets/esri/core/workers/chunks/d3d98ea5b5e56fc60a31.js +1 -0
  78. package/assets/esri/core/workers/chunks/{5719471414810b6a9aec.js → d9d9180689bcf71af00f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{dcaeb57c69d432118604.js → db13c93b4d708a2481db.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{2c3bfa75286376388806.js → db192728fa0ee08a776a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{40b8e53c8b1c447eff7e.js → e2d012078d51dc2b2802.js} +1 -1
  82. package/assets/esri/core/workers/chunks/e385a27fd1ac2123a05f.js +1 -0
  83. package/assets/esri/core/workers/chunks/{e85f892ea44d67d53ff0.js → f3b51aa0a1a8fc3b231c.js} +2 -2
  84. package/assets/esri/core/workers/chunks/f74f8ed3f17713a208c3.js +1 -0
  85. package/assets/esri/core/workers/chunks/f9567108862629f25c8b.js +1 -0
  86. package/assets/esri/core/workers/chunks/fa99abc572b382e7e0c7.js +1 -0
  87. package/assets/esri/themes/base/widgets/_Directions.scss +74 -0
  88. package/assets/esri/themes/base/widgets/_Editor.scss +2 -1
  89. package/assets/esri/themes/base/widgets/_SearchResultRenderer.scss +5 -30
  90. package/assets/esri/themes/dark/main.css +1 -1
  91. package/assets/esri/themes/light/main.css +1 -1
  92. package/assets/esri/themes/light/view.css +1 -1
  93. package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
  94. package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
  95. package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
  96. package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
  97. package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
  98. package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
  99. package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
  100. package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
  101. package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
  102. package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
  103. package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
  104. package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
  105. package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
  106. package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
  107. package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
  108. package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
  109. package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
  110. package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
  111. package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
  112. package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
  113. package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
  114. package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
  115. package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
  116. package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
  117. package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
  118. package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
  119. package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
  120. package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
  121. package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
  122. package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
  123. package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
  124. package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
  125. package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
  126. package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
  127. package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
  128. package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
  129. package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
  130. package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
  131. package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
  132. package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
  133. package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
  134. package/assets/esri/widgets/Search/t9n/Search.json +1 -1
  135. package/assets/esri/widgets/Search/t9n/Search_ar.json +1 -1
  136. package/assets/esri/widgets/Search/t9n/Search_bg.json +1 -1
  137. package/assets/esri/widgets/Search/t9n/Search_bs.json +1 -1
  138. package/assets/esri/widgets/Search/t9n/Search_ca.json +1 -1
  139. package/assets/esri/widgets/Search/t9n/Search_cs.json +1 -1
  140. package/assets/esri/widgets/Search/t9n/Search_da.json +1 -1
  141. package/assets/esri/widgets/Search/t9n/Search_de.json +1 -1
  142. package/assets/esri/widgets/Search/t9n/Search_el.json +1 -1
  143. package/assets/esri/widgets/Search/t9n/Search_en.json +1 -1
  144. package/assets/esri/widgets/Search/t9n/Search_es.json +1 -1
  145. package/assets/esri/widgets/Search/t9n/Search_et.json +1 -1
  146. package/assets/esri/widgets/Search/t9n/Search_fi.json +1 -1
  147. package/assets/esri/widgets/Search/t9n/Search_fr.json +1 -1
  148. package/assets/esri/widgets/Search/t9n/Search_he.json +1 -1
  149. package/assets/esri/widgets/Search/t9n/Search_hr.json +1 -1
  150. package/assets/esri/widgets/Search/t9n/Search_hu.json +1 -1
  151. package/assets/esri/widgets/Search/t9n/Search_id.json +1 -1
  152. package/assets/esri/widgets/Search/t9n/Search_it.json +1 -1
  153. package/assets/esri/widgets/Search/t9n/Search_ja.json +1 -1
  154. package/assets/esri/widgets/Search/t9n/Search_ko.json +1 -1
  155. package/assets/esri/widgets/Search/t9n/Search_lt.json +1 -1
  156. package/assets/esri/widgets/Search/t9n/Search_lv.json +1 -1
  157. package/assets/esri/widgets/Search/t9n/Search_nl.json +1 -1
  158. package/assets/esri/widgets/Search/t9n/Search_no.json +1 -1
  159. package/assets/esri/widgets/Search/t9n/Search_pl.json +1 -1
  160. package/assets/esri/widgets/Search/t9n/Search_pt-BR.json +1 -1
  161. package/assets/esri/widgets/Search/t9n/Search_pt-PT.json +1 -1
  162. package/assets/esri/widgets/Search/t9n/Search_ro.json +1 -1
  163. package/assets/esri/widgets/Search/t9n/Search_ru.json +1 -1
  164. package/assets/esri/widgets/Search/t9n/Search_sk.json +1 -1
  165. package/assets/esri/widgets/Search/t9n/Search_sl.json +1 -1
  166. package/assets/esri/widgets/Search/t9n/Search_sr.json +1 -1
  167. package/assets/esri/widgets/Search/t9n/Search_sv.json +1 -1
  168. package/assets/esri/widgets/Search/t9n/Search_th.json +1 -1
  169. package/assets/esri/widgets/Search/t9n/Search_tr.json +1 -1
  170. package/assets/esri/widgets/Search/t9n/Search_uk.json +1 -1
  171. package/assets/esri/widgets/Search/t9n/Search_vi.json +1 -1
  172. package/assets/esri/widgets/Search/t9n/Search_zh-CN.json +1 -1
  173. package/assets/esri/widgets/Search/t9n/Search_zh-HK.json +1 -1
  174. package/assets/esri/widgets/Search/t9n/Search_zh-TW.json +1 -1
  175. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ar.json +1 -0
  176. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_bg.json +1 -0
  177. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_bs.json +1 -0
  178. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ca.json +1 -0
  179. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_cs.json +1 -0
  180. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_da.json +1 -0
  181. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_de.json +1 -0
  182. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_el.json +1 -0
  183. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_es.json +1 -0
  184. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_et.json +1 -0
  185. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_fi.json +1 -0
  186. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_fr.json +1 -0
  187. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_he.json +1 -0
  188. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_hr.json +1 -0
  189. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_hu.json +1 -0
  190. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_id.json +1 -0
  191. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_it.json +1 -0
  192. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ja.json +1 -0
  193. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ko.json +1 -0
  194. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_lt.json +1 -0
  195. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_lv.json +1 -0
  196. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_nl.json +1 -0
  197. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_no.json +1 -0
  198. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pl.json +1 -0
  199. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pt-BR.json +1 -0
  200. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_pt-PT.json +1 -0
  201. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ro.json +1 -0
  202. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_ru.json +1 -0
  203. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sk.json +1 -0
  204. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sl.json +1 -0
  205. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sr.json +1 -0
  206. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_sv.json +1 -0
  207. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_th.json +1 -0
  208. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_tr.json +1 -0
  209. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_uk.json +1 -0
  210. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_vi.json +1 -0
  211. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-CN.json +1 -0
  212. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-HK.json +1 -0
  213. package/assets/esri/widgets/support/FilterBuilder/t9n/FilterBuilder_zh-TW.json +1 -0
  214. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ar.json +1 -0
  215. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_bg.json +1 -0
  216. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_bs.json +1 -0
  217. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ca.json +1 -0
  218. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_cs.json +1 -0
  219. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_da.json +1 -0
  220. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_de.json +1 -0
  221. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_el.json +1 -0
  222. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_es.json +1 -0
  223. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_et.json +1 -0
  224. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_fi.json +1 -0
  225. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_fr.json +1 -0
  226. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_he.json +1 -0
  227. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_hr.json +1 -0
  228. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_hu.json +1 -0
  229. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_id.json +1 -0
  230. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_it.json +1 -0
  231. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ja.json +1 -0
  232. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ko.json +1 -0
  233. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_lt.json +1 -0
  234. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_lv.json +1 -0
  235. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_nl.json +1 -0
  236. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_no.json +1 -0
  237. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pl.json +1 -0
  238. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pt-BR.json +1 -0
  239. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_pt-PT.json +1 -0
  240. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ro.json +1 -0
  241. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_ru.json +1 -0
  242. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sk.json +1 -0
  243. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sl.json +1 -0
  244. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sr.json +1 -0
  245. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_sv.json +1 -0
  246. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_th.json +1 -0
  247. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_tr.json +1 -0
  248. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_uk.json +1 -0
  249. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_vi.json +1 -0
  250. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-CN.json +1 -0
  251. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-HK.json +1 -0
  252. package/assets/esri/widgets/support/FilterCondition/t9n/FilterCondition_zh-TW.json +1 -0
  253. package/chunks/Bufferer-Dw9Qi4T1.js +5 -0
  254. package/chunks/Distance2DCalculator-CXhBP-8I.js +5 -0
  255. package/chunks/Envelope.js +1 -1
  256. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +5 -0
  257. package/chunks/Geometry.js +1 -1
  258. package/chunks/MultiPathImpl.js +5 -0
  259. package/chunks/OperatorClip.js +1 -1
  260. package/chunks/OperatorCut.js +1 -1
  261. package/chunks/OperatorDensify.js +1 -1
  262. package/chunks/OperatorGeneralize.js +1 -1
  263. package/chunks/OperatorGeodesicBuffer.js +1 -1
  264. package/chunks/OperatorGeodeticArea.js +1 -1
  265. package/chunks/OperatorGeodeticDistance.js +1 -1
  266. package/chunks/OperatorGeodeticLength.js +1 -1
  267. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  268. package/chunks/OperatorProximityGeodesic.js +1 -1
  269. package/chunks/OperatorShapePreservingLength.js +1 -1
  270. package/chunks/OperatorShapePreservingProject.js +1 -1
  271. package/chunks/Point2D.js +1 -1
  272. package/chunks/ProjectionTransformation.js +1 -1
  273. package/chunks/ShadowCastClear.glsl.js +5 -0
  274. package/chunks/distanceOperator.js +1 -1
  275. package/config.js +1 -1
  276. package/geometry/operators/extendOperator.js +1 -1
  277. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  278. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  279. package/geometry/operators/gx/operatorBoundary.js +1 -1
  280. package/geometry/operators/gx/operatorBuffer.js +1 -1
  281. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  282. package/geometry/operators/gx/operatorDifference.js +1 -1
  283. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  284. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  285. package/geometry/operators/gx/operatorIntersection.js +1 -1
  286. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  287. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  288. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  289. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  290. package/geometry/operators/gx/operatorOffset.js +1 -1
  291. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  292. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  293. package/geometry/operators/gx/operatorSimplify.js +1 -1
  294. package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
  295. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  296. package/geometry/operators/gx/operatorUnion.js +1 -1
  297. package/geometry/operators/isNearOperator.js +1 -1
  298. package/geometry/operators/reshapeOperator.js +1 -1
  299. package/geometry/operators/support/apiConverter.js +1 -1
  300. package/geometry/operators/support/initNoPeFactory.js +1 -1
  301. package/geometry/operators/support/jsonConverter.js +1 -1
  302. package/geometry/support/aaBoundingBox.js +1 -1
  303. package/geometry.js +1 -1
  304. package/interfaces.d.ts +205 -51
  305. package/layers/KnowledgeGraphLayer.js +1 -1
  306. package/layers/LinkChartLayer.js +1 -1
  307. package/layers/graphics/sources/support/QueryTask.js +1 -1
  308. package/package.json +2 -2
  309. package/pointCloudRenderers.js +1 -1
  310. package/portal/Portal.js +1 -1
  311. package/rasterRenderers.js +1 -1
  312. package/renderers.js +1 -1
  313. package/request.js +1 -1
  314. package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +1 -1
  315. package/rest/knowledgeGraph/GraphAddPropertyResult.js +5 -0
  316. package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
  317. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +1 -1
  318. package/rest/knowledgeGraph/GraphDeletePropertyResult.js +5 -0
  319. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.js +5 -0
  320. package/rest/knowledgeGraph/GraphUpdatePropertyResult.js +5 -0
  321. package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
  322. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
  323. package/rest/knowledgeGraphService.js +1 -1
  324. package/rest/networks/unitIdentifiers/insertGap.js +5 -0
  325. package/rest/networks/unitIdentifiers/queryUnitIdentifiers.js +5 -0
  326. package/rest/networks/unitIdentifiers/reset.js +5 -0
  327. package/rest/networks/unitIdentifiers/resize.js +5 -0
  328. package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +5 -0
  329. package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParamters.js +5 -0
  330. package/rest/networks/unitIdentifiers/support/ResetParameters.js +5 -0
  331. package/rest/networks/unitIdentifiers/support/ResizeParameters.js +5 -0
  332. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +5 -0
  333. package/rest/query/executeForCount.js +1 -1
  334. package/rest/utils.js +1 -1
  335. package/support/apiKeyUtils.js +1 -1
  336. package/support/basemapEnsureType.js +1 -1
  337. package/support/revision.js +1 -1
  338. package/symbols.js +1 -1
  339. package/unionTypes.d.ts +2 -0
  340. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  341. package/views/3d/FocusAreasView.js +1 -1
  342. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementController.js +1 -1
  343. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  344. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  345. package/views/3d/analysis/Dimension/DimensionController.js +1 -1
  346. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  347. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  348. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  349. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  350. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  351. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  352. package/views/3d/analysis/support/measurementUtils.js +1 -1
  353. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  354. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  355. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  356. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  357. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
  358. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  359. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  360. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  361. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  362. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  363. package/views/3d/layers/ContentGeometryLayerView.js +5 -0
  364. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  365. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  366. package/views/3d/layers/FlowSubView3D.js +1 -1
  367. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  368. package/views/3d/layers/I3SMeshView3D.js +1 -1
  369. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  370. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  371. package/views/3d/layers/RouteLayerView3D.js +1 -1
  372. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  373. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  374. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  375. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  376. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  377. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  378. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  379. package/views/3d/layers/graphics/Labeler.js +1 -1
  380. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +1 -1
  381. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  382. package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
  383. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  384. package/views/3d/terrain/TerrainRenderer.js +1 -1
  385. package/views/3d/terrain/TerrainSurface.js +1 -1
  386. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  387. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  388. package/views/3d/webgl-engine/shaders/ShadowCastClear.glsl.js +5 -0
  389. package/views/3d/webgl-engine/shaders/ShadowCastClearTechnique.js +5 -0
  390. package/views/LinkChartView.js +1 -1
  391. package/views/draw/DrawAction.js +1 -1
  392. package/views/draw/DrawGraphicTool.js +1 -1
  393. package/views/draw/DrawOperation.js +1 -1
  394. package/views/draw/DrawScreenTool.js +1 -1
  395. package/views/draw/DrawTool.js +1 -1
  396. package/views/draw/PointDrawAction.js +1 -1
  397. package/views/draw/PolygonDrawAction.js +1 -1
  398. package/views/draw/PolylineDrawAction.js +1 -1
  399. package/views/draw/SegmentDrawAction.js +1 -1
  400. package/views/draw/support/Box.js +1 -1
  401. package/views/draw/support/Reshape.js +1 -1
  402. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  403. package/views/draw/support/tooltipUtils.js +1 -1
  404. package/views/interactive/SegmentLabels.js +1 -1
  405. package/views/interactive/coordinateHelper.js +1 -1
  406. package/views/interactive/snapping/LineSnapper.js +1 -1
  407. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  408. package/views/interactive/snapping/SelfSnappingEngine.js +1 -1
  409. package/views/interactive/snapping/SnappingManager.js +1 -1
  410. package/views/support/automaticAreaMeasurementUtils.js +1 -1
  411. package/views/support/automaticLengthMeasurementUtils.js +1 -1
  412. package/views/support/extentUtils.js +1 -1
  413. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  414. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  415. package/views/support/geodesicMeasurementUtils.js +1 -1
  416. package/views/support/layerViewUtils.js +1 -1
  417. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  418. package/widgets/BasemapLayerList.js +1 -1
  419. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  420. package/widgets/BatchAttributeForm.js +1 -1
  421. package/widgets/CatalogLayerList.js +1 -1
  422. package/widgets/Directions/css.js +1 -1
  423. package/widgets/Directions.js +1 -1
  424. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  425. package/widgets/Editor/EditorViewModel.js +1 -1
  426. package/widgets/Editor/UpdateFeaturesWorkflow.d.ts +4 -0
  427. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  428. package/widgets/Editor/UpdateFeaturesWorkflowData.d.ts +4 -0
  429. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  430. package/widgets/Editor/UpdateWorkflow.js +1 -1
  431. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  432. package/widgets/Editor/support/SketchController.js +1 -1
  433. package/widgets/Editor/workflowUtils.js +1 -1
  434. package/widgets/Editor.js +1 -1
  435. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  436. package/widgets/LayerList.js +1 -1
  437. package/widgets/Search/SearchResultRenderer.js +1 -1
  438. package/widgets/Search/SearchViewModel.js +1 -1
  439. package/widgets/Search/searchResultRendererCSS.js +1 -1
  440. package/widgets/Sketch/SketchViewModel.js +1 -1
  441. package/widgets/TableList.js +1 -1
  442. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  443. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  444. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  445. package/widgets/support/SelectionList.js +1 -1
  446. package/widgets/support/SelectionToolbar.js +1 -1
  447. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  448. package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +0 -1
  449. package/assets/esri/core/workers/chunks/0817ddd885ce8b2459cb.js +0 -1
  450. package/assets/esri/core/workers/chunks/0cce3770591b0730cf22.js +0 -1
  451. package/assets/esri/core/workers/chunks/1991f0d0f0a12175f849.js +0 -1
  452. package/assets/esri/core/workers/chunks/1f194ffea16cc6595ecc.js +0 -1
  453. package/assets/esri/core/workers/chunks/297d2c0a9d3f1e978318.js +0 -1
  454. package/assets/esri/core/workers/chunks/394b9723d108cff7136e.js +0 -1
  455. package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +0 -1
  456. package/assets/esri/core/workers/chunks/52a3d0e041717da7697e.js +0 -1
  457. package/assets/esri/core/workers/chunks/62798f66872dc32e77d6.js +0 -346
  458. package/assets/esri/core/workers/chunks/6b42bcfbb60432e3ed1f.js +0 -1
  459. package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +0 -1
  460. package/assets/esri/core/workers/chunks/8e82acd1f730571680f4.js +0 -1
  461. package/assets/esri/core/workers/chunks/a0d2bd5d4ed3c90f6b1c.js +0 -1
  462. package/assets/esri/core/workers/chunks/a673128da9e6656ead2e.js +0 -1
  463. package/assets/esri/core/workers/chunks/a9b1f4bf5eaa937943be.js +0 -1
  464. package/assets/esri/core/workers/chunks/b52b28a6f422b10ff166.js +0 -1
  465. package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +0 -1
  466. package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +0 -1
  467. package/assets/esri/core/workers/chunks/cd5c380196db7fb55242.js +0 -1
  468. package/assets/esri/core/workers/chunks/ce321fd8fc5551e190ec.js +0 -1
  469. package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +0 -1
  470. package/assets/esri/core/workers/chunks/d6ab65ad864782c50705.js +0 -1
  471. package/assets/esri/core/workers/chunks/da3c62a851a4332f6dda.js +0 -1
  472. package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +0 -2
  473. package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +0 -2
  474. package/chunks/Bufferer-CicaNej1.js +0 -5
  475. package/chunks/Distance2DCalculator-C1KHhZwD.js +0 -5
  476. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +0 -5
  477. package/chunks/QuadraticBezier.js +0 -5
  478. /package/assets/esri/core/workers/chunks/{0fd6d80393722132e044.js.LICENSE.txt → 0229c573fa8a2fff2d8b.js.LICENSE.txt} +0 -0
  479. /package/assets/esri/core/workers/chunks/{7e1dc8e5e18f18dd21e2.js.LICENSE.txt → 29fb64826bb1351aca8d.js.LICENSE.txt} +0 -0
  480. /package/assets/esri/core/workers/chunks/{ab9614555a15f04396f6.js.LICENSE.txt → 54f981fe0f8851767be9.js.LICENSE.txt} +0 -0
  481. /package/assets/esri/core/workers/chunks/{fbd2f45d5adce4ca323f.js.LICENSE.txt → 73ddb356121add556994.js.LICENSE.txt} +0 -0
  482. /package/assets/esri/core/workers/chunks/{db3f710d770adf631b28.js.LICENSE.txt → 9588328d4ed6b0f04166.js.LICENSE.txt} +0 -0
  483. /package/assets/esri/core/workers/chunks/{f4c6ea630cecf0f260d7.js.LICENSE.txt → aad9a693813b47a51530.js.LICENSE.txt} +0 -0
  484. /package/assets/esri/core/workers/chunks/{e85f892ea44d67d53ff0.js.LICENSE.txt → f3b51aa0a1a8fc3b231c.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{toUnit as o}from"../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{adaptiveLengthUnit as n,adaptiveVerticalLengthUnit as a}from"../../../../core/unitUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{MeasurementMode as u}from"../interfaces.js";import{applyProjectionAndElevationAlignment as p,logFailedGeometryProjectionError as m}from"../support/projectionUtils.js";import{euclideanDistanceBetweenPoints as d}from"../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistanceBetweenPoints as v}from"../../../support/geodesicLengthMeasurementUtils.js";let h=class extends e{constructor(t){super(t)}initialize(){this.addHandles([r((()=>({viewData:this.viewData,startPoint:this.analysis.startPoint})),(({viewData:t,startPoint:e})=>{t.elevationAlignedStartPoint=this._applyProjectionAndElevationAlignment(e)}),s),r((()=>({viewData:this.viewData,endPoint:this.analysis.endPoint})),(({viewData:t,endPoint:e})=>{t.elevationAlignedEndPoint=this._applyProjectionAndElevationAlignment(e)}),s),r((()=>({result:this._computedResult,viewData:this.viewData})),(({result:t,viewData:e})=>{e.result=t}),s)])}_applyProjectionAndElevationAlignment(t){if(null==t)return t;const{spatialReference:e,elevationProvider:o}=this.view,r=p(t,e,o);return r??(m(this.analysis,t.spatialReference,i.getLogger(this)),null)}get _computedResult(){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:e,measurementMode:i,unit:r}=this.viewData;if(null==t||null==e)return null;const s=d(t,e),l=v(t,e);if(null==s)return null;let c,p;switch(i){case u.Auto:p=null!=l?"geodesic":"euclidean",c=l??s.horizontal;break;case u.Geodesic:if(null==l)return null;p="geodesic",c=l;break;case u.Euclidean:p="euclidean",c=s.horizontal}let m=s.direct,h=s.vertical;const f=n(m.value,m.unit,r),g=n(c.value,c.unit,r),j=a(h.value,h.unit,r);return m=o(m,f),c=o(c,g),h=o(h,j),{mode:p,directDistance:m,horizontalDistance:c,verticalDistance:h}}};t([l()],h.prototype,"view",void 0),t([l()],h.prototype,"analysis",void 0),t([l()],h.prototype,"viewData",void 0),t([l()],h.prototype,"_computedResult",null),h=t([c("esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController")],h);export{h as DirectLineMeasurementController};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{toUnit as o}from"../../../../core/quantityUtils.js";import{watch as n,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{adaptiveLengthUnit as s,adaptiveVerticalLengthUnit as a}from"../../../../core/unitUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{MeasurementMode as u}from"../interfaces.js";import{applyProjectionAndElevationAlignment as p,logFailedGeometryProjectionError as d}from"../support/projectionUtils.js";import{euclideanDistanceBetweenPoints as m}from"../../../support/euclideanLengthMeasurementUtils.js";let v=class extends e{constructor(t){super(t)}initialize(){this.addHandles([n((()=>({viewData:this.viewData,startPoint:this.analysis.startPoint})),(({viewData:t,startPoint:e})=>{t.elevationAlignedStartPoint=this._applyProjectionAndElevationAlignment(e)}),r),n((()=>({viewData:this.viewData,endPoint:this.analysis.endPoint})),(({viewData:t,endPoint:e})=>{t.elevationAlignedEndPoint=this._applyProjectionAndElevationAlignment(e)}),r),n((()=>({result:this._computedResult,viewData:this.viewData})),(({result:t,viewData:e})=>{e.result=t}),r)])}_applyProjectionAndElevationAlignment(t){if(null==t)return t;const{spatialReference:e,elevationProvider:o}=this.view,n=p(t,e,o);return n??(d(this.analysis,t.spatialReference,i.getLogger(this)),null)}get _computedResult(){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:e,measurementMode:i,unit:n}=this.viewData;if(null==t||null==e)return null;const r=m(t,e),l=this.geodesicLengthMeasurementUtils.geodesicDistanceBetweenPoints(t,e);if(null==r)return null;let c,p;switch(i){case u.Auto:p=null!=l?"geodesic":"euclidean",c=l??r.horizontal;break;case u.Geodesic:if(null==l)return null;p="geodesic",c=l;break;case u.Euclidean:p="euclidean",c=r.horizontal}let d=r.direct,v=r.vertical;const h=s(d.value,d.unit,n),g=s(c.value,c.unit,n),y=a(v.value,v.unit,n);return d=o(d,h),c=o(c,g),v=o(v,y),{mode:p,directDistance:d,horizontalDistance:c,verticalDistance:v}}};t([l({constructOnly:!0})],v.prototype,"view",void 0),t([l({constructOnly:!0})],v.prototype,"analysis",void 0),t([l({constructOnly:!0})],v.prototype,"viewData",void 0),t([l({constructOnly:!0})],v.prototype,"geodesicLengthMeasurementUtils",void 0),t([l()],v.prototype,"_computedResult",null),v=t([c("esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController")],v);export{v as DirectLineMeasurementController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{abortMaybe as a,destroyMaybe as s}from"../../../core/maybe.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as o}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as r}from"./AnalysisView3D.js";import{MeasurementMode as u}from"./interfaces.js";import{DirectLineMeasurementController as p}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as y}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import h from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as m,removeAnalysisViewTool as d,startExclusiveInteractiveOperation as c}from"../../analysis/analysisViewUtils.js";let v=class extends(r(e)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.tool=null,this.result=null,this.measurementMode=u.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){const{analysis:t,view:e}=this;this._analysisVisualization=new y({view:e,analysis:t,analysisView:this}),this._analysisController=new p({view:e,analysis:t,viewData:this}),this.addHandles(m(this,h))}destroy(){d(this),this.userOperation=a(this.userOperation),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct?.text??""}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??""}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??""}get unit(){return this.analysis.unit??o(this.view)}get testData(){}place(t){if(this.analysis.valid)throw new i("DirectLineMeasurementAnalysisView3D:place","Cannot place a direct line measurement when the analysis already has a start and end point.");return c(this,{abortOptions:t})}};t([l()],v.prototype,"_analysisVisualization",void 0),t([l()],v.prototype,"_analysisController",void 0),t([l()],v.prototype,"updating",null),t([l({readOnly:!0})],v.prototype,"type",void 0),t([l({constructOnly:!0,nonNullable:!0})],v.prototype,"analysis",void 0),t([l()],v.prototype,"tool",void 0),t([l()],v.prototype,"result",void 0),t([l()],v.prototype,"measurementMode",void 0),t([l()],v.prototype,"elevationAlignedStartPoint",void 0),t([l()],v.prototype,"elevationAlignedEndPoint",void 0),t([l({readOnly:!0})],v.prototype,"viewMode",null),t([l({readOnly:!0})],v.prototype,"actualVisualizedMeasurement",null),t([l()],v.prototype,"visualElementOrientation",null),t([l()],v.prototype,"allowVisualElementsOrientationChange",null),t([l()],v.prototype,"triangleCollapseRatioThreshold",null),t([l({readOnly:!0})],v.prototype,"directLabelText",null),t([l({readOnly:!0})],v.prototype,"horizontalLabelText",null),t([l({readOnly:!0})],v.prototype,"verticalLabelText",null),t([l()],v.prototype,"unit",null),t([l()],v.prototype,"userOperation",void 0),v=t([n("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],v);const g=v;export{g as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import"../../../core/has.js";import{abortMaybe as i,destroyMaybe as s}from"../../../core/maybe.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as l}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as n}from"./AnalysisView3D.js";import{MeasurementMode as r}from"./interfaces.js";import{DirectLineMeasurementController as u}from"./DirectLineMeasurement/DirectLineMeasurementController.js";import{DirectLineMeasurementVisualization as p}from"./DirectLineMeasurement/DirectLineMeasurementVisualization.js";import y from"../interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js";import{connectAnalysisViewToTool as h,removeAnalysisViewTool as m,startExclusiveInteractiveOperation as d}from"../../analysis/analysisViewUtils.js";import{loadGeodesicLengthMeasurementUtils as c}from"../../support/geodesicLengthMeasurementUtils.js";let g=class extends(n(e)){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.tool=null,this.result=null,this.measurementMode=r.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null,this.userOperation=null}initialize(){const{analysis:t,view:e}=this;this._analysisVisualization=new p({view:e,analysis:t,analysisView:this}),this.addResolvingPromise(c().then((i=>{this.destroyed||(this._analysisController=new u({view:e,analysis:t,viewData:this,geodesicLengthMeasurementUtils:i}))}))),this.addHandles(h(this,y))}destroy(){m(this),this.userOperation=i(this.userOperation),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization)}get updating(){return!!this._analysisVisualization?.loadingMessages}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){return this._analysisVisualization.labels.direct?.text??""}get horizontalLabelText(){return this._analysisVisualization.labels.horizontal?.text??""}get verticalLabelText(){return this._analysisVisualization.labels.vertical?.text??""}get unit(){return this.analysis.unit??l(this.view)}get testData(){}place(t){return d(this,{abortOptions:t})}};t([a()],g.prototype,"_analysisVisualization",void 0),t([a()],g.prototype,"_analysisController",void 0),t([a()],g.prototype,"updating",null),t([a({readOnly:!0})],g.prototype,"type",void 0),t([a({constructOnly:!0,nonNullable:!0})],g.prototype,"analysis",void 0),t([a()],g.prototype,"tool",void 0),t([a()],g.prototype,"result",void 0),t([a()],g.prototype,"measurementMode",void 0),t([a()],g.prototype,"elevationAlignedStartPoint",void 0),t([a()],g.prototype,"elevationAlignedEndPoint",void 0),t([a({readOnly:!0})],g.prototype,"viewMode",null),t([a({readOnly:!0})],g.prototype,"actualVisualizedMeasurement",null),t([a()],g.prototype,"visualElementOrientation",null),t([a()],g.prototype,"allowVisualElementsOrientationChange",null),t([a()],g.prototype,"triangleCollapseRatioThreshold",null),t([a({readOnly:!0})],g.prototype,"directLabelText",null),t([a({readOnly:!0})],g.prototype,"horizontalLabelText",null),t([a({readOnly:!0})],g.prototype,"verticalLabelText",null),t([a()],g.prototype,"unit",null),t([a()],g.prototype,"userOperation",void 0),g=t([o("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],g);const v=g;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{updatePointsFromFeatureReference as t,getFeatureId as o}from"../../../../analysis/featureReferenceUtils.js";import i from"../../../../core/Accessor.js";import{createTask as n}from"../../../../core/asyncUtils.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{handlesGroup as a,makeHandle as l}from"../../../../core/handleUtils.js";import c from"../../../../core/Logger.js";import{abortMaybe as u}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as p}from"../../../../core/reactiveUtils.js";import{property as g}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as m,d as v,n as f,g as _,f as b,F as y,a as C}from"../../../../chunks/vec32.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as O}from"../../../../core/support/UpdatingHandles.js";import I from"../../../../geometry/Point.js";import{projectOrLoad as P}from"../../../../geometry/projection.js";import{projectBoundingRect as j}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as S,containsPointObject as w,intersectsSegment as R}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as A,create as H}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as E}from"../../../../support/elevationInfoUtils.js";import L from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as V}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as F}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as x}from"../support/projectionUtils.js";import{StoreResults as D}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as G}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as N,TaskPriority as z}from"../../../support/Scheduler.js";let k=class extends(r.EventedMixin(i)){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new O,this._frameTask=N,this._computationHandles=new s,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(z.LINE_OF_SIGHT_TOOL):N,this._intersector=new F({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:o,computationResult:i}=t,{observerAdjusted:n,targetAdjusted:r}=o,{start:s,end:a}=i;m(s,n),m(a,r);this._canCompute(t)?this._computeIntersection(e):M(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:o}=this,{inputPoints:i}=e,{observer:n,target:r,observerAdjusted:s,targetAdjusted:a}=i;m(s,n),m(a,r),t(o,this._intersector.intersector,i);const{observerSurfaceNormal:l,targetSurfaceNormal:c}=i,u=this._screenPixelSize,d=B;null!=l?m(d,l):v(d,a,s);const p=u;f(d,d),_(d,d,Math.min(p,1)),b(s,s,d),null!=c?m(d,c):v(d,s,a);const g=o.state.camera.computeScreenPixelSizeAt(a);f(d,d),_(d,d,Math.min(g,1)),b(a,a,d)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:o}=this,{sceneIntersectionHelper:i,renderCoordsHelper:n}=o;if(null==i)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:c}=a,{start:u,end:d}=s,p=A(u,d,q);r.options.store=D.MIN,i.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,v=B;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){m(t.originalIntersection,h),m(t.originalObserver,u),m(t.originalTarget,d),n.fromRenderCoords(h,v,o.spatialReference);const e=1-y(d,c)/y(u,c);f=y(l,h)>=e*y(l,c)}const _=new I(v,o.spatialReference);{const{result:t,target:i}=e;null!=t?(t.target=i,t.intersectedGraphic=f?null:G(g,o),t.intersectedLocation=f?null:_,t.visible=f):e.result=new L({target:i,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:G(g,o),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,o=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==o)return!1;const{observerAdjusted:i,targetAdjusted:n}=e.inputPoints,r=o.intersectsPoint(i),s=o.intersectsPoint(n);return r&&s}_onObserverPositionChange(e,t,i,n,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return x(this.analysis,e.spatialReference,c.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=U(t,i),{absoluteZ:a,elevation:l}=E(t.x,t.y,t.z,this.view.spatialReference,this.view,s),u=t.clone();u.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=u;const d=T();this.view.renderCoordsHelper.toRenderCoords(u,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=a-l,this._observerFeatureId=o(n),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n){const{inputPoints:r}=e;switch(m(r.observer,t),r.observerFeatureId=n,r.observerSurfaceNormal=null,i){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,o,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,n,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==i)return null!=t&&x(this.analysis,t.spatialReference,c.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const l=U(i,n),{absoluteZ:u,elevation:d}=E(i.x,i.y,i.z,this.view.spatialReference,this.view,l),p=i.clone();switch(p.z=u,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=o(r),a.targetSurfaceNormal=null,l.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,u-d,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=z.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return a([this._updatingHandles.add((()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:P(e.target.position,this.view.spatialReference)})),(({computation:e,targetPosition:t,targetElevationInfo:o,targetFeatureInfo:i,projectedTargetPosition:n})=>{null==n.pending?this._onTargetPositionChange(e,t,n.geometry,o,i):this._updatingHandles.addPromise(n.pending)}),p)])}_connectComputationToObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver})),(({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}),p)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId})),(({computation:e,observer:t,observerGroundOffset:o,observerElevationMode:i,observerFeatureId:n})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,o,i,n)}),p)}_connectComputationToCamera(e){return this._updatingHandles.add((()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty})),(({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()}))}_connectComputationToSlicePlane(e){return this._updatingHandles.add((()=>this.view.slice.plane),(()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()}))}_connectComputationToElevation(e){const t=(o,i)=>{const n=this.analysis.observer,r=e.target;let s=null,a=null,l=null,c=null,u=null,d=null;if(null!=n?.position){const e=P(n.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));s=e.geometry,a=n.elevationInfo,l=n.feature}if(null!=r.position){const e=P(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,i)));c=e.geometry,u=r.elevationInfo,d=r.feature}null==s&&null==c||(j(o,i,J,this.view.spatialReference),null!=s&&w(J,s)&&this._onObserverPositionChange(null!=n?n.position:null,s,a,l,!1),null!=c&&w(J,c)&&this._onTargetPositionChange(e,r.position,c,u,d,!1),null!=s&&null!=c&&R(J,s,c)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:o})=>t(e,o)))}_connectComputationToTask(e){let t=null;const o={computation:e,interpolationInfo:{originalIntersection:T(),originalObserver:T(),originalTarget:T()}};return a([this._updatingHandles.add((()=>e.inputPoints),(()=>{t=u(t),t=n((async e=>{await d(this._frameTask.schedule((()=>this._computeResult(o)),e))}))}),{initial:!0,equals:()=>!1}),l((()=>t=u(t)))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const o of t)this._disconnectComputation(o);for(const o of e)this._connectComputation(o)}_onTargetCollectionChange({added:e,removed:t}){for(const o of t)this._removeTarget(o);for(const o of e)this._addTarget(o)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some((t=>t.target===e))||this._computations.add(new V({target:e}))}_removeTarget(e){const t=this._computations.findIndex((t=>t.target===e));this._computations.removeAt(t)}_connectObserver(){return a([this._updatingHandles.add((()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:P(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null})),(({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:o,observerFeatureInfo:i})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,o,i,!0):this._updatingHandles.addPromise(t.pending)}),p)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this._computations),(e=>this._onComputationCollectionChange(e)),{initial:!0,final:!0})}_connectTargets(){return a([this._updatingHandles.addOnCollectionChange((()=>this.analysis.targets),(e=>this._onTargetCollectionChange(e)),{initial:!0,final:!0}),this._updatingHandles.add((()=>this.analysisViewData.cursorTarget),((e,t)=>{this._onCursorTargetChange(e,t)}))])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:o}=t;if(null==e||null==o)return!1;const i=B;o.toRenderCoords(e,i);const n=t.state.camera.computeScreenPixelSizeAt(i);return Math.abs((n-this._screenPixelSize)/this._screenPixelSize)>Z}};function U(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function M({computation:e,interpolationInfo:t}){const{computationResult:o,inputPoints:i}=e,{start:n,end:r,intersection:s}=o,{originalIntersection:a,originalObserver:l,originalTarget:c}=t;if(m(s,a),i.isValid){const e=B,t=y(l,a)/y(l,c);C(e,n,l),_(e,e,1-t),b(s,s,e),C(e,r,c),_(e,e,t),b(s,s,e),o.isValid=!0}else e.result=null,o.isValid=!1,o.isTargetVisible=!1}e([g({constructOnly:!0})],k.prototype,"analysis",void 0),e([g({constructOnly:!0})],k.prototype,"analysisViewData",void 0),e([g({constructOnly:!0})],k.prototype,"view",void 0),e([g()],k.prototype,"updating",null),e([g()],k.prototype,"priority",null),e([g()],k.prototype,"updateOnCameraChange",void 0),e([g()],k.prototype,"_computations",null),e([g()],k.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([g()],k.prototype,"_observerGroundOffsetRenderSpace",void 0),e([g()],k.prototype,"_effectiveObserverElevationMode",void 0),e([g()],k.prototype,"_observerFeatureId",void 0),e([g()],k.prototype,"_screenPixelSize",null),e([g({readOnly:!0})],k.prototype,"_updatingHandles",void 0),e([g()],k.prototype,"_frameTask",void 0),e([g()],k.prototype,"_isCameraDirty",null),k=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightController")],k);const Z=.1,B=T(),q=H(),J=S();export{k as LineOfSightController};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{updatePointsFromFeatureReference as t,getFeatureId as o}from"../../../../analysis/featureReferenceUtils.js";import n from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import r from"../../../../core/Evented.js";import s from"../../../../core/Handles.js";import{handlesGroup as a,makeHandle as l}from"../../../../core/handleUtils.js";import u from"../../../../core/Logger.js";import{abortMaybe as c}from"../../../../core/maybe.js";import{ignoreAbortErrors as d}from"../../../../core/promiseUtils.js";import{initial as p,on as g}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as v,d as f,n as _,g as b,f as y,F as C,a as T}from"../../../../chunks/vec32.js";import{create as O}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as I}from"../../../../core/support/UpdatingHandles.js";import P from"../../../../geometry/Point.js";import{projectOrLoad as j}from"../../../../geometry/projection.js";import{projectBoundingRect as S}from"../../../../geometry/projection/projectBoundingRect.js";import{intersectsSegment as w}from"../../../../geometry/support/aaBoundingBox.js";import{empty as R,containsPointObject as A,intersectsSegment as H}from"../../../../geometry/support/aaBoundingRect.js";import{fromPoints as E,create as L}from"../../../../geometry/support/ray.js";import{zValueInAbsoluteHeightMode as V}from"../../../../support/elevationInfoUtils.js";import F from"../LineOfSightAnalysisResult.js";import{LineOfSightComputation as x}from"./LineOfSightComputation.js";import{LineOfSightRayIntersector as D}from"./LineOfSightRayIntersector.js";import{logFailedGeometryProjectionError as G}from"../support/projectionUtils.js";import{StoreResults as N}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as z}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{ImmediateTask as U,TaskPriority as k}from"../../../support/Scheduler.js";let M=class extends(r.EventedMixin(n)){constructor(e){super(e),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new I,this._frameTask=U,this._computationHandles=new s,this._externalObserverUpdate=!0}initialize(){const e=this.view.resourceController?.scheduler;this._frameTask=e?e.registerTask(k.LINE_OF_SIGHT_TOOL):U,this._intersector=new D({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(e){const t=e.computation,{inputPoints:o,computationResult:n}=t,{observerAdjusted:i,targetAdjusted:r}=o,{start:s,end:a}=n;v(s,i),v(a,r);this._canCompute(t)?this._computeIntersection(e):Z(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const{view:o}=this,{inputPoints:n}=e,{observer:i,target:r,observerAdjusted:s,targetAdjusted:a}=n;v(s,i),v(a,r),t(o,this._intersector.intersector,n);const{observerSurfaceNormal:l,targetSurfaceNormal:u}=n,c=this._screenPixelSize,d=J;null!=l?v(d,l):f(d,a,s);const p=c;_(d,d),b(d,d,Math.min(p,1)),y(s,s,d),null!=u?v(d,u):f(d,s,a);const g=o.state.camera.computeScreenPixelSizeAt(a);_(d,d),b(d,d,Math.min(g,1)),y(a,a,d)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:o}=this,{sceneIntersectionHelper:n,renderCoordsHelper:i}=o;if(null==n)return;const r=this._intersector.intersector,{computationResult:s,inputPoints:a}=e,{observer:l,target:u}=a,{start:c,end:d}=s,p=E(c,d,K);r.options.store=N.MIN,n.intersectToolIntersectorRay(p,r);const g=r.results.min,h=s.intersection,m=J;let f=!0;if(null!=g&&g.getIntersectionPoint(h)){v(t.originalIntersection,h),v(t.originalObserver,c),v(t.originalTarget,d),i.fromRenderCoords(h,m,o.spatialReference);const e=1-C(d,u)/C(c,u);f=C(l,h)>=e*C(l,u)}const _=new P(m,o.spatialReference);{const{result:t,target:n}=e;null!=t?(t.target=n,t.intersectedGraphic=f?null:z(g,o),t.intersectedLocation=f?null:_,t.visible=f):e.result=new F({target:n,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:f?null:z(g,o),intersectedLocation:f?null:_,visible:f})}s.isValid=a.isValid=!0,s.isTargetVisible=f}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,o=this.view.frustum;if(null==t||null==e.elevationAlignedTargetLocation||null==o)return!1;const{observerAdjusted:n,targetAdjusted:i}=e.inputPoints,r=o.intersectsPoint(n),s=o.intersectsPoint(i);return r&&s}_onObserverPositionChange(e,t,n,i,r){if(this._externalObserverUpdate=r,null==e)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(null==t)return G(this.analysis,e.spatialReference,u.getLogger(this)),void(this.analysisViewData.elevationAlignedObserver=null);const s=B(t,n),{absoluteZ:a,elevation:l}=V(t.x,t.y,t.z,this.view.spatialReference,this.view,s),c=t.clone();c.z=a,this._effectiveObserverElevationMode=s.mode,this.analysisViewData.elevationAlignedObserver=c;const d=O();this.view.renderCoordsHelper.toRenderCoords(c,d),this._elevationAlignedObserverPositionRenderSpace=d,this._observerGroundOffsetRenderSpace=a-l,this._observerFeatureId=o(i),this.priority=k.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(e,t,o,n,i){const{inputPoints:r}=e;switch(v(r.observer,t),r.observerFeatureId=i,r.observerSurfaceNormal=null,n){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(r.observer,o,r.observer);null==r.observerFeatureId&&(r.observerSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=k.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,n,i,r,s=!0){const a=e.inputPoints;if(s&&(a.isValid=!1),null==n)return null!=t&&G(this.analysis,t.spatialReference,u.getLogger(this)),e.elevationAlignedTargetLocation=null,void e.notifyInputPointsChanged();const l=B(n,i),{absoluteZ:c,elevation:d}=V(n.x,n.y,n.z,this.view.spatialReference,this.view,l),p=n.clone();switch(p.z=c,e.elevationAlignedTargetLocation=p,this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,a.target),a.targetFeatureId=o(r),a.targetSurfaceNormal=null,l.mode){case"on-the-ground":case"relative-to-ground":{const e=this._intersector.updateFromGroundIntersection(a.target,c-d,a.target);null==a.targetFeatureId&&(a.targetSurfaceNormal=e)}}this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=k.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return a([this._updatingHandles.add((()=>({computation:e,targetPosition:e.target.position,targetElevationInfo:e.target.elevationInfo,targetFeatureInfo:e.target.feature,projectedTargetPosition:j(e.target.position,this.view.spatialReference)})),(({computation:e,targetPosition:t,targetElevationInfo:o,targetFeatureInfo:n,projectedTargetPosition:i})=>{null==i.pending?this._onTargetPositionChange(e,t,i.geometry,o,n):this._updatingHandles.addPromise(i.pending)}),p)])}_connectComputationToObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver})),(({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}),p)}_connectComputationToRenderSpaceObserver(e){return this._updatingHandles.add((()=>({computation:e,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId})),(({computation:e,observer:t,observerGroundOffset:o,observerElevationMode:n,observerFeatureId:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,o,n,i)}),p)}_connectComputationToCamera(e){return this._updatingHandles.add((()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty})),(({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()}))}_connectComputationToSlicePlane(e){return this._updatingHandles.add((()=>this.view.slice.plane),(()=>{e.inputPoints.isValid=!1,e.notifyInputPointsChanged()}))}_connectComputationToElevation(e){const t=(o,n)=>{const i=this.analysis.observer,r=e.target;let s=null,a=null,l=null,u=null,c=null,d=null;if(null!=i?.position){const e=j(i.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,n)));s=e.geometry,a=i.elevationInfo,l=i.feature}if(null!=r.position){const e=j(r.position,this.view.spatialReference);if(null!=e.pending)return this._updatingHandles.addPromise(e.pending),void e.pending.finally((()=>t(o,n)));u=e.geometry,c=r.elevationInfo,d=r.feature}null==s&&null==u||(S(o,n,Q,this.view.spatialReference),null!=s&&A(Q,s)&&this._onObserverPositionChange(null!=i?i.position:null,s,a,l,!1),null!=u&&A(Q,u)&&this._onTargetPositionChange(e,r.position,u,c,d,!1),null!=s&&null!=u&&H(Q,s,u)&&e.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",(({extent:e,spatialReference:o})=>t(e,o)))}_connectComputationToTask(e){let t=null;const o={computation:e,interpolationInfo:{originalIntersection:O(),originalObserver:O(),originalTarget:O()}};return a([this._updatingHandles.add((()=>e.inputPoints),(()=>{t=c(t),t=i((async e=>{await d(this._frameTask.schedule((()=>this._computeResult(o)),e))}))}),{initial:!0,equals:()=>!1}),l((()=>t=c(t)))])}_connectComputationToContent(e){return g((()=>this.view.pointsOfInterest?.contentGeometryUpdates.events),"request-update",(t=>{const o=t?.renderBounds,{observerAdjusted:n,targetAdjusted:i}=e.inputPoints;(null==o||w(o,n,i))&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())}))}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e),this._connectComputationToContent(e)],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_onComputationCollectionChange({added:e,removed:t}){for(const o of t)this._disconnectComputation(o);for(const o of e)this._connectComputation(o)}_onTargetCollectionChange({added:e,removed:t}){for(const o of t)this._removeTarget(o);for(const o of e)this._addTarget(o)}_onCursorTargetChange(e,t){null!=t&&this._removeTarget(t),null!=e&&this._addTarget(e)}_addTarget(e){this._computations.some((t=>t.target===e))||this._computations.add(new x({target:e}))}_removeTarget(e){const t=this._computations.findIndex((t=>t.target===e));this._computations.removeAt(t)}_connectObserver(){return a([this._updatingHandles.add((()=>({observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,projectedObserverPosition:j(null!=this.analysis.observer?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:null!=this.analysis.observer?this.analysis.observer.elevationInfo:null,observerFeatureInfo:null!=this.analysis.observer?this.analysis.observer.feature:null})),(({observerPosition:e,projectedObserverPosition:t,observerElevationInfo:o,observerFeatureInfo:n})=>{null==t.pending?this._onObserverPositionChange(e,t.geometry,o,n,!0):this._updatingHandles.addPromise(t.pending)}),p)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange((()=>this._computations),(e=>this._onComputationCollectionChange(e)),{initial:!0,final:!0})}_connectTargets(){return a([this._updatingHandles.addOnCollectionChange((()=>this.analysis.targets),(e=>this._onTargetCollectionChange(e)),{initial:!0,final:!0}),this._updatingHandles.add((()=>this.analysisViewData.cursorTarget),((e,t)=>{this._onCursorTargetChange(e,t)}))])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:o}=t;if(null==e||null==o)return!1;const n=J;o.toRenderCoords(e,n);const i=t.state.camera.computeScreenPixelSizeAt(n);return Math.abs((i-this._screenPixelSize)/this._screenPixelSize)>q}};function B(e,t){return e.hasZ?t??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}function Z({computation:e,interpolationInfo:t}){const{computationResult:o,inputPoints:n}=e,{start:i,end:r,intersection:s}=o,{originalIntersection:a,originalObserver:l,originalTarget:u}=t;if(v(s,a),n.isValid){const e=J,t=C(l,a)/C(l,u);T(e,i,l),b(e,e,1-t),y(s,s,e),T(e,r,u),b(e,e,t),y(s,s,e),o.isValid=!0}else e.result=null,o.isValid=!1,o.isTargetVisible=!1}e([h({constructOnly:!0})],M.prototype,"analysis",void 0),e([h({constructOnly:!0})],M.prototype,"analysisViewData",void 0),e([h({constructOnly:!0})],M.prototype,"view",void 0),e([h()],M.prototype,"updating",null),e([h()],M.prototype,"priority",null),e([h()],M.prototype,"updateOnCameraChange",void 0),e([h()],M.prototype,"_computations",null),e([h()],M.prototype,"_elevationAlignedObserverPositionRenderSpace",null),e([h()],M.prototype,"_observerGroundOffsetRenderSpace",void 0),e([h()],M.prototype,"_effectiveObserverElevationMode",void 0),e([h()],M.prototype,"_observerFeatureId",void 0),e([h()],M.prototype,"_screenPixelSize",null),e([h({readOnly:!0})],M.prototype,"_updatingHandles",void 0),e([h()],M.prototype,"_frameTask",void 0),e([h()],M.prototype,"_isCameraDirty",null),M=e([m("esri.views.3d.analysis.LineOfSight.LineOfSightController")],M);const q=.1,J=O(),K=L(),Q=R();export{M as LineOfSightController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{when as n,watch as l,syncAndInitial as r,sync as d,initial as c}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,H as g,i as v,p as w,e as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as M}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as j}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as P}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let W=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=q,this._creationState=!1,this._interactionVisualElements=null,this._settings=new M({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([n((()=>this._valid),(()=>this.finishToolCreation()),r),l((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),l((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),d),l((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),n((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),c),l((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),l((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),c)])}destroy(){this.subToolHandles=o(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some((e=>e.viewshedComputedData.valid))??!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}onActivate(){this._placementMode=q}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._stagedViewshed=null,"multiple"===this._placementMode?(this._creationState="placing-observer",this.selectedViewshed=e):(this._creationState=!1,this._stagedViewshed=null,this.selectedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null)}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:o}=x(this.view,i,e);t.farDistance=o,t.tilt=a,t.heading=s}removeStaged(){return null!=this._stagedViewshed&&(this.analysis.viewsheds.remove(this._stagedViewshed),this._stagedViewshed=null,!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const o=t.mapPoint;return o.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,o),null==o?null:(t.feature=I(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new j({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:P.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l((()=>e.zVerticalLine),(e=>e.apply(s)),r),l((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,o=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void o(i,!1);if(null==s||null==a)return void o(!1,!1);const n=s.moveInteractionState,l=e?n.grabbing:n.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(o(c,l),c){const e=l?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function x(e,t,i){const s=t.observerRenderSpace,o=m(U,i,s),n=g(o)*t.metersPerUnit,l=e.renderCoordsHelper.basisMatrixAtPosition(s,F),r=v(A,l[8],l[9],l[10]),d=b(s,r,G),c=S(d,i,z),h=m(c,c,s),u=(g(h)<1e-4?90:a(w(o,h)))*(_(r,o)<0?-1:1)+90,p=v(K,l[4],l[5],l[6]),V=a(w(p,h)),f=v(K,l[0],l[1],l[2]);return{heading:_(h,f)<0?360-V:V,tilt:u,farDistance:n}}e([h({constructOnly:!0})],W.prototype,"view",void 0),e([h()],W.prototype,"analysisViewData",void 0),e([h()],W.prototype,"removeIncompleteOnCancel",void 0),e([h()],W.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],W.prototype,"analysis",void 0),e([h()],W.prototype,"subToolHandles",void 0),e([h()],W.prototype,"_stagedViewshed",void 0),e([h()],W.prototype,"_stagedViewshedComputedData",void 0),e([h()],W.prototype,"_placementMode",void 0),e([h()],W.prototype,"_creationState",void 0),e([h()],W.prototype,"_valid",null),e([h({readOnly:!0})],W.prototype,"cursor",null),e([h()],W.prototype,"_selectedManipulator",void 0),e([h()],W.prototype,"_selectedSubTool",null),e([h()],W.prototype,"selectedViewshed",null),e([h()],W.prototype,"selectedViewshedComputedData",null),e([h()],W.prototype,"stagedViewshed",null),e([h()],W.prototype,"grabbing",null),e([h()],W.prototype,"creating",null),e([h()],W.prototype,"isPlacingTarget",null),W=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],W);const U=V(),A=V(),z=V(),K=V(),F=p(),G=y(),B={mapPoint:new f,scenePoint:V(),feature:null},q="multiple";export{W as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../analysis/Viewshed.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as s}from"../../../../core/mapCollectionUtils.js";import{rad2deg as a}from"../../../../core/mathUtils.js";import{destroyMaybe as n}from"../../../../core/maybe.js";import{when as o,watch as l,syncAndInitial as r,sync as d,initial as c}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as m,H as g,i as v,p as w,e as _}from"../../../../chunks/vec32.js";import{create as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../../../../geometry/Point.js";import{fromPositionAndNormal as b,create as y,projectPoint as S}from"../../../../geometry/support/plane.js";import{creationVerticalOffset as T}from"./ViewshedConfiguration.js";import{ViewshedSubTool as C}from"./ViewshedSubTool.js";import{Manipulator3D as D}from"../../interactive/Manipulator3D.js";import{Settings as M}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as j}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as H}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{RenderOccludedFlag as P}from"../../webgl-engine/lib/Material.js";import{AnalysisToolBase as E}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as L}from"../../../interactive/keybindings.js";import{newToolIntersector as k}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as O}from"../../../support/screenUtils.js";const R=Symbol("interactionVisuals");let W=class extends E{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=q,this._creationState=!1,this._interactionVisualElements=null,this._settings=new M({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=k(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s((()=>e),(({viewshedComputedData:e})=>{const t=new C({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}})),this.addHandles([o((()=>this._valid),(()=>this.finishToolCreation()),r),l((()=>this._stagedViewshed),(e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null}),r),this.analysis.viewsheds.on("after-remove",(e=>{const t=this._stagedViewshed;null!=t&&e.item===t&&this.analysis.viewsheds.add(t)})),l((()=>this.firstGrabbedManipulator),(e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()}),d),l((()=>this.view.activeTool),(e=>{e!==this&&null!=e&&(this.selectedViewshed=null)})),o((()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.observerRenderSpace,target:e.targetRenderSpace}}),(e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)}),c),l((()=>this.creating),(()=>this.updateInteractionVisualsVisibility())),l((()=>this.selectedViewshed),(e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)}),c)])}destroy(){this.subToolHandles=n(this.subToolHandles),this.removeHandles(R)}onDeactivate(){this.removeStaged(),this._creationState=!1}get _valid(){return this.analysisViewData.viewshedComputedDataHandles?.some((e=>e.viewshedComputedData.valid))??!1}get cursor(){return this.creating?"crosshair":null}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_selectManipulator(e){const t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,null!=t&&(t.selected=!1),null!=e&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}get stagedViewshed(){return this._stagedViewshed}get grabbing(){return this.subToolHandles.some((({subTool:e})=>e.grabbing))}get creating(){return this._creationState&&this.active}get isPlacingTarget(){return"placing-target"===this._creationState}place(e){this.selectedViewshed=null,this._placementMode=e,this._creationState="placing-observer",this._finishToolCreationIfValid()}onManipulatorSelectionChanged(){this.subToolHandles.forEach((e=>e.subTool.onManipulatorSelectionChanged()))}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":L.cancel===e.key?this._cancelKeyHandler(e):L.delete.includes(e.key)&&this._deleteKeyHandler();break;case"hold":this.updateInteractionVisualsVisibility(!0)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickPlacementHandler(e)}onActivate(){this._placementMode=q}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,B);if(null!=i){if("placing-observer"===this._creationState){i.mapPoint.z=(i.mapPoint.z??0)+T;const e=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(e),this._stagedViewshed=e,this._creationState="placing-target",this._updateStagedViewshed(i.scenePoint)}else if("placing-target"===this._creationState){this._updateStagedViewshed(i.scenePoint);const e=this._stagedViewshed;this._stagedViewshed=null,"multiple"===this._placementMode?(this._creationState="placing-observer",this.selectedViewshed=e):(this._creationState=!1,this._stagedViewshed=null,this.selectedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null)}e.stopPropagation()}}_doubleClickHandler(e){this.creating&&(this.removeStaged(),this._creationState=!1,this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(!this.creating)return;const t=this._intersectScreen(e,B);null!=t&&(this._updateInteractionVisualsLocation(t.scenePoint,!1),this._updateStagedViewshed(t.scenePoint))}_cancelKeyHandler(e){this.creating?this._onCancelWhileCreating(e):this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_onCancelWhileCreating(e){const t=this.removeStaged();this._finishToolCreationIfValid(),t?(this._creationState="placing-observer",this.selectedViewshed=null,"multiple"===this._placementMode&&e.stopPropagation()):this._creationState=!1}_deleteKeyHandler(){this.creating&&(this.removeStaged(),this._creationState="placing-observer"),null!=this.selectedViewshed&&this.analysis.viewsheds.remove(this.selectedViewshed)}_finishToolCreationIfValid(){this._valid&&this.finishToolCreation()}_updateStagedViewshed(e){const t=this._stagedViewshed,i=this._stagedViewshedComputedData;if(null==t||null==i)return;const{heading:s,tilt:a,farDistance:n}=x(this.view,i,e);t.farDistance=n,t.tilt=a,t.heading=s}removeStaged(){const e=this._stagedViewshed;return null!=e&&(this._stagedViewshed=null,this.analysis.viewsheds.remove(e),!0)}_intersectScreen(e,t){const i=O(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,a=t.scenePoint;if(!s.getIntersectionPoint(a))return null;const n=t.mapPoint;return n.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(a,n),null==n?null:(t.feature=I(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(R);const e=this._settings.visualElements,t=new H({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new j({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:P.OccludeAndTransparent,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l((()=>e.zVerticalLine),(e=>e.apply(s)),r),l((()=>e.heightPlane),(e=>e.apply(t)),r),i((()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null}))],R)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,a=this.selectedViewshedComputedData,n=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void n(i,!1);if(null==s||null==a)return void n(!1,!1);const o=s.moveInteractionState,l=e?o.grabbing:o.dragging,r=s.scaleOrientInteractionState,d=e?r.grabbing:r.dragging,c=i&&(l||d);if(n(c,l),c){const e=l?a.observerRenderSpace:a.targetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:a}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&a.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof D?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};function x(e,t,i){const s=t.observerRenderSpace,n=m(U,i,s),o=g(n)*t.metersPerUnit,l=e.renderCoordsHelper.basisMatrixAtPosition(s,F),r=v(A,l[8],l[9],l[10]),d=b(s,r,G),c=S(d,i,z),h=m(c,c,s),u=(g(h)<1e-4?90:a(w(n,h)))*(_(r,n)<0?-1:1)+90,p=v(K,l[4],l[5],l[6]),V=a(w(p,h)),f=v(K,l[0],l[1],l[2]);return{heading:_(h,f)<0?360-V:V,tilt:u,farDistance:o}}e([h({constructOnly:!0})],W.prototype,"view",void 0),e([h()],W.prototype,"analysisViewData",void 0),e([h()],W.prototype,"removeIncompleteOnCancel",void 0),e([h()],W.prototype,"automaticManipulatorSelection",void 0),e([h({constructOnly:!0})],W.prototype,"analysis",void 0),e([h()],W.prototype,"subToolHandles",void 0),e([h()],W.prototype,"_stagedViewshed",void 0),e([h()],W.prototype,"_stagedViewshedComputedData",void 0),e([h()],W.prototype,"_placementMode",void 0),e([h()],W.prototype,"_creationState",void 0),e([h()],W.prototype,"_valid",null),e([h({readOnly:!0})],W.prototype,"cursor",null),e([h()],W.prototype,"_selectedManipulator",void 0),e([h()],W.prototype,"_selectedSubTool",null),e([h()],W.prototype,"selectedViewshed",null),e([h()],W.prototype,"selectedViewshedComputedData",null),e([h()],W.prototype,"stagedViewshed",null),e([h()],W.prototype,"grabbing",null),e([h()],W.prototype,"creating",null),e([h()],W.prototype,"isPlacingTarget",null),W=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],W);const U=V(),A=V(),z=V(),K=V(),F=p(),G=y(),B={mapPoint:new f,scenePoint:V(),feature:null},q="multiple";export{W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{c as t,i as r,f as e,n,h as s,e as o,g as i,s as f}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a}from"../../../../chunks/sphere.js";import{planeFromPoints as u}from"../../support/mathUtils.js";import{geodesicArea as c}from"../../../support/geodesicAreaMeasurementUtils.js";function h(t,n){const s=a(n);r(s,0,0,0);for(let r=0;r<t.length;++r)e(s,s,t[r]);i(s,s,1/t.length);let o=0;for(let r=0;r<t.length;++r)o=Math.max(o,f(s,t[r]));n[3]=Math.sqrt(o)}function g(t,r){if(t.length<3)throw new Error("need at least 3 points to fit a plane");u(t[0],t[1],t[2],r)}function p(t,r){return o(t,r)+t[3]}function m(r,e,n,s){const o=x;return t(o.rings[0][0],r),t(o.rings[0][1],e),t(o.rings[0][2],n),t(o.rings[0][3],r),o.spatialReference=s,c(o)}function j(i,f=null,l=!0){const a=(t,r)=>{if(0===r[0]&&0===r[1]&&0===r[2])return!1;for(let e=0;e<t.length;++e)if(o(r,t[e])<-1e-6)return!1;return!0};if(0===i.length)return!1;if(1===i.length)return f&&t(f,i[0]),!0;r(y,0,0,0);for(let t=0;t<i.length;++t)e(y,y,i[t]);if(n(y,y),a(i,y))return f&&t(f,y),!0;if(!l)return!1;for(let r=0;r<i.length;++r)for(let e=0;e<i.length;++e)if(r!==e&&(s(y,i[r],i[e]),n(y,y),a(i,y)))return f&&t(f,y),!0;return!1}function M(t){return"mouse"!==t.pointerType||0===t.button}const x={hasM:!1,hasZ:!0,rings:[[l(),l(),l(),l()]],spatialReference:null,type:"polygon"},y=l();export{g as bestFitPlane,h as boundingSphere,j as fitHemisphere,M as isPrimaryPointerAction,p as planePointDistance,m as triangleAreaGeodesic};
5
+ import{c as t,i as e,f as r,n,h as o,e as s,g as i,s as f}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../../geometry/Polygon.js";import{a as u}from"../../../../chunks/sphere.js";import{planeFromPoints as c}from"../../support/mathUtils.js";function h(t,n){const o=u(n);e(o,0,0,0);for(let e=0;e<t.length;++e)r(o,o,t[e]);i(o,o,1/t.length);let s=0;for(let e=0;e<t.length;++e)s=Math.max(s,f(o,t[e]));n[3]=Math.sqrt(s)}function g(t,e){if(t.length<3)throw new Error("need at least 3 points to fit a plane");c(t[0],t[1],t[2],e)}function m(t,e){return s(t,e)+t[3]}function p(e,r,n,o,{geodesicArea:s}){const i=x;return t(i.rings[0][0],e),t(i.rings[0][1],r),t(i.rings[0][2],n),t(i.rings[0][3],e),i.spatialReference=o,i.clearCache(),s(i)}function j(i,f=null,l=!0){const a=(t,e)=>{if(0===e[0]&&0===e[1]&&0===e[2])return!1;for(let r=0;r<t.length;++r)if(s(e,t[r])<-1e-6)return!1;return!0};if(0===i.length)return!1;if(1===i.length)return f&&t(f,i[0]),!0;e(y,0,0,0);for(let t=0;t<i.length;++t)r(y,y,i[t]);if(n(y,y),a(i,y))return f&&t(f,y),!0;if(!l)return!1;for(let e=0;e<i.length;++e)for(let r=0;r<i.length;++r)if(e!==r&&(o(y,i[e],i[r]),n(y,y),a(i,y)))return f&&t(f,y),!0;return!1}function w(t){return"mouse"!==t.pointerType||0===t.button}const x=new a({hasM:!1,hasZ:!0,rings:[[l(),l(),l(),l()]],spatialReference:null}),y=l();export{g as bestFitPlane,h as boundingSphere,j as fitHemisphere,w as isPrimaryPointerAction,m as planePointDistance,p as triangleAreaGeodesic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as w}from"../meshFastUpdateUtils.js";import{Settings as y}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as I}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as L}from"../../../layers/graphics/GraphicState.js";import{RenderOccludedFlag as S}from"../../../webgl-engine/lib/Material.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as G}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as x}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as C,SceneDrawSurface as O}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as T}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as b}from"../../../../../core/accessorSupport/trackingUtils.js";let z=class extends D{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new y({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new L({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o((()=>({element:this._outlineVisualElement,isDraped:r.isDraped})),(({element:e,isDraped:t})=>{e&&(e.isDraped=t)}),n),b((()=>{T(this.tooltipInfos.mesh,this.geometryToPlace)})),this._setupLoadingIndicator(r),...w(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new x({view:this.view,manipulators:this.manipulators,geometryType:G(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new O(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new C(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new V({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:S.OccludeAndTransparent,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o((()=>l.visualElements.zVerticalLine),(e=>e.apply(h)),a),o((()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)})),(({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),a),r((()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)}))]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(A,e[0],e[1],e[2]),U.setFromElevationInfo(this.elevationInfo),A[2]=j(A,r,U,i);i.toRenderCoords(A,this.view.spatialReference,A)?(t.setStartEndFromWorldDownAtLocation(A),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o((()=>l.visualElements.lineObjects.outline),(e=>e.apply(c)),a),o((()=>l.visualElements.lineObjects.shadowStyle),(e=>e.apply(c)),a),r((()=>{this._outlineVisualElement=s(this._outlineVisualElement)}))]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o((()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)})),(({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),a),r((()=>{this._verticesVisualElement=s(this._verticesVisualElement)}))]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"!==this.geometryType||"point"!==e?.type)super.updateGraphicGeometry(e);else{const t=this.geometryToPlace;t?.centerAt(e),T(this.tooltipInfos.mesh,t);const i=this._graphic;t&&i.geometry===t||(i.geometry=t)}}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const s=r((()=>{t.loading=!1}));let o;const a=()=>o&&cancelAnimationFrame(o);return i([l((()=>e.displaying),(()=>{a(),o=requestAnimationFrame((()=>s.remove()))}),{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],z.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],z.prototype,"geometryType",void 0),e([c()],z.prototype,"type",void 0),e([c({constructOnly:!0})],z.prototype,"view",void 0),z=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],z);const U=new I,A=h();export{z as DrawGraphicTool3D};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as s}from"../../../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as w}from"../meshFastUpdateUtils.js";import{Settings as y}from"../settings.js";import{ExtendedLineVisualElement as V}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as L}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as I}from"../../../layers/graphics/GraphicState.js";import{RenderOccludedFlag as S}from"../../../webgl-engine/lib/Material.js";import{DrawGraphicTool as D,geometryTypeToDrawOperationGeometryType as G}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as x}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as C,SceneDrawSurface as O}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as T}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as b}from"../../../../../core/accessorSupport/trackingUtils.js";let z=class extends D{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new y({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,s=this._createGraphicState=new I({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(s),o((()=>({element:this._outlineVisualElement,isDraped:s.isDraped})),(({element:e,isDraped:t})=>{e&&(e.isDraped=t)}),n),b((()=>{T(this.tooltipInfos.mesh,this.geometryToPlace)})),this._setupLoadingIndicator(s),...w(s)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new x({view:this.view,manipulators:this.manipulators,geometryType:G(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new O(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new C(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),s();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new V({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:S.OccludeAndTransparent,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o((()=>l.visualElements.zVerticalLine),(e=>e.apply(h)),a),o((()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)})),(({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),a),s((()=>{this._activeVertexVisualElement=r(this._activeVertexVisualElement),this._verticalLineVisualElement=r(this._verticalLineVisualElement)}))]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:s}=this.view;p(A,e[0],e[1],e[2]),U.setFromElevationInfo(this.elevationInfo),A[2]=j(A,s,U,i);i.toRenderCoords(A,this.view.spatialReference,A)?(t.setStartEndFromWorldDownAtLocation(A),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,s();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o((()=>l.visualElements.lineObjects.outline),(e=>e.apply(c)),a),o((()=>l.visualElements.lineObjects.shadowStyle),(e=>e.apply(c)),a),s((()=>{this._outlineVisualElement=r(this._outlineVisualElement)}))]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,s();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o((()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)})),(({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t}),a),s((()=>{this._verticesVisualElement=r(this._verticesVisualElement)}))]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"!==this.geometryType||"point"!==e?.type)super.updateGraphicGeometry(e);else{const t=this.geometryToPlace;t?.centerAt(e),T(this.tooltipInfos.mesh,t);const i=this._graphic;t&&i.geometry===t||(i.geometry=t)}}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const r=s((()=>{t.loading=!1}));let o;const a=()=>o&&cancelAnimationFrame(o);return i([l((()=>e.displaying),(()=>{a(),o=requestAnimationFrame((()=>r.remove()))}),{...n,once:!0}),s(a),r])}};e([c({constructOnly:!0})],z.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],z.prototype,"geometryType",void 0),e([c()],z.prototype,"type",void 0),e([c({constructOnly:!0})],z.prototype,"view",void 0),z=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],z);const U=new L,A=h();export{z as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import i from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{zeroMeters as a,scale as l}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import{makeDehydratedPoint as m}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as d}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{orientation as v}from"../geometryUtils.js";import{SupportedObjectResult as g}from"../isSupportedObjectUtils.js";import{manipulatedObjectGeometry as _}from"../manipulatedObjectUtils.js";import{canMoveZOperations as M}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as j}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as b}from"../tooltipUtils3D.js";import{createVisualElements as y}from"../visualElementUtils.js";import{discRadius as T}from"../manipulations/config.js";import{ManipulationType as w,MoveManipulation as I}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as S}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as O}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as x}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{dragManipulatedObjectMany as U,resetManipulatedObjectMany as P}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as k}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as H}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import X from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as Y}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as R}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as A,enterInputModeIfAvailable as z}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as D}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as Z}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as C}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoDistanceBetweenPoints2D as V}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.objects=t,this.type="move-start"}}class B{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class N{constructor(t){this.objects=t,this.type="move-stop"}}const q=Symbol("manipulators"),J=Symbol("tooltips");let K=class extends k{constructor(t){super(t),this._infos=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new X,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new u,this._moveManipulation=null}initialize(){const{view:t}=this;this.tooltip=A((()=>({view:t,options:this.sketchOptions.tooltips}))),this.addHandles([this.objects.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),this.objects.on("change",(()=>this._connectTooltips()))]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(t){if(!this.destroyed&&!z(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=_(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(x(e)!==g.SUPPORTED)continue;const t=new Q(e);this._infos.set(e,t)}for(const e of o)this._infos.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infos.get(o);this.addHandles(j(t.object),o)}}_refreshManipulators(){if(this.removeHandles(q),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values());this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new O({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator((t=>{this.addHandles([t.events.on("immediate-click",(t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{"start"===t?this._showTooltip(w.XY):this._hideTooltip()}))],q)})),this.addHandles(o.manipulationXY.createDragPipeline(((o,e,i,n)=>this._buildDragEventPipeline(t,w.XY,o,e,i,n))),q)}this._createMoveManipulation(t)}_createMoveManipulation(t){const o=new I({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?I.radiusForSymbol(t[0].object.graphic?.symbol):T});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()})),q)}));const e=t=>o=>{this.addHandles([o.events.on("focus-changed",(({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()})),o.events.on("grab-changed",(()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=a)}))],q)};this._moveManipulation.xyManipulation.forEachManipulator(e(w.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(w.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(w.Z));const i=()=>this._updateMoveManipulation(t);for(const a of t)this.addHandles([a.object.on("committed",i),r((()=>a.object.visible),i)],q);const n=t[t.length-1];this.addHandles(n.object.on("committed",(()=>this._updateMoveManipulationAngle(n))),q);const{object:s}=n,{operations:l}=s;if(l){const e=s.graphic;this.addHandles(o.createDragPipeline(((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s)),s.elevationInfo,l.data.spatialReference,e),q)}this._updateMoveManipulationAngle(n)}_createVisualElements(t){for(const o of t){const e=o.object,i=y({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",(()=>{o.object.isDraped||this._updateMoveManipulation(t)})),r((()=>o.object.isDraped),(()=>this._updateMoveManipulation(t)))],q),this.addHandles(i,q))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=v(_(t.object)))}_updateMoveManipulation(t){const o=m(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&M(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&o===w.XY){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next((t=>p?.(t))).next((()=>(l.length&&this.events.emit("move-stop",new N(l)),this.destroyed||c(),null))),{steps:i=i.next((o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=U(l),p=P(l),this._emitRecordUndo(),this.events.emit("move-start",new L(l)),this.destroyed))return null}return 0!==l.length?o:null})).next((t=>r?.(t))).next((t=>(this._updateMoveTooltip(o,t),t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new B(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new N(l)),this.destroyed)return null;c()}return null})),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(J),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new D({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new L([o]))},onMove:()=>e.emit("move",new B(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new N([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=b(this.tooltip,o,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i})))}else t=r((()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null),(t=>{this.tooltip.info=t}),p);this.addHandles(t,J)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e}=this;switch(t){case w.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new Z({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,o)=>V(t,o)));break;case w.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new C({sketchOptions:e}),W(this._latestTooltipInfo,o,((t,e)=>l(V(t,e),S(o))));break;case w.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new F({sketchOptions:e}),W(this._latestTooltipInfo,o,G)}this._latestTooltipInfo.sketchOptions=e}_emitRecordUndo(){const t=this.objects.toArray().map((t=>t.createUndoRecord?.())).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=_(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new Y({elevationInfo:o,pointer:n,editGeometryOperations:H.fromGeometry(a,this.view.state.viewingMode),visualizer:new f,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=R({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(c),{steps:e=e.next((o=>{a.z=d(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}})).next(...p),cancel:i}}};t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"view",void 0),t([c()],K.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],K.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:X})],K.prototype,"sketchOptions",void 0),t([c({constructOnly:!0})],K.prototype,"snappingManager",void 0),t([c()],K.prototype,"type",void 0),t([c()],K.prototype,"updating",null),t([c()],K.prototype,"_latestTooltipInfo",void 0),t([c()],K.prototype,"_shouldShowMovePointTooltip",null),t([c()],K.prototype,"activeTooltipInfo",null),K=t([h("esri.views.3d.interactive.editingTools.move.MoveTool3D")],K);class Q{constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function W(t,o,e){if(null==o||"end"===o.action)return void(t.distance=a);const{mapStart:i,mapEnd:n}=o,s=e(i,n);t.distance=null!=s?s:a}export{B as MoveEvent,L as MoveStartEvent,N as MoveStopEvent,K as MoveTool3D};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Collection.js";import i from"../../../../../core/Evented.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{zeroMeters as a,scale as l}from"../../../../../core/quantityUtils.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import{ensureType as h}from"../../../../../core/accessorSupport/ensureType.js";import"../../../../../core/has.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as m}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/Point.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as v}from"../../../../../support/elevationInfoUtils.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{orientation as _}from"../geometryUtils.js";import{SupportedObjectResult as M}from"../isSupportedObjectUtils.js";import{manipulatedObjectGeometry as j}from"../manipulatedObjectUtils.js";import{canMoveZOperations as b}from"../manipulatorUtils.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{connectTooltipToManipulatedObject as T}from"../tooltipUtils3D.js";import{createVisualElements as w}from"../visualElementUtils.js";import{discRadius as I}from"../manipulations/config.js";import{ManipulationType as S,MoveManipulation as O}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as x}from"../manipulations/moveUtils.js";import{MoveXYObjectManipulation as P}from"../manipulations/MoveXYObjectManipulation.js";import{isSupportedObject as U}from"./isSupportedObject.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{dragManipulatedObjectMany as k,resetManipulatedObjectMany as H}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as X}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as Y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import D from"../../../../interactive/sketch/SketchOptions.js";import{SnappingContext as R}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as A}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as z,enterInputModeIfAvailable as Z}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as C}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{TranslateTooltipInfo as F}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as V}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as B}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{verticalSignedDistanceBetweenPoints as G}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.objects=t,this.type="move-start"}}class N{constructor(t,o,e){this.dx=t,this.dy=o,this.objects=e,this.type="move"}}class q{constructor(t){this.objects=t,this.type="move-stop"}}const J=Symbol("manipulators"),K=Symbol("tooltips");let Q=class extends X{constructor(t){super(t),this._infos=new Map,this.events=new i,this.objects=new e,this.enableZ=!0,this.sketchOptions=new D,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new m,this._moveManipulation=null}initialize(){const{view:t}=this;this.tooltip=z((()=>({view:t,options:this.sketchOptions.tooltips}))),this.addHandles([this.objects.on("change",(t=>{t.removed.forEach((t=>this.removeHandles(t))),this._updateObjectInfos(t),this._setupFastTransformUpdates(t.added),this._refreshManipulators()})),this.objects.on("change",(()=>this._connectTooltips()))]);const o=this.objects.toArray();this._updateObjectInfos({added:o,removed:[]}),this._setupFastTransformUpdates(o),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=s(this.tooltip),this._moveManipulation=s(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(t){if(!this.destroyed&&!Z(t,this.tooltip))return super.onInputEvent(t)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){const{objects:t}=this;if(1!==t.length)return!1;const o=j(t.at(0))?.type;return"point"===o||"mesh"===o}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:t,removed:o}){for(const e of t){if(U(e)!==M.SUPPORTED)continue;const t=new $(e);this._infos.set(e,t)}for(const e of o)this._infos.delete(e)}_setupFastTransformUpdates(t){for(const o of t){const t=this._infos.get(o);this.addHandles(y(t.object),o)}}_refreshManipulators(){if(this.removeHandles(J),this._moveManipulation=s(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;const t=Array.from(this._infos.values());this._createManipulators(t),this._createVisualElements(t),this._updateMoveManipulation(t)}_createManipulators(t){for(const o of t){const e=o.object;o.manipulationXY=new P({tool:this,view:this.view,object:e}),o.manipulationXY.forEachManipulator((t=>{this.addHandles([t.events.on("immediate-click",(t=>{this.events.emit("immediate-click",{...t,object:e}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{"start"===t?this._showTooltip(S.XY):this._hideTooltip()}))],J)})),this.addHandles(o.manipulationXY.createDragPipeline(((o,e,i,n)=>this._buildDragEventPipeline(t,S.XY,o,e,i,n))),J)}this._createMoveManipulation(t)}_createMoveManipulation(t){const o=new O({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?O.radiusForSymbol(t[0].object.graphic?.symbol):I});this._moveManipulation=o,o.elevationInfo={mode:"absolute-height",offset:0},o.forEachManipulator((t=>{this.addHandles(t.events.on("immediate-click",(e=>{const i=this.objects.at(0);!o.zManipulation.hasManipulator(t)&&1===this.objects.length&&i&&this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()})),J)}));const e=t=>o=>{this.addHandles([o.events.on("focus-changed",(({action:o})=>{"focus"===o?this._showTooltip(t):this._hideTooltip()})),o.events.on("grab-changed",(()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=a)}))],J)};this._moveManipulation.xyManipulation.forEachManipulator(e(S.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(S.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(S.Z));const i=()=>this._updateMoveManipulation(t);for(const a of t)this.addHandles([a.object.on("committed",i),r((()=>a.object.visible),i)],J);const n=t[t.length-1];this.addHandles(n.object.on("committed",(()=>this._updateMoveManipulationAngle(n))),J);const{object:s}=n,{operations:l}=s;if(l){const e=s.graphic;this.addHandles(o.createDragPipeline(((o,e,i,n,s)=>this._buildDragEventPipeline(t,o,e,i,n,s)),s.elevationInfo,l.data.spatialReference,e),J)}this._updateMoveManipulationAngle(n)}_createVisualElements(t){for(const o of t){const e=o.object,i=w({view:this.view,object:e,forEachManipulator:t=>{o.manipulationXY?.forEachManipulator(t),this._moveManipulation?.forEachManipulator(t)},onManipulatorsChanged:()=>n()});null!=i&&(o.geometryRepresentation=i.visualElement,o.geometryRepresentation instanceof E&&this.addHandles([o.geometryRepresentation.events.on("attachment-origin-changed",(()=>{o.object.isDraped||this._updateMoveManipulation(t)})),r((()=>o.object.isDraped),(()=>this._updateMoveManipulation(t)))],J),this.addHandles(i,J))}}_updateMoveManipulationAngle(t){this._moveManipulation&&(this._moveManipulation.angle=_(j(t.object)))}_updateMoveManipulation(t){const o=f(0,0,0,this.view.spatialReference);let e=0,i=!1;const n=this._moveManipulation;if(n){for(const n of t){if(!n.object.visible)continue;this.enableZ&&b(n.object.operations,n.object.elevationInfo)&&(i=!0);const t=n.geometryRepresentation instanceof E&&!n.object.isDraped?n.geometryRepresentation.attachmentOrigin:n.object.origin;if(null!=t){const{x:i,y:n,z:s}=t;o.x+=i,o.y+=n,s&&(o.z??=0,o.z+=s),e++}}e>0?(o.x/=e,o.y/=e,o.z??=0,o.z/=e,n.location=o,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=i):n.available=!1}}_buildDragEventPipeline(t,o,e,i,n,s){const a=[],l=[];let r=null,p=null;const c=()=>{for(const t of a)t.dragging=!1;a.length=0,l.length=0,r=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===t.length&&o===S.XY){const o=t[0].object;({steps:i,cancel:n}=this._buildSnappingPipelineSteps(o,o.elevationInfo,i,n,s))}return n=n.next((t=>p?.(t))).next((()=>(l.length&&this.events.emit("move-stop",new q(l)),this.destroyed||c(),null))),{steps:i=i.next((o=>{if("start"===o.action){a.length=0,l.length=0;for(const o of t)o.dragging||!o.manipulationXY?.hasManipulator(e)&&o.manipulationXY?.grabbing||(a.push(o),l.push(o.object),o.dragging=!0);if(0!==l.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),r=k(l),p=H(l),this._emitRecordUndo(),this.events.emit("move-start",new L(l)),this.destroyed))return null}return 0!==l.length?o:null})).next((t=>r?.(t))).next((t=>(this._updateMoveTooltip(o,t),t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const o=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd);if(!o||!e)return null;const i=e.x-o.x,n=e.y-o.y;if(this.events.emit("move",new N(i,n,l)),this.destroyed)return null}break;case"end":if(this.events.emit("move-stop",new q(l)),this.destroyed)return null;c()}return null})),cancel:n}}_connectTooltips(){let t;if(this.removeHandles(K),this._shouldShowMovePointTooltip){const o=this.objects.at(0),{events:e}=this;this._movePointTooltipInfo??=new C({viewType:this.view.type,sketchOptions:this.sketchOptions});const i={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("move-start",new L([o]))},onMove:()=>e.emit("move",new N(0,0,[o])),onMoveStop:()=>e.emit("move-stop",new q([o])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};t=T(this.tooltip,o,(()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:i})))}else t=r((()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null),(t=>{this.tooltip.info=t}),p);this.addHandles(t,K)}_showTooltip(t){this._shouldShowMovePointTooltip||this._updateMoveTooltip(t)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(t,o){if(this._shouldShowMovePointTooltip)return;const{sketchOptions:e,autoLengthMeasurementUtils:i}=this;switch(t){case S.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new F({sketchOptions:e}),tt(this._latestTooltipInfo,o,((t,o)=>i.autoDistanceBetweenPoints2D(W(t),W(o))));break;case S.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new V({sketchOptions:e}),tt(this._latestTooltipInfo,o,((t,e)=>l(i.autoDistanceBetweenPoints2D(W(t),W(e)),x(o))));break;case S.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new B({sketchOptions:e}),tt(this._latestTooltipInfo,o,G)}this._latestTooltipInfo.sketchOptions=e}_emitRecordUndo(){const t=this.objects.toArray().map((t=>t.createUndoRecord?.())).filter(o);t.length>0&&this.events.emit("record-undo",{updates:t})}_buildSnappingPipelineSteps(t,o,e,i,n){const s=j(t);if(null==s||"point"!==s.type&&"mesh"!==s.type)return{steps:e,cancel:i};const a=("point"===s.type?s:s.origin).clone(),l=new R({elevationInfo:o,pointer:n,editGeometryOperations:Y.fromGeometry(a,this.view.state.viewingMode),visualizer:new g,excludeFeature:t.graphic}),r=this.snappingManager,{snappingStep:p,cancelSnapping:c}=A({snappingContext:l,snappingManager:r,updatingHandles:this._updatingHandles});return i=i.next(c),{steps:e=e.next((o=>{a.z=v(this.view,a,t.elevationInfo,{mode:"absolute-height",offset:0});return{...o,snapOrigin:l.coordinateHelper.pointToVector(a)}})).next(...p),cancel:i}}};t([c({constructOnly:!0,nonNullable:!0})],Q.prototype,"view",void 0),t([c({constructOnly:!0})],Q.prototype,"autoLengthMeasurementUtils",void 0),t([c()],Q.prototype,"objects",void 0),t([c({constructOnly:!0,nonNullable:!0})],Q.prototype,"enableZ",void 0),t([c({constructOnly:!0,type:D})],Q.prototype,"sketchOptions",void 0),t([c({constructOnly:!0})],Q.prototype,"snappingManager",void 0),t([c()],Q.prototype,"type",void 0),t([c()],Q.prototype,"updating",null),t([c()],Q.prototype,"_latestTooltipInfo",void 0),t([c()],Q.prototype,"_shouldShowMovePointTooltip",null),t([c()],Q.prototype,"activeTooltipInfo",null),Q=t([u("esri.views.3d.interactive.editingTools.move.MoveTool3D")],Q);const W=h(d);class ${constructor(t){this.object=t,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function tt(t,o,e){if(null==o||"end"===o.action)return void(t.distance=a);const{mapStart:i,mapEnd:n}=o,s=e(i,n);t.distance=null!=s?s:a}export{N as MoveEvent,L as MoveStartEvent,q as MoveStopEvent,Q as MoveTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as n}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import a from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as d}from"../../../../../core/maybe.js";import{watch as h,on as u,initial as c,syncAndInitial as f,when as m,sync as g}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as b,d as x,m as E,i as O,f as y,g as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as H}from"../../../../../core/support/UpdatingHandles.js";import w from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import T from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as A}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as G}from"../../../../../symbols/support/utils.js";import{Manipulator3D as D}from"../../Manipulator3D.js";import{createManipulatorMaterial as P,createManipulatorOutlineMaterial as L,placeAtObject as C}from"../../manipulatorUtils.js";import{RenderObject as N}from"../../RenderObject.js";import{SegmentLabels3D as U}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as k}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as z,convertToMapCoordinates as F}from"../dragEventPipeline3D.js";import{orientation as Z}from"../geometryUtils.js";import{ManipulatorType as X}from"../ManipulatorType.js";import{canMoveZOperations as Y}from"../manipulatorUtils.js";import{Settings as q}from"../settings.js";import{createVisualElements as B}from"../visualElementUtils.js";import{discRadiusSmall as W}from"../manipulations/config.js";import{ManipulationType as K,MoveManipulation as J}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Q}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as $,createEdgeOffsetIntersectionPlane as ee,createEdgeOffsetOperation as te,edgeOffsetRotationMatrix as ie,screenEdgeLengthSquared as ne,getDistanceInGeometrySR as ae}from"./edgeOffsetUtils.js";import{createTooltipInfos as oe,connectTooltipToManipulatedObject as se,getUpdatedTranslateObjectTooltipInfo as re,getUpdatedEdgeOffsetTooltipInfo as le}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as pe}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as de,createSphereGeometry as he}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as ue}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as ce,addMapDelta as fe,createManipulatorDragEventPipeline as me,dragAtLocation as ge,addScreenDelta as _e}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ve,ManipulatorStateCustomFlags as Me}from"../../../../interactive/interfaces.js";import{tooltipKeys as be}from"../../../../interactive/keybindings.js";import{AccumulationBehavior as xe}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as Ee}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Oe}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as ye,enterInputModeIfAvailable as je}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const Ie=Symbol();let Se=class extends t{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Ce.NONE,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new H,this._recreatingManipulators=!1,this._settings=new q({getTheme:()=>this.view.effectiveTheme}),this.events=new a,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(Ce.RESHAPING),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(Ce.NONE,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(Ce.MOVING),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(Ce.NONE,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=oe(this._sketchOptions,e),this._vertexManipulatorMaterial=P(n(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=L(n(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=L(n(i.hoverOutlineColor),i.renderOccluded);const a=t.edge;this._edgeManipulatorMaterial=P(n(a.color),a.renderOccluded),this._edgeManipulatorOutlineMaterial=L(n(a.outlineColor),a.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=P(n(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=P(n(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=P(n(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=L(n(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=L(n(s.hoverOutlineColor),s.renderOccluded),this.tooltip=ye((()=>({view:e,options:this._sketchOptions.tooltips}))),this.addHandles([h((()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}}),(({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:n})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),n.applyColor(this._selectedManipulatorMaterial),n.applyOutline(this._selectedManipulatorOutlineMaterial),n.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),h((()=>this.object.visible),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Ae(t)&&(t.edgeManipulator.available=e)})),h((()=>this._numGrabbing+this._numDragging===0),(e=>this._toggleAutoHideManipulators(e))),h((()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")}),c),se(this.tooltip,this.object,(()=>this._tooltipsContext)),h((()=>this.tooltip.mode),((e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()})),u((()=>this._operations),"vertex-update",(e=>this._updateManipulatorPositions(e.vertices)),{onListenerAdd:()=>this._recreateManipulators()}),u((()=>this._operations?.data),"change",(e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()}))])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===be.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!je(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const i of this._operations.data.components){const n=e?.byComponentIndex.get(i.index);for(const e of i.vertices){const i=n?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of i.edges)this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}get canRedo(){return null!=this._operations&&this._operations.canRedo}get canUndo(){return null!=this._operations&&this._operations.canUndo}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new U({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const n=[],a=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),o=e===Ne.SELECTED_OR_ALL&&a;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||n.push(s),i++);this._moveVertices(n,t);if(n.length===i){if(this._updateEventState(Ce.MOVING),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(Ce.RESHAPING),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Ie):this.tool.manipulators.forEach((({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Ie)})))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e),0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Ce.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:n}=e;if(!t&&!i&&!n)return;const a=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&a.push(o);this._moveVertices(a,e,xe.ACCUMULATE_STEPS),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case Ce.NONE:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case Ce.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case Ce.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case Ce.MOVING:switch(this._reshapeEventState){case Ce.NONE:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case Ce.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case Ce.RESHAPING:switch(this._reshapeEventState){case Ce.NONE:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case Ce.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:n}=this;if(n){if(this._objectMoveManipulation=new Q({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=n.createUndoGroup()),t))).next((e=>this._perObjectManipulatorDragAction(Ne.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(K.XY,e),e))).next((t=>{"end"===t.action&&(this._resetTooltip(),e=d(e))})),a.next((()=>this._onDragCancel(!0,(()=>e=d(e)))))}))),this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1))))}else this._objectMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))))}}_createMoveManipulation(e){const{object:t,tool:i,view:n,_operations:a}=this;if(!a)return;this._moveManipulation=new J({tool:i,view:n,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&Y(t.operations,t.elevationInfo),snapToScene:!1,radius:J.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles([e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()})),this._watchAndUpdateGrabState(e,!1)])));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",(({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()}))])};this._moveManipulation.xyManipulation.forEachManipulator(o(K.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(K.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o(K.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=a.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((n,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:d}=Oe({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new Ee({editGeometryOperations:a,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new k}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next((e=>(this._onDragCancel(),e))).next(d),{steps:s=s.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===X.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e})).next(ce(this.view,e,t.graphic??void 0)).next(...p).next(fe()).next((e=>this._perObjectManipulatorDragAction(Ne.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(n,e),e))),cancel:r}}),e,s,t.graphic),h((()=>t.visible),(()=>this._updateMoveManipulationPosition()),c),t.on("committed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),h((()=>t.isDraped),(e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):this.removeHandles(t)}),c)])}_createVisualElements(){const{object:e,view:t}=this,i=B({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,X.TRANSLATE_XY)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof pe?i.visualElement:null);const n=this._outlineVisualElement;if(null!=n){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(u((()=>n.events),"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,n=this._operations;if(e.component.vertices.length<=2||!n)return null;const a=n.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,d=p/2,h=p*Math.sqrt(3)/2,{height:u,offset:c}=o,f=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=de(f,h,d,d,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=de(f,-h,d,d,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const m=[new N(this._edgeOffsetManipulatorGeometryInside.instantiate(),ve.Unfocused),new N(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ve.Focused),new N(this._edgeOffsetManipulatorGeometryOutside.instantiate(),ve.Unfocused),new N(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ve.Focused)],g=new D({view:i,renderObjects:m,elevationInfo:"on-the-ground"!==t.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Te(a)}),_=new D({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Te(a)}),v={manipulator:g,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map((e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)})));const b=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(g,!0),this._watchAndUpdateGrabState(_,!0),me(g,this._createEdgeOffsetPipeline(v,t,n)),me(_,this._createEdgePipeline(v,t,n)),_.events.on("immediate-click",b),g.events.on("immediate-click",b),g.events.on("focus-changed",(()=>this._resetTooltip())),g.events.on("grab-changed",(({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?$(e,this.view,this.object,v):null}))],g),this._manipulatorInfos.push(v),this.manipulators.addMany([g,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,n=e.edgeManipulator,a=()=>{e.visibilityHandle=d(e.visibilityHandle);const a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=a&&null!=o&&ne(a.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!n.focused||l)&&(i.grabbable=!l,n.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,n.grabbable=this.enableMoveObject}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",a),n.events.on("focus-changed",a),r((()=>{d(e.visibilityHandle),n.metadata.deleting=!0,this.manipulators.remove(n)}))],i),a()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=ee(this.view,e.manipulator.elevationAlignedLocation,te(t,e.handle,e.manipulator.elevationInfo)),n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==n||null==a)return;const o=n.manipulator.renderLocation,s=a.manipulator.renderLocation,r=null!=i?ie(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(De,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(n,a,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(n,a,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=n;a.next((e=>this._trackNumDragging(e))).next(ge(this.view,r)).next(R(this.view,r,t,s,e)).next(_e()).next(fe()).next((e=>this._perObjectManipulatorDragAction(Ne.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(K.XY,e),e))).next((e=>{"end"===e.action&&this._resetTooltip()})),o.next((()=>this._onDragCancel(!n.metadata.deleting)))}}}_createEdgeOffsetPipeline(e,t,i){return(n,a,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);a.next((e=>this._trackNumDragging(e))).next(ge(this.view,n.elevationAlignedLocation)).next(r).next(z(this.view)).next(F(this.view,i.data.spatialReference)).next(fe()).next(He()).next((e=>this._pendingEdgeOffsetInfo?e:p(e))).next((e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()})),o.next((()=>{this._exitEdgeOffsetInputMode(),n.metadata.deleting||(l(),this._onDragCancel())}))}}_initializeEdgeOffset(e,t,i,n){const{view:a,object:o}=this,r=te(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=ee(a,e.manipulator.elevationAlignedLocation,r);let h;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),h=d(h)},c=this.events.on("undo",u);return h=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,(()=>{n.execute({action:"cancel"})}))]),{initializeStep:e=>null==r||null==p?(u(),null):{...e,operation:r,plane:p},cleanup:u}}_initializeEdgeOffsetVisualElement(e,t,i,a){const o=()=>new V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:a.data.spatialReference}),r=new pe({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([h((()=>({color:this._accentColor,draped:t.isDraped})),(({color:e,draped:t})=>{r.color=n(e),r.isDraped=t}),f),t.on("committed",(()=>{r.geometry=o()})),l(r)]);return r.attached=!0,p}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(Ce.RESHAPING),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftEdge?.leftVertex,n=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(n.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,n.pos)<Pe){const e=this._getManipulatorInfoFromHandle(n);null!=e&&l.push(e)}if(s.distance(n.pos,o.pos)<r||a&&s.distance(a.pos,o.pos)<Pe){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!je(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Ae).find((({manipulator:e})=>e.hovering||e.grabbing||e.dragging))}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:n}=i,a=te(t.data.coordinateHelper,e.handle,n);this._selectEdgeOffsetArrow(e,a),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,n,t),this._connectEdgeOffsetTooltip(e,a,t,(()=>{this.removeHandles(a),this._exitEdgeOffsetInputMode()}))],a)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??$(this.view.inputManager?.latestPointerLocation,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,n){const a=()=>this.tooltipInfos.edgeOffset.distance.actual,o=a=>{n(),queueMicrotask((()=>{this.view.focus();const n=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ae(a,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),n.remove()}))},r=()=>{const e=a();null!=e?o(e):n()};return s([m((()=>this.tooltip&&!this.tooltip.focused),(()=>r()),g),this.tooltip.on("discard",n),this.tooltip.on("commit",(e=>{"commit-and-exit"===e.type&&r()}))])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const n=this.view,a=this._operations,o=this._settings;if(!a)return null;const r=a.data.type,l=a.data.spatialReference;if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=we(o.manipulators.vertex);this._vertexManipulatorGeometry=he(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=he(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=we(o.manipulators.edge);this._edgeManipulatorGeometry=he(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=he(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new N(this._vertexManipulatorGeometry.instantiate(),Le.Vertex|ve.Unselected),new N(this._vertexManipulatorOutlineGeometry.instantiate(),Le.Vertex|ve.Unfocused|ve.Unselected),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Le.Vertex|ve.Focused|ve.Unselected),new N(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),ve.Selected),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),ve.Selected|ve.Unfocused),new N(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),ve.Selected|ve.Focused)];this.enableMidpoints&&p.push(new N(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),Le.Edge|ve.Focused|ve.Unselected),new N(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Le.Edge|ve.Focused|ve.Unselected),new N(this._edgeManipulatorGeometry.instantiate(),Le.Edge|ve.Unfocused|ve.Unselected),new N(this._edgeManipulatorOutlineGeometry.instantiate(),Le.Edge|ve.Unfocused|ve.Unselected));const h=new D({view:n,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Te(l)});h.selected=i,this._setTypeSpecificManipulatorSettings(h,e,t);const u="edge"===e.type?{manipulator:h,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:h,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(u),this.manipulators.add(h),this._updateManipulatorPosition(u),"edge"===u.type){const e=[];for(const t of[u.handle.leftVertex,u.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(u))))}u.locationUpdateHandle=s(e),this._manipulatorHandles.add(u.locationUpdateHandle,h)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(h,!0),h);const c=me(h,((e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:h}=Oe({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new Ee({editGeometryOperations:a,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new k}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next((t=>(this._onDragCancel(!e.metadata.deleting,(()=>r=d(r))),t))).next(h);const{elevationAlignedLocation:c}=e,f=this.object.graphic??void 0;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&a&&(r=a.createUndoGroup()),"edge"===u.type){const t=this._splitEdgeManipulator(u);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:u,snapOrigin:u.handle.pos}})).next(ge(n,c)).next(R(n,c,t,l,f)).next(ce(n,t,f)).next(...p).next(fe()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=d(r)),this._resetTooltip()}))}));return this._manipulatorHandles.add([c,h.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,u))),h.events.on("select-changed",(()=>{u.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()})),h.events.on("focus-changed",(()=>{this._resetTooltip()}))],h),this.events.emit("manipulators-changed"),u}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case Ce.NONE:break;case Ce.MOVING:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case Ce.RESHAPING:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(Ce.NONE)}_setTypeSpecificManipulatorSettings(e,t,i){const n=this._settings;switch(t.type){case"vertex":{e.state=Le.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:a}=n.manipulators.vertex;e.radius=t/2+a,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"edge":{e.state=Le.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:a}=n.manipulators.edge;e.radius=t/2+a,e.elevationInfo="on-the-ground"!==i.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)}))}_onGrabStateChanged(e,t,i,n="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Ce.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==n||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Ae(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),this._objectMoveManipulation.forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Ge),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==n)return;const a=i.manipulator,o=n.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=a.location,n=o.location,s=.5,r=i.x+s*(n.x-i.x),l=i.y+s*(n.y-i.y),p=i.hasZ&&n.hasZ?0:void 0;e.manipulator.location=A(r,l,p,t.data.spatialReference)}else E(De,a.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=De}}_splitEdgeManipulator(e,t=.5){const i=this._operations,n=i.splitEdge(e.handle,t).createdVertex;e.locationUpdateHandle=d(e.locationUpdateHandle);const a=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(n)):(o=e,o.handle=n,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,a)),n.leftEdge&&this._createVertexOrEdgeManipulator(n.leftEdge),n.rightEdge&&this._createVertexOrEdgeManipulator(n.rightEdge),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(Ce.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(n.component);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:n.index}],added:r}),s&&this._updateEventState(Ce.NONE),o}_updateMoveManipulationPosition(){const e=O(De,0,0,0);let t=0,i=!1,n=null,a=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,y(e,e,r.manipulator.renderLocation),null==n||r.selectedIndex>n.selectedIndex?(a=n,n=r):(null==a||r.selectedIndex>a.selectedIndex)&&(a=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&Y(this._operations,o.elevationInfo),this._moveManipulation.angle=Z(s),this._moveManipulation.radius=J.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&Y(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=n){const e=n.handle.pos,t=null!=a?a.handle.pos:n.handle.leftEdge?.leftVertex?n.handle.leftEdge.leftVertex.pos:null,o=null==a&&n.handle.rightEdge?.rightVertex?n.handle.rightEdge.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Ve(t,e):o&&(i=Ve(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=W}0!==t&&i?(j(e,e,1/t),Ge.spatialReference=this._operations.data.spatialReference,Ge.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Ge),this._moveManipulation.elevationAlignedLocation=Ge):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const n of e){const e=n.handle.component;if("vertex"===n.type&&i.canRemoveVertex(e)){t.push(n.handle),this._removeManipulator(n),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.rightEdge));const a=i.removeVertices([n.handle]),o=a.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.edges[0]))}}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}})),n=this._updateEventState(Ce.RESHAPING);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(n&&(this._updateEventState(Ce.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?xe.NEW_STEP:xe.ACCUMULATE_STEPS)){const n=this._operations;if(n){e.length>0&&n.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t,i){if(!this._operations)return;const n=t.clone();n.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],n),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===ue.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===ue.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=re(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=le(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?le(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return 1===e.length?e[0]:null}get _tooltipsContext(){return{sketchOptions:this._sketchOptions,tooltipInfos:this.tooltipInfos,activeTooltipInfo:this.activeTooltipInfo,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks}}get test(){}};function He(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function we(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Ve(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Te(e){return new w({x:0,y:0,z:0,spatialReference:e})}function Ae(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],Se.prototype,"_numGrabbing",void 0),e([_()],Se.prototype,"_numDragging",void 0),e([_()],Se.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],Se.prototype,"_operations",null),e([_()],Se.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],Se.prototype,"tool",void 0),e([_()],Se.prototype,"tooltip",void 0),e([_()],Se.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],Se.prototype,"updating",null),e([_()],Se.prototype,"manipulators",null),e([_()],Se.prototype,"view",null),e([_()],Se.prototype,"object",null),e([_()],Se.prototype,"enableZShape",null),e([_()],Se.prototype,"enableDeleteVertices",null),e([_()],Se.prototype,"enableZVertex",null),e([_()],Se.prototype,"autoHideManipulators",null),e([_()],Se.prototype,"enableMoveObject",null),e([_()],Se.prototype,"enableMidpoints",null),e([_()],Se.prototype,"enableEdgeOffset",null),e([_()],Se.prototype,"_sketchOptions",null),e([_()],Se.prototype,"_accentColor",null),e([_()],Se.prototype,"_tooltipsContext",null),Se=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],Se);const Ge=A(0,0,void 0,T.WGS84),De=S(),Pe=1e-6;var Le,Ce,Ne;!function(e){e.Vertex=Me.Custom1,e.Edge=Me.Custom2}(Le||(Le={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Ce||(Ce={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Ne||(Ne={}));export{Se as ReshapeOperation};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as n}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import a from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as d}from"../../../../../core/maybe.js";import{watch as u,on as h,initial as c,syncAndInitial as m,when as g,sync as f}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as b,d as x,m as E,i as O,f as y,g as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as H}from"../../../../../core/support/UpdatingHandles.js";import w from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import A from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as G}from"../../../../../symbols/support/utils.js";import{Manipulator3D as D}from"../../Manipulator3D.js";import{createManipulatorMaterial as L,createManipulatorOutlineMaterial as P,placeAtObject as U}from"../../manipulatorUtils.js";import{RenderObject as C}from"../../RenderObject.js";import{SegmentLabels3D as N}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as k}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as z,convertToMapCoordinates as F}from"../dragEventPipeline3D.js";import{orientation as Z}from"../geometryUtils.js";import{ManipulatorType as X}from"../ManipulatorType.js";import{canMoveZOperations as Y}from"../manipulatorUtils.js";import{Settings as q}from"../settings.js";import{createVisualElements as B}from"../visualElementUtils.js";import{discRadiusSmall as W}from"../manipulations/config.js";import{ManipulationType as K,MoveManipulation as J}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as Q}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as $,createEdgeOffsetIntersectionPlane as ee,createEdgeOffsetOperation as te,edgeOffsetRotationMatrix as ie,screenEdgeLengthSquared as ne,getDistanceInGeometrySR as ae}from"./edgeOffsetUtils.js";import{createTooltipInfos as oe,connectTooltipToManipulatedObject as se,getUpdatedTranslateObjectTooltipInfo as re,getUpdatedEdgeOffsetTooltipInfo as le}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as pe}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as de,createSphereGeometry as ue}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as he}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as ce,addMapDelta as me,createManipulatorDragEventPipeline as ge,dragAtLocation as fe,addScreenDelta as _e}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ve,ManipulatorStateCustomFlags as Me}from"../../../../interactive/interfaces.js";import{tooltipKeys as be}from"../../../../interactive/keybindings.js";import{AccumulationBehavior as xe}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as Ee}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Oe}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as ye,enterInputModeIfAvailable as je}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const Ie=Symbol();let Se=class extends t{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Ue.NONE,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new H,this._recreatingManipulators=!1,this._settings=new q({getTheme:()=>this.view.effectiveTheme}),this.events=new a,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(Ue.RESHAPING),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(Ue.NONE,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(Ue.MOVING),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(Ue.NONE,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=oe(this._sketchOptions,e),this._vertexManipulatorMaterial=L(n(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=P(n(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=P(n(i.hoverOutlineColor),i.renderOccluded);const a=t.edge;this._edgeManipulatorMaterial=L(n(a.color),a.renderOccluded),this._edgeManipulatorOutlineMaterial=P(n(a.outlineColor),a.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=L(n(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=L(n(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=L(n(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=P(n(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=P(n(s.hoverOutlineColor),s.renderOccluded),this.tooltip=ye((()=>({view:e,options:this._sketchOptions.tooltips}))),this.addHandles([u((()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}}),(({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:n})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),n.applyColor(this._selectedManipulatorMaterial),n.applyOutline(this._selectedManipulatorOutlineMaterial),n.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),u((()=>this.object.visible),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Te(t)&&(t.edgeManipulator.available=e)})),u((()=>this._numGrabbing+this._numDragging===0),(e=>this._toggleAutoHideManipulators(e))),u((()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")}),c),se(this.tooltip,this.object,(()=>this._tooltipsContext)),u((()=>this.tooltip.mode),((e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()})),h((()=>this._operations),"vertex-update",(e=>this._updateManipulatorPositions(e.vertices)),{onListenerAdd:()=>this._recreateManipulators()}),h((()=>this._operations?.data),"change",(e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()}))])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===be.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!je(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const i of this._operations.data.components){const n=e?.byComponentIndex.get(i.index);for(const e of i.vertices){const i=n?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of i.edges)this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}get canRedo(){return null!=this._operations&&this._operations.canRedo}get canUndo(){return null!=this._operations&&this._operations.canUndo}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new N({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const n=[],a=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),o=e===Ce.SELECTED_OR_ALL&&a;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||n.push(s),i++);this._moveVertices(n,t);if(n.length===i){if(this._updateEventState(Ue.MOVING),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(Ue.RESHAPING),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Ie):this.tool.manipulators.forEach((({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Ie)})))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e),0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Ue.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:n}=e;if(!t&&!i&&!n)return;const a=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&a.push(o);this._moveVertices(a,e,xe.ACCUMULATE_STEPS),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case Ue.NONE:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case Ue.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case Ue.MOVING:switch(this._reshapeEventState){case Ue.NONE:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case Ue.RESHAPING:switch(this._reshapeEventState){case Ue.NONE:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case Ue.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:n}=this;if(n){if(this._objectMoveManipulation=new Q({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=n.createUndoGroup()),t))).next((e=>this._perObjectManipulatorDragAction(Ce.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(K.XY,e),e))).next((t=>{"end"===t.action&&(this._resetTooltip(),e=d(e))})),a.next((()=>this._onDragCancel(!0,(()=>e=d(e)))))}))),this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1))))}else this._objectMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))))}}_createMoveManipulation(e){const{object:t,tool:i,view:n,_operations:a}=this;if(!a)return;this._moveManipulation=new J({tool:i,view:n,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&Y(t.operations,t.elevationInfo),snapToScene:!1,radius:J.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles([e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()})),this._watchAndUpdateGrabState(e,!1)])));const o=e=>t=>{this.addHandles([t.events.on("focus-changed",(({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()}))])};this._moveManipulation.xyManipulation.forEachManipulator(o(K.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(K.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o(K.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=a.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((n,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:d}=Oe({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new Ee({editGeometryOperations:a,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new k}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next((e=>(this._onDragCancel(),e))).next(d),{steps:s=s.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===X.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e})).next(ce(this.view,e,t.graphic??void 0)).next(...p).next(me()).next((e=>this._perObjectManipulatorDragAction(Ce.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(n,e),e))),cancel:r}}),e,s,t.graphic),u((()=>t.visible),(()=>this._updateMoveManipulationPosition()),c),t.on("committed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),u((()=>t.isDraped),(e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):this.removeHandles(t)}),c)])}_createVisualElements(){const{object:e,view:t}=this,i=B({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,X.TRANSLATE_XY)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof pe?i.visualElement:null);const n=this._outlineVisualElement;if(null!=n){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(h((()=>n.events),"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,n=this._operations;if(e.component.vertices.length<=2||!n)return null;const a=n.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,d=p/2,u=p*Math.sqrt(3)/2,{height:h,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=de(m,u,d,d,h,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=de(m,-u,d,d,h,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new C(this._edgeOffsetManipulatorGeometryInside.instantiate(),ve.Unfocused),new C(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ve.Focused),new C(this._edgeOffsetManipulatorGeometryOutside.instantiate(),ve.Unfocused),new C(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),ve.Focused)],f=new D({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Ae(a)}),_=new D({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Ae(a)}),v={manipulator:f,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map((e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)})));const b=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),ge(f,this._createEdgeOffsetPipeline(v,t,n)),ge(_,this._createEdgePipeline(v,t,n)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",(()=>this._resetTooltip())),f.events.on("grab-changed",(({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?$(e,this.view,this.object,v):null}))],f),this._manipulatorInfos.push(v),this.manipulators.addMany([f,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,n=e.edgeManipulator,a=()=>{e.visibilityHandle=d(e.visibilityHandle);const a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=a&&null!=o&&ne(a.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!n.focused||l)&&(i.grabbable=!l,n.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,n.grabbable=this.enableMoveObject}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",a),n.events.on("focus-changed",a),r((()=>{d(e.visibilityHandle),n.metadata.deleting=!0,this.manipulators.remove(n)}))],i),a()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=ee(this.view,e.manipulator.elevationAlignedLocation,te(t,e.handle,e.manipulator.elevationInfo)),n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==n||null==a)return;const o=n.manipulator.renderLocation,s=a.manipulator.renderLocation,r=null!=i?ie(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(De,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(n,a,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(n,a,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=n;a.next((e=>this._trackNumDragging(e))).next(fe(this.view,r)).next(R(this.view,r,t,s,e)).next(_e()).next(me()).next((e=>this._perObjectManipulatorDragAction(Ce.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(K.XY,e),e))).next((e=>{"end"===e.action&&this._resetTooltip()})),o.next((()=>this._onDragCancel(!n.metadata.deleting)))}}}_createEdgeOffsetPipeline(e,t,i){return(n,a,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);a.next((e=>this._trackNumDragging(e))).next(fe(this.view,n.elevationAlignedLocation)).next(r).next(z(this.view)).next(F(this.view,i.data.spatialReference)).next(me()).next(He()).next((e=>this._pendingEdgeOffsetInfo?e:p(e))).next((e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()})),o.next((()=>{this._exitEdgeOffsetInputMode(),n.metadata.deleting||(l(),this._onDragCancel())}))}}_initializeEdgeOffset(e,t,i,n){const{view:a,object:o}=this,r=te(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=ee(a,e.manipulator.elevationAlignedLocation,r);let u;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const h=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),u=d(u)},c=this.events.on("undo",h);return u=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,(()=>{n.execute({action:"cancel"})}))]),{initializeStep:e=>null==r||null==p?(h(),null):{...e,operation:r,plane:p},cleanup:h}}_initializeEdgeOffsetVisualElement(e,t,i,a){const o=()=>new V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:a.data.spatialReference}),r=new pe({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([u((()=>({color:this._accentColor,draped:t.isDraped})),(({color:e,draped:t})=>{r.color=n(e),r.isDraped=t}),m),t.on("committed",(()=>{r.geometry=o()})),l(r)]);return r.attached=!0,p}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(Ue.RESHAPING),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){const i=e.handle.leftVertex.leftEdge?.leftVertex,n=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(n.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,n.pos)<Le){const e=this._getManipulatorInfoFromHandle(n);null!=e&&l.push(e)}if(s.distance(n.pos,o.pos)<r||a&&s.distance(a.pos,o.pos)<Le){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!je(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Te).find((({manipulator:e})=>e.hovering||e.grabbing||e.dragging))}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:n}=i,a=te(t.data.coordinateHelper,e.handle,n);this._selectEdgeOffsetArrow(e,a),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,n,t),this._connectEdgeOffsetTooltip(e,a,t,(()=>{this.removeHandles(a),this._exitEdgeOffsetInputMode()}))],a)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??$(this.view.inputManager?.latestPointerLocation,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,n){const a=()=>this.tooltipInfos.edgeOffset.distance.actual,o=a=>{n(),queueMicrotask((()=>{this.view.focus();const n=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ae(a,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),n.remove()}))},r=()=>{const e=a();null!=e?o(e):n()};return s([g((()=>this.tooltip&&!this.tooltip.focused),(()=>r()),f),this.tooltip.on("discard",n),this.tooltip.on("commit",(e=>{"commit-and-exit"===e.type&&r()}))])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const n=this.view,a=this._operations,o=this._settings;if(!a)return null;const r=a.data.type,l=a.data.spatialReference;if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=we(o.manipulators.vertex);this._vertexManipulatorGeometry=ue(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=ue(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=we(o.manipulators.edge);this._edgeManipulatorGeometry=ue(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=ue(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new C(this._vertexManipulatorGeometry.instantiate(),Pe.Vertex|ve.Unselected),new C(this._vertexManipulatorOutlineGeometry.instantiate(),Pe.Vertex|ve.Unfocused|ve.Unselected),new C(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Pe.Vertex|ve.Focused|ve.Unselected),new C(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),ve.Selected),new C(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),ve.Selected|ve.Unfocused),new C(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),ve.Selected|ve.Focused)];this.enableMidpoints&&p.push(new C(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),Pe.Edge|ve.Focused|ve.Unselected),new C(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Pe.Edge|ve.Focused|ve.Unselected),new C(this._edgeManipulatorGeometry.instantiate(),Pe.Edge|ve.Unfocused|ve.Unselected),new C(this._edgeManipulatorOutlineGeometry.instantiate(),Pe.Edge|ve.Unfocused|ve.Unselected));const u=new D({view:n,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Ae(l)});u.selected=i,this._setTypeSpecificManipulatorSettings(u,e,t);const h="edge"===e.type?{manipulator:u,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:u,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(h),this.manipulators.add(u),this._updateManipulatorPosition(h),"edge"===h.type){const e=[];for(const t of[h.handle.leftVertex,h.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(h))))}h.locationUpdateHandle=s(e),this._manipulatorHandles.add(h.locationUpdateHandle,u)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(u,!0),u);const c=ge(u,((e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:u}=Oe({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new Ee({editGeometryOperations:a,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new k}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next((t=>(this._onDragCancel(!e.metadata.deleting,(()=>r=d(r))),t))).next(u);const{elevationAlignedLocation:c}=e,m=this.object.graphic??void 0;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&a&&(r=a.createUndoGroup()),"edge"===h.type){const t=this._splitEdgeManipulator(h);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:h,snapOrigin:h.handle.pos}})).next(fe(n,c)).next(R(n,c,t,l,m)).next(ce(n,t,m)).next(...p).next(me()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=d(r)),this._resetTooltip()}))}));return this._manipulatorHandles.add([c,u.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,h))),u.events.on("select-changed",(()=>{h.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()})),u.events.on("focus-changed",(()=>{this._resetTooltip()}))],u),this.events.emit("manipulators-changed"),h}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case Ue.NONE:break;case Ue.MOVING:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(Ue.NONE)}_setTypeSpecificManipulatorSettings(e,t,i){const n=this._settings;switch(t.type){case"vertex":{e.state=Pe.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:a}=n.manipulators.vertex;e.radius=t/2+a,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"edge":{e.state=Pe.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:a}=n.manipulators.edge;e.radius=t/2+a,e.elevationInfo="on-the-ground"!==i.mode||G(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)}))}_onGrabStateChanged(e,t,i,n="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Ue.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==n||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Te(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),this._objectMoveManipulation.forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Ge),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==n)return;const a=i.manipulator,o=n.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=a.location,n=o.location,s=.5,r=i.x+s*(n.x-i.x),l=i.y+s*(n.y-i.y),p=i.hasZ&&n.hasZ?0:void 0;e.manipulator.location=T(r,l,p,t.data.spatialReference)}else E(De,a.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=De}}_splitEdgeManipulator(e,t=.5){const i=this._operations,n=i.splitEdge(e.handle,t).createdVertex;e.locationUpdateHandle=d(e.locationUpdateHandle);const a=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(n)):(o=e,o.handle=n,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,a)),n.leftEdge&&this._createVertexOrEdgeManipulator(n.leftEdge),n.rightEdge&&this._createVertexOrEdgeManipulator(n.rightEdge),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(Ue.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(n.component);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:n.index}],added:r}),s&&this._updateEventState(Ue.NONE),o}_updateMoveManipulationPosition(){const e=O(De,0,0,0);let t=0,i=!1,n=null,a=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,y(e,e,r.manipulator.renderLocation),null==n||r.selectedIndex>n.selectedIndex?(a=n,n=r):(null==a||r.selectedIndex>a.selectedIndex)&&(a=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&Y(this._operations,o.elevationInfo),this._moveManipulation.angle=Z(s),this._moveManipulation.radius=J.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&Y(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=n){const e=n.handle.pos,t=null!=a?a.handle.pos:n.handle.leftEdge?.leftVertex?n.handle.leftEdge.leftVertex.pos:null,o=null==a&&n.handle.rightEdge?.rightVertex?n.handle.rightEdge.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Ve(t,e):o&&(i=Ve(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=W}0!==t&&i?(j(e,e,1/t),Ge.spatialReference=this._operations.data.spatialReference,Ge.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Ge),this._moveManipulation.elevationAlignedLocation=Ge):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?U(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const n of e){const e=n.handle.component;if("vertex"===n.type&&i.canRemoveVertex(e)){t.push(n.handle),this._removeManipulator(n),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.rightEdge));const a=i.removeVertices([n.handle]),o=a.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.edges[0]))}}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}})),n=this._updateEventState(Ue.RESHAPING);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(n&&(this._updateEventState(Ue.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?xe.NEW_STEP:xe.ACCUMULATE_STEPS)){const n=this._operations;if(n){e.length>0&&n.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t,i){if(!this._operations)return;const n=t.clone();n.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],n),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===he.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===he.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=re(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=le(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?le(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return 1===e.length?e[0]:null}get _tooltipsContext(){const{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:n}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:n}}get test(){}};function He(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function we(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Ve(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ae(e){return new w({x:0,y:0,z:0,spatialReference:e})}function Te(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],Se.prototype,"_numGrabbing",void 0),e([_()],Se.prototype,"_numDragging",void 0),e([_()],Se.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],Se.prototype,"_operations",null),e([_()],Se.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],Se.prototype,"tool",void 0),e([_()],Se.prototype,"tooltip",void 0),e([_()],Se.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],Se.prototype,"updating",null),e([_()],Se.prototype,"manipulators",null),e([_()],Se.prototype,"view",null),e([_()],Se.prototype,"automaticAreaMeasurementUtils",null),e([_()],Se.prototype,"automaticLengthMeasurementUtils",null),e([_()],Se.prototype,"object",null),e([_()],Se.prototype,"enableZShape",null),e([_()],Se.prototype,"enableDeleteVertices",null),e([_()],Se.prototype,"enableZVertex",null),e([_()],Se.prototype,"autoHideManipulators",null),e([_()],Se.prototype,"enableMoveObject",null),e([_()],Se.prototype,"enableMidpoints",null),e([_()],Se.prototype,"enableEdgeOffset",null),e([_()],Se.prototype,"_sketchOptions",null),e([_()],Se.prototype,"_accentColor",null),e([_()],Se.prototype,"_tooltipsContext",null),Se=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],Se);const Ge=T(0,0,void 0,A.WGS84),De=S(),Le=1e-6;var Pe,Ue,Ce;!function(e){e.Vertex=Me.Custom1,e.Edge=Me.Custom2}(Pe||(Pe={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Ue||(Ue={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Ce||(Ce={}));export{Se as ReshapeOperation};