@arcgis/core 4.23.0-next.20220126 → 4.23.0-next.20220127

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 (247) hide show
  1. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
  4. package/assets/esri/core/workers/chunks/0317f37b6c8705b363fd.js +1 -0
  5. package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
  6. package/assets/esri/core/workers/chunks/{97ec9eef0048760fa260.js → 0d02c6ad1f4688bfa374.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
  8. package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
  9. package/assets/esri/core/workers/chunks/12c0cabb6c59e65d8546.js +1 -0
  10. package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
  11. package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
  12. package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
  13. package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
  14. package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
  15. package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
  16. package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
  17. package/assets/esri/core/workers/chunks/2c8fe9bc988c3c5760a5.js +1 -0
  18. package/assets/esri/core/workers/chunks/322d917e8cb398816a93.js +1 -0
  19. package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
  20. package/assets/esri/core/workers/chunks/{e6165e17fbb07bfc40a1.js → 391e96192d1ec4e55ce2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{23b15e7c2f96d260e16c.js → 392b6382e06652dd4c80.js} +1 -1
  22. package/assets/esri/core/workers/chunks/3aa73119b055e05bbbeb.js +1 -0
  23. package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{438f0b5ae5c53ae4f06a.js → 4954fd86b48cc68b737c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
  26. package/assets/esri/core/workers/chunks/52ea678ba1da0e349919.js +1 -0
  27. package/assets/esri/core/workers/chunks/56274b37ff74ca0d68a6.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{5dfe1f8d520025e2118b.js → 57b349d1dbc0bed75b79.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{b2ebe4f6d100e15b512d.js → 5948923e07bd1662c24a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{97a28641b3b2fd31bea2.js → 5bcb3240b3c005e5fe72.js} +1 -1
  32. package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
  33. package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
  34. package/assets/esri/core/workers/chunks/5ee497d5d7b0e580526a.js +1 -0
  35. package/assets/esri/core/workers/chunks/5f1dcb6556820cd0aa31.js +1 -0
  36. package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
  37. package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
  38. package/assets/esri/core/workers/chunks/6e6a3c5866e8d8820457.js +1 -0
  39. package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
  40. package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
  41. package/assets/esri/core/workers/chunks/8001b0e514bfffe9d7f8.js +1 -0
  42. package/assets/esri/core/workers/chunks/83b8fec1650e061aaa56.js +1 -0
  43. package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
  44. package/assets/esri/core/workers/chunks/842db82733635dbf25cb.js +1 -0
  45. package/assets/esri/core/workers/chunks/{434b16731c6a81f868ef.js → 85b1f36790df95b17659.js} +1 -1
  46. package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
  47. package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
  49. package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
  50. package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
  51. package/assets/esri/core/workers/chunks/{f760a3e030b0f358a92a.js → aeaa1667c2d9f1b3366b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → b62e3dccd9f662c0afeb.js} +1 -1
  53. package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
  54. package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
  55. package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
  56. package/assets/esri/core/workers/chunks/{e4b84ca8ddfd48dd79b1.js → bac9fc90e6756e211160.js} +1 -1
  57. package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
  58. package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
  59. package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
  60. package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
  61. package/assets/esri/core/workers/chunks/{e4e2036373166c1d5cf5.js → c2253a9f29c1aabb2b75.js} +1 -1
  62. package/assets/esri/core/workers/chunks/c9cbf8135e95f0f42cd9.js +1 -0
  63. package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
  64. package/assets/esri/core/workers/chunks/d07440469fe7d181c4fd.js +1 -0
  65. package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
  66. package/assets/esri/core/workers/chunks/d835b2a683fcd8aeeed8.js +1 -0
  67. package/assets/esri/core/workers/chunks/dbf192b4ce7e608610f6.js +1 -0
  68. package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
  69. package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
  70. package/assets/esri/core/workers/chunks/{22b09e276c9b9f22f0f8.js → dee9929d95e9fe26929c.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{6f50a9647f026a8d4729.js → e0c8d61c7a85ce15499a.js} +1 -1
  72. package/assets/esri/core/workers/chunks/e12d91ef44d6f879a02a.js +1 -0
  73. package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → e4896cf85fb2da8a9cc7.js} +1 -1
  74. package/assets/esri/core/workers/chunks/e657ba0cab29f05d02da.js +1 -0
  75. package/assets/esri/core/workers/chunks/e8741bf421f80213f1d3.js +1 -0
  76. package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
  77. package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
  78. package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
  79. package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
  80. package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
  81. package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
  82. package/assets/esri/core/workers/chunks/f9ff3eaf4eb324429fbd.js +1 -0
  83. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  84. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  85. package/assets/esri/themes/dark/main.css +1 -1
  86. package/assets/esri/themes/dark-blue/main.css +1 -1
  87. package/assets/esri/themes/dark-green/main.css +1 -1
  88. package/assets/esri/themes/dark-purple/main.css +1 -1
  89. package/assets/esri/themes/dark-red/main.css +1 -1
  90. package/assets/esri/themes/light/main.css +1 -1
  91. package/assets/esri/themes/light/view.css +1 -1
  92. package/assets/esri/themes/light-blue/main.css +1 -1
  93. package/assets/esri/themes/light-green/main.css +1 -1
  94. package/assets/esri/themes/light-purple/main.css +1 -1
  95. package/assets/esri/themes/light-red/main.css +1 -1
  96. package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
  97. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  98. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  99. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  100. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  101. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  102. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  103. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  104. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  105. package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
  106. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  107. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  108. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  109. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  110. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  111. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  112. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  113. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  114. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  115. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  116. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  117. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  118. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  119. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  120. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  121. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  122. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  123. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  124. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  125. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  126. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  127. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  128. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  129. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  130. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  131. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  132. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  133. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  137. package/chunks/Precipitation.glsl.js +91 -0
  138. package/chunks/vxlLayer.js +1 -1
  139. package/core/clock.js +1 -1
  140. package/core/jsonMap.js +1 -1
  141. package/core/promiseUtils.js +1 -1
  142. package/core/reactiveUtils.js +1 -1
  143. package/form/ExpressionInfo.js +1 -1
  144. package/interfaces.d.ts +28 -28
  145. package/package.json +1 -1
  146. package/rest/print.js +1 -1
  147. package/support/arcadeOnDemand.js +1 -1
  148. package/support/featureFlags.js +1 -1
  149. package/support/revision.js +1 -1
  150. package/views/2d/MapViewConstraints.js +1 -1
  151. package/views/2d/viewpointUtils.js +1 -1
  152. package/views/3d/environment/CloudsPresets.js +1 -1
  153. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  154. package/views/3d/environment/Precipitation.glsl.js +5 -0
  155. package/views/3d/environment/Precipitation.js +5 -0
  156. package/views/3d/environment/PrecipitationTechnique.js +5 -0
  157. package/views/3d/environment/RainyWeather.js +1 -1
  158. package/views/3d/environment/SnowyWeather.js +5 -0
  159. package/views/3d/environment/weather.js +1 -1
  160. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  161. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  162. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  163. package/views/3d/layers/GraphicsView3D.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  165. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  166. package/views/3d/support/sunUtils.js +1 -1
  167. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  168. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  169. package/views/MapView.js +1 -1
  170. package/views/View.js +1 -1
  171. package/views/input/recognizers/DoubleTapDrag.js +1 -1
  172. package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
  173. package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
  174. package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
  175. package/views/support/DefaultsFromMap.js +1 -1
  176. package/views/support/projectionUtils.js +5 -0
  177. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  178. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  179. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  180. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  181. package/widgets/BasemapGallery.js +1 -1
  182. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  183. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  184. package/widgets/Slice/SliceViewModel.js +1 -1
  185. package/widgets/Weather/WeatherViewModel.js +1 -1
  186. package/widgets/Weather/css.js +1 -1
  187. package/widgets/Weather/enums.js +5 -0
  188. package/widgets/Weather.js +1 -1
  189. package/widgets/support/InteractiveToolViewModel.js +1 -1
  190. package/assets/esri/core/workers/chunks/00c5bb5eecb0e89266df.js +0 -1
  191. package/assets/esri/core/workers/chunks/021a37e2b191298e80b7.js +0 -1
  192. package/assets/esri/core/workers/chunks/1370c92c40fd6271553c.js +0 -1
  193. package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
  194. package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
  195. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
  196. package/assets/esri/core/workers/chunks/1fbcc8424452d0256bd6.js +0 -1
  197. package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
  198. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
  199. package/assets/esri/core/workers/chunks/2792ca40f1e92849247c.js +0 -1
  200. package/assets/esri/core/workers/chunks/2a96f1bba9ce6883e5e0.js +0 -1
  201. package/assets/esri/core/workers/chunks/3231ee3e090bb4cac3fc.js +0 -1
  202. package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
  203. package/assets/esri/core/workers/chunks/36e250278b5622ccf068.js +0 -1
  204. package/assets/esri/core/workers/chunks/395ba088d4864588ff66.js +0 -1
  205. package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
  206. package/assets/esri/core/workers/chunks/3cc77692b2eee27b9c9e.js +0 -1
  207. package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
  208. package/assets/esri/core/workers/chunks/4385a268c2a64281d1c1.js +0 -1
  209. package/assets/esri/core/workers/chunks/46b4bb66a54bbd8e2e57.js +0 -1
  210. package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
  211. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
  212. package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
  213. package/assets/esri/core/workers/chunks/5d991b74d958005c26c4.js +0 -1
  214. package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
  215. package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
  216. package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
  217. package/assets/esri/core/workers/chunks/7d661129a0d8c466eeec.js +0 -1
  218. package/assets/esri/core/workers/chunks/8070972c0efb78523b68.js +0 -1
  219. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
  220. package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
  221. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
  222. package/assets/esri/core/workers/chunks/98986e6601b0366376b4.js +0 -1
  223. package/assets/esri/core/workers/chunks/9cdcf9309d6feda70185.js +0 -1
  224. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
  225. package/assets/esri/core/workers/chunks/aace7e1fef256bb961c9.js +0 -1
  226. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
  227. package/assets/esri/core/workers/chunks/af5694b4d278cf1db2d9.js +0 -1
  228. package/assets/esri/core/workers/chunks/afbb4f802ca5774f0326.js +0 -1
  229. package/assets/esri/core/workers/chunks/b2c5f92e3d7606297ca9.js +0 -1
  230. package/assets/esri/core/workers/chunks/b8316c6469a543029bc6.js +0 -1
  231. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
  232. package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
  233. package/assets/esri/core/workers/chunks/bf0a65b4be31959f921d.js +0 -1
  234. package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
  235. package/assets/esri/core/workers/chunks/c890c7fca27170e3341f.js +0 -1
  236. package/assets/esri/core/workers/chunks/c976785f2391c77d8a30.js +0 -1
  237. package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
  238. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
  239. package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
  240. package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
  241. package/assets/esri/core/workers/chunks/e4f93c55eaefab4192b5.js +0 -1
  242. package/assets/esri/core/workers/chunks/ec89466f76d0ba22525e.js +0 -1
  243. package/assets/esri/core/workers/chunks/ee45618c45806ab654cb.js +0 -1
  244. package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
  245. package/assets/esri/core/workers/chunks/f4baa5ea2e42b1317941.js +0 -1
  246. package/assets/esri/core/workers/chunks/face43cf5abcd2f5bd9d.js +0 -1
  247. package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{equalsShallow as i}from"../../../core/lang.js";import{lerp as r}from"../../../core/mathUtils.js";import{isSome as o,destroyMaybe as n,applySome as a,isNone as h}from"../../../core/maybe.js";import{watch as p,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{when as d}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as u}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as c}from"../../../geometry/projectionEllipsoid.js";import{isMoon as g,isEarth as w}from"../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as v}from"./ChapmanAtmosphere.js";import{CloudsComposition as y}from"./CloudsComposition.js";import{isReadyCloudsData as f}from"./CloudsData.js";import{CloudsGenerator as R}from"./CloudsGenerator.js";import{cloudPresets as A}from"./CloudsPresets.js";import{Fog as C}from"./Fog.js";import{PanoramicAtmosphere as E}from"./PanoramicAtmosphere.js";import N from"./SimpleAtmosphere.js";import{Stars as T}from"./Stars.js";import{weatherHeightLimit as j}from"./weather.js";import{RenderPass as P}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as b}from"../webgl-engine/lib/RenderSlot.js";const x=[b.POSTPROCESSING_ENVIRONMENT_OPAQUE,b.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let S=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null,this._stars=null,this._clouds=null,this._cloudComposition=null,this._fog=null}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){var e;return!(null==(e=this.view.basemapTerrain)||!e.renderer.canRender)||"global"!==this.view.viewingMode}get needsLinearDepth(){return"realistic"===this._selectAtmosphereType()}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return u(this.view.state.camera.eye)-c(this.view.spatialReference).radius<=j}get weatherEnabled(){var e;return!(null==(e=this.view.environmentManager)||!e.weatherEnabled)}initialize(){this.view._stage.addRenderPlugin(x,this)}destroy(){this._pendingAtmosphere=n(this._pendingAtmosphere),this.uninitializeRenderContext(),this._handles=n(this._handles),this.view&&null!=this.view._stage&&(this.view._stage.removeRenderPlugin(this),this._set("view",null))}initializeRenderContext(e=null){this._context=e,this._handles.add([d(this.view,"basemapTerrain",(()=>this._updateBasemapTerrain()),!0),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),l),p((()=>this._starsCreationParameters),(e=>this._createOrDestroyStars(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._cloudsCreationParameters),(e=>this._createOrDestroyClouds(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._fogCreationParameters),(e=>this._createOrDestroyFog(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),l)])}uninitializeRenderContext(){this._stars=n(this._stars),this._atmosphere=n(this._atmosphere),this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),this._fog=n(this._fog)}render(e){if(e.pass===P.MATERIAL)switch(e.slot){case b.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&this._atmosphere.canRender&&(this._atmosphere.render(e),f(this._clouds)&&o(this._cloudComposition)&&(this._cloudComposition.render(e,this._clouds,o(this.view.animation)),this._cloudComposition.isFading&&this._setNeedsRender()));break;case b.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)&&this._atmosphere.canRender){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)&&("foggy"!==t&&"realistic"===this._selectAtmosphereType()||this._fog.render(e,"foggy"===t,"rainy"===t))}}}get _cloudsCreationParameters(){return this.weatherEnabled?{view:this.view,viewingMode:this.view.state.viewingMode,rctx:o(this._context)?this._context.renderContext.rctx:null,radius:c(this.view.spatialReference).radius}:null}_createOrDestroyClouds(e){this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),a(e,(({view:e,viewingMode:t,rctx:s,radius:i})=>{this._clouds=new R({rctx:s,view:e,requestRender:()=>this._setNeedsRender()}),this._cloudComposition=new y(s,t,i,u(e.state.camera.eye)-i)})),this._setNeedsRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return h(e)?null:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){h(e)||h(this._clouds)||this._clouds.applyPreset(A[e.type],e.weatherAdjustment)}_setNeedsRender(){o(this._context)&&this._context.requestRender()}get _starsCreationParameters(){var e,t,s;return{view:this.view,starsEnabled:null!=(e=null==(t=this.view)||null==(s=t.environment)?void 0:s.starsEnabled)&&e}}_createOrDestroyStars({view:e,starsEnabled:t}){t&&h(this._stars)?(this._stars=new T({view:e,requestRender:()=>this._setNeedsRender()}),this._setNeedsRender()):!t&&o(this._stars)&&(this._stars.destroy(),this._stars=null,this._setNeedsRender())}_updateFog(e){h(this._fog)||h(e)||("foggy"===e.type?this._fog.strength=r(3e-5,.005,e.weatherAdjustment**3):this._fog.strength=4e-6)}get _fogCreationParameters(){return!this.weatherEnabled||h(this._context)?null:{view:this.view,context:this._context}}_createOrDestroyFog(e){this.weatherEnabled&&h(this._fog)?(a(e,(({view:e,context:t})=>{this._fog=new C(t,e)})),this._updateFog(this._weatherUpdateParameters),this._setNeedsRender()):o(this._fog)&&(this._fog.destroy(),this._fog=null,this._setNeedsRender())}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),h(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return v;case"panoramic":return E;case"simple":return N;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||g(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&v.isSupported(this._context)&&w(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType()}}};e([m({constructOnly:!0})],S.prototype,"view",void 0),e([m({type:Boolean,readOnly:!0})],S.prototype,"updating",null),e([m()],S.prototype,"weatherVisible",null),e([m()],S.prototype,"_pendingAtmosphere",void 0),e([m()],S.prototype,"_stars",void 0),e([m()],S.prototype,"_clouds",void 0),e([m()],S.prototype,"_cloudComposition",void 0),e([m()],S.prototype,"_fog",void 0),e([m()],S.prototype,"weatherEnabled",null),e([m()],S.prototype,"_cloudsCreationParameters",null),e([m()],S.prototype,"_weatherUpdateParameters",null),e([m()],S.prototype,"_starsCreationParameters",null),e([m()],S.prototype,"_fogCreationParameters",null),S=e([_("esri.views.3d.environment.EnvironmentRenderer")],S);export{S as EnvironmentRenderer};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import s from"../../../core/Handles.js";import{equalsShallow as i}from"../../../core/lang.js";import{lerp as r}from"../../../core/mathUtils.js";import{isSome as o,destroyMaybe as n,applySome as a,isNone as h}from"../../../core/maybe.js";import{watch as p,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{when as d}from"../../../core/watchUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{l as c}from"../../../chunks/vec3.js";import{getReferenceEllipsoid as u}from"../../../geometry/projectionEllipsoid.js";import{isMoon as g,isEarth as w}from"../../../geometry/support/spatialReferenceUtils.js";import{enablePrecipitation as v}from"../../../support/featureFlags.js";import{ChapmanAtmosphere as y}from"./ChapmanAtmosphere.js";import{CloudsComposition as f}from"./CloudsComposition.js";import{isReadyCloudsData as R}from"./CloudsData.js";import{CloudsGenerator as A}from"./CloudsGenerator.js";import{cloudPresets as P}from"./CloudsPresets.js";import{Fog as C}from"./Fog.js";import{PanoramicAtmosphere as E}from"./PanoramicAtmosphere.js";import{Precipitation as N}from"./Precipitation.js";import{P as b}from"../../../chunks/Precipitation.glsl.js";import j from"./SimpleAtmosphere.js";import{Stars as T}from"./Stars.js";import{weatherHeightLimit as x}from"./weather.js";import{RenderPass as O}from"../webgl-engine/lib/RenderPass.js";import{RenderSlot as S}from"../webgl-engine/lib/RenderSlot.js";const M=[S.POSTPROCESSING_ENVIRONMENT_OPAQUE,S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT];let D=class extends t{constructor(e){super(e),this._handles=new s,this._context=null,this._pendingAtmosphere=null,this._atmosphere=null,this._stars=null,this._precipitation=null,this._clouds=null,this._cloudComposition=null,this._fog=null}get atmosphereType(){return o(this._pendingAtmosphere)?this._pendingAtmosphere.type:o(this._atmosphere)?this._atmosphere.type:"none"}get canRender(){var e;return!(null==(e=this.view.basemapTerrain)||!e.renderer.canRender)||"global"!==this.view.viewingMode}get needsLinearDepth(){return"realistic"===this._selectAtmosphereType()}updateAnimation(e){return!!o(this._precipitation)&&this._precipitation.update(e)}get updating(){return o(this._pendingAtmosphere)||o(this._stars)&&this._stars.updating||o(this._clouds)&&this._clouds.running}get weatherVisible(){return c(this.view.state.camera.eye)-u(this.view.spatialReference).radius<=x}get weatherEnabled(){var e;return!(null==(e=this.view.environmentManager)||!e.weatherEnabled)}get precipitationEnabled(){return v()}initialize(){this.view._stage.addRenderPlugin(M,this)}destroy(){this._pendingAtmosphere=n(this._pendingAtmosphere),this.uninitializeRenderContext(),this._handles=n(this._handles),this.view&&null!=this.view._stage&&(this.view._stage.removeRenderPlugin(this),this._set("view",null))}initializeRenderContext(e=null){this._context=e,this._handles.add([d(this.view,"basemapTerrain",(()=>this._updateBasemapTerrain()),!0),p((()=>({viewingMode:this.view.viewingMode,atmosphereEnabled:this.view.environment.atmosphereEnabled,atmosphereQuality:this.view.environment.atmosphere.quality})),(()=>this._updateAtmosphere()),l),p((()=>this._starsCreationParameters),(e=>this._createOrDestroyStars(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyPrecipitation(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._cloudsCreationParameters),(e=>this._createOrDestroyClouds(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._environmentPostProcessCreationParameters),(e=>this._createOrDestroyFog(e)),{sync:!0,initial:!0,equals:i}),p((()=>this._weatherUpdateParameters),(e=>{this._updateWeather(e),this._updateFog(e)}),l)])}uninitializeRenderContext(){this._stars=n(this._stars),this._precipitation=n(this._precipitation),this._atmosphere=n(this._atmosphere),this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),this._fog=n(this._fog)}render(e){if(e.pass===O.MATERIAL)switch(e.slot){case S.POSTPROCESSING_ENVIRONMENT_OPAQUE:o(this._stars)&&this._stars.render(e),o(this._atmosphere)&&this._atmosphere.canRender&&(this._atmosphere.render(e),R(this._clouds)&&o(this._cloudComposition)&&(this._cloudComposition.render(e,this._clouds,o(this.view.animation)),this._cloudComposition.isFading&&this._setNeedsRender()));break;case S.POSTPROCESSING_ENVIRONMENT_TRANSPARENT:if(o(this._atmosphere)&&this._atmosphere.canRender){const t=this.weatherEnabled?this.view.environment.weather.type:"disabled";this._atmosphere.renderHaze(e,"rainy"===t),o(this._fog)&&("foggy"!==t&&"realistic"===this._selectAtmosphereType()||this._fog.render(e,"foggy"===t,"rainy"===t)),"rainy"!==this.view.environment.weather.type&&"snowy"!==this.view.environment.weather.type||o(this._precipitation)&&this._precipitation.render(e,this.view.environment.weather.precipitation,"rainy"===this.view.environment.weather.type?b.RAIN:b.SNOW)}}}get _cloudsCreationParameters(){return this.weatherEnabled?{view:this.view,viewingMode:this.view.state.viewingMode,rctx:o(this._context)?this._context.renderContext.rctx:null,radius:u(this.view.spatialReference).radius}:null}_createOrDestroyClouds(e){this._clouds=n(this._clouds),this._cloudComposition=n(this._cloudComposition),a(e,(({view:e,viewingMode:t,rctx:s,radius:i})=>{this._clouds=new A({rctx:s,view:e,requestRender:()=>this._setNeedsRender()}),this._cloudComposition=new f(s,t,i,c(e.state.camera.eye)-i)})),this._setNeedsRender()}get _weatherUpdateParameters(){const e=this.weatherEnabled?this.view.environment.weather:null;return h(e)?null:{type:e.type,weatherAdjustment:"foggy"===e.type?e.fogStrength:e.cloudCover}}_updateWeather(e){h(e)||h(this._clouds)||this._clouds.applyPreset(P[e.type],e.weatherAdjustment)}_setNeedsRender(){o(this._context)&&this._context.requestRender()}get _starsCreationParameters(){var e,t,s;return{view:this.view,starsEnabled:null!=(e=null==(t=this.view)||null==(s=t.environment)?void 0:s.starsEnabled)&&e}}_createOrDestroyStars({view:e,starsEnabled:t}){t&&h(this._stars)?(this._stars=new T({view:e,requestRender:()=>this._setNeedsRender()}),this._setNeedsRender()):!t&&o(this._stars)&&(this._stars.destroy(),this._stars=null,this._setNeedsRender())}_createOrDestroyPrecipitation(e){this.precipitationEnabled&&h(this._precipitation)?(a(e,(({context:e,view:t})=>{this._precipitation=new N(e,t)})),this._setNeedsRender()):!this.precipitationEnabled&&o(this._precipitation)&&(this._precipitation=n(this._precipitation),this._setNeedsRender())}_updateFog(e){h(this._fog)||h(e)||("foggy"===e.type?this._fog.strength=r(3e-5,.005,e.weatherAdjustment**3):this._fog.strength=4e-6)}get _environmentPostProcessCreationParameters(){return!this.weatherEnabled||h(this._context)?null:{view:this.view,context:this._context}}_createOrDestroyFog(e){this.weatherEnabled&&h(this._fog)?(a(e,(({view:e,context:t})=>{this._fog=new C(t,e)})),this._updateFog(this._weatherUpdateParameters),this._setNeedsRender()):o(this._fog)&&(this._fog.destroy(),this._fog=null,this._setNeedsRender())}_updateAtmosphere(){const e=this._selectAtmosphereType();if(this.atmosphereType===e)return;o(this._pendingAtmosphere)&&(this._pendingAtmosphere!==this._atmosphere&&this._pendingAtmosphere.destroy(),this._pendingAtmosphere=null);const t=this._getAtmosphereClass();if(!t)return o(this._atmosphere)&&(this._atmosphere.destroy(),this._atmosphere=null,this._setNeedsRender()),void this._updateBasemapTerrain();const s=new t(this.view);o(this._context)&&s.initializeRenderContext(this._context),h(this._atmosphere)&&(this._atmosphere=s,this._setNeedsRender()),this._pendingAtmosphere=s,s.when().then((()=>{o(this._atmosphere)&&this._pendingAtmosphere&&this._pendingAtmosphere!==this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=this._pendingAtmosphere),this._pendingAtmosphere=null,this._setNeedsRender(),this._updateBasemapTerrain()})).catch((()=>{this._pendingAtmosphere===s&&(this._pendingAtmosphere=null)}))}_getAtmosphereClass(){switch(this._selectAtmosphereType()){case"none":return null;case"realistic":return y;case"panoramic":return E;case"simple":return j;default:return}}_selectAtmosphereType(){const e=this.view.get("environment.atmosphereEnabled"),t=this.view.get("environment.atmosphere.quality"),s=this.view.viewingMode;return!e||null==t||g(this.view.spatialReference)?"none":"local"===s?"panoramic":"high"===t&&o(this._context)&&y.isSupported(this._context)&&w(this.view.spatialReference)?"realistic":"simple"}_updateBasemapTerrain(){this.view.basemapTerrain&&(this.view.basemapTerrain.velvetOverground=o(this._atmosphere)&&"simple"===this.atmosphereType)}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType()}}};e([m({constructOnly:!0})],D.prototype,"view",void 0),e([m({type:Boolean,readOnly:!0})],D.prototype,"updating",null),e([m()],D.prototype,"weatherVisible",null),e([m()],D.prototype,"_pendingAtmosphere",void 0),e([m()],D.prototype,"_stars",void 0),e([m()],D.prototype,"_precipitation",void 0),e([m()],D.prototype,"_clouds",void 0),e([m()],D.prototype,"_cloudComposition",void 0),e([m()],D.prototype,"_fog",void 0),e([m()],D.prototype,"weatherEnabled",null),e([m()],D.prototype,"precipitationEnabled",null),e([m()],D.prototype,"_cloudsCreationParameters",null),e([m()],D.prototype,"_weatherUpdateParameters",null),e([m()],D.prototype,"_starsCreationParameters",null),e([m()],D.prototype,"_environmentPostProcessCreationParameters",null),D=e([_("esri.views.3d.environment.EnvironmentRenderer")],D);export{D as EnvironmentRenderer};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import"../webgl-engine/core/shaderModules/interfaces.js";import"../webgl-engine/core/shaderModules/ShaderBuilder.js";import"../webgl-engine/lib/basicInterfaces.js";export{P as PrecipitationType,b as build}from"../../../chunks/Precipitation.glsl.js";
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{isNone as t,disposeMaybe as r,isSome as i}from"../../../core/maybe.js";import{secondsFromMilliseconds as s}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as o}from"../../../geometry/projectionEllipsoid.js";import{P as c}from"../../../chunks/Precipitation.glsl.js";import{PrecipitationTechniqueConfiguration as h,PrecipitationTechnique as u}from"./PrecipitationTechnique.js";import{glLayout as p}from"../support/buffer/glUtil.js";import{newLayout as m}from"../support/buffer/InterleavedLayout.js";import{AnimationTimer as _}from"../webgl-engine/lib/AnimationTimer.js";import{VertexAttribute as d}from"../webgl-engine/lib/basicInterfaces.js";import{WatchUpdatingTracking as f}from"../../support/WatchUpdatingTracking.js";import{BufferObject as l}from"../../webgl/BufferObject.js";import{PrimitiveType as T,Usage as g}from"../../webgl/enums.js";import{bindVertexBufferLayout as b,unbindVertexBufferLayout as y}from"../../webgl/Util.js";import{VertexArrayObject as j}from"../../webgl/VertexArrayObject.js";let w=class{constructor(e,t){this._numParticles=25e4,this._rainSpeed=.1,this._snowSpeed=.01,this._renderParameter={camera:null,time:0,radius:1},this._animation=new _,this._updatingTracking=new f,this._renderParameter.time=0,this._renderParameter.radius=o(t.spatialReference).radius,this._shaderTechniqueRepository=e.shaderTechniqueRep}get updating(){return this._updatingTracking.updating}get rainTechnique(){if(t(this._rainTechnique)){const e=new h;e.type=c.RAIN,this._rainTechnique=this._shaderTechniqueRepository.acquire(u,e)}return this._rainTechnique}get snowTechnique(){if(t(this._snowTechnique)){const e=new h;e.type=c.SNOW,this._snowTechnique=this._shaderTechniqueRepository.acquire(u,e)}return this._snowTechnique}destroy(){this._updatingTracking.destroy(),this._numParticles=0,this._snowTechnique=r(this._snowTechnique),this._rainTechnique=r(this._rainTechnique),this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}update(e){return this._animation.advance(e)}render(e,r,i){const{rctx:n,camera:a}=e;this._ensureResources(n);const o=i===c.RAIN?this.rainTechnique:this.snowTechnique;if(t(o)||t(this._vao)||t(this._instanceIdBuffer))return!1;const h=o.program,p=u.attributeLocation;return n.useProgram(h),this._renderParameter.camera=a,this._renderParameter.time=(i===c.RAIN?this._rainSpeed:this._snowSpeed)*s(this._animation.time),o.bindPass(this._renderParameter),o.bindPipelineState(n),n.bindVAO(this._vao),h.assertCompatibleVertexAttributeLocations(this._vao),b(n,p,this._instanceIdBuffer,q,0),n.capabilities.instancing.drawArraysInstanced(T.TRIANGLES,0,3,this._numParticles*r),y(n,p,this._instanceIdBuffer,q),!0}_ensureResources(e){i(this._vao)||(this._vao=this._createVertexArrayObject(e),i(this._instanceIdBuffer)||(this._instanceIdBuffer=this._createInstanceIndices(e)))}_createInstanceIndices(e){const t=[];for(let r=0;r<this._numParticles;r++)t.push(r);return l.createVertex(e,g.STATIC_DRAW,new Float32Array(t))}_createVertexArrayObject(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new j(e,u.attributeLocation,{geometry:p(I)},{geometry:l.createVertex(e,g.STATIC_DRAW,t)})}};e([n({constructOnly:!0})],w.prototype,"requestRender",void 0),e([n({readOnly:!0})],w.prototype,"updating",null),e([n()],w.prototype,"_updatingTracking",void 0),w=e([a("esri.views.3d.environment.Precipitation")],w);const I=m().vec3f(d.POSITION),q=p(m().f32(d.INSTANCEFEATUREATTRIBUTE),1);export{w as Precipitation};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{smoothstep as i}from"../../../core/mathUtils.js";import{l as e}from"../../../chunks/vec3.js";import{c as r}from"../../../chunks/vec3f64.js";import{a as s,P as o}from"../../../chunks/Precipitation.glsl.js";import{weatherHeightLimit as h}from"./weather.js";import{bindProjectionMatrix as a}from"../webgl-engine/core/shaderLibrary/util/View.glsl.js";import{ReloadableShaderModule as n}from"../webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as m}from"../webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{parameter as f,ShaderTechniqueConfiguration as c}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";import{VertexAttribute as l}from"../webgl-engine/lib/basicInterfaces.js";import{Program as p}from"../webgl-engine/lib/Program.js";import{BlendFactor as d,CompareFunction as g}from"../../webgl/enums.js";import{makePipelineState as _,separateBlendingParams as w,defaultColorWriteParams as u}from"../../webgl/renderState.js";class b extends m{constructor(){super(...arguments),this._width=500,this._offset=r(),this._tile=r()}initializeProgram(t){const i=b.shader.get(),e=this.configuration,r=i.build({type:e.type});return new p(t.rctx,r,b.attributeLocation)}initializePipeline(){return _({blending:w(d.ONE,d.ONE,d.ONE_MINUS_SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA),depthTest:{func:g.LEQUAL},colorWrite:u})}bindPass(t){const r=t.camera.eye;this._tile[0]=Math.floor((r[0]+.5*this._width)/this._width),this._tile[1]=Math.floor((r[1]+.5*this._width)/this._width),this._tile[2]=Math.floor((r[2]+.5*this._width)/this._width),this._offset[0]=r[0]-this._tile[0]*this._width,this._offset[1]=r[1]-this._tile[1]*this._width,this._offset[2]=r[2]-this._tile[2]*this._width,this.program.setUniform1f("width",this._width),this.program.setUniform3fv("offset",this._offset),this.program.setUniformMatrix4fv("view",t.camera.viewMatrix),this.program.setUniform3fv("cameraPos",t.camera.eye),a(this.program,t.camera.projectionMatrix),this.program.setUniform1f("time",t.time);const s=1-i(.9*h,h,Math.abs(e(t.camera.eye)-t.radius));this.program.setUniform1f("heightFade",s)}}b.shader=new n(s,(()=>import("./Precipitation.glsl.js"))),b.attributeLocation=new Map([[l.POSITION,0],[l.INSTANCEFEATUREATTRIBUTE,1]]);class j extends c{constructor(){super(...arguments),this.type=o.RAIN}}t([f()],j.prototype,"type",void 0);export{b as PrecipitationTechnique,j as PrecipitationTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";var p;let c=p=class extends o{constructor(r){super(r),this.type="rainy",this.cloudCover=.5}clone(){return new p({cloudCover:this.cloudCover})}};r([s({rainy:"rainy"})],c.prototype,"type",void 0),r([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],c.prototype,"cloudCover",void 0),c=p=r([t("esri.views.3d.environment.RainyWeather")],c);const a=c;export{a as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{enumeration as t}from"../../../core/accessorSupport/decorators/enumeration.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";var p;let i=p=class extends o{constructor(r){super(r),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new p({cloudCover:this.cloudCover,precipitation:this.precipitation})}};r([t({rainy:"rainy"})],i.prototype,"type",void 0),r([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],i.prototype,"cloudCover",void 0),r([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],i.prototype,"precipitation",void 0),i=p=r([s("esri.views.3d.environment.RainyWeather")],i);const c=i;export{c as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{enumeration as t}from"../../../core/accessorSupport/decorators/enumeration.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";var p;let i=p=class extends r{constructor(o){super(o),this.type="snowy",this.cloudCover=.5,this.precipitation=.5}clone(){return new p({cloudCover:this.cloudCover,precipitation:this.precipitation})}};o([t({snowy:"snowy"})],i.prototype,"type",void 0),o([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],i.prototype,"cloudCover",void 0),o([e({type:Number,nonNullable:!0,range:{min:0,max:1}})],i.prototype,"precipitation",void 0),i=p=o([s("esri.views.3d.environment.SnowyWeather")],i);const c=i;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import e from"./CloudyWeather.js";import r from"./FoggyWeather.js";import t from"./RainyWeather.js";import o from"./SunnyWeather.js";const n={key:"type",base:null,typeMap:{sunny:o,cloudy:e,rainy:t,foggy:r}},y=1e4;function a(e,r){if(e.type!==r.type)return!1;switch(e.type){case"sunny":case"rainy":case"cloudy":return e.cloudCover===r.cloudCover;case"foggy":return e.fogStrength===r.fogStrength}}export{a as weatherEquals,y as weatherHeightLimit,n as weatherTypes};
5
+ import e from"./CloudyWeather.js";import o from"./FoggyWeather.js";import r from"./RainyWeather.js";import t from"./SnowyWeather.js";import n from"./SunnyWeather.js";const y={key:"type",base:null,typeMap:{sunny:n,cloudy:e,rainy:r,snowy:t,foggy:o}},s=1e4;function a(e,o){if(e.type!==o.type)return!1;switch(e.type){case"sunny":case"rainy":case"snowy":case"cloudy":return e.cloudCover===o.cloudCover;case"foggy":return e.fogStrength===o.fogStrength}}export{a as weatherEquals,s as weatherHeightLimit,y as weatherTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/clock.js";import i from"../../../../../core/Handles.js";import{releaseMaybe as a,destroyMaybe as s,isSome as n,isNone as r,removeMaybe as l}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../../core/scheduling.js";import{createScreenPoint as u,screenPointObjectToArray as c,createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{d as y,u as P,m as w}from"../../../../../chunks/mat4.js";import{d as g,l as m,g as f,a as M,b as V,m as D,n as T,s as b}from"../../../../../chunks/vec3.js";import{a as k,c as E}from"../../../../../chunks/vec3f64.js";import{c as S,a as H,n as x,f as I}from"../../../../../chunks/boundedPlane.js";import{signedDistance as R,create as j,intersectRay as C,normal as O}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as L}from"../../../../../geometry/support/vectorStacks.js";import{calculateInputRotationTransform as K}from"../../manipulatorUtils.js";import{PLANE_PREVIEW_OUTLINE_WIDTH as A,forceVerticalModifier as B,forceHorizontalModifier as F,PREVIEW_FADE_DURATION_SECONDS as N,POINTER_MOVE_TIMER_MS as q,PLANE_OUTLINE_COLOR as Z,PLANE_BACKGROUND_COLOR as J,PREVIEW_FADE_DOT_THRESHOLD as Q,INITIAL_DEPTH_OFFSET_FRAC as W}from"./sliceToolConfig.js";import{createShiftManipulator as X,createRotateManipulator as Y,createResizeManipulator as $,createGridVisualElement as tt,createOutlineVisualElement as et,planeToShape as it,createRotatePlane as at,RotationAxis as st,resizePlane as nt,calculatePlaneHalfSize as rt,SliceOrientation as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as Pt}from"./images/Factory.js";import{screenToRenderPlane as wt}from"../../editingTools/dragEventPipeline3D.js";import{fromScreen as gt}from"../../../support/geometryUtils/ray.js";import{newIntersector as mt}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as ft}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{createManipulatorDragEventPipeline as Mt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Vt}from"../../../../interactive/InteractiveToolBase.js";import{createScreenPointFromEvent as Dt}from"../../../../support/screenUtils.js";import Tt from"../../../../../widgets/Slice/SlicePlane.js";let bt=class extends Vt{constructor(t){super(t),this.clock=e,this._previewPlaneOpacity=1,this.analysisView=null,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this.disableEngineLayers=!1,this._handles=new i,this._viewHandles=new i,this._frameTask=null,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=S(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=u(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=mt(t.view.state.viewingMode),this._intersector.options.store=ft.MIN}initialize(){this._initialize()}async _initialize(){const t=()=>{if("creating"===this.toolState||"created"===this.toolState)throw new Error("Unexpected toolState");return!this.destroyed};if(!t())return;if(this.analysisView=await this.view.whenAnalysisView(this.analysis),!t())return;if(null==this.analysis)throw new Error("SliceTool requires valid model, but null was provided.");this.analysisViewData=this.analysisView,this.rotateHeadingImage=yt(this.view.toolViewManager.textures),this.rotateTiltImage=Pt(this.view.toolViewManager.textures);const e=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(n(this.analysisViewData.plane)&&H(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=X(this.view),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(t=>{this._onShiftGrab(t),e(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=Y(this.view,this.rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(t=>{this._onRotateHeadingGrab(t),e(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=Y(this.view,this.rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(t=>{this._onRotateTiltGrab(t),e(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((t,i)=>{const a=$(this.view,t);return a.events.on("grab-changed",(t=>{this._onResizeGrab(t,i),e(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=tt(this.view),this._previewPlaneOutlineVisualElement=et(this.view),this._previewPlaneOutlineVisualElement.width=A,this._handles.add(this.analysisViewData.watch("plane",(()=>this._updateManipulators()),!0)),this.startToolCreation();const i=o((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),h);this._handles.add([i,o((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this.rotateHeadingImage=a(this.rotateHeadingImage),this.rotateTiltImage=a(this.rotateTiltImage),this._handles=s(this._handles),this._viewHandles=s(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=s(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=s(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._get("cursor")}set analysis(t){if(null==t)throw new Error("SliceTool requires valid model, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisView.showGrid=n(t)&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return n(this.inputState)&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._updateMouseCursor(),this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this.analysis.visible=t,this._updateMouseCursor(),this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Et(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor()):this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t),this._updateMouseCursor();break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Et(t))return;this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor());break;case"click":if(!Et(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisView&&(this.analysisView.editable=this.editable)}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&n(e)&&"shift"===e.type){const i=Dt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Dt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&n(this.analysisViewData.plane)){const e=Dt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),H(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const e=Dt(t),i=S();if(this._pickPlane(e,!1,this._activeKeyModifiers,i)){if(H(i,this._startPlane),this.analysis.shape=it(i,this.view,this.view.spatialReference,new Tt),"pointer-drag"===t.type){const a=this._calculatePickRay(e);this.inputState=kt(a,t.pointerId,i.origin,i)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(Dt(t)).then((t=>{if(t.results.length){const e=t.results[0],i=e&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===B||t.key===F)&&(this._activeKeyModifiers[t.key]=!0,n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==B&&t.key!==F||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=this._calculatePickRay(t.screenPoint);H(this.analysisViewData.plane,this._startPlane),this.inputState=kt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"shift"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=.001,a=Math.min((1-Math.abs(g(x(this.analysisViewData.plane),e.ray.direction)/m(e.ray.direction)))/i,1),s=-R(this._startPlane.plane,e.renderEnd),n=-R(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(r(this.analysisViewData.plane))return;const e=f(G.get(),this._startPlane.origin),i=f(G.get(),x(this._startPlane));M(i,i,-t.depth),V(i,i,e);const a=I(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,S());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.HEADING,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.TILT,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=O(t.rotatePlane),a=K(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(r(this.analysisViewData.plane))return;const e=y(U.get(),t.rotateAngle,t.rotateAxis),i=D(G.get(),this._startPlane.basis1,e),a=D(G.get(),this._startPlane.basis2,e),s=I(this.analysisViewData.plane.origin,i,a,S());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||r(this.analysisViewData.plane))return;const i=this._calculatePickRay(t.screenPoint),a=G.get();C(this.analysisViewData.plane.plane,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:k(a)})}_createResizeDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"resize"!==a.type||r(this.analysisViewData.plane))return;const s=H(this.analysisViewData.plane,S());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(r(this.analysisViewData.plane))return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,H(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(!n(e))throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,r(t))return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=n(i)?i:S();if(i=n(i)?H(i,St):null,this._pickPlane(t,!0,e,a)){const t=Q;let e=!1;n(i)&&(e=g(i.plane,a.plane)<t||g(T(G.get(),i.basis1),T(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}n(this._previewPlane)&&r(this._frameTask)&&0===this._previewPlaneOpacity?this._frameTask=p({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*N),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):r(this._previewPlane)&&n(this._frameTask)?this._removeFrameTask():n(this._previewPlane)&&this._updateManipulators()}_removeFrameTask(){this._frameTask=l(this._frameTask)}_calculatePickRay(t){const e=z(),i=c(t,Ht);return gt(this.view.state.camera,i,e),T(e.direction,e.direction),e}_pickMinResult(t){const e=c(t,L.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;g(r,l.viewForward)>0&&M(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*W,p=M(G.get(),r,h);V(p,p,n);const u=this.analysis.tiltEnabled?lt.TILTED:lt.HORIZONTAL_OR_VERTICAL,c=i[B]?lt.VERTICAL:i[F]?lt.HORIZONTAL:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_updateMouseCursor(){this._set("cursor",null),this._isPlacingSlicePlane||"exclude"===this.layersMode?this._set("cursor","crosshair"):n(this._creatingPointerId)&&this._set("cursor","grabbing")}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=l(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this.clock.setTimeout((()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht}),q)}_updateManipulators(){if(this.disableEngineLayers)return;let t=null,e=!1;if(n(this.analysisViewData.plane))t=this.analysisViewData.plane,e=!1;else{if(!n(this._previewPlane))return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=pt(t,U.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ut(this.shiftManipulator,i,t,this.view.state.camera),ct(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>_t(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=b(G.get(),m(t.basis1),m(t.basis2),1),s=P(U.get(),a),r=w(s,i,s);this._previewPlaneOutlineVisualElement.transform=r,this._previewPlaneGridVisualElement.transform=r,this._updateMaterials()}_updateMaterials(){const t=[Z[0],Z[1],Z[2],Z[3]*this._previewPlaneOpacity];this._previewPlaneOutlineVisualElement.color=t;const e=[J[0],J[1],J[2],J[3]*this._previewPlaneOpacity],i=[0,0,0,0];this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=i}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane}}};function kt(t,e,i,a){const s=vt(i,x(a),t.direction,j()),n=E();return C(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Et(t){return"mouse"!==t.pointerType||0===t.button}t([_()],bt.prototype,"clock",void 0),t([_({constructOnly:!0})],bt.prototype,"view",void 0),t([_()],bt.prototype,"analysisView",void 0),t([_()],bt.prototype,"analysisViewData",void 0),t([_({readOnly:!0})],bt.prototype,"state",null),t([_({readOnly:!0,value:null})],bt.prototype,"cursor",null),t([_()],bt.prototype,"analysis",null),t([_({readOnly:!0})],bt.prototype,"layersMode",void 0),t([_({value:null})],bt.prototype,"inputState",null),bt=t([v("esri.views.3d.interactive.analysisTools.slice.SliceTool")],bt);const St=S(),Ht=d(),xt=bt;export{xt as default};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import{clock as e}from"../../../../../core/clock.js";import i from"../../../../../core/Handles.js";import{releaseMaybe as a,destroyMaybe as s,isSome as n,isNone as r,removeMaybe as l}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as h}from"../../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../../core/scheduling.js";import{createScreenPoint as u,screenPointObjectToArray as c,createScreenPointArray as d}from"../../../../../core/screenUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{d as y,u as P,m as w}from"../../../../../chunks/mat4.js";import{d as g,l as m,g as f,a as M,b as V,m as D,n as T,s as b}from"../../../../../chunks/vec3.js";import{a as k,c as E}from"../../../../../chunks/vec3f64.js";import{c as S,a as H,n as x,f as I}from"../../../../../chunks/boundedPlane.js";import{signedDistance as R,create as j,intersectRay as C,normal as O}from"../../../../../geometry/support/plane.js";import{create as z}from"../../../../../geometry/support/ray.js";import{sv3d as G,sm4d as U,sv2d as L}from"../../../../../geometry/support/vectorStacks.js";import{calculateInputRotationTransform as K}from"../../manipulatorUtils.js";import{PLANE_PREVIEW_OUTLINE_WIDTH as A,forceVerticalModifier as B,forceHorizontalModifier as F,PREVIEW_FADE_DURATION_SECONDS as N,POINTER_MOVE_TIMER_MS as q,PLANE_OUTLINE_COLOR as Z,PLANE_BACKGROUND_COLOR as J,PREVIEW_FADE_DOT_THRESHOLD as Q,INITIAL_DEPTH_OFFSET_FRAC as W}from"./sliceToolConfig.js";import{createShiftManipulator as X,createRotateManipulator as Y,createResizeManipulator as $,createGridVisualElement as tt,createOutlineVisualElement as et,planeToShape as it,createRotatePlane as at,RotationAxis as st,resizePlane as nt,calculatePlaneHalfSize as rt,SliceOrientation as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{getRotateHeadingTexture as yt,getTiltRotateTexture as Pt}from"./images/Factory.js";import{screenToRenderPlane as wt}from"../../editingTools/dragEventPipeline3D.js";import{fromScreen as gt}from"../../../support/geometryUtils/ray.js";import{newIntersector as mt}from"../../../webgl-engine/lib/Intersector.js";import{StoreResults as ft}from"../../../webgl-engine/lib/IntersectorInterfaces.js";import{createManipulatorDragEventPipeline as Mt}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Vt}from"../../../../interactive/InteractiveToolBase.js";import{createScreenPointFromEvent as Dt}from"../../../../support/screenUtils.js";import Tt from"../../../../../widgets/Slice/SlicePlane.js";let bt=class extends Vt{constructor(t){super(t),this.clock=e,this._previewPlaneOpacity=1,this.analysisView=null,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this.disableEngineLayers=!1,this._handles=new i,this._viewHandles=new i,this._frameTask=null,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=S(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=u(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=mt(t.view.state.viewingMode),this._intersector.options.store=ft.MIN}initialize(){this._initialize()}async _initialize(){const t=()=>{if("creating"===this.toolState||"created"===this.toolState)throw new Error("Unexpected toolState");return!this.destroyed};if(!t())return;if(this.analysisView=await this.view.whenAnalysisView(this.analysis),!t())return;if(null==this.analysis)throw new Error("SliceTool requires valid model, but null was provided.");this.analysisViewData=this.analysisView,this.rotateHeadingImage=yt(this.view.toolViewManager.textures),this.rotateTiltImage=Pt(this.view.toolViewManager.textures);const e=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(n(this.analysisViewData.plane)&&H(this.analysisViewData.plane,this._startPlane),this.inputState=null)};this.shiftManipulator=X(this.view),this.manipulators.add(this.shiftManipulator),this.shiftManipulator.events.on("grab-changed",(t=>{this._onShiftGrab(t),e(this.shiftManipulator)})),this._handles.add(this._createShiftDragPipeline(this.shiftManipulator)),this.rotateHeadingManipulator=Y(this.view,this.rotateHeadingImage.texture),this.manipulators.add(this.rotateHeadingManipulator),this.rotateHeadingManipulator.events.on("grab-changed",(t=>{this._onRotateHeadingGrab(t),e(this.rotateHeadingManipulator)})),this._handles.add(this._createRotateHeadingDragPipeline(this.rotateHeadingManipulator)),this.rotateTiltManipulator=Y(this.view,this.rotateTiltImage.texture),this.manipulators.add(this.rotateTiltManipulator),this.rotateTiltManipulator.events.on("grab-changed",(t=>{this._onRotateTiltGrab(t),e(this.rotateTiltManipulator)})),this._handles.add(this._createRotateTiltDragPipeline(this.rotateTiltManipulator)),this.resizeManipulators=this._resizeHandles.map(((t,i)=>{const a=$(this.view,t);return a.events.on("grab-changed",(t=>{this._onResizeGrab(t,i),e(a)})),this._handles.add(this._createResizeDragPipeline(a)),a})),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=tt(this.view),this._previewPlaneOutlineVisualElement=et(this.view),this._previewPlaneOutlineVisualElement.width=A,this._handles.add(this.analysisViewData.watch("plane",(()=>this._updateManipulators()),!0)),this.startToolCreation();const i=o((()=>this.state),(t=>{"sliced"===t&&this.finishToolCreation()}),h);this._handles.add([i,o((()=>this.view.state.camera),(()=>this._onCameraChange()))])}destroy(){this.rotateHeadingImage=a(this.rotateHeadingImage),this.rotateTiltImage=a(this.rotateTiltImage),this._handles=s(this._handles),this._viewHandles=s(this._viewHandles),this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=s(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=s(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this._get("cursor")}set analysis(t){if(null==t)throw new Error("SliceTool requires valid model, but null was provided.");this._handles.remove("analysis"),this._set("analysis",t)}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisView.showGrid=n(t)&&"resize"===t.type,this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return n(this.inputState)&&"shift"===this.inputState.type?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){r(this.analysisViewData.plane)||(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._updateMouseCursor(),this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this.analysis.visible=t,this._updateMouseCursor(),this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-drag":if(!Et(t))return;this._isPlacingSlicePlane?this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor()):this._onPointerDrag(t)&&t.stopPropagation();break;case"pointer-move":this._onPointerMove(t),this._updateMouseCursor();break;case"pointer-up":this._onPointerUp(t)&&t.stopPropagation();break;case"immediate-click":if(!Et(t))return;this._onClickPlacePlane(t)&&(t.stopPropagation(),this._updateMouseCursor());break;case"click":if(!Et(t))return;this._onClickExcludeLayer(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisView&&(this.analysisView.editable=this.editable)}_onPointerDrag(t){const e=this.inputState;if(t.pointerId===this._creatingPointerId&&n(e)&&"shift"===e.type){const i=Dt(t);return this.shiftManipulator.events.emit("drag",{action:e.hasBeenDragged?"update":"start",pointerType:t.pointerType,start:i,screenPoint:i}),e.hasBeenDragged=!0,!0}return!1}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Dt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(t){if(t.pointerId===this._creatingPointerId&&n(this.analysisViewData.plane)){const e=Dt(t);return this.shiftManipulator.events.emit("drag",{action:"end",start:e,screenPoint:e}),H(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(t){if("exclude"===this.layersMode)return!1;if(this._isPlacingSlicePlane){const e=Dt(t),i=S();if(this._pickPlane(e,!1,this._activeKeyModifiers,i)){if(H(i,this._startPlane),this.analysis.shape=it(i,this.view,this.view.spatialReference,new Tt),"pointer-drag"===t.type){const a=this._calculatePickRay(e);this.inputState=kt(a,t.pointerId,i.origin,i)}return!0}}return!1}_onClickExcludeLayer(t){return!("exclude"!==this.layersMode||!this.created)&&(this.view.hitTest(Dt(t)).then((t=>{if(t.results.length){const e=t.results[0],i=e&&e.graphic;if(i){const t=i.sourceLayer||i.layer;t&&this.analysis.excludedLayers.push(t)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0})),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(t){return(t.key===B||t.key===F)&&(this._activeKeyModifiers[t.key]=!0,n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==B&&t.key!==F||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],n(this._previewPlane)&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=this._calculatePickRay(t.screenPoint);H(this.analysisViewData.plane,this._startPlane),this.inputState=kt(e,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"shift"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_shiftDragAdjustSensitivity(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=.001,a=Math.min((1-Math.abs(g(x(this.analysisViewData.plane),e.ray.direction)/m(e.ray.direction)))/i,1),s=-R(this._startPlane.plane,e.renderEnd),n=-R(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(r(this.analysisViewData.plane))return;const e=f(G.get(),this._startPlane.origin),i=f(G.get(),x(this._startPlane));M(i,i,-t.depth),V(i,i,e);const a=I(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,S());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.HEADING,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_onRotateTiltGrab(t){if("start"!==t.action||r(this.analysisViewData.plane))return;const e=at(this.analysisViewData.plane,this.view.renderCoordsHelper,st.TILT,j()),i=this._calculatePickRay(t.screenPoint),a=E();C(e,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"rotate"!==a.type)return;const s=n(this.analysisViewData.plane)?H(this.analysisViewData.plane,S()):null;e.next(wt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next((()=>{n(s)&&this._updateBoundedPlane(s)}))}))}_rotateDragRenderPlaneToRotate(t){return e=>{if(r(this.analysisViewData.plane))return null;const i=O(t.rotatePlane),a=K(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(r(this.analysisViewData.plane))return;const e=y(U.get(),t.rotateAngle,t.rotateAxis),i=D(G.get(),this._startPlane.basis1,e),a=D(G.get(),this._startPlane.basis2,e),s=I(this.analysisViewData.plane.origin,i,a,S());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||r(this.analysisViewData.plane))return;const i=this._calculatePickRay(t.screenPoint),a=G.get();C(this.analysisViewData.plane.plane,i,a)&&(H(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:k(a)})}_createResizeDragPipeline(t){return Mt(t,((t,e,i)=>{const a=this.inputState;if(r(a)||"resize"!==a.type||r(this.analysisViewData.plane))return;const s=H(this.analysisViewData.plane,S());e.next(wt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next((()=>{this._updateBoundedPlane(s)}))}))}_resizeDragUpdatePlane(t){return e=>{if(r(this.analysisViewData.plane))return;const i=this._resizeHandles[t.activeHandleIdx],a=nt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,H(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(!n(e))throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){let i=this._previewPlane;if(this._previewPlane=null,r(t))return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=n(i)?i:S();if(i=n(i)?H(i,St):null,this._pickPlane(t,!0,e,a)){const t=Q;let e=!1;n(i)&&(e=g(i.plane,a.plane)<t||g(T(G.get(),i.basis1),T(G.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}n(this._previewPlane)&&r(this._frameTask)&&0===this._previewPlaneOpacity?this._frameTask=p({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*N),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):r(this._previewPlane)&&n(this._frameTask)?this._removeFrameTask():n(this._previewPlane)&&this._updateManipulators()}_removeFrameTask(){this._frameTask=l(this._frameTask)}_calculatePickRay(t){const e=z(),i=c(t,Ht);return gt(this.view.state.camera,i,e),T(e.direction,e.direction),e}_pickMinResult(t){const e=c(t,L.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=G.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(G.get()),l=this.view.state.camera;g(r,l.viewForward)>0&&M(r,r,-1);const o=rt(n,l),h=(e?1:-1)*o*W,p=M(G.get(),r,h);V(p,p,n);const u=this.analysis.tiltEnabled?lt.TILTED:lt.HORIZONTAL_OR_VERTICAL,c=i[B]?lt.VERTICAL:i[F]?lt.HORIZONTAL:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_updateMouseCursor(){this._set("cursor",null),this._isPlacingSlicePlane||"exclude"===this.layersMode?this._set("cursor","crosshair"):n(this._creatingPointerId)&&this._set("cursor","grabbing")}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=l(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this.clock.setTimeout((()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht}),q)}_updateManipulators(){if(this.disableEngineLayers)return;let t=null,e=!1;if(n(this.analysisViewData.plane))t=this.analysisViewData.plane,e=!1;else{if(!n(this._previewPlane))return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);t=this._previewPlane,e=!0}const i=pt(t,U.get());e?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach((t=>t.available=!1)),this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach((t=>t.available=!0)),ut(this.shiftManipulator,i,t,this.view.state.camera),ct(this.rotateHeadingManipulator,i,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,i,t),this.resizeManipulators.forEach(((e,a)=>_t(e,this._resizeHandles[a],i,t))),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=b(G.get(),m(t.basis1),m(t.basis2),1),s=P(U.get(),a),r=w(s,i,s);this._previewPlaneOutlineVisualElement.transform=r,this._previewPlaneGridVisualElement.transform=r,this._updateMaterials()}_updateMaterials(){const t=[Z[0],Z[1],Z[2],Z[3]*this._previewPlaneOpacity];this._previewPlaneOutlineVisualElement.color=t;const e=[J[0],J[1],J[2],J[3]*this._previewPlaneOpacity],i=[0,0,0,0];this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=i}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach((t=>{t.interactive=!0}));this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach((e=>{e.interactive=e===t}))}testData(){return{plane:this.analysisViewData.plane}}};function kt(t,e,i,a){const s=vt(i,x(a),t.direction,j()),n=E();return C(s,t,n)?{type:"shift",creatingPointerId:e,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function Et(t){return"mouse"!==t.pointerType||0===t.button}t([_()],bt.prototype,"clock",void 0),t([_({constructOnly:!0})],bt.prototype,"view",void 0),t([_()],bt.prototype,"analysisView",void 0),t([_()],bt.prototype,"analysisViewData",void 0),t([_({readOnly:!0})],bt.prototype,"state",null),t([_({readOnly:!0,value:null})],bt.prototype,"cursor",null),t([_()],bt.prototype,"analysis",null),t([_({readOnly:!0})],bt.prototype,"layersMode",void 0),t([_({value:null})],bt.prototype,"inputState",null),bt=t([v("esri.views.3d.interactive.analysisTools.slice.SliceTool")],bt);const St=S(),Ht=d(),xt=bt;export{xt as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r,get as s,isNone as i}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as u}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import p from"../../../rest/support/Query.js";import{DrapeSourceType as c}from"./interfaces.js";import d from"./graphics/Graphics3DFeatureProcessor.js";import h from"./graphics/QueryEngine.js";import{toViewIfLocal as y}from"./support/projectExtentUtils.js";import{UpdatePolicy as m}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as g}from"../../support/Scheduler.js";const f=f=>{let E=class extends f{constructor(){super(...arguments),this.controller=null,this.updatePolicy=m.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=c.Features,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.clippingExtent=null,this.supportsHeightUnitConversion=!0,this.pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType());const r=new d({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",r),this.addResolvingPromise((async()=>{await r.setup(),this.queryEngine=new h({layerView:this,priority:g.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await y(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e)),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=r(this.controller),this._set("processor",r(this.processor)),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController=r(this.pendingController)}get legendEnabled(){var e,t;return this.canResume()&&!(null!=(e=this.processor)&&null!=(t=e.frustumVisibility)&&t.suspended)}getGraphicFromGraphicUid(e){var t;let r=null;return null==(t=this.loadedGraphics)||t.forEach((t=>{t.uid===e&&(r=a(t,this.layer))})),r}whenGraphicBounds(e,t){var r;return null==(r=this.processor)?void 0:r.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var r;return null==(r=this.processor)?void 0:r.computeAttachmentOrigin(e,t)}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),s(t,"signal"))}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),s(t,"signal"))}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),s(t,"signal"))}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),s(t,"signal"))}_ensureQuery(e){return i(e)?this.createQuery():p.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.suspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){var e,t,r;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(t=this.view)&&null!=(r=t.basemapTerrain)&&r.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this.pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await o((()=>{var e,t;return null==(e=this.view)||null==(t=e.basemapTerrain)?void 0:t.ready})),this.beforeSetController(e),this.pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":return Promise.reject(new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType}))}}_getResourceInfo(){var e,t;const r=this.controller instanceof u?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:null!=(e=null==r?void 0:r.maximumNumberOfFeatures)?e:-1,totalNumberOfFeatures:null!=(t=null==r?void 0:r.serviceDataCount)?t:-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([n()],E.prototype,"loadedGraphics",void 0),e([n()],E.prototype,"suspended",void 0),e([n({readOnly:!0})],E.prototype,"legendEnabled",null),e([n()],E.prototype,"updating",void 0),e([n()],E.prototype,"controller",void 0),e([n()],E.prototype,"processor",void 0),e([n({readOnly:!0})],E.prototype,"updatePolicy",void 0),e([n({readOnly:!0})],E.prototype,"suspendResumeExtentMode",void 0),e([n({type:Boolean})],E.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],E.prototype,"suspendInfo",void 0),E=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],E),E};export{f as FeatureLikeLayerView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r,get as s,isNone as i}from"../../../core/maybe.js";import{whenOnce as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{FeatureTileController3D as u}from"../../../layers/graphics/controllers/FeatureTileController3D.js";import p from"../../../rest/support/Query.js";import{DrapeSourceType as c}from"./interfaces.js";import d from"./graphics/Graphics3DFeatureProcessor.js";import h from"./graphics/QueryEngine.js";import{toViewIfLocal as y}from"./support/projectExtentUtils.js";import{UpdatePolicy as m}from"../webgl-engine/lib/basicInterfaces.js";import{TaskPriority as g}from"../../support/Scheduler.js";const f=f=>{let E=class extends f{constructor(){super(...arguments),this.controller=null,this.updatePolicy=m.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.drapeSourceType=c.Features,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.clippingExtent=null,this.supportsHeightUnitConversion=!0,this.pendingController=null,this.queryEngine=null}initialize(){const e=this.layer;if("isTable"in e&&e.isTable)return void this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e})));this.addResolvingPromise(this._validateGeometryType());const r=new d({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentVisibilityEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this._set("processor",r),this.addResolvingPromise((async()=>{await r.setup(),this.queryEngine=new h({layerView:this,priority:g.FEATURE_QUERY_ENGINE})})()),this.addResolvingPromise((async()=>{const e=await y(this);this.fullExtentInLocalViewSpatialReference=e,await this._initializeController()})()),this.updatingHandles.add((()=>this.updatePolicy),(e=>this.processor.preferredUpdatePolicy=e)),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=r(this.controller),this._set("processor",r(this.processor)),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this.pendingController=r(this.pendingController)}get legendEnabled(){var e,t;return this.canResume()&&!(null!=(e=this.processor)&&null!=(t=e.frustumVisibility)&&t.suspended)}getGraphicFromGraphicUid(e){var t;let r=null;return null==(t=this.loadedGraphics)||t.forEach((t=>{t.uid===e&&(r=a(t,this.layer))})),r}whenGraphicBounds(e,t){var r;return null==(r=this.processor)?void 0:r.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var r;return null==(r=this.processor)?void 0:r.computeAttachmentOrigin(e,t)}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),s(t,"signal"))}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),s(t,"signal"))}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),s(t,"signal"))}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),s(t,"signal"))}_ensureQuery(e){return i(e)?this.createQuery():p.from(e)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}maskOccludee(e){return this.processor.maskOccludee(e)}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.scaleVisibilitySuspended)}getSuspendInfo(){const e=super.getSuspendInfo();return this.processor?{...e,...this.processor.suspendInfo}:e}isUpdating(){var e,t,r;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&(null==(e=this.controller)||!e.updating)&&null!=(t=this.view)&&null!=(r=t.basemapTerrain)&&r.ready&&!this.processor.updating)}async _initializeController(){const e=this.createController();this.pendingController=e,await e.when(),this._setControllerWhenInitialized(e)}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await o((()=>{var e,t;return null==(e=this.view)||null==(t=e.basemapTerrain)?void 0:t.ready})),this.beforeSetController(e),this.pendingController=null,this.controller=e,this.loadedGraphics=e.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":return Promise.reject(new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType}))}}_getResourceInfo(){var e,t;const r=this.controller instanceof u?this.controller:null;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:null!=(e=null==r?void 0:r.maximumNumberOfFeatures)?e:-1,totalNumberOfFeatures:null!=(t=null==r?void 0:r.serviceDataCount)?t:-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return e([n()],E.prototype,"loadedGraphics",void 0),e([n()],E.prototype,"suspended",void 0),e([n({readOnly:!0})],E.prototype,"legendEnabled",null),e([n()],E.prototype,"updating",void 0),e([n()],E.prototype,"controller",void 0),e([n()],E.prototype,"processor",void 0),e([n({readOnly:!0})],E.prototype,"updatePolicy",void 0),e([n({readOnly:!0})],E.prototype,"suspendResumeExtentMode",void 0),e([n({type:Boolean})],E.prototype,"slicePlaneEnabled",void 0),e([n({readOnly:!0})],E.prototype,"suspendInfo",void 0),E=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],E),E};export{f as FeatureLikeLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as s}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/maybe.js";import{whenTrueOnce as r,init as i,watch as t}from"../../../core/watchUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as p}from"./interfaces.js";import{LayerView3D as n}from"./LayerView3D.js";import c from"./graphics/Graphics3DFrustumVisibility.js";import h from"./graphics/GraphicsProcessor.js";import{enlargeExtent as u}from"./graphics/graphicUtils.js";import{toViewIfLocal as l}from"./support/projectExtentUtils.js";import{UpdatePolicy as d}from"../webgl-engine/lib/basicInterfaces.js";import m from"../../layers/LayerView.js";const y=1.2;let g=class extends(n(m)){constructor(){super(...arguments),this.type="graphics-3d",this.frustumVisibility=new c,this.slicePlaneEnabled=!1,this.drapeSourceType=p.Features,this.suspendResumeExtent=null,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new h({owner:this,layer:this.layer,scaleVisibilityEnabled:!0})),this.processor.setup(),this.frustumVisibility.setup(this),this._setupSuspendResumeExtent(),this.updatingHandles.add((()=>this.fullOpacity),(()=>this.processor.graphicsCore.opacityChange())),this.handles.add(this.layer.on("graphic-update",(s=>this.processor.graphicsCore.graphicUpdateHandler(s)))),this.addResolvingPromise(l(this).then((s=>this.fullExtentInLocalViewSpatialReference=s))),this.layer.internal?this.notifyChange("updating"):this.handles.add(r(this.view,"basemapTerrain.ready",(()=>this.notifyChange("updating"))))}destroy(){this.frustumVisibility&&(this.frustumVisibility.destroy(),this._set("frustumVisibility",null)),this.processor&&(this.processor.destroy(),this._set("processor",null))}get legendEnabled(){return this.canResume()&&!this.frustumVisibility.suspended}getSuspendInfo(){var s;const r=super.getSuspendInfo();return e(this.processor.scaleVisibility)&&this.processor.scaleVisibility.suspended&&(r.outsideScaleRange=!0),r.outsideOfView=!(null==(s=this.frustumVisibility)||!s.suspended),r}async fetchPopupFeatures(s,r){return e(r)?r.clientGraphics:null}notifyGraphicGeometryChanged(s){this.processor.graphicsCore.notifyGraphicGeometryChanged(s)}notifyGraphicVisibilityChanged(s){this.processor.graphicsCore.notifyGraphicVisibilityChanged(s)}get graphics3DGraphics(){var s;return null==(s=this.processor)?void 0:s.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var s;return null==(s=this.processor)?void 0:s.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(s){return this.processor.getGraphicFromGraphicUid(s)}whenGraphicBounds(s,e){return this.processor.whenGraphicBounds(s,e)}computeAttachmentOrigin(s,e){return this.processor?this.processor.graphicsCore.computeAttachmentOrigin(s,e):null}getSymbolLayerSize(s,e){return this.processor.getSymbolLayerSize(s,e)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(s){return this.processor.maskOccludee(s)}highlight(s){return this.processor.highlight(s)}get updatePolicy(){var s;return(null==(s=this.processor)?void 0:s.graphicsCore.effectiveUpdatePolicy)||d.SYNC}canResume(){var s;return super.canResume()&&!(null!=(s=this.processor)&&s.suspended)}isUpdating(){var s,e;return!(!(this.processor&&this.processor.updating||this.frustumVisibility&&this.frustumVisibility.updating)&&(this.layer.internal||null!=(s=this.view)&&null!=(e=s.basemapTerrain)&&e.ready))}_setupSuspendResumeExtent(){const s=()=>{this.suspendResumeExtent=u(this.processor.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.processor.graphicsCore.extentPadding),this.frustumVisibility.setExtent(this.suspendResumeExtent)};i(this.processor.graphicsCore,"computedExtent",(()=>s()),!0),t(this.processor.graphicsCore,"extentPadding",(()=>s()),!0)}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended}}};s([o({aliasOf:"layer.graphics"})],g.prototype,"loadedGraphics",void 0),s([o({readOnly:!0})],g.prototype,"suspended",void 0),s([o({readOnly:!0})],g.prototype,"legendEnabled",null),s([o({readOnly:!0})],g.prototype,"updating",void 0),s([o()],g.prototype,"layer",void 0),s([o({readOnly:!0})],g.prototype,"frustumVisibility",void 0),s([o({readOnly:!0})],g.prototype,"processor",void 0),s([o({type:Boolean})],g.prototype,"slicePlaneEnabled",void 0),g=s([a("esri.views.3d.layers.GraphicsLayerView3D")],g);const f=g;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyMaybe as s,isSome as t}from"../../../core/maybe.js";import{when as i,watch as r,syncAndInitial as o,sync as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as l}from"./interfaces.js";import{LayerView3D as u}from"./LayerView3D.js";import c from"./graphics/Graphics3DFrustumVisibility.js";import{GraphicsProcessor as h}from"./graphics/GraphicsProcessor.js";import{enlargeExtent as d}from"./graphics/graphicUtils.js";import{toViewIfLocal as m}from"./support/projectExtentUtils.js";import{UpdatePolicy as y}from"../webgl-engine/lib/basicInterfaces.js";import g from"../../layers/LayerView.js";const f=1.2;let b=class extends(u(g)){constructor(){super(...arguments),this.type="graphics-3d",this.frustumVisibility=new c,this.slicePlaneEnabled=!1,this.drapeSourceType=l.Features,this.suspendResumeExtent=null,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new h({owner:this,scaleVisibilityEnabled:!0})),this.processor.setup(),this.frustumVisibility.setup(this.processor),this._setupSuspendResumeExtent(),this.updatingHandles.add((()=>this.fullOpacity),(()=>this.processor.graphicsCore.opacityChange())),this.handles.add(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.addResolvingPromise(m(this).then((e=>this.fullExtentInLocalViewSpatialReference=e))),this.layer.internal?this.notifyChange("updating"):this.handles.add(i((()=>{var e,s;return null==(e=this.view)||null==(s=e.basemapTerrain)?void 0:s.ready}),(()=>()=>this.notifyChange("updating")),{once:!0}))}destroy(){this.handles.removeAll(),this._set("frustumVisibility",s(this.frustumVisibility)),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.frustumVisibility.suspended}getSuspendInfo(){var e,s;const i=super.getSuspendInfo();return t(this.processor.scaleVisibility)&&this.processor.scaleVisibility.suspended&&(i.outsideScaleRange=!0),i.outsideOfView=null!=(e=null==(s=this.frustumVisibility)?void 0:s.suspended)&&e,i}async fetchPopupFeatures(e,s){return t(s)?s.clientGraphics:null}getGraphicFromGraphicUid(e){return this.processor.getGraphicFromGraphicUid(e)}whenGraphicBounds(e,s){return this.processor.whenGraphicBounds(e,s)}computeAttachmentOrigin(e,s){var t;return null==(t=this.processor)?void 0:t.computeAttachmentOrigin(e,s)}getSymbolLayerSize(e,s){return this.processor.getSymbolLayerSize(e,s)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}get updatePolicy(){var e;return(null==(e=this.processor)?void 0:e.graphicsCore.effectiveUpdatePolicy)||y.SYNC}canResume(){var e;return super.canResume()&&!(null!=(e=this.processor)&&e.scaleVisibilitySuspended)}isUpdating(){var e,s;return!(!(this.processor&&this.processor.updating||this.frustumVisibility&&this.frustumVisibility.updating)&&(this.layer.internal||null!=(e=this.view)&&null!=(s=e.basemapTerrain)&&s.ready))}_setupSuspendResumeExtent(){const e=()=>{this.suspendResumeExtent=d(this.processor.graphicsCore.computedExtent,this.suspendResumeExtent,f,this.processor.graphicsCore.extentPadding),this.frustumVisibility.setExtent(this.suspendResumeExtent)};this.handles.add(r((()=>{var e,s;return null==(e=this.processor)||null==(s=e.graphicsCore)?void 0:s.computedExtent}),(()=>e()),o)),this.handles.add(r((()=>{var e,s;return null==(e=this.processor)||null==(s=e.graphicsCore)?void 0:s.extentPadding}),(()=>e()),a))}get performanceInfo(){return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:this.processor.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended}}};e([n()],b.prototype,"loadedGraphics",null),e([n({readOnly:!0})],b.prototype,"legendEnabled",null),e([n()],b.prototype,"layer",void 0),e([n({readOnly:!0})],b.prototype,"frustumVisibility",void 0),e([n({readOnly:!0})],b.prototype,"processor",void 0),e([n({type:Boolean})],b.prototype,"slicePlaneEnabled",void 0),b=e([p("esri.views.3d.layers.GraphicsLayerView3D")],b);const v=b;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{isSome as e}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as t}from"./interfaces.js";import p from"./graphics/GraphicsProcessor.js";import{GraphicsView as c}from"../../layers/GraphicsView.js";let a=class extends(c(s)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.drapeSourceType=t.Features}initialize(){const r="__sceneView.graphics-"+Date.now().toString(16),s={id:r,uid:r,type:"graphics-view-3d-proxy"};this._set("processor",new p({owner:this,layer:s})),this.processor.setup()}destroy(){this.processor&&(this.processor.destroy(),this._set("processor",null))}get updating(){var r;return!(null==(r=this.processor)||!r.updating)}notifyGraphicGeometryChanged(r){this.processor.graphicsCore.notifyGraphicGeometryChanged(r)}notifyGraphicVisibilityChanged(r){this.processor.graphicsCore.notifyGraphicVisibilityChanged(r)}get graphics3DGraphics(){return this.processor.graphicsCore.graphics3DGraphics}get graphics3DGraphicsByObjectID(){return this.processor.graphicsCore.graphics3DGraphicsByObjectID}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(r){return this.processor.getGraphicFromGraphicUid(r)}whenGraphicBounds(r,s){return this.processor.whenGraphicBounds(r,s)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}queryGraphics(){return Promise.resolve(this.loadedGraphics)}async fetchPopupFeatures(r,s){return e(s)?s.clientGraphics:null}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};r([o({readOnly:!0,aliasOf:"view.graphics"})],a.prototype,"graphics",void 0),r([o({aliasOf:"graphics"})],a.prototype,"loadedGraphics",void 0),r([o({readOnly:!0})],a.prototype,"updating",null),r([o({constructOnly:!0})],a.prototype,"view",void 0),r([o()],a.prototype,"processor",void 0),r([o({type:Boolean})],a.prototype,"slicePlaneEnabled",void 0),a=r([i("esri.views.3d.layers.GraphicsView3D")],a);const h=a;export{h as default};
5
+ import{_ as r}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{Identifiable as s}from"../../../core/Identifiable.js";import{destroyMaybe as o,isSome as t}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DrapeSourceType as c}from"./interfaces.js";import{GraphicsProcessor as a}from"./graphics/GraphicsProcessor.js";import{GraphicsView as h}from"../../layers/GraphicsView.js";let n=class extends(h(e)){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.layer=new l,this.drapeSourceType=c.Features}initialize(){this._set("processor",new a({owner:this})),this.processor.setup()}destroy(){this._set("processor",o(this.processor))}get graphics(){return this.view.graphics}get loadedGraphics(){return this.graphics}get updating(){var r;return!(null==(r=this.processor)||!r.updating)}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getGraphicFromGraphicUid(r){return this.processor.getGraphicFromGraphicUid(r)}whenGraphicBounds(r,e){return this.processor.whenGraphicBounds(r,e)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}async fetchPopupFeatures(r,e){return t(e)?e.clientGraphics:null}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};r([i({readOnly:!0})],n.prototype,"graphics",null),r([i()],n.prototype,"loadedGraphics",null),r([i({readOnly:!0})],n.prototype,"updating",null),r([i({constructOnly:!0})],n.prototype,"view",void 0),r([i()],n.prototype,"processor",void 0),r([i({type:Boolean})],n.prototype,"slicePlaneEnabled",void 0),r([i()],n.prototype,"layer",void 0),n=r([p("esri.views.3d.layers.GraphicsView3D")],n);class l extends s{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const u=n;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{neverReached as i}from"../../../../core/compilerUtils.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{destroyMaybe as r,isSome as n,unwrap as a}from"../../../../core/maybe.js";import{logOnError as o}from"../../../../core/promiseUtils.js";import{watch as l,initial as p,when as h}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as c}from"../../../../core/accessorSupport/diffUtils.js";import{canProject as y,project as g}from"../../../../geometry/support/webMercatorUtils.js";import{getRenderingInfo as m,getRenderingInfoAsync as f}from"../../../../renderers/support/renderingInfoUtils.js";import b from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as v}from"./constants.js";import{Graphics3DCore as E}from"./Graphics3DCore.js";import C from"./Graphics3DElevationAlignment.js";import{Graphics3DFilterVisibility as x}from"./Graphics3DFilterVisibility.js";import w from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as V}from"./Graphics3DObjectStates.js";import S from"./Graphics3DScaleVisibility.js";import{enlargeExtent as j}from"./graphicUtils.js";import{attributeLookup as R}from"../support/attributeUtils.js";import{UpdatePolicy as O,Object3DState as G}from"../../webgl-engine/lib/basicInterfaces.js";let _=class extends s{constructor(e){super(e),this.type="graphics-3d",this.elevationFeatureExpressionEnabled=!1,this.dataExtent=null,this.preferredUpdatePolicy=O.ASYNC,this.suspendResumeExtent=null}normalizeCtorArgs(e){const t=e.frustumVisibilityEnabled?new w:null,i=e.scaleVisibilityEnabled?new S:null,s=(e.filterVisibilityEnabled||e.timeExtentVisibilityEnabled)&&"multipatch"!==e.owner.layer.geometryType?new x:null,r=e.elevationAlignmentEnabled?new C:null,{owner:n,updateClippingExtent:a,dataExtent:o,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}=e;return{owner:n,updateClippingExtent:a,dataExtent:o,frustumVisibility:t,scaleVisibility:i,filterVisibility:s,elevationAlignment:r,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}}initialize(){const e=new E({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:this.owner.hasZ,hasM:this.owner.hasM});this._set("graphicsCore",e),this.scaleVisibility&&this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this.scaleVisibility.layerMinMaxScaleChangeHandler())),this.filterVisibility&&(this.updatingHandles.add((()=>"filter"in this.owner&&this.owner.filter),(()=>this.filterVisibility.filterChanged())),this.updatingHandles.add((()=>"timeExtent"in this.owner&&this.owner.timeExtent),(()=>this.filterVisibility.filterChanged()))),this.elevationAlignment&&this.updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{c(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this.updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this.updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{c(e,t)&&this.graphicsCore.updateLabelingInfo()})),this.updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",r(this.frustumVisibility)),this._set("scaleVisibility",r(this.scaleVisibility)),this._set("filterVisibility",r(this.filterVisibility)),this._set("elevationAlignment",r(this.elevationAlignment)),this._set("objectStates",r(this.objectStates)),this._set("graphicsCore",r(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get suspended(){var e;return null==(e=this.scaleVisibility)?void 0:e.suspended}get suspendInfo(){var e,t;const i={};return null!=(e=this.scaleVisibility)&&e.suspended&&(i.outsideScaleRange=!0),null!=(t=this.frustumVisibility)&&t.suspended&&(i.outsideOfView=!0),i}get updating(){var e,t,i;return!!(null!=(e=this.graphicsCore)&&e.updating||null!=(t=this.frustumVisibility)&&t.updating||null!=(i=this.updatingHandles)&&i.updating)}get featureStore(){var e;return null==(e=this.graphicsCore)?void 0:e.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get drapeSourceType(){return this.owner.drapeSourceType}get updatePolicy(){return this.owner.updatePolicy}get graphics3DGraphics(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphicsByObjectID}get symbolUpdateType(){var e;return null==(e=this.graphicsCore)?void 0:e.symbolUpdateType}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibility.suspended}}async setup(){this.frustumVisibility&&this.frustumVisibility.setup(this);const e=this.owner,t=this.owner.view.basemapTerrain,i=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.scaleVisibility&&this.scaleVisibility.setup(this,this.layer,i,this.graphicsCore,t),this.filterVisibility&&("filter"in e||"timeExtent"in e)&&this.filterVisibility.setup(e,this.graphicsCore),this.elevationAlignment){const t=e.view.elevationProvider;this.elevationAlignment.setup(this,i,this.graphicsCore,t)}this._set("objectStates",new V(this.graphicsCore)),this._set("labeling",this.owner.view.labeler.addGraphicsOwner(this.graphicsCore,this.scaleVisibility)),this._set("deconfliction",e.view.deconflictor.addGraphicsOwner(this.graphicsCore)),await o(this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,filterVisibility:this.filterVisibility,deconflictor:this.deconfliction,labeler:this.labeling,objectStates:this.objectStates})),this.updatingHandles.add((()=>this.layer.renderer),(e=>this.updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this.updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this.updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await o(this.graphicsCore.updateLabelingInfo())}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(G.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof b){const{set:t,handle:s}=this.objectStates.acquireSet(G.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==R(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(G.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>R(this.layer.fieldsIndex,e.attributes,i)))}if("number"==typeof e[0]||"string"==typeof e[0]){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(G.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return U}whenGraphicBounds(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=m(e,{renderer:t,arcade:i});if(n(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return f(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.getSymbolLayerSize(e,t)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.handles.add(l((()=>this.suspendResumeExtentMode),(()=>{switch(this.handles.remove(I),this.suspendResumeExtentMode){case"computed":this.handles.add([l((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],I);break;case"data":this.handles.add([h((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(a(this.dataExtent))))],I);break;default:i(this.suspendResumeExtentMode)}}),p))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this.suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!y(e,i))return;e=g(e,i)}return j(e,t,v,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){this.frustumVisibility&&this.frustumVisibility.setExtent(e),this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([d()],_.prototype,"type",void 0),e([d({constructOnly:!0})],_.prototype,"owner",void 0),e([d()],_.prototype,"layer",null),e([d({constructOnly:!0})],_.prototype,"updateClippingExtent",void 0),e([d({constructOnly:!0})],_.prototype,"elevationFeatureExpressionEnabled",void 0),e([d({constructOnly:!0})],_.prototype,"graphicsCore",void 0),e([d({constructOnly:!0})],_.prototype,"scaleVisibility",void 0),e([d({constructOnly:!0})],_.prototype,"filterVisibility",void 0),e([d({constructOnly:!0})],_.prototype,"elevationAlignment",void 0),e([d({constructOnly:!0})],_.prototype,"frustumVisibility",void 0),e([d({readOnly:!0})],_.prototype,"deconfliction",void 0),e([d({readOnly:!0})],_.prototype,"labeling",void 0),e([d({readOnly:!0})],_.prototype,"objectStates",void 0),e([d()],_.prototype,"suspendResumeExtentMode",null),e([d()],_.prototype,"dataExtent",void 0),e([d()],_.prototype,"suspended",null),e([d()],_.prototype,"suspendInfo",null),e([d()],_.prototype,"updating",null),e([d()],_.prototype,"featureStore",null),e([d()],_.prototype,"view",null),e([d()],_.prototype,"loadedGraphics",null),e([d()],_.prototype,"fullOpacity",null),e([d()],_.prototype,"filter",null),e([d()],_.prototype,"slicePlaneEnabled",null),e([d()],_.prototype,"drapeSourceType",null),e([d()],_.prototype,"updatePolicy",null),e([d()],_.prototype,"preferredUpdatePolicy",void 0),_=e([u("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],_);const A=_,I="suspendResumeExtentMode",U={remove(){},pause(){},resume(){}};export{A as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import{neverReached as i}from"../../../../core/compilerUtils.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{destroyMaybe as r,isSome as n,unwrap as a}from"../../../../core/maybe.js";import{logOnError as o}from"../../../../core/promiseUtils.js";import{watch as l,initial as p,when as h}from"../../../../core/reactiveUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as c}from"../../../../core/accessorSupport/diffUtils.js";import{canProject as y,project as g}from"../../../../geometry/support/webMercatorUtils.js";import{getRenderingInfo as m,getRenderingInfoAsync as f}from"../../../../renderers/support/renderingInfoUtils.js";import b from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as v}from"./constants.js";import{Graphics3DCore as E}from"./Graphics3DCore.js";import C from"./Graphics3DElevationAlignment.js";import{Graphics3DFilterVisibility as x}from"./Graphics3DFilterVisibility.js";import w from"./Graphics3DFrustumVisibility.js";import{Graphics3DObjectStates as V}from"./Graphics3DObjectStates.js";import S from"./Graphics3DScaleVisibility.js";import{enlargeExtent as j}from"./graphicUtils.js";import{attributeLookup as R}from"../support/attributeUtils.js";import{UpdatePolicy as O,Object3DState as G}from"../../webgl-engine/lib/basicInterfaces.js";let _=class extends s{constructor(e){super(e),this.type="graphics-3d",this.elevationFeatureExpressionEnabled=!1,this.dataExtent=null,this.preferredUpdatePolicy=O.ASYNC,this.suspendResumeExtent=null}normalizeCtorArgs(e){const t=e.frustumVisibilityEnabled?new w:null,i=e.scaleVisibilityEnabled?new S:null,s=(e.filterVisibilityEnabled||e.timeExtentVisibilityEnabled)&&"multipatch"!==e.owner.layer.geometryType?new x:null,r=e.elevationAlignmentEnabled?new C:null,{owner:n,updateClippingExtent:a,dataExtent:o,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}=e;return{owner:n,updateClippingExtent:a,dataExtent:o,frustumVisibility:t,scaleVisibility:i,filterVisibility:s,elevationAlignment:r,elevationFeatureExpressionEnabled:l,preferredUpdatePolicy:p}}initialize(){const e=new E({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:this.owner.hasZ,hasM:this.owner.hasM});this._set("graphicsCore",e),this.scaleVisibility&&this.updatingHandles.add((()=>this.layer.effectiveScaleRange),(()=>this.scaleVisibility.layerMinMaxScaleChangeHandler())),this.filterVisibility&&(this.updatingHandles.add((()=>"filter"in this.owner&&this.owner.filter),(()=>this.filterVisibility.filterChanged())),this.updatingHandles.add((()=>"timeExtent"in this.owner&&this.owner.timeExtent),(()=>this.filterVisibility.filterChanged()))),this.elevationAlignment&&this.updatingHandles.add((()=>this.layer.elevationInfo),((e,t)=>{c(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})),this.updatingHandles.add((()=>this.layer.labelsVisible),(()=>this.graphicsCore.updateVisibilityInfo())),this.updatingHandles.add((()=>this.layer.labelingInfo),((e,t)=>{c(e,t)&&this.graphicsCore.updateLabelingInfo()})),this.updatingHandles.add((()=>this.preferredUpdatePolicy),(e=>this.graphicsCore.preferredUpdatePolicy=e))}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("frustumVisibility",r(this.frustumVisibility)),this._set("scaleVisibility",r(this.scaleVisibility)),this._set("filterVisibility",r(this.filterVisibility)),this._set("elevationAlignment",r(this.elevationAlignment)),this._set("objectStates",r(this.objectStates)),this._set("graphicsCore",r(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){var e;return null==(e=this.scaleVisibility)?void 0:e.suspended}get suspended(){return this.owner.suspended}get suspendInfo(){var e,t;const i={};return null!=(e=this.scaleVisibility)&&e.suspended&&(i.outsideScaleRange=!0),null!=(t=this.frustumVisibility)&&t.suspended&&(i.outsideOfView=!0),i}get updating(){var e,t,i;return!!(null!=(e=this.graphicsCore)&&e.updating||null!=(t=this.frustumVisibility)&&t.updating||null!=(i=this.updatingHandles)&&i.updating)}get featureStore(){var e;return null==(e=this.graphicsCore)?void 0:e.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get drapeSourceType(){return this.owner.drapeSourceType}get updatePolicy(){return this.owner.updatePolicy}get graphics3DGraphics(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphicsByObjectID}get symbolUpdateType(){var e;return null==(e=this.graphicsCore)?void 0:e.symbolUpdateType}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibility.suspended}}async setup(){this.frustumVisibility&&this.frustumVisibility.setup(this);const e=this.owner,t=this.owner.view.basemapTerrain,i=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.scaleVisibility&&this.scaleVisibility.setup(this,this.layer,i,this.graphicsCore,t),this.filterVisibility&&("filter"in e||"timeExtent"in e)&&this.filterVisibility.setup(e,this.graphicsCore),this.elevationAlignment){const t=e.view.elevationProvider;this.elevationAlignment.setup(this,i,this.graphicsCore,t)}this._set("objectStates",new V(this.graphicsCore)),this._set("labeling",this.owner.view.labeler.addGraphicsOwner(this.graphicsCore,this.scaleVisibility)),this._set("deconfliction",e.view.deconflictor.addGraphicsOwner(this.graphicsCore)),await o(this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,filterVisibility:this.filterVisibility,deconflictor:this.deconfliction,labeler:this.labeling,objectStates:this.objectStates})),this.updatingHandles.add((()=>this.layer.renderer),(e=>this.updatingHandles.addPromise(this.graphicsCore.rendererChange(e)))),this.updatingHandles.add((()=>e.fullOpacity),(()=>this.graphicsCore.opacityChange())),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this.updatingHandles.add((()=>e.view.clippingArea),(()=>this._updateClippingExtent())),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await o(this.graphicsCore.updateLabelingInfo())}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(G.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e,i){if(e instanceof b){const{set:t,handle:s}=this.objectStates.acquireSet(G.Highlight,i);return this.owner.queryObjectIds(e).then((e=>this.objectStates.setObjectIds(t,e))),s}if("number"==typeof e||"string"==typeof e)return this.highlight([e],i);if(e instanceof t)return this.highlight([e],i);if("toArray"in e&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e;if(null==R(this.layer.fieldsIndex,t[0].attributes,i)){const e=t.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(G.Highlight,null);return this.objectStates.setUids(i,e),s}e=t.map((e=>R(this.layer.fieldsIndex,e.attributes,i)))}if("number"==typeof e[0]||"string"==typeof e[0]){const t=e,{set:s,handle:r}=this.objectStates.acquireSet(G.Highlight,i);return this.objectStates.setObjectIds(s,t),r}}return U}whenGraphicBounds(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.computeAttachmentOrigin(e,t)}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=m(e,{renderer:t,arcade:i});if(n(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return f(e,{renderer:t,arcade:i,...s})}getSymbolLayerSize(e,t){var i;return null==(i=this.graphicsCore)?void 0:i.getSymbolLayerSize(e,t)}_updateClippingExtent(){const e=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.owner.view.spatialReference)&&(this.updateClippingExtent(e)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.handles.add(l((()=>this.suspendResumeExtentMode),(()=>{switch(this.handles.remove(I),this.suspendResumeExtentMode){case"computed":this.handles.add([l((()=>this.graphicsCore.computedExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent)))],I);break;case"data":this.handles.add([h((()=>this.dataExtent),(e=>this._updateSuspendResumeExtent(e)),p),l((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent(a(this.dataExtent))))],I);break;default:i(this.suspendResumeExtentMode)}}),p))}_updateSuspendResumeExtent(e){e?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(e,this.suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(e,t){const i=this.owner.view.spatialReference;if(!e.spatialReference.equals(i)){if(!y(e,i))return;e=g(e,i)}return j(e,t,v,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(e){this.frustumVisibility&&this.frustumVisibility.setExtent(e),this.scaleVisibility&&this.scaleVisibility.setExtent(e)}};e([d()],_.prototype,"type",void 0),e([d({constructOnly:!0})],_.prototype,"owner",void 0),e([d()],_.prototype,"layer",null),e([d({constructOnly:!0})],_.prototype,"updateClippingExtent",void 0),e([d({constructOnly:!0})],_.prototype,"elevationFeatureExpressionEnabled",void 0),e([d({constructOnly:!0})],_.prototype,"graphicsCore",void 0),e([d({constructOnly:!0})],_.prototype,"scaleVisibility",void 0),e([d({constructOnly:!0})],_.prototype,"filterVisibility",void 0),e([d({constructOnly:!0})],_.prototype,"elevationAlignment",void 0),e([d({constructOnly:!0})],_.prototype,"frustumVisibility",void 0),e([d({readOnly:!0})],_.prototype,"deconfliction",void 0),e([d({readOnly:!0})],_.prototype,"labeling",void 0),e([d({readOnly:!0})],_.prototype,"objectStates",void 0),e([d()],_.prototype,"suspendResumeExtentMode",null),e([d()],_.prototype,"dataExtent",void 0),e([d()],_.prototype,"scaleVisibilitySuspended",null),e([d()],_.prototype,"suspended",null),e([d()],_.prototype,"suspendInfo",null),e([d()],_.prototype,"updating",null),e([d()],_.prototype,"featureStore",null),e([d()],_.prototype,"view",null),e([d()],_.prototype,"loadedGraphics",null),e([d()],_.prototype,"fullOpacity",null),e([d()],_.prototype,"filter",null),e([d()],_.prototype,"slicePlaneEnabled",null),e([d()],_.prototype,"drapeSourceType",null),e([d()],_.prototype,"updatePolicy",null),e([d()],_.prototype,"preferredUpdatePolicy",void 0),_=e([u("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],_);const A=_,I="suspendResumeExtentMode",U={remove(){},pause(){},resume(){}};export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import s from"../../../../core/Collection.js";import r from"../../../../core/Handles.js";import{isSome as a,destroyMaybe as o,isNone as n}from"../../../../core/maybe.js";import{isAbortError as c}from"../../../../core/promiseUtils.js";import{init as p}from"../../../../core/watchUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as d}from"../../../../core/accessorSupport/diffUtils.js";import u from"../../../../layers/Layer.js";import{hydrateGraphic as g}from"../../../../layers/graphics/hydratedFeatures.js";import m from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as y}from"./constants.js";import{Graphics3DCore as f}from"./Graphics3DCore.js";import b from"./Graphics3DElevationAlignment.js";import{Graphics3DObjectStates as j}from"./Graphics3DObjectStates.js";import w from"./Graphics3DScaleVisibility.js";import{enlargeExtent as C}from"./graphicUtils.js";import{UpdatePolicy as v,Object3DState as S}from"../../webgl-engine/lib/basicInterfaces.js";import{WatchUpdatingTracking as x}from"../../../support/WatchUpdatingTracking.js";let G=class extends i{constructor(t){super(t),this.type="graphics-3d",this.graphicsCore=null,this.elevationAlignment=new b,this.watchUpdatingTracking=new x,this.handles=new r,this.suspendResumeExtent=null}normalizeCtorArgs(t){let e=null;t.scaleVisibilityEnabled&&(delete(t={...t}).scaleVisibilityEnabled,e=new w);const i=new f({owner:t.owner,layer:t.layer,preferredUpdatePolicy:v.SYNC,graphicSymbolSupported:!0});return{...t,graphicsCore:i,scaleVisibility:e}}initialize(){const{layer:t,scaleVisibility:e}=this;a(e)&&"graphics"===t.type&&this.watchUpdatingTracking.add((()=>t.effectiveScaleRange),(()=>e.layerMinMaxScaleChangeHandler())),"graphics"===t.type&&this.watchUpdatingTracking.add((()=>t.elevationInfo),((t,e)=>{d(t,e)&&this.watchUpdatingTracking.addPromise(this.graphicsCore.elevationInfoChange())}))}async setup(){const t=(t,e,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(t,e,i);if(this.elevationAlignment.setup(this.owner,t,this.graphicsCore,this.view.elevationProvider),a(this.scaleVisibility)&&"effectiveScaleRange"in this.layer){const e=this.owner.view.basemapTerrain;this.scaleVisibility.setup(this.owner,this.layer,t,this.graphicsCore,e)}this._set("objectStates",new j(this.graphicsCore));try{await this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,objectStates:this.objectStates})}catch(e){if(c(e))return;throw e}this.destroyed||(this.handles.add(this.view.watch("clippingArea",(()=>this._updateClippingExtent()),!0)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles=o(this.handles),this.watchUpdatingTracking.destroy(),this._set("elevationAlignment",o(this.elevationAlignment)),this._set("scaleVisibility",o(this.scaleVisibility)),this._set("objectStates",o(this.objectStates)),this._set("graphicsCore",o(this.graphicsCore))}get suspended(){return!(!a(this.scaleVisibility)||!this.scaleVisibility.suspended)}get updating(){var t,e;return!!(null!=(t=this.graphicsCore)&&t.updating||a(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(e=this.watchUpdatingTracking)&&e.updating)}get graphics3DGraphics(){var t;return null==(t=this.graphicsCore)?void 0:t.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var t;return null==(t=this.graphicsCore)?void 0:t.graphics3DGraphicsByObjectID}getGraphicFromGraphicUid(t){if(this.owner.loadedGraphics){const e=this.owner.loadedGraphics.find((e=>e.uid===t));if(e){const t=this.layer instanceof u?this.layer:null;return g(e,t)}}}whenGraphicBounds(t,e){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(t,e):Promise.reject()}computeAttachmentOrigin(t,e){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(t,e):null}getSymbolLayerSize(t,e){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(t,e):null}maskOccludee(t){const{set:e,handle:i}=this.objectStates.acquireSet(S.MaskOccludee,null);return this.objectStates.setUid(e,t.uid),i}highlight(t){if(t instanceof m)return E;if("number"==typeof t)return this.highlight([t]);if(t instanceof e)return this.highlight([t]);if(t instanceof s&&(t=t.toArray()),Array.isArray(t)&&t.length>0){if(t[0]instanceof e){const e=t.map((t=>t.uid)),{set:i,handle:s}=this.objectStates.acquireSet(S.Highlight,null);return this.objectStates.setUids(i,e),s}if("number"==typeof t[0]){const e=t,{set:i,handle:s}=this.objectStates.acquireSet(S.Highlight,null);return this.objectStates.setObjectIds(i,e),s}}return E}_updateClippingExtent(){const t=this.view.clippingArea;this.graphicsCore.setClippingExtent(t,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}_updateSuspendResumeExtent(){n(this.scaleVisibility)||(this.suspendResumeExtent=C(this.graphicsCore.computedExtent,this.suspendResumeExtent,y,this.graphicsCore.extentPadding),this.scaleVisibility.setExtent(this.suspendResumeExtent))}_setupSuspendResumeExtent(){n(this.scaleVisibility)||(p(this.graphicsCore,"computedExtent",(t=>this._updateSuspendResumeExtent()),!0),this.graphicsCore.watch("extentPadding",(t=>this._updateSuspendResumeExtent())))}};t([h()],G.prototype,"type",void 0),t([h({constructOnly:!0})],G.prototype,"owner",void 0),t([h({constructOnly:!0})],G.prototype,"layer",void 0),t([h({readOnly:!0,aliasOf:"owner.view"})],G.prototype,"view",void 0),t([h({constructOnly:!0})],G.prototype,"graphicsCore",void 0),t([h({constructOnly:!0})],G.prototype,"scaleVisibility",void 0),t([h({readOnly:!0})],G.prototype,"elevationAlignment",void 0),t([h({readOnly:!0})],G.prototype,"objectStates",void 0),t([h({readOnly:!0})],G.prototype,"watchUpdatingTracking",void 0),t([h({readOnly:!0})],G.prototype,"suspended",null),t([h({readOnly:!0})],G.prototype,"updating",null),t([h()],G.prototype,"graphics3DGraphics",null),t([h()],G.prototype,"graphics3DGraphicsByObjectID",null),G=t([l("esri.views.3d.layers.graphics.GraphicsProcessor")],G);const E={remove(){},pause(){},resume(){}},O=G;export{O as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../Graphic.js";import i from"../../../../core/Collection.js";import{HandleOwner as s}from"../../../../core/HandleOwner.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{isSome as a,destroyMaybe as n,isNone as o}from"../../../../core/maybe.js";import{isAbortError as l}from"../../../../core/promiseUtils.js";import{watch as p,syncAndInitial as c}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{diff as u}from"../../../../core/accessorSupport/diffUtils.js";import g from"../../../../layers/Layer.js";import{hydrateGraphic as y}from"../../../../layers/graphics/hydratedFeatures.js";import{getRenderingInfo as m,getRenderingInfoAsync as f}from"../../../../renderers/support/renderingInfoUtils.js";import b from"../../../../rest/support/Query.js";import{SUSPEND_RESUME_EXTENT_OPTIMISM as C}from"./constants.js";import{Graphics3DCore as j}from"./Graphics3DCore.js";import S from"./Graphics3DElevationAlignment.js";import{Graphics3DObjectStates as v}from"./Graphics3DObjectStates.js";import w from"./Graphics3DScaleVisibility.js";import{enlargeExtent as G}from"./graphicUtils.js";import{UpdatePolicy as x,Object3DState as E}from"../../webgl-engine/lib/basicInterfaces.js";let V=class extends s{constructor(e){super(e),this.type="graphics-3d",this.graphicsCore=null,this.elevationAlignment=new S,this.suspendResumeExtent=null}normalizeCtorArgs(e){let t=null;return e.scaleVisibilityEnabled&&(delete(e={...e}).scaleVisibilityEnabled,t=new w),{...e,scaleVisibility:t}}initialize(){const e=new j({owner:this,layer:this.owner.layer,preferredUpdatePolicy:x.SYNC,graphicSymbolSupported:!0});this._set("graphicsCore",e);const{layer:t,scaleVisibility:i}=this;a(i)&&"graphics"===t.type&&this.updatingHandles.add((()=>t.effectiveScaleRange),(()=>i.layerMinMaxScaleChangeHandler())),"graphics"===t.type&&this.updatingHandles.add((()=>t.elevationInfo),((e,t)=>{u(e,t)&&this.updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}))}async setup(){const e=(e,t,i)=>this.graphicsCore.spatialIndex.queryGraphicUIDsInExtent(e,t,i);if(this.elevationAlignment.setup(this,e,this.graphicsCore,this.view.elevationProvider),a(this.scaleVisibility)&&"effectiveScaleRange"in this.layer){const t=this.owner.view.basemapTerrain;this.scaleVisibility.setup(this,this.layer,e,this.graphicsCore,t)}this._set("objectStates",new v(this.graphicsCore));try{await this.graphicsCore.setup({elevationAlignment:this.elevationAlignment,scaleVisibility:this.scaleVisibility,objectStates:this.objectStates})}catch(t){if(l(t))return;throw t}this.destroyed||(this.handles.add(this.view.watch("clippingArea",(()=>this._updateClippingExtent()),!0)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this.handles.removeAll(),this.updatingHandles.removeAll(),this._set("elevationAlignment",n(this.elevationAlignment)),this._set("scaleVisibility",n(this.scaleVisibility)),this._set("objectStates",n(this.objectStates)),this._set("graphicsCore",n(this.graphicsCore))}get layer(){return this.owner.layer}get view(){return this.owner.view}get scaleVisibilitySuspended(){return!(!a(this.scaleVisibility)||!this.scaleVisibility.suspended)}get suspended(){var e;return null!=(e=this.owner.suspended)&&e}get updating(){var e;return!!(null!=(e=this.graphicsCore)&&e.updating||a(this.scaleVisibility)&&this.scaleVisibility.updating||this.updatingHandles.updating)}get graphics3DGraphics(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return null==(e=this.graphicsCore)?void 0:e.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){var e;return null!=(e=this.owner.fullOpacity)?e:1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get drapeSourceType(){return this.owner.drapeSourceType}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,t,i){const s=m(e,{renderer:t,arcade:i});if(a(s)&&s.color){const e=s.color;e[0]=e[0]/255,e[1]=e[1]/255,e[2]=e[2]/255}return s}getRenderingInfoAsync(e,t,i,s){return f(e,{renderer:t,arcade:i,...s})}getGraphicFromGraphicUid(e){if(this.owner.loadedGraphics){const t=this.owner.loadedGraphics.find((t=>t.uid===e));if(t){const e=this.layer instanceof g?this.layer:null;return y(t,e)}}}whenGraphicBounds(e,t){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(e,t):Promise.reject()}computeAttachmentOrigin(e,t){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(e,t):null}getSymbolLayerSize(e,t){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(e,t):null}maskOccludee(e){const{set:t,handle:i}=this.objectStates.acquireSet(E.MaskOccludee,null);return this.objectStates.setUid(t,e.uid),i}highlight(e){if(e instanceof b)return A;if("number"==typeof e)return this.highlight([e]);if(e instanceof t)return this.highlight([e]);if(e instanceof i&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof t){const t=e.map((e=>e.uid)),{set:i,handle:s}=this.objectStates.acquireSet(E.Highlight,null);return this.objectStates.setUids(i,t),s}if("number"==typeof e[0]){const t=e,{set:i,handle:s}=this.objectStates.acquireSet(E.Highlight,null);return this.objectStates.setObjectIds(i,t),s}}return A}_updateClippingExtent(){const e=this.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}_updateSuspendResumeExtent(){o(this.scaleVisibility)||(this.suspendResumeExtent=G(this.graphicsCore.computedExtent,this.suspendResumeExtent,C,this.graphicsCore.extentPadding),this.scaleVisibility.setExtent(this.suspendResumeExtent))}_setupSuspendResumeExtent(){o(this.scaleVisibility)||this.handles.add([p((()=>this.graphicsCore.computedExtent),(()=>this._updateSuspendResumeExtent()),c),p((()=>this.graphicsCore.extentPadding),(()=>this._updateSuspendResumeExtent()))])}};e([h()],V.prototype,"type",void 0),e([h({constructOnly:!0})],V.prototype,"owner",void 0),e([h()],V.prototype,"layer",null),e([h()],V.prototype,"view",null),e([h({constructOnly:!0})],V.prototype,"graphicsCore",void 0),e([h({constructOnly:!0})],V.prototype,"scaleVisibility",void 0),e([h({readOnly:!0})],V.prototype,"elevationAlignment",void 0),e([h({readOnly:!0})],V.prototype,"objectStates",void 0),e([h({readOnly:!0})],V.prototype,"scaleVisibilitySuspended",null),e([h()],V.prototype,"suspended",null),e([h({readOnly:!0})],V.prototype,"updating",null),e([h()],V.prototype,"loadedGraphics",null),e([h()],V.prototype,"fullOpacity",null),e([h()],V.prototype,"slicePlaneEnabled",null),e([h()],V.prototype,"drapeSourceType",null),e([h()],V.prototype,"updatePolicy",null),V=e([d("esri.views.3d.layers.graphics.GraphicsProcessor")],V);const A=r();export{V as GraphicsProcessor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/has.js";import{lerp as e,clamp as i,smoothstep as n}from"../../../core/mathUtils.js";import{i as o,r as a,o as r,g as l}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s,e as u,m}from"../../../chunks/vec3.js";import{c as d,f as b,a as g}from"../../../chunks/vec3f64.js";import{ViewingMode as h}from"../../ViewingMode.js";import{S as f}from"../../../chunks/SunCalc.js";const p={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8e5,ambient:.015,direct:.75},planarDirection:{localAltitude:1e4,globalAltitude:1e6,globalAngles:{azimuth:1.3*Math.PI,altitude:.6*Math.PI}}};function A(t,n,o,a,r){const l=n[2];s(a.ambient.color,1,1,1),a.ambient.intensity=p.global.ambient,s(a.direct.color,1,1,1),a.direct.intensity=p.global.direct;const c=i((Math.abs(l)-p.local.altitude)/(p.global.altitude-p.local.altitude),0,1);a.globalFactor=c;const m=f.getTimes(t,n[1],n[0]);if(c<1){const i=v(t,m,r);u(a.ambient.color,i.ambient.color,a.ambient.color,c),a.ambient.intensity=e(i.ambient.intensity,a.ambient.intensity,c),u(a.direct.color,i.direct.color,a.direct.color,c),a.direct.intensity=e(i.direct.intensity,a.direct.intensity,c)}a.noonFactor=O(t,m),y(t,n,o,a.direct.directionToLightSource)}function y(e,c,d,b){const g=z,A=o(x);if(d===h.Global){if(f.getPosition(e,0,0,g),s(b,0,0,-1),a(A,A,-g.azimuth),r(A,A,-g.altitude),m(b,b,A),t("enable-feature:pole-lights")){const t=Math.sign(c[1]),e=n(t*G,t*H,c[1])*n(S,k,c[2]);u(b,b,1===t?I:D,e)}}else{const t=p.planarDirection,n=t.globalAngles,o=c[2];let r=(Math.abs(o)-t.localAltitude)/(t.globalAltitude-t.localAltitude);r=i(r,0,1),r<1?(f.getPosition(e,c[1],c[0],g),g.azimuth=(1-r)*g.azimuth+r*n.azimuth,g.altitude=(1-r)*g.altitude+r*n.altitude):(g.azimuth=n.azimuth,g.altitude=n.altitude),s(b,0,-1,0),l(A,A,-g.azimuth),a(A,A,-g.altitude),m(b,b,A)}}function N(t,e){if(e===h.Global)return!0;const i=p.planarDirection;return Math.abs(t)<i.localAltitude}function T(t,e,i,n,o){const a=t.getTime(),r=e.getTime()-a,l=Math.floor(r/i)+1,c=new Array(l);for(let s=0;s<l;++s)E.setTime(a+i*s),c[s]=d(),y(E,n,o,c[s]);return c}const M=b(.5773502691896258,-.5773502691896258,.5773502691896258);class P{constructor(){this.ambient={color:b(1,1,1),intensity:.55},this.direct={color:b(1,1,1),intensity:.55,directionToLightSource:g(M)},this.noonFactor=.5,this.globalFactor=0}}const x=c(),z={azimuth:0,altitude:0};function O(t,e){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=o+(a-o)/2;return 1-i(Math.abs(n-r)/432e5,0,1)}function j(t){switch(t){case"disabled":case"sunny":return{direct:1,ambient:1};case"cloudy":return{direct:.8,ambient:1.1};case"rainy":return{direct:.4,ambient:1};case"foggy":return{direct:.3,ambient:1.6}}}function v(t,e,i){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=a-o,l=o+r/2,c=r/4,s=l-c,u=l+c,m=.06*r,d=o-m/2,g=o+m/2,h=a-m/2,A=a+m/2,y=p.local,N=[.01,y.ambientAtNight],T=[.8,.8,1],M=[.01,.01,.01],P=[y.directAtTwilight,y.ambientAtTwilight],x=[1,.6,.5],z=[.8,.8,1],O=[.9*y.directAtNoon,y.ambientAtNoon],v=[1,.98,.98],E=[.98,.98,1],I=[y.directAtNoon,y.ambientAtNoon],D=[1,1,1],G=[1,1,1],H=O,S=v,k=E,F=P,L=x,_=z;let U,R,C=[0,0],V=[0,0,0],q=[0,0,0];n<d||n>A?(C=N,V=M,q=T,R="night"):n<g?(U=g-d,C=w(n-d,U,N,P),V=w(n-d,U,M,x),q=w(n-d,U,T,z),R="sun rising"):n<s?(U=s-g,C=w(n-g,U,P,O),V=w(n-g,U,x,v),q=w(n-g,U,z,E),R="early morning"):n<l?(U=l-s,C=w(n-s,U,O,I),V=w(n-s,U,v,D),q=w(n-s,U,E,G),R="late morning"):n<u?(U=u-l,C=w(n-l,U,I,H),V=w(n-l,U,D,S),q=w(n-l,U,G,k),R="early afternoon"):n<h?(U=h-u,C=w(n-u,U,H,F),V=w(n-u,U,S,L),q=w(n-u,U,k,_),R="late afternoon"):n<A&&(U=A-h,C=w(n-h,U,F,N),V=w(n-h,U,L,M),q=w(n-h,U,_,T),R="sun setting");const B=b(V[0],V[1],V[2]),J=b(q[0],q[1],q[2]),K=j(i);return{direct:{intensity:C[0]*K.direct,color:B},ambient:{intensity:C[1]*K.ambient,color:J},timeOfDay:R}}function w(t,e,i,n){const o=[];for(let a=0;a<i.length;a++)o[a]=(n[a]-i[a])*t/e+i[a];return o}const E=new Date(0),I=b(0,0,1),D=b(0,0,-1),G=55,H=70,S=15e6,k=1e7;export{P as ColorAndIntensity,A as computeColorAndIntensity,T as computeDirectionsOverTime,N as computeShadowsEnabled};
5
+ import t from"../../../core/has.js";import{lerp as e,clamp as i,smoothstep as n}from"../../../core/mathUtils.js";import{i as o,r as a,o as r,g as l}from"../../../chunks/mat4.js";import{c}from"../../../chunks/mat4f64.js";import{s,e as u,m}from"../../../chunks/vec3.js";import{c as d,f as b,a as g}from"../../../chunks/vec3f64.js";import{ViewingMode as h}from"../../ViewingMode.js";import{S as f}from"../../../chunks/SunCalc.js";const p={local:{altitude:1500,ambientAtNight:.1,ambientAtNoon:.45,ambientAtTwilight:.2,directAtNoon:.65,directAtTwilight:.7},global:{altitude:8e5,ambient:.015,direct:.75},planarDirection:{localAltitude:1e4,globalAltitude:1e6,globalAngles:{azimuth:1.3*Math.PI,altitude:.6*Math.PI}}};function A(t,n,o,a,r){const l=n[2];s(a.ambient.color,1,1,1),a.ambient.intensity=p.global.ambient,s(a.direct.color,1,1,1),a.direct.intensity=p.global.direct;const c=i((Math.abs(l)-p.local.altitude)/(p.global.altitude-p.local.altitude),0,1);a.globalFactor=c;const m=f.getTimes(t,n[1],n[0]);if(c<1){const i=j(t,m,r);u(a.ambient.color,i.ambient.color,a.ambient.color,c),a.ambient.intensity=e(i.ambient.intensity,a.ambient.intensity,c),u(a.direct.color,i.direct.color,a.direct.color,c),a.direct.intensity=e(i.direct.intensity,a.direct.intensity,c)}a.noonFactor=z(t,m),y(t,n,o,a.direct.directionToLightSource)}function y(e,c,d,b){const g=x,A=o(w);if(d===h.Global){if(f.getPosition(e,0,0,g),s(b,0,0,-1),a(A,A,-g.azimuth),r(A,A,-g.altitude),m(b,b,A),t("enable-feature:pole-lights")){const t=Math.sign(c[1]),e=n(t*G,t*H,c[1])*n(S,k,c[2]);u(b,b,1===t?I:D,e)}}else{const t=p.planarDirection,n=t.globalAngles,o=c[2];let r=(Math.abs(o)-t.localAltitude)/(t.globalAltitude-t.localAltitude);r=i(r,0,1),r<1?(f.getPosition(e,c[1],c[0],g),g.azimuth=(1-r)*g.azimuth+r*n.azimuth,g.altitude=(1-r)*g.altitude+r*n.altitude):(g.azimuth=n.azimuth,g.altitude=n.altitude),s(b,0,-1,0),l(A,A,-g.azimuth),a(A,A,-g.altitude),m(b,b,A)}}function N(t,e){if(e===h.Global)return!0;const i=p.planarDirection;return Math.abs(t)<i.localAltitude}function T(t,e,i,n,o){const a=t.getTime(),r=e.getTime()-a,l=Math.floor(r/i)+1,c=new Array(l);for(let s=0;s<l;++s)E.setTime(a+i*s),c[s]=d(),y(E,n,o,c[s]);return c}const M=b(.5773502691896258,-.5773502691896258,.5773502691896258);class P{constructor(){this.ambient={color:b(1,1,1),intensity:.55},this.direct={color:b(1,1,1),intensity:.55,directionToLightSource:g(M)},this.noonFactor=.5,this.globalFactor=0}}const w=c(),x={azimuth:0,altitude:0};function z(t,e){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=o+(a-o)/2;return 1-i(Math.abs(n-r)/432e5,0,1)}function O(t){switch(t){case"disabled":case"sunny":return{direct:1,ambient:1};case"cloudy":return{direct:.8,ambient:1.1};case"rainy":return{direct:.4,ambient:1};case"snowy":return{direct:.6,ambient:1};case"foggy":return{direct:.3,ambient:1.6}}}function j(t,e,i){const n=t.valueOf();let o,a;e.polarException===f.PolarException.MIDNIGHT_SUN?(o=n-60*(t.getHours()+48)*60*1e3-60*t.getMinutes()*1e3,a=o+432e6):e.polarException===f.PolarException.POLAR_NIGHT?(o=n-2,a=n-1):(o=e.sunrise.valueOf(),a=e.sunset.valueOf());const r=a-o,l=o+r/2,c=r/4,s=l-c,u=l+c,m=.06*r,d=o-m/2,g=o+m/2,h=a-m/2,A=a+m/2,y=p.local,N=[.01,y.ambientAtNight],T=[.8,.8,1],M=[.01,.01,.01],P=[y.directAtTwilight,y.ambientAtTwilight],w=[1,.6,.5],x=[.8,.8,1],z=[.9*y.directAtNoon,y.ambientAtNoon],j=[1,.98,.98],E=[.98,.98,1],I=[y.directAtNoon,y.ambientAtNoon],D=[1,1,1],G=[1,1,1],H=z,S=j,k=E,F=P,L=w,_=x;let U,R,C=[0,0],V=[0,0,0],q=[0,0,0];n<d||n>A?(C=N,V=M,q=T,R="night"):n<g?(U=g-d,C=v(n-d,U,N,P),V=v(n-d,U,M,w),q=v(n-d,U,T,x),R="sun rising"):n<s?(U=s-g,C=v(n-g,U,P,z),V=v(n-g,U,w,j),q=v(n-g,U,x,E),R="early morning"):n<l?(U=l-s,C=v(n-s,U,z,I),V=v(n-s,U,j,D),q=v(n-s,U,E,G),R="late morning"):n<u?(U=u-l,C=v(n-l,U,I,H),V=v(n-l,U,D,S),q=v(n-l,U,G,k),R="early afternoon"):n<h?(U=h-u,C=v(n-u,U,H,F),V=v(n-u,U,S,L),q=v(n-u,U,k,_),R="late afternoon"):n<A&&(U=A-h,C=v(n-h,U,F,N),V=v(n-h,U,L,M),q=v(n-h,U,_,T),R="sun setting");const B=b(V[0],V[1],V[2]),J=b(q[0],q[1],q[2]),K=O(i);return{direct:{intensity:C[0]*K.direct,color:B},ambient:{intensity:C[1]*K.ambient,color:J},timeOfDay:R}}function v(t,e,i,n){const o=[];for(let a=0;a<i.length;a++)o[a]=(n[a]-i[a])*t/e+i[a];return o}const E=new Date(0),I=b(0,0,1),D=b(0,0,-1),G=55,H=70,S=15e6,k=1e7;export{P as ColorAndIntensity,A as computeColorAndIntensity,T as computeDirectionsOverTime,N as computeShadowsEnabled};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.23/esri/copyright.txt for details.
4
4
  */
5
- import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{union as r}from"./depthRange.js";import{RenderSlot as t}from"./RenderSlot.js";import{assert as n}from"./Util.js";class s{constructor(e){this.context=e,this.renderPlugins=new Array,this.slots=[];for(let r=0;r<t.MAX_SLOTS;++r)this.slots[r]=[]}add(r,t,n){const s=()=>{this.renderPlugins.push(t);for(const e of r)this.slots[e].push(t);this.context.requestRender()},i=t.initializeRenderContext(this.context,n);if(e(i))return i.then(s);s()}remove(e){const r=this.renderPlugins.length;this.renderPlugins=this.renderPlugins.filter((r=>r!==e)),n(this.renderPlugins.length<r,"Removing non-added render plugin");for(let t=0;t<this.slots.length;++t)this.slots[t]=this.slots[t].filter((r=>r!==e));e.uninitializeRenderContext(),this.context.requestRender()}prepareRender(e,r){for(const t of this.renderPlugins)t.prepareRender&&t.prepareRender(e,r)}render(){const e=this.slots[this.context.renderContext.slot],r=new Array;e.filter((e=>{if(!e.canRender)return!1;if(i(e)){const t=e.prepareTechnique(this.context.renderContext);return!!t&&(r.push(t),!0)}return r.push(null),!0})).forEach(((e,t)=>e.render(this.context.renderContext,r[t])))}queryDepthRange(e){const t=o;t.near=1/0,t.far=-1/0;for(const n of this.renderPlugins)if(n.queryDepthRange){const s=n.queryDepthRange(e);s&&r(t,s,t)}return t}get needsTransparentPass(){return this.renderPlugins.some((e=>e.needsTransparentPass))}get needsHighlight(){return this.renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this.renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this.slots[t.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){let e=0;return this.renderPlugins.forEach((r=>{r.renderOccludedFlags&&(e|=r.renderOccludedFlags)})),e}}function i(e){return"prepareTechnique"in e}const o={near:0,far:0};export{s as RenderPluginManager};
5
+ import{isPromiseLike as e}from"../../../../core/promiseUtils.js";import{union as t}from"./depthRange.js";import{RenderSlot as r}from"./RenderSlot.js";import{assert as n}from"./Util.js";class s{constructor(e){this.context=e,this.renderPlugins=new Array,this.slots=[];for(let t=0;t<r.MAX_SLOTS;++t)this.slots[t]=[]}add(t,r,n){const s=()=>{this.renderPlugins.push(r);for(const e of t)this.slots[e].push(r);this.context.requestRender()},i=r.initializeRenderContext(this.context,n);if(e(i))return i.then(s);s()}remove(e){const t=this.renderPlugins.length;this.renderPlugins=this.renderPlugins.filter((t=>t!==e)),n(this.renderPlugins.length<t,"Removing non-added render plugin");for(let r=0;r<this.slots.length;++r)this.slots[r]=this.slots[r].filter((t=>t!==e));e.uninitializeRenderContext(),this.context.requestRender()}prepareRender(e,t){for(const r of this.renderPlugins)r.prepareRender&&r.prepareRender(e,t)}updateAnimation(e){let t=!1;return this.renderPlugins.forEach((r=>{r.updateAnimation&&(t=r.updateAnimation(e)||t)})),t}render(){const e=this.slots[this.context.renderContext.slot],t=new Array;e.filter((e=>{if(!e.canRender)return!1;if(i(e)){const r=e.prepareTechnique(this.context.renderContext);return!!r&&(t.push(r),!0)}return t.push(null),!0})).forEach(((e,r)=>e.render(this.context.renderContext,t[r])))}queryDepthRange(e){const r=o;r.near=1/0,r.far=-1/0;for(const n of this.renderPlugins)if(n.queryDepthRange){const s=n.queryDepthRange(e);s&&t(r,s,r)}return r}get needsTransparentPass(){return this.renderPlugins.some((e=>e.needsTransparentPass))}get needsHighlight(){return this.renderPlugins.some((e=>e.needsHighlight))}get needsLinearDepth(){return this.renderPlugins.some((e=>e.needsLinearDepth))}get needsLaserlineWithContrastControl(){const e=this.slots[r.LASERLINES_CONTRAST_CONTROL];return!!e&&e.length>0}get renderOccludedFlags(){let e=0;return this.renderPlugins.forEach((t=>{t.renderOccludedFlags&&(e|=t.renderOccludedFlags)})),e}}function i(e){return"prepareTechnique"in e}const o={near:0,far:0};export{s as RenderPluginManager};