@arcgis/core 4.23.0-next.20220105 → 4.23.0-next.20220123

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 (632) hide show
  1. package/assets/components/assets/calcite-date-picker/nls/bg.json +31 -0
  2. package/assets/components/assets/calcite-icon/centerAlign16.json +1 -0
  3. package/assets/components/assets/calcite-icon/centerAlign24.json +1 -0
  4. package/assets/components/assets/calcite-icon/centerAlign32.json +1 -0
  5. package/assets/components/assets/calcite-icon/checkSquareF16.json +1 -0
  6. package/assets/components/assets/calcite-icon/checkSquareF24.json +1 -0
  7. package/assets/components/assets/calcite-icon/checkSquareF32.json +1 -0
  8. package/assets/components/assets/calcite-icon/convert16.json +1 -0
  9. package/assets/components/assets/calcite-icon/convert24.json +1 -0
  10. package/assets/components/assets/calcite-icon/convert32.json +1 -0
  11. package/assets/components/assets/calcite-icon/explore16.json +1 -0
  12. package/assets/components/assets/calcite-icon/explore24.json +1 -0
  13. package/assets/components/assets/calcite-icon/explore32.json +1 -0
  14. package/assets/components/assets/calcite-icon/formDropdown16.json +1 -0
  15. package/assets/components/assets/calcite-icon/formDropdown24.json +1 -0
  16. package/assets/components/assets/calcite-icon/formDropdown32.json +1 -0
  17. package/assets/components/assets/calcite-icon/language16.json +1 -0
  18. package/assets/components/assets/calcite-icon/language24.json +1 -0
  19. package/assets/components/assets/calcite-icon/language32.json +1 -0
  20. package/assets/components/assets/calcite-icon/languageTranslate16.json +1 -0
  21. package/assets/components/assets/calcite-icon/languageTranslate24.json +1 -0
  22. package/assets/components/assets/calcite-icon/languageTranslate32.json +1 -0
  23. package/assets/components/assets/calcite-icon/leftAlign16.json +1 -0
  24. package/assets/components/assets/calcite-icon/leftAlign24.json +1 -0
  25. package/assets/components/assets/calcite-icon/leftAlign32.json +1 -0
  26. package/assets/components/assets/calcite-icon/lineSolid4.json +1 -0
  27. package/assets/components/assets/calcite-icon/partlyCloudy16.json +1 -0
  28. package/assets/components/assets/calcite-icon/partlyCloudy24.json +1 -0
  29. package/assets/components/assets/calcite-icon/partlyCloudy32.json +1 -0
  30. package/assets/components/assets/calcite-icon/rightAlign16.json +1 -0
  31. package/assets/components/assets/calcite-icon/rightAlign24.json +1 -0
  32. package/assets/components/assets/calcite-icon/rightAlign32.json +1 -0
  33. package/assets/components/assets/calcite-icon/screenshotMode16.json +1 -0
  34. package/assets/components/assets/calcite-icon/screenshotMode24.json +1 -0
  35. package/assets/components/assets/calcite-icon/screenshotMode32.json +1 -0
  36. package/assets/components/assets/calcite-icon/squareF16.json +1 -0
  37. package/assets/components/assets/calcite-icon/squareF24.json +1 -0
  38. package/assets/components/assets/calcite-icon/squareF32.json +1 -0
  39. package/assets/components/assets/calcite-icon/terminal16.json +1 -0
  40. package/assets/components/assets/calcite-icon/terminal24.json +1 -0
  41. package/assets/components/assets/calcite-icon/terminal32.json +1 -0
  42. package/assets/components/assets/calcite-icon/touch16.json +1 -0
  43. package/assets/components/assets/calcite-icon/touch24.json +1 -0
  44. package/assets/components/assets/calcite-icon/touch32.json +1 -0
  45. package/assets/components/assets/calcite-icon/xHexagon16.json +1 -0
  46. package/assets/components/assets/calcite-icon/xHexagon24.json +1 -0
  47. package/assets/components/assets/calcite-icon/xHexagon32.json +1 -0
  48. package/assets/components/assets/calcite-icon/xHexagonF16.json +1 -0
  49. package/assets/components/assets/calcite-icon/xHexagonF24.json +1 -0
  50. package/assets/components/assets/calcite-icon/xHexagonF32.json +1 -0
  51. package/assets/components/assets/calcite-icon/xOctagonF16.json +1 -0
  52. package/assets/components/assets/calcite-icon/xOctagonF24.json +1 -0
  53. package/assets/components/assets/calcite-icon/xOctagonF32.json +1 -0
  54. package/assets/esri/core/workers/RemoteClient.js +1 -1
  55. package/assets/esri/core/workers/chunks/09da224052976e290828.js +1 -0
  56. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +1 -0
  57. package/assets/esri/core/workers/chunks/{ce5ca5e95b2378ec55b9.js → 1305ef8717da6e902a55.js} +1 -1
  58. package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
  59. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
  60. package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +1 -0
  61. package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +1 -0
  62. package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +1 -0
  63. package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{9c417740bf3707a0d465.js → 2c607d30ff8ca1b61286.js} +1 -1
  65. package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +1 -0
  66. package/assets/esri/core/workers/chunks/37a7bd30352b1309b8f8.js +1 -0
  67. package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +1 -0
  68. package/assets/esri/core/workers/chunks/{3d5169ea9810d10caf0d.js → 3a9740dccda6a733313c.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
  70. package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +1 -0
  71. package/assets/esri/core/workers/chunks/4c9084a04948b6924749.js +1 -0
  72. package/assets/esri/core/workers/chunks/{35961690afe9ea1f91b0.js → 5383a8f3e4ec1a8a4fcd.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{4beba242e7540ee3182b.js → 5538639a49c7cc2eca63.js} +1 -1
  74. package/assets/esri/core/workers/chunks/57c67e260267a1dbc5e3.js +1 -0
  75. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
  76. package/assets/esri/core/workers/chunks/5ac4c1d54b94c7d87835.js +1 -0
  77. package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{ba6fdaed6c315dc13981.js → 625d2663daa8e0cf64b0.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{3a2b2dc3e938d53faa30.js → 64276aacaafa4c8a15bd.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{75466e0c8c8da499b150.js → 662d13f68cf3ec92439b.js} +1 -1
  81. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
  82. package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +1 -0
  83. package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
  84. package/assets/esri/core/workers/chunks/6cdfe175c965918b741b.js +1 -0
  85. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +1 -0
  86. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +1 -0
  87. package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +1 -0
  88. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js → 7a8764ae8a0041e1151d.js} +2 -2
  89. package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js.LICENSE.txt → 7a8764ae8a0041e1151d.js.LICENSE.txt} +1 -1
  90. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +1 -0
  91. package/assets/esri/core/workers/chunks/{f52b6d5037e4205b035c.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
  92. package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +1 -0
  93. package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +1 -0
  94. package/assets/esri/core/workers/chunks/8cbb04a9065aa3756638.js +1 -0
  95. package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
  96. package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
  97. package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +1 -0
  98. package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +1 -0
  99. package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +1 -0
  100. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +1 -0
  101. package/assets/esri/core/workers/chunks/9d77467aa71d345fc1b6.js +1 -0
  102. package/assets/esri/core/workers/chunks/9f8b7b6b4e95f9a794fc.js +1 -0
  103. package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
  104. package/assets/esri/core/workers/chunks/{9b7c51ff3d2b42aa62f5.js → a7b1b75643ed31489495.js} +1 -1
  105. package/assets/esri/core/workers/chunks/a8b13fb804bb775e4967.js +1 -0
  106. package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +1 -0
  107. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +1 -0
  108. package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +1 -0
  109. package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +1 -0
  110. package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +1 -0
  111. package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +1 -0
  112. package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
  113. package/assets/esri/core/workers/chunks/{2a39d520b192b8e552b5.js → b2ae5fc4f787ea568b88.js} +1 -1
  114. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +1 -0
  115. package/assets/esri/core/workers/chunks/{b87bc1481a49b38109f4.js → b9c177524b3e7de1ffd1.js} +1 -1
  116. package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +1 -0
  117. package/assets/esri/core/workers/chunks/{7c1b9ae141112a63b446.js → ba6654a885be4b7a43f0.js} +1 -1
  118. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +1 -0
  119. package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +1 -0
  120. package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
  121. package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → c080114a69fa95b88d22.js} +1 -1
  122. package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +1 -0
  123. package/assets/esri/core/workers/chunks/c36f84daa7736878418d.js +1 -0
  124. package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +1 -0
  125. package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
  127. package/assets/esri/core/workers/chunks/cbb291412fd1a5261aa9.js +1 -0
  128. package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
  129. package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +1 -0
  130. package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +1 -0
  131. package/assets/esri/core/workers/chunks/d1454155ee1b8a421cbb.js +1 -0
  132. package/assets/esri/core/workers/chunks/{0cd583c3233573cb8468.js → d24c4fbc567486b1188f.js} +1 -1
  133. package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +1 -0
  134. package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
  135. package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +1 -0
  136. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
  137. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +1 -0
  138. package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +1 -0
  139. package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +1 -0
  140. package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +1 -0
  141. package/assets/esri/core/workers/chunks/{2f66fcb8670b108af549.js → ed0bcc66fb1e0ee75a4b.js} +1 -1
  142. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +1 -0
  143. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  144. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.svg +1 -0
  145. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.ttf +0 -0
  146. package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.woff +0 -0
  147. package/assets/esri/themes/base/icons/selection.json +1 -1
  148. package/assets/esri/themes/base/icons/style.css +4 -0
  149. package/assets/esri/themes/base/icons/style.scss +6 -0
  150. package/assets/esri/themes/base/icons/variables.scss +1 -0
  151. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  152. package/assets/esri/themes/dark/main.css +1 -1
  153. package/assets/esri/themes/dark-blue/main.css +1 -1
  154. package/assets/esri/themes/dark-green/main.css +1 -1
  155. package/assets/esri/themes/dark-purple/main.css +1 -1
  156. package/assets/esri/themes/dark-red/main.css +1 -1
  157. package/assets/esri/themes/light/main.css +1 -1
  158. package/assets/esri/themes/light/view.css +1 -1
  159. package/assets/esri/themes/light-blue/main.css +1 -1
  160. package/assets/esri/themes/light-green/main.css +1 -1
  161. package/assets/esri/themes/light-purple/main.css +1 -1
  162. package/assets/esri/themes/light-red/main.css +1 -1
  163. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  194. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  195. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  196. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  197. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  198. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  199. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  200. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  201. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  202. package/assets/esri/widgets/ElevationProfile/t9n/ElevationProfile_ja.json +1 -1
  203. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ar.json +1 -1
  204. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bg.json +1 -1
  205. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bs.json +1 -1
  206. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ca.json +1 -1
  207. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_cs.json +1 -1
  208. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_da.json +1 -1
  209. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_de.json +1 -1
  210. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_el.json +1 -1
  211. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_es.json +1 -1
  212. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_et.json +1 -1
  213. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fi.json +1 -1
  214. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fr.json +1 -1
  215. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_he.json +1 -1
  216. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hr.json +1 -1
  217. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hu.json +1 -1
  218. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_id.json +1 -1
  219. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_it.json +1 -1
  220. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ja.json +1 -1
  221. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ko.json +1 -1
  222. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lt.json +1 -1
  223. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lv.json +1 -1
  224. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nb.json +1 -1
  225. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nl.json +1 -1
  226. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pl.json +1 -1
  227. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-BR.json +1 -1
  228. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-PT.json +1 -1
  229. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ro.json +1 -1
  230. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ru.json +1 -1
  231. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sk.json +1 -1
  232. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sl.json +1 -1
  233. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sr.json +1 -1
  234. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sv.json +1 -1
  235. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_th.json +1 -1
  236. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_tr.json +1 -1
  237. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_uk.json +1 -1
  238. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_vi.json +1 -1
  239. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-CN.json +1 -1
  240. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-HK.json +1 -1
  241. package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-TW.json +1 -1
  242. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
  243. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
  244. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
  245. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
  246. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  247. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  248. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  249. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  250. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  251. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  252. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  253. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  254. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  255. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  256. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  257. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  258. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  259. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  260. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  261. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  262. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  263. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  264. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  265. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  266. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  267. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  268. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  269. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  270. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  271. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  272. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  273. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  274. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  275. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  276. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  277. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  278. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  279. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  280. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  281. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  282. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  283. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  284. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  285. package/chunks/Clouds.glsl.js +14 -14
  286. package/chunks/CloudsComposition.glsl.js +4 -4
  287. package/chunks/DefaultMaterial.glsl.js +2 -2
  288. package/chunks/HUDMaterial.glsl.js +22 -21
  289. package/chunks/RibbonLine.glsl.js +10 -14
  290. package/chunks/persistableUrlUtils.js +1 -1
  291. package/chunks/vec32.js +1 -1
  292. package/chunks/vec42.js +1 -1
  293. package/chunks/vxlLayer.js +1 -1
  294. package/core/has.js +1 -1
  295. package/core/urlUtils.js +1 -1
  296. package/core/workers/workerFactory.js +1 -1
  297. package/form/elements/FieldElement.js +1 -1
  298. package/geometry/support/buffer/math/common.js +1 -1
  299. package/geometry/support/heightModelInfoUtils.js +1 -1
  300. package/interfaces.d.ts +372 -126
  301. package/layers/FeatureLayer.js +1 -1
  302. package/layers/RouteLayer.js +1 -1
  303. package/layers/SubtypeGroupLayer.js +1 -1
  304. package/layers/VectorTileLayer.js +1 -1
  305. package/layers/VoxelLayer.js +1 -1
  306. package/layers/VoxelWasmPerScene.js +1 -1
  307. package/layers/WMSLayer.js +1 -1
  308. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  309. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  310. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  311. package/layers/mixins/ArcGISImageService.js +1 -1
  312. package/layers/mixins/OperationalLayer.js +1 -1
  313. package/layers/ogc/crsUtils.js +5 -0
  314. package/layers/support/RasterFunction.js +1 -1
  315. package/layers/support/RasterWorker.js +1 -1
  316. package/layers/support/capabilities.js +1 -1
  317. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  318. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  319. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  320. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  321. package/layers/support/vectorTileLayerLoader.js +1 -1
  322. package/layers/support/wmsUtils.js +1 -1
  323. package/layers/support/wmtsUtils.js +1 -1
  324. package/libs/vxl/enums.js +1 -1
  325. package/package.json +5 -5
  326. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  327. package/portal/schemas/definitions.js +1 -1
  328. package/portal/schemas/integratedMeshLayerItem.js +1 -1
  329. package/portal/schemas/pointCloudLayerItem.js +1 -1
  330. package/portal/schemas/sceneLayerItem.js +1 -1
  331. package/portal/schemas/webScene.js +1 -1
  332. package/rasterRenderers.js +1 -1
  333. package/renderers/support/RasterSymbolizer.js +1 -1
  334. package/request.js +1 -1
  335. package/rest/find.js +1 -1
  336. package/rest/geometryService/generalize.js +1 -1
  337. package/rest/geometryService/lengths.js +1 -1
  338. package/rest/geometryService/offset.js +1 -1
  339. package/rest/geometryService/relation.js +1 -1
  340. package/rest/geometryService/trimExtend.js +1 -1
  341. package/rest/identify.js +1 -1
  342. package/{tasks → rest}/operations/find.js +0 -0
  343. package/{tasks → rest}/operations/generalize.js +0 -0
  344. package/rest/operations/identify.js +5 -0
  345. package/{tasks → rest}/operations/lengths.js +0 -0
  346. package/{tasks → rest}/operations/offset.js +0 -0
  347. package/{tasks → rest}/operations/relation.js +0 -0
  348. package/{tasks → rest}/operations/trimExtend.js +0 -0
  349. package/{tasks → rest}/operations/urlUtils.js +0 -0
  350. package/rest/print.js +1 -1
  351. package/rest/query/operations/query.js +1 -1
  352. package/rest/query/operations/queryAttachments.js +1 -1
  353. package/rest/query/operations/queryRelatedRecords.js +1 -1
  354. package/rest/query/operations/queryTopFeatures.js +1 -1
  355. package/rest/route/utils.js +1 -1
  356. package/rest/support/ImageIdentifyParameters.js +1 -1
  357. package/rest/support/NetworkServiceDescription.js +1 -1
  358. package/rest/support/RouteInfo.js +1 -1
  359. package/rest/support/RouteParameters.js +1 -1
  360. package/rest/support/RouteSettings.js +5 -0
  361. package/rest/support/StatisticDefinition.js +1 -1
  362. package/rest/support/Stop.js +1 -1
  363. package/rest/support/networkEnums.js +1 -1
  364. package/smartMapping/renderers/univariateColorSize.js +1 -1
  365. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  366. package/support/featureFlags.js +1 -1
  367. package/support/revision.js +1 -1
  368. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  369. package/symbols/Font.js +1 -1
  370. package/symbols/IconSymbol3DLayer.js +1 -1
  371. package/symbols/ObjectSymbol3DLayer.js +1 -1
  372. package/symbols/PathSymbol3DLayer.js +1 -1
  373. package/symbols/TextSymbol.js +1 -1
  374. package/symbols/TextSymbol3DLayer.js +1 -1
  375. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  376. package/symbols/support/Symbol3DHalo.js +1 -1
  377. package/symbols/support/Symbol3DMaterial.js +1 -1
  378. package/symbols/support/cimSymbolUtils.js +1 -1
  379. package/symbols/support/textUtils.js +5 -0
  380. package/symbols/support/utils.js +1 -1
  381. package/views/2d/engine/Stage.js +1 -1
  382. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  383. package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +1 -1
  384. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  385. package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +5 -0
  386. package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
  387. package/views/2d/engine/webgl/MaterialManager.js +1 -1
  388. package/views/2d/engine/webgl/alignmentUtils.js +1 -1
  389. package/views/2d/engine/webgl/effects/BlendEffect.js +1 -1
  390. package/views/2d/engine/webgl/materialKey/MaterialKey.js +1 -1
  391. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  392. package/views/2d/engine/webgl/shaders/BlendPrograms.js +1 -1
  393. package/views/2d/engine/webgl/shaders/MaterialPrograms.js +1 -1
  394. package/views/2d/layers/BaseLayerView2D.js +1 -1
  395. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  396. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  397. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  398. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  399. package/views/2d/layers/LayerView2D.js +1 -1
  400. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  401. package/views/2d/layers/RouteLayerView2D.js +1 -1
  402. package/views/2d/layers/TileLayerView2D.js +1 -1
  403. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  404. package/views/2d/layers/WMSLayerView2D.js +1 -1
  405. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  406. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  407. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  408. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  409. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  410. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  411. package/views/2d/support/engineHelpers.js +1 -1
  412. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  413. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  414. package/views/3d/environment/CloudsComposition.js +1 -1
  415. package/views/3d/environment/CloudsGenerator.js +1 -1
  416. package/views/3d/environment/CloudyWeather.js +1 -1
  417. package/views/3d/environment/Fog.js +1 -1
  418. package/views/3d/environment/FoggyWeather.js +1 -1
  419. package/views/3d/environment/NoiseTextureAtlas.js +1 -1
  420. package/views/3d/environment/RainyWeather.js +1 -1
  421. package/views/3d/environment/Stars.js +1 -1
  422. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  423. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  424. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  425. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  426. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  427. package/views/3d/layers/GraphicsView3D.js +1 -1
  428. package/views/3d/layers/I3SMeshView3D.js +1 -1
  429. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  430. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  431. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  432. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  433. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  434. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  435. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  436. package/views/3d/layers/SceneLayerView3D.js +1 -1
  437. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  438. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  439. package/views/3d/layers/WMSLayerView3D.js +1 -1
  440. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  441. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  442. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  443. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  444. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  445. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +5 -0
  446. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  447. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  448. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  449. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  450. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  451. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  452. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  453. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  454. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  455. package/views/3d/layers/graphics/GraphicsProcessor.js +5 -0
  456. package/views/3d/layers/graphics/IGraphics3DFeatureProcessor.js +4 -0
  457. package/views/3d/layers/graphics/Labeler.js +1 -1
  458. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  459. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  460. package/views/3d/state/controllers/RotateController.js +1 -1
  461. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  462. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  463. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  464. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  465. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  466. package/views/3d/support/debugFlags.js +1 -1
  467. package/views/3d/support/sunUtils.js +1 -1
  468. package/views/3d/terrain/Overlay.js +1 -1
  469. package/views/3d/terrain/OverlayManager.js +1 -1
  470. package/views/3d/terrain/TerrainSurface.js +1 -1
  471. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +7 -1
  472. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +28 -24
  473. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +19 -14
  474. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
  475. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  476. package/views/3d/webgl-engine/lib/InstanceParameters.js +5 -0
  477. package/views/3d/webgl-engine/lib/{localOrigin.js → LocalOriginFactory.js} +0 -0
  478. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  479. package/views/3d/webgl-engine/lib/Program.js +1 -1
  480. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  481. package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
  482. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  483. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  484. package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
  485. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  486. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  487. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  488. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  489. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  490. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  491. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  492. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  493. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  494. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  495. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  496. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  497. package/views/LayerViewManager.js +1 -1
  498. package/views/MapView.js +1 -1
  499. package/views/SceneView.js +1 -1
  500. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  501. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  502. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  503. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  504. package/views/layers/ImageryTileLayerView.js +1 -1
  505. package/views/layers/LayerView.js +1 -1
  506. package/views/layers/OGCFeatureLayerView.js +1 -1
  507. package/views/layers/RefreshableLayerView.js +1 -1
  508. package/views/overlay/ViewOverlay.js +1 -1
  509. package/views/support/DefaultsFromMap.js +1 -1
  510. package/views/support/WatchUpdatingTracking.js +1 -1
  511. package/views/support/imageReprojection.js +1 -1
  512. package/views/webgl/BufferObject.js +1 -1
  513. package/views/webgl/ContextState.js +1 -1
  514. package/views/webgl/FramebufferObject.js +1 -1
  515. package/views/webgl/Program.js +1 -1
  516. package/views/webgl/ProgramCache.js +1 -1
  517. package/views/webgl/ProgramTemplate.js +1 -1
  518. package/views/webgl/Renderbuffer.js +1 -1
  519. package/views/webgl/RenderingContext.js +1 -1
  520. package/views/webgl/ShaderTranspiler.js +1 -1
  521. package/views/webgl/Texture.js +1 -1
  522. package/views/webgl/UniformBufferLayout.js +5 -0
  523. package/views/webgl/UniformBufferObject.js +5 -0
  524. package/views/webgl/Util.js +1 -1
  525. package/views/webgl/enums.js +1 -1
  526. package/views/webgl/rasterUtils.js +1 -1
  527. package/views/webgl/storageLayouts.js +5 -0
  528. package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
  529. package/views/webgl/testFloatBufferBlend.js +1 -1
  530. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  531. package/views/webgl/testSamplerPrecision.js +1 -1
  532. package/views/webgl/tests/SimpleDraw.js +1 -1
  533. package/widgets/BasemapLayerList.js +1 -1
  534. package/widgets/BuildingExplorer/BuildingDisciplinesViewModel.js +1 -1
  535. package/widgets/Editor/BatchCreateWorkflow.js +1 -1
  536. package/widgets/Editor/CreateWorkflow.js +1 -1
  537. package/widgets/Editor/UpdateWorkflow.js +1 -1
  538. package/widgets/Editor/workflowUtils.js +1 -1
  539. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  540. package/widgets/ElevationProfile.js +1 -1
  541. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  542. package/widgets/Feature/FeatureExpression.js +1 -1
  543. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  544. package/widgets/Feature/FeatureMedia.js +1 -1
  545. package/widgets/Feature/FeatureViewModel.js +1 -1
  546. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  547. package/widgets/FeatureForm/InputField.js +1 -1
  548. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  549. package/widgets/FeatureForm.js +1 -1
  550. package/widgets/FeatureTemplates.js +1 -1
  551. package/widgets/FloorFilter.js +1 -1
  552. package/widgets/LayerList/LayerListViewModel.js +1 -1
  553. package/widgets/LayerList/ListItemPanel.js +1 -1
  554. package/widgets/LayerList/support/layerListUtils.js +1 -1
  555. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  556. package/widgets/Popup.js +1 -1
  557. package/widgets/Print.js +1 -1
  558. package/widgets/Search.js +1 -1
  559. package/widgets/Sketch/SketchViewModel.js +1 -1
  560. package/widgets/Weather/CoverageSlider.js +5 -0
  561. package/widgets/Weather/WeatherViewModel.js +1 -1
  562. package/widgets/Weather/css.js +1 -1
  563. package/widgets/Weather.js +1 -1
  564. package/widgets/support/geolocationUtils.js +1 -1
  565. package/assets/esri/core/workers/chunks/0881ce46b10362861f87.js +0 -1
  566. package/assets/esri/core/workers/chunks/0c0a02770eeeb3e28ea1.js +0 -1
  567. package/assets/esri/core/workers/chunks/0d2effbd84a9482eb639.js +0 -1
  568. package/assets/esri/core/workers/chunks/0f04246c1b591a3ac74d.js +0 -1
  569. package/assets/esri/core/workers/chunks/1ac6be0dc25e16c75d06.js +0 -1
  570. package/assets/esri/core/workers/chunks/1f8110ea12d65ca94b55.js +0 -1
  571. package/assets/esri/core/workers/chunks/2025d0fd61a64876c81b.js +0 -1
  572. package/assets/esri/core/workers/chunks/241859d74c0daac62e11.js +0 -1
  573. package/assets/esri/core/workers/chunks/2c9af2ebd72d9b55329b.js +0 -1
  574. package/assets/esri/core/workers/chunks/331be347c1b1ca0be2d2.js +0 -1
  575. package/assets/esri/core/workers/chunks/39af317388ecebb4387d.js +0 -1
  576. package/assets/esri/core/workers/chunks/39be2893a7dbdecfd65a.js +0 -1
  577. package/assets/esri/core/workers/chunks/3a20f66b0b7d08064e34.js +0 -1
  578. package/assets/esri/core/workers/chunks/445099d037affd139ed0.js +0 -1
  579. package/assets/esri/core/workers/chunks/45848fecec88ed2da33d.js +0 -1
  580. package/assets/esri/core/workers/chunks/48d3a3abc53abe6a4017.js +0 -1
  581. package/assets/esri/core/workers/chunks/5005b8c1fdd5cb9a4c19.js +0 -1
  582. package/assets/esri/core/workers/chunks/52e4c367c72ea7cc3457.js +0 -1
  583. package/assets/esri/core/workers/chunks/5d8170f6207dbeb4de1b.js +0 -1
  584. package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
  585. package/assets/esri/core/workers/chunks/642c38ac00a962f35d44.js +0 -1
  586. package/assets/esri/core/workers/chunks/64459604505647e9c714.js +0 -1
  587. package/assets/esri/core/workers/chunks/653d1550dd1a4867a9fc.js +0 -1
  588. package/assets/esri/core/workers/chunks/65f73fbbc3c7c60c6d3d.js +0 -1
  589. package/assets/esri/core/workers/chunks/6db7081d344bea26ef64.js +0 -1
  590. package/assets/esri/core/workers/chunks/6deac533bb455be4004b.js +0 -1
  591. package/assets/esri/core/workers/chunks/6e13dab8ec43f7494297.js +0 -1
  592. package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
  593. package/assets/esri/core/workers/chunks/7bd4c3ee43fb038b88d8.js +0 -1
  594. package/assets/esri/core/workers/chunks/803de5097a8a2c4b58a8.js +0 -1
  595. package/assets/esri/core/workers/chunks/8298231a0fd0129b0d5c.js +0 -1
  596. package/assets/esri/core/workers/chunks/8500c6c011400af1b7bd.js +0 -1
  597. package/assets/esri/core/workers/chunks/8b322a2a47dfdbb59b45.js +0 -1
  598. package/assets/esri/core/workers/chunks/8f83bebef9174c3f15da.js +0 -1
  599. package/assets/esri/core/workers/chunks/904332faa22bc0e876cb.js +0 -1
  600. package/assets/esri/core/workers/chunks/950565d1e682fc4072e1.js +0 -1
  601. package/assets/esri/core/workers/chunks/9846098704ee38bf6350.js +0 -1
  602. package/assets/esri/core/workers/chunks/a247ddd84245c81112c8.js +0 -1
  603. package/assets/esri/core/workers/chunks/a721342a32541717324d.js +0 -1
  604. package/assets/esri/core/workers/chunks/a9ffa806df20130ecfb6.js +0 -1
  605. package/assets/esri/core/workers/chunks/af13e534e4160636bd3d.js +0 -1
  606. package/assets/esri/core/workers/chunks/b2f62234ebb8b6158baa.js +0 -1
  607. package/assets/esri/core/workers/chunks/b51261a9a9ab62388839.js +0 -971
  608. package/assets/esri/core/workers/chunks/b58eba403bd517a7bb15.js +0 -1
  609. package/assets/esri/core/workers/chunks/b5bb7cfa26b1f0cec67a.js +0 -1
  610. package/assets/esri/core/workers/chunks/b8666d1a4e4fff7a4703.js +0 -1
  611. package/assets/esri/core/workers/chunks/bea1da9e3f878e0e2c83.js +0 -1
  612. package/assets/esri/core/workers/chunks/c1b6c31fa3ec1542f996.js +0 -1
  613. package/assets/esri/core/workers/chunks/c32a4fbdc87225f84019.js +0 -1
  614. package/assets/esri/core/workers/chunks/c67fea81f69a60c0eaef.js +0 -1
  615. package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
  616. package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
  617. package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
  618. package/assets/esri/core/workers/chunks/d336afd5890dcdbf5341.js +0 -1
  619. package/assets/esri/core/workers/chunks/da69e3e5949fe1716e34.js +0 -1
  620. package/assets/esri/core/workers/chunks/daa9c450b2e2a5371249.js +0 -1
  621. package/assets/esri/core/workers/chunks/dd63ba77b7e4c3c9c594.js +0 -1
  622. package/assets/esri/core/workers/chunks/dfa57982d28c9aeb97b9.js +0 -1
  623. package/assets/esri/core/workers/chunks/e01812116b27874948f0.js +0 -1
  624. package/assets/esri/core/workers/chunks/e5c9d8482b913cf3580a.js +0 -1
  625. package/assets/esri/core/workers/chunks/eeadd92f0bede9fc8745.js +0 -1
  626. package/assets/esri/core/workers/chunks/fbb67cb6224aed2cce16.js +0 -1
  627. package/assets/esri/core/workers/chunks/feeaf61424336e9eac88.js +0 -1
  628. package/assets/esri/core/workers/chunks/ff02295329a8986d0568.js +0 -1
  629. package/tasks/operations/identify.js +0 -5
  630. package/views/2d/engine/webgl/mesh/templates/meshUtils.js +0 -5
  631. package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +0 -5
  632. package/views/3d/layers/graphics/Graphics3DGraphicLikeLayerView.js +0 -5
@@ -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 r from"../core/CollectionFlattener.js";import i from"../core/Error.js";import{HandleOwner as t}from"../core/HandleOwner.js";import a from"../core/Logger.js";import{someMap as s}from"../core/MapUtils.js";import{isNone as o,isSome as l,removeMaybe as n}from"../core/maybe.js";import{createDeferred as y,isAbortError as h,onAbort as p,throwIfAborted as w}from"../core/promiseUtils.js";import{schedule as c}from"../core/scheduling.js";import{on as d,init as m}from"../core/watchUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as v}from"./support/WatchUpdatingTracking.js";const _=a.getLogger("esri.views.LayerViewManager");class g{constructor(e,r,t){this.layer=e,this.view=r,this.layerViewImporter=t,this._controller=new AbortController,this._deferred=y(),this._started=!1,this.done=!1,p(this._controller.signal,(()=>{const r=new i("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(r)}))}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:r,view:i}=this;r.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:r,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:t}=this;this._map=t.map;try{var a,s;let l,y;if(await r.load({signal:e}),"prefetchResources"in r&&await r.prefetchResources({signal:e}),r.createLayerView)l=await r.createLayerView(t,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new i("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(r);w(e),l="default"in a?new a.default({layer:r,view:t}):new a({layer:r,view:t})}const h=()=>{y=n(y),l.destroyed||l.destroy(),l.layer=null,l.parent=null,l.view=null,this.done=!0};y=p(e,h),w(e);try{await l.when()}catch(o){throw h(),o}if(!(null==(a=this._map)||null==(s=a.allLayers)?void 0:s.includes(r)))return h(),void this._deferred.reject(new i("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=l,r.emit("layerview-create",{view:t,layerView:l}),t.emit("layerview-create",{layer:r,layerView:l}),this.done=!0,this._deferred.resolve(l)}catch(o){r.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:r,error:o}),this.done=!0,this._deferred.reject(new i("layerview:create-error","layerview creation failed",{layer:r,error:o}))}}}let V=class extends t{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new v,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var e;const r=null==(e=this.view.map)?void 0:e.allLayers;if(r)for(const i of r)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>(o(this._workPromise)&&(this._workPromise=y()),this.handles.remove("reschedule"),this.handles.add(c(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var e,i,t;const a=this.view.map;if(this._map!==a&&(this.clear(),this._map=a),o(this._workPromise))return void this.notifyChange("updating");this.handles.remove("reschedule"),this.handles.remove("collection-change");const s=new r({getCollections:()=>this._rootCollectionNames.map((e=>this.get(e))),getChildrenFunction:e=>e&&"layers"in e?e.layers:null});if(!s)return this._workPromise.resolve(),void(this._workPromise=null);for(const r of s)this._createLayerView(r);this._refreshCollections();for(const[r,o]of this._layerLayerViewInfoMap)s.includes(r)||(this._layerLayerViewInfoMap.delete(o.layer),o.destroy());const l=s.filter((e=>"group"===e.type)).map((e=>e.layers)),n=[null==a||null==(e=a.ground)?void 0:e.layers,null==a||null==(i=a.basemap)?void 0:i.baseLayers,null==a||null==(t=a.basemap)?void 0:t.referenceLayers,null==a?void 0:a.layers,...l].filter((e=>!!e));this.handles.add(n.map((e=>this._watchUpdatingTracking.addOnCollectionChange(e,this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.handles.add([d(this,"view.map.allLayers","change",this._preloadLayerViewModules,this._preloadLayerViewModules),m(this.view,["map.basemap","map.ground","map.layers","ready"],this._reschedule,!0)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return l(this._workPromise)||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let t=0;for(const a of e){const e=this._layerLayerViewInfoMap.get(a);if(!e||!e.layerView)continue;const s=e.layerView;s.layer=a,s.parent=i,r.getItemAt(t)!==s&&r.splice(t,0,s),a.layers&&this._populateLayerViewsOwners(a.layers,s.layerViews,s),t+=1}t<r.length&&r.splice(t,r.length)}_createLayerView(e){if(this._layerLayerViewInfoMap.has(e))return this.view.ready&&this._layerLayerViewInfoMap.get(e).start(),this.notifyChange("updating"),void this.notifyChange("updatingRemaining");e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new g(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{var i,t;r&&(h(r)||"cancelled:layerview-create"===r.name)||_.error(`Failed to create layerview for layer title:'${null!=(i=e.title)?i:"no title"}', id:'${null!=(t=e.id)?t:"no id"}' of type '${e.type}'.`,{layer:e,error:r});this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([u()],V.prototype,"_workPromise",void 0),e([u({readOnly:!0})],V.prototype,"_watchUpdatingTracking",void 0),e([u({readOnly:!0})],V.prototype,"_layersToLayerViews",null),e([u({readOnly:!0})],V.prototype,"_rootCollectionNames",null),e([u()],V.prototype,"layerViewImporter",void 0),e([u()],V.prototype,"supportsGround",void 0),e([u({readOnly:!0})],V.prototype,"updating",null),e([u({readOnly:!0})],V.prototype,"updatingRemaining",null),e([u({constructOnly:!0})],V.prototype,"view",void 0),V=e([f("esri.views.LayerViewManager")],V);const L=V;export{L as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/CollectionFlattener.js";import i from"../core/Error.js";import{HandleOwner as t}from"../core/HandleOwner.js";import a from"../core/Logger.js";import{someMap as s}from"../core/MapUtils.js";import{isNone as o,isSome as l,removeMaybe as n}from"../core/maybe.js";import{createDeferred as y,isAbortError as h,onAbort as p,throwIfAborted as w}from"../core/promiseUtils.js";import{schedule as c}from"../core/scheduling.js";import{on as d,init as m}from"../core/watchUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as v}from"./support/WatchUpdatingTracking.js";const _=a.getLogger("esri.views.LayerViewManager");class g{constructor(e,r,t){this.layer=e,this.view=r,this.layerViewImporter=t,this._controller=new AbortController,this._deferred=y(),this._started=!1,this.done=!1,p(this._controller.signal,(()=>{const r=new i("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(r)}))}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:r,view:i}=this;r.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:r,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:t}=this;this._map=t.map;try{var a,s;let l,y;if(await r.load({signal:e}),"prefetchResources"in r&&await r.prefetchResources({signal:e}),r.createLayerView)l=await r.createLayerView(t,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new i("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(r);w(e),l="default"in a?new a.default({layer:r,view:t}):new a({layer:r,view:t})}const h=()=>{y=n(y),l.destroyed||l.destroy(),l.layer=null,l.parent=null,l.view=null,this.done=!0};y=p(e,h),w(e);try{await l.when()}catch(o){throw h(),o}if(!(null==(a=this._map)||null==(s=a.allLayers)?void 0:s.includes(r)))return h(),void this._deferred.reject(new i("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=l,r.emit("layerview-create",{view:t,layerView:l}),t.emit("layerview-create",{layer:r,layerView:l}),this.done=!0,this._deferred.resolve(l)}catch(o){r.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:r,error:o}),this.done=!0,this._deferred.reject(new i("layerview:create-error","layerview creation failed",{layer:r,error:o}))}}}let V=class extends t{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new v,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var e;const r=null==(e=this.view.map)?void 0:e.allLayers;if(r)for(const i of r)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>(o(this._workPromise)&&(this._workPromise=y()),this.handles.remove("reschedule"),this.handles.add(c(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var e,i,t;const a=this.view.map;if(this._map!==a&&(this.clear(),this._map=a),o(this._workPromise))return void this.notifyChange("updating");this.handles.remove("reschedule"),this.handles.remove("collection-change");const s=new r({getCollections:()=>this._rootCollectionNames.map((e=>this.get(e))),getChildrenFunction:e=>e&&"layers"in e?e.layers:null});if(!s)return this._workPromise.resolve(),void(this._workPromise=null);for(const r of s)this._createLayerView(r);this._refreshCollections();for(const[r,o]of this._layerLayerViewInfoMap)s.includes(r)||(this._layerLayerViewInfoMap.delete(o.layer),o.destroy());const l=s.filter((e=>"group"===e.type)).map((e=>e.layers)),n=[null==a||null==(e=a.ground)?void 0:e.layers,null==a||null==(i=a.basemap)?void 0:i.baseLayers,null==a||null==(t=a.basemap)?void 0:t.referenceLayers,null==a?void 0:a.layers,...l].filter((e=>!!e));this.handles.add(n.map((e=>this._watchUpdatingTracking.addOnCollectionChange((()=>e),this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.handles.add([d(this,"view.map.allLayers","change",this._preloadLayerViewModules,this._preloadLayerViewModules),m(this.view,["map.basemap","map.ground","map.layers","ready"],this._reschedule,!0)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return l(this._workPromise)||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let t=0;for(const a of e){const e=this._layerLayerViewInfoMap.get(a);if(!e||!e.layerView)continue;const s=e.layerView;s.layer=a,s.parent=i,r.getItemAt(t)!==s&&r.splice(t,0,s),a.layers&&this._populateLayerViewsOwners(a.layers,s.layerViews,s),t+=1}t<r.length&&r.splice(t,r.length)}_createLayerView(e){if(this._layerLayerViewInfoMap.has(e))return this.view.ready&&this._layerLayerViewInfoMap.get(e).start(),this.notifyChange("updating"),void this.notifyChange("updatingRemaining");e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new g(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{var i,t;r&&(h(r)||"cancelled:layerview-create"===r.name)||_.error(`Failed to create layerview for layer title:'${null!=(i=e.title)?i:"no title"}', id:'${null!=(t=e.id)?t:"no id"}' of type '${e.type}'.`,{layer:e,error:r});this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([u()],V.prototype,"_workPromise",void 0),e([u({readOnly:!0})],V.prototype,"_watchUpdatingTracking",void 0),e([u({readOnly:!0})],V.prototype,"_layersToLayerViews",null),e([u({readOnly:!0})],V.prototype,"_rootCollectionNames",null),e([u()],V.prototype,"layerViewImporter",void 0),e([u()],V.prototype,"supportsGround",void 0),e([u({readOnly:!0})],V.prototype,"updating",null),e([u({readOnly:!0})],V.prototype,"updatingRemaining",null),e([u({constructOnly:!0})],V.prototype,"view",void 0),V=e([f("esri.views.LayerViewManager")],V);const L=V;export{L as default};
package/views/MapView.js CHANGED
@@ -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"../Viewpoint.js";import s from"../core/Collection.js";import n from"../core/CollectionFlattener.js";import r from"../core/Error.js";import a from"../core/has.js";import{isIterable as o}from"../core/iteratorUtils.js";import l from"../core/Logger.js";import{isSome as h,isNone as p,unwrap as d}from"../core/maybe.js";import{throwIfAborted as u}from"../core/promiseUtils.js";import{watch as c,whenOnce as m,sync as g,syncAndInitial as y}from"../core/reactiveUtils.js";import{createScreenPoint as w}from"../core/screenUtils.js";import{initialize as f}from"../core/workers/workers.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import V from"../geometry/Extent.js";import T from"../geometry/Point.js";import{canProject as b,project as S}from"../geometry/support/webMercatorUtils.js";import M from"../layers/support/TileInfo.js";import{BreakpointsOwner as x}from"./BreakpointsOwner.js";import{DOMContainer as O}from"./DOMContainer.js";import{PopupView as j}from"./PopupView.js";import z from"./View.js";import R from"./ViewAnimation.js";import k from"./2d/AnimationManager.js";import L from"./2d/FrameTask.js";import{layerView2DImporter as E}from"./2d/layerViewModuleImportUtils.js";import C from"./2d/MapViewConstraints.js";import G from"./2d/PaddedViewState.js";import"./2d/tiling/PagedTileQueue.js";import I from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{centerAt as N,setExtent as P,rotateTo as q,scaleTo as D,copy as U,createAsync as A,extentToScale as W,resize as $}from"./2d/viewpointUtils.js";import F from"./2d/input/MapViewInputManager.js";import H from"./2d/layers/features/support/TileStore.js";import J from"./2d/support/HighlightOptions.js";import{Timeline as B}from"./2d/support/Timeline.js";import Q from"./support/createScreenshotPlan.js";import{getMaximumResolutionScale as Z,getFormatAndQuality as K}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as X,createScreenPointFromSupportedEvent as Y}from"./support/screenUtils.js";import{check as tt}from"./support/WebGLRequirements.js";import et from"./ui/2d/DefaultUI2D.js";import it from"../webmap/background/ColorBackground.js";const st=l.getLogger("esri.views.MapView");let nt,rt,at,ot,lt,ht;async function pt(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:s,MagnifierView2D:n,Stage:r}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);rt=t,at=e,ot=i,lt=s,ht=n,nt=r}const dt=160;function ut(t){return t&&"esri.Viewpoint"===t.declaredClass}let ct=class extends(x(O(j(z)))){constructor(t){super(t),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new n({getCollections:()=>{var t,e;return[null==(t=this.basemapView)?void 0:t.baseLayerViews,this.layerViews,null==(e=this.basemapView)?void 0:e.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new L(this),this.floors=new s,this.highlightOptions=new J,this.inputManager=new F({view:this}),this.map=null,this.resizeAlign="center",this.timeline=new B,this.type="2d",this.ui=new et,this.constraints=new C,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([c((()=>this.viewpoint),(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(dt)}),g),this.on("resize",(t=>this._resizeHandler(t))),c((()=>{var t;return null==(t=this.animationManager)?void 0:t.animation}),(t=>{this.animation=t}))]),f()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new H(this.featuresTilingScheme)}get initialExtentRequired(){var t;const{scale:e,constraints:i,spatialReference:s}=this,n=this._normalizeInput(this.center,s),r=this._normalizeInput(this.viewpoint,s),a=this._normalizeInput(this.extent,s);let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&null!=(t=this.map.initialViewProperties)&&t.viewpoint)&&(!a&&(i.effectiveLODs||(o=-1),(!n||0===e&&-1===o)&&(!r||!h(r.targetGeometry)||"extent"!==r.targetGeometry.type&&!r.scale)))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1}}}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t),this.frameTask.animationInProgress=!0;const i=()=>{t===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};t.when(i,i)}get background(){return this.get("map.initialViewProperties.background")||null}set background(t){void 0===t?this._clearOverride("background"):this._override("background",t)}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return new T({x:t[0],y:t[1],spatialReference:e})}set center(t){if(null==t)return;if(!this._normalizeInput(t,this.spatialReference))return void st.error("#center",`incompatible spatialReference ${JSON.stringify(t.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`);if(!this.ready)return this._set("center",t),void this.notifyChange("initialExtentRequired");const e=this.viewpoint;N(e,e,t),this.viewpoint=e}set constraints(t){const e=this._get("constraints");e&&(this.handles.remove("map-view-constraints"),e.destroy()),this._set("constraints",t),t&&(t.view=this,this.ready&&(this.state.viewpoint=t.fit(this.state.paddedViewState.viewpoint)),this.handles.add(t.on("update",(()=>{this.ready&&this.state&&(this.state.viewpoint=t.fit(this.state.paddedViewState.viewpoint))})),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(t){if(null==t)return;const e=this._normalizeInput(t,this.spatialReference);if(!e)return void st.error("#center",`incompatible spatialReference ${JSON.stringify(t.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`);if(!e.width||!e.height)return void st.error("#extent","invalid extent size");if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");const i=this.viewpoint;P(i,i,e,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;q(e,e,t),this.viewpoint=e}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",-1);const e=this._get("extent");return e&&(this._set("extent",null),this._set("center",e.center)),void this.notifyChange("initialExtentRequired")}const e=this.viewpoint;D(e,e,t),this.viewpoint=e}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){return!this.destroyed&&(!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((t=>!t.destroyed&&!("layerViews"in t)&&!0===t.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const t=this.state.paddedViewState;return t&&t.viewpoint.clone()}set viewpoint(t){if(null==t)return;const e=this._normalizeInput(t,this.spatialReference);if(!e)return void(!t.scale||isNaN(t.scale)?st.error("#viewpoint",`invalid scale value of ${t.scale}`):p(t.targetGeometry)?st.error("#viewpoint","geometry not defined"):st.error("#viewpoint",`incompatible spatialReference ${JSON.stringify(t.targetGeometry.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`));if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");const s=new i({targetGeometry:new T,scale:0,rotation:0});U(s,e),this.constraints.constrain(s,this.state.paddedViewState.viewpoint),this.state.viewpoint=s,this.frameTask.requestFrame(),this._set("viewpoint",s)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(t){if(null==t)return;if(!this.ready){this.notifyChange("initialExtentRequired"),this._set("zoom",t),this._set("scale",0);const e=this._get("extent");e&&(this._set("extent",null),this._set("center",e.center))}if(!this.constraints.effectiveLODs)return;const e=this.viewpoint;D(e,e,this.constraints.zoomToScale(t)),this.viewpoint=e,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(t,e){if(t)return this.animation&&(this.animation=null),this._createAnimation(),m((()=>this.ready),e).then((()=>{const i={animate:!0,...e},s=A(t,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));st.error("#goTo()","target cannot be null or undefined")}async hitTest(t,e){const i=X(t)?Y(this,t):t;if(!this.ready||isNaN(i.x)||isNaN(i.y))return{screenPoint:i,results:[]};let s=new Set,n=!1,r=null,a=null;null!=e&&e.include?wt(e.include,yt(this,(t=>s.add(t)),(t=>{r||(r=new Set),r.add(t)}),(t=>s.add(t)),(()=>n=!0))):(n=!0,s=new Set(this.allLayerViews)),null!=e&&e.exclude&&wt(e.exclude,yt(this,(t=>s.delete(t)),(t=>{a||(a=new Set),a.add(t)})));const o=this.allLayerViews.filter((t=>!t.suspended&&s.has(t))).reverse(),l=this.toMap(i);let p=(await Promise.all([n?this.graphicsView.hitTest(l):null,...o.map((t=>t.hitTest(l,i)))])).filter(h).flat();return r&&(p=p.filter((t=>r.has(gt(t))))),a&&(p=p.filter((t=>!a.has(gt(t))))),{screenPoint:i,results:p.map((t=>({mapPoint:l,graphic:t})))}}takeScreenshot(t){t=t||{};const e=this.supersampleScreenshotsEnabled?Math.min(4,Z(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let i;t.layers?(i=[],t.layers.forEach((t=>{const e=this.allLayerViews.find((e=>e.layer.id===t.id));e&&"container"in e&&e.container&&i.push(e.container)}))):i=this._stage.children;const{format:s,quality:n}=K(t.format,t.quality),r=Q(t,e,this.size,this.padding,s,n,i,t.rotation);return this._stage.takeScreenshot(r)}toMap(t){if(!this.ready)return null;const e=X(t)?Y(this,t):t,i=[0,0],[s,n]=this.state.toMap(i,[e.x,e.y]),r=this.spatialReference;return new T({x:s,y:n,spatialReference:r})}toScreen(t){if(!this.ready)return null;const e=this._normalizeInput(t,this.spatialReference),i=[e.x,e.y];return this.state.toScreen(i,i),w(i[0],i[1])}on(t,e,i,s){const n=this.inputManager&&this.viewEvents.on(t,e,i,s);return n||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}whenLayerView(t){return super.whenLayerView(t)}graphicChanged(t){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(t)}}whenReady(){return new Promise((t=>{this.ready?t(this):this._resolveWhenReady.push(t)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var t,e,i;return this.map&&"initialViewProperties"in this.map&&(null==(t=this.map)||null==(e=t.initialViewProperties)?void 0:e.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||null}getSpatialReferenceSupport({layer:t}){return t||this._get("ready")||null!==this._getDefaultViewpoint()?{}:null}hasLayerViewModule(t){return E.hasLayerViewModule(t)}importLayerView(t){return E.importLayerView(t)}pixelSizeAt(){return this.ready?this.state.resolution:(st.error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(t){return this.hitTest(t).then((e=>({...e,mapPoint:this.toMap(t)})))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let t=tt(this.type);return a("safari")&&a("safari")<9&&(t=new r("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:a("safari")})),h(t)?(st.warn("#validate()",t.message),Promise.reject(t)):pt()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new R),this.animation}_cancellableGoTo(t,e,i){const s=()=>t===this._gotoTask,n=i.then((()=>{s()&&(this.animation=null)})).catch((t=>{throw s()&&(this.animation=null,e.done||(e.stop(),this.frameTask.animationInProgress=!1)),t})),r=new Promise((t=>t(n)));return e.when().catch((()=>{s()&&r.cancel&&r.cancel()})),r}_gotoImmediate(t,e){const i=this._gotoTask,s=this.animation,n=t.then((t=>{if(u(e),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=t,s.finish()}));return this._cancellableGoTo(i,s,n)}_flipStationary(t){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const t=performance.now()-this._lastStationaryEventTimestamp;t<dt&&(this._stationaryTimer=this._flipStationary(t))}),t)),this._stationaryTimer}_getDefaultViewpoint(){var t,e,s,n;const{constraints:r,spatialReference:a}=this,o=this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties,l={zoom:this._get("zoom"),scale:this._get("scale"),center:this._normalizeInput(this._get("center"),a),extent:this._normalizeInput(this._get("extent"),a),rotation:this._get("rotation"),viewpoint:this._normalizeInput(this._get("viewpoint"),a),spatialReference:this._userSpatialReference};r.effectiveLODs?-1!==l.zoom&&(l.scale=r.zoomToScale(l.zoom)):l.zoom=-1;let p=null,u=null,c=0;const m=l.viewpoint&&l.viewpoint.rotation,g=l.viewpoint&&l.viewpoint.targetGeometry;h(g)&&("extent"===g.type?p=g:"point"===g.type&&(u=g,c=l.viewpoint.scale));const y=this._normalizeInput(null==(t=d(null==o||null==(e=o.viewpoint)?void 0:e.targetGeometry))?void 0:t.extent,a),w=this._normalizeInput(this.initialExtent,a),f=l.extent||p||y||w,v=l.center||u||f&&f.center,_=null==o||null==(s=o.viewpoint)?void 0:s.scale,V=l.scale||c||_||f&&W(f,this.size),T=null==o||null==(n=o.viewpoint)?void 0:n.rotation,b=l.rotation||m||T||0;return v&&V?new i({targetGeometry:v,scale:V,rotation:b}):null}_gotoAnimated(t,e){const i=this._gotoTask,s=this.animation,n=t.then((t=>{if(u(e),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");return s.update(t),this.animationManager.animate(s,this.viewpoint,e),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,n)}_normalizeInput(t,e){const i=t&&t.targetGeometry||t;return e?i?e.equals(i.spatialReference)?t:b(i,e)?ut(t)?(t.targetGeometry=S(i,e),t):S(i,e):null:null:t}_resizeHandler(t){const e=this.state;if(!e)return;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();e.size=[t.width,t.height],$(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){this.timeline.begin("MapView Startup");const t=this._getDefaultViewpoint();this.constraints.view=this,this.constraints.fit(t),this._set("animationManager",new k({view:this})),this._set("state",new G({padding:this._get("padding"),size:this.size,viewpoint:t})),this._set("featuresTilingScheme",new I(M.create({spatialReference:this.spatialReference,size:512,numLODs:36}))),this._set("ready",!0),this.frameTask&&this.frameTask.start(),this.graphics.owner=this;const e={disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},i=new nt(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:e,renderingOptions:this.renderingOptions,timeline:this.timeline}),s=new rt({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new at(this.featuresTilingScheme)}),n=new lt({view:this,animationManager:this.animationManager}),r=new ot({view:this});this._magnifierView=new ht,this._magnifierView.magnifier=this.magnifier,this._stage=i,this.frameTask.graphicsView=s,this._set("graphicsView",s),this._set("mapViewNavigation",n),this._set("labelManager",r),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),i.on("post-render",(()=>this._set("rendering",i.renderRequested))),i.on("will-render",(()=>this._set("rendering",i.renderRequested))),i.on("webgl-error",(t=>this.fatalError=t.error)),c((()=>this.stationary),(t=>i.stationary=t),y),c((()=>this.state.id),(()=>i.state=this.state),y),c((()=>this.background),(t=>{i.background=t,this._magnifierView.background=t}),y),c((()=>this.magnifier),(t=>this._magnifierView.magnifier=t),y),c((()=>this.renderingOptions),(t=>i.renderingOptions=t),y),c((()=>this.highlightOptions),(t=>i.highlightOptions=t),y)],"map-view"),i.state=this.state,this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((t=>t(this))),this.timeline.end("MapView Startup")}_teardown(){this.handles.remove("map-view"),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy();this.graphicsView.destroy(),this.mapViewNavigation.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask&&this.frameTask.stop(),this._set("ready",!1),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null);const{center:[t,e],spatialReference:i,rotation:s,scale:n}=this.state.paddedViewState,r=new T({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",r),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("spatialReference",i),this.constraints.view=null,this.animationManager.destroy(),this._set("animationManager",null),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((t=>{this._stage.addChild(t.container)}));const t=this.graphicsView;this._stage.addChild(t.container),this._stage.addChild(this._magnifierView)}};t([v({readOnly:!0})],ct.prototype,"animationManager",void 0),t([v({constructOnly:!0})],ct.prototype,"deactivatedWebGLExtensions",void 0),t([v({constructOnly:!0})],ct.prototype,"debugWebGLExtensions",void 0),t([v({readOnly:!0})],ct.prototype,"featuresTilingScheme",void 0),t([v({readOnly:!0})],ct.prototype,"fullOpacity",void 0),t([v({readOnly:!0})],ct.prototype,"graphicsTileStore",null),t([v()],ct.prototype,"graphicsView",void 0),t([v({readOnly:!0})],ct.prototype,"state",void 0),t([v()],ct.prototype,"initialExtentRequired",null),t([v()],ct.prototype,"labelManager",void 0),t([v({readOnly:!0})],ct.prototype,"resourceManager",null),t([v({readOnly:!0})],ct.prototype,"textureManager",null),t([v({readOnly:!0})],ct.prototype,"mapViewNavigation",void 0),t([v({constructOnly:!0})],ct.prototype,"renderCanvas",void 0),t([v()],ct.prototype,"renderingOptions",void 0),t([v({readOnly:!0})],ct.prototype,"rendering",void 0),t([v({constructOnly:!0})],ct.prototype,"supersampleScreenshotsEnabled",void 0),t([v({readOnly:!0})],ct.prototype,"supportsGround",void 0),t([v()],ct.prototype,"_stationaryTimer",void 0),t([v()],ct.prototype,"_defaultsFromMapSettings",null),t([v()],ct.prototype,"animation",null),t([v({type:it})],ct.prototype,"background",null),t([v({value:null,type:T,dependsOn:["state.id","ready"]})],ct.prototype,"center",null),t([v({type:C})],ct.prototype,"constraints",null),t([v({value:null,type:V,dependsOn:["state.id","ready"]})],ct.prototype,"extent",null),t([v()],ct.prototype,"floors",void 0),t([v({type:J})],ct.prototype,"highlightOptions",void 0),t([v({readOnly:!0})],ct.prototype,"inputManager",void 0),t([v()],ct.prototype,"map",void 0),t([v({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],ct.prototype,"padding",null),t([v()],ct.prototype,"resizeAlign",void 0),t([v({readOnly:!0,dependsOn:["state.id"]})],ct.prototype,"resolution",null),t([v({value:0,type:Number,dependsOn:["state.id","ready"]})],ct.prototype,"rotation",null),t([v({value:0,type:Number,dependsOn:["state.id","ready"]})],ct.prototype,"scale",null),t([v()],ct.prototype,"stationary",null),t([v({type:B,readOnly:!0})],ct.prototype,"timeline",void 0),t([v({readOnly:!0})],ct.prototype,"type",void 0),t([v({readOnly:!0})],ct.prototype,"updating",null),t([v({value:null,type:i,dependsOn:["state.id","ready"]})],ct.prototype,"viewpoint",null),t([v({value:-1,dependsOn:["state.id"]})],ct.prototype,"zoom",null),t([v({type:Boolean})],ct.prototype,"navigating",null),t([v({type:et})],ct.prototype,"ui",void 0),ct=t([_("esri.views.MapView")],ct);const mt=ct;function gt(t){const e=t.getObjectId();var i,s,n,r;return e?`${null!=(i=null!=(s=null==(n=t.layer)?void 0:n.uid)?s:null==(r=t.sourceLayer)?void 0:r.uid)?i:"MapView"}/${e}`:`"MapView/${t.uid}`}function yt(t,i,s,n,r){return a=>{if(a instanceof e){if(a.layer===t)null==r||r();else{const e=t.allLayerViews.find((t=>t.layer===a.layer));e&&(null==n||n(e))}s(gt(a))}else{const e=t.allLayerViews.find((t=>t.layer===a));e&&i(e)}}}function wt(t,e){if(t)if(o(t))for(const i of t)if(o(i))for(const t of i)e(t);else e(i);else e(t)}export{mt as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import e from"../Graphic.js";import i from"../Viewpoint.js";import s from"../core/Collection.js";import n from"../core/CollectionFlattener.js";import r from"../core/Error.js";import a from"../core/has.js";import{isIterable as o}from"../core/iteratorUtils.js";import l from"../core/Logger.js";import{isSome as h,isNone as p,unwrap as d}from"../core/maybe.js";import{throwIfAborted as u}from"../core/promiseUtils.js";import{watch as c,whenOnce as m,sync as g,syncAndInitial as y}from"../core/reactiveUtils.js";import{createScreenPoint as w}from"../core/screenUtils.js";import{initialize as f}from"../core/workers/workers.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import V from"../geometry/Extent.js";import T from"../geometry/Point.js";import{canProject as b,project as S}from"../geometry/support/webMercatorUtils.js";import M from"../layers/support/TileInfo.js";import{BreakpointsOwner as x}from"./BreakpointsOwner.js";import{DOMContainer as O}from"./DOMContainer.js";import{PopupView as R}from"./PopupView.js";import j from"./View.js";import z from"./ViewAnimation.js";import k from"./2d/AnimationManager.js";import L from"./2d/FrameTask.js";import{layerView2DImporter as E}from"./2d/layerViewModuleImportUtils.js";import C from"./2d/MapViewConstraints.js";import G from"./2d/PaddedViewState.js";import"./2d/tiling/PagedTileQueue.js";import I from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{centerAt as N,setExtent as P,rotateTo as q,scaleTo as D,copy as U,createAsync as A,extentToScale as W,resize as $}from"./2d/viewpointUtils.js";import F from"./2d/input/MapViewInputManager.js";import H from"./2d/layers/features/support/TileStore.js";import J from"./2d/support/HighlightOptions.js";import{Timeline as B}from"./2d/support/Timeline.js";import Q from"./support/createScreenshotPlan.js";import{getMaximumResolutionScale as Z,getFormatAndQuality as K}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as X,createScreenPointFromSupportedEvent as Y}from"./support/screenUtils.js";import{check as tt}from"./support/WebGLRequirements.js";import et from"./ui/2d/DefaultUI2D.js";import it from"../webmap/background/ColorBackground.js";const st=l.getLogger("esri.views.MapView");let nt,rt,at,ot,lt,ht;async function pt(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:s,MagnifierView2D:n,Stage:r}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);rt=t,at=e,ot=i,lt=s,ht=n,nt=r}const dt=160;function ut(t){return t&&"esri.Viewpoint"===t.declaredClass}let ct=class extends(x(O(R(j)))){constructor(t){super(t),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new n({getCollections:()=>{var t,e;return[null==(t=this.basemapView)?void 0:t.baseLayerViews,this.layerViews,null==(e=this.basemapView)?void 0:e.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new L(this),this.floors=new s,this.highlightOptions=new J,this.inputManager=new F({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!0,this.timeline=new B,this.type="2d",this.ui=new et,this.constraints=new C,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([c((()=>this.viewpoint),(()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(dt)}),g),this.on("resize",(t=>this._resizeHandler(t))),c((()=>{var t;return null==(t=this.animationManager)?void 0:t.animation}),(t=>{this.animation=t}))]),f()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new H(this.featuresTilingScheme)}get initialExtentRequired(){var t;const{scale:e,constraints:i,spatialReference:s}=this,n=this._normalizeInput(this.center,s),r=this._normalizeInput(this.viewpoint,s),a=this._normalizeInput(this.extent,s);let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&null!=(t=this.map.initialViewProperties)&&t.viewpoint)&&(!a&&(null!=i&&i.effectiveLODs||(o=-1),(!n||0===e&&-1===o)&&(!r||!h(r.targetGeometry)||"extent"!==r.targetGeometry.type&&!r.scale)))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1}}}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t),this.frameTask.animationInProgress=!0;const i=()=>{t===this._get("animation")&&(this._set("animation",null),this.frameTask.requestFrame()),this.frameTask.animationInProgress=!1};t.when(i,i)}get background(){return this.get("map.initialViewProperties.background")||null}set background(t){void 0===t?this._clearOverride("background"):this._override("background",t)}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return new T({x:t[0],y:t[1],spatialReference:e})}set center(t){if(null==t)return;if(!this._normalizeInput(t,this.spatialReference))return void st.error("#center",`incompatible spatialReference ${JSON.stringify(t.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`);if(!this.ready)return this._set("center",t),void this.notifyChange("initialExtentRequired");const e=this.viewpoint;N(e,e,t),this.viewpoint=e}set constraints(t){const e=this._get("constraints");e&&(this.handles.remove("map-view-constraints"),e.destroy()),this._set("constraints",t),t&&(t.view=this,this.ready&&(this.state.viewpoint=t.fit(this.state.paddedViewState.viewpoint)),this.handles.add(t.on("update",(()=>{this.ready&&this.state&&(this.state.viewpoint=t.fit(this.state.paddedViewState.viewpoint))})),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(t){if(null==t)return;const e=this._normalizeInput(t,this.spatialReference);if(!e)return void st.error("#center",`incompatible spatialReference ${JSON.stringify(t.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`);if(!e.width||!e.height)return void st.error("#extent","invalid extent size");if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");const i=this.viewpoint;P(i,i,e,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;q(e,e,t),this.viewpoint=e}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",-1);const e=this._get("extent");return e&&(this._set("extent",null),this._set("center",e.center)),void this.notifyChange("initialExtentRequired")}const e=this.viewpoint;D(e,e,t),this.viewpoint=e}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){return!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some((t=>!t.destroyed&&!("layerViews"in t)&&!0===t.updating)))}get viewpoint(){if(!this.ready)return this._get("viewpoint");const t=this.state.paddedViewState;return t&&t.viewpoint.clone()}set viewpoint(t){if(null==t)return;const e=this._normalizeInput(t,this.spatialReference);if(!e)return void(!t.scale||isNaN(t.scale)?st.error("#viewpoint",`invalid scale value of ${t.scale}`):p(t.targetGeometry)?st.error("#viewpoint","geometry not defined"):st.error("#viewpoint",`incompatible spatialReference ${JSON.stringify(t.targetGeometry.spatialReference)} with view's spatialReference ${JSON.stringify(this.spatialReference)}`));if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");const s=new i({targetGeometry:new T,scale:0,rotation:0});U(s,e),this.constraints.constrain(s,this.state.paddedViewState.viewpoint),this.state.viewpoint=s,this.frameTask.requestFrame(),this._set("viewpoint",s)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(t){if(null==t)return;if(!this.ready){this.notifyChange("initialExtentRequired"),this._set("zoom",t),this._set("scale",0);const e=this._get("extent");e&&(this._set("extent",null),this._set("center",e.center))}if(!this.constraints.effectiveLODs)return;const e=this.viewpoint;D(e,e,this.constraints.zoomToScale(t)),this.viewpoint=e,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(t,e){if(t)return this.animation&&(this.animation=null),this._createAnimation(),m((()=>this.ready),e).then((()=>{const i={animate:!0,...e},s=A(t,this);return this.animation.update(s),this._gotoTask={},i.animate?this._gotoAnimated(s,i):this._gotoImmediate(s,i)}));st.error("#goTo()","target cannot be null or undefined")}async hitTest(t,e){const i=X(t)?Y(this,t):t;if(!this.ready||isNaN(i.x)||isNaN(i.y))return{screenPoint:i,results:[]};let s=new Set,n=!1,r=null,a=null;null!=e&&e.include?wt(e.include,yt(this,(t=>s.add(t)),(t=>{r||(r=new Set),r.add(t)}),(t=>s.add(t)),(()=>n=!0))):(n=!0,s=new Set(this.allLayerViews)),null!=e&&e.exclude&&wt(e.exclude,yt(this,(t=>s.delete(t)),(t=>{a||(a=new Set),a.add(t)})));const o=this.allLayerViews.filter((t=>!t.suspended&&s.has(t))).reverse(),l=this.toMap(i);let p=(await Promise.all([n?this.graphicsView.hitTest(l):null,...o.map((t=>t.hitTest(l,i)))])).filter(h).flat();return r&&(p=p.filter((t=>r.has(gt(t))))),a&&(p=p.filter((t=>!a.has(gt(t))))),{screenPoint:i,results:p.map((t=>({mapPoint:l,graphic:t})))}}takeScreenshot(t){t=t||{};const e=this.supersampleScreenshotsEnabled?Math.min(4,Z(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let i;t.layers?(i=[],t.layers.forEach((t=>{const e=this.allLayerViews.find((e=>e.layer.id===t.id));e&&"container"in e&&e.container&&i.push(e.container)}))):i=this._stage.children;const{format:s,quality:n}=K(t.format,t.quality),r=Q(t,e,this.size,this.padding,s,n,i,t.rotation);return this._stage.takeScreenshot(r)}toMap(t){if(!this.ready)return null;const e=X(t)?Y(this,t):t,i=[0,0],[s,n]=this.state.toMap(i,[e.x,e.y]),r=this.spatialReference;return new T({x:s,y:n,spatialReference:r})}toScreen(t){if(!this.ready)return null;const e=this._normalizeInput(t,this.spatialReference),i=[e.x,e.y];return this.state.toScreen(i,i),w(i[0],i[1])}on(t,e,i,s){const n=this.inputManager&&this.viewEvents.on(t,e,i,s);return n||super.on(t,e)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}whenLayerView(t){return super.whenLayerView(t)}graphicChanged(t){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(t)}}whenReady(){return new Promise((t=>{this.ready?t(this):this._resolveWhenReady.push(t)}))}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var t,e,i;return this.map&&"initialViewProperties"in this.map&&(null==(t=this.map)||null==(e=t.initialViewProperties)?void 0:e.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||null}getSpatialReferenceSupport({layer:t}){return t||this._get("ready")||null!==this._getDefaultViewpoint()?{}:null}hasLayerViewModule(t){return E.hasLayerViewModule(t)}importLayerView(t){return E.importLayerView(t)}pixelSizeAt(){return this.ready?this.state.resolution:(st.error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(t){return this.hitTest(t).then((e=>({...e,mapPoint:this.toMap(t)})))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let t=tt(this.type);return a("safari")&&a("safari")<9&&(t=new r("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:a("safari")})),h(t)?(st.warn("#validate()",t.message),Promise.reject(t)):pt()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new z),this.animation}_cancellableGoTo(t,e,i){const s=()=>t===this._gotoTask,n=i.then((()=>{s()&&(this.animation=null)})).catch((t=>{throw s()&&(this.animation=null,e.done||(e.stop(),this.frameTask.animationInProgress=!1)),t})),r=new Promise((t=>t(n)));return e.when().catch((()=>{s()&&r.cancel&&r.cancel()})),r}_gotoImmediate(t,e){const i=this._gotoTask,s=this.animation,n=t.then((t=>{if(u(e),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");this.viewpoint=s.target=t,s.finish()}));return this._cancellableGoTo(i,s,n)}_flipStationary(t){return null!==this._stationaryTimer||(this._stationaryTimer=setTimeout((()=>{this._stationaryTimer=null;const t=performance.now()-this._lastStationaryEventTimestamp;t<dt&&(this._stationaryTimer=this._flipStationary(t))}),t)),this._stationaryTimer}_getDefaultViewpoint(){var t,e,s,n;const{constraints:r,spatialReference:a}=this,o=this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties,l={zoom:this._get("zoom"),scale:this._get("scale"),center:this._normalizeInput(this._get("center"),a),extent:this._normalizeInput(this._get("extent"),a),rotation:this._get("rotation"),viewpoint:this._normalizeInput(this._get("viewpoint"),a),spatialReference:this._userSpatialReference};r.effectiveLODs?-1!==l.zoom&&(l.scale=r.zoomToScale(l.zoom)):l.zoom=-1;let p=null,u=null,c=0;const m=l.viewpoint&&l.viewpoint.rotation,g=l.viewpoint&&l.viewpoint.targetGeometry;h(g)&&("extent"===g.type?p=g:"point"===g.type&&(u=g,c=l.viewpoint.scale));const y=this._normalizeInput(null==(t=d(null==o||null==(e=o.viewpoint)?void 0:e.targetGeometry))?void 0:t.extent,a),w=this._normalizeInput(this.initialExtent,a),f=l.extent||p||y||w,v=l.center||u||f&&f.center,_=null==o||null==(s=o.viewpoint)?void 0:s.scale,V=l.scale||c||_||f&&W(f,this.size),T=null==o||null==(n=o.viewpoint)?void 0:n.rotation,b=l.rotation||m||T||0;return v&&V?new i({targetGeometry:v,scale:V,rotation:b}):null}_gotoAnimated(t,e){const i=this._gotoTask,s=this.animation,n=t.then((t=>{if(u(e),i!==this._gotoTask)throw new r("view:goto-interrupted","Goto was interrupted");return s.update(t),this.animationManager.animate(s,this.viewpoint,e),s.when().then((()=>{}),(()=>{}))}));return this._cancellableGoTo(i,s,n)}_normalizeInput(t,e){const i=t&&t.targetGeometry||t;return e?i?e.equals(i.spatialReference)?t:b(i,e)?ut(t)?(t.targetGeometry=S(i,e),t):S(i,e):null:null:t}_resizeHandler(t){const e=this.state;if(!e)return;let i=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();e.size=[t.width,t.height],$(i,i,s,this.state.paddedViewState.size,this.resizeAlign),i=this.constraints.constrain(i,null),this.state.viewpoint=i}_startup(){this.timeline.begin("MapView Startup");const t=this._getDefaultViewpoint();this.constraints.view=this,this.constraints.fit(t),this._set("animationManager",new k({view:this})),this._set("state",new G({padding:this._get("padding"),size:this.size,viewpoint:t})),this._set("featuresTilingScheme",new I(M.create({spatialReference:this.spatialReference,size:512,numLODs:36}))),this._set("ready",!0),this.frameTask&&this.frameTask.start(),this.graphics.owner=this;const e={disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},i=new nt(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:e,renderingOptions:this.renderingOptions,timeline:this.timeline}),s=new rt({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new at(this.featuresTilingScheme)}),n=new lt({view:this,animationManager:this.animationManager}),r=new ot({view:this});this._magnifierView=new ht,this._magnifierView.magnifier=this.magnifier,this._stage=i,this.frameTask.graphicsView=s,this._set("graphicsView",s),this._set("mapViewNavigation",n),this._set("labelManager",r),this.handles.add([this.rootLayerViews.on("change",(()=>this._updateStageChildren())),i.on("post-render",(()=>this._set("rendering",i.renderRequested))),i.on("will-render",(()=>this._set("rendering",i.renderRequested))),i.on("webgl-error",(t=>this.fatalError=t.error)),c((()=>this.stationary),(t=>i.stationary=t),y),c((()=>this.state.id),(()=>i.state=this.state),y),c((()=>this.background),(t=>{i.background=t,this._magnifierView.background=t}),y),c((()=>this.magnifier),(t=>this._magnifierView.magnifier=t),y),c((()=>this.renderingOptions),(t=>i.renderingOptions=t),y),c((()=>this.highlightOptions),(t=>i.highlightOptions=t),y)],"map-view"),i.state=this.state,this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach((t=>t(this))),this.timeline.end("MapView Startup")}_teardown(){this.handles.remove("map-view"),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._stage.destroy();this.graphicsView.destroy(),this.mapViewNavigation.destroy(),this._stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask&&this.frameTask.stop(),this._set("ready",!1),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null);const{center:[t,e],spatialReference:i,rotation:s,scale:n}=this.state.paddedViewState,r=new T({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",r),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("spatialReference",i),this.constraints.view=null,this.animationManager.destroy(),this._set("animationManager",null),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach((t=>{this._stage.addChild(t.container)}));const t=this.graphicsView;this._stage.addChild(t.container),this._stage.addChild(this._magnifierView)}};t([v({readOnly:!0})],ct.prototype,"animationManager",void 0),t([v({constructOnly:!0})],ct.prototype,"deactivatedWebGLExtensions",void 0),t([v({constructOnly:!0})],ct.prototype,"debugWebGLExtensions",void 0),t([v({readOnly:!0})],ct.prototype,"featuresTilingScheme",void 0),t([v({readOnly:!0})],ct.prototype,"fullOpacity",void 0),t([v({readOnly:!0})],ct.prototype,"graphicsTileStore",null),t([v()],ct.prototype,"graphicsView",void 0),t([v({readOnly:!0})],ct.prototype,"state",void 0),t([v()],ct.prototype,"initialExtentRequired",null),t([v()],ct.prototype,"labelManager",void 0),t([v({readOnly:!0})],ct.prototype,"resourceManager",null),t([v({readOnly:!0})],ct.prototype,"textureManager",null),t([v({readOnly:!0})],ct.prototype,"mapViewNavigation",void 0),t([v({constructOnly:!0})],ct.prototype,"renderCanvas",void 0),t([v()],ct.prototype,"renderingOptions",void 0),t([v({readOnly:!0})],ct.prototype,"rendering",void 0),t([v({constructOnly:!0})],ct.prototype,"supersampleScreenshotsEnabled",void 0),t([v({readOnly:!0})],ct.prototype,"supportsGround",void 0),t([v()],ct.prototype,"_stationaryTimer",void 0),t([v()],ct.prototype,"_defaultsFromMapSettings",null),t([v()],ct.prototype,"animation",null),t([v({type:it})],ct.prototype,"background",null),t([v({value:null,type:T,dependsOn:["state.id","ready"]})],ct.prototype,"center",null),t([v({type:C})],ct.prototype,"constraints",null),t([v({value:null,type:V,dependsOn:["state.id","ready"]})],ct.prototype,"extent",null),t([v()],ct.prototype,"floors",void 0),t([v({type:J})],ct.prototype,"highlightOptions",void 0),t([v({readOnly:!0})],ct.prototype,"inputManager",void 0),t([v()],ct.prototype,"map",void 0),t([v({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],ct.prototype,"padding",null),t([v()],ct.prototype,"resizeAlign",void 0),t([v({readOnly:!0,dependsOn:["state.id"]})],ct.prototype,"resolution",null),t([v({value:0,type:Number,dependsOn:["state.id","ready"]})],ct.prototype,"rotation",null),t([v({value:0,type:Number,dependsOn:["state.id","ready"]})],ct.prototype,"scale",null),t([v({constructOnly:!0})],ct.prototype,"spatialReferenceLocked",void 0),t([v()],ct.prototype,"stationary",null),t([v({type:B,readOnly:!0})],ct.prototype,"timeline",void 0),t([v({readOnly:!0})],ct.prototype,"type",void 0),t([v({readOnly:!0})],ct.prototype,"updating",null),t([v({value:null,type:i,dependsOn:["state.id","ready"]})],ct.prototype,"viewpoint",null),t([v({value:-1,dependsOn:["state.id"]})],ct.prototype,"zoom",null),t([v({type:Boolean})],ct.prototype,"navigating",null),t([v({type:et})],ct.prototype,"ui",void 0),ct=t([_("esri.views.MapView")],ct);const mt=ct;function gt(t){const e=t.getObjectId();var i,s,n,r;return e?`${null!=(i=null!=(s=null==(n=t.layer)?void 0:n.uid)?s:null==(r=t.sourceLayer)?void 0:r.uid)?i:"MapView"}/${e}`:`"MapView/${t.uid}`}function yt(t,i,s,n,r){return a=>{if(a instanceof e){if(a.layer===t)null==r||r();else{const e=t.allLayerViews.find((t=>t.layer===a.layer));e&&(null==n||n(e))}s(gt(a))}else{const e=t.allLayerViews.find((t=>t.layer===a));e&&i(e)}}}function wt(t,e){if(t)if(o(t))for(const i of t)if(o(i))for(const t of i)e(t);else e(i);else e(t)}export{mt 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"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Ground.js";import s from"../Viewpoint.js";import n from"../core/Collection.js";import{byId as a}from"../core/domUtils.js";import o from"../core/Error.js";import{on as l}from"../core/events.js";import{handlesGroup as p,makeHandle as h}from"../core/handleUtils.js";import d from"../core/has.js";import{isIterable as c}from"../core/iteratorUtils.js";import u from"../core/Logger.js";import{destroyMaybe as g,isNone as m,isSome as f,unwrapOr as y}from"../core/maybe.js";import{ObservableChangesType as w}from"../core/ObservableChangesType.js";import{throwIfAborted as v}from"../core/promiseUtils.js";import{setFrameDuration as _}from"../core/scheduling.js";import{on as b,whenOnce as S,init as M,whenTrueOnce as R}from"../core/watchUtils.js";import{initialize as T}from"../core/workers/workers.js";import{screenPointObjectToArray as x,createScreenPoint as V,createScreenPointArray as C}from"../core/screenUtils.js";import{property as O}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as I}from"../core/accessorSupport/decorators/cast.js";import{subclass as P}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as E}from"../core/accessorSupport/ensureType.js";import{c as j}from"../chunks/vec3f64.js";import G from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as H,project as L,projectPointToVector as U,projectVectorToVector as A,projectBoundingRect as D}from"../geometry/projection.js";import{create as F,toExtent as N}from"../geometry/support/aaBoundingRect.js";import{B as W,a as q}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as k}from"../geometry/support/scaleUtils.js";import B from"../layers/VoxelWasmManager.js";import{isTiledLayer as Q}from"../layers/support/layerUtils.js";import{BreakpointsOwner as Y}from"./BreakpointsOwner.js";import{DOMContainer as $}from"./DOMContainer.js";import X from"./GroundView.js";import{PopupView as K}from"./PopupView.js";import Z from"./View.js";import J from"./ViewAnimation.js";import{ViewingMode as ee,stringFromViewingMode as te,viewingModeFromString as ie}from"./ViewingMode.js";import{layerView3DImporter as re}from"./3d/layerViewModuleImportUtils.js";import se from"./3d/analysis/AnalysisViewManager3D.js";import ne from"./3d/constraints/Constraints.js";import ae from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as oe}from"./3d/environment/SceneViewEnvironmentManager.js";import le from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as pe}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as he}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as de}from"./3d/layers/graphics/ObjectResourceCache.js";import ce from"./3d/layers/support/FeatureTileTree3D.js";import ue from"./3d/state/ViewState.js";import ge from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as me}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as fe}from"./3d/support/CombinedElevationProvider.js";import ye from"./3d/support/debugFlags.js";import we from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as ve}from"./3d/support/ElevationProvider.js";import _e from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as be}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import Me from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Re}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Te}from"./3d/support/ResourceController.js";import xe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ve}from"./3d/support/SharedSymbolResources.js";import Ce from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Oe from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ie,getTiledLayerInfo as Pe}from"./3d/terrain/terrainUtils.js";import{Stage as Ee}from"./3d/webgl-engine/Stage.js";import{newIntersector as je,DEFAULT_TOLERANCE as Ge}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as He,IntersectorType as Le}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as Ue}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toGraphic as Ae,toOwner as De}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSameDistance as Ne}from"./support/hitTestSelectUtils.js";import{occludeesSupported as We}from"./support/layerViewUtils.js";import{toRenderSettings as qe,screenshotSuperSampleSettings as ze}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as ke,createScreenPointFromSupportedEvent as Be}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Qe}from"./support/spatialReferenceSupport.js";import{WatchFlags as Ye}from"./support/WatchUpdatingTracking.js";import{check as $e}from"./support/WebGLRequirements.js";import Xe from"./ui/3d/DefaultUI3D.js";import Ke from"../webscene/Environment.js";import Ze from"../geometry/Extent.js";import Je from"../geometry/SpatialReference.js";import et from"../geometry/Point.js";const tt=u.getLogger("esri.views.SceneView");let it=class extends(Y($(K(Z)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Se({slicePlane:W},this),this._resourceController=Te(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new pe({view:this}),this.labeler=new he({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new ne,this.environmentManager=new oe,this.extent=null,this.floors=new n,this.windowDevicePixelRatio=1,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new se({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ue,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Xe,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new _e,T(),e&&e.environment||(this._defaults.environment=new ae,this.environment=this._defaults.environment);const t=e=>{f(e)&&e.type===w.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([b(this,"map.allLayers","after-changes",t,t,t,!0),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),this.watch("map",(e=>{e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new le({view:this});const i=()=>{const e=window.devicePixelRatio;e!==this.windowDevicePixelRatio&&(this.windowDevicePixelRatio=e,this.notifyChange("pixelRatio"))};this.stateManager=new ge({view:this,updateDevicePixelRatio:i})}initialize(){this.groundView=new X({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(b(this,"map.allLayers","after-changes",e,e,e)),this.updatingHandles.add(this.qualitySettings,"memoryLimit",(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),Ye.INIT),this.updatingHandles.add(this.qualitySettings,"additionalCacheMemory",(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),Ye.INIT),this.updatingHandles.add(this.qualitySettings,"frameRate",(e=>_(e>0?1e3/Math.ceil(e):0)),Ye.INIT),this.updatingHandles.add(ye,"SCENEVIEW_LOCKING_LOG",(e=>this.defaultsFromMap.logDebugInformation=e),Ye.INIT),this.updatingHandles.add(this,"map.ground",e,Ye.SYNC|Ye.INIT),this.updatingHandles.add(this,"map.ground.opacity",(()=>this._updateDefaultHitTestOptions()),Ye.SYNC|Ye.INIT),this.handles.add(this.watch("spatialReference",(()=>this.notifyChange("clippingArea")),!0))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=g(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=g(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=g(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain&&this.basemapTerrain.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||m(e)?(this._clippingArea=null,null):e instanceof Ze?this.spatialReference&&(e=nt(e,this.spatialReference),m(e))?(tt.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),m(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(tt.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&f(e)?tt.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ee.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return m(t)||m(e)||t.spatialReference.equals(e)?t:nt(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||Je.WGS84,i=nt(this.clippingArea,t);f(i)&&(e=f(e)?e.intersection(i):i);const r=this._get("dataExtent");return f(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||Je.WGS84;let t;const i=i=>{const r=nt(i,e);m(r)||(f(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(null!=r&&r.spatialReference){const e=r.groundExtent;i(new Ze({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!f(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(m(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof ae?e:e instanceof Ke?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):ae.fromWebsceneEnvironment(e):E(ae,e):new ae}get pixelRatio(){return Math.min(this.windowDevicePixelRatio,this.maximumPixelRatio)}set pixelRatio(e){f(e)?this._override("pixelRatio",e):this._clearOverride("pixelRatio")}get maximumPixelRatio(){let e=1/0;const{maximumPixelRatio:t,maximumRenderResolution:i}=this.qualitySettings;if(null!=t&&(e=Math.min(e,t)),null!=i){const t=i/Math.max(this.width,this.height);e=Math.min(e,t)}return e}set maximumPixelRatio(e){f(e)?this._override("maximumPixelRatio",e):this._clearOverride("maximumPixelRatio")}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||f(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(m(this.state)||this.state.stationary)}set qualityProfile(e){we.isValidProfile(e)&&(we.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||we.getDefaultProfile()}set slicePlane(e){if(f(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),m(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");q(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?k(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?G.deriveUnitFromSR(e,this.spatialReference):null}get updating(){var e,t,i;if(this.destroyed)return!1;let r=0,s=this.layerViewManager.updating,n=s?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((e=>{if(e.isFulfilled()){if(e.updating){if(s=!0,e.suspended||Ie(e))return;++n,r+=e.updatingProgress}}else++n}));for(const a of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(f(a)&&a.updating){const e=.1;n+=e,r+=.5*e}for(const a of[this.deconflictor,this.labeler,this.basemapTerrain])f(a)&&a.updating&&(++n,r+=a.updatingProgress);if(s=!!(s||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||null!=(e=this.inputManager)&&e.hasPendingInputs||null!=(t=this.map)&&null!=(i=t.allLayers)&&i.some((e=>!e.isFulfilled()))),s?(this._numUpdating=Math.max(n,this._numUpdating),r+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?r/=this._numUpdating:r=s?0:1,this._get("updatingProgress")!==r){const e=this._resourceController.scheduler.now;if(r<1){const t=Math.min((e-this._lastUpdateTime)/2e3,1);r=this.updatingProgress*(1-t)+r*t}this._set("updatingProgress",r),this._lastUpdateTime=s&&r<1?e:0}return s}get viewingMode(){var e;const t=this._predeterminedViewingMode;if(f(t))return te(t);const i=this.spatialReference;return f(null==(e=this.defaultsFromMap)?void 0:e.viewingMode)&&i&&i.equals(this.defaultsFromMap.spatialReference)?te(this.defaultsFromMap.viewingMode):!i||Qe(i,ee.Global)?"global":"local"}set viewingMode(e){this.ready?tt.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new xe(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return tt.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=f(i.graphics)&&(f(i.graphics.include)||f(i.graphics.exclude)),s=ke(e)?Be(this,e):e,n=x(s);i.enableDraped=i.include&&!i.include.has(Fe)||i.exclude&&i.exclude.has(Fe);const a=this.sceneIntersectionHelper,o=je(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?He.ALL:He.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=Ae(e,this);if(m(t))return this._intersectResultToMapPoint(e);if(this._testGraphicUidFilter(i.graphics,t))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return tt.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=y(null==e.z&&ve(this.elevationProvider,e),0);return U(e,ot,this.renderSpatialReference,t),this.state.camera.projectToScreen(ot,lt),V(lt[0],lt[1])}pixelSizeAt(e){return this.ready?e?(U(e,ot,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(ot)):0:(tt.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return tt.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ke(e)?Be(this,e):e,r=C(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=je(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=He.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=De(o,this),p=f(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:Ue(o)?o.distanceInRenderSpace:0,layer:p}};return ye.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}popupHitTest(e){return Ne(this,e).then((({results:t,ground:i})=>{let r=null;return!(0===t.length||Math.abs(y(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}))}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(m(e.parent))throw new o("view:no-analysisview-for-analysis","The analysis has not been added to an AnalysisLayer or SceneView.analyses",{analysis:e});if("analysis"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView(e)}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}takeScreenshot(e){return this.whenReady().then((()=>{const t=qe(e,this);for(const e of this.map.allLayers.items)"voxel"===e.type&&(t.renderScreenshotTwice=!0);return t.pixelRatio/=this.pixelRatio,this._stage.renderView.takeScreenshot(ze(t,this.supersampleScreenshotsEnabled,this.padding))}))}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return re.importLayerView(e)}hasLayerViewModule(e){return re.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,t,i,r;return this.map&&"initialViewProperties"in this.map&&(null==(e=this.map)||null==(t=e.initialViewProperties)?void 0:t.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||(null==(r=this.defaultsFromMap)?void 0:r.ready)&&this._initialDefaultSpatialReference||null}async validate(){let e=$e(this.type);if(d("safari")&&d("safari")<9&&(e=new o("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:d("safari")})),f(e))throw tt.warn("#validate()",e.message),e}get _predeterminedViewingMode(){var e,t;const i=this._isOverridden("viewingMode")?this._get("viewingMode"):null!=(e=this.map&&"initialViewProperties"in this.map?null==(t=this.map.initialViewProperties)?void 0:t.viewingMode:null)?e:null;return f(i)?ie(i):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(f(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ee.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ee.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ee.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ee.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Qe(e,i)&&(!!m(t)||(!Q(t)||!m(Pe(t,e,i)))&&("voxel"!==t.type||i===ee.Local))}_makeSpatialReferenceConstraints(e,t,i){return t&&!Q(t)&&"voxel"!==t.type&&(e.isWebMercator||e.isWGS84)?[{spatialReference:e,viewingMode:i},{spatialReference:e.isWebMercator?Je.WGS84:Je.WebMercator,viewingMode:i}]:[{spatialReference:e,viewingMode:i}]}_validateSpatialReference(e){const t=f(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(f(i)?tt.warnOnce(`Spatial reference defined on view not supported in ${te(i)} viewing mode.`):e.isGeographic&&tt.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||Je.WGS84;return A(e,this.renderSpatialReference,e,i)||(i=Je.WGS84,A(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new et(e,i),t}trackGraphicState(e){if(!e.graphic)return tt.error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&f(t)&&"graphics3d"in t&&t.graphics3d&&t.graphics3d.graphicsCore&&(i=t.graphics3d.graphicsCore.trackGraphicState(e))};return f(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return p(e.map((e=>this.highlight(e))));if(n.isCollection(e))return p(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):h()}maskOccludee(e){if(!e)return tt.error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&f(t)&&"graphics3d"in t&&We(t)&&(i=t.maskOccludee(e))};return f(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){f(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await S(this,"graphicsView"),this.graphicsView;if(!e.layer||!this.map)throw new o("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{-1!==s.added.indexOf(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,at.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,at.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(ot)?(t=this.computeMapPointFromVec3d(ot,t),e.intersector===Le.TERRAIN&&this.basemapTerrain&&(t.z=y(ve(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=De(n,this);if(f(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=Ae(n,this);if(!f(o))continue;if(m(r)&&s!==e.length-1&&(r=new Set),f(r)){const e=this._getGraphicFilterUid(o);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o))continue;const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({graphic:o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return m(e)||(m(e.include)||e.include.has(i))&&(m(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,s={layerUids:null,graphicUids:null}){if(!e)return s;if(e instanceof i)st(s,this._getGraphicFilterUid(e)),t===at.INCLUDE&&(f(this.graphicsView)&&e.layer===this?rt(s,this.graphicsView.graphics3d.layer.id):e.layer&&rt(s,e.layer.uid));else if(c(e))for(const i of e)i===this.graphics&&f(this.graphicsView)?rt(s,this.graphicsView.graphics3d.layer.id):i instanceof r?i===this.map.ground&&rt(s,Fe):this._externalToInternalRenderItems(i,t,s);else rt(s,e.uid);return s}_initBasemapTerrain(){this._set("basemapTerrain",new Oe({view:this})),this._set("elevationProvider",new fe({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ce({view:this})),this._set("featureTiles",new ce({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain&&this.basemapTerrain.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=f(this.basemapTerrain.extent)?L(N(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;f(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add(ye,"FEATURE_TILE_TREE_SHOW_TILES",(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&ye.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||ye.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),Ye.INIT|Ye.SYNC),this.updatingHandles.add(this,"clippingArea",e,Ye.INIT|Ye.SYNC),this.updatingHandles.add(this,"basemapTerrain.extent",e,Ye.INIT|Ye.SYNC)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new be(this.map,e));const t=this.state.isGlobal,i=z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Re.create(this.state.viewingMode,i)),t||this.handles.add(this.watch("basemapTerrain.extent",(e=>{const t=this.renderCoordsHelper.spatialReference;0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!D(e,this.basemapTerrain.spatialReference,pt,t)||(this.renderCoordsHelper.extent=pt)}),!0),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){f(e)&&e.type===w.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add([e.watch(["updating","updatingProgress"],(()=>this._updatingChanged()),!0)],"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new me(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=a(this.surface),{resourceController:r,state:s,renderSpatialReference:n}=this;this._stage=new Ee({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:n}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=l(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new o("webgl-context-lost"))),this.handles.add([this.updatingHandles.add(this.qualitySettings,"antialiasingEnabled",(()=>{this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})}),Ye.INIT),this.updatingHandles.add(this.qualitySettings,"highQualityTransparency",(()=>{this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})}),Ye.INIT),M(this,"magnifier",(e=>this._stage.renderView.magnifier=e),!0)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:_e.toEngineOptions(this.highlightOptions)})};for(const a of["highlightOptions","highlightOptions.color","highlightOptions.haloColor","highlightOptions.haloOpacity","highlightOptions.fillOpacity","highlightOptions.shadowOpacity","highlightOptions.shadowColor","highlightOptions.shadowDifference"])this.handles.add(this.updatingHandles.add(this,a,p),"stage");p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ge/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ve({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new de})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;v(e),await R(this.basemapTerrain,"ready",e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),f(this.graphicsView)&&(this.handles.remove(this.graphicsView.graphics3d.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ie(this.viewingMode);if(e===ee.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(b(this,"graphics","after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Fe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Fe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}getVoxelWasmPerSceneView(){return B.getInstance().getVoxelWasmPerSceneView(this)}};function rt(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function st(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function nt(e,t){return f(e)&&H(e.spatialReference,t)?L(e,t):null}var at;e([O()],it.prototype,"_userClippingArea",void 0),e([O()],it.prototype,"_resourceController",void 0),e([O()],it.prototype,"_stage",void 0),e([O({readOnly:!0})],it.prototype,"deconflictor",void 0),e([O({readOnly:!0})],it.prototype,"labeler",void 0),e([O({type:J,readOnly:!0,aliasOf:"state.animation"})],it.prototype,"animation",void 0),e([O({readOnly:!0})],it.prototype,"basemapTerrain",void 0),e([O({readOnly:!0})],it.prototype,"elevationProvider",void 0),e([O({type:t,aliasOf:"stateManager.camera"})],it.prototype,"camera",void 0),e([O({type:t,aliasOf:"stateManager.contentCamera"})],it.prototype,"contentCamera",void 0),e([O({readOnly:!0})],it.prototype,"canvas",void 0),e([O({type:et,aliasOf:"stateManager.center"})],it.prototype,"center",void 0),e([O({type:Ze})],it.prototype,"clippingArea",null),e([O({type:ne})],it.prototype,"constraints",void 0),e([O({type:Ze,readOnly:!0})],it.prototype,"renderDataExtent",null),e([O({type:Ze,readOnly:!0})],it.prototype,"dataExtent",null),e([O({type:Ze,readOnly:!0})],it.prototype,"groundAndLayersExtent",null),e([O({value:null,type:ae})],it.prototype,"environment",null),e([I("environment")],it.prototype,"castEnvironment",null),e([O({readOnly:!0})],it.prototype,"environmentManager",void 0),e([O({type:Ze,aliasOf:"stateManager.extent"})],it.prototype,"extent",void 0),e([O()],it.prototype,"floors",void 0),e([O({readOnly:!0,aliasOf:"stateManager.screenCenter"})],it.prototype,"screenCenter",void 0),e([O({type:Number})],it.prototype,"pixelRatio",null),e([O({type:Number,dependsOn:["qualitySettings.maximumPixelRatio","qualitySettings.maximumRenderResolution","size"]})],it.prototype,"maximumPixelRatio",null),e([O({aliasOf:"stateManager.frustum"})],it.prototype,"frustum",void 0),e([O({type:Number,readOnly:!0})],it.prototype,"fullOpacity",void 0),e([O({readOnly:!0})],it.prototype,"graphicsView",void 0),e([O({readOnly:!0})],it.prototype,"analysisViewManager",void 0),e([O()],it.prototype,"groundView",void 0),e([O({type:Boolean})],it.prototype,"initialExtentRequired",null),e([O()],it.prototype,"_defaultsFromMapSettings",null),e([O({type:Boolean,readOnly:!0})],it.prototype,"interacting",null),e([O()],it.prototype,"stationary",null),e([O({aliasOf:"state.navigating"})],it.prototype,"navigating",void 0),e([O()],it.prototype,"map",void 0),e([O({readOnly:!0})],it.prototype,"mapCoordsHelper",void 0),e([O({aliasOf:"stateManager.padding"})],it.prototype,"padding",void 0),e([O({type:Ce,readOnly:!0})],it.prototype,"pointsOfInterest",void 0),e([O({type:ce,readOnly:!0})],it.prototype,"featureTiles",void 0),e([O()],it.prototype,"featureTreeDebugger",void 0),e([O({type:Boolean})],it.prototype,"screenSizePerspectiveEnabled",void 0),e([O({constructOnly:!0})],it.prototype,"deactivatedWebGLExtensions",void 0),e([O({constructOnly:!0})],it.prototype,"debugWebGLExtensions",void 0),e([O({constructOnly:!0})],it.prototype,"renderCanvas",void 0),e([O({constructOnly:!0})],it.prototype,"state",void 0),e([O({readOnly:!0})],it.prototype,"inputManager",void 0),e([O({readOnly:!0})],it.prototype,"stateManager",void 0),e([O({type:["low","medium","high"]})],it.prototype,"qualityProfile",null),e([O({type:Me,get(){let e=this._get("qualitySettings");return e||(e=new Me,we.apply(this.qualityProfile,e)),e}})],it.prototype,"qualitySettings",void 0),e([O()],it.prototype,"slicePlane",null),e([O({readOnly:!0})],it.prototype,"typeSpecificPreconditionsReady",null),e([O({readOnly:!0})],it.prototype,"renderCoordsHelper",void 0),e([O({readOnly:!0})],it.prototype,"sceneIntersectionHelper",void 0),e([O({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],it.prototype,"resolution",null),e([O({type:Number,aliasOf:"stateManager.scale"})],it.prototype,"scale",void 0),e([O()],it.prototype,"heightModelInfo",null),e([O()],it.prototype,"spatialReference",void 0),e([O({type:Boolean,constructOnly:!0})],it.prototype,"alphaCompositingEnabled",void 0),e([O({type:Boolean})],it.prototype,"supersampleScreenshotsEnabled",void 0),e([O({readOnly:!0})],it.prototype,"type",void 0),e([O({type:Xe})],it.prototype,"ui",void 0),e([O({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],it.prototype,"updating",null),e([O({type:Number,readOnly:!0,dependsOn:["updating"]})],it.prototype,"updatingProgress",void 0),e([O({type:["global","local"]})],it.prototype,"viewingMode",null),e([O({type:s,aliasOf:"stateManager.viewpoint"})],it.prototype,"viewpoint",void 0),e([O({type:Number,aliasOf:"stateManager.zoom"})],it.prototype,"zoom",void 0),e([O({type:_e})],it.prototype,"highlightOptions",void 0),it=e([P("esri.views.SceneView")],it),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(at||(at={}));const ot=j(),lt=C(),pt=F(),ht=it;export{ht as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Ground.js";import s from"../Viewpoint.js";import n from"../core/Collection.js";import{byId as a}from"../core/domUtils.js";import o from"../core/Error.js";import{on as l}from"../core/events.js";import{handlesGroup as p,makeHandle as h}from"../core/handleUtils.js";import d from"../core/has.js";import{isIterable as c}from"../core/iteratorUtils.js";import u from"../core/Logger.js";import{destroyMaybe as g,isNone as m,isSome as f,unwrapOr as y}from"../core/maybe.js";import{ObservableChangesType as w}from"../core/ObservableChangesType.js";import{throwIfAborted as v}from"../core/promiseUtils.js";import{initial as _,syncAndInitial as b}from"../core/reactiveUtils.js";import{setFrameDuration as M}from"../core/scheduling.js";import{on as R,whenOnce as S,init as x,whenTrueOnce as V}from"../core/watchUtils.js";import{initialize as C}from"../core/workers/workers.js";import{screenPointObjectToArray as T,createScreenPoint as O,createScreenPointArray as P}from"../core/screenUtils.js";import{property as E}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import{subclass as I}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as G}from"../core/accessorSupport/ensureType.js";import{c as H}from"../chunks/vec3f64.js";import L from"../geometry/HeightModelInfo.js";import{canProjectWithoutEngine as U,project as A,projectPointToVector as D,projectVectorToVector as F,projectBoundingRect as W}from"../geometry/projection.js";import{create as q,toExtent as z}from"../geometry/support/aaBoundingRect.js";import{B as k,a as N}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as B}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as Q}from"../geometry/support/scaleUtils.js";import $ from"../layers/VoxelWasmManager.js";import{isTiledLayer as X}from"../layers/support/layerUtils.js";import{BreakpointsOwner as K}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import J from"./GroundView.js";import{PopupView as Y}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import oe from"./3d/constraints/Constraints.js";import le from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as pe}from"./3d/environment/SceneViewEnvironmentManager.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ce}from"./3d/layers/graphics/Labeler.js";import{ObjectResourceCache as ue}from"./3d/layers/graphics/ObjectResourceCache.js";import ge from"./3d/layers/support/FeatureTileTree3D.js";import me from"./3d/state/ViewState.js";import fe from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as we}from"./3d/support/CombinedElevationProvider.js";import ve from"./3d/support/debugFlags.js";import _e from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as be}from"./3d/support/ElevationProvider.js";import Me from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Re}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import xe from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ve}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ce}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Oe}from"./3d/support/SharedSymbolResources.js";import Pe from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ee from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as je,getTiledLayerInfo as Ie}from"./3d/terrain/terrainUtils.js";import{Stage as Ge}from"./3d/webgl-engine/Stage.js";import{newIntersector as He,DEFAULT_TOLERANCE as Le}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as Ue,IntersectorType as Ae}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as De}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toGraphic as Fe,toOwner as We}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as qe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSameDistance as ze}from"./support/hitTestSelectUtils.js";import{occludeesSupported as ke}from"./support/layerViewUtils.js";import{toRenderSettings as Ne,screenshotSuperSampleSettings as Be}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Qe,createScreenPointFromSupportedEvent as $e}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Xe}from"./support/spatialReferenceSupport.js";import{check as Ke}from"./support/WebGLRequirements.js";import Ze from"./ui/3d/DefaultUI3D.js";import Je from"../webscene/Environment.js";import Ye from"../geometry/Extent.js";import et from"../geometry/SpatialReference.js";import tt from"../geometry/Point.js";const it=u.getLogger("esri.views.SceneView");let rt=class extends(K(Z(Y(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this.propertiesPool=new Se({slicePlane:k},this),this._resourceController=Ce(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new de({view:this}),this.labeler=new ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.basemapTerrain=null,this.elevationProvider=null,this.camera=null,this.canvas=null,this.center=null,this.constraints=new oe,this.environmentManager=new pe,this.extent=null,this.floors=new n,this.windowDevicePixelRatio=1,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.navigating=!1,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new me,this.scale=null,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Ze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.viewpoint=null,this.zoom=null,this.highlightOptions=new Me,C(),e&&e.environment||(this._defaults.environment=new le,this.environment=this._defaults.environment);const t=e=>{f(e)&&e.type===w.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.handles.add([R(this,"map.allLayers","after-changes",t,t,t,!0),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),this.watch("map",(e=>{e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new he({view:this});const i=()=>{const e=window.devicePixelRatio;e!==this.windowDevicePixelRatio&&(this.windowDevicePixelRatio=e,this.notifyChange("pixelRatio"))};this.stateManager=new fe({view:this,updateDevicePixelRatio:i})}initialize(){this.groundView=new J({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.handles.add(R(this,"map.allLayers","after-changes",e,e,e)),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),_),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),_),this.updatingHandles.add((()=>this.qualitySettings.frameRate),(e=>M(e>0?1e3/Math.ceil(e):0)),_),this.updatingHandles.add((()=>ve.SCENEVIEW_LOCKING_LOG),(e=>this.defaultsFromMap.logDebugInformation=e),_),this.updatingHandles.add((()=>{var e;return null==(e=this.map)?void 0:e.ground}),e,b),this.updatingHandles.add((()=>{var e,t;return null==(e=this.map)||null==(t=e.ground)?void 0:t.opacity}),(()=>this._updateDefaultHitTestOptions()),b),this.handles.add(this.watch("spatialReference",(()=>this.notifyChange("clippingArea")),!0))}destroy(){this.destroyed||(this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=g(this.sharedSymbolResources),this.labeler.destroy(),this._set("labeler",null),this.deconflictor.destroy(),this._set("deconflictor",null),this._resourceController=g(this._resourceController),this.stateManager.destroy(),this._set("stateManager",null),this.inputManager.destroy(),this._set("inputManager",null),this.propertiesPool.destroy(),this.handles.remove("updatingMonitors"),this.environmentManager.destroy(),this._set("environmentManager",null),this.groundView=g(this.groundView))}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain&&this.basemapTerrain.spatialReference}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||this.get("map.clippingArea");return!(!!this._userClippingArea||this.get("map.clippingEnabled"))||m(e)?(this._clippingArea=null,null):e instanceof Ye?this.spatialReference&&(e=at(e,this.spatialReference),m(e))?(it.error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),m(e.intersection(this.groundAndLayersExtent))&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(it.error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&f(e)?it.error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return m(t)||m(e)||t.spatialReference.equals(e)?t:at(t,e)}get dataExtent(){let e=this.groundAndLayersExtent;const t=this.spatialReference||et.WGS84,i=at(this.clippingArea,t);f(i)&&(e=f(e)?e.intersection(i):i);const r=this._get("dataExtent");return f(e)&&e.equals(r)?r:e}get groundAndLayersExtent(){const e=this.spatialReference||et.WGS84;let t;const i=i=>{const r=at(i,e);m(r)||(f(t)?t.union(r):t=r.clone())},r=this.basemapTerrain;if(null!=r&&r.spatialReference){const e=r.groundExtent;i(new Ye({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{!f(e.fullExtent)||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(m(t))return null;t.hasZ?(t.zmin=Math.min(0,t.zmin),t.zmax=Math.max(0,t.zmax)):(t.zmin=0,t.zmax=0);const s=this._get("groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof le?e:e instanceof Je?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):le.fromWebsceneEnvironment(e):G(le,e):new le}get pixelRatio(){return Math.min(this.windowDevicePixelRatio,this.maximumPixelRatio)}set pixelRatio(e){f(e)?this._override("pixelRatio",e):this._clearOverride("pixelRatio")}get maximumPixelRatio(){let e=1/0;const{maximumPixelRatio:t,maximumRenderResolution:i}=this.qualitySettings;if(null!=t&&(e=Math.min(e,t)),null!=i){const t=i/Math.max(this.width,this.height);e=Math.min(e,t)}return e}set maximumPixelRatio(e){f(e)?this._override("maximumPixelRatio",e):this._clearOverride("maximumPixelRatio")}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||f(this.activeTool)}get stationary(){return!this.animation&&!this.resizing&&(m(this.state)||this.state.stationary)}set qualityProfile(e){_e.isValidProfile(e)&&(_e.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||_e.getDefaultProfile()}set slicePlane(e){if(f(this._stage)&&this._stage.renderView.setRenderParameters({slicePlane:e}),m(e))return void this._set("slicePlane",null);const t=this.propertiesPool.get("slicePlane");N(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?Q(this.scale,this.spatialReference):0}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){var e,t,i;if(this.destroyed)return!1;let r=0,s=this.layerViewManager.updating,n=s?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((e=>{if(e.isFulfilled()){if(e.updating){if(s=!0,e.suspended||je(e))return;++n,r+=e.updatingProgress}}else++n}));for(const a of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this.featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(f(a)&&a.updating){const e=.1;n+=e,r+=.5*e}for(const a of[this.deconflictor,this.labeler,this.basemapTerrain])f(a)&&a.updating&&(++n,r+=a.updatingProgress);if(s=!!(s||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||this._createGraphicsViewController||null!=(e=this.inputManager)&&e.hasPendingInputs||null!=(t=this.map)&&null!=(i=t.allLayers)&&i.some((e=>!e.isFulfilled()))),s?(this._numUpdating=Math.max(n,this._numUpdating),r+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?r/=this._numUpdating:r=s?0:1,this._get("updatingProgress")!==r){const e=this._resourceController.scheduler.now;if(r<1){const t=Math.min((e-this._lastUpdateTime)/2e3,1);r=this.updatingProgress*(1-t)+r*t}this._set("updatingProgress",r),this._lastUpdateTime=s&&r<1?e:0}return s}get viewingMode(){var e;const t=this._predeterminedViewingMode;if(f(t))return re(t);const i=this.spatialReference;return f(null==(e=this.defaultsFromMap)?void 0:e.viewingMode)&&i&&i.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):!i||Xe(i,ie.Global)?"global":"local"}set viewingMode(e){this.ready?it.error("#viewingMode","viewingMode cannot be set once view is ready"):e?this._override("viewingMode",e):void 0===e&&this._clearOverride("viewingMode")}get resourceController(){return this._resourceController}get performanceInfo(){return new Te(this)}forceAnimationTime(e){this._stage.renderView.forcedAnimationTime=this.basemapTerrain.overlayManager.forcedAnimationTime=e}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return it.error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=f(i.graphics)&&(f(i.graphics.include)||f(i.graphics.exclude)),s=Qe(e)?$e(this,e):e,n=T(s);i.enableDraped=i.include&&!i.include.has(qe)||i.exclude&&i.exclude.has(qe);const a=this.sceneIntersectionHelper,o=He(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?Ue.ALL:Ue.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=Fe(e,this);if(m(t))return this._intersectResultToMapPoint(e);if(this._testGraphicUidFilter(i.graphics,t))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return it.error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=y(null==e.z&&be(this.elevationProvider,e),0);return D(e,lt,this.renderSpatialReference,t),this.state.camera.projectToScreen(lt,pt),O(pt[0],pt[1])}pixelSizeAt(e){return this.ready?e?(D(e,lt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(lt)):0:(it.error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return it.error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Qe(e)?$e(this,e):e,r=P(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=He(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=Ue.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=We(o,this),p=f(l)&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:De(o)?o.distanceInRenderSpace:0,layer:p}};return ve.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}popupHitTest(e){return ze(this,e).then((({results:t,ground:i})=>{let r=null;return!(0===t.length||Math.abs(y(t[0].distance,0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}))}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(m(e.parent))throw new o("view:no-analysisview-for-analysis","The analysis has not been added to an AnalysisLayer or SceneView.analyses",{analysis:e});if("analysis"===e.parent.type){return(await this.whenLayerView(e.parent)).whenAnalysisView(e)}return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}takeScreenshot(e){return this.whenReady().then((()=>{const t=Ne(e,this);return t.pixelRatio/=this.pixelRatio,this._stage.renderView.takeScreenshot(Be(t,this.supersampleScreenshotsEnabled,this.padding))}))}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,t,i,r;return this.map&&"initialViewProperties"in this.map&&(null==(e=this.map)||null==(t=e.initialViewProperties)?void 0:t.spatialReference)||(null==(i=this.defaultsFromMap)?void 0:i.spatialReference)||(null==(r=this.defaultsFromMap)?void 0:r.ready)&&this._initialDefaultSpatialReference||null}async validate(){let e=Ke(this.type);if(d("safari")&&d("safari")<9&&(e=new o("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:d("safari")})),f(e))throw it.warn("#validate()",e.message),e}get _predeterminedViewingMode(){var e,t;const i=this._isOverridden("viewingMode")?this._get("viewingMode"):null!=(e=this.map&&"initialViewProperties"in this.map?null==(t=this.map.initialViewProperties)?void 0:t.viewingMode:null)?e:null;return f(i)?se(i):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(f(i))return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Xe(e,i)&&(!!m(t)||(!X(t)||!m(Ie(t,e,i)))&&("voxel"!==t.type||i===ie.Local))}_makeSpatialReferenceConstraints(e,t,i){return t&&!X(t)&&"voxel"!==t.type&&(e.isWebMercator||e.isWGS84)?[{spatialReference:e,viewingMode:i},{spatialReference:e.isWebMercator?et.WGS84:et.WebMercator,viewingMode:i}]:t&&X(t)&&e.isWebMercator&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:et.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]}_validateSpatialReference(e){const t=f(this.getSpatialReferenceSupport({spatialReference:e})),i=this._predeterminedViewingMode;return t||(f(i)?it.warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&it.warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||et.WGS84;return F(e,this.renderSpatialReference,e,i)||(i=et.WGS84,F(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new tt(e,i),t}trackGraphicState(e){if(!e.graphic)return it.error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&f(t)&&"processor"in t&&t.processor&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return f(t)?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return p(e.map((e=>this.highlight(e))));if(n.isCollection(e))return p(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):h()}maskOccludee(e){if(!e)return it.error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&f(t)&&ke(t)&&(i=t.maskOccludee(e))};return f(t)?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,f(i)&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){f(this.graphicsView)&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await S(this,"graphicsView"),this.graphicsView;if(!e.layer||!this.map)throw new o("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{-1!==s.added.indexOf(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ot.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ot.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(lt)?(t=this.computeMapPointFromVec3d(lt,t),e.intersector===Ae.TERRAIN&&this.basemapTerrain&&(t.z=y(be(this.basemapTerrain,t),0)),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=We(n,this);if(f(a)&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=Fe(n,this);if(!f(o))continue;if(m(r)&&s!==e.length-1&&(r=new Set),f(r)){const e=this._getGraphicFilterUid(o);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o))continue;const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({graphic:o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return m(e)||(m(e.include)||e.include.has(i))&&(m(e.exclude)||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,s={layerUids:null,graphicUids:null}){if(!e)return s;if(e instanceof i)nt(s,this._getGraphicFilterUid(e)),t===ot.INCLUDE&&(f(this.graphicsView)&&e.layer===this?st(s,this.graphicsView.processor.layer.id):e.layer&&st(s,e.layer.uid));else if(c(e))for(const i of e)i===this.graphics&&f(this.graphicsView)?st(s,this.graphicsView.processor.layer.id):i instanceof r?i===this.map.ground&&st(s,qe):this._externalToInternalRenderItems(i,t,s);else st(s,e.uid);return s}_initBasemapTerrain(){this._set("basemapTerrain",new Ee({view:this})),this._set("elevationProvider",new we({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Pe({view:this})),this._set("featureTiles",new ge({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.contentCameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain&&this.basemapTerrain.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=f(this.basemapTerrain.extent)?A(z(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;f(this.clippingArea)?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.handles.add([this.updatingHandles.add((()=>ve.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this.featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this.featureTreeDebugger&&ve.FEATURE_TILE_TREE_SHOW_TILES&&(this.featureTreeDebugger=new e({view:this}))})):e||!this.featureTreeDebugger||ve.FEATURE_TILE_TREE_SHOW_TILES||(this.featureTreeDebugger.destroy(),this.featureTreeDebugger=null)}),b),this.updatingHandles.add((()=>this.clippingArea),e,b),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,b)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.deinit(),this.handles.remove("render-coords-helper"),this.handles.remove("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Re(this.map,e));const t=this.state.isGlobal,i=B(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ve.create(this.state.viewingMode,i)),t||this.handles.add(this.watch("basemapTerrain.extent",(e=>{const t=this.renderCoordsHelper.spatialReference;0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!W(e,this.basemapTerrain.spatialReference,ht,t)||(this.renderCoordsHelper.extent=ht)}),!0),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Le/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.handles.remove("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){f(e)&&e.type===w.MOVE||(this.handles.remove("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.handles.add([e.watch(["updating","updatingProgress"],(()=>this._updatingChanged()),!0)],"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,canvas:this.renderCanvas,screenshot:{renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ye(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=a(this.surface),{resourceController:r,state:s,renderSpatialReference:n}=this;this._stage=new Ge({options:e,container:i,resourceController:r,state:s,sceneIntersectionHelper:t,renderSR:n}),this._stage.renderView.setRenderParameters({slicePlane:this.slicePlane}),this._lostWebGLContextHandle=l(this._stage.renderView.canvas,"webglcontextlost",(()=>this.fatalError=new o("webgl-context-lost"))),this.handles.add([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderView.setRenderParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),_),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(()=>this._stage.renderView.setRenderParameters({highQualityTransparency:this.qualitySettings.highQualityTransparency})),_),x(this,"magnifier",(e=>this._stage.renderView.magnifier=e),!0)],"stage");const p=()=>{this._stage.renderView.setRenderParameters({defaultHighlightOptions:Me.toEngineOptions(this.highlightOptions)})};this.handles.add(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),p),"stage"),p(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Le/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage.destroy(),this._stage=null,this._lostWebGLContextHandle.remove(),this._lostWebGLContextHandle=null,this.handles.remove("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Oe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state,objectResourceCache:new ue})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.handles.remove("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;v(e),await V(this.basemapTerrain,"ready",e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.handles.remove("graphics-view"),f(this.graphicsView)&&(this.handles.remove(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=se(this.viewingMode);if(e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.handles.add(R(this,"graphics","after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.handles.remove("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(qe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(qe);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultToMapOptions.exclude.add(e.uid)}}getVoxelWasmPerSceneView(){return $.getInstance().getVoxelWasmPerSceneView(this)}};function st(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function nt(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function at(e,t){return f(e)&&U(e.spatialReference,t)?A(e,t):null}var ot;e([E()],rt.prototype,"_userClippingArea",void 0),e([E()],rt.prototype,"_resourceController",void 0),e([E()],rt.prototype,"_stage",void 0),e([E({readOnly:!0})],rt.prototype,"deconflictor",void 0),e([E({readOnly:!0})],rt.prototype,"labeler",void 0),e([E({type:te,readOnly:!0,aliasOf:"state.animation"})],rt.prototype,"animation",void 0),e([E({readOnly:!0})],rt.prototype,"basemapTerrain",void 0),e([E({readOnly:!0})],rt.prototype,"elevationProvider",void 0),e([E({type:t,aliasOf:"stateManager.camera"})],rt.prototype,"camera",void 0),e([E({type:t,aliasOf:"stateManager.contentCamera"})],rt.prototype,"contentCamera",void 0),e([E({readOnly:!0})],rt.prototype,"canvas",void 0),e([E({type:tt,aliasOf:"stateManager.center"})],rt.prototype,"center",void 0),e([E({type:Ye})],rt.prototype,"clippingArea",null),e([E({type:oe})],rt.prototype,"constraints",void 0),e([E({type:Ye,readOnly:!0})],rt.prototype,"renderDataExtent",null),e([E({type:Ye,readOnly:!0})],rt.prototype,"dataExtent",null),e([E({type:Ye,readOnly:!0})],rt.prototype,"groundAndLayersExtent",null),e([E({value:null,type:le})],rt.prototype,"environment",null),e([j("environment")],rt.prototype,"castEnvironment",null),e([E({readOnly:!0})],rt.prototype,"environmentManager",void 0),e([E({type:Ye,aliasOf:"stateManager.extent"})],rt.prototype,"extent",void 0),e([E()],rt.prototype,"floors",void 0),e([E({readOnly:!0,aliasOf:"stateManager.screenCenter"})],rt.prototype,"screenCenter",void 0),e([E({type:Number})],rt.prototype,"pixelRatio",null),e([E({type:Number,dependsOn:["qualitySettings.maximumPixelRatio","qualitySettings.maximumRenderResolution","size"]})],rt.prototype,"maximumPixelRatio",null),e([E({aliasOf:"stateManager.frustum"})],rt.prototype,"frustum",void 0),e([E({type:Number,readOnly:!0})],rt.prototype,"fullOpacity",void 0),e([E({readOnly:!0})],rt.prototype,"graphicsView",void 0),e([E({readOnly:!0})],rt.prototype,"analysisViewManager",void 0),e([E()],rt.prototype,"groundView",void 0),e([E({type:Boolean})],rt.prototype,"initialExtentRequired",null),e([E()],rt.prototype,"_defaultsFromMapSettings",null),e([E({type:Boolean,readOnly:!0})],rt.prototype,"interacting",null),e([E()],rt.prototype,"stationary",null),e([E({aliasOf:"state.navigating"})],rt.prototype,"navigating",void 0),e([E()],rt.prototype,"map",void 0),e([E({readOnly:!0})],rt.prototype,"mapCoordsHelper",void 0),e([E({aliasOf:"stateManager.padding"})],rt.prototype,"padding",void 0),e([E({type:Pe,readOnly:!0})],rt.prototype,"pointsOfInterest",void 0),e([E({type:ge,readOnly:!0})],rt.prototype,"featureTiles",void 0),e([E()],rt.prototype,"featureTreeDebugger",void 0),e([E({type:Boolean})],rt.prototype,"screenSizePerspectiveEnabled",void 0),e([E({constructOnly:!0})],rt.prototype,"deactivatedWebGLExtensions",void 0),e([E({constructOnly:!0})],rt.prototype,"debugWebGLExtensions",void 0),e([E({constructOnly:!0})],rt.prototype,"renderCanvas",void 0),e([E({constructOnly:!0})],rt.prototype,"state",void 0),e([E({readOnly:!0})],rt.prototype,"inputManager",void 0),e([E({readOnly:!0})],rt.prototype,"stateManager",void 0),e([E({type:["low","medium","high"]})],rt.prototype,"qualityProfile",null),e([E({type:xe,get(){let e=this._get("qualitySettings");return e||(e=new xe,_e.apply(this.qualityProfile,e)),e}})],rt.prototype,"qualitySettings",void 0),e([E()],rt.prototype,"slicePlane",null),e([E({readOnly:!0})],rt.prototype,"typeSpecificPreconditionsReady",null),e([E({readOnly:!0})],rt.prototype,"renderCoordsHelper",void 0),e([E({readOnly:!0})],rt.prototype,"sceneIntersectionHelper",void 0),e([E({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],rt.prototype,"resolution",null),e([E({type:Number,aliasOf:"stateManager.scale"})],rt.prototype,"scale",void 0),e([E()],rt.prototype,"heightModelInfo",null),e([E()],rt.prototype,"spatialReference",void 0),e([E({type:Boolean,constructOnly:!0})],rt.prototype,"alphaCompositingEnabled",void 0),e([E({type:Boolean})],rt.prototype,"supersampleScreenshotsEnabled",void 0),e([E({readOnly:!0})],rt.prototype,"type",void 0),e([E({type:Ze})],rt.prototype,"ui",void 0),e([E({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating"]})],rt.prototype,"updating",null),e([E({type:Number,readOnly:!0,dependsOn:["updating"]})],rt.prototype,"updatingProgress",void 0),e([E({type:["global","local"]})],rt.prototype,"viewingMode",null),e([E({type:s,aliasOf:"stateManager.viewpoint"})],rt.prototype,"viewpoint",void 0),e([E({type:Number,aliasOf:"stateManager.zoom"})],rt.prototype,"zoom",void 0),e([E({type:Me})],rt.prototype,"highlightOptions",void 0),rt=e([I("esri.views.SceneView")],rt),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ot||(ot={}));const lt=H(),pt=P(),ht=q(),dt=rt;export{dt 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{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as o}from"../../../core/MapUtils.js";import{isSome as i,unwrap as n,isNone as a}from"../../../core/maybe.js";import{eachAlwaysValues as s,throwIfAborted as c}from"../../../core/promiseUtils.js";import{init as u}from"../../../core/watchUtils.js";import{property as l}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{c as p}from"../../../chunks/vec3f64.js";import{SnappingTypes as h}from"../../../layers/graphics/data/QueryEngineResult.js";import{RayConstraint as g}from"./SnappingConstraint.js";import{sortCandidatesInPlace as y,anyMapPointToRender as f,anyMapPointToScreenPoint as S}from"./snappingUtils.js";import{EdgeSnappingCandidate as m}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as v}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as w,OtherVertexType as _}from"./candidates/RightAngleSnappingCandidate.js";import{WatchFlags as j}from"../../support/WatchUpdatingTracking.js";let x=class extends t{constructor(e){super(e),this.sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null}}}get updating(){return o(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){var e;const t=this._get("snappingSources")||new Map,r=new Map;if(null!=(e=this.options)&&e.featureSources)for(const o of this.options.featureSources.items){const e=o.layer.uid,n=t.get(e);if(n){t.delete(e),r.set(e,n);continue}if(!o.layer.loaded){this.updatingHandles.addPromise(o.layer.load());continue}const a=this._createSourceInfo(o);i(a)&&r.set(e,a)}for(const[,o]of t)o.destroy();return r}initialize(){this.updatingHandles.add(this,"snappingSources",(()=>{this.notifyChange("updating")}),j.SYNC),i(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r){if(!this.options.effectiveFeatureEnabled)return[];const o=[],n=this._computeScreeenSizeDistanceParameters(e,t),a={distance:n,point:e,coordinateHelper:t.coordinateHelper,types:this.types,filter:null};for(const[,{snappingSource:s,layerView:c}]of this.snappingSources)!s.layerSource.enabled||i(c)&&c.suspended||o.push(s.fetchCandidates(a,r).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,t.excludeFeature))))));const u=(await s(o)).flat();return this._addRightAngleCandidates(u,e,n,t),c(r),y(e,u),u}_addRightAngleCandidates(e,t,r,o){var a,s,c,u,l,d,p,h;const g=i(o.vertexHandle)?null==(a=o.vertexHandle.rightEdge)||null==(s=a.rightVertex)?void 0:s.pos:i(o.editGeometryOperations)&&"polygon"===o.editGeometryOperations.data.type?null==(c=n(null==(u=o.editGeometryOperations.data.components[0])?void 0:u.getFirstVertex()))?void 0:c.pos:null,y=i(o.vertexHandle)?null==(l=o.vertexHandle.leftEdge)||null==(d=l.leftVertex)?void 0:d.pos:i(o.editGeometryOperations)?null==(p=n(null==(h=o.editGeometryOperations.data.components[0])?void 0:h.getLastVertex()))?void 0:p.pos:null,f=e.length;for(let i=0;i<f;i++)this._addRightAngleCandidate(e[i],y,t,r,o,e),this._addRightAngleCandidate(e[i],g,t,r,o,e)}_addRightAngleCandidate(e,t,r,o,i,n){if(a(t)||!(e instanceof m))return;const s=e.constraint.closestTo(t),c=(s[0]-r[0])/o.x,u=(s[1]-r[1])/o.y;if(c*c+u*u<=1){const r=i.coordinateHelper;n.push(new w({coordinateHelper:r,targetPoint:s,otherVertex:t,otherVertexType:_.NEXT,previousVertex:e.constraint.start,constraint:new g(r,t,s),objectId:e.objectId}))}}_computeScreeenSizeDistanceParameters(e,t){const r=this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1);return a(this.view)?{x:r,y:r}:"2d"===this.view.type?{x:r*this.view.resolution,y:r*this.view.resolution}:this._computeScreeenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreeenSizeDistanceParameters3D(e,t,r,o){const{coordinateHelper:i,elevationInfo:n}=o,a=r.state.camera.computeScreenPixelSizeAt(f(e,i,n,r,H))*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,s=t*a;return{x:s/this._computeScreenMagnitudeOfMapOffset(e,a,0,r,o),y:s/this._computeScreenMagnitudeOfMapOffset(e,0,a,r,o)}}_computeScreenMagnitudeOfMapOffset(e,t,r,o,{coordinateHelper:i,elevationInfo:n}){const a=i.clone(e);a[0]+=t,a[1]+=r;const s=S(e,i,n,o),c=S(a,i,n,o),u=c.x-s.x,l=c.y-s.y;return Math.sqrt(u*u+l*l)}get types(){return h.EDGE|h.VERTEX}_candidateIsExcluded(e,t,r){if(a(r))return!1;const o=this._getCandidateObjectId(t);if(a(o))return!1;const i=e.layerSource.layer;return"graphics"===i.type?r.uid===o:r.sourceLayer===i&&(!(!r.attributes||!("objectIdField"in i))&&r.attributes[i.objectIdField]===o)}_getCandidateObjectId(e){return e instanceof v?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(a(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=i(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new C(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e)}return null}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":{const t=this._getSourceModule("featureService");return i(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return i(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return i(t.module)?{source:new t.module.GraphicsSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this.sourceModules[e];if(a(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){switch(e){case"featureService":return this.updatingHandles.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return this.updatingHandles.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":return this.updatingHandles.addPromise(import("./featureSources/GraphicsSnappingSource.js"))}return null}};e([l({constructOnly:!0})],x.prototype,"spatialReference",void 0),e([l({constructOnly:!0})],x.prototype,"view",void 0),e([l()],x.prototype,"options",void 0),e([l({readOnly:!0})],x.prototype,"updating",null),e([l({readOnly:!0})],x.prototype,"snappingSources",null),x=e([d("esri.views.interactive.snapping.FeatureSnappingEngine")],x);class C{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const o=this.snappingSource.layerSource.layer;if("refresh"in o){const t=o;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([u(e,"updating",(t=>e.layerSource.updating=t),!0),u(e,"availability",(t=>e.layerSource.availability=t),!0)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}const H=p();export{x as FeatureSnappingEngine};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as o}from"../../../core/MapUtils.js";import{isSome as i,unwrap as n,isNone as a}from"../../../core/maybe.js";import{eachAlwaysValues as s,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u}from"../../../core/reactiveUtils.js";import{init as l}from"../../../core/watchUtils.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 p}from"../../../core/accessorSupport/decorators/subclass.js";import{c as h}from"../../../chunks/vec3f64.js";import{SnappingTypes as g}from"../../../layers/graphics/data/QueryEngineResult.js";import{RayConstraint as y}from"./SnappingConstraint.js";import{sortCandidatesInPlace as f,anyMapPointToRender as S,anyMapPointToScreenPoint as m}from"./snappingUtils.js";import{EdgeSnappingCandidate as v}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as w}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as _,OtherVertexType as j}from"./candidates/RightAngleSnappingCandidate.js";let x=class extends t{constructor(e){super(e),this.sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null}}}get updating(){return o(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){var e;const t=this._get("snappingSources")||new Map,r=new Map;if(null!=(e=this.options)&&e.featureSources)for(const o of this.options.featureSources.items){const e=o.layer.uid,n=t.get(e);if(n){t.delete(e),r.set(e,n);continue}if(!o.layer.loaded){this.updatingHandles.addPromise(o.layer.load());continue}const a=this._createSourceInfo(o);i(a)&&r.set(e,a)}for(const[,o]of t)o.destroy();return r}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),i(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r){if(!this.options.effectiveFeatureEnabled)return[];const o=[],n=this._computeScreeenSizeDistanceParameters(e,t),a={distance:n,point:e,coordinateHelper:t.coordinateHelper,types:this.types,filter:null};for(const[,{snappingSource:s,layerView:c}]of this.snappingSources)!s.layerSource.enabled||i(c)&&c.suspended||o.push(s.fetchCandidates(a,r).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,t.excludeFeature))))));const u=(await s(o)).flat();return this._addRightAngleCandidates(u,e,n,t),c(r),f(e,u),u}_addRightAngleCandidates(e,t,r,o){var a,s,c,u,l,d,p,h;const g=i(o.vertexHandle)?null==(a=o.vertexHandle.rightEdge)||null==(s=a.rightVertex)?void 0:s.pos:i(o.editGeometryOperations)&&"polygon"===o.editGeometryOperations.data.type?null==(c=n(null==(u=o.editGeometryOperations.data.components[0])?void 0:u.getFirstVertex()))?void 0:c.pos:null,y=i(o.vertexHandle)?null==(l=o.vertexHandle.leftEdge)||null==(d=l.leftVertex)?void 0:d.pos:i(o.editGeometryOperations)?null==(p=n(null==(h=o.editGeometryOperations.data.components[0])?void 0:h.getLastVertex()))?void 0:p.pos:null,f=e.length;for(let i=0;i<f;i++)this._addRightAngleCandidate(e[i],y,t,r,o,e),this._addRightAngleCandidate(e[i],g,t,r,o,e)}_addRightAngleCandidate(e,t,r,o,i,n){if(a(t)||!(e instanceof v))return;const s=e.constraint.closestTo(t),c=(s[0]-r[0])/o.x,u=(s[1]-r[1])/o.y;if(c*c+u*u<=1){const r=i.coordinateHelper;n.push(new _({coordinateHelper:r,targetPoint:s,otherVertex:t,otherVertexType:j.NEXT,previousVertex:e.constraint.start,constraint:new y(r,t,s),objectId:e.objectId}))}}_computeScreeenSizeDistanceParameters(e,t){const r=this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1);return a(this.view)?{x:r,y:r}:"2d"===this.view.type?{x:r*this.view.resolution,y:r*this.view.resolution}:this._computeScreeenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreeenSizeDistanceParameters3D(e,t,r,o){const{coordinateHelper:i,elevationInfo:n}=o,a=r.state.camera.computeScreenPixelSizeAt(S(e,i,n,r,H))*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,s=t*a;return{x:s/this._computeScreenMagnitudeOfMapOffset(e,a,0,r,o),y:s/this._computeScreenMagnitudeOfMapOffset(e,0,a,r,o)}}_computeScreenMagnitudeOfMapOffset(e,t,r,o,{coordinateHelper:i,elevationInfo:n}){const a=i.clone(e);a[0]+=t,a[1]+=r;const s=m(e,i,n,o),c=m(a,i,n,o),u=c.x-s.x,l=c.y-s.y;return Math.sqrt(u*u+l*l)}get types(){return g.EDGE|g.VERTEX}_candidateIsExcluded(e,t,r){if(a(r))return!1;const o=this._getCandidateObjectId(t);if(a(o))return!1;const i=e.layerSource.layer;return"graphics"===i.type?r.uid===o:r.sourceLayer===i&&(!(!r.attributes||!("objectIdField"in i))&&r.attributes[i.objectIdField]===o)}_getCandidateObjectId(e){return e instanceof w?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(a(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=i(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new C(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e)}return null}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":{const t=this._getSourceModule("featureService");return i(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return i(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return i(t.module)?{source:new t.module.GraphicsSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this.sourceModules[e];if(a(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){switch(e){case"featureService":return this.updatingHandles.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return this.updatingHandles.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":return this.updatingHandles.addPromise(import("./featureSources/GraphicsSnappingSource.js"))}return null}};e([d({constructOnly:!0})],x.prototype,"spatialReference",void 0),e([d({constructOnly:!0})],x.prototype,"view",void 0),e([d()],x.prototype,"options",void 0),e([d({readOnly:!0})],x.prototype,"updating",null),e([d({readOnly:!0})],x.prototype,"snappingSources",null),x=e([p("esri.views.interactive.snapping.FeatureSnappingEngine")],x);class C{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const o=this.snappingSource.layerSource.layer;if("refresh"in o){const t=o;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l(e,"updating",(t=>e.layerSource.updating=t),!0),l(e,"availability",(t=>e.layerSource.availability=t),!0)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}const H=h();export{x as FeatureSnappingEngine};
@@ -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 r from"../../../../core/Accessor.js";import{HandleOwnerMixin as t}from"../../../../core/HandleOwner.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{isSome as s}from"../../../../core/maybe.js";import{watch as a,sync as o,initial as n}from"../../../../core/reactiveUtils.js";import{property as l}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{FeatureServiceTiles2D as p}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as c}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{convertSnappingCandidate as d}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as h}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as f}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as m}from"./featureServiceSource/FeatureServiceTilesSimple.js";import y from"../../../support/debugFlags.js";import{WatchFlags as g}from"../../../support/WatchUpdatingTracking.js";let S=class extends(t(r)){constructor(e){super(e)}get updateTilesParameters(){return{tiles:this.tilesOfInterest.tiles,tileInfo:this.tilesOfInterest.tileInfo,tileSize:this.tilesOfInterest.tileSize}}get updating(){return this.workerHandle.updating||this.updatingHandles.updating}get configuration(){return{filter:this.layer.createQuery(),customParameters:this.layer.customParameters}}get availability(){return this.workerHandle.availability}get layer(){return this.layerSource.layer}initialize(){const e=this.view;if(s(e))switch(e.type){case"2d":this.tilesOfInterest=new p({view:e,layer:this.layer}),this.workerHandle=new f;break;case"3d":{const r=e.resourceController;this.tilesOfInterest=new c({view:e}),this.workerHandle=new f({schedule:e=>r.schedule(e)});break}}else this.tilesOfInterest=new m({layer:this.layer}),this.workerHandle=new f;this.handles.add([i(this.workerHandle)]),this.workerHandle.setup({layer:this.layer,spatialReference:this.spatialReference,configuration:this.configuration},null),this.updatingHandles.add(this,"updateTilesParameters",(()=>this.workerHandle.updateTiles(this.updateTilesParameters,null)),g.INIT),this.handles.add([a((()=>this.configuration),(e=>this.workerHandle.configure(e,null)),o)]),s(e)&&this.handles.add(a((()=>y.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES),(r=>{r&&!this.debug?(this.debug=new h({view:e,handle:this.workerHandle}),this.handles.add(i(this.debug),"debug")):!r&&this.debug&&this.handles.remove("debug")}),n)),this.handles.add(this.layerSource.layer.on("apply-edits",(e=>{this.workerHandle.applyEdits(e,null)})))}refresh(){this.workerHandle.refresh(null)}async fetchCandidates(e,r){return this.tilesOfInterest.pointOfInterest=e.coordinateHelper.vectorToPoint(e.point),(await this.workerHandle.fetchCandidates({...e,filter:null},r)).candidates.map((r=>d(r,e.coordinateHelper)))}getDebugInfo(e){return this.workerHandle.getDebugInfo(e)}};e([l({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([l({constructOnly:!0})],S.prototype,"layerSource",void 0),e([l({constructOnly:!0})],S.prototype,"view",void 0),e([l()],S.prototype,"tilesOfInterest",void 0),e([l({readOnly:!0})],S.prototype,"updateTilesParameters",null),e([l({readOnly:!0})],S.prototype,"updating",null),e([l({readOnly:!0})],S.prototype,"configuration",null),e([l({readOnly:!0})],S.prototype,"availability",null),S=e([u("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],S);export{S as FeatureServiceSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{HandleOwnerMixin as t}from"../../../../core/HandleOwner.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{isSome as s}from"../../../../core/maybe.js";import{initial as a,watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{property as l}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{FeatureServiceTiles2D as c}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as d}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{convertSnappingCandidate as p}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as h}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as f}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as m}from"./featureServiceSource/FeatureServiceTilesSimple.js";import y from"../../../support/debugFlags.js";let g=class extends(t(r)){constructor(e){super(e)}get updateTilesParameters(){return{tiles:this.tilesOfInterest.tiles,tileInfo:this.tilesOfInterest.tileInfo,tileSize:this.tilesOfInterest.tileSize}}get updating(){return this.workerHandle.updating||this.updatingHandles.updating}get configuration(){return{filter:this.layer.createQuery(),customParameters:this.layer.customParameters}}get availability(){return this.workerHandle.availability}get layer(){return this.layerSource.layer}initialize(){const e=this.view;if(s(e))switch(e.type){case"2d":this.tilesOfInterest=new c({view:e,layer:this.layer}),this.workerHandle=new f;break;case"3d":{const r=e.resourceController;this.tilesOfInterest=new d({view:e}),this.workerHandle=new f({schedule:e=>r.schedule(e)});break}}else this.tilesOfInterest=new m({layer:this.layer}),this.workerHandle=new f;this.handles.add([i(this.workerHandle)]),this.workerHandle.setup({layer:this.layer,spatialReference:this.spatialReference,configuration:this.configuration},null),this.updatingHandles.add((()=>this.updateTilesParameters),(()=>this.workerHandle.updateTiles(this.updateTilesParameters,null)),a),this.handles.add([o((()=>this.configuration),(e=>this.workerHandle.configure(e,null)),n)]),s(e)&&this.handles.add(o((()=>y.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES),(r=>{r&&!this.debug?(this.debug=new h({view:e,handle:this.workerHandle}),this.handles.add(i(this.debug),"debug")):!r&&this.debug&&this.handles.remove("debug")}),a)),this.handles.add(this.layerSource.layer.on("apply-edits",(e=>{this.workerHandle.applyEdits(e,null)})))}refresh(){this.workerHandle.refresh(null)}async fetchCandidates(e,r){return this.tilesOfInterest.pointOfInterest=e.coordinateHelper.vectorToPoint(e.point),(await this.workerHandle.fetchCandidates({...e,filter:null},r)).candidates.map((r=>p(r,e.coordinateHelper)))}getDebugInfo(e){return this.workerHandle.getDebugInfo(e)}};e([l({constructOnly:!0})],g.prototype,"spatialReference",void 0),e([l({constructOnly:!0})],g.prototype,"layerSource",void 0),e([l({constructOnly:!0})],g.prototype,"view",void 0),e([l()],g.prototype,"tilesOfInterest",void 0),e([l({readOnly:!0})],g.prototype,"updateTilesParameters",null),e([l({readOnly:!0})],g.prototype,"updating",null),e([l({readOnly:!0})],g.prototype,"configuration",null),e([l({readOnly:!0})],g.prototype,"availability",null),g=e([u("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],g);export{g as FeatureServiceSnappingSource};
@@ -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{removeUnordered as r}from"../../../../core/arrayUtils.js";import{HandleOwnerMixin as s}from"../../../../core/HandleOwner.js";import{isSome as o,isNone as i}from"../../../../core/maybe.js";import{eachAlwaysValues as a,createTask as n}from"../../../../core/promiseUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../geometry/Polygon.js";import{canProjectWithoutEngine as l,project as u,initializeProjection as h}from"../../../../geometry/projection.js";import{normalizeCentralMeridianSync as m}from"../../../../geometry/support/normalizeUtilsSync.js";import{featureGeometryTypeKebabDictionary as y}from"../../../../geometry/support/typeUtils.js";import{convertFromGeometry as f}from"../../../../layers/graphics/featureConversionUtils.js";import g from"../../../../layers/graphics/OptimizedFeature.js";import S from"../../../../layers/graphics/data/FeatureStore.js";import _ from"../../../../layers/graphics/data/QueryEngine.js";import{sortCandidatesInPlace as j}from"../snappingUtils.js";import{convertSnappingCandidate as w}from"./queryEngineUtils.js";let v=class extends(s(t)){constructor(e){super(e),this.availability=1,this.sources={multipoint:null,point:null,polygon:null,polyline:null},this.loadedWkids=new Set,this.loadedWkts=new Set,this.pendingAdds=[]}get updating(){return this.updatingHandles.updating}get layer(){return this.layerSource.layer}destroy(){const e=this.pendingAdds;this.pendingAdds.length=0;for(const t of e)t.task.abort();this._mapSources((e=>this._destroySource(e)))}initialize(){this.handles.add([this.layer.on("graphic-update",(e=>this._onGraphicUpdate(e))),this.updatingHandles.addOnCollectionChange(this.layer.graphics,(e=>this._onGraphicsChanged(e)))]),this._addMany(this.layer.graphics.toArray())}async fetchCandidates(e,t){const r=await a(this._mapSources((r=>r.queryEngine.executeQueryForSnapping({point:e.coordinateHelper.vectorToPoint(e.point).toJSON(),distance:e.distance,types:e.types,query:o(e.filter)?e.filter.createQuery().toJSON():{where:"1=1"}},t).then((({candidates:e})=>e))))),s=r.flat().map((t=>w(t,e.coordinateHelper)));return j(e.point,s),s}refresh(){}_onGraphicUpdate(e){switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],r=new Map;for(const s of e)i(s.geometry)||(this._needsInitializeProjection(s.geometry.spatialReference)?(t.push(s.geometry.spatialReference),r.set(s.uid,s)):this._add(s));this._createPendingAdd(t,r)}_createPendingAdd(e,t){if(!e.length)return;const s=n((async r=>{await h(e.map((e=>({source:e,dest:this.spatialReference}))),{signal:r}),this._markLoadedSpatialReferences(e);for(const[,e]of t)this._add(e)}));this.updatingHandles.addPromise(s.promise);const o={task:s,graphics:t},i=()=>r(this.pendingAdds,o);s.promise.then(i,i),this.pendingAdds.push(o)}_markLoadedSpatialReferences(e){for(const t of e)null!=t.wkid&&this.loadedWkids.add(t.wkid),null!=t.wkt&&this.loadedWkts.add(t.wkt)}_add(e){if(i(e.geometry)||!e.visible)return;let t=e.geometry;if("mesh"===t.type)return;"extent"===t.type&&(t=c.fromExtent(t));const r=this._ensureSource(t.type);if(i(r))return;const s=this._createOptimizedFeature(e.uid,t);o(s)&&r.featureStore.add(s)}_needsInitializeProjection(e){return(null==e.wkid||!this.loadedWkids.has(e.wkid))&&((null==e.wkt||!this.loadedWkts.has(e.wkt))&&!l(e,this.spatialReference))}_createOptimizedFeature(e,t){const r=u(m(t),this.spatialReference);return r?new g(f(r,!1,!1),{[k]:e},null,e):null}_ensureSource(e){const t=this.sources[e];if(o(t))return t;const r=this._createSource(e);return this.sources[e]=r,r}_createSource(e){const t=y.toJSON(e),r=new S({geometryType:t,hasZ:!1,hasM:!1});return{featureStore:r,queryEngine:new _({featureStore:r,fields:[{name:k,type:"esriFieldTypeOID",alias:k}],geometryType:t,hasM:!1,hasZ:!1,objectIdField:k,spatialReference:this.spatialReference,scheduler:o(this.view)&&"3d"===this.view.type?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources((t=>this._removeFromSource(t,e)));for(const t of this.pendingAdds)t.graphics.delete(e.uid),0===t.graphics.size&&t.task.abort()}_removeFromSource(e,t){const r=t.uid;e.featureStore.has(r)&&e.featureStore.removeById(t.uid)}_destroySource(e){e.queryEngine.destroy(),this.sources[e.type]=null}_mapSources(e){const{point:t,polygon:r,polyline:s,multipoint:i}=this.sources,a=[];return o(t)&&a.push(e(t)),o(r)&&a.push(e(r)),o(s)&&a.push(e(s)),o(i)&&a.push(e(i)),a}};e([p({constructOnly:!0})],v.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],v.prototype,"layerSource",void 0),e([p({constructOnly:!0})],v.prototype,"view",void 0),e([p({readOnly:!0})],v.prototype,"updating",null),e([p({readOnly:!0})],v.prototype,"availability",void 0),v=e([d("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],v);const k="OBJECTID";export{v as GraphicsSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{removeUnordered as r}from"../../../../core/arrayUtils.js";import{HandleOwnerMixin as s}from"../../../../core/HandleOwner.js";import{isSome as o,isNone as i}from"../../../../core/maybe.js";import{eachAlwaysValues as a,createTask as n}from"../../../../core/promiseUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import c from"../../../../geometry/Polygon.js";import{canProjectWithoutEngine as l,project as u,initializeProjection as h}from"../../../../geometry/projection.js";import{normalizeCentralMeridianSync as m}from"../../../../geometry/support/normalizeUtilsSync.js";import{featureGeometryTypeKebabDictionary as y}from"../../../../geometry/support/typeUtils.js";import{convertFromGeometry as f}from"../../../../layers/graphics/featureConversionUtils.js";import g from"../../../../layers/graphics/OptimizedFeature.js";import S from"../../../../layers/graphics/data/FeatureStore.js";import _ from"../../../../layers/graphics/data/QueryEngine.js";import{sortCandidatesInPlace as j}from"../snappingUtils.js";import{convertSnappingCandidate as w}from"./queryEngineUtils.js";let v=class extends(s(t)){constructor(e){super(e),this.availability=1,this.sources={multipoint:null,point:null,polygon:null,polyline:null},this.loadedWkids=new Set,this.loadedWkts=new Set,this.pendingAdds=[]}get updating(){return this.updatingHandles.updating}get layer(){return this.layerSource.layer}destroy(){const e=this.pendingAdds;this.pendingAdds.length=0;for(const t of e)t.task.abort();this._mapSources((e=>this._destroySource(e)))}initialize(){this.handles.add([this.layer.on("graphic-update",(e=>this._onGraphicUpdate(e))),this.updatingHandles.addOnCollectionChange((()=>this.layer.graphics),(e=>this._onGraphicsChanged(e)))]),this._addMany(this.layer.graphics.toArray())}async fetchCandidates(e,t){const r=await a(this._mapSources((r=>r.queryEngine.executeQueryForSnapping({point:e.coordinateHelper.vectorToPoint(e.point).toJSON(),distance:e.distance,types:e.types,query:o(e.filter)?e.filter.createQuery().toJSON():{where:"1=1"}},t).then((({candidates:e})=>e))))),s=r.flat().map((t=>w(t,e.coordinateHelper)));return j(e.point,s),s}refresh(){}_onGraphicUpdate(e){switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],r=new Map;for(const s of e)i(s.geometry)||(this._needsInitializeProjection(s.geometry.spatialReference)?(t.push(s.geometry.spatialReference),r.set(s.uid,s)):this._add(s));this._createPendingAdd(t,r)}_createPendingAdd(e,t){if(!e.length)return;const s=n((async r=>{await h(e.map((e=>({source:e,dest:this.spatialReference}))),{signal:r}),this._markLoadedSpatialReferences(e);for(const[,e]of t)this._add(e)}));this.updatingHandles.addPromise(s.promise);const o={task:s,graphics:t},i=()=>r(this.pendingAdds,o);s.promise.then(i,i),this.pendingAdds.push(o)}_markLoadedSpatialReferences(e){for(const t of e)null!=t.wkid&&this.loadedWkids.add(t.wkid),null!=t.wkt&&this.loadedWkts.add(t.wkt)}_add(e){if(i(e.geometry)||!e.visible)return;let t=e.geometry;if("mesh"===t.type)return;"extent"===t.type&&(t=c.fromExtent(t));const r=this._ensureSource(t.type);if(i(r))return;const s=this._createOptimizedFeature(e.uid,t);o(s)&&r.featureStore.add(s)}_needsInitializeProjection(e){return(null==e.wkid||!this.loadedWkids.has(e.wkid))&&((null==e.wkt||!this.loadedWkts.has(e.wkt))&&!l(e,this.spatialReference))}_createOptimizedFeature(e,t){const r=u(m(t),this.spatialReference);return r?new g(f(r,!1,!1),{[k]:e},null,e):null}_ensureSource(e){const t=this.sources[e];if(o(t))return t;const r=this._createSource(e);return this.sources[e]=r,r}_createSource(e){const t=y.toJSON(e),r=new S({geometryType:t,hasZ:!1,hasM:!1});return{featureStore:r,queryEngine:new _({featureStore:r,fields:[{name:k,type:"esriFieldTypeOID",alias:k}],geometryType:t,hasM:!1,hasZ:!1,objectIdField:k,spatialReference:this.spatialReference,scheduler:o(this.view)&&"3d"===this.view.type?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources((t=>this._removeFromSource(t,e)));for(const t of this.pendingAdds)t.graphics.delete(e.uid),0===t.graphics.size&&t.task.abort()}_removeFromSource(e,t){const r=t.uid;e.featureStore.has(r)&&e.featureStore.removeById(t.uid)}_destroySource(e){e.queryEngine.destroy(),this.sources[e.type]=null}_mapSources(e){const{point:t,polygon:r,polyline:s,multipoint:i}=this.sources,a=[];return o(t)&&a.push(e(t)),o(r)&&a.push(e(r)),o(s)&&a.push(e(s)),o(i)&&a.push(e(i)),a}};e([p({constructOnly:!0})],v.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],v.prototype,"layerSource",void 0),e([p({constructOnly:!0})],v.prototype,"view",void 0),e([p({readOnly:!0})],v.prototype,"updating",null),e([p({readOnly:!0})],v.prototype,"availability",void 0),v=e([d("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],v);const k="OBJECTID";export{v as GraphicsSnappingSource};
@@ -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{equals as t}from"../../../../../core/arrayUtils.js";import{AsyncSequence as i}from"../../../../../core/AsyncSequence.js";import{HandleOwner as s}from"../../../../../core/HandleOwner.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import o from"../../../../../core/Logger.js";import{isSome as n,isNone as a,unwrap as l}from"../../../../../core/maybe.js";import{createTask as u,throwIfAbortError as c}from"../../../../../core/promiseUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import p from"../../../../../geometry/Extent.js";import{toExtent as f}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as y,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeatureSetParserContext as m}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as _,executeQueryPBF as F,executeQuery as b}from"../../../../../rest/query/operations/query.js";import T from"../../../../../rest/support/Query.js";import{StateType as v,PendingFeatureTile as P}from"./PendingFeatureTile.js";import{WatchFlags as I}from"../../../../support/WatchUpdatingTracking.js";const S=o.getLogger("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher");let O=class extends s{constructor(e){super(e),this.tilesOfInterest=[],this.availability=0,this.pendingTiles=new Map,this.pendingEdits=new i,this.pendingEditsAbortController=new AbortController}get minimumVerticesPerFeature(){var e;switch(null==(e=this.store)?void 0:e.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(n(e)&&n(t)&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingHandles.updating||this.pendingEdits.updating}initialize(){this._initializeFetchExtent(),this.updatingHandles.add(this,"configuration",(()=>this.refresh())),this.updatingHandles.add(this,"tilesOfInterest",((e,i)=>{t(e,i,(({id:e},{id:t})=>e===t))||this._process()}),I.SYNC)}destroy(){this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this.pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this.pendingEditsAbortController.abort(),this.pendingEditsAbortController=null}refresh(){this.store.refresh(),this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this.pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,i]of this.pendingTiles)i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this.updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this.pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent)return;const e=u((async e=>{try{var t;const i=await _(this.url,new T({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this.configuration.customParameters,signal:e});this.store.extent=p.fromJSON(null==(t=i.data)?void 0:t.extent)}catch(i){c(i),S.warn("Failed to fetch data extent",i)}}));this.updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.handles.add(r((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this.pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this.pendingTiles)e.alive=!1}_createPendingTiles(){const e=this._collectMissingTilesInfo();if(this._setAvailability(a(e)?1:e.coveredArea/e.fullArea),!a(e))for(const{data:t,resolution:i}of e.missingTiles){const e=this.pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const i=this.tilesOfInterest[t],s=this.store.process(i,((e,t)=>this._verifyTileComplexity(e,t)));a(e)?e=s:e.prepend(s)}return e}_deletePendingTiles(){for(const[,e]of this.pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this.pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this.updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this.minimumVerticesPerFeature<x}_verifyFeatureDensity(e,t){if(a(this.tileInfo))return!1;const i=this.tileSize*t;return e*(E/(i*i))<w}_ensureFetchAllCounts(e){let t=!0;for(const[,i]of this.pendingTiles)i.state.type<v.FETCHED_COUNT&&this.updatingHandles.addPromise(i.process(e)),i.state.type<=v.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(a(e)?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new P(e,t);return this.pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this.pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:j,signal:t})}async _fetchFeatures(e,t,i){let s,r=0,o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),u=this._setPagingParameters(a,r,n),{features:c,exceededTransferLimit:d}=await this._queryFeatures(a,i);if(u&&(r+=l(a.num)),o+=c.length,s=s?s.concat(c):c,n=t-o,!u||!d||n<=0)return s}}_filterProperties(e){return a(e)?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(a(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.store.featureStore.forEach((r=>{var o;e===r.attributes[t]&&(s=null!=(o=r.objectId)?o:r.attributes[i])})),a(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery(null);return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await F(this.url,e,new m({sourceSpatialReference:i}),{query:this.configuration.customParameters,timeout:j,signal:t});return y(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await b(this.url,e,i,{query:this.configuration.customParameters,timeout:j,signal:t});return g(s,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e){const t=this._createBaseQuery(e);return t.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],t.returnGeometry=!0,n(e)&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new T({returnZ:!1,returnM:!1,geometry:n(this.tileInfo)&&n(e)?f(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this.configuration.filter;return n(i)&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?T.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||C);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([d({constructOnly:!0})],O.prototype,"url",void 0),e([d({constructOnly:!0})],O.prototype,"objectIdField",void 0),e([d({constructOnly:!0})],O.prototype,"globalIdField",void 0),e([d({constructOnly:!0})],O.prototype,"capabilities",void 0),e([d({constructOnly:!0})],O.prototype,"sourceSpatialReference",void 0),e([d({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([d({constructOnly:!0})],O.prototype,"store",void 0),e([d({readOnly:!0})],O.prototype,"minimumVerticesPerFeature",null),e([d()],O.prototype,"filter",null),e([d()],O.prototype,"customParameters",null),e([d({readOnly:!0})],O.prototype,"configuration",null),e([d()],O.prototype,"tileInfo",null),e([d()],O.prototype,"tileSize",null),e([d()],O.prototype,"tilesOfInterest",void 0),e([d({readOnly:!0})],O.prototype,"updating",null),e([d({readOnly:!0})],O.prototype,"availability",void 0),O=e([h("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],O);const C=2e3,j=6e5,x=1e6,E=25,w=1;export{O as FeatureServiceTiledFetcher};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{equals as t}from"../../../../../core/arrayUtils.js";import{AsyncSequence as i}from"../../../../../core/AsyncSequence.js";import{HandleOwner as s}from"../../../../../core/HandleOwner.js";import{makeHandle as r}from"../../../../../core/handleUtils.js";import o from"../../../../../core/Logger.js";import{isSome as n,isNone as a,unwrap as l}from"../../../../../core/maybe.js";import{createTask as u,throwIfAbortError as c}from"../../../../../core/promiseUtils.js";import{sync as d}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import f from"../../../../../geometry/Extent.js";import{toExtent as y}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as g,convertFromFeatureSet as m}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeatureSetParserContext as _}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as F,executeQueryPBF as b,executeQuery as T}from"../../../../../rest/query/operations/query.js";import v from"../../../../../rest/support/Query.js";import{StateType as P,PendingFeatureTile as I}from"./PendingFeatureTile.js";const O=o.getLogger("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher");let S=class extends s{constructor(e){super(e),this.tilesOfInterest=[],this.availability=0,this.pendingTiles=new Map,this.pendingEdits=new i,this.pendingEditsAbortController=new AbortController}get minimumVerticesPerFeature(){var e;switch(null==(e=this.store)?void 0:e.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(n(e)&&n(t)&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingHandles.updating||this.pendingEdits.updating}initialize(){this._initializeFetchExtent(),this.updatingHandles.add((()=>this.configuration),(()=>this.refresh())),this.updatingHandles.add((()=>this.tilesOfInterest),((e,i)=>{t(e,i,(({id:e},{id:t})=>e===t))||this._process()}),d)}destroy(){this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this.pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this.pendingEditsAbortController.abort(),this.pendingEditsAbortController=null}refresh(){this.store.refresh(),this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this.pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,i]of this.pendingTiles)i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this.updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this.pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent)return;const e=u((async e=>{try{var t;const i=await F(this.url,new v({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this.configuration.customParameters,signal:e});this.store.extent=f.fromJSON(null==(t=i.data)?void 0:t.extent)}catch(i){c(i),O.warn("Failed to fetch data extent",i)}}));this.updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.handles.add(r((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this.pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this.pendingTiles)e.alive=!1}_createPendingTiles(){const e=this._collectMissingTilesInfo();if(this._setAvailability(a(e)?1:e.coveredArea/e.fullArea),!a(e))for(const{data:t,resolution:i}of e.missingTiles){const e=this.pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const i=this.tilesOfInterest[t],s=this.store.process(i,((e,t)=>this._verifyTileComplexity(e,t)));a(e)?e=s:e.prepend(s)}return e}_deletePendingTiles(){for(const[,e]of this.pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this.pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this.updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this.minimumVerticesPerFeature<x}_verifyFeatureDensity(e,t){if(a(this.tileInfo))return!1;const i=this.tileSize*t;return e*(E/(i*i))<w}_ensureFetchAllCounts(e){let t=!0;for(const[,i]of this.pendingTiles)i.state.type<P.FETCHED_COUNT&&this.updatingHandles.addPromise(i.process(e)),i.state.type<=P.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(a(e)?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new I(e,t);return this.pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this.pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:j,signal:t})}async _fetchFeatures(e,t,i){let s,r=0,o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),u=this._setPagingParameters(a,r,n),{features:c,exceededTransferLimit:d}=await this._queryFeatures(a,i);if(u&&(r+=l(a.num)),o+=c.length,s=s?s.concat(c):c,n=t-o,!u||!d||n<=0)return s}}_filterProperties(e){return a(e)?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(a(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.store.featureStore.forEach((r=>{var o;e===r.attributes[t]&&(s=null!=(o=r.objectId)?o:r.attributes[i])})),a(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery(null);return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await b(this.url,e,new _({sourceSpatialReference:i}),{query:this.configuration.customParameters,timeout:j,signal:t});return g(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await T(this.url,e,i,{query:this.configuration.customParameters,timeout:j,signal:t});return m(s,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e){const t=this._createBaseQuery(e);return t.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],t.returnGeometry=!0,n(e)&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new v({returnZ:!1,returnM:!1,geometry:n(this.tileInfo)&&n(e)?y(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this.configuration.filter;return n(i)&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?v.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||C);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"minimumVerticesPerFeature",null),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const C=2e3,j=6e5,x=1e6,E=25,w=1;export{S as FeatureServiceTiledFetcher};
@@ -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 r from"../../core/Error.js";import{isSome as i,isNone as o}from"../../core/maybe.js";import{property as s}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{combinedViewLayerTimeExtentProperty as n}from"../../layers/support/commonProperties.js";import{getDefaultDatumTransformationForDataset as l,projectExtent as u}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as p}from"./support/popupUtils.js";const m=m=>{let f=class extends m{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.fullExtent=null,this.tileInfo=null,this.datumTransformation=null}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}async fetchPopupFeatures(e,o){const{layer:s}=this;if(!e)return Promise.reject(new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s}));const{popupEnabled:a}=s,n=p(s,o);if(!a||!i(n))throw new r("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:n});const l=[],{value:u,magdirValue:m}=await s.identify(e,{timeExtent:this.timeExtent});let f="";if(u&&u.length){var c,h;f="imagery-tile"===s.type&&s.hasStandardTime()&&null!=u[0]?u.map((e=>s.getStandardTimeValue(e))).join(", "):u.join(", ");const e={ObjectId:0},r="Raster.ServicePixelValue";e[r]=this._formatAttributeValue(f,r);const i=null==(c=s.rasterInfo)||null==(h=c.attributeTable)?void 0:h.features;if(i&&i.length>0){const t=i.filter((e=>{const t=e.attributes.value||e.attributes.Value||e.attributes.VALUE;return String(t)===f}));if(t.length>0){const r=t[0];if(r)for(const t in r.attributes)if(r.attributes.hasOwnProperty(t)){const i=this._rasterFieldPrefix+t;e[i]=this._formatAttributeValue(r.attributes[t],i)}}}const o=s.rasterInfo.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(e["Raster.Magnitude"]=null==m?void 0:m[0],e["Raster.Direction"]=null==m?void 0:m[1]);const a=new t(this.fullExtent.clone(),null,e);a.layer=s,a.sourceLayer=a.layer,l.push(a)}return l}updateFullExtent(){const e=this.layer.tileInfo;if(!(e&&e.spatialReference))return Promise.reject(new r("layerview:tiling-information-missing","The layer doesn't provide tiling information",{layer:this.layer}));if(o(this.layer.fullExtent))return Promise.reject(new r("layerview:extent-missing","The layer doesn't provide a full extent.",{layer:this.layer}));const t=l(this.layer.fullExtent,this.view.spatialReference,!1),i=u(this.layer.fullExtent,this.view.spatialReference,t);return null==i?Promise.reject(new r("layerview:projection-not-supported","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})):(this._set("fullExtent",i),this.datumTransformation||(this.datumTransformation=l(this.layer.fullExtent,this.view.spatialReference,!0)),Promise.resolve())}_formatAttributeValue(e,t){if("string"==typeof e){const r=this.layer.popupTemplate&&this.layer.popupTemplate.fieldInfos,i=this._getFieldInfo(r,t),o=i&&i.format;if(o){let t,r;return e.trim().indexOf(",")>-1?(t=",",r=t+" ",this._formatDelimitedString(e,t,r,o)):e.trim().indexOf(" ")>-1?(t=r=" ",this._formatDelimitedString(e,t,r,o)):this._formatNumberFromString(e,o)}}return e}_getFieldInfo(e,t){if(!e||!e.length||!t)return;const r=t.toLowerCase();let i;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==r&&e.fieldName.toLowerCase()!==r.replace(/ /g,"_"))&&(i=e,!0))),i}_formatDelimitedString(e,t,r,i){return e&&t&&r&&i?e.trim().split(t).map((e=>this._formatNumberFromString(e,i))).join(r):e}_formatNumberFromString(e,t){if(!e||!t)return e;const r=Number(e);return isNaN(r)?e:t.format(r)}};return e([s()],f.prototype,"layer",void 0),e([s(n)],f.prototype,"timeExtent",void 0),e([s()],f.prototype,"view",void 0),e([s()],f.prototype,"fullExtent",void 0),e([s()],f.prototype,"tileInfo",void 0),e([s({readOnly:!0})],f.prototype,"hasTilingEffects",null),f=e([a("esri.views.layers.ImageryTileLayerView")],f),f};export{m as ImageryTileLayerView,m as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{unwrap as i,isSome as o}from"../../core/maybe.js";import{property as s}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{combinedViewLayerTimeExtentProperty as n}from"../../layers/support/commonProperties.js";import{getDefaultDatumTransformationForDataset as l,projectExtent as u}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as p}from"./support/popupUtils.js";const m=m=>{let f=class extends m{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return l(i(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(e){return!!this.projectFullExtent(e)}projectFullExtent(e){const t=i(this.layer.fullExtent),r=l(t,e,!1);return u(t,e,r)}async fetchPopupFeatures(e,i){const{layer:s}=this;if(!e)return Promise.reject(new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s}));const{popupEnabled:a}=s,n=p(s,i);if(!a||!o(n))throw new r("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:n});const l=[],{value:u,magdirValue:m}=await s.identify(e,{timeExtent:this.timeExtent});let f="";if(u&&u.length){var c,d;f="imagery-tile"===s.type&&s.hasStandardTime()&&null!=u[0]?u.map((e=>s.getStandardTimeValue(e))).join(", "):u.join(", ");const e={ObjectId:0},r="Raster.ServicePixelValue";e[r]=this._formatAttributeValue(f,r);const i=null==(c=s.rasterInfo)||null==(d=c.attributeTable)?void 0:d.features;if(i&&i.length>0){const t=i.filter((e=>{const t=e.attributes.value||e.attributes.Value||e.attributes.VALUE;return String(t)===f}));if(t.length>0){const r=t[0];if(r)for(const t in r.attributes)if(r.attributes.hasOwnProperty(t)){const i=this._rasterFieldPrefix+t;e[i]=this._formatAttributeValue(r.attributes[t],i)}}}const o=s.rasterInfo.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(e["Raster.Magnitude"]=null==m?void 0:m[0],e["Raster.Direction"]=null==m?void 0:m[1]);const a=new t(this.fullExtent.clone(),null,e);a.layer=s,a.sourceLayer=a.layer,l.push(a)}return l}_formatAttributeValue(e,t){if("string"==typeof e){const r=this.layer.popupTemplate&&this.layer.popupTemplate.fieldInfos,i=this._getFieldInfo(r,t),o=i&&i.format;if(o){let t,r;return e.trim().indexOf(",")>-1?(t=",",r=t+" ",this._formatDelimitedString(e,t,r,o)):e.trim().indexOf(" ")>-1?(t=r=" ",this._formatDelimitedString(e,t,r,o)):this._formatNumberFromString(e,o)}}return e}_getFieldInfo(e,t){if(!e||!e.length||!t)return;const r=t.toLowerCase();let i;return e.some((e=>!(!e.fieldName||e.fieldName.toLowerCase()!==r&&e.fieldName.toLowerCase()!==r.replace(/ /g,"_"))&&(i=e,!0))),i}_formatDelimitedString(e,t,r,i){return e&&t&&r&&i?e.trim().split(t).map((e=>this._formatNumberFromString(e,i))).join(r):e}_formatNumberFromString(e,t){if(!e||!t)return e;const r=Number(e);return isNaN(r)?e:t.format(r)}};return e([s()],f.prototype,"layer",void 0),e([s(n)],f.prototype,"timeExtent",void 0),e([s()],f.prototype,"view",void 0),e([s()],f.prototype,"fullExtent",null),e([s()],f.prototype,"tileInfo",void 0),e([s({readOnly:!0})],f.prototype,"hasTilingEffects",null),f=e([a("esri.views.layers.ImageryTileLayerView")],f),f};export{m as ImageryTileLayerView,m as default};