@arcgis/core 5.1.0-next.106 → 5.1.0-next.108

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 (396) hide show
  1. package/analysis/ShadowCastAnalysis.d.ts +2 -1
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/arcgisGlobal.d.ts +5 -0
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{b7a81fd4994eabba1869.js → 0c8e6ccb5a8174718d62.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{be817be7c81fb630122f.js → 17604cbd4d24158e2c16.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{065dd2fdc834146423c7.js → 33ec193e6d7a0cb9d8dd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/4e13d639419ac64f7563.js +1 -0
  9. package/assets/esri/core/workers/chunks/4f9ea7544b2d0e88a05c.js +1 -0
  10. package/assets/esri/core/workers/chunks/{15920af0c4f46773b06e.js → 502c3da8c49bf885f51d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +1 -0
  12. package/assets/esri/core/workers/chunks/{aaad0d3e82ed917d3886.js → 547dc6ccb989bd962661.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{bd59cb5abc67e46f1b2c.js → 55334ad3618899cdbf78.js} +2 -2
  14. package/assets/esri/core/workers/chunks/{d859c046a3ea42530bff.js → 56d9d3f108ff6e719dd4.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{770611659b38066a6228.js → 5a85cbc04c64091d7f46.js} +1 -1
  16. package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +1 -0
  17. package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +1 -0
  18. package/assets/esri/core/workers/chunks/91c0de3950991d81b7f2.js +1 -0
  19. package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +1 -0
  20. package/assets/esri/core/workers/chunks/{a8ae00e06f98e04aee8e.js → ac408c62565e2c8b5975.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{f7fe17a22390a24d6df8.js → b69d1d528e271568cbd8.js} +2 -2
  22. package/assets/esri/core/workers/chunks/{0cc74bc3772be51cabc1.js → bbaf8baa3ca6195467e4.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{7ce60331f94ee0a5d674.js → beff5b4e15edee12bd4c.js} +33 -41
  24. package/assets/esri/core/workers/chunks/{b9850fe7dcdaed0c327c.js → cdb48d198145493f76f3.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{63ea4191d441efd2f146.js → d4014213c476bf8099af.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{740588250eaffb7301fd.js → e1340232962cf576d37e.js} +1 -1
  27. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  28. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  29. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  30. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -24
  31. package/assets/esri/themes/dark/main.css +1 -1
  32. package/assets/esri/themes/light/main.css +1 -1
  33. package/assets/esri/themes/light/view.css +1 -1
  34. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  35. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
  36. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
  37. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
  38. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
  39. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
  40. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
  41. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
  42. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
  43. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
  44. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
  45. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
  46. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
  47. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
  48. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
  49. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
  50. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
  51. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
  52. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
  53. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
  54. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
  55. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
  56. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
  57. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
  58. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
  59. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
  60. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
  61. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
  62. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
  63. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
  64. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
  65. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
  66. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
  67. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
  68. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
  69. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
  70. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
  71. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
  72. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
  73. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  74. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  75. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  76. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  77. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  78. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  79. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  80. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  81. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  82. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  83. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  84. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  85. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  86. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  87. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  88. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  89. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  90. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  91. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  92. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  93. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  94. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  95. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  96. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  97. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  98. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  99. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  100. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  101. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  102. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  103. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  104. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  105. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  106. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  107. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  108. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  109. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  110. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  111. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  128. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  131. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  132. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  133. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  134. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  135. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  137. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  138. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  139. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  140. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  141. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  142. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  143. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  144. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  145. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  146. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  147. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  148. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  149. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  150. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  151. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  152. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  153. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  154. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  155. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  156. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  157. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  158. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  159. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  160. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  161. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  162. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  163. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  164. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  165. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  166. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  169. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  170. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  171. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  172. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  173. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  174. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  175. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  176. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  177. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  178. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  179. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  180. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  181. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  182. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  183. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  184. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  185. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  186. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  187. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  188. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  189. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  190. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  191. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  192. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  193. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  233. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  234. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  235. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  236. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  237. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  238. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  239. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  240. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  241. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  242. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  243. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  244. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  245. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  246. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  247. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  248. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  249. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  250. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  251. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  252. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  253. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  254. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  257. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  258. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  259. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  260. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  261. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  262. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  263. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  264. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  265. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  266. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  267. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  268. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  269. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  270. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  271. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  272. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  273. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  274. package/chunks/Fog.glsl.js +3 -3
  275. package/chunks/GlobalIllumination.glsl.js +12 -12
  276. package/chunks/GlowComposition.glsl.js +38 -56
  277. package/chunks/OITBlend.glsl.js +7 -7
  278. package/chunks/OITBlendEmission.glsl.js +4 -4
  279. package/chunks/OITDimOpaque.glsl.js +8 -3
  280. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  281. package/chunks/lyr3DWorker.js +1 -1
  282. package/chunks/pe-wasm.js +1 -1
  283. package/config.js +1 -1
  284. package/core/workers/workers.js +1 -1
  285. package/geometry/support/WKIDUnitConversion.js +1 -1
  286. package/identity/IdentityManagerBase.js +1 -1
  287. package/kernel.js +1 -1
  288. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  289. package/layers/raster/datasets/MRFRaster.js +1 -1
  290. package/layers/video/VideoController.js +1 -1
  291. package/package.json +3 -3
  292. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  293. package/rest/networks/circuits/support/VerifyCircuitsResult.js +1 -1
  294. package/support/revision.js +1 -1
  295. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  296. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  297. package/views/2d/layers/RouteLayerView2D.js +1 -1
  298. package/views/2d/layers/TileLayerView2D.js +1 -1
  299. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  300. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  301. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  302. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  303. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  304. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  305. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  306. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +3 -1
  307. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  308. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  309. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  310. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +2 -0
  311. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  312. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  313. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
  314. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  315. package/views/3d/environment/FoggyWeather.js +1 -1
  316. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  317. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  318. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  319. package/views/3d/layers/I3SMeshView3D.js +1 -1
  320. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  321. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  322. package/views/3d/layers/TileLayerView3D.js +1 -1
  323. package/views/3d/layers/i3s/Intersector.js +1 -1
  324. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  325. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  326. package/views/3d/support/ResourceController.js +1 -1
  327. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  328. package/views/3d/support/popupHitTest.js +1 -1
  329. package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
  330. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  331. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  332. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  333. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  334. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -12
  335. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  336. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  337. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  338. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  339. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  340. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
  341. package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +1 -1
  342. package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +1 -1
  343. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  344. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  345. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  346. package/views/PopupView.js +1 -1
  347. package/views/SceneView.js +1 -1
  348. package/views/View2D.js +1 -1
  349. package/views/draw/DrawTool.d.ts +77 -0
  350. package/views/draw/support/editingSessionUtils.js +1 -1
  351. package/views/draw/support/managers/PluginLifecycleManager.d.ts +10 -0
  352. package/views/interactive/InteractiveToolBase.d.ts +11 -0
  353. package/views/interactive/editGeometry/interfaces.d.ts +8 -0
  354. package/views/interactive/interfaces.d.ts +20 -0
  355. package/views/layers/FeatureLikeLayerView.js +1 -1
  356. package/views/layers/ImageryLayerView.js +1 -1
  357. package/views/layers/ImageryTileLayerView.js +1 -1
  358. package/views/layers/WMSLayerView.js +1 -1
  359. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  360. package/views/webgl/capabilities/load.js +1 -1
  361. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +26 -1
  362. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  363. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  364. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  365. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +5 -44
  366. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  367. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
  368. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  369. package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +2 -0
  370. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  371. package/widgets/BatchAttributeForm.js +1 -1
  372. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +9 -1
  373. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  374. package/widgets/FeatureForm.js +1 -1
  375. package/widgets/FeatureTable/Grid/Column.js +1 -1
  376. package/widgets/FeatureTable/Grid/types.d.ts +21 -1
  377. package/widgets/FeatureTable.js +1 -1
  378. package/widgets/Sketch/SketchViewModel.d.ts +67 -2
  379. package/widgets/Sketch/SketchViewModel.js +1 -1
  380. package/widgets/Sketch/VisibleElements.d.ts +19 -1
  381. package/widgets/Sketch/VisibleElements.js +1 -1
  382. package/widgets/Sketch/support/OperationHandle.js +1 -1
  383. package/widgets/Sketch/support/PluginManager.d.ts +12 -0
  384. package/widgets/Sketch/support/PluginManager.js +1 -1
  385. package/widgets/Sketch.js +1 -1
  386. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +81 -0
  387. package/widgets/support/SelectionToolbar/types.d.ts +4 -0
  388. package/assets/esri/core/workers/chunks/2a2e97918524e0f436d7.js +0 -1
  389. package/assets/esri/core/workers/chunks/2b3a8a53cd68f666676b.js +0 -1
  390. package/assets/esri/core/workers/chunks/2ecb21c402cdd8c82533.js +0 -1
  391. package/assets/esri/core/workers/chunks/7e02e5c6979090fe3ea7.js +0 -1
  392. package/assets/esri/core/workers/chunks/dcba6c766eee8b90381a.js +0 -1
  393. package/assets/esri/core/workers/chunks/f9324420f2c6ac240f63.js +0 -1
  394. package/assets/esri/core/workers/chunks/fae2c8f053927559fff0.js +0 -1
  395. /package/assets/esri/core/workers/chunks/{bd59cb5abc67e46f1b2c.js.LICENSE.txt → 55334ad3618899cdbf78.js.LICENSE.txt} +0 -0
  396. /package/assets/esri/core/workers/chunks/{f7fe17a22390a24d6df8.js.LICENSE.txt → b69d1d528e271568cbd8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/RandomLCG.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import y from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=[0,0];let q=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new y({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=T(e);if(0===s.length)return i();const r=U(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(h){if(s(h))throw h;if(!this.resampling)return m(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new f(t),h=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return u(this._tileInfoView,h,s,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:h,resamplingLevel:a=0}=i,o=new f(0,0,0,0);let l,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:h}),!this.resampling&&o.level!==e.level)return await r(i),m(this._tileInfoView.size);l=await this._fetchImage(o,h)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&a<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){o.set(t);try{l=await this._fetchTileWithTilemapCache(o,{...i,resamplingLevel:a+1})}catch{}}}}return l?this.resampling?u(this._tileInfoView,l,o,e):l:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i}).then(({bitmap:e})=>e)}};e([h()],q.prototype,"resampling",null),e([h()],q.prototype,"tilemapCache",null),q=e([a("esri.views.2d.layers.TileLayerView2D")],q);const S=q;export{S as default};
2
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as h,subclass as a}from"../../../core/accessorSupport/decorators.js";import{equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/Accessor.js";import"../../../core/has.js";import"../../../core/mathUtils.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/RandomLCG.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2D as c}from"./LayerView2D.js";import g from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as u}from"./support/imageUtils.js";import d from"../tiling/TileInfoView.js";import f from"../tiling/TileKey.js";import y from"../tiling/TileQueue.js";import w from"../tiling/TileStrategy.js";import j from"../../layers/LayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as T}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as b,MapServiceLayerViewHelper as V}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as v}from"../../support/drapedUtils.js";import{getHighlightName as U}from"../../support/highlightOptionsUtils.js";import{TaskPriority as H}from"../../support/Scheduler.js";const I=[0,0];let q=class extends(_(n(c(j)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new d(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new y({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:H.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new w({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),b(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new g(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new V({createFetchPopupFeaturesQueryGeometry:(e,i)=>v(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtTarget(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(e,i):[]}highlight(e,t){const s=T(e);if(0===s.length)return i();const r=U(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return o(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(h){if(s(h))throw h;if(!this.resampling)return m(this._tileInfoView.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new f(t),h=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return u(this._tileInfoView,h,s,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:h,resamplingLevel:a=0}=i,o=new f(0,0,0,0);let l,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:h}),!this.resampling&&o.level!==e.level)return await r(i),m(this._tileInfoView.size);l=await this._fetchImage(o,h)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&a<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){o.set(t);try{l=await this._fetchTileWithTilemapCache(o,{...i,resamplingLevel:a+1})}catch{}}}}return l?this.resampling?u(this._tileInfoView,l,o,e):l:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once("attach",()=>this.requestUpdate()),e.once("isReady",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i}).then(({bitmap:e})=>e)}};e([h()],q.prototype,"resampling",null),e([h()],q.prototype,"tilemapCache",null),q=e([a("esri.views.2d.layers.TileLayerView2D")],q);const S=q;export{S as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../../../../request.js";import e from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import r from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as a}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as s,quantizeOptimizedFeatureSet as i}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as o}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as n,getQueryParameters as u,executeQuery as c}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as m}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as p}from"../../../support/FeatureSetReaderPBF.js";class l{constructor(t,e){this.service=t,this._metadata=e}destroy(){}}function f(t,e,r){switch(t.type){case"memory":return new d(t,e,r);case"ogc":return new w(t,e);case"feature-service":return t.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?new h(t,e):new _(t,e)}}async function y(t){const e=new r;return await e.open(t,{}),e}class d extends l{constructor(t,e,r){super(t,e),this._ports=[],this._loaded=this._load(r)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const t of this._ports)t.close()}).catch(()=>{})}async _load(t){this._ports=await t.layerView.openMemoryPorts(),this._client=await y(this._ports)}async executeQuery(t,e){await this._loaded;const r=await this._client.invoke("queryFeatures",t.toJSON(),e);return m.fromFeatureSet(r,this._metadata)}}class h extends l{async executeQuery(r,a){const s=await n(this.service.source,r,a),i=!r.quantizationParameters;try{return p.fromBuffer(s,this._metadata,i)}catch(o){const s=await u(this.service.source,r,"pbf",a??{}),{data:{url:i}}=await t(s.url,{responseType:"native-request-init",...s.options});throw new e("featurelayer:query","Failed to parse response",{url:i,error:o,query:r.toJSON()})}}}class _ extends l{async executeQuery(t,e){const{source:r,queryMetadata:o}=this.service;if(null!=t.quantizationParameters&&!o.supportsQuantization){const o=t.clone(),n=a(o.quantizationParameters);o.quantizationParameters=null;const u=await c(r,o,this._metadata.spatialReference,e),p=s(u,this._metadata.featureIdInfo);return i(n,p),m.fromOptimizedFeatureSet(p,this._metadata)}const n=await c(r,t,this._metadata.spatialReference,e);return"esriGeometryPoint"===this._metadata.geometryType&&(n.features=n.features?.filter(t=>{if(null!=t.geometry){const e=t.geometry;return Number.isFinite(e.x)&&Number.isFinite(e.y)}return!0})),m.fromFeatureSet(n,this._metadata)}}class w extends l{async executeQuery(t,e){if(t.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=t.clone(),s=a(r.quantizationParameters);r.quantizationParameters=null;const n=await o(this.service.source,t,e);return i(s,n),m.fromOptimizedFeatureSet(n,this._metadata)}const r=await o(this.service.source,t,e);return m.fromOptimizedFeatureSet(r,this._metadata)}}export{l as SourceAdapter,f as createQueryAdapter};
2
+ import t from"../../../../../../../request.js";import e from"../../../../../../../core/Error.js";import has from"../../../../../../../core/has.js";import r from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as a}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as s,quantizeOptimizedFeatureSet as o}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as i}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as n,getQueryParameters as u,executeQuery as c}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as m}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as l}from"../../../support/FeatureSetReaderPBF.js";class p{constructor(t,e){this.service=t,this._metadata=e}destroy(){}}function y(t,e,r){switch(t.type){case"memory":return new d(t,e,r);case"ogc":return new _(t,e);case"feature-service":return t.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?new h(t,e):new w(t,e)}}async function f(t){const e=new r;return await e.open(t,{}),e}class d extends p{constructor(t,e,r){super(t,e),this._ports=[],this._loaded=this._load(r)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const t of this._ports)t.close()}).catch(()=>{})}async _load(t){this._ports=await t.layerView.openMemoryPorts(),this._client=await f(this._ports)}async executeQuery(t,e){await this._loaded;const r=await this._client.invoke("queryFeatures",t.toJSON(),e);return m.fromFeatureSet(r,this._metadata)}}class h extends p{async executeQuery(r,a){const s=await n(this.service.source,r,a),o=!r.quantizationParameters;try{return l.fromBuffer(s,this._metadata,o)}catch(i){const s=await u(this.service.source,r,"pbf",a??{}),{data:{url:o}}=await t(s.url,{responseType:"native-request-init",...s.options});throw new e("featurelayer:query","Failed to parse response",{url:o,error:i,query:r.toJSON()})}}}class w extends p{async executeQuery(t,e){const{source:r,queryMetadata:i}=this.service,n=null;if(null!=t.quantizationParameters&&!i.supportsQuantization){const i=t.clone(),u=a(i.quantizationParameters);i.quantizationParameters=null;const l=await c(r,i,n,e),p=s(l,this._metadata.featureIdInfo);return o(u,p),m.fromOptimizedFeatureSet(p,this._metadata)}const u=await c(r,t,n,e);return"esriGeometryPoint"===this._metadata.geometryType&&(u.features=u.features?.filter(t=>{if(null!=t.geometry){const e=t.geometry;return Number.isFinite(e.x)&&Number.isFinite(e.y)}return!0})),m.fromFeatureSet(u,this._metadata)}}class _ extends p{async executeQuery(t,e){if(t.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=t.clone(),s=a(r.quantizationParameters);r.quantizationParameters=null;const n=await i(this.service.source,t,e);return o(s,n),m.fromOptimizedFeatureSet(n,this._metadata)}const r=await i(this.service.source,t,e);return m.fromOptimizedFeatureSet(r,this._metadata)}}export{p as SourceAdapter,y as createQueryAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as l,generalizeOptimizedGeometry as c,quantizeOptimizedGeometry as m,unquantizeOptimizedGeometryInPlace as y}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as f}from"../../../../../layers/graphics/OptimizedFeature.js";import p from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as g,unknown as _}from"../../../../../time/constants.js";import{FeatureSetCache as b}from"./FeatureSetCache.js";const x=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=x[0],T=x[1],F=x[2],I=x[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],S=A[0],B=A[1],j=A[2],C=has("featurelayer-simplify-mobile-factor")??2,G=has("esri-mobile"),M=4294967295;function v(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class O{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=G?C:1;t>4e6?r=j*s:t>1e6?r=B*s:t>5e5?r=S*s:t>1e5&&(r=s);let i=0;return e>4e3?i=I*r:e>2e3?i=F*r:e>100?i=T:e>15&&(i=D),i}getBounds(e){v(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===M||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(M),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new f(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return l(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=c(t,this.metadata.geometryType,e.scale[0])),t&&(t=m(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&y(t,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&y(r,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new b(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);if("esriGeometryPoint"===this.geometryType||!t)return t;const r=this.getInTransform();if(!t||!r)return t;const s=r.scale[2]??1,i=r.translate[2]??0,o=r.scale[3]??1,a=r.translate[3]??0,{hasZ:n,hasM:d,stride:u,size:h,coords:l}=t,c=n&&(1!==s||0!==i),m=d&&(1!==o||0!==a);if(c||m){const e=2,t=n?3:2;for(let r=0,n=u*h;r<n;r+=u)c&&(l[r+e]=s*l[r+e]+i),m&&(l[r+t]=o*l[r+t]+a)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=l(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??g):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===_}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&null==this.geometry()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;const t=this.getCursor();for(;t.next();){e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}const e=this.getObjectId();return this._deleted.has(e)||!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(e);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?isNaN(r[0])||isNaN(r[1])?h(e):(r[1]*=-1,new p([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return l(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new p([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new p([2],[e-1,t+1,1,-1])}}export{O as FeatureSetReader};
2
+ import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{estimateNumberArrayMemory as t}from"../../../../../core/memoryEstimations.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{quantizeX as d,quantizeY as u}from"../../../../../geometry/support/quantizationUtils.js";import{zScale as c}from"../../../../../geometry/support/zscale.js";import{getCentroidOptimizedGeometry as h}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as l,generalizeOptimizedGeometry as m,quantizeOptimizedGeometry as y,unquantizeOptimizedGeometryInPlace as f}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as p}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as _,unknown as b}from"../../../../../time/constants.js";import{FeatureSetCache as x}from"./FeatureSetCache.js";const T=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],D=T[0],F=T[1],I=T[2],S=T[3],A=has("featurelayer-simplify-payload-size-factors")??[1,2,4],j=A[0],B=A[1],C=A[2],G=has("featurelayer-simplify-mobile-factor")??2,M=has("esri-mobile"),v=4294967295;function O(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class w{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._overrides=null,this._postQueryFilteredIds=new Set,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._deleted=new Set,this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(e,t){let r=1;const s=M?G:1;t>4e6?r=C*s:t>1e6?r=B*s:t>5e5?r=j*s:t>1e5&&(r=s);let i=0;return e>4e3?i=S*r:e>2e3?i=I*r:e>100?i=F:e>15&&(i=D),i}getBounds(e){O(this._boundsBuffer,4*this.getIndex()+4,0);const t=this.getBoundsXMin();if(t===v||!isFinite(t))return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(t?.isPoint&&0===t.coords[0]&&0===t.coords[1])return o(e,0,0,0,0),!0;if(!t)return this.setBoundsXMin(v),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)}),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const r=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),a=this.getBoundsYMax();return o(e,r,s,i,a),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}registerOverrides(e){this._overrides=e}withoutOverrides(){const e=this.copy();return e._overrides=null,e}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace();return new p(e,t,r,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return l(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createDeltaQuantizedGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryForDisplayTransformed(e){let t=this.readGeometryForDisplay();if(t&&"esriGeometryPolyline"===this.metadata.geometryType&&(t=m(t,this.metadata.geometryType,e.scale[0])),t&&(t=y(t,this.metadata.geometryType,e,t.hasZ,t.hasM,!0)),!t){const t=this.readCentroidForDisplay();if(!t)return null;const r=d(e,t.coords[0]),s=u(e,t.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(r,s).deltaDecode()}return t}_transformToWorldSpace(e){if(!e)return null;e=e.clone();const t=this.getInTransform();t&&f(e,t);const r=c(this.metadata.spatialReference,this.metadata.outSpatialReference);if(e.hasZ&&1!==r){const{stride:t,coords:s}=e;for(let e=2;e<s.length;e+=t)s[e]*=r}return e}readGeometryWorldSpace(){let e=this._readGeometry();return e||(e=this._createDeltaQuantizedGeometryFromServerCentroid()),this._transformToWorldSpace(e)}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();return this._transformToWorldSpace(t)}setCache(e){let t=this._caches.get(e);null==t&&(t=new x(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}delete(){this._deleted.add(this.getObjectId())}getByReferenceVertexCount(){return null}get underlyingMemory(){let e=0;e+=t(this._boundsBuffer);for(const t of this._caches.values())e+=t.usedMemory;return e}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);if("esriGeometryPoint"===this.geometryType||!t)return t;const r=this.getInTransform();if(!t||!r)return t;const s=r.scale[2]??1,i=r.translate[2]??0,o=r.scale[3]??1,a=r.translate[3]??0,{hasZ:n,hasM:d,stride:u,size:c,coords:h}=t,l=n&&(1!==s||0!==i),m=d&&(1!==o||0!==a);if(l||m){const e=2,t=n?3:2;for(let r=0,n=u*c;r<n;r+=u)l&&(h[r+e]=s*h[r+e]+i),m&&(h[r+t]=o*h[r+t]+a)}return t.deltaDecode()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=l(e,this.geometryType,this.hasZ,this.hasM),r=a(t);if(r){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.outSpatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??_):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===b}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}isEmpty(){return this.fields.fields.length<=0&&null==this.geometry()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}applyPostQueryFilter(e){if(this._postQueryFilteredIds.clear(),!e)return;const t=this.getCursor();for(;t.next();){e.check(t,{currentUser:null})||this._postQueryFilteredIds.add(t.getObjectId())}}_getExists(){if(this._overrides){const e=this.getObjectId();return!this._overrides.hasOverride(e)}const e=this.getObjectId();return this._deleted.has(e)||!this._postQueryFilteredIds.has(e)}_computeDisplayCentroid(e){if(null==this.getInTransform())return h(e);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?isNaN(r[0])||isNaN(r[1])?h(e):(r[1]*=-1,new g([],r)):null}copyInto(e){e._joined=this._joined,e._overrides=this._overrides,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone,e._postQueryFilteredIds=this._postQueryFilteredIds,e._deleted=this._deleted}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return l(e,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createDeltaQuantizedExtrudedGeometry(t,r)}_createDeltaQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(e,t):this._createDeltaQuantizedExtrudedQuad(e,t)}_createDeltaQuantizedExtrudedQuad(e,t){return new g([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(e,t){return new g([2],[e-1,t+1,1,-1])}}export{w as FeatureSetReader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{absoluteHeightElevationInfo as n,getConvertedElevation as o,getGraphicEffectiveElevationInfo as e}from"../../../../support/elevationInfoUtils.js";import t from"../../../../symbols/support/ElevationInfo.js";function l(n){return n?.clone()??null}function r(n){return n?.clone()??null}function u(n){const o=l(n);return n&&o?{observer:n,snapshot:o}:null}function i(n){return{target:n,snapshot:r(n)??n.clone()}}function a(e,t,l,r=null){const u=l.clone();return u.z=o(t,l,r??n,n),e.getMapPointIntersection(u)}function c(l,r,u,i=u.mapPoint,a=null,c=n){if(null==i)return r.position=null,r.elevationInfo=null,void(r.feature=null);const s=i.clone();s.z=o(l,i,c??n,n);const f=!("relative-to-ground"===c?.mode||"on-the-ground"===c?.mode)&&!u.mapPoint?.equals(s);switch(u.context?.type){case"graphic":{const n=u.context.graphic,o=e(n);"on-the-ground"===o.mode&&(o.mode="relative-to-ground",o.offset=0),r.elevationInfo=new t(o),r.feature=n;break}case"ground":r.elevationInfo=a?.clone()??new t({mode:"on-the-ground"}),r.feature=null;break;default:r.elevationInfo=a?.clone()??null,r.feature=null}f&&(r.elevationInfo=null);const p=s.clone();p.z=o(l,s,n,r.elevationInfo),r.position=p}export{u as createLineOfSightObserverItem,i as createLineOfSightTargetItem,a as getLineOfSightMapPointIntersection,l as snapshotLineOfSightObserverState,r as snapshotLineOfSightTargetState,c as updateLineOfSightItemFromIntersection};
2
+ import{length as n,normalize as e,scaleAndAdd as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as t,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as l,absoluteHeightElevationInfo as i,getGraphicEffectiveElevationInfo as u}from"../../../../support/elevationInfoUtils.js";import a from"../../../../symbols/support/ElevationInfo.js";function s(n){return n?.clone()??null}function c(n){return n?.clone()??null}function f(n){const e=s(n);return n&&e?{observer:n,snapshot:e}:null}function p(n){return{target:n,snapshot:c(n)??n.clone()}}function m(n,e,o,t=null){const r=o.clone();return r.z=l(e,o,t??i,i),n.getMapPointIntersection(r)}function d(n,e,o,t=o.mapPoint,r=null,s=i){if(null==t)return e.position=null,e.elevationInfo=null,void(e.feature=null);const c=t.clone();c.z=l(n,t,s??i,i);const f=!("relative-to-ground"===s?.mode||"on-the-ground"===s?.mode)&&!o.mapPoint?.equals(c);switch(o.context?.type){case"graphic":{const n=o.context.graphic,t=u(n);"on-the-ground"===t.mode&&(t.mode="relative-to-ground",t.offset=0),e.elevationInfo=new a(t),e.feature=n;break}case"gaussian-splat":return e.elevationInfo=r?.clone()??null,e.feature=null,f&&(e.elevationInfo=null),void(e.position=v(n,c,e.elevationInfo,o.normal));case"ground":e.elevationInfo=r?.clone()??new a({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=r?.clone()??null,e.feature=null}f&&(e.elevationInfo=null);const p=c.clone();p.z=l(n,c,i,e.elevationInfo),e.position=p}function v(u,a,s,c){const f=a.clone(),p=t(a.x,a.y,a.z??0);if(!u.renderCoordsHelper.toRenderCoords(p,a.spatialReference,p)||0===n(c))return f.z=l(u,f,i,s),f;const m=4,d=u.state.camera.computeScreenPixelSizeAt(p)*m,v=e(r(),c);o(p,p,v,d);const g=u.renderCoordsHelper.fromRenderCoords(p,f);return null==g?(f.z=l(u,f,i,s),f):(g.z=l(u,g,i,s),g)}export{f as createLineOfSightObserverItem,p as createLineOfSightTargetItem,v as getGaussianSplatOffsetPosition,m as getLineOfSightMapPointIntersection,s as snapshotLineOfSightObserverState,c as snapshotLineOfSightTargetState,d as updateLineOfSightItemFromIntersection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{equals as r}from"../../../../core/arrayUtils.js";import{equalsMaybe as e}from"../../../../core/maybe.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as c}from"../../../../geometry/support/ray.js";let p=class extends o{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&e(this.mapPoint,t.mapPoint)&&n(this.renderPoint,t.renderPoint)&&r(this.normal,t.normal)&&c(this.ray,t.ray)}};t([s({constructOnly:!0})],p.prototype,"context",void 0),t([s({constructOnly:!0})],p.prototype,"id",void 0),t([s({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([s({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([s({constructOnly:!0})],p.prototype,"normal",void 0),t([s({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const l=new y;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,l as lineOfSightIntersectionContextGround};
2
+ import{__decorate as t}from"tslib";import r from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{equalsMaybe as s}from"../../../../core/maybe.js";import{property as e,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{equals as n}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{equals as c}from"../../../../geometry/support/ray.js";let p=class extends r{constructor(t){super(t)}clone(){return this}equals(t){return this.context?.type===t.context?.type&&(!this.context||!t.context||this.context.equals(t.context))&&this.id===t.id&&s(this.mapPoint,t.mapPoint)&&n(this.renderPoint,t.renderPoint)&&o(this.normal,t.normal)&&c(this.ray,t.ray)}};t([e({constructOnly:!0})],p.prototype,"context",void 0),t([e({constructOnly:!0})],p.prototype,"id",void 0),t([e({constructOnly:!0})],p.prototype,"mapPoint",void 0),t([e({constructOnly:!0})],p.prototype,"renderPoint",void 0),t([e({constructOnly:!0})],p.prototype,"normal",void 0),t([e({constructOnly:!0})],p.prototype,"ray",void 0),p=t([i("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],p);class a{constructor(t){this.graphic=t,this.type="graphic"}equals(t){return t.type===this.type&&this.graphic===t.graphic}}class y{constructor(){this.type="ground"}equals(t){return t.type===this.type}}const l=new y;class u{constructor(){this.type="gaussian-splat"}equals(t){return t.type===this.type}}const h=new u;export{a as LineOfSightIntersectionContextGraphic,p as LineOfSightIntersectionResult,h as lineOfSightIntersectionContextGaussianSplat,l as lineOfSightIntersectionContextGround};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as o,normalize as s,scaleAndAdd as a,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as m,clone as p,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{fromPoints as f,copy as g,create as y}from"../../../../geometry/support/ray.js";import{sv2d as w}from"../../../../geometry/support/vectorStacks.js";import{LineOfSightIntersectionResult as h,lineOfSightIntersectionContextGround as v,LineOfSightIntersectionContextGraphic as I}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as P,isIntegratedMeshIntersectorResult as b}from"../../terrain/Intersector.js";import{Intersector as x}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as U}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{isIntegratedMeshLayerView as L}from"../../../support/layerViewUtils.js";let _=class extends t{constructor(e){super(e)}initialize(){this.intersector=new x(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}get _integratedMeshLayerViews(){return this.view.allLayerViews.items.filter(L)}get _terrainIntersectionOptionsLayerUids(){return new Set([U,...this._integratedMeshLayerViews.map(e=>e.uid)])}getScreenPointIntersection(e){const t=r(e,w.get()),i=j(this.view.state.camera,t,C);return this._getRayIntersection(i)}getMapPointIntersection(e){const t=m(e.x,e.y,e.z??0);if(!this.view.renderCoordsHelper.toRenderCoords(t,e.spatialReference,t))return null;const r=this.view.state.camera.eye;return f(r,t,C),this._getRayIntersection(C)}_getRayIntersection(e,t){const{view:r,intersector:i}=this;if(null==e||null==r.sceneIntersectionHelper)return null;i.options.store=0,r.sceneIntersectionHelper.intersectToolIntersectorRay(e,i,t);const n=i.results.min;if(null==n.target)return null;const o=u();if(!n.getIntersectionPoint(o))return null;if(null!=t?.maxDistance&&!n.withinDistance(t.maxDistance))return null;const s=r.renderCoordsHelper.fromRenderCoords(o,new d({spatialReference:r.spatialReference})),a=p(n.normal);if(P(n))return new h({context:v,id:n.target.lij.slice(),mapPoint:s,renderPoint:o,normal:a,ray:g(e)});if(b(r,n))return new h({context:v,id:`${n.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)});const l=R(n,r);if(null!=l){const{layer:t}=l,r=l.getObjectId()??l.uid;return new h({context:new I(l),id:`${t?.uid}/${r}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}const c="layerViewUid"in n.target?`${n.target.layerViewUid}`:"";return new h({context:null,id:c,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}updateFromGroundIntersection(e,t,r){const i=V,n=O,m=M;o(n,e),this.view.renderCoordsHelper.worldUpAtPosition(n,m),s(m,m);const u=this.view.groundView?.visibleElevationRange,d=(t>=0?1:-1)*((u?Math.abs(u.maxElevation-u.minElevation):100)+Math.abs(t)),g=.001*d;a(i,n,m,d-g),a(n,n,m,g),f(i,n,C);const y=this._getRayIntersection(C,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=y){const e=S;return l(e,m,t),c(r,y.renderPoint,e),p(y.normal)}return o(r,e),null}};e([i()],_.prototype,"view",void 0),e([i()],_.prototype,"intersector",void 0),e([i()],_.prototype,"_integratedMeshLayerViews",null),e([i()],_.prototype,"_terrainIntersectionOptionsLayerUids",null),_=e([n("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],_);const V=u(),O=u(),M=u(),S=u(),C=y();export{_ as LineOfSightRayIntersector};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{property as i,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{copy as o,normalize as s,scaleAndAdd as a,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as m,clone as p,create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../../geometry/Point.js";import{fromPoints as f,copy as g,create as y}from"../../../../geometry/support/ray.js";import{sv2d as w}from"../../../../geometry/support/vectorStacks.js";import{LineOfSightIntersectionResult as h,lineOfSightIntersectionContextGaussianSplat as v,lineOfSightIntersectionContextGround as I,LineOfSightIntersectionContextGraphic as j}from"./LineOfSightIntersectionResult.js";import{isGaussianSplatIntersectorResult as P}from"../../layers/i3s/Intersector.js";import{fromScreen as x}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as b,isIntegratedMeshIntersectorResult as R}from"../../terrain/Intersector.js";import{Intersector as U}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as L}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as V}from"../../webgl-engine/lib/verticalOffsetUtils.js";import{isIntegratedMeshLayerView as _}from"../../../support/layerViewUtils.js";let O=class extends t{constructor(e){super(e)}initialize(){this.intersector=new U(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}get _integratedMeshLayerViews(){return this.view.allLayerViews.items.filter(_)}get _terrainIntersectionOptionsLayerUids(){return new Set([V,...this._integratedMeshLayerViews.map(e=>e.uid)])}getScreenPointIntersection(e){const t=r(e,w.get()),i=x(this.view.state.camera,t,H);return this._getRayIntersection(i)}getMapPointIntersection(e){const t=m(e.x,e.y,e.z??0);if(!this.view.renderCoordsHelper.toRenderCoords(t,e.spatialReference,t))return null;const r=this.view.state.camera.eye;return f(r,t,H),this._getRayIntersection(H)}_getRayIntersection(e,t){const{view:r,intersector:i}=this;if(null==e||null==r.sceneIntersectionHelper)return null;i.options.store=0,r.sceneIntersectionHelper.intersectToolIntersectorRay(e,i,t);const n=i.results.min;if(null==n.target)return null;const o=u();if(!n.getIntersectionPoint(o))return null;if(null!=t?.maxDistance&&!n.withinDistance(t.maxDistance))return null;const s=r.renderCoordsHelper.fromRenderCoords(o,new d({spatialReference:r.spatialReference}));if(P(n))return new h({context:v,id:`${n.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:p(n.target.outwardDirection),ray:g(e)});const a=p(n.normal);if(b(n))return new h({context:I,id:n.target.lij.slice(),mapPoint:s,renderPoint:o,normal:a,ray:g(e)});if(R(r,n))return new h({context:I,id:`${n.target.layerViewUid}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)});const l=L(n,r);if(null!=l){const{layer:t}=l,r=l.getObjectId()??l.uid;return new h({context:new j(l),id:`${t?.uid}/${r}`,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}const c="layerViewUid"in n.target?`${n.target.layerViewUid}`:"";return new h({context:null,id:c,mapPoint:s,renderPoint:o,normal:a,ray:g(e)})}updateFromGroundIntersection(e,t,r){const i=M,n=S,m=C;o(n,e),this.view.renderCoordsHelper.worldUpAtPosition(n,m),s(m,m);const u=this.view.groundView?.visibleElevationRange,d=(t>=0?1:-1)*((u?Math.abs(u.maxElevation-u.minElevation):100)+Math.abs(t)),g=.001*d;a(i,n,m,d-g),a(n,n,m,g),f(i,n,H);const y=this._getRayIntersection(H,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=y){const e=D;return l(e,m,t),c(r,y.renderPoint,e),p(y.normal)}return o(r,e),null}};e([i()],O.prototype,"view",void 0),e([i()],O.prototype,"intersector",void 0),e([i()],O.prototype,"_integratedMeshLayerViews",null),e([i()],O.prototype,"_terrainIntersectionOptionsLayerUids",null),O=e([n("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],O);const M=u(),S=u(),C=u(),D=u(),H=y();export{O as LineOfSightRayIntersector};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import i from"../../../../core/Handles.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{memoize as s}from"../../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{when as l,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{fromPoints as g,create as _}from"../../../../geometry/support/lineSegment.js";import{hydrateGeometry as m,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as b,getGraphicEffectiveElevationInfo as y,getConvertedElevation as f}from"../../../../support/elevationInfoUtils.js";import M from"../../../../symbols/support/ElevationInfo.js";import{getLaserLineColors as T,laserLineConfiguration as P}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as w,LineOfSightObserverManipulator as S}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as L}from"./LineOfSightRayIntersector.js";import{SnappingVisualizer3D as k}from"../../interactive/SnappingVisualizer3D.js";import{LaserlineVisualElement as C}from"../../interactive/visualElements/LaserlineVisualElement.js";import{mouseButtons as O}from"../../../input/mouseButtons.js";import{AnalysisToolBase as H}from"../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as I}from"../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as R}from"../../../interactive/dragEventPipeline.js";import{EditGeometry as j}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as V}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as D}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as x}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as G}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as A}from"../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as F}from"../../../support/screenUtils.js";let U=class extends H{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._trackerIntersection=null,this._trackerMapPoint=null,this._snappingManagerResult=null,this._analysisHandles=new i,this._updatingHandles=new d,this._manipulatorHandles=new i,this._targetTrackerManipulator=null,this._getSnappingContext=s(e=>new V({elevationInfo:b,pointer:e,editGeometryOperations:new E(new j("point",I(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new k}))}initialize(){this._intersector=new L({view:this.view}),this._snappingOperation=new G({view:this.view}),A(this,()=>{const e=this.view.inputManager.latestPointerInfo?.type??"mouse",t=this._getSnappingContext(e);this._updatingHandles.consumePromise(o(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this.addHandles(l(()=>"created"===this.state,()=>this.finishToolCreation(),p)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData?.elevationAlignedObserver,e=>this._onObserverLocationChange(e),u),this._updatingHandles.add(()=>T(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:n})=>this._updateLaserLineStyle(e,t,n),u),this._updatingHandles.add(()=>this._laserLineRendererDependencies(),e=>this._updateLaserLineRenderer(e)),this._connectComputations(),this._updatingHandles.addWhen(()=>!this._shouldRenderTracker,()=>this._clearCursorTracker(),u),this._updatingHandles.add(()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators}),({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)},u),this._updatingHandles.add(()=>({observerPosition:this.analysis.observer?.position,showTracker:this._showTracker,hasGrabbedManipulators:this.hasGrabbedManipulators,stagedPoint:this._snappingOperation.stagedPoint,trackerIntersection:this._trackerIntersection}),({observerPosition:e,showTracker:t,hasGrabbedManipulators:i,stagedPoint:a,trackerIntersection:r})=>{if(null==e||!t||i||null==r?.mapPoint)return;this.analysisViewData.cursorTarget??=new n;const s=null!=a?m(a):r.mapPoint,o=this._resolveIntersection(r,s);this._updateFromIntersection(this.analysisViewData.cursorTarget,o,s),this._updateLaserLineRenderer()},u)])}destroy(){this._updatingHandles=r(this._updatingHandles),this._manipulatorHandles=r(this._manipulatorHandles),this._analysisHandles=r(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._snappingOperation=r(this._snappingOperation),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?"creating":"created":null!=this.analysis.observer?.position?"created":"ready"}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return!!this.analysisViewData?.updating||!!this._snappingManager?.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}get _snappingManager(){return this._snappingManagerResult?.snappingManager}get snappingOptions(){return this._snappingManager?.options}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const n=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>B(e),()=>W(n,e),u),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,e=>this._onTargetLocationChange(e,n),u)],e)}_disconnectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this._trackerIntersection=null,this._trackerMapPoint=null,this._resetSnappingState(),this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_ensureSnappingManager(){if(null==this._snappingManagerResult){const e=x(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}_createTargetManipulator(e){const t={target:e,type:"target"},n=new w(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",e=>this._manipulatorGrabChanged(n,e)),n.events.on("immediate-click",e=>this._manipulatorClick(n,e))],n),this.manipulators.add(n),null!=e.position?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(n=>{const i=n.manipulator;null==t&&"target"===i.metadata.type&&i.metadata.target===e&&(t=i)}),t}_createObserverManipulator(){const e=new S(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",t=>this._manipulatorGrabChanged(e,t)),e.events.on("immediate-click",t=>this._manipulatorClick(e,t))],e),this.manipulators.add(e),e}_createTargetManipulatorDragPipeline(e){return R(e,(t,n,i,a)=>{const r=this._ensureSnappingManager(),{snappingStep:s,cancelSnapping:o}=D({snappingManager:r,snappingContext:this._getSnappingContext(a),updatingHandles:this._updatingHandles});n.next(this._screenToSnappingDragEvent()).next(...s).next(this._updateIntersectionFromSnappedPoint()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),i.next(z(e.metadata.target)).next(o).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return R(e,(e,t,n,i)=>{const a=this._ensureSnappingManager(),{snappingStep:r,cancelSnapping:s}=D({snappingManager:a,snappingContext:this._getSnappingContext(i),updatingHandles:this._updatingHandles});t.next(this._screenToSnappingDragEvent()).next(...r).next(this._updateIntersectionFromSnappedPoint()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),n.next(this._cancelObserverDragStep()).next(s).next(()=>this._updateLaserLineRenderer())})}_screenToSnappingDragEvent(){let e=null;return t=>{"start"===t.action&&(e=this._intersector.getScreenPointIntersection(t.screenStart));const n=this._intersector.getScreenPointIntersection(t.screenEnd);return null==e?.mapPoint||null==n?.mapPoint?null:{...t,intersection:n,mapStart:v(e.mapPoint),mapEnd:v(n.mapPoint)}}}_updateIntersectionFromSnappedPoint(){return e=>(e.intersection=this._resolveIntersection(e.intersection,e.mapEnd),e)}_updateObserverDragStep(){return e=>(this.analysis.observer??=new t,this._updateFromIntersection(this.analysis.observer,e.intersection,e.mapEnd),e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>(this._updateFromIntersection(e.metadata.target,t.intersection,t.mapEnd),e.elevationAlignedLocation=t.mapEnd,t)}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:n,shouldRenderTracker:i,observerPosition:a,visible:r}=e;if(null==t)return;const s=null!=n?n:i&&null!=a?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,q):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=P;this._laserlineVisualElement=new C({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,t,n){const i=this._laserlineVisualElement;if(null==i)return;const a=i.style;i.style={...a,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:n}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e,i){const a=this._getPlacementLocation(e,i);if(null==a)return;const{intersection:r,point:s}=a;if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new n;this._updateFromIntersection(e,r,s),this.analysis.targets.add(e)}else{const e=new t;this._updateFromIntersection(e,r,s),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==O.Right&&(this._addPointFromClickEvent(F(e),e.pointerType),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==O.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker)return void this._clearCursorTracker();const t=F(e),n=this._intersector.getScreenPointIntersection(t),i=n?.mapPoint;null!=n?.mapPoint&&null!=i?(this._trackerIntersection=n,this._trackerMapPoint=i,this._updateHoverSnapping(i,e.pointerType)):this._clearCursorTracker()}_getPlacementLocation(e,t){const n=this._intersector.getScreenPointIntersection(e);if(null==n?.mapPoint)return null;const i=n.mapPoint;if(!this._shouldUsePlacementSnapping(t))return{intersection:n,point:i};const a=n.mapPoint,r=this._trackerMapPoint?.equals(a)?this._snappingOperation.stagedPoint:null,s=m(r??this._snappingOperation.update({point:a},this._ensureSnappingManager(),this._getSnappingContext(t)));return{intersection:this._resolveIntersection(n,s),point:s}}_shouldUsePlacementSnapping(e){return"touch"!==e}_updateHoverSnapping(e,t){const n=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}_updateFromIntersection(e,t,n=t.mapPoint){if(null==n)return e.position=null,e.elevationInfo=null,void(e.feature=null);const i=!t.mapPoint?.equals(n);switch(t.context?.type){case"graphic":{const n=t.context.graphic,i=y(n);"on-the-ground"===i.mode&&(i.mode="relative-to-ground",i.offset=0),e.elevationInfo=new M(i),e.feature=n}break;case"ground":e.elevationInfo=new M({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}i&&(e.elevationInfo=null);const a=n.clone();a.z=f(this.view,a,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=a}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==O.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),t.stopPropagation()}get testInfo(){}_resetSnappingState(){this._snappingManager?.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_resolveIntersection(e,t){return e.mapPoint?.equals(t)?e:this._intersector.getMapPointIntersection(t)??e}};function z(e){const t=e.position?.clone();return n=>(e.position=t,n)}function W(e,t){const{isValid:n,isTargetVisible:i}=t.computationResult;e.state=n?i?16:32:64}function B(e){const{isValid:t,isTargetVisible:n}=e.computationResult;return{isValid:t,isTargetVisible:n}}e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({constructOnly:!0})],U.prototype,"analysis",void 0),e([c()],U.prototype,"_creationMode",void 0),e([c({readOnly:!0})],U.prototype,"state",null),e([c({readOnly:!0})],U.prototype,"cursor",null),e([c()],U.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],U.prototype,"_showTracker",null),e([c()],U.prototype,"_latestPointerMovePointerType",void 0),e([c()],U.prototype,"_shouldRenderTracker",null),e([c()],U.prototype,"_laserlineVisualElement",void 0),e([c()],U.prototype,"_grabbedManipulator",void 0),e([c()],U.prototype,"_trackerIntersection",void 0),e([c()],U.prototype,"_trackerMapPoint",void 0),e([c()],U.prototype,"_snappingManagerResult",void 0),U=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],U);const q=_();export{U as LineOfSightTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/LineOfSightAnalysisObserver.js";import n from"../../../../analysis/LineOfSightAnalysisTarget.js";import i from"../../../../core/Handles.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{memoize as s}from"../../../../core/memoize.js";import{ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{when as l,syncAndInitial as p,initial as u}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{fromPoints as g,create as _}from"../../../../geometry/support/lineSegment.js";import{hydrateGeometry as m,clonePoint as v}from"../../../../layers/graphics/hydratedFeatures.js";import{absoluteHeightElevationInfo as b,getGraphicEffectiveElevationInfo as y,getConvertedElevation as f}from"../../../../support/elevationInfoUtils.js";import M from"../../../../symbols/support/ElevationInfo.js";import{getGaussianSplatOffsetPosition as T}from"./LineOfSightAuthoringUtils.js";import{getLaserLineColors as P,laserLineConfiguration as w}from"./LineOfSightConfiguration.js";import{LineOfSightTargetManipulator as S,LineOfSightObserverManipulator as L}from"./LineOfSightManipulators.js";import{LineOfSightRayIntersector as k}from"./LineOfSightRayIntersector.js";import{SnappingVisualizer3D as C}from"../../interactive/SnappingVisualizer3D.js";import{LaserlineVisualElement as O}from"../../interactive/visualElements/LaserlineVisualElement.js";import{mouseButtons as I}from"../../../input/mouseButtons.js";import{AnalysisToolBase as H}from"../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as j}from"../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as R}from"../../../interactive/dragEventPipeline.js";import{EditGeometry as E}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as V}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as x}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as G}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as A}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as F}from"../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as U}from"../../../support/screenUtils.js";let z=class extends H{constructor(e){super(e),this._creationMode=!1,this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._trackerIntersection=null,this._trackerMapPoint=null,this._snappingManagerResult=null,this._analysisHandles=new i,this._updatingHandles=new d,this._manipulatorHandles=new i,this._targetTrackerManipulator=null,this._getSnappingContext=s(e=>new D({elevationInfo:b,pointer:e,editGeometryOperations:new V(new E("point",j(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new C}))}initialize(){this._intersector=new k({view:this.view}),this._snappingOperation=new A({view:this.view}),F(this,()=>{const e=this.view.inputManager.latestPointerInfo?.type??"mouse",t=this._getSnappingContext(e);this._updatingHandles.consumePromise(o(this._snappingOperation.snapAgainNearPreviousMapPoint(this._ensureSnappingManager(),t)))}),this.addHandles(l(()=>"created"===this.state,()=>this.finishToolCreation(),p)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData?.elevationAlignedObserver,e=>this._onObserverLocationChange(e),u),this._updatingHandles.add(()=>P(this.view.effectiveTheme),({glowColor:e,innerColor:t,globalAlpha:n})=>this._updateLaserLineStyle(e,t,n),u),this._updatingHandles.add(()=>this._laserLineRendererDependencies(),e=>this._updateLaserLineRenderer(e)),this._connectComputations(),this._updatingHandles.addWhen(()=>!this._shouldRenderTracker,()=>this._clearCursorTracker(),u),this._updatingHandles.add(()=>({active:this.active,hasGrabbedManipulators:this.hasGrabbedManipulators}),({active:e,hasGrabbedManipulators:t})=>{this._creationMode=!!e&&(this._creationMode||!t)},u),this._updatingHandles.add(()=>({observerPosition:this.analysis.observer?.position,showTracker:this._showTracker,hasGrabbedManipulators:this.hasGrabbedManipulators,stagedPoint:this._snappingOperation.stagedPoint,trackerIntersection:this._trackerIntersection}),({observerPosition:e,showTracker:t,hasGrabbedManipulators:i,stagedPoint:a,trackerIntersection:r})=>{if(null==e||!t||i||null==r?.mapPoint)return;this.analysisViewData.cursorTarget??=new n;const s=null!=a?m(a):r.mapPoint,o=this._resolveIntersection(r,s);this._updateFromIntersection(this.analysisViewData.cursorTarget,o,s),this._updateLaserLineRenderer()},u)])}destroy(){this._updatingHandles=r(this._updatingHandles),this._manipulatorHandles=r(this._manipulatorHandles),this._analysisHandles=r(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._snappingOperation=r(this._snappingOperation),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){return this.active?!this.hasGrabbedManipulators||this._creationMode?"creating":"created":null!=this.analysis.observer?.position?"created":"ready"}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return!!this.analysisViewData?.updating||!!this._snappingManager?.updating}get _showTracker(){return this.active&&"mouse"===this._latestPointerMovePointerType}get _shouldRenderTracker(){return this._showTracker&&null!=this.analysis.observer?.position&&!this.hasGrabbedManipulators}get _snappingManager(){return this._snappingManagerResult?.snappingManager}get snappingOptions(){return this._snappingManager?.options}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){if("immediate-click"===e.type)this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:t}){for(const n of t)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const t=this._analysisHandles;if(t.has(e))return;const n=this._createTargetManipulator(e.target);null==this._targetTrackerManipulator&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),t.add([this._updatingHandles.add(()=>q(e),()=>B(n,e),u),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,e=>this._onTargetLocationChange(e,n),u)],e)}_disconnectComputation(e){if(this.destroyed)return void a.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const t=this._getTargetManipulator(e.target);null!=t&&(this.manipulators.remove(t),this._manipulatorHandles.remove(t),null!=this._targetTrackerManipulator&&this._targetTrackerManipulator===t&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this._trackerIntersection=null,this._trackerMapPoint=null,this._resetSnappingState(),this.analysisViewData.cursorTarget=r(this.analysisViewData.cursorTarget)}_ensureSnappingManager(){if(null==this._snappingManagerResult){const e=G(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}_createTargetManipulator(e){const t={target:e,type:"target"},n=new S(this.view,t);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",e=>this._manipulatorGrabChanged(n,e)),n.events.on("immediate-click",e=>this._manipulatorClick(n,e))],n),this.manipulators.add(n),null!=e.position?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let t=null;return this.manipulators.forEach(n=>{const i=n.manipulator;null==t&&"target"===i.metadata.type&&i.metadata.target===e&&(t=i)}),t}_createObserverManipulator(){const e=new L(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",t=>this._manipulatorGrabChanged(e,t)),e.events.on("immediate-click",t=>this._manipulatorClick(e,t))],e),this.manipulators.add(e),e}_createTargetManipulatorDragPipeline(e){return R(e,(t,n,i,a)=>{const r=this._ensureSnappingManager(),{snappingStep:s,cancelSnapping:o}=x({snappingManager:r,snappingContext:this._getSnappingContext(a),updatingHandles:this._updatingHandles});n.next(this._screenToSnappingDragEvent()).next(...s).next(this._updateIntersectionFromSnappedPoint()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),i.next(W(e.metadata.target)).next(o).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return R(e,(e,t,n,i)=>{const a=this._ensureSnappingManager(),{snappingStep:r,cancelSnapping:s}=x({snappingManager:a,snappingContext:this._getSnappingContext(i),updatingHandles:this._updatingHandles});t.next(this._screenToSnappingDragEvent()).next(...r).next(this._updateIntersectionFromSnappedPoint()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),n.next(this._cancelObserverDragStep()).next(s).next(()=>this._updateLaserLineRenderer())})}_screenToSnappingDragEvent(){let e=null;return t=>{"start"===t.action&&(e=this._intersector.getScreenPointIntersection(t.screenStart));const n=this._intersector.getScreenPointIntersection(t.screenEnd);return null==e?.mapPoint||null==n?.mapPoint?null:{...t,intersection:n,mapStart:v(e.mapPoint),mapEnd:v(n.mapPoint)}}}_updateIntersectionFromSnappedPoint(){return e=>(e.intersection=this._resolveIntersection(e.intersection,e.mapEnd),e)}_updateObserverDragStep(){return e=>(this.analysis.observer??=new t,this._updateFromIntersection(this.analysis.observer,e.intersection,e.mapEnd),e)}_cancelObserverDragStep(){const e=null!=this.analysis.observer?.position?this.analysis.observer.clone():null;return t=>(this.analysis.observer=e,t)}_updateTargetDragStep(e){return t=>(this._updateFromIntersection(e.metadata.target,t.intersection,t.mapEnd),e.elevationAlignedLocation=t.mapEnd,t)}_manipulatorGrabChanged(e,t){switch(t.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:null!=this.analysis.observer?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:t,grabbedManipulator:n,shouldRenderTracker:i,observerPosition:a,visible:r}=e;if(null==t)return;const s=null!=n?n:i&&null!=a?this._targetTrackerManipulator:null;null!=s&&r?(t.visible=!0,t.heightManifoldTarget=s.renderLocation,s!==this._observerManipulator?t.lineVerticalPlaneSegment=g(this._observerManipulator.renderLocation,s.renderLocation,N):t.lineVerticalPlaneSegment=null):(t.visible=!1,t.heightManifoldTarget=null,t.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:t}=w;this._laserlineVisualElement=new O({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:t},isDecoration:!0})}_removeLaserLine(){null!=this._laserlineVisualElement&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,t,n){const i=this._laserlineVisualElement;if(null==i)return;const a=i.style;i.style={...a,glowColor:e.toUnitRGB(),innerColor:t.toUnitRGB(),globalAlpha:n}}_onObserverLocationChange(e){null!=e?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,t){null!=e?(t.elevationAlignedLocation=e,t!==this._targetTrackerManipulator&&(t.available=!0)):t.available=!1}_addPointFromClickEvent(e,i){const a=this._getPlacementLocation(e,i);if(null==a)return;const{intersection:r,point:s}=a;if(null!=this.analysis.observer?.position){this._clearCursorTracker();const e=new n;this._updateFromIntersection(e,r,s),this.analysis.targets.add(e)}else{const e=new t;this._updateFromIntersection(e,r,s),this.analysis.observer=e}}_clickHandler(e){this.active&&e.button!==I.Right&&(this._addPointFromClickEvent(U(e),e.pointerType),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==I.Right&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){if(this.hasGrabbedManipulators)return;if(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker)return void this._clearCursorTracker();const t=U(e),n=this._intersector.getScreenPointIntersection(t),i=n?.mapPoint;null!=n?.mapPoint&&null!=i?(this._trackerIntersection=n,this._trackerMapPoint=i,this._updateHoverSnapping(i,e.pointerType)):this._clearCursorTracker()}_getPlacementLocation(e,t){const n=this._intersector.getScreenPointIntersection(e);if(null==n?.mapPoint)return null;const i=n.mapPoint;if(!this._shouldUsePlacementSnapping(t))return{intersection:n,point:i};const a=n.mapPoint,r=this._trackerMapPoint?.equals(a)?this._snappingOperation.stagedPoint:null,s=m(r??this._snappingOperation.update({point:a},this._ensureSnappingManager(),this._getSnappingContext(t)));return{intersection:this._resolveIntersection(n,s),point:s}}_shouldUsePlacementSnapping(e){return"touch"!==e}_updateHoverSnapping(e,t){const n=this._getSnappingContext(t);this._updatingHandles.consumePromise(o(this._snappingOperation.snap({point:e},this._ensureSnappingManager(),n)))}_updateFromIntersection(e,t,n=t.mapPoint){if(null==n)return e.position=null,e.elevationInfo=null,void(e.feature=null);const i=!t.mapPoint?.equals(n);switch(t.context?.type){case"graphic":{const n=t.context.graphic,i=y(n);"on-the-ground"===i.mode&&(i.mode="relative-to-ground",i.offset=0),e.elevationInfo=new M(i),e.feature=n}break;case"gaussian-splat":return e.elevationInfo=null,e.feature=null,void(e.position=T(this.view,n,e.elevationInfo,t.normal));case"ground":e.elevationInfo=new M({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}i&&(e.elevationInfo=null);const a=n.clone();a.z=f(this.view,a,b,e.elevationInfo),e.position=a}_manipulatorClick(e,t){if("observer"===e.metadata.type||e.grabbing||e.dragging||t.button!==I.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),t.stopPropagation()}get testInfo(){}_resetSnappingState(){this._snappingManager?.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_resolveIntersection(e,t){return e.mapPoint?.equals(t)?e:this._intersector.getMapPointIntersection(t)??e}};function W(e){const t=e.position?.clone();return n=>(e.position=t,n)}function B(e,t){const{isValid:n,isTargetVisible:i}=t.computationResult;e.state=n?i?16:32:64}function q(e){const{isValid:t,isTargetVisible:n}=e.computationResult;return{isValid:t,isTargetVisible:n}}e([c({constructOnly:!0})],z.prototype,"view",void 0),e([c({constructOnly:!0})],z.prototype,"analysis",void 0),e([c()],z.prototype,"_creationMode",void 0),e([c({readOnly:!0})],z.prototype,"state",null),e([c({readOnly:!0})],z.prototype,"cursor",null),e([c()],z.prototype,"removeIncompleteOnCancel",void 0),e([c({readOnly:!0})],z.prototype,"updating",null),e([c({constructOnly:!0})],z.prototype,"analysisViewData",void 0),e([c({readOnly:!0})],z.prototype,"_showTracker",null),e([c()],z.prototype,"_latestPointerMovePointerType",void 0),e([c()],z.prototype,"_shouldRenderTracker",null),e([c()],z.prototype,"_laserlineVisualElement",void 0),e([c()],z.prototype,"_grabbedManipulator",void 0),e([c()],z.prototype,"_trackerIntersection",void 0),e([c()],z.prototype,"_trackerMapPoint",void 0),e([c()],z.prototype,"_snappingManagerResult",void 0),z=e([h("esri.views.3d.analysis.LineOfSight.LineOfSightTool")],z);const N=_();export{z as LineOfSightTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{roundToNearest as e}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as g}from"../../../../intl/locale.js";import{fetchMessageBundle as w}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const i=d(t,o);this._screenPoint=i,this._throttledUpdateShadowDuration?.(this.view,i)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=i(async i=>{const{results:s,ground:e}=await t.hitTest(o);if(n(i),0===s.length&&!e.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,i);n(i),this.shadowDuration=a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=i(()=>w("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([g(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),s(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const i=e(o,o<U?j:U);return v(this.getVisualizeSunlight()?t.sunlightDuration:t.shadowDuration,{duration:_(i)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},i=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",i),t.on("pointer-down",i),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):i()}),t.on("click",o=>{const i=d(o.x,o.y);this._screenPoint=i,this._updateShadowDuration(t,i)}),s(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"getVisualizeSunlight",void 0),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
2
+ import{__decorate as t}from"tslib";import o from"../../../../core/Accessor.js";import{createTask as i}from"../../../../core/asyncUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{roundToNearest as e}from"../../../../core/mathUtils.js";import{removeMaybe as a,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as n}from"../../../../core/promiseUtils.js";import{initial as l}from"../../../../core/reactiveUtils.js";import{createScreenPoint as d}from"../../../../core/screenUtils.js";import{throttle as h}from"../../../../core/throttle.js";import{convertTime as p}from"../../../../core/timeUtils.js";import{property as u,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as m}from"../../../../core/support/UpdatingHandles.js";import{formatDuration as _}from"../../../../intl/duration.js";import{onLocaleChange as g}from"../../../../intl/locale.js";import{fetchMessageBundle as w}from"../../../../intl/messages.js";import{substitute as v}from"../../../../intl/substitute.js";let f=class extends o{constructor(t){super(t),this.throttleDelay=x,this._tooltipElement=y(),this._tooltipContentElement=D(),this._updatingHandles=new m,this._messagesTask=null,this._screenPoint=null,this._shadowDurationTask=null,this.shadowDuration=null,this._throttledUpdateShadowDuration=null,this._onPointerMove=({x:t,y:o})=>{const i=d(t,o);this._screenPoint=i,this._throttledUpdateShadowDuration?.(this.view,i)},this._updateShadowDuration=(t,o)=>{this._abortShadowDurationTask(),this._shadowDurationTask=i(async i=>{const{results:s,ground:e}=await t.hitTest(o);if(n(i),0===s.length&&!e.mapPoint)return void(this.shadowDuration=null);const a=await this.getDuration(o,i);n(i),this.shadowDuration=a<0?null:a})}}initialize(){this._tooltipElement.appendChild(this._tooltipContentElement);const t=()=>{this._messagesTask?.abort(),this._messagesTask=i(()=>w("esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis"))};t(),this.addHandles([g(t),this._updatingHandles.add(()=>({enabled:this.isVisible(),surface:this.view.surface}),({enabled:t,surface:o})=>{t&&o?(o.appendChild(this._tooltipElement),this._startTracking(this.view)):(this.removeHandles(T),this._tooltipElement.remove())},l),this._updatingHandles.add(()=>this._styles,t=>{Object.assign(this._tooltipElement.style,t)},l),this._updatingHandles.add(()=>this._formattedText,t=>{this._tooltipContentElement.innerText=t},l),this._updatingHandles.add(()=>this.throttleDelay,t=>{this._throttledUpdateShadowDuration=h(this._updateShadowDuration,t)},l),s(()=>{this._throttledUpdateShadowDuration=a(this._throttledUpdateShadowDuration)})])}destroy(){this._updatingHandles.destroy(),this._tooltipElement.remove()}get updating(){return this._updatingHandles.updating||null!=this._shadowDurationTask&&!this._shadowDurationTask?.finished||null!=this._messagesTask&&!this._messagesTask?.finished||!0===this._throttledUpdateShadowDuration?.hasPendingUpdates()}get _formattedText(){const t=this._messagesTask?.value,o=this.shadowDuration;if(null==t||null==o)return"";const i=e(o,o<U?j:U);return v(this.getVisualizeSunlight()?t.sunlightDuration:t.shadowDuration,{duration:_(i)})}get _styles(){const t=this._screenPoint;return t&&this._formattedText?{display:"block",transform:`translate(${t.x}px, ${t.y}px)`}:{display:"none"}}_startTracking(t){if(this.hasHandles(T))return;const o=o=>{this.hasHandles(S)||(o&&this._onPointerMove(o),this.addHandles(t.on("pointer-move",this._onPointerMove),S))},i=()=>{this.removeHandles(S),this._abortShadowDurationTask(),this._screenPoint=null,this.shadowDuration=null};this.addHandles([t.on("pointer-enter",o),t.on("pointer-leave",i),t.on("pointer-down",i),t.on("pointer-up",o),t.on("pointer-drag",t=>{"end"===t.action?o(t):i()}),t.on("click",o=>{const i=d(o.x,o.y);this._screenPoint=i,this._updateShadowDuration(t,i)}),s(()=>this._abortShadowDurationTask())],T),o()}_abortShadowDurationTask(){this._shadowDurationTask=r(this._shadowDurationTask)}};function y(){const t=k(document.createElement("div"),{position:"absolute",top:"0",left:"0",pointerEvents:"none"});return t.style.setProperty("--tooltip-arrow-size","6px"),t.style.setProperty("--tooltip-background","var(--calcite-color-foreground-1)"),t.appendChild(b()),t}function D(){return k(document.createElement("div"),{color:"var(--calcite-color-text-1)",fontSize:"var(--calcite-font-size-sm)",position:"absolute",width:"max-content",transform:"translate(0, -100%)",insetInlineStart:"calc(var(--calcite-spacing-lg) * -1)",marginTop:"calc((var(--tooltip-arrow-size) * -1) - var(--calcite-spacing-xxs))",background:"var(--tooltip-background)",paddingInline:"var(--calcite-spacing-md)",paddingBlock:"var(--calcite-spacing-xs)",pointerEvents:"none",borderRadius:"var(--calcite-corner-radius-sm)"})}function b(){return k(document.createElement("div"),{display:"block",position:"absolute",width:"0",height:"0",bottom:"-1px",left:"50%",transform:"translate(-50%, 0)",borderTop:"var(--tooltip-arrow-size) solid var(--tooltip-background)",borderRight:"var(--tooltip-arrow-size) solid transparent",borderBottom:"var(--tooltip-arrow-size) solid transparent",borderLeft:"var(--tooltip-arrow-size) solid transparent",pointerEvents:"none"})}function k(t,o){return Object.assign(t.style,o),t}t([u()],f.prototype,"view",void 0),t([u()],f.prototype,"isVisible",void 0),t([u()],f.prototype,"getDuration",void 0),t([u()],f.prototype,"throttleDelay",void 0),t([u()],f.prototype,"updating",null),t([u()],f.prototype,"getVisualizeSunlight",void 0),t([u()],f.prototype,"_messagesTask",void 0),t([u()],f.prototype,"_screenPoint",void 0),t([u()],f.prototype,"_shadowDurationTask",void 0),t([u()],f.prototype,"shadowDuration",void 0),t([u()],f.prototype,"_throttledUpdateShadowDuration",void 0),t([u()],f.prototype,"_formattedText",null),t([u()],f.prototype,"_styles",null),f=t([c("esri.views.3d.analysis.ShadowCast.ShadowCastTooltip")],f);const T=Symbol("tracking"),S=Symbol("pointer"),x=300,j=p(1,"minutes","milliseconds"),U=p(15,"minutes","milliseconds");export{f as ShadowCastTooltip};
@@ -76,7 +76,9 @@ export default abstract class ShadowCastAnalysisView3D extends AnalysisView3D {
76
76
  * [ShadowCastAnalysis.visualizeSunlight](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#visualizeSunlight) is `true`, this method returns the time spent in sunlight.
77
77
  *
78
78
  * @param point - The point on the screen for which the shadow or sunlight duration is calculated.
79
- * @returns A promise that resolves to the duration (in milliseconds) spent in shadow or sunlight for the given screen point.
79
+ * @returns A promise that resolves to the duration (in milliseconds) spent in shadow or sunlight for the given
80
+ * screen point. Returns `-1` when the point is outside the [ShadowCastAnalysis.geometry](https://developers.arcgis.com/javascript/latest/references/core/analysis/ShadowCastAnalysis/#geometry) project
81
+ * area.
80
82
  * @since 5.0
81
83
  * @example
82
84
  * ```js
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import a from"../../../core/Logger.js";import{abortMaybe as n,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as y,subclass as v}from"../../../core/accessorSupport/decorators.js";import{create as f}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{n as C}from"../../../chunks/boundedPlane.js";import{polygonToVolume as b}from"../focusAreaUtils.js";import V from"./AnalysisView3D.js";import{registerAnalysisView as U,hideOtherAnalysisViews as T}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as P}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as O}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as S}from"../support/earthUtils.js";import{computeDirectionsOverTime as x}from"../support/sunUtils.js";import{maxColorRampSize as z}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as j}from"../../../widgets/support/traversalUtils.js";let R=class extends V{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([U(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{n(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(B,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>H(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&T(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{L(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{L(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{L(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{L(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new P({getDuration:this.getDurationAtScreen.bind(this),getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&L(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=n(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?S(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(M-1)):M}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?I:this._referencePosition;if(null==i)return[];const s=x(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,M),r=s.length;q.length=0;const a=j(0,r,q),n=new Array(r);for(let o=0;o<r;++o)n[o]=s[a[o]];return n}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=b(e,this.view,F);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return a.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,thresholdRendersSunlight:this.analysis.visualizeSunlight,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e.contextOptions.color,e.contextOptions.colorStops,1/this._lightDirectionsContext.length,this.analysis.visualizeSunlight)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?G/s:0,a=this._getEffectiveShadowCastColorRamp(e,t,1/s,this.analysis.visualizeSunlight);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:a}:{bandedGradientColorRamp:a,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,1/this._lightDirections.length,this.analysis.visualizeSunlight),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(k)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),a=s.map(e=>e.suspended),n=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:a,graphicsViewSuspended:l,layerVisibilities:n,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_totalDurationSampleCount:i}=this;if(null==t||0===i)return 0;const s=this.view.state.camera.screenToRender(h(e.x,e.y),m()),r=t.readAccumulatedShadow(s);return(this.analysis.visualizeSunlight?1-r:r)*this._totalDuration}_getEffectiveShadowCastColorRamp(e,t,i,s){if(null!=t){t.length>z&&a.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(s?e=>[1-e.value*i,e.color.toUnitRGBA()]:e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return E(e,s)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],R.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],R.prototype,"analysis",void 0),e([y({readOnly:!0})],R.prototype,"updating",null),e([y()],R.prototype,"_stopPreviewingTask",void 0),e([y()],R.prototype,"_updatedRecently",void 0),e([y()],R.prototype,"_tooltip",void 0),e([y()],R.prototype,"_sceneUpdating",null),e([y()],R.prototype,"_effectiveUtcOffset",null),e([y()],R.prototype,"_utcOffsetAuto",null),e([y()],R.prototype,"_dateUTCOffset",null),e([y()],R.prototype,"_startDateTimeUTC",null),e([y()],R.prototype,"_endDateTimeUTC",null),e([y()],R.prototype,"_referencePosition",null),e([y()],R.prototype,"_interval",null),e([y()],R.prototype,"_intervalContext",null),e([y()],R.prototype,"_totalDurationSampleCount",null),e([y()],R.prototype,"_totalDuration",null),e([y()],R.prototype,"_lightDirections",null),e([y()],R.prototype,"_lightDirectionsContext",null),e([y()],R.prototype,"_analysisVolume",null),e([y()],R.prototype,"_visualizationParameters",null),e([y()],R.prototype,"_minDurationVisualizationParameters",null),e([y()],R.prototype,"_minDurationContextVisualizationParameters",null),e([y()],R.prototype,"_durationVisualizationParameters",null),e([y()],R.prototype,"_discreteVisualizationParameters",null),e([y()],R.prototype,"_shadowLayerViews",null),e([y()],R.prototype,"_previewDependencies",null),e([y()],R.prototype,"_renderer",null),R=e([v("esri.views.3d.analysis.ShadowCastAnalysisView3D")],R);const A=R;function L(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function E(e,t){const i=e.toUnitRGBA(),s=w(i[0],i[1],i[2],0),[r,a]=t?[i,s]:[s,i];return[[0,r],[1,a]]}function k(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function H(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=C(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),a=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,n=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&a&&n&&o&&l&&u}const G=_(1,"hours","milliseconds"),B=500,M=255,I=f(),q=[],F=new O;export{A as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t,equals as i}from"../../../core/arrayUtils.js";import{createTask as s}from"../../../core/asyncUtils.js";import r from"../../../core/Error.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{abortMaybe as a,destroyMaybe as o}from"../../../core/maybe.js";import{after as l,throwIfAborted as u,isPromiseLike as c}from"../../../core/promiseUtils.js";import{watch as p,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{createScreenPointArray as h,createRenderScreenPointArray as m}from"../../../core/screenUtils.js";import{offsetDateUTC as g,convertTime as _}from"../../../core/timeUtils.js";import{property as y,subclass as f}from"../../../core/accessorSupport/decorators.js";import{create as v}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as D}from"../../../core/support/UpdatingHandles.js";import{projectAsync as C}from"../../../geometry/projectionUtils.js";import{e as b}from"../../../chunks/containsOperator.js";import{n as V}from"../../../chunks/boundedPlane.js";import{polygonToVolume as U}from"../focusAreaUtils.js";import P from"./AnalysisView3D.js";import{registerAnalysisView as T,hideOtherAnalysisViews as S}from"./ShadowCast/analysisViewRegister.js";import{ShadowCastTooltip as O}from"./ShadowCast/ShadowCastTooltip.js";import{ElevationContext as x}from"../layers/graphics/ElevationContext.js";import{longitudeToTimezone as j}from"../support/earthUtils.js";import{computeDirectionsOverTime as z}from"../support/sunUtils.js";import{maxColorRampSize as R}from"../webgl-engine/shaders/colorRampParameters.js";import{breadthFirstBinaryPartitioning as A}from"../../../widgets/support/traversalUtils.js";let L=class extends P{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._updatingHandles=new D,this._stopPreviewingTask=null,this._updatedRecently=!1,this._tooltip=null,this._previousVolume=null}initialize(){this.addHandles([T(this.view,this),p(()=>({dependencies:this._previewDependencies,sceneUpdating:this._sceneUpdating}),()=>{a(this._stopPreviewingTask),this._updatedRecently=!0,this._stopPreviewingTask=s(async e=>{await l(M,e),u(e),this._updatedRecently=!1})},{sync:!0,initial:!0,equals:(e,t)=>I(e.dependencies,t.dependencies)&&(e.sceneUpdating===t.sceneUpdating||!e.sceneUpdating)}),p(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&S(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},d),p(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{k(e,i,t)},d),p(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:s})=>{k(e,s,{lightDirections:t,lightDirectionsContext:i})},d),p(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{k(e,i,{previewing:t})},d),p(()=>({analysisVolume:this._analysisVolume,renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t,analysisVolume:i})=>{k(e,t,{analysisVolume:i})},d)]),this.interactive=!0,this._tooltip=new O({getDuration:(e,t)=>this._getDurationAtScreen(e,t),getVisualizeSunlight:()=>this.analysis.visualizeSunlight,isVisible:()=>this.interactive&&this.visible,view:this.view})}destroy(){this.visible&&k(this._renderer,!0,{enabled:!1}),this._tooltip=o(this._tooltip),this._stopPreviewingTask=a(this._stopPreviewingTask),this._updatingHandles=o(this._updatingHandles)}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return this._previewing||null!=this._stopPreviewingTask&&!this._stopPreviewingTask.finished||!0===this._tooltip?.updating||this._updatingHandles.updating}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){return this._updatedRecently||this._sceneUpdating}get _sceneUpdating(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,graphicsView:i}=e;return!t||this._shadowLayerViews.some(e=>e.updating)||!i?.suspended&&!!i?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?j(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=g(e,-e.getTimezoneOffset(),"minutes"),e=g(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return g(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _totalDurationInterval(){return this._totalDuration>0?Math.floor(this._totalDuration/(q-1)):q}get _interval(){const e=this._totalDurationInterval;switch(this.analysis.mode){case"min-duration":return this._totalDuration>0?e:0;case"total-duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,minDurationOptions:t}=this.analysis;return"min-duration"===e&&t.contextEnabled?t.contextOptions.interval||this._totalDurationInterval:-1}get _totalDurationSampleCount(){return this._lightDirections.length}get _totalDuration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?F:this._referencePosition;if(null==i)return[];const s=z(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,q),r=s.length;N.length=0;const n=A(0,r,N),a=new Array(r);for(let o=0;o<r;++o)a[o]=s[n[o]];return a}get _analysisVolume(){const{geometry:e}=this.analysis;if(null==e)return this._previousVolume=null,null;try{const t=U(e,this.view,J);return null==t?(this._previousVolume=null,null):c(t)?(this._updatingHandles.consumePromise(t),this._previousVolume):(this._previousVolume=t,t)}catch(t){return n.getLogger(this).error(new r("shadowcastanalysisview3d:projection-failed","Failed to project analysis area geometry to view spatial reference",{geometry:e,error:t})),null}}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"min-duration":return this._minDurationVisualizationParameters;case"total-duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _minDurationVisualizationParameters(){const{color:e,minDuration:t}=this.analysis.minDurationOptions,i=this._totalDuration;return{visualization:2,thresholdColor:e.toUnitRGBA(),threshold:i>0?t/this._totalDuration:0,thresholdRendersSunlight:this.analysis.visualizeSunlight,...this._minDurationContextVisualizationParameters}}get _minDurationContextVisualizationParameters(){const{minDurationOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColorRamp:this._getEffectiveShadowCastColorRamp(e.contextOptions.color,e.contextOptions.colorStops,1/this._lightDirectionsContext.length,this.analysis.visualizeSunlight)}:{}}get _durationVisualizationParameters(){const{color:e,colorStops:t,mode:i}=this.analysis.totalDurationOptions,s=this._totalDuration,r=s>0&&"hourly"===i?B/s:0,n=this._getEffectiveShadowCastColorRamp(e,t,1/s,this.analysis.visualizeSunlight);return 0===r?{...this._discreteVisualizationParameters,gradientColorRamp:n}:{bandedGradientColorRamp:n,visualization:1,bandSize:r}}get _discreteVisualizationParameters(){const{color:e,colorStops:t}=this.analysis.discreteOptions;return{gradientColorRamp:this._getEffectiveShadowCastColorRamp(e,t,1/this._lightDirections.length,this.analysis.visualizeSunlight),visualization:0}}get _shadowLayerViews(){return this.view.allLayerViews.items.filter(G)}get _previewDependencies(){const{view:e}=this,i=e.slice.plane,s=this._shadowLayerViews,r=s.map(e=>e.layer).filter(t),n=s.map(e=>e.suspended),a=r.map(e=>e.visible),o=r.map(e=>e.opacity),l=!!e.graphicsView?.suspended,u=r.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),c=s.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:i,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:n,graphicsViewSuspended:l,layerVisibilities:a,layerOpacities:o,filters:c,definitionExpressions:u}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){return this._getDurationAtScreen(e)}async _getDurationAtScreen(e,t){if(!await this._isScreenPointInAnalysisArea(e,t))return-1;const{_renderer:i,_totalDurationSampleCount:s}=this;if(null==i||0===s)return 0;const r=this.view.state.camera.screenToRender(h(e.x,e.y),m()),n=i.readAccumulatedShadow(r);return(this.analysis.visualizeSunlight?1-n:n)*this._totalDuration}async _isScreenPointInAnalysisArea(e,t){const{geometry:i}=this.analysis;if(!i)return!0;const s=await this.view.hitTest(e);u(t);const r=s.results.find(e=>e.mapPoint)?.mapPoint??s?.ground?.mapPoint;if(!r)return!1;const n=await C(r,i.spatialReference,{signal:t});return u(t),null!=n&&b(i,n)}_getEffectiveShadowCastColorRamp(e,t,i,s){if(null!=t){t.length>R&&n.getLogger(this).warnOnce("ShadowCastAnalysis supports at most 8 color stops");const e=t.map(s?e=>[1-e.value*i,e.color.toUnitRGBA()]:e=>[e.value*i,e.color.toUnitRGBA()]);return e.sort(([e],[t])=>e-t),e}return H(e,s)}};e([y({readOnly:!0,type:["shadow-cast-view-3d"]})],L.prototype,"type",void 0),e([y({constructOnly:!0,nonNullable:!0})],L.prototype,"analysis",void 0),e([y({readOnly:!0})],L.prototype,"updating",null),e([y()],L.prototype,"_stopPreviewingTask",void 0),e([y()],L.prototype,"_updatedRecently",void 0),e([y()],L.prototype,"_tooltip",void 0),e([y()],L.prototype,"_sceneUpdating",null),e([y()],L.prototype,"_effectiveUtcOffset",null),e([y()],L.prototype,"_utcOffsetAuto",null),e([y()],L.prototype,"_dateUTCOffset",null),e([y()],L.prototype,"_startDateTimeUTC",null),e([y()],L.prototype,"_endDateTimeUTC",null),e([y()],L.prototype,"_referencePosition",null),e([y()],L.prototype,"_interval",null),e([y()],L.prototype,"_intervalContext",null),e([y()],L.prototype,"_totalDurationSampleCount",null),e([y()],L.prototype,"_totalDuration",null),e([y()],L.prototype,"_lightDirections",null),e([y()],L.prototype,"_lightDirectionsContext",null),e([y()],L.prototype,"_analysisVolume",null),e([y()],L.prototype,"_visualizationParameters",null),e([y()],L.prototype,"_minDurationVisualizationParameters",null),e([y()],L.prototype,"_minDurationContextVisualizationParameters",null),e([y()],L.prototype,"_durationVisualizationParameters",null),e([y()],L.prototype,"_discreteVisualizationParameters",null),e([y()],L.prototype,"_shadowLayerViews",null),e([y()],L.prototype,"_previewDependencies",null),e([y()],L.prototype,"_renderer",null),L=e([f("esri.views.3d.analysis.ShadowCastAnalysisView3D")],L);const E=L;function k(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function H(e,t){const i=e.toUnitRGBA(),s=w(i[0],i[1],i[2],0),[r,n]=t?[i,s]:[s,i];return[[0,r],[1,n]]}function G(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;case"base-dynamic-3d":case"catalog-3d":case"catalog-dynamic-group-3d":case"dimension-3d":case"gaussian-splat-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"viewshed-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":case"group":default:return!1;case"graphics-3d":return e.layer.graphics.some(e=>{const{symbol:t}=e;return null==t||"text"!==t.type&&!("symbolLayers"in t)||"text"!==t.type&&t.symbolLayers.some(e=>"text"!==e.type)})}}function I(e,t){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const s=V(e.slicePlane,t.slicePlane),r=e.startDateUTC.valueOf()===t.startDateUTC.valueOf()&&e.endDateUTC.valueOf()===t.endDateUTC.valueOf(),n=i(e.layerViewSuspended,t.layerViewSuspended)&&e.graphicsViewSuspended===t.graphicsViewSuspended,a=i(e.layerVisibilities,t.layerVisibilities),o=i(e.layerOpacities,t.layerOpacities),l=i(e.filters,t.filters),u=i(e.definitionExpressions,t.definitionExpressions);return s&&r&&n&&a&&o&&l&&u}const B=_(1,"hours","milliseconds"),M=500,q=255,F=v(),N=[],J=new x;export{E as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../Color.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import o from"../../../../symbols/support/ElevationInfo.js";const r=2,s=4,c=t(2),n=new o({mode:"absolute-height",offset:1.5});class l{constructor(){this.collisionRadius=5,this.fovUnfocusedArcWidth=s,this.fovFocusedArcWidth=r*this.fovUnfocusedArcWidth,this.scaleOrientSize=90,this.scaleOrientHandleRadius=.025,this.scaleOrientMinDistance=1,this.scaleOrientArrowTipLength=.3,this.scaleOrientArrowTipFocusMultiplier=r/1.5,this.observerSize=5,this.hoverTimeoutMilliseconds=1e3,this.viewAngleThreshold=10}getFovArcWidth(e){return e?this.fovFocusedArcWidth:this.fovUnfocusedArcWidth}getScaleOrientArrowTipLength(e){return this.scaleOrientArrowTipLength*(e?this.scaleOrientArrowTipFocusMultiplier:1)}}const h=new l;class a{constructor(){this.frameWidthNotSelected=.3,this.frameWidthSelected=1,this.frameColor=new e([255,255,255,.99]),this.observerPointConfiguration={size:6,pixelSnappingEnabled:!1,primitive:"circle",elevationInfo:{mode:"absolute-height",offset:0},outlineSize:0,color:new e([3,252,111,1]).toUnitRGBA()},this.shapeMaterialParameters={color:i(.33,.33,.33,.25),renderOccluded:1,cullFace:2,writeDepth:!1}}}const d=new a;export{c as arcAnglePerSegment,n as creationElevationInfo,h as viewshedToolManipulatorConfiguration,d as viewshedVisualizationConfiguration};
2
+ import e from"../../../../Color.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";const r=2,s=4,o=i(2),c=1.5;class n{constructor(){this.collisionRadius=5,this.fovUnfocusedArcWidth=s,this.fovFocusedArcWidth=r*this.fovUnfocusedArcWidth,this.scaleOrientSize=90,this.scaleOrientHandleRadius=.025,this.scaleOrientMinDistance=1,this.scaleOrientArrowTipLength=.3,this.scaleOrientArrowTipFocusMultiplier=r/1.5,this.observerSize=5,this.hoverTimeoutMilliseconds=1e3,this.viewAngleThreshold=10}getFovArcWidth(e){return e?this.fovFocusedArcWidth:this.fovUnfocusedArcWidth}getScaleOrientArrowTipLength(e){return this.scaleOrientArrowTipLength*(e?this.scaleOrientArrowTipFocusMultiplier:1)}}const h=new n;class l{constructor(){this.frameWidthNotSelected=.3,this.frameWidthSelected=1,this.frameColor=new e([255,255,255,.99]),this.observerPointConfiguration={size:6,pixelSnappingEnabled:!1,primitive:"circle",elevationInfo:{mode:"absolute-height",offset:0},outlineSize:0,color:new e([3,252,111,1]).toUnitRGBA()},this.shapeMaterialParameters={color:t(.33,.33,.33,.25),renderOccluded:1,cullFace:2,writeDepth:!1}}}const a=new l;export{o as arcAnglePerSegment,c as creationVerticalOffset,h as viewshedToolManipulatorConfiguration,a as viewshedVisualizationConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o,sync as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as c}from"./ViewshedSnappingController.js";import{ViewshedSubTool as u}from"./ViewshedSubTool.js";import{findSubTool as p}from"./viewshedSubToolUtils.js";import{InteractiveToolBase as h}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as g}from"../../../interactive/keybindings.js";let b=class extends h{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.creating=!1,this.isPlacingTarget=!1,this._selectedManipulator=null}initialize(){this._interactionVisuals=new d({view:this.view}),this._snappingController=new c({view:this.view});const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>e,({viewshedComputedData:e})=>{const t=new u({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.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},n),o(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},a),o(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),a),o(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)},a)])}destroy(){this._selectManipulator(null),s(this._interactionVisuals),s(this.subToolHandles),s(this._snappingController)}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)||this._snappingController?.updating}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const s=t.moveInteractionState,o=e?s.grabbing:s.dragging,n=t.scaleOrientInteractionState,a=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(o||a)))return void this._interactionVisuals?.setVisibility(!1);const l=o?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:l,laserlineVisible:!0,verticalLineVisible:o,intersectsWorldUp:o})}createObserverMoveSnappingPipeline(e,t,i){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i)}onInputEvent(e){switch(e.type){case"key-down":this._onKeyDown(e);break;case"hold":this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_onKeyDown(e){g.cancel===e.key&&(this.grabbing||(this.selectedViewshed=null,e.stopPropagation()))}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return p(this.subToolHandles,e)}_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 test(){}};e([l({constructOnly:!0})],b.prototype,"analysis",void 0),e([l({constructOnly:!0})],b.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],b.prototype,"view",void 0),e([l()],b.prototype,"subToolHandles",void 0),e([l()],b.prototype,"removeIncompleteOnCancel",void 0),e([l()],b.prototype,"automaticManipulatorSelection",void 0),e([l()],b.prototype,"creating",void 0),e([l()],b.prototype,"isPlacingTarget",void 0),e([l()],b.prototype,"_selectedManipulator",void 0),e([l()],b.prototype,"_interactionVisuals",void 0),e([l()],b.prototype,"_snappingController",void 0),e([l()],b.prototype,"updating",null),e([l()],b.prototype,"grabbing",null),e([l()],b.prototype,"cursor",null),e([l()],b.prototype,"selectedViewshed",null),e([l()],b.prototype,"selectedViewshedComputedData",null),e([l()],b.prototype,"_selectedSubTool",null),b=e([r("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],b);export{b as ViewshedEditTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as i}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as o,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as l,initial as r}from"../../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{ViewshedInteractionVisuals as c}from"./ViewshedInteractionVisuals.js";import{ViewshedObserverManipulatedObject3D as d}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedSnappingController as u}from"./ViewshedSnappingController.js";import{ViewshedSubTool as h}from"./ViewshedSubTool.js";import{findSubTool as b}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as v}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import g from"../../../interactive/sketch/SketchOptions.js";import{enterInputModeIfAvailable as m,makeTooltip as w}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as V}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";let y=class extends T{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.creating=!1,this.isPlacingTarget=!1,this._selectedManipulator=null,this._observerTooltipSketchOptions=new g({tooltips:{enabled:!0}}),this._observerTooltipConnectionHandle=null,this._observerTooltipObject=null}initialize(){const{view:e}=this;this._interactionVisuals=new c({view:e}),this._snappingController=new u({view:e}),this._initializeObserverTooltip(e);const t=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=i(()=>t,({viewshedComputedData:e})=>{const t=new h({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.firstGrabbedManipulator,e=>{if(null!=e){const t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},l),n(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(null==e)return;const{subTool:t,observer:i,target:o}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(o,!1)},r),n(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),r),n(()=>this.selectedViewshed,e=>{const t=this._selectedManipulator,i=this._selectedSubTool;this._connectObserverTooltip(i),null==e?this._selectManipulator(null):null!=t&&i.hasManipulator(t)||this._selectManipulator(i.discManipulator)},r)])}destroy(){this._selectManipulator(null),this._disconnectObserverTooltip(),o(this.subToolHandles),o(this._interactionVisuals),o(this._snappingController),o(this._observerTooltip)}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)||this._snappingController?.updating}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){const t=this._selectedSubTool,i=this.selectedViewshedComputedData;if(null==t||null==i)return void this._interactionVisuals?.setVisibility(!1);const o=t.moveInteractionState,s=e?o.grabbing:o.dragging,n=t.scaleOrientInteractionState,l=e?n.grabbing:n.dragging;if(!(this.analysisViewData.visible&&(s||l)))return void this._interactionVisuals?.setVisibility(!1);const r=s?i.elevationAlignedObserverRenderSpace:i.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:r,laserlineVisible:!0,verticalLineVisible:s,intersectsWorldUp:s})}createObserverMoveSnappingPipeline(e,t,i){return this._snappingController.createObserverMoveSnappingPipeline(e,t,i)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!m(e,this._observerTooltip))switch(e.type){case"key-down":this._onKeyDown(e);break;case"hold":this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){const t=this._observerTooltipSketchOptions;this._observerTooltip=w(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new V({sketchOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),null==e)return void this._observerTooltip.clear();const t=new d({view:this.view,subTool:e});this._observerTooltipObject=t,this._observerTooltipConnectionHandle=v(this._observerTooltip,t,()=>({sketchOptions:this._observerTooltipSketchOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=s(this._observerTooltipConnectionHandle),this._observerTooltipObject=o(this._observerTooltipObject)}_onKeyDown(e){_.cancel===e.key&&(this.grabbing||(this.selectedViewshed=null,e.stopPropagation()))}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return b(this.subToolHandles,e)}_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 test(){}};e([a({constructOnly:!0})],y.prototype,"analysis",void 0),e([a({constructOnly:!0})],y.prototype,"analysisViewData",void 0),e([a({constructOnly:!0})],y.prototype,"view",void 0),e([a()],y.prototype,"subToolHandles",void 0),e([a()],y.prototype,"removeIncompleteOnCancel",void 0),e([a()],y.prototype,"automaticManipulatorSelection",void 0),e([a()],y.prototype,"creating",void 0),e([a()],y.prototype,"isPlacingTarget",void 0),e([a()],y.prototype,"_selectedManipulator",void 0),e([a()],y.prototype,"_interactionVisuals",void 0),e([a()],y.prototype,"_snappingController",void 0),e([a()],y.prototype,"_observerTooltip",void 0),e([a()],y.prototype,"_observerTooltipInfo",void 0),e([a()],y.prototype,"updating",null),e([a()],y.prototype,"grabbing",null),e([a()],y.prototype,"cursor",null),e([a()],y.prototype,"selectedViewshed",null),e([a()],y.prototype,"selectedViewshedComputedData",null),e([a()],y.prototype,"_selectedSubTool",null),y=e([p("esri.views.3d.analysis.Viewshed.ViewshedEditTool")],y);export{y as ViewshedEditTool};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{__decorate as t}from"tslib";import{EventedAccessor as e}from"../../../../core/Evented.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{absoluteHeightElevationInfo as a}from"../../../../support/elevationInfoUtils.js";import{viewingModeFromString as m}from"../../../ViewingMode.js";import{EditGeometryOperations as p}from"../../../interactive/editGeometry/EditGeometryOperations.js";const d=Symbol("observerTooltipOperations");let l=class extends e{constructor(t){super(t),this._operations=null}initialize(){this.addHandles(i(()=>this.subTool.observer,t=>this._syncObserver(t),r))}destroy(){this.removeHandles(d),this._operations=o(this._operations)}get operations(){return this._operations}get elevationInfo(){return a}get visible(){return this.subTool.viewshedComputedData?.valid??!1}get isDraped(){return!1}get origin(){return this.subTool.observer}get updating(){return!1}toMap(t){return this.view.toMap(t)}_syncObserver(t){if(null==t)return this.removeHandles(d),this._operations=o(this._operations),void this.emit("committed");const e=this._operations?.data.geometry;if(e===t)return;if(this._operations?.trySetGeometry(t))return this.emit("modified-externally"),void this.emit("committed");this.removeHandles(d),this._operations=o(this._operations);const i=p.fromGeometry(t.clone(),m(this.view.viewingMode));this._operations=i,this.addHandles(i.data.on("change",()=>{const t=i.data.geometry;"point"===t.type&&(this.subTool.observer=t,this.emit("committed"))}),d),this.emit("committed")}};t([s({constructOnly:!0})],l.prototype,"view",void 0),t([s({constructOnly:!0})],l.prototype,"subTool",void 0),l=t([n("esri.views.3d.analysis.Viewshed.ViewshedObserverManipulatedObject3D")],l);export{l as ViewshedObserverManipulatedObject3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as a,throwIfAborted as o,onAbort as s}from"../../../../core/promiseUtils.js";import{watch as n,sync as r}from"../../../../core/reactiveUtils.js";import{property as l,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{createDrawTool as h,createPlacementResult as d}from"./placementUtils.js";import{detachToolFromView as p}from"./toolLifecycleUtils.js";import{creationElevationInfo as m}from"./ViewshedConfiguration.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as u}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{Manipulator3D as v}from"../../interactive/Manipulator3D.js";import{ViewEventPriorities as P}from"../../../input/InputManager.js";import{sketchKeys as g}from"../../../interactive/keybindings.js";import y from"../../../interactive/sketch/SketchOptions.js";const O="multiple",b=new y({tooltips:{enabled:!0}}),C=Symbol("hiddenManipulatorHandle");let T=class extends i{constructor(e){super(e),this.placementMode=O,this.creationState=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),P.DEFAULT),n(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(a()),o(t);const{resolve:i,reject:n,promise:r}=Promise.withResolvers(),l=s(t,()=>this._cancelPlacementOperation());return this._placeOperation=new _({abortHandle:l,reject:n,resolve:i}),this.place(e),r}place(e){this.callbacks.setSelectedViewshed(null),this.placementMode=e,this._startObserverPlacement()}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(g.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):g.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e){const i=new t({observer:e.mapPoint.clone(),elevationInfo:m.clone(),feature:e.feature});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState="placing-target",this._updateStagedViewshed(e.scenePoint),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e.scenePoint);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),"multiple"!==this.placementMode||(this.creationState="placing-observer")}_handleTargetPlacementPreview(e){this._updateStagedViewshed(e.scenePoint)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:i}=h({analysisViewData:this.analysisViewData,view:this.view,sketchOptions:b,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e)});this._drawTool=e,this._renderer=i;try{this.view.addAndActivateTool(e),e.begin([u({mode:this.placementMode,onObserverComplete:i=>this._onObserverMapPointComplete(e,t,i),onTargetComplete:i=>this._onTargetMapPointComplete(e,t,i),onTargetPreview:i=>this._onTargetMapPointPreview(e,t,i)})])}catch(a){this._destroyDrawTool(e),this._rejectPlaceOperation(a instanceof Error?a:new Error(String(a)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,i){const a=d({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleObserverPlacementComplete(a)):this._onCancel(e)}_onTargetMapPointComplete(e,t,i){const a=d({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementComplete(a),"multiple"===this.placementMode&&this._renderer?.updatePlacementLocation(null)):this._onCancel(e)}_onTargetMapPointPreview(e,t,i){const a=d({drawTool:e,intersector:t,mapPoint:i,view:this.view});a&&(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementPreview(a))}_onManipulatorCountChange(e){e.removeHandles(C);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof v&&t.push(e.disableDisplay())}),e.addHandles(t,C)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&p(this.view,e)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const i=this.callbacks.findViewshedComputedData(t);if(!i)return;const{heading:a,tilt:o,farDistance:s}=w(this.view,i,e);t.farDistance=s,t.tilt=o,t.heading=a}get test(){}};e([l({constructOnly:!0})],T.prototype,"analysis",void 0),e([l({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([l({constructOnly:!0})],T.prototype,"view",void 0),e([l({constructOnly:!0})],T.prototype,"callbacks",void 0),e([l()],T.prototype,"placementMode",void 0),e([l()],T.prototype,"creationState",void 0),e([l()],T.prototype,"stagedViewshed",void 0),e([l()],T.prototype,"_placeOperation",void 0),e([l()],T.prototype,"_drawTool",void 0),e([l()],T.prototype,"_renderer",void 0),e([l()],T.prototype,"updating",null),e([l()],T.prototype,"active",null),T=e([c("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],T);export{T as ViewshedPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as a,throwIfAborted as o,onAbort as s}from"../../../../core/promiseUtils.js";import{watch as n,sync as r}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../../../core/units.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{createDrawTool as d,createPlacementResult as p}from"./placementUtils.js";import{detachToolFromView as m}from"./toolLifecycleUtils.js";import{creationVerticalOffset as _}from"./ViewshedConfiguration.js";import u from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as w}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as v}from"./viewshedToolUtils.js";import{Manipulator3D as P}from"../../interactive/Manipulator3D.js";import{ViewEventPriorities as g}from"../../../input/InputManager.js";import{sketchKeys as y}from"../../../interactive/keybindings.js";import O from"../../../interactive/sketch/SketchOptions.js";const b="multiple",C=new O({tooltips:{enabled:!0}}),T=Symbol("hiddenManipulatorHandle");let f=class extends i{constructor(e){super(e),this.placementMode=b,this.creationState=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null}initialize(){this.addHandles([this.view.on("key-down",e=>this._handleKeyDown(e),g.DEFAULT),n(()=>{const{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:null!=e&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{null==e||t||this.analysis.viewsheds.add(e)},r)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(a()),o(t);const{resolve:i,reject:n,promise:r}=Promise.withResolvers(),l=s(t,()=>this._cancelPlacementOperation());return this._placeOperation=new u({abortHandle:l,reject:n,resolve:i}),this.place(e),r}place(e){this.callbacks.setSelectedViewshed(null),this.placementMode=e,this._startObserverPlacement()}cancelPlaceOperation(){null==this.creationState&&null==this._placeOperation||(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return null!=this.creationState&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){null!=this.creationState&&(y.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):y.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&"multiple"===this.placementMode)return this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement();this._destroyDrawTool(),this._abortCreation()}_removeStaged(){const{stagedViewshed:e}=this;return this.stagedViewshed=null,!!e&&(this.analysis.viewsheds.remove(e),!0)}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e){const i=l(e.mapPoint.spatialReference);e.mapPoint.z=(e.mapPoint.z??0)+_/i;const a=new t({observer:e.mapPoint.clone(),feature:e.feature});this.analysis.viewsheds.add(a),this.stagedViewshed=a,this.creationState="placing-target",this._updateStagedViewshed(e.scenePoint),this.callbacks.setSelectedViewshed(null)}_onCancel(e){const t=this._removeStaged();return"placing-observer"===this.creationState?t&&"multiple"===this.placementMode?(this.callbacks.setSelectedViewshed(null),void this._startObserverPlacement()):(this._destroyDrawTool(e),void this._abortCreation()):t?(this.creationState="placing-observer",this.callbacks.setSelectedViewshed(null),void("multiple"!==this.placementMode?(this._destroyDrawTool(e),this._abortCreation()):this._startPointPlacement())):(this._destroyDrawTool(e),void this._abortCreation())}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e.scenePoint);const t=this.stagedViewshed;this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),"multiple"!==this.placementMode||(this.creationState="placing-observer")}_handleTargetPlacementPreview(e){this._updateStagedViewshed(e.scenePoint)}_resolvePlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.resolve())}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){const t=this._placeOperation;this._placeOperation=null,e(t)}_startObserverPlacement(){this.creationState="placing-observer",this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);const{drawTool:e,intersector:t,renderer:i}=d({analysisViewData:this.analysisViewData,view:this.view,sketchOptions:C,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e)});this._drawTool=e,this._renderer=i;try{this.view.addAndActivateTool(e),e.begin([w({mode:this.placementMode,onObserverComplete:i=>this._onObserverMapPointComplete(e,t,i),onTargetComplete:i=>this._onTargetMapPointComplete(e,t,i),onTargetPreview:i=>this._onTargetMapPointPreview(e,t,i)})])}catch(a){this._destroyDrawTool(e),this._rejectPlaceOperation(a instanceof Error?a:new Error(String(a)))}}_onComplete(e){this._removeStaged(),this._resolvePlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleObserverPlacementComplete(a)):this._onCancel(e)}_onTargetMapPointComplete(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a?(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementComplete(a),"multiple"===this.placementMode&&this._renderer?.updatePlacementLocation(null)):this._onCancel(e)}_onTargetMapPointPreview(e,t,i){const a=p({drawTool:e,intersector:t,mapPoint:i,view:this.view});a&&(this._renderer?.updatePlacementLocation(a.scenePoint),this._handleTargetPlacementPreview(a))}_onManipulatorCountChange(e){e.removeHandles(T);const t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof P&&t.push(e.disableDisplay())}),e.addHandles(t,T)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&m(this.view,e)}_updateStagedViewshed(e){const t=this.stagedViewshed;if(!t)return;const i=this.callbacks.findViewshedComputedData(t);if(!i)return;const{heading:a,tilt:o,farDistance:s}=v(this.view,i,e);t.farDistance=s,t.tilt=o,t.heading=a}get test(){}};e([c({constructOnly:!0})],f.prototype,"analysis",void 0),e([c({constructOnly:!0})],f.prototype,"analysisViewData",void 0),e([c({constructOnly:!0})],f.prototype,"view",void 0),e([c({constructOnly:!0})],f.prototype,"callbacks",void 0),e([c()],f.prototype,"placementMode",void 0),e([c()],f.prototype,"creationState",void 0),e([c()],f.prototype,"stagedViewshed",void 0),e([c()],f.prototype,"_placeOperation",void 0),e([c()],f.prototype,"_drawTool",void 0),e([c()],f.prototype,"_renderer",void 0),e([c()],f.prototype,"updating",null),e([c()],f.prototype,"active",null),f=e([h("esri.views.3d.analysis.Viewshed.ViewshedPlacementController")],f);export{f as ViewshedPlacementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";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{destroyMaybe as n}from"../../../../core/maybe.js";import{when as a,syncAndInitial as o,watch as l,sync as r,initial as d}from"../../../../core/reactiveUtils.js";import{property as c,subclass as h}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../../../../geometry/Point.js";import{creationElevationInfo as g}from"./ViewshedConfiguration.js";import{ViewshedSubTool as m}from"./ViewshedSubTool.js";import{computeParametersFromTargetPoint as v}from"./viewshedToolUtils.js";import{Manipulator3D as w}from"../../interactive/Manipulator3D.js";import{Settings as _}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as V}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as b}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as f}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{AnalysisToolBase as y}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as S}from"../../../interactive/keybindings.js";import{newToolIntersector as T}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as C}from"../../../support/screenUtils.js";const D=Symbol("interactionVisuals");let M=class extends y{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=H,this._creationState=!1,this._interactionVisualElements=null,this._settings=new _({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=T(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s(()=>e,({viewshedComputedData:e})=>{const t=new m({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([a(()=>this._valid,()=>this.finishToolCreation(),o),l(()=>this._stagedViewshed,e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null},o),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()},r),l(()=>this.view.activeTool,e=>{e!==this&&null!=e&&(this.selectedViewshed=null)}),a(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},d),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)},d)])}destroy(){n(this.subToolHandles),this.removeHandles(D)}onDeactivate(){this.removeStaged(),this._creationState=!1}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}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":S.cancel===e.key?this._cancelKeyHandler(e):S.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=H}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,I);if(null!=i){if("placing-observer"===this._creationState){const e=new t({observer:i.mapPoint.clone(),elevationInfo:g.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._creationState=!1,this._stagedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null),this.selectedViewshed=e}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,I);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:n,farDistance:a}=v(this.view,i,e);t.farDistance=a,t.tilt=n,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=C(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=t.scenePoint;if(!s.getIntersectionPoint(n))return null;const a=t.mapPoint;return a.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(n,a),null==a?null:(t.feature=f(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(D);const e=this._settings.visualElements,t=new b({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new V({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l(()=>e.zVerticalLine,e=>e.apply(s),o),l(()=>e.heightPlane,e=>e.apply(t),o),i(()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null})],D)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,n=this.selectedViewshedComputedData,a=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void a(i,!1);if(null==s||null==n)return void a(!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(a(c,l),c){const e=l?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:n}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof w?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};e([c()],M.prototype,"updating",null),e([c({constructOnly:!0})],M.prototype,"view",void 0),e([c()],M.prototype,"analysisViewData",void 0),e([c()],M.prototype,"removeIncompleteOnCancel",void 0),e([c()],M.prototype,"automaticManipulatorSelection",void 0),e([c()],M.prototype,"multiTouchEnabled",void 0),e([c({constructOnly:!0})],M.prototype,"analysis",void 0),e([c()],M.prototype,"subToolHandles",void 0),e([c()],M.prototype,"_stagedViewshed",void 0),e([c()],M.prototype,"_stagedViewshedComputedData",void 0),e([c()],M.prototype,"_placementMode",void 0),e([c()],M.prototype,"_creationState",void 0),e([c()],M.prototype,"_valid",null),e([c({readOnly:!0})],M.prototype,"cursor",null),e([c()],M.prototype,"_selectedManipulator",void 0),e([c()],M.prototype,"_selectedSubTool",null),e([c()],M.prototype,"selectedViewshed",null),e([c()],M.prototype,"selectedViewshedComputedData",null),e([c()],M.prototype,"stagedViewshed",null),e([c()],M.prototype,"grabbing",null),e([c()],M.prototype,"creating",null),e([c()],M.prototype,"isPlacingTarget",null),M=e([h("esri.views.3d.analysis.Viewshed.ViewshedTool")],M);const I={mapPoint:new p,scenePoint:u(),feature:null},H="multiple";export{M as default};
2
+ import{__decorate as e}from"tslib";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{destroyMaybe as n}from"../../../../core/maybe.js";import{when as a,syncAndInitial as o,watch as l,sync as r,initial as d}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as c}from"../../../../core/units.js";import{property as h,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import g from"../../../../geometry/Point.js";import{creationVerticalOffset as m}from"./ViewshedConfiguration.js";import{ViewshedSubTool as v}from"./ViewshedSubTool.js";import{computeParametersFromTargetPoint as w}from"./viewshedToolUtils.js";import{Manipulator3D as _}from"../../interactive/Manipulator3D.js";import{Settings as V}from"../../interactive/editingTools/settings.js";import{ExtendedLineVisualElement as b}from"../../interactive/visualElements/ExtendedLineVisualElement.js";import{LaserlineVisualElement as f}from"../../interactive/visualElements/LaserlineVisualElement.js";import{toGraphic as y}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import{AnalysisToolBase as S}from"../../../interactive/AnalysisToolBase.js";import{sketchKeys as T}from"../../../interactive/keybindings.js";import{newToolIntersector as C}from"../../../interactive/ToolIntersector.js";import{createScreenPointArrayFromEvent as D}from"../../../support/screenUtils.js";const M=Symbol("interactionVisuals");let H=class extends S{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._stagedViewshed=null,this._stagedViewshedComputedData=null,this._placementMode=P,this._creationState=!1,this._interactionVisualElements=null,this._settings=new V({getTheme:()=>this.view.effectiveTheme}),this._selectedManipulator=null}initialize(){this._intersector=C(this.view.state.viewingMode),this._createInteractionVisuals();const e=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=s(()=>e,({viewshedComputedData:e})=>{const t=new v({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([a(()=>this._valid,()=>this.finishToolCreation(),o),l(()=>this._stagedViewshed,e=>{const t=this.analysisViewData.viewshedComputedDataHandles;this._stagedViewshedComputedData=null!=e&&null!=t?this._findSubTool(e)?.viewshedComputedData:null},o),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()},r),l(()=>this.view.activeTool,e=>{e!==this&&null!=e&&(this.selectedViewshed=null)}),a(()=>{const e=this.selectedViewshedComputedData;return null==e?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{const{subTool:t,observer:i,target:s}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(i,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(s,!1)},d),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)},d)])}destroy(){n(this.subToolHandles),this.removeHandles(M)}onDeactivate(){this.removeStaged(),this._creationState=!1}get updating(){return this.subToolHandles.some(({subTool:e})=>e.updating)}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":T.cancel===e.key?this._cancelKeyHandler(e):T.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=P}_clickPlacementHandler(e){if(!this.creating||this.hasFocusedManipulators)return;const i=this._intersectScreen(e,I);if(null!=i){if("placing-observer"===this._creationState){const e=c(i.mapPoint.spatialReference);i.mapPoint.z=(i.mapPoint.z??0)+m/e;const s=new t({observer:i.mapPoint.clone(),feature:i.feature});this.analysis.viewsheds.add(s),this._stagedViewshed=s,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._creationState=!1,this._stagedViewshed=null,this._finishToolCreationIfValid(),this.view.activeTool=null),this.selectedViewshed=e}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,I);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:n,farDistance:a}=w(this.view,i,e);t.farDistance=a,t.tilt=n,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=D(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(i,this._intersector);const s=this._intersector.results.min,n=t.scenePoint;if(!s.getIntersectionPoint(n))return null;const a=t.mapPoint;return a.spatialReference=this.view.spatialReference,this.view.renderCoordsHelper.fromRenderCoords(n,a),null==a?null:(t.feature=y(s,this.view),t)}_createInteractionVisuals(){this.removeHandles(M);const e=this._settings.visualElements,t=new f({view:this.view,attached:!1,style:{glowWidth:e.heightPlane.glowWidth,innerWidth:e.heightPlane.innerWidth},isDecoration:!0}),s=new b({view:this.view,extensionType:e.zVerticalLine.extensionType,attached:!1,innerWidth:1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._interactionVisualElements={laserline:t,verticalLine:s},this.addHandles([l(()=>e.zVerticalLine,e=>e.apply(s),o),l(()=>e.heightPlane,e=>e.apply(t),o),i(()=>{t.destroy(),s.destroy(),this._interactionVisualElements=null})],M)}updateInteractionVisualsVisibility(e=!1){const t=this.creating,i=this.analysisViewData.visible,s=this._selectedSubTool,n=this.selectedViewshedComputedData,a=(e,t)=>{const i=this._interactionVisualElements;null!=i&&(i.verticalLine.attached=t,i.laserline.attached=e)};if(t)return void a(i,!1);if(null==s||null==n)return void a(!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(a(c,l),c){const e=l?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._updateInteractionVisualsLocation(e,l)}}_updateInteractionVisualsLocation(e,t){const i=this._interactionVisualElements;if(null==i)return;const{laserline:s,verticalLine:n}=i;s.heightManifoldTarget=e,s.intersectsWorldUpAtLocation=t?e:null,null!=e&&n.setStartEndFromWorldDownAtLocation(e)}_findSubTool(e){if(null==e)return null;const t=e instanceof _?t=>t.subTool.hasManipulator(e):t=>t.subTool.viewshed===e;return this.subToolHandles?.find(t)?.subTool}get test(){}};e([h()],H.prototype,"updating",null),e([h({constructOnly:!0})],H.prototype,"view",void 0),e([h()],H.prototype,"analysisViewData",void 0),e([h()],H.prototype,"removeIncompleteOnCancel",void 0),e([h()],H.prototype,"automaticManipulatorSelection",void 0),e([h()],H.prototype,"multiTouchEnabled",void 0),e([h({constructOnly:!0})],H.prototype,"analysis",void 0),e([h()],H.prototype,"subToolHandles",void 0),e([h()],H.prototype,"_stagedViewshed",void 0),e([h()],H.prototype,"_stagedViewshedComputedData",void 0),e([h()],H.prototype,"_placementMode",void 0),e([h()],H.prototype,"_creationState",void 0),e([h()],H.prototype,"_valid",null),e([h({readOnly:!0})],H.prototype,"cursor",null),e([h()],H.prototype,"_selectedManipulator",void 0),e([h()],H.prototype,"_selectedSubTool",null),e([h()],H.prototype,"selectedViewshed",null),e([h()],H.prototype,"selectedViewshedComputedData",null),e([h()],H.prototype,"stagedViewshed",null),e([h()],H.prototype,"grabbing",null),e([h()],H.prototype,"creating",null),e([h()],H.prototype,"isPlacingTarget",null),H=e([u("esri.views.3d.analysis.Viewshed.ViewshedTool")],H);const I={mapPoint:new g,scenePoint:p(),feature:null},P="multiple";export{H as default};