@arcgis/core 5.2.0-next.137 → 5.2.0-next.138

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 (466) hide show
  1. package/analysis/LineOfSightAnalysisObserver.d.ts +12 -0
  2. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  3. package/analysis/LineOfSightAnalysisTarget.d.ts +12 -0
  4. package/analysis/LineOfSightAnalysisTarget.js +1 -1
  5. package/arcade/featureset/sources/FeatureLayerParquet.js +1 -1
  6. package/arcgisGlobal.d.ts +4 -0
  7. package/assets/components/assets/icon/blockHeightMedium16.json +1 -0
  8. package/assets/components/assets/icon/blockHeightMedium24.json +1 -0
  9. package/assets/components/assets/icon/blockHeightMedium32.json +1 -0
  10. package/assets/components/assets/icon/blockHeightShort16.json +1 -0
  11. package/assets/components/assets/icon/blockHeightShort24.json +1 -0
  12. package/assets/components/assets/icon/blockHeightShort32.json +1 -0
  13. package/assets/components/assets/icon/blockHeightTall16.json +1 -0
  14. package/assets/components/assets/icon/blockHeightTall24.json +1 -0
  15. package/assets/components/assets/icon/blockHeightTall32.json +1 -0
  16. package/assets/components/assets/icon/cursorCircle16.json +1 -0
  17. package/assets/components/assets/icon/cursorCircle24.json +1 -0
  18. package/assets/components/assets/icon/cursorCircle32.json +1 -0
  19. package/assets/components/assets/icon/dictionary16.json +1 -0
  20. package/assets/components/assets/icon/dictionary24.json +1 -0
  21. package/assets/components/assets/icon/dictionary32.json +1 -0
  22. package/assets/components/assets/icon/jobDependency16.json +1 -0
  23. package/assets/components/assets/icon/jobDependency24.json +1 -0
  24. package/assets/components/assets/icon/jobDependency32.json +1 -0
  25. package/assets/components/assets/icon/referenceChip16.json +1 -0
  26. package/assets/components/assets/icon/referenceChip24.json +1 -0
  27. package/assets/components/assets/icon/referenceChip32.json +1 -0
  28. package/assets/esri/core/workers/RemoteClient.js +1 -1
  29. package/assets/esri/core/workers/chunks/{4e6f95d8c624d513849a.js → 05963f57cbe5a5249496.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{0b8681ca4a83e97f1f71.js → 067de1910190da228291.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{3c0fd1c6cda44e9f40ab.js → 070684943698fa43c2b4.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{bc1cb4b9a02e6c78deb7.js → 076e8d2e08ff2a013736.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{c10e040368065411506a.js → 10445313d0d57b34511b.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{d537c59b46cdaaf66034.js → 1188d0a136fffc009643.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{20af3f085f60c32c6c53.js → 178083d8ed7707b45ca2.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{f5efe3e800c6e23efcf3.js → 1819c45655c836b9a8d7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +2 -0
  38. package/assets/esri/core/workers/chunks/{d8d8b38ac8a91d9e45fc.js → 1cc744ab5eee5ee3bed8.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{05e39b4de7f62c5b22cc.js → 20f75cc777af13fa249b.js} +1 -1
  40. package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +2 -0
  41. package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +1 -0
  42. package/assets/esri/core/workers/chunks/{60f6d5da9480dd36e877.js → 3dddae78286d05eb10fc.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{9efd30bbd02ec0d1031b.js → 3ec3589f6e74d7cb87cf.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{0bec054fca104f3bf141.js → 3f776d9fd2ab68b21fca.js} +1 -1
  45. package/assets/esri/core/workers/chunks/402a82c77420254831bc.js +1 -0
  46. package/assets/esri/core/workers/chunks/{e2ebf0ea3af2e6907987.js → 406f24ec13eb30d43405.js} +1 -1
  47. package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +1 -0
  48. package/assets/esri/core/workers/chunks/{ddedc414bb478b376221.js → 46b2d4addfc73f9183a4.js} +1 -1
  49. package/assets/esri/core/workers/chunks/498d6dfd3bb0d3490548.js +1 -0
  50. package/assets/esri/core/workers/chunks/{36ef86701883a20dd6f6.js → 4a640548032355e57acd.js} +1 -1
  51. package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +1 -0
  52. package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js → 590e6c70206122e4cc3c.js} +2 -2
  53. package/assets/esri/core/workers/chunks/{54860dd53a46cf4c47f3.js → 59295b99bdff4045a0e7.js} +1 -1
  54. package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +1 -0
  55. package/assets/esri/core/workers/chunks/{5da86409d70098fc6a10.js → 5b3cfe95314a75a735c1.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{a54678bfa0f1807b61cd.js → 5c855af73ee3c3e764fb.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{a8b7e6198c2d0c37c9a0.js → 5e90c1b49f2b7e21d05a.js} +4 -4
  58. package/assets/esri/core/workers/chunks/{30f808cac8a34f95ea6e.js → 6079d27f4ab319fb8f0c.js} +1 -1
  59. package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +1 -0
  60. package/assets/esri/core/workers/chunks/{dac90b3631f7f7158f68.js → 67f15538c51838201fc7.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js → 68d8ae42ab71d01a70a5.js} +2 -2
  62. package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +1 -0
  63. package/assets/esri/core/workers/chunks/{864e7030c4ddbfcf0114.js → 6ccf9535013fe672c93b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{ba7f0cf7e495d3ec2d55.js → 6e62581d933e7298d1f6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{83b5dd4029e00abd80bf.js → 700b1d5bc67b7e1b3ff3.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f9fea72cc222a30ef2f9.js → 72399062767abdfb0bee.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{2a7fbfd77002a24bf737.js → 747461bb6a1bc2f0a64d.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{c333f6ed42985bb2b11f.js → 7851aef196eea5d6c94e.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{f0b6bd6fab5320c3082f.js → 7a05b18f655c1167ce0a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{04296b75d0f81fbd1bb5.js → 864194927d05ebc4cc31.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{3c4a13a9f0b305394a26.js → 876f7633c15f1e31078d.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{62298dba3f6cbdc3f4ae.js → 879b2f0ff1977bca9376.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{b547b3bce729c9dac90d.js → 898359be6996fd9763b8.js} +1 -1
  74. package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +1 -0
  75. package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +2 -0
  76. package/assets/esri/core/workers/chunks/{625f02db93d7fbf175ca.js → 9001e9a1e81bce175ddd.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{9ffa6c8d93d3443834c6.js → 912080c90b5cc2e817cf.js} +1 -1
  78. package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +2 -0
  79. package/assets/esri/core/workers/chunks/{13e4379441499599c3b5.js → 9cbde13e536676767900.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{408db4f32850b77264ae.js → 9cd3fcb5fca6f9dbbcd8.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a054da6cbd8ee4774a57.js +1 -0
  82. package/assets/esri/core/workers/chunks/{468fa166608ffc9108d9.js → a05790444115e4cf1bcc.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{d1f2685782b423ef87a6.js → a556dd4e9e6d35e33a2c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{00d576d355599c88931e.js → bc38def1983089514e4b.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{0725e515f3004bdd5c56.js → ca2adcbcf44454484fd5.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{f3507b9e831ffd7a6bf8.js → cca8bd07bcd1d267a2e8.js} +1 -1
  87. package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +1 -0
  88. package/assets/esri/core/workers/chunks/{1d6b2a64f4e40e5cc13d.js → d201fbf3ceff946d2bd6.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{4439078780d9ba49fd26.js → d51bb11baadc741c46bc.js} +1 -1
  90. package/assets/esri/core/workers/chunks/db1ab9b9c8bf5c7635d3.js +1 -0
  91. package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +1 -0
  92. package/assets/esri/core/workers/chunks/e630f3c56c077cb2bd8e.js +1 -0
  93. package/assets/esri/core/workers/chunks/e81173724e8de8c1e65b.js +1 -0
  94. package/assets/esri/core/workers/chunks/{2025288bed125594ceda.js → f6e62d2d279a328cbed7.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{47c19778fcee7154ca38.js → f8bc474434fd365ab174.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{9a20dc26cb9c7b2087cf.js → f95a1f878c9c1146180e.js} +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
  128. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
  131. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
  132. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
  133. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
  134. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
  135. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
  137. package/assets/esri/widgets/FeatureForm/t9n/messages.ar.json +1 -1
  138. package/assets/esri/widgets/FeatureForm/t9n/messages.bg.json +1 -1
  139. package/assets/esri/widgets/FeatureForm/t9n/messages.bs.json +1 -1
  140. package/assets/esri/widgets/FeatureForm/t9n/messages.ca.json +1 -1
  141. package/assets/esri/widgets/FeatureForm/t9n/messages.cs.json +1 -1
  142. package/assets/esri/widgets/FeatureForm/t9n/messages.da.json +1 -1
  143. package/assets/esri/widgets/FeatureForm/t9n/messages.de.json +1 -1
  144. package/assets/esri/widgets/FeatureForm/t9n/messages.el.json +1 -1
  145. package/assets/esri/widgets/FeatureForm/t9n/messages.es.json +1 -1
  146. package/assets/esri/widgets/FeatureForm/t9n/messages.et.json +1 -1
  147. package/assets/esri/widgets/FeatureForm/t9n/messages.fi.json +1 -1
  148. package/assets/esri/widgets/FeatureForm/t9n/messages.fr.json +1 -1
  149. package/assets/esri/widgets/FeatureForm/t9n/messages.he.json +1 -1
  150. package/assets/esri/widgets/FeatureForm/t9n/messages.hr.json +1 -1
  151. package/assets/esri/widgets/FeatureForm/t9n/messages.hu.json +1 -1
  152. package/assets/esri/widgets/FeatureForm/t9n/messages.id.json +1 -1
  153. package/assets/esri/widgets/FeatureForm/t9n/messages.it.json +1 -1
  154. package/assets/esri/widgets/FeatureForm/t9n/messages.ja.json +1 -1
  155. package/assets/esri/widgets/FeatureForm/t9n/messages.ko.json +1 -1
  156. package/assets/esri/widgets/FeatureForm/t9n/messages.lt.json +1 -1
  157. package/assets/esri/widgets/FeatureForm/t9n/messages.lv.json +1 -1
  158. package/assets/esri/widgets/FeatureForm/t9n/messages.nl.json +1 -1
  159. package/assets/esri/widgets/FeatureForm/t9n/messages.no.json +1 -1
  160. package/assets/esri/widgets/FeatureForm/t9n/messages.pl.json +1 -1
  161. package/assets/esri/widgets/FeatureForm/t9n/messages.pt-BR.json +1 -1
  162. package/assets/esri/widgets/FeatureForm/t9n/messages.pt-PT.json +1 -1
  163. package/assets/esri/widgets/FeatureForm/t9n/messages.ro.json +1 -1
  164. package/assets/esri/widgets/FeatureForm/t9n/messages.ru.json +1 -1
  165. package/assets/esri/widgets/FeatureForm/t9n/messages.sk.json +1 -1
  166. package/assets/esri/widgets/FeatureForm/t9n/messages.sl.json +1 -1
  167. package/assets/esri/widgets/FeatureForm/t9n/messages.sr.json +1 -1
  168. package/assets/esri/widgets/FeatureForm/t9n/messages.sv.json +1 -1
  169. package/assets/esri/widgets/FeatureForm/t9n/messages.th.json +1 -1
  170. package/assets/esri/widgets/FeatureForm/t9n/messages.tr.json +1 -1
  171. package/assets/esri/widgets/FeatureForm/t9n/messages.uk.json +1 -1
  172. package/assets/esri/widgets/FeatureForm/t9n/messages.vi.json +1 -1
  173. package/assets/esri/widgets/FeatureForm/t9n/messages.zh-CN.json +1 -1
  174. package/assets/esri/widgets/FeatureForm/t9n/messages.zh-HK.json +1 -1
  175. package/assets/esri/widgets/FeatureForm/t9n/messages.zh-TW.json +1 -1
  176. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ar.json +1 -1
  177. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bg.json +1 -1
  178. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.bs.json +1 -1
  179. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ca.json +1 -1
  180. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.cs.json +1 -1
  181. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.da.json +1 -1
  182. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
  183. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.el.json +1 -1
  184. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.es.json +1 -1
  185. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.et.json +1 -1
  186. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fi.json +1 -1
  187. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.fr.json +1 -1
  188. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.he.json +1 -1
  189. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hr.json +1 -1
  190. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.hu.json +1 -1
  191. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.id.json +1 -1
  192. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.it.json +1 -1
  193. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ja.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ko.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lt.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.lv.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.nl.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.no.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pl.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-BR.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.pt-PT.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ro.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.ru.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sk.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sl.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sr.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.sv.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.th.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.tr.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.uk.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.vi.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-CN.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-HK.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.zh-TW.json +1 -1
  215. package/chunks/Bufferer-CclWhXVb.js +1 -1
  216. package/chunks/Component.glsl.js +3 -3
  217. package/chunks/DefaultMaterial.glsl.js +2 -2
  218. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  219. package/chunks/Envelope.js +1 -1
  220. package/chunks/Envelope2D.js +1 -1
  221. package/chunks/FocusArea.glsl.js +8 -10
  222. package/chunks/GaussianSplat.glsl.js +2 -2
  223. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  224. package/chunks/GeodeticUtils.js +1 -1
  225. package/chunks/Geometry.js +1 -1
  226. package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
  227. package/chunks/LineMarker.glsl.js +35 -42
  228. package/chunks/MultiPathImpl.js +1 -1
  229. package/chunks/OperatorAffineTransform.js +1 -1
  230. package/chunks/OperatorClip.js +1 -1
  231. package/chunks/OperatorDensify.js +1 -1
  232. package/chunks/OperatorDistance.js +1 -1
  233. package/chunks/OperatorGeneralize.js +1 -1
  234. package/chunks/OperatorGeodesicBuffer.js +1 -1
  235. package/chunks/OperatorGeodeticArea.js +1 -1
  236. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  237. package/chunks/OperatorGeodeticDistance.js +1 -1
  238. package/chunks/OperatorGeodeticLength.js +1 -1
  239. package/chunks/OperatorGraphicBuffer.js +1 -1
  240. package/chunks/OperatorIntegrate.js +1 -1
  241. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  242. package/chunks/OperatorProximity.js +1 -1
  243. package/chunks/OperatorProximityGeodesic.js +1 -1
  244. package/chunks/OperatorShapePreservingLength.js +1 -1
  245. package/chunks/OperatorShapePreservingProject.js +1 -1
  246. package/chunks/OperatorSimplifyOGC.js +1 -1
  247. package/chunks/Path.glsl.js +2 -2
  248. package/chunks/Point2D.js +1 -1
  249. package/chunks/RealisticTree.glsl.js +2 -2
  250. package/chunks/RibbonLine.glsl.js +50 -56
  251. package/chunks/SideCalculator2D-DX0718xq.js +1 -1
  252. package/chunks/Terrain.glsl.js +2 -2
  253. package/chunks/Transformation2D.js +1 -1
  254. package/chunks/UnitFactory.js +1 -1
  255. package/config.js +1 -1
  256. package/core/workers/RemoteClient.js +1 -1
  257. package/core/workers/workerFactory.js +1 -1
  258. package/editing/fieldUtils.d.ts +12 -0
  259. package/geometry/operators/extendOperator.js +1 -1
  260. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  261. package/geometry/operators/gx/operatorBoundary.js +1 -1
  262. package/geometry/operators/gx/operatorBuffer.js +1 -1
  263. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  264. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  265. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  266. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  267. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  268. package/geometry/operators/gx/operatorOffset.js +1 -1
  269. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  270. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  271. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  272. package/geometry/operators/isNearOperator.js +1 -1
  273. package/geometry/operators/reshapeOperator.js +1 -1
  274. package/geometry/operators/support/jsonConverter.js +1 -1
  275. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  276. package/interfaces.d.ts +15 -18
  277. package/kernel.js +1 -1
  278. package/layers/LinkChartLayer.js +1 -1
  279. package/layers/ParquetLayer.js +1 -1
  280. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  281. package/layers/list/LayerItemCollection.d.ts +1 -0
  282. package/layers/list/types.d.ts +5 -1
  283. package/layers/support/TimeSeriesCalculation.d.ts +1 -1
  284. package/layers/support/TimeSeriesCalculation.js +1 -1
  285. package/layers/support/dataSeriesUtils.d.ts +10 -0
  286. package/layers/support/timeSeriesUtils.js +17 -6
  287. package/libs/lyr3d/Lyr3DModule.js +1 -1
  288. package/networks/UtilityNetwork.d.ts +15 -0
  289. package/networks/UtilityNetwork.js +1 -1
  290. package/package.json +4 -4
  291. package/popup/FeatureContent.d.ts +14 -1
  292. package/popup/FeatureContent.js +1 -1
  293. package/popup/FeatureContentCollection.d.ts +4 -10
  294. package/popup/FeatureContentCollection.js +1 -1
  295. package/popup/actions.js +1 -1
  296. package/popup/support/featureUtils.js +1 -1
  297. package/renderers/support/RenderingInfo.js +1 -1
  298. package/renderers/support/renderingInfoUtils.js +1 -1
  299. package/renderers/visualVariables/SizeVariable.d.ts +16 -20
  300. package/renderers/visualVariables/support/SizeStop.d.ts +6 -2
  301. package/rest/networks/support/TraceLocation.js +1 -1
  302. package/rest/networks/support/TraceResult.d.ts +7 -0
  303. package/rest/networks/support/TraceResult.js +1 -1
  304. package/smartMapping/renderers/color.js +1 -1
  305. package/smartMapping/renderers/opacity.js +1 -1
  306. package/smartMapping/renderers/size.js +1 -1
  307. package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
  308. package/smartMapping/statistics/histogramForTimeSeries.d.ts +11 -0
  309. package/smartMapping/statistics/histogramForTimeSeries.js +2 -0
  310. package/smartMapping/statistics/summaryStatisticsForTimeSeries.d.ts +11 -0
  311. package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +2 -0
  312. package/smartMapping/statistics/support/timeSeriesUtils.js +24 -0
  313. package/smartMapping/statistics/types.d.ts +50 -0
  314. package/symbols/cim/CIMPlacements.js +1 -1
  315. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  316. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  317. package/views/2d/engine/webgl/definitions.js +1 -1
  318. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  319. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  320. package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +1 -1
  321. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextParams.js +1 -1
  322. package/views/2d/layers/SketchLayerView2D.js +1 -1
  323. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  324. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  325. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  326. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  327. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  328. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  329. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  330. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  331. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  332. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  333. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  334. package/views/2d/layers/features/schema/ExceedsLimitCache.js +1 -1
  335. package/views/2d/layers/features/schema/TimeSchema.js +2 -0
  336. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  337. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  338. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  339. package/views/2d/types.d.ts +2 -1
  340. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  341. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  342. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  343. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +24 -0
  344. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  345. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  346. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  347. package/views/3d/camera/constraintUtils.js +1 -1
  348. package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
  349. package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
  350. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  351. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  352. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  353. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  354. package/views/3d/state/controllers/momentum/GroundNavigationMomentumController.js +1 -1
  355. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  356. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  357. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  358. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  359. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
  360. package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +12 -0
  361. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  362. package/views/3d/webgl-engine/effects/focusArea/FocusArea.glsl.js +1 -1
  363. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  364. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  365. package/views/SelectionManager.d.ts +3 -3
  366. package/views/draw/support/Reshape.js +1 -1
  367. package/views/interactive/options/bindViewToolOptions.js +1 -1
  368. package/views/interactive/sketch/SketchLabelOptions.d.ts +3 -0
  369. package/views/interactive/sketch/SketchLabelOptions.js +1 -1
  370. package/views/interactive/sketch/SketchTooltipOptions.d.ts +3 -0
  371. package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
  372. package/views/interactive/sketch/SketchValueOptions.d.ts +3 -0
  373. package/views/interactive/sketch/SketchValueOptions.js +1 -1
  374. package/views/interactive/snapping/SnappingOptions.d.ts +3 -0
  375. package/views/interactive/snapping/SnappingOptions.js +1 -1
  376. package/views/interactive/snapping/snappingUtils.js +1 -1
  377. package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
  378. package/views/layers/SketchLayerView.d.ts +34 -0
  379. package/views/layers/SketchLayerView.js +2 -0
  380. package/views/layers/types.d.ts +3 -2
  381. package/views/selection/types.d.ts +15 -4
  382. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  383. package/widgets/BasemapGallery.js +1 -1
  384. package/widgets/Bookmarks/BookmarksViewModel.d.ts +4 -0
  385. package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +5 -1
  386. package/widgets/Bookmarks/types.d.ts +2 -0
  387. package/widgets/Editor/EditorViewModel.d.ts +31 -30
  388. package/widgets/Editor/EditorViewModel.js +1 -1
  389. package/widgets/Editor/components/Settings.js +1 -1
  390. package/widgets/Editor/types.d.ts +44 -0
  391. package/widgets/Editor.d.ts +30 -27
  392. package/widgets/Editor.js +1 -1
  393. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
  394. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  395. package/widgets/FeatureTable/support/FeatureStore.d.ts +1 -1
  396. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  397. package/widgets/FeatureTable.d.ts +6 -0
  398. package/widgets/FeatureTable.js +1 -1
  399. package/widgets/Histogram/types.d.ts +10 -2
  400. package/widgets/HistogramRangeSlider/types.d.ts +4 -1
  401. package/widgets/LayerList/LayerListViewModel.d.ts +2 -1
  402. package/widgets/Legend/LegendViewModel.d.ts +2 -0
  403. package/widgets/Legend/styles/card/CardView.d.ts +2 -0
  404. package/widgets/Legend/styles/classic/ClassicView.d.ts +4 -1
  405. package/widgets/Legend.d.ts +3 -0
  406. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +7 -0
  407. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  408. package/widgets/OrientedImageryViewer/types.d.ts +9 -0
  409. package/widgets/OrientedImageryViewer.d.ts +7 -0
  410. package/widgets/OrientedImageryViewer.js +2 -2
  411. package/widgets/PanoramicVideoViewer.js +1 -1
  412. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  413. package/widgets/ScaleRangeSlider/types.d.ts +9 -2
  414. package/widgets/Sketch/SketchViewModel.d.ts +32 -1
  415. package/widgets/Sketch/SketchViewModel.js +1 -1
  416. package/widgets/Sketch.d.ts +27 -1
  417. package/widgets/Sketch.js +1 -1
  418. package/widgets/Slider/types.d.ts +58 -13
  419. package/widgets/Slider.d.ts +6 -0
  420. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.d.ts +2 -0
  421. package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +2 -0
  422. package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +2 -0
  423. package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +2 -0
  424. package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +2 -0
  425. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +2 -0
  426. package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +2 -0
  427. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +3 -0
  428. package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +2 -0
  429. package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +2 -0
  430. package/widgets/smartMapping/types.d.ts +30 -7
  431. package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +21 -11
  432. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  433. package/widgets/support/FilterBuilder/types.d.ts +28 -0
  434. package/widgets/support/FilterBuilder.js +1 -1
  435. package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +24 -0
  436. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  437. package/widgets/support/FilterCondition/types.d.ts +16 -1
  438. package/widgets/support/FilterCondition.js +1 -1
  439. package/widgets/support/SnappingControls/snappingLayerListUtils.js +1 -1
  440. package/widgets/support/iconUtils.js +1 -1
  441. package/assets/esri/core/workers/chunks/0606ab6fdfc1dfea3856.js +0 -1
  442. package/assets/esri/core/workers/chunks/1289204f8ca96032c17a.js +0 -1
  443. package/assets/esri/core/workers/chunks/12b5a645c0987a0efe54.js +0 -2
  444. package/assets/esri/core/workers/chunks/17b938ba49fb1e7ab8c4.js +0 -1
  445. package/assets/esri/core/workers/chunks/1dbb3e25e005a8220779.js +0 -2
  446. package/assets/esri/core/workers/chunks/3d6fef25af7e1a51e1bd.js +0 -1
  447. package/assets/esri/core/workers/chunks/55ae00f33f5240a73a50.js +0 -1
  448. package/assets/esri/core/workers/chunks/74211d096cc3296e0968.js +0 -1
  449. package/assets/esri/core/workers/chunks/7926faab76a721a2e1c4.js +0 -1
  450. package/assets/esri/core/workers/chunks/96c3900685cfb2a8ca12.js +0 -1
  451. package/assets/esri/core/workers/chunks/ad28486bc6afaa346de5.js +0 -1
  452. package/assets/esri/core/workers/chunks/ad29c729e90b5866713c.js +0 -1
  453. package/assets/esri/core/workers/chunks/b72a2514aa4cc4ae7d1b.js +0 -1
  454. package/assets/esri/core/workers/chunks/be761749f8d77fbd9df5.js +0 -1
  455. package/assets/esri/core/workers/chunks/d4f55e2b1ace7867a3b8.js +0 -1
  456. package/assets/esri/core/workers/chunks/dbfd25aa0d19aed5890c.js +0 -1
  457. package/assets/esri/core/workers/chunks/de28a86775235bd5d3c4.js +0 -2
  458. package/assets/esri/core/workers/chunks/f6cfc901267a229de7a1.js +0 -2
  459. package/assets/esri/core/workers/chunks/fb147097149a89e671ff.js +0 -1
  460. package/support/revision.js +0 -2
  461. /package/assets/esri/core/workers/chunks/{1dbb3e25e005a8220779.js.LICENSE.txt → 1b946714ca4a1a7359d4.js.LICENSE.txt} +0 -0
  462. /package/assets/esri/core/workers/chunks/{f6cfc901267a229de7a1.js.LICENSE.txt → 2a1ec30f9ad305763f81.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{c3b96d1d43afccd23e45.js.LICENSE.txt → 590e6c70206122e4cc3c.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{cfaba0470619786e1ef8.js.LICENSE.txt → 68d8ae42ab71d01a70a5.js.LICENSE.txt} +0 -0
  465. /package/assets/esri/core/workers/chunks/{de28a86775235bd5d3c4.js.LICENSE.txt → 8dc1c3042267618fd710.js.LICENSE.txt} +0 -0
  466. /package/assets/esri/core/workers/chunks/{12b5a645c0987a0efe54.js.LICENSE.txt → 96c50a0dda0f1503ef92.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{initial as a,watch as o}from"../../../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{create as u,fromPoints as d}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as f}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as p,LineOfSightTargetManipulator as m,LineOfSightTargetManipulatorState as h,getInteractiveLineOfSightTargetManipulatorState as g}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as _}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as v}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as y}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as b}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as x,dragAtLocation as S,sceneSnappingAtLocation as C,dragManipulatedObject as w}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as T}from"../../../interactive/InteractiveToolBase.js";import{bindViewToolOptions as E}from"../../../interactive/options/bindViewToolOptions.js";import D from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as O}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as k}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as A,enterInputModeIfAvailable as j}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as M}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const N=u();let P=class extends T{constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new Map,this._updatingHandles=new l,this._toolOptions=new D,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null,this._tooltipHandle=null,this._tooltipObject=null,this._tooltipUndoRecord=null,this._tooltipInfo=new M({toolOptions:this._toolOptions,viewType:`3d`})}initialize(){let{view:e}=this;this._tooltip=A(()=>({view:e,options:this._toolOptions.tooltips})),this._interactionVisuals=new f({view:e}),this.addHandles([E(this._toolOptions,()=>e.options),this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),a),o(()=>this._tooltip.mode,e=>{e!==`input`&&this._grabbedManipulator==null&&this._disconnectTooltip()})]),this.finishToolCreation()}destroy(){this._disconnectTooltip(),this._tooltip=r(this._tooltip),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.itemType===`observer`?new p(this.view,{deleting:!1,intersection:null,type:`observer`}):new m(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._tooltipObject===e&&this._disconnectTooltip(),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this.manipulators.remove(t),t.destroy(),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e))}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){this._tooltipObject!=null&&this._tooltipObject!==e&&this._disconnectTooltip();let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),j(e,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===b.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t,this._connectTooltip(e)):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals(),this._tooltip.mode!==`input`&&this._disconnectTooltip())}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return x(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=k({snappingContext:new O({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new _}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(S(this.view,t.elevationAlignedLocation)).next(v(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(C(this.view,e.elevationInfo)).next(...l).next(w(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_connectTooltip(e){this._disconnectTooltip(),this._tooltipObject=e,this._tooltipHandle=y(this._tooltip,e,()=>({activeTooltipInfo:this._tooltipInfo,onRecordUndo:e=>this.events.emit(`record-undo`,{record:e}),callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=e.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{this._tooltipUndoRecord!=null&&(this.events.emit(`record-undo`,{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=i(this._tooltipHandle),this._tooltipObject=null,this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.itemType!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?h.undefined:r.computationResult.isTargetVisible?h.visible:h.occluded;t.state=this.interacting&&t.selected?g(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.itemType===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:d(r.renderLocation,t.renderLocation,N);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([s({constructOnly:!0})],P.prototype,`analysisViewData`,void 0),e([s({constructOnly:!0})],P.prototype,`snappingManager`,void 0),e([s({constructOnly:!0})],P.prototype,`view`,void 0),e([s()],P.prototype,`automaticManipulatorSelection`,void 0),e([s()],P.prototype,`removeIncompleteOnCancel`,void 0),e([s()],P.prototype,`interacting`,void 0),e([s()],P.prototype,`manipulatorsInteractive`,void 0),e([s()],P.prototype,`_grabbedManipulator`,void 0),e([s()],P.prototype,`updating`,null),P=e([c(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],P);export{P as LineOfSightItemTool};
2
+ import{__decorate as e}from"tslib";import{EventEmitter as t}from"../../../../core/Evented.js";import{handlesGroup as n}from"../../../../core/handleUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import a from"../../../../core/ReactiveMap.js";import{initial as o,watch as s,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../../../core/support/UpdatingHandles.js";import{create as f,fromPoints as p}from"../../../../geometry/support/lineSegment.js";import{LineOfSightInteractionVisuals as m}from"./LineOfSightInteractionVisuals.js";import{LineOfSightObserverManipulator as h,LineOfSightTargetManipulator as g,LineOfSightTargetManipulatorState as _,getInteractiveLineOfSightTargetManipulatorState as v}from"./LineOfSightManipulators.js";import{SnappingVisualizer3D as y}from"../../interactive/SnappingVisualizer3D.js";import{screenToMapAtSceneSurface as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{connectTooltipToManipulatedObject as x}from"../../interactive/editingTools/tooltipUtils3D.js";import{mouseButtons as S}from"../../../input/mouseButtons.js";import{createManipulatorDragEventPipeline as C,dragAtLocation as w,sceneSnappingAtLocation as T,dragManipulatedObject as E}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as D}from"../../../interactive/InteractiveToolBase.js";import{bindViewToolOptions as O}from"../../../interactive/options/bindViewToolOptions.js";import k from"../../../interactive/options/InteractiveToolOptions.js";import{SnappingContext as A}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as M,enterInputModeIfAvailable as N}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as P}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const F=f(),I=Symbol(`inactiveManipulatorDisplay`);let L=class extends D{get _manipulatorsToHide(){let e=this._manipulatorByObject.values();return this.view.tools.some(e=>e.hasGrabbedManipulators)||e.some(e=>e.grabbing)?e.filter(e=>!e.grabbing).toArray():[]}constructor(e){super(e),this.events=new t,this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this.interacting=!1,this.manipulatorsInteractive=!0,this._objectByItem=new Map,this._manipulatorByObject=new a,this._updatingHandles=new d,this._toolOptions=new k,this._interactionVisuals=null,this._grabbedManipulator=null,this._visualsManipulator=null,this._tooltipHandle=null,this._tooltipObject=null,this._tooltipUndoRecord=null,this._tooltipInfo=new P({toolOptions:this._toolOptions,viewType:`3d`})}initialize(){let{view:e}=this;this._tooltip=M(()=>({view:e,options:this._toolOptions.tooltips})),this._interactionVisuals=new m({view:e}),this.addHandles([O(this._toolOptions,()=>e.options),this._updatingHandles.add(()=>({analysisVisible:this.analysisViewData.visible,computations:this.analysisViewData.computations.toArray().map(e=>({isTargetVisible:e.computationResult.isTargetVisible,isValid:e.computationResult.isValid,target:e.target})),grabbedManipulator:this._grabbedManipulator,interacting:this.interacting,manipulatorsInteractive:this.manipulatorsInteractive,visible:this.visible}),()=>this._syncManipulators(),o),s(()=>this._manipulatorsToHide,e=>{let t=e.map(e=>e.disableDisplay());this.removeHandles(I),this.addHandles(t,I)},c),s(()=>this._tooltip.mode,e=>{e!==`input`&&this._grabbedManipulator==null&&this._disconnectTooltip()})]),this.finishToolCreation()}destroy(){this.removeHandles(I),this._disconnectTooltip(),this._tooltip=r(this._tooltip),this._interactionVisuals=r(this._interactionVisuals),this._updatingHandles.destroy(),this._objectByItem.clear(),this._manipulatorByObject.clear(),super.destroy()}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}get laserLineVisualElement(){return this._interactionVisuals?.laserLineVisualElement??null}get verticalLineVisualElement(){return this._interactionVisuals?.verticalLineVisualElement??null}showInteractionVisuals(e){this._visualsManipulator=this._manipulatorByObject.get(e),this._syncInteractionVisuals()}hideInteractionVisuals(){this._visualsManipulator=null,this._syncInteractionVisuals()}addObject(e){if(this._manipulatorByObject.has(e))return;let t=e.item.type===`observer`?new h(this.view,{deleting:!1,intersection:null,type:`observer`}):new g(this.view,{deleting:!1,target:e.item,type:`target`});t.cursor=`move`,this._objectByItem.set(e.item,e),this._manipulatorByObject.set(e,t),this.manipulators.add(t),this.addHandles(this._connectManipulator(e,t),e),this._syncManipulator(e,t)}removeObject(e){let t=this._manipulatorByObject.get(e);t!=null&&(this._grabbedManipulator===t&&(this._grabbedManipulator=null),this._tooltipObject===e&&this._disconnectTooltip(),this._visualsManipulator===t&&this.hideInteractionVisuals(),this.removeHandles(e),this.removeHandles(e),this._objectByItem.delete(e.item),this._manipulatorByObject.delete(e),this.manipulators.remove(t),t.destroy())}getManipulator(e){let t=this._objectByItem.get(e);return t==null?null:this._manipulatorByObject.get(t)}hasManipulatorAt(e,t){for(let n of this._manipulatorByObject.values())if(n.consumesClicks&&n.intersectionDistance(e,t)!=null)return!0;return!1}selectObject(e){this._tooltipObject!=null&&this._tooltipObject!==e&&this._disconnectTooltip();let t=!1;for(let[n,r]of this._manipulatorByObject){let i=n===e;r.selected=i,t||=i}return this._syncManipulators(),t}onInputEvent(e){e.type===`hold`&&this._grabbedManipulator!=null&&(this._visualsManipulator=this._grabbedManipulator,this._syncInteractionVisuals()),N(e,this._tooltip)}onManipulatorSelectionChanged(){[...this._manipulatorByObject.values()].some(e=>e.selected)||this.events.emit(`selection-cleared`)}_connectManipulator(e,t){let r=()=>this._syncManipulator(e,t);return n([e.on(`committed`,r),e.on(`modified-externally`,r),t.events.on(`immediate-click`,n=>{this.events.emit(`select-item`,{item:e.item}),n.button===S.Right&&t.metadata.type===`target`&&this.events.emit(`delete-item`,{target:t.metadata.target}),n.stopPropagation()}),t.events.on(`grab-changed`,({action:n})=>{n===`start`?(this.events.emit(`select-item`,{item:e.item}),this._grabbedManipulator=t,this._connectTooltip(e)):this._grabbedManipulator===t&&(this._grabbedManipulator=null,this.hideInteractionVisuals(),this._tooltip.mode!==`input`&&this._disconnectTooltip()),this._manipulatorByObject.set(e,t)}),t.events.on(`drag`,t=>{e.updateDragIntersection(t),t.action===`start`&&this.showInteractionVisuals(e)}),t.events.on(`location-update`,()=>this._syncInteractionVisuals()),this._createDragHandle(e,t)])}_createDragHandle(e,t){return C(t,(n,r,i,a)=>{let o=e.operations;if(o==null)return;let s=null,{cancelSnapping:c,snappingStep:l}=j({snappingContext:new A({editGeometryOperations:o,elevationInfo:e.elevationInfo,pointer:a,visualizer:new y}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!0});i.next(e=>(s?.undo(null),s=null,e)).next(c);let u=o.data.allVerticesUnordered.at(0);r.next(t=>(t.action===`start`&&(s=e.createUndoRecord()),{...t,snapOrigin:u?.pos})).next(w(this.view,t.elevationAlignedLocation)).next(b(this.view,o.data.geometry,e.elevationInfo,o.data.spatialReference)).next(T(this.view,e.elevationInfo)).next(...l).next(E(e)).next(e=>(e.action===`end`&&s!=null&&(this.events.emit(`record-undo`,{record:s}),s=null),e))})}_connectTooltip(e){this._disconnectTooltip(),this._tooltipObject=e,this._tooltipHandle=x(this._tooltip,e,()=>({activeTooltipInfo:this._tooltipInfo,onRecordUndo:e=>this.events.emit(`record-undo`,{record:e}),callbacks:{onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._tooltipUndoRecord=e.createUndoRecord()},onMove:()=>{},onMoveStop:()=>{this._tooltipUndoRecord!=null&&(this.events.emit(`record-undo`,{record:this._tooltipUndoRecord}),this._tooltipUndoRecord=null)},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}},toolOptions:this._toolOptions}))}_disconnectTooltip(){this._tooltipHandle=i(this._tooltipHandle),this._tooltipObject=null,this._tooltipUndoRecord=null,this._tooltip.clear()}_syncManipulators(){for(let[e,t]of this._manipulatorByObject)this._syncManipulator(e,t);this._syncInteractionVisuals()}_syncManipulator(e,t){let n=e.origin;if(t.available=this.visible&&e.visible&&n!=null,t.interactive=this.manipulatorsInteractive&&(this._grabbedManipulator==null||this._grabbedManipulator===t),n!=null&&(t.elevationAlignedLocation=n),e.item.type!==`target`)return;let r=this.analysisViewData.computations.find(t=>t.target===e.item),i=r==null||!r.computationResult.isValid?_.undefined:r.computationResult.isTargetVisible?_.visible:_.occluded;t.state=this.interacting&&t.selected?v(i):i}_syncInteractionVisuals(){let e=this._interactionVisuals,t=this._visualsManipulator,n=this.visible&&this.analysisViewData.visible;if(e==null||t==null||!n){e?.hide();return}let r=[...this._manipulatorByObject.entries()].find(([e])=>e.item.type===`observer`)?.[1];if(r==null){e.hide();return}let i=t===r?null:p(r.renderLocation,t.renderLocation,F);e.update({target:t.renderLocation,lineVerticalPlaneSegment:i,visible:!0})}};e([l({constructOnly:!0})],L.prototype,`analysisViewData`,void 0),e([l({constructOnly:!0})],L.prototype,`snappingManager`,void 0),e([l({constructOnly:!0})],L.prototype,`view`,void 0),e([l()],L.prototype,`automaticManipulatorSelection`,void 0),e([l()],L.prototype,`removeIncompleteOnCancel`,void 0),e([l()],L.prototype,`interacting`,void 0),e([l()],L.prototype,`manipulatorsInteractive`,void 0),e([l()],L.prototype,`_grabbedManipulator`,void 0),e([l()],L.prototype,`_manipulatorsToHide`,null),e([l()],L.prototype,`updating`,null),L=e([u(`esri.views.3d.analysis.LineOfSight.LineOfSightItemTool`)],L);export{L as LineOfSightItemTool};
@@ -1,4 +1,6 @@
1
1
  import type LineOfSightAnalysis from "../../../analysis/LineOfSightAnalysis.js";
2
+ import type LineOfSightAnalysisObserver from "../../../analysis/LineOfSightAnalysisObserver.js";
3
+ import type LineOfSightAnalysisTarget from "../../../analysis/LineOfSightAnalysisTarget.js";
2
4
  import type Collection from "../../../core/Collection.js";
3
5
  import type AnalysisView3D from "./AnalysisView3D.js";
4
6
  import type LineOfSightAnalysisResult from "./LineOfSightAnalysisResult.js";
@@ -73,6 +75,28 @@ export default abstract class LineOfSightAnalysisView3D extends AnalysisView3D {
73
75
  * ```
74
76
  */
75
77
  get results(): Collection<LineOfSightAnalysisResult | null | undefined>;
78
+ /**
79
+ * The observer or target currently selected for interactive editing. Use the item's `type` property to determine
80
+ * whether it is an observer or a target.
81
+ *
82
+ * @since 5.2
83
+ * @example
84
+ * ```ts
85
+ * const analysisView = await view.whenAnalysisView(analysis);
86
+ * analysisView.interactive = true;
87
+ *
88
+ * reactiveUtils.watch(() => analysisView.selectedItem, (item) => {
89
+ * if (item?.type === "observer") {
90
+ * const observer = item; // LineOfSightAnalysisObserver
91
+ * console.log("Selected observer:", observer.position);
92
+ * } else if (item?.type === "target") {
93
+ * const target = item; // LineOfSightAnalysisTarget
94
+ * console.log("Selected target:", target.position);
95
+ * }
96
+ * });
97
+ * ```
98
+ */
99
+ get selectedItem(): LineOfSightAnalysisObserver | LineOfSightAnalysisTarget | null | undefined;
76
100
  /**
77
101
  * The analysis view type.
78
102
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as n}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as f}from"./ViewshedSnappingController.js";import{ViewshedSubTool as p}from"./ViewshedSubTool.js";import{findSubTool as m}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as h}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{bindViewToolOptions as v}from"../../../interactive/options/bindViewToolOptions.js";import y from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as b,makeTooltip as x}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as S}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";let C=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new y,this._observerTooltipConnectionHandle=null,this._updatingHandles=new u}initialize(){let{snappingManager:e,view:t}=this;this._interactionVisuals=new d({view:t}),this._snappingController=new f({snappingManager:e,view:t}),this._initializeObserverTooltip(t);let r=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=n(()=>r,({viewshedComputedData:e})=>{let t=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([v(this._observerToolOptions,()=>t.options),a(()=>this.firstGrabbedManipulator,e=>{if(e!=null){let t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},o),this._updatingHandles.add(()=>{let e=this.selectedViewshedComputedData;return e==null?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(e==null)return;let{subTool:t,observer:n,target:r}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(n,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(r,!1)},s),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),s),this._updatingHandles.add(()=>this.selectedViewshed,e=>{let t=this._selectedManipulator,n=this._selectedSubTool;this._connectObserverTooltip(n),e==null?this._selectManipulator(null):(t==null||!n.hasManipulator(t))&&this._selectManipulator(n.observerManipulator)},s)])}destroy(){this._selectManipulator(null),this._disconnectObserverTooltip(),r(this.subToolHandles),r(this._interactionVisuals),r(this._snappingController),r(this._observerTooltip),this._updatingHandles.destroy()}get updating(){return!!this._snappingController?.updating||this._updatingHandles.updating||this.subToolHandles.some(({subTool:e})=>e.updating)}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){let t=this._selectedSubTool,n=this.selectedViewshedComputedData;if(t==null||n==null){this._interactionVisuals?.setVisibility(!1);return}let r=t.moveInteractionState,i=e?r.grabbing:r.dragging,a=t.scaleOrientInteractionState,o=e?a.grabbing:a.dragging;if(!(this.analysisViewData.visible&&(i||o))){this._interactionVisuals?.setVisibility(!1);return}let s=i?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:s,laserlineVisible:!0,verticalLineVisible:i,intersectsWorldUp:i})}createObserverMoveSnappingPipeline(e,t,n,r=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,n,r)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!b(e,this._observerTooltip))switch(e.type){case`key-down`:_.cancel===e.key?this._cancelKeyHandler(e):_.delete.includes(e.key)&&this._deleteKeyHandler(e);break;case`hold`:this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){let t=this._observerToolOptions;this._observerTooltip=x(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new S({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),e==null){this._observerTooltip.clear();return}let t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=h(this._observerTooltip,t,()=>({toolOptions:this._observerToolOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=i(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){let t=this.selectedViewshed;t!=null&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return m(this.subToolHandles,e)}_selectManipulator(e){let t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,t!=null&&(t.selected=!1),e!=null&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([c({constructOnly:!0})],C.prototype,`analysis`,void 0),e([c({constructOnly:!0})],C.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],C.prototype,`intersector`,void 0),e([c({constructOnly:!0})],C.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],C.prototype,`view`,void 0),e([c()],C.prototype,`subToolHandles`,void 0),e([c()],C.prototype,`removeIncompleteOnCancel`,void 0),e([c()],C.prototype,`automaticManipulatorSelection`,void 0),e([c()],C.prototype,`multiTouchEnabled`,void 0),e([c()],C.prototype,`_selectedManipulator`,void 0),e([c()],C.prototype,`_interactionVisuals`,void 0),e([c()],C.prototype,`_snappingController`,void 0),e([c()],C.prototype,`_observerTooltip`,void 0),e([c()],C.prototype,`_observerTooltipInfo`,void 0),e([c()],C.prototype,`updating`,null),e([c()],C.prototype,`grabbing`,null),e([c()],C.prototype,`cursor`,null),e([c()],C.prototype,`selectedViewshed`,null),e([c()],C.prototype,`selectedViewshedComputedData`,null),e([c()],C.prototype,`_selectedSubTool`,null),C=e([l(`esri.views.3d.analysis.Viewshed.ViewshedEditTool`)],C);export{C as ViewshedEditTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Collection.js";import"../../../../core/has.js";import{mapCollection as n}from"../../../../core/mapCollectionUtils.js";import{destroyMaybe as r,removeMaybe as i}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{ViewshedInteractionVisuals as d}from"./ViewshedInteractionVisuals.js";import{ViewshedSnappingController as f}from"./ViewshedSnappingController.js";import{ViewshedSubTool as p}from"./ViewshedSubTool.js";import{findSubTool as m}from"./viewshedSubToolUtils.js";import{connectTooltipToManipulatedObject as h}from"../../interactive/editingTools/tooltipUtils3D.js";import{InteractiveToolBase as g}from"../../../interactive/InteractiveToolBase.js";import{sketchKeys as _}from"../../../interactive/keybindings.js";import{bindViewToolOptions as v}from"../../../interactive/options/bindViewToolOptions.js";import y from"../../../interactive/options/InteractiveToolOptions.js";import{enterInputModeIfAvailable as b,makeTooltip as x}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as S}from"../../../interactive/tooltip/infos/MovePointTooltipInfo.js";const C=Symbol(`inactiveManipulatorDisplay`);let w=class extends g{constructor(e){super(e),this.subToolHandles=new t,this.removeIncompleteOnCancel=!1,this.automaticManipulatorSelection=!1,this.multiTouchEnabled=!1,this._selectedManipulator=null,this._observerToolOptions=new y,this._observerTooltipConnectionHandle=null,this._updatingHandles=new u}initialize(){let{snappingManager:e,view:t}=this;this._interactionVisuals=new d({view:t}),this._snappingController=new f({snappingManager:e,view:t}),this._initializeObserverTooltip(t);let r=this.analysisViewData.viewshedComputedDataHandles;this.subToolHandles=n(()=>r,({viewshedComputedData:e})=>{let t=new p({analysis:this.analysis,analysisViewData:this.analysisViewData,parentTool:this,view:this.view,viewshedComputedData:e});return{subTool:t,remove:()=>{this.selectedViewshed===e.viewshed&&(this.selectedViewshed=null),t.destroy()}}}),this.addHandles([v(this._observerToolOptions,()=>t.options),a(()=>this.firstGrabbedManipulator,e=>{if(e!=null){let t=this._findSubTool(e)?.viewshed;this.selectedViewshed=t,this._selectManipulator(e)}else this._selectedSubTool?.onManipulatorSelectionChanged()},o),a(()=>({grabbedManipulator:this.firstGrabbedManipulator,subTools:this.subToolHandles.map(({subTool:e})=>e).toArray()}),({grabbedManipulator:e,subTools:t})=>{let n=e==null?[]:t.map(t=>t.hideInactiveManipulators(e));this.removeHandles(C),this.addHandles(n,C),t.forEach(t=>t.setInteractive(t=>e==null||t===e))},o),this._updatingHandles.add(()=>{let e=this.selectedViewshedComputedData;return e==null?null:{subTool:this._selectedSubTool,observer:e.elevationAlignedObserverRenderSpace,target:e.elevationAlignedTargetRenderSpace}},e=>{if(e==null)return;let{subTool:t,observer:n,target:r}=e;t?.moveInteractionState.dragging?this._updateInteractionVisualsLocation(n,!0):t?.scaleOrientInteractionState.dragging&&this._updateInteractionVisualsLocation(r,!1)},s),this._updatingHandles.add(()=>this.analysisViewData.visible,()=>this.updateInteractionVisualsVisibility(),s),this._updatingHandles.add(()=>this.selectedViewshed,e=>{let t=this._selectedManipulator,n=this._selectedSubTool;this._connectObserverTooltip(n),e==null?this._selectManipulator(null):(t==null||!n.hasManipulator(t))&&this._selectManipulator(n.observerManipulator)},s)])}destroy(){this.removeHandles(C),this._selectManipulator(null),this._disconnectObserverTooltip(),r(this.subToolHandles),r(this._interactionVisuals),r(this._snappingController),r(this._observerTooltip),this._updatingHandles.destroy()}get updating(){return!!this._snappingController?.updating||this._updatingHandles.updating||this.subToolHandles.some(({subTool:e})=>e.updating)}get grabbing(){return this.subToolHandles.some(({subTool:e})=>e.grabbing)}get cursor(){return null}get selectedViewshed(){return this.analysisViewData.selectedViewshed}set selectedViewshed(e){this.analysisViewData.selectedViewshed=e}get selectedViewshedComputedData(){return this._selectedSubTool?.viewshedComputedData}onManipulatorSelectionChanged(){this.subToolHandles.forEach(({subTool:e})=>e.onManipulatorSelectionChanged())}updateInteractionVisualsVisibility(e=!1){let t=this._selectedSubTool,n=this.selectedViewshedComputedData;if(t==null||n==null){this._interactionVisuals?.setVisibility(!1);return}let r=t.moveInteractionState,i=e?r.grabbing:r.dragging,a=t.scaleOrientInteractionState,o=e?a.grabbing:a.dragging;if(!(this.analysisViewData.visible&&(i||o))){this._interactionVisuals?.setVisibility(!1);return}let s=i?n.elevationAlignedObserverRenderSpace:n.elevationAlignedTargetRenderSpace;this._interactionVisuals?.update({location:s,laserlineVisible:!0,verticalLineVisible:i,intersectsWorldUp:i})}createObserverMoveSnappingPipeline(e,t,n,r=!1){return this._snappingController.createObserverMoveSnappingPipeline(e,t,n,r)}onActivate(){this.updateInteractionVisualsVisibility()}onDeactivate(){this.updateInteractionVisualsVisibility()}onInputEvent(e){if(!this.destroyed&&!b(e,this._observerTooltip))switch(e.type){case`key-down`:_.cancel===e.key?this._cancelKeyHandler(e):_.delete.includes(e.key)&&this._deleteKeyHandler(e);break;case`hold`:this.updateInteractionVisualsVisibility(!0)}}_updateInteractionVisualsLocation(e,t){this._interactionVisuals?.updateLocation(e,t)}_initializeObserverTooltip(e){let t=this._observerToolOptions;this._observerTooltip=x(()=>({view:e,options:t.tooltips})),this._observerTooltipInfo=new S({toolOptions:t,viewType:e.type})}_connectObserverTooltip(e){if(this._disconnectObserverTooltip(),e==null){this._observerTooltip.clear();return}let t=e.observerManipulatedObject;this._observerTooltipConnectionHandle=h(this._observerTooltip,t,()=>({toolOptions:this._observerToolOptions,activeTooltipInfo:this._observerTooltipInfo,callbacks:{onBeforeUpdate:()=>this.updateInteractionVisualsVisibility(),onMoveStart:()=>{},onMove:()=>{},onMoveStop:()=>{},onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}}}))}_disconnectObserverTooltip(){this._observerTooltipConnectionHandle=i(this._observerTooltipConnectionHandle)}_cancelKeyHandler(e){this.grabbing||(this.selectedViewshed=null,e.stopPropagation())}_deleteKeyHandler(e){let t=this.selectedViewshed;t!=null&&(this.analysis.viewsheds.remove(t),e.stopPropagation())}get _selectedSubTool(){return this._findSubTool(this.selectedViewshed)}_findSubTool(e){return m(this.subToolHandles,e)}_selectManipulator(e){let t=this._selectedManipulator;t!==e&&(this._selectedManipulator=e,t!=null&&(t.selected=!1),e!=null&&(e.selected=!0),this._findSubTool(t)?.onManipulatorSelectionChanged(),this._selectedSubTool?.onManipulatorSelectionChanged())}get test(){}};e([c({constructOnly:!0})],w.prototype,`analysis`,void 0),e([c({constructOnly:!0})],w.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],w.prototype,`intersector`,void 0),e([c({constructOnly:!0})],w.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],w.prototype,`view`,void 0),e([c()],w.prototype,`subToolHandles`,void 0),e([c()],w.prototype,`removeIncompleteOnCancel`,void 0),e([c()],w.prototype,`automaticManipulatorSelection`,void 0),e([c()],w.prototype,`multiTouchEnabled`,void 0),e([c()],w.prototype,`_selectedManipulator`,void 0),e([c()],w.prototype,`_interactionVisuals`,void 0),e([c()],w.prototype,`_snappingController`,void 0),e([c()],w.prototype,`_observerTooltip`,void 0),e([c()],w.prototype,`_observerTooltipInfo`,void 0),e([c()],w.prototype,`updating`,null),e([c()],w.prototype,`grabbing`,null),e([c()],w.prototype,`cursor`,null),e([c()],w.prototype,`selectedViewshed`,null),e([c()],w.prototype,`selectedViewshedComputedData`,null),e([c()],w.prototype,`_selectedSubTool`,null),w=e([l(`esri.views.3d.analysis.Viewshed.ViewshedEditTool`)],w);export{w as ViewshedEditTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}_setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import{cyclicalDegrees as r,Cyclical as i}from"../../../../core/Cyclical.js";import{handlesGroup as a}from"../../../../core/handleUtils.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as c,syncAndInitial as l,initial as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{sub as p,len as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as _}from"../../../../core/support/UpdatingHandles.js";import{getFeatureReference as v}from"./placementUtils.js";import{viewshedToolManipulatorConfiguration as y}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as b,isSideHorizontal as x,flipSide as S}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedObserverManipulatedObject3D as C}from"./ViewshedObserverManipulatedObject3D.js";import{ViewshedScaleOrientManipulation as w}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as T}from"./viewshedToolManipulatorUtils.js";import{screenToMapAtSceneSurface as E}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as D}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as O}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{createManipulatorDragEventPipeline as k,resetManipulatedObject as A,sceneSnappingAtLocation as j,dragManipulatedObject as M,sceneSnappingAtProjectedLocation as N,resetProperties as P}from"../../../interactive/dragEventPipeline.js";const F=Symbol(`dragHandles`);let I=class extends t{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._observerManipulatedObject=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._updatingHandles=new _,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new b({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new w({view:this.view,tool:this.parentTool}),this._observerManipulator=new T(this.view,this.parentTool),this._observerManipulatedObject=new C({view:this.view,subTool:this}),this.addHandles([c(()=>this.elevationAlignedObserverRenderSpace,e=>{e!=null&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},l),this._updatingHandles.add(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=o(90-e))},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:this.elevationAlignedObserverRenderSpace,operations:this._observerManipulatedObject.operations}},({viewshedComputedData:e,observer:t,operations:r},i)=>{this._grabbing&&t!==i?.observer||(this.removeHandles(F),e?.valid&&r!=null&&this.addHandles([this._buildObserverManipulatorDragPipeline(e),this._buildMoveManipulationDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(n),F))},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.elevationAlignedTargetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{e!=null&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},u),this._updatingHandles.add(()=>{let{viewshedComputedData:e,analysisViewData:t}=this,n=t.visible&&(e?.valid??!1),r=t.selectedViewshed===e?.viewshed,i=n&&r,a=e?.effectiveElevationInfo.mode;return{controlsAvailable:i,selected:r,visibleAndValid:n,zManipulationAvailable:i&&a!==`on-the-ground`}},({controlsAvailable:e,selected:t,visibleAndValid:n,zManipulationAvailable:r})=>{this._moveManipulation.available=e,this._moveManipulation.zManipulation.available=r,this._scaleOrientManipulation.available=e,this._observerManipulator.available=n,this._observerManipulator.collisionPriority=t?2:0,this._fieldOfViewManipulation.available=e},u),this._updatingHandles.add(()=>{let e=this.viewshedComputedData;if(!e?.valid)return null;let{observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}=e;return{viewshedCompData:e,observer:t,target:n,verticalFieldOfView:r,horizontalFieldOfView:i}},e=>{e!=null&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},u)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(`grab-changed`,t=>{this._grabbing=t.action===`start`,t.action===`end`&&this.parentTool.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e.setInteractive(!this._grabbing)}),this.setInteractive(t=>t===e||!this._grabbing)}),e.events.on(`drag`,e=>{e.action===`start`&&this.parentTool.updateInteractionVisualsVisibility()})])})}destroy(){this._observerManipulatedObject=s(this._observerManipulatedObject),this._moveManipulation=s(this._moveManipulation),this._fieldOfViewManipulation=s(this._fieldOfViewManipulation),this._scaleOrientManipulation=s(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=s(this._observerManipulator),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){let t=this.viewshed;t!=null&&(t.observer=e)}get elevationAlignedObserverRenderSpace(){return this.viewshedComputedData?.elevationAlignedObserverRenderSpace}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get observerManipulator(){return this._observerManipulator}get observerManipulatedObject(){return this._observerManipulatedObject}get moveInteractionState(){let{dragging:e,grabbing:t}=this._moveManipulation;return{dragging:e||this._observerManipulator.dragging,grabbing:t||this._observerManipulator.grabbing}}get scaleOrientInteractionState(){let{dragging:e,grabbing:t}=this._scaleOrientManipulation;return{dragging:e,grabbing:t}}setInteractive(e){let t=typeof e==`boolean`;this._observerManipulator.interactive=t?e:e(this._observerManipulator),this._forEachManipulation(n=>{n.interactive=t?e:n.someManipulator(e)})}hideInactiveManipulators(e){let t=[];return this._forEachManipulation(n=>{n.hasManipulator(e)?n!==this._moveManipulation&&t.push(a(n.mapManipulators(t=>t===e||n===this._fieldOfViewManipulation&&t.grabbing?null:t.disableDisplay?.()))):t.push(n.hideManipulators())}),this._observerManipulator!==e&&t.push(this._observerManipulator.disableDisplay()),a(t)}onManipulatorSelectionChanged(){this._someManipulatorSelected()||this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null)}hasManipulator(e){let t=!1;return this._forEachManipulator(n=>{t||=n===e}),t}_someManipulatorSelected(){return this._moveManipulation.selected||this._observerManipulator.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_createMoveManipulation(){return new O({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:D})}_buildObserverManipulatorDragPipeline(e){let{effectiveElevationInfo:t,viewshed:n}=e,r=this._observerManipulatedObject,i=r.operations;if(i==null)return null;let a=i.data.spatialReference;return k(this._observerManipulator,(e,o,s,c)=>{let{parentTool:l,view:u}=this,{intersector:d,snappingManager:f}=l,{geometry:p}=i.data;if(p.type!==`point`)return;let m=n.feature,h=A(r);s=s.next(e=>(n.feature=m,h(e)));let g=l.createObserverMoveSnappingPipeline(0,c,t,!0),_=o.next(E(u,p,t,a)).next(j(u,t));if(g!=null){let{snappingStep:e,cancelSnapping:t}=g;s.next(t),_=_.next(...e)}_.next(e=>(n.feature=v({intersector:d,snappingManager:f,screenPoint:e.screenEnd,view:u}),e)).next(M(r))})}_buildMoveManipulationDragPipeline(e){let{effectiveElevationInfo:t}=e,n=this._observerManipulatedObject,r=n.operations;return r==null?null:this._moveManipulation.createDragPipeline((e,r,i,a,o)=>{a=a.next(A(n));let s=this.parentTool.createObserverMoveSnappingPipeline(e,o,t);if(s!=null){let{snappingStep:e,cancelSnapping:r}=s;return a=a.next(r),i=i.next(N(this.view,t)).next(...e).next(M(n)),{steps:i,cancel:a}}return i=i.next(M(n)),{steps:i,cancel:a}},t,r.data.spatialReference,void 0)}_buildFOVDragPipeline(e){let t=0,n=0;return this._fieldOfViewManipulation.createDragPipeline((i,a,o)=>{if(e==null)return{steps:a,cancel:o};let s=e.viewshed,c=null;return o=o.next(P(s,[`horizontalFieldOfView`,`verticalFieldOfView`])),{steps:a.next(i=>{i.action===`start`&&(c=null,t=e.horizontalFieldOfView,n=e.verticalFieldOfView);let a=i.deltaAngle;if(c==null&&a!==0){let e=i.side===`bottom`||i.side===`left`?a>0:a<0;c=x(i.side)?t===0&&e||t===360&&!e:n===0&&e}let o=c?S(i.side):i.side,l=0;switch(o){case`left`:l=t/2-a;break;case`right`:l=t/2+a;break;case`top`:l=n+a*2;break;case`bottom`:l=n-a*2}return x(o)?(l=r.normalize(l),l=l>270?0:l>180?180:l,s.horizontalFieldOfView=l*2):s.verticalFieldOfView=l,i}),cancel:o}},e)}_buildScaleOrientDragPipeline(e){let t=0,n=0,i=(t,n)=>(r,i,a)=>{if(e==null)return{steps:i,cancel:a};let o=e.viewshed;return a=a.next(P(o,[t])),i=i.next(n(o,e)),{steps:i,cancel:a}};return a([this._scaleOrientManipulation.createHeadingDragPipeline(i(`heading`,(t,i)=>i=>(i.action===`start`&&(n=e.heading),t.heading=r.normalize(n+i.deltaAngle),i)),e),this._scaleOrientManipulation.createTiltDragPipeline(i(`tilt`,(n,r)=>r=>{r.action===`start`&&(t=e.tilt);let i=t+r.deltaAngle;return i<-90?i=180:i>270&&(i=0),n.tilt=R.clamp(i),r}),e),this._scaleOrientManipulation.createDistanceDragPipeline(i(`farDistance`,(e,t)=>n=>{let r=p(L,n.renderEnd,t.elevationAlignedObserverRenderSpace),i=m(r)*t.metersPerUnit;return e.farDistance=h(r,t.targetDirection)<0?y.scaleOrientMinDistance:i,n}),e)])}_forEachManipulator(e){this._forEachManipulation(t=>{t.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{observerManipulator:this._observerManipulator,moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData}}};e([d({constructOnly:!0})],I.prototype,`analysis`,void 0),e([d({constructOnly:!0})],I.prototype,`analysisViewData`,void 0),e([d({constructOnly:!0})],I.prototype,`parentTool`,void 0),e([d({constructOnly:!0,nonNullable:!0})],I.prototype,`view`,void 0),e([d()],I.prototype,`updating`,null),e([d()],I.prototype,`viewshed`,null),e([d()],I.prototype,`_grabbing`,void 0),e([d()],I.prototype,`grabbing`,null),e([d()],I.prototype,`viewshedComputedData`,void 0),e([d()],I.prototype,`observer`,null),e([d()],I.prototype,`elevationAlignedObserverRenderSpace`,null),I=e([f(`esri.views.3d.analysis.Viewshed.ViewshedSubTool`)],I);const L=g(),R=new i(0,180);export{I as ViewshedSubTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{deg2rad as t}from"../../../../core/mathUtils.js";import{valueInUnit as n}from"../../../../core/quantity.js";import{watch as r,sync as i,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as o,convertUnit as s}from"../../../../core/units.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as d,lerp as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,fromArray as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{sv3d as g,sm4d as _}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as v}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as y}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as x}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as S,addMapTranslation as C}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import T from"../../../interactive/options/InteractiveToolOptions.js";import E from"../../../interactive/support/Units.js";import{makeTooltip as D,enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as k}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as A}from"../../../support/euclideanLengthMeasurementUtils.js";let j=class extends w{constructor(e){super(e),this.multiTouchEnabled=!1,this._updatingHandles=new h,this.toolOptions=new T}initialize(){let{view:e}=this;this._shiftManipulator=new x(e,0,8),this._shiftManipulator.state|=v,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),r(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),i),r(()=>this._showManipulator,e=>this._updateManipulatorVisibility(e),a)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){let{view:e}=this;this.tooltip=D(()=>({view:e,options:this.toolOptions.tooltips})),this._tooltipInfo=new k({toolOptions:this.toolOptions}),this.toolOptions.tooltips.enabled=!0,this.toolOptions.tooltips.placement=`trailing`,this._updateToolOptions(),this.addHandles([this._updatingHandles.add(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),this._updatingHandles.add(()=>this._shouldShowTooltip,e=>{e?this._showTooltip():this._hideTooltip()}),this.tooltip.on(`commit`,()=>{let e=this._tooltipInfo.elevation.actual,t=o(this.view.spatialReference);if(e==null||t==null)return;let r=n(e,t);this._updateValue(r,{recordUndo:this.analysis.cutFillOptions.targetElevation})}),r(()=>[this.analysis.displayUnits.elevation,this.analysis.inputUnits.elevation,e.options.displayUnits.verticalLength,e.options.inputUnits.verticalLength],()=>this._updateToolOptions(),a)])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}onInputEvent(e){if(!this.destroyed&&!O(e,this.tooltip))return super.onInputEvent(e)}onHide(){this._hideTooltip()}onEditableChange(){this.internallyEditable||this._hideTooltip()}get _shouldShowTooltip(){return this._showManipulator&&(this.hasFocusedManipulators||this.tooltip.mode===`input`)}get _showManipulator(){let{interactive:e,targetGeometry:t,visible:n}=this.analysisViewData,{measureType:r}=this.analysis;return n&&e&&t!=null&&r===`cut-fill`}_createDragPipeline(){return S(this._shiftManipulator,(e,t,n)=>{let r=p(e.renderLocation),i=this.analysis.inputUnits.elevation??`meters`,a=o(this.view.spatialReference),c;t.next(b(this.view,r,this.view.spatialReference)).next(C()).next(e=>{if(e.action===`start`){let{targetElevation:e}=this.analysis.cutFillOptions;c=e&&a?s(e,i,a):void 0}return this._updateValue(c==null?e.mapEnd.z:c+e.translationZ,e.action===`end`?{recordUndo:c}:void 0),e}),n.next(()=>{this._updateValue(c)})})}_updateManipulatorPosition(){let{targetGeometry:e}=this.analysisViewData,{renderCoordsHelper:n}=this.view;if(!e)return;let r=e.rings[0],i=m(r[0]),a=m(r[1]);n.toRenderCoords(i,e.spatialReference,i),n.toRenderCoords(a,e.spatialReference,a);let o=g.get();d(o,a,i);let s=g.get();f(s,i,a,.5);let c=n.worldBasisAtPosition(s,1,g.get()),l=n.worldBasisAtPosition(s,0,g.get()),h=y(c,l,s,_.get()),v=n.headingAtPosition(s,o),b=e.isClockwise(e.rings[0])?-Math.PI/2:Math.PI/2;u(h,h,t(v)+b),h[12]=0,h[13]=0,h[14]=0,this._shiftManipulator.renderLocation=p(s),this._shiftManipulator.modelTransform=h}_updateManipulatorVisibility(e){this._shiftManipulator.available=e}_updateValue(e,t){let n=A(e,this.view.spatialReference);if(n==null)return;let r=this.analysis.inputUnits.elevation??`meters`,i=s(n.value,n.unit,r),a=e=>void(this.analysis.cutFillOptions.targetElevation=e);if(a(i),t&&`recordUndo`in t){let e=t.recordUndo;this.emit(`record-undo`,{apply:()=>a(i),undo:()=>a(e)})}}_getUpdatedTooltipInfo(){let{effectiveTargetElevation:e}=this.analysisViewData;return e&&(this._tooltipInfo.elevation.actual=A(e,this.view.spatialReference)),this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear(),this.tooltip?.exitInputMode({focusOnView:!1})}_updateToolOptions(){let{analysis:e}=this,{displayUnits:t,inputUnits:n}=e,r=this.view.options;this.toolOptions.values.inputUnits=new E({verticalLength:n.elevation??r.inputUnits.verticalLength}),this.toolOptions.values.displayUnits=new E({verticalLength:t.elevation??r.displayUnits.verticalLength})}};e([c()],j.prototype,`multiTouchEnabled`,void 0),e([c()],j.prototype,`updating`,null),e([c({constructOnly:!0})],j.prototype,`analysis`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0,type:T})],j.prototype,`toolOptions`,void 0),e([c()],j.prototype,`_shouldShowTooltip`,null),e([c()],j.prototype,`_showManipulator`,null),j=e([l(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool`)],j);export{j as VolumeMeasurementShiftTool};
2
+ import{__decorate as e}from"tslib";import{deg2rad as t}from"../../../../core/mathUtils.js";import{valueInUnit as n}from"../../../../core/quantity.js";import{watch as r,sync as i,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as o,convertUnit as s}from"../../../../core/units.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{rotateZ as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{subtract as d,lerp as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as p,fromArray as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{sv3d as g,sm4d as _}from"../../../../geometry/support/vectorStacks.js";import{IsShiftEdgeOnScreenFlag as v}from"../Slice/sliceToolUtils.js";import{calculateTranslateRotateFromBases as y}from"../../interactive/manipulatorUtils.js";import{screenToZConstrained as b}from"../../interactive/editingTools/dragEventPipeline3D.js";import{ShiftManipulator as x}from"../../interactive/manipulators/ShiftManipulator.js";import{createManipulatorDragEventPipeline as S,addMapTranslation as C}from"../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as w}from"../../../interactive/InteractiveToolBase.js";import{bindToolUnits as T}from"../../../interactive/options/bindViewToolOptions.js";import E from"../../../interactive/options/InteractiveToolOptions.js";import{makeTooltip as D,enterInputModeIfAvailable as O}from"../../../interactive/tooltip/tooltipCommonUtils.js";import{ElevationTooltipInfo as k}from"../../../interactive/tooltip/infos/ElevationTooltipInfo.js";import{elevationFromZ as A}from"../../../support/euclideanLengthMeasurementUtils.js";let j=class extends w{constructor(e){super(e),this.multiTouchEnabled=!1,this._updatingHandles=new h,this.toolOptions=new E}initialize(){let{view:e}=this;this._shiftManipulator=new x(e,0,8),this._shiftManipulator.state|=v,this.manipulators.add(this._shiftManipulator),this.addHandles([this._createDragPipeline(),r(()=>this.analysisViewData.targetGeometry,()=>this._updateManipulatorPosition(),i),r(()=>this._showManipulator,e=>this._updateManipulatorVisibility(e),a)]),this._initializeTooltip(),this.finishToolCreation()}_initializeTooltip(){let{view:e}=this;this.tooltip=D(()=>({view:e,options:this.toolOptions.tooltips})),this._tooltipInfo=new k({toolOptions:this.toolOptions}),this.toolOptions.tooltips.enabled=!0,this.toolOptions.tooltips.placement=`trailing`,this.addHandles([T(this.toolOptions.values,()=>this.view.options,()=>({displayUnits:{verticalLength:this.analysis.displayUnits.elevation},inputUnits:{verticalLength:this.analysis.inputUnits.elevation}})),this._updatingHandles.add(()=>this.analysisViewData.effectiveTargetElevation,()=>this._updateTooltip()),this._updatingHandles.add(()=>this._shouldShowTooltip,e=>{e?this._showTooltip():this._hideTooltip()}),this.tooltip.on(`commit`,()=>{let e=this._tooltipInfo.elevation.actual,t=o(this.view.spatialReference);if(e==null||t==null)return;let r=n(e,t);this._updateValue(r,{recordUndo:this.analysis.cutFillOptions.targetElevation})})])}destroy(){this._shiftManipulator.destroy(),this.tooltip.destroy(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}onInputEvent(e){if(!this.destroyed&&!O(e,this.tooltip))return super.onInputEvent(e)}onHide(){this._hideTooltip()}onEditableChange(){this.internallyEditable||this._hideTooltip()}get _shouldShowTooltip(){return this._showManipulator&&(this.hasFocusedManipulators||this.tooltip.mode===`input`)}get _showManipulator(){let{interactive:e,targetGeometry:t,visible:n}=this.analysisViewData,{measureType:r}=this.analysis;return n&&e&&t!=null&&r===`cut-fill`}_createDragPipeline(){return S(this._shiftManipulator,(e,t,n)=>{let r=p(e.renderLocation),i=this.analysis.inputUnits.elevation??`meters`,a=o(this.view.spatialReference),c;t.next(b(this.view,r,this.view.spatialReference)).next(C()).next(e=>{if(e.action===`start`){let{targetElevation:e}=this.analysis.cutFillOptions;c=e&&a?s(e,i,a):void 0}return this._updateValue(c==null?e.mapEnd.z:c+e.translationZ,e.action===`end`?{recordUndo:c}:void 0),e}),n.next(()=>{this._updateValue(c)})})}_updateManipulatorPosition(){let{targetGeometry:e}=this.analysisViewData,{renderCoordsHelper:n}=this.view;if(!e)return;let r=e.rings[0],i=m(r[0]),a=m(r[1]);n.toRenderCoords(i,e.spatialReference,i),n.toRenderCoords(a,e.spatialReference,a);let o=g.get();d(o,a,i);let s=g.get();f(s,i,a,.5);let c=n.worldBasisAtPosition(s,1,g.get()),l=n.worldBasisAtPosition(s,0,g.get()),h=y(c,l,s,_.get()),v=n.headingAtPosition(s,o),b=e.isClockwise(e.rings[0])?-Math.PI/2:Math.PI/2;u(h,h,t(v)+b),h[12]=0,h[13]=0,h[14]=0,this._shiftManipulator.renderLocation=p(s),this._shiftManipulator.modelTransform=h}_updateManipulatorVisibility(e){this._shiftManipulator.available=e}_updateValue(e,t){let n=A(e,this.view.spatialReference);if(n==null)return;let r=this.analysis.inputUnits.elevation??`meters`,i=s(n.value,n.unit,r),a=e=>void(this.analysis.cutFillOptions.targetElevation=e);if(a(i),t&&`recordUndo`in t){let e=t.recordUndo;this.emit(`record-undo`,{apply:()=>a(i),undo:()=>a(e)})}}_getUpdatedTooltipInfo(){let{effectiveTargetElevation:e}=this.analysisViewData;return e&&(this._tooltipInfo.elevation.actual=A(e,this.view.spatialReference)),this._tooltipInfo}_updateTooltip(){this._shouldShowTooltip&&(this.tooltip.info=this._getUpdatedTooltipInfo())}_showTooltip(){this._updateTooltip()}_hideTooltip(){this.tooltip?.clear(),this.tooltip?.exitInputMode({focusOnView:!1})}};e([c()],j.prototype,`multiTouchEnabled`,void 0),e([c()],j.prototype,`updating`,null),e([c({constructOnly:!0})],j.prototype,`analysis`,void 0),e([c({constructOnly:!0})],j.prototype,`view`,void 0),e([c({constructOnly:!0})],j.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0,type:E})],j.prototype,`toolOptions`,void 0),e([c()],j.prototype,`_shouldShowTooltip`,null),e([c()],j.prototype,`_showManipulator`,null),j=e([l(`esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementShiftTool`)],j);export{j as VolumeMeasurementShiftTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{add as e,subtract as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAltitudeConstraint as i,getAltitudeConstraintError as a}from"./constraintUtils/altitude.js";import{hasConstraintType as o}from"./constraintUtils/common.js";import{ConstraintOptions as s}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as c,getDistanceConstraintError as l}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as u}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as d,getTiltConstraintError as f}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function m(e,t,n=b,r=t,i=null){r!==t&&r.copyFrom(t),r.computeUp(e.state.viewingMode);let a=!1;for(let t=0;t<x;t++){let t=0;for(let i of y)if(o(n.selection,i.type)){let o=Math.abs(i.error(e,r,n));i.apply(e,r,n)&&(a=!0,t+=o)}if(t===0)break}i?.copyFrom(r);let s=o(n.selection,8),c=h(n.interactionType,e);return s&&u(e,null,r,c)&&(a=!0),a&&r.computeUp(e.state.viewingMode),a}function h(e,t){switch(e){case 4:case 6:return 1;case 5:return t.state.isGlobal?2:1;default:return 0}}function g(e){let t=Math.min(1,e/150);return p(t)}function _(e,t,n){return f(e,t,n)*t.distance}function v(i,a,o){let s=n(a.eye);m(i,a,o),a.center=e(r(),a.center,t(r(),a.eye,s))}const y=[{type:1,error:_,apply:d},{type:2,error:a,apply:i},{type:4,error:l,apply:c}],b=new s,x=5;export{m as applyAll,v as applyConstraintsAndUpdateCenterRenderCamera,g as pixelDistanceToInteractionFactor};
2
+ import{add as e,subtract as t}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as n,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAltitudeConstraint as i,getAltitudeConstraintError as a}from"./constraintUtils/altitude.js";import{hasConstraintType as o}from"./constraintUtils/common.js";import{ConstraintOptions as s}from"./constraintUtils/ConstraintOptions.js";import{applyDistanceConstraint as c,getDistanceConstraintError as l}from"./constraintUtils/distance.js";import{applySurfaceCollisionConstraint as u}from"./constraintUtils/surfaceCollision.js";import{applyTiltConstraint as d,getTiltConstraintError as f}from"./constraintUtils/tilt.js";import{inOutCubic as p}from"../../animation/easing.js";function m(e,t,n=x,r=t,i=null){r!==t&&r.copyFrom(t),r.computeUp(e.state.viewingMode);let a=!1;for(let t=0;t<S;t++){let t=0;for(let i of b)if(o(n.selection,i.type)){let o=Math.abs(i.error(e,r,n));i.apply(e,r,n)&&(a=!0,t+=o)}if(t===0)break}i?.copyFrom(r);let s=o(n.selection,8),c=h(n.interactionType,e);return s&&u(e,null,r,c)&&(a=!0),a&&r.computeUp(e.state.viewingMode),a}function h(e,t){switch(e){case 4:case 6:return 1;case 5:return t.state.isGlobal?2:1;default:return 0}}function g(e){let t=Math.min(1,e/150);return p(t)}function _(e,t,n){return f(e,t,n)*t.distance}const v=r();function y(r,i,a){let o=n(i.eye);m(r,i,a),i.center=e(v,i.center,t(v,i.eye,o))}const b=[{type:1,error:_,apply:d},{type:2,error:a,apply:i},{type:4,error:l,apply:c}],x=new s,S=5;export{m as applyAll,y as applyConstraintsAndUpdateCenterRenderCamera,g as pixelDistanceToInteractionFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ignoreAbortErrors as e}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as t}from"../../../../../core/screenUtils.js";import{copy as n,subtract as r,add as i}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as o}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as s}from"../../../webgl.js";import{shortenTranslation as c}from"../../../state/utils/groundNavigationUtils.js";import{pickPointAndInitSphere as l}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as u}from"../../../state/utils/OffsetCorrectionController.js";import d from"../../../webgl/RenderCamera.js";import{InputHandler as f}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as p}from"../../../../input/handlers/support.js";class m extends f{constructor(e,t){super(!0),this._view=e,this._tmpTranslation=a(),this._tmpTargetLocation=a(),this._tmpCenterOffset=a(),this.registerIncoming(`double-click`,t,e=>this._handleDoubleClick(e)),this._offsetCorrectionController=new u(this._view)}_handleDoubleClick(e){if(this._view.navigation.mode.type!==`ground`)return;let{data:t}=e;p(t,`primary`)&&(this._move(e),e.stopPropagation())}_move(a){let u=this._view.state.camera,f=new d().copyFrom(u),p=t(a.data.x,a.data.y);if(this._view.state.isGlobal){let e=l(this._view,this._view.state.camera,p,o(this._view.spatialReference).radius,1,{});if(e.scenePickPoint==null||!e.hasGeometryIntersection)return;n(this._tmpTargetLocation,e.scenePickPoint)}else if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(p,this._tmpTargetLocation,{}))return;r(this._tmpTranslation,this._tmpTargetLocation,u.eye),c(this._tmpTranslation,this._tmpTranslation,.99,2),i(this._tmpTargetLocation,u.eye,this._tmpTranslation),r(this._tmpCenterOffset,f.center,f.eye),f.eye=this._tmpTargetLocation,f.center=i(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation(f,1e3),e(this._view.goTo(s(this._view,f),{liftOffDisabled:!0,duration:500}))}}export{m as GroundDoubleClickMove};
2
+ import{ignoreAbortErrors as e}from"../../../../../core/promiseUtils.js";import{createScreenPointArray as t}from"../../../../../core/screenUtils.js";import{copy as n,subtract as r,add as i,distance as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as s}from"../../../../../geometry/ellipsoidUtils.js";import{fromRenderCamera as c}from"../../../webgl.js";import{shortenTranslation as l}from"../../../state/utils/groundNavigationUtils.js";import{pickPointAndInitSphere as u}from"../../../state/utils/navigationUtils.js";import{OffsetCorrectionController as d}from"../../../state/utils/OffsetCorrectionController.js";import f from"../../../webgl/RenderCamera.js";import{InputHandler as p}from"../../../../input/InputHandler.js";import{eventMatchesPointerAction as m}from"../../../../input/handlers/support.js";class h extends p{constructor(e,t){super(!0),this._view=e,this._tmpTranslation=o(),this._tmpTargetLocation=o(),this._tmpCenterOffset=o(),this.registerIncoming(`double-click`,t,e=>this._handleDoubleClick(e)),this._offsetCorrectionController=new d(this._view)}_handleDoubleClick(e){if(this._view.navigation.mode.type!==`ground`)return;let{data:t}=e;m(t,`primary`)&&(this._move(e),e.stopPropagation())}_move(o){let d=this._view.state.camera,p=new f().copyFrom(d),m=t(o.data.x,o.data.y);if(this._view.state.isGlobal){let e=u(this._view,this._view.state.camera,m,s(this._view.spatialReference).radius,1,{});if(e.scenePickPoint==null||!e.hasGeometryIntersection)return;n(this._tmpTargetLocation,e.scenePickPoint)}else if(!this._view.sceneIntersectionHelper.intersectScreenFreePointFallback(m,this._tmpTargetLocation,{}))return;r(this._tmpTranslation,this._tmpTargetLocation,d.eye),l(this._tmpTranslation,this._tmpTranslation,.99,2),i(this._tmpTargetLocation,d.eye,this._tmpTranslation),r(this._tmpCenterOffset,p.center,p.eye),p.eye=this._tmpTargetLocation,p.center=i(this._tmpCenterOffset,this._tmpTargetLocation,this._tmpCenterOffset),this._offsetCorrectionController.immediatelyCorrectGroundElevation({camera:p,correctionLimit:1e3}),e(this._view.goTo(c(this._view,p),{liftOffDisabled:!0,duration:500*Math.max(1,Math.sqrt(a(p.eye,this._view.state.camera.eye)/100))}))}}export{h as GroundDoubleClickMove};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{onAbort as a}from"../../../../core/promiseUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{property as s,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{subtract as l,add as u,copy as d,cross as f,normalize as p,scale as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../geometry/Point.js";import{shortenTranslation as v}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../../state/utils/OffsetCorrectionController.js";import b from"../../webgl/RenderCamera.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";let S=class extends x{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=g(),this._tmpWorldUp=g(),this._tmpHorizontalForward=g(),this._tmpTranslation=g(),this._tmpScratchVector=g(),this._hasErrorCursor=!1}initialize(){this.signal&&this.addHandles([a(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=g();if(!i.intersectScreen(o(e.x,e.y),a)){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(l(this._tmpTranslation,a,n.eye),v(this._tmpTranslation,this._tmpTranslation,.999,.5),u(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new b().copyFrom(n);e.eye=a,new y(this.view).immediatelyCorrectGroundElevation(e,void 0,void 0,this.groundMode),d(a,e.eye)}let s=this.cameraTurningEnabled?this._computeHeadingOffset(n,a):0,c=this.view.renderCoordsHelper.fromRenderCoords(a,new _({spatialReference:this.view.spatialReference})),f=new t({position:c,heading:this.view.camera.heading+s,tilt:85});this.emit(`success`,f),this.view.activeTool=null}_computeHeadingOffset(e,t){let n=this.view.renderCoordsHelper.worldUpAtPosition(t,this._tmpWorldUp),r=f(this._tmpHorizontalForward,n,e.viewRight);l(this._tmpMouseDirection,t,e.eye),p(this._tmpMouseDirection,this._tmpMouseDirection),l(this._tmpMouseDirection,this._tmpMouseDirection,m(this._tmpScratchVector,n,h(n,this._tmpMouseDirection))),p(this._tmpMouseDirection,this._tmpMouseDirection);let a=f(g(),this._tmpMouseDirection,r),o=Math.sign(h(a,n)),s=Math.acos(h(this._tmpMouseDirection,r));return o*i(s)}_showErrorCursor(){this._hasErrorCursor=!0,this._errorTimeout?.remove(),this._errorTimeout=n.setTimeout(()=>{this._hasErrorCursor=!1,this._errorTimeout=void 0},500)}};e([s({constructOnly:!0})],S.prototype,`view`,void 0),e([s({constructOnly:!0})],S.prototype,`signal`,void 0),e([s({constructOnly:!0})],S.prototype,`cameraTurningEnabled`,void 0),e([s({constructOnly:!0})],S.prototype,`groundMode`,void 0),e([s()],S.prototype,`_hasErrorCursor`,void 0),e([s({readOnly:!0})],S.prototype,`cursor`,null),S=e([c(`esri.views.3d.interactive.placementTools.GroundNavigationPlacementTool3D`)],S);export{S as GroundNavigationPlacementTool3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../Camera.js";import{clock as n}from"../../../../core/clock.js";import r from"../../../../core/Logger.js";import{rad2deg as i}from"../../../../core/mathUtils.js";import{onAbort as a}from"../../../../core/promiseUtils.js";import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{property as s,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{subtract as l,add as u,copy as d,cross as f,normalize as p,scale as m,dot as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../../../../geometry/Point.js";import{shortenTranslation as v}from"../../state/utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../../state/utils/OffsetCorrectionController.js";import b from"../../webgl/RenderCamera.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";let S=class extends x{constructor(e){super(e),this.isGroundNavigationPlacementTool=!0,this._internalAbortController=new AbortController,this._tmpMouseDirection=g(),this._tmpWorldUp=g(),this._tmpHorizontalForward=g(),this._tmpTranslation=g(),this._tmpScratchVector=g(),this._hasErrorCursor=!1}initialize(){this.signal&&this.addHandles([a(this.signal,()=>{this.cancel(),this.active&&(this.view.activeTool=null)})]),this.finishToolCreation()}cancel(){super.cancel(),this._internalAbortController?.abort()}onDeactivate(){this.emit(`cancel`)}get cursor(){return this.active?this._hasErrorCursor?`not-allowed`:`crosshair`:null}async onInputEvent(e){if(!this.active||e.type!==`immediate-click`)return;e.stopPropagation();let n=this.view.state.camera,i=this.view.sceneIntersectionHelper,a=g();if(!i.intersectScreen(o(e.x,e.y),a)){r.getLogger(this).warn(`The clicked location did not produce a valid target. Try again by clicking in a different location.`),this._showErrorCursor();return}if(l(this._tmpTranslation,a,n.eye),v(this._tmpTranslation,this._tmpTranslation,.999,.5),u(a,n.eye,this._tmpTranslation),this.groundMode?.offset){let e=new b().copyFrom(n);e.eye=a,new y(this.view).immediatelyCorrectGroundElevation({camera:e,navigationModeOverride:this.groundMode}),d(a,e.eye)}let s=this.cameraTurningEnabled?this._computeHeadingOffset(n,a):0,c=this.view.renderCoordsHelper.fromRenderCoords(a,new _({spatialReference:this.view.spatialReference})),f=new t({position:c,heading:this.view.camera.heading+s,tilt:85});this.emit(`success`,f),this.view.activeTool=null}_computeHeadingOffset(e,t){let n=this.view.renderCoordsHelper.worldUpAtPosition(t,this._tmpWorldUp),r=f(this._tmpHorizontalForward,n,e.viewRight);l(this._tmpMouseDirection,t,e.eye),p(this._tmpMouseDirection,this._tmpMouseDirection),l(this._tmpMouseDirection,this._tmpMouseDirection,m(this._tmpScratchVector,n,h(n,this._tmpMouseDirection))),p(this._tmpMouseDirection,this._tmpMouseDirection);let a=f(g(),this._tmpMouseDirection,r),o=Math.sign(h(a,n)),s=Math.acos(h(this._tmpMouseDirection,r));return o*i(s)}_showErrorCursor(){this._hasErrorCursor=!0,this._errorTimeout?.remove(),this._errorTimeout=n.setTimeout(()=>{this._hasErrorCursor=!1,this._errorTimeout=void 0},500)}};e([s({constructOnly:!0})],S.prototype,`view`,void 0),e([s({constructOnly:!0})],S.prototype,`signal`,void 0),e([s({constructOnly:!0})],S.prototype,`cameraTurningEnabled`,void 0),e([s({constructOnly:!0})],S.prototype,`groundMode`,void 0),e([s()],S.prototype,`_hasErrorCursor`,void 0),e([s({readOnly:!0})],S.prototype,`cursor`,null),S=e([c(`esri.views.3d.interactive.placementTools.GroundNavigationPlacementTool3D`)],S);export{S as GroundNavigationPlacementTool3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{px2pt as t,pt2px as n}from"../../../../core/screenUtils.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as a,clone as o,ones as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as c,fromBuffer as l,intersectsClippingArea as u,empty as d,expandWithAABB as f,expandWithBuffer as p}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as m}from"../../../../renderers/support/renderingInfoUtils.js";import{sharedGeometryElevationAligner as h}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as g,needsElevationUpdates2D as _}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as v}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as y}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as b,nanFallbackColor as x}from"./Graphics3DSymbolLayer.js";import{parseCapType as S,computeSymbolLayerIndex as C,parseLineMarkerStyle as w}from"./lineUtils.js";import{initFastSymbolUpdatesState as T,updateFastSymbolUpdatesState as E,getAttributeValue as D,getSizeAttributeValue as O,ConvertOptions as k}from"../support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{createGeometry as j}from"../../support/engineContent/line.js";import{geometryToRenderInfo as M,geometryToRenderInfoDraped as N}from"../../support/renderInfoUtils/line.js";import{Object3D as P}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as F}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as I}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as L,patternHidesLine as R}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as z}from"../../webgl-engine/materials/RibbonLineMaterial.js";const B=[`polyline`];class V extends b{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,W(t))}async doLoad(){if(this._fastUpdates=T(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=T(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?t(1):this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,a=this._worldSizedEnabled,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i?.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:C(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:S(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:L(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new z(this._getMaterialParameters(!1,0),this.view.state.isGlobal),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new z({...this._getMaterialParameters(!1,1),wireframe:!0},this.view.state.isGlobal),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new I({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:w(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=m(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackMarkerOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,B,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(E(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof z&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(E(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof I&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return 2}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this._worldSizedEnabled),delete t.size),t.cap?.type===`complete`&&(n.cap=S(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=g(V.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=_(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=H(r.geometry);if(i==null)return null;let a=[],o=c(),s=M(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,d=r.mapPositions;if(this._context.clippingExtent!=null&&(l(d,o),!u(o,this._context.clippingExtent)))continue;let f=this._createGeometry(this._lineMaterial,e,c,d,i.type,1,n);if(a.push(f),A.LINE_WIREFRAMES&&a.push(f.instantiate({material:this._wireframeLineMaterial})),this._markerMaterial!=null){let t=f.instantiate({material:this._markerMaterial});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(a.length===0)return null;let d=this._context.layerViewUid,f=new P({geometries:a,castShadow:!1,layerViewUid:d,graphicUid:n}),p=new y(this,f,null,h,t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=_(t.mode),p}_createGeometry(e,t,n,r,i,a,o){let s=a===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,c=i===`polygon`,l=this._fastUpdates?.visualVariables.color,u=this._fastUpdates?.visualVariables.size,d=this._fastUpdates?.visualVariables.opacity,f=this._context.layerViewUid,p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:f}),{renderingInfo:m}=t,h={position:n,size:u?null:this._getDrivenSize(m),color:l?null:this._getDrivenColor(m),sizeFeature:u?O(u,m.size):null,colorFeature:l?D(l,m.color):null,opacityFeature:d?D(d,m.opacity):null};return j(e,{overlayInfo:s,removeDuplicateStartEnd:c,mapPositions:r,attributeData:h},p)}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=A.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=c(),s=d(),m=N(n,this._context.overlaySR);this._logGeometryCreationWarnings(m,n.paths,`paths`,`LineSymbol3DLayer`);for(let c of m.lines){if(l(c.position,o),!u(o,this._context.clippingExtent))continue;f(s,o);let d=this._createGeometry(this._lineMaterial,e,c.position,void 0,n.type,0,t.uid),m=e=>{let n=this._context.layerViewUid,r=new F(e,{layerViewUid:n,graphicUid:t.uid});a.push(r)};if(i!=null){let t=d.instantiate({material:i});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),m(t);let n=this.symbolLayer.marker.placement;(n===`begin`||n===`begin-end`)&&p(o,c.position,0,1),(n===`end`||n===`begin-end`)&&p(o,c.position,c.position.length-3,1)}m(d),A.LINE_WIREFRAMES&&m(d.instantiate({material:r}))}return new v(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return R(this.symbolLayer.pattern)}_computeMaterialWidth(e,r){return r?e??1:(e??=t(1),this._drivenProperties.size?this._fastUpdates?.visualVariables.size?n(1):1:n(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&U(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&U(o(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),U(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&U(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:w(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize();return new k({supports:{size:!0,color:!0,rotation:!1,opacity:!0},fallbackColor:e?this._getFallbackMarkerOpacityAndColor(x):this._getFallbackOpacityAndColor(x),fallbackSize:r(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer?.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer?.marker?.color?.a??this._getFallbackOpacity()}get _worldSizedEnabled(){return this.symbol.type===`line-3d`&&this.symbol.worldSized}_getWorldOrScreenSize(e){return this._worldSizedEnabled?e:n(e)}_getFallbackSize(){let e=this.symbolLayer?.size;return e==null?1:this._getWorldOrScreenSize(e)}}function H(e){return e.type===`polyline`?e:null}function U(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function W(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{V as Graphics3DLineSymbolLayer};
2
+ import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import{pt2px as t,px2pt as n}from"../../../../core/screenUtils.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ZEROS as a,clone as o,ones as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as c,fromBuffer as l,intersectsClippingArea as u,empty as d,expandWithAABB as f,expandWithBuffer as p}from"../../../../geometry/support/aaBoundingBox.js";import{getDriverAxisSizeValueAny as m}from"../../../../renderers/support/renderingInfoUtils.js";import{getTransformationType as h}from"../../../../renderers/visualVariables/support/sizeVariableUtils.js";import{sharedGeometryElevationAligner as g}from"./ElevationAligners.js";import{elevationModeChangeUpdateType as _,needsElevationUpdates2D as v}from"./elevationAlignmentUtils.js";import{Graphics3DDrapedGraphicLayer as y}from"./Graphics3DDrapedGraphicLayer.js";import{Graphics3DObject3DGraphicLayer as b}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as x,nanFallbackColor as S}from"./Graphics3DSymbolLayer.js";import{parseCapType as C,computeSymbolLayerIndex as w,parseLineMarkerStyle as T}from"./lineUtils.js";import{initFastSymbolUpdatesState as E,updateFastSymbolUpdatesState as D,getAttributeValue as O,getSizeAttributeValue as k,ConvertOptions as A}from"../support/FastSymbolUpdates.js";import{debugFlags as j}from"../../support/debugFlags.js";import{createGeometry as M}from"../../support/engineContent/line.js";import{geometryToRenderInfo as N,geometryToRenderInfoDraped as P}from"../../support/renderInfoUtils/line.js";import{Object3D as F}from"../../webgl-engine/lib/Object3D.js";import{RenderGeometry as I}from"../../webgl-engine/lib/RenderGeometry.js";import{LineMarkerMaterial as L}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{getStipplePatternForLinePattern as R,patternHidesLine as z}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as B}from"../../webgl-engine/materials/RibbonLineMaterial.js";const V=[`polyline`],H=n(1);class U extends x{static{this.elevationModeChangeTypes={definedChanged:2,staysOnTheGround:0,onTheGroundChanged:2}}constructor(e,t,n,r){super(e,t,n,r,K(t))}async doLoad(){if(this._fastUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastMarkerUpdates=E(this._context.renderer,this._fastVisualVariableConvertOptions(!0)),!this._drivenProperties.size&&(this.symbolLayer.size==null?H:this.symbolLayer.size)<0)throw new e(`graphics3dlinesymbollayer:invalid-size`,`Symbol sizes may not be negative values`)}_getMaterialParameters(e,t){let n=this._screenSizePerspective,r=!!has(`enable-feature:emissive-on-non-volumetric`)&&!this.draped,{symbolLayer:i}=this,{worldSized:a}=this.symbol,o={...this._getMaterialColorParameters(t),shadingEnabled:r,width:this._computeMaterialWidth(i.size,a),worldSized:a,polygonOffset:3,polygonOffsetIndex:w(this._renderPriority,this._renderPriorityStep),join:i.join||`miter`,cap:C(i.cap||`butt`),hasSlicePlane:this._context.slicePlaneEnabled,isClosed:e,stipplePattern:R(i.pattern??i.imagePattern),emissiveStrength:this._emissiveStrength,screenSizePerspective:n};if(t===2){if(this._fastMarkerUpdates?.visualVariables)return{...o,...this._fastMarkerUpdates.materialParameters}}else if(this._fastUpdates?.visualVariables)return{...o,...this._fastUpdates.materialParameters};return o}_getMaterialColorParameters(e){let t=e===2,n=this._getCombinedOpacityAndColor(t&&this._markerColor||this._materialColor);return this._patternHidesLine&&!t&&(n[3]=0),{color:n}}get _materialColor(){return this.symbolLayer.material?.color}get _emissiveStrength(){let e=this.symbolLayer.material?.emissive;return(e?.source===`color`?e?.strength:void 0)??0}get _markerColor(){return this.symbolLayer.marker?.color}get _lineMaterial(){return this._materials[0]??=new B(this._getMaterialParameters(!1,0),this.view.state.isGlobal),this._materials[0]}get _wireframeLineMaterial(){return this._materials[1]??=new B({...this._getMaterialParameters(!1,1),wireframe:!0},this.view.state.isGlobal),this._materials[1]}get _markerMaterial(){return this._materials[2]==null&&this.symbolLayer.marker!=null&&(this._materials[2]=new L({...this._getMaterialParameters(!1,2),placement:this.symbolLayer.marker.placement,markerPrimitive:T(this.symbolLayer.marker.style)},this.view.state.isGlobal)),this._materials[2]}_getDrivenSize(e){if(this._drivenProperties.size){let t=e.size;if(t==null)return this._getFallbackSize();let n=m(t.output);return this._getWorldOrScreenSize(n)}return 1}_getDrivenColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._materialColor)&&(n[3]=t?.output??this._getFallbackOpacity()),n}_getDrivenMarkerColor({color:e,opacity:t}){let n=s();return this._drivenProperties.color&&(i(n,e?.output??this._getFallbackMarkerOpacityAndColor(a)),t==null)||this._drivenProperties.opacity&&(e||this._markerColor||this._materialColor)&&(n[3]=t?.output??this._getFallbackMarkerOpacity()),n}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validatePolylineContext(e))return null;this._warnIfVVRequiresWorldSized(e.renderingInfo);let n=this.createElevationContextForGraphic(t),r=n.mode===`on-the-ground`;return this.ensureDrapedStatus(r),this.draped?this._createAsOverlay(e):this._createAs3DShape(e,n,t.uid)}_validatePolylineContext(e){let t=e.graphic.geometry;return this._validateGeometry(t,V,this.symbolLayer.type)&&t.type===`polyline`}applyRendererDiff(e,t){for(let n in e.diff)switch(n){case`visualVariables`:{let e=this._fastUpdates;if(D(e,t,this._fastVisualVariableConvertOptions()))for(let t of this._materials)t instanceof B&&t.setParameters(e.materialParameters);else return 0;let n=this._fastMarkerUpdates;if(D(n,t,this._fastVisualVariableConvertOptions(!0)))for(let e of this._materials)e instanceof L&&e.setParameters(n.materialParameters);else return 0}break;default:return 0}return`visualVariables`in e.diff&&this._warnIfVVRequiresWorldSized(),2}_warnIfVVRequiresWorldSized(e){if(this.symbol.worldSized||this.ignoreDrivers)return;let t=this._getSizeVariable(e);t==null||t.useSymbolValue||t.target===`outline`||h(t)===`real-world-size`&&this.logger.warnOnce(`SizeVariable uses real-world units, but LineSymbol3D.worldSized is false. Set LineSymbol3D.worldSized to true to render real-world line widths.`)}_getSizeVariable(e){let t=this._fastUpdates?.visualVariables.size;if(t)return t.variables[0];let n=e?.size,r=n?.output.findIndex(e=>typeof e==`number`);return r==null?null:n?.variables[r]}prepareSymbolLayerPatch(e){if(e.diff.type!==`partial`)return;let t=e.diff.diff,n={};t.size?.type===`complete`&&(n.width=this._computeMaterialWidth(t.size.newValue,this.symbol.worldSized),delete t.size),t.cap?.type===`complete`&&(n.cap=C(t.cap.newValue??`butt`),delete t.cap);let r=this._prepareMarkerPatch(e,t);this._prepareMaterialPatch(e,t,r),e.symbolLayerStatePatches.push(()=>{for(let e of this._materials)e?.setParameters(n)})}layerOpacityChanged(){for(let e=0;e<3;e++)this._materials[e]?.setParameters(this._getMaterialColorParameters(e))}get _screenSizePerspective(){return!this.draped&&this._context.screenSizePerspectiveEnabled?this.view.screenSizePerspective.parameters:null}layerScreenSizePerspectiveChanged(){let e=this._screenSizePerspective;for(let t of this._materials)t?.setParameters({screenSizePerspective:e})}layerElevationInfoChanged(e,t,n){let r=this._elevationContext.mode,i=_(U.elevationModeChangeTypes,n,r);if(i!==1)return i;let a=v(r);return this.updateGraphics3DGraphicElevationInfo(e,t,()=>a)}slicePlaneEnabledChanged(){let e={hasSlicePlane:this._context.slicePlaneEnabled};for(let t of this._materials)t?.setParameters(e);return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,t,n){let r=e.graphic,i=W(r.geometry);if(i==null)return null;let a=[],o=c(),s=N(i,this._context.elevationProvider,this._context.renderCoordsHelper,t);this._logGeometryCreationWarnings(s,i.paths,`paths`,`LineSymbol3DLayer`);for(let t=0;t<s.lines.length;t++){let r=s.lines[t],c=r.position,d=r.mapPositions;if(this._context.clippingExtent!=null&&(l(d,o),!u(o,this._context.clippingExtent)))continue;let f=this._createGeometry(this._lineMaterial,e,c,d,i.type,1,n);if(a.push(f),j.LINE_WIREFRAMES&&a.push(f.instantiate({material:this._wireframeLineMaterial})),this._markerMaterial!=null){let t=f.instantiate({material:this._markerMaterial});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),a.push(t)}}if(a.length===0)return null;let d=this._context.layerViewUid,f=new F({geometries:a,castShadow:!1,layerViewUid:d,graphicUid:n}),p=new b(this,f,null,g,t);return p.alignedSampledElevation=s.sampledElevation,p.needsElevationUpdates=v(t.mode),p}_createGeometry(e,t,n,r,i,a,o){let s=a===0?{spatialReference:this._context.overlaySR,renderCoordsHelper:this._context.renderCoordsHelper}:null,c=i===`polygon`,l=this._fastUpdates?.visualVariables.color,u=this._fastUpdates?.visualVariables.size,d=this._fastUpdates?.visualVariables.opacity,f=this._context.layerViewUid,p=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:o,layerViewUid:f}),{renderingInfo:m}=t,h={position:n,size:u?null:this._getDrivenSize(m),color:l?null:this._getDrivenColor(m),sizeFeature:u?k(u,m.size):null,colorFeature:l?O(l,m.color):null,opacityFeature:d?O(d,m.opacity):null};return M(e,{overlayInfo:s,removeDuplicateStartEnd:c,mapPositions:r,attributeData:h},p)}_createAsOverlay(e){let t=e.graphic,{geometry:n}=t;this._lineMaterial.renderPriority=this._renderPriority;let r=j.LINE_WIREFRAMES?this._wireframeLineMaterial:null,i=this._markerMaterial;r!=null&&(r.renderPriority=this._renderPriority-.001),i!=null&&(i.renderPriority=this._renderPriority-.002);let a=[],o=c(),s=d(),m=P(n,this._context.overlaySR);this._logGeometryCreationWarnings(m,n.paths,`paths`,`LineSymbol3DLayer`);for(let c of m.lines){if(l(c.position,o),!u(o,this._context.clippingExtent))continue;f(s,o);let d=this._createGeometry(this._lineMaterial,e,c.position,void 0,n.type,0,t.uid),m=e=>{let n=this._context.layerViewUid,r=new I(e,{layerViewUid:n,graphicUid:t.uid});a.push(r)};if(i!=null){let t=d.instantiate({material:i});t.attributes.has(`color`)&&t.setAttributeData(`color`,this._getDrivenMarkerColor(e.renderingInfo)),m(t);let n=this.symbolLayer.marker.placement;(n===`begin`||n===`begin-end`)&&p(o,c.position,0,1),(n===`end`||n===`begin-end`)&&p(o,c.position,c.position.length-3,1)}m(d),j.LINE_WIREFRAMES&&m(d.instantiate({material:r}))}return new y(this,a,s,this._context.drapeSourceRenderer)}get _patternHidesLine(){return z(this.symbolLayer.pattern)}_computeMaterialWidth(e,n){return n?this._drivenProperties.size?1:e??1:(e??=H,this._drivenProperties.size?this._fastUpdates?.visualVariables.size?t(1):1:t(e))}_prepareMaterialPatch(e,t,n){let r=t.material;if(r==null){n.changed&&n.useMaterialColor&&G(this._getCombinedOpacityAndColor(this._materialColor),this._materials[2],e);return}if(r.type===`collection`)return;let i=r.type===`complete`?r.newValue?.color:r.diff.color?.type===`complete`?r.diff.color.newValue:null,a=this._getCombinedOpacityAndColor(i);n.useMaterialColor&&G(o(a),this._materials[2],e),this._patternHidesLine&&(a[3]=0),G(a,this._materials[0],e),delete t.material}_prepareMarkerPatch(e,t){let n=t.marker,r=this._markerMaterial;if(n==null||n.type!==`partial`||n.diff==null||n.diff.placement!=null||n.diff.style!=null&&n.diff.style.type!==`complete`||n.diff.color!=null&&n.diff.color.type!==`complete`||r==null)return{changed:!1,useMaterialColor:this._markerColor==null};let i=n.diff.color,a=i!=null,o=a?i.newValue:null,s=o==null&&this._markerColor==null;o&&G(this._getCombinedOpacityAndColor(o),r,e);let c=n.diff.style?.newValue;return c&&e.symbolLayerStatePatches.push(()=>r.setParameters({markerPrimitive:T(c)})),delete t.marker,{changed:a,useMaterialColor:s}}_fastVisualVariableConvertOptions(e=!1){let t=this._getFallbackSize(),{size:n}=this.symbolLayer;return new A({supports:{size:!0,color:!0,rotation:!1,opacity:!0},symbolSize:r(n,n,n),fallbackColor:e?this._getFallbackMarkerOpacityAndColor(S):this._getFallbackOpacityAndColor(S),fallbackSize:r(t,t,t)})}_getFallbackOpacityAndColor(e){return this._materialColor?.toUnitRGBA()??e}_getFallbackOpacity(){return this._materialColor?.a??0}_getFallbackMarkerOpacityAndColor(e){return this.symbolLayer.marker?.color?.toUnitRGBA()??this._getFallbackOpacityAndColor(e)}_getFallbackMarkerOpacity(){return this.symbolLayer.marker?.color?.a??this._getFallbackOpacity()}_getWorldOrScreenSize(e){return this.symbol.worldSized?e:t(e)}_getFallbackSize(){return this._getWorldOrScreenSize(this.symbolLayer.size)}}function W(e){return e.type===`polyline`?e:null}function G(e,t,n){t!=null&&n.symbolLayerStatePatches.push(()=>t.setParameters({color:e}))}function K(e){return(e.material?.color?.a??1)===1&&(e.marker?.color?.a??1)===1}export{U as Graphics3DLineSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{splitIntoChunks as n}from"../../../../core/arrayUtils.js";import{createTask as r,resultOrAbort as i}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import s from"../../../../core/Logger.js";import{abortMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateNumberMemory as u,estimateStringMemory as d}from"../../../../core/memoryEstimations.js";import{whenOrAbort as f,throwIfAborted as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/ReactiveSet.js";import{watch as h,sync as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{equals as y}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as b}from"../../../../intl/number.js";import{getMaximumQuerySize as x,queryAllJSON as S}from"../../../../layers/support/featureQueryAll.js";let C=class extends t{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=D,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new m,this._geometryChangedObjectIds=new m,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new T(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(h(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,!this._pendingFetchChangedObjectIds&&(this._applyGeometryOverridesTask=c(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=r(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise.catch(()=>{}))},g)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}).catch(()=>{})}destroy(){this._set(`layer`,null),this._memCache=l(this._memCache),this._pendingFetchAbortController=c(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return this._associatedLayer?.infoFor3D!=null}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return this.layer==null?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return this.is3DOFL?!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished):!1}get isEmpty(){return this._pendingFetchChangedObjectIds==null&&this._attributeChangedObjectIds.size===0&&this._geometryChangedObjectIds.size===0}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);let t=this._interactiveEditingSessions,n=new w(e,()=>{t.remove(n)});return t.unshift(n),n}async applyAttributeOverrides(e,t,n,r=[]){if(this._pendingFetchChangedObjectIds&&await f(this._pendingFetchChangedObjectIds,n),t==null)return;let{attributeData:i,loadedAttributes:a}=t;if(a==null||i==null||this._attributeChangedObjectIds.size===0)return;let o=new Set;for(let e of a)o.add(e.index);for(let t of r)o.has(t.index)||(a.push(t),i[t.name]=Array(e.length));let s=await this._lockFeatureIds(e);try{let t={attributeData:i,loadedAttributes:a},{objectIds:r,fieldNames:o}=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds);if(r.length===0||o.length===0)return;let s=await this._queryAttributeOverridesFromAssociatedLayer(r,o,n);if(s==null)return;this._processOverridesFromAssociatedLayer(e,s,o,t)}finally{s.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);let n=this._clientGeometryCache.get(e);if(n!=null&&(this.geometryOverrides.remove(n),this._clientGeometryCache.delete(e)),t!=null){let n={oid:e,mesh:t};this.geometryOverrides.add(n),this._clientGeometryCache.set(e,n)}}updateAttributeValue(e,t,n){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,n)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,n){this._memCache.put(e,t,n)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:n},r){let i=[];for(let e of t)i[e.index]=n[e.name];let a=new Set,o=new Set;for(let n=0;n<e.length;n++){let s=e[n];if(r.has(s))for(let e of t){let t=this._attributeFromCache(s,e.index);if(t!==void 0){i[e.index][n]=t;continue}a.add(s),o.add(e.name)}}return{objectIds:Array.from(a),fieldNames:Array.from(o)}}_attributeFromCache(e,t){let n=this._fromInteractiveEditingSession(e,t);return n===void 0?this._memCache.get(e,t):n}_fromInteractiveEditingSession(e,t){if(this._interactiveEditingSessions!=null)for(let n of this._interactiveEditingSessions){if(n.objectId!==e)continue;let r=n.getAttribute(t);if(r!==void 0)return r}}async _queryAttributeOverridesFromAssociatedLayer(e,t,n){if(e.length===0)return null;this._logWarningIfMaximumObjectsExceeded();let{associatedLayer:r}=this.layer;if(r==null)return null;let i=r.createQuery(),{objectIdField:a}=r,o=[a,...t];i.where=this.layer.definitionExpression||`1=1`,i.returnGeometry=!1,i.outFields=o,i.cacheHint=!0;let s=await this._executeBatchQuery(r,e,i,n),c=[];for(let e of s)if(e.ok)for(let t of e.value.features)c.push(t);return c}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(e.length===0||!this.is3DOFL)return null;let n=this.layer.associatedLayer,r=n.infoFor3D,{spatialReference:i}=n;if(this.view){let{state:{viewingMode:e},spatialReference:t}=this.view,n=e===1,r=i.isGeographic;if(n&&!r)return s.getLogger(this).warn(`unsupported-pcs-edits-in-global-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!n&&r)return s.getLogger(this).warn(`unsupported-gcs-edits-in-local-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!(y(i,t)||n&&t.isWebMercator&&i.isWGS84))return s.getLogger(this).warn(`unsupported-mismatched-spatial-reference-edits`,this.layer.title,O(i,t,this.view.viewingMode,1)),null}this._logWarningIfMaximumObjectsExceeded();let{objectIdField:a,globalIdField:o}=n,c=[a,...o==null?[]:[o]],l=n.createQuery();l.where=this.layer.definitionExpression||`1=1`,l.returnGeometry=!0,l.outFields=c,l.cacheHint=!0,l.returnZ=n.hasZ,l.returnM=n.hasM;let{assetMapFromAssetMapsJSON:u,extractMesh:d}=await import(`../../../../rest/support/meshFeatureSet.js`),f=await this._executeBatchQuery(n,e,l,t),p=[];for(let e of f){if(!e.ok)continue;let{assetMaps:t,features:n,globalIdFieldName:a}=e.value;if(t==null)continue;let o=u(r,t);for(let e of n){let t=d(e,a,i,r,o),n=e;if(t==null){n.geometry=null;continue}n.geometry=t,p.push(n)}}return p}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${b(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`,t=this.layer.portalItem;t?.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,s.getLogger(this).warn(`#queryOverrides()`,this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,a){if(t.length===0)return[];let o=x(e);t=[...t].sort((e,t)=>e-t);let s=n(t,o).map(t=>{let n=r.clone();return n.objectIds=t,i(S(e,n,{signal:a}))});return Promise.all(s)}_processOverridesFromAssociatedLayer(e,t,n,{loadedAttributes:r,attributeData:i}){let a=this._associatedLayer;if(a==null)return;let o=a.objectIdField,s=n.map(t=>(t in i||(i[t]=Array(e.length)),i[t])),c=new Map(r.map(e=>[e.name,e.index])),l=n.map(e=>c.get(e)),u=new Map(Array.from(e,(e,t)=>[e,t]));for(let e of t){let t=e.attributes[o];for(let r=0;r<n.length;r++){let i=l[r],a=u.get(t),o=e.attributes[n[r]];s[r][a]=o,this._cacheAttributeValue(t,i,o)}}}async _fetchChangedObjectIds(e){let t=this.layer;await t.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();let{associatedLayer:n}=t;if(n==null||(await n.load({signal:e}),!n.capabilities?.operations?.supportsChangeTracking))return;let r=this._getFetchChangedObjectIdsServerGen();if(r==null)return;let i=await this.extractChanges.fetch(n,{serverGen:r,returnGeometryChanges:this.is3DOFL,signal:e});if(p(e),i!=null)for(this._setChangedObjectIds(i);this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}_setChangedObjectIds(e){let{attributeChangedObjectIds:t,geometryChangedObjectIds:n}=e,r=Math.min(this._maximumNumberOfEditOVerrides,t.length);r<t.length&&(this._warnMaximumChangedObjectsExceeded=!0);let i=t.sort((e,t)=>e-t);for(let e=0;e<r;++e){let t=i[e];this._attributeChangedObjectIds.add(t)}for(let e of n)this._geometryChangedObjectIds.add(e)}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;let{associatedLayer:t}=this.layer;if(t!=null&&t.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){let n=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(n!=null)for(let e of n)e.geometry!=null&&this.updateGeometry(e.attributes[t.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){let e=this.layer;if(e.serviceUpdateTimeStamp?.lastUpdate!=null)return e.serviceUpdateTimeStamp.lastUpdate;let t=e.associatedLayer;return t?.serverGens?.minServerGen==null?null:t.serverGens.minServerGen}async _lockFeatureIds(e){let t=this._featureIdLocks,n=!0;for(;n;){let r=[];for(let n of e){let e=t.get(n);e&&r.push(e)}r.length===0?n=!1:await Promise.all(r)}let r=Promise.withResolvers(),i=r.promise;for(let n of e)t.set(n,i);return o(()=>{for(let n of e)t.delete(n);r.resolve()})}get test(){}};e([_({constructOnly:!0})],C.prototype,`view`,void 0),e([_({constructOnly:!0})],C.prototype,`layer`,void 0),e([_({constructOnly:!0})],C.prototype,`extractChanges`,void 0),e([_({readOnly:!0})],C.prototype,`is3DOFL`,null),e([_()],C.prototype,`_interactiveEditingSessions`,void 0),e([_({readOnly:!0})],C.prototype,`sortedGeometryChangedObjectIds`,null),e([_({readOnly:!0})],C.prototype,`geometryOverrides`,void 0),e([_()],C.prototype,`_clientGeometryCache`,void 0),e([_()],C.prototype,`_associatedLayer`,null),e([_({constructOnly:!0})],C.prototype,`memoryController`,void 0),e([_()],C.prototype,`_attributeChangedObjectIds`,void 0),e([_()],C.prototype,`_geometryChangedObjectIds`,void 0),e([_()],C.prototype,`hasGeometryChanges`,null),e([_()],C.prototype,`_pendingFetchChangedObjectIds`,void 0),e([_()],C.prototype,`_pendingFetchAbortController`,void 0),e([_()],C.prototype,`_applyGeometryOverridesTask`,void 0),e([_()],C.prototype,`updating`,null),e([_()],C.prototype,`isEmpty`,null),C=e([v(`esri.views.3d.layers.i3s.I3SOverrides`)],C);class w{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class T{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,n){this._cache.put(this._getKey(e,t),new E(n))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class E{constructor(e){this.value=e,this.usedMemory=typeof e==`string`?d(e):u}}const D=5e4;function O(e,t,n,r){return`Displaying the edits of a SceneLayer with a${r===0?e.isGeographic?` geographic `:` projected `:` `}spatial reference (wkid:${e.wkid}) in ${n} viewing mode${r===1?` with spatial reference (wkid:${t.wkid}) `:` `}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${r===0?`viewing mode`:`view spatial reference`} to display edits.`}export{C as I3SOverrides};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{splitIntoChunks as n}from"../../../../core/arrayUtils.js";import{createTask as r,resultOrAbort as i}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import s from"../../../../core/Logger.js";import{abortMaybe as c,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateNumberMemory as u,estimateStringMemory as d}from"../../../../core/memoryEstimations.js";import{whenOrAbort as f,throwIfAborted as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/ReactiveSet.js";import{watch as h,sync as g}from"../../../../core/reactiveUtils.js";import{property as _,subclass as v}from"../../../../core/accessorSupport/decorators.js";import{equals as y}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as b}from"../../../../intl/number.js";import{getMaximumQuerySize as x,queryAllJSON as S}from"../../../../layers/support/featureQueryAll.js";let C=class extends t{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=D,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new m,this._geometryChangedObjectIds=new m,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new T(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(h(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,!this._pendingFetchChangedObjectIds&&(this._applyGeometryOverridesTask=c(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=r(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise.catch(()=>{}))},g)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}).catch(()=>{})}destroy(){this._set(`layer`,null),this._memCache=l(this._memCache),this._pendingFetchAbortController=c(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return this._associatedLayer?.infoFor3D!=null}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return this.layer==null?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return this.is3DOFL?!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished):!1}get isEmpty(){return this._pendingFetchChangedObjectIds==null&&this._attributeChangedObjectIds.size===0&&this._geometryChangedObjectIds.size===0}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);let t=this._interactiveEditingSessions,n=new w(e,()=>{t.remove(n)});return t.unshift(n),n}async applyAttributeOverrides(e,t,n,r=[]){if(this._pendingFetchChangedObjectIds&&await f(this._pendingFetchChangedObjectIds,n),t==null)return;let{attributeData:i,loadedAttributes:a}=t;if(a==null||i==null||this._attributeChangedObjectIds.size===0)return;let o=new Set;for(let e of a)o.add(e.index);for(let t of r)o.has(t.index)||(a.push(t),i[t.name]=Array(e.length));let s=await this._lockFeatureIds(e);try{let t={attributeData:i,loadedAttributes:a},{objectIds:r,fieldNames:o}=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds);if(r.length===0||o.length===0)return;let s=await this._queryAttributeOverridesFromAssociatedLayer(r,o,n);if(s==null)return;this._processOverridesFromAssociatedLayer(e,s,o,t)}finally{s.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);let n=this._clientGeometryCache.get(e);if(n!=null&&(this.geometryOverrides.remove(n),this._clientGeometryCache.delete(e)),t!=null){let n={oid:e,mesh:t};this.geometryOverrides.add(n),this._clientGeometryCache.set(e,n)}}updateAttributeValue(e,t,n){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,n)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,n){this._memCache.put(e,t,n)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:n},r){let i=[];for(let e of t)i[e.index]=n[e.name];let a=new Set,o=new Set;for(let n=0;n<e.length;n++){let s=e[n];if(r.has(s))for(let e of t){let t=this._attributeFromCache(s,e.index);if(t!==void 0){i[e.index][n]=t;continue}a.add(s),o.add(e.name)}}return{objectIds:Array.from(a),fieldNames:Array.from(o)}}_attributeFromCache(e,t){let n=this._fromInteractiveEditingSession(e,t);return n===void 0?this._memCache.get(e,t):n}_fromInteractiveEditingSession(e,t){if(this._interactiveEditingSessions!=null)for(let n of this._interactiveEditingSessions){if(n.objectId!==e)continue;let r=n.getAttribute(t);if(r!==void 0)return r}}async _queryAttributeOverridesFromAssociatedLayer(e,t,n){if(e.length===0)return null;this._logWarningIfMaximumObjectsExceeded();let{associatedLayer:r}=this.layer;if(r==null)return null;let i=r.createQuery(),{objectIdField:a}=r,o=[a,...t];i.where=this.layer.definitionExpression||`1=1`,i.returnGeometry=!1,i.outFields=o,r.capabilities.query.supportsCacheHint&&(i.cacheHint=!0);let s=await this._executeBatchQuery(r,e,i,n),c=[];for(let e of s)if(e.ok)for(let t of e.value.features)c.push(t);return c}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(e.length===0||!this.is3DOFL)return null;let n=this.layer.associatedLayer,r=n.infoFor3D,{spatialReference:i}=n;if(this.view){let{state:{viewingMode:e},spatialReference:t}=this.view,n=e===1,r=i.isGeographic;if(n&&!r)return s.getLogger(this).warn(`unsupported-pcs-edits-in-global-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!n&&r)return s.getLogger(this).warn(`unsupported-gcs-edits-in-local-view`,this.layer.title,O(i,t,this.view.viewingMode,0)),null;if(!(y(i,t)||n&&t.isWebMercator&&i.isWGS84))return s.getLogger(this).warn(`unsupported-mismatched-spatial-reference-edits`,this.layer.title,O(i,t,this.view.viewingMode,1)),null}this._logWarningIfMaximumObjectsExceeded();let{objectIdField:a,globalIdField:o}=n,c=[a,...o==null?[]:[o]],l=n.createQuery();l.where=this.layer.definitionExpression||`1=1`,l.returnGeometry=!0,l.outFields=c,l.returnZ=n.hasZ,l.returnM=n.hasM,n.capabilities.query.supportsCacheHint&&(l.cacheHint=!0);let{assetMapFromAssetMapsJSON:u,extractMesh:d}=await import(`../../../../rest/support/meshFeatureSet.js`),f=await this._executeBatchQuery(n,e,l,t),p=[];for(let e of f){if(!e.ok)continue;let{assetMaps:t,features:n,globalIdFieldName:a}=e.value;if(t==null)continue;let o=u(r,t);for(let e of n){let t=d(e,a,i,r,o),n=e;if(t==null){n.geometry=null;continue}n.geometry=t,p.push(n)}}return p}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${b(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`,t=this.layer.portalItem;t?.loaded?e+=` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:e+=` (${this.layer.parsedUrl.path})`,s.getLogger(this).warn(`#queryOverrides()`,this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,a){if(t.length===0)return[];let o=x(e);t=[...t].sort((e,t)=>e-t);let s=n(t,o).map(t=>{let n=r.clone();return n.objectIds=t,i(S(e,n,{signal:a}))});return Promise.all(s)}_processOverridesFromAssociatedLayer(e,t,n,{loadedAttributes:r,attributeData:i}){let a=this._associatedLayer;if(a==null)return;let o=a.objectIdField,s=n.map(t=>(t in i||(i[t]=Array(e.length)),i[t])),c=new Map(r.map(e=>[e.name,e.index])),l=n.map(e=>c.get(e)),u=new Map(Array.from(e,(e,t)=>[e,t]));for(let e of t){let t=e.attributes[o];for(let r=0;r<n.length;r++){let i=l[r],a=u.get(t),o=e.attributes[n[r]];s[r][a]=o,this._cacheAttributeValue(t,i,o)}}}async _fetchChangedObjectIds(e){let t=this.layer;await t.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();let{associatedLayer:n}=t;if(n==null||(await n.load({signal:e}),!n.capabilities?.operations?.supportsChangeTracking))return;let r=this._getFetchChangedObjectIdsServerGen();if(r==null)return;let i=await this.extractChanges.fetch(n,{serverGen:r,returnGeometryChanges:this.is3DOFL,signal:e});if(p(e),i!=null)for(this._setChangedObjectIds(i);this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}_setChangedObjectIds(e){let{attributeChangedObjectIds:t,geometryChangedObjectIds:n}=e,r=Math.min(this._maximumNumberOfEditOVerrides,t.length);r<t.length&&(this._warnMaximumChangedObjectsExceeded=!0);let i=t.sort((e,t)=>e-t);for(let e=0;e<r;++e){let t=i[e];this._attributeChangedObjectIds.add(t)}for(let e of n)this._geometryChangedObjectIds.add(e)}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;let{associatedLayer:t}=this.layer;if(t!=null&&t.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){let n=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(n!=null)for(let e of n)e.geometry!=null&&this.updateGeometry(e.attributes[t.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){let e=this.layer;if(e.serviceUpdateTimeStamp?.lastUpdate!=null)return e.serviceUpdateTimeStamp.lastUpdate;let t=e.associatedLayer;return t?.serverGens?.minServerGen==null?null:t.serverGens.minServerGen}async _lockFeatureIds(e){let t=this._featureIdLocks,n=!0;for(;n;){let r=[];for(let n of e){let e=t.get(n);e&&r.push(e)}r.length===0?n=!1:await Promise.all(r)}let r=Promise.withResolvers(),i=r.promise;for(let n of e)t.set(n,i);return o(()=>{for(let n of e)t.delete(n);r.resolve()})}get test(){}};e([_({constructOnly:!0})],C.prototype,`view`,void 0),e([_({constructOnly:!0})],C.prototype,`layer`,void 0),e([_({constructOnly:!0})],C.prototype,`extractChanges`,void 0),e([_({readOnly:!0})],C.prototype,`is3DOFL`,null),e([_()],C.prototype,`_interactiveEditingSessions`,void 0),e([_({readOnly:!0})],C.prototype,`sortedGeometryChangedObjectIds`,null),e([_({readOnly:!0})],C.prototype,`geometryOverrides`,void 0),e([_()],C.prototype,`_clientGeometryCache`,void 0),e([_()],C.prototype,`_associatedLayer`,null),e([_({constructOnly:!0})],C.prototype,`memoryController`,void 0),e([_()],C.prototype,`_attributeChangedObjectIds`,void 0),e([_()],C.prototype,`_geometryChangedObjectIds`,void 0),e([_()],C.prototype,`hasGeometryChanges`,null),e([_()],C.prototype,`_pendingFetchChangedObjectIds`,void 0),e([_()],C.prototype,`_pendingFetchAbortController`,void 0),e([_()],C.prototype,`_applyGeometryOverridesTask`,void 0),e([_()],C.prototype,`updating`,null),e([_()],C.prototype,`isEmpty`,null),C=e([v(`esri.views.3d.layers.i3s.I3SOverrides`)],C);class w{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class T{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,n){this._cache.put(this._getKey(e,t),new E(n))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class E{constructor(e){this.value=e,this.usedMemory=typeof e==`string`?d(e):u}}const D=5e4;function O(e,t,n,r){return`Displaying the edits of a SceneLayer with a${r===0?e.isGeographic?` geographic `:` projected `:` `}spatial reference (wkid:${e.wkid}) in ${n} viewing mode${r===1?` with spatial reference (wkid:${t.wkid}) `:` `}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${r===0?`viewing mode`:`view spatial reference`} to display edits.`}export{C as I3SOverrides};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e}from"../../../../core/mathUtils.js";import{fromMat4 as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{identity as r,copy as i,set as a,multiply as o,scale as s,translate as c,rotateZ as l,rotateX as ee,rotateY as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,copy as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as m,zeros as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ones as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{meterIn as y}from"../../../../renderers/support/lengthUtils.js";import{isStringOrNull as b,isNumber as x}from"../../../../support/guards.js";import{debugFlags as S}from"../../support/debugFlags.js";import{olidEnabled as C}from"../../webgl-engine/effects/geometry/olidUtils.js";import{NoParameters as w}from"../../../webgl/NoParameters.js";class T{constructor(e){this.source=e}}class E extends T{constructor(e){super(e),this.minSize=[0,0,0],this.maxSize=[0,0,0],this.offset=[0,0,0],this.factor=[0,0,0],this.type=[0,0,0],this.fallback=[0,0,0],this.symbolRotationMatrix=n(),this.symbolAnchor=g()}}class D extends T{constructor(e){super(e),this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.values=[0,0,0,0,0,0,0,0],this.fallback=[0,0,0,0]}}class O extends T{constructor(e,t=0){super(e),this.fallback=t,this.values=[0,0,0,0,0,0,0,0],this.opacityValues=[0,0,0,0,0,0,0,0]}}class k extends T{constructor(e){super(e),this.offset=[0,0,0],this.factor=[1,1,1],this.type=[0,0,0]}}class A{}function j(e){return e!=null}function M(e,t){e&&e.push(t)}function N(e,t,n,r=d()){let i=e||0,a=t||0,o=n||0;return i!==0&&l(r,r,-i/180*Math.PI),a!==0&&ee(r,r,a/180*Math.PI),o!==0&&u(r,r,o/180*Math.PI),r}function P(e,t,n,r,i){let a=e.minSize,o=e.maxSize;if(e.useSymbolValue){let e=r.symbolSize[n];return t.minSize[n]=e,t.maxSize[n]=e,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0}return j(e.field)||j(e.valueExpression)?j(e.stops)?e.stops.length===2&&x(e.stops[0].size)&&x(e.stops[1].size)?(F(e.stops[0].size,e.stops[1].size,e.stops[0].value,e.stops[1].value,t,n),t.type[n]=1,!0):(M(i,`Could not convert size info: stops only supported with 2 elements`),!1):x(a)&&x(o)&&j(e.minDataValue)&&j(e.maxDataValue)?(F(a,o,e.minDataValue,e.maxDataValue,t,n),t.type[n]=1,!0):e.valueUnit===`unknown`?(M(i,`Could not convert size info: proportional size not supported`),!1):y[e.valueUnit]==null?(M(i,`Could not convert size info: scale-dependent size not supported`),!1):(t.minSize[n]=-1/0,t.maxSize[n]=1/0,t.offset[n]=0,t.factor[n]=1/y[e.valueUnit],t.type[n]=1,!0):e.stops?.[0]&&x(e.stops[0].size)?(t.minSize[n]=e.stops[0].size,t.maxSize[n]=e.stops[0].size,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0):x(a)?(t.minSize[n]=a,t.maxSize[n]=a,t.offset[n]=a,t.factor[n]=0,t.type[n]=1,!0):(M(i,`Could not convert size info: unsupported variant of sizeInfo`),!1)}function F(e,t,n,r,i,a){let o=Math.abs(r-n)>0?(t-e)/(r-n):0;i.minSize[a]=o>0?e:t,i.maxSize[a]=o>0?t:e,i.offset[a]=e-n*o,i.factor[a]=o}function te(e,t,n,r){if(e.normalizationField||e.valueRepresentation)return M(r,`Could not convert size info: unsupported property`),null;if(!b(e.field)&&!b(e.valueExpression))return M(r,`Could not convert size info: field is not a string`),null;let i=R(e);if(!t.size)t.size=new E(i),p(t.size.fallback,n.fallbackSize);else if(i){if(!t.size.source)t.size.source=i;else if(i!==t.size.source)return M(r,`Could not convert size info: multiple fields in use`),null}let a;switch(e.axis){case`width`:return a=P(e,t.size,0,n,r),a?t:null;case`height`:return a=P(e,t.size,2,n,r),a?t:null;case`depth`:return a=P(e,t.size,1,n,r),a?t:null;case`width-and-depth`:return a=P(e,t.size,0,n,r),a&&P(e,t.size,1,n,r),a?t:null;case null:case void 0:case`all`:return a=P(e,t.size,0,n,r),a&&=P(e,t.size,1,n,r),a&&=P(e,t.size,2,n,r),a?t:null;default:return M(r,`Could not convert size info: unknown axis "${e.axis}""`),null}}function ne(e,t,n){for(let n=0;n<3;++n){let r=t.unitInMeters;e.type[n]===1&&(r*=t.modelSize[n],e.type[n]=2),e.minSize[n]=e.minSize[n]/r,e.maxSize[n]=e.maxSize[n]/r,e.offset[n]=e.offset[n]/r,e.factor[n]=e.factor[n]/r}let r;if(e.type[0]!==0)r=0;else if(e.type[1]!==0)r=1;else if(e.type[2]!==0)r=2;else return M(n,`No size axis contains a valid size or scale`),!1;for(let t=0;t<3;++t)e.type[t]===0&&(e.minSize[t]=e.minSize[r],e.maxSize[t]=e.maxSize[r],e.offset[t]=e.offset[r],e.factor[t]=e.factor[r],e.type[t]=e.type[r]);return!0}function I(e,t,n){e[4*t]=n.r/255,e[4*t+1]=n.g/255,e[4*t+2]=n.b/255,e[4*t+3]=n.a}function re(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert color info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert color info: too many color stops`),null;t.color=new D(i);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.color.values[e]=n.value,I(t.color.colors,e,n.color)}_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: missing stops or colors`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0&&e.stops[0].color;t.color=new D(null);for(let e=0;e<8;e++)t.color.values[e]=1/0,I(t.color.colors,e,r);_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: no field and no colors/stops`),null;return t}function ie(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert opacity info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert opacity info: too many opacity stops`),null;t.opacity=new O(i,n.fallbackColor[3]);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.opacity.values[e]=n.value,t.opacity.opacityValues[e]=n.opacity}}else return M(r,`Could not convert opacity info: missing stops or opacities`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0?e.stops[0].opacity:0;t.opacity={source:``,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0],fallback:n.fallbackColor[3]};for(let e=0;e<8;e++)t.opacity.values[e]=1/0,t.opacity.opacityValues[e]=r}else return M(r,`Could not convert opacity info: no field and no opacities/stops`),null;return t}function L(e,t,n){let r=n===2&&e.rotationType===`arithmetic`;t.offset[n]=r?90:0,t.factor[n]=r?-1:1,t.type[n]=1}function R(e){return(e.cache.hasExpression?e.valueExpression:e.field)||``}function z(e,t,n){let r=R(e);if(!t.rotation)t.rotation={source:r,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(r){if(!t.rotation.source)t.rotation.source=r;else if(r!==t.rotation.source)return M(n,`Could not convert rotation info: multiple fields in use`),null}switch(e.axis){case`tilt`:return L(e,t.rotation,0),t;case`roll`:return L(e,t.rotation,1),t;case null:case void 0:case`heading`:return L(e,t.rotation,2),t;default:return M(n,`Could not convert rotation info: unknown axis "${e.axis}""`),null}}class B{constructor({supports:e,modelSize:t,symbolSize:n,unitInMeters:r,anchor:i,scale:a,rotation:o,fallbackColor:s,fallbackSize:c}){this.supports=e,this.modelSize=t??m(),this.symbolSize=n??m(),this.unitInMeters=r??1,this.anchor=i??h(),this.scale=a??m(),this.rotation=o??h(),this.fallbackColor=s??v(),this.fallbackSize=c??m()}}function V(e,t,n){if(!e)return null;let r=e.reduce((e,r)=>{if(!e)return e;switch(r.type){case`size`:return t.supports.size?te(r,e,t,n):e;case`color`:return t.supports.color?re(r,e,t,n):e;case`opacity`:return t.supports.opacity?ie(r,e,t,n):null;case`rotation`:return t.supports.rotation?z(r,e,n):e;default:return null}},new A);return e.length>0&&r&&!r.size&&!r.color&&!r.opacity&&!r.rotation||r?.size&&!ne(r.size,t,n)?null:r}class H{constructor(e,t,n){this.visualVariables=e,this.materialParameters=t,this.requiresShaderTransformation=n}}function U(e,t){if(!e||C()||S.TESTS_DISABLE_FAST_UPDATES)return null;let n=V(e.visualVariables,t);return n?new H(n,q(n,t),!!n.size):null}function W(e,t,n){if(!t||!e)return!1;let r=e.visualVariables,i=V(t.visualVariables,n);return!i||!G(r.size,i.size,`size`)||!G(r.color,i.color,`color`)||!G(r.rotation,i.rotation,`rotation`)||!G(r.opacity,i.opacity,`opacity`)?!1:(e.visualVariables=i,e.materialParameters=q(i,n),e.requiresShaderTransformation=!!i.size,!0)}function G(e,t,n){if(!!e!=!!t||e&&e.source!==t?.source)return!1;if(e&&n===`rotation`){let n=e,r=t;for(let e=0;e<3;e++)if(n.type[e]!==r.type[e]||n.offset[e]!==r.offset[e]||n.factor[e]!==r.factor[e])return!1}return!0}class K extends w{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function q(e,n){let i=new K(e);return i.vvSize&&(p(i.vvSize.symbolAnchor,n.anchor),r($),N(n.rotation[2],n.rotation[0],n.rotation[1],$),t(i.vvSize.symbolRotationMatrix,$)),i}function J(e,t,n){if(!e.vvSize)return n;i(Z,n);let r=e.vvSize.symbolRotationMatrix;return a($,r[0],r[1],r[2],0,r[3],r[4],r[5],0,r[6],r[7],r[8],0,0,0,0,1),o(Z,Z,$),Y(Q,e,t),s(Z,Z,Q),c(Z,Z,e.vvSize.symbolAnchor),Z}function Y(t,n,r){if(!n.vvSize)return f(t,1,1,1),t;if(Number.isNaN(r[0]))return p(t,n.vvSize.fallback);for(let i=0;i<3;++i){let a=n.vvSize.offset[i]+r[0]*n.vvSize.factor[i];t[i]=e(a,n.vvSize.minSize[i],n.vvSize.maxSize[i])}return t}function ae(e,t){return e?.source?X(t?.input):0}function oe(e,t){if(!e?.source)return 0;for(let e=0;e<3;e++)if(t?.input[e]!=null)return X(t.input[e]);return X(void 0)}function X(e){return typeof e!=`number`||!isFinite(e)?NaN:e}const Z=d(),Q=g(),$=d();export{B as ConvertOptions,D as FastColorInfo,O as FastOpacityInfo,k as FastRotationInfo,E as FastSizeInfo,H as FastSymbolUpdatesState,A as FastVisualVariables,K as VisualVariablesParameters,V as convertVisualVariables,J as evaluateModelTransform,Y as evaluateModelTransformScale,ae as getAttributeValue,q as getMaterialParameters,oe as getSizeAttributeValue,U as initFastSymbolUpdatesState,W as updateFastSymbolUpdatesState};
2
+ import{clamp as e}from"../../../../core/mathUtils.js";import{fromMat4 as t}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{identity as r,copy as i,set as a,multiply as o,scale as s,translate as c,rotateZ as l,rotateX as ee,rotateY as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f,copy as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as m,zeros as h,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as _}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ones as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{meterIn as y}from"../../../../renderers/support/lengthUtils.js";import{isStringOrNull as b,isNumber as x}from"../../../../support/guards.js";import{debugFlags as S}from"../../support/debugFlags.js";import{olidEnabled as C}from"../../webgl-engine/effects/geometry/olidUtils.js";import{NoParameters as w}from"../../../webgl/NoParameters.js";class T{constructor(e){this.source=e}}class E extends T{constructor(e){super(e),this.minSize=[0,0,0],this.maxSize=[0,0,0],this.offset=[0,0,0],this.factor=[0,0,0],this.variables=[null,null,null],this.type=[0,0,0],this.fallback=[0,0,0],this.symbolRotationMatrix=n(),this.symbolAnchor=g()}}class D extends T{constructor(e){super(e),this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.values=[0,0,0,0,0,0,0,0],this.fallback=[0,0,0,0]}}class O extends T{constructor(e,t=0){super(e),this.fallback=t,this.values=[0,0,0,0,0,0,0,0],this.opacityValues=[0,0,0,0,0,0,0,0]}}class k extends T{constructor(e){super(e),this.offset=[0,0,0],this.factor=[1,1,1],this.type=[0,0,0]}}class A{}function j(e){return e!=null}function M(e,t){e&&e.push(t)}function N(e,t,n,r=d()){let i=e||0,a=t||0,o=n||0;return i!==0&&l(r,r,-i/180*Math.PI),a!==0&&ee(r,r,a/180*Math.PI),o!==0&&u(r,r,o/180*Math.PI),r}function P(e,t,n,r,i){let a=e.minSize,o=e.maxSize;if(t.variables[n]=e,e.useSymbolValue){let e=r.symbolSize[n];return t.minSize[n]=e,t.maxSize[n]=e,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0}return j(e.field)||j(e.valueExpression)?j(e.stops)?e.stops.length===2&&x(e.stops[0].size)&&x(e.stops[1].size)?(F(e.stops[0].size,e.stops[1].size,e.stops[0].value,e.stops[1].value,t,n),t.type[n]=1,!0):(M(i,`Could not convert size info: stops only supported with 2 elements`),!1):x(a)&&x(o)&&j(e.minDataValue)&&j(e.maxDataValue)?(F(a,o,e.minDataValue,e.maxDataValue,t,n),t.type[n]=1,!0):e.valueUnit===`unknown`?(M(i,`Could not convert size info: proportional size not supported`),!1):y[e.valueUnit]==null?(M(i,`Could not convert size info: scale-dependent size not supported`),!1):(t.minSize[n]=-1/0,t.maxSize[n]=1/0,t.offset[n]=0,t.factor[n]=1/y[e.valueUnit],t.type[n]=1,!0):e.stops?.[0]&&x(e.stops[0].size)?(t.minSize[n]=e.stops[0].size,t.maxSize[n]=e.stops[0].size,t.offset[n]=t.minSize[n],t.factor[n]=0,t.type[n]=1,!0):x(a)?(t.minSize[n]=a,t.maxSize[n]=a,t.offset[n]=a,t.factor[n]=0,t.type[n]=1,!0):(M(i,`Could not convert size info: unsupported variant of sizeInfo`),!1)}function F(e,t,n,r,i,a){let o=Math.abs(r-n)>0?(t-e)/(r-n):0;i.minSize[a]=o>0?e:t,i.maxSize[a]=o>0?t:e,i.offset[a]=e-n*o,i.factor[a]=o}function te(e,t,n,r){if(e.normalizationField||e.valueRepresentation)return M(r,`Could not convert size info: unsupported property`),null;if(!b(e.field)&&!b(e.valueExpression))return M(r,`Could not convert size info: field is not a string`),null;let i=R(e);if(!t.size)t.size=new E(i),p(t.size.fallback,n.fallbackSize);else if(i){if(!t.size.source)t.size.source=i;else if(i!==t.size.source)return M(r,`Could not convert size info: multiple fields in use`),null}let a;switch(e.axis){case`width`:return a=P(e,t.size,0,n,r),a?t:null;case`height`:return a=P(e,t.size,2,n,r),a?t:null;case`depth`:return a=P(e,t.size,1,n,r),a?t:null;case`width-and-depth`:return a=P(e,t.size,0,n,r),a&&P(e,t.size,1,n,r),a?t:null;case null:case void 0:case`all`:return a=P(e,t.size,0,n,r),a&&=P(e,t.size,1,n,r),a&&=P(e,t.size,2,n,r),a?t:null;default:return M(r,`Could not convert size info: unknown axis "${e.axis}""`),null}}function ne(e,t,n){for(let n=0;n<3;++n){let r=t.unitInMeters;e.type[n]===1&&(r*=t.modelSize[n],e.type[n]=2),e.minSize[n]=e.minSize[n]/r,e.maxSize[n]=e.maxSize[n]/r,e.offset[n]=e.offset[n]/r,e.factor[n]=e.factor[n]/r}let r;if(e.type[0]!==0)r=0;else if(e.type[1]!==0)r=1;else if(e.type[2]!==0)r=2;else return M(n,`No size axis contains a valid size or scale`),!1;for(let t=0;t<3;++t)e.type[t]===0&&(e.minSize[t]=e.minSize[r],e.maxSize[t]=e.maxSize[r],e.offset[t]=e.offset[r],e.factor[t]=e.factor[r],e.type[t]=e.type[r],e.variables[t]=e.variables[r]);return!0}function I(e,t,n){e[4*t]=n.r/255,e[4*t+1]=n.g/255,e[4*t+2]=n.b/255,e[4*t+3]=n.a}function re(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert color info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert color info: too many color stops`),null;t.color=new D(i);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.color.values[e]=n.value,I(t.color.colors,e,n.color)}_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: missing stops or colors`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0&&e.stops[0].color;t.color=new D(null);for(let e=0;e<8;e++)t.color.values[e]=1/0,I(t.color.colors,e,r);_(t.color.fallback,n.fallbackColor)}else return M(r,`Could not convert color info: no field and no colors/stops`),null;return t}function ie(e,t,n,r){if(e.normalizationField)return M(r,`Could not convert opacity info: unsupported property`),null;let i=R(e);if(i){if(e.stops){if(e.stops.length>8)return M(r,`Could not convert opacity info: too many opacity stops`),null;t.opacity=new O(i,n.fallbackColor[3]);let a=e.stops;for(let e=0;e<8;++e){let n=a[Math.min(e,a.length-1)];t.opacity.values[e]=n.value,t.opacity.opacityValues[e]=n.opacity}}else return M(r,`Could not convert opacity info: missing stops or opacities`),null}else if(e.stops&&e.stops.length>=0){let r=e.stops&&e.stops.length>=0?e.stops[0].opacity:0;t.opacity={source:``,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0],fallback:n.fallbackColor[3]};for(let e=0;e<8;e++)t.opacity.values[e]=1/0,t.opacity.opacityValues[e]=r}else return M(r,`Could not convert opacity info: no field and no opacities/stops`),null;return t}function L(e,t,n){let r=n===2&&e.rotationType===`arithmetic`;t.offset[n]=r?90:0,t.factor[n]=r?-1:1,t.type[n]=1}function R(e){return(e.cache.hasExpression?e.valueExpression:e.field)||``}function z(e,t,n){let r=R(e);if(!t.rotation)t.rotation={source:r,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};else if(r){if(!t.rotation.source)t.rotation.source=r;else if(r!==t.rotation.source)return M(n,`Could not convert rotation info: multiple fields in use`),null}switch(e.axis){case`tilt`:return L(e,t.rotation,0),t;case`roll`:return L(e,t.rotation,1),t;case null:case void 0:case`heading`:return L(e,t.rotation,2),t;default:return M(n,`Could not convert rotation info: unknown axis "${e.axis}""`),null}}class B{constructor({supports:e,modelSize:t,symbolSize:n,unitInMeters:r,anchor:i,scale:a,rotation:o,fallbackColor:s,fallbackSize:c}){this.supports=e,this.modelSize=t??m(),this.symbolSize=n??m(),this.unitInMeters=r??1,this.anchor=i??h(),this.scale=a??m(),this.rotation=o??h(),this.fallbackColor=s??v(),this.fallbackSize=c??m()}}function V(e,t,n){if(!e)return null;let r=e.reduce((e,r)=>{if(!e)return e;switch(r.type){case`size`:return t.supports.size?te(r,e,t,n):e;case`color`:return t.supports.color?re(r,e,t,n):e;case`opacity`:return t.supports.opacity?ie(r,e,t,n):null;case`rotation`:return t.supports.rotation?z(r,e,n):e;default:return null}},new A);return e.length>0&&r&&!r.size&&!r.color&&!r.opacity&&!r.rotation||r?.size&&!ne(r.size,t,n)?null:r}class H{constructor(e,t,n){this.visualVariables=e,this.materialParameters=t,this.requiresShaderTransformation=n}}function U(e,t){if(!e||C()||S.TESTS_DISABLE_FAST_UPDATES)return null;let n=V(e.visualVariables,t);return n?new H(n,q(n,t),!!n.size):null}function W(e,t,n){if(!t||!e)return!1;let r=e.visualVariables,i=V(t.visualVariables,n);return!i||!G(r.size,i.size,`size`)||!G(r.color,i.color,`color`)||!G(r.rotation,i.rotation,`rotation`)||!G(r.opacity,i.opacity,`opacity`)?!1:(e.visualVariables=i,e.materialParameters=q(i,n),e.requiresShaderTransformation=!!i.size,!0)}function G(e,t,n){if(!!e!=!!t||e&&e.source!==t?.source)return!1;if(e&&n===`rotation`){let n=e,r=t;for(let e=0;e<3;e++)if(n.type[e]!==r.type[e]||n.offset[e]!==r.offset[e]||n.factor[e]!==r.factor[e])return!1}return!0}class K extends w{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function q(e,n){let i=new K(e);return i.vvSize&&(p(i.vvSize.symbolAnchor,n.anchor),r($),N(n.rotation[2],n.rotation[0],n.rotation[1],$),t(i.vvSize.symbolRotationMatrix,$)),i}function J(e,t,n){if(!e.vvSize)return n;i(Z,n);let r=e.vvSize.symbolRotationMatrix;return a($,r[0],r[1],r[2],0,r[3],r[4],r[5],0,r[6],r[7],r[8],0,0,0,0,1),o(Z,Z,$),Y(Q,e,t),s(Z,Z,Q),c(Z,Z,e.vvSize.symbolAnchor),Z}function Y(t,n,r){if(!n.vvSize)return f(t,1,1,1),t;if(Number.isNaN(r[0]))return p(t,n.vvSize.fallback);for(let i=0;i<3;++i){let a=n.vvSize.offset[i]+r[0]*n.vvSize.factor[i];t[i]=e(a,n.vvSize.minSize[i],n.vvSize.maxSize[i])}return t}function ae(e,t){return e?.source?X(t?.input):0}function oe(e,t){if(!e?.source)return 0;for(let e=0;e<3;e++)if(t?.input[e]!=null)return X(t.input[e]);return X(void 0)}function X(e){return typeof e!=`number`||!isFinite(e)?NaN:e}const Z=d(),Q=g(),$=d();export{B as ConvertOptions,D as FastColorInfo,O as FastOpacityInfo,k as FastRotationInfo,E as FastSizeInfo,H as FastSymbolUpdatesState,A as FastVisualVariables,K as VisualVariablesParameters,V as convertVisualVariables,J as evaluateModelTransform,Y as evaluateModelTransformScale,ae as getAttributeValue,q as getMaterialParameters,oe as getSizeAttributeValue,U as initFastSymbolUpdatesState,W as updateFastSymbolUpdatesState};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../../core/a11yUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as s,dot as c,crossAndNormalize as l,scale as u,add as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPositionAndNormal as h}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as _}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as y}from"./InteractiveController.js";import{GroundNavigationMomentumController as b}from"./momentum/GroundNavigationMomentumController.js";import{findSphereHorizonY as x,computeHorizonPaddingLimits as S,findPlaneHorizonY as C,findGroundNavigationGrabLocation as w,groundNavigationConstants as T}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as E}from"../utils/OffsetCorrectionController.js";import D from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as O}from"../../../navigation/GroundNavigationMomentumEstimator.js";let k=class extends y{constructor(e){super(e),this._drag=null,this._validState=!0,this._adjustedScenePoint=f(),this._momentumEstimator=new O,this._referenceSphere=new g,this._referencePlane=m(),this._tmp3d=f(),this._screenPointArray=n(),this._forwardRopeComponent=f(),this._sidewaysRopeComponent=f(),this._ropeTranslation=f(),this._beginScreenPoint=n(),this._screenPickPoint=n(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=m(),this._pointerOverHorizonVelocityAdjustment=1,this._beginCamera=new D,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new E(this.view)}stepController(e,t){this._drag&&=(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,e),t.copyFrom(this.currentCamera),null)}get isGlobalMode(){return this.view.state.viewingMode===1}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!t()}begin(e){this.running&&(r(e.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),a(this._beginScreenPoint,this._screenPickPoint),this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera))}update(e){this.running&&this._validState&&(this._drag=e,this.updateInteractive())}end(e){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=p(this.view.spatialReference).radius,this._horizonY=x(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=this._horizonY==null?null:S(this.startCamera,this._horizonY)}_localInitHorizonValues(){let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=f();s(t,this.startCamera.eye,e,-this.startCamera.relativeElevation),h(t,e,this._referencePlane),this._horizonY=C(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;if(this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio,!w({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint})){this._validState=!1;return}let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=this.startCamera.viewRight,n=c(this._ropeTranslation,t),r=l(f(),e,t),i=c(this._ropeTranslation,r);u(this._forwardRopeComponent,r,i),u(this._sidewaysRopeComponent,t,n),h(this._adjustedScenePoint,e,this._ropePlane);let a=this._ropeScreenHeight-this._beginScreenPoint[1],o=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=o===0?1:Math.max(a/o,1)}_panningRopePull(e,t){if(!this._horizonY||!this._horizonPadding)return;let n=r(e.center,this._screenPointArray),i=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,a=(this._ropeScreenHeight-n[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),c=1-a,l=(n[0]-i)/(this._beginScreenPoint[0]-i),f=c*T.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,p=(c*T.xSpeedMultiplier+a*((1-l)*T.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;u(this._ropeTranslation,this._forwardRopeComponent,f),s(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,p),this.currentCamera.eye=d(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=d(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(n,this._ropeTranslation,e.timestamp*.001),this._constraintOptions.interactionFactor=_(o(this._beginScreenPoint,n)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation(this.currentCamera,t,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){let e=this.momentumEnabled&&this._momentumEstimator.createMomentum();return e?new b({view:this.view,momentum:e}):null}};k=e([i(`esri.views.3d.state.controllers.GroundNavigationController`)],k);export{k as GroundNavigationController};
2
+ import{__decorate as e}from"tslib";import{prefersReducedMotion as t}from"../../../../core/a11yUtils.js";import{createScreenPointArray as n,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as i}from"../../../../core/accessorSupport/decorators.js";import{copy as a,distance as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as s,dot as c,crossAndNormalize as l,scale as u,add as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as p}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPositionAndNormal as h}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as _}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as y}from"./InteractiveController.js";import{GroundNavigationMomentumController as b}from"./momentum/GroundNavigationMomentumController.js";import{findSphereHorizonY as x,computeHorizonPaddingLimits as S,findPlaneHorizonY as C,findGroundNavigationGrabLocation as w,groundNavigationConstants as T}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as E}from"../utils/OffsetCorrectionController.js";import D from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as O}from"../../../navigation/GroundNavigationMomentumEstimator.js";let k=class extends y{constructor(e){super(e),this._drag=null,this._validState=!0,this._adjustedScenePoint=f(),this._momentumEstimator=new O,this._referenceSphere=new g,this._referencePlane=m(),this._tmp3d=f(),this._screenPointArray=n(),this._forwardRopeComponent=f(),this._sidewaysRopeComponent=f(),this._ropeTranslation=f(),this._beginScreenPoint=n(),this._screenPickPoint=n(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=m(),this._pointerOverHorizonVelocityAdjustment=1,this._forceStayAboveGround=!1,this._beginCamera=new D,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new E(this.view)}stepController(e,t){this._drag&&=(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,e),t.copyFrom(this.currentCamera),null)}get isGlobalMode(){return this.view.state.viewingMode===1}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!t()}begin(e){this.running&&(r(e.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),a(this._beginScreenPoint,this._screenPickPoint),this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera))}update(e){this.running&&this._validState&&(this._drag=e,this.updateInteractive())}end(e){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=p(this.view.spatialReference).radius,this._horizonY=x(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=this._horizonY==null?null:S(this.startCamera,this._horizonY)}_localInitHorizonValues(){let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=f();s(t,this.startCamera.eye,e,-this.startCamera.relativeElevation),h(t,e,this._referencePlane),this._horizonY=C(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;if(this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio,!w({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint})){this._validState=!1;return}let e=f();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,e);let t=this.startCamera.viewRight,n=c(this._ropeTranslation,t),r=l(f(),e,t),i=c(this._ropeTranslation,r);u(this._forwardRopeComponent,r,i),u(this._sidewaysRopeComponent,t,n),h(this._adjustedScenePoint,e,this._ropePlane);let a=this._ropeScreenHeight-this._beginScreenPoint[1],o=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=o===0?1:Math.max(a/o,1),this._forceStayAboveGround=this.view.groundView.baseOpacity>0&&this.view.state.camera.relativeElevation>=0&&this.view.navigation.mode.offset!=null}_panningRopePull(e,t){if(!this._horizonY||!this._horizonPadding)return;let n=r(e.center,this._screenPointArray),i=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,a=(this._ropeScreenHeight-n[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),c=1-a,l=(n[0]-i)/(this._beginScreenPoint[0]-i),f=c*T.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,p=(c*T.xSpeedMultiplier+a*((1-l)*T.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;u(this._ropeTranslation,this._forwardRopeComponent,f),s(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,p),this.currentCamera.eye=d(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=d(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(n,this._ropeTranslation,e.timestamp*.001),this._constraintOptions.interactionFactor=_(o(this._beginScreenPoint,n)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation({camera:this.currentCamera,deltaTime:t,constraintOptions:this._constraintOptions,forceStayAboveGround:this._forceStayAboveGround}),this._constraintOptions.interactionDirection=null}createMomentum(){let e=this.momentumEnabled&&this._momentumEstimator.createMomentum();return e?new b({view:this.view,momentum:e,forceStayAboveGround:this._forceStayAboveGround}):null}};k=e([i(`esri.views.3d.state.controllers.GroundNavigationController`)],k);export{k as GroundNavigationController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{Seconds as t}from"../../../../../core/time.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{scale as i,add as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as s}from"./MomentumController.js";import{OffsetCorrectionController as c}from"../../utils/OffsetCorrectionController.js";let l=class extends s{constructor(e){super(e),this.interactionType=6,this._tmpPan=o(),this._lastUpdateTime=0,this._remainingGroundCorrection=0}initialize(){this._offsetCorrectionController=new c(this.view)}momentumStep(e,n){let r=this.momentum.value(e);i(this._tmpPan,this.momentum.direction,r),n.eye=a(u,n.eye,this._tmpPan),n.center=a(u,n.center,this._tmpPan);let o=t(e-this._lastUpdateTime);this.constraintOptions.interactionDirection=this._tmpPan,this._remainingGroundCorrection=this._offsetCorrectionController.smoothlyCorrectGroundElevation(n,o),this._lastUpdateTime=e}get finished(){return super.finished&&this._remainingGroundCorrection<=.01}};e([n({constructOnly:!0})],l.prototype,`momentum`,void 0),l=e([r(`esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController`)],l);const u=o();export{l as GroundNavigationMomentumController};
2
+ import{__decorate as e}from"tslib";import{Seconds as t}from"../../../../../core/time.js";import{property as n,subclass as r}from"../../../../../core/accessorSupport/decorators.js";import{scale as i,add as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MomentumController as s}from"./MomentumController.js";import{OffsetCorrectionController as c}from"../../utils/OffsetCorrectionController.js";let l=class extends s{constructor(e){super(e),this.forceStayAboveGround=!1,this.interactionType=6,this._tmpPan=o(),this._lastUpdateTime=0,this._remainingGroundCorrection=0}initialize(){this._offsetCorrectionController=new c(this.view)}momentumStep(e,n){let r=this.momentum.value(e);i(this._tmpPan,this.momentum.direction,r),n.eye=a(u,n.eye,this._tmpPan),n.center=a(u,n.center,this._tmpPan);let o=t(e-this._lastUpdateTime);this.constraintOptions.interactionDirection=this._tmpPan,this._remainingGroundCorrection=this._offsetCorrectionController.smoothlyCorrectGroundElevation({camera:n,deltaTime:o,forceStayAboveGround:this.forceStayAboveGround}),this._lastUpdateTime=e}get finished(){return super.finished&&this._remainingGroundCorrection<=.01}};e([n({constructOnly:!0})],l.prototype,`momentum`,void 0),e([n()],l.prototype,`forceStayAboveGround`,void 0),l=e([r(`esri.views.3d.state.controllers.momentum.GroundNavigationMomentumController`)],l);const u=o();export{l as GroundNavigationMomentumController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as e}from"../../../../core/mathUtils.js";import{dot as t,distance as n,subtract as r,scale as i,add as a,copy as o,normalize as s,cross as c,scaleAndAdd as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as p}from"../../camera/constraintUtils.js";import{Intersector as m}from"../../webgl-engine/lib/Intersector.js";const h=.5,g=new Set([0,2,8]),_=new Set(g).add(7);class v{constructor(e){this._view=e,this._tmpRay=f(),this._tmpWorldUp=u(),this._tmpScaledUp=u(),this._tmpCorrectionOffset=u(),this._tmpUpdatedCameraPos=u(),this._tmpCenterDiff=u(),this._tmpMovementDelta=u(),this._tmpPerpendicularMovementDelta=u(),this._tmpGroundIntersections=[u(),u(),u()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[u(),u(),u()],this._tmpRayDirection=u(),this._previousCameraPosition=null,this._intersector=new m(this._view.state.viewingMode),this._intersector.options.invisibleTerrain=!0}smoothlyCorrectGroundElevation(e,n,r,i){let a=this._prepareMode(i);if(!a)return 0;let o=this._view.renderCoordsHelper.worldUpAtPosition(e.eye,this._tmpWorldUp),s=this._prepareCameraAndPreviousIterationPosition(e,o,this._previousCameraPosition),c=this._prepareRays(e,o,s),l=this._intersectRays(a,o,c);if(!l.hasIntersection){let t=this._adjustCameraElevation(e,o,0,r);return this._previousCameraPosition=d(t),0}let u=this._filterRayResults(o,s,l),f=this._getSmoothedElevationCorrection(a,u,e,o,s,n),p=this._adjustCameraElevation(e,o,f,r);return this._previousCameraPosition=d(p),Math.abs(u-t(p,o))}immediatelyCorrectGroundElevation(e,i=1/0,a,o){let s=this._prepareMode(o);if(!s)return;let c=this._view.renderCoordsHelper.worldUpAtPosition(e.eye,this._tmpWorldUp),l=this._prepareRays(e,c),u=this._intersectRays(s,c,l),d=u.intersections[0];if(!u.hasIntersection||n(e.eye,d)>i){this._adjustCameraElevation(e,c,0,a);return}this._adjustCameraElevation(e,c,t(c,r(this._tmpCorrectionOffset,d,e.eye)),a)}_prepareMode(e){let t=e??this._view.navigation.mode;return t.type!==`ground`||!t.offset?null:t}_prepareCameraAndPreviousIterationPosition(e,n,r){if(r){let o=t(n,e.eye),s=t(n,r);return i(this._tmpCorrectionOffset,n,s-o),e.eye=a(this._tmpUpdatedCameraPos,e.eye,this._tmpCorrectionOffset),e.center=a(this._tmpUpdatedCameraPos,e.center,this._tmpCorrectionOffset),r}return e.eye}_prepareRays(e,t,n){let r=i(this._tmpRayDirection,t,-1e5);if(o(this._tmpRayOrigins[0],e.eye),!n)return{origins:this._tmpRayOrigins,direction:r,count:1};let{forwardMovementDirection:a,rightMovementDirection:s}=this._getMovementDirections(e.eye,n,t);return this._getLeftRayOrigin(e.eye,a,s,this._tmpRayOrigins[1]),this._getRightRayOrigin(e.eye,a,s,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:r,count:this._tmpRayOrigins.length}}_getMovementDirections(e,n,a){let o=r(this._tmpMovementDelta,e,n);return r(o,o,i(this._tmpScaledUp,a,t(a,o))),s(o,o),{forwardMovementDirection:o,rightMovementDirection:c(this._tmpPerpendicularMovementDelta,o,a)}}_getLeftRayOrigin(e,t,n,r){return l(r,e,t,h),l(r,r,n,-.5),r}_getRightRayOrigin(e,t,n,r){return l(r,e,t,h),l(r,r,n,h),r}_intersectRays(e,t,r){let i=e.offset,a=this._view.sceneIntersectionHelper,s=y(e,this._view.groundView.baseOpacity===0);o(this._tmpRay.direction,r.direction);for(let e=0;e<r.count;e++)o(this._tmpRay.origin,r.origins[e]),this._tmpGroundIntersectionHits[e]=a.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[e],s),this._tmpGroundIntersectionHits[e]&&n(this._tmpGroundIntersections[e],this._tmpRay.origin)>1e5&&(this._tmpGroundIntersectionHits[e]=!1),this._tmpGroundIntersectionHits[e]&&l(this._tmpGroundIntersections[e],this._tmpGroundIntersections[e],t,i);let c=this._tmpGroundIntersectionHits.some((e,t)=>t<r.count&&e);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:r.count,hasIntersection:c}}_filterRayResults(e,n,r){let i=t(n,e),a=null;for(let n=0;n<r.count;n++){if(!r.hits[n])continue;let o=r.intersections[n],s=t(o,e);(a==null||Math.abs(s-i)<Math.abs(a-i))&&(a=s)}return a}_getSmoothedElevationCorrection(r,i,a,o,s,c){let l=n(a.eye,s)/c,u=1+Math.max(0,(l-5)*.03),d=(u*1e-5)**c,f=t(s,o)*d+i*(1-d),p=t(a.eye,o),m=u*5*c*(r.offset??0),h=f-p;return e(h,-m,m)}_adjustCameraElevation(e,t,n,i){return n!==0&&(l(this._tmpUpdatedCameraPos,e.eye,t,n),r(this._tmpCenterDiff,e.center,e.eye),e.eye=this._tmpUpdatedCameraPos,e.center=a(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff)),p(this._view,e,i),e.eye}}function y(e,t){return b(e.include)?{include:e.include,exclude:e.exclude}:{exclude:e.exclude,objectFilter:e=>!!e.lastValidElevationBB,allowedIntersectorTypes:t?g:_}}function b(e){return e!=null&&e.size>0}export{v as OffsetCorrectionController};
2
+ import{clamp as e}from"../../../../core/mathUtils.js";import{dot as t,distance as n,subtract as r,scale as i,add as a,copy as o,normalize as s,cross as c,scaleAndAdd as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u,clone as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f}from"../../../../geometry/support/ray.js";import p from"../../../../ground/NavigationConstraint.js";import{applyConstraintsAndUpdateCenterRenderCamera as m}from"../../camera/constraintUtils.js";import{Intersector as h}from"../../webgl-engine/lib/Intersector.js";const g=.5,_=new Set([0,2,8]),v=new Set(_).add(7);class y{constructor(e){this._view=e,this._tmpRay=f(),this._tmpWorldUp=u(),this._tmpScaledUp=u(),this._tmpCorrectionOffset=u(),this._tmpUpdatedCameraPos=u(),this._tmpCenterDiff=u(),this._tmpMovementDelta=u(),this._tmpPerpendicularMovementDelta=u(),this._tmpGroundIntersections=[u(),u(),u()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[u(),u(),u()],this._tmpRayDirection=u(),this._previousCameraPosition=null,this._intersector=new h(this._view.state.viewingMode),this._intersector.options.invisibleTerrain=!0}smoothlyCorrectGroundElevation(e){let{camera:n,deltaTime:r,constraintOptions:i,navigationModeOverride:a,forceStayAboveGround:o}=e,s=this._prepareMode(a);if(!s||!r)return 0;let c=this._view.renderCoordsHelper.worldUpAtPosition(n.eye,this._tmpWorldUp),l=this._prepareCameraAndPreviousIterationPosition(n,c,this._previousCameraPosition),u=this._prepareRays(n,c,l),f=this._intersectRays(s,c,u);if(!f.hasIntersection){let e=this._adjustCameraElevation(n,c,0,o,i);return this._previousCameraPosition=d(e),0}let p=this._filterRayResults(c,l,f),m=this._getSmoothedElevationCorrection(s,p,n,c,l,r),h=this._adjustCameraElevation(n,c,m,o,i);return this._previousCameraPosition=d(h),Math.abs(p-t(h,c))}immediatelyCorrectGroundElevation(e){let{camera:i,constraintOptions:a,navigationModeOverride:o,correctionLimit:s}=e,c=this._prepareMode(o);if(!c)return;let l=this._view.renderCoordsHelper.worldUpAtPosition(i.eye,this._tmpWorldUp),u=this._prepareRays(i,l),d=this._intersectRays(c,l,u),f=d.intersections[0];if(!d.hasIntersection||n(i.eye,f)>(s??1/0)){this._adjustCameraElevation(i,l,0,!1,a);return}this._adjustCameraElevation(i,l,t(l,r(this._tmpCorrectionOffset,f,i.eye)),!1,a)}_prepareMode(e){let t=e??this._view.navigation.mode;return t.type!==`ground`||!t.offset?null:t}_prepareCameraAndPreviousIterationPosition(e,n,r){if(r){let o=t(n,e.eye),s=t(n,r);return i(this._tmpCorrectionOffset,n,s-o),e.eye=a(this._tmpUpdatedCameraPos,e.eye,this._tmpCorrectionOffset),e.center=a(this._tmpUpdatedCameraPos,e.center,this._tmpCorrectionOffset),r}return e.eye}_prepareRays(e,t,n){let r=i(this._tmpRayDirection,t,-1e5);if(o(this._tmpRayOrigins[0],e.eye),!n)return{origins:this._tmpRayOrigins,direction:r,count:1};let{forwardMovementDirection:a,rightMovementDirection:s}=this._getMovementDirections(e.eye,n,t);return this._getLeftRayOrigin(e.eye,a,s,this._tmpRayOrigins[1]),this._getRightRayOrigin(e.eye,a,s,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:r,count:this._tmpRayOrigins.length}}_getMovementDirections(e,n,a){let o=r(this._tmpMovementDelta,e,n);return r(o,o,i(this._tmpScaledUp,a,t(a,o))),s(o,o),{forwardMovementDirection:o,rightMovementDirection:c(this._tmpPerpendicularMovementDelta,o,a)}}_getLeftRayOrigin(e,t,n,r){return l(r,e,t,g),l(r,r,n,-.5),r}_getRightRayOrigin(e,t,n,r){return l(r,e,t,g),l(r,r,n,g),r}_intersectRays(e,t,r){let i=e.offset,a=this._view.sceneIntersectionHelper,s=b(e,this._view.groundView.baseOpacity===0);o(this._tmpRay.direction,r.direction);for(let e=0;e<r.count;e++)o(this._tmpRay.origin,r.origins[e]),this._tmpGroundIntersectionHits[e]=a.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[e],s),this._tmpGroundIntersectionHits[e]&&n(this._tmpGroundIntersections[e],this._tmpRay.origin)>1e5&&(this._tmpGroundIntersectionHits[e]=!1),this._tmpGroundIntersectionHits[e]&&l(this._tmpGroundIntersections[e],this._tmpGroundIntersections[e],t,i);let c=this._tmpGroundIntersectionHits.some((e,t)=>t<r.count&&e);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:r.count,hasIntersection:c}}_filterRayResults(e,n,r){let i=t(n,e),a=null;for(let n=0;n<r.count;n++){if(!r.hits[n])continue;let o=r.intersections[n],s=t(o,e);(a==null||Math.abs(s-i)<Math.abs(a-i))&&(a=s)}return a}_getSmoothedElevationCorrection(r,i,a,o,s,c){let l=n(a.eye,s)/c,u=1+Math.max(0,(l-5)*.03),d=(u*1e-5)**c,f=t(s,o)*d+i*(1-d),p=t(a.eye,o),m=u*5*c*(r.offset??0),h=f-p;return e(h,-m,m)}_adjustCameraElevation(e,t,n,i,o){n!==0&&(l(this._tmpUpdatedCameraPos,e.eye,t,n),r(this._tmpCenterDiff,e.center,e.eye),e.eye=this._tmpUpdatedCameraPos,e.center=a(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff));let s=this._view.map.ground.navigationConstraint;return i&&s?.type!==`stay-above`?(this._view.map.ground.navigationConstraint=new p({type:`stay-above`}),m(this._view,e,o),this._view.map.ground.navigationConstraint=s):m(this._view,e,o),e.eye}}function b(e,t){return x(e.include)?{include:e.include,exclude:e.exclude}:{exclude:e.exclude,objectFilter:e=>!!e.lastValidElevationBB,allowedIntersectorTypes:t?_:v}}function x(e){return e!=null&&e.size>0}export{y as OffsetCorrectionController};