@arcgis/core 4.25.0-next.20220919 → 4.25.0-next.20220921

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 (604) hide show
  1. package/AggregateGraphic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{9f31ab2247c9defb882c.js → 01ac91fc0bc6b4d4e3c6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{d26108352874af0b6762.js → 053564e659222e8f0efb.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1c65fd714f637ac1ee8c.js +1 -0
  6. package/assets/esri/core/workers/chunks/{8588cbecb8e808f451fe.js → 249e32af1f2d433fae4c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{5b16b30ac3166f33e81e.js → 26690f4ec1f3cb8099c2.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{be93b0cef85665446944.js → 274b4cdf6c8d77e8a2e6.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{52dcfd6b8b1dfa864e44.js → 2cae0ec5f60ab42a49aa.js} +1 -1
  10. package/assets/esri/core/workers/chunks/43e4560d65e5ddeeef6f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{f436c86f86236ea7ea04.js → 4641e10e0e8e9d257521.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{7a45333de9ded92619c2.js → 466008f793c2e11e854c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{c9d655675552dcf6cef7.js → 4a699b41072ee88f0956.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{14ea96e398f4842abe4e.js → 4fdd18f5cdaa0d82ebc1.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9662da3e1e37f3445186.js → 562b9619b8ee13734813.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{5c1a5615c865c10209c2.js → 5880fa48bad79a7c93ab.js} +1 -1
  17. package/assets/esri/core/workers/chunks/58824250492b89ec24ea.js +1 -0
  18. package/assets/esri/core/workers/chunks/64a6b837f1d5d7ad7619.js +1 -0
  19. package/assets/esri/core/workers/chunks/{421241543afbc9a619ea.js → 64de93865088bbe0398f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{99d56a707039d645622c.js → 6a20d8740ec2a5b2c579.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8bab21bc6164a593278f.js → 771b92e524802de840ba.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{dbb1bf97c85848bb8ce1.js → 7ce250cc6fbe68aef50d.js} +32 -32
  23. package/assets/esri/core/workers/chunks/{2c4938512dd726a177dd.js → 7fab18074b130b71a648.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f67357b3c6c591c9da5e.js → 872f1cb3596fb80e387f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{3ee81834b3217720cb48.js → 8874e69378a27d155f9d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{31de71018575457155e5.js → 8ee3da8677255b8c8709.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{2e44aee22e70857b893c.js → 93631b10452b0e0189b3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{cb2dc84d972469445da6.js → 95cd9edca50ea163d50f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d31bbb13af45ce8e45dc.js → acf9f753741b677afb44.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{1455944edeba1560eb07.js → afdafa77f5ca1b9e3acc.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{cf3e1ac63580bc495ea6.js → b4da35f1093f3731f9ac.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{09f4296dcb80e3ae4b3d.js → b8eba8c9d5424a7ae5f2.js} +1 -1
  33. package/assets/esri/core/workers/chunks/bb0d86937faf0cd7d16d.js +1 -0
  34. package/assets/esri/core/workers/chunks/bf3e80023e156d5906c7.js +1 -0
  35. package/assets/esri/core/workers/chunks/{8ba83fee56dd4f306d87.js → c2a6ac7046134f725cf3.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5d3fabe66e1bce1b30fb.js → cc7569489b572b8b3b53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{fddd4ea487788e003fb1.js → d09f06eb4157a7c2c8ab.js} +1 -1
  38. package/assets/esri/core/workers/chunks/d1be3ab7846e3a555b6c.js +1 -0
  39. package/assets/esri/core/workers/chunks/e064035f959d68e9603f.js +1 -0
  40. package/assets/esri/core/workers/chunks/{d92975e56a1290255252.js → e09df62cf35d636b0975.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{674fa5b93704ef08c9e8.js → e0c763e05feb1c2093ba.js} +1 -1
  42. package/assets/esri/core/workers/chunks/e20e99f8f76f5002437e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{51289d2f5277af4023e9.js → ed33e019bc7775db2e50.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ef95d6ab7b1c032ab4ad.js +1 -0
  45. package/assets/esri/core/workers/chunks/{48aa432e1bf60c68de14.js → f0c4b408a0b88adf6576.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{169f4354a375db5de121.js → ffcbcb928b6cb8c596ad.js} +1 -1
  47. package/assets/esri/t9n/common_ar.json +1 -1
  48. package/assets/esri/t9n/common_bg.json +1 -1
  49. package/assets/esri/t9n/common_bs.json +1 -1
  50. package/assets/esri/t9n/common_ca.json +1 -1
  51. package/assets/esri/t9n/common_cs.json +1 -1
  52. package/assets/esri/t9n/common_da.json +1 -1
  53. package/assets/esri/t9n/common_de.json +1 -1
  54. package/assets/esri/t9n/common_el.json +1 -1
  55. package/assets/esri/t9n/common_es.json +1 -1
  56. package/assets/esri/t9n/common_et.json +1 -1
  57. package/assets/esri/t9n/common_fi.json +1 -1
  58. package/assets/esri/t9n/common_fr.json +1 -1
  59. package/assets/esri/t9n/common_he.json +1 -1
  60. package/assets/esri/t9n/common_hr.json +1 -1
  61. package/assets/esri/t9n/common_hu.json +1 -1
  62. package/assets/esri/t9n/common_id.json +1 -1
  63. package/assets/esri/t9n/common_it.json +1 -1
  64. package/assets/esri/t9n/common_ja.json +1 -1
  65. package/assets/esri/t9n/common_ko.json +1 -1
  66. package/assets/esri/t9n/common_lt.json +1 -1
  67. package/assets/esri/t9n/common_lv.json +1 -1
  68. package/assets/esri/t9n/common_nb.json +1 -1
  69. package/assets/esri/t9n/common_nl.json +1 -1
  70. package/assets/esri/t9n/common_pl.json +1 -1
  71. package/assets/esri/t9n/common_pt-BR.json +1 -1
  72. package/assets/esri/t9n/common_pt-PT.json +1 -1
  73. package/assets/esri/t9n/common_ro.json +1 -1
  74. package/assets/esri/t9n/common_ru.json +1 -1
  75. package/assets/esri/t9n/common_sk.json +1 -1
  76. package/assets/esri/t9n/common_sl.json +1 -1
  77. package/assets/esri/t9n/common_sr.json +1 -1
  78. package/assets/esri/t9n/common_sv.json +1 -1
  79. package/assets/esri/t9n/common_th.json +1 -1
  80. package/assets/esri/t9n/common_tr.json +1 -1
  81. package/assets/esri/t9n/common_uk.json +1 -1
  82. package/assets/esri/t9n/common_vi.json +1 -1
  83. package/assets/esri/t9n/common_zh-CN.json +1 -1
  84. package/assets/esri/t9n/common_zh-HK.json +1 -1
  85. package/assets/esri/t9n/common_zh-TW.json +1 -1
  86. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -0
  87. package/assets/esri/themes/base/widgets/_Directions.scss +1 -2
  88. package/assets/esri/themes/dark/main.css +1 -1
  89. package/assets/esri/themes/light/main.css +1 -1
  90. package/assets/esri/themes/light/view.css +1 -1
  91. package/assets/esri/widgets/Feature/t9n/Feature_ar.json +1 -1
  92. package/assets/esri/widgets/Feature/t9n/Feature_bg.json +1 -1
  93. package/assets/esri/widgets/Feature/t9n/Feature_bs.json +1 -1
  94. package/assets/esri/widgets/Feature/t9n/Feature_ca.json +1 -1
  95. package/assets/esri/widgets/Feature/t9n/Feature_cs.json +1 -1
  96. package/assets/esri/widgets/Feature/t9n/Feature_da.json +1 -1
  97. package/assets/esri/widgets/Feature/t9n/Feature_de.json +1 -1
  98. package/assets/esri/widgets/Feature/t9n/Feature_el.json +1 -1
  99. package/assets/esri/widgets/Feature/t9n/Feature_es.json +1 -1
  100. package/assets/esri/widgets/Feature/t9n/Feature_et.json +1 -1
  101. package/assets/esri/widgets/Feature/t9n/Feature_fi.json +1 -1
  102. package/assets/esri/widgets/Feature/t9n/Feature_fr.json +1 -1
  103. package/assets/esri/widgets/Feature/t9n/Feature_he.json +1 -1
  104. package/assets/esri/widgets/Feature/t9n/Feature_hr.json +1 -1
  105. package/assets/esri/widgets/Feature/t9n/Feature_hu.json +1 -1
  106. package/assets/esri/widgets/Feature/t9n/Feature_id.json +1 -1
  107. package/assets/esri/widgets/Feature/t9n/Feature_it.json +1 -1
  108. package/assets/esri/widgets/Feature/t9n/Feature_ja.json +1 -1
  109. package/assets/esri/widgets/Feature/t9n/Feature_ko.json +1 -1
  110. package/assets/esri/widgets/Feature/t9n/Feature_lt.json +1 -1
  111. package/assets/esri/widgets/Feature/t9n/Feature_lv.json +1 -1
  112. package/assets/esri/widgets/Feature/t9n/Feature_nb.json +1 -1
  113. package/assets/esri/widgets/Feature/t9n/Feature_nl.json +1 -1
  114. package/assets/esri/widgets/Feature/t9n/Feature_pl.json +1 -1
  115. package/assets/esri/widgets/Feature/t9n/Feature_pt-BR.json +1 -1
  116. package/assets/esri/widgets/Feature/t9n/Feature_pt-PT.json +1 -1
  117. package/assets/esri/widgets/Feature/t9n/Feature_ro.json +1 -1
  118. package/assets/esri/widgets/Feature/t9n/Feature_ru.json +1 -1
  119. package/assets/esri/widgets/Feature/t9n/Feature_sk.json +1 -1
  120. package/assets/esri/widgets/Feature/t9n/Feature_sl.json +1 -1
  121. package/assets/esri/widgets/Feature/t9n/Feature_sr.json +1 -1
  122. package/assets/esri/widgets/Feature/t9n/Feature_sv.json +1 -1
  123. package/assets/esri/widgets/Feature/t9n/Feature_th.json +1 -1
  124. package/assets/esri/widgets/Feature/t9n/Feature_tr.json +1 -1
  125. package/assets/esri/widgets/Feature/t9n/Feature_uk.json +1 -1
  126. package/assets/esri/widgets/Feature/t9n/Feature_vi.json +1 -1
  127. package/assets/esri/widgets/Feature/t9n/Feature_zh-CN.json +1 -1
  128. package/assets/esri/widgets/Feature/t9n/Feature_zh-HK.json +1 -1
  129. package/assets/esri/widgets/Feature/t9n/Feature_zh-TW.json +1 -1
  130. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  131. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  132. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  133. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  134. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  135. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  136. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  137. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  138. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  139. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  140. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  141. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  142. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  143. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  144. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  145. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  146. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  147. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  148. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  149. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  150. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  151. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  152. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  153. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  154. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  155. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  156. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  157. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  158. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  159. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  160. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  161. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  162. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  163. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  164. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  165. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  166. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  169. package/assets/esri/widgets/Popup/t9n/Popup_ar.json +1 -1
  170. package/assets/esri/widgets/Popup/t9n/Popup_bg.json +1 -1
  171. package/assets/esri/widgets/Popup/t9n/Popup_bs.json +1 -1
  172. package/assets/esri/widgets/Popup/t9n/Popup_ca.json +1 -1
  173. package/assets/esri/widgets/Popup/t9n/Popup_cs.json +1 -1
  174. package/assets/esri/widgets/Popup/t9n/Popup_da.json +1 -1
  175. package/assets/esri/widgets/Popup/t9n/Popup_de.json +1 -1
  176. package/assets/esri/widgets/Popup/t9n/Popup_el.json +1 -1
  177. package/assets/esri/widgets/Popup/t9n/Popup_es.json +1 -1
  178. package/assets/esri/widgets/Popup/t9n/Popup_et.json +1 -1
  179. package/assets/esri/widgets/Popup/t9n/Popup_fi.json +1 -1
  180. package/assets/esri/widgets/Popup/t9n/Popup_fr.json +1 -1
  181. package/assets/esri/widgets/Popup/t9n/Popup_he.json +1 -1
  182. package/assets/esri/widgets/Popup/t9n/Popup_hr.json +1 -1
  183. package/assets/esri/widgets/Popup/t9n/Popup_hu.json +1 -1
  184. package/assets/esri/widgets/Popup/t9n/Popup_id.json +1 -1
  185. package/assets/esri/widgets/Popup/t9n/Popup_it.json +1 -1
  186. package/assets/esri/widgets/Popup/t9n/Popup_ja.json +1 -1
  187. package/assets/esri/widgets/Popup/t9n/Popup_ko.json +1 -1
  188. package/assets/esri/widgets/Popup/t9n/Popup_lt.json +1 -1
  189. package/assets/esri/widgets/Popup/t9n/Popup_lv.json +1 -1
  190. package/assets/esri/widgets/Popup/t9n/Popup_nb.json +1 -1
  191. package/assets/esri/widgets/Popup/t9n/Popup_nl.json +1 -1
  192. package/assets/esri/widgets/Popup/t9n/Popup_pl.json +1 -1
  193. package/assets/esri/widgets/Popup/t9n/Popup_pt-BR.json +1 -1
  194. package/assets/esri/widgets/Popup/t9n/Popup_pt-PT.json +1 -1
  195. package/assets/esri/widgets/Popup/t9n/Popup_ro.json +1 -1
  196. package/assets/esri/widgets/Popup/t9n/Popup_ru.json +1 -1
  197. package/assets/esri/widgets/Popup/t9n/Popup_sk.json +1 -1
  198. package/assets/esri/widgets/Popup/t9n/Popup_sl.json +1 -1
  199. package/assets/esri/widgets/Popup/t9n/Popup_sr.json +1 -1
  200. package/assets/esri/widgets/Popup/t9n/Popup_sv.json +1 -1
  201. package/assets/esri/widgets/Popup/t9n/Popup_th.json +1 -1
  202. package/assets/esri/widgets/Popup/t9n/Popup_tr.json +1 -1
  203. package/assets/esri/widgets/Popup/t9n/Popup_uk.json +1 -1
  204. package/assets/esri/widgets/Popup/t9n/Popup_vi.json +1 -1
  205. package/assets/esri/widgets/Popup/t9n/Popup_zh-CN.json +1 -1
  206. package/assets/esri/widgets/Popup/t9n/Popup_zh-HK.json +1 -1
  207. package/assets/esri/widgets/Popup/t9n/Popup_zh-TW.json +1 -1
  208. package/assets/esri/widgets/support/t9n/DatePicker_ar.json +1 -1
  209. package/assets/esri/widgets/support/t9n/DatePicker_bg.json +1 -1
  210. package/assets/esri/widgets/support/t9n/DatePicker_bs.json +1 -1
  211. package/assets/esri/widgets/support/t9n/DatePicker_ca.json +1 -1
  212. package/assets/esri/widgets/support/t9n/DatePicker_cs.json +1 -1
  213. package/assets/esri/widgets/support/t9n/DatePicker_da.json +1 -1
  214. package/assets/esri/widgets/support/t9n/DatePicker_de.json +1 -1
  215. package/assets/esri/widgets/support/t9n/DatePicker_el.json +1 -1
  216. package/assets/esri/widgets/support/t9n/DatePicker_es.json +1 -1
  217. package/assets/esri/widgets/support/t9n/DatePicker_et.json +1 -1
  218. package/assets/esri/widgets/support/t9n/DatePicker_fi.json +1 -1
  219. package/assets/esri/widgets/support/t9n/DatePicker_fr.json +1 -1
  220. package/assets/esri/widgets/support/t9n/DatePicker_he.json +1 -1
  221. package/assets/esri/widgets/support/t9n/DatePicker_hr.json +1 -1
  222. package/assets/esri/widgets/support/t9n/DatePicker_hu.json +1 -1
  223. package/assets/esri/widgets/support/t9n/DatePicker_id.json +1 -1
  224. package/assets/esri/widgets/support/t9n/DatePicker_it.json +1 -1
  225. package/assets/esri/widgets/support/t9n/DatePicker_ja.json +1 -1
  226. package/assets/esri/widgets/support/t9n/DatePicker_ko.json +1 -1
  227. package/assets/esri/widgets/support/t9n/DatePicker_lt.json +1 -1
  228. package/assets/esri/widgets/support/t9n/DatePicker_lv.json +1 -1
  229. package/assets/esri/widgets/support/t9n/DatePicker_nb.json +1 -1
  230. package/assets/esri/widgets/support/t9n/DatePicker_nl.json +1 -1
  231. package/assets/esri/widgets/support/t9n/DatePicker_pl.json +1 -1
  232. package/assets/esri/widgets/support/t9n/DatePicker_pt-BR.json +1 -1
  233. package/assets/esri/widgets/support/t9n/DatePicker_pt-PT.json +1 -1
  234. package/assets/esri/widgets/support/t9n/DatePicker_ro.json +1 -1
  235. package/assets/esri/widgets/support/t9n/DatePicker_ru.json +1 -1
  236. package/assets/esri/widgets/support/t9n/DatePicker_sk.json +1 -1
  237. package/assets/esri/widgets/support/t9n/DatePicker_sl.json +1 -1
  238. package/assets/esri/widgets/support/t9n/DatePicker_sr.json +1 -1
  239. package/assets/esri/widgets/support/t9n/DatePicker_sv.json +1 -1
  240. package/assets/esri/widgets/support/t9n/DatePicker_th.json +1 -1
  241. package/assets/esri/widgets/support/t9n/DatePicker_tr.json +1 -1
  242. package/assets/esri/widgets/support/t9n/DatePicker_uk.json +1 -1
  243. package/assets/esri/widgets/support/t9n/DatePicker_vi.json +1 -1
  244. package/assets/esri/widgets/support/t9n/DatePicker_zh-CN.json +1 -1
  245. package/assets/esri/widgets/support/t9n/DatePicker_zh-HK.json +1 -1
  246. package/assets/esri/widgets/support/t9n/DatePicker_zh-TW.json +1 -1
  247. package/assets/esri/widgets/support/t9n/TimePicker_ar.json +1 -1
  248. package/assets/esri/widgets/support/t9n/TimePicker_bg.json +1 -1
  249. package/assets/esri/widgets/support/t9n/TimePicker_bs.json +1 -1
  250. package/assets/esri/widgets/support/t9n/TimePicker_ca.json +1 -1
  251. package/assets/esri/widgets/support/t9n/TimePicker_cs.json +1 -1
  252. package/assets/esri/widgets/support/t9n/TimePicker_da.json +1 -1
  253. package/assets/esri/widgets/support/t9n/TimePicker_de.json +1 -1
  254. package/assets/esri/widgets/support/t9n/TimePicker_el.json +1 -1
  255. package/assets/esri/widgets/support/t9n/TimePicker_es.json +1 -1
  256. package/assets/esri/widgets/support/t9n/TimePicker_et.json +1 -1
  257. package/assets/esri/widgets/support/t9n/TimePicker_fi.json +1 -1
  258. package/assets/esri/widgets/support/t9n/TimePicker_fr.json +1 -1
  259. package/assets/esri/widgets/support/t9n/TimePicker_he.json +1 -1
  260. package/assets/esri/widgets/support/t9n/TimePicker_hr.json +1 -1
  261. package/assets/esri/widgets/support/t9n/TimePicker_hu.json +1 -1
  262. package/assets/esri/widgets/support/t9n/TimePicker_id.json +1 -1
  263. package/assets/esri/widgets/support/t9n/TimePicker_it.json +1 -1
  264. package/assets/esri/widgets/support/t9n/TimePicker_ja.json +1 -1
  265. package/assets/esri/widgets/support/t9n/TimePicker_ko.json +1 -1
  266. package/assets/esri/widgets/support/t9n/TimePicker_lt.json +1 -1
  267. package/assets/esri/widgets/support/t9n/TimePicker_lv.json +1 -1
  268. package/assets/esri/widgets/support/t9n/TimePicker_nb.json +1 -1
  269. package/assets/esri/widgets/support/t9n/TimePicker_nl.json +1 -1
  270. package/assets/esri/widgets/support/t9n/TimePicker_pl.json +1 -1
  271. package/assets/esri/widgets/support/t9n/TimePicker_pt-BR.json +1 -1
  272. package/assets/esri/widgets/support/t9n/TimePicker_pt-PT.json +1 -1
  273. package/assets/esri/widgets/support/t9n/TimePicker_ro.json +1 -1
  274. package/assets/esri/widgets/support/t9n/TimePicker_ru.json +1 -1
  275. package/assets/esri/widgets/support/t9n/TimePicker_sk.json +1 -1
  276. package/assets/esri/widgets/support/t9n/TimePicker_sl.json +1 -1
  277. package/assets/esri/widgets/support/t9n/TimePicker_sr.json +1 -1
  278. package/assets/esri/widgets/support/t9n/TimePicker_sv.json +1 -1
  279. package/assets/esri/widgets/support/t9n/TimePicker_th.json +1 -1
  280. package/assets/esri/widgets/support/t9n/TimePicker_tr.json +1 -1
  281. package/assets/esri/widgets/support/t9n/TimePicker_uk.json +1 -1
  282. package/assets/esri/widgets/support/t9n/TimePicker_vi.json +1 -1
  283. package/assets/esri/widgets/support/t9n/TimePicker_zh-CN.json +1 -1
  284. package/assets/esri/widgets/support/t9n/TimePicker_zh-HK.json +1 -1
  285. package/assets/esri/widgets/support/t9n/TimePicker_zh-TW.json +1 -1
  286. package/chunks/CheckerBoard.glsl.js +3 -3
  287. package/chunks/ColorMaterial.glsl.js +5 -5
  288. package/chunks/ComponentShader.glsl.js +1 -1
  289. package/chunks/Compositing.glsl.js +4 -19
  290. package/chunks/DefaultMaterial.glsl.js +2 -2
  291. package/chunks/HUDCompositing.glsl.js +7 -0
  292. package/chunks/HeatmapDensity.glsl.js +4 -4
  293. package/chunks/ImageMaterial.glsl.js +1 -1
  294. package/chunks/Laserlines.glsl.js +5 -5
  295. package/chunks/LineMarker.glsl.js +1 -1
  296. package/chunks/MeasurementArrow.glsl.js +3 -3
  297. package/chunks/NativeLine.glsl.js +1 -1
  298. package/chunks/OITCompositing.glsl.js +13 -0
  299. package/chunks/OverlayCompositing.glsl.js +8 -0
  300. package/chunks/Path.glsl.js +3 -3
  301. package/chunks/Pattern.glsl.js +1 -1
  302. package/chunks/Precipitation.glsl.js +3 -3
  303. package/chunks/RealisticTree.glsl.js +2 -2
  304. package/chunks/RibbonLine.glsl.js +25 -25
  305. package/chunks/ShadedColorMaterial.glsl.js +1 -1
  306. package/chunks/ShadowHighlight.glsl.js +1 -1
  307. package/chunks/SlicePlaneMaterial.glsl.js +2 -2
  308. package/chunks/Terrain.glsl.js +4 -4
  309. package/chunks/WaterSurface.glsl.js +1 -1
  310. package/chunks/ar.js +1 -1
  311. package/chunks/bg_BG.js +1 -1
  312. package/chunks/boundedPlane.js +1 -1
  313. package/chunks/bs_BA.js +1 -1
  314. package/chunks/ca_ES.js +1 -1
  315. package/chunks/cameraUtilsPlanar.js +1 -1
  316. package/chunks/cameraUtilsSpherical.js +1 -1
  317. package/chunks/cs_CZ.js +1 -1
  318. package/chunks/da_DK.js +1 -1
  319. package/chunks/de_CH.js +1 -1
  320. package/chunks/de_DE.js +1 -1
  321. package/chunks/el_GR.js +1 -1
  322. package/chunks/en_CA.js +1 -1
  323. package/chunks/en_US.js +1 -1
  324. package/chunks/es_ES.js +1 -1
  325. package/chunks/et_EE.js +1 -1
  326. package/chunks/fi_FI.js +1 -1
  327. package/chunks/fr_FR.js +1 -1
  328. package/chunks/he_IL.js +1 -1
  329. package/chunks/hr_HR.js +1 -1
  330. package/chunks/hu_HU.js +1 -1
  331. package/chunks/id_ID.js +1 -1
  332. package/chunks/index.js +1 -1
  333. package/chunks/it_IT.js +1 -1
  334. package/chunks/ja_JP.js +1 -1
  335. package/chunks/ko_KR.js +1 -1
  336. package/chunks/lt_LT.js +1 -1
  337. package/chunks/lv_LV.js +1 -1
  338. package/chunks/mat3.js +1 -1
  339. package/chunks/nb_NO.js +1 -1
  340. package/chunks/nl_NL.js +1 -1
  341. package/chunks/pl_PL.js +1 -1
  342. package/chunks/pt_BR.js +1 -1
  343. package/chunks/pt_PT.js +1 -1
  344. package/chunks/quat.js +1 -1
  345. package/chunks/quat2.js +1 -1
  346. package/chunks/quatf64.js +1 -1
  347. package/chunks/ro_RO.js +1 -1
  348. package/chunks/ru_RU.js +1 -1
  349. package/chunks/sk_SK.js +1 -1
  350. package/chunks/sl_SL.js +1 -1
  351. package/chunks/sphere.js +1 -1
  352. package/chunks/sr_RS.js +1 -1
  353. package/chunks/sv_SE.js +1 -1
  354. package/chunks/th_TH.js +1 -1
  355. package/chunks/tr_TR.js +1 -1
  356. package/chunks/uk_UA.js +1 -1
  357. package/chunks/vec3.js +1 -1
  358. package/chunks/vec3f32.js +1 -1
  359. package/chunks/vec4f64.js +1 -1
  360. package/chunks/vi_VN.js +1 -1
  361. package/chunks/zh_Hans.js +1 -1
  362. package/chunks/zh_Hant.js +1 -1
  363. package/core/VectorStack.js +1 -1
  364. package/core/libs/gl-matrix-2/factories/quatf64.js +1 -1
  365. package/core/libs/gl-matrix-2/factories/vec3f32.js +1 -1
  366. package/core/libs/gl-matrix-2/factories/vec4f64.js +1 -1
  367. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  368. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  369. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  370. package/core/perspectiveUtils.js +1 -1
  371. package/core/workers/workerFactory.js +1 -1
  372. package/geohash/GeohashTree.js +1 -1
  373. package/geometry/support/MeshTransform.js +1 -1
  374. package/geometry/support/axisAngle.js +1 -1
  375. package/geometry/support/axisAngleDegrees.js +1 -1
  376. package/geometry/support/lineSegment.js +1 -1
  377. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  378. package/geometry/support/meshUtils/exporters/gltf/node.js +1 -1
  379. package/geometry/support/meshUtils/georeference.js +1 -1
  380. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  381. package/geometry/support/meshUtils/projection.js +1 -1
  382. package/geometry/support/meshUtils/rotate.js +1 -1
  383. package/geometry/support/plane.js +1 -1
  384. package/interfaces.d.ts +70 -0
  385. package/layers/VoxelWasmPerSceneView.js +1 -1
  386. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  387. package/layers/graphics/featureConversionUtils.js +1 -1
  388. package/layers/mixins/EditBusLayer.js +1 -1
  389. package/layers/mixins/OperationalLayer.js +1 -1
  390. package/layers/support/AggregateField.js +1 -1
  391. package/layers/support/ControlPointsGeoreference.js +1 -1
  392. package/layers/support/ExportImageServiceParameters.js +1 -1
  393. package/layers/support/OutStatistic.js +1 -1
  394. package/layers/support/VoxelVolume.js +1 -1
  395. package/layers/support/voxelPlaneUtils.js +1 -1
  396. package/package.json +1 -1
  397. package/rest/support/AggregateFeatureSet.js +5 -0
  398. package/support/revision.js +1 -1
  399. package/views/2d/ViewState.js +1 -1
  400. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  401. package/views/2d/engine/imagery/RasterVFTile.js +1 -1
  402. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  403. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  404. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  405. package/views/2d/engine/webgl/WGLTile.js +1 -1
  406. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  407. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  408. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  409. package/views/2d/layers/LayerView2D.js +1 -1
  410. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  411. package/views/2d/layers/features/schemaUtils.js +1 -1
  412. package/views/2d/layers/features/support/BinStore.js +1 -1
  413. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  414. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  415. package/views/2d/layers/imagery/ImageryView2D.js +1 -1
  416. package/views/2d/layers/support/DebugOverlay.js +1 -1
  417. package/views/2d/layers/support/ExportStrategy.js +1 -1
  418. package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
  419. package/views/2d/layers/support/clusterUtils.js +1 -1
  420. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  421. package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
  422. package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
  423. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  424. package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
  425. package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
  426. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  427. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  428. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  429. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  430. package/views/3d/camera/constraintUtils/distance.js +1 -1
  431. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  432. package/views/3d/environment/CloudsComposition.js +1 -1
  433. package/views/3d/environment/CloudsCompositionParameters.js +1 -1
  434. package/views/3d/environment/CloudsGenerator.js +1 -1
  435. package/views/3d/environment/CloudsPresets.js +1 -1
  436. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  437. package/views/3d/environment/Fog.js +1 -1
  438. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  439. package/views/3d/environment/Precipitation.js +1 -1
  440. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  441. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  442. package/views/3d/environment/weatherUtils.js +1 -1
  443. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  444. package/views/3d/externalRenderers/RenderContext.js +1 -1
  445. package/views/3d/glTF/internal/Resource.js +1 -1
  446. package/views/3d/interactive/Manipulator3D.js +1 -1
  447. package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
  448. package/views/3d/interactive/editingTools/settings.js +1 -1
  449. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  450. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  451. package/views/3d/interactive/manipulatorUtils.js +1 -1
  452. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  453. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  454. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  455. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  456. package/views/3d/layers/I3SMeshView3D.js +1 -1
  457. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  458. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  459. package/views/3d/layers/PointCloudWorker.js +1 -1
  460. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  461. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  462. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  463. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  464. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  465. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  466. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  467. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  468. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  469. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  470. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  471. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  472. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  473. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  474. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  475. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  476. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  477. package/views/3d/layers/support/I3STreeDebugger.js +1 -1
  478. package/views/3d/layers/support/edgeUtils.js +1 -1
  479. package/views/3d/layers/support/uvUtils.js +1 -1
  480. package/views/3d/state/Frustum.js +1 -1
  481. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  482. package/views/3d/state/controllers/RotateController.js +1 -1
  483. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  484. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  485. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  486. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  487. package/views/3d/state/utils/navigationUtils.js +1 -1
  488. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  489. package/views/3d/support/orientedBoundingBox.js +1 -1
  490. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  491. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  492. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  493. package/views/3d/support/sunUtils.js +1 -1
  494. package/views/3d/terrain/OverlayManager.js +1 -1
  495. package/views/3d/terrain/OverlayRenderer.js +1 -1
  496. package/views/3d/terrain/PatchRenderData.js +1 -1
  497. package/views/3d/terrain/TerrainRenderer.js +1 -1
  498. package/views/3d/terrain/TerrainSurface.js +1 -1
  499. package/views/3d/terrain/Tile.js +1 -1
  500. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  501. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  502. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  503. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  504. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  505. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  506. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  507. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +6 -6
  508. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
  509. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  510. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +1 -1
  511. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +9 -9
  512. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  513. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
  514. package/views/3d/webgl-engine/core/util/TwoVectorPosition.js +1 -1
  515. package/views/3d/webgl-engine/lib/AnimationTimer.js +1 -1
  516. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  517. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  518. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  519. package/views/3d/webgl-engine/lib/GeometryRecord.js +1 -1
  520. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  521. package/views/3d/webgl-engine/lib/Highlight.js +1 -1
  522. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  523. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  524. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  525. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  526. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  527. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  528. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  529. package/views/3d/webgl-engine/lib/Update.js +5 -0
  530. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  531. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  532. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  533. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  534. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  535. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  536. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  537. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  538. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  539. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  540. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  541. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  542. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  543. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  544. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  545. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  546. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  547. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  548. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  549. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  550. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  551. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  552. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +5 -0
  553. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +5 -0
  554. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +5 -0
  555. package/views/3d/webgl-engine/shaders/OITCompositingTechnique.js +5 -0
  556. package/views/3d/webgl-engine/shaders/OverlayCompositing.glsl.js +5 -0
  557. package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +5 -0
  558. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  559. package/views/SceneView.js +1 -1
  560. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  561. package/views/interactive/coordinateHelper.js +1 -1
  562. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  563. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  564. package/views/interactive/snapping/LineSnapper.js +1 -1
  565. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  566. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  567. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  568. package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
  569. package/views/interactive/snapping/SnappingManager.js +1 -1
  570. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  571. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  572. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  573. package/views/interactive/snapping/featureSources/SnappingCandidateElevationAligner.js +1 -1
  574. package/views/interactive/snapping/featureSources/SnappingResultElevationFilter.js +1 -1
  575. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  576. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  577. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  578. package/views/interactive/snapping/featureSources/snappingResultElevationUtils.js +5 -0
  579. package/views/interactive/snapping/snappingUtils.js +1 -1
  580. package/views/layers/FeatureLayerView.js +1 -1
  581. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  582. package/views/support/Scheduler.js +1 -1
  583. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  584. package/views/support/geometry3dUtils.js +1 -1
  585. package/widgets/Directions/support/resources.js +1 -1
  586. package/widgets/Directions.js +1 -1
  587. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  588. package/widgets/ElevationProfile/support/constants.js +1 -1
  589. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  590. package/widgets/Feature/FeatureRelationship.js +1 -1
  591. package/widgets/Legend/LegendViewModel.js +1 -1
  592. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  593. package/widgets/Weather/LabeledSlider.js +1 -1
  594. package/widgets/Weather.js +1 -1
  595. package/assets/esri/core/workers/chunks/0059699bf824f851d51c.js +0 -1
  596. package/assets/esri/core/workers/chunks/01a6005569d0820992a0.js +0 -1
  597. package/assets/esri/core/workers/chunks/2eb547a0be305f2c816c.js +0 -1
  598. package/assets/esri/core/workers/chunks/36dd5654df5c7f00406d.js +0 -1
  599. package/assets/esri/core/workers/chunks/36e0a0d5f86b2b4b88f9.js +0 -1
  600. package/assets/esri/core/workers/chunks/8b8a813f5e6d6551a816.js +0 -1
  601. package/assets/esri/core/workers/chunks/bf84189bd9bf3de81df9.js +0 -1
  602. package/assets/esri/core/workers/chunks/cd7f5c3d328166f28f59.js +0 -1
  603. package/assets/esri/core/workers/chunks/de128d8a643b4297940b.js +0 -1
  604. package/assets/esri/core/workers/chunks/e208d9c34f5db4481441.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{eachAlwaysValues as t}from"../../../../core/promiseUtils.js";import{isDataProtocol as r,dataComponents as s,dataToArrayBuffer as n,makeAbsolute as o}from"../../../../core/urlUtils.js";import{Version as a}from"../../../../core/Version.js";import{y as i,m as u,v as c,e as f,k as d}from"../../../../chunks/mat4.js";import{c as p,b as m}from"../../../../chunks/mat4f64.js";import{g as l}from"../../../../chunks/quat.js";import{a as h}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as y,BufferViewUint16 as T,BufferViewUint8 as b,BufferViewVec3f as _,BufferViewVec4f as x,BufferViewVec2f as w,BufferViewVec4u8 as O,BufferViewVec4u16 as N,BufferViewVec3u8 as S,BufferViewVec3u16 as g,BufferViewVec2u32 as C,BufferViewVec2u16 as U,BufferViewVec2i16 as I,BufferViewVec2u8 as L,BufferViewVec2i8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{m as E}from"../../../../chunks/scalar.js";import{BinaryStreamReader as R}from"./BinaryStreamReader.js";import{AttributeType as B}from"./enums.js";import{material as v,textureSampler as D}from"./fillDefaults.js";import{splitURI as G}from"./pathUtils.js";import{DataType as j}from"../../../webgl/enums.js";const M={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class F{constructor(e,t,r,s,n){this._context=e,this._errorContext=t,this.uri=r,this.json=s,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=G(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==s.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==s.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==s.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,o,a){if(r(o)){const r=s(o);if(r&&"model/gltf-binary"!==r.mediaType)try{const s=JSON.parse(r.isBase64?atob(r.data):r.data);return new F(e,t,o,s)}catch{}const a=n(o);if(F._isGLBData(a))return this._fromGLBData(e,t,o,a)}if(o.endsWith(".gltf")){const r=await e.loadJSON(o,a);return new F(e,t,o,r)}const i=await e.loadBinary(o,a);if(F._isGLBData(i))return this._fromGLBData(e,t,o,i);const u=await e.loadJSON(o,a);return new F(e,t,o,u)}static _isGLBData(e){if(null==e)return!1;const t=new R(e);return t.remainingBytes()>=4&&t.readUint32()===M.MAGIC}static async _fromGLBData(e,t,r,s){const n=await F._parseGLBData(t,s);return new F(e,t,r,n.json,n.binaryData)}static async _parseGLBData(e,t){const r=new R(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const s=r.readUint32(),n=r.readUint32(),o=r.readUint32();e.assert(s===M.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=o,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==n,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),s=r.readUint32();0===u?(e.assert(s===M.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await K(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(s!==M.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],s=this._errorContext;if(null==r.uri)return s.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const n=await this._getBufferLoader(e,t);return s.assert(n.byteLength===r.byteLength,"Buffer byte lengths should match."),n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const s=this.json.accessors[e];r.errorUnsupportedIf(null==s?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(s.type in[B.MAT2,B.MAT3,B.MAT4],`AttributeType ${s.type} is not supported`);const n=this.json.bufferViews[s.bufferView],o=await this.getBuffer(n.buffer,t),a=V[s.type],i=Y[s.componentType],u=a*i,c=n.byteStride||u;return{raw:o.buffer,byteStride:c,byteOffset:o.byteOffset+(n.byteOffset||0)+(s.byteOffset||0),entryCount:s.count,isDenselyPacked:c===u,componentCount:a,componentByteSize:i,componentType:s.componentType,min:s.min,max:s.max,normalized:!!s.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case j.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case j.UNSIGNED_BYTE:return E(this._wrapAccessor(b,r));case j.UNSIGNED_SHORT:return E(this._wrapAccessor(T,r));case j.UNSIGNED_INT:return E(this._wrapAccessor(y,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const s=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const s=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const s=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(4!==s.componentCount,"TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed()),new x(s.raw,s.byteOffset,s.byteStride,s.byteOffset+s.byteStride*s.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const s=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==s.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed()),s.componentType===j.FLOAT?this._wrapAccessor(w,s):(r.errorUnsupportedIf(!s.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),J(s))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const s=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==s.componentCount&&3!==s.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed()),4===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(x,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(O,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(N,s)}else if(3===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(_,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(S,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(g,s)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+z[s.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=null!=e.material?v(this.json.materials[e.material]):v(),o=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(o.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),c=r?this.getTexture(n.occlusionTexture,t):void 0,f=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(o.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:o.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:p,occlusionTexture:await c,emissiveTexture:await f,emissiveFactor:n.emissiveFactor,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:o?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:o?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return s}async getTexture(t,r){if(!t)return;this._errorContext.errorUnsupportedIf(0!==(t.texCoord||0),"Only TEXCOORD with index 0 is supported.");const s=t.index,n=this._errorContext,o=this.json.textures[s],a=D(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const i=this.json.images[o.source],u=await this._loadTextureImageData(s,o,r);return e(this._textureCache,s,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:u,wrapS:e(a.wrapS)?a.wrapS:t(a.wrapS),wrapT:e(a.wrapT)?a.wrapT:t(a.wrapT),minFilter:a.minFilter,name:i.name,id:s}}))}getNodeTransform(e){if(void 0===e)return H;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?t=u(p(),r,s.matrix):s.translation||s.rotation||s.scale?(t=m(r),s.translation&&c(t,t,s.translation),s.rotation&&(k[3]=l(k,s.rotation),f(t,t,k[3],k)),s.scale&&d(t,t,s.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return o(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=a.parse(this.json.asset.version,"glTF");P.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const s=this._errorContext;s.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),s.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t);return s.errorUnsupportedIf(null!=n.byteStride,"byteStride not supported for image buffer"),q(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength),r.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await t(Array.from(this._bufferLoaders.values())),r=await t(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+r.reduce(((e,t)=>e+(t?t.width*t.height*4:0)),0)}}const P=new a(2,0,"glTF"),H=i(p(),Math.PI/2),k=h(),V={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},Y={[j.BYTE]:1,[j.UNSIGNED_BYTE]:1,[j.SHORT]:2,[j.UNSIGNED_SHORT]:2,[j.FLOAT]:4,[j.UNSIGNED_INT]:4};function J(e){switch(e.componentType){case j.BYTE:return new A(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_BYTE:return new L(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_SHORT:return new U(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_INT:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.FLOAT:return new w(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}async function K(e){return new Promise(((t,r)=>{const s=new Blob([e]),n=new FileReader;n.onload=()=>{const e=n.result;t(JSON.parse(e))},n.onerror=e=>{r(e)},n.readAsText(s)}))}async function q(e,t){return new Promise(((r,s)=>{const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),a=new Image,i=()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))).then(c):(r(a),c())},u=e=>{URL.revokeObjectURL(o),s(e),c()},c=()=>{a.removeEventListener("load",i),a.removeEventListener("error",u)};a.addEventListener("load",i),a.addEventListener("error",u),a.src=o}))}const z={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};export{F as Resource};
5
+ import{getOrCreateMapValue as e}from"../../../../core/MapUtils.js";import{eachAlwaysValues as t}from"../../../../core/promiseUtils.js";import{isDataProtocol as r,dataComponents as s,dataToArrayBuffer as n,makeAbsolute as o}from"../../../../core/urlUtils.js";import{Version as a}from"../../../../core/Version.js";import{y as i,m as u,v as c,e as f,k as d}from"../../../../chunks/mat4.js";import{c as p,b as m}from"../../../../chunks/mat4f64.js";import{g as l}from"../../../../chunks/quat.js";import{c as h}from"../../../../chunks/quatf64.js";import{BufferViewUint32 as y,BufferViewUint16 as T,BufferViewUint8 as b,BufferViewVec3f as _,BufferViewVec4f as x,BufferViewVec2f as w,BufferViewVec4u8 as O,BufferViewVec4u16 as N,BufferViewVec3u8 as S,BufferViewVec3u16 as g,BufferViewVec2u32 as C,BufferViewVec2u16 as U,BufferViewVec2i16 as I,BufferViewVec2u8 as L,BufferViewVec2i8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{m as E}from"../../../../chunks/scalar.js";import{BinaryStreamReader as R}from"./BinaryStreamReader.js";import{AttributeType as B}from"./enums.js";import{material as v,textureSampler as D}from"./fillDefaults.js";import{splitURI as G}from"./pathUtils.js";import{DataType as j}from"../../../webgl/enums.js";const M={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class F{constructor(e,t,r,s,n){this._context=e,this._errorContext=t,this.uri=r,this.json=s,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=G(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(null==s.scenes,"Scenes must be defined."),t.errorUnsupportedIf(null==s.meshes,"Meshes must be defined"),t.errorUnsupportedIf(null==s.nodes,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,o,a){if(r(o)){const r=s(o);if(r&&"model/gltf-binary"!==r.mediaType)try{const s=JSON.parse(r.isBase64?atob(r.data):r.data);return new F(e,t,o,s)}catch{}const a=n(o);if(F._isGLBData(a))return this._fromGLBData(e,t,o,a)}if(o.endsWith(".gltf")){const r=await e.loadJSON(o,a);return new F(e,t,o,r)}const i=await e.loadBinary(o,a);if(F._isGLBData(i))return this._fromGLBData(e,t,o,i);const u=await e.loadJSON(o,a);return new F(e,t,o,u)}static _isGLBData(e){if(null==e)return!1;const t=new R(e);return t.remainingBytes()>=4&&t.readUint32()===M.MAGIC}static async _fromGLBData(e,t,r,s){const n=await F._parseGLBData(t,s);return new F(e,t,r,n.json,n.binaryData)}static async _parseGLBData(e,t){const r=new R(t);e.assert(r.remainingBytes()>=12,"GLB binary data is insufficiently large.");const s=r.readUint32(),n=r.readUint32(),o=r.readUint32();e.assert(s===M.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=o,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(2!==n,"An unsupported GLB container version was detected. Only version 2 is supported.");let a,i,u=0;for(;r.remainingBytes()>=8;){const t=r.readUint32(),s=r.readUint32();0===u?(e.assert(s===M.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(t>=0,"No JSON data found."),a=await K(r.readUint8Array(t))):1===u?(e.errorUnsupportedIf(s!==M.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=r.readUint8Array(t)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return a||e.error("No GLB JSON chunk detected."),{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e],s=this._errorContext;if(null==r.uri)return s.assert(null!=this._glbBuffer,"GLB buffer not present"),this._glbBuffer;const n=await this._getBufferLoader(e,t);return s.assert(n.byteLength===r.byteLength,"Buffer byte lengths should match."),n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){const r=this._errorContext;r.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const s=this.json.accessors[e];r.errorUnsupportedIf(null==s?.bufferView,"Some accessor does not specify a bufferView."),r.errorUnsupportedIf(s.type in[B.MAT2,B.MAT3,B.MAT4],`AttributeType ${s.type} is not supported`);const n=this.json.bufferViews[s.bufferView],o=await this.getBuffer(n.buffer,t),a=V[s.type],i=Y[s.componentType],u=a*i,c=n.byteStride||u;return{raw:o.buffer,byteStride:c,byteOffset:o.byteOffset+(n.byteOffset||0)+(s.byteOffset||0),entryCount:s.count,isDenselyPacked:c===u,componentCount:a,componentByteSize:i,componentType:s.componentType,min:s.min,max:s.max,normalized:!!s.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case j.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case j.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case j.UNSIGNED_BYTE:return E(this._wrapAccessor(b,r));case j.UNSIGNED_SHORT:return E(this._wrapAccessor(T,r));case j.UNSIGNED_INT:return E(this._wrapAccessor(y,r))}}async getPositionData(e,t){const r=this._errorContext;r.errorUnsupportedIf(null==e.attributes.POSITION,"No POSITION vertex data found.");const s=await this.getAccessor(e.attributes.POSITION,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getNormalData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.NORMAL,"No NORMAL vertex data found.");const s=await this.getAccessor(e.attributes.NORMAL,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(3!==s.componentCount,"NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed()),this._wrapAccessor(_,s)}async getTangentData(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TANGENT,"No TANGENT vertex data found.");const s=await this.getAccessor(e.attributes.TANGENT,t);return r.errorUnsupportedIf(s.componentType!==j.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+z[s.componentType]),r.errorUnsupportedIf(4!==s.componentCount,"TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed()),new x(s.raw,s.byteOffset,s.byteStride,s.byteOffset+s.byteStride*s.entryCount)}async getTextureCoordinates(e,t){const r=this._errorContext;r.assert(null!=e.attributes.TEXCOORD_0,"No TEXCOORD_0 vertex data found.");const s=await this.getAccessor(e.attributes.TEXCOORD_0,t);return r.errorUnsupportedIf(2!==s.componentCount,"TEXCOORD_0 vertex attribute must have 2 components, but found "+s.componentCount.toFixed()),s.componentType===j.FLOAT?this._wrapAccessor(w,s):(r.errorUnsupportedIf(!s.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),J(s))}async getVertexColors(e,t){const r=this._errorContext;r.assert(null!=e.attributes.COLOR_0,"No COLOR_0 vertex data found.");const s=await this.getAccessor(e.attributes.COLOR_0,t);if(r.errorUnsupportedIf(4!==s.componentCount&&3!==s.componentCount,"COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed()),4===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(x,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(O,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(N,s)}else if(3===s.componentCount){if(s.componentType===j.FLOAT)return this._wrapAccessor(_,s);if(s.componentType===j.UNSIGNED_BYTE)return this._wrapAccessor(S,s);if(s.componentType===j.UNSIGNED_SHORT)return this._wrapAccessor(g,s)}r.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+z[s.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=null!=e.material?v(this.json.materials[e.material]):v(),o=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(o.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),c=r?this.getTexture(n.occlusionTexture,t):void 0,f=r?this.getTexture(n.emissiveTexture,t):void 0,d=r?this.getTexture(o.metallicRoughnessTexture,t):void 0,p=null!=e.material?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:o.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:p,occlusionTexture:await c,emissiveTexture:await f,emissiveFactor:n.emissiveFactor,metallicFactor:o.metallicFactor,roughnessFactor:o.roughnessFactor,metallicRoughnessTexture:await d,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:o?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:o?.metallicRoughnessTexture?.extensions?.KHR_texture_transform}}return s}async getTexture(t,r){if(!t)return;this._errorContext.errorUnsupportedIf(0!==(t.texCoord||0),"Only TEXCOORD with index 0 is supported.");const s=t.index,n=this._errorContext,o=this.json.textures[s],a=D(null!=o.sampler?this.json.samplers[o.sampler]:{});n.errorUnsupportedIf(null==o.source,"Source is expected to be defined for a texture.");const i=this.json.images[o.source],u=await this._loadTextureImageData(s,o,r);return e(this._textureCache,s,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>(n.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),10497);return{data:u,wrapS:e(a.wrapS)?a.wrapS:t(a.wrapS),wrapT:e(a.wrapT)?a.wrapT:t(a.wrapT),minFilter:a.minFilter,name:i.name,id:s}}))}getNodeTransform(e){if(void 0===e)return H;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?t=u(p(),r,s.matrix):s.translation||s.rotation||s.scale?(t=m(r),s.translation&&c(t,t,s.translation),s.rotation&&(k[3]=l(k,s.rotation),f(t,t,k[3],k)),s.scale&&d(t,t,s.scale)):t=r,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return o(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=a.parse(this.json.asset.version,"glTF");P.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&0!==e.extensionsRequired.length&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=this.json.images[e.source];if(r.uri)return this._context.loadImage(this._resolveUri(r.uri),t);const s=this._errorContext;s.errorUnsupportedIf(null==r.bufferView,"Image bufferView must be defined."),s.errorUnsupportedIf(null==r.mimeType,"Image mimeType must be defined.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t);return s.errorUnsupportedIf(null!=n.byteStride,"byteStride not supported for image buffer"),q(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength),r.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await t(Array.from(this._bufferLoaders.values())),r=await t(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+r.reduce(((e,t)=>e+(t?t.width*t.height*4:0)),0)}}const P=new a(2,0,"glTF"),H=i(p(),Math.PI/2),k=h(),V={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},Y={[j.BYTE]:1,[j.UNSIGNED_BYTE]:1,[j.SHORT]:2,[j.UNSIGNED_SHORT]:2,[j.FLOAT]:4,[j.UNSIGNED_INT]:4};function J(e){switch(e.componentType){case j.BYTE:return new A(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_BYTE:return new L(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.SHORT:return new I(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_SHORT:return new U(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.UNSIGNED_INT:return new C(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case j.FLOAT:return new w(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}async function K(e){return new Promise(((t,r)=>{const s=new Blob([e]),n=new FileReader;n.onload=()=>{const e=n.result;t(JSON.parse(e))},n.onerror=e=>{r(e)},n.readAsText(s)}))}async function q(e,t){return new Promise(((r,s)=>{const n=new Blob([e],{type:t}),o=URL.createObjectURL(n),a=new Image,i=()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then((()=>r(a)),(()=>r(a))).then(c):(r(a),c())},u=e=>{URL.revokeObjectURL(o),s(e),c()},c=()=>{a.removeEventListener("load",i),a.removeEventListener("error",u)};a.addEventListener("load",i),a.addEventListener("error",u),a.src=o}))}const z={5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5125:"UNSIGNED_INT",5126:"FLOAT"};export{F as Resource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{isSome as s,isNone as o,unwrapOr as n,unwrap as r}from"../../../core/maybe.js";import{createScreenPointArray as a,createRenderScreenPointArray3 as c,screenPointObjectToArray as l,castRenderScreenPointArray as h}from"../../../core/screenUtils.js";import{once as d}from"../../../core/accessorSupport/utils.js";import{f as _}from"../../../chunks/mat3.js";import{c as u}from"../../../chunks/mat3f64.js";import{c as g,s as m,m as f,i as p}from"../../../chunks/mat4.js";import{c as b}from"../../../chunks/mat4f64.js";import{k as v}from"../../../chunks/vec2.js";import{a as y,t as j,m as L,g as S,c as R,d as w,s as O,b as T}from"../../../chunks/vec3.js";import{c as A,Z as E}from"../../../chunks/vec3f64.js";import{canProjectWithoutEngine as D,projectPoint as F,sphericalPCPFtoLonLatElevation as k,computeENUToSphericalPCPFLocalRotation as z}from"../../../geometry/projection.js";import{getReferenceEllipsoid as I}from"../../../geometry/projectionEllipsoid.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as M,distance2 as C,fromPoints as x,closestRayDistance2 as B}from"../../../geometry/support/lineSegment.js";import{create as W,fromPositionAndNormal as U,intersectRay as V}from"../../../geometry/support/plane.js";import{create as N}from"../../../geometry/support/ray.js";import{sv3d as G}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as Y}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as Z}from"../support/ElevationProvider.js";import{fromScreen as q}from"../support/geometryUtils/ray.js";import{UpdatePolicy as J}from"../webgl-engine/lib/basicInterfaces.js";import{Camera as K}from"../webgl-engine/lib/Camera.js";import{Object3D as Q}from"../webgl-engine/lib/Object3D.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as $,ManipulatorStateFlags as ee}from"../../interactive/interfaces.js";import te from"../../../geometry/Point.js";class ie{constructor(e){this._camera=new K,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=b(),this._worldFrame=null,this._renderLocation=A(),this._renderLocationDirty=!0,this._location=new te({x:0,y:0,z:0}),this._elevationAlignedLocation=new te,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=$.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:a(),renderScreenPointArray:c(),pixelSize:0},this._screenLocationDirty=!0,this._applyObjectTransform=null,this._engineResourcesAddedToStage=!1,this._engineResources=null,this._attached=!1,this._engineLayer=null,this._materialIdReferences=null,this._location.spatialReference=e.view.spatialReference;for(const t in e)this[t]=e[t];this.view.state&&this.view.state.camera&&this._camera.copyFrom(this.view.state.camera)}destroy(){this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),{remove:d((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){se(e)&&(this._screenLocationDirty=!0),g(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=b()),oe(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y;const e=s(this._elevation.override)?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=Y(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(se(this._modelTransform)){const t=this._calculateModelTransformOffset(pe);e=y(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=l(t,ne),n=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(v(this.screenLocation.screenPointArray,s)<n*n)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,he),a=n*this.screenLocation.pixelSize,c=q(this._camera,s,ae);if(o(c))return null;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],i);for(let t=1;t<s.length;t++){const o=L(ue,s[t],i),n=B(x(e,o,re),c);if(null!=n&&n<a*a){const t=y(G.get(),e,o);S(t,t,.5);const i=h(G.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}R(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??E,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this.screenLocation.pixelSize,l=q(this._camera,s,ae);if(o(l))return null;const h=_(ce,a),d=j(me,e,h),u=L(fe,t,a);U(u,d,de);const g=ge;if(V(de,l,g)&&w(g,u)<c*c)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),l=q(this._camera,s,ae);if(o(l))return null;const d=_(ce,a),u=j(me,t,d),g=this._calculateModelTransformPosition(fe);U(g,u,de);const m=ge;if(!V(de,l,m))break;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],a);for(let t=1;t<s.length;t++){const i=L(ue,s[t],a),o=C(x(e,i,re),m);if(null!=o&&o<c*c){const t=y(G.get(),e,i);S(t,t,.5);const s=h(G.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}R(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){if(!this.view._stage)return;const t=e.manipulator3D;if(o(t.engineLayerId)){const e=new X({isPickable:!1,updatePolicy:J.SYNC});this.view._stage.add(e),t.engineLayerId=e.id,this._engineLayer=e}else this.view._stage?.getObject&&(this._engineLayer=this.view._stage.getObject(t.engineLayerId));t.engineLayerReferences=(t.engineLayerReferences||0)+1,this._materialIdReferences=t.materialIdReferences,o(this._materialIdReferences)&&(this._materialIdReferences=new Map,t.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),D(this._location.spatialReference,this.view.spatialReference)||(this.location=new te({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;i&&(t.engineLayerId=null),this._removeResourcesFromStage(i),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){F(this.location,be,e.spatialReference),P(e.extent,be)&&(this.location=this._location)}_evaluateElevationAlignment(e=this.location){if(o(this.elevationInfo))return!1;let t=null,i=0;const s=n(this.elevationInfo.offset,0);switch(this.elevationInfo.mode){case"on-the-ground":t=n(Z(this.view.elevationProvider,e,"ground"),0);break;case"relative-to-ground":i=n(Z(this.view.elevationProvider,e,"ground"),0)+s;break;case"relative-to-scene":i=n(Z(this.view.elevationProvider,e,"scene"),0)+s;break;case"absolute-height":i=s}return(i!==this._elevation.offset||t!==this._elevation.override)&&(this._elevation.offset=i,this._elevation.override=t,!0)}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=he;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?ee.Focused:ee.Unfocused)|(this.selected?ee.Selected:ee.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.setVisible(!1);continue}const e=(n&ee.All)!==ee.None,i=(n&$.All)!==$.None,a=!e||(s&n)==(n&ee.All),c=!i||(this.state&n)==(n&$.All);if(a&&c)for(const s of r)s.setVisible(!0),s.transformation=t;else for(const t of r)t.setVisible(!1)}}_ensureEngineResources(){if(o(this._engineResources)){const e=r(this._engineLayer),t=[],i=new Set;this.renderObjects.forEach((({material:e})=>{i.has(e)||(t.push(e),i.add(e))}));const s=(e,t)=>{const{geometry:i,material:s,transform:o}=t;Array.isArray(i)?i.forEach((t=>e.addGeometry(t,s,o))):e.addGeometry(i,s,o)},o=new Map;this._renderObjects.forEach((e=>{const t=new Q({castShadow:!1});s(t,e);const i=e.stateMask||0,n=o.get(i)||[];n.push(t),o.set(i,n)}));const n=[];o.forEach(((e,t)=>n.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){if(this._engineResourcesAddedToStage||o(this._engineResources))return;const{objectsByState:e,layer:t,materials:i}=this._engineResources;i.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id)||0;0===i&&this.view._stage.add(e),t.set(e.id,i+1)})),e.forEach((({objects:e})=>{t.addMany(e),this.view._stage.addMany(e)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(e=!1){if(!this._engineResourcesAddedToStage||o(this._engineResources)||!this.view._stage)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:e})=>{i.removeMany(e),this.view._stage.removeMany(e)})),s.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id);1===i?(this.view._stage.remove(e),t.delete(e.id)):t.set(e.id,i-1)})),e&&this.view._stage.remove(i),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,le);return O(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return T(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return m(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&f(t,t,this._worldFrame),f(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,s(this._applyObjectTransform)&&this._applyObjectTransform(t),t}get test(){let e=!1;if(s(this._engineResources))for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.isVisible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function se(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function oe(e,t,s){switch(e.viewingMode){case"local":return p(s),!0;case"global":{const o=I(e.renderCoordsHelper.spatialReference);return k(t,0,_e,0,o.radius),z(i(_e[0]),i(_e[1]),s),!0}}}const ne=a(),re=M(),ae=N(),ce=u(),le=b(),he=b(),de=W(),_e=A(),ue=A(),ge=A(),me=A(),fe=A(),pe=A(),be=new te({x:0,y:0,z:0,spatialReference:null});export{ie as Manipulator3D};
5
+ import"../../../geometry.js";import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{isSome as s,isNone as o,unwrapOr as n,unwrap as r}from"../../../core/maybe.js";import{createScreenPointArray as a,createRenderScreenPointArray3 as c,screenPointObjectToArray as l,castRenderScreenPointArray as h}from"../../../core/screenUtils.js";import{once as d}from"../../../core/accessorSupport/utils.js";import{f as _}from"../../../chunks/mat3.js";import{c as u}from"../../../chunks/mat3f64.js";import{c as g,s as m,m as f,i as p}from"../../../chunks/mat4.js";import{c as b}from"../../../chunks/mat4f64.js";import{k as v}from"../../../chunks/vec2.js";import{a as y,t as j,v as L,g as S,c as R,d as w,s as O,b as T}from"../../../chunks/vec3.js";import{c as A,Z as E}from"../../../chunks/vec3f64.js";import{canProjectWithoutEngine as D,projectPoint as F,sphericalPCPFtoLonLatElevation as k,computeENUToSphericalPCPFLocalRotation as z}from"../../../geometry/projection.js";import{getReferenceEllipsoid as I}from"../../../geometry/projectionEllipsoid.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as M,distance2 as C,fromPoints as x,closestRayDistance2 as B}from"../../../geometry/support/lineSegment.js";import{create as W,fromPositionAndNormal as U,intersectRay as V}from"../../../geometry/support/plane.js";import{create as N}from"../../../geometry/support/ray.js";import{sv3d as G}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as Y}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationAtPoint as Z}from"../support/ElevationProvider.js";import{fromScreen as q}from"../support/geometryUtils/ray.js";import{UpdatePolicy as J}from"../webgl-engine/lib/basicInterfaces.js";import{Camera as K}from"../webgl-engine/lib/Camera.js";import{Object3D as Q}from"../webgl-engine/lib/Object3D.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as $,ManipulatorStateFlags as ee}from"../../interactive/interfaces.js";import te from"../../../geometry/Point.js";class ie{constructor(e){this._camera=new K,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=b(),this._worldFrame=null,this._renderLocation=A(),this._renderLocationDirty=!0,this._location=new te({x:0,y:0,z:0}),this._elevationAlignedLocation=new te,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.cursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=$.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:a(),renderScreenPointArray:c(),pixelSize:0},this._screenLocationDirty=!0,this._applyObjectTransform=null,this._engineResourcesAddedToStage=!1,this._engineResources=null,this._attached=!1,this._engineLayer=null,this._materialIdReferences=null,this._location.spatialReference=e.view.spatialReference;for(const t in e)this[t]=e[t];this.view.state&&this.view.state.camera&&this._camera.copyFrom(this.view.state.camera)}destroy(){this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),{remove:d((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){se(e)&&(this._screenLocationDirty=!0),g(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=b()),oe(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y;const e=s(this._elevation.override)?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=Y(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(se(this._modelTransform)){const t=this._calculateModelTransformOffset(pe);e=y(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=l(t,ne),n=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(v(this.screenLocation.screenPointArray,s)<n*n)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,he),a=n*this.screenLocation.pixelSize,c=q(this._camera,s,ae);if(o(c))return null;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],i);for(let t=1;t<s.length;t++){const o=L(ue,s[t],i),n=B(x(e,o,re),c);if(null!=n&&n<a*a){const t=y(G.get(),e,o);S(t,t,.5);const i=h(G.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}R(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??E,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this.screenLocation.pixelSize,l=q(this._camera,s,ae);if(o(l))return null;const h=_(ce,a),d=j(me,e,h),u=L(fe,t,a);U(u,d,de);const g=ge;if(V(de,l,g)&&w(g,u)<c*c)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),a=this._calculateObjectTransform(i,he),c=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),l=q(this._camera,s,ae);if(o(l))return null;const d=_(ce,a),u=j(me,t,d),g=this._calculateModelTransformPosition(fe);U(g,u,de);const m=ge;if(!V(de,l,m))break;for(const s of e){if(0===s.length)continue;const e=L(_e,s[0],a);for(let t=1;t<s.length;t++){const i=L(ue,s[t],a),o=C(x(e,i,re),m);if(null!=o&&o<c*c){const t=y(G.get(),e,i);S(t,t,.5);const s=h(G.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}R(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){if(!this.view._stage)return;const t=e.manipulator3D;if(o(t.engineLayerId)){const e=new X({isPickable:!1,updatePolicy:J.SYNC});this.view._stage.add(e),t.engineLayerId=e.id,this._engineLayer=e}else this.view._stage?.getObject&&(this._engineLayer=this.view._stage.getObject(t.engineLayerId));t.engineLayerReferences=(t.engineLayerReferences||0)+1,this._materialIdReferences=t.materialIdReferences,o(this._materialIdReferences)&&(this._materialIdReferences=new Map,t.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),D(this._location.spatialReference,this.view.spatialReference)||(this.location=new te({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;i&&(t.engineLayerId=null),this._removeResourcesFromStage(i),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){F(this.location,be,e.spatialReference),P(e.extent,be)&&(this.location=this._location)}_evaluateElevationAlignment(e=this.location){if(o(this.elevationInfo))return!1;let t=null,i=0;const s=n(this.elevationInfo.offset,0);switch(this.elevationInfo.mode){case"on-the-ground":t=n(Z(this.view.elevationProvider,e,"ground"),0);break;case"relative-to-ground":i=n(Z(this.view.elevationProvider,e,"ground"),0)+s;break;case"relative-to-scene":i=n(Z(this.view.elevationProvider,e,"scene"),0)+s;break;case"absolute-height":i=s}return(i!==this._elevation.offset||t!==this._elevation.override)&&(this._elevation.offset=i,this._elevation.override=t,!0)}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=he;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?ee.Focused:ee.Unfocused)|(this.selected?ee.Selected:ee.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.setVisible(!1);continue}const e=(n&ee.All)!==ee.None,i=(n&$.All)!==$.None,a=!e||(s&n)==(n&ee.All),c=!i||(this.state&n)==(n&$.All);if(a&&c)for(const s of r)s.setVisible(!0),s.transformation=t;else for(const t of r)t.setVisible(!1)}}_ensureEngineResources(){if(o(this._engineResources)){const e=r(this._engineLayer),t=[],i=new Set;this.renderObjects.forEach((({material:e})=>{i.has(e)||(t.push(e),i.add(e))}));const s=(e,t)=>{const{geometry:i,material:s,transform:o}=t;Array.isArray(i)?i.forEach((t=>e.addGeometry(t,s,o))):e.addGeometry(i,s,o)},o=new Map;this._renderObjects.forEach((e=>{const t=new Q({castShadow:!1});s(t,e);const i=e.stateMask||0,n=o.get(i)||[];n.push(t),o.set(i,n)}));const n=[];o.forEach(((e,t)=>n.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:n,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){if(this._engineResourcesAddedToStage||o(this._engineResources))return;const{objectsByState:e,layer:t,materials:i}=this._engineResources;i.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id)||0;0===i&&this.view._stage.add(e),t.set(e.id,i+1)})),e.forEach((({objects:e})=>{t.addMany(e),this.view._stage.addMany(e)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(e=!1){if(!this._engineResourcesAddedToStage||o(this._engineResources)||!this.view._stage)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:e})=>{i.removeMany(e),this.view._stage.removeMany(e)})),s.forEach((e=>{const t=r(this._materialIdReferences),i=t.get(e.id);1===i?(this.view._stage.remove(e),t.delete(e.id)):t.set(e.id,i-1)})),e&&this.view._stage.remove(i),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,le);return O(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return T(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return m(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&f(t,t,this._worldFrame),f(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,s(this._applyObjectTransform)&&this._applyObjectTransform(t),t}get test(){let e=!1;if(s(this._engineResources))for(const t in this._engineResources.objectsByState){const i=this._engineResources.objectsByState[t];for(const t of i.objects)if(t.isVisible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function se(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function oe(e,t,s){switch(e.viewingMode){case"local":return p(s),!0;case"global":{const o=I(e.renderCoordsHelper.spatialReference);return k(t,0,_e,0,o.radius),z(i(_e[0]),i(_e[1]),s),!0}}}const ne=a(),re=M(),ae=N(),ce=u(),le=b(),he=b(),de=W(),_e=A(),ue=A(),ge=A(),me=A(),fe=A(),pe=A(),be=new te({x:0,y:0,z:0,spatialReference:null});export{ie as Manipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isNone as e,isSome as r}from"../../../../../core/maybe.js";import{createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{f as n}from"../../../../../chunks/mat4f64.js";import{f as t,r as s,p as c,b as i}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{normal as f,fromPositionAndNormal as p,create as m}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{PlaneType as a,OffsetEdgeVertex as l}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function j(e,r,o){const n="on-the-ground"===o.mode?a.XY:a.XYZ;return new l(e,n,r,0)}function h(r,o,n){const s=d();if(!r.renderCoordsHelper.toRenderCoords(o,s))return null;const c=y(r,o,f(n.plane)),i=y(r,o,n.edgeDirection);if(e(c)||e(i))return null;const u=t(d(),c,i);return p(s,u,m())}function y(e,r,o){const n=u(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),t=d(),c=d();return e.renderCoordsHelper.toRenderCoords(r,t)&&e.renderCoordsHelper.toRenderCoords(n,c)?s(c,t,c):null}function C(e,r,o){const c=f(e),i=s(d(),r,o),p=t(d(),i,c),m=t(d(),i,p);return n(i[0],i[1],i[2],0,p[0],p[1],p[2],0,m[0],m[1],m[2],0,0,0,0,1)}function R(e,n,t){const s=t.projectToRenderScreen(e,o()),d=t.projectToRenderScreen(n,o());return r(s)&&r(d)?c(i(s,s,d)):0}export{h as createEdgeOffsetIntersectionPlane,j as createEdgeOffsetOperation,C as edgeOffsetRotationMatrix,R as screenEdgeLengthSquared};
5
+ import{isNone as e,isSome as r}from"../../../../../core/maybe.js";import{createRenderScreenPointArray3 as o}from"../../../../../core/screenUtils.js";import{f as n}from"../../../../../chunks/mat4f64.js";import{f as t,A as s,z as c,b as i}from"../../../../../chunks/vec3.js";import{c as d}from"../../../../../chunks/vec3f64.js";import{normal as f,fromPositionAndNormal as m,create as p}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as u}from"../../../../../layers/graphics/dehydratedFeatures.js";import{PlaneType as a,OffsetEdgeVertex as l}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function j(e,r,o){const n="on-the-ground"===o.mode?a.XY:a.XYZ;return new l(e,n,r,0)}function h(r,o,n){const s=d();if(!r.renderCoordsHelper.toRenderCoords(o,s))return null;const c=y(r,o,f(n.plane)),i=y(r,o,n.edgeDirection);if(e(c)||e(i))return null;const u=t(d(),c,i);return m(s,u,p())}function y(e,r,o){const n=u(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),t=d(),c=d();return e.renderCoordsHelper.toRenderCoords(r,t)&&e.renderCoordsHelper.toRenderCoords(n,c)?s(c,t,c):null}function C(e,r,o){const c=f(e),i=s(d(),r,o),m=t(d(),i,c),p=t(d(),i,m);return n(i[0],i[1],i[2],0,m[0],m[1],m[2],0,p[0],p[1],p[2],0,0,0,0,1)}function R(e,n,t){const s=t.projectToRenderScreen(e,o()),d=t.projectToRenderScreen(n,o());return r(s)&&r(d)?c(i(s,s,d)):0}export{h as createEdgeOffsetIntersectionPlane,j as createEdgeOffsetOperation,C as edgeOffsetRotationMatrix,R as screenEdgeLengthSquared};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../Color.js";import{toHSV as e,toRGB as i}from"../../../../core/colorUtils.js";import{b as l}from"../../../../chunks/vec4f64.js";import{ExtensionType as o}from"../visualElements/ExtendedLineVisualElement.js";import{RenderOccludedFlag as s}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as n}from"../../webgl-engine/materials/lineStippleUtils.js";const r={main:new t([255,127,0]),selected:new t([255,255,255]),staged:new t([12,207,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255])},h=.3;function c(t,e){const i=t.clone();return i.a*=e,i}function a(t,l){const o=t.clone(),s=e(o);s.s*=l;const n=i(s);return o.r=n.r,o.g=n.g,o.b=n.b,o}function d(t,e){if(e)for(const i in e)t[i]=e[i]}class u{constructor(t){this.color=r.main,this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=s.Opaque,d(this,t)}}class p{constructor(t){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=r.main,this.outlineColor=r.outline,this.renderOccluded=s.Opaque,this.hoverOutlineColor=r.selectedOutline,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:"color"!==t||i.a<1,renderOccluded:this.renderOccluded})}}class g{constructor(t){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.color=c(r.main,.5),this.hoverColor=r.main,this.renderOccluded=s.Transparent,this.minSquaredEdgeLength=900,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:i.a<1,renderOccluded:this.renderOccluded})}}class f{constructor(t){this.vertex=new p({color:r.main,outlineColor:r.outline}),this.edge=new p({color:a(c(r.main,2/3),.5),outlineColor:c(r.outline,.5),size:8,collisionPadding:8}),this.selected=new p({color:r.selected,outlineColor:r.outline}),this.edgeOffset=new g,d(this,t)}}class w{constructor(t){this.color=r.selected,this.width=1.5,this.stipplePattern=n(5),this.stippleOffColor=r.outline,this.falloff=0,this.innerWidth=1.5,this.innerColor=r.selected,this.renderOccluded=s.OccludeAndTransparent,d(this,t)}apply(t){t.color=P(this.color),t.width=this.width,t.stipplePattern=this.stipplePattern,t.stippleOffColor=P(this.stippleOffColor),t.falloff=this.falloff,t.innerWidth=this.innerWidth,t.innerColor=P(this.innerColor),t.renderOccluded=this.renderOccluded}}class C{constructor(t){this.color=r.selected,this.size=4,this.outlineSize=1,this.outlineColor=r.outline,this.shape="square",d(this,t)}apply(t){t.color=P(this.color),t.size=this.size,t.outlineSize=this.outlineSize,t.outlineColor=P(this.outlineColor),t.primitive=this.shape}}class m{constructor(t){this.innerColor=r.selected,this.innerWidth=1,this.glowColor=r.main,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=h,this.globalAlphaContrastBoost=1.5,this.radius=3,this.heightFillColor=r.main,d(this,t)}apply(e,i=1){const l={glowColor:t.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:t.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*i,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=l:e.laserlineStyle=l}}class O{constructor(t){this.outline=new w({color:r.outline,renderOccluded:s.OccludeAndTransparentStencil,stippleOffColor:r.selected,stipplePattern:n(5),width:1.5,innerWidth:0}),this.staged=new w({color:r.selected,renderOccluded:s.OccludeAndTransparentStencil,innerColor:r.staged,stippleOffColor:r.outline,stipplePattern:n(5),width:1.5}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),d(this,t)}}class A{constructor(t){this.outline=new C({color:r.selected,outlineColor:r.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:1.5,glowWidth:6,innerColor:r.selected,innerWidth:1,radius:2}),d(this,t)}}class W extends w{constructor(t){super(),this.extensionType=o.GROUND_RAY,d(this,t)}}class b{constructor(t){this.lineGraphics=new O,this.pointGraphics=new A,this.heightPlane=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),this.heightBox=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:0,heightFillColor:r.main}),this.zVerticalLine=new W({color:c(r.main,5*h/3),falloff:2,innerColor:c(r.selected,0),renderOccluded:s.OccludeAndTransparent,stipplePattern:null,width:5,extensionType:o.GROUND_RAY}),this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,d(this,t)}}class z{constructor(t){this.visualElements=new b,this.reshapeManipulators=new f,this.zManipulator=new u,d(this,t)}colorToVec4(t){return P(t)}}function P(e){return l(t.toUnitRGBA(e))}const y=new z;export{p as VertexManipulatorStyle,r as colors,y as settings};
5
+ import t from"../../../../Color.js";import{toHSV as e,toRGB as i}from"../../../../core/colorUtils.js";import{a as l}from"../../../../chunks/vec4f64.js";import{ExtensionType as o}from"../visualElements/ExtendedLineVisualElement.js";import{RenderOccludedFlag as s}from"../../webgl-engine/lib/Material.js";import{createStipplePatternSimple as n}from"../../webgl-engine/materials/lineStippleUtils.js";const r={main:new t([255,127,0]),selected:new t([255,255,255]),staged:new t([12,207,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255])},h=.3;function c(t,e){const i=t.clone();return i.a*=e,i}function a(t,l){const o=t.clone(),s=e(o);s.s*=l;const n=i(s);return o.r=n.r,o.g=n.g,o.b=n.b,o}function d(t,e){if(e)for(const i in e)t[i]=e[i]}class u{constructor(t){this.color=r.main,this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=s.Opaque,d(this,t)}}class p{constructor(t){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=r.main,this.outlineColor=r.outline,this.renderOccluded=s.Opaque,this.hoverOutlineColor=r.selectedOutline,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:"color"!==t||i.a<1,renderOccluded:this.renderOccluded})}}class g{constructor(t){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.color=c(r.main,.5),this.hoverColor=r.main,this.renderOccluded=s.Transparent,this.minSquaredEdgeLength=900,d(this,t)}apply(t,e){const i=this[t];e.setParameters({color:P(i),transparent:i.a<1,renderOccluded:this.renderOccluded})}}class f{constructor(t){this.vertex=new p({color:r.main,outlineColor:r.outline}),this.edge=new p({color:a(c(r.main,2/3),.5),outlineColor:c(r.outline,.5),size:8,collisionPadding:8}),this.selected=new p({color:r.selected,outlineColor:r.outline}),this.edgeOffset=new g,d(this,t)}}class w{constructor(t){this.color=r.selected,this.width=1.5,this.stipplePattern=n(5),this.stippleOffColor=r.outline,this.falloff=0,this.innerWidth=1.5,this.innerColor=r.selected,this.renderOccluded=s.OccludeAndTransparent,d(this,t)}apply(t){t.color=P(this.color),t.width=this.width,t.stipplePattern=this.stipplePattern,t.stippleOffColor=P(this.stippleOffColor),t.falloff=this.falloff,t.innerWidth=this.innerWidth,t.innerColor=P(this.innerColor),t.renderOccluded=this.renderOccluded}}class C{constructor(t){this.color=r.selected,this.size=4,this.outlineSize=1,this.outlineColor=r.outline,this.shape="square",d(this,t)}apply(t){t.color=P(this.color),t.size=this.size,t.outlineSize=this.outlineSize,t.outlineColor=P(this.outlineColor),t.primitive=this.shape}}class m{constructor(t){this.innerColor=r.selected,this.innerWidth=1,this.glowColor=r.main,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=h,this.globalAlphaContrastBoost=1.5,this.radius=3,this.heightFillColor=r.main,d(this,t)}apply(e,i=1){const l={glowColor:t.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:t.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*i,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=l:e.laserlineStyle=l}}class O{constructor(t){this.outline=new w({color:r.outline,renderOccluded:s.OccludeAndTransparentStencil,stippleOffColor:r.selected,stipplePattern:n(5),width:1.5,innerWidth:0}),this.staged=new w({color:r.selected,renderOccluded:s.OccludeAndTransparentStencil,innerColor:r.staged,stippleOffColor:r.outline,stipplePattern:n(5),width:1.5}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),d(this,t)}}class A{constructor(t){this.outline=new C({color:r.selected,outlineColor:r.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new m({globalAlpha:h,glowColor:r.main,glowFalloff:1.5,glowWidth:6,innerColor:r.selected,innerWidth:1,radius:2}),d(this,t)}}class W extends w{constructor(t){super(),this.extensionType=o.GROUND_RAY,d(this,t)}}class b{constructor(t){this.lineGraphics=new O,this.pointGraphics=new A,this.heightPlane=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:1}),this.heightBox=new m({globalAlpha:h,glowColor:r.main,glowFalloff:8,glowWidth:8,innerColor:r.selected,innerWidth:0,heightFillColor:r.main}),this.zVerticalLine=new W({color:c(r.main,5*h/3),falloff:2,innerColor:c(r.selected,0),renderOccluded:s.OccludeAndTransparent,stipplePattern:null,width:5,extensionType:o.GROUND_RAY}),this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,d(this,t)}}class z{constructor(t){this.visualElements=new b,this.reshapeManipulators=new f,this.zManipulator=new u,d(this,t)}colorToVec4(t){return P(t)}}function P(e){return l(t.toUnitRGBA(e))}const y=new z;export{p as VertexManipulatorStyle,r as colors,y as settings};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as o,unwrapOr as r,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{createLength as l}from"../../../../../core/quantityUtils.js";import{watch as h,initial as c}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as d}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as u,getMetersPerUnitForSR as m}from"../../../../../core/unitUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../../../core/accessorSupport/decorators/subclass.js";import{o as v}from"../../../../../chunks/mat4.js";import{s as y,a as f,f as S}from"../../../../../chunks/vec2.js";import{a as M}from"../../../../../chunks/vec2f64.js";import{c as b,z as T,b as E,n as x,l as B,e as A}from"../../../../../chunks/vec3.js";import{c as O,a as R}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{a as G,c as D}from"../../../../../chunks/boundedPlane.js";import{intersectRay as w,create as z,normal as P}from"../../../../../geometry/support/plane.js";import{create as I}from"../../../../../geometry/support/ray.js";import{sv2d as U,sv3d as Z,sm4d as C}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as k}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as X,OffsetMode as Y,IsShiftEdgeOnScreenFlag as L,createResizeManipulator as N,resizeNormal as V,resizeOutlineOnly as H,isDiagonalResizeHandle as F,calculateDiagonalResizeHandleScale as q,createRotatePlane as W,RotationAxis as J,calculateBoundedPlaneTranslateRotate as K,updateRotateHeadingHandle as Q,updateResizeHandle as $}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as tt}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as et}from"../../Manipulator3D.js";import{createRotateManipulator as it,getGraphicAttachmentOrigin as at,calculateInputRotationTransform as st}from"../../manipulatorUtils.js";import{screenToZConstrained as ot,screenToRenderPlane as rt}from"../dragEventPipeline3D.js";import{ManipulatorType as nt}from"../ManipulatorType.js";import{canMoveZ as pt}from"../manipulatorUtils.js";import{createVisualElements as lt}from"../visualElementUtils.js";import{ManipulationType as ht}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as ct}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as dt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ut}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as mt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as _t}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as gt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as vt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as yt,addMapDelta as ft,addScreenDelta as St}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as bt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as Tt}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Et}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{mapPlaneAutoHorizontalSizeByElevationMode as xt,calculateOrientedBounds as Bt,mapPlaneToRenderPlane as At,apply as Ot,unapply as Rt}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import jt from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Gt,ExtentScaleTooltipInfo as Dt}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as wt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as zt,TranslateGraphicZTooltipInfo as Pt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as It}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistance as Ut}from"../../../../support/euclideanLengthMeasurementUtils.js";let Zt=class extends(e.EventedMixin(Mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new jt,this._preserveAspectRatio=new dt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this._handles=new i,this._moveZManipulator=null,this._resizeManipulators=null,this._rotateManipulator=null,this._attachmentOrigin=null,this._outlineVisualElement=null,this._mapBounds=G(),this._mapBoundsStart=G(),this._zmax=0,this._sizeStart=null,this._displayBounds=G(),this._displayBoundsStart=G(),this._displayBoundsMarginStart=0,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=M(),this._endScale=M()}initialize(){const{view:t,graphic:e,manipulators:i,_handles:s}=this,r=this._graphicState=new gt({graphic:e}),n=e.geometry;this._editGeometryOperations=bt.fromGeometry(n,t.state.viewingMode),this._graphicMoveManipulation=new ct({tool:this,view:t,graphicState:r}),this._moveZManipulator=X(t,Y.CENTER_ON_CALLOUT),this._moveZManipulator.state|=L,s.add([this._createMoveXYGraphicDragPipeline(),h((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this._moveZManipulator,nt.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this._moveZManipulator),this._resizeManipulators=this._resizeHandles.map((e=>{const i=N(t,e);return s.add([h((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,nt.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this._resizeManipulators),this._rotateManipulatorTexture=tt(t.toolViewManager.textures),this._rotateManipulator=it(t,this._rotateManipulatorTexture.texture),s.add([h((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this._rotateManipulator,nt.ROTATE))),this._rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this._rotateManipulator)]),i.add(this._rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const p=lt({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});o(p)&&(this._outlineVisualElement=p.visualElement instanceof ut?p.visualElement:null),o(this._outlineVisualElement)&&s.add(this._outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(p),s.add([r.on("changed",(()=>this._onGeometryChanged())),h((()=>r.displaying),(()=>this._updateAllManipulatorAvailability())),h((()=>r.isDraped),(()=>this._graphicDrapedChanged()),c),t.trackGraphicState(r)]);const l=t.pointsOfInterest;l&&s.add(h((()=>l.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const u=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===nt.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(u),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._mapBounds=null,this._displayBounds=null,this._rotateManipulatorTexture.release(),this._handles.destroy(),this._graphicMoveManipulation.destroy(),this._editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{_handles:t,view:e}=this,i=this._tooltip=new wt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",(()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._tooltip.clear()})),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{y(this._startScale,t.xScale,t.yScale),y(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{y(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{y(this._startScale,0,0),y(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",(t=>{"cancel"===t.action?this._tooltip.clear():a()}))])}))}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this._graphicMoveManipulation.grabbing||this._graphicMoveManipulation.dragging?this._computeMoveXYTooltipInfo():this._moveZManipulator.focused?this._computeMoveZTooltipInfo():this._rotateManipulator.focused?this._computeRotateTooltipInfo():this._resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null:null}_computeMoveXYTooltipInfo(){return this._moveXYTooltipInfo=r(this._moveXYTooltipInfo,(()=>new zt({tooltipOptions:this.tooltipOptions})))}_computeMoveZTooltipInfo(){const t=this._moveZTooltipInfo=r(this._moveZTooltipInfo,(()=>new Pt({tooltipOptions:this.tooltipOptions}))),e=this._moveUnit;if(this._moveZManipulator.dragging){const e=this._mapBoundsStart.origin,i=this._mapBounds.origin,a=Ut(e,i,this.view.spatialReference);if(n(a))return null;t.distance=a}else t.distance=l(0,e);return t}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo=r(this._rotateTooltipInfo,(()=>new Gt({tooltipOptions:this.tooltipOptions})));return t.angle=this._startAngle-this._endAngle,t}_computeScaleTooltipInfo(){const t=this.graphic.geometry;if(n(t))return null;const e=this._scaleTooltipInfo=r(this._scaleTooltipInfo,(()=>new Dt({tooltipOptions:this.tooltipOptions}))),i=xt(this._mapBounds,this._zmax,t.spatialReference,this._graphicState.isDraped);return n(i)?null:(e.xSize=i[0],e.ySize=i[1],o(this._sizeStart)&&this._resizeManipulators.some((t=>t.dragging))?(e.xScale=i[0].value/this._sizeStart[0].value,e.yScale=i[1].value/this._sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_graphicDrapedChanged(){this._handles.remove(Ct),this._updateDisplayBounds(),this._graphicState.isDraped&&this._handles.add(this.view.elevationProvider.on("elevation-change",(t=>{o(this._attachmentOrigin)&&j(t.extent,this._attachmentOrigin.x,this._attachmentOrigin.y)&&this._updateDisplayBounds()})),Ct)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof et){const a=this._graphicState.displaying,s=this.enableZ&&pt(this.graphic);switch(e){case nt.ROTATE:t.available=a&&this.enableRotation;break;case nt.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?V:H;break;case nt.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this._graphicMoveManipulation.forEachManipulator(t),this._resizeManipulators.forEach((e=>t(e,nt.SCALE))),t(this._rotateManipulator,nt.ROTATE),t(this._moveZManipulator,nt.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return r(u(this.view.spatialReference),"meters")}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this._editGeometryOperations.data,i=e.components[0].edges[0],a=f(U.get(),i.leftVertex.pos,i.rightVertex.pos);S(a,a);const s=r(at(this.view,this.graphic),(()=>t.extent.center));let o=Xt*this.view.pixelSizeAt(s);const n=this.view.spatialReference,p=t.spatialReference;n.equals(p)||(o*=m(n)/m(p)),Bt(a,e,o,this._mapBounds),this._updateZMax()}_updateZMax(){const t=this._editGeometryOperations.data;if(!t.geometry.hasZ)return void(this._zmax=0);const e=t.coordinateHelper;let i=Number.NEGATIVE_INFINITY;for(const a of t.components)for(const t of a.vertices){const a=e.getZ(t.pos);i=Math.max(a,i)}this._zmax=i}_updateDisplayBounds(){const t=this.graphic.geometry;if(n(t))return;const e=o(this._outlineVisualElement)&&!this._graphicState.isDraped&&o(this._outlineVisualElement.attachmentOrigin)?this._outlineVisualElement.attachmentOrigin:at(this.view,this.graphic);this._attachmentOrigin=r(e,t.extent.center);const i=o(e)?e.z:mt(this._mapBounds.origin,this.view.elevationProvider,_t.fromElevationInfo(k(this.graphic)),this.view.renderCoordsHelper),a=D(this._mapBounds);a.origin[2]=i,At(a,this.view.renderCoordsHelper,t.spatialReference,this._displayBoundsMargin,this._displayBounds),this._updateManipulators()}get _displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this._editGeometryOperations.data.geometry.extent.center;return kt*this.view.pixelSizeAt(e)}_createMoveXYGraphicDragPipeline(){return this._graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,ht.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this._editGeometryOperations.data.spatialReference;return yt(this._moveZManipulator,((i,a,s)=>{const o=R(i.renderLocation),r=a.next(ot(t,o,e)).next(St());this._applyGraphicMoveSteps(r,s,ht.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},this._updateOperationStartProperties(),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(ft()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{o(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_updateOperationStartProperties(){D(this._displayBounds,this._displayBoundsStart),D(this._mapBounds,this._mapBoundsStart),n(this.graphic.geometry)?this._sizeStart=null:this._sizeStart=xt(this._mapBoundsStart,this._zmax,this.graphic.geometry.spatialReference,this._graphicState.isDraped)}_moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this._editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,a=this._editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Ot(a,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===ht.XY||e===ht.XY_AXIS){const e=It(t.mapStart,t.mapEnd,this._graphicState.isDraped?"on-the-ground":"absolute-height");o(e)&&o(this._moveXYTooltipInfo)&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab(t){if("start"!==t.action)return;const e=this._calculatePickRay(t.screenPoint);w(this._displayBounds.plane,e,Z.get())&&(this._updateOperationStartProperties(),this._displayBoundsMarginStart=this._displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return yt(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(rt(this.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{o(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this._displayBoundsStart,i=t.handle.direction,a=this._displayBoundsMargin,s=this._displayBoundsMarginStart,o=b(Z.get(),e.origin);T(o,o,e.basis1,-i[0]),T(o,o,e.basis2,-i[1]);const r=E(Z.get(),t.renderEnd,o),n=E(Z.get(),t.renderStart,o),p=F(t.handle),l=q(e),h=q(this._displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=B(e),o=.5*t*A(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*A(e,n)/i)*l*h}const c=i<1.5*s?1:Yt;return i=Math.max(i-s,Yt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=b(O(),this._mapBoundsStart.origin);T(e,e,this._mapBoundsStart.basis1,-t.handle.direction[0]),T(e,e,this._mapBoundsStart.basis2,-t.handle.direction[1]);const i=y(M(),this._mapBoundsStart.basis1[0],this._mapBoundsStart.basis1[1]);S(i,i);const a=[];for(const r of this._editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,o=this._editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Et.REPLACE);return D(this._mapBoundsStart,this._mapBounds),Ot(o,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_onRotateGrab(t){if("start"!==t.action)return;const e=W(this._displayBounds,this.view.renderCoordsHelper,J.HEADING,z()),i=this._calculatePickRay(t.screenPoint);w(e,i,Z.get())&&(this._updateOperationStartProperties(),this.inputState={type:"rotate",rotatePlane:e})}_createRotateDragPipeline(t){return yt(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(rt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{o(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=P(t.rotatePlane),a=st(e.renderStart,e.renderEnd,this._displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=b(O(),this._mapBoundsStart.origin),i=[];for(const o of this._editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,s=this._editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Et.REPLACE);return D(this._mapBoundsStart,this._mapBounds),Ot(s,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=I(),i=d(t);return vt(this.view.state.camera,i,e),x(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=K(this._displayBounds,C.get());Q(this._rotateManipulator,t,this._displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this._moveZManipulator,t),this._resizeManipulators.forEach(((e,i)=>{$(e,this._resizeHandles[i],t,this._displayBounds)}))}_updateZMoveHandle(t,e){const i=this._displayBounds,a={basis:i.basis1,direction:-1,position:E(Z.get(),i.origin,i.basis1),edge:2},s=C.get();v(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this._editGeometryOperations.lastOperation;n(t)||(this._editGeometryOperations.undo(),this.graphic.geometry=this._editGeometryOperations.data.geometry,Rt(t,this._mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this._editGeometryOperations.canUndo}undo(){if(o(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this._editGeometryOperations.undo();this.graphic.geometry=this._editGeometryOperations.data.geometry,Rt(p(t),this._mapBounds),this._updateDisplayBounds()}}get canRedo(){return this._editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this._editGeometryOperations.redo();this.graphic.geometry=this._editGeometryOperations.data.geometry,Ot(p(t),this._mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this._resizeManipulators,rotateManipulator:this._rotateManipulator,moveZManipulator:this._moveZManipulator,tooltip:this._tooltip}}};t([_({constructOnly:!0,nonNullable:!0})],Zt.prototype,"view",void 0),t([_({constructOnly:!0,nonNullable:!0})],Zt.prototype,"graphic",void 0),t([_({constructOnly:!0,nonNullable:!0})],Zt.prototype,"enableZ",void 0),t([_()],Zt.prototype,"enableRotation",void 0),t([_()],Zt.prototype,"enableScaling",void 0),t([_({constructOnly:!0,type:jt})],Zt.prototype,"tooltipOptions",void 0),t([_()],Zt.prototype,"preserveAspectRatio",null),t([_()],Zt.prototype,"grabbing",void 0),t([_()],Zt.prototype,"inputState",void 0),t([_({readOnly:!0})],Zt.prototype,"type",void 0),t([_()],Zt.prototype,"_moveUnit",null),Zt=t([g("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],Zt);const Ct="draped-elevation-changes",kt=10,Xt=80,Yt=1e-6;export{Yt as EPSILON,Zt as ExtentTransformTool};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as o,unwrapOr as r,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{createLength as l}from"../../../../../core/quantityUtils.js";import{watch as h,initial as c}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as d}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as u,getMetersPerUnitForSR as m}from"../../../../../core/unitUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../../../../core/accessorSupport/decorators/subclass.js";import{o as v}from"../../../../../chunks/mat4.js";import{s as y,a as f,f as S}from"../../../../../chunks/vec2.js";import{a as M}from"../../../../../chunks/vec2f64.js";import{c as b,q as T,b as E,n as x,l as B,e as A}from"../../../../../chunks/vec3.js";import{c as O,a as R}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{a as G,c as D}from"../../../../../chunks/boundedPlane.js";import{intersectRay as w,create as P,normal as z}from"../../../../../geometry/support/plane.js";import{create as I}from"../../../../../geometry/support/ray.js";import{sv2d as U,sv3d as Z,sm4d as C}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as k}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as X,OffsetMode as Y,IsShiftEdgeOnScreenFlag as L,createResizeManipulator as N,resizeNormal as V,resizeOutlineOnly as H,isDiagonalResizeHandle as F,calculateDiagonalResizeHandleScale as q,createRotatePlane as W,RotationAxis as J,calculateBoundedPlaneTranslateRotate as K,updateRotateHeadingHandle as Q,updateResizeHandle as $}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as tt}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as et}from"../../Manipulator3D.js";import{createRotateManipulator as it,getGraphicAttachmentOrigin as at,calculateInputRotationTransform as st}from"../../manipulatorUtils.js";import{screenToZConstrained as ot,screenToRenderPlane as rt}from"../dragEventPipeline3D.js";import{ManipulatorType as nt}from"../ManipulatorType.js";import{canMoveZ as pt}from"../manipulatorUtils.js";import{createVisualElements as lt}from"../visualElementUtils.js";import{ManipulationType as ht}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as ct}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as dt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ut}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as mt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as _t}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as gt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as vt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as yt,addMapDelta as ft,addScreenDelta as St}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as bt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as Tt}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Et}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{mapPlaneAutoHorizontalSizeByElevationMode as xt,calculateOrientedBounds as Bt,mapPlaneToRenderPlane as At,apply as Ot,unapply as Rt}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import jt from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Gt,ExtentScaleTooltipInfo as Dt}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as wt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as Pt,TranslateGraphicZTooltipInfo as zt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as It}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistance as Ut}from"../../../../support/euclideanLengthMeasurementUtils.js";let Zt=class extends(e.EventedMixin(Mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new jt,this._preserveAspectRatio=new dt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this._handles=new i,this._moveZManipulator=null,this._resizeManipulators=null,this._rotateManipulator=null,this._attachmentOrigin=null,this._outlineVisualElement=null,this._mapBounds=G(),this._mapBoundsStart=G(),this._zmax=0,this._sizeStart=null,this._displayBounds=G(),this._displayBoundsStart=G(),this._displayBoundsMarginStart=0,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=M(),this._endScale=M()}initialize(){const{view:t,graphic:e,manipulators:i,_handles:s}=this,r=this._graphicState=new gt({graphic:e}),n=e.geometry;this._editGeometryOperations=bt.fromGeometry(n,t.state.viewingMode),this._graphicMoveManipulation=new ct({tool:this,view:t,graphicState:r}),this._moveZManipulator=X(t,Y.CENTER_ON_CALLOUT),this._moveZManipulator.state|=L,s.add([this._createMoveXYGraphicDragPipeline(),h((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this._moveZManipulator,nt.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this._moveZManipulator),this._resizeManipulators=this._resizeHandles.map((e=>{const i=N(t,e);return s.add([h((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,nt.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this._resizeManipulators),this._rotateManipulatorTexture=tt(t.toolViewManager.textures),this._rotateManipulator=it(t,this._rotateManipulatorTexture.texture),s.add([h((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this._rotateManipulator,nt.ROTATE))),this._rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this._rotateManipulator)]),i.add(this._rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const p=lt({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});o(p)&&(this._outlineVisualElement=p.visualElement instanceof ut?p.visualElement:null),o(this._outlineVisualElement)&&s.add(this._outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(p),s.add([r.on("changed",(()=>this._onGeometryChanged())),h((()=>r.displaying),(()=>this._updateAllManipulatorAvailability())),h((()=>r.isDraped),(()=>this._graphicDrapedChanged()),c),t.trackGraphicState(r)]);const l=t.pointsOfInterest;l&&s.add(h((()=>l.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const u=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===nt.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(u),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._mapBounds=null,this._displayBounds=null,this._rotateManipulatorTexture.release(),this._handles.destroy(),this._graphicMoveManipulation.destroy(),this._editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{_handles:t,view:e}=this,i=this._tooltip=new wt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",(()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._tooltip.clear()})),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{y(this._startScale,t.xScale,t.yScale),y(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{y(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{y(this._startScale,0,0),y(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",(t=>{"cancel"===t.action?this._tooltip.clear():a()}))])}))}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this._graphicMoveManipulation.grabbing||this._graphicMoveManipulation.dragging?this._computeMoveXYTooltipInfo():this._moveZManipulator.focused?this._computeMoveZTooltipInfo():this._rotateManipulator.focused?this._computeRotateTooltipInfo():this._resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null:null}_computeMoveXYTooltipInfo(){return this._moveXYTooltipInfo=r(this._moveXYTooltipInfo,(()=>new Pt({tooltipOptions:this.tooltipOptions})))}_computeMoveZTooltipInfo(){const t=this._moveZTooltipInfo=r(this._moveZTooltipInfo,(()=>new zt({tooltipOptions:this.tooltipOptions}))),e=this._moveUnit;if(this._moveZManipulator.dragging){const e=this._mapBoundsStart.origin,i=this._mapBounds.origin,a=Ut(e,i,this.view.spatialReference);if(n(a))return null;t.distance=a}else t.distance=l(0,e);return t}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo=r(this._rotateTooltipInfo,(()=>new Gt({tooltipOptions:this.tooltipOptions})));return t.angle=this._startAngle-this._endAngle,t}_computeScaleTooltipInfo(){const t=this.graphic.geometry;if(n(t))return null;const e=this._scaleTooltipInfo=r(this._scaleTooltipInfo,(()=>new Dt({tooltipOptions:this.tooltipOptions}))),i=xt(this._mapBounds,this._zmax,t.spatialReference,this._graphicState.isDraped);return n(i)?null:(e.xSize=i[0],e.ySize=i[1],o(this._sizeStart)&&this._resizeManipulators.some((t=>t.dragging))?(e.xScale=i[0].value/this._sizeStart[0].value,e.yScale=i[1].value/this._sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_graphicDrapedChanged(){this._handles.remove(Ct),this._updateDisplayBounds(),this._graphicState.isDraped&&this._handles.add(this.view.elevationProvider.on("elevation-change",(t=>{o(this._attachmentOrigin)&&j(t.extent,this._attachmentOrigin.x,this._attachmentOrigin.y)&&this._updateDisplayBounds()})),Ct)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof et){const a=this._graphicState.displaying,s=this.enableZ&&pt(this.graphic);switch(e){case nt.ROTATE:t.available=a&&this.enableRotation;break;case nt.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?V:H;break;case nt.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this._graphicMoveManipulation.forEachManipulator(t),this._resizeManipulators.forEach((e=>t(e,nt.SCALE))),t(this._rotateManipulator,nt.ROTATE),t(this._moveZManipulator,nt.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return r(u(this.view.spatialReference),"meters")}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this._editGeometryOperations.data,i=e.components[0].edges[0],a=f(U.get(),i.leftVertex.pos,i.rightVertex.pos);S(a,a);const s=r(at(this.view,this.graphic),(()=>t.extent.center));let o=Xt*this.view.pixelSizeAt(s);const n=this.view.spatialReference,p=t.spatialReference;n.equals(p)||(o*=m(n)/m(p)),Bt(a,e,o,this._mapBounds),this._updateZMax()}_updateZMax(){const t=this._editGeometryOperations.data;if(!t.geometry.hasZ)return void(this._zmax=0);const e=t.coordinateHelper;let i=Number.NEGATIVE_INFINITY;for(const a of t.components)for(const t of a.vertices){const a=e.getZ(t.pos);i=Math.max(a,i)}this._zmax=i}_updateDisplayBounds(){const t=this.graphic.geometry;if(n(t))return;const e=o(this._outlineVisualElement)&&!this._graphicState.isDraped&&o(this._outlineVisualElement.attachmentOrigin)?this._outlineVisualElement.attachmentOrigin:at(this.view,this.graphic);this._attachmentOrigin=r(e,t.extent.center);const i=o(e)?e.z:mt(this._mapBounds.origin,this.view.elevationProvider,_t.fromElevationInfo(k(this.graphic)),this.view.renderCoordsHelper),a=D(this._mapBounds);a.origin[2]=i,At(a,this.view.renderCoordsHelper,t.spatialReference,this._displayBoundsMargin,this._displayBounds),this._updateManipulators()}get _displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this._editGeometryOperations.data.geometry.extent.center;return kt*this.view.pixelSizeAt(e)}_createMoveXYGraphicDragPipeline(){return this._graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,ht.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this._editGeometryOperations.data.spatialReference;return yt(this._moveZManipulator,((i,a,s)=>{const o=R(i.renderLocation),r=a.next(ot(t,o,e)).next(St());this._applyGraphicMoveSteps(r,s,ht.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},this._updateOperationStartProperties(),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(ft()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{o(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_updateOperationStartProperties(){D(this._displayBounds,this._displayBoundsStart),D(this._mapBounds,this._mapBoundsStart),n(this.graphic.geometry)?this._sizeStart=null:this._sizeStart=xt(this._mapBoundsStart,this._zmax,this.graphic.geometry.spatialReference,this._graphicState.isDraped)}_moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this._editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,a=this._editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Ot(a,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===ht.XY||e===ht.XY_AXIS){const e=It(t.mapStart,t.mapEnd,this._graphicState.isDraped?"on-the-ground":"absolute-height");o(e)&&o(this._moveXYTooltipInfo)&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab(t){if("start"!==t.action)return;const e=this._calculatePickRay(t.screenPoint);w(this._displayBounds.plane,e,Z.get())&&(this._updateOperationStartProperties(),this._displayBoundsMarginStart=this._displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return yt(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(rt(this.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{o(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this._displayBoundsStart,i=t.handle.direction,a=this._displayBoundsMargin,s=this._displayBoundsMarginStart,o=b(Z.get(),e.origin);T(o,o,e.basis1,-i[0]),T(o,o,e.basis2,-i[1]);const r=E(Z.get(),t.renderEnd,o),n=E(Z.get(),t.renderStart,o),p=F(t.handle),l=q(e),h=q(this._displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=B(e),o=.5*t*A(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*A(e,n)/i)*l*h}const c=i<1.5*s?1:Yt;return i=Math.max(i-s,Yt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=b(O(),this._mapBoundsStart.origin);T(e,e,this._mapBoundsStart.basis1,-t.handle.direction[0]),T(e,e,this._mapBoundsStart.basis2,-t.handle.direction[1]);const i=y(M(),this._mapBoundsStart.basis1[0],this._mapBoundsStart.basis1[1]);S(i,i);const a=[];for(const r of this._editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,o=this._editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Et.REPLACE);return D(this._mapBoundsStart,this._mapBounds),Ot(o,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_onRotateGrab(t){if("start"!==t.action)return;const e=W(this._displayBounds,this.view.renderCoordsHelper,J.HEADING,P()),i=this._calculatePickRay(t.screenPoint);w(e,i,Z.get())&&(this._updateOperationStartProperties(),this.inputState={type:"rotate",rotatePlane:e})}_createRotateDragPipeline(t){return yt(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(rt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{o(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=z(t.rotatePlane),a=st(e.renderStart,e.renderEnd,this._displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=b(O(),this._mapBoundsStart.origin),i=[];for(const o of this._editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,s=this._editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Et.REPLACE);return D(this._mapBoundsStart,this._mapBounds),Ot(s,this._mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=I(),i=d(t);return vt(this.view.state.camera,i,e),x(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=K(this._displayBounds,C.get());Q(this._rotateManipulator,t,this._displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this._moveZManipulator,t),this._resizeManipulators.forEach(((e,i)=>{$(e,this._resizeHandles[i],t,this._displayBounds)}))}_updateZMoveHandle(t,e){const i=this._displayBounds,a={basis:i.basis1,direction:-1,position:E(Z.get(),i.origin,i.basis1),edge:2},s=C.get();v(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this._editGeometryOperations.lastOperation;n(t)||(this._editGeometryOperations.undo(),this.graphic.geometry=this._editGeometryOperations.data.geometry,Rt(t,this._mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this._editGeometryOperations.canUndo}undo(){if(o(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this._editGeometryOperations.undo();this.graphic.geometry=this._editGeometryOperations.data.geometry,Rt(p(t),this._mapBounds),this._updateDisplayBounds()}}get canRedo(){return this._editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this._editGeometryOperations.redo();this.graphic.geometry=this._editGeometryOperations.data.geometry,Ot(p(t),this._mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this._resizeManipulators,rotateManipulator:this._rotateManipulator,moveZManipulator:this._moveZManipulator,tooltip:this._tooltip}}};t([_({constructOnly:!0,nonNullable:!0})],Zt.prototype,"view",void 0),t([_({constructOnly:!0,nonNullable:!0})],Zt.prototype,"graphic",void 0),t([_({constructOnly:!0,nonNullable:!0})],Zt.prototype,"enableZ",void 0),t([_()],Zt.prototype,"enableRotation",void 0),t([_()],Zt.prototype,"enableScaling",void 0),t([_({constructOnly:!0,type:jt})],Zt.prototype,"tooltipOptions",void 0),t([_()],Zt.prototype,"preserveAspectRatio",null),t([_()],Zt.prototype,"grabbing",void 0),t([_()],Zt.prototype,"inputState",void 0),t([_({readOnly:!0})],Zt.prototype,"type",void 0),t([_()],Zt.prototype,"_moveUnit",null),Zt=t([g("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],Zt);const Ct="draped-elevation-changes",kt=10,Xt=80,Yt=1e-6;export{Yt as EPSILON,Zt as ExtentTransformTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n,isNone as l}from"../../../../../core/maybe.js";import{createAngle as c,createLength as h}from"../../../../../core/quantityUtils.js";import{when as p,initial as u,watch as d}from"../../../../../core/reactiveUtils.js";import{addFrameTask as g}from"../../../../../core/scheduling.js";import{createScreenPointArray as m}from"../../../../../core/screenUtils.js";import{d as _,C as f,m as M,k as D,e as S}from"../../../../../chunks/mat4.js";import{c as v}from"../../../../../chunks/mat4f64.js";import{s as y,b,l as T,d as R,f as k,a as j}from"../../../../../chunks/vec3.js";import{a as w,f as O}from"../../../../../chunks/vec3f64.js";import{b as A}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as I,create as F,normal as P}from"../../../../../geometry/support/plane.js";import{wrap as E,distance2 as C}from"../../../../../geometry/support/ray.js";import{sv3d as U,sm4d as z}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as L}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as x}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{screenToRenderPlane as H}from"../dragEventPipeline3D.js";import{ManipulatorType as V}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as q,SCALE_INDICATOR_DIRECTION_BUFFER as B,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as G,RING_THICKNESS as J,HANDLE_COLOR as K,DRAG_THRESHOLD_PX as Q,RING_RADIUS as W,INNER_INDICATOR_RADIUS as X,OUTER_INDICATOR_RADIUS as Y,RING_HEIGHT as Z,ROTATE_INDICATOR_ARROW_TIP_RADIUS as $,ROTATE_INDICATOR_ARROW_TIP_LENGTH as tt,SCALE_INDICATOR_OFFSET1 as et,SCALE_INDICATOR_OFFSET2 as at,RING_INDICATOR_DELAY_MS as it,GEOMETRY_SEGMENTS as ot,ROTATE_INDICATOR_ARC_LENGTH as st,INDICATOR_THICKNESS as rt,RING_RESET_ANIMATION_SPEED_FACTOR as nt,SCALE_INDICATOR_ARC_LENGTH as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import{createExtrudedTriangle as ht,transformInPlace as pt,createPathExtrusionGeometry as ut}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as dt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as gt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as mt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as _t,ManipulatorStateFlags as ft}from"../../../../interactive/interfaces.js";import{Tooltip as Mt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as Dt,TransformScaleTooltipInfo as St,TransformAbsoluteTooltipInfo as vt}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var yt,bt;!function(t){t.ScaleIn=_t.Custom2,t.ScaleOut=_t.Custom3,t.RotateLeft=_t.Custom4,t.RotateRight=_t.Custom5,t.Unlocked=_t.Custom7,t.DelayedFocused=_t.Custom8,t.TouchInput=_t.Custom12}(yt||(yt={}));class Tt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this._mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this._adapter.scale:1,this.tool=r,this._mode=o,this._adapter=t,this._tooltipOptions=i,this._tooltip=new Mt({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(p((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),u))}get angle(){return this._adapter.angle}get scale(){return this._adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=g({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,V.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=mt(e,((e,r,n)=>{this._scaleRotateDragData=null;const l=this._adapter.startInteraction(),c={mode:"none",origin:w(e.renderLocation),initialAngle:this._adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=U.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(H(this.tool.view,I(e.renderLocation,h,F()))).next((e=>{const r=P(e.plane),n=N(e.renderStart,e.renderEnd,c.origin,r),h=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+h,-q,q),c.angle=n;const p=Rt(c,e),u=p-this._adapter.scale;if(c.scaleDir=i(c.scaleDir+u,-B,B),this._onScaleChanged(),"none"===c.mode){const t=this._mode||kt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":l.state.angle=c.initialAngle+n;break;case"scale":l.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:p,yScale:p})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:p,yScale:p})}}return"end"===e.action&&(this.startAnimation(wt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),l.done()),e})).next(this._updateTooltipPipelineStep(c)),n.next((()=>{if(l.cancel(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(wt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(Ot(this,(()=>this._updateDelayedFocusedState()))):this._updateDelayedFocusedState()})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),d((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),u)])}_updateTooltipPipelineStep(t){return e=>{const a=this._tooltipOptions;if(!a.enabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const i=this._tooltip,o=this._tooltipOptions.visualVariables,r=s(o)?o.size:null,l=s(o)?o.rotation:null;switch(t.mode){case"scale":i.info=new St({tooltipOptions:a,scale:{value:this._adapter.scale},size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(r)?r.unit:null,sizePrecision:s(r)?At(r.valueType):null});break;case"rotate":{const t=s(l)?At(l.valueType):null,e=s(l)?l.rotationType:"geographic";i.info=new Dt({tooltipOptions:a,rotation:c(n(-this._adapter.relativeAngle,0),"radians","geographic"),rotationPrecision:t,orientation:c(-this._adapter.angle,"radians","geographic"),orientationPrecision:t,rotationType:e})}}return e}}_updateFocusTooltip(){if(!this._tooltipOptions.enabled)return;if(this.getFocused()){const t=this._tooltipOptions.visualVariables,e=s(t)?t.rotation:null,a=s(t)?t.size:null;this._tooltip.info=new vt({tooltipOptions:this._tooltipOptions,orientation:c(-this._adapter.angle,"radians","geographic"),orientationEnabled:null==this._mode||"rotate"===this._mode,orientationPrecision:s(e)?At(e.valueType):null,rotationType:s(e)?e.rotationType:"geographic",size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(a)?a.unit:null,sizeEnabled:null==this._mode||"scale"===this._mode,sizePrecision:s(a)?At(a.valueType):null})}else this._tooltip.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(yt.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(yt.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(yt.ScaleIn|yt.ScaleOut,!1),this._ringManipulator.updateStateEnabled(yt.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(yt.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(yt.RotateLeft|yt.RotateRight,!1),this._ringManipulator.updateStateEnabled(yt.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(yt.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(yt.ScaleIn|yt.ScaleOut|yt.RotateLeft|yt.RotateRight,!1)}_updateManipulatorTransform(){const t=_(z.get(),this._adapter.angle,O(0,0,1));if(l(t))return;const e=this.getScale(),a=f(z.get(),y(U.get(),e,e,e));this._ringManipulator.modelTransform=M(z.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(ot*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(O(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,Z/2],[-t/2,Z/2]],i=(t,e)=>ut(a(e),t,[],[],!1),o=e(W),s=i(o,J),r={left:[],right:[]},n=[];for(let k=0;k<2;k++){const e=k*Math.PI-Math.PI/4,a=Math.PI/2-st,o=e+a,s=e+Math.PI/2-a,l=t(o,s,X),c=i(l,rt);n.push(l),n.push(t(o,s,Y-J/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=v();if(e){D(a,a,[1,-1,1]),S(a,a,-o,[0,0,1]);const t=Math.round(G*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{S(a,a,s,[0,0,1]);const t=Math.round((1-G)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=ht(tt,0,$,Z);pt(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let D=0;D<2;D++){const e=D*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,r=t(o,s,Y);l.push(i(r,rt))}const c=e(W+et),h=e(W+at),p=i(c,rt),u=i(h,rt),d=e(W-et),g=e(W-at),m=i(d,rt),_=i(g,rt),f=this._createMaterial(),M=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let T=[{geometry:s,material:f,stateMask:yt.DelayedFocused},{geometry:s,material:y,stateMask:ft.None}];this._mode&&"scale"!==this._mode||(T=T.concat([{geometry:l,material:f,stateMask:yt.DelayedFocused|yt.Unlocked},{geometry:p,material:M,stateMask:yt.DelayedFocused|yt.ScaleIn},{geometry:u,material:b,stateMask:yt.DelayedFocused|yt.ScaleIn},{geometry:m,material:M,stateMask:yt.DelayedFocused|yt.ScaleOut},{geometry:_,material:b,stateMask:yt.DelayedFocused|yt.ScaleOut}])),this._mode&&"rotate"!==this._mode||(T=T.concat([{geometry:r.right,material:f,stateMask:yt.DelayedFocused|yt.Unlocked},{geometry:r.left,material:f,stateMask:yt.DelayedFocused|yt.RotateLeft},{geometry:r.right,material:f,stateMask:yt.DelayedFocused|yt.RotateRight}]));const R=[o,...n];return new x({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:J,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:L(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:O(0,0,1)}})}_createMaterial(t=1){const e=A([...K,t]);return new gt({color:e,transparent:1!==t,cullFace:ct.Back,renderOccluded:dt.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function Rt(t,e){const a=b(U.get(),e.renderStart,t.origin),i=b(U.get(),e.renderEnd,t.origin),o=T(a),s=T(i);return 0===o?0:s/o}function kt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=jt(o,i,U.get()),n=jt(s,i,U.get());if(R(r,n)<Q*Q)return null;const l=b(U.get(),o,a),c=k(U.get(),l,P(e)),h=o,p=j(U.get(),h,c),u=jt(a,i,U.get()),d=r,g=jt(p,i,U.get()),m=b(U.get(),g,d),_=b(U.get(),r,u),f=E(d,m),M=E(u,_);return C(f,n)<C(M,n)?"rotate":"scale"}function jt(t,e,a){return e.projectToScreen(t,It),y(a,It[0],It[1],0)}function wt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*nt,1),e(),Math.abs(i-1)<.01?bt.STOP:bt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function Ot(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>it?bt.STOP:bt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}function At(t){switch(t){case"integer":case"long":return 0;default:return null}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(bt||(bt={}));const It=m();export{Tt as GraphicScaleRotateTransform};
5
+ import{cyclicalPI as t}from"../../../../../core/Cyclical.js";import e from"../../../../../core/Evented.js";import a from"../../../../../core/Handles.js";import{clamp as i,rad2deg as o}from"../../../../../core/mathUtils.js";import{isSome as s,destroyMaybe as r,unwrapOr as n,isNone as l}from"../../../../../core/maybe.js";import{createAngle as c,createLength as h}from"../../../../../core/quantityUtils.js";import{when as p,initial as u,watch as d}from"../../../../../core/reactiveUtils.js";import{addFrameTask as g}from"../../../../../core/scheduling.js";import{createScreenPointArray as m}from"../../../../../core/screenUtils.js";import{d as _,C as f,m as M,k as D,e as S}from"../../../../../chunks/mat4.js";import{c as v}from"../../../../../chunks/mat4f64.js";import{s as y,b,l as T,d as R,f as k,a as j}from"../../../../../chunks/vec3.js";import{a as w,f as O}from"../../../../../chunks/vec3f64.js";import{a as A}from"../../../../../chunks/vec4f64.js";import{fromPositionAndNormal as I,create as F,normal as P}from"../../../../../geometry/support/plane.js";import{wrap as E,distance2 as C}from"../../../../../geometry/support/ray.js";import{sv3d as U,sm4d as z}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as L}from"../../../../../support/elevationInfoUtils.js";import{Manipulator3D as x}from"../../Manipulator3D.js";import{calculateInputRotationTransform as N}from"../../manipulatorUtils.js";import{screenToRenderPlane as H}from"../dragEventPipeline3D.js";import{ManipulatorType as V}from"../ManipulatorType.js";import{ROTATE_INDICATOR_DIRECTION_BUFFER as q,SCALE_INDICATOR_DIRECTION_BUFFER as B,ROTATE_INDICATOR_ARROW_PLACEMENT_PERCENTAGE as G,RING_THICKNESS as J,HANDLE_COLOR as K,DRAG_THRESHOLD_PX as Q,RING_RADIUS as W,INNER_INDICATOR_RADIUS as X,OUTER_INDICATOR_RADIUS as Y,RING_HEIGHT as Z,ROTATE_INDICATOR_ARROW_TIP_RADIUS as $,ROTATE_INDICATOR_ARROW_TIP_LENGTH as tt,SCALE_INDICATOR_OFFSET1 as et,SCALE_INDICATOR_OFFSET2 as at,RING_INDICATOR_DELAY_MS as it,GEOMETRY_SEGMENTS as ot,ROTATE_INDICATOR_ARC_LENGTH as st,INDICATOR_THICKNESS as rt,RING_RESET_ANIMATION_SPEED_FACTOR as nt,SCALE_INDICATOR_ARC_LENGTH as lt}from"../manipulations/config.js";import{CullFaceOptions as ct}from"../../../webgl-engine/lib/basicInterfaces.js";import{createExtrudedTriangle as ht,transformInPlace as pt,createPathExtrusionGeometry as ut}from"../../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as dt}from"../../../webgl-engine/lib/Material.js";import{ColorMaterial as gt}from"../../../webgl-engine/materials/ColorMaterial.js";import{createManipulatorDragEventPipeline as mt}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as _t,ManipulatorStateFlags as ft}from"../../../../interactive/interfaces.js";import{Tooltip as Mt}from"../../../../interactive/tooltip/Tooltip.js";import{TransformRotateTooltipInfo as Dt,TransformScaleTooltipInfo as St,TransformAbsoluteTooltipInfo as vt}from"../../../../interactive/tooltip/TransformTooltipInfos.js";var yt,bt;!function(t){t.ScaleIn=_t.Custom2,t.ScaleOut=_t.Custom3,t.RotateLeft=_t.Custom4,t.RotateRight=_t.Custom5,t.Unlocked=_t.Custom7,t.DelayedFocused=_t.Custom8,t.TouchInput=_t.Custom12}(yt||(yt={}));class Tt{constructor({adapter:t,tooltipOptions:i,mode:o,tool:r}){this._mode=null,this._handles=new a,this._scaleRotateDragData=null,this._activeAnimation=null,this.events=new e,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>s(this._scaleRotateDragData)&&"scale"===this._scaleRotateDragData.mode?this._adapter.scale:1,this.tool=r,this._mode=o,this._adapter=t,this._tooltipOptions=i,this._tooltip=new Mt({view:r.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this._handles.add(p((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),u))}get angle(){return this._adapter.angle}get scale(){return this._adapter.scale}set location(t){this._ringManipulator.location=t}set elevationAlignedLocation(t){this._ringManipulator.elevationAlignedLocation=t}get grabbing(){return this._ringManipulator.grabbing}set interactive(t){this._ringManipulator.interactive=t}destroy(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=null),this._handles=r(this._handles),this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=r(this._tooltip)}startAnimation(t){this.cancelActiveAnimation(),t.start();const e=g({update:({deltaTime:e})=>{t.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...t,frameTask:e}}cancelActiveAnimation(){s(this._activeAnimation)&&(this._activeAnimation.frameTask.remove(),this._activeAnimation=r(this._activeAnimation))}forEachManipulator(t){t(this._ringManipulator,V.SCALE_ROTATE)}_createManipulator(){const e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);const a=this.tool.graphicState.graphic,r=mt(e,((e,r,n)=>{this._scaleRotateDragData=null;const l=this._adapter.startInteraction(),c={mode:"none",origin:w(e.renderLocation),initialAngle:this._adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=c,this._updateDragState();const h=U.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,h),r.next(H(this.tool.view,I(e.renderLocation,h,F()))).next((e=>{const r=P(e.plane),n=N(e.renderStart,e.renderEnd,c.origin,r),h=t.shortestSignedDiff(c.angle,n);c.angleDir=i(c.angleDir+h,-q,q),c.angle=n;const p=Rt(c,e),u=p-this._adapter.scale;if(c.scaleDir=i(c.scaleDir+u,-B,B),this._onScaleChanged(),"none"===c.mode){const t=this._mode||kt(e,e.plane,c.origin,this.tool.view.state.camera);if(s(t)){switch(t){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:a,angle:0}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this._adapter.createUndoRecord()})}c.mode=t}}switch(c.mode){case"rotate":l.state.angle=c.initialAngle+n;break;case"scale":l.state.scale=p,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:a,xScale:p,yScale:p})}break;case"end":switch(c.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:o(c.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:p,yScale:p})}}return"end"===e.action&&(this.startAnimation(wt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState(),l.done()),e})).next(this._updateTooltipPipelineStep(c)),n.next((()=>{if(l.cancel(),s(this._scaleRotateDragData)){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:a,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1})}this.startAnimation(wt(this,(()=>this._onScaleChanged()))),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()}))}));this._handles.add([r,e.events.on("focus-changed",(t=>{"focus"===t.action?this.startAnimation(Ot(this,(()=>this._updateDelayedFocusedState()))):this._updateDelayedFocusedState()})),e.events.on("immediate-click",(t=>{t.stopPropagation()})),d((()=>this.tool.graphicState?.displaying),(t=>this._ringManipulator.available=t),u)])}_updateTooltipPipelineStep(t){return e=>{const a=this._tooltipOptions;if(!a.enabled)return e;if("end"===e.action)return this._updateFocusTooltip(),e;const i=this._tooltip,o=this._tooltipOptions.visualVariables,r=s(o)?o.size:null,l=s(o)?o.rotation:null;switch(t.mode){case"scale":i.info=new St({tooltipOptions:a,scale:{value:this._adapter.scale},size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(r)?r.unit:null,sizePrecision:s(r)?At(r.valueType):null});break;case"rotate":{const t=s(l)?At(l.valueType):null,e=s(l)?l.rotationType:"geographic";i.info=new Dt({tooltipOptions:a,rotation:c(n(-this._adapter.relativeAngle,0),"radians","geographic"),rotationPrecision:t,orientation:c(-this._adapter.angle,"radians","geographic"),orientationPrecision:t,rotationType:e})}}return e}}_updateFocusTooltip(){if(!this._tooltipOptions.enabled)return;if(this.getFocused()){const t=this._tooltipOptions.visualVariables,e=s(t)?t.rotation:null,a=s(t)?t.size:null;this._tooltip.info=new vt({tooltipOptions:this._tooltipOptions,orientation:c(-this._adapter.angle,"radians","geographic"),orientationEnabled:null==this._mode||"rotate"===this._mode,orientationPrecision:s(e)?At(e.valueType):null,rotationType:s(e)?e.rotationType:"geographic",size:h(n(this._adapter.size,-1),"meters"),sizeUnit:s(a)?a.unit:null,sizeEnabled:null==this._mode||"scale"===this._mode,sizePrecision:s(a)?At(a.valueType):null})}else this._tooltip.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(yt.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){if(this._ringManipulator.updateStateEnabled(yt.Unlocked,!(s(this._scaleRotateDragData)&&"none"!==this._scaleRotateDragData.mode)),s(this._scaleRotateDragData))switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(yt.ScaleIn|yt.ScaleOut,!1),this._ringManipulator.updateStateEnabled(yt.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(yt.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(yt.RotateLeft|yt.RotateRight,!1),this._ringManipulator.updateStateEnabled(yt.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(yt.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(yt.ScaleIn|yt.ScaleOut|yt.RotateLeft|yt.RotateRight,!1)}_updateManipulatorTransform(){const t=_(z.get(),this._adapter.angle,O(0,0,1));if(l(t))return;const e=this.getScale(),a=f(z.get(),y(U.get(),e,e,e));this._ringManipulator.modelTransform=M(z.get(),a,t)}_createRingManipulator(){const t=(t,e,a)=>{const i=[],o=Math.ceil(ot*(e-t)/(2*Math.PI));for(let s=0;s<o+1;s++){const r=t+s*(e-t)/o;i.push(O(a*Math.cos(r),a*Math.sin(r),0))}return i},e=e=>t(0,2*Math.PI,e),a=t=>[[-t/2,0],[t/2,0],[t/2,Z/2],[-t/2,Z/2]],i=(t,e)=>ut(a(e),t,[],[],!1),o=e(W),s=i(o,J),r={left:[],right:[]},n=[];for(let k=0;k<2;k++){const e=k*Math.PI-Math.PI/4,a=Math.PI/2-st,o=e+a,s=e+Math.PI/2-a,l=t(o,s,X),c=i(l,rt);n.push(l),n.push(t(o,s,Y-J/2)),r.left.push(c),r.right.push(c);for(let t=0;t<2;t++){const e=0===t,a=v();if(e){D(a,a,[1,-1,1]),S(a,a,-o,[0,0,1]);const t=Math.round(G*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}else{S(a,a,s,[0,0,1]);const t=Math.round((1-G)*(l.length-1));a[12]=l[t][0],a[13]=l[t][1],a[14]=l[t][2]}const i=ht(tt,0,$,Z);pt(i,a),(e?r.left:r.right).push(i)}}const l=[];for(let D=0;D<2;D++){const e=D*Math.PI-Math.PI/4,a=Math.PI/2-lt,o=e+a,s=e+Math.PI/2-a,r=t(o,s,Y);l.push(i(r,rt))}const c=e(W+et),h=e(W+at),p=i(c,rt),u=i(h,rt),d=e(W-et),g=e(W-at),m=i(d,rt),_=i(g,rt),f=this._createMaterial(),M=this._createMaterial(.66),y=this._createMaterial(.5),b=this._createMaterial(.33);let T=[{geometry:s,material:f,stateMask:yt.DelayedFocused},{geometry:s,material:y,stateMask:ft.None}];this._mode&&"scale"!==this._mode||(T=T.concat([{geometry:l,material:f,stateMask:yt.DelayedFocused|yt.Unlocked},{geometry:p,material:M,stateMask:yt.DelayedFocused|yt.ScaleIn},{geometry:u,material:b,stateMask:yt.DelayedFocused|yt.ScaleIn},{geometry:m,material:M,stateMask:yt.DelayedFocused|yt.ScaleOut},{geometry:_,material:b,stateMask:yt.DelayedFocused|yt.ScaleOut}])),this._mode&&"rotate"!==this._mode||(T=T.concat([{geometry:r.right,material:f,stateMask:yt.DelayedFocused|yt.Unlocked},{geometry:r.left,material:f,stateMask:yt.DelayedFocused|yt.RotateLeft},{geometry:r.right,material:f,stateMask:yt.DelayedFocused|yt.RotateRight}]));const R=[o,...n];return new x({view:this.tool.view,renderObjects:T,autoScaleRenderObjects:!1,worldOriented:!0,radius:J,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:L(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:R,direction:O(0,0,1)}})}_createMaterial(t=1){const e=A([...K,t]);return new gt({color:e,transparent:1!==t,cullFace:ct.Back,renderOccluded:dt.Transparent})}get test(){return{ringManipulator:this._ringManipulator,tooltip:this._tooltip}}}function Rt(t,e){const a=b(U.get(),e.renderStart,t.origin),i=b(U.get(),e.renderEnd,t.origin),o=T(a),s=T(i);return 0===o?0:s/o}function kt(t,e,a,i){const{renderStart:o,renderEnd:s}=t,r=jt(o,i,U.get()),n=jt(s,i,U.get());if(R(r,n)<Q*Q)return null;const l=b(U.get(),o,a),c=k(U.get(),l,P(e)),h=o,p=j(U.get(),h,c),u=jt(a,i,U.get()),d=r,g=jt(p,i,U.get()),m=b(U.get(),g,d),_=b(U.get(),r,u),f=E(d,m),M=E(u,_);return C(f,n)<C(M,n)?"rotate":"scale"}function jt(t,e,a){return e.projectToScreen(t,It),y(a,It[0],It[1],0)}function wt(t,e){let a=null,i=1;const o=()=>i;return{start:()=>{i=t.getScale(),a=t.getScale,t.getScale=o,e()},update:t=>(i+=((i+1)/2-i)*Math.min(t*nt,1),e(),Math.abs(i-1)<.01?bt.STOP:bt.CONTINUE),destroy:()=>{t.getScale=a,e()}}}function Ot(t,e){let a=0,i=null;const o=()=>!1;return{start:()=>{i=t.getFocused,t.getFocused=o,a=0,e()},update:t=>(a+=t,!i()||a>it?bt.STOP:bt.CONTINUE),destroy:()=>{t.getFocused=i,e()}}}function At(t){switch(t){case"integer":case"long":return 0;default:return null}}!function(t){t[t.CONTINUE=0]="CONTINUE",t[t.STOP=1]="STOP"}(bt||(bt={}));const It=m();export{Tt as GraphicScaleRotateTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as t}from"../../../core/maybe.js";import{a as r}from"../../../chunks/mat4.js";import{b as n,f as o,m as a,n as i}from"../../../chunks/vec3.js";import{f as c}from"../../../chunks/vec4f64.js";import{sv3d as s,sm4d as l}from"../../../geometry/support/vectorStacks.js";import{hydrateGeometry as m}from"../../../layers/graphics/hydratedFeatures.js";import{Manipulator3D as u}from"./Manipulator3D.js";import{computeCentroid as p}from"../layers/graphics/graphicUtils.js";import{CullFaceOptions as g}from"../webgl-engine/lib/basicInterfaces.js";import{Geometry as d}from"../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as f,createSphereGeometry as O}from"../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as w}from"../webgl-engine/lib/Material.js";import{VertexAttribute as b}from"../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as j}from"../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as I}from"../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as h}from"../webgl-engine/materials/NativeLineMaterial.js";import{ShadedColorMaterial as S}from"../webgl-engine/materials/ShadedColorMaterial.js";import{ManipulatorStateFlags as y,ManipulatorStateCustomFlags as U}from"../../interactive/interfaces.js";function A(e,t=w.OccludeAndTransparent,r=!0){const n=c(e[0],e[1],e[2],e.length>3?e[3]:1),o=e[3]<1;return r?new S({color:n,transparent:o,writeDepth:!0,cullFace:g.Back,renderOccluded:t}):new j({color:n,transparent:o,writeDepth:!0,cullFace:g.Back,renderOccluded:t})}function D(e,t=w.OccludeAndTransparent){const r=c(e[0],e[1],e[2],4===e.length?e[3]:1);return new j({color:r,transparent:!0,writeDepth:!0,cullFace:g.Front,renderOccluded:t})}const C=Object.freeze({OFFSET_DISTANCE:40,DISC_RADIUS:27,DISC_RADIUS_FOCUS_MULTIPLIER:1.1,CALLOUT_COLOR:c(1,.5,0,1)});function F(e,t,r=U.None){const n=new I({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:w.Opaque}),o=C.OFFSET_DISTANCE,a=C.DISC_RADIUS,i=a*C.DISC_RADIUS_FOCUS_MULTIPLIER,c=e=>{const t=[0,1,2,2,3,0];return new d([[b.POSITION,{size:3,data:[o-e,-e,0,o+e,-e,0,o+e,e,0,o-e,e,0],exclusive:!0}],[b.UV0,{size:2,data:[0,0,1,0,1,1,0,1]}]],[[b.POSITION,t],[b.UV0,t]])},s=f([[0,0,0],[o-a,0,0]]),l=f([[0,0,0],[o-i,0,0]]),m=new h({color:C.CALLOUT_COLOR,renderOccluded:w.OccludeAndTransparent}),p=[{geometry:c(a),material:n,stateMask:y.Unfocused|r},{geometry:s,material:m,stateMask:y.Unfocused|r},{geometry:c(i),material:n,stateMask:y.Focused|r},{geometry:l,material:m,stateMask:y.Focused|r}];return new u({view:e,renderObjects:p,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[o,0,0]},collisionPriority:1,radius:a/2})}function T(e,t,r){return new u({view:e,renderObjects:[{geometry:O(1,32,32),material:A(c(t[0],t[1],t[2],null!=r?r:1))}]})}function M(e,t,i,c){const m=n(s.get(),e,i),u=L(m,o(s.get(),c,m),i,l.get());r(u,u);const p=a(s.get(),t,u);return Math.atan2(p[1],p[0])}function L(e,t,r,n){const a=i(s.get(),e),c=i(s.get(),t),l=o(s.get(),a,c);return n[0]=a[0],n[1]=a[1],n[2]=a[2],n[3]=0,n[4]=c[0],n[5]=c[1],n[6]=c[2],n[7]=0,n[8]=l[0],n[9]=l[1],n[10]=l[2],n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n}function _(t,r){const n=t.getViewForGraphic(r);return e(n)&&"computeAttachmentOrigin"in n?n.computeAttachmentOrigin(r,t.spatialReference):null}function k(t,r,n){const o=_(t,n);e(o)?r.elevationAlignedLocation=o:R(r,n.geometry)}function R(e,r){if(t(r))return;const n="mesh"===r.type?r.anchor:p(r);t(n)||(e.location=m(n))}export{M as calculateInputRotationTransform,L as calculateTranslateRotateFromBases,A as createManipulatorMaterial,D as createManipulatorOutlineMaterial,F as createRotateManipulator,T as createSphereManipulator,_ as getGraphicAttachmentOrigin,k as placeAtGraphic};
5
+ import{isSome as e,isNone as t}from"../../../core/maybe.js";import{a as r}from"../../../chunks/mat4.js";import{b as n,f as o,v as a,n as i}from"../../../chunks/vec3.js";import{f as c}from"../../../chunks/vec4f64.js";import{sv3d as s,sm4d as l}from"../../../geometry/support/vectorStacks.js";import{hydrateGeometry as m}from"../../../layers/graphics/hydratedFeatures.js";import{Manipulator3D as u}from"./Manipulator3D.js";import{computeCentroid as p}from"../layers/graphics/graphicUtils.js";import{CullFaceOptions as g}from"../webgl-engine/lib/basicInterfaces.js";import{Geometry as d}from"../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as f,createSphereGeometry as O}from"../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as w}from"../webgl-engine/lib/Material.js";import{VertexAttribute as b}from"../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as j}from"../webgl-engine/materials/ColorMaterial.js";import{ImageMaterial as I}from"../webgl-engine/materials/ImageMaterial.js";import{NativeLineMaterial as h}from"../webgl-engine/materials/NativeLineMaterial.js";import{ShadedColorMaterial as S}from"../webgl-engine/materials/ShadedColorMaterial.js";import{ManipulatorStateFlags as y,ManipulatorStateCustomFlags as U}from"../../interactive/interfaces.js";function A(e,t=w.OccludeAndTransparent,r=!0){const n=c(e[0],e[1],e[2],e.length>3?e[3]:1),o=e[3]<1;return r?new S({color:n,transparent:o,writeDepth:!0,cullFace:g.Back,renderOccluded:t}):new j({color:n,transparent:o,writeDepth:!0,cullFace:g.Back,renderOccluded:t})}function D(e,t=w.OccludeAndTransparent){const r=c(e[0],e[1],e[2],4===e.length?e[3]:1);return new j({color:r,transparent:!0,writeDepth:!0,cullFace:g.Front,renderOccluded:t})}const C=Object.freeze({OFFSET_DISTANCE:40,DISC_RADIUS:27,DISC_RADIUS_FOCUS_MULTIPLIER:1.1,CALLOUT_COLOR:c(1,.5,0,1)});function F(e,t,r=U.None){const n=new I({transparent:!0,writeDepth:!1,textureId:t.id,renderOccluded:w.Opaque}),o=C.OFFSET_DISTANCE,a=C.DISC_RADIUS,i=a*C.DISC_RADIUS_FOCUS_MULTIPLIER,c=e=>{const t=[0,1,2,2,3,0];return new d([[b.POSITION,{size:3,data:[o-e,-e,0,o+e,-e,0,o+e,e,0,o-e,e,0],exclusive:!0}],[b.UV0,{size:2,data:[0,0,1,0,1,1,0,1]}]],[[b.POSITION,t],[b.UV0,t]])},s=f([[0,0,0],[o-a,0,0]]),l=f([[0,0,0],[o-i,0,0]]),m=new h({color:C.CALLOUT_COLOR,renderOccluded:w.OccludeAndTransparent}),p=[{geometry:c(a),material:n,stateMask:y.Unfocused|r},{geometry:s,material:m,stateMask:y.Unfocused|r},{geometry:c(i),material:n,stateMask:y.Focused|r},{geometry:l,material:m,stateMask:y.Focused|r}];return new u({view:e,renderObjects:p,autoScaleRenderObjects:!1,collisionType:{type:"disc",direction:[0,0,1],offset:[o,0,0]},collisionPriority:1,radius:a/2})}function T(e,t,r){return new u({view:e,renderObjects:[{geometry:O(1,32,32),material:A(c(t[0],t[1],t[2],null!=r?r:1))}]})}function M(e,t,i,c){const m=n(s.get(),e,i),u=L(m,o(s.get(),c,m),i,l.get());r(u,u);const p=a(s.get(),t,u);return Math.atan2(p[1],p[0])}function L(e,t,r,n){const a=i(s.get(),e),c=i(s.get(),t),l=o(s.get(),a,c);return n[0]=a[0],n[1]=a[1],n[2]=a[2],n[3]=0,n[4]=c[0],n[5]=c[1],n[6]=c[2],n[7]=0,n[8]=l[0],n[9]=l[1],n[10]=l[2],n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n}function _(t,r){const n=t.getViewForGraphic(r);return e(n)&&"computeAttachmentOrigin"in n?n.computeAttachmentOrigin(r,t.spatialReference):null}function k(t,r,n){const o=_(t,n);e(o)?r.elevationAlignedLocation=o:v(r,n.geometry)}function v(e,r){if(t(r))return;const n="mesh"===r.type?r.anchor:p(r);t(n)||(e.location=m(n))}export{M as calculateInputRotationTransform,L as calculateTranslateRotateFromBases,A as createManipulatorMaterial,D as createManipulatorOutlineMaterial,F as createRotateManipulator,T as createSphereManipulator,_ as getGraphicAttachmentOrigin,k as placeAtGraphic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import e from"../../../../core/Handles.js";import{isSome as t,unwrap as s,isNone as i,unwrapOr as r}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{c as a,b as l,k as o,o as h}from"../../../../chunks/vec3.js";import{c as _,f as d}from"../../../../chunks/vec3f64.js";import{g as p,c as u}from"../../../../chunks/vec4.js";import{f as c,a as f}from"../../../../chunks/vec4f32.js";import{create as m,fromRay as y,getStart as g,getEnd as x}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as b}from"../../../../geometry/support/frustum.js";import{create as w,fromPoints as E,pointAt as R}from"../../../../geometry/support/lineSegment.js";import{create as O,fromPoints as D}from"../../../../geometry/support/ray.js";import{LaserlineVisualElement as A}from"./LaserlineVisualElement.js";import{Object3DVisualElement as C}from"./Object3DVisualElement.js";import{createPolylineGeometry as P}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as j}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as v}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as M}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends C{constructor(t){super(t),this._ray=O(),this._externalResources=null,this._handles=new e,this._isWorldDown=!1,this._start=_(),this._end=d(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=V.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=j.OccludeAndTransparent,this._fadedExtensions=F,this.applyProps(t)}createExternalResources(){const e=new M(this.materialParameters);this._handles.add(n((()=>this.view.state.camera),(()=>{this._updateGeometry()})));const t=new A({view:this.view,attached:this._laserlineEnabled});this._externalResources={material:e,laserline:t}}destroyExternalResources(){t(this._externalResources)&&this._externalResources.laserline.destroy(),this._externalResources=null,this._handles.removeAll()}forEachExternalMaterial(e){t(this._externalResources)&&e(this._externalResources.material)}createGeometries(e){const t=[_(),_()],i=this.extensionType===V.FADED;i&&t.push(_(),_());const r=i?new Float32Array([1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]):null,n=P(t,null,r);e.addGeometry(n,s(this._externalResources).material),this._updateVertices(e)}updateVisibility(e){super.updateVisibility(e),t(this._externalResources)&&(this._externalResources.laserline.visible=e)}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,a(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),l(this._end,e,this._end),D(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,o(this._start,e)||(a(this._start,e),D(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,o(this._end,e)||(a(this._end,e),D(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){p(e,this._color)||(u(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){p(e,this._innerColor)||(u(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const s=t(e)!==t(this._stipplePattern);this._stipplePattern=e,s?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(i(e)||i(this._stippleOffColor)||!p(e,this._stippleOffColor))&&(this._stippleOffColor=t(e)?f(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this._updateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&t(this._laserlineStyle)}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached,t(e)&&(this._externalResources.laserline.style=e))}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached))}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=r(e,F),this.recreateGeometry()}_updateMaterial(){if(i(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}}_updateGeometry(){t(this.object)&&this._updateVertices(this.object)}_updateVertices(e){const s=this._extensionType===V.FADED?this._updateLineSegmentFinite(T):this._updateLineSegmentInfinite(this._extensionType,T);this._updateVertexAttributes(e,s),t(this._externalResources)&&(this._externalResources.laserline.intersectsLine=s)}_updateLineSegmentFinite(e){return E(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const s=this.view.state.camera;switch(y(this._ray,W),e){case V.LINE:W.c0=-Number.MAX_VALUE;break;case V.RAY:case V.GROUND_RAY:{const e=this._ray.origin,t=r(this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground"),0),s=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&s<t&&h(W.ray.direction,W.ray.direction),this._extensionType===V.GROUND_RAY&&null!=t&&(W.c1=Math.abs(s-t));break}}if(!b(s.frustum,W))return E(this._start,this._end,t);const i=g(W,L),n=x(W,S);return E(i,n,t)}_updateVertexAttributes(e,t){const s=e.geometries[0].getMutableAttribute(v.POSITION).data;if(this.extensionType===V.FADED){const e=R(t,-this.fadedExtensions.start,L);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=R(t,0,L);s[3]=i[0],s[4]=i[1],s[5]=i[2];const r=R(t,1,L);s[6]=r[0],s[7]=r[1],s[8]=r[2];const n=R(t,1+this.fadedExtensions.end,L);s[9]=n[0],s[10]=n[1],s[11]=n[2]}else{const e=R(t,0,L);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=R(t,1,L);s[3]=i[0],s[4]=i[1],s[5]=i[2]}e.geometryVertexAttrsUpdated(e.geometryRecords[0])}}const W=m(),L=_(),S=_(),T=w();var V;!function(e){e[e.LINE=0]="LINE",e[e.RAY=1]="RAY",e[e.GROUND_RAY=2]="GROUND_RAY",e[e.FADED=3]="FADED"}(V||(V={}));const N=1/3,F={start:N,end:N};export{G as ExtendedLineVisualElement,V as ExtensionType};
5
+ import"../../../../core/has.js";import e from"../../../../core/Handles.js";import{isSome as t,unwrap as s,isNone as i,unwrapOr as r}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{c as a,b as l,w as o,x as h}from"../../../../chunks/vec3.js";import{c as _,f as d}from"../../../../chunks/vec3f64.js";import{g as p,c as u}from"../../../../chunks/vec4.js";import{f as c,a as f}from"../../../../chunks/vec4f32.js";import{create as m,fromRay as y,getStart as g,getEnd as x}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as b}from"../../../../geometry/support/frustum.js";import{create as w,fromPoints as E,pointAt as R}from"../../../../geometry/support/lineSegment.js";import{create as O,fromPoints as D}from"../../../../geometry/support/ray.js";import{LaserlineVisualElement as A}from"./LaserlineVisualElement.js";import{Object3DVisualElement as C}from"./Object3DVisualElement.js";import{createPolylineGeometry as P}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as j}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as v}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as M}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends C{constructor(t){super(t),this._ray=O(),this._externalResources=null,this._handles=new e,this._isWorldDown=!1,this._start=_(),this._end=d(1,0,0),this._width=1,this._color=c(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=c(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=V.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=j.OccludeAndTransparent,this._fadedExtensions=F,this.applyProps(t)}createExternalResources(){const e=new M(this.materialParameters);this._handles.add(n((()=>this.view.state.camera),(()=>{this._updateGeometry()})));const t=new A({view:this.view,attached:this._laserlineEnabled});this._externalResources={material:e,laserline:t}}destroyExternalResources(){t(this._externalResources)&&this._externalResources.laserline.destroy(),this._externalResources=null,this._handles.removeAll()}forEachExternalMaterial(e){t(this._externalResources)&&e(this._externalResources.material)}createGeometries(e){const t=[_(),_()],i=this.extensionType===V.FADED;i&&t.push(_(),_());const r=i?new Float32Array([1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]):null,n=P(t,null,r);e.addGeometry(n,s(this._externalResources).material),this._updateVertices(e)}updateVisibility(e){super.updateVisibility(e),t(this._externalResources)&&(this._externalResources.laserline.visible=e)}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,a(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),l(this._end,e,this._end),D(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,o(this._start,e)||(a(this._start,e),D(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,o(this._end,e)||(a(this._end,e),D(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){p(e,this._color)||(u(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){p(e,this._innerColor)||(u(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const s=t(e)!==t(this._stipplePattern);this._stipplePattern=e,s?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(i(e)||i(this._stippleOffColor)||!p(e,this._stippleOffColor))&&(this._stippleOffColor=t(e)?f(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this._updateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&t(this._laserlineStyle)}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached,t(e)&&(this._externalResources.laserline.style=e))}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,t(this._externalResources)&&(this._externalResources.laserline.attached=this._laserlineAttached))}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=r(e,F),this.recreateGeometry()}_updateMaterial(){if(i(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}}_updateGeometry(){t(this.object)&&this._updateVertices(this.object)}_updateVertices(e){const s=this._extensionType===V.FADED?this._updateLineSegmentFinite(T):this._updateLineSegmentInfinite(this._extensionType,T);this._updateVertexAttributes(e,s),t(this._externalResources)&&(this._externalResources.laserline.intersectsLine=s)}_updateLineSegmentFinite(e){return E(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const s=this.view.state.camera;switch(y(this._ray,W),e){case V.LINE:W.c0=-Number.MAX_VALUE;break;case V.RAY:case V.GROUND_RAY:{const e=this._ray.origin,t=r(this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground"),0),s=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&s<t&&h(W.ray.direction,W.ray.direction),this._extensionType===V.GROUND_RAY&&null!=t&&(W.c1=Math.abs(s-t));break}}if(!b(s.frustum,W))return E(this._start,this._end,t);const i=g(W,L),n=x(W,S);return E(i,n,t)}_updateVertexAttributes(e,t){const s=e.geometries[0].getMutableAttribute(v.POSITION).data;if(this.extensionType===V.FADED){const e=R(t,-this.fadedExtensions.start,L);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=R(t,0,L);s[3]=i[0],s[4]=i[1],s[5]=i[2];const r=R(t,1,L);s[6]=r[0],s[7]=r[1],s[8]=r[2];const n=R(t,1+this.fadedExtensions.end,L);s[9]=n[0],s[10]=n[1],s[11]=n[2]}else{const e=R(t,0,L);s[0]=e[0],s[1]=e[1],s[2]=e[2];const i=R(t,1,L);s[3]=i[0],s[4]=i[1],s[5]=i[2]}e.geometryVertexAttrsUpdated(e.geometryRecords[0])}}const W=m(),L=_(),S=_(),T=w();var V;!function(e){e[e.LINE=0]="LINE",e[e.RAY=1]="RAY",e[e.GROUND_RAY=2]="GROUND_RAY",e[e.FADED=3]="FADED"}(V||(V={}));const N=1/3,F={start:N,end:N};export{G as ExtendedLineVisualElement,V as ExtensionType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e,isNone as t,unwrap as r}from"../../../../core/maybe.js";import{f as s}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{s as a,m as o}from"../../../../chunks/vec3.js";import{Z as l,c as n}from"../../../../chunks/vec3f64.js";import{f as h,a as m}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{lineStripsToParameters as _,createGeometry as f}from"../../support/engineContent/line.js";import{RenderOccludedFlag as d}from"../../webgl-engine/lib/Material.js";import{RibbonLineMaterial as u}from"../../webgl-engine/materials/RibbonLineMaterial.js";class c extends p{constructor(t,r){super(t),this._hasExternalMaterial=!1,this._renderOccluded=d.OccludeAndTransparent,this._width=1,this._color=h(1,0,1,1),this._innerWidth=1,this._innerColor=null,this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._writeDepthEnabled=!0,this._falloff=0,this._polygonOffset=!1,this._material=r,this._hasExternalMaterial=e(r),this.applyProps(t)}setGeometryFromRenderSpacePoint(e,t=1e3){const r=[];r.push([[e[0]-t,e[1]+0,e[2]+0],[e[0]+t,e[1]+0,e[2]+0]]),r.push([[e[0]-0,e[1]-t,e[2]+0],[e[0]+0,e[1]+t,e[2]+0]]),r.push([[e[0]-0,e[1]+0,e[2]-t],[e[0]+0,e[1]+0,e[2]+t]]),this.geometry=r}setGeometryFromExtent(e){const t=this.view.spatialReference,r=n(),s=n(),i=100,o=[];a(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[2],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[2],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[0],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),this.geometry=[o]}setGeometryFromFrustum(e){const t=[];e.lines.forEach((e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])})),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,i=e.basis2,a=.5,o=n(),l=n(),h=n(),m=n();o[0]=r[0]-s[0]*a-i[0]*a,o[1]=r[1]-s[1]*a-i[1]*a,o[2]=r[2]-s[2]*a-i[2]*a,l[0]=r[0]-s[0]*a+i[0]*a,l[1]=r[1]-s[1]*a+i[1]*a,l[2]=r[2]-s[2]*a+i[2]*a,h[0]=r[0]+s[0]*a+i[0]*a,h[1]=r[1]+s[1]*a+i[1]*a,h[2]=r[2]+s[2]*a+i[2]*a,m[0]=r[0]+s[0]*a-i[0]*a,m[1]=r[1]+s[1]*a-i[1]*a,m[2]=r[2]+s[2]*a-i[2]*a,t.push([o[0],o[1],o[2]]),t.push([l[0],l[1],l[2]]),t.push([h[0],h[1],h[2]]),t.push([m[0],m[1],m[2]]),t.push([o[0],o[1],o[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;this.transform=s(g,t);const{points:r}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[r]}setGeometryFromSegments(e,t=l){this.transform=s(g,t),this.geometry=e.map((e=>e.createRenderGeometry(t,this.view.renderCoordsHelper).points))}getTransformedGeometry(){return t(this._geometry)?null:this._geometry.map((e=>e.map((e=>o(n(),e,this.transform)))))}get renderOccluded(){return e(this._material)?this._material.parameters.renderOccluded:this._renderOccluded}set renderOccluded(t){this._renderOccluded=t,e(this._material)&&this._material.setParameters({renderOccluded:t})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return e(this._material)?this._material.parameters.width:this._width}set width(t){this._width=t,e(this._material)&&this._material.setParameters({width:t})}get color(){return e(this._material)?this._material.parameters.color:this._color}set color(t){this._color=m(t),e(this._material)&&this._material.setParameters({color:this._color})}get innerWidth(){return e(this._material)?this._material.parameters.innerWidth:this._innerWidth}set innerWidth(t){this._innerWidth=t,e(this._material)&&this._material.setParameters({innerWidth:t})}get innerColor(){return e(this._material)?this._material.parameters.innerColor:this._innerColor}set innerColor(t){this._innerColor=e(t)?m(t):t,e(this._material)&&this._material.setParameters({innerColor:this._innerColor})}get stipplePattern(){return e(this._material)?this._material.parameters.stipplePattern:this._stipplePattern}set stipplePattern(t){this._stipplePattern=t,e(this._material)&&this._material.setParameters({stipplePattern:t})}get stippleOffColor(){return e(this._material)?this._material.parameters.stippleOffColor:this._stippleOffColor}set stippleOffColor(t){this._stippleOffColor=e(t)?m(t):null,e(this._material)&&this._material.setParameters({stippleOffColor:this._stippleOffColor})}get stipplePreferContinuous(){return e(this._material)?this._material.parameters.stipplePreferContinuous:this._stipplePreferContinuous}set stipplePreferContinuous(t){this._stipplePreferContinuous=t,e(this._material)&&this._material.setParameters({stipplePreferContinuous:t})}get writeDepthEnabled(){return e(this._material)?this._material.parameters.writeDepth:this._writeDepthEnabled}set writeDepthEnabled(t){this._writeDepthEnabled=t,e(this._material)&&this._material.setParameters({writeDepth:t})}get falloff(){return e(this._material)?this._material.parameters.falloff:this._falloff}set falloff(t){this._falloff=t,e(this._material)&&this._material.setParameters({falloff:t})}get polygonOffset(){return e(this._material)?this._material.parameters.hasPolygonOffset:this._polygonOffset}set polygonOffset(t){this._polygonOffset=t,e(this._material)&&this._material.setParameters({hasPolygonOffset:t})}createExternalResources(){this._hasExternalMaterial||(this._material=new u({width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,isClosed:!1,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,hasPolygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}))}destroyExternalResources(){this._hasExternalMaterial||(this._material=null)}createGeometries(e){for(const t of _(this.geometry)){const s=f(t);e.addGeometry(s,r(this._material))}}forEachExternalMaterial(e){this._hasExternalMaterial||e(r(this._material))}}const g=i();export{c as LineVisualElement};
5
+ import{isSome as e,isNone as t,unwrap as r}from"../../../../core/maybe.js";import{f as s}from"../../../../chunks/mat4.js";import{c as i}from"../../../../chunks/mat4f64.js";import{s as a,v as o}from"../../../../chunks/vec3.js";import{Z as l,c as n}from"../../../../chunks/vec3f64.js";import{f as h,a as m}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as p}from"./Object3DVisualElement.js";import{lineStripsToParameters as _,createGeometry as f}from"../../support/engineContent/line.js";import{RenderOccludedFlag as d}from"../../webgl-engine/lib/Material.js";import{RibbonLineMaterial as u}from"../../webgl-engine/materials/RibbonLineMaterial.js";class c extends p{constructor(t,r){super(t),this._hasExternalMaterial=!1,this._renderOccluded=d.OccludeAndTransparent,this._width=1,this._color=h(1,0,1,1),this._innerWidth=1,this._innerColor=null,this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._writeDepthEnabled=!0,this._falloff=0,this._polygonOffset=!1,this._material=r,this._hasExternalMaterial=e(r),this.applyProps(t)}setGeometryFromRenderSpacePoint(e,t=1e3){const r=[];r.push([[e[0]-t,e[1]+0,e[2]+0],[e[0]+t,e[1]+0,e[2]+0]]),r.push([[e[0]-0,e[1]-t,e[2]+0],[e[0]+0,e[1]+t,e[2]+0]]),r.push([[e[0]-0,e[1]+0,e[2]-t],[e[0]+0,e[1]+0,e[2]+t]]),this.geometry=r}setGeometryFromExtent(e){const t=this.view.spatialReference,r=n(),s=n(),i=100,o=[];a(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[2],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[2],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[0],e[3],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),a(r,e[0],e[1],i),this.view.renderCoordsHelper.toRenderCoords(r,t,s),o.push([s[0],s[1],s[2]]),this.geometry=[o]}setGeometryFromFrustum(e){const t=[];e.lines.forEach((e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])})),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],r=e.origin,s=e.basis1,i=e.basis2,a=.5,o=n(),l=n(),h=n(),m=n();o[0]=r[0]-s[0]*a-i[0]*a,o[1]=r[1]-s[1]*a-i[1]*a,o[2]=r[2]-s[2]*a-i[2]*a,l[0]=r[0]-s[0]*a+i[0]*a,l[1]=r[1]-s[1]*a+i[1]*a,l[2]=r[2]-s[2]*a+i[2]*a,h[0]=r[0]+s[0]*a+i[0]*a,h[1]=r[1]+s[1]*a+i[1]*a,h[2]=r[2]+s[2]*a+i[2]*a,m[0]=r[0]+s[0]*a-i[0]*a,m[1]=r[1]+s[1]*a-i[1]*a,m[2]=r[2]+s[2]*a-i[2]*a,t.push([o[0],o[1],o[2]]),t.push([l[0],l[1],l[2]]),t.push([h[0],h[1],h[2]]),t.push([m[0],m[1],m[2]]),t.push([o[0],o[1],o[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;this.transform=s(g,t);const{points:r}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[r]}setGeometryFromSegments(e,t=l){this.transform=s(g,t),this.geometry=e.map((e=>e.createRenderGeometry(t,this.view.renderCoordsHelper).points))}getTransformedGeometry(){return t(this._geometry)?null:this._geometry.map((e=>e.map((e=>o(n(),e,this.transform)))))}get renderOccluded(){return e(this._material)?this._material.parameters.renderOccluded:this._renderOccluded}set renderOccluded(t){this._renderOccluded=t,e(this._material)&&this._material.setParameters({renderOccluded:t})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return e(this._material)?this._material.parameters.width:this._width}set width(t){this._width=t,e(this._material)&&this._material.setParameters({width:t})}get color(){return e(this._material)?this._material.parameters.color:this._color}set color(t){this._color=m(t),e(this._material)&&this._material.setParameters({color:this._color})}get innerWidth(){return e(this._material)?this._material.parameters.innerWidth:this._innerWidth}set innerWidth(t){this._innerWidth=t,e(this._material)&&this._material.setParameters({innerWidth:t})}get innerColor(){return e(this._material)?this._material.parameters.innerColor:this._innerColor}set innerColor(t){this._innerColor=e(t)?m(t):t,e(this._material)&&this._material.setParameters({innerColor:this._innerColor})}get stipplePattern(){return e(this._material)?this._material.parameters.stipplePattern:this._stipplePattern}set stipplePattern(t){this._stipplePattern=t,e(this._material)&&this._material.setParameters({stipplePattern:t})}get stippleOffColor(){return e(this._material)?this._material.parameters.stippleOffColor:this._stippleOffColor}set stippleOffColor(t){this._stippleOffColor=e(t)?m(t):null,e(this._material)&&this._material.setParameters({stippleOffColor:this._stippleOffColor})}get stipplePreferContinuous(){return e(this._material)?this._material.parameters.stipplePreferContinuous:this._stipplePreferContinuous}set stipplePreferContinuous(t){this._stipplePreferContinuous=t,e(this._material)&&this._material.setParameters({stipplePreferContinuous:t})}get writeDepthEnabled(){return e(this._material)?this._material.parameters.writeDepth:this._writeDepthEnabled}set writeDepthEnabled(t){this._writeDepthEnabled=t,e(this._material)&&this._material.setParameters({writeDepth:t})}get falloff(){return e(this._material)?this._material.parameters.falloff:this._falloff}set falloff(t){this._falloff=t,e(this._material)&&this._material.setParameters({falloff:t})}get polygonOffset(){return e(this._material)?this._material.parameters.hasPolygonOffset:this._polygonOffset}set polygonOffset(t){this._polygonOffset=t,e(this._material)&&this._material.setParameters({hasPolygonOffset:t})}createExternalResources(){this._hasExternalMaterial||(this._material=new u({width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,isClosed:!1,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,hasPolygonOffset:this._polygonOffset,renderOccluded:this._renderOccluded,writeDepth:this._writeDepthEnabled}))}destroyExternalResources(){this._hasExternalMaterial||(this._material=null)}createGeometries(e){for(const t of _(this.geometry)){const s=f(t);e.addGeometry(s,r(this._material))}}forEachExternalMaterial(e){this._hasExternalMaterial||e(r(this._material))}}const g=i();export{c as LineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Handles.js";import{unwrap as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{f as a,a as c,b as n,s as h,j as l}from"../../../../chunks/vec2.js";import{k as d,c as m,n as u,b as _,a as p}from"../../../../chunks/vec3.js";import{c as f,f as g}from"../../../../chunks/vec3f64.js";import{g as j,c as b}from"../../../../chunks/vec4.js";import{f as w}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as x}from"./Object3DVisualElement.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as O}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as G}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";class v extends x{constructor(t){super(t),this._handles=new e,this._location=f(),this._direction=g(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=w(1,0,1,1),this._renderOccluded=O.OccludeAndTransparent,this.applyProps(t)}get location(){return this._location}set location(e){d(this._location,e)||(m(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(m(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){u(this._direction,_(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){j(e,this._color)||(b(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}createExternalResources(){const e=new R(this.materialParameters);this._handles.add(i((()=>this.view.state.camera),(()=>{this._updateGeometry()}))),this._externalResources={material:e}}destroyExternalResources(){this._handles.removeAll(),this._externalResources=null}createGeometries(e){const r=y([f(),f()]),s=y([f(),f()]),i=t(this._externalResources).material;e.addGeometry(r,i),e.addGeometry(s,i),this._updateVertices(e)}forEachExternalMaterial(e){r(this._externalResources)&&e(this._externalResources.material)}_updateMaterial(){if(s(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded}}_updateGeometry(){const e=this.object;s(e)||this._updateVertices(e)}_updateVertices(e){const t=this.view.state.camera;t.projectToScreen(this.location,A),p(V,this.location,this.direction),t.projectToScreen(V,M),a(M,c(M,M,A)),this._updateVertexAttributes(t,e,0,A,M,1),this._updateVertexAttributes(t,e,1,A,M,-1)}_updateVertexAttributes(e,t,r,s,i,o){const a=t.geometryRecords[r],c=a.geometry.getMutableAttribute(G.POSITION).data,d=n(P,h(P,i[1]*o,i[0]*-o),this.offset+this.width/2),m=l(k,l(k,l(k,s,n(k,i,this.length/2)),d),d),u=l(E,m,n(E,i,-this.length));e.unprojectFromScreen(m,V),c[0]=V[0],c[1]=V[1],c[2]=V[2],e.unprojectFromScreen(u,V),c[3]=V[0],c[4]=V[1],c[5]=V[2],t.geometryVertexAttrsUpdated(a)}}const V=f(),A=o(),M=o(),P=o(),k=o(),E=o();export{v as ParallelLineVisualElement};
5
+ import e from"../../../../core/Handles.js";import{unwrap as t,isSome as r,isNone as s}from"../../../../core/maybe.js";import{watch as i}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{f as a,a as c,b as n,s as h,j as l}from"../../../../chunks/vec2.js";import{w as d,c as m,n as u,b as _,a as p}from"../../../../chunks/vec3.js";import{c as f,f as g}from"../../../../chunks/vec3f64.js";import{g as j,c as b}from"../../../../chunks/vec4.js";import{f as w}from"../../../../chunks/vec4f32.js";import{Object3DVisualElement as x}from"./Object3DVisualElement.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as O}from"../../webgl-engine/lib/Material.js";import{VertexAttribute as G}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";class v extends x{constructor(t){super(t),this._handles=new e,this._location=f(),this._direction=g(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=w(1,0,1,1),this._renderOccluded=O.OccludeAndTransparent,this.applyProps(t)}get location(){return this._location}set location(e){d(this._location,e)||(m(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(m(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){u(this._direction,_(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){j(e,this._color)||(b(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}createExternalResources(){const e=new R(this.materialParameters);this._handles.add(i((()=>this.view.state.camera),(()=>{this._updateGeometry()}))),this._externalResources={material:e}}destroyExternalResources(){this._handles.removeAll(),this._externalResources=null}createGeometries(e){const r=y([f(),f()]),s=y([f(),f()]),i=t(this._externalResources).material;e.addGeometry(r,i),e.addGeometry(s,i),this._updateVertices(e)}forEachExternalMaterial(e){r(this._externalResources)&&e(this._externalResources.material)}_updateMaterial(){if(s(this._externalResources))return;this._externalResources.material.setParameters(this.materialParameters)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded}}_updateGeometry(){const e=this.object;s(e)||this._updateVertices(e)}_updateVertices(e){const t=this.view.state.camera;t.projectToScreen(this.location,A),p(V,this.location,this.direction),t.projectToScreen(V,M),a(M,c(M,M,A)),this._updateVertexAttributes(t,e,0,A,M,1),this._updateVertexAttributes(t,e,1,A,M,-1)}_updateVertexAttributes(e,t,r,s,i,o){const a=t.geometryRecords[r],c=a.geometry.getMutableAttribute(G.POSITION).data,d=n(P,h(P,i[1]*o,i[0]*-o),this.offset+this.width/2),m=l(k,l(k,l(k,s,n(k,i,this.length/2)),d),d),u=l(E,m,n(E,i,-this.length));e.unprojectFromScreen(m,V),c[0]=V[0],c[1]=V[1],c[2]=V[2],e.unprojectFromScreen(u,V),c[3]=V[0],c[4]=V[1],c[5]=V[2],t.geometryVertexAttrsUpdated(a)}}const V=f(),A=o(),M=o(),P=o(),k=o(),E=o();export{v as ParallelLineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.25/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import s from"../../../core/Logger.js";import{applySome as i,isSome as l,isNone as o}from"../../../core/maybe.js";import{initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{WhereClause as d}from"../../../core/sql/WhereClause.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import p from"../../../layers/support/FeatureFilter.js";import{fixFields as h,unpackFieldNames as y,populateMissingFields as c}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/Query.js";import{BuildingSublayerView3DMixin as m}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as g}from"./I3SMeshView3D.js";import{ForAllFeaturesReturnType as F,ForAllFeaturesVisibilityMode as b}from"./II3SMeshView3D.js";import{applyFilterMode as _}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as x}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as j}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as I,getIndexCrs as v}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as Q}from"./support/DefinitionExpressionSceneLayerView.js";import L from"../../layers/BuildingComponentSublayerView.js";import{getRequiredFields as q,getFetchPopupTemplate as A}from"../../layers/support/popupUtils.js";import{TaskPriority as R}from"../../support/Scheduler.js";let C=class extends(Q(g(m(L)))){constructor(){super(...arguments),this.type="building-component-sublayer-3d",this.layerView=null,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerUid(){return this.sublayer.layer.uid}get sublayerUid(){return this.sublayer.uid}initialize(){this.updatingHandles.add((()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields]),(()=>this._updateRequiredFields())),this.updatingHandles.add((()=>this.sublayer.renderer),(e=>this._rendererChange(e)),a),this.updatingHandles.add((()=>[this.parsedDefinitionExpression,this.filter,i(this._filter,(({parsedWhereClause:e,parsedGeometry:r,sortedObjectIds:t})=>[e,r,t]))]),(()=>this._filterChange())),this.updatingHandles.add((()=>this.parsedFilterExpressions),(()=>this._updateSymbologyOverride()),a),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return"Overview"!==this.sublayer.modelName&&this.layerView?this.layerView.filterExpressions.map((([e,r])=>{let t;try{t=d.create(e,this.sublayer.fieldsIndex)}catch(o){return s.getLogger(this.declaredClass).error("Failed to parse filterExpression: "+o),null}if(!t.isStandardized)return s.getLogger(this.declaredClass).error("filterExpression is using non standard function"),null;const i=[],l=t.fieldNames;return I(l,this.sublayer.fields,{missingFields:i}),i.length>0?(s.getLogger(this.declaredClass).error(`filterExpression references unknown fields: ${i.join(", ")}`),null):[t,r]})).filter((e=>null!=e)):[]}get filter(){return l(this._filter)?this._filter.viewFilter:null}set filter(e){!o(e)&&w.checkSupport(e)?l(this._filter)?this._filter.viewFilter=e:this._filter=new w({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),applyFilters:()=>this._applyFilters(!0),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError)}):this._filter=null}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride(((r,t)=>{for(const[i,l]of e)try{if(i.testFeature(r))return _(t,l)}catch(s){this.logError(s)}return _(t,null)}),this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return h(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce(((e,[r])=>e.concat(r.fieldNames)),new Array))}get availableFields(){const e=this.sublayer,r=e.fieldsIndex;let t=this.requiredFields;if(e.outFields||e.layer.outFields){const s=[...e.outFields||[],...e.layer.outFields||[]];t=[...y(r,s),...t]}return h(r,t)}_createLayerGraphic(e){const t=new r(null,null,e);return t.layer=this.sublayer.layer,t.sourceLayer=this.sublayer,t}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}async fetchPopupFeatures(e,r){const t=this._validateFetchPopupFeatures(r);if(t)throw t;if(o(r)||!r.clientGraphics||0===r.clientGraphics.length)return[];const i=[],a=[],n=l(this.sublayer.associatedLayer)?await this.sublayer.associatedLayer.load():this.sublayer,u=y(this.sublayer.fieldsIndex,await q(n,A(this.sublayer,r))),d=new Set;for(const s of r.clientGraphics)c(u,s,d)?a.push(s):i.push(s);return 0===a.length?i:(l(this.sublayer.associatedLayer)&&await this.sublayer.associatedLayer.load().catch((()=>s.getLogger(this.declaredClass).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes."))),this.whenGraphicAttributes(a,Array.from(d)).catch((()=>a)).then((e=>i.concat(e))))}async _updateRequiredFields(){const e=h(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields||[],...this.filterExpressionFields||[]]);this._set("requiredFields",e)}_validateFetchPopupFeatures(e){const{sublayer:r}=this,{popupEnabled:s}=r;return s?A(r,e)?void 0:new t("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:r}):new t("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:r})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),l(this._filter)&&this._filter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return l(this.filter)?this.filter.createQuery(e):new f(e)}queryExtent(e,r){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),r?.signal)}queryFeatureCount(e,r){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),r?.signal)}queryFeatures(e,r){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),r?.signal).then((e=>{if(!e?.features)return e;const r=this.sublayer,t=r.layer;for(const s of e.features)s.layer=t,s.sourceLayer=r;return e}))}queryObjectIds(e,r){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),r?.signal)}_ensureQueryEngine(){return o(this._queryEngine)&&(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=E(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new x({layerView:this,priority:R.FEATURE_QUERY_ENGINE,spatialIndex:new j({featureAdapter:new S({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),toArray:()=>{const e=new Array;return this._forAllFeatures(((r,t,s)=>(e.push({id:r,index:t,meta:s}),F.CONTINUE)),null,b.ALL_IN_CLIPPING_AREA),e},forAllFeatures:(e,r)=>this._forAllFeatures(((r,t,s)=>e({id:r,index:t,meta:s})),r,b.ALL_IN_CLIPPING_AREA),getFeatureExtent:e,sourceSpatialReference:v(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():f.from(e))}};e([n()],C.prototype,"i3slayer",null),e([n()],C.prototype,"layerView",void 0),e([n()],C.prototype,"lodFactor",null),e([n({readOnly:!0})],C.prototype,"parsedFilterExpressions",null),e([n({type:p})],C.prototype,"filter",null),e([n()],C.prototype,"_filter",void 0),e([n({type:[String],readOnly:!0})],C.prototype,"filterExpressionFields",null),e([n({type:[String],readOnly:!0})],C.prototype,"requiredFields",void 0),e([n({type:[String],readOnly:!0})],C.prototype,"availableFields",null),C=e([u("esri.views.3d.layers.BuildingComponentSublayerView3D")],C);const V=C;export{V as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import s from"../../../core/Logger.js";import{applySome as i,isSome as l,isNone as o}from"../../../core/maybe.js";import{initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{WhereClause as d}from"../../../core/sql/WhereClause.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import p from"../../../layers/support/FeatureFilter.js";import{fixFields as h,unpackFieldNames as y,populateMissingFields as c}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/Query.js";import{BuildingSublayerView3DMixin as g}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as m}from"./I3SMeshView3D.js";import{ForAllFeaturesReturnType as F,ForAllFeaturesVisibilityMode as b}from"./II3SMeshView3D.js";import{applyFilterMode as _}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as x}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as S}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as I}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as j,getIndexCrs as v}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as Q}from"./support/DefinitionExpressionSceneLayerView.js";import L from"../../layers/BuildingComponentSublayerView.js";import{getRequiredFields as q,getFetchPopupTemplate as A}from"../../layers/support/popupUtils.js";import{TaskPriority as R}from"../../support/Scheduler.js";let C=class extends(Q(m(g(L)))){constructor(){super(...arguments),this.type="building-component-sublayer-3d",this.layerView=null,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerUid(){return this.sublayer.layer.uid}get sublayerUid(){return this.sublayer.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}initialize(){this.updatingHandles.add((()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields]),(()=>this._updateRequiredFields())),this.updatingHandles.add((()=>this.sublayer.renderer),(e=>this._rendererChange(e)),a),this.updatingHandles.add((()=>[this.parsedDefinitionExpression,this.filter,i(this._filter,(({parsedWhereClause:e,parsedGeometry:r,sortedObjectIds:t})=>[e,r,t]))]),(()=>this._filterChange())),this.updatingHandles.add((()=>this.parsedFilterExpressions),(()=>this._updateSymbologyOverride()),a),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return"Overview"!==this.sublayer.modelName&&this.layerView?this.layerView.filterExpressions.map((([e,r])=>{let t;try{t=d.create(e,this.sublayer.fieldsIndex)}catch(o){return s.getLogger(this.declaredClass).error("Failed to parse filterExpression: "+o),null}if(!t.isStandardized)return s.getLogger(this.declaredClass).error("filterExpression is using non standard function"),null;const i=[],l=t.fieldNames;return j(l,this.sublayer.fields,{missingFields:i}),i.length>0?(s.getLogger(this.declaredClass).error(`filterExpression references unknown fields: ${i.join(", ")}`),null):[t,r]})).filter((e=>null!=e)):[]}get filter(){return l(this._filter)?this._filter.viewFilter:null}set filter(e){!o(e)&&w.checkSupport(e)?l(this._filter)?this._filter.viewFilter=e:this._filter=new w({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),applyFilters:()=>this._applyFilters(!0),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError)}):this._filter=null}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride(((r,t)=>{for(const[i,l]of e)try{if(i.testFeature(r))return _(t,l)}catch(s){this.logError(s)}return _(t,null)}),this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return h(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce(((e,[r])=>e.concat(r.fieldNames)),new Array))}get availableFields(){const e=this.sublayer,r=e.fieldsIndex;let t=this.requiredFields;if(e.outFields||e.layer.outFields){const s=[...e.outFields||[],...e.layer.outFields||[]];t=[...y(r,s),...t]}return h(r,t)}_createLayerGraphic(e){const t=new r(null,null,e);return t.layer=this.sublayer.layer,t.sourceLayer=this.sublayer,t}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}async fetchPopupFeatures(e,r){const t=this._validateFetchPopupFeatures(r);if(t)throw t;if(o(r)||!r.clientGraphics||0===r.clientGraphics.length)return[];const i=[],a=[],n=l(this.sublayer.associatedLayer)?await this.sublayer.associatedLayer.load():this.sublayer,u=y(this.sublayer.fieldsIndex,await q(n,A(this.sublayer,r))),d=new Set;for(const s of r.clientGraphics)c(u,s,d)?a.push(s):i.push(s);return 0===a.length?i:(l(this.sublayer.associatedLayer)&&await this.sublayer.associatedLayer.load().catch((()=>s.getLogger(this.declaredClass).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes."))),this.whenGraphicAttributes(a,Array.from(d)).catch((()=>a)).then((e=>i.concat(e))))}async _updateRequiredFields(){const e=h(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields||[],...this.filterExpressionFields||[]]);this._set("requiredFields",e)}_validateFetchPopupFeatures(e){const{sublayer:r}=this,{popupEnabled:s}=r;return s?A(r,e)?void 0:new t("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:r}):new t("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:r})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),l(this._filter)&&this._filter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return l(this.filter)?this.filter.createQuery(e):new f(e)}queryExtent(e,r){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),r?.signal)}queryFeatureCount(e,r){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),r?.signal)}queryFeatures(e,r){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),r?.signal).then((e=>{if(!e?.features)return e;const r=this.sublayer,t=r.layer;for(const s of e.features)s.layer=t,s.sourceLayer=r;return e}))}queryObjectIds(e,r){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),r?.signal)}_ensureQueryEngine(){return o(this._queryEngine)&&(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=E(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new x({layerView:this,priority:R.FEATURE_QUERY_ENGINE,spatialIndex:new I({featureAdapter:new S({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),toArray:()=>{const e=new Array;return this._forAllFeatures(((r,t,s)=>(e.push({id:r,index:t,meta:s}),F.CONTINUE)),null,b.ALL_IN_CLIPPING_AREA),e},forAllFeatures:(e,r)=>this._forAllFeatures(((r,t,s)=>e({id:r,index:t,meta:s})),r,b.ALL_IN_CLIPPING_AREA),getFeatureExtent:e,sourceSpatialReference:v(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(o(e)?this.createQuery():f.from(e))}};e([n()],C.prototype,"i3slayer",null),e([n()],C.prototype,"layerView",void 0),e([n()],C.prototype,"lodFactor",null),e([n({readOnly:!0})],C.prototype,"parsedFilterExpressions",null),e([n({type:p})],C.prototype,"filter",null),e([n()],C.prototype,"_filter",void 0),e([n({type:[String],readOnly:!0})],C.prototype,"filterExpressionFields",null),e([n({type:[String],readOnly:!0})],C.prototype,"requiredFields",void 0),e([n({type:[String],readOnly:!0})],C.prototype,"availableFields",null),C=e([u("esri.views.3d.layers.BuildingComponentSublayerView3D")],C);const V=C;export{V as default};